You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
hy-screen-2.0/docs/assets/index-c9e6302b-178266155265...

4525 lines
2.3 MiB

var cY=Object.defineProperty,hY=Object.defineProperties;var fY=Object.getOwnPropertyDescriptors;var vy=Object.getOwnPropertySymbols;var nD=Object.prototype.hasOwnProperty,rD=Object.prototype.propertyIsEnumerable;var dw=(n,e)=>{if(e=Symbol[n])return e;throw Error("Symbol."+n+" is not defined")},eu=Math.pow,pw=(n,e,t)=>e in n?cY(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Le=(n,e)=>{for(var t in e||(e={}))nD.call(e,t)&&pw(n,t,e[t]);if(vy)for(var t of vy(e))rD.call(e,t)&&pw(n,t,e[t]);return n},Ve=(n,e)=>hY(n,fY(e));var iD=(n,e)=>{var t={};for(var r in n)nD.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&vy)for(var r of vy(n))e.indexOf(r)<0&&rD.call(n,r)&&(t[r]=n[r]);return t};var Kt=(n,e,t)=>(pw(n,typeof e!="symbol"?e+"":e,t),t);var $e=(n,e,t)=>new Promise((r,i)=>{var a=l=>{try{o(t.next(l))}catch(u){i(u)}},s=l=>{try{o(t.throw(l))}catch(u){i(u)}},o=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);o((t=t.apply(n,e)).next())}),dY=function(n,e){this[0]=n,this[1]=e};var aD=n=>{var e=n[dw("asyncIterator")],t=!1,r,i={};return e==null?(e=n[dw("iterator")](),r=a=>i[a]=s=>e[a](s)):(e=e.call(n),r=a=>i[a]=s=>{if(t){if(t=!1,a==="throw")throw s;return s}return t=!0,{done:!1,value:new dY(new Promise(o=>{var l=e[a](s);if(!(l instanceof Object))throw TypeError("Object expected");o(l)}),1)}}),i[dw("iterator")]=()=>i,r("next"),"throw"in e?r("throw"):i.throw=a=>{throw a},"return"in e&&r("return"),i};import{_ as zb,o as Z,c as ne,a as E,t as ie,r as dp,b as Ue,d as Be,w as ei,p as sD,i as kd,n as Ct,u as dn,e as he,f as ns,g as mt,h as pY,j as EG,k as oD,l as Ia,m as lD,s as Cg,q as vY,v as Ya,x as gY,y as Fh,z as pn,A as uD,F as et,B as ut,C as wi,D as jn,E as Mt,G as Hr,H as xh,I as Kd,J as da,K as Nv,L as mY,M as yY,N as tu,O as _Y}from"./index-1782661552655.js";const ax=""+new URL("bottom-menu-arrow-big-180b7071-balabala-1782661552655.svg",import.meta.url).href,sx=""+new URL("bottom-menu-arrow-small-19304179-balabala-1782661552655.svg",import.meta.url).href;/**
* @name: autofit.js
* @author: Larry Zhu
* @version: 3.2.8
* @description: autofit.js 是迄今为止最易用的自适应工具
* @license: MIT
*/let vw=null,Mm="",tT="",nT="",gw=null,cD=null,_i=1,Zd=!1;const Ub={isAutofitRunning:!1,init(n={},e=!0){e&&console.log("autofit.js is running");const{dw:t=1920,dh:r=1080,el:i=typeof n=="string"?n:"body",resize:a=!0,ignore:s=[],transition:o="none",delay:l=0,limit:u=.1,cssMode:c="scale",allowScroll:h=!1}=n;vw=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=`${r}px`,f.style.width=`${t}px`,f.style.transformOrigin="0 0",!h&&(f.style.overflow="hidden"),mw(t,r,f,s,u,c),gw=()=>{clearTimeout(cD),l!=0?cD=setTimeout(()=>{mw(t,r,f,s,u,c),Zd&&rT(Mm,nT,tT)},l):(mw(t,r,f,s,u,c),Zd&&rT(Mm,nT,tT))},a&&window.addEventListener("resize",gw),this.isAutofitRunning=!0,setTimeout(()=>{f.style.transition=`${o}s`})},off(n="body"){try{window.removeEventListener("resize",gw);const e=document.querySelector("#autofit-style");e&&e.remove();const t=document.querySelector("#ignoreStyle");t&&t.remove();const r=document.querySelector(vw||n);r&&(r.style.cssText=""),Zd&&PG()}catch(e){console.error("autofit: Failed to remove normally",e)}this.isAutofitRunning=!1,console.log("autofit.js is off")},elRectification:null,scale:_i};function rT(n,e=!0,t=1){if(!Ub.isAutofitRunning){console.error("autofit.js:(elRectification): autofit has not been initialized yet");return}PG(),!n&&console.error(`autofit.js:elRectification bad selector: ${n}`),Mm=n,tT=t,nT=e;const r=Array.from(document.querySelectorAll(n));if(r.length==0){console.error(`autofit.js:elRectification found no element by selector: "${n}"`);return}for(const i of r){const a=_i==1?1:Number(_i)*Number(t);Zd||(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(_i)})`,i.style.transformOrigin="0 0"}Zd=!0}function PG(){if(Mm){Zd=!1;for(const n of Array.from(document.querySelectorAll(Mm)))n.style.width="",n.style.height="",n.style.transform=""}}function mw(n,e,t,r,i,a="scale"){const s=document.documentElement.clientHeight,o=document.documentElement.clientWidth;_i=o/s<n/e?o/n:s/e,_i=Math.abs(1-_i)>i?_i:1,Ub.scale=+_i;const l=Math.round(s/Number(_i)),u=Math.round(o/Number(_i));t.style.height=`${l}px`,t.style.width=`${u}px`,a==="zoom"?t.style.zoom=`${_i}`:t.style.transform=`translateZ(0) scale(${_i})`;const c=document.querySelector("#ignoreStyle");c.innerHTML="";for(const h of r){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(_i),g=p!=_i&&f.fontSize,v=p!=_i&&f.width,m=p!=_i&&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;
}`)}}Ub.elRectification=rT;function Sl(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function LG(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__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 Ka={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},pp={duration:.5,overwrite:!1,delay:0},qE,Ai,hr,Ps=1e8,Qn=1/Ps,iT=Math.PI*2,xY=iT/4,bY=0,RG=Math.sqrt,SY=Math.cos,wY=Math.sin,vi=function(e){return typeof e=="string"},Tr=function(e){return typeof e=="function"},Ol=function(e){return typeof e=="number"},XE=function(e){return typeof e=="undefined"},Xo=function(e){return typeof e=="object"},Sa=function(e){return e!==!1},YE=function(){return typeof window!="undefined"},gy=function(e){return Tr(e)||vi(e)},DG=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Vi=Array.isArray,AY=/random\([^)]+\)/g,MY=/,\s*/g,hD=/(?:-?\.?\d|\.)+/gi,IG=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Od=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,yw=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,NG=/[+-]=-?[.\d]+/,TY=/[^,'"\[\]\s]+/gi,CY=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,mr,Eo,aT,KE,es={},ox={},kG,OG=function(e){return(ox=vp(e,es))&&Ea},ZE=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},Tm=function(e,t){return!t&&console.warn(e)},FG=function(e,t){return e&&(es[e]=t)&&ox&&(ox[e]=t)||es},Cm=function(){return 0},EY={suppressEvents:!0,isStart:!0,kill:!1},w1={suppressEvents:!0,kill:!1},PY={suppressEvents:!0},QE={},Yu=[],sT={},BG,Ua={},_w={},fD=30,A1=[],JE="",eP=function(e){var t=e[0],r,i;if(Xo(t)||Tr(t)||(e=[e]),!(r=(t._gsap||{}).harness)){for(i=A1.length;i--&&!A1[i].targetTest(t););r=A1[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new lz(e[i],r)))||e.splice(i,1);return e},Bh=function(e){return e._gsap||eP(Ls(e))[0]._gsap},GG=function(e,t,r){return(r=e[t])&&Tr(r)?e[t]():XE(r)&&e.getAttribute&&e.getAttribute(t)||r},wa=function(e,t){return(e=e.split(",")).forEach(t)||e},Dr=function(e){return Math.round(e*1e5)/1e5||0},vr=function(e){return Math.round(e*1e7)/1e7||0},Qd=function(e,t){var r=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),r==="+"?e+i:r==="-"?e-i:r==="*"?e*i:e/i},LY=function(e,t){for(var r=t.length,i=0;e.indexOf(t[i])<0&&++i<r;);return i<r},lx=function(){var e=Yu.length,t=Yu.slice(0),r,i;for(sT={},Yu.length=0,r=0;r<e;r++)i=t[r],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},tP=function(e){return!!(e._initted||e._startAt||e.add)},zG=function(e,t,r,i){Yu.length&&!Ai&&lx(),e.render(t,r,i||!!(Ai&&t<0&&tP(e))),Yu.length&&!Ai&&lx()},UG=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(TY).length<2?t:vi(e)?e.trim():e},VG=function(e){return e},ts=function(e,t){for(var r in t)r in e||(e[r]=t[r]);return e},RY=function(e){return function(t,r){for(var i in r)i in t||i==="duration"&&e||i==="ease"||(t[i]=r[i])}},vp=function(e,t){for(var r in t)e[r]=t[r];return e},dD=function n(e,t){for(var r in t)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=Xo(t[r])?n(e[r]||(e[r]={}),t[r]):t[r]);return e},ux=function(e,t){var r={},i;for(i in e)i in t||(r[i]=e[i]);return r},Xg=function(e){var t=e.parent||mr,r=e.keyframes?RY(Vi(e.keyframes)):ts;if(Sa(e.inherit))for(;t;)r(e,t.vars.defaults),t=t.parent||t._dp;return e},DY=function(e,t){for(var r=e.length,i=r===t.length;i&&r--&&e[r]===t[r];);return r<0},HG=function(e,t,r,i,a){r===void 0&&(r="_first"),i===void 0&&(i="_last");var s=e[i],o;if(a)for(o=t[a];s&&s[a]>o;)s=s._prev;return s?(t._next=s._next,s._next=t):(t._next=e[r],e[r]=t),t._next?t._next._prev=t:e[i]=t,t._prev=s,t.parent=t._dp=e,t},Vb=function(e,t,r,i){r===void 0&&(r="_first"),i===void 0&&(i="_last");var a=t._prev,s=t._next;a?a._next=s:e[r]===t&&(e[r]=s),s?s._prev=a:e[i]===t&&(e[i]=a),t._next=t._prev=t.parent=null},ac=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Gh=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},IY=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},oT=function(e,t,r,i){return e._startAt&&(Ai?e._startAt.revert(w1):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},NY=function n(e){return!e||e._ts&&n(e.parent)},pD=function(e){return e._repeat?gp(e._tTime,e=e.duration()+e._rDelay)*e:0},gp=function(e,t){var r=Math.floor(e=vr(e/t));return e&&r===e?r-1:r},cx=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Hb=function(e){return e._end=vr(e._start+(e._tDur/Math.abs(e._ts||e._rts||Qn)||0))},Wb=function(e,t){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=vr(r._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Hb(e),r._dirty||Gh(r,e)),e},WG=function(e,t){var r;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(r=cx(e.rawTime(),t),(!t._dur||E0(0,t.totalDuration(),r)-t._tTime>Qn)&&t.render(r,!0)),Gh(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-Qn}},Do=function(e,t,r,i){return t.parent&&ac(t),t._start=vr((Ol(r)?r:r||e!==mr?hs(e,r,t):e._time)+t._delay),t._end=vr(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),HG(e,t,"_first","_last",e._sort?"_start":0),lT(t)||(e._recent=t),i||WG(e,t),e._ts<0&&Wb(e,e._tTime),e},$G=function(e,t){return(es.ScrollTrigger||ZE("scrollTrigger",t))&&es.ScrollTrigger.create(t,e)},jG=function(e,t,r,i,a){if(rP(e,t,a),!e._initted)return 1;if(!r&&e._pt&&!Ai&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&BG!==Ha.frame)return Yu.push(e),e._lazy=[a,i],1},kY=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},lT=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},OY=function(e,t,r,i){var a=e.ratio,s=t<0||!t&&(!e._start&&kY(e)&&!(!e._initted&&lT(e))||(e._ts<0||e._dp._ts<0)&&!lT(e))?0:1,o=e._rDelay,l=0,u,c,h;if(o&&e._repeat&&(l=E0(0,e._tDur,t),c=gp(l,o),e._yoyo&&c&1&&(s=1-s),c!==gp(e._tTime,o)&&(a=1-s,e.vars.repeatRefresh&&e._initted&&e.invalidate())),s!==a||Ai||i||e._zTime===Qn||!t&&e._zTime){if(!e._initted&&jG(e,t,i,r,l))return;for(h=e._zTime,e._zTime=t||(r?Qn:0),r||(r=t&&!h),e.ratio=s,e._from&&(s=1-s),e._time=0,e._tTime=l,u=e._pt;u;)u.r(s,u.d),u=u._next;t<0&&oT(e,t,r,!0),e._onUpdate&&!r&&ja(e,"onUpdate"),l&&e._repeat&&!r&&e.parent&&ja(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===s&&(s&&ac(e,1),!r&&!Ai&&(ja(e,s?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},FY=function(e,t,r){var i;if(r>t)for(i=e._first;i&&i._start<=r;){if(i.data==="isPause"&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=r;){if(i.data==="isPause"&&i._start<t)return i;i=i._prev}},mp=function(e,t,r,i){var a=e._repeat,s=vr(t)||0,o=e._tTime/e._tDur;return o&&!i&&(e._time*=s/e._dur),e._dur=s,e._tDur=a?a<0?1e10:vr(s*(a+1)+e._rDelay*a):s,o>0&&!i&&Wb(e,e._tTime=e._tDur*o),e.parent&&Hb(e),r||Gh(e.parent,e),e},vD=function(e){return e instanceof na?Gh(e):mp(e,e._dur)},BY={_start:0,endTime:Cm,totalDuration:Cm},hs=function n(e,t,r){var i=e.labels,a=e._recent||BY,s=e.duration()>=Ps?a.endTime(!1):e._dur,o,l,u;return vi(t)&&(isNaN(t)||t in i)?(l=t.charAt(0),u=t.substr(-1)==="%",o=t.indexOf("="),l==="<"||l===">"?(o>=0&&(t=t.replace(/=/,"")),(l==="<"?a._start:a.endTime(a._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(o<0?a:r).totalDuration()/100:1)):o<0?(t in i||(i[t]=s),i[t]):(l=parseFloat(t.charAt(o-1)+t.substr(o+1)),u&&r&&(l=l/100*(Vi(r)?r[0]:r).totalDuration()),o>1?n(e,t.substr(0,o-1),r)+l:s+l)):t==null?s:+t},Yg=function(e,t,r){var i=Ol(t[1]),a=(i?2:1)+(e<2?0:1),s=t[a],o,l;if(i&&(s.duration=t[1]),s.parent=r,e){for(o=s,l=r;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=Sa(l.vars.inherit)&&l.parent;s.immediateRender=Sa(o.immediateRender),e<2?s.runBackwards=1:s.startAt=t[a-1]}return new $r(t[0],s,t[a+1])},xc=function(e,t){return e||e===0?t(e):t},E0=function(e,t,r){return r<e?e:r>t?t:r},zi=function(e,t){return!vi(e)||!(t=CY.exec(e))?"":t[1]},GY=function(e,t,r){return xc(r,function(i){return E0(e,t,i)})},uT=[].slice,qG=function(e,t){return e&&Xo(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Xo(e[0]))&&!e.nodeType&&e!==Eo},zY=function(e,t,r){return r===void 0&&(r=[]),e.forEach(function(i){var a;return vi(i)&&!t||qG(i,1)?(a=r).push.apply(a,Ls(i)):r.push(i)})||r},Ls=function(e,t,r){return hr&&!t&&hr.selector?hr.selector(e):vi(e)&&!r&&(aT||!yp())?uT.call((t||KE).querySelectorAll(e),0):Vi(e)?zY(e,r):qG(e)?uT.call(e,0):e?[e]:[]},cT=function(e){return e=Ls(e)[0]||Tm("Invalid scope")||{},function(t){var r=e.current||e.nativeElement||e;return Ls(t,r.querySelectorAll?r:r===e?Tm("Invalid scope")||KE.createElement("div"):e)}},XG=function(e){return e.sort(function(){return .5-Math.random()})},YG=function(e){if(Tr(e))return e;var t=Xo(e)?e:{each:e},r=zh(t.ease),i=t.from||0,a=parseFloat(t.base)||0,s={},o=i>0&&i<1,l=isNaN(i)||o,u=t.axis,c=i,h=i;return vi(i)?c=h={center:.5,edges:.5,end:1}[i]||0:!o&&l&&(c=i[0],h=i[1]),function(f,d,p){var g=(p||t).length,v=s[g],m,y,_,x,b,S,w,T,C;if(!v){if(C=t.grid==="auto"?0:(t.grid||[1,Ps])[1],!C){for(w=-Ps;w<(w=p[C++].getBoundingClientRect().left)&&C<g;);C<g&&C--}for(v=s[g]=[],m=l?Math.min(C,g)*c-.5:i%C,y=C===Ps?0:l?g*h/C-.5:i/C|0,w=0,T=Ps,S=0;S<g;S++)_=S%C-m,x=y-(S/C|0),v[S]=b=u?Math.abs(u==="y"?x:_):RG(_*_+x*x),b>w&&(w=b),b<T&&(T=b);i==="random"&&XG(v),v.max=w-T,v.min=T,v.v=g=(parseFloat(t.amount)||parseFloat(t.each)*(C>g?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=zi(t.amount||t.each)||0,r=r&&g<0?az(r):r}return g=(v[f]-v.min)/v.max||0,vr(v.b+(r?r(g):g)*v.v)+v.u}},hT=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var i=vr(Math.round(parseFloat(r)/e)*e*t);return(i-i%1)/t+(Ol(r)?0:zi(r))}},KG=function(e,t){var r=Vi(e),i,a;return!r&&Xo(e)&&(i=r=e.radius||Ps,e.values?(e=Ls(e.values),(a=!Ol(e[0]))&&(i*=i)):e=hT(e.increment)),xc(t,r?Tr(e)?function(s){return a=e(s),Math.abs(a-s)<=i?a:s}:function(s){for(var o=parseFloat(a?s.x:s),l=parseFloat(a?s.y:0),u=Ps,c=0,h=e.length,f,d;h--;)a?(f=e[h].x-o,d=e[h].y-l,f=f*f+d*d):f=Math.abs(e[h]-o),f<u&&(u=f,c=h);return c=!i||u<=i?e[c]:s,a||c===s||Ol(s)?c:c+zi(s)}:hT(e))},ZG=function(e,t,r,i){return xc(Vi(e)?!t:r===!0?!!(r=0):!i,function(){return Vi(e)?e[~~(Math.random()*e.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((e-r/2+Math.random()*(t-e+r*.99))/r)*r*i)/i})},UY=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(i){return t.reduce(function(a,s){return s(a)},i)}},VY=function(e,t){return function(r){return e(parseFloat(r))+(t||zi(r))}},HY=function(e,t,r){return JG(e,t,0,1,r)},QG=function(e,t,r){return xc(r,function(i){return e[~~t(i)]})},WY=function n(e,t,r){var i=t-e;return Vi(e)?QG(e,n(0,e.length),t):xc(r,function(a){return(i+(a-e)%i)%i+e})},$Y=function n(e,t,r){var i=t-e,a=i*2;return Vi(e)?QG(e,n(0,e.length-1),t):xc(r,function(s){return s=(a+(s-e)%a)%a||0,e+(s>i?a-s:s)})},Em=function(e){return e.replace(AY,function(t){var r=t.indexOf("[")+1,i=t.substring(r||7,r?t.indexOf("]"):t.length-1).split(MY);return ZG(r?i:+i[0],r?0:+i[1],+i[2]||1e-5)})},JG=function(e,t,r,i,a){var s=t-e,o=i-r;return xc(a,function(l){return r+((l-e)/s*o||0)})},jY=function n(e,t,r,i){var a=isNaN(e+t)?0:function(d){return(1-d)*e+d*t};if(!a){var s=vi(e),o={},l,u,c,h,f;if(r===!0&&(i=1)&&(r=null),s)e={p:e},t={p:t};else if(Vi(e)&&!Vi(t)){for(c=[],h=e.length,f=h-2,u=1;u<h;u++)c.push(n(e[u-1],e[u]));h--,a=function(p){p*=h;var g=Math.min(f,~~p);return c[g](p-g)},r=t}else i||(e=vp(Vi(e)?[]:{},e));if(!c){for(l in t)nP.call(o,e,l,"get",t[l]);a=function(p){return sP(p,o)||(s?e.p:e)}}}return xc(r,a)},gD=function(e,t,r){var i=e.labels,a=Ps,s,o,l;for(s in i)o=i[s]-t,o<0==!!r&&o&&a>(o=Math.abs(o))&&(l=s,a=o);return l},ja=function(e,t,r){var i=e.vars,a=i[t],s=hr,o=e._ctx,l,u,c;if(a)return l=i[t+"Params"],u=i.callbackScope||e,r&&Yu.length&&lx(),o&&(hr=o),c=l?a.apply(u,l):a.call(u),hr=s,c},Eg=function(e){return ac(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Ai),e.progress()<1&&ja(e,"onInterrupt"),e},Fd,ez=[],tz=function(e){if(e)if(e=!e.name&&e.default||e,YE()||e.headless){var t=e.name,r=Tr(e),i=t&&!r&&e.init?function(){this._props=[]}:e,a={init:Cm,render:sP,add:nP,kill:lK,modifier:oK,rawVars:0},s={targetTest:0,get:0,getSetter:aP,aliases:{},register:0};if(yp(),e!==i){if(Ua[t])return;ts(i,ts(ux(e,a),s)),vp(i.prototype,vp(a,ux(e,s))),Ua[i.prop=t]=i,e.targetTest&&(A1.push(i),QE[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}FG(t,i),e.register&&e.register(Ea,i,Aa)}else ez.push(e)},Kn=255,Pg={aqua:[0,Kn,Kn],lime:[0,Kn,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Kn],navy:[0,0,128],white:[Kn,Kn,Kn],olive:[128,128,0],yellow:[Kn,Kn,0],orange:[Kn,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Kn,0,0],pink:[Kn,192,203],cyan:[0,Kn,Kn],transparent:[Kn,Kn,Kn,0]},xw=function(e,t,r){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(r-t)*e*6:e<.5?r:e*3<2?t+(r-t)*(2/3-e)*6:t)*Kn+.5|0},nz=function(e,t,r){var i=e?Ol(e)?[e>>16,e>>8&Kn,e&Kn]:0:Pg.black,a,s,o,l,u,c,h,f,d,p;if(!i){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Pg[e])i=Pg[e];else if(e.charAt(0)==="#"){if(e.length<6&&(a=e.charAt(1),s=e.charAt(2),o=e.charAt(3),e="#"+a+a+s+s+o+o+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return i=parseInt(e.substr(1,6),16),[i>>16,i>>8&Kn,i&Kn,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),i=[e>>16,e>>8&Kn,e&Kn]}else if(e.substr(0,3)==="hsl"){if(i=p=e.match(hD),!t)l=+i[0]%360/360,u=+i[1]/100,c=+i[2]/100,s=c<=.5?c*(u+1):c+u-c*u,a=c*2-s,i.length>3&&(i[3]*=1),i[0]=xw(l+1/3,a,s),i[1]=xw(l,a,s),i[2]=xw(l-1/3,a,s);else if(~e.indexOf("="))return i=e.match(IG),r&&i.length<4&&(i[3]=1),i}else i=e.match(hD)||Pg.transparent;i=i.map(Number)}return t&&!p&&(a=i[0]/Kn,s=i[1]/Kn,o=i[2]/Kn,h=Math.max(a,s,o),f=Math.min(a,s,o),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?(s-o)/d+(s<o?6:0):h===s?(o-a)/d+2:(a-s)/d+4,l*=60),i[0]=~~(l+.5),i[1]=~~(u*100+.5),i[2]=~~(c*100+.5)),r&&i.length<4&&(i[3]=1),i},rz=function(e){var t=[],r=[],i=-1;return e.split(Ku).forEach(function(a){var s=a.match(Od)||[];t.push.apply(t,s),r.push(i+=s.length+1)}),t.c=r,t},mD=function(e,t,r){var i="",a=(e+i).match(Ku),s=t?"hsla(":"rgba(",o=0,l,u,c,h;if(!a)return e;if(a=a.map(function(f){return(f=nz(f,t,1))&&s+(t?f[0]+","+f[1]+"%,"+f[2]+"%,"+f[3]:f.join(","))+")"}),r&&(c=rz(e),l=r.c,l.join(i)!==c.c.join(i)))for(u=e.replace(Ku,"1").split(Od),h=u.length-1;o<h;o++)i+=u[o]+(~l.indexOf(o)?a.shift()||s+"0,0,0,0)":(c.length?c:a.length?a:r).shift());if(!u)for(u=e.split(Ku),h=u.length-1;o<h;o++)i+=u[o]+a[o];return i+u[h]},Ku=function(){var n="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Pg)n+="|"+e+"\\b";return new RegExp(n+")","gi")}(),qY=/hsl[a]?\(/,iz=function(e){var t=e.join(" "),r;if(Ku.lastIndex=0,Ku.test(t))return r=qY.test(t),e[1]=mD(e[1],r),e[0]=mD(e[0],r,rz(e[1])),!0},Pm,Ha=function(){var n=Date.now,e=500,t=33,r=n(),i=r,a=1e3/240,s=a,o=[],l,u,c,h,f,d,p=function g(v){var m=n()-i,y=v===!0,_,x,b,S;if((m>e||m<0)&&(r+=m-t),i+=m,b=i-r,_=b-s,(_>0||y)&&(S=++h.frame,f=b-h.time*1e3,h.time=b=b/1e3,s+=_+(_>=a?4:a-_),x=1),y||(l=u(g)),x)for(d=0;d<o.length;d++)o[d](b,f,S,v)};return h={time:0,frame:0,tick:function(){p(!0)},deltaRatio:function(v){return f/(1e3/(v||60))},wake:function(){kG&&(!aT&&YE()&&(Eo=aT=window,KE=Eo.document||{},es.gsap=Ea,(Eo.gsapVersions||(Eo.gsapVersions=[])).push(Ea.version),OG(ox||Eo.GreenSockGlobals||!Eo.gsap&&Eo||{}),ez.forEach(tz)),c=typeof requestAnimationFrame!="undefined"&&requestAnimationFrame,l&&h.sleep(),u=c||function(v){return setTimeout(v,s-h.time*1e3+1|0)},Pm=1,p(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(l),Pm=0,u=Cm},lagSmoothing:function(v,m){e=v||1/0,t=Math.min(m||33,e)},fps:function(v){a=1e3/(v||240),s=h.time*1e3+a},add:function(v,m,y){var _=m?function(x,b,S,w){v(x,b,S,w),h.remove(_)}:v;return h.remove(v),o[y?"unshift":"push"](_),yp(),_},remove:function(v,m){~(m=o.indexOf(v))&&o.splice(m,1)&&d>=m&&d--},_listeners:o},h}(),yp=function(){return!Pm&&Ha.wake()},wn={},XY=/^[\d.\-M][\d.\-,\s]/,YY=/["']/g,KY=function(e){for(var t={},r=e.substr(1,e.length-3).split(":"),i=r[0],a=1,s=r.length,o,l,u;a<s;a++)l=r[a],o=a!==s-1?l.lastIndexOf(","):l.length,u=l.substr(0,o),t[i]=isNaN(u)?u.replace(YY,"").trim():+u,i=l.substr(o+1).trim();return t},ZY=function(e){var t=e.indexOf("(")+1,r=e.indexOf(")"),i=e.indexOf("(",t);return e.substring(t,~i&&i<r?e.indexOf(")",r+1):r)},QY=function(e){var t=(e+"").split("("),r=wn[t[0]];return r&&t.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[KY(t[1])]:ZY(e).split(",").map(UG)):wn._CE&&XY.test(e)?wn._CE("",e):r},az=function(e){return function(t){return 1-e(1-t)}},sz=function n(e,t){for(var r=e._first,i;r;)r instanceof na?n(r,t):r.vars.yoyoEase&&(!r._yoyo||!r._repeat)&&r._yoyo!==t&&(r.timeline?n(r.timeline,t):(i=r._ease,r._ease=r._yEase,r._yEase=i,r._yoyo=t)),r=r._next},zh=function(e,t){return e&&(Tr(e)?e:wn[e]||QY(e))||t},xf=function(e,t,r,i){r===void 0&&(r=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:r,easeInOut:i},s;return wa(e,function(o){wn[o]=es[o]=a,wn[s=o.toLowerCase()]=r;for(var l in a)wn[s+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=wn[o+"."+l]=a[l]}),a},oz=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},bw=function n(e,t,r){var i=t>=1?t:1,a=(r||(e?.3:.45))/(t<1?t:1),s=a/iT*(Math.asin(1/i)||0),o=function(c){return c===1?1:i*Math.pow(2,-10*c)*wY((c-s)*a)+1},l=e==="out"?o:e==="in"?function(u){return 1-o(1-u)}:oz(o);return a=iT/a,l.config=function(u,c){return n(e,u,c)},l},Sw=function n(e,t){t===void 0&&(t=1.70158);var r=function(s){return s?--s*s*((t+1)*s+t)+1:0},i=e==="out"?r:e==="in"?function(a){return 1-r(1-a)}:oz(r);return i.config=function(a){return n(e,a)},i};wa("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;xf(n+",Power"+(t-1),e?function(r){return Math.pow(r,t)}:function(r){return r},function(r){return 1-Math.pow(1-r,t)},function(r){return r<.5?Math.pow(r*2,t)/2:1-Math.pow((1-r)*2,t)/2})});wn.Linear.easeNone=wn.none=wn.Linear.easeIn;xf("Elastic",bw("in"),bw("out"),bw());(function(n,e){var t=1/e,r=2*t,i=2.5*t,a=function(o){return o<t?n*o*o:o<r?n*Math.pow(o-1.5/e,2)+.75:o<i?n*(o-=2.25/e)*o+.9375:n*Math.pow(o-2.625/e,2)+.984375};xf("Bounce",function(s){return 1-a(1-s)},a)})(7.5625,2.75);xf("Expo",function(n){return Math.pow(2,10*(n-1))*n+n*n*n*n*n*n*(1-n)});xf("Circ",function(n){return-(RG(1-n*n)-1)});xf("Sine",function(n){return n===1?1:-SY(n*xY)+1});xf("Back",Sw("in"),Sw("out"),Sw());wn.SteppedEase=wn.steps=es.SteppedEase={config:function(e,t){e===void 0&&(e=1);var r=1/e,i=e+(t?0:1),a=t?1:0,s=1-Qn;return function(o){return((i*E0(0,s,o)|0)+a)*r}}};pp.ease=wn["quad.out"];wa("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(n){return JE+=n+","+n+"Params,"});var lz=function(e,t){this.id=bY++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:GG,this.set=t?t.getSetter:aP},Lm=function(){function n(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,mp(this,+t.duration,1,1),this.data=t.data,hr&&(this._ctx=hr,hr.data.push(this)),Pm||Ha.wake()}var e=n.prototype;return e.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},e.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,mp(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,i){if(yp(),!arguments.length)return this._tTime;var a=this._dp;if(a&&a.smoothChildTiming&&this._ts){for(Wb(this,r),!a._dp||a.parent||WG(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&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Do(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===Qn||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),zG(this,r,i)),this},e.time=function(r,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+pD(this))%(this._dur+this._rDelay)||(r?this._dur:0),i):this._time},e.totalProgress=function(r,i){return arguments.length?this.totalTime(this.totalDuration()*r,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+pD(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,i){var a=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*a,i):this._repeat?gp(this._tTime,a)+1:1},e.timeScale=function(r,i){if(!arguments.length)return this._rts===-Qn?0:this._rts;if(this._rts===r)return this;var a=this.parent&&this._ts?cx(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Qn?0:this._rts,this.totalTime(E0(-Math.abs(this._delay),this.totalDuration(),a),i!==!1),Hb(this),IY(this)},e.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(yp(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Qn&&(this._tTime-=Qn)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=vr(r);var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Do(i,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Sa(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var i=this.parent||this._dp;return i?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?cx(i.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=PY);var i=Ai;return Ai=r,tP(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Ai=i,this},e.globalTime=function(r){for(var i=this,a=arguments.length?r:i.rawTime();i;)a=i._start+a/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(r):a},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,vD(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var i=this._time;return this._rDelay=r,vD(this),i?this.time(i):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,i){return this.totalTime(hs(this,r),Sa(i))},e.restart=function(r,i){return this.play().totalTime(r?-this._delay:0,Sa(i)),this._dur||(this._zTime=-Qn),this},e.play=function(r,i){return r!=null&&this.seek(r,i),this.reversed(!1).paused(!1)},e.reverse=function(r,i){return r!=null&&this.seek(r||this.totalDuration(),i),this.reversed(!0).paused(!1)},e.pause=function(r,i){return r!=null&&this.seek(r,i),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-Qn:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Qn,this},e.isActive=function(){var r=this.parent||this._dp,i=this._start,a;return!!(!r||this._ts&&this._initted&&r.isActive()&&(a=r.rawTime(!0))>=i&&a<this.endTime(!0)-Qn)},e.eventCallback=function(r,i,a){var s=this.vars;return arguments.length>1?(i?(s[r]=i,a&&(s[r+"Params"]=a),r==="onUpdate"&&(this._onUpdate=i)):delete s[r],this):s[r]},e.then=function(r){var i=this,a=i._prom;return new Promise(function(s){var o=Tr(r)?r:VG,l=function(){var c=i.then;i.then=null,a&&a(),Tr(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=c),s(o),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?l():i._prom=l})},e.kill=function(){Eg(this)},n}();ts(Lm.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:-Qn,_prom:0,_ps:!1,_rts:1});var na=function(n){LG(e,n);function e(r,i){var a;return r===void 0&&(r={}),a=n.call(this,r)||this,a.labels={},a.smoothChildTiming=!!r.smoothChildTiming,a.autoRemoveChildren=!!r.autoRemoveChildren,a._sort=Sa(r.sortChildren),mr&&Do(r.parent||mr,Sl(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),r.scrollTrigger&&$G(Sl(a),r.scrollTrigger),a}var t=e.prototype;return t.to=function(i,a,s){return Yg(0,arguments,this),this},t.from=function(i,a,s){return Yg(1,arguments,this),this},t.fromTo=function(i,a,s,o){return Yg(2,arguments,this),this},t.set=function(i,a,s){return a.duration=0,a.parent=this,Xg(a).repeatDelay||(a.repeat=0),a.immediateRender=!!a.immediateRender,new $r(i,a,hs(this,s),1),this},t.call=function(i,a,s){return Do(this,$r.delayedCall(0,i,a),s)},t.staggerTo=function(i,a,s,o,l,u,c){return s.duration=a,s.stagger=s.stagger||o,s.onComplete=u,s.onCompleteParams=c,s.parent=this,new $r(i,s,hs(this,l)),this},t.staggerFrom=function(i,a,s,o,l,u,c){return s.runBackwards=1,Xg(s).immediateRender=Sa(s.immediateRender),this.staggerTo(i,a,s,o,l,u,c)},t.staggerFromTo=function(i,a,s,o,l,u,c,h){return o.startAt=s,Xg(o).immediateRender=Sa(o.immediateRender),this.staggerTo(i,a,o,l,u,c,h)},t.render=function(i,a,s){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,u=this._dur,c=i<=0?0:vr(i),h=this._zTime<0!=i<0&&(this._initted||!u),f,d,p,g,v,m,y,_,x,b,S,w;if(this!==mr&&c>l&&i>=0&&(c=l),c!==this._tTime||s||h){if(o!==this._time&&u&&(c+=this._time-o,i+=this._time-o),f=c,x=this._start,_=this._ts,m=!_,h&&(u||(o=this._zTime),(i||!a)&&(this._zTime=i)),this._repeat){if(S=this._yoyo,v=u+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(v*100+i,a,s);if(f=vr(c%v),c===l?(g=this._repeat,f=u):(b=vr(c/v),g=~~b,g&&g===b&&(f=u,g--),f>u&&(f=u)),b=gp(this._tTime,v),!o&&this._tTime&&b!==g&&this._tTime-b*v-this._dur<=0&&(b=g),S&&g&1&&(f=u-f,w=1),g!==b&&!this._lock){var T=S&&b&1,C=T===(S&&g&1);if(g<b&&(T=!T),o=T?0:c%u?u:c,this._lock=1,this.render(o||(w?0:vr(g*v)),a,!u)._lock=0,this._tTime=c,!a&&this.parent&&ja(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1,b=g),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,l=this._tDur,C&&(this._lock=2,o=T?u:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;sz(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=FY(this,vr(o),vr(f)),y&&(c-=f-(f=y._start))),this._tTime=c,this._time=f,this._act=!_,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,o=0),!o&&c&&u&&!a&&!b&&(ja(this,"onStart"),this._tTime!==c))return this;if(f>=o&&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,s);if(d.render(d._ts>0?(f-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(f-d._start)*d._ts,a,s),f!==this._time||!this._ts&&!m){y=0,p&&(c+=this._zTime=-Qn);break}}d=p}else{d=this._last;for(var A=i<0?i:f;d;){if(p=d._prev,(d._act||A<=d._end)&&d._ts&&y!==d){if(d.parent!==this)return this.render(i,a,s);if(d.render(d._ts>0?(A-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(A-d._start)*d._ts,a,s||Ai&&tP(d)),f!==this._time||!this._ts&&!m){y=0,p&&(c+=this._zTime=A?-Qn:Qn);break}}d=p}}if(y&&!a&&(this.pause(),y.render(f>=o?0:-Qn)._zTime=f>=o?1:-1,this._ts))return this._start=x,Hb(this),this.render(i,a,s);this._onUpdate&&!a&&ja(this,"onUpdate",!0),(c===l&&this._tTime>=this.totalDuration()||!c&&o)&&(x===this._start||Math.abs(_)!==Math.abs(this._ts))&&(this._lock||((i||!u)&&(c===l&&this._ts>0||!c&&this._ts<0)&&ac(this,1),!a&&!(i<0&&!o)&&(c||o||!l)&&(ja(this,c===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<l&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(i,a){var s=this;if(Ol(a)||(a=hs(this,a,i)),!(i instanceof Lm)){if(Vi(i))return i.forEach(function(o){return s.add(o,a)}),this;if(vi(i))return this.addLabel(i,a);if(Tr(i))i=$r.delayedCall(0,i);else return this}return this!==i?Do(this,i,a):this},t.getChildren=function(i,a,s,o){i===void 0&&(i=!0),a===void 0&&(a=!0),s===void 0&&(s=!0),o===void 0&&(o=-Ps);for(var l=[],u=this._first;u;)u._start>=o&&(u instanceof $r?a&&l.push(u):(s&&l.push(u),i&&l.push.apply(l,u.getChildren(!0,a,s)))),u=u._next;return l},t.getById=function(i){for(var a=this.getChildren(1,1,1),s=a.length;s--;)if(a[s].vars.id===i)return a[s]},t.remove=function(i){return vi(i)?this.removeLabel(i):Tr(i)?this.killTweensOf(i):(i.parent===this&&Vb(this,i),i===this._recent&&(this._recent=this._last),Gh(this))},t.totalTime=function(i,a){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=vr(Ha.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),n.prototype.totalTime.call(this,i,a),this._forcing=0,this):this._tTime},t.addLabel=function(i,a){return this.labels[i]=hs(this,a),this},t.removeLabel=function(i){return delete this.labels[i],this},t.addPause=function(i,a,s){var o=$r.delayedCall(0,a||Cm,s);return o.data="isPause",this._hasPause=1,Do(this,o,hs(this,i))},t.removePause=function(i){var a=this._first;for(i=hs(this,i);a;)a._start===i&&a.data==="isPause"&&ac(a),a=a._next},t.killTweensOf=function(i,a,s){for(var o=this.getTweensOf(i,s),l=o.length;l--;)Iu!==o[l]&&o[l].kill(i,a);return this},t.getTweensOf=function(i,a){for(var s=[],o=Ls(i),l=this._first,u=Ol(a),c;l;)l instanceof $r?LY(l._targets,o)&&(u?(!Iu||l._initted&&l._ts)&&l.globalTime(0)<=a&&l.globalTime(l.totalDuration())>a:!a||l.isActive())&&s.push(l):(c=l.getTweensOf(o,a)).length&&s.push.apply(s,c),l=l._next;return s},t.tweenTo=function(i,a){a=a||{};var s=this,o=hs(s,i),l=a,u=l.startAt,c=l.onStart,h=l.onStartParams,f=l.immediateRender,d,p=$r.to(s,ts({ease:a.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale())||Qn,onStart:function(){if(s.pause(),!d){var v=a.duration||Math.abs((o-(u&&"time"in u?u.time:s._time))/s.timeScale());p._dur!==v&&mp(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,s){return this.tweenTo(a,ts({startAt:{time:hs(this,i)}},s))},t.recent=function(){return this._recent},t.nextLabel=function(i){return i===void 0&&(i=this._time),gD(this,hs(this,i))},t.previousLabel=function(i){return i===void 0&&(i=this._time),gD(this,hs(this,i),1)},t.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+Qn)},t.shiftChildren=function(i,a,s){s===void 0&&(s=0);var o=this._first,l=this.labels,u;for(i=vr(i);o;)o._start>=s&&(o._start+=i,o._end+=i),o=o._next;if(a)for(u in l)l[u]>=s&&(l[u]+=i);return Gh(this)},t.invalidate=function(i){var a=this._first;for(this._lock=0;a;)a.invalidate(i),a=a._next;return n.prototype.invalidate.call(this,i)},t.clear=function(i){i===void 0&&(i=!0);for(var a=this._first,s;a;)s=a._next,this.remove(a),a=s;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),Gh(this)},t.totalDuration=function(i){var a=0,s=this,o=s._last,l=Ps,u,c,h;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-i:i));if(s._dirty){for(h=s.parent;o;)u=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>l&&s._sort&&o._ts&&!s._lock?(s._lock=1,Do(s,o,c-o._delay,1)._lock=0):l=c,c<0&&o._ts&&(a-=c,(!h&&!s._dp||h&&h.smoothChildTiming)&&(s._start+=vr(c/s._ts),s._time-=c,s._tTime-=c),s.shiftChildren(-c,!1,-1/0),l=0),o._end>a&&o._ts&&(a=o._end),o=u;mp(s,s===mr&&s._time>a?s._time:a,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(i){if(mr._ts&&(zG(mr,cx(i,mr)),BG=Ha.frame),Ha.frame>=fD){fD+=Ka.autoSleep||120;var a=mr._first;if((!a||!a._ts)&&Ka.autoSleep&&Ha._listeners.length<2){for(;a&&!a._ts;)a=a._next;a||Ha.sleep()}}},e}(Lm);ts(na.prototype,{_lock:0,_hasPause:0,_forcing:0});var JY=function(e,t,r,i,a,s,o){var l=new Aa(this._pt,e,t,0,1,pz,null,a),u=0,c=0,h,f,d,p,g,v,m,y;for(l.b=r,l.e=i,r+="",i+="",(m=~i.indexOf("random("))&&(i=Em(i)),s&&(y=[r,i],s(y,e,t),r=y[0],i=y[1]),f=r.match(yw)||[];h=yw.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)==="="?Qd(v,p)-v:parseFloat(p)-v,m:d&&d<4?Math.round:0},u=yw.lastIndex);return l.c=u<i.length?i.substring(u,i.length):"",l.fp=o,(NG.test(i)||m)&&(l.e=0),this._pt=l,l},nP=function(e,t,r,i,a,s,o,l,u,c){Tr(i)&&(i=i(a||0,e,s));var h=e[t],f=r!=="get"?r:Tr(h)?u?e[t.indexOf("set")||!Tr(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():h,d=Tr(h)?u?iK:fz:iP,p;if(vi(i)&&(~i.indexOf("random(")&&(i=Em(i)),i.charAt(1)==="="&&(p=Qd(f,i)+(zi(f)||0),(p||p===0)&&(i=p))),!c||f!==i||fT)return!isNaN(f*i)&&i!==""?(p=new Aa(this._pt,e,t,+f||0,i-(f||0),typeof h=="boolean"?sK:dz,0,d),u&&(p.fp=u),o&&p.modifier(o,this,e),this._pt=p):(!h&&!(t in e)&&ZE(t,i),JY.call(this,e,t,f,i,d,l||Ka.stringFilter,u))},eK=function(e,t,r,i,a){if(Tr(e)&&(e=Kg(e,a,t,r,i)),!Xo(e)||e.style&&e.nodeType||Vi(e)||DG(e))return vi(e)?Kg(e,a,t,r,i):e;var s={},o;for(o in e)s[o]=Kg(e[o],a,t,r,i);return s},uz=function(e,t,r,i,a,s){var o,l,u,c;if(Ua[e]&&(o=new Ua[e]).init(a,o.rawVars?t[e]:eK(t[e],i,a,s,r),r,i,s)!==!1&&(r._pt=l=new Aa(r._pt,a,e,0,1,o.render,o,0,o.priority),r!==Fd))for(u=r._ptLookup[r._targets.indexOf(a)],c=o._props.length;c--;)u[o._props[c]]=l;return o},Iu,fT,rP=function n(e,t,r){var i=e.vars,a=i.ease,s=i.startAt,o=i.immediateRender,l=i.lazy,u=i.onUpdate,c=i.runBackwards,h=i.yoyoEase,f=i.keyframes,d=i.autoRevert,p=e._dur,g=e._startAt,v=e._targets,m=e.parent,y=m&&m.data==="nested"?m.vars.targets:v,_=e._overwrite==="auto"&&!qE,x=e.timeline,b,S,w,T,C,A,M,P,D,L,R,N,F;if(x&&(!f||!a)&&(a="none"),e._ease=zh(a,pp.ease),e._yEase=h?az(zh(h===!0?a:h,pp.ease)):0,h&&e._yoyo&&!e._repeat&&(h=e._yEase,e._yEase=e._ease,e._ease=h),e._from=!x&&!!i.runBackwards,!x||f&&!i.stagger){if(P=v[0]?Bh(v[0]).harness:0,N=P&&i[P.prop],b=ux(i,QE),g&&(g._zTime<0&&g.progress(1),t<0&&c&&o&&!d?g.render(-1,!0):g.revert(c&&p?w1:EY),g._lazy=0),s){if(ac(e._startAt=$r.set(v,ts({data:"isStart",overwrite:!1,parent:m,immediateRender:!0,lazy:!g&&Sa(l),startAt:null,delay:0,onUpdate:u&&function(){return ja(e,"onUpdate")},stagger:0},s))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Ai||!o&&!d)&&e._startAt.revert(w1),o&&p&&t<=0&&r<=0){t&&(e._zTime=t);return}}else if(c&&p&&!g){if(t&&(o=!1),w=ts({overwrite:!1,data:"isFromStart",lazy:o&&!g&&Sa(l),immediateRender:o,stagger:0,parent:m},b),N&&(w[P.prop]=N),ac(e._startAt=$r.set(v,w)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Ai?e._startAt.revert(w1):e._startAt.render(-1,!0)),e._zTime=t,!o)n(e._startAt,Qn,Qn);else if(!t)return}for(e._pt=e._ptCache=0,l=p&&Sa(l)||l&&!p,S=0;S<v.length;S++){if(C=v[S],M=C._gsap||eP(v)[S]._gsap,e._ptLookup[S]=L={},sT[M.id]&&Yu.length&&lx(),R=y===v?S:y.indexOf(C),P&&(D=new P).init(C,N||b,e,R,y)!==!1&&(e._pt=T=new Aa(e._pt,C,D.name,0,1,D.render,D,0,D.priority),D._props.forEach(function(O){L[O]=T}),D.priority&&(A=1)),!P||N)for(w in b)Ua[w]&&(D=uz(w,b,e,R,C,y))?D.priority&&(A=1):L[w]=T=nP.call(e,C,w,"get",b[w],R,y,0,i.stringFilter);e._op&&e._op[S]&&e.kill(C,e._op[S]),_&&e._pt&&(Iu=e,mr.killTweensOf(C,L,e.globalTime(t)),F=!e.parent,Iu=0),e._pt&&l&&(sT[M.id]=1)}A&&vz(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!F,f&&t<=0&&x.render(Ps,!0,!0)},tK=function(e,t,r,i,a,s,o,l){var u=(e._pt&&e._ptCache||(e._ptCache={}))[t],c,h,f,d;if(!u)for(u=e._ptCache[t]=[],f=e._ptLookup,d=e._targets.length;d--;){if(c=f[d][t],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==t&&c.fp!==t;)c=c._next;if(!c)return fT=1,e.vars[t]="+=0",rP(e,o),fT=0,l?Tm(t+" not eligible for reset"):1;u.push(c)}for(d=u.length;d--;)h=u[d],c=h._pt||h,c.s=(i||i===0)&&!a?i:c.s+(i||0)+s*c.c,c.c=r-c.s,h.e&&(h.e=Dr(r)+zi(h.e)),h.b&&(h.b=c.s+zi(h.b))},nK=function(e,t){var r=e[0]?Bh(e[0]).harness:0,i=r&&r.aliases,a,s,o,l;if(!i)return t;a=vp({},t);for(s in i)if(s in a)for(l=i[s].split(","),o=l.length;o--;)a[l[o]]=a[s];return a},rK=function(e,t,r,i){var a=t.ease||i||"power1.inOut",s,o;if(Vi(t))o=r[e]||(r[e]=[]),t.forEach(function(l,u){return o.push({t:u/(t.length-1)*100,v:l,e:a})});else for(s in t)o=r[s]||(r[s]=[]),s==="ease"||o.push({t:parseFloat(e),v:t[s],e:a})},Kg=function(e,t,r,i,a){return Tr(e)?e.call(t,r,i,a):vi(e)&&~e.indexOf("random(")?Em(e):e},cz=JE+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",hz={};wa(cz+",id,stagger,delay,duration,paused,scrollTrigger",function(n){return hz[n]=1});var $r=function(n){LG(e,n);function e(r,i,a,s){var o;typeof i=="number"&&(a.duration=i,i=a,a=null),o=n.call(this,s?i:Xg(i))||this;var l=o.vars,u=l.duration,c=l.delay,h=l.immediateRender,f=l.stagger,d=l.overwrite,p=l.keyframes,g=l.defaults,v=l.scrollTrigger,m=l.yoyoEase,y=i.parent||mr,_=(Vi(r)||DG(r)?Ol(r[0]):"length"in i)?[r]:Ls(r),x,b,S,w,T,C,A,M;if(o._targets=_.length?eP(_):Tm("GSAP target "+r+" not found. https://gsap.com",!Ka.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=d,p||f||gy(u)||gy(c)){if(i=o.vars,x=o.timeline=new na({data:"nested",defaults:g||{},targets:y&&y.data==="nested"?y.vars.targets:_}),x.kill(),x.parent=x._dp=Sl(o),x._start=0,f||gy(u)||gy(c)){if(w=_.length,A=f&&YG(f),Xo(f))for(T in f)~cz.indexOf(T)&&(M||(M={}),M[T]=f[T]);for(b=0;b<w;b++)S=ux(i,hz),S.stagger=0,m&&(S.yoyoEase=m),M&&vp(S,M),C=_[b],S.duration=+Kg(u,Sl(o),b,C,_),S.delay=(+Kg(c,Sl(o),b,C,_)||0)-o._delay,!f&&w===1&&S.delay&&(o._delay=c=S.delay,o._start+=c,S.delay=0),x.to(C,S,A?A(b,C,_):0),x._ease=wn.none;x.duration()?u=c=0:o.timeline=0}else if(p){Xg(ts(x.vars.defaults,{ease:"none"})),x._ease=zh(p.ease||i.ease||"none");var P=0,D,L,R;if(Vi(p))p.forEach(function(N){return x.to(_,N,">")}),x.duration();else{S={};for(T in p)T==="ease"||T==="easeEach"||rK(T,p[T],S,p.easeEach);for(T in S)for(D=S[T].sort(function(N,F){return N.t-F.t}),P=0,b=0;b<D.length;b++)L=D[b],R={ease:L.e,duration:(L.t-(b?D[b-1].t:0))/100*u},R[T]=L.v,x.to(_,R,P),P+=R.duration;x.duration()<u&&x.to({},{duration:u-x.duration()})}}u||o.duration(u=x.duration())}else o.timeline=0;return d===!0&&!qE&&(Iu=Sl(o),mr.killTweensOf(_),Iu=0),Do(y,Sl(o),a),i.reversed&&o.reverse(),i.paused&&o.paused(!0),(h||!u&&!p&&o._start===vr(y._time)&&Sa(h)&&NY(Sl(o))&&y.data!=="nested")&&(o._tTime=-Qn,o.render(Math.max(0,-c)||0)),v&&$G(Sl(o),v),o}var t=e.prototype;return t.render=function(i,a,s){var o=this._time,l=this._tDur,u=this._dur,c=i<0,h=i>l-Qn&&!c?l:i<Qn?0:i,f,d,p,g,v,m,y,_,x;if(!u)OY(this,i,a,s);else if(h!==this._tTime||!i||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(f=h,_=this.timeline,this._repeat){if(g=u+this._rDelay,this._repeat<-1&&c)return this.totalTime(g*100+i,a,s);if(f=vr(h%g),h===l?(p=this._repeat,f=u):(v=vr(h/g),p=~~v,p&&p===v?(f=u,p--):f>u&&(f=u)),m=this._yoyo&&p&1,m&&(x=this._yEase,f=u-f),v=gp(this._tTime,g),f===o&&!s&&this._initted&&p===v)return this._tTime=h,this;p!==v&&(_&&this._yEase&&sz(_,m),this.vars.repeatRefresh&&!m&&!this._lock&&f!==g&&this._initted&&(this._lock=s=1,this.render(vr(g*p),!0).invalidate()._lock=0))}if(!this._initted){if(jG(this,c?i:f,s,a,h))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&p!==v))return this;if(u!==this._dur)return this.render(i,a,s)}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),!o&&h&&!a&&!v&&(ja(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,s)||this._startAt&&(this._zTime=i),this._onUpdate&&!a&&(c&&oT(this,i,a,s),ja(this,"onUpdate")),this._repeat&&p!==v&&this.vars.onRepeat&&!a&&this.parent&&ja(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(c&&!this._onUpdate&&oT(this,i,!0,!0),(i||!u)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&ac(this,1),!a&&!(c&&!o)&&(h||o||m)&&(ja(this,h===l?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&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),n.prototype.invalidate.call(this,i)},t.resetTo=function(i,a,s,o,l){Pm||Ha.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||rP(this,u),c=this._ease(u/this._dur),tK(this,i,a,s,o,c,u,l)?this.resetTo(i,a,s,o,1):(Wb(this,0),this.parent||HG(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?Eg(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Ai),this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(i,a,Iu&&Iu.vars.overwrite!==!0)._first||Eg(this),this.parent&&s!==this.timeline.totalDuration()&&mp(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,l=i?Ls(i):o,u=this._ptLookup,c=this._pt,h,f,d,p,g,v,m;if((!a||a==="all")&&DY(o,l))return a==="all"&&(this._pt=0),Eg(this);for(h=this._op=this._op||[],a!=="all"&&(vi(a)&&(g={},wa(a,function(y){return g[y]=1}),a=g),a=nK(o,a)),m=o.length;m--;)if(~l.indexOf(o[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)&&Vb(this,v,"_pt"),delete f[g]),d!=="all"&&(d[g]=1)}return this._initted&&!this._pt&&c&&Eg(this),this},e.to=function(i,a){return new e(i,a,arguments[2])},e.from=function(i,a){return Yg(1,arguments)},e.delayedCall=function(i,a,s,o){return new e(a,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:a,onReverseComplete:a,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},e.fromTo=function(i,a,s){return Yg(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,s){return mr.killTweensOf(i,a,s)},e}(Lm);ts($r.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});wa("staggerTo,staggerFrom,staggerFromTo",function(n){$r[n]=function(){var e=new na,t=uT.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var iP=function(e,t,r){return e[t]=r},fz=function(e,t,r){return e[t](r)},iK=function(e,t,r,i){return e[t](i.fp,r)},aK=function(e,t,r){return e.setAttribute(t,r)},aP=function(e,t){return Tr(e[t])?fz:XE(e[t])&&e.setAttribute?aK:iP},dz=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},sK=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},pz=function(e,t){var r=t._pt,i="";if(!e&&t.b)i=t.b;else if(e===1&&t.e)i=t.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*e):Math.round((r.s+r.c*e)*1e4)/1e4)+i,r=r._next;i+=t.c}t.set(t.t,t.p,i,t)},sP=function(e,t){for(var r=t._pt;r;)r.r(e,r.d),r=r._next},oK=function(e,t,r,i){for(var a=this._pt,s;a;)s=a._next,a.p===i&&a.modifier(e,t,r),a=s},lK=function(e){for(var t=this._pt,r,i;t;)i=t._next,t.p===e&&!t.op||t.op===e?Vb(this,t,"_pt"):t.dep||(r=1),t=i;return!r},uK=function(e,t,r,i){i.mSet(e,t,i.m.call(i.tween,r,i.mt),i)},vz=function(e){for(var t=e._pt,r,i,a,s;t;){for(r=t._next,i=a;i&&i.pr>t.pr;)i=i._next;(t._prev=i?i._prev:s)?t._prev._next=t:a=t,(t._next=i)?i._prev=t:s=t,t=r}e._pt=a},Aa=function(){function n(t,r,i,a,s,o,l,u,c){this.t=r,this.s=a,this.c=s,this.p=i,this.r=o||dz,this.d=l||this,this.set=u||iP,this.pr=c||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(r,i,a){this.mSet=this.mSet||this.set,this.set=uK,this.m=r,this.mt=a,this.tween=i},n}();wa(JE+"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(n){return QE[n]=1});es.TweenMax=es.TweenLite=$r;es.TimelineLite=es.TimelineMax=na;mr=new na({sortChildren:!1,defaults:pp,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ka.stringFilter=iz;var Uh=[],M1={},cK=[],yD=0,hK=0,ww=function(e){return(M1[e]||cK).map(function(t){return t()})},dT=function(){var e=Date.now(),t=[];e-yD>2&&(ww("matchMediaInit"),Uh.forEach(function(r){var i=r.queries,a=r.conditions,s,o,l,u;for(o in i)s=Eo.matchMedia(i[o]).matches,s&&(l=1),s!==a[o]&&(a[o]=s,u=1);u&&(r.revert(),l&&t.push(r))}),ww("matchMediaRevert"),t.forEach(function(r){return r.onMatch(r,function(i){return r.add(null,i)})}),yD=e,ww("matchMedia"))},gz=function(){function n(t,r){this.selector=r&&cT(r),this.data=[],this._r=[],this.isReverted=!1,this.id=hK++,t&&this.add(t)}var e=n.prototype;return e.add=function(r,i,a){Tr(r)&&(a=i,i=r,r=Tr);var s=this,o=function(){var u=hr,c=s.selector,h;return u&&u!==s&&u.data.push(s),a&&(s.selector=cT(a)),hr=s,h=i.apply(s,arguments),Tr(h)&&s._r.push(h),hr=u,s.selector=c,s.isReverted=!1,h};return s.last=o,r===Tr?o(s,function(l){return s.add(null,l)}):r?s[r]=o:o},e.ignore=function(r){var i=hr;hr=null,r(this),hr=i},e.getTweens=function(){var r=[];return this.data.forEach(function(i){return i instanceof n?r.push.apply(r,i.getTweens()):i instanceof $r&&!(i.parent&&i.parent.data==="nested")&&r.push(i)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,i){var a=this;if(r?function(){for(var o=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 o.splice(o.indexOf(c),1)}));for(o.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(r)}),l=a.data.length;l--;)u=a.data[l],u instanceof na?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof $r)&&u.revert&&u.revert(r);a._r.forEach(function(c){return c(r,a)}),a.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),i)for(var s=Uh.length;s--;)Uh[s].id===this.id&&Uh.splice(s,1)},e.revert=function(r){this.kill(r||{})},n}(),fK=function(){function n(t){this.contexts=[],this.scope=t,hr&&hr.data.push(this)}var e=n.prototype;return e.add=function(r,i,a){Xo(r)||(r={matches:r});var s=new gz(0,a||this.scope),o=s.conditions={},l,u,c;hr&&!s.selector&&(s.selector=hr.selector),this.contexts.push(s),i=s.add("onMatch",i),s.queries=r;for(u in r)u==="all"?c=1:(l=Eo.matchMedia(r[u]),l&&(Uh.indexOf(s)<0&&Uh.push(s),(o[u]=l.matches)&&(c=1),l.addListener?l.addListener(dT):l.addEventListener("change",dT)));return c&&i(s,function(h){return s.add(null,h)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(i){return i.kill(r,!0)})},n}(),hx={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.forEach(function(i){return tz(i)})},timeline:function(e){return new na(e)},getTweensOf:function(e,t){return mr.getTweensOf(e,t)},getProperty:function(e,t,r,i){vi(e)&&(e=Ls(e)[0]);var a=Bh(e||{}).get,s=r?VG:UG;return r==="native"&&(r=""),e&&(t?s((Ua[t]&&Ua[t].get||a)(e,t,r,i)):function(o,l,u){return s((Ua[o]&&Ua[o].get||a)(e,o,l,u))})},quickSetter:function(e,t,r){if(e=Ls(e),e.length>1){var i=e.map(function(c){return Ea.quickSetter(c,t,r)}),a=i.length;return function(c){for(var h=a;h--;)i[h](c)}}e=e[0]||{};var s=Ua[t],o=Bh(e),l=o.harness&&(o.harness.aliases||{})[t]||t,u=s?function(c){var h=new s;Fd._pt=0,h.init(e,r?c+r:c,Fd,0,[e]),h.render(1,h),Fd._pt&&sP(1,Fd)}:o.set(e,l);return s?u:function(c){return u(e,l,r?c+r:c,o,1)}},quickTo:function(e,t,r){var i,a=Ea.to(e,ts((i={},i[t]="+=0.1",i.paused=!0,i.stagger=0,i),r||{})),s=function(l,u,c){return a.resetTo(t,l,u,c)};return s.tween=a,s},isTweening:function(e){return mr.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=zh(e.ease,pp.ease)),dD(pp,e||{})},config:function(e){return dD(Ka,e||{})},registerEffect:function(e){var t=e.name,r=e.effect,i=e.plugins,a=e.defaults,s=e.extendTimeline;(i||"").split(",").forEach(function(o){return o&&!Ua[o]&&!es[o]&&Tm(t+" effect requires "+o+" plugin.")}),_w[t]=function(o,l,u){return r(Ls(o),ts(l||{},a),u)},s&&(na.prototype[t]=function(o,l,u){return this.add(_w[t](o,Xo(l)?l:(u=l)&&{},this),u)})},registerEase:function(e,t){wn[e]=zh(t)},parseEase:function(e,t){return arguments.length?zh(e,t):wn},getById:function(e){return mr.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var r=new na(e),i,a;for(r.smoothChildTiming=Sa(e.smoothChildTiming),mr.remove(r),r._dp=0,r._time=r._tTime=mr._time,i=mr._first;i;)a=i._next,(t||!(!i._dur&&i instanceof $r&&i.vars.onComplete===i._targets[0]))&&Do(r,i,i._start-i._delay),i=a;return Do(mr,r,0),r},context:function(e,t){return e?new gz(e,t):hr},matchMedia:function(e){return new fK(e)},matchMediaRefresh:function(){return Uh.forEach(function(e){var t=e.conditions,r,i;for(i in t)t[i]&&(t[i]=!1,r=1);r&&e.revert()})||dT()},addEventListener:function(e,t){var r=M1[e]||(M1[e]=[]);~r.indexOf(t)||r.push(t)},removeEventListener:function(e,t){var r=M1[e],i=r&&r.indexOf(t);i>=0&&r.splice(i,1)},utils:{wrap:WY,wrapYoyo:$Y,distribute:YG,random:ZG,snap:KG,normalize:HY,getUnit:zi,clamp:GY,splitColor:nz,toArray:Ls,selector:cT,mapRange:JG,pipe:UY,unitize:VY,interpolate:jY,shuffle:XG},install:OG,effects:_w,ticker:Ha,updateRoot:na.updateRoot,plugins:Ua,globalTimeline:mr,core:{PropTween:Aa,globals:FG,Tween:$r,Timeline:na,Animation:Lm,getCache:Bh,_removeLinkedListItem:Vb,reverting:function(){return Ai},context:function(e){return e&&hr&&(hr.data.push(e),e._ctx=hr),hr},suppressOverwrites:function(e){return qE=e}}};wa("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return hx[n]=$r[n]});Ha.add(na.updateRoot);Fd=hx.to({},{duration:0});var dK=function(e,t){for(var r=e._pt;r&&r.p!==t&&r.op!==t&&r.fp!==t;)r=r._next;return r},pK=function(e,t){var r=e._targets,i,a,s;for(i in t)for(a=r.length;a--;)s=e._ptLookup[a][i],s&&(s=s.d)&&(s._pt&&(s=dK(s,i)),s&&s.modifier&&s.modifier(t[i],e,r[a],i))},Aw=function(e,t){return{name:e,headless:1,rawVars:1,init:function(i,a,s){s._onInit=function(o){var l,u;if(vi(a)&&(l={},wa(a,function(c){return l[c]=1}),a=l),t){l={};for(u in a)l[u]=t(a[u]);a=l}pK(o,a)}}}},Ea=hx.registerPlugin({name:"attr",init:function(e,t,r,i,a){var s,o,l;this.tween=r;for(s in t)l=e.getAttribute(s)||"",o=this.add(e,"setAttribute",(l||0)+"",t[s],i,a,0,0,s),o.op=s,o.b=l,this._props.push(s)},render:function(e,t){for(var r=t._pt;r;)Ai?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,t){for(var r=t.length;r--;)this.add(e,r,e[r]||0,t[r],0,0,0,0,0,1)}},Aw("roundProps",hT),Aw("modifiers"),Aw("snap",KG))||hx;$r.version=na.version=Ea.version="3.14.2";kG=1;YE()&&yp();wn.Power0;wn.Power1;wn.Power2;wn.Power3;wn.Power4;wn.Linear;wn.Quad;wn.Cubic;wn.Quart;wn.Quint;wn.Strong;wn.Elastic;wn.Back;wn.SteppedEase;wn.Bounce;wn.Sine;wn.Expo;wn.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 _D,Nu,Jd,oP,Th,xD,lP,vK=function(){return typeof window!="undefined"},Fl={},uh=180/Math.PI,ep=Math.PI/180,Nf=Math.atan2,bD=1e8,uP=/([A-Z])/g,gK=/(left|right|width|margin|padding|x)/i,mK=/[\s,\(]\S/,Bo={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},pT=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},yK=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)},_K=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)},xK=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)},bK=function(e,t){var r=t.s+t.c*e;t.set(t.t,t.p,~~(r+(r<0?-.5:.5))+t.u,t)},mz=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},yz=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},SK=function(e,t,r){return e.style[t]=r},wK=function(e,t,r){return e.style.setProperty(t,r)},AK=function(e,t,r){return e._gsap[t]=r},MK=function(e,t,r){return e._gsap.scaleX=e._gsap.scaleY=r},TK=function(e,t,r,i,a){var s=e._gsap;s.scaleX=s.scaleY=r,s.renderTransform(a,s)},CK=function(e,t,r,i,a){var s=e._gsap;s[t]=r,s.renderTransform(a,s)},yr="transform",Ma=yr+"Origin",EK=function n(e,t){var r=this,i=this.target,a=i.style,s=i._gsap;if(e in Fl&&a){if(this.tfm=this.tfm||{},e!=="transform")e=Bo[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return r.tfm[o]=Ml(i,o)}):this.tfm[e]=s.x?s[e]:Ml(i,e),e===Ma&&(this.tfm.zOrigin=s.zOrigin);else return Bo.transform.split(",").forEach(function(o){return n.call(r,o,t)});if(this.props.indexOf(yr)>=0)return;s.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Ma,t,"")),e=yr}(a||t)&&this.props.push(e,t,a[e])},_z=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},PK=function(){var e=this.props,t=this.target,r=t.style,i=t._gsap,a,s;for(a=0;a<e.length;a+=3)e[a+1]?e[a+1]===2?t[e[a]](e[a+2]):t[e[a]]=e[a+2]:e[a+2]?r[e[a]]=e[a+2]:r.removeProperty(e[a].substr(0,2)==="--"?e[a]:e[a].replace(uP,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)i[s]=this.tfm[s];i.svg&&(i.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),a=lP(),(!a||!a.isStart)&&!r[yr]&&(_z(r),i.zOrigin&&r[Ma]&&(r[Ma]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},xz=function(e,t){var r={target:e,props:[],revert:PK,save:EK};return e._gsap||Ea.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(i){return r.save(i)}),r},bz,vT=function(e,t){var r=Nu.createElementNS?Nu.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Nu.createElement(e);return r&&r.style?r:Nu.createElement(e)},qa=function n(e,t,r){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(uP,"-$1").toLowerCase())||i.getPropertyValue(t)||!r&&n(e,_p(t)||t,1)||""},SD="O,Moz,ms,Ms,Webkit".split(","),_p=function(e,t,r){var i=t||Th,a=i.style,s=5;if(e in a&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);s--&&!(SD[s]+e in a););return s<0?null:(s===3?"ms":s>=0?SD[s]:"")+e},gT=function(){vK()&&window.document&&(_D=window,Nu=_D.document,Jd=Nu.documentElement,Th=vT("div")||{style:{}},vT("div"),yr=_p(yr),Ma=yr+"Origin",Th.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",bz=!!_p("perspective"),lP=Ea.core.reverting,oP=1)},wD=function(e){var t=e.ownerSVGElement,r=vT("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=e.cloneNode(!0),a;i.style.display="block",r.appendChild(i),Jd.appendChild(r);try{a=i.getBBox()}catch(s){}return r.removeChild(i),Jd.removeChild(r),a},AD=function(e,t){for(var r=t.length;r--;)if(e.hasAttribute(t[r]))return e.getAttribute(t[r])},Sz=function(e){var t,r;try{t=e.getBBox()}catch(i){t=wD(e),r=1}return t&&(t.width||t.height)||r||(t=wD(e)),t&&!t.width&&!t.x&&!t.y?{x:+AD(e,["x","cx","x1"])||0,y:+AD(e,["y","cy","y1"])||0,width:0,height:0}:t},wz=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Sz(e))},sc=function(e,t){if(t){var r=e.style,i;t in Fl&&t!==Ma&&(t=yr),r.removeProperty?(i=t.substr(0,2),(i==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),r.removeProperty(i==="--"?t:t.replace(uP,"-$1").toLowerCase())):r.removeAttribute(t)}},ku=function(e,t,r,i,a,s){var o=new Aa(e._pt,t,r,0,1,s?yz:mz);return e._pt=o,o.b=i,o.e=a,e._props.push(r),o},MD={deg:1,rad:1,turn:1},LK={grid:1,flex:1},oc=function n(e,t,r,i){var a=parseFloat(r)||0,s=(r+"").trim().substr((a+"").length)||"px",o=Th.style,l=gK.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===s||!a||MD[i]||MD[s])return a;if(s!=="px"&&!f&&(a=n(e,t,r,"px")),m=e.getCTM&&wz(e),(d||s==="%")&&(Fl[t]||~t.indexOf("adius")))return p=m?e.getBBox()[l?"width":"height"]:e[c],Dr(d?a/p*h:a/100*p);if(o[l?"width":"height"]=h+(f?s:i),g=i!=="rem"&&~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,m&&(g=(e.ownerSVGElement||{}).parentNode),(!g||g===Nu||!g.appendChild)&&(g=Nu.body),v=g._gsap,v&&d&&v.width&&l&&v.time===Ha.time&&!v.uncache)return Dr(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:sc(e,t)}else(d||s==="%")&&!LK[qa(g,"display")]&&(o.position=qa(e,"position")),g===e&&(o.position="static"),g.appendChild(Th),p=Th[c],g.removeChild(Th),o.position="absolute";return l&&d&&(v=Bh(g),v.time=Ha.time,v.width=g[c]),Dr(f?p*a/h:p&&a?h/p*a:0)},Ml=function(e,t,r,i){var a;return oP||gT(),t in Bo&&t!=="transform"&&(t=Bo[t],~t.indexOf(",")&&(t=t.split(",")[0])),Fl[t]&&t!=="transform"?(a=Dm(e,i),a=t!=="transformOrigin"?a[t]:a.svg?a.origin:dx(qa(e,Ma))+" "+a.zOrigin+"px"):(a=e.style[t],(!a||a==="auto"||i||~(a+"").indexOf("calc("))&&(a=fx[t]&&fx[t](e,t,r)||qa(e,t)||GG(e,t)||(t==="opacity"?1:0))),r&&!~(a+"").trim().indexOf(" ")?oc(e,t,a,r)+r:a},RK=function(e,t,r,i){if(!r||r==="none"){var a=_p(t,e,1),s=a&&qa(e,a,1);s&&s!==r?(t=a,r=s):t==="borderColor"&&(r=qa(e,"borderTopColor"))}var o=new Aa(this._pt,e.style,t,0,1,pz),l=0,u=0,c,h,f,d,p,g,v,m,y,_,x,b;if(o.b=r,o.e=i,r+="",i+="",i.substring(0,6)==="var(--"&&(i=qa(e,i.substring(4,i.indexOf(")")))),i==="auto"&&(g=e.style[t],e.style[t]=i,i=qa(e,t)||i,g?e.style[t]=g:sc(e,t)),c=[r,i],iz(c),r=c[0],i=c[1],f=r.match(Od)||[],b=i.match(Od)||[],b.length){for(;h=Od.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=Qd(d,v)+x),m=parseFloat(v),_=v.substr((m+"").length),l=Od.lastIndex-_.length,_||(_=_||Ka.units[t]||x,l===i.length&&(i+=_,o.e+=_)),x!==_&&(d=oc(e,t,g,_)||0),o._pt={_next:o._pt,p:y||u===1?y:",",s:d,c:m-d,m:p&&p<4||t==="zIndex"?Math.round:0});o.c=l<i.length?i.substring(l,i.length):""}else o.r=t==="display"&&i==="none"?yz:mz;return NG.test(i)&&(o.e=0),this._pt=o,o},TD={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},DK=function(e){var t=e.split(" "),r=t[0],i=t[1]||"50%";return(r==="top"||r==="bottom"||i==="left"||i==="right")&&(e=r,r=i,i=e),t[0]=TD[r]||r,t[1]=TD[i]||i,t.join(" ")},IK=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var r=t.t,i=r.style,a=t.u,s=r._gsap,o,l,u;if(a==="all"||a===!0)i.cssText="",l=1;else for(a=a.split(","),u=a.length;--u>-1;)o=a[u],Fl[o]&&(l=1,o=o==="transformOrigin"?Ma:yr),sc(r,o);l&&(sc(r,yr),s&&(s.svg&&r.removeAttribute("transform"),i.scale=i.rotate=i.translate="none",Dm(r,1),s.uncache=1,_z(i)))}},fx={clearProps:function(e,t,r,i,a){if(a.data!=="isFromStart"){var s=e._pt=new Aa(e._pt,t,r,0,0,IK);return s.u=i,s.pr=-10,s.tween=a,e._props.push(r),1}}},Rm=[1,0,0,1,0,0],Az={},Mz=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},CD=function(e){var t=qa(e,yr);return Mz(t)?Rm:t.substr(7).match(IG).map(Dr)},cP=function(e,t){var r=e._gsap||Bh(e),i=e.style,a=CD(e),s,o,l,u;return r.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"?Rm:a):(a===Rm&&!e.offsetParent&&e!==Jd&&!r.svg&&(l=i.display,i.display="block",s=e.parentNode,(!s||!e.offsetParent&&!e.getBoundingClientRect().width)&&(u=1,o=e.nextElementSibling,Jd.appendChild(e)),a=CD(e),l?i.display=l:sc(e,"display"),u&&(o?s.insertBefore(e,o):s?s.appendChild(e):Jd.removeChild(e))),t&&a.length>6?[a[0],a[1],a[4],a[5],a[12],a[13]]:a)},mT=function(e,t,r,i,a,s){var o=e._gsap,l=a||cP(e,!0),u=o.xOrigin||0,c=o.yOrigin||0,h=o.xOffset||0,f=o.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,b=parseFloat(_[1])||0,S,w,T,C;r?l!==Rm&&(w=d*v-p*g)&&(T=x*(v/w)+b*(-g/w)+(g*y-v*m)/w,C=x*(-p/w)+b*(d/w)-(d*y-p*m)/w,x=T,b=C):(S=Sz(e),x=S.x+(~_[0].indexOf("%")?x/100*S.width:x),b=S.y+(~(_[1]||_[0]).indexOf("%")?b/100*S.height:b)),i||i!==!1&&o.smooth?(m=x-u,y=b-c,o.xOffset=h+(m*d+y*g)-m,o.yOffset=f+(m*p+y*v)-y):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=b,o.smooth=!!i,o.origin=t,o.originIsAbsolute=!!r,e.style[Ma]="0px 0px",s&&(ku(s,o,"xOrigin",u,x),ku(s,o,"yOrigin",c,b),ku(s,o,"xOffset",h,o.xOffset),ku(s,o,"yOffset",f,o.yOffset)),e.setAttribute("data-svg-origin",x+" "+b)},Dm=function(e,t){var r=e._gsap||new lz(e);if("x"in r&&!t&&!r.uncache)return r;var i=e.style,a=r.scaleX<0,s="px",o="deg",l=getComputedStyle(e),u=qa(e,Ma)||"0",c,h,f,d,p,g,v,m,y,_,x,b,S,w,T,C,A,M,P,D,L,R,N,F,O,H,U,$,Y,oe,X,re;return c=h=f=g=v=m=y=_=x=0,d=p=1,r.svg=!!(e.getCTM&&wz(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[yr]=(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[yr]!=="none"?l[yr]:"")),i.scale=i.rotate=i.translate="none"),w=cP(e,r.svg),r.svg&&(r.uncache?(O=e.getBBox(),u=r.xOrigin-O.x+"px "+(r.yOrigin-O.y)+"px",F=""):F=!t&&e.getAttribute("data-svg-origin"),mT(e,F||u,!!F||r.originIsAbsolute,r.smooth!==!1,w)),b=r.xOrigin||0,S=r.yOrigin||0,w!==Rm&&(M=w[0],P=w[1],D=w[2],L=w[3],c=R=w[4],h=N=w[5],w.length===6?(d=Math.sqrt(M*M+P*P),p=Math.sqrt(L*L+D*D),g=M||P?Nf(P,M)*uh:0,y=D||L?Nf(D,L)*uh+g:0,y&&(p*=Math.abs(Math.cos(y*ep))),r.svg&&(c-=b-(b*M+S*D),h-=S-(b*P+S*L))):(re=w[6],oe=w[7],U=w[8],$=w[9],Y=w[10],X=w[11],c=w[12],h=w[13],f=w[14],T=Nf(re,Y),v=T*uh,T&&(C=Math.cos(-T),A=Math.sin(-T),F=R*C+U*A,O=N*C+$*A,H=re*C+Y*A,U=R*-A+U*C,$=N*-A+$*C,Y=re*-A+Y*C,X=oe*-A+X*C,R=F,N=O,re=H),T=Nf(-D,Y),m=T*uh,T&&(C=Math.cos(-T),A=Math.sin(-T),F=M*C-U*A,O=P*C-$*A,H=D*C-Y*A,X=L*A+X*C,M=F,P=O,D=H),T=Nf(P,M),g=T*uh,T&&(C=Math.cos(T),A=Math.sin(T),F=M*C+P*A,O=R*C+N*A,P=P*C-M*A,N=N*C-R*A,M=F,R=O),v&&Math.abs(v)+Math.abs(g)>359.9&&(v=g=0,m=180-m),d=Dr(Math.sqrt(M*M+P*P+D*D)),p=Dr(Math.sqrt(N*N+re*re)),T=Nf(R,N),y=Math.abs(T)>2e-4?T*uh:0,x=X?1/(X<0?-X:X):0),r.svg&&(F=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!Mz(qa(e,yr)),F&&e.setAttribute("transform",F))),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||r.uncache,r.x=c-((r.xPercent=c&&(!t&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-c)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+s,r.y=h-((r.yPercent=h&&(!t&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+s,r.z=f+s,r.scaleX=Dr(d),r.scaleY=Dr(p),r.rotation=Dr(g)+o,r.rotationX=Dr(v)+o,r.rotationY=Dr(m)+o,r.skewX=y+o,r.skewY=_+o,r.transformPerspective=x+s,(r.zOrigin=parseFloat(u.split(" ")[2])||!t&&r.zOrigin||0)&&(i[Ma]=dx(u)),r.xOffset=r.yOffset=0,r.force3D=Ka.force3D,r.renderTransform=r.svg?kK:bz?Tz:NK,r.uncache=0,r},dx=function(e){return(e=e.split(" "))[0]+" "+e[1]},Mw=function(e,t,r){var i=zi(t);return Dr(parseFloat(t)+parseFloat(oc(e,"x",r+"px",i)))+i},NK=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Tz(e,t)},Pc="0deg",kv="0px",Lc=") ",Tz=function(e,t){var r=t||this,i=r.xPercent,a=r.yPercent,s=r.x,o=r.y,l=r.z,u=r.rotation,c=r.rotationY,h=r.rotationX,f=r.skewX,d=r.skewY,p=r.scaleX,g=r.scaleY,v=r.transformPerspective,m=r.force3D,y=r.target,_=r.zOrigin,x="",b=m==="auto"&&e&&e!==1||m===!0;if(_&&(h!==Pc||c!==Pc)){var S=parseFloat(c)*ep,w=Math.sin(S),T=Math.cos(S),C;S=parseFloat(h)*ep,C=Math.cos(S),s=Mw(y,s,w*C*-_),o=Mw(y,o,-Math.sin(S)*-_),l=Mw(y,l,T*C*-_+_)}v!==kv&&(x+="perspective("+v+Lc),(i||a)&&(x+="translate("+i+"%, "+a+"%) "),(b||s!==kv||o!==kv||l!==kv)&&(x+=l!==kv||b?"translate3d("+s+", "+o+", "+l+") ":"translate("+s+", "+o+Lc),u!==Pc&&(x+="rotate("+u+Lc),c!==Pc&&(x+="rotateY("+c+Lc),h!==Pc&&(x+="rotateX("+h+Lc),(f!==Pc||d!==Pc)&&(x+="skew("+f+", "+d+Lc),(p!==1||g!==1)&&(x+="scale("+p+", "+g+Lc),y.style[yr]=x||"translate(0, 0)"},kK=function(e,t){var r=t||this,i=r.xPercent,a=r.yPercent,s=r.x,o=r.y,l=r.rotation,u=r.skewX,c=r.skewY,h=r.scaleX,f=r.scaleY,d=r.target,p=r.xOrigin,g=r.yOrigin,v=r.xOffset,m=r.yOffset,y=r.forceCSS,_=parseFloat(s),x=parseFloat(o),b,S,w,T,C;l=parseFloat(l),u=parseFloat(u),c=parseFloat(c),c&&(c=parseFloat(c),u+=c,l+=c),l||u?(l*=ep,u*=ep,b=Math.cos(l)*h,S=Math.sin(l)*h,w=Math.sin(l-u)*-f,T=Math.cos(l-u)*f,u&&(c*=ep,C=Math.tan(u-c),C=Math.sqrt(1+C*C),w*=C,T*=C,c&&(C=Math.tan(c),C=Math.sqrt(1+C*C),b*=C,S*=C)),b=Dr(b),S=Dr(S),w=Dr(w),T=Dr(T)):(b=h,T=f,S=w=0),(_&&!~(s+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(_=oc(d,"x",s,"px"),x=oc(d,"y",o,"px")),(p||g||v||m)&&(_=Dr(_+p-(p*b+g*w)+v),x=Dr(x+g-(p*S+g*T)+m)),(i||a)&&(C=d.getBBox(),_=Dr(_+i/100*C.width),x=Dr(x+a/100*C.height)),C="matrix("+b+","+S+","+w+","+T+","+_+","+x+")",d.setAttribute("transform",C),y&&(d.style[yr]=C)},OK=function(e,t,r,i,a){var s=360,o=vi(a),l=parseFloat(a)*(o&&~a.indexOf("rad")?uh:1),u=l-i,c=i+u+"deg",h,f;return o&&(h=a.split("_")[1],h==="short"&&(u%=s,u!==u%(s/2)&&(u+=u<0?s:-s)),h==="cw"&&u<0?u=(u+s*bD)%s-~~(u/s)*s:h==="ccw"&&u>0&&(u=(u-s*bD)%s-~~(u/s)*s)),e._pt=f=new Aa(e._pt,t,r,i,u,yK),f.e=c,f.u="deg",e._props.push(r),f},ED=function(e,t){for(var r in t)e[r]=t[r];return e},FK=function(e,t,r){var i=ED({},r._gsap),a="perspective,force3D,transformOrigin,svgOrigin",s=r.style,o,l,u,c,h,f,d,p;i.svg?(u=r.getAttribute("transform"),r.setAttribute("transform",""),s[yr]=t,o=Dm(r,1),sc(r,yr),r.setAttribute("transform",u)):(u=getComputedStyle(r)[yr],s[yr]=t,o=Dm(r,1),s[yr]=u);for(l in Fl)u=i[l],c=o[l],u!==c&&a.indexOf(l)<0&&(d=zi(u),p=zi(c),h=d!==p?oc(r,l,u,p):parseFloat(u),f=parseFloat(c),e._pt=new Aa(e._pt,o,l,h,f-h,pT),e._pt.u=p||0,e._props.push(l));ED(o,i)};wa("padding,margin,Width,Radius",function(n,e){var t="Top",r="Right",i="Bottom",a="Left",s=(e<3?[t,r,i,a]:[t+a,t+r,i+r,i+a]).map(function(o){return e<2?n+o:"border"+o+n});fx[e>1?"border"+n:n]=function(o,l,u,c,h){var f,d;if(arguments.length<4)return f=s.map(function(p){return Ml(o,p,u)}),d=f.join(" "),d.split(f[0]).length===5?f[0]:d;f=(c+"").split(" "),d={},s.forEach(function(p,g){return d[p]=f[g]=f[g]||f[(g-1)/2|0]}),o.init(l,d,h)}});var Cz={name:"css",register:gT,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,r,i,a){var s=this._props,o=e.style,l=r.vars.startAt,u,c,h,f,d,p,g,v,m,y,_,x,b,S,w,T,C;oP||gT(),this.styles=this.styles||xz(e),T=this.styles.props,this.tween=r;for(g in t)if(g!=="autoRound"&&(c=t[g],!(Ua[g]&&uz(g,t,r,i,e,a)))){if(d=typeof c,p=fx[g],d==="function"&&(c=c.call(r,i,e,a),d=typeof c),d==="string"&&~c.indexOf("random(")&&(c=Em(c)),p)p(this,e,g,c,r)&&(w=1);else if(g.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(g)+"").trim(),c+="",Ku.lastIndex=0,Ku.test(u)||(v=zi(u),m=zi(c),m?v!==m&&(u=oc(e,g,u,m)+m):v&&(c+=v)),this.add(o,"setProperty",u,c,i,a,0,0,g),s.push(g),T.push(g,0,o[g]);else if(d!=="undefined"){if(l&&g in l?(u=typeof l[g]=="function"?l[g].call(r,i,e,a):l[g],vi(u)&&~u.indexOf("random(")&&(u=Em(u)),zi(u+"")||u==="auto"||(u+=Ka.units[g]||zi(Ml(e,g))||""),(u+"").charAt(1)==="="&&(u=Ml(e,g))):u=Ml(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 Bo&&(g==="autoAlpha"&&(f===1&&Ml(e,"visibility")==="hidden"&&h&&(f=0),T.push("visibility",0,o.visibility),ku(this,o,"visibility",f?"inherit":"hidden",h?"inherit":"hidden",!h)),g!=="scale"&&g!=="transform"&&(g=Bo[g],~g.indexOf(",")&&(g=g.split(",")[0]))),_=g in Fl,_){if(this.styles.save(g),C=c,d==="string"&&c.substring(0,6)==="var(--"){if(c=qa(e,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var A=e.style.perspective;e.style.perspective=c,c=qa(e,"perspective"),A?e.style.perspective=A:sc(e,"perspective")}h=parseFloat(c)}if(x||(b=e._gsap,b.renderTransform&&!t.parseTransform||Dm(e,t.parseTransform),S=t.smoothOrigin!==!1&&b.smooth,x=this._pt=new Aa(this._pt,o,yr,0,1,b.renderTransform,b,0,-1),x.dep=1),g==="scale")this._pt=new Aa(this._pt,b,"scaleY",b.scaleY,(y?Qd(b.scaleY,y+h):h)-b.scaleY||0,pT),this._pt.u=0,s.push("scaleY",g),g+="X";else if(g==="transformOrigin"){T.push(Ma,0,o[Ma]),c=DK(c),b.svg?mT(e,c,0,S,0,this):(m=parseFloat(c.split(" ")[2])||0,m!==b.zOrigin&&ku(this,b,"zOrigin",b.zOrigin,m),ku(this,o,g,dx(u),dx(c)));continue}else if(g==="svgOrigin"){mT(e,c,1,S,0,this);continue}else if(g in Az){OK(this,b,g,f,y?Qd(f,y+c):c);continue}else if(g==="smoothOrigin"){ku(this,b,"smooth",b.smooth,c);continue}else if(g==="force3D"){b[g]=c;continue}else if(g==="transform"){FK(this,c,e);continue}}else g in o||(g=_p(g)||g);if(_||(h||h===0)&&(f||f===0)&&!mK.test(c)&&g in o)v=(u+"").substr((f+"").length),h||(h=0),m=zi(c)||(g in Ka.units?Ka.units[g]:v),v!==m&&(f=oc(e,g,u,m)),this._pt=new Aa(this._pt,_?b:o,g,f,(y?Qd(f,y+h):h)-f,!_&&(m==="px"||g==="zIndex")&&t.autoRound!==!1?bK:pT),this._pt.u=m||0,_&&C!==c?(this._pt.b=u,this._pt.e=C,this._pt.r=xK):v!==m&&m!=="%"&&(this._pt.b=u,this._pt.r=_K);else if(g in o)RK.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"){ZE(g,c);continue}_||(g in o?T.push(g,0,o[g]):typeof e[g]=="function"?T.push(g,2,e[g]()):T.push(g,1,u||e[g])),s.push(g)}}w&&vz(this)},render:function(e,t){if(t.tween._time||!lP())for(var r=t._pt;r;)r.r(e,r.d),r=r._next;else t.styles.revert()},get:Ml,aliases:Bo,getSetter:function(e,t,r){var i=Bo[t];return i&&i.indexOf(",")<0&&(t=i),t in Fl&&t!==Ma&&(e._gsap.x||Ml(e,"x"))?r&&xD===r?t==="scale"?MK:AK:(xD=r||{})&&(t==="scale"?TK:CK):e.style&&!XE(e.style[t])?SK:~t.indexOf("-")?wK:aP(e,t)},core:{_removeProperty:sc,_getMatrix:cP}};Ea.utils.checkPrefix=_p;Ea.core.getStyleSaver=xz;(function(n,e,t,r){var i=wa(n+","+e+","+t,function(a){Fl[a]=1});wa(e,function(a){Ka.units[a]="deg",Az[a]=1}),Bo[i[13]]=n+","+e,wa(r,function(a){var s=a.split(":");Bo[s[1]]=i[s[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");wa("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){Ka.units[n]="px"});Ea.registerPlugin(Cz);var Mr=Ea.registerPlugin(Cz)||Ea;Mr.core.Tween;const BK={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 n=1;return{maskId:"svgline-"+n,radialGradientId:"radialGradient-"+n}},mounted(){let n=this._.uid;this.maskId="svgline-"+n,this.radialGradientId="radialGradient-"+n}},GK={class:"svg-line-animation"},zK=["viewBox"],UK=["id"],VK=["stop-opacity"],HK=["stop-opacity"],WK=["id"],$K=["r","fill"],jK=["begin","dur","path","keyPoints"],qK=["d","stroke","stroke-width","mask"];function XK(n,e,t,r,i,a){return Z(),ne("div",GK,[(Z(),ne("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[E("defs",null,[E("radialGradient",{id:i.radialGradientId,cx:"50%",cy:"50%",fx:"100%",fy:"50%",r:"50%"},[E("stop",{offset:"0%","stop-color":"#fff","stop-opacity":t.dir[1]},null,8,VK),E("stop",{offset:"100%","stop-color":"#fff","stop-opacity":t.dir[0]},null,8,HK)],8,UK),E("mask",{id:i.maskId},[E("circle",{r:t.length,cx:"0",cy:"0",fill:`url(#${i.radialGradientId})`},[E("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,jK)],8,$K)],8,WK)]),E("path",{class:"path-line",d:t.path,stroke:t.color,"stroke-width":t.strokeWidth,mask:`url(#${i.maskId})`},null,8,qK)],8,zK))])}const px=zb(BK,[["render",XK]]);const YK={class:"m-header"},KK={class:"m-header-wrap"},ZK={class:"m-header-title"},QK={class:"m-header-subtext"},JK={class:"m-header-left",style:{color:"#fff"}},eZ={class:"m-header-right"},tZ={class:"m-header-line"},nZ={__name:"index",props:{title:{type:String,default:"红原县数字畜牧业监管平台"},subText:{type:String,default:"Hongyuan Digital Animal Husbandry Supervision Platform"}},setup(n){return(e,t)=>(Z(),ne("div",YK,[E("div",KK,[E("div",ZK,ie(n.title),1),E("div",QK,ie(n.subText),1)]),E("div",JK,[dp(e.$slots,"left")]),E("div",eZ,[dp(e.$slots,"right")]),E("div",tZ,[Ue(px,{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"}),Ue(px,{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 rZ={class:"m-menu"},iZ={__name:"index",props:{defaultActive:{type:[String,Number],default:""}},emits:["select"],setup(n,{emit:e}){const t=e,r=n,i=Be(r.defaultActive);return sD("updateActive",s=>{i.value=s,t("select",s)}),sD("activeIndex",i),ei(()=>r.defaultActive,s=>{s!==i.value&&(i.value=s)}),(s,o)=>(Z(),ne("div",rZ,[dp(s.$slots,"default")]))}},aZ={__name:"index",props:{index:{type:[String,Number],required:!0}},setup(n){const e=n,t=kd("updateActive"),r=kd("activeIndex"),i=()=>{t(e.index)};return(a,s)=>(Z(),ne("div",{class:Ct(["m-menu-item",{"is-active":n.index===dn(r)}]),onClick:i},[dp(a.$slots,"default")],2))}};let PD=0;const LD="webkit moz ms o".split(" ");let Po,Lo;const sZ=typeof window=="undefined";if(sZ)Po=function(){},Lo=function(){};else{Po=window.requestAnimationFrame,Lo=window.cancelAnimationFrame;let n;for(let e=0;e<LD.length&&!(Po&&Lo);e++)n=LD[e],Po=Po||window[n+"RequestAnimationFrame"],Lo=Lo||window[n+"CancelAnimationFrame"]||window[n+"CancelRequestAnimationFrame"];(!Po||!Lo)&&(Po=function(e){const t=new Date().getTime(),r=Math.max(0,16-(t-PD)),i=window.setTimeout(()=>{e(t+r)},r);return PD=t+r,i},Lo=function(e){window.clearTimeout(e)})}const oZ={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(n){return n>=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(n,e,t,r){return t*(-Math.pow(2,-10*n/r)+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=Po(this.count)},pauseResume(){this.paused?(this.resume(),this.paused=!1):(this.pause(),this.paused=!0)},pause(){Lo(this.rAF)},resume(){this.startTime=null,this.localDuration=+this.remaining,this.localStartVal=+this.printVal,Po(this.count)},reset(){this.startTime=null,Lo(this.rAF),this.displayValue=this.formatNumber(this.startVal)},count(n){this.startTime||(this.startTime=n),this.timestamp=n;const e=n-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.printVal<this.endVal?this.endVal:this.printVal:this.printVal=this.printVal>this.endVal?this.endVal:this.printVal,this.displayValue=this.formatNumber(this.printVal),e<this.localDuration?this.rAF=Po(this.count):this.$emit("callback")},isNumber(n){return!isNaN(parseFloat(n))},formatNumber(n){n=n.toFixed(this.decimals),n+="";const e=n.split(".");let t=e[0];const r=e.length>1?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+r+this.suffix}},destroyed(){Lo(this.rAF)}};function lZ(n,e,t,r,i,a){return Z(),ne("span",null,ie(i.displayValue),1)}const Ez=zb(oZ,[["render",lZ]]);typeof window!="undefined"&&window.Vue&&window.Vue.component("count-to",Ez);const uZ={class:"count-card-left"},cZ={class:"count-card-title"},hZ={class:"title-zh"},fZ={key:0,class:"title-en"},dZ={class:"count-card-right"},pZ={class:"unit"},vZ={__name:"index",props:{info:{type:Object,default:()=>({icon:"xiaoshoujine",zh:"2023年销售金额",en:"Sales amount in 2023",value:9500,unit:"万元",decimals:0})}},setup(n){const e=n,t=Be(!0),r=Be(!1),i=Be(0);let a=null;const s=he(()=>e.info.duration||1800);ei(()=>[e.info.value,e.info.zh],()=>{a&&window.clearTimeout(a),t.value=!0,r.value=!1,i.value+=1},{immediate:!0});function o(c){return c.toUpperCase()}function l(){t.value=!0,r.value=!1}function u(){t.value=!1,r.value=!0,a&&window.clearTimeout(a),a=window.setTimeout(()=>{r.value=!1},900)}return ns(()=>{a&&window.clearTimeout(a)}),(c,h)=>(Z(),ne("div",{class:Ct(["count-card",{"is-counting":t.value,"is-settled":r.value}])},[E("div",uZ,[E("div",{class:Ct(["count-card-icon","icon-"+n.info.icon])},null,2),E("div",cZ,[E("div",hZ,ie(n.info.zh),1),n.info.en?(Z(),ne("div",fZ,ie(o(n.info.en)),1)):mt("",!0)])]),E("div",dZ,[(Z(),ne("div",{class:"value",key:i.value},[Ue(dn(Ez),{startVal:0,endVal:n.info.value,decimals:n.info.decimals,duration:s.value,separator:"",autoplay:!0,onMountedCallback:l,onCallback:u},null,8,["endVal","decimals","duration"])])),E("div",pZ,ie(n.info.unit),1)])],2))}};/*! *****************************************************************************
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 yT=function(n,e){return yT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},yT(n,e)};function ve(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");yT(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var gZ=function(){function n(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return n}(),mZ=function(){function n(){this.browser=new gZ,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 n}(),bu=new mZ;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(bu.wxa=!0,bu.touchEventsSupported=!0):typeof document=="undefined"&&typeof self!="undefined"?bu.worker=!0:!bu.hasGlobalWindow||"Deno"in window?(bu.node=!0,bu.svgSupported=!0):yZ(navigator.userAgent,bu);function yZ(n,e){var t=e.browser,r=n.match(/Firefox\/([\d.]+)/),i=n.match(/MSIE\s([\d.]+)/)||n.match(/Trident\/.+?rv:(([\d.]+))/),a=n.match(/Edge?\/([\d.]+)/),s=/micromessenger/i.test(n);r&&(t.firefox=!0,t.version=r[1]),i&&(t.ie=!0,t.version=i[1]),a&&(t.edge=!0,t.version=a[1],t.newEdge=+a[1].split(".")[0]>18),s&&(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 o=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in o||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in o)&&!("OTransition"in o),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}const on=bu;var hP=12,Pz="sans-serif",lc=hP+"px "+Pz,_Z=20,xZ=100,bZ="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function SZ(n){var e={};if(typeof JSON=="undefined")return e;for(var t=0;t<n.length;t++){var r=String.fromCharCode(t+32),i=(n.charCodeAt(t)-_Z)/xZ;e[r]=i}return e}var wZ=SZ(bZ),uc={createCanvas:function(){return typeof document!="undefined"&&document.createElement("canvas")},measureText:function(){var n,e;return function(t,r){if(!n){var i=uc.createCanvas();n=i&&i.getContext("2d")}if(n)return e!==r&&(e=n.font=r||lc),n.measureText(t);t=t||"",r=r||lc;var a=/((?:\d+)?\.?\d*)px/.exec(r),s=a&&+a[1]||hP,o=0;if(r.indexOf("mono")>=0)o=s*t.length;else for(var l=0;l<t.length;l++){var u=wZ[t[l]];o+=u==null?s:u*s}return{width:o}}}(),loadImage:function(n,e,t){var r=new Image;return r.onload=e,r.onerror=t,r.src=n,r}},Lz=Yo(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(n,e){return n["[object "+e+"]"]=!0,n},{}),Rz=Yo(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(n,e){return n["[object "+e+"Array]"]=!0,n},{}),Wp=Object.prototype.toString,$b=Array.prototype,AZ=$b.forEach,MZ=$b.filter,fP=$b.slice,TZ=$b.map,RD=function(){}.constructor,my=RD?RD.prototype:null,dP="__proto__",CZ=2311;function Dz(){return CZ++}function pP(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];typeof console!="undefined"&&console.error.apply(console,n)}function yt(n){if(n==null||typeof n!="object")return n;var e=n,t=Wp.call(n);if(t==="[object Array]"){if(!Zg(n)){e=[];for(var r=0,i=n.length;r<i;r++)e[r]=yt(n[r])}}else if(Rz[t]){if(!Zg(n)){var a=n.constructor;if(a.from)e=a.from(n);else{e=new a(n.length);for(var r=0,i=n.length;r<i;r++)e[r]=n[r]}}}else if(!Lz[t]&&!Zg(n)&&!xp(n)){e={};for(var s in n)n.hasOwnProperty(s)&&s!==dP&&(e[s]=yt(n[s]))}return e}function It(n,e,t){if(!gt(e)||!gt(n))return t?yt(e):n;for(var r in e)if(e.hasOwnProperty(r)&&r!==dP){var i=n[r],a=e[r];gt(a)&&gt(i)&&!Ie(a)&&!Ie(i)&&!xp(a)&&!xp(i)&&!DD(a)&&!DD(i)&&!Zg(a)&&!Zg(i)?It(i,a,t):(t||!(r in n))&&(n[r]=yt(e[r]))}return n}function vP(n,e){for(var t=n[0],r=1,i=n.length;r<i;r++)t=It(t,n[r],e);return t}function Pe(n,e){if(Object.assign)Object.assign(n,e);else for(var t in e)e.hasOwnProperty(t)&&t!==dP&&(n[t]=e[t]);return n}function dt(n,e,t){for(var r=Yt(e),i=0,a=r.length;i<a;i++){var s=r[i];(t?e[s]!=null:n[s]==null)&&(n[s]=e[s])}return n}function Ft(n,e){if(n){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t}return-1}function EZ(n,e){var t=n.prototype;function r(){}r.prototype=e.prototype,n.prototype=new r;for(var i in t)t.hasOwnProperty(i)&&(n.prototype[i]=t[i]);n.prototype.constructor=n,n.superClass=e}function zr(n,e,t){if(n="prototype"in n?n.prototype:n,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var r=Object.getOwnPropertyNames(e),i=0;i<r.length;i++){var a=r[i];a!=="constructor"&&(t?e[a]!=null:n[a]==null)&&(n[a]=e[a])}else dt(n,e,t)}function Hi(n){return!n||typeof n=="string"?!1:typeof n.length=="number"}function z(n,e,t){if(n&&e)if(n.forEach&&n.forEach===AZ)n.forEach(e,t);else if(n.length===+n.length)for(var r=0,i=n.length;r<i;r++)e.call(t,n[r],r,n);else for(var a in n)n.hasOwnProperty(a)&&e.call(t,n[a],a,n)}function Ne(n,e,t){if(!n)return[];if(!e)return gP(n);if(n.map&&n.map===TZ)return n.map(e,t);for(var r=[],i=0,a=n.length;i<a;i++)r.push(e.call(t,n[i],i,n));return r}function Yo(n,e,t,r){if(n&&e){for(var i=0,a=n.length;i<a;i++)t=e.call(r,t,n[i],i,n);return t}}function _n(n,e,t){if(!n)return[];if(!e)return gP(n);if(n.filter&&n.filter===MZ)return n.filter(e,t);for(var r=[],i=0,a=n.length;i<a;i++)e.call(t,n[i],i,n)&&r.push(n[i]);return r}function PZ(n,e,t){if(n&&e){for(var r=0,i=n.length;r<i;r++)if(e.call(t,n[r],r,n))return n[r]}}function Yt(n){if(!n)return[];if(Object.keys)return Object.keys(n);var e=[];for(var t in n)n.hasOwnProperty(t)&&e.push(t);return e}function LZ(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return function(){return n.apply(e,t.concat(fP.call(arguments)))}}var Qe=my&&ct(my.bind)?my.call.bind(my.bind):LZ;function Rt(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return function(){return n.apply(this,e.concat(fP.call(arguments)))}}function Ie(n){return Array.isArray?Array.isArray(n):Wp.call(n)==="[object Array]"}function ct(n){return typeof n=="function"}function Ke(n){return typeof n=="string"}function _T(n){return Wp.call(n)==="[object String]"}function un(n){return typeof n=="number"}function gt(n){var e=typeof n;return e==="function"||!!n&&e==="object"}function DD(n){return!!Lz[Wp.call(n)]}function Pa(n){return!!Rz[Wp.call(n)]}function xp(n){return typeof n=="object"&&typeof n.nodeType=="number"&&typeof n.ownerDocument=="object"}function jb(n){return n.colorStops!=null}function RZ(n){return n.image!=null}function DZ(n){return Wp.call(n)==="[object RegExp]"}function Im(n){return n!==n}function di(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=0,r=n.length;t<r;t++)if(n[t]!=null)return n[t]}function Et(n,e){return n!=null?n:e}function Ho(n,e,t){return n!=null?n:e!=null?e:t}function gP(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return fP.apply(n,e)}function mP(n){if(typeof n=="number")return[n,n,n,n];var e=n.length;return e===2?[n[0],n[1],n[0],n[1]]:e===3?[n[0],n[1],n[2],n[1]]:n}function sa(n,e){if(!n)throw new Error(e)}function no(n){return n==null?null:typeof n.trim=="function"?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var Iz="__ec_primitive__";function vx(n){n[Iz]=!0}function Zg(n){return n[Iz]}var IZ=function(){function n(){this.data={}}return n.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},n.prototype.has=function(e){return this.data.hasOwnProperty(e)},n.prototype.get=function(e){return this.data[e]},n.prototype.set=function(e,t){return this.data[e]=t,this},n.prototype.keys=function(){return Yt(this.data)},n.prototype.forEach=function(e){var t=this.data;for(var r in t)t.hasOwnProperty(r)&&e(t[r],r)},n}(),Nz=typeof Map=="function";function NZ(){return Nz?new Map:new IZ}var kZ=function(){function n(e){var t=Ie(e);this.data=NZ();var r=this;e instanceof n?e.each(i):e&&z(e,i);function i(a,s){t?r.set(a,s):r.set(s,a)}}return n.prototype.hasKey=function(e){return this.data.has(e)},n.prototype.get=function(e){return this.data.get(e)},n.prototype.set=function(e,t){return this.data.set(e,t),t},n.prototype.each=function(e,t){this.data.forEach(function(r,i){e.call(t,r,i)})},n.prototype.keys=function(){var e=this.data.keys();return Nz?Array.from(e):e},n.prototype.removeKey=function(e){this.data.delete(e)},n}();function st(n){return new kZ(n)}function Nm(n,e){for(var t=new n.constructor(n.length+e.length),r=0;r<n.length;r++)t[r]=n[r];for(var i=n.length,r=0;r<e.length;r++)t[r+i]=e[r];return t}function qb(n,e){var t;if(Object.create)t=Object.create(n);else{var r=function(){};r.prototype=n,t=new r}return e&&Pe(t,e),t}function kz(n){var e=n.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function tt(n,e){return n.hasOwnProperty(e)}function Er(){}var T1=180/Math.PI;function bf(n,e){return n==null&&(n=0),e==null&&(e=0),[n,e]}function Qi(n,e){return n[0]=e[0],n[1]=e[1],n}function Rl(n){return[n[0],n[1]]}function OZ(n,e,t){return n[0]=e,n[1]=t,n}function ID(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n}function xT(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n}function Ch(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n}function bT(n){return Math.sqrt(FZ(n))}function FZ(n){return n[0]*n[0]+n[1]*n[1]}function C1(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n}function $p(n,e){var t=bT(e);return t===0?(n[0]=0,n[1]=0):(n[0]=e[0]/t,n[1]=e[1]/t),n}function ST(n,e){return Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]))}var Ou=ST;function BZ(n,e){return(n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])}var Vh=BZ;function E1(n,e,t,r){return n[0]=e[0]+r*(t[0]-e[0]),n[1]=e[1]+r*(t[1]-e[1]),n}function Mi(n,e,t){var r=e[0],i=e[1];return n[0]=t[0]*r+t[2]*i+t[4],n[1]=t[1]*r+t[3]*i+t[5],n}function Fu(n,e,t){return n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n}function Bu(n,e,t){return n[0]=Math.max(e[0],t[0]),n[1]=Math.max(e[1],t[1]),n}var kf=function(){function n(e,t){this.target=e,this.topTarget=t&&t.topTarget}return n}(),GZ=function(){function n(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return n.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new kf(t,e),"dragstart",e.event))},n.prototype._drag=function(e){var t=this._draggingTarget;if(t){var r=e.offsetX,i=e.offsetY,a=r-this._x,s=i-this._y;this._x=r,this._y=i,t.drift(a,s,e),this.handler.dispatchToElement(new kf(t,e),"drag",e.event);var o=this.handler.findHover(r,i,t).target,l=this._dropTarget;this._dropTarget=o,t!==o&&(l&&o!==l&&this.handler.dispatchToElement(new kf(l,e),"dragleave",e.event),o&&o!==l&&this.handler.dispatchToElement(new kf(o,e),"dragenter",e.event))}},n.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new kf(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new kf(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},n}();const zZ=GZ;var UZ=function(){function n(e){e&&(this._$eventProcessor=e)}return n.prototype.on=function(e,t,r,i){this._$handlers||(this._$handlers={});var a=this._$handlers;if(typeof t=="function"&&(i=r,r=t,t=null),!r||!e)return this;var s=this._$eventProcessor;t!=null&&s&&s.normalizeQuery&&(t=s.normalizeQuery(t)),a[e]||(a[e]=[]);for(var o=0;o<a[e].length;o++)if(a[e][o].h===r)return this;var l={h:r,query:t,ctx:i||this,callAtLast:r.zrEventfulCallAtLast},u=a[e].length-1,c=a[e][u];return c&&c.callAtLast?a[e].splice(u,0,l):a[e].push(l),this},n.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},n.prototype.off=function(e,t){var r=this._$handlers;if(!r)return this;if(!e)return this._$handlers={},this;if(t){if(r[e]){for(var i=[],a=0,s=r[e].length;a<s;a++)r[e][a].h!==t&&i.push(r[e][a]);r[e]=i}r[e]&&r[e].length===0&&delete r[e]}else delete r[e];return this},n.prototype.trigger=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!this._$handlers)return this;var i=this._$handlers[e],a=this._$eventProcessor;if(i)for(var s=t.length,o=i.length,l=0;l<o;l++){var u=i[l];if(!(a&&a.filter&&u.query!=null&&!a.filter(e,u.query)))switch(s){case 0:u.h.call(u.ctx);break;case 1:u.h.call(u.ctx,t[0]);break;case 2:u.h.call(u.ctx,t[0],t[1]);break;default:u.h.apply(u.ctx,t);break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},n.prototype.triggerWithContext=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!this._$handlers)return this;var i=this._$handlers[e],a=this._$eventProcessor;if(i)for(var s=t.length,o=t[s-1],l=i.length,u=0;u<l;u++){var c=i[u];if(!(a&&a.filter&&c.query!=null&&!a.filter(e,c.query)))switch(s){case 0:c.h.call(o);break;case 1:c.h.call(o,t[0]);break;case 2:c.h.call(o,t[0],t[1]);break;default:c.h.apply(o,t.slice(1,s-1));break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},n}();const Bs=UZ;var VZ=Math.log(2);function wT(n,e,t,r,i,a){var s=r+"-"+i,o=n.length;if(a.hasOwnProperty(s))return a[s];if(e===1){var l=Math.round(Math.log((1<<o)-1&~i)/VZ);return n[t][l]}for(var u=r|1<<t,c=t+1;r&1<<c;)c++;for(var h=0,f=0,d=0;f<o;f++){var p=1<<f;p&i||(h+=(d%2?-1:1)*n[t][f]*wT(n,e-1,c,u,i|p,a),d++)}return a[s]=h,h}function ND(n,e){var t=[[n[0],n[1],1,0,0,0,-e[0]*n[0],-e[0]*n[1]],[0,0,0,n[0],n[1],1,-e[1]*n[0],-e[1]*n[1]],[n[2],n[3],1,0,0,0,-e[2]*n[2],-e[2]*n[3]],[0,0,0,n[2],n[3],1,-e[3]*n[2],-e[3]*n[3]],[n[4],n[5],1,0,0,0,-e[4]*n[4],-e[4]*n[5]],[0,0,0,n[4],n[5],1,-e[5]*n[4],-e[5]*n[5]],[n[6],n[7],1,0,0,0,-e[6]*n[6],-e[6]*n[7]],[0,0,0,n[6],n[7],1,-e[7]*n[6],-e[7]*n[7]]],r={},i=wT(t,8,0,0,0,r);if(i!==0){for(var a=[],s=0;s<8;s++)for(var o=0;o<8;o++)a[o]==null&&(a[o]=0),a[o]+=((s+o)%2?-1:1)*wT(t,7,s===0?1:0,1<<s,1<<o,r)/i*e[s];return function(l,u,c){var h=u*a[6]+c*a[7]+1;l[0]=(u*a[0]+c*a[1]+a[2])/h,l[1]=(u*a[3]+c*a[4]+a[5])/h}}}var kD="___zrEVENTSAVED",Tw=[];function HZ(n,e,t,r,i){return AT(Tw,e,r,i,!0)&&AT(n,t,Tw[0],Tw[1])}function AT(n,e,t,r,i){if(e.getBoundingClientRect&&on.domSupported&&!Oz(e)){var a=e[kD]||(e[kD]={}),s=WZ(e,a),o=$Z(s,a,i);if(o)return o(n,t,r),!0}return!1}function WZ(n,e){var t=e.markers;if(t)return t;t=e.markers=[];for(var r=["left","right"],i=["top","bottom"],a=0;a<4;a++){var s=document.createElement("div"),o=s.style,l=a%2,u=(a>>1)%2;o.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[l]+":0",i[u]+":0",r[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),n.appendChild(s),t.push(s)}return t}function $Z(n,e,t){for(var r=t?"invTrans":"trans",i=e[r],a=e.srcCoords,s=[],o=[],l=!0,u=0;u<4;u++){var c=n[u].getBoundingClientRect(),h=2*u,f=c.left,d=c.top;s.push(f,d),l=l&&a&&f===a[h]&&d===a[h+1],o.push(n[u].offsetLeft,n[u].offsetTop)}return l&&i?i:(e.srcCoords=s,e[r]=t?ND(o,s):ND(s,o))}function Oz(n){return n.nodeName.toUpperCase()==="CANVAS"}var jZ=/([&<>"'])/g,qZ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Bi(n){return n==null?"":(n+"").replace(jZ,function(e,t){return qZ[t]})}var XZ=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Cw=[],YZ=on.browser.firefox&&+on.browser.version.split(".")[0]<39;function MT(n,e,t,r){return t=t||{},r?OD(n,e,t):YZ&&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):OD(n,e,t),t}function OD(n,e,t){if(on.domSupported&&n.getBoundingClientRect){var r=e.clientX,i=e.clientY;if(Oz(n)){var a=n.getBoundingClientRect();t.zrX=r-a.left,t.zrY=i-a.top;return}else if(AT(Cw,n,r,i)){t.zrX=Cw[0],t.zrY=Cw[1];return}}t.zrX=t.zrY=0}function yP(n){return n||window.event}function vs(n,e,t){if(e=yP(e),e.zrX!=null)return e;var r=e.type,i=r&&r.indexOf("touch")>=0;if(i){var s=r!=="touchend"?e.targetTouches[0]:e.changedTouches[0];s&&MT(n,s,e,t)}else{MT(n,e,e,t);var a=KZ(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var o=e.button;return e.which==null&&o!==void 0&&XZ.test(e.type)&&(e.which=o&1?1:o&2?3:o&4?2:0),e}function KZ(n){var e=n.wheelDelta;if(e)return e;var t=n.deltaX,r=n.deltaY;if(t==null||r==null)return e;var i=Math.abs(r!==0?r:t),a=r>0?-1:r<0?1:t>0?-1:1;return 3*i*a}function TT(n,e,t,r){n.addEventListener(e,t,r)}function ZZ(n,e,t,r){n.removeEventListener(e,t,r)}var Bl=function(n){n.preventDefault(),n.stopPropagation(),n.cancelBubble=!0};function FD(n){return n.which===2||n.which===3}var QZ=function(){function n(){this._track=[]}return n.prototype.recognize=function(e,t,r){return this._doTrack(e,t,r),this._recognize(e)},n.prototype.clear=function(){return this._track.length=0,this},n.prototype._doTrack=function(e,t,r){var i=e.touches;if(i){for(var a={points:[],touches:[],target:t,event:e},s=0,o=i.length;s<o;s++){var l=i[s],u=MT(r,l,{});a.points.push([u.zrX,u.zrY]),a.touches.push(l)}this._track.push(a)}},n.prototype._recognize=function(e){for(var t in Ew)if(Ew.hasOwnProperty(t)){var r=Ew[t](this._track,e);if(r)return r}},n}();function BD(n){var e=n[1][0]-n[0][0],t=n[1][1]-n[0][1];return Math.sqrt(e*e+t*t)}function JZ(n){return[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]}var Ew={pinch:function(n,e){var t=n.length;if(t){var r=(n[t-1]||{}).points,i=(n[t-2]||{}).points||r;if(i&&i.length>1&&r&&r.length>1){var a=BD(r)/BD(i);!isFinite(a)&&(a=1),e.pinchScale=a;var s=JZ(r);return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:n[0].target,event:e}}}}};function Za(){return[1,0,0,1,0,0]}function Xb(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n[4]=0,n[5]=0,n}function _P(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function Dl(n,e,t){var r=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],s=e[1]*t[2]+e[3]*t[3],o=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return n[0]=r,n[1]=i,n[2]=a,n[3]=s,n[4]=o,n[5]=l,n}function Ko(n,e,t){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4]+t[0],n[5]=e[5]+t[1],n}function Sf(n,e,t,r){r===void 0&&(r=[0,0]);var i=e[0],a=e[2],s=e[4],o=e[1],l=e[3],u=e[5],c=Math.sin(t),h=Math.cos(t);return n[0]=i*h+o*c,n[1]=-i*c+o*h,n[2]=a*h+l*c,n[3]=-a*c+h*l,n[4]=h*(s-r[0])+c*(u-r[1])+r[0],n[5]=h*(u-r[1])-c*(s-r[0])+r[1],n}function xP(n,e,t){var r=t[0],i=t[1];return n[0]=e[0]*r,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*i,n}function jp(n,e){var t=e[0],r=e[2],i=e[4],a=e[1],s=e[3],o=e[5],l=t*s-a*r;return l?(l=1/l,n[0]=s*l,n[1]=-a*l,n[2]=-r*l,n[3]=t*l,n[4]=(r*o-s*i)*l,n[5]=(a*i-t*o)*l,n):null}function eQ(n){var e=Za();return _P(e,n),e}var tQ=function(){function n(e,t){this.x=e||0,this.y=t||0}return n.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.set=function(e,t){return this.x=e,this.y=t,this},n.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},n.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},n.prototype.scale=function(e){this.x*=e,this.y*=e},n.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},n.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},n.prototype.dot=function(e){return this.x*e.x+this.y*e.y},n.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},n.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},n.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},n.prototype.distance=function(e){var t=this.x-e.x,r=this.y-e.y;return Math.sqrt(t*t+r*r)},n.prototype.distanceSquare=function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r},n.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},n.prototype.transform=function(e){if(e){var t=this.x,r=this.y;return this.x=e[0]*t+e[2]*r+e[4],this.y=e[1]*t+e[3]*r+e[5],this}},n.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},n.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},n.set=function(e,t,r){e.x=t,e.y=r},n.copy=function(e,t){e.x=t.x,e.y=t.y},n.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},n.lenSquare=function(e){return e.x*e.x+e.y*e.y},n.dot=function(e,t){return e.x*t.x+e.y*t.y},n.add=function(e,t,r){e.x=t.x+r.x,e.y=t.y+r.y},n.sub=function(e,t,r){e.x=t.x-r.x,e.y=t.y-r.y},n.scale=function(e,t,r){e.x=t.x*r,e.y=t.y*r},n.scaleAndAdd=function(e,t,r,i){e.x=t.x+r.x*i,e.y=t.y+r.y*i},n.lerp=function(e,t,r,i){var a=1-i;e.x=a*t.x+i*r.x,e.y=a*t.y+i*r.y},n}();const Nt=tQ;var yy=Math.min,_y=Math.max,Rc=new Nt,Dc=new Nt,Ic=new Nt,Nc=new Nt,Ov=new Nt,Fv=new Nt,nQ=function(){function n(e,t,r,i){r<0&&(e=e+r,r=-r),i<0&&(t=t+i,i=-i),this.x=e,this.y=t,this.width=r,this.height=i}return n.prototype.union=function(e){var t=yy(e.x,this.x),r=yy(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=_y(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=_y(e.y+e.height,this.y+this.height)-r:this.height=e.height,this.x=t,this.y=r},n.prototype.applyTransform=function(e){n.applyTransform(this,this,e)},n.prototype.calculateTransform=function(e){var t=this,r=e.width/t.width,i=e.height/t.height,a=Za();return Ko(a,a,[-t.x,-t.y]),xP(a,a,[r,i]),Ko(a,a,[e.x,e.y]),a},n.prototype.intersect=function(e,t){if(!e)return!1;e instanceof n||(e=n.create(e));var r=this,i=r.x,a=r.x+r.width,s=r.y,o=r.y+r.height,l=e.x,u=e.x+e.width,c=e.y,h=e.y+e.height,f=!(a<l||u<i||o<c||h<s);if(t){var d=1/0,p=0,g=Math.abs(a-l),v=Math.abs(u-i),m=Math.abs(o-c),y=Math.abs(h-s),_=Math.min(g,v),x=Math.min(m,y);a<l||u<i?_>p&&(p=_,g<v?Nt.set(Fv,-g,0):Nt.set(Fv,v,0)):_<d&&(d=_,g<v?Nt.set(Ov,g,0):Nt.set(Ov,-v,0)),o<c||h<s?x>p&&(p=x,m<y?Nt.set(Fv,0,-m):Nt.set(Fv,0,y)):_<d&&(d=_,m<y?Nt.set(Ov,0,m):Nt.set(Ov,0,-y))}return t&&Nt.copy(t,f?Ov:Fv),f},n.prototype.contain=function(e,t){var r=this;return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height},n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.copy=function(e){n.copy(this,e)},n.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},n.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},n.prototype.isZero=function(){return this.width===0||this.height===0},n.create=function(e){return new n(e.x,e.y,e.width,e.height)},n.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},n.applyTransform=function(e,t,r){if(!r){e!==t&&n.copy(e,t);return}if(r[1]<1e-5&&r[1]>-1e-5&&r[2]<1e-5&&r[2]>-1e-5){var i=r[0],a=r[3],s=r[4],o=r[5];e.x=t.x*i+s,e.y=t.y*a+o,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}Rc.x=Ic.x=t.x,Rc.y=Nc.y=t.y,Dc.x=Nc.x=t.x+t.width,Dc.y=Ic.y=t.y+t.height,Rc.transform(r),Nc.transform(r),Dc.transform(r),Ic.transform(r),e.x=yy(Rc.x,Dc.x,Ic.x,Nc.x),e.y=yy(Rc.y,Dc.y,Ic.y,Nc.y);var l=_y(Rc.x,Dc.x,Ic.x,Nc.x),u=_y(Rc.y,Dc.y,Ic.y,Nc.y);e.width=l-e.x,e.height=u-e.y},n}();const Ot=nQ;var Fz="silent";function rQ(n,e,t){return{type:n,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:iQ}}function iQ(){Bl(this.event)}var aQ=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Bs),Bv=function(){function n(e,t){this.x=e,this.y=t}return n}(),sQ=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Pw=new Ot(0,0,0,0),Bz=function(n){ve(e,n);function e(t,r,i,a,s){var o=n.call(this)||this;return o._hovered=new Bv(0,0),o.storage=t,o.painter=r,o.painterRoot=a,o._pointerSize=s,i=i||new aQ,o.proxy=null,o.setHandlerProxy(i),o._draggingMgr=new zZ(o),o}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(z(sQ,function(r){t.on&&t.on(r,this[r],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var r=t.zrX,i=t.zrY,a=Gz(this,r,i),s=this._hovered,o=s.target;o&&!o.__zr&&(s=this.findHover(s.x,s.y),o=s.target);var l=this._hovered=a?new Bv(r,i):this.findHover(r,i),u=l.target,c=this.proxy;c.setCursor&&c.setCursor(u?u.cursor:"default"),o&&u!==o&&this.dispatchToElement(s,"mouseout",t),this.dispatchToElement(l,"mousemove",t),u&&u!==o&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var r=t.zrEventControl;r!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),r!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new Bv(0,0)},e.prototype.dispatch=function(t,r){var i=this[t];i&&i.call(this,r)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var r=this.proxy;r.setCursor&&r.setCursor(t)},e.prototype.dispatchToElement=function(t,r,i){t=t||{};var a=t.target;if(!(a&&a.silent)){for(var s="on"+r,o=rQ(r,t,i);a&&(a[s]&&(o.cancelBubble=!!a[s].call(a,o)),a.trigger(r,o),a=a.__hostTarget?a.__hostTarget:a.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(r,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[s]=="function"&&l[s].call(l,o),l.trigger&&l.trigger(r,o)}))}},e.prototype.findHover=function(t,r,i){var a=this.storage.getDisplayList(),s=new Bv(t,r);if(GD(a,s,t,r,i),this._pointerSize&&!s.target){for(var o=[],l=this._pointerSize,u=l/2,c=new Ot(t-u,r-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)&&(Pw.copy(f.getBoundingRect()),f.transform&&Pw.applyTransform(f.transform),Pw.intersect(c)&&o.push(f))}if(o.length)for(var d=4,p=Math.PI/12,g=Math.PI*2,v=0;v<u;v+=d)for(var m=0;m<g;m+=p){var y=t+v*Math.cos(m),_=r+v*Math.sin(m);if(GD(o,s,y,_,i),s.target)return s}}return s},e.prototype.processGesture=function(t,r){this._gestureMgr||(this._gestureMgr=new QZ);var i=this._gestureMgr;r==="start"&&i.clear();var a=i.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if(r==="end"&&i.clear(),a){var s=a.type;t.gestureEvent=s;var o=new Bv;o.target=a.target,this.dispatchToElement(o,s,a.event)}},e}(Bs);z(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(n){Bz.prototype[n]=function(e){var t=e.zrX,r=e.zrY,i=Gz(this,t,r),a,s;if((n!=="mouseup"||!i)&&(a=this.findHover(t,r),s=a.target),n==="mousedown")this._downEl=s,this._downPoint=[e.zrX,e.zrY],this._upEl=s;else if(n==="mouseup")this._upEl=s;else if(n==="click"){if(this._downEl!==this._upEl||!this._downPoint||Ou(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(a,n,e)}});function oQ(n,e,t){if(n[n.rectHover?"rectContain":"contain"](e,t)){for(var r=n,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var s=r.getClipPath();if(s&&!s.contain(e,t))return!1}r.silent&&(i=!0);var o=r.__hostTarget;r=o||r.parent}return i?Fz:!0}return!1}function GD(n,e,t,r,i){for(var a=n.length-1;a>=0;a--){var s=n[a],o=void 0;if(s!==i&&!s.ignore&&(o=oQ(s,t,r))&&(!e.topTarget&&(e.topTarget=s),o!==Fz)){e.target=s;break}}}function Gz(n,e,t){var r=n.painter;return e<0||e>r.getWidth()||t<0||t>r.getHeight()}const lQ=Bz;var zz=32,Gv=7;function uQ(n){for(var e=0;n>=zz;)e|=n&1,n>>=1;return n+e}function zD(n,e,t,r){var i=e+1;if(i===t)return 1;if(r(n[i++],n[e])<0){for(;i<t&&r(n[i],n[i-1])<0;)i++;cQ(n,e,i)}else for(;i<t&&r(n[i],n[i-1])>=0;)i++;return i-e}function cQ(n,e,t){for(t--;e<t;){var r=n[e];n[e++]=n[t],n[t--]=r}}function UD(n,e,t,r,i){for(r===e&&r++;r<t;r++){for(var a=n[r],s=e,o=r,l;s<o;)l=s+o>>>1,i(a,n[l])<0?o=l:s=l+1;var u=r-s;switch(u){case 3:n[s+3]=n[s+2];case 2:n[s+2]=n[s+1];case 1:n[s+1]=n[s];break;default:for(;u>0;)n[s+u]=n[s+u-1],u--}n[s]=a}}function Lw(n,e,t,r,i,a){var s=0,o=0,l=1;if(a(n,e[t+i])>0){for(o=r-i;l<o&&a(n,e[t+i+l])>0;)s=l,l=(l<<1)+1,l<=0&&(l=o);l>o&&(l=o),s+=i,l+=i}else{for(o=i+1;l<o&&a(n,e[t+i-l])<=0;)s=l,l=(l<<1)+1,l<=0&&(l=o);l>o&&(l=o);var u=s;s=i-l,l=i-u}for(s++;s<l;){var c=s+(l-s>>>1);a(n,e[t+c])>0?s=c+1:l=c}return l}function Rw(n,e,t,r,i,a){var s=0,o=0,l=1;if(a(n,e[t+i])<0){for(o=i+1;l<o&&a(n,e[t+i-l])<0;)s=l,l=(l<<1)+1,l<=0&&(l=o);l>o&&(l=o);var u=s;s=i-l,l=i-u}else{for(o=r-i;l<o&&a(n,e[t+i+l])>=0;)s=l,l=(l<<1)+1,l<=0&&(l=o);l>o&&(l=o),s+=i,l+=i}for(s++;s<l;){var c=s+(l-s>>>1);a(n,e[t+c])<0?l=c:s=c+1}return l}function hQ(n,e){var t=Gv,r,i,a=0,s=[];r=[],i=[];function o(d,p){r[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]&&d--;else if(i[d]>i[d+1])break;c(d)}}function u(){for(;a>1;){var d=a-2;d>0&&i[d-1]<i[d+1]&&d--,c(d)}}function c(d){var p=r[d],g=i[d],v=r[d+1],m=i[d+1];i[d]=g+m,d===a-3&&(r[d+1]=r[d+2],i[d+1]=i[d+2]),a--;var y=Rw(n[v],n,p,g,0,e);p+=y,g-=y,g!==0&&(m=Lw(n[p+g-1],n,v,m,m-1,e),m!==0&&(g<=m?h(p,g,v,m):f(p,g,v,m)))}function h(d,p,g,v){var m=0;for(m=0;m<p;m++)s[m]=n[d+m];var y=0,_=g,x=d;if(n[x++]=n[_++],--v===0){for(m=0;m<p;m++)n[x+m]=s[y+m];return}if(p===1){for(m=0;m<v;m++)n[x+m]=n[_+m];n[x+v]=s[y];return}for(var b=t,S,w,T;;){S=0,w=0,T=!1;do if(e(n[_],s[y])<0){if(n[x++]=n[_++],w++,S=0,--v===0){T=!0;break}}else if(n[x++]=s[y++],S++,w=0,--p===1){T=!0;break}while((S|w)<b);if(T)break;do{if(S=Rw(n[_],s,y,p,0,e),S!==0){for(m=0;m<S;m++)n[x+m]=s[y+m];if(x+=S,y+=S,p-=S,p<=1){T=!0;break}}if(n[x++]=n[_++],--v===0){T=!0;break}if(w=Lw(s[y],n,_,v,0,e),w!==0){for(m=0;m<w;m++)n[x+m]=n[_+m];if(x+=w,_+=w,v-=w,v===0){T=!0;break}}if(n[x++]=s[y++],--p===1){T=!0;break}b--}while(S>=Gv||w>=Gv);if(T)break;b<0&&(b=0),b+=2}if(t=b,t<1&&(t=1),p===1){for(m=0;m<v;m++)n[x+m]=n[_+m];n[x+v]=s[y]}else{if(p===0)throw new Error;for(m=0;m<p;m++)n[x+m]=s[y+m]}}function f(d,p,g,v){var m=0;for(m=0;m<v;m++)s[m]=n[g+m];var y=d+p-1,_=v-1,x=g+v-1,b=0,S=0;if(n[x--]=n[y--],--p===0){for(b=x-(v-1),m=0;m<v;m++)n[b+m]=s[m];return}if(v===1){for(x-=p,y-=p,S=x+1,b=y+1,m=p-1;m>=0;m--)n[S+m]=n[b+m];n[x]=s[_];return}for(var w=t;;){var T=0,C=0,A=!1;do if(e(s[_],n[y])<0){if(n[x--]=n[y--],T++,C=0,--p===0){A=!0;break}}else if(n[x--]=s[_--],C++,T=0,--v===1){A=!0;break}while((T|C)<w);if(A)break;do{if(T=p-Rw(s[_],n,d,p,p-1,e),T!==0){for(x-=T,y-=T,p-=T,S=x+1,b=y+1,m=T-1;m>=0;m--)n[S+m]=n[b+m];if(p===0){A=!0;break}}if(n[x--]=s[_--],--v===1){A=!0;break}if(C=v-Lw(n[y],s,0,v,v-1,e),C!==0){for(x-=C,_-=C,v-=C,S=x+1,b=_+1,m=0;m<C;m++)n[S+m]=s[b+m];if(v<=1){A=!0;break}}if(n[x--]=n[y--],--p===0){A=!0;break}w--}while(T>=Gv||C>=Gv);if(A)break;w<0&&(w=0),w+=2}if(t=w,t<1&&(t=1),v===1){for(x-=p,y-=p,S=x+1,b=y+1,m=p-1;m>=0;m--)n[S+m]=n[b+m];n[x]=s[_]}else{if(v===0)throw new Error;for(b=x-(v-1),m=0;m<v;m++)n[b+m]=s[m]}}return{mergeRuns:l,forceMergeRuns:u,pushRun:o}}function P1(n,e,t,r){t||(t=0),r||(r=n.length);var i=r-t;if(!(i<2)){var a=0;if(i<zz){a=zD(n,t,r,e),UD(n,t,r,t+a,e);return}var s=hQ(n,e),o=uQ(i);do{if(a=zD(n,t,r,e),a<o){var l=i;l>o&&(l=o),UD(n,t,t+l,t+a,e),a=l}s.pushRun(t,a),s.mergeRuns(),i-=a,t+=a}while(i!==0);s.forceMergeRuns()}}var Wa=1,Lg=2,Cd=4,VD=!1;function Dw(){VD||(VD=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function HD(n,e){return n.zlevel===e.zlevel?n.z===e.z?n.z2-e.z2:n.z-e.z:n.zlevel-e.zlevel}var fQ=function(){function n(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=HD}return n.prototype.traverse=function(e,t){for(var r=0;r<this._roots.length;r++)this._roots[r].traverse(e,t)},n.prototype.getDisplayList=function(e,t){t=t||!1;var r=this._displayList;return(e||!r.length)&&this.updateDisplayList(t),r},n.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,r=this._displayList,i=0,a=t.length;i<a;i++)this._updateAndAddDisplayable(t[i],null,e);r.length=this._displayListLen,P1(r,HD)},n.prototype._updateAndAddDisplayable=function(e,t,r){if(!(e.ignore&&!r)){e.beforeUpdate(),e.update(),e.afterUpdate();var i=e.getClipPath();if(e.ignoreClip)t=null;else if(i){t?t=t.slice():t=[];for(var a=i,s=e;a;)a.parent=s,a.updateTransform(),t.push(a),s=a,a=a.getClipPath()}if(e.childrenRef){for(var o=e.childrenRef(),l=0;l<o.length;l++){var u=o[l];e.__dirty&&(u.__dirty|=Wa),this._updateAndAddDisplayable(u,t,r)}e.__dirty=0}else{var c=e;t&&t.length?c.__clipPaths=t:c.__clipPaths&&c.__clipPaths.length>0&&(c.__clipPaths=[]),isNaN(c.z)&&(Dw(),c.z=0),isNaN(c.z2)&&(Dw(),c.z2=0),isNaN(c.zlevel)&&(Dw(),c.zlevel=0),this._displayList[this._displayListLen++]=c}var h=e.getDecalElement&&e.getDecalElement();h&&this._updateAndAddDisplayable(h,t,r);var f=e.getTextGuideLine();f&&this._updateAndAddDisplayable(f,t,r);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,t,r)}},n.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},n.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,r=e.length;t<r;t++)this.delRoot(e[t]);return}var i=Ft(this._roots,e);i>=0&&this._roots.splice(i,1)},n.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},n.prototype.getRoots=function(){return this._roots},n.prototype.dispose=function(){this._displayList=null,this._roots=null},n}();const dQ=fQ;var Uz;Uz=on.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(n){return setTimeout(n,16)};const CT=Uz;var L1={linear:function(n){return n},quadraticIn:function(n){return n*n},quadraticOut:function(n){return n*(2-n)},quadraticInOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)},cubicIn:function(n){return n*n*n},cubicOut:function(n){return--n*n*n+1},cubicInOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)},quarticIn:function(n){return n*n*n*n},quarticOut:function(n){return 1- --n*n*n*n},quarticInOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)},quinticIn:function(n){return n*n*n*n*n},quinticOut:function(n){return--n*n*n*n*n+1},quinticInOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)},sinusoidalIn:function(n){return 1-Math.cos(n*Math.PI/2)},sinusoidalOut:function(n){return Math.sin(n*Math.PI/2)},sinusoidalInOut:function(n){return .5*(1-Math.cos(Math.PI*n))},exponentialIn:function(n){return n===0?0:Math.pow(1024,n-1)},exponentialOut:function(n){return n===1?1:1-Math.pow(2,-10*n)},exponentialInOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)},circularIn:function(n){return 1-Math.sqrt(1-n*n)},circularOut:function(n){return Math.sqrt(1- --n*n)},circularInOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)},elasticIn:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)))},elasticOut:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*n)*Math.sin((n-e)*(2*Math.PI)/r)+1)},elasticInOut:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),(n*=2)<1?-.5*(t*Math.pow(2,10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)):t*Math.pow(2,-10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)*.5+1)},backIn:function(n){var e=1.70158;return n*n*((e+1)*n-e)},backOut:function(n){var e=1.70158;return--n*n*((e+1)*n+e)+1},backInOut:function(n){var e=2.5949095;return(n*=2)<1?.5*(n*n*((e+1)*n-e)):.5*((n-=2)*n*((e+1)*n+e)+2)},bounceIn:function(n){return 1-L1.bounceOut(1-n)},bounceOut:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},bounceInOut:function(n){return n<.5?L1.bounceIn(n*2)*.5:L1.bounceOut(n*2-1)*.5+.5}};const Vz=L1;var xy=Math.pow,Zu=Math.sqrt,gx=1e-8,Hz=1e-4,WD=Zu(3),by=1/3,Io=bf(),xs=bf(),tp=bf();function Gu(n){return n>-gx&&n<gx}function Wz(n){return n>gx||n<-gx}function Qr(n,e,t,r,i){var a=1-i;return a*a*(a*n+3*i*e)+i*i*(i*r+3*a*t)}function $D(n,e,t,r,i){var a=1-i;return 3*(((e-n)*a+2*(t-e)*i)*a+(r-t)*i*i)}function mx(n,e,t,r,i,a){var s=r+3*(e-t)-n,o=3*(t-e*2+n),l=3*(e-n),u=n-i,c=o*o-3*s*l,h=o*l-9*s*u,f=l*l-3*o*u,d=0;if(Gu(c)&&Gu(h))if(Gu(o))a[0]=0;else{var p=-l/o;p>=0&&p<=1&&(a[d++]=p)}else{var g=h*h-4*c*f;if(Gu(g)){var v=h/c,p=-o/s+v,m=-v/2;p>=0&&p<=1&&(a[d++]=p),m>=0&&m<=1&&(a[d++]=m)}else if(g>0){var y=Zu(g),_=c*o+1.5*s*(-h+y),x=c*o+1.5*s*(-h-y);_<0?_=-xy(-_,by):_=xy(_,by),x<0?x=-xy(-x,by):x=xy(x,by);var p=(-o-(_+x))/(3*s);p>=0&&p<=1&&(a[d++]=p)}else{var b=(2*c*o-3*s*h)/(2*Zu(c*c*c)),S=Math.acos(b)/3,w=Zu(c),T=Math.cos(S),p=(-o-2*w*T)/(3*s),m=(-o+w*(T+WD*Math.sin(S)))/(3*s),C=(-o+w*(T-WD*Math.sin(S)))/(3*s);p>=0&&p<=1&&(a[d++]=p),m>=0&&m<=1&&(a[d++]=m),C>=0&&C<=1&&(a[d++]=C)}}return d}function $z(n,e,t,r,i){var a=6*t-12*e+6*n,s=9*e+3*r-3*n-9*t,o=3*e-3*n,l=0;if(Gu(s)){if(Wz(a)){var u=-o/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*s*o;if(Gu(c))i[0]=-a/(2*s);else if(c>0){var h=Zu(c),u=(-a+h)/(2*s),f=(-a-h)/(2*s);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function cc(n,e,t,r,i,a){var s=(e-n)*i+n,o=(t-e)*i+e,l=(r-t)*i+t,u=(o-s)*i+s,c=(l-o)*i+o,h=(c-u)*i+u;a[0]=n,a[1]=s,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=r}function jz(n,e,t,r,i,a,s,o,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)xs[0]=Qr(n,t,i,s,y),xs[1]=Qr(e,r,a,o,y),v=Vh(Io,xs),v<d&&(h=y,d=v);d=1/0;for(var _=0;_<32&&!(f<Hz);_++)p=h-f,g=h+f,xs[0]=Qr(n,t,i,s,p),xs[1]=Qr(e,r,a,o,p),v=Vh(xs,Io),p>=0&&v<d?(h=p,d=v):(tp[0]=Qr(n,t,i,s,g),tp[1]=Qr(e,r,a,o,g),m=Vh(tp,Io),g<=1&&m<d?(h=g,d=m):f*=.5);return c&&(c[0]=Qr(n,t,i,s,h),c[1]=Qr(e,r,a,o,h)),Zu(d)}function pQ(n,e,t,r,i,a,s,o,l){for(var u=n,c=e,h=0,f=1/l,d=1;d<=l;d++){var p=d*f,g=Qr(n,t,i,s,p),v=Qr(e,r,a,o,p),m=g-u,y=v-c;h+=Math.sqrt(m*m+y*y),u=g,c=v}return h}function fi(n,e,t,r){var i=1-r;return i*(i*n+2*r*e)+r*r*t}function ET(n,e,t,r){return 2*((1-r)*(e-n)+r*(t-e))}function vQ(n,e,t,r,i){var a=n-2*e+t,s=2*(e-n),o=n-r,l=0;if(Gu(a)){if(Wz(s)){var u=-o/s;u>=0&&u<=1&&(i[l++]=u)}}else{var c=s*s-4*a*o;if(Gu(c)){var u=-s/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var h=Zu(c),u=(-s+h)/(2*a),f=(-s-h)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function qz(n,e,t){var r=n+t-2*e;return r===0?.5:(n-e)/r}function km(n,e,t,r,i){var a=(e-n)*r+n,s=(t-e)*r+e,o=(s-a)*r+a;i[0]=n,i[1]=a,i[2]=o,i[3]=o,i[4]=s,i[5]=t}function Xz(n,e,t,r,i,a,s,o,l){var u,c=.005,h=1/0;Io[0]=s,Io[1]=o;for(var f=0;f<1;f+=.05){xs[0]=fi(n,t,i,f),xs[1]=fi(e,r,a,f);var d=Vh(Io,xs);d<h&&(u=f,h=d)}h=1/0;for(var p=0;p<32&&!(c<Hz);p++){var g=u-c,v=u+c;xs[0]=fi(n,t,i,g),xs[1]=fi(e,r,a,g);var d=Vh(xs,Io);if(g>=0&&d<h)u=g,h=d;else{tp[0]=fi(n,t,i,v),tp[1]=fi(e,r,a,v);var m=Vh(tp,Io);v<=1&&m<h?(u=v,h=m):c*=.5}}return l&&(l[0]=fi(n,t,i,u),l[1]=fi(e,r,a,u)),Zu(h)}function gQ(n,e,t,r,i,a,s){for(var o=n,l=e,u=0,c=1/s,h=1;h<=s;h++){var f=h*c,d=fi(n,t,i,f),p=fi(e,r,a,f),g=d-o,v=p-l;u+=Math.sqrt(g*g+v*v),o=d,l=p}return u}var mQ=/cubic-bezier\(([0-9,\.e ]+)\)/;function bP(n){var e=n&&mQ.exec(n);if(e){var t=e[1].split(","),r=+no(t[0]),i=+no(t[1]),a=+no(t[2]),s=+no(t[3]);if(isNaN(r+i+a+s))return;var o=[];return function(l){return l<=0?0:l>=1?1:mx(0,r,a,1,l,o)&&Qr(0,i,s,1,o[0])}}}var yQ=function(){function n(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||Er,this.ondestroy=e.ondestroy||Er,this.onrestart=e.onrestart||Er,e.easing&&this.setEasing(e.easing)}return n.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var r=this._life,i=e-this._startTime-this._pausedTime,a=i/r;a<0&&(a=0),a=Math.min(a,1);var s=this.easingFunc,o=s?s(a):a;if(this.onframe(o),a===1)if(this.loop){var l=i%r;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},n.prototype.pause=function(){this._paused=!0},n.prototype.resume=function(){this._paused=!1},n.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ct(e)?e:Vz[e]||bP(e)},n}();const _Q=yQ;var Yz=function(){function n(e){this.value=e}return n}(),xQ=function(){function n(){this._len=0}return n.prototype.insert=function(e){var t=new Yz(e);return this.insertEntry(t),t},n.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++},n.prototype.remove=function(e){var t=e.prev,r=e.next;t?t.next=r:this.head=r,r?r.prev=t:this.tail=t,e.next=e.prev=null,this._len--},n.prototype.len=function(){return this._len},n.prototype.clear=function(){this.head=this.tail=null,this._len=0},n}(),bQ=function(){function n(e){this._list=new xQ,this._maxSize=10,this._map={},this._maxSize=e}return n.prototype.put=function(e,t){var r=this._list,i=this._map,a=null;if(i[e]==null){var s=r.len(),o=this._lastRemovedEntry;if(s>=this._maxSize&&s>0){var l=r.head;r.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}o?o.value=t:o=new Yz(t),o.key=e,r.insertEntry(o),i[e]=o}return a},n.prototype.get=function(e){var t=this._map[e],r=this._list;if(t!=null)return t!==r.tail&&(r.remove(t),r.insertEntry(t)),t.value},n.prototype.clear=function(){this._list.clear(),this._map={}},n.prototype.len=function(){return this._list.len()},n}();const P0=bQ;var jD={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 ao(n){return n=Math.round(n),n<0?0:n>255?255:n}function SQ(n){return n=Math.round(n),n<0?0:n>360?360:n}function Om(n){return n<0?0:n>1?1:n}function Iw(n){var e=n;return e.length&&e.charAt(e.length-1)==="%"?ao(parseFloat(e)/100*255):ao(parseInt(e,10))}function Hh(n){var e=n;return e.length&&e.charAt(e.length-1)==="%"?Om(parseFloat(e)/100):Om(parseFloat(e))}function Nw(n,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?n+(e-n)*t*6:t*2<1?e:t*3<2?n+(e-n)*(2/3-t)*6:n}function zu(n,e,t){return n+(e-n)*t}function cs(n,e,t,r,i){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function PT(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n}var Kz=new P0(20),Sy=null;function Of(n,e){Sy&&PT(Sy,e),Sy=Kz.put(n,Sy||e.slice())}function Qa(n,e){if(n){e=e||[];var t=Kz.get(n);if(t)return PT(e,t);n=n+"";var r=n.replace(/ /g,"").toLowerCase();if(r in jD)return PT(e,jD[r]),Of(n,e),e;var i=r.length;if(r.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){cs(e,0,0,0,1);return}return cs(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),Of(n,e),e}else if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){cs(e,0,0,0,1);return}return cs(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),Of(n,e),e}return}var s=r.indexOf("("),o=r.indexOf(")");if(s!==-1&&o+1===i){var l=r.substr(0,s),u=r.substr(s+1,o-(s+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?cs(e,+u[0],+u[1],+u[2],1):cs(e,0,0,0,1);c=Hh(u.pop());case"rgb":if(u.length>=3)return cs(e,Iw(u[0]),Iw(u[1]),Iw(u[2]),u.length===3?c:Hh(u[3])),Of(n,e),e;cs(e,0,0,0,1);return;case"hsla":if(u.length!==4){cs(e,0,0,0,1);return}return u[3]=Hh(u[3]),LT(u,e),Of(n,e),e;case"hsl":if(u.length!==3){cs(e,0,0,0,1);return}return LT(u,e),Of(n,e),e;default:return}}cs(e,0,0,0,1)}}function LT(n,e){var t=(parseFloat(n[0])%360+360)%360/360,r=Hh(n[1]),i=Hh(n[2]),a=i<=.5?i*(r+1):i+r-i*r,s=i*2-a;return e=e||[],cs(e,ao(Nw(s,a,t+1/3)*255),ao(Nw(s,a,t)*255),ao(Nw(s,a,t-1/3)*255),1),n.length===4&&(e[3]=n[3]),e}function wQ(n){if(n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i=Math.min(e,t,r),a=Math.max(e,t,r),s=a-i,o=(a+i)/2,l,u;if(s===0)l=0,u=0;else{o<.5?u=s/(a+i):u=s/(2-a-i);var c=((a-e)/6+s/2)/s,h=((a-t)/6+s/2)/s,f=((a-r)/6+s/2)/s;e===a?l=f-h:t===a?l=1/3+c-f:r===a&&(l=2/3+h-c),l<0&&(l+=1),l>1&&(l-=1)}var d=[l*360,u,o];return n[3]!=null&&d.push(n[3]),d}}function RT(n,e){var t=Qa(n);if(t){for(var r=0;r<3;r++)e<0?t[r]=t[r]*(1-e)|0:t[r]=(255-t[r])*e+t[r]|0,t[r]>255?t[r]=255:t[r]<0&&(t[r]=0);return Il(t,t.length===4?"rgba":"rgb")}}function kw(n,e,t){if(!(!(e&&e.length)||!(n>=0&&n<=1))){t=t||[];var r=n*(e.length-1),i=Math.floor(r),a=Math.ceil(r),s=e[i],o=e[a],l=r-i;return t[0]=ao(zu(s[0],o[0],l)),t[1]=ao(zu(s[1],o[1],l)),t[2]=ao(zu(s[2],o[2],l)),t[3]=Om(zu(s[3],o[3],l)),t}}function AQ(n,e,t){if(!(!(e&&e.length)||!(n>=0&&n<=1))){var r=n*(e.length-1),i=Math.floor(r),a=Math.ceil(r),s=Qa(e[i]),o=Qa(e[a]),l=r-i,u=Il([ao(zu(s[0],o[0],l)),ao(zu(s[1],o[1],l)),ao(zu(s[2],o[2],l)),Om(zu(s[3],o[3],l))],"rgba");return t?{color:u,leftIndex:i,rightIndex:a,value:r}:u}}function Qg(n,e,t,r){var i=Qa(n);if(n)return i=wQ(i),e!=null&&(i[0]=SQ(e)),t!=null&&(i[1]=Hh(t)),r!=null&&(i[2]=Hh(r)),Il(LT(i),"rgba")}function yx(n,e){var t=Qa(n);if(t&&e!=null)return t[3]=Om(e),Il(t,"rgba")}function Il(n,e){if(!(!n||!n.length)){var t=n[0]+","+n[1]+","+n[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+n[3]),e+"("+t+")"}}function _x(n,e){var t=Qa(n);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var qD=new P0(100);function DT(n){if(Ke(n)){var e=qD.get(n);return e||(e=RT(n,-.1),qD.put(n,e)),e}else if(jb(n)){var t=Pe({},n);return t.colorStops=Ne(n.colorStops,function(r){return{offset:r.offset,color:RT(r.color,-.1)}}),t}return n}var xx=Math.round;function Fm(n){var e;if(!n||n==="transparent")n="none";else if(typeof n=="string"&&n.indexOf("rgba")>-1){var t=Qa(n);t&&(n="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:n,opacity:e==null?1:e}}var XD=1e-4;function Uu(n){return n<XD&&n>-XD}function wy(n){return xx(n*1e3)/1e3}function IT(n){return xx(n*1e4)/1e4}function MQ(n){return"matrix("+wy(n[0])+","+wy(n[1])+","+wy(n[2])+","+wy(n[3])+","+IT(n[4])+","+IT(n[5])+")"}var TQ={left:"start",right:"end",center:"middle",middle:"middle"};function CQ(n,e,t){return t==="top"?n+=e/2:t==="bottom"&&(n-=e/2),n}function EQ(n){return n&&(n.shadowBlur||n.shadowOffsetX||n.shadowOffsetY)}function PQ(n){var e=n.style,t=n.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 Zz(n){return n&&!!n.image}function LQ(n){return n&&!!n.svgElement}function SP(n){return Zz(n)||LQ(n)}function Qz(n){return n.type==="linear"}function Jz(n){return n.type==="radial"}function eU(n){return n&&(n.type==="linear"||n.type==="radial")}function Yb(n){return"url(#"+n+")"}function tU(n){var e=n.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function nU(n){var e=n.x||0,t=n.y||0,r=(n.rotation||0)*T1,i=Et(n.scaleX,1),a=Et(n.scaleY,1),s=n.skewX||0,o=n.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),r&&l.push("rotate("+r+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(s||o)&&l.push("skew("+xx(s*T1)+"deg, "+xx(o*T1)+"deg)"),l.join(" ")}var RQ=function(){return on.hasGlobalWindow&&ct(window.btoa)?function(n){return window.btoa(unescape(encodeURIComponent(n)))}:typeof Buffer!="undefined"?function(n){return Buffer.from(n).toString("base64")}:function(n){return null}}(),NT=Array.prototype.slice;function wl(n,e,t){return(e-n)*t+n}function Ow(n,e,t,r){for(var i=e.length,a=0;a<i;a++)n[a]=wl(e[a],t[a],r);return n}function DQ(n,e,t,r){for(var i=e.length,a=i&&e[0].length,s=0;s<i;s++){n[s]||(n[s]=[]);for(var o=0;o<a;o++)n[s][o]=wl(e[s][o],t[s][o],r)}return n}function Ay(n,e,t,r){for(var i=e.length,a=0;a<i;a++)n[a]=e[a]+t[a]*r;return n}function YD(n,e,t,r){for(var i=e.length,a=i&&e[0].length,s=0;s<i;s++){n[s]||(n[s]=[]);for(var o=0;o<a;o++)n[s][o]=e[s][o]+t[s][o]*r}return n}function IQ(n,e){for(var t=n.length,r=e.length,i=t>r?e:n,a=Math.min(t,r),s=i[a-1]||{color:[0,0,0,0],offset:0},o=a;o<Math.max(t,r);o++)i.push({offset:s.offset,color:s.color.slice()})}function NQ(n,e,t){var r=n,i=e;if(!(!r.push||!i.push)){var a=r.length,s=i.length;if(a!==s){var o=a>s;if(o)r.length=s;else for(var l=a;l<s;l++)r.push(t===1?i[l]:NT.call(i[l]))}for(var u=r[0]&&r[0].length,l=0;l<r.length;l++)if(t===1)isNaN(r[l])&&(r[l]=i[l]);else for(var c=0;c<u;c++)isNaN(r[l][c])&&(r[l][c]=i[l][c])}}function Jg(n){if(Hi(n)){var e=n.length;if(Hi(n[0])){for(var t=[],r=0;r<e;r++)t.push(NT.call(n[r]));return t}return NT.call(n)}return n}function R1(n){return n[0]=Math.floor(n[0])||0,n[1]=Math.floor(n[1])||0,n[2]=Math.floor(n[2])||0,n[3]=n[3]==null?1:n[3],"rgba("+n.join(",")+")"}function kQ(n){return Hi(n&&n[0])?2:1}var My=0,D1=1,rU=2,Rg=3,kT=4,OT=5,KD=6;function ZD(n){return n===kT||n===OT}function Ty(n){return n===D1||n===rU}var zv=[0,0,0,0],OQ=function(){function n(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return n.prototype.isFinished=function(){return this._finished},n.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},n.prototype.needsAnimate=function(){return this.keyframes.length>=1},n.prototype.getAdditiveTrack=function(){return this._additiveTrack},n.prototype.addKeyframe=function(e,t,r){this._needsSort=!0;var i=this.keyframes,a=i.length,s=!1,o=KD,l=t;if(Hi(t)){var u=kQ(t);o=u,(u===1&&!un(t[0])||u===2&&!un(t[0][0]))&&(s=!0)}else if(un(t)&&!Im(t))o=My;else if(Ke(t))if(!isNaN(+t))o=My;else{var c=Qa(t);c&&(l=c,o=Rg)}else if(jb(t)){var h=Pe({},l);h.colorStops=Ne(t.colorStops,function(d){return{offset:d.offset,color:Qa(d.color)}}),Qz(t)?o=kT:Jz(t)&&(o=OT),l=h}a===0?this.valType=o:(o!==this.valType||o===KD)&&(s=!0),this.discrete=this.discrete||s;var f={time:e,value:l,rawValue:t,percent:0};return r&&(f.easing=r,f.easingFunc=ct(r)?r:Vz[r]||bP(r)),i.push(f),f},n.prototype.prepare=function(e,t){var r=this.keyframes;this._needsSort&&r.sort(function(g,v){return g.time-v.time});for(var i=this.valType,a=r.length,s=r[a-1],o=this.discrete,l=Ty(i),u=ZD(i),c=0;c<a;c++){var h=r[c],f=h.value,d=s.value;h.percent=h.time/e,o||(l&&c!==a-1?NQ(f,d,i):u&&IQ(f.colorStops,d.colorStops))}if(!o&&i!==OT&&t&&this.needsAnimate()&&t.needsAnimate()&&i===t.valType&&!t._finished){this._additiveTrack=t;for(var p=r[0].value,c=0;c<a;c++)i===My?r[c].additiveValue=r[c].value-p:i===Rg?r[c].additiveValue=Ay([],r[c].value,p,-1):Ty(i)&&(r[c].additiveValue=i===D1?Ay([],r[c].value,p,-1):YD([],r[c].value,p,-1))}},n.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var r=this._additiveTrack!=null,i=r?"additiveValue":"value",a=this.valType,s=this.keyframes,o=s.length,l=this.propName,u=a===Rg,c,h=this._lastFr,f=Math.min,d,p;if(o===1)d=p=s[0];else{if(t<0)c=0;else if(t<this._lastFrP){var g=f(h+1,o-1);for(c=g;c>=0&&!(s[c].percent<=t);c--);c=f(c,o-2)}else{for(c=h;c<o&&!(s[c].percent>t);c++);c=f(c-1,o-2)}p=s[c+1],d=s[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=r?this._additiveValue:u?zv:e[l];if((Ty(a)||u)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=m<1?d.rawValue:p.rawValue;else if(Ty(a))a===D1?Ow(y,d[i],p[i],m):DQ(y,d[i],p[i],m);else if(ZD(a)){var _=d[i],x=p[i],b=a===kT;e[l]={type:b?"linear":"radial",x:wl(_.x,x.x,m),y:wl(_.y,x.y,m),colorStops:Ne(_.colorStops,function(w,T){var C=x.colorStops[T];return{offset:wl(w.offset,C.offset,m),color:R1(Ow([],w.color,C.color,m))}}),global:x.global},b?(e[l].x2=wl(_.x2,x.x2,m),e[l].y2=wl(_.y2,x.y2,m)):e[l].r=wl(_.r,x.r,m)}else if(u)Ow(y,d[i],p[i],m),r||(e[l]=R1(y));else{var S=wl(d[i],p[i],m);r?this._additiveValue=S:e[l]=S}r&&this._addToTarget(e)}}},n.prototype._addToTarget=function(e){var t=this.valType,r=this.propName,i=this._additiveValue;t===My?e[r]=e[r]+i:t===Rg?(Qa(e[r],zv),Ay(zv,zv,i,1),e[r]=R1(zv)):t===D1?Ay(e[r],e[r],i,1):t===rU&&YD(e[r],e[r],i,1)},n}(),wP=function(){function n(e,t,r,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&i){pP("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=r}return n.prototype.getMaxTime=function(){return this._maxTime},n.prototype.getDelay=function(){return this._delay},n.prototype.getLoop=function(){return this._loop},n.prototype.getTarget=function(){return this._target},n.prototype.changeTarget=function(e){this._target=e},n.prototype.when=function(e,t,r){return this.whenWithKeys(e,t,Yt(t),r)},n.prototype.whenWithKeys=function(e,t,r,i){for(var a=this._tracks,s=0;s<r.length;s++){var o=r[s],l=a[o];if(!l){l=a[o]=new OQ(o);var u=void 0,c=this._getAdditiveTrack(o);if(c){var h=c.keyframes,f=h[h.length-1];u=f&&f.value,c.valType===Rg&&u&&(u=R1(u))}else u=this._target[o];if(u==null)continue;e>0&&l.addKeyframe(0,Jg(u),i),this._trackKeys.push(o)}l.addKeyframe(e,Jg(t[o]),i)}return this._maxTime=Math.max(this._maxTime,e),this},n.prototype.pause=function(){this._clip.pause(),this._paused=!0},n.prototype.resume=function(){this._clip.resume(),this._paused=!1},n.prototype.isPaused=function(){return!!this._paused},n.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},n.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,r=0;r<t;r++)e[r].call(this)},n.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var r=0;r<t.length;r++)t[r].call(this)},n.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,r=0;r<t.length;r++)e[t[r]].setFinished()},n.prototype._getAdditiveTrack=function(e){var t,r=this._additiveAnimators;if(r)for(var i=0;i<r.length;i++){var a=r[i].getTrack(e);a&&(t=a)}return t},n.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,r=[],i=this._maxTime||0,a=0;a<this._trackKeys.length;a++){var s=this._trackKeys[a],o=this._tracks[s],l=this._getAdditiveTrack(s),u=o.keyframes,c=u.length;if(o.prepare(i,l),o.needsAnimate())if(!this._allowDiscrete&&o.discrete){var h=u[c-1];h&&(t._target[o.propName]=h.rawValue),o.setFinished()}else r.push(o)}if(r.length||this._force){var f=new _Q({life:i,loop:this._loop,delay:this._delay||0,onframe:function(d){t._started=2;var p=t._additiveAnimators;if(p){for(var g=!1,v=0;v<p.length;v++)if(p[v]._clip){g=!0;break}g||(t._additiveAnimators=null)}for(var v=0;v<r.length;v++)r[v].step(t._target,d);var m=t._onframeCbs;if(m)for(var v=0;v<m.length;v++)m[v](t._target,d)},ondestroy:function(){t._doneCallback()}});this._clip=f,this.animation&&this.animation.addClip(f),e&&f.setEasing(e)}else this._doneCallback();return this}},n.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},n.prototype.delay=function(e){return this._delay=e,this},n.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},n.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},n.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},n.prototype.getClip=function(){return this._clip},n.prototype.getTrack=function(e){return this._tracks[e]},n.prototype.getTracks=function(){var e=this;return Ne(this._trackKeys,function(t){return e._tracks[t]})},n.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var r=this._tracks,i=this._trackKeys,a=0;a<e.length;a++){var s=r[e[a]];s&&!s.isFinished()&&(t?s.step(this._target,1):this._started===1&&s.step(this._target,0),s.setFinished())}for(var o=!0,a=0;a<i.length;a++)if(!r[i[a]].isFinished()){o=!1;break}return o&&this._abortedCallback(),o},n.prototype.saveTo=function(e,t,r){if(e){t=t||this._trackKeys;for(var i=0;i<t.length;i++){var a=t[i],s=this._tracks[a];if(!(!s||s.isFinished())){var o=s.keyframes,l=o[r?0:o.length-1];l&&(e[a]=Jg(l.rawValue))}}}},n.prototype.__changeFinalValue=function(e,t){t=t||Yt(e);for(var r=0;r<t.length;r++){var i=t[r],a=this._tracks[i];if(a){var s=a.keyframes;if(s.length>1){var o=s.pop();a.addKeyframe(o.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},n}();function Bd(){return new Date().getTime()}var FQ=function(n){ve(e,n);function e(t){var r=n.call(this)||this;return r._running=!1,r._time=0,r._pausedTime=0,r._pauseStart=0,r._paused=!1,t=t||{},r.stage=t.stage||{},r}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 r=t.getClip();r&&this.addClip(r)},e.prototype.removeClip=function(t){if(t.animation){var r=t.prev,i=t.next;r?r.next=i:this._head=i,i?i.prev=r:this._tail=r,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var r=t.getClip();r&&this.removeClip(r),t.animation=null},e.prototype.update=function(t){for(var r=Bd()-this._pausedTime,i=r-this._time,a=this._head;a;){var s=a.next,o=a.step(r,i);o&&(a.ondestroy(),this.removeClip(a)),a=s}this._time=r,t||(this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function r(){t._running&&(CT(r),!t._paused&&t.update())}CT(r)},e.prototype.start=function(){this._running||(this._time=Bd(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=Bd(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=Bd()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var r=t.next;t.prev=t.next=t.animation=null,t=r}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,r){r=r||{},this.start();var i=new wP(t,r.loop);return this.addAnimator(i),i},e}(Bs);const BQ=FQ;var GQ=300,Fw=on.domSupported,Bw=function(){var n=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},r=Ne(n,function(i){var a=i.replace("mouse","pointer");return t.hasOwnProperty(a)?a:i});return{mouse:n,touch:e,pointer:r}}(),QD={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},JD=!1;function FT(n){var e=n.pointerType;return e==="pen"||e==="touch"}function zQ(n){n.touching=!0,n.touchTimer!=null&&(clearTimeout(n.touchTimer),n.touchTimer=null),n.touchTimer=setTimeout(function(){n.touching=!1,n.touchTimer=null},700)}function Gw(n){n&&(n.zrByTouch=!0)}function UQ(n,e){return vs(n.dom,new VQ(n,e),!0)}function iU(n,e){for(var t=e,r=!1;t&&t.nodeType!==9&&!(r=t.domBelongToZr||t!==e&&t===n.painterRoot);)t=t.parentNode;return r}var VQ=function(){function n(e,t){this.stopPropagation=Er,this.stopImmediatePropagation=Er,this.preventDefault=Er,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return n}(),Ks={mousedown:function(n){n=vs(this.dom,n),this.__mayPointerCapture=[n.zrX,n.zrY],this.trigger("mousedown",n)},mousemove:function(n){n=vs(this.dom,n);var e=this.__mayPointerCapture;e&&(n.zrX!==e[0]||n.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",n)},mouseup:function(n){n=vs(this.dom,n),this.__togglePointerCapture(!1),this.trigger("mouseup",n)},mouseout:function(n){n=vs(this.dom,n);var e=n.toElement||n.relatedTarget;iU(this,e)||(this.__pointerCapturing&&(n.zrEventControl="no_globalout"),this.trigger("mouseout",n))},wheel:function(n){JD=!0,n=vs(this.dom,n),this.trigger("mousewheel",n)},mousewheel:function(n){JD||(n=vs(this.dom,n),this.trigger("mousewheel",n))},touchstart:function(n){n=vs(this.dom,n),Gw(n),this.__lastTouchMoment=new Date,this.handler.processGesture(n,"start"),Ks.mousemove.call(this,n),Ks.mousedown.call(this,n)},touchmove:function(n){n=vs(this.dom,n),Gw(n),this.handler.processGesture(n,"change"),Ks.mousemove.call(this,n)},touchend:function(n){n=vs(this.dom,n),Gw(n),this.handler.processGesture(n,"end"),Ks.mouseup.call(this,n),+new Date-+this.__lastTouchMoment<GQ&&Ks.click.call(this,n)},pointerdown:function(n){Ks.mousedown.call(this,n)},pointermove:function(n){FT(n)||Ks.mousemove.call(this,n)},pointerup:function(n){Ks.mouseup.call(this,n)},pointerout:function(n){FT(n)||Ks.mouseout.call(this,n)}};z(["click","dblclick","contextmenu"],function(n){Ks[n]=function(e){e=vs(this.dom,e),this.trigger(n,e)}});var BT={pointermove:function(n){FT(n)||BT.mousemove.call(this,n)},pointerup:function(n){BT.mouseup.call(this,n)},mousemove:function(n){this.trigger("mousemove",n)},mouseup:function(n){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",n),e&&(n.zrEventControl="only_globalout",this.trigger("mouseout",n))}};function HQ(n,e){var t=e.domHandlers;on.pointerEventsSupported?z(Bw.pointer,function(r){I1(e,r,function(i){t[r].call(n,i)})}):(on.touchEventsSupported&&z(Bw.touch,function(r){I1(e,r,function(i){t[r].call(n,i),zQ(e)})}),z(Bw.mouse,function(r){I1(e,r,function(i){i=yP(i),e.touching||t[r].call(n,i)})}))}function WQ(n,e){on.pointerEventsSupported?z(QD.pointer,t):on.touchEventsSupported||z(QD.mouse,t);function t(r){function i(a){a=yP(a),iU(n,a.target)||(a=UQ(n,a),e.domHandlers[r].call(n,a))}I1(e,r,i,{capture:!0})}}function I1(n,e,t,r){n.mounted[e]=t,n.listenerOpts[e]=r,TT(n.domTarget,e,t,r)}function zw(n){var e=n.mounted;for(var t in e)e.hasOwnProperty(t)&&ZZ(n.domTarget,t,e[t],n.listenerOpts[t]);n.mounted={}}var eI=function(){function n(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t}return n}(),$Q=function(n){ve(e,n);function e(t,r){var i=n.call(this)||this;return i.__pointerCapturing=!1,i.dom=t,i.painterRoot=r,i._localHandlerScope=new eI(t,Ks),Fw&&(i._globalHandlerScope=new eI(document,BT)),HQ(i,i._localHandlerScope),i}return e.prototype.dispose=function(){zw(this._localHandlerScope),Fw&&zw(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,Fw&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var r=this._globalHandlerScope;t?WQ(this,r):zw(r)}},e}(Bs);const jQ=$Q;var aU=1;on.hasGlobalWindow&&(aU=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var bx=aU,GT=.4,zT="#333",UT="#ccc",qQ="#eee",tI=Xb,nI=5e-5;function kc(n){return n>nI||n<-nI}var Oc=[],Ff=[],Uw=Za(),Vw=Math.abs,XQ=function(){function n(){}return n.prototype.getLocalTransform=function(e){return n.getLocalTransform(this,e)},n.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},n.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},n.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},n.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},n.prototype.needLocalTransform=function(){return kc(this.rotation)||kc(this.x)||kc(this.y)||kc(this.scaleX-1)||kc(this.scaleY-1)||kc(this.skewX)||kc(this.skewY)},n.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),r=this.transform;if(!(t||e)){r&&(tI(r),this.invTransform=null);return}r=r||Za(),t?this.getLocalTransform(r):tI(r),e&&(t?Dl(r,e,r):_P(r,e)),this.transform=r,this._resolveGlobalScaleRatio(r)},n.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(Oc);var r=Oc[0]<0?-1:1,i=Oc[1]<0?-1:1,a=((Oc[0]-r)*t+r)/Oc[0]||0,s=((Oc[1]-i)*t+i)/Oc[1]||0;e[0]*=a,e[1]*=a,e[2]*=s,e[3]*=s}this.invTransform=this.invTransform||Za(),jp(this.invTransform,e)},n.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},n.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],r=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]);r=Math.sqrt(r)*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=r,this.originX=0,this.originY=0}},n.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||Za(),Dl(Ff,e.invTransform,t),t=Ff);var r=this.originX,i=this.originY;(r||i)&&(Uw[4]=r,Uw[5]=i,Dl(Ff,t,Uw),Ff[4]-=r,Ff[5]-=i,t=Ff),this.setLocalTransform(t)}},n.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)},n.prototype.transformCoordToLocal=function(e,t){var r=[e,t],i=this.invTransform;return i&&Mi(r,r,i),r},n.prototype.transformCoordToGlobal=function(e,t){var r=[e,t],i=this.transform;return i&&Mi(r,r,i),r},n.prototype.getLineScale=function(){var e=this.transform;return e&&Vw(e[0]-1)>1e-10&&Vw(e[3]-1)>1e-10?Math.sqrt(Vw(e[0]*e[3]-e[2]*e[1])):1},n.prototype.copyTransform=function(e){sU(this,e)},n.getLocalTransform=function(e,t){t=t||[];var r=e.originX||0,i=e.originY||0,a=e.scaleX,s=e.scaleY,o=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(r||i||o||l){var p=r+o,g=i+l;t[4]=-p*a-f*g*s,t[5]=-g*s-d*p*a}else t[4]=t[5]=0;return t[0]=a,t[3]=s,t[1]=d*a,t[2]=f*s,u&&Sf(t,t,u),t[4]+=r+c,t[5]+=i+h,t},n.initDefaultProps=function(){var e=n.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}(),n}(),Zo=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function sU(n,e){for(var t=0;t<Zo.length;t++){var r=Zo[t];n[r]=e[r]}}const Cl=XQ;var rI={};function Ja(n,e){e=e||lc;var t=rI[e];t||(t=rI[e]=new P0(500));var r=t.get(n);return r==null&&(r=uc.measureText(n,e).width,t.put(n,r)),r}function iI(n,e,t,r){var i=Ja(n,e),a=Kb(e),s=Dg(0,i,t),o=Ed(0,a,r),l=new Ot(s,o,i,a);return l}function L0(n,e,t,r){var i=((n||"")+"").split(`
`),a=i.length;if(a===1)return iI(i[0],e,t,r);for(var s=new Ot(0,0,0,0),o=0;o<i.length;o++){var l=iI(i[o],e,t,r);o===0?s.copy(l):s.union(l)}return s}function Dg(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function Ed(n,e,t){return t==="middle"?n-=e/2:t==="bottom"&&(n-=e),n}function Kb(n){return Ja("国",n)}function uo(n,e){return typeof n=="string"?n.lastIndexOf("%")>=0?parseFloat(n)/100*e:parseFloat(n):n}function Sx(n,e,t){var r=e.position||"inside",i=e.distance!=null?e.distance:5,a=t.height,s=t.width,o=a/2,l=t.x,u=t.y,c="left",h="top";if(r instanceof Array)l+=uo(r[0],t.width),u+=uo(r[1],t.height),c=null,h=null;else switch(r){case"left":l-=i,u+=o,c="right",h="middle";break;case"right":l+=i+s,u+=o,h="middle";break;case"top":l+=s/2,u-=i,c="center",h="bottom";break;case"bottom":l+=s/2,u+=a+i,c="center";break;case"inside":l+=s/2,u+=o,c="center",h="middle";break;case"insideLeft":l+=i,u+=o,h="middle";break;case"insideRight":l+=s-i,u+=o,c="right",h="middle";break;case"insideTop":l+=s/2,u+=i,c="center";break;case"insideBottom":l+=s/2,u+=a-i,c="center",h="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=s-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=a-i,h="bottom";break;case"insideBottomRight":l+=s-i,u+=a-i,c="right",h="bottom";break}return n=n||{},n.x=l,n.y=u,n.align=c,n.verticalAlign=h,n}var Hw="__zr_normal__",Ww=Zo.concat(["ignore"]),YQ=Yo(Zo,function(n,e){return n[e]=!0,n},{ignore:!1}),Bf={},KQ=new Ot(0,0,0,0),AP=function(){function n(e){this.id=Dz(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return n.prototype._init=function(e){this.attr(e)},n.prototype.drift=function(e,t,r){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()},n.prototype.beforeUpdate=function(){},n.prototype.afterUpdate=function(){},n.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},n.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var r=this.textConfig,i=r.local,a=t.innerTransformable,s=void 0,o=void 0,l=!1;a.parent=i?this:null;var u=!1;if(a.copyTransform(t),r.position!=null){var c=KQ;r.layoutRect?c.copy(r.layoutRect):c.copy(this.getBoundingRect()),i||c.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Bf,r,c):Sx(Bf,r,c),a.x=Bf.x,a.y=Bf.y,s=Bf.align,o=Bf.verticalAlign;var h=r.origin;if(h&&r.rotation!=null){var f=void 0,d=void 0;h==="center"?(f=c.width*.5,d=c.height*.5):(f=uo(h[0],c.width),d=uo(h[1],c.height)),u=!0,a.originX=-a.x+f+(i?0:c.x),a.originY=-a.y+d+(i?0:c.y)}}r.rotation!=null&&(a.rotation=r.rotation);var p=r.offset;p&&(a.x+=p[0],a.y+=p[1],u||(a.originX=-p[0],a.originY=-p[1]));var g=r.inside==null?typeof r.position=="string"&&r.position.indexOf("inside")>=0:r.inside,v=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,y=void 0,_=void 0;g&&this.canBeInsideText()?(m=r.insideFill,y=r.insideStroke,(m==null||m==="auto")&&(m=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(m),_=!0)):(m=r.outsideFill,y=r.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||s!==v.align||o!==v.verticalAlign)&&(l=!0,v.fill=m,v.stroke=y,v.autoStroke=_,v.align=s,v.verticalAlign=o,t.setDefaultTextStyle(v)),t.__dirty|=Wa,l&&t.dirtyStyle(!0)}},n.prototype.canBeInsideText=function(){return!0},n.prototype.getInsideTextFill=function(){return"#fff"},n.prototype.getInsideTextStroke=function(e){return"#000"},n.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?UT:zT},n.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),r=typeof t=="string"&&Qa(t);r||(r=[255,255,255,1]);for(var i=r[3],a=this.__zr.isDarkMode(),s=0;s<3;s++)r[s]=r[s]*i+(a?0:255)*(1-i);return r[3]=1,Il(r,"rgba")},n.prototype.traverse=function(e,t){},n.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},n.prototype.hide=function(){this.ignore=!0,this.markRedraw()},n.prototype.show=function(){this.ignore=!1,this.markRedraw()},n.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(gt(e))for(var r=e,i=Yt(r),a=0;a<i.length;a++){var s=i[a];this.attrKV(s,e[s])}return this.markRedraw(),this},n.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,r=0;r<this.animators.length;r++){var i=this.animators[r],a=i.__fromStateTransition;if(!(i.getLoop()||a&&a!==Hw)){var s=i.targetName,o=s?t[s]:t;i.saveTo(o)}}},n.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||(t=this._normalState={}),e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,Ww)},n.prototype._savePrimaryToNormal=function(e,t,r){for(var i=0;i<r.length;i++){var a=r[i];e[a]!=null&&!(a in t)&&(t[a]=this[a])}},n.prototype.hasState=function(){return this.currentStates.length>0},n.prototype.getState=function(e){return this.states[e]},n.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},n.prototype.clearStates=function(e){this.useState(Hw,!1,e)},n.prototype.useState=function(e,t,r,i){var a=e===Hw,s=this.hasState();if(!(!s&&a)){var o=this.currentStates,l=this.stateTransition;if(!(Ft(o,e)>=0&&(t||o.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){pP("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,!r&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,f=this._textGuide;return h&&h.useState(e,t,r,c),f&&f.useState(e,t,r,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&=~Wa),u}}},n.prototype.useStates=function(e,t,r){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,s=e.length,o=s===a.length;if(o){for(var l=0;l<s;l++)if(e[l]!==a[l]){o=!1;break}}if(o)return;for(var l=0;l<s;l++){var u=e[l],c=void 0;this.stateProxy&&(c=this.stateProxy(u,e)),c||(c=this.states[u]),c&&i.push(c)}var h=i[s-1],f=!!(h&&h.hoverLayer||r);f&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(i),p=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(e.join(","),d,this._normalState,!1,!t&&!this.__inHover&&p&&p.duration>0,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&=~Wa)}},n.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},n.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},n.prototype.removeState=function(e){var t=Ft(this.currentStates,e);if(t>=0){var r=this.currentStates.slice();r.splice(t,1),this.useStates(r)}},n.prototype.replaceState=function(e,t,r){var i=this.currentStates.slice(),a=Ft(i,e),s=Ft(i,t)>=0;a>=0?s?i.splice(a,1):i[a]=t:r&&!s&&i.push(t),this.useStates(i)},n.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},n.prototype._mergeStates=function(e){for(var t={},r,i=0;i<e.length;i++){var a=e[i];Pe(t,a),a.textConfig&&(r=r||{},Pe(r,a.textConfig))}return r&&(t.textConfig=r),t},n.prototype._applyStateObj=function(e,t,r,i,a,s){var o=!(t&&i);t&&t.textConfig?(this.textConfig=Pe({},i?this.textConfig:r.textConfig),Pe(this.textConfig,t.textConfig)):o&&r.textConfig&&(this.textConfig=r.textConfig);for(var l={},u=!1,c=0;c<Ww.length;c++){var h=Ww[c],f=a&&YQ[h];t&&t[h]!=null?f?(u=!0,l[h]=t[h]):this[h]=t[h]:o&&r[h]!=null&&(f?(u=!0,l[h]=r[h]):this[h]=r[h])}if(!a)for(var c=0;c<this.animators.length;c++){var d=this.animators[c],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(t||r)[p]:t||r)}u&&this._transitionState(e,l,s)},n.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}},n.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},n.prototype.getClipPath=function(){return this._clipPath},n.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},n.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},n.prototype.getTextContent=function(){return this._textContent},n.prototype.setTextContent=function(e){var t=this._textContent;t!==e&&(t&&t!==e&&this.removeTextContent(),e.innerTransformable=new Cl,this._attachComponent(e),this._textContent=e,this.markRedraw())},n.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),Pe(this.textConfig,e),this.markRedraw()},n.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},n.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},n.prototype.getTextGuideLine=function(){return this._textGuide},n.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},n.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},n.prototype.markRedraw=function(){this.__dirty|=Wa;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},n.prototype.dirty=function(){this.markRedraw()},n.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var t=this._textContent,r=this._textGuide;t&&(t.__inHover=e),r&&(r.__inHover=e)},n.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var r=0;r<t.length;r++)e.animation.addAnimator(t[r]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},n.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var r=0;r<t.length;r++)e.animation.removeAnimator(t[r]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},n.prototype.animate=function(e,t,r){var i=e?this[e]:this,a=new wP(i,t,r);return e&&(a.targetName=e),this.addAnimator(a,e),a},n.prototype.addAnimator=function(e,t){var r=this.__zr,i=this;e.during(function(){i.updateDuringAnimation(t)}).done(function(){var a=i.animators,s=Ft(a,e);s>=0&&a.splice(s,1)}),this.animators.push(e),r&&r.animation.addAnimator(e),r&&r.wakeUp()},n.prototype.updateDuringAnimation=function(e){this.markRedraw()},n.prototype.stopAnimation=function(e,t){for(var r=this.animators,i=r.length,a=[],s=0;s<i;s++){var o=r[s];!e||e===o.scope?o.stop(t):a.push(o)}return this.animators=a,this},n.prototype.animateTo=function(e,t,r){$w(this,e,t,r)},n.prototype.animateFrom=function(e,t,r){$w(this,e,t,r,!0)},n.prototype._transitionState=function(e,t,r,i){for(var a=$w(this,t,r,i),s=0;s<a.length;s++)a[s].__fromStateTransition=e},n.prototype.getBoundingRect=function(){return null},n.prototype.getPaintRect=function(){return null},n.initDefaultProps=function(){var e=n.prototype;e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=Wa;function t(r,i,a,s){Object.defineProperty(e,r,{get:function(){if(!this[i]){var l=this[i]=[];o(this,l)}return this[i]},set:function(l){this[a]=l[0],this[s]=l[1],this[i]=l,o(this,l)}});function o(l,u){Object.defineProperty(u,0,{get:function(){return l[a]},set:function(c){l[a]=c}}),Object.defineProperty(u,1,{get:function(){return l[s]},set:function(c){l[s]=c}})}}Object.defineProperty&&(t("position","_legacyPos","x","y"),t("scale","_legacyScale","scaleX","scaleY"),t("origin","_legacyOrigin","originX","originY"))}(),n}();zr(AP,Bs);zr(AP,Cl);function $w(n,e,t,r,i){t=t||{};var a=[];oU(n,"",n,e,t,r,a,i);var s=a.length,o=!1,l=t.done,u=t.aborted,c=function(){o=!0,s--,s<=0&&(o?l&&l():u&&u())},h=function(){s--,s<=0&&(o?l&&l():u&&u())};s||l&&l(),a.length>0&&t.during&&a[0].during(function(p,g){t.during(g)});for(var f=0;f<a.length;f++){var d=a[f];c&&d.done(c),h&&d.aborted(h),t.force&&d.duration(t.duration),d.start(t.easing)}return a}function jw(n,e,t){for(var r=0;r<t;r++)n[r]=e[r]}function ZQ(n){return Hi(n[0])}function QQ(n,e,t){if(Hi(e[t]))if(Hi(n[t])||(n[t]=[]),Pa(e[t])){var r=e[t].length;n[t].length!==r&&(n[t]=new e[t].constructor(r),jw(n[t],e[t],r))}else{var i=e[t],a=n[t],s=i.length;if(ZQ(i))for(var o=i[0].length,l=0;l<s;l++)a[l]?jw(a[l],i[l],o):a[l]=Array.prototype.slice.call(i[l]);else jw(a,i,s);a.length=i.length}else n[t]=e[t]}function JQ(n,e){return n===e||Hi(n)&&Hi(e)&&eJ(n,e)}function eJ(n,e){var t=n.length;if(t!==e.length)return!1;for(var r=0;r<t;r++)if(n[r]!==e[r])return!1;return!0}function oU(n,e,t,r,i,a,s,o){for(var l=Yt(r),u=i.duration,c=i.delay,h=i.additive,f=i.setToFinal,d=!gt(a),p=n.animators,g=[],v=0;v<l.length;v++){var m=l[v],y=r[m];if(y!=null&&t[m]!=null&&(d||a[m]))if(gt(y)&&!Hi(y)&&!jb(y)){if(e){o||(t[m]=y,n.updateDuringAnimation(e));continue}oU(n,m,t[m],y,i,a&&a[m],s,o)}else g.push(m);else o||(t[m]=y,n.updateDuringAnimation(e),g.push(m))}var _=g.length;if(!h&&_)for(var x=0;x<p.length;x++){var b=p[x];if(b.targetName===e){var S=b.stopTracks(g);if(S){var w=Ft(p,b);p.splice(w,1)}}}if(i.force||(g=_n(g,function(M){return!JQ(r[M],t[M])}),_=g.length),_>0||i.force&&!s.length){var T=void 0,C=void 0,A=void 0;if(o){C={},f&&(T={});for(var x=0;x<_;x++){var m=g[x];C[m]=t[m],f?T[m]=r[m]:t[m]=r[m]}}else if(f){A={};for(var x=0;x<_;x++){var m=g[x];A[m]=Jg(t[m]),QQ(t,r,m)}}var b=new wP(t,!1,!1,h?_n(p,function(P){return P.targetName===e}):null);b.targetName=e,i.scope&&(b.scope=i.scope),f&&T&&b.whenWithKeys(0,T,g),A&&b.whenWithKeys(0,A,g),b.whenWithKeys(u==null?500:u,o?C:r,g).delay(c||0),n.addAnimator(b,e),s.push(b)}}const lU=AP;var uU=function(n){ve(e,n);function e(t){var r=n.call(this)||this;return r.isGroup=!0,r._children=[],r.attr(t),r}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 r=this._children,i=0;i<r.length;i++)if(r[i].name===t)return r[i]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(t){return t&&t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),this},e.prototype.addBefore=function(t,r){if(t&&t!==this&&t.parent!==this&&r&&r.parent===this){var i=this._children,a=i.indexOf(r);a>=0&&(i.splice(a,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,r){var i=Ft(this._children,t);return i>=0&&this.replaceAt(r,i),this},e.prototype.replaceAt=function(t,r){var i=this._children,a=i[r];if(t&&t!==this&&t.parent!==this&&t!==a){i[r]=t,a.parent=null;var s=this.__zr;s&&a.removeSelfFromZr(s),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var r=this.__zr;r&&r!==t.__zr&&t.addSelfToZr(r),r&&r.refresh()},e.prototype.remove=function(t){var r=this.__zr,i=this._children,a=Ft(i,t);return a<0?this:(i.splice(a,1),t.parent=null,r&&t.removeSelfFromZr(r),r&&r.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,r=this.__zr,i=0;i<t.length;i++){var a=t[i];r&&a.removeSelfFromZr(r),a.parent=null}return t.length=0,this},e.prototype.eachChild=function(t,r){for(var i=this._children,a=0;a<i.length;a++){var s=i[a];t.call(r,s,a)}return this},e.prototype.traverse=function(t,r){for(var i=0;i<this._children.length;i++){var a=this._children[i],s=t.call(r,a);a.isGroup&&!s&&a.traverse(t,r)}return this},e.prototype.addSelfToZr=function(t){n.prototype.addSelfToZr.call(this,t);for(var r=0;r<this._children.length;r++){var i=this._children[r];i.addSelfToZr(t)}},e.prototype.removeSelfFromZr=function(t){n.prototype.removeSelfFromZr.call(this,t);for(var r=0;r<this._children.length;r++){var i=this._children[r];i.removeSelfFromZr(t)}},e.prototype.getBoundingRect=function(t){for(var r=new Ot(0,0,0,0),i=t||this._children,a=[],s=null,o=0;o<i.length;o++){var l=i[o];if(!(l.ignore||l.invisible)){var u=l.getBoundingRect(),c=l.getLocalTransform(a);c?(Ot.applyTransform(r,u,c),s=s||r.clone(),s.union(r)):(s=s||u.clone(),s.union(u))}}return s||r},e}(lU);uU.prototype.type="group";const bt=uU;/*!
* ZRender, a high performance 2d drawing library.
*
* Copyright (c) 2013, Baidu Inc.
* All rights reserved.
*
* LICENSE
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
*/var N1={},cU={};function tJ(n){delete cU[n]}function nJ(n){if(!n)return!1;if(typeof n=="string")return _x(n,1)<GT;if(n.colorStops){for(var e=n.colorStops,t=0,r=e.length,i=0;i<r;i++)t+=_x(e[i].color,1);return t/=r,t<GT}return!1}var rJ=function(){function n(e,t,r){var i=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,r=r||{},this.dom=t,this.id=e;var a=new dQ,s=r.renderer||"canvas";N1[s]||(s=Yt(N1)[0]),r.useDirtyRect=r.useDirtyRect==null?!1:r.useDirtyRect;var o=new N1[s](t,a,r,e),l=r.ssr||o.ssrOnly;this.storage=a,this.painter=o;var u=!on.node&&!on.worker&&!l?new jQ(o.getViewportRoot(),o.root):null,c=r.useCoarsePointer,h=c==null||c==="auto"?on.touchEventsSupported:!!c,f=44,d;h&&(d=Et(r.pointerSize,f)),this.handler=new lQ(a,o,u,o.root,d),this.animation=new BQ({stage:{update:l?null:function(){return i._flush(!0)}}}),l||this.animation.start()}return n.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},n.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},n.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},n.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=nJ(e))},n.prototype.getBackgroundColor=function(){return this._backgroundColor},n.prototype.setDarkMode=function(e){this._darkMode=e},n.prototype.isDarkMode=function(){return this._darkMode},n.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},n.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},n.prototype.flush=function(){this._disposed||this._flush(!1)},n.prototype._flush=function(e){var t,r=Bd();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var i=Bd();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:i-r})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},n.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},n.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},n.prototype.refreshHover=function(){this._needsRefreshHover=!0},n.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},n.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},n.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},n.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},n.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},n.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},n.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},n.prototype.on=function(e,t,r){return this._disposed||this.handler.on(e,t,r),this},n.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},n.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},n.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof bt&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},n.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,tJ(this.id))},n}();function aI(n,e){var t=new rJ(Dz(),n,e);return cU[t.id]=t,t}function iJ(n,e){N1[n]=e}var VT;function aJ(n){if(typeof VT=="function")return VT(n)}function sJ(n){VT=n}var sI=1e-4,hU=20;function oJ(n){return n.replace(/^\s+|\s+$/g,"")}function Sn(n,e,t,r){var i=e[0],a=e[1],s=t[0],o=t[1],l=a-i,u=o-s;if(l===0)return u===0?s:(s+o)/2;if(r)if(l>0){if(n<=i)return s;if(n>=a)return o}else{if(n>=i)return s;if(n<=a)return o}else{if(n===i)return s;if(n===a)return o}return(n-i)/l*u+s}function Xe(n,e){switch(n){case"center":case"middle":n="50%";break;case"left":case"top":n="0%";break;case"right":case"bottom":n="100%";break}return Ke(n)?oJ(n).match(/%$/)?parseFloat(n)/100*e:parseFloat(n):n==null?NaN:+n}function xr(n,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),hU),n=(+n).toFixed(e),t?n:+n}function Rs(n){return n.sort(function(e,t){return e-t}),n}function Go(n){if(n=+n,isNaN(n))return 0;if(n>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(n*e)/e===n)return t}return lJ(n)}function lJ(n){var e=n.toString().toLowerCase(),t=e.indexOf("e"),r=t>0?+e.slice(t+1):0,i=t>0?t:e.length,a=e.indexOf("."),s=a<0?0:i-1-a;return Math.max(0,s-r)}function fU(n,e){var t=Math.log,r=Math.LN10,i=Math.floor(t(n[1]-n[0])/r),a=Math.round(t(Math.abs(e[1]-e[0]))/r),s=Math.min(Math.max(-i+a,0),20);return isFinite(s)?s:20}function uJ(n,e){var t=Yo(n,function(d,p){return d+(isNaN(p)?0:p)},0);if(t===0)return[];for(var r=Math.pow(10,e),i=Ne(n,function(d){return(isNaN(d)?0:d)/t*r*100}),a=r*100,s=Ne(i,function(d){return Math.floor(d)}),o=Yo(s,function(d,p){return d+p},0),l=Ne(i,function(d,p){return d-s[p]});o<a;){for(var u=Number.NEGATIVE_INFINITY,c=null,h=0,f=l.length;h<f;++h)l[h]>u&&(u=l[h],c=h);++s[c],l[c]=0,++o}return Ne(s,function(d){return d/r})}function cJ(n,e){var t=Math.max(Go(n),Go(e)),r=n+e;return t>hU?r:xr(r,t)}var oI=9007199254740991;function dU(n){var e=Math.PI*2;return(n%e+e)%e}function Bm(n){return n>-sI&&n<sI}var hJ=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Qo(n){if(n instanceof Date)return n;if(Ke(n)){var e=hJ.exec(n);if(!e)return new Date(NaN);if(e[8]){var t=+e[4]||0;return e[8].toUpperCase()!=="Z"&&(t-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,t,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}else return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0)}else if(n==null)return new Date(NaN);return new Date(Math.round(n))}function fJ(n){return Math.pow(10,MP(n))}function MP(n){if(n===0)return 0;var e=Math.floor(Math.log(n)/Math.LN10);return n/Math.pow(10,e)>=10&&e++,e}function pU(n,e){var t=MP(n),r=Math.pow(10,t),i=n/r,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,n=a*r,t>=-20?+n.toFixed(t<0?-t:0):n}function qw(n,e){var t=(n.length-1)*e+1,r=Math.floor(t),i=+n[r-1],a=t-r;return a?i+a*(n[r]-i):i}function lI(n){n.sort(function(l,u){return o(l,u,0)?-1:1});for(var e=-1/0,t=1,r=0;r<n.length;){for(var i=n[r].interval,a=n[r].close,s=0;s<2;s++)i[s]<=e&&(i[s]=e,a[s]=s?1:1-t),e=i[s],t=a[s];i[0]===i[1]&&a[0]*a[1]!==1?n.splice(r,1):r++}return n;function o(l,u,c){return l.interval[c]<u.interval[c]||l.interval[c]===u.interval[c]&&(l.close[c]-u.close[c]===(c?-1:1)||!c&&o(l,u,1))}}function Gl(n){var e=parseFloat(n);return e==n&&(e!==0||!Ke(n)||n.indexOf("x")<=0)?e:NaN}function vU(n){return!isNaN(Gl(n))}function gU(){return Math.round(Math.random()*9)}function mU(n,e){return e===0?n:mU(e,n%e)}function uI(n,e){return n==null?e:e==null?n:n*e/mU(n,e)}function mn(n){throw new Error(n)}function cI(n,e,t){return(e-n)*t+n}var yU="series\0",_U="\0_ec_\0";function Cn(n){return n instanceof Array?n:n==null?[]:[n]}function of(n,e,t){if(n){n[e]=n[e]||{},n.emphasis=n.emphasis||{},n.emphasis[e]=n.emphasis[e]||{};for(var r=0,i=t.length;r<i;r++){var a=t[r];!n.emphasis[e].hasOwnProperty(a)&&n[e].hasOwnProperty(a)&&(n.emphasis[e][a]=n[e][a])}}}var hI=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function qp(n){return gt(n)&&!Ie(n)&&!(n instanceof Date)?n.value:n}function dJ(n){return gt(n)&&!(n instanceof Array)}function xU(n,e,t){var r=t==="normalMerge",i=t==="replaceMerge",a=t==="replaceAll";n=n||[],e=(e||[]).slice();var s=st();z(e,function(l,u){if(!gt(l)){e[u]=null;return}});var o=pJ(n,s,t);return(r||i)&&vJ(o,n,s,e),r&&gJ(o,e),r||i?mJ(o,e,i):a&&yJ(o,e),_J(o),o}function pJ(n,e,t){var r=[];if(t==="replaceAll")return r;for(var i=0;i<n.length;i++){var a=n[i];a&&a.id!=null&&e.set(a.id,i),r.push({existing:t==="replaceMerge"||Gm(a)?null:a,newOption:null,keyInfo:null,brandNew:null})}return r}function vJ(n,e,t,r){z(r,function(i,a){if(!(!i||i.id==null)){var s=em(i.id),o=t.get(s);if(o!=null){var l=n[o];sa(!l.newOption,'Duplicated option on id "'+s+'".'),l.newOption=i,l.existing=e[o],r[a]=null}}})}function gJ(n,e){z(e,function(t,r){if(!(!t||t.name==null))for(var i=0;i<n.length;i++){var a=n[i].existing;if(!n[i].newOption&&a&&(a.id==null||t.id==null)&&!Gm(t)&&!Gm(a)&&bU("name",a,t)){n[i].newOption=t,e[r]=null;return}}})}function mJ(n,e,t){z(e,function(r){if(r){for(var i,a=0;(i=n[a])&&(i.newOption||Gm(i.existing)||i.existing&&r.id!=null&&!bU("id",r,i.existing));)a++;i?(i.newOption=r,i.brandNew=t):n.push({newOption:r,brandNew:t,existing:null,keyInfo:null}),a++}})}function yJ(n,e){z(e,function(t){n.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})})}function _J(n){var e=st();z(n,function(t){var r=t.existing;r&&e.set(r.id,t)}),z(n,function(t){var r=t.newOption;sa(!r||r.id==null||!e.get(r.id)||e.get(r.id)===t,"id duplicates: "+(r&&r.id)),r&&r.id!=null&&e.set(r.id,t),!t.keyInfo&&(t.keyInfo={})}),z(n,function(t,r){var i=t.existing,a=t.newOption,s=t.keyInfo;if(gt(a)){if(s.name=a.name!=null?em(a.name):i?i.name:yU+r,i)s.id=em(i.id);else if(a.id!=null)s.id=em(a.id);else{var o=0;do s.id="\0"+s.name+"\0"+o++;while(e.get(s.id))}e.set(s.id,t)}})}function bU(n,e,t){var r=Yr(e[n],null),i=Yr(t[n],null);return r!=null&&i!=null&&r===i}function em(n){return Yr(n,"")}function Yr(n,e){return n==null?e:Ke(n)?n:un(n)||_T(n)?n+"":e}function TP(n){var e=n.name;return!!(e&&e.indexOf(yU))}function Gm(n){return n&&n.id!=null&&em(n.id).indexOf(_U)===0}function xJ(n){return _U+n}function bJ(n,e,t){z(n,function(r){var i=r.newOption;gt(i)&&(r.keyInfo.mainType=e,r.keyInfo.subType=SJ(e,i,r.existing,t))})}function SJ(n,e,t,r){var i=e.type?e.type:t?t.subType:r.determineSubType(n,e);return i}function wJ(n,e){var t={},r={};return i(n||[],t),i(e||[],r,t),[a(t),a(r)];function i(s,o,l){for(var u=0,c=s.length;u<c;u++){var h=Yr(s[u].seriesId,null);if(h==null)return;for(var f=Cn(s[u].dataIndex),d=l&&l[h],p=0,g=f.length;p<g;p++){var v=f[p];d&&d[v]?d[v]=null:(o[h]||(o[h]={}))[v]=1}}}function a(s,o){var l=[];for(var u in s)if(s.hasOwnProperty(u)&&s[u]!=null)if(o)l.push(+u);else{var c=a(s[u],!0);c.length&&l.push({seriesId:u,dataIndex:c})}return l}}function lf(n,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return Ie(e.dataIndex)?Ne(e.dataIndex,function(t){return n.indexOfRawIndex(t)}):n.indexOfRawIndex(e.dataIndex);if(e.name!=null)return Ie(e.name)?Ne(e.name,function(t){return n.indexOfName(t)}):n.indexOfName(e.name)}function en(){var n="__ec_inner_"+AJ++;return function(e){return e[n]||(e[n]={})}}var AJ=gU();function tm(n,e,t){var r=CP(e,t),i=r.mainTypeSpecified,a=r.queryOptionMap,s=r.others,o=s,l=t?t.defaultMainType:null;return!i&&l&&a.set(l,{}),a.each(function(u,c){var h=R0(n,c,u,{useDefault:l===c,enableAll:t&&t.enableAll!=null?t.enableAll:!0,enableNone:t&&t.enableNone!=null?t.enableNone:!0});o[c+"Models"]=h.models,o[c+"Model"]=h.models[0]}),o}function CP(n,e){var t;if(Ke(n)){var r={};r[n+"Index"]=0,t=r}else t=n;var i=st(),a={},s=!1;return z(t,function(o,l){if(l==="dataIndex"||l==="dataIndexInside"){a[l]=o;return}var u=l.match(/^(\w+)(Index|Id|Name)$/)||[],c=u[1],h=(u[2]||"").toLowerCase();if(!(!c||!h||e&&e.includeMainTypes&&Ft(e.includeMainTypes,c)<0)){s=s||!!c;var f=i.get(c)||i.set(c,{});f[h]=o}}),{mainTypeSpecified:s,queryOptionMap:i,others:a}}var Fr={useDefault:!0,enableAll:!1,enableNone:!1},MJ={useDefault:!1,enableAll:!0,enableNone:!0};function R0(n,e,t,r){r=r||Fr;var i=t.index,a=t.id,s=t.name,o={models:null,specified:i!=null||a!=null||s!=null};if(!o.specified){var l=void 0;return o.models=r.useDefault&&(l=n.getComponent(e))?[l]:[],o}return i==="none"||i===!1?(sa(r.enableNone,'`"none"` or `false` is not a valid value on index option.'),o.models=[],o):(i==="all"&&(sa(r.enableAll,'`"all"` is not a valid value on index option.'),i=a=s=null),o.models=n.queryComponents({mainType:e,index:i,id:a,name:s}),o)}function SU(n,e,t){n.setAttribute?n.setAttribute(e,t):n[e]=t}function TJ(n,e){return n.getAttribute?n.getAttribute(e):n[e]}function CJ(n){return n==="auto"?on.domSupported?"html":"richText":n||"html"}function HT(n,e){var t=st(),r=[];return z(n,function(i){var a=e(i);(t.get(a)||(r.push(a),t.set(a,[]))).push(i)}),{keys:r,buckets:t}}function wU(n,e,t,r,i){var a=e==null||e==="auto";if(r==null)return r;if(un(r)){var s=cI(t||0,r,i);return xr(s,a?Math.max(Go(t||0),Go(r)):e)}else{if(Ke(r))return i<1?t:r;for(var o=[],l=t,u=r,c=Math.max(l?l.length:0,u.length),h=0;h<c;++h){var f=n.getDimensionInfo(h);if(f&&f.type==="ordinal")o[h]=(i<1&&l?l:u)[h];else{var d=l&&l[h]?l[h]:0,p=u[h],s=cI(d,p,i);o[h]=xr(s,a?Math.max(Go(d),Go(p)):e)}}return o}}var EJ=".",Fc="___EC__COMPONENT__CONTAINER___",AU="___EC__EXTENDED_CLASS___";function zo(n){var e={main:"",sub:""};if(n){var t=n.split(EJ);e.main=t[0]||"",e.sub=t[1]||""}return e}function PJ(n){sa(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n),'componentType "'+n+'" illegal')}function LJ(n){return!!(n&&n[AU])}function EP(n,e){n.$constructor=n,n.extend=function(t){var r=this,i;return RJ(r)?i=function(a){ve(s,a);function s(){return a.apply(this,arguments)||this}return s}(r):(i=function(){(t.$constructor||r).apply(this,arguments)},EZ(i,this)),Pe(i.prototype,t),i[AU]=!0,i.extend=this.extend,i.superCall=NJ,i.superApply=kJ,i.superClass=r,i}}function RJ(n){return ct(n)&&/^class\s/.test(Function.prototype.toString.call(n))}function MU(n,e){n.extend=e.extend}var DJ=Math.round(Math.random()*10);function IJ(n){var e=["__\0is_clz",DJ++].join("_");n.prototype[e]=!0,n.isInstance=function(t){return!!(t&&t[e])}}function NJ(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return this.superClass.prototype[e].apply(n,t)}function kJ(n,e,t){return this.superClass.prototype[e].apply(n,t)}function Zb(n){var e={};n.registerClass=function(r){var i=r.type||r.prototype.type;if(i){PJ(i),r.prototype.type=i;var a=zo(i);if(!a.sub)e[a.main]=r;else if(a.sub!==Fc){var s=t(a);s[a.sub]=r}}return r},n.getClass=function(r,i,a){var s=e[r];if(s&&s[Fc]&&(s=i?s[i]:null),a&&!s)throw new Error(i?"Component "+r+"."+(i||"")+" is used but not imported.":r+".type should be specified.");return s},n.getClassesByMainType=function(r){var i=zo(r),a=[],s=e[i.main];return s&&s[Fc]?z(s,function(o,l){l!==Fc&&a.push(o)}):a.push(s),a},n.hasClass=function(r){var i=zo(r);return!!e[i.main]},n.getAllClassMainTypes=function(){var r=[];return z(e,function(i,a){r.push(a)}),r},n.hasSubTypes=function(r){var i=zo(r),a=e[i.main];return a&&a[Fc]};function t(r){var i=e[r.main];return(!i||!i[Fc])&&(i=e[r.main]={},i[Fc]=!0),i}}function uf(n,e){for(var t=0;t<n.length;t++)n[t][1]||(n[t][1]=n[t][0]);return e=e||!1,function(r,i,a){for(var s={},o=0;o<n.length;o++){var l=n[o][1];if(!(i&&Ft(i,l)>=0||a&&Ft(a,l)<0)){var u=r.getShallow(l,e);u!=null&&(s[n[o][0]]=u)}}return s}}var OJ=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],FJ=uf(OJ),BJ=function(){function n(){}return n.prototype.getAreaStyle=function(e,t){return FJ(this,e,t)},n}(),WT=new P0(50);function GJ(n){if(typeof n=="string"){var e=WT.get(n);return e&&e.image}else return n}function PP(n,e,t,r,i){if(n)if(typeof n=="string"){if(e&&e.__zrImageSrc===n||!t)return e;var a=WT.get(n),s={hostEl:t,cb:r,cbPayload:i};return a?(e=a.image,!Qb(e)&&a.pending.push(s)):(e=uc.loadImage(n,fI,fI),e.__zrImageSrc=n,WT.put(n,e.__cachedImgObj={image:e,pending:[s]})),e}else return n;else return e}function fI(){var n=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<n.pending.length;e++){var t=n.pending[e],r=t.cb;r&&r(this,t.cbPayload),t.hostEl.dirty()}n.pending.length=0}function Qb(n){return n&&n.width&&n.height}var Xw=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function zJ(n,e,t,r,i,a){if(!t){n.text="",n.isTruncated=!1;return}var s=(e+"").split(`
`);a=TU(t,r,i,a);for(var o=!1,l={},u=0,c=s.length;u<c;u++)CU(l,s[u],a),s[u]=l.textLine,o=o||l.isTruncated;n.text=s.join(`
`),n.isTruncated=o}function TU(n,e,t,r){r=r||{};var i=Pe({},r);i.font=e,t=Et(t,"..."),i.maxIterations=Et(r.maxIterations,2);var a=i.minChar=Et(r.minChar,0);i.cnCharWidth=Ja("国",e);var s=i.ascCharWidth=Ja("a",e);i.placeholder=Et(r.placeholder,"");for(var o=n=Math.max(0,n-1),l=0;l<a&&o>=s;l++)o-=s;var u=Ja(t,e);return u>o&&(t="",u=0),o=n-u,i.ellipsis=t,i.ellipsisWidth=u,i.contentWidth=o,i.containerWidth=n,i}function CU(n,e,t){var r=t.containerWidth,i=t.font,a=t.contentWidth;if(!r){n.textLine="",n.isTruncated=!1;return}var s=Ja(e,i);if(s<=r){n.textLine=e,n.isTruncated=!1;return}for(var o=0;;o++){if(s<=a||o>=t.maxIterations){e+=t.ellipsis;break}var l=o===0?UJ(e,a,t.ascCharWidth,t.cnCharWidth):s>0?Math.floor(e.length*a/s):0;e=e.substr(0,l),s=Ja(e,i)}e===""&&(e=t.placeholder),n.textLine=e,n.isTruncated=!0}function UJ(n,e,t,r){for(var i=0,a=0,s=n.length;a<s&&i<e;a++){var o=n.charCodeAt(a);i+=0<=o&&o<=127?t:r}return a}function VJ(n,e){n!=null&&(n+="");var t=e.overflow,r=e.padding,i=e.font,a=t==="truncate",s=Kb(i),o=Et(e.lineHeight,s),l=!!e.backgroundColor,u=e.lineOverflow==="truncate",c=!1,h=e.width,f;h!=null&&(t==="break"||t==="breakAll")?f=n?EU(n,e.font,h,t==="breakAll",0).lines:[]:f=n?n.split(`
`):[];var d=f.length*o,p=Et(e.height,d);if(d>p&&u){var g=Math.floor(p/o);c=c||f.length>g,f=f.slice(0,g)}if(n&&a&&h!=null)for(var v=TU(h,i,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),m={},y=0;y<f.length;y++)CU(m,f[y],v),f[y]=m.textLine,c=c||m.isTruncated;for(var _=p,x=0,y=0;y<f.length;y++)x=Math.max(Ja(f[y],i),x);h==null&&(h=x);var b=x;return r&&(_+=r[0]+r[2],b+=r[1]+r[3],h+=r[1]+r[3]),l&&(b=h),{lines:f,height:p,outerWidth:b,outerHeight:_,lineHeight:o,calculatedLineHeight:s,contentWidth:x,contentHeight:d,width:h,isTruncated:c}}var HJ=function(){function n(){}return n}(),dI=function(){function n(e){this.tokens=[],e&&(this.tokens=e)}return n}(),WJ=function(){function n(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return n}();function $J(n,e){var t=new WJ;if(n!=null&&(n+=""),!n)return t;for(var r=e.width,i=e.height,a=e.overflow,s=(a==="break"||a==="breakAll")&&r!=null?{width:r,accumWidth:0,breakAll:a==="breakAll"}:null,o=Xw.lastIndex=0,l;(l=Xw.exec(n))!=null;){var u=l.index;u>o&&Yw(t,n.substring(o,u),e,s),Yw(t,l[2],e,s,l[1]),o=Xw.lastIndex}o<n.length&&Yw(t,n.substring(o,n.length),e,s);var c=[],h=0,f=0,d=e.padding,p=a==="truncate",g=e.lineOverflow==="truncate",v={};function m(U,$,Y){U.width=$,U.lineHeight=Y,h+=Y,f=Math.max(f,$)}e:for(var y=0;y<t.lines.length;y++){for(var _=t.lines[y],x=0,b=0,S=0;S<_.tokens.length;S++){var w=_.tokens[S],T=w.styleName&&e.rich[w.styleName]||{},C=w.textPadding=T.padding,A=C?C[1]+C[3]:0,M=w.font=T.font||e.font;w.contentHeight=Kb(M);var P=Et(T.height,w.contentHeight);if(w.innerHeight=P,C&&(P+=C[0]+C[2]),w.height=P,w.lineHeight=Ho(T.lineHeight,e.lineHeight,P),w.align=T&&T.align||e.align,w.verticalAlign=T&&T.verticalAlign||"middle",g&&i!=null&&h+w.lineHeight>i){var D=t.lines.length;S>0?(_.tokens=_.tokens.slice(0,S),m(_,b,x),t.lines=t.lines.slice(0,y+1)):t.lines=t.lines.slice(0,y),t.isTruncated=t.isTruncated||t.lines.length<D;break e}var L=T.width,R=L==null||L==="auto";if(typeof L=="string"&&L.charAt(L.length-1)==="%")w.percentWidth=L,c.push(w),w.contentWidth=Ja(w.text,M);else{if(R){var N=T.backgroundColor,F=N&&N.image;F&&(F=GJ(F),Qb(F)&&(w.width=Math.max(w.width,F.width*P/F.height)))}var O=p&&r!=null?r-b:null;O!=null&&O<w.width?!R||O<A?(w.text="",w.width=w.contentWidth=0):(zJ(v,w.text,O-A,M,e.ellipsis,{minChar:e.truncateMinChar}),w.text=v.text,t.isTruncated=t.isTruncated||v.isTruncated,w.width=w.contentWidth=Ja(w.text,M)):w.contentWidth=Ja(w.text,M)}w.width+=A,b+=w.width,T&&(x=Math.max(x,w.lineHeight))}m(_,b,x)}t.outerWidth=t.width=Et(r,f),t.outerHeight=t.height=Et(i,h),t.contentHeight=h,t.contentWidth=f,d&&(t.outerWidth+=d[1]+d[3],t.outerHeight+=d[0]+d[2]);for(var y=0;y<c.length;y++){var w=c[y],H=w.percentWidth;w.width=parseInt(H,10)/100*t.width}return t}function Yw(n,e,t,r,i){var a=e==="",s=i&&t.rich[i]||{},o=n.lines,l=s.font||t.font,u=!1,c,h;if(r){var f=s.padding,d=f?f[1]+f[3]:0;if(s.width!=null&&s.width!=="auto"){var p=uo(s.width,r.width)+d;o.length>0&&p+r.accumWidth>r.width&&(c=e.split(`
`),u=!0),r.accumWidth=p}else{var g=EU(e,l,r.width,r.breakAll,r.accumWidth);r.accumWidth=g.accumWidth+d,h=g.linesWidths,c=g.lines}}else c=e.split(`
`);for(var v=0;v<c.length;v++){var m=c[v],y=new HJ;if(y.styleName=i,y.text=m,y.isLineHolder=!m&&!a,typeof s.width=="number"?y.width=s.width:y.width=h?h[v]:Ja(m,l),!v&&!u){var _=(o[o.length-1]||(o[0]=new dI)).tokens,x=_.length;x===1&&_[0].isLineHolder?_[0]=y:(m||!x||a)&&_.push(y)}else o.push(new dI([y]))}}function jJ(n){var e=n.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var qJ=Yo(",&?/;] ".split(""),function(n,e){return n[e]=!0,n},{});function XJ(n){return jJ(n)?!!qJ[n]:!0}function EU(n,e,t,r,i){for(var a=[],s=[],o="",l="",u=0,c=0,h=0;h<n.length;h++){var f=n.charAt(h);if(f===`
`){l&&(o+=l,c+=u),a.push(o),s.push(c),o="",l="",u=0,c=0;continue}var d=Ja(f,e),p=r?!1:!XJ(f);if(a.length?c+d>t:i+c+d>t){c?(o||l)&&(p?(o||(o=l,l="",u=0,c=u),a.push(o),s.push(c-u),l+=f,u+=d,o="",c=u):(l&&(o+=l,l="",u=0),a.push(o),s.push(c),o=f,c=d)):p?(a.push(l),s.push(u),l=f,u=d):(a.push(f),s.push(d));continue}c+=d,p?(l+=f,u+=d):(l&&(o+=l,l="",u=0),o+=f)}return!a.length&&!o&&(o=n,l="",u=0),l&&(o+=l),o&&(a.push(o),s.push(c)),a.length===1&&(c+=i),{accumWidth:c,lines:a,linesWidths:s}}var $T="__zr_style_"+Math.round(Math.random()*10),Wh={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Jb={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Wh[$T]=!0;var pI=["z","z2","invisible"],YJ=["invisible"],KJ=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype._init=function(t){for(var r=Yt(t),i=0;i<r.length;i++){var a=r[i];a==="style"?this.useStyle(t[a]):n.prototype.attrKV.call(this,a,t[a])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(t,r,i,a){var s=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&ZJ(this,t,r)||s&&!s[0]&&!s[3])return!1;if(i&&this.__clipPaths){for(var o=0;o<this.__clipPaths.length;++o)if(this.__clipPaths[o].isZeroArea())return!1}if(a&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(t,r){return this.rectContain(t,r)},e.prototype.traverse=function(t,r){t.call(r,this)},e.prototype.rectContain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();return a.contain(i[0],i[1])},e.prototype.getPaintRect=function(){var t=this._paintRect;if(!this._paintRect||this.__dirty){var r=this.transform,i=this.getBoundingRect(),a=this.style,s=a.shadowBlur||0,o=a.shadowOffsetX||0,l=a.shadowOffsetY||0;t=this._paintRect||(this._paintRect=new Ot(0,0,0,0)),r?Ot.applyTransform(t,i,r):t.copy(i),(s||o||l)&&(t.width+=s*2+Math.abs(o),t.height+=s*2+Math.abs(l),t.x=Math.min(t.x,t.x+o-s),t.y=Math.min(t.y,t.y+l-s));var u=this.dirtyRectTolerance;t.isZero()||(t.x=Math.floor(t.x-u),t.y=Math.floor(t.y-u),t.width=Math.ceil(t.width+1+u*2),t.height=Math.ceil(t.height+1+u*2))}return t},e.prototype.setPrevPaintRect=function(t){t?(this._prevPaintRect=this._prevPaintRect||new Ot(0,0,0,0),this._prevPaintRect.copy(t)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(t){return this.animate("style",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(t,r){t!=="style"?n.prototype.attrKV.call(this,t,r):this.style?this.setStyle(r):this.useStyle(r)},e.prototype.setStyle=function(t,r){return typeof t=="string"?this.style[t]=r:Pe(this.style,t),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(t){t||this.markRedraw(),this.__dirty|=Lg,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&Lg)},e.prototype.styleUpdated=function(){this.__dirty&=~Lg},e.prototype.createStyle=function(t){return qb(Wh,t)},e.prototype.useStyle=function(t){t[$T]||(t=this.createStyle(t)),this.__inHover?this.__hoverStyle=t:this.style=t,this.dirtyStyle()},e.prototype.isStyleObject=function(t){return t[$T]},e.prototype._innerSaveToNormal=function(t){n.prototype._innerSaveToNormal.call(this,t);var r=this._normalState;t.style&&!r.style&&(r.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,r,pI)},e.prototype._applyStateObj=function(t,r,i,a,s,o){n.prototype._applyStateObj.call(this,t,r,i,a,s,o);var l=!(r&&a),u;if(r&&r.style?s?a?u=r.style:(u=this._mergeStyle(this.createStyle(),i.style),this._mergeStyle(u,r.style)):(u=this._mergeStyle(this.createStyle(),a?this.style:i.style),this._mergeStyle(u,r.style)):l&&(u=i.style),u)if(s){var c=this.style;if(this.style=this.createStyle(l?{}:c),l)for(var h=Yt(c),f=0;f<h.length;f++){var d=h[f];d in u&&(u[d]=u[d],this.style[d]=c[d])}for(var p=Yt(u),f=0;f<p.length;f++){var d=p[f];this.style[d]=this.style[d]}this._transitionState(t,{style:u},o,this.getAnimationStyleProps())}else this.useStyle(u);for(var g=this.__inHover?YJ:pI,f=0;f<g.length;f++){var d=g[f];r&&r[d]!=null?this[d]=r[d]:l&&i[d]!=null&&(this[d]=i[d])}},e.prototype._mergeStates=function(t){for(var r=n.prototype._mergeStates.call(this,t),i,a=0;a<t.length;a++){var s=t[a];s.style&&(i=i||{},this._mergeStyle(i,s.style))}return i&&(r.style=i),r},e.prototype._mergeStyle=function(t,r){return Pe(t,r),t},e.prototype.getAnimationStyleProps=function(){return Jb},e.initDefaultProps=function(){var t=e.prototype;t.type="displayable",t.invisible=!1,t.z=0,t.z2=0,t.zlevel=0,t.culling=!1,t.cursor="pointer",t.rectHover=!1,t.incremental=!1,t._rect=null,t.dirtyRectTolerance=0,t.__dirty=Wa|Lg}(),e}(lU),Kw=new Ot(0,0,0,0),Zw=new Ot(0,0,0,0);function ZJ(n,e,t){return Kw.copy(n.getBoundingRect()),n.transform&&Kw.applyTransform(n.transform),Zw.width=e,Zw.height=t,!Kw.intersect(Zw)}const Os=KJ;var pa=Math.min,va=Math.max,Qw=Math.sin,Jw=Math.cos,Bc=Math.PI*2,Cy=bf(),Ey=bf(),Py=bf();function eS(n,e,t){if(n.length!==0){for(var r=n[0],i=r[0],a=r[0],s=r[1],o=r[1],l=1;l<n.length;l++)r=n[l],i=pa(i,r[0]),a=va(a,r[0]),s=pa(s,r[1]),o=va(o,r[1]);e[0]=i,e[1]=s,t[0]=a,t[1]=o}}function vI(n,e,t,r,i,a){i[0]=pa(n,t),i[1]=pa(e,r),a[0]=va(n,t),a[1]=va(e,r)}var gI=[],mI=[];function QJ(n,e,t,r,i,a,s,o,l,u){var c=$z,h=Qr,f=c(n,t,i,s,gI);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var d=0;d<f;d++){var p=h(n,t,i,s,gI[d]);l[0]=pa(p,l[0]),u[0]=va(p,u[0])}f=c(e,r,a,o,mI);for(var d=0;d<f;d++){var g=h(e,r,a,o,mI[d]);l[1]=pa(g,l[1]),u[1]=va(g,u[1])}l[0]=pa(n,l[0]),u[0]=va(n,u[0]),l[0]=pa(s,l[0]),u[0]=va(s,u[0]),l[1]=pa(e,l[1]),u[1]=va(e,u[1]),l[1]=pa(o,l[1]),u[1]=va(o,u[1])}function JJ(n,e,t,r,i,a,s,o){var l=qz,u=fi,c=va(pa(l(n,t,i),1),0),h=va(pa(l(e,r,a),1),0),f=u(n,t,i,c),d=u(e,r,a,h);s[0]=pa(n,i,f),s[1]=pa(e,a,d),o[0]=va(n,i,f),o[1]=va(e,a,d)}function eee(n,e,t,r,i,a,s,o,l){var u=Fu,c=Bu,h=Math.abs(i-a);if(h%Bc<1e-4&&h>1e-4){o[0]=n-t,o[1]=e-r,l[0]=n+t,l[1]=e+r;return}if(Cy[0]=Jw(i)*t+n,Cy[1]=Qw(i)*r+e,Ey[0]=Jw(a)*t+n,Ey[1]=Qw(a)*r+e,u(o,Cy,Ey),c(l,Cy,Ey),i=i%Bc,i<0&&(i=i+Bc),a=a%Bc,a<0&&(a=a+Bc),i>a&&!s?a+=Bc:i<a&&s&&(i+=Bc),s){var f=a;a=i,i=f}for(var d=0;d<a;d+=Math.PI/2)d>i&&(Py[0]=Jw(d)*t+n,Py[1]=Qw(d)*r+e,u(o,Py,o),c(l,Py,l))}var Ln={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Gc=[],zc=[],vo=[],nu=[],go=[],mo=[],eA=Math.min,tA=Math.max,Uc=Math.cos,Vc=Math.sin,hl=Math.abs,jT=Math.PI,Su=jT*2,nA=typeof Float32Array!="undefined",Uv=[];function rA(n){var e=Math.round(n/jT*1e8)/1e8;return e%2*jT}function LP(n,e){var t=rA(n[0]);t<0&&(t+=Su);var r=t-n[0],i=n[1];i+=r,!e&&i-t>=Su?i=t+Su:e&&t-i>=Su?i=t-Su:!e&&t>i?i=t+(Su-rA(t-i)):e&&t<i&&(i=t-(Su-rA(i-t))),n[0]=t,n[1]=i}var Jo=function(){function n(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return n.prototype.increaseVersion=function(){this._version++},n.prototype.getVersion=function(){return this._version},n.prototype.setScale=function(e,t,r){r=r||0,r>0&&(this._ux=hl(r/bx/e)||0,this._uy=hl(r/bx/t)||0)},n.prototype.setDPR=function(e){this.dpr=e},n.prototype.setContext=function(e){this._ctx=e},n.prototype.getContext=function(){return this._ctx},n.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},n.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},n.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Ln.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},n.prototype.lineTo=function(e,t){var r=hl(e-this._xi),i=hl(t-this._yi),a=r>this._ux||i>this._uy;if(this.addData(Ln.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var s=r*r+i*i;s>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=s)}return this},n.prototype.bezierCurveTo=function(e,t,r,i,a,s){return this._drawPendingPt(),this.addData(Ln.C,e,t,r,i,a,s),this._ctx&&this._ctx.bezierCurveTo(e,t,r,i,a,s),this._xi=a,this._yi=s,this},n.prototype.quadraticCurveTo=function(e,t,r,i){return this._drawPendingPt(),this.addData(Ln.Q,e,t,r,i),this._ctx&&this._ctx.quadraticCurveTo(e,t,r,i),this._xi=r,this._yi=i,this},n.prototype.arc=function(e,t,r,i,a,s){this._drawPendingPt(),Uv[0]=i,Uv[1]=a,LP(Uv,s),i=Uv[0],a=Uv[1];var o=a-i;return this.addData(Ln.A,e,t,r,r,i,o,0,s?0:1),this._ctx&&this._ctx.arc(e,t,r,i,a,s),this._xi=Uc(a)*r+e,this._yi=Vc(a)*r+t,this},n.prototype.arcTo=function(e,t,r,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,r,i,a),this},n.prototype.rect=function(e,t,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,r,i),this.addData(Ln.R,e,t,r,i),this},n.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ln.Z);var e=this._ctx,t=this._x0,r=this._y0;return e&&e.closePath(),this._xi=t,this._yi=r,this},n.prototype.fill=function(e){e&&e.fill(),this.toStatic()},n.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},n.prototype.len=function(){return this._len},n.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&nA&&(this.data=new Float32Array(t));for(var r=0;r<t;r++)this.data[r]=e[r];this._len=t},n.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var t=e.length,r=0,i=this._len,a=0;a<t;a++)r+=e[a].len();nA&&this.data instanceof Float32Array&&(this.data=new Float32Array(i+r));for(var a=0;a<t;a++)for(var s=e[a].data,o=0;o<s.length;o++)this.data[i++]=s[o];this._len=i},n.prototype.addData=function(e,t,r,i,a,s,o,l,u){if(this._saveData){var c=this.data;this._len+arguments.length>c.length&&(this._expandData(),c=this.data);for(var h=0;h<arguments.length;h++)c[this._len++]=arguments[h]}},n.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},n.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},n.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,nA&&this._len>11&&(this.data=new Float32Array(e)))}},n.prototype.getBoundingRect=function(){vo[0]=vo[1]=go[0]=go[1]=Number.MAX_VALUE,nu[0]=nu[1]=mo[0]=mo[1]=-Number.MAX_VALUE;var e=this.data,t=0,r=0,i=0,a=0,s;for(s=0;s<this._len;){var o=e[s++],l=s===1;switch(l&&(t=e[s],r=e[s+1],i=t,a=r),o){case Ln.M:t=i=e[s++],r=a=e[s++],go[0]=i,go[1]=a,mo[0]=i,mo[1]=a;break;case Ln.L:vI(t,r,e[s],e[s+1],go,mo),t=e[s++],r=e[s++];break;case Ln.C:QJ(t,r,e[s++],e[s++],e[s++],e[s++],e[s],e[s+1],go,mo),t=e[s++],r=e[s++];break;case Ln.Q:JJ(t,r,e[s++],e[s++],e[s],e[s+1],go,mo),t=e[s++],r=e[s++];break;case Ln.A:var u=e[s++],c=e[s++],h=e[s++],f=e[s++],d=e[s++],p=e[s++]+d;s+=1;var g=!e[s++];l&&(i=Uc(d)*h+u,a=Vc(d)*f+c),eee(u,c,h,f,d,p,g,go,mo),t=Uc(p)*h+u,r=Vc(p)*f+c;break;case Ln.R:i=t=e[s++],a=r=e[s++];var v=e[s++],m=e[s++];vI(i,a,i+v,a+m,go,mo);break;case Ln.Z:t=i,r=a;break}Fu(vo,vo,go),Bu(nu,nu,mo)}return s===0&&(vo[0]=vo[1]=nu[0]=nu[1]=0),new Ot(vo[0],vo[1],nu[0]-vo[0],nu[1]-vo[1])},n.prototype._calculateLength=function(){var e=this.data,t=this._len,r=this._ux,i=this._uy,a=0,s=0,o=0,l=0;this._pathSegLen||(this._pathSegLen=[]);for(var u=this._pathSegLen,c=0,h=0,f=0;f<t;){var d=e[f++],p=f===1;p&&(a=e[f],s=e[f+1],o=a,l=s);var g=-1;switch(d){case Ln.M:a=o=e[f++],s=l=e[f++];break;case Ln.L:{var v=e[f++],m=e[f++],y=v-a,_=m-s;(hl(y)>r||hl(_)>i||f===t-1)&&(g=Math.sqrt(y*y+_*_),a=v,s=m);break}case Ln.C:{var x=e[f++],b=e[f++],v=e[f++],m=e[f++],S=e[f++],w=e[f++];g=pQ(a,s,x,b,v,m,S,w,10),a=S,s=w;break}case Ln.Q:{var x=e[f++],b=e[f++],v=e[f++],m=e[f++];g=gQ(a,s,x,b,v,m,10),a=v,s=m;break}case Ln.A:var T=e[f++],C=e[f++],A=e[f++],M=e[f++],P=e[f++],D=e[f++],L=D+P;f+=1,p&&(o=Uc(P)*A+T,l=Vc(P)*M+C),g=tA(A,M)*eA(Su,Math.abs(D)),a=Uc(L)*A+T,s=Vc(L)*M+C;break;case Ln.R:{o=a=e[f++],l=s=e[f++];var R=e[f++],N=e[f++];g=R*2+N*2;break}case Ln.Z:{var y=o-a,_=l-s;g=Math.sqrt(y*y+_*_),a=o,s=l;break}}g>=0&&(u[h++]=g,c+=g)}return this._pathLen=c,c},n.prototype.rebuildPath=function(e,t){var r=this.data,i=this._ux,a=this._uy,s=this._len,o,l,u,c,h,f,d=t<1,p,g,v=0,m=0,y,_=0,x,b;if(!(d&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,g=this._pathLen,y=t*g,!y)))e:for(var S=0;S<s;){var w=r[S++],T=S===1;switch(T&&(u=r[S],c=r[S+1],o=u,l=c),w!==Ln.L&&_>0&&(e.lineTo(x,b),_=0),w){case Ln.M:o=u=r[S++],l=c=r[S++],e.moveTo(u,c);break;case Ln.L:{h=r[S++],f=r[S++];var C=hl(h-u),A=hl(f-c);if(C>i||A>a){if(d){var M=p[m++];if(v+M>y){var P=(y-v)/M;e.lineTo(u*(1-P)+h*P,c*(1-P)+f*P);break e}v+=M}e.lineTo(h,f),u=h,c=f,_=0}else{var D=C*C+A*A;D>_&&(x=h,b=f,_=D)}break}case Ln.C:{var L=r[S++],R=r[S++],N=r[S++],F=r[S++],O=r[S++],H=r[S++];if(d){var M=p[m++];if(v+M>y){var P=(y-v)/M;cc(u,L,N,O,P,Gc),cc(c,R,F,H,P,zc),e.bezierCurveTo(Gc[1],zc[1],Gc[2],zc[2],Gc[3],zc[3]);break e}v+=M}e.bezierCurveTo(L,R,N,F,O,H),u=O,c=H;break}case Ln.Q:{var L=r[S++],R=r[S++],N=r[S++],F=r[S++];if(d){var M=p[m++];if(v+M>y){var P=(y-v)/M;km(u,L,N,P,Gc),km(c,R,F,P,zc),e.quadraticCurveTo(Gc[1],zc[1],Gc[2],zc[2]);break e}v+=M}e.quadraticCurveTo(L,R,N,F),u=N,c=F;break}case Ln.A:var U=r[S++],$=r[S++],Y=r[S++],oe=r[S++],X=r[S++],re=r[S++],_e=r[S++],Fe=!r[S++],Ce=Y>oe?Y:oe,Ae=hl(Y-oe)>.001,ze=X+re,fe=!1;if(d){var M=p[m++];v+M>y&&(ze=X+re*(y-v)/M,fe=!0),v+=M}if(Ae&&e.ellipse?e.ellipse(U,$,Y,oe,_e,X,ze,Fe):e.arc(U,$,Ce,X,ze,Fe),fe)break e;T&&(o=Uc(X)*Y+U,l=Vc(X)*oe+$),u=Uc(ze)*Y+U,c=Vc(ze)*oe+$;break;case Ln.R:o=u=r[S],l=c=r[S+1],h=r[S++],f=r[S++];var j=r[S++],xe=r[S++];if(d){var M=p[m++];if(v+M>y){var pe=y-v;e.moveTo(h,f),e.lineTo(h+eA(pe,j),f),pe-=j,pe>0&&e.lineTo(h+j,f+eA(pe,xe)),pe-=xe,pe>0&&e.lineTo(h+tA(j-pe,0),f+xe),pe-=j,pe>0&&e.lineTo(h,f+tA(xe-pe,0));break e}v+=M}e.rect(h,f,j,xe);break;case Ln.Z:if(d){var M=p[m++];if(v+M>y){var P=(y-v)/M;e.lineTo(u*(1-P)+o*P,c*(1-P)+l*P);break e}v+=M}e.closePath(),u=o,c=l}}},n.prototype.clone=function(){var e=new n,t=this.data;return e.data=t.slice?t.slice():Array.prototype.slice.call(t),e._len=this._len,e},n.CMD=Ln,n.initDefaultProps=function(){var e=n.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),n}();function Au(n,e,t,r,i,a,s){if(i===0)return!1;var o=i,l=0,u=n;if(s>e+o&&s>r+o||s<e-o&&s<r-o||a>n+o&&a>t+o||a<n-o&&a<t-o)return!1;if(n!==t)l=(e-r)/(n-t),u=(n*r-t*e)/(n-t);else return Math.abs(a-n)<=o/2;var c=l*a-s+u,h=c*c/(l*l+1);return h<=o/2*o/2}function tee(n,e,t,r,i,a,s,o,l,u,c){if(l===0)return!1;var h=l;if(c>e+h&&c>r+h&&c>a+h&&c>o+h||c<e-h&&c<r-h&&c<a-h&&c<o-h||u>n+h&&u>t+h&&u>i+h&&u>s+h||u<n-h&&u<t-h&&u<i-h&&u<s-h)return!1;var f=jz(n,e,t,r,i,a,s,o,u,c,null);return f<=h/2}function PU(n,e,t,r,i,a,s,o,l){if(s===0)return!1;var u=s;if(l>e+u&&l>r+u&&l>a+u||l<e-u&&l<r-u&&l<a-u||o>n+u&&o>t+u&&o>i+u||o<n-u&&o<t-u&&o<i-u)return!1;var c=Xz(n,e,t,r,i,a,o,l,null);return c<=u/2}var yI=Math.PI*2;function Xa(n){return n%=yI,n<0&&(n+=yI),n}var Vv=Math.PI*2;function nee(n,e,t,r,i,a,s,o,l){if(s===0)return!1;var u=s;o-=n,l-=e;var c=Math.sqrt(o*o+l*l);if(c-u>t||c+u<t)return!1;if(Math.abs(r-i)%Vv<1e-4)return!0;if(a){var h=r;r=Xa(i),i=Xa(h)}else r=Xa(r),i=Xa(i);r>i&&(i+=Vv);var f=Math.atan2(l,o);return f<0&&(f+=Vv),f>=r&&f<=i||f+Vv>=r&&f+Vv<=i}function Al(n,e,t,r,i,a){if(a>e&&a>r||a<e&&a<r||r===e)return 0;var s=(a-e)/(r-e),o=r<e?1:-1;(s===1||s===0)&&(o=r<e?.5:-.5);var l=s*(t-n)+n;return l===i?1/0:l>i?o:0}var ru=Jo.CMD,Hc=Math.PI*2,ree=1e-4;function iee(n,e){return Math.abs(n-e)<ree}var ea=[-1,-1,-1],ys=[-1,-1];function aee(){var n=ys[0];ys[0]=ys[1],ys[1]=n}function see(n,e,t,r,i,a,s,o,l,u){if(u>e&&u>r&&u>a&&u>o||u<e&&u<r&&u<a&&u<o)return 0;var c=mx(e,r,a,o,u,ea);if(c===0)return 0;for(var h=0,f=-1,d=void 0,p=void 0,g=0;g<c;g++){var v=ea[g],m=v===0||v===1?.5:1,y=Qr(n,t,i,s,v);y<l||(f<0&&(f=$z(e,r,a,o,ys),ys[1]<ys[0]&&f>1&&aee(),d=Qr(e,r,a,o,ys[0]),f>1&&(p=Qr(e,r,a,o,ys[1]))),f===2?v<ys[0]?h+=d<e?m:-m:v<ys[1]?h+=p<d?m:-m:h+=o<p?m:-m:v<ys[0]?h+=d<e?m:-m:h+=o<d?m:-m)}return h}function oee(n,e,t,r,i,a,s,o){if(o>e&&o>r&&o>a||o<e&&o<r&&o<a)return 0;var l=vQ(e,r,a,o,ea);if(l===0)return 0;var u=qz(e,r,a);if(u>=0&&u<=1){for(var c=0,h=fi(e,r,a,u),f=0;f<l;f++){var d=ea[f]===0||ea[f]===1?.5:1,p=fi(n,t,i,ea[f]);p<s||(ea[f]<u?c+=h<e?d:-d:c+=a<h?d:-d)}return c}else{var d=ea[0]===0||ea[0]===1?.5:1,p=fi(n,t,i,ea[0]);return p<s?0:a<e?d:-d}}function lee(n,e,t,r,i,a,s,o){if(o-=e,o>t||o<-t)return 0;var l=Math.sqrt(t*t-o*o);ea[0]=-l,ea[1]=l;var u=Math.abs(r-i);if(u<1e-4)return 0;if(u>=Hc-1e-4){r=0,i=Hc;var c=a?1:-1;return s>=ea[0]+n&&s<=ea[1]+n?c:0}if(r>i){var h=r;r=i,i=h}r<0&&(r+=Hc,i+=Hc);for(var f=0,d=0;d<2;d++){var p=ea[d];if(p+n>s){var g=Math.atan2(o,p),c=a?1:-1;g<0&&(g=Hc+g),(g>=r&&g<=i||g+Hc>=r&&g+Hc<=i)&&(g>Math.PI/2&&g<Math.PI*1.5&&(c=-c),f+=c)}}return f}function LU(n,e,t,r,i){for(var a=n.data,s=n.len(),o=0,l=0,u=0,c=0,h=0,f,d,p=0;p<s;){var g=a[p++],v=p===1;switch(g===ru.M&&p>1&&(t||(o+=Al(l,u,c,h,r,i))),v&&(l=a[p],u=a[p+1],c=l,h=u),g){case ru.M:c=a[p++],h=a[p++],l=c,u=h;break;case ru.L:if(t){if(Au(l,u,a[p],a[p+1],e,r,i))return!0}else o+=Al(l,u,a[p],a[p+1],r,i)||0;l=a[p++],u=a[p++];break;case ru.C:if(t){if(tee(l,u,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],e,r,i))return!0}else o+=see(l,u,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],r,i)||0;l=a[p++],u=a[p++];break;case ru.Q:if(t){if(PU(l,u,a[p++],a[p++],a[p],a[p+1],e,r,i))return!0}else o+=oee(l,u,a[p++],a[p++],a[p],a[p+1],r,i)||0;l=a[p++],u=a[p++];break;case ru.A:var m=a[p++],y=a[p++],_=a[p++],x=a[p++],b=a[p++],S=a[p++];p+=1;var w=!!(1-a[p++]);f=Math.cos(b)*_+m,d=Math.sin(b)*x+y,v?(c=f,h=d):o+=Al(l,u,f,d,r,i);var T=(r-m)*x/_+m;if(t){if(nee(m,y,x,b,b+S,w,e,T,i))return!0}else o+=lee(m,y,x,b,b+S,w,T,i);l=Math.cos(b+S)*_+m,u=Math.sin(b+S)*x+y;break;case ru.R:c=l=a[p++],h=u=a[p++];var C=a[p++],A=a[p++];if(f=c+C,d=h+A,t){if(Au(c,h,f,h,e,r,i)||Au(f,h,f,d,e,r,i)||Au(f,d,c,d,e,r,i)||Au(c,d,c,h,e,r,i))return!0}else o+=Al(f,h,f,d,r,i),o+=Al(c,d,c,h,r,i);break;case ru.Z:if(t){if(Au(l,u,c,h,e,r,i))return!0}else o+=Al(l,u,c,h,r,i);l=c,u=h;break}}return!t&&!iee(u,h)&&(o+=Al(l,u,c,h,r,i)||0),o!==0}function uee(n,e,t){return LU(n,0,!1,e,t)}function cee(n,e,t,r){return LU(n,e,!0,t,r)}var Ax=dt({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Wh),hee={style:dt({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Jb.style)},iA=Zo.concat(["invisible","culling","z","z2","zlevel","parent"]),fee=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.update=function(){var t=this;n.prototype.update.call(this);var r=this.style;if(r.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 s in r)a[s]!==r[s]&&(a[s]=r[s]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var o=0;o<iA.length;++o)i[iA[o]]=this[iA[o]];i.__dirty|=Wa}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(t){var r=Yt(t);this.shape=this.getDefaultShape();var i=this.getDefaultStyle();i&&this.useStyle(i);for(var a=0;a<r.length;a++){var s=r[a],o=t[s];s==="style"?this.style?Pe(this.style,o):this.useStyle(o):s==="shape"?Pe(this.shape,o):n.prototype.attrKV.call(this,s,o)}this.style||this.useStyle({})},e.prototype.getDefaultStyle=function(){return null},e.prototype.getDefaultShape=function(){return{}},e.prototype.canBeInsideText=function(){return this.hasFill()},e.prototype.getInsideTextFill=function(){var t=this.style.fill;if(t!=="none"){if(Ke(t)){var r=_x(t,0);return r>.5?zT:r>.2?qQ:UT}else if(t)return UT}return zT},e.prototype.getInsideTextStroke=function(t){var r=this.style.fill;if(Ke(r)){var i=this.__zr,a=!!(i&&i.isDarkMode()),s=_x(t,0)<GT;if(a===s)return r}},e.prototype.buildPath=function(t,r,i){},e.prototype.pathUpdated=function(){this.__dirty&=~Cd},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Jo(!1)},e.prototype.hasStroke=function(){var t=this.style,r=t.stroke;return!(r==null||r==="none"||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style,r=t.fill;return r!=null&&r!=="none"},e.prototype.getBoundingRect=function(){var t=this._rect,r=this.style,i=!t;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var s=this.path;(a||this.__dirty&Cd)&&(s.beginPath(),this.buildPath(s,this.shape,!1),this.pathUpdated()),t=s.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||i){o.copy(t);var l=r.strokeNoScale?this.getLineScale():1,u=r.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c==null?4:c)}l>1e-10&&(o.width+=u/l,o.height+=u/l,o.x-=u/l/2,o.y-=u/l/2)}return o}return t},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect(),s=this.style;if(t=i[0],r=i[1],a.contain(t,r)){var o=this.path;if(this.hasStroke()){var l=s.lineWidth,u=s.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),cee(o,l/u,t,r)))return!0}if(this.hasFill())return uee(o,t,r)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=Cd,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,r){t==="shape"?this.setShape(r):n.prototype.attrKV.call(this,t,r)},e.prototype.setShape=function(t,r){var i=this.shape;return i||(i=this.shape={}),typeof t=="string"?i[t]=r:Pe(i,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&Cd)},e.prototype.createStyle=function(t){return qb(Ax,t)},e.prototype._innerSaveToNormal=function(t){n.prototype._innerSaveToNormal.call(this,t);var r=this._normalState;t.shape&&!r.shape&&(r.shape=Pe({},this.shape))},e.prototype._applyStateObj=function(t,r,i,a,s,o){n.prototype._applyStateObj.call(this,t,r,i,a,s,o);var l=!(r&&a),u;if(r&&r.shape?s?a?u=r.shape:(u=Pe({},i.shape),Pe(u,r.shape)):(u=Pe({},a?this.shape:i.shape),Pe(u,r.shape)):l&&(u=i.shape),u)if(s){this.shape=Pe({},this.shape);for(var c={},h=Yt(u),f=0;f<h.length;f++){var d=h[f];typeof u[d]=="object"?this.shape[d]=u[d]:c[d]=u[d]}this._transitionState(t,{shape:c},o)}else this.shape=u,this.dirtyShape()},e.prototype._mergeStates=function(t){for(var r=n.prototype._mergeStates.call(this,t),i,a=0;a<t.length;a++){var s=t[a];s.shape&&(i=i||{},this._mergeStyle(i,s.shape))}return i&&(r.shape=i),r},e.prototype.getAnimationStyleProps=function(){return hee},e.prototype.isZeroArea=function(){return!1},e.extend=function(t){var r=function(a){ve(s,a);function s(o){var l=a.call(this,o)||this;return t.init&&t.init.call(l,o),l}return s.prototype.getDefaultStyle=function(){return yt(t.style)},s.prototype.getDefaultShape=function(){return yt(t.shape)},s}(e);for(var i in t)typeof t[i]=="function"&&(r.prototype[i]=t[i]);return r},e.initDefaultProps=function(){var t=e.prototype;t.type="path",t.strokeContainThreshold=5,t.segmentIgnoreThreshold=0,t.subPixelOptimize=!1,t.autoBatch=!1,t.__dirty=Wa|Lg|Cd}(),e}(Os);const Ht=fee;var dee=dt({strokeFirst:!0,font:lc,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},Ax),RU=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.hasStroke=function(){var t=this.style,r=t.stroke;return r!=null&&r!=="none"&&t.lineWidth>0},e.prototype.hasFill=function(){var t=this.style,r=t.fill;return r!=null&&r!=="none"},e.prototype.createStyle=function(t){return qb(dee,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var r=t.text;r!=null?r+="":r="";var i=L0(r,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}(Os);RU.prototype.type="tspan";const zm=RU;var pee=dt({x:0,y:0},Wh),vee={style:dt({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Jb.style)};function gee(n){return!!(n&&typeof n!="string"&&n.width&&n.height)}var DU=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.createStyle=function(t){return qb(pee,t)},e.prototype._getSize=function(t){var r=this.style,i=r[t];if(i!=null)return i;var a=gee(r.image)?r.image:this.__image;if(!a)return 0;var s=t==="width"?"height":"width",o=r[s];return o==null?a[t]:a[t]/a[s]*o},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return vee},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new Ot(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(Os);DU.prototype.type="image";const Pi=DU;function mee(n,e){var t=e.x,r=e.y,i=e.width,a=e.height,s=e.r,o,l,u,c;i<0&&(t=t+i,i=-i),a<0&&(r=r+a,a=-a),typeof s=="number"?o=l=u=c=s:s instanceof Array?s.length===1?o=l=u=c=s[0]:s.length===2?(o=u=s[0],l=c=s[1]):s.length===3?(o=s[0],l=c=s[1],u=s[2]):(o=s[0],l=s[1],u=s[2],c=s[3]):o=l=u=c=0;var h;o+l>i&&(h=o+l,o*=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),o+c>a&&(h=o+c,o*=a/h,c*=a/h),n.moveTo(t+o,r),n.lineTo(t+i-l,r),l!==0&&n.arc(t+i-l,r+l,l,-Math.PI/2,0),n.lineTo(t+i,r+a-u),u!==0&&n.arc(t+i-u,r+a-u,u,0,Math.PI/2),n.lineTo(t+c,r+a),c!==0&&n.arc(t+c,r+a-c,c,Math.PI/2,Math.PI),n.lineTo(t,r+o),o!==0&&n.arc(t+o,r+o,o,Math.PI,Math.PI*1.5)}var Gd=Math.round;function IU(n,e,t){if(e){var r=e.x1,i=e.x2,a=e.y1,s=e.y2;n.x1=r,n.x2=i,n.y1=a,n.y2=s;var o=t&&t.lineWidth;return o&&(Gd(r*2)===Gd(i*2)&&(n.x1=n.x2=Eh(r,o,!0)),Gd(a*2)===Gd(s*2)&&(n.y1=n.y2=Eh(a,o,!0))),n}}function NU(n,e,t){if(e){var r=e.x,i=e.y,a=e.width,s=e.height;n.x=r,n.y=i,n.width=a,n.height=s;var o=t&&t.lineWidth;return o&&(n.x=Eh(r,o,!0),n.y=Eh(i,o,!0),n.width=Math.max(Eh(r+a,o,!1)-n.x,a===0?0:1),n.height=Math.max(Eh(i+s,o,!1)-n.y,s===0?0:1)),n}}function Eh(n,e,t){if(!e)return n;var r=Gd(n*2);return(r+Gd(e))%2===0?r/2:(r+(t?1:-1))/2}var yee=function(){function n(){this.x=0,this.y=0,this.width=0,this.height=0}return n}(),_ee={},kU=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new yee},e.prototype.buildPath=function(t,r){var i,a,s,o;if(this.subPixelOptimize){var l=NU(_ee,r,this.style);i=l.x,a=l.y,s=l.width,o=l.height,l.r=r.r,r=l}else i=r.x,a=r.y,s=r.width,o=r.height;r.r?mee(t,r):t.rect(i,a,s,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Ht);kU.prototype.type="rect";const nn=kU;var _I={fill:"#000"},xI=2,xee={style:dt({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},Jb.style)},OU=function(n){ve(e,n);function e(t){var r=n.call(this)||this;return r.type="text",r._children=[],r._defaultStyle=_I,r.attr(t),r}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){n.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var r=this._children[t];r.zlevel=this.zlevel,r.z=this.z,r.z2=this.z2,r.culling=this.culling,r.cursor=this.cursor,r.invisible=this.invisible}},e.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):n.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(t){var r=this.innerTransformable;return r?r.getLocalTransform(t):n.prototype.getLocalTransform.call(this,t)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),n.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){this._childCursor=0,wee(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(t){n.prototype.addSelfToZr.call(this,t);for(var r=0;r<this._children.length;r++)this._children[r].__zr=t},e.prototype.removeSelfFromZr=function(t){n.prototype.removeSelfFromZr.call(this,t);for(var r=0;r<this._children.length;r++)this._children[r].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var t=new Ot(0,0,0,0),r=this._children,i=[],a=null,s=0;s<r.length;s++){var o=r[s],l=o.getBoundingRect(),u=o.getLocalTransform(i);u?(t.copy(l),t.applyTransform(u),a=a||t.clone(),a.union(t)):(a=a||l.clone(),a.union(l))}this._rect=a||t}return this._rect},e.prototype.setDefaultTextStyle=function(t){this._defaultStyle=t||_I},e.prototype.setTextContent=function(t){},e.prototype._mergeStyle=function(t,r){if(!r)return t;var i=r.rich,a=t.rich||i&&{};return Pe(t,r),i&&a?(this._mergeRich(a,i),t.rich=a):a&&(t.rich=a),t},e.prototype._mergeRich=function(t,r){for(var i=Yt(r),a=0;a<i.length;a++){var s=i[a];t[s]=t[s]||{},Pe(t[s],r[s])}},e.prototype.getAnimationStyleProps=function(){return xee},e.prototype._getOrCreateChild=function(t){var r=this._children[this._childCursor];return(!r||!(r instanceof t))&&(r=new t),this._children[this._childCursor++]=r,r.__zr=this.__zr,r.parent=this,r},e.prototype._updatePlainTexts=function(){var t=this.style,r=t.font||lc,i=t.padding,a=CI(t),s=VJ(a,t),o=aA(t),l=!!t.backgroundColor,u=s.outerHeight,c=s.outerWidth,h=s.contentWidth,f=s.lines,d=s.lineHeight,p=this._defaultStyle;this.isTruncated=!!s.isTruncated;var g=t.x||0,v=t.y||0,m=t.align||p.align||"left",y=t.verticalAlign||p.verticalAlign||"top",_=g,x=Ed(v,s.contentHeight,y);if(o||i){var b=Dg(g,c,m),S=Ed(v,u,y);o&&this._renderBackground(t,t,b,S,c,u)}x+=d/2,i&&(_=TI(g,m,i),y==="top"?x+=i[0]:y==="bottom"&&(x-=i[2]));for(var w=0,T=!1,C=MI("fill"in t?t.fill:(T=!0,p.fill)),A=AI("stroke"in t?t.stroke:!l&&(!p.autoStroke||T)?(w=xI,p.stroke):null),M=t.textShadowBlur>0,P=t.width!=null&&(t.overflow==="truncate"||t.overflow==="break"||t.overflow==="breakAll"),D=s.calculatedLineHeight,L=0;L<f.length;L++){var R=this._getOrCreateChild(zm),N=R.createStyle();R.useStyle(N),N.text=f[L],N.x=_,N.y=x,m&&(N.textAlign=m),N.textBaseline="middle",N.opacity=t.opacity,N.strokeFirst=!0,M&&(N.shadowBlur=t.textShadowBlur||0,N.shadowColor=t.textShadowColor||"transparent",N.shadowOffsetX=t.textShadowOffsetX||0,N.shadowOffsetY=t.textShadowOffsetY||0),N.stroke=A,N.fill=C,A&&(N.lineWidth=t.lineWidth||w,N.lineDash=t.lineDash,N.lineDashOffset=t.lineDashOffset||0),N.font=r,SI(N,t),x+=d,P&&R.setBoundingRect(new Ot(Dg(N.x,h,N.textAlign),Ed(N.y,D,N.textBaseline),h,D))}},e.prototype._updateRichTexts=function(){var t=this.style,r=CI(t),i=$J(r,t),a=i.width,s=i.outerWidth,o=i.outerHeight,l=t.padding,u=t.x||0,c=t.y||0,h=this._defaultStyle,f=t.align||h.align,d=t.verticalAlign||h.verticalAlign;this.isTruncated=!!i.isTruncated;var p=Dg(u,s,f),g=Ed(c,o,d),v=p,m=g;l&&(v+=l[3],m+=l[0]);var y=v+a;aA(t)&&this._renderBackground(t,t,p,g,s,o);for(var _=!!t.backgroundColor,x=0;x<i.lines.length;x++){for(var b=i.lines[x],S=b.tokens,w=S.length,T=b.lineHeight,C=b.width,A=0,M=v,P=y,D=w-1,L=void 0;A<w&&(L=S[A],!L.align||L.align==="left");)this._placeToken(L,t,T,m,M,"left",_),C-=L.width,M+=L.width,A++;for(;D>=0&&(L=S[D],L.align==="right");)this._placeToken(L,t,T,m,P,"right",_),C-=L.width,P-=L.width,D--;for(M+=(a-(M-v)-(y-P)-C)/2;A<=D;)L=S[A],this._placeToken(L,t,T,m,M+L.width/2,"center",_),M+=L.width,A++;m+=T}},e.prototype._placeToken=function(t,r,i,a,s,o,l){var u=r.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&&aA(u);f&&this._renderBackground(u,r,o==="right"?s-t.width:o==="center"?s-t.width/2:s,h-t.height/2,t.width,t.height);var d=!!u.backgroundColor,p=t.textPadding;p&&(s=TI(s,o,p),h-=t.height/2-p[0]-t.innerHeight/2);var g=this._getOrCreateChild(zm),v=g.createStyle();g.useStyle(v);var m=this._defaultStyle,y=!1,_=0,x=MI("fill"in u?u.fill:"fill"in r?r.fill:(y=!0,m.fill)),b=AI("stroke"in u?u.stroke:"stroke"in r?r.stroke:!d&&!l&&(!m.autoStroke||y)?(_=xI,m.stroke):null),S=u.textShadowBlur>0||r.textShadowBlur>0;v.text=t.text,v.x=s,v.y=h,S&&(v.shadowBlur=u.textShadowBlur||r.textShadowBlur||0,v.shadowColor=u.textShadowColor||r.textShadowColor||"transparent",v.shadowOffsetX=u.textShadowOffsetX||r.textShadowOffsetX||0,v.shadowOffsetY=u.textShadowOffsetY||r.textShadowOffsetY||0),v.textAlign=o,v.textBaseline="middle",v.font=t.font||lc,v.opacity=Ho(u.opacity,r.opacity,1),SI(v,u),b&&(v.lineWidth=Ho(u.lineWidth,r.lineWidth,_),v.lineDash=Et(u.lineDash,r.lineDash),v.lineDashOffset=r.lineDashOffset||0,v.stroke=b),x&&(v.fill=x);var w=t.contentWidth,T=t.contentHeight;g.setBoundingRect(new Ot(Dg(v.x,w,v.textAlign),Ed(v.y,T,v.textBaseline),w,T))},e.prototype._renderBackground=function(t,r,i,a,s,o){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(nn),g.useStyle(g.createStyle()),g.style.fill=null;var m=g.shape;m.x=i,m.y=a,m.width=s,m.height=o,m.r=d,g.dirtyShape()}if(f){var y=g.style;y.fill=l||null,y.fillOpacity=Et(t.fillOpacity,1)}else if(h){v=this._getOrCreateChild(Pi),v.onload=function(){p.dirtyStyle()};var _=v.style;_.image=l.image,_.x=i,_.y=a,_.width=s,_.height=o}if(u&&c){var y=g.style;y.lineWidth=u,y.stroke=c,y.strokeOpacity=Et(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=Ho(t.opacity,r.opacity,1)},e.makeFont=function(t){var r="";return BU(t)&&(r=[t.fontStyle,t.fontWeight,FU(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),r&&no(r)||t.textFont||t.font},e}(Os),bee={left:!0,right:1,center:1},See={top:1,bottom:1,middle:1},bI=["fontStyle","fontWeight","fontSize","fontFamily"];function FU(n){return typeof n=="string"&&(n.indexOf("px")!==-1||n.indexOf("rem")!==-1||n.indexOf("em")!==-1)?n:isNaN(+n)?hP+"px":n+"px"}function SI(n,e){for(var t=0;t<bI.length;t++){var r=bI[t],i=e[r];i!=null&&(n[r]=i)}}function BU(n){return n.fontSize!=null||n.fontFamily||n.fontWeight}function wee(n){return wI(n),z(n.rich,wI),n}function wI(n){if(n){n.font=OU.makeFont(n);var e=n.align;e==="middle"&&(e="center"),n.align=e==null||bee[e]?e:"left";var t=n.verticalAlign;t==="center"&&(t="middle"),n.verticalAlign=t==null||See[t]?t:"top";var r=n.padding;r&&(n.padding=mP(n.padding))}}function AI(n,e){return n==null||e<=0||n==="transparent"||n==="none"?null:n.image||n.colorStops?"#000":n}function MI(n){return n==null||n==="none"?null:n.image||n.colorStops?"#000":n}function TI(n,e,t){return e==="right"?n-t[1]:e==="center"?n+t[3]/2-t[1]/2:n+t[3]}function CI(n){var e=n.text;return e!=null&&(e+=""),e}function aA(n){return!!(n.backgroundColor||n.lineHeight||n.borderWidth&&n.borderColor)}const ln=OU;var St=en(),qT=function(n,e,t,r){if(r){var i=St(r);i.dataIndex=t,i.dataType=e,i.seriesIndex=n,i.ssrType="chart",r.type==="group"&&r.traverse(function(a){var s=St(a);s.seriesIndex=n,s.dataIndex=t,s.dataType=e,s.ssrType="chart"})}},EI=1,PI={},GU=en(),RP=en(),DP=0,D0=1,tS=2,oa=["emphasis","blur","select"],Um=["normal","emphasis","blur","select"],Xp=10,Aee=9,$h="highlight",k1="downplay",nm="select",O1="unselect",rm="toggleSelect";function Gf(n){return n!=null&&n!=="none"}function nS(n,e,t){n.onHoverStateChange&&(n.hoverState||0)!==t&&n.onHoverStateChange(e),n.hoverState=t}function zU(n){nS(n,"emphasis",tS)}function UU(n){n.hoverState===tS&&nS(n,"normal",DP)}function IP(n){nS(n,"blur",D0)}function VU(n){n.hoverState===D0&&nS(n,"normal",DP)}function Mee(n){n.selected=!0}function Tee(n){n.selected=!1}function LI(n,e,t){e(n,t)}function Xl(n,e,t){LI(n,e,t),n.isGroup&&n.traverse(function(r){LI(r,e,t)})}function Mx(n,e){switch(e){case"emphasis":n.hoverState=tS;break;case"normal":n.hoverState=DP;break;case"blur":n.hoverState=D0;break;case"select":n.selected=!0}}function Cee(n,e,t,r){for(var i=n.style,a={},s=0;s<e.length;s++){var o=e[s],l=i[o];a[o]=l==null?r&&r[o]:l}for(var s=0;s<n.animators.length;s++){var u=n.animators[s];u.__fromStateTransition&&u.__fromStateTransition.indexOf(t)<0&&u.targetName==="style"&&u.saveTo(a,e)}return a}function Eee(n,e,t,r){var i=t&&Ft(t,"select")>=0,a=!1;if(n instanceof Ht){var s=GU(n),o=i&&s.selectFill||s.normalFill,l=i&&s.selectStroke||s.normalStroke;if(Gf(o)||Gf(l)){r=r||{};var u=r.style||{};u.fill==="inherit"?(a=!0,r=Pe({},r),u=Pe({},u),u.fill=o):!Gf(u.fill)&&Gf(o)?(a=!0,r=Pe({},r),u=Pe({},u),u.fill=DT(o)):!Gf(u.stroke)&&Gf(l)&&(a||(r=Pe({},r),u=Pe({},u)),u.stroke=DT(l)),r.style=u}}if(r&&r.z2==null){a||(r=Pe({},r));var c=n.z2EmphasisLift;r.z2=n.z2+(c!=null?c:Xp)}return r}function Pee(n,e,t){if(t&&t.z2==null){t=Pe({},t);var r=n.z2SelectLift;t.z2=n.z2+(r!=null?r:Aee)}return t}function Lee(n,e,t){var r=Ft(n.currentStates,e)>=0,i=n.style.opacity,a=r?null:Cee(n,["opacity"],e,{opacity:1});t=t||{};var s=t.style||{};return s.opacity==null&&(t=Pe({},t),s=Pe({opacity:r?i:a.opacity*.1},s),t.style=s),t}function sA(n,e){var t=this.states[n];if(this.style){if(n==="emphasis")return Eee(this,n,e,t);if(n==="blur")return Lee(this,n,t);if(n==="select")return Pee(this,n,t)}return t}function cf(n){n.stateProxy=sA;var e=n.getTextContent(),t=n.getTextGuideLine();e&&(e.stateProxy=sA),t&&(t.stateProxy=sA)}function RI(n,e){!jU(n,e)&&!n.__highByOuter&&Xl(n,zU)}function DI(n,e){!jU(n,e)&&!n.__highByOuter&&Xl(n,UU)}function zl(n,e){n.__highByOuter|=1<<(e||0),Xl(n,zU)}function Ul(n,e){!(n.__highByOuter&=~(1<<(e||0)))&&Xl(n,UU)}function HU(n){Xl(n,IP)}function NP(n){Xl(n,VU)}function WU(n){Xl(n,Mee)}function $U(n){Xl(n,Tee)}function jU(n,e){return n.__highDownSilentOnTouch&&e.zrByTouch}function qU(n){var e=n.getModel(),t=[],r=[];e.eachComponent(function(i,a){var s=RP(a),o=i==="series",l=o?n.getViewOfSeriesModel(a):n.getViewOfComponentModel(a);!o&&r.push(l),s.isBlured&&(l.group.traverse(function(u){VU(u)}),o&&t.push(a)),s.isBlured=!1}),z(r,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(t,!1,e)})}function XT(n,e,t,r){var i=r.getModel();t=t||"coordinateSystem";function a(u,c){for(var h=0;h<c.length;h++){var f=u.getItemGraphicEl(c[h]);f&&NP(f)}}if(n!=null&&!(!e||e==="none")){var s=i.getSeriesByIndex(n),o=s.coordinateSystem;o&&o.master&&(o=o.master);var l=[];i.eachSeries(function(u){var c=s===u,h=u.coordinateSystem;h&&h.master&&(h=h.master);var f=h&&o?h===o:c;if(!(t==="series"&&!c||t==="coordinateSystem"&&!f||e==="series"&&c)){var d=r.getViewOfSeriesModel(u);if(d.group.traverse(function(v){v.__highByOuter&&c&&e==="self"||IP(v)}),Hi(e))a(u.getData(),e);else if(gt(e))for(var p=Yt(e),g=0;g<p.length;g++)a(u.getData(p[g]),e[p[g]]);l.push(u),RP(u).isBlured=!0}}),i.eachComponent(function(u,c){if(u!=="series"){var h=r.getViewOfComponentModel(c);h&&h.toggleBlurSeries&&h.toggleBlurSeries(l,!0,i)}})}}function YT(n,e,t){if(!(n==null||e==null)){var r=t.getModel().getComponent(n,e);if(r){RP(r).isBlured=!0;var i=t.getViewOfComponentModel(r);!i||!i.focusBlurEnabled||i.group.traverse(function(a){IP(a)})}}}function Ree(n,e,t){var r=n.seriesIndex,i=n.getData(e.dataType);if(i){var a=lf(i,e);a=(Ie(a)?a[0]:a)||0;var s=i.getItemGraphicEl(a);if(!s)for(var o=i.count(),l=0;!s&&l<o;)s=i.getItemGraphicEl(l++);if(s){var u=St(s);XT(r,u.focus,u.blurScope,t)}else{var c=n.get(["emphasis","focus"]),h=n.get(["emphasis","blurScope"]);c!=null&&XT(r,c,h,t)}}}function kP(n,e,t,r){var i={focusSelf:!1,dispatchers:null};if(n==null||n==="series"||e==null||t==null)return i;var a=r.getModel().getComponent(n,e);if(!a)return i;var s=r.getViewOfComponentModel(a);if(!s||!s.findHighDownDispatchers)return i;for(var o=s.findHighDownDispatchers(t),l,u=0;u<o.length;u++)if(St(o[u]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:o}}function Dee(n,e,t){var r=St(n),i=kP(r.componentMainType,r.componentIndex,r.componentHighDownName,t),a=i.dispatchers,s=i.focusSelf;a?(s&&YT(r.componentMainType,r.componentIndex,t),z(a,function(o){return RI(o,e)})):(XT(r.seriesIndex,r.focus,r.blurScope,t),r.focus==="self"&&YT(r.componentMainType,r.componentIndex,t),RI(n,e))}function Iee(n,e,t){qU(t);var r=St(n),i=kP(r.componentMainType,r.componentIndex,r.componentHighDownName,t).dispatchers;i?z(i,function(a){return DI(a,e)}):DI(n,e)}function Nee(n,e,t){if(ZT(e)){var r=e.dataType,i=n.getData(r),a=lf(i,e);Ie(a)||(a=[a]),n[e.type===rm?"toggleSelect":e.type===nm?"select":"unselect"](a,r)}}function II(n){var e=n.getAllData();z(e,function(t){var r=t.data,i=t.type;r.eachItemGraphicEl(function(a,s){n.isSelected(s,i)?WU(a):$U(a)})})}function kee(n){var e=[];return n.eachSeries(function(t){var r=t.getAllData();z(r,function(i){i.data;var a=i.type,s=t.getSelectedDataIndices();if(s.length>0){var o={dataIndex:s,seriesIndex:t.seriesIndex};a!=null&&(o.dataType=a),e.push(o)}})}),e}function jh(n,e,t){Ph(n,!0),Xl(n,cf),KT(n,e,t)}function Oee(n){Ph(n,!1)}function lr(n,e,t,r){r?Oee(n):jh(n,e,t)}function KT(n,e,t){var r=St(n);e!=null?(r.focus=e,r.blurScope=t):r.focus&&(r.focus=null)}var NI=["emphasis","blur","select"],Fee={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Ci(n,e,t,r){t=t||"itemStyle";for(var i=0;i<NI.length;i++){var a=NI[i],s=e.getModel([a,t]),o=n.ensureState(a);o.style=r?r(s):s[Fee[t]]()}}function Ph(n,e){var t=e===!1,r=n;n.highDownSilentOnTouch&&(r.__highDownSilentOnTouch=n.highDownSilentOnTouch),(!t||r.__highDownDispatcher)&&(r.__highByOuter=r.__highByOuter||0,r.__highDownDispatcher=!t)}function Vm(n){return!!(n&&n.__highDownDispatcher)}function Bee(n,e,t){var r=St(n);r.componentMainType=e.mainType,r.componentIndex=e.componentIndex,r.componentHighDownName=t}function Gee(n){var e=PI[n];return e==null&&EI<=32&&(e=PI[n]=EI++),e}function ZT(n){var e=n.type;return e===nm||e===O1||e===rm}function kI(n){var e=n.type;return e===$h||e===k1}function zee(n){var e=GU(n);e.normalFill=n.style.fill,e.normalStroke=n.style.stroke;var t=n.states.select||{};e.selectFill=t.style&&t.style.fill||null,e.selectStroke=t.style&&t.style.stroke||null}var zf=Jo.CMD,Uee=[[],[],[]],OI=Math.sqrt,Vee=Math.atan2;function XU(n,e){if(e){var t=n.data,r=n.len(),i,a,s,o,l,u,c=zf.M,h=zf.C,f=zf.L,d=zf.R,p=zf.A,g=zf.Q;for(s=0,o=0;s<r;){switch(i=t[s++],o=s,a=0,i){case c:a=1;break;case f:a=1;break;case h:a=3;break;case g:a=2;break;case p:var v=e[4],m=e[5],y=OI(e[0]*e[0]+e[1]*e[1]),_=OI(e[2]*e[2]+e[3]*e[3]),x=Vee(-e[1]/_,e[0]/y);t[s]*=y,t[s++]+=v,t[s]*=_,t[s++]+=m,t[s++]*=y,t[s++]*=_,t[s++]+=x,t[s++]+=x,s+=2,o=s;break;case d:u[0]=t[s++],u[1]=t[s++],Mi(u,u,e),t[o++]=u[0],t[o++]=u[1],u[0]+=t[s++],u[1]+=t[s++],Mi(u,u,e),t[o++]=u[0],t[o++]=u[1]}for(l=0;l<a;l++){var b=Uee[l];b[0]=t[s++],b[1]=t[s++],Mi(b,b,e),t[o++]=b[0],t[o++]=b[1]}}n.increaseVersion()}}var oA=Math.sqrt,Ly=Math.sin,Ry=Math.cos,Hv=Math.PI;function FI(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function QT(n,e){return(n[0]*e[0]+n[1]*e[1])/(FI(n)*FI(e))}function BI(n,e){return(n[0]*e[1]<n[1]*e[0]?-1:1)*Math.acos(QT(n,e))}function GI(n,e,t,r,i,a,s,o,l,u,c){var h=l*(Hv/180),f=Ry(h)*(n-t)/2+Ly(h)*(e-r)/2,d=-1*Ly(h)*(n-t)/2+Ry(h)*(e-r)/2,p=f*f/(s*s)+d*d/(o*o);p>1&&(s*=oA(p),o*=oA(p));var g=(i===a?-1:1)*oA((s*s*(o*o)-s*s*(d*d)-o*o*(f*f))/(s*s*(d*d)+o*o*(f*f)))||0,v=g*s*d/o,m=g*-o*f/s,y=(n+t)/2+Ry(h)*v-Ly(h)*m,_=(e+r)/2+Ly(h)*v+Ry(h)*m,x=BI([1,0],[(f-v)/s,(d-m)/o]),b=[(f-v)/s,(d-m)/o],S=[(-1*f-v)/s,(-1*d-m)/o],w=BI(b,S);if(QT(b,S)<=-1&&(w=Hv),QT(b,S)>=1&&(w=0),w<0){var T=Math.round(w/Hv*1e6)/1e6;w=Hv*2+T%2*Hv}c.addData(u,y,_,s,o,x,w,h,a)}var Hee=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,Wee=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function $ee(n){var e=new Jo;if(!n)return e;var t=0,r=0,i=t,a=r,s,o=Jo.CMD,l=n.match(Hee);if(!l)return e;for(var u=0;u<l.length;u++){for(var c=l[u],h=c.charAt(0),f=void 0,d=c.match(Wee)||[],p=d.length,g=0;g<p;g++)d[g]=parseFloat(d[g]);for(var v=0;v<p;){var m=void 0,y=void 0,_=void 0,x=void 0,b=void 0,S=void 0,w=void 0,T=t,C=r,A=void 0,M=void 0;switch(h){case"l":t+=d[v++],r+=d[v++],f=o.L,e.addData(f,t,r);break;case"L":t=d[v++],r=d[v++],f=o.L,e.addData(f,t,r);break;case"m":t+=d[v++],r+=d[v++],f=o.M,e.addData(f,t,r),i=t,a=r,h="l";break;case"M":t=d[v++],r=d[v++],f=o.M,e.addData(f,t,r),i=t,a=r,h="L";break;case"h":t+=d[v++],f=o.L,e.addData(f,t,r);break;case"H":t=d[v++],f=o.L,e.addData(f,t,r);break;case"v":r+=d[v++],f=o.L,e.addData(f,t,r);break;case"V":r=d[v++],f=o.L,e.addData(f,t,r);break;case"C":f=o.C,e.addData(f,d[v++],d[v++],d[v++],d[v++],d[v++],d[v++]),t=d[v-2],r=d[v-1];break;case"c":f=o.C,e.addData(f,d[v++]+t,d[v++]+r,d[v++]+t,d[v++]+r,d[v++]+t,d[v++]+r),t+=d[v-2],r+=d[v-1];break;case"S":m=t,y=r,A=e.len(),M=e.data,s===o.C&&(m+=t-M[A-4],y+=r-M[A-3]),f=o.C,T=d[v++],C=d[v++],t=d[v++],r=d[v++],e.addData(f,m,y,T,C,t,r);break;case"s":m=t,y=r,A=e.len(),M=e.data,s===o.C&&(m+=t-M[A-4],y+=r-M[A-3]),f=o.C,T=t+d[v++],C=r+d[v++],t+=d[v++],r+=d[v++],e.addData(f,m,y,T,C,t,r);break;case"Q":T=d[v++],C=d[v++],t=d[v++],r=d[v++],f=o.Q,e.addData(f,T,C,t,r);break;case"q":T=d[v++]+t,C=d[v++]+r,t+=d[v++],r+=d[v++],f=o.Q,e.addData(f,T,C,t,r);break;case"T":m=t,y=r,A=e.len(),M=e.data,s===o.Q&&(m+=t-M[A-4],y+=r-M[A-3]),t=d[v++],r=d[v++],f=o.Q,e.addData(f,m,y,t,r);break;case"t":m=t,y=r,A=e.len(),M=e.data,s===o.Q&&(m+=t-M[A-4],y+=r-M[A-3]),t+=d[v++],r+=d[v++],f=o.Q,e.addData(f,m,y,t,r);break;case"A":_=d[v++],x=d[v++],b=d[v++],S=d[v++],w=d[v++],T=t,C=r,t=d[v++],r=d[v++],f=o.A,GI(T,C,t,r,S,w,_,x,b,f,e);break;case"a":_=d[v++],x=d[v++],b=d[v++],S=d[v++],w=d[v++],T=t,C=r,t+=d[v++],r+=d[v++],f=o.A,GI(T,C,t,r,S,w,_,x,b,f,e);break}}(h==="z"||h==="Z")&&(f=o.Z,e.addData(f),t=i,r=a),s=f}return e.toStatic(),e}var YU=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.applyTransform=function(t){},e}(Ht);function KU(n){return n.setData!=null}function ZU(n,e){var t=$ee(n),r=Pe({},e);return r.buildPath=function(i){if(KU(i)){i.setData(t.data);var a=i.getContext();a&&i.rebuildPath(a,1)}else{var a=i;t.rebuildPath(a,1)}},r.applyTransform=function(i){XU(t,i),this.dirtyShape()},r}function QU(n,e){return new YU(ZU(n,e))}function jee(n,e){var t=ZU(n,e),r=function(i){ve(a,i);function a(s){var o=i.call(this,s)||this;return o.applyTransform=t.applyTransform,o.buildPath=t.buildPath,o}return a}(YU);return r}function qee(n,e){for(var t=[],r=n.length,i=0;i<r;i++){var a=n[i];t.push(a.getUpdatedPathProxy(!0))}var s=new Ht(e);return s.createPathProxy(),s.buildPath=function(o){if(KU(o)){o.appendPath(t);var l=o.getContext();l&&o.rebuildPath(l,1)}},s}function OP(n,e){e=e||{};var t=new Ht;return n.shape&&t.setShape(n.shape),t.setStyle(n.style),e.bakeTransform?XU(t.path,n.getComputedTransform()):e.toLocal?t.setLocalTransform(n.getComputedTransform()):t.copyTransform(n),t.buildPath=n.buildPath,t.applyTransform=t.applyTransform,t.z=n.z,t.z2=n.z2,t.zlevel=n.zlevel,t}var Xee=function(){function n(){this.cx=0,this.cy=0,this.r=0}return n}(),JU=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Xee},e.prototype.buildPath=function(t,r){t.moveTo(r.cx+r.r,r.cy),t.arc(r.cx,r.cy,r.r,0,Math.PI*2)},e}(Ht);JU.prototype.type="circle";const bc=JU;var Yee=function(){function n(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return n}(),e7=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Yee},e.prototype.buildPath=function(t,r){var i=.5522848,a=r.cx,s=r.cy,o=r.rx,l=r.ry,u=o*i,c=l*i;t.moveTo(a-o,s),t.bezierCurveTo(a-o,s-c,a-u,s-l,a,s-l),t.bezierCurveTo(a+u,s-l,a+o,s-c,a+o,s),t.bezierCurveTo(a+o,s+c,a+u,s+l,a,s+l),t.bezierCurveTo(a-u,s+l,a-o,s+c,a-o,s),t.closePath()},e}(Ht);e7.prototype.type="ellipse";const FP=e7;var t7=Math.PI,lA=t7*2,Wc=Math.sin,Uf=Math.cos,Kee=Math.acos,Li=Math.atan2,zI=Math.abs,im=Math.sqrt,Ig=Math.max,yo=Math.min,Ys=1e-4;function Zee(n,e,t,r,i,a,s,o){var l=t-n,u=r-e,c=s-i,h=o-a,f=h*l-c*u;if(!(f*f<Ys))return f=(c*(e-a)-h*(n-i))/f,[n+f*l,e+f*u]}function Dy(n,e,t,r,i,a,s){var o=n-t,l=e-r,u=(s?a:-a)/im(o*o+l*l),c=u*l,h=-u*o,f=n+c,d=e+h,p=t+c,g=r+h,v=(f+p)/2,m=(d+g)/2,y=p-f,_=g-d,x=y*y+_*_,b=i-a,S=f*g-p*d,w=(_<0?-1:1)*im(Ig(0,b*b*x-S*S)),T=(S*_-y*w)/x,C=(-S*y-_*w)/x,A=(S*_+y*w)/x,M=(-S*y+_*w)/x,P=T-v,D=C-m,L=A-v,R=M-m;return P*P+D*D>L*L+R*R&&(T=A,C=M),{cx:T,cy:C,x0:-c,y0:-h,x1:T*(i/b-1),y1:C*(i/b-1)}}function Qee(n){var e;if(Ie(n)){var t=n.length;if(!t)return n;t===1?e=[n[0],n[0],0,0]:t===2?e=[n[0],n[0],n[1],n[1]]:t===3?e=n.concat(n[2]):e=n}else e=[n,n,n,n];return e}function Jee(n,e){var t,r=Ig(e.r,0),i=Ig(e.r0||0,0),a=r>0,s=i>0;if(!(!a&&!s)){if(a||(r=i,i=0),i>r){var o=r;r=i,i=o}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var c=e.cx,h=e.cy,f=!!e.clockwise,d=zI(u-l),p=d>lA&&d%lA;if(p>Ys&&(d=p),!(r>Ys))n.moveTo(c,h);else if(d>lA-Ys)n.moveTo(c+r*Uf(l),h+r*Wc(l)),n.arc(c,h,r,l,u,!f),i>Ys&&(n.moveTo(c+i*Uf(u),h+i*Wc(u)),n.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,b=void 0,S=void 0,w=void 0,T=void 0,C=void 0,A=void 0,M=void 0,P=void 0,D=void 0,L=void 0,R=r*Uf(l),N=r*Wc(l),F=i*Uf(u),O=i*Wc(u),H=d>Ys;if(H){var U=e.cornerRadius;U&&(t=Qee(U),g=t[0],v=t[1],m=t[2],y=t[3]);var $=zI(r-i)/2;if(_=yo($,m),x=yo($,y),b=yo($,g),S=yo($,v),C=w=Ig(_,x),A=T=Ig(b,S),(w>Ys||T>Ys)&&(M=r*Uf(u),P=r*Wc(u),D=i*Uf(l),L=i*Wc(l),d<t7)){var Y=Zee(R,N,D,L,M,P,F,O);if(Y){var oe=R-Y[0],X=N-Y[1],re=M-Y[0],_e=P-Y[1],Fe=1/Wc(Kee((oe*re+X*_e)/(im(oe*oe+X*X)*im(re*re+_e*_e)))/2),Ce=im(Y[0]*Y[0]+Y[1]*Y[1]);C=yo(w,(r-Ce)/(Fe+1)),A=yo(T,(i-Ce)/(Fe-1))}}}if(!H)n.moveTo(c+R,h+N);else if(C>Ys){var Ae=yo(m,C),ze=yo(y,C),fe=Dy(D,L,R,N,r,Ae,f),j=Dy(M,P,F,O,r,ze,f);n.moveTo(c+fe.cx+fe.x0,h+fe.cy+fe.y0),C<w&&Ae===ze?n.arc(c+fe.cx,h+fe.cy,C,Li(fe.y0,fe.x0),Li(j.y0,j.x0),!f):(Ae>0&&n.arc(c+fe.cx,h+fe.cy,Ae,Li(fe.y0,fe.x0),Li(fe.y1,fe.x1),!f),n.arc(c,h,r,Li(fe.cy+fe.y1,fe.cx+fe.x1),Li(j.cy+j.y1,j.cx+j.x1),!f),ze>0&&n.arc(c+j.cx,h+j.cy,ze,Li(j.y1,j.x1),Li(j.y0,j.x0),!f))}else n.moveTo(c+R,h+N),n.arc(c,h,r,l,u,!f);if(!(i>Ys)||!H)n.lineTo(c+F,h+O);else if(A>Ys){var Ae=yo(g,A),ze=yo(v,A),fe=Dy(F,O,M,P,i,-ze,f),j=Dy(R,N,D,L,i,-Ae,f);n.lineTo(c+fe.cx+fe.x0,h+fe.cy+fe.y0),A<T&&Ae===ze?n.arc(c+fe.cx,h+fe.cy,A,Li(fe.y0,fe.x0),Li(j.y0,j.x0),!f):(ze>0&&n.arc(c+fe.cx,h+fe.cy,ze,Li(fe.y0,fe.x0),Li(fe.y1,fe.x1),!f),n.arc(c,h,i,Li(fe.cy+fe.y1,fe.cx+fe.x1),Li(j.cy+j.y1,j.cx+j.x1),f),Ae>0&&n.arc(c+j.cx,h+j.cy,Ae,Li(j.y1,j.x1),Li(j.y0,j.x0),!f))}else n.lineTo(c+F,h+O),n.arc(c,h,i,u,l,f)}n.closePath()}}}var ete=function(){function n(){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 n}(),n7=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new ete},e.prototype.buildPath=function(t,r){Jee(t,r)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Ht);n7.prototype.type="sector";const La=n7;var tte=function(){function n(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return n}(),r7=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new tte},e.prototype.buildPath=function(t,r){var i=r.cx,a=r.cy,s=Math.PI*2;t.moveTo(i+r.r,a),t.arc(i,a,r.r,0,s,!1),t.moveTo(i+r.r0,a),t.arc(i,a,r.r0,0,s,!0)},e}(Ht);r7.prototype.type="ring";const rS=r7;function nte(n,e,t,r){var i=[],a=[],s=[],o=[],l,u,c,h;if(r){c=[1/0,1/0],h=[-1/0,-1/0];for(var f=0,d=n.length;f<d;f++)Fu(c,c,n[f]),Bu(h,h,n[f]);Fu(c,c,r[0]),Bu(h,h,r[1])}for(var f=0,d=n.length;f<d;f++){var p=n[f];if(t)l=n[f?f-1:d-1],u=n[(f+1)%d];else if(f===0||f===d-1){i.push(Rl(n[f]));continue}else l=n[f-1],u=n[f+1];Ch(a,u,l),C1(a,a,e);var g=ST(p,l),v=ST(p,u),m=g+v;m!==0&&(g/=m,v/=m),C1(s,a,-g),C1(o,a,v);var y=ID([],p,s),_=ID([],p,o);r&&(Bu(y,y,c),Fu(y,y,h),Bu(_,_,c),Fu(_,_,h)),i.push(y),i.push(_)}return t&&i.push(i.shift()),i}function i7(n,e,t){var r=e.smooth,i=e.points;if(i&&i.length>=2){if(r){var a=nte(i,r,t,e.smoothConstraint);n.moveTo(i[0][0],i[0][1]);for(var s=i.length,o=0;o<(t?s:s-1);o++){var l=a[o*2],u=a[o*2+1],c=i[(o+1)%s];n.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{n.moveTo(i[0][0],i[0][1]);for(var o=1,h=i.length;o<h;o++)n.lineTo(i[o][0],i[o][1])}t&&n.closePath()}}var rte=function(){function n(){this.points=null,this.smooth=0,this.smoothConstraint=null}return n}(),a7=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new rte},e.prototype.buildPath=function(t,r){i7(t,r,!0)},e}(Ht);a7.prototype.type="polygon";const Ra=a7;var ite=function(){function n(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return n}(),s7=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ite},e.prototype.buildPath=function(t,r){i7(t,r,!1)},e}(Ht);s7.prototype.type="polyline";const Na=s7;var ate={},ste=function(){function n(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return n}(),o7=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ste},e.prototype.buildPath=function(t,r){var i,a,s,o;if(this.subPixelOptimize){var l=IU(ate,r,this.style);i=l.x1,a=l.y1,s=l.x2,o=l.y2}else i=r.x1,a=r.y1,s=r.x2,o=r.y2;var u=r.percent;u!==0&&(t.moveTo(i,a),u<1&&(s=i*(1-u)+s*u,o=a*(1-u)+o*u),t.lineTo(s,o))},e.prototype.pointAt=function(t){var r=this.shape;return[r.x1*(1-t)+r.x2*t,r.y1*(1-t)+r.y2*t]},e}(Ht);o7.prototype.type="line";const pi=o7;var ua=[],ote=function(){function n(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return n}();function UI(n,e,t){var r=n.cpx2,i=n.cpy2;return r!=null||i!=null?[(t?$D:Qr)(n.x1,n.cpx1,n.cpx2,n.x2,e),(t?$D:Qr)(n.y1,n.cpy1,n.cpy2,n.y2,e)]:[(t?ET:fi)(n.x1,n.cpx1,n.x2,e),(t?ET:fi)(n.y1,n.cpy1,n.y2,e)]}var l7=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ote},e.prototype.buildPath=function(t,r){var i=r.x1,a=r.y1,s=r.x2,o=r.y2,l=r.cpx1,u=r.cpy1,c=r.cpx2,h=r.cpy2,f=r.percent;f!==0&&(t.moveTo(i,a),c==null||h==null?(f<1&&(km(i,l,s,f,ua),l=ua[1],s=ua[2],km(a,u,o,f,ua),u=ua[1],o=ua[2]),t.quadraticCurveTo(l,u,s,o)):(f<1&&(cc(i,l,c,s,f,ua),l=ua[1],c=ua[2],s=ua[3],cc(a,u,h,o,f,ua),u=ua[1],h=ua[2],o=ua[3]),t.bezierCurveTo(l,u,c,h,s,o)))},e.prototype.pointAt=function(t){return UI(this.shape,t,!1)},e.prototype.tangentAt=function(t){var r=UI(this.shape,t,!0);return $p(r,r)},e}(Ht);l7.prototype.type="bezier-curve";const iS=l7;var lte=function(){function n(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return n}(),u7=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new lte},e.prototype.buildPath=function(t,r){var i=r.cx,a=r.cy,s=Math.max(r.r,0),o=r.startAngle,l=r.endAngle,u=r.clockwise,c=Math.cos(o),h=Math.sin(o);t.moveTo(c*s+i,h*s+a),t.arc(i,a,s,o,l,!u)},e}(Ht);u7.prototype.type="arc";const BP=u7;var ute=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="compound",t}return e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,r=this.shapeChanged(),i=0;i<t.length;i++)r=r||t[i].shapeChanged();r&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var t=this.shape.paths||[],r=this.getGlobalScale(),i=0;i<t.length;i++)t[i].path||t[i].createPathProxy(),t[i].path.setScale(r[0],r[1],t[i].segmentIgnoreThreshold)},e.prototype.buildPath=function(t,r){for(var i=r.paths||[],a=0;a<i.length;a++)i[a].buildPath(t,i[a].shape,!0)},e.prototype.afterBrush=function(){for(var t=this.shape.paths||[],r=0;r<t.length;r++)t[r].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),Ht.prototype.getBoundingRect.call(this)},e}(Ht);const GP=ute;var cte=function(){function n(e){this.colorStops=e||[]}return n.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},n}();const c7=cte;var hte=function(n){ve(e,n);function e(t,r,i,a,s,o){var l=n.call(this,s)||this;return l.x=t==null?0:t,l.y=r==null?0:r,l.x2=i==null?1:i,l.y2=a==null?0:a,l.type="linear",l.global=o||!1,l}return e}(c7);const Zr=hte;var fte=function(n){ve(e,n);function e(t,r,i,a,s){var o=n.call(this,a)||this;return o.x=t==null?.5:t,o.y=r==null?.5:r,o.r=i==null?.5:i,o.type="radial",o.global=s||!1,o}return e}(c7);const h7=fte;var $c=[0,0],jc=[0,0],Iy=new Nt,Ny=new Nt,dte=function(){function n(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var r=0;r<4;r++)this._corners[r]=new Nt;for(var r=0;r<2;r++)this._axes[r]=new Nt;e&&this.fromBoundingRect(e,t)}return n.prototype.fromBoundingRect=function(e,t){var r=this._corners,i=this._axes,a=e.x,s=e.y,o=a+e.width,l=s+e.height;if(r[0].set(a,s),r[1].set(o,s),r[2].set(o,l),r[3].set(a,l),t)for(var u=0;u<4;u++)r[u].transform(t);Nt.sub(i[0],r[1],r[0]),Nt.sub(i[1],r[3],r[0]),i[0].normalize(),i[1].normalize();for(var u=0;u<2;u++)this._origin[u]=i[u].dot(r[0])},n.prototype.intersect=function(e,t){var r=!0,i=!t;return Iy.set(1/0,1/0),Ny.set(0,0),!this._intersectCheckOneSide(this,e,Iy,Ny,i,1)&&(r=!1,i)||!this._intersectCheckOneSide(e,this,Iy,Ny,i,-1)&&(r=!1,i)||i||Nt.copy(t,r?Iy:Ny),r},n.prototype._intersectCheckOneSide=function(e,t,r,i,a,s){for(var o=!0,l=0;l<2;l++){var u=this._axes[l];if(this._getProjMinMaxOnAxis(l,e._corners,$c),this._getProjMinMaxOnAxis(l,t._corners,jc),$c[1]<jc[0]||$c[0]>jc[1]){if(o=!1,a)return o;var c=Math.abs(jc[0]-$c[1]),h=Math.abs($c[0]-jc[1]);Math.min(c,h)>i.len()&&(c<h?Nt.scale(i,u,-c*s):Nt.scale(i,u,h*s))}else if(r){var c=Math.abs(jc[0]-$c[1]),h=Math.abs($c[0]-jc[1]);Math.min(c,h)<r.len()&&(c<h?Nt.scale(r,u,c*s):Nt.scale(r,u,-h*s))}}return o},n.prototype._getProjMinMaxOnAxis=function(e,t,r){for(var i=this._axes[e],a=this._origin,s=t[0].dot(i)+a[e],o=s,l=s,u=1;u<t.length;u++){var c=t[u].dot(i)+a[e];o=Math.min(c,o),l=Math.max(c,l)}r[0]=o,r[1]=l},n}();const Tx=dte;var pte=[],vte=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.notClear=!0,t.incremental=!0,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return e.prototype.traverse=function(t,r){t.call(r,this)},e.prototype.useStyle=function(){this.style={}},e.prototype.getCursor=function(){return this._cursor},e.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},e.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},e.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},e.prototype.addDisplayable=function(t,r){r?this._temporaryDisplayables.push(t):this._displayables.push(t),this.markRedraw()},e.prototype.addDisplayables=function(t,r){r=r||!1;for(var i=0;i<t.length;i++)this.addDisplayable(t[i],r)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(t){for(var r=this._cursor;r<this._displayables.length;r++)t&&t(this._displayables[r]);for(var r=0;r<this._temporaryDisplayables.length;r++)t&&t(this._temporaryDisplayables[r])},e.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++){var r=this._displayables[t];r.parent=this,r.update(),r.parent=null}for(var t=0;t<this._temporaryDisplayables.length;t++){var r=this._temporaryDisplayables[t];r.parent=this,r.update(),r.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new Ot(1/0,1/0,-1/0,-1/0),r=0;r<this._displayables.length;r++){var i=this._displayables[r],a=i.getBoundingRect().clone();i.needLocalTransform()&&a.applyTransform(i.getLocalTransform(pte)),t.union(a)}this._rect=t}return this._rect},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();if(a.contain(i[0],i[1]))for(var s=0;s<this._displayables.length;s++){var o=this._displayables[s];if(o.contain(t,r))return!0}return!1},e}(Os);const gte=vte;var f7=en();function Yp(n,e,t,r,i){var a;if(e&&e.ecModel){var s=e.ecModel.getUpdatePayload();a=s&&s.animation}var o=e&&e.isAnimationEnabled(),l=n==="update";if(o){var u=void 0,c=void 0,h=void 0;r?(u=Et(r.duration,200),c=Et(r.easing,"cubicOut"),h=0):(u=e.getShallow(l?"animationDurationUpdate":"animationDuration"),c=e.getShallow(l?"animationEasingUpdate":"animationEasing"),h=e.getShallow(l?"animationDelayUpdate":"animationDelay")),a&&(a.duration!=null&&(u=a.duration),a.easing!=null&&(c=a.easing),a.delay!=null&&(h=a.delay)),ct(h)&&(h=h(t,i)),ct(u)&&(u=u(t));var f={duration:u||0,delay:h,easing:c};return f}else return null}function zP(n,e,t,r,i,a,s){var o=!1,l;ct(i)?(s=a,a=i,i=null):gt(i)&&(a=i.cb,s=i.during,o=i.isFrom,l=i.removeOpt,i=i.dataIndex);var u=n==="leave";u||e.stopAnimation("leave");var c=Yp(n,r,i,u?l||{}:null,r&&r.getAnimationDelayParams?r.getAnimationDelayParams(e,i):null);if(c&&c.duration>0){var h=c.duration,f=c.delay,d=c.easing,p={duration:h,delay:f||0,easing:d,done:a,force:!!a||!!s,setToFinal:!u,scope:n,during:s};o?e.animateFrom(t,p):e.animateTo(t,p)}else e.stopAnimation(),!o&&e.attr(t),s&&s(1),a&&a()}function cn(n,e,t,r,i,a){zP("update",n,e,t,r,i,a)}function Jn(n,e,t,r,i,a){zP("enter",n,e,t,r,i,a)}function np(n){if(!n.__zr)return!0;for(var e=0;e<n.animators.length;e++){var t=n.animators[e];if(t.scope==="leave")return!0}return!1}function hc(n,e,t,r,i,a){np(n)||zP("leave",n,e,t,r,i,a)}function VI(n,e,t,r){n.removeTextContent(),n.removeTextGuideLine(),hc(n,{style:{opacity:0}},e,t,r)}function Hm(n,e,t){function r(){n.parent&&n.parent.remove(n)}n.isGroup?n.traverse(function(i){i.isGroup||VI(i,e,t,r)}):VI(n,e,t,r)}function co(n){f7(n).oldStyle=n.style}function mte(n){return f7(n).oldStyle}var Cx=Math.max,Ex=Math.min,JT={};function yte(n){return Ht.extend(n)}var _te=jee;function xte(n,e){return _te(n,e)}function fo(n,e){JT[n]=e}function UP(n){if(JT.hasOwnProperty(n))return JT[n]}function aS(n,e,t,r){var i=QU(n,e);return t&&(r==="center"&&(t=p7(t,i.getBoundingRect())),v7(i,t)),i}function d7(n,e,t){var r=new Pi({style:{image:n,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(i){if(t==="center"){var a={width:i.width,height:i.height};r.setStyle(p7(e,a))}}});return r}function p7(n,e){var t=e.width/e.height,r=n.height*t,i;r<=n.width?i=n.height:(r=n.width,i=r/t);var a=n.x+n.width/2,s=n.y+n.height/2;return{x:a-r/2,y:s-i/2,width:r,height:i}}var Ms=qee;function v7(n,e){if(n.applyTransform){var t=n.getBoundingRect(),r=t.calculateTransform(e);n.applyTransform(r)}}function bp(n,e){return IU(n,n,{lineWidth:e}),n}function bte(n){return NU(n.shape,n.shape,n.style),n}var F1=Eh;function qh(n,e){for(var t=Xb([]);n&&n!==e;)Dl(t,n.getLocalTransform(),t),n=n.parent;return t}function so(n,e,t){return e&&!Hi(e)&&(e=Cl.getLocalTransform(e)),t&&(e=jp([],e)),Mi([],n,e)}function sS(n,e,t){var r=e[4]===0||e[5]===0||e[0]===0?1:Math.abs(2*e[4]/e[0]),i=e[4]===0||e[5]===0||e[2]===0?1:Math.abs(2*e[4]/e[2]),a=[n==="left"?-r:n==="right"?r:0,n==="top"?-i:n==="bottom"?i:0];return a=so(a,e,t),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function HI(n){return!n.isGroup}function Ste(n){return n.shape!=null}function I0(n,e,t){if(!n||!e)return;function r(s){var o={};return s.traverse(function(l){HI(l)&&l.anid&&(o[l.anid]=l)}),o}function i(s){var o={x:s.x,y:s.y,rotation:s.rotation};return Ste(s)&&(o.shape=Pe({},s.shape)),o}var a=r(n);e.traverse(function(s){if(HI(s)&&s.anid){var o=a[s.anid];if(o){var l=i(s);s.attr(i(o)),cn(s,l,t,St(s).dataIndex)}}})}function g7(n,e){return Ne(n,function(t){var r=t[0];r=Cx(r,e.x),r=Ex(r,e.x+e.width);var i=t[1];return i=Cx(i,e.y),i=Ex(i,e.y+e.height),[r,i]})}function wte(n,e){var t=Cx(n.x,e.x),r=Ex(n.x+n.width,e.x+e.width),i=Cx(n.y,e.y),a=Ex(n.y+n.height,e.y+e.height);if(r>=t&&a>=i)return{x:t,y:i,width:r-t,height:a-i}}function N0(n,e,t){var r=Pe({rectHover:!0},e),i=r.style={strokeNoScale:!0};if(t=t||{x:-1,y:-1,width:2,height:2},n)return n.indexOf("image://")===0?(i.image=n.slice(8),dt(i,t),new Pi(r)):aS(n.replace("path://",""),r,t,"center")}function Ng(n,e,t,r,i){for(var a=0,s=i[i.length-1];a<i.length;a++){var o=i[a];if(m7(n,e,t,r,o[0],o[1],s[0],s[1]))return!0;s=o}}function m7(n,e,t,r,i,a,s,o){var l=t-n,u=r-e,c=s-i,h=o-a,f=uA(c,h,l,u);if(Ate(f))return!1;var d=n-i,p=e-a,g=uA(d,p,l,u)/f;if(g<0||g>1)return!1;var v=uA(d,p,c,h)/f;return!(v<0||v>1)}function uA(n,e,t,r){return n*r-t*e}function Ate(n){return n<=1e-6&&n>=-1e-6}function wf(n){var e=n.itemTooltipOption,t=n.componentModel,r=n.itemName,i=Ke(e)?{formatter:e}:e,a=t.mainType,s=t.componentIndex,o={componentType:a,name:r,$vars:["name"]};o[a+"Index"]=s;var l=n.formatterParamsExtra;l&&z(Yt(l),function(c){tt(o,c)||(o[c]=l[c],o.$vars.push(c))});var u=St(n.el);u.componentMainType=a,u.componentIndex=s,u.tooltipConfig={name:r,option:dt({content:r,encodeHTMLContent:!0,formatterParams:o},i)}}function WI(n,e){var t;n.isGroup&&(t=e(n)),t||n.traverse(e)}function Sc(n,e){if(n)if(Ie(n))for(var t=0;t<n.length;t++)WI(n[t],e);else WI(n,e)}fo("circle",bc);fo("ellipse",FP);fo("sector",La);fo("ring",rS);fo("polygon",Ra);fo("polyline",Na);fo("rect",nn);fo("line",pi);fo("bezierCurve",iS);fo("arc",BP);const Af=Object.freeze(Object.defineProperty({__proto__:null,Arc:BP,BezierCurve:iS,BoundingRect:Ot,Circle:bc,CompoundPath:GP,Ellipse:FP,Group:bt,Image:Pi,IncrementalDisplayable:gte,Line:pi,LinearGradient:Zr,OrientedBoundingRect:Tx,Path:Ht,Point:Nt,Polygon:Ra,Polyline:Na,RadialGradient:h7,Rect:nn,Ring:rS,Sector:La,Text:ln,applyTransform:so,clipPointsByRect:g7,clipRectByRect:wte,createIcon:N0,extendPath:xte,extendShape:yte,getShapeClass:UP,getTransform:qh,groupTransition:I0,initProps:Jn,isElementRemoved:np,lineLineIntersect:m7,linePolygonIntersect:Ng,makeImage:d7,makePath:aS,mergePath:Ms,registerShape:fo,removeElement:hc,removeElementWithFadeOut:Hm,resizePath:v7,setTooltipConfig:wf,subPixelOptimize:F1,subPixelOptimizeLine:bp,subPixelOptimizeRect:bte,transformDirection:sS,traverseElements:Sc,updateProps:cn},Symbol.toStringTag,{value:"Module"}));var oS={};function y7(n,e){for(var t=0;t<oa.length;t++){var r=oa[t],i=e[r],a=n.ensureState(r);a.style=a.style||{},a.style.text=i}var s=n.currentStates.slice();n.clearStates(!0),n.setStyle({text:e.normal}),n.useStates(s,!0)}function eC(n,e,t){var r=n.labelFetcher,i=n.labelDataIndex,a=n.labelDimIndex,s=e.normal,o;r&&(o=r.getFormattedLabel(i,"normal",null,a,s&&s.get("formatter"),t!=null?{interpolatedValue:t}:null)),o==null&&(o=ct(n.defaultText)?n.defaultText(i,n,t):n.defaultText);for(var l={normal:o},u=0;u<oa.length;u++){var c=oa[u],h=e[c];l[c]=Et(r?r.getFormattedLabel(i,c,null,a,h&&h.get("formatter")):null,o)}return l}function Ei(n,e,t,r){t=t||oS;for(var i=n instanceof ln,a=!1,s=0;s<Um.length;s++){var o=e[Um[s]];if(o&&o.getShallow("show")){a=!0;break}}var l=i?n:n.getTextContent();if(a){i||(l||(l=new ln,n.setTextContent(l)),n.stateProxy&&(l.stateProxy=n.stateProxy));var u=eC(t,e),c=e.normal,h=!!c.getShallow("show"),f=Hn(c,r&&r.normal,t,!1,!i);f.text=u.normal,i||n.setTextConfig(Px(c,t,!1));for(var s=0;s<oa.length;s++){var d=oa[s],o=e[d];if(o){var p=l.ensureState(d),g=!!Et(o.getShallow("show"),h);if(g!==h&&(p.ignore=!g),p.style=Hn(o,r&&r[d],t,!0,!i),p.style.text=u[d],!i){var v=n.ensureState(d);v.textConfig=Px(o,t,!0)}}}l.silent=!!c.getShallow("silent"),l.style.x!=null&&(f.x=l.style.x),l.style.y!=null&&(f.y=l.style.y),l.ignore=!h,l.useStyle(f),l.dirty(),t.enableTextSetter&&(Kp(l).setLabelText=function(m){var y=eC(t,e,m);y7(l,y)})}else l&&(l.ignore=!0);n.dirty()}function ri(n,e){e=e||"label";for(var t={normal:n.getModel(e)},r=0;r<oa.length;r++){var i=oa[r];t[i]=n.getModel([i,e])}return t}function Hn(n,e,t,r,i){var a={};return Mte(a,n,t,r,i),e&&Pe(a,e),a}function Px(n,e,t){e=e||{};var r={},i,a=n.getShallow("rotate"),s=Et(n.getShallow("distance"),t?null:5),o=n.getShallow("offset");return i=n.getShallow("position")||(t?null:"inside"),i==="outside"&&(i=e.defaultOutsidePosition||"top"),i!=null&&(r.position=i),o!=null&&(r.offset=o),a!=null&&(a*=Math.PI/180,r.rotation=a),s!=null&&(r.distance=s),r.outsideFill=n.get("color")==="inherit"?e.inheritColor||null:"auto",r}function Mte(n,e,t,r,i){t=t||oS;var a=e.ecModel,s=a&&a.option.textStyle,o=Tte(e),l;if(o){l={};for(var u in o)if(o.hasOwnProperty(u)){var c=e.getModel(["rich",u]);XI(l[u]={},c,s,t,r,i,!1,!0)}}l&&(n.rich=l);var h=e.get("overflow");h&&(n.overflow=h);var f=e.get("minMargin");f!=null&&(n.margin=f),XI(n,e,s,t,r,i,!0,!1)}function Tte(n){for(var e;n&&n!==n.ecModel;){var t=(n.option||oS).rich;if(t){e=e||{};for(var r=Yt(t),i=0;i<r.length;i++){var a=r[i];e[a]=1}}n=n.parentModel}return e}var $I=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],jI=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],qI=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function XI(n,e,t,r,i,a,s,o){t=!i&&t||oS;var l=r&&r.inheritColor,u=e.getShallow("color"),c=e.getShallow("textBorderColor"),h=Et(e.getShallow("opacity"),t.opacity);(u==="inherit"||u==="auto")&&(l?u=l:u=null),(c==="inherit"||c==="auto")&&(l?c=l:c=null),a||(u=u||t.color,c=c||t.textBorderColor),u!=null&&(n.fill=u),c!=null&&(n.stroke=c);var f=Et(e.getShallow("textBorderWidth"),t.textBorderWidth);f!=null&&(n.lineWidth=f);var d=Et(e.getShallow("textBorderType"),t.textBorderType);d!=null&&(n.lineDash=d);var p=Et(e.getShallow("textBorderDashOffset"),t.textBorderDashOffset);p!=null&&(n.lineDashOffset=p),!i&&h==null&&!o&&(h=r&&r.defaultOpacity),h!=null&&(n.opacity=h),!i&&!a&&n.fill==null&&r.inheritColor&&(n.fill=r.inheritColor);for(var g=0;g<$I.length;g++){var v=$I[g],m=Et(e.getShallow(v),t[v]);m!=null&&(n[v]=m)}for(var g=0;g<jI.length;g++){var v=jI[g],m=e.getShallow(v);m!=null&&(n[v]=m)}if(n.verticalAlign==null){var y=e.getShallow("baseline");y!=null&&(n.verticalAlign=y)}if(!s||!r.disableBox){for(var g=0;g<qI.length;g++){var v=qI[g],m=e.getShallow(v);m!=null&&(n[v]=m)}var _=e.getShallow("borderType");_!=null&&(n.borderDash=_),(n.backgroundColor==="auto"||n.backgroundColor==="inherit")&&l&&(n.backgroundColor=l),(n.borderColor==="auto"||n.borderColor==="inherit")&&l&&(n.borderColor=l)}}function VP(n,e){var t=e&&e.getModel("textStyle");return no([n.fontStyle||t&&t.getShallow("fontStyle")||"",n.fontWeight||t&&t.getShallow("fontWeight")||"",(n.fontSize||t&&t.getShallow("fontSize")||12)+"px",n.fontFamily||t&&t.getShallow("fontFamily")||"sans-serif"].join(" "))}var Kp=en();function _7(n,e,t,r){if(n){var i=Kp(n);i.prevValue=i.value,i.value=t;var a=e.normal;i.valueAnimation=a.get("valueAnimation"),i.valueAnimation&&(i.precision=a.get("precision"),i.defaultInterpolatedText=r,i.statesModels=e)}}function x7(n,e,t,r,i){var a=Kp(n);if(!a.valueAnimation||a.prevValue===a.value)return;var s=a.defaultInterpolatedText,o=Et(a.interpolatedValue,a.prevValue),l=a.value;function u(c){var h=wU(t,a.precision,o,l,c);a.interpolatedValue=c===1?null:h;var f=eC({labelDataIndex:e,labelFetcher:i,defaultText:s?s(h):h+""},a.statesModels,h);y7(n,f)}n.percent=0,(a.prevValue==null?Jn:cn)(n,{percent:1},r,e,null,u)}var Cte=["textStyle","color"],cA=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],hA=new ln,Ete=function(){function n(){}return n.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(Cte):null)},n.prototype.getFont=function(){return VP({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},n.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},r=0;r<cA.length;r++)t[cA[r]]=this.getShallow(cA[r]);return hA.useStyle(t),hA.update(),hA.getBoundingRect()},n}();const Pte=Ete;var b7=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],Lte=uf(b7),Rte=function(){function n(){}return n.prototype.getLineStyle=function(e){return Lte(this,e)},n}(),S7=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],Dte=uf(S7),Ite=function(){function n(){}return n.prototype.getItemStyle=function(e,t){return Dte(this,e,t)},n}(),Mf=function(){function n(e,t,r){this.parentModel=t,this.ecModel=r,this.option=e}return n.prototype.init=function(e,t,r){},n.prototype.mergeOption=function(e,t){It(this.option,e,!0)},n.prototype.get=function(e,t){return e==null?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},n.prototype.getShallow=function(e,t){var r=this.option,i=r==null?r:r[e];if(i==null&&!t){var a=this.parentModel;a&&(i=a.getShallow(e))}return i},n.prototype.getModel=function(e,t){var r=e!=null,i=r?this.parsePath(e):null,a=r?this._doGet(i):this.option;return t=t||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(i)),new n(a,t,this.ecModel)},n.prototype.isEmpty=function(){return this.option==null},n.prototype.restoreData=function(){},n.prototype.clone=function(){var e=this.constructor;return new e(yt(this.option))},n.prototype.parsePath=function(e){return typeof e=="string"?e.split("."):e},n.prototype.resolveParentPath=function(e){return e},n.prototype.isAnimationEnabled=function(){if(!on.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},n.prototype._doGet=function(e,t){var r=this.option;if(!e)return r;for(var i=0;i<e.length&&!(e[i]&&(r=r&&typeof r=="object"?r[e[i]]:null,r==null));i++);return r==null&&t&&(r=t._doGet(this.resolveParentPath(e),t.parentModel)),r},n}();EP(Mf);IJ(Mf);zr(Mf,Rte);zr(Mf,Ite);zr(Mf,BJ);zr(Mf,Pte);const Wn=Mf;var Nte=Math.round(Math.random()*10);function Zp(n){return[n||"",Nte++].join("_")}function kte(n){var e={};n.registerSubTypeDefaulter=function(t,r){var i=zo(t);e[i.main]=r},n.determineSubType=function(t,r){var i=r.type;if(!i){var a=zo(t).main;n.hasSubTypes(t)&&e[a]&&(i=e[a](r))}return i}}function Ote(n,e){n.topologicalTravel=function(a,s,o,l){if(!a.length)return;var u=t(s),c=u.graph,h=u.noEntryList,f={};for(z(a,function(y){f[y]=!0});h.length;){var d=h.pop(),p=c[d],g=!!f[d];g&&(o.call(l,d,p.originalDeps.slice()),delete f[d]),z(p.successor,g?m:v)}z(f,function(){var y="";throw new Error(y)});function v(y){c[y].entryCount--,c[y].entryCount===0&&h.push(y)}function m(y){f[y]=!0,v(y)}};function t(a){var s={},o=[];return z(a,function(l){var u=r(s,l),c=u.originalDeps=e(l),h=i(c,a);u.entryCount=h.length,u.entryCount===0&&o.push(l),z(h,function(f){Ft(u.predecessor,f)<0&&u.predecessor.push(f);var d=r(s,f);Ft(d.successor,f)<0&&d.successor.push(l)})}),{graph:s,noEntryList:o}}function r(a,s){return a[s]||(a[s]={predecessor:[],successor:[]}),a[s]}function i(a,s){var o=[];return z(a,function(l){Ft(s,l)>=0&&o.push(l)}),o}}function wc(n,e){return It(It({},n,!0),e,!0)}const Fte={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:". "}}}},Bte={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 Lx="ZH",HP="EN",rp=HP,B1={},WP={},w7=on.domSupported?function(){var n=(document.documentElement.lang||navigator.language||navigator.browserLanguage||rp).toUpperCase();return n.indexOf(Lx)>-1?Lx:rp}():rp;function A7(n,e){n=n.toUpperCase(),WP[n]=new Wn(e),B1[n]=e}function Gte(n){if(Ke(n)){var e=B1[n.toUpperCase()]||{};return n===Lx||n===HP?yt(e):It(yt(e),yt(B1[rp]),!1)}else return It(yt(n),yt(B1[rp]),!1)}function tC(n){return WP[n]}function zte(){return WP[rp]}A7(HP,Fte);A7(Lx,Bte);var $P=1e3,jP=$P*60,am=jP*60,Ts=am*24,YI=Ts*365,kg={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}"},ky="{yyyy}-{MM}-{dd}",KI={year:"{yyyy}",month:"{yyyy}-{MM}",day:ky,hour:ky+" "+kg.hour,minute:ky+" "+kg.minute,second:ky+" "+kg.second,millisecond:kg.none},fA=["year","month","day","hour","minute","second","millisecond"],M7=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function iu(n,e){return n+="","0000".substr(0,e-n.length)+n}function ip(n){switch(n){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return n}}function Ute(n){return n===ip(n)}function Vte(n){switch(n){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function lS(n,e,t,r){var i=Qo(n),a=i[qP(t)](),s=i[ap(t)]()+1,o=Math.floor((s-1)/3)+1,l=i[uS(t)](),u=i["get"+(t?"UTC":"")+"Day"](),c=i[Wm(t)](),h=(c-1)%12+1,f=i[cS(t)](),d=i[hS(t)](),p=i[fS(t)](),g=c>=12?"pm":"am",v=g.toUpperCase(),m=r instanceof Wn?r:tC(r||w7)||zte(),y=m.getModel("time"),_=y.get("month"),x=y.get("monthAbbr"),b=y.get("dayOfWeek"),S=y.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,v+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,iu(a%100+"",2)).replace(/{Q}/g,o+"").replace(/{MMMM}/g,_[s-1]).replace(/{MMM}/g,x[s-1]).replace(/{MM}/g,iu(s,2)).replace(/{M}/g,s+"").replace(/{dd}/g,iu(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,b[u]).replace(/{ee}/g,S[u]).replace(/{e}/g,u+"").replace(/{HH}/g,iu(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,iu(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,iu(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,iu(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,iu(p,3)).replace(/{S}/g,p+"")}function Hte(n,e,t,r,i){var a=null;if(Ke(t))a=t;else if(ct(t))a=t(n.value,e,{level:n.level});else{var s=Pe({},kg);if(n.level>0)for(var o=0;o<fA.length;++o)s[fA[o]]="{primary|"+s[fA[o]]+"}";var l=t?t.inherit===!1?t:dt(t,s):s,u=T7(n.value,i);if(l[u])a=l[u];else if(l.inherit){for(var c=M7.indexOf(u),o=c-1;o>=0;--o)if(l[u]){a=l[u];break}a=a||s.none}if(Ie(a)){var h=n.level==null?0:n.level>=0?n.level:a.length+n.level;h=Math.min(h,a.length-1),a=a[h]}}return lS(new Date(n.value),a,i,r)}function T7(n,e){var t=Qo(n),r=t[ap(e)]()+1,i=t[uS(e)](),a=t[Wm(e)](),s=t[cS(e)](),o=t[hS(e)](),l=t[fS(e)](),u=l===0,c=u&&o===0,h=c&&s===0,f=h&&a===0,d=f&&i===1,p=d&&r===1;return p?"year":d?"month":f?"day":h?"hour":c?"minute":u?"second":"millisecond"}function ZI(n,e,t){var r=un(n)?Qo(n):n;switch(e=e||T7(n,t),e){case"year":return r[qP(t)]();case"half-year":return r[ap(t)]()>=6?1:0;case"quarter":return Math.floor((r[ap(t)]()+1)/4);case"month":return r[ap(t)]();case"day":return r[uS(t)]();case"half-day":return r[Wm(t)]()/24;case"hour":return r[Wm(t)]();case"minute":return r[cS(t)]();case"second":return r[hS(t)]();case"millisecond":return r[fS(t)]()}}function qP(n){return n?"getUTCFullYear":"getFullYear"}function ap(n){return n?"getUTCMonth":"getMonth"}function uS(n){return n?"getUTCDate":"getDate"}function Wm(n){return n?"getUTCHours":"getHours"}function cS(n){return n?"getUTCMinutes":"getMinutes"}function hS(n){return n?"getUTCSeconds":"getSeconds"}function fS(n){return n?"getUTCMilliseconds":"getMilliseconds"}function Wte(n){return n?"setUTCFullYear":"setFullYear"}function C7(n){return n?"setUTCMonth":"setMonth"}function E7(n){return n?"setUTCDate":"setDate"}function P7(n){return n?"setUTCHours":"setHours"}function L7(n){return n?"setUTCMinutes":"setMinutes"}function R7(n){return n?"setUTCSeconds":"setSeconds"}function D7(n){return n?"setUTCMilliseconds":"setMilliseconds"}function I7(n){if(!vU(n))return Ke(n)?n:"-";var e=(n+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function N7(n,e){return n=(n||"").toLowerCase().replace(/-(.)/g,function(t,r){return r.toUpperCase()}),e&&n&&(n=n.charAt(0).toUpperCase()+n.slice(1)),n}var Qp=mP;function nC(n,e,t){var r="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&no(c)?c:"-"}function a(c){return!!(c!=null&&!isNaN(c)&&isFinite(c))}var s=e==="time",o=n instanceof Date;if(s||o){var l=s?Qo(n):n;if(isNaN(+l)){if(o)return"-"}else return lS(l,r,t)}if(e==="ordinal")return _T(n)?i(n):un(n)&&a(n)?n+"":"-";var u=Gl(n);return a(u)?I7(u):_T(n)?i(n):typeof n=="boolean"?n+"":"-"}var QI=["a","b","c","d","e","f","g"],dA=function(n,e){return"{"+n+(e==null?"":e)+"}"};function k7(n,e,t){Ie(e)||(e=[e]);var r=e.length;if(!r)return"";for(var i=e[0].$vars||[],a=0;a<i.length;a++){var s=QI[a];n=n.replace(dA(s),dA(s,0))}for(var o=0;o<r;o++)for(var l=0;l<i.length;l++){var u=e[o][i[l]];n=n.replace(dA(QI[l],o),t?Bi(u):u)}return n}function $te(n,e,t){return z(e,function(r,i){n=n.replace("{"+i+"}",t?Bi(r):r)}),n}function jte(n,e){var t=Ke(n)?{color:n,extraCssText:e}:n||{},r=t.color,i=t.type;e=t.extraCssText;var a=t.renderMode||"html";if(!r)return"";if(a==="html")return i==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+Bi(r)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+Bi(r)+";"+(e||"")+'"></span>';var s=t.markerId||"markerX";return{renderMode:a,content:"{"+s+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}}function hf(n,e){return e=e||"transparent",Ke(n)?n:gt(n)&&n.colorStops&&(n.colorStops[0]||{}).color||e}function Rx(n,e){if(e==="_blank"||e==="blank"){var t=window.open();t.opener=null,t.location.href=n}else window.open(n,e)}var G1=z,O7=["left","right","top","bottom","width","height"],Lh=[["width","left","right"],["height","top","bottom"]];function XP(n,e,t,r,i){var a=0,s=0;r==null&&(r=1/0),i==null&&(i=1/0);var o=0;e.eachChild(function(l,u){var c=l.getBoundingRect(),h=e.childAt(u+1),f=h&&h.getBoundingRect(),d,p;if(n==="horizontal"){var g=c.width+(f?-f.x+c.x:0);d=a+g,d>r||l.newline?(a=0,d=g,s+=o+t,o=c.height):o=Math.max(o,c.height)}else{var v=c.height+(f?-f.y+c.y:0);p=s+v,p>i||l.newline?(a+=o+t,s=0,p=v,o=c.width):o=Math.max(o,c.width)}l.newline||(l.x=a,l.y=s,l.markRedraw(),n==="horizontal"?a=d+t:s=p+t)})}var Xh=XP;Rt(XP,"vertical");Rt(XP,"horizontal");function qte(n,e,t){var r=e.width,i=e.height,a=Xe(n.left,r),s=Xe(n.top,i),o=Xe(n.right,r),l=Xe(n.bottom,i);return(isNaN(a)||isNaN(parseFloat(n.left)))&&(a=0),(isNaN(o)||isNaN(parseFloat(n.right)))&&(o=r),(isNaN(s)||isNaN(parseFloat(n.top)))&&(s=0),(isNaN(l)||isNaN(parseFloat(n.bottom)))&&(l=i),t=Qp(t||0),{width:Math.max(o-a-t[1]-t[3],0),height:Math.max(l-s-t[0]-t[2],0)}}function Kr(n,e,t){t=Qp(t||0);var r=e.width,i=e.height,a=Xe(n.left,r),s=Xe(n.top,i),o=Xe(n.right,r),l=Xe(n.bottom,i),u=Xe(n.width,r),c=Xe(n.height,i),h=t[2]+t[0],f=t[1]+t[3],d=n.aspect;switch(isNaN(u)&&(u=r-o-f-a),isNaN(c)&&(c=i-l-h-s),d!=null&&(isNaN(u)&&isNaN(c)&&(d>r/i?u=r*.8:c=i*.8),isNaN(u)&&(u=d*c),isNaN(c)&&(c=u/d)),isNaN(a)&&(a=r-o-u-f),isNaN(s)&&(s=i-l-c-h),n.left||n.right){case"center":a=r/2-u/2-t[3];break;case"right":a=r-u-f;break}switch(n.top||n.bottom){case"middle":case"center":s=i/2-c/2-t[0];break;case"bottom":s=i-c-h;break}a=a||0,s=s||0,isNaN(u)&&(u=r-f-a-(o||0)),isNaN(c)&&(c=i-h-s-(l||0));var p=new Ot(a+t[3],s+t[0],u,c);return p.margin=t,p}function dS(n,e,t,r,i,a){var s=!i||!i.hv||i.hv[0],o=!i||!i.hv||i.hv[1],l=i&&i.boundingMode||"all";if(a=a||n,a.x=n.x,a.y=n.y,!s&&!o)return!1;var u;if(l==="raw")u=n.type==="group"?new Ot(0,0,+e.width||0,+e.height||0):n.getBoundingRect();else if(u=n.getBoundingRect(),n.needLocalTransform()){var c=n.getLocalTransform();u=u.clone(),u.applyTransform(c)}var h=Kr(dt({width:u.width,height:u.height},e),t,r),f=s?h.x-u.x:0,d=o?h.y-u.y:0;return l==="raw"?(a.x=f,a.y=d):(a.x+=f,a.y+=d),a===n&&n.markRedraw(),!0}function Xte(n,e){return n[Lh[e][0]]!=null||n[Lh[e][1]]!=null&&n[Lh[e][2]]!=null}function $m(n){var e=n.layoutMode||n.constructor.layoutMode;return gt(e)?e:e?{type:e}:null}function fc(n,e,t){var r=t&&t.ignoreSize;!Ie(r)&&(r=[r,r]);var i=s(Lh[0],0),a=s(Lh[1],1);u(Lh[0],n,i),u(Lh[1],n,a);function s(c,h){var f={},d=0,p={},g=0,v=2;if(G1(c,function(_){p[_]=n[_]}),G1(c,function(_){o(e,_)&&(f[_]=p[_]=e[_]),l(f,_)&&d++,l(p,_)&&g++}),r[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<c.length;m++){var y=c[m];if(!o(f,y)&&o(n,y)){f[y]=n[y];break}}return f}function o(c,h){return c.hasOwnProperty(h)}function l(c,h){return c[h]!=null&&c[h]!=="auto"}function u(c,h,f){G1(c,function(d){h[d]=f[d]})}}function Jp(n){return F7({},n)}function F7(n,e){return e&&n&&G1(O7,function(t){e.hasOwnProperty(t)&&(n[t]=e[t])}),n}var Yte=en(),ev=function(n){ve(e,n);function e(t,r,i){var a=n.call(this,t,r,i)||this;return a.uid=Zp("ec_cpt_model"),a}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i)},e.prototype.mergeDefaultAndTheme=function(t,r){var i=$m(this),a=i?Jp(t):{},s=r.getTheme();It(t,s.get(this.mainType)),It(t,this.getDefaultOption()),i&&fc(t,a,i)},e.prototype.mergeOption=function(t,r){It(this.option,t,!0);var i=$m(this);i&&fc(this.option,t,i)},e.prototype.optionUpdated=function(t,r){},e.prototype.getDefaultOption=function(){var t=this.constructor;if(!LJ(t))return t.defaultOption;var r=Yte(this);if(!r.defaultOption){for(var i=[],a=t;a;){var s=a.prototype.defaultOption;s&&i.push(s),a=a.superClass}for(var o={},l=i.length-1;l>=0;l--)o=It(o,i[l],!0);r.defaultOption=o}return r.defaultOption},e.prototype.getReferringComponents=function(t,r){var i=t+"Index",a=t+"Id";return R0(this.ecModel,t,{index:this.get(i,!0),id:this.get(a,!0)},r)},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}(Wn);MU(ev,Wn);Zb(ev);kte(ev);Ote(ev,Kte);function Kte(n){var e=[];return z(ev.getClassesByMainType(n),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=Ne(e,function(t){return zo(t).main}),n!=="dataset"&&Ft(e,"dataset")<=0&&e.unshift("dataset"),e}const sn=ev;var B7="";typeof navigator!="undefined"&&(B7=navigator.platform||"");var Vf="rgba(0, 0, 0, 0.2)";const Zte={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Vf,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Vf,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Vf,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Vf,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Vf,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Vf,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:B7.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 G7=st(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Gs="original",Wi="arrayRows",zs="objectRows",rl="keyedColumns",Qu="typedArray",z7="unknown",Wo="column",tv="row",Si={Must:1,Might:2,Not:3},U7=en();function Qte(n){U7(n).datasetMap=st()}function V7(n,e,t){var r={},i=KP(e);if(!i||!n)return r;var a=[],s=[],o=e.ecModel,l=U7(o).datasetMap,u=i.uid+"_"+t.seriesLayoutBy,c,h;n=n.slice(),z(n,function(g,v){var m=gt(g)?g:n[v]={name:g};m.type==="ordinal"&&c==null&&(c=v,h=p(m)),r[m.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});z(n,function(g,v){var m=g.name,y=p(g);if(c==null){var _=f.valueWayDim;d(r[m],_,y),d(s,_,y),f.valueWayDim+=y}else if(c===v)d(r[m],0,y),d(a,0,y);else{var _=f.categoryWayDim;d(r[m],_,y),d(s,_,y),f.categoryWayDim+=y}});function d(g,v,m){for(var y=0;y<m;y++)g.push(v+y)}function p(g){var v=g.dimsDef;return v?v.length:1}return a.length&&(r.itemName=a),s.length&&(r.seriesName=s),r}function YP(n,e,t){var r={},i=KP(n);if(!i)return r;var a=e.sourceFormat,s=e.dimensionsDefine,o;(a===zs||a===rl)&&z(s,function(c,h){(gt(c)?c.name:c)==="name"&&(o=h)});var l=function(){for(var c={},h={},f=[],d=0,p=Math.min(5,t);d<p;d++){var g=W7(e.data,a,e.seriesLayoutBy,s,e.startIndex,d);f.push(g);var v=g===Si.Not;if(v&&c.v==null&&d!==o&&(c.v=d),(c.n==null||c.n===c.v||!v&&f[c.n]===Si.Not)&&(c.n=d),m(c)&&f[c.n]!==Si.Not)return c;v||(g===Si.Might&&h.v==null&&d!==o&&(h.v=d),(h.n==null||h.n===h.v)&&(h.n=d))}function m(y){return y.v!=null&&y.n!=null}return m(c)?c:m(h)?h:null}();if(l){r.value=[l.v];var u=o!=null?o:l.n;r.itemName=[u],r.seriesName=[u]}return r}function KP(n){var e=n.get("data",!0);if(!e)return R0(n.ecModel,"dataset",{index:n.get("datasetIndex",!0),id:n.get("datasetId",!0)},Fr).models[0]}function Jte(n){return!n.get("transform",!0)&&!n.get("fromTransformResult",!0)?[]:R0(n.ecModel,"dataset",{index:n.get("fromDatasetIndex",!0),id:n.get("fromDatasetId",!0)},Fr).models}function H7(n,e){return W7(n.data,n.sourceFormat,n.seriesLayoutBy,n.dimensionsDefine,n.startIndex,e)}function W7(n,e,t,r,i,a){var s,o=5;if(Pa(n))return Si.Not;var l,u;if(r){var c=r[a];gt(c)?(l=c.name,u=c.type):Ke(c)&&(l=c)}if(u!=null)return u==="ordinal"?Si.Must:Si.Not;if(e===Wi){var h=n;if(t===tv){for(var f=h[a],d=0;d<(f||[]).length&&d<o;d++)if((s=x(f[i+d]))!=null)return s}else for(var d=0;d<h.length&&d<o;d++){var p=h[i+d];if(p&&(s=x(p[a]))!=null)return s}}else if(e===zs){var g=n;if(!l)return Si.Not;for(var d=0;d<g.length&&d<o;d++){var v=g[d];if(v&&(s=x(v[l]))!=null)return s}}else if(e===rl){var m=n;if(!l)return Si.Not;var f=m[l];if(!f||Pa(f))return Si.Not;for(var d=0;d<f.length&&d<o;d++)if((s=x(f[d]))!=null)return s}else if(e===Gs)for(var y=n,d=0;d<y.length&&d<o;d++){var v=y[d],_=qp(v);if(!Ie(_))return Si.Not;if((s=x(_[a]))!=null)return s}function x(b){var S=Ke(b);if(b!=null&&Number.isFinite(Number(b))&&b!=="")return S?Si.Might:Si.Not;if(S&&b!=="-")return Si.Must}return Si.Not}var rC=st();function ene(n,e){sa(rC.get(n)==null&&e),rC.set(n,e)}function tne(n,e,t){var r=rC.get(e);if(!r)return t;var i=r(n);return i?t.concat(i):t}var JI=en(),nne=en(),ZP=function(){function n(){}return n.prototype.getColorFromPalette=function(e,t,r){var i=Cn(this.get("color",!0)),a=this.get("colorLayer",!0);return $7(this,JI,i,a,e,t,r)},n.prototype.clearColorPalette=function(){ine(this,JI)},n}();function iC(n,e,t,r){var i=Cn(n.get(["aria","decal","decals"]));return $7(n,nne,i,null,e,t,r)}function rne(n,e){for(var t=n.length,r=0;r<t;r++)if(n[r].length>e)return n[r];return n[t-1]}function $7(n,e,t,r,i,a,s){a=a||n;var o=e(a),l=o.paletteIdx||0,u=o.paletteNameMap=o.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=s==null||!r?t:rne(r,s);if(c=c||t,!(!c||!c.length)){var h=c[l];return i&&(u[i]=h),o.paletteIdx=(l+1)%c.length,h}}function ine(n,e){e(n).paletteIdx=0,e(n).paletteNameMap={}}var Oy,Wv,eN,tN="\0_ec_inner",ane=1,j7=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(t,r,i,a,s,o){a=a||{},this.option=null,this._theme=new Wn(a),this._locale=new Wn(s),this._optionManager=o},e.prototype.setOption=function(t,r,i){var a=iN(r);this._optionManager.setOption(t,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(t,r){return this._resetOption(t,iN(r))},e.prototype._resetOption=function(t,r){var i=!1,a=this._optionManager;if(!t||t==="recreate"){var s=a.mountOption(t==="recreate");!this.option||t==="recreate"?eN(this,s):(this.restoreData(),this._mergeOption(s,r)),i=!0}if((t==="timeline"||t==="media")&&this.restoreData(),!t||t==="recreate"||t==="timeline"){var o=a.getTimelineOption(this);o&&(i=!0,this._mergeOption(o,r))}if(!t||t==="recreate"||t==="media"){var l=a.getMediaOption(this);l.length&&z(l,function(u){i=!0,this._mergeOption(u,r)},this)}return i},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,r){var i=this.option,a=this._componentsMap,s=this._componentsCount,o=[],l=st(),u=r&&r.replaceMergeMainTypeMap;Qte(this),z(t,function(h,f){h!=null&&(sn.hasClass(f)?f&&(o.push(f),l.set(f,!0)):i[f]=i[f]==null?yt(h):It(i[f],h,!0))}),u&&u.each(function(h,f){sn.hasClass(f)&&!l.get(f)&&(o.push(f),l.set(f,!0))}),sn.topologicalTravel(o,sn.getAllClassMainTypes(),c,this);function c(h){var f=tne(this,h,Cn(t[h])),d=a.get(h),p=d?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",g=xU(d,f,p);bJ(g,h,sn),i[h]=null,a.set(h,null),s.set(h,0);var v=[],m=[],y=0,_;z(g,function(x,b){var S=x.existing,w=x.newOption;if(!w)S&&(S.mergeOption({},this),S.optionUpdated({},!1));else{var T=h==="series",C=sn.getClass(h,x.keyInfo.subType,!T);if(!C)return;if(h==="tooltip"){if(_)return;_=!0}if(S&&S.constructor===C)S.name=x.keyInfo.name,S.mergeOption(w,this),S.optionUpdated(w,!1);else{var A=Pe({componentIndex:b},x.keyInfo);S=new C(w,this,this,A),Pe(S,A),x.brandNew&&(S.__requireNewView=!0),S.init(w,this,this),S.optionUpdated(null,!0)}}S?(v.push(S.option),m.push(S),y++):(v.push(void 0),m.push(void 0))},this),i[h]=v,a.set(h,m),s.set(h,y),h==="series"&&Oy(this)}this._seriesIndices||Oy(this)},e.prototype.getOption=function(){var t=yt(this.option);return z(t,function(r,i){if(sn.hasClass(i)){for(var a=Cn(r),s=a.length,o=!1,l=s-1;l>=0;l--)a[l]&&!Gm(a[l])?o=!0:(a[l]=null,!o&&s--);a.length=s,t[i]=a}}),delete t[tN],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,r){var i=this._componentsMap.get(t);if(i){var a=i[r||0];if(a)return a;if(r==null){for(var s=0;s<i.length;s++)if(i[s])return i[s]}}},e.prototype.queryComponents=function(t){var r=t.mainType;if(!r)return[];var i=t.index,a=t.id,s=t.name,o=this._componentsMap.get(r);if(!o||!o.length)return[];var l;return i!=null?(l=[],z(Cn(i),function(u){o[u]&&l.push(o[u])})):a!=null?l=nN("id",a,o):s!=null?l=nN("name",s,o):l=_n(o,function(u){return!!u}),rN(l,t)},e.prototype.findComponents=function(t){var r=t.query,i=t.mainType,a=o(r),s=a?this.queryComponents(a):_n(this._componentsMap.get(i),function(u){return!!u});return l(rN(s,t));function o(u){var c=i+"Index",h=i+"Id",f=i+"Name";return u&&(u[c]!=null||u[h]!=null||u[f]!=null)?{mainType:i,index:u[c],id:u[h],name:u[f]}:null}function l(u){return t.filter?_n(u,t.filter):u}},e.prototype.eachComponent=function(t,r,i){var a=this._componentsMap;if(ct(t)){var s=r,o=t;a.each(function(h,f){for(var d=0;h&&d<h.length;d++){var p=h[d];p&&o.call(s,f,p,p.componentIndex)}})}else for(var l=Ke(t)?a.get(t):gt(t)?this.findComponents(t):null,u=0;l&&u<l.length;u++){var c=l[u];c&&r.call(i,c,c.componentIndex)}},e.prototype.getSeriesByName=function(t){var r=Yr(t,null);return _n(this._componentsMap.get("series"),function(i){return!!i&&r!=null&&i.name===r})},e.prototype.getSeriesByIndex=function(t){return this._componentsMap.get("series")[t]},e.prototype.getSeriesByType=function(t){return _n(this._componentsMap.get("series"),function(r){return!!r&&r.subType===t})},e.prototype.getSeries=function(){return _n(this._componentsMap.get("series"),function(t){return!!t})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(t,r){Wv(this),z(this._seriesIndices,function(i){var a=this._componentsMap.get("series")[i];t.call(r,a,i)},this)},e.prototype.eachRawSeries=function(t,r){z(this._componentsMap.get("series"),function(i){i&&t.call(r,i,i.componentIndex)})},e.prototype.eachSeriesByType=function(t,r,i){Wv(this),z(this._seriesIndices,function(a){var s=this._componentsMap.get("series")[a];s.subType===t&&r.call(i,s,a)},this)},e.prototype.eachRawSeriesByType=function(t,r,i){return z(this.getSeriesByType(t),r,i)},e.prototype.isSeriesFiltered=function(t){return Wv(this),this._seriesIndicesMap.get(t.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(t,r){Wv(this);var i=[];z(this._seriesIndices,function(a){var s=this._componentsMap.get("series")[a];t.call(r,s,a)&&i.push(a)},this),this._seriesIndices=i,this._seriesIndicesMap=st(i)},e.prototype.restoreData=function(t){Oy(this);var r=this._componentsMap,i=[];r.each(function(a,s){sn.hasClass(s)&&i.push(s)}),sn.topologicalTravel(i,sn.getAllClassMainTypes(),function(a){z(r.get(a),function(s){s&&(a!=="series"||!sne(s,t))&&s.restoreData()})})},e.internalField=function(){Oy=function(t){var r=t._seriesIndices=[];z(t._componentsMap.get("series"),function(i){i&&r.push(i.componentIndex)}),t._seriesIndicesMap=st(r)},Wv=function(t){},eN=function(t,r){t.option={},t.option[tN]=ane,t._componentsMap=st({series:[]}),t._componentsCount=st();var i=r.aria;gt(i)&&i.enabled==null&&(i.enabled=!0),one(r,t._theme.option),It(r,Zte,!1),t._mergeOption(r,null)}}(),e}(Wn);function sne(n,e){if(e){var t=e.seriesIndex,r=e.seriesId,i=e.seriesName;return t!=null&&n.componentIndex!==t||r!=null&&n.id!==r||i!=null&&n.name!==i}}function one(n,e){var t=n.color&&!n.colorLayer;z(e,function(r,i){i==="colorLayer"&&t||sn.hasClass(i)||(typeof r=="object"?n[i]=n[i]?It(n[i],r,!1):yt(r):n[i]==null&&(n[i]=r))})}function nN(n,e,t){if(Ie(e)){var r=st();return z(e,function(a){if(a!=null){var s=Yr(a,null);s!=null&&r.set(a,!0)}}),_n(t,function(a){return a&&r.get(a[n])})}else{var i=Yr(e,null);return _n(t,function(a){return a&&i!=null&&a[n]===i})}}function rN(n,e){return e.hasOwnProperty("subType")?_n(n,function(t){return t&&t.subType===e.subType}):n}function iN(n){var e=st();return n&&z(Cn(n.replaceMerge),function(t){e.set(t,!0)}),{replaceMergeMainTypeMap:e}}zr(j7,ZP);const q7=j7;var lne=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],une=function(){function n(e){z(lne,function(t){this[t]=Qe(e[t],e)},this)}return n}();const X7=une;var pA={},cne=function(){function n(){this._coordinateSystems=[]}return n.prototype.create=function(e,t){var r=[];z(pA,function(i,a){var s=i.create(e,t);r=r.concat(s||[])}),this._coordinateSystems=r},n.prototype.update=function(e,t){z(this._coordinateSystems,function(r){r.update&&r.update(e,t)})},n.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},n.register=function(e,t){pA[e]=t},n.get=function(e){return pA[e]},n}();const k0=cne;var hne=/^(min|max)?(.+)$/,fne=function(){function n(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return n.prototype.setOption=function(e,t,r){e&&(z(Cn(e.series),function(s){s&&s.data&&Pa(s.data)&&vx(s.data)}),z(Cn(e.dataset),function(s){s&&s.source&&Pa(s.source)&&vx(s.source)})),e=yt(e);var i=this._optionBackup,a=dne(e,t,!i);this._newBaseOption=a.baseOption,i?(a.timelineOptions.length&&(i.timelineOptions=a.timelineOptions),a.mediaList.length&&(i.mediaList=a.mediaList),a.mediaDefault&&(i.mediaDefault=a.mediaDefault)):this._optionBackup=a},n.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],yt(e?t.baseOption:this._newBaseOption)},n.prototype.getTimelineOption=function(e){var t,r=this._timelineOptions;if(r.length){var i=e.getComponent("timeline");i&&(t=yt(r[i.getCurrentIndex()]))}return t},n.prototype.getMediaOption=function(e){var t=this._api.getWidth(),r=this._api.getHeight(),i=this._mediaList,a=this._mediaDefault,s=[],o=[];if(!i.length&&!a)return o;for(var l=0,u=i.length;l<u;l++)pne(i[l].query,t,r)&&s.push(l);return!s.length&&a&&(s=[-1]),s.length&&!gne(s,this._currentMediaIndices)&&(o=Ne(s,function(c){return yt(c===-1?a.option:i[c].option)})),this._currentMediaIndices=s,o},n}();function dne(n,e,t){var r=[],i,a,s=n.baseOption,o=n.timeline,l=n.options,u=n.media,c=!!n.media,h=!!(l||o||s&&s.timeline);s?(a=s,a.timeline||(a.timeline=o)):((h||c)&&(n.options=n.media=null),a=n),c&&Ie(u)&&z(u,function(d){d&&d.option&&(d.query?r.push(d):i||(i=d))}),f(a),z(l,function(d){return f(d)}),z(r,function(d){return f(d.option)});function f(d){z(e,function(p){p(d,t)})}return{baseOption:a,timelineOptions:l||[],mediaDefault:i,mediaList:r}}function pne(n,e,t){var r={width:e,height:t,aspectratio:e/t},i=!0;return z(n,function(a,s){var o=s.match(hne);if(!(!o||!o[1]||!o[2])){var l=o[1],u=o[2].toLowerCase();vne(r[u],a,l)||(i=!1)}}),i}function vne(n,e,t){return t==="min"?n>=e:t==="max"?n<=e:n===e}function gne(n,e){return n.join(",")===e.join(",")}const mne=fne;var Ws=z,jm=gt,aN=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function vA(n){var e=n&&n.itemStyle;if(e)for(var t=0,r=aN.length;t<r;t++){var i=aN[t],a=e.normal,s=e.emphasis;a&&a[i]&&(n[i]=n[i]||{},n[i].normal?It(n[i].normal,a[i]):n[i].normal=a[i],a[i]=null),s&&s[i]&&(n[i]=n[i]||{},n[i].emphasis?It(n[i].emphasis,s[i]):n[i].emphasis=s[i],s[i]=null)}}function ki(n,e,t){if(n&&n[e]&&(n[e].normal||n[e].emphasis)){var r=n[e].normal,i=n[e].emphasis;r&&(t?(n[e].normal=n[e].emphasis=null,dt(n[e],r)):n[e]=r),i&&(n.emphasis=n.emphasis||{},n.emphasis[e]=i,i.focus&&(n.emphasis.focus=i.focus),i.blurScope&&(n.emphasis.blurScope=i.blurScope))}}function Og(n){ki(n,"itemStyle"),ki(n,"lineStyle"),ki(n,"areaStyle"),ki(n,"label"),ki(n,"labelLine"),ki(n,"upperLabel"),ki(n,"edgeLabel")}function Rr(n,e){var t=jm(n)&&n[e],r=jm(t)&&t.textStyle;if(r)for(var i=0,a=hI.length;i<a;i++){var s=hI[i];r.hasOwnProperty(s)&&(t[s]=r[s])}}function gs(n){n&&(Og(n),Rr(n,"label"),n.emphasis&&Rr(n.emphasis,"label"))}function yne(n){if(jm(n)){vA(n),Og(n),Rr(n,"label"),Rr(n,"upperLabel"),Rr(n,"edgeLabel"),n.emphasis&&(Rr(n.emphasis,"label"),Rr(n.emphasis,"upperLabel"),Rr(n.emphasis,"edgeLabel"));var e=n.markPoint;e&&(vA(e),gs(e));var t=n.markLine;t&&(vA(t),gs(t));var r=n.markArea;r&&gs(r);var i=n.data;if(n.type==="graph"){i=i||n.nodes;var a=n.links||n.edges;if(a&&!Pa(a))for(var s=0;s<a.length;s++)gs(a[s]);z(n.categories,function(u){Og(u)})}if(i&&!Pa(i))for(var s=0;s<i.length;s++)gs(i[s]);if(e=n.markPoint,e&&e.data)for(var o=e.data,s=0;s<o.length;s++)gs(o[s]);if(t=n.markLine,t&&t.data)for(var l=t.data,s=0;s<l.length;s++)Ie(l[s])?(gs(l[s][0]),gs(l[s][1])):gs(l[s]);n.type==="gauge"?(Rr(n,"axisLabel"),Rr(n,"title"),Rr(n,"detail")):n.type==="treemap"?(ki(n.breadcrumb,"itemStyle"),z(n.levels,function(u){Og(u)})):n.type==="tree"&&Og(n.leaves)}}function fl(n){return Ie(n)?n:n?[n]:[]}function sN(n){return(Ie(n)?n[0]:n)||{}}function _ne(n,e){Ws(fl(n.series),function(r){jm(r)&&yne(r)});var t=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&t.push("valueAxis","categoryAxis","logAxis","timeAxis"),Ws(t,function(r){Ws(fl(n[r]),function(i){i&&(Rr(i,"axisLabel"),Rr(i.axisPointer,"label"))})}),Ws(fl(n.parallel),function(r){var i=r&&r.parallelAxisDefault;Rr(i,"axisLabel"),Rr(i&&i.axisPointer,"label")}),Ws(fl(n.calendar),function(r){ki(r,"itemStyle"),Rr(r,"dayLabel"),Rr(r,"monthLabel"),Rr(r,"yearLabel")}),Ws(fl(n.radar),function(r){Rr(r,"name"),r.name&&r.axisName==null&&(r.axisName=r.name,delete r.name),r.nameGap!=null&&r.axisNameGap==null&&(r.axisNameGap=r.nameGap,delete r.nameGap)}),Ws(fl(n.geo),function(r){jm(r)&&(gs(r),Ws(fl(r.regions),function(i){gs(i)}))}),Ws(fl(n.timeline),function(r){gs(r),ki(r,"label"),ki(r,"itemStyle"),ki(r,"controlStyle",!0);var i=r.data;Ie(i)&&z(i,function(a){gt(a)&&(ki(a,"label"),ki(a,"itemStyle"))})}),Ws(fl(n.toolbox),function(r){ki(r,"iconStyle"),Ws(r.feature,function(i){ki(i,"iconStyle")})}),Rr(sN(n.axisPointer),"label"),Rr(sN(n.tooltip).axisPointer,"label")}function xne(n,e){for(var t=e.split(","),r=n,i=0;i<t.length&&(r=r&&r[t[i]],r!=null);i++);return r}function bne(n,e,t,r){for(var i=e.split(","),a=n,s,o=0;o<i.length-1;o++)s=i[o],a[s]==null&&(a[s]={}),a=a[s];(r||a[i[o]]==null)&&(a[i[o]]=t)}function oN(n){n&&z(Sne,function(e){e[0]in n&&!(e[1]in n)&&(n[e[1]]=n[e[0]])})}var Sne=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],wne=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],gA=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function $v(n){var e=n&&n.itemStyle;if(e)for(var t=0;t<gA.length;t++){var r=gA[t][1],i=gA[t][0];e[r]!=null&&(e[i]=e[r])}}function lN(n){n&&n.alignTo==="edge"&&n.margin!=null&&n.edgeDistance==null&&(n.edgeDistance=n.margin)}function uN(n){n&&n.downplay&&!n.blur&&(n.blur=n.downplay)}function Ane(n){n&&n.focusNodeAdjacency!=null&&(n.emphasis=n.emphasis||{},n.emphasis.focus==null&&(n.emphasis.focus="adjacency"))}function Y7(n,e){if(n)for(var t=0;t<n.length;t++)e(n[t]),n[t]&&Y7(n[t].children,e)}function K7(n,e){_ne(n,e),n.series=Cn(n.series),z(n.series,function(t){if(gt(t)){var r=t.type;if(r==="line")t.clipOverflow!=null&&(t.clip=t.clipOverflow);else if(r==="pie"||r==="gauge"){t.clockWise!=null&&(t.clockwise=t.clockWise),lN(t.label);var i=t.data;if(i&&!Pa(i))for(var a=0;a<i.length;a++)lN(i[a]);t.hoverOffset!=null&&(t.emphasis=t.emphasis||{},(t.emphasis.scaleSize=null)&&(t.emphasis.scaleSize=t.hoverOffset))}else if(r==="gauge"){var s=xne(t,"pointer.color");s!=null&&bne(t,"itemStyle.color",s)}else if(r==="bar"){$v(t),$v(t.backgroundStyle),$v(t.emphasis);var i=t.data;if(i&&!Pa(i))for(var a=0;a<i.length;a++)typeof i[a]=="object"&&($v(i[a]),$v(i[a]&&i[a].emphasis))}else if(r==="sunburst"){var o=t.highlightPolicy;o&&(t.emphasis=t.emphasis||{},t.emphasis.focus||(t.emphasis.focus=o)),uN(t),Y7(t.data,uN)}else r==="graph"||r==="sankey"?Ane(t):r==="map"&&(t.mapType&&!t.map&&(t.map=t.mapType),t.mapLocation&&dt(t,t.mapLocation));t.hoverAnimation!=null&&(t.emphasis=t.emphasis||{},t.emphasis&&t.emphasis.scale==null&&(t.emphasis.scale=t.hoverAnimation)),oN(t)}}),n.dataRange&&(n.visualMap=n.dataRange),z(wne,function(t){var r=n[t];r&&(Ie(r)||(r=[r]),z(r,function(i){oN(i)}))})}function Mne(n){var e=st();n.eachSeries(function(t){var r=t.get("stack");if(r){var i=e.get(r)||e.set(r,[]),a=t.getData(),s={stackResultDimension:a.getCalculationInfo("stackResultDimension"),stackedOverDimension:a.getCalculationInfo("stackedOverDimension"),stackedDimension:a.getCalculationInfo("stackedDimension"),stackedByDimension:a.getCalculationInfo("stackedByDimension"),isStackedByIndex:a.getCalculationInfo("isStackedByIndex"),data:a,seriesModel:t};if(!s.stackedDimension||!(s.isStackedByIndex||s.stackedByDimension))return;i.length&&a.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(s)}}),e.each(Tne)}function Tne(n){z(n,function(e,t){var r=[],i=[NaN,NaN],a=[e.stackResultDimension,e.stackedOverDimension],s=e.data,o=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";s.modify(a,function(u,c,h){var f=s.get(e.stackedDimension,h);if(isNaN(f))return i;var d,p;o?p=s.getRawIndex(h):d=s.get(e.stackedByDimension,h);for(var g=NaN,v=t-1;v>=0;v--){var m=n[v];if(o||(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=cJ(f,y),g=y;break}}}return r[0]=f,r[1]=g,r})})}var pS=function(){function n(e){this.data=e.data||(e.sourceFormat===rl?{}:[]),this.sourceFormat=e.sourceFormat||z7,this.seriesLayoutBy=e.seriesLayoutBy||Wo,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var r=0;r<t.length;r++){var i=t[r];i.type==null&&H7(this,r)===Si.Must&&(i.type="ordinal")}}return n}();function QP(n){return n instanceof pS}function aC(n,e,t){t=t||Z7(n);var r=e.seriesLayoutBy,i=Ene(n,t,r,e.sourceHeader,e.dimensions),a=new pS({data:n,sourceFormat:t,seriesLayoutBy:r,dimensionsDefine:i.dimensionsDefine,startIndex:i.startIndex,dimensionsDetectedCount:i.dimensionsDetectedCount,metaRawOption:yt(e)});return a}function JP(n){return new pS({data:n,sourceFormat:Pa(n)?Qu:Gs})}function Cne(n){return new pS({data:n.data,sourceFormat:n.sourceFormat,seriesLayoutBy:n.seriesLayoutBy,dimensionsDefine:yt(n.dimensionsDefine),startIndex:n.startIndex,dimensionsDetectedCount:n.dimensionsDetectedCount})}function Z7(n){var e=z7;if(Pa(n))e=Qu;else if(Ie(n)){n.length===0&&(e=Wi);for(var t=0,r=n.length;t<r;t++){var i=n[t];if(i!=null){if(Ie(i)||Pa(i)){e=Wi;break}else if(gt(i)){e=zs;break}}}}else if(gt(n)){for(var a in n)if(tt(n,a)&&Hi(n[a])){e=rl;break}}return e}function Ene(n,e,t,r,i){var a,s;if(!n)return{dimensionsDefine:cN(i),startIndex:s,dimensionsDetectedCount:a};if(e===Wi){var o=n;r==="auto"||r==null?hN(function(u){u!=null&&u!=="-"&&(Ke(u)?s==null&&(s=1):s=0)},t,o,10):s=un(r)?r:r?1:0,!i&&s===1&&(i=[],hN(function(u,c){i[c]=u!=null?u+"":""},t,o,1/0)),a=i?i.length:t===tv?o.length:o[0]?o[0].length:null}else if(e===zs)i||(i=Pne(n));else if(e===rl)i||(i=[],z(n,function(u,c){i.push(c)}));else if(e===Gs){var l=qp(n[0]);a=Ie(l)&&l.length||1}return{startIndex:s,dimensionsDefine:cN(i),dimensionsDetectedCount:a}}function Pne(n){for(var e=0,t;e<n.length&&!(t=n[e++]););if(t)return Yt(t)}function cN(n){if(n){var e=st();return Ne(n,function(t,r){t=gt(t)?t:{name:t};var i={name:t.name,displayName:t.displayName,type:t.type};if(i.name==null)return i;i.name+="",i.displayName==null&&(i.displayName=i.name);var a=e.get(i.name);return a?i.name+="-"+a.count++:e.set(i.name,{count:1}),i})}}function hN(n,e,t,r){if(e===tv)for(var i=0;i<t.length&&i<r;i++)n(t[i]?t[i][0]:null,i);else for(var a=t[0]||[],i=0;i<a.length&&i<r;i++)n(a[i],i)}function Q7(n){var e=n.sourceFormat;return e===zs||e===rl}var qc,Xc,Yc,fN,dN,J7=function(){function n(e,t){var r=QP(e)?e:JP(e);this._source=r;var i=this._data=r.data;r.sourceFormat===Qu&&(this._offset=0,this._dimSize=t,this._data=i),dN(this,i,r)}return n.prototype.getSource=function(){return this._source},n.prototype.count=function(){return 0},n.prototype.getItem=function(e,t){},n.prototype.appendData=function(e){},n.prototype.clean=function(){},n.protoInitialize=function(){var e=n.prototype;e.pure=!1,e.persistent=!0}(),n.internalField=function(){var e;dN=function(s,o,l){var u=l.sourceFormat,c=l.seriesLayoutBy,h=l.startIndex,f=l.dimensionsDefine,d=fN[eL(u,c)];if(Pe(s,d),u===Qu)s.getItem=t,s.count=i,s.fillStorage=r;else{var p=eV(u,c);s.getItem=Qe(p,null,o,h,f);var g=tV(u,c);s.count=Qe(g,null,o,h,f)}};var t=function(s,o){s=s-this._offset,o=o||[];for(var l=this._data,u=this._dimSize,c=u*s,h=0;h<u;h++)o[h]=l[c+h];return o},r=function(s,o,l,u){for(var c=this._data,h=this._dimSize,f=0;f<h;f++){for(var d=u[f],p=d[0]==null?1/0:d[0],g=d[1]==null?-1/0:d[1],v=o-s,m=l[f],y=0;y<v;y++){var _=c[y*h+f];m[s+y]=_,_<p&&(p=_),_>g&&(g=_)}d[0]=p,d[1]=g}},i=function(){return this._data?this._data.length/this._dimSize:0};fN=(e={},e[Wi+"_"+Wo]={pure:!0,appendData:a},e[Wi+"_"+tv]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[zs]={pure:!0,appendData:a},e[rl]={pure:!0,appendData:function(s){var o=this._data;z(s,function(l,u){for(var c=o[u]||(o[u]=[]),h=0;h<(l||[]).length;h++)c.push(l[h])})}},e[Gs]={appendData:a},e[Qu]={persistent:!1,pure:!0,appendData:function(s){this._data=s},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(s){for(var o=0;o<s.length;o++)this._data.push(s[o])}}(),n}(),pN=function(n,e,t,r){return n[r]},Lne=(qc={},qc[Wi+"_"+Wo]=function(n,e,t,r){return n[r+e]},qc[Wi+"_"+tv]=function(n,e,t,r,i){r+=e;for(var a=i||[],s=n,o=0;o<s.length;o++){var l=s[o];a[o]=l?l[r]:null}return a},qc[zs]=pN,qc[rl]=function(n,e,t,r,i){for(var a=i||[],s=0;s<t.length;s++){var o=t[s].name,l=n[o];a[s]=l?l[r]:null}return a},qc[Gs]=pN,qc);function eV(n,e){var t=Lne[eL(n,e)];return t}var vN=function(n,e,t){return n.length},Rne=(Xc={},Xc[Wi+"_"+Wo]=function(n,e,t){return Math.max(0,n.length-e)},Xc[Wi+"_"+tv]=function(n,e,t){var r=n[0];return r?Math.max(0,r.length-e):0},Xc[zs]=vN,Xc[rl]=function(n,e,t){var r=t[0].name,i=n[r];return i?i.length:0},Xc[Gs]=vN,Xc);function tV(n,e){var t=Rne[eL(n,e)];return t}var mA=function(n,e,t){return n[e]},Dne=(Yc={},Yc[Wi]=mA,Yc[zs]=function(n,e,t){return n[t]},Yc[rl]=mA,Yc[Gs]=function(n,e,t){var r=qp(n);return r instanceof Array?r[e]:r},Yc[Qu]=mA,Yc);function nV(n){var e=Dne[n];return e}function eL(n,e){return n===Wi?n+"_"+e:n}function Sp(n,e,t){if(n){var r=n.getRawDataItem(e);if(r!=null){var i=n.getStore(),a=i.getSource().sourceFormat;if(t!=null){var s=n.getDimensionIndex(t),o=i.getDimensionProperty(s);return nV(a)(r,s,o)}else{var l=r;return a===Gs&&(l=qp(r)),l}}}}var Ine=/\{@(.+?)\}/g,vS=function(){function n(){}return n.prototype.getDataParams=function(e,t){var r=this.getData(t),i=this.getRawValue(e,t),a=r.getRawIndex(e),s=r.getName(e),o=r.getRawDataItem(e),l=r.getItemVisual(e,"style"),u=l&&l[r.getItemVisual(e,"drawType")||"fill"],c=l&&l.stroke,h=this.mainType,f=h==="series",d=r.userOutput&&r.userOutput.get();return{componentType:h,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:f?this.subType:null,seriesIndex:this.seriesIndex,seriesId:f?this.id:null,seriesName:f?this.name:null,name:s,dataIndex:a,data:o,dataType:t,value:i,color:u,borderColor:c,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},n.prototype.getFormattedLabel=function(e,t,r,i,a,s){t=t||"normal";var o=this.getData(r),l=this.getDataParams(e,r);if(s&&(l.value=s.interpolatedValue),i!=null&&Ie(l.value)&&(l.value=l.value[i]),!a){var u=o.getItemModel(e);a=u.get(t==="normal"?["label","formatter"]:[t,"label","formatter"])}if(ct(a))return l.status=t,l.dimensionIndex=i,a(l);if(Ke(a)){var c=k7(a,l);return c.replace(Ine,function(h,f){var d=f.length,p=f;p.charAt(0)==="["&&p.charAt(d-1)==="]"&&(p=+p.slice(1,d-1));var g=Sp(o,e,p);if(s&&Ie(s.interpolatedValue)){var v=o.getDimensionIndex(p);v>=0&&(g=s.interpolatedValue[v])}return g!=null?g+"":""})}},n.prototype.getRawValue=function(e,t){return Sp(this.getData(t),e)},n.prototype.formatTooltip=function(e,t,r){},n}();function gN(n){var e,t;return gt(n)?n.type&&(t=n):e=n,{text:e,frag:t}}function sm(n){return new Nne(n)}var Nne=function(){function n(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return n.prototype.perform=function(e){var t=this._upstream,r=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&&!r&&(a=this._plan(this.context));var s=c(this._modBy),o=this._modDataCount||0,l=c(e&&e.modBy),u=e&&e.modDataCount||0;(s!==l||o!==u)&&(a="reset");function c(y){return!(y>=1)&&(y=1),y}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(r)),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(!r&&(h||d<p)){var g=this._progress;if(Ie(g))for(var v=0;v<g.length;v++)this._doProgress(g[v],d,p,l,u);else this._doProgress(g,d,p,l,u)}this._dueIndex=p;var m=this._settedOutputEnd!=null?this._settedOutputEnd:p;this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},n.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},n.prototype._doProgress=function(e,t,r,i,a){mN.reset(t,r,i,a),this._callingProgress=e,this._callingProgress({start:t,end:r,count:r-t,next:mN.next},this.context)},n.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var t,r;!e&&this._reset&&(t=this._reset(this.context),t&&t.progress&&(r=t.forceFirstProgress,t=t.progress),Ie(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var i=this._downstream;return i&&i.dirty(),r},n.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},n.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},n.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},n.prototype.getUpstream=function(){return this._upstream},n.prototype.getDownstream=function(){return this._downstream},n.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},n}(),mN=function(){var n,e,t,r,i,a={reset:function(l,u,c,h){e=l,n=u,t=c,r=h,i=Math.ceil(r/t),a.next=t>1&&r>0?o:s}};return a;function s(){return e<n?e++:null}function o(){var l=e%i*t+Math.ceil(e/i),u=e>=n?null:l<r?l:e;return e++,u}}();function Ju(n,e){var t=e&&e.type;return t==="ordinal"?n:(t==="time"&&!un(n)&&n!=null&&n!=="-"&&(n=+Qo(n)),n==null||n===""?NaN:Number(n))}var kne=st({number:function(n){return parseFloat(n)},time:function(n){return+Qo(n)},trim:function(n){return Ke(n)?no(n):n}});function rV(n){return kne.get(n)}var iV={lt:function(n,e){return n<e},lte:function(n,e){return n<=e},gt:function(n,e){return n>e},gte:function(n,e){return n>=e}},One=function(){function n(e,t){if(!un(t)){var r="";mn(r)}this._opFn=iV[e],this._rvalFloat=Gl(t)}return n.prototype.evaluate=function(e){return un(e)?this._opFn(e,this._rvalFloat):this._opFn(Gl(e),this._rvalFloat)},n}(),aV=function(){function n(e,t){var r=e==="desc";this._resultLT=r?1:-1,t==null&&(t=r?"min":"max"),this._incomparable=t==="min"?-1/0:1/0}return n.prototype.evaluate=function(e,t){var r=un(e)?e:Gl(e),i=un(t)?t:Gl(t),a=isNaN(r),s=isNaN(i);if(a&&(r=this._incomparable),s&&(i=this._incomparable),a&&s){var o=Ke(e),l=Ke(t);o&&(r=l?e:0),l&&(i=o?t:0)}return r<i?this._resultLT:r>i?-this._resultLT:0},n}(),Fne=function(){function n(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Gl(t)}return n.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var r=typeof e;r!==this._rvalTypeof&&(r==="number"||this._rvalTypeof==="number")&&(t=Gl(e)===this._rvalFloat)}return this._isEQ?t:!t},n}();function Bne(n,e){return n==="eq"||n==="ne"?new Fne(n==="eq",e):tt(iV,n)?new One(n,e):null}var Gne=function(){function n(){}return n.prototype.getRawData=function(){throw new Error("not supported")},n.prototype.getRawDataItem=function(e){throw new Error("not supported")},n.prototype.cloneRawData=function(){},n.prototype.getDimensionInfo=function(e){},n.prototype.cloneAllDimensionInfo=function(){},n.prototype.count=function(){},n.prototype.retrieveValue=function(e,t){},n.prototype.retrieveValueFromItem=function(e,t){},n.prototype.convertValue=function(e,t){return Ju(e,t)},n}();function zne(n,e){var t=new Gne,r=n.data,i=t.sourceFormat=n.sourceFormat,a=n.startIndex,s="";n.seriesLayoutBy!==Wo&&mn(s);var o=[],l={},u=n.dimensionsDefine;if(u)z(u,function(g,v){var m=g.name,y={index:v,name:m,displayName:g.displayName};if(o.push(y),m!=null){var _="";tt(l,m)&&mn(_),l[m]=y}});else for(var c=0;c<n.dimensionsDetectedCount;c++)o.push({index:c});var h=eV(i,Wo);e.__isBuiltIn&&(t.getRawDataItem=function(g){return h(r,a,o,g)},t.getRawData=Qe(Une,null,n)),t.cloneRawData=Qe(Vne,null,n);var f=tV(i,Wo);t.count=Qe(f,null,r,a,o);var d=nV(i);t.retrieveValue=function(g,v){var m=h(r,a,o,g);return p(m,v)};var p=t.retrieveValueFromItem=function(g,v){if(g!=null){var m=o[v];if(m)return d(g,v,m.name)}};return t.getDimensionInfo=Qe(Hne,null,o,l),t.cloneAllDimensionInfo=Qe(Wne,null,o),t}function Une(n){var e=n.sourceFormat;if(!tL(e)){var t="";mn(t)}return n.data}function Vne(n){var e=n.sourceFormat,t=n.data;if(!tL(e)){var r="";mn(r)}if(e===Wi){for(var i=[],a=0,s=t.length;a<s;a++)i.push(t[a].slice());return i}else if(e===zs){for(var i=[],a=0,s=t.length;a<s;a++)i.push(Pe({},t[a]));return i}}function Hne(n,e,t){if(t!=null){if(un(t)||!isNaN(t)&&!tt(e,t))return n[t];if(tt(e,t))return e[t]}}function Wne(n){return yt(n)}var sV=st();function $ne(n){n=yt(n);var e=n.type,t="";e||mn(t);var r=e.split(":");r.length!==2&&mn(t);var i=!1;r[0]==="echarts"&&(e=r[1],i=!0),n.__isBuiltIn=i,sV.set(e,n)}function jne(n,e,t){var r=Cn(n),i=r.length,a="";i||mn(a);for(var s=0,o=i;s<o;s++){var l=r[s];e=qne(l,e),s!==o-1&&(e.length=Math.max(e.length,1))}return e}function qne(n,e,t,r){var i="";e.length||mn(i),gt(n)||mn(i);var a=n.type,s=sV.get(a);s||mn(i);var o=Ne(e,function(u){return zne(u,s)}),l=Cn(s.transform({upstream:o[0],upstreamList:o,config:yt(n.config)}));return Ne(l,function(u,c){var h="";gt(u)||mn(h),u.data||mn(h);var f=Z7(u.data);tL(f)||mn(h);var d,p=e[0];if(p&&c===0&&!u.dimensions){var g=p.startIndex;g&&(u.data=p.data.slice(0,g).concat(u.data)),d={seriesLayoutBy:Wo,sourceHeader:g,dimensions:p.metaRawOption.dimensions}}else d={seriesLayoutBy:Wo,sourceHeader:0,dimensions:u.dimensions};return aC(u.data,d,null)})}function tL(n){return n===Wi||n===zs}var gS="undefined",Xne=typeof Uint32Array===gS?Array:Uint32Array,Yne=typeof Uint16Array===gS?Array:Uint16Array,oV=typeof Int32Array===gS?Array:Int32Array,yN=typeof Float64Array===gS?Array:Float64Array,lV={float:yN,int:oV,ordinal:Array,number:Array,time:yN},yA;function Hf(n){return n>65535?Xne:Yne}function Wf(){return[1/0,-1/0]}function Kne(n){var e=n.constructor;return e===Array?n.slice():new e(n)}function _N(n,e,t,r,i){var a=lV[t||"float"];if(i){var s=n[e],o=s&&s.length;if(o!==r){for(var l=new a(r),u=0;u<o;u++)l[u]=s[u];n[e]=l}}else n[e]=new a(r)}var sC=function(){function n(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=st()}return n.prototype.initData=function(e,t,r){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var i=e.getSource(),a=this.defaultDimValueGetter=yA[i.sourceFormat];this._dimValueGetter=r||a,this._rawExtent=[],Q7(i),this._dimensions=Ne(t,function(s){return{type:s.type,property:s.property}}),this._initDataFromProvider(0,e.count())},n.prototype.getProvider=function(){return this._provider},n.prototype.getSource=function(){return this._provider.getSource()},n.prototype.ensureCalculationDimension=function(e,t){var r=this._calcDimNameToIdx,i=this._dimensions,a=r.get(e);if(a!=null){if(i[a].type===t)return a}else a=i.length;return i[a]={type:t},r.set(e,a),this._chunks[a]=new lV[t||"float"](this._rawCount),this._rawExtent[a]=Wf(),a},n.prototype.collectOrdinalMeta=function(e,t){var r=this._chunks[e],i=this._dimensions[e],a=this._rawExtent,s=i.ordinalOffset||0,o=r.length;s===0&&(a[e]=Wf());for(var l=a[e],u=s;u<o;u++){var c=r[u]=t.parseAndCollect(r[u]);isNaN(c)||(l[0]=Math.min(c,l[0]),l[1]=Math.max(c,l[1]))}i.ordinalMeta=t,i.ordinalOffset=o,i.type="ordinal"},n.prototype.getOrdinalMeta=function(e){var t=this._dimensions[e],r=t.ordinalMeta;return r},n.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},n.prototype.appendData=function(e){var t=this._provider,r=this.count();t.appendData(e);var i=t.count();return t.persistent||(i+=r),r<i&&this._initDataFromProvider(r,i,!0),[r,i]},n.prototype.appendValues=function(e,t){for(var r=this._chunks,i=this._dimensions,a=i.length,s=this._rawExtent,o=this.count(),l=o+Math.max(e.length,t||0),u=0;u<a;u++){var c=i[u];_N(r,u,c.type,l,!0)}for(var h=[],f=o;f<l;f++)for(var d=f-o,p=0;p<a;p++){var c=i[p],g=yA.arrayRows.call(this,e[d]||h,c.property,d,p);r[p][f]=g;var v=s[p];g<v[0]&&(v[0]=g),g>v[1]&&(v[1]=g)}return this._rawCount=this._count=l,{start:o,end:l}},n.prototype._initDataFromProvider=function(e,t,r){for(var i=this._provider,a=this._chunks,s=this._dimensions,o=s.length,l=this._rawExtent,u=Ne(s,function(y){return y.property}),c=0;c<o;c++){var h=s[c];l[c]||(l[c]=Wf()),_N(a,c,h.type,t,r)}if(i.fillStorage)i.fillStorage(e,t,a,l);else for(var f=[],d=e;d<t;d++){f=i.getItem(d,f);for(var p=0;p<o;p++){var g=a[p],v=this._dimValueGetter(f,u[p],d,p);g[d]=v;var m=l[p];v<m[0]&&(m[0]=v),v>m[1]&&(m[1]=v)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent=[]},n.prototype.count=function(){return this._count},n.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var r=this._chunks[e];return r?r[this.getRawIndex(t)]:NaN},n.prototype.getValues=function(e,t){var r=[],i=[];if(t==null){t=e,e=[];for(var a=0;a<this._dimensions.length;a++)i.push(a)}else i=e;for(var a=0,s=i.length;a<s;a++)r.push(this.get(i[a],t));return r},n.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var r=this._chunks[e];return r?r[t]:NaN},n.prototype.getSum=function(e){var t=this._chunks[e],r=0;if(t)for(var i=0,a=this.count();i<a;i++){var s=this.get(e,i);isNaN(s)||(r+=s)}return r},n.prototype.getMedian=function(e){var t=[];this.each([e],function(a){isNaN(a)||t.push(a)});var r=t.sort(function(a,s){return a-s}),i=this.count();return i===0?0:i%2===1?r[(i-1)/2]:(r[i/2]+r[i/2-1])/2},n.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,r=t[e];if(r!=null&&r<this._count&&r===e)return e;for(var i=0,a=this._count-1;i<=a;){var s=(i+a)/2|0;if(t[s]<e)i=s+1;else if(t[s]>e)a=s-1;else return s}return-1},n.prototype.indicesOfNearest=function(e,t,r){var i=this._chunks,a=i[e],s=[];if(!a)return s;r==null&&(r=1/0);for(var o=1/0,l=-1,u=0,c=0,h=this.count();c<h;c++){var f=this.getRawIndex(c),d=t-a[f],p=Math.abs(d);p<=r&&((p<o||p===o&&d>=0&&l<0)&&(o=p,l=d,u=0),d===l&&(s[u++]=c))}return s.length=u,s},n.prototype.getIndices=function(){var e,t=this._indices;if(t){var r=t.constructor,i=this._count;if(r===Array){e=new r(i);for(var a=0;a<i;a++)e[a]=t[a]}else e=new r(t.buffer,0,i)}else{var r=Hf(this._rawCount);e=new r(this.count());for(var a=0;a<e.length;a++)e[a]=a}return e},n.prototype.filter=function(e,t){if(!this._count)return this;for(var r=this.clone(),i=r.count(),a=Hf(r._rawCount),s=new a(i),o=[],l=e.length,u=0,c=e[0],h=r._chunks,f=0;f<i;f++){var d=void 0,p=r.getRawIndex(f);if(l===0)d=t(f);else if(l===1){var g=h[c][p];d=t(g,f)}else{for(var v=0;v<l;v++)o[v]=h[e[v]][p];o[v]=f,d=t.apply(null,o)}d&&(s[u++]=p)}return u<i&&(r._indices=s),r._count=u,r._extent=[],r._updateGetRawIdx(),r},n.prototype.selectRange=function(e){var t=this.clone(),r=t._count;if(!r)return this;var i=Yt(e),a=i.length;if(!a)return this;var s=t.count(),o=Hf(t._rawCount),l=new o(s),u=0,c=i[0],h=e[c][0],f=e[c][1],d=t._chunks,p=!1;if(!t._indices){var g=0;if(a===1){for(var v=d[i[0]],m=0;m<r;m++){var y=v[m];(y>=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],b=e[i[1]][1],m=0;m<r;m++){var y=v[m],S=_[m];(y>=h&&y<=f||isNaN(y))&&(S>=x&&S<=b||isNaN(S))&&(l[u++]=g),g++}p=!0}}if(!p)if(a===1)for(var m=0;m<s;m++){var w=t.getRawIndex(m),y=d[i[0]][w];(y>=h&&y<=f||isNaN(y))&&(l[u++]=w)}else for(var m=0;m<s;m++){for(var T=!0,w=t.getRawIndex(m),C=0;C<a;C++){var A=i[C],y=d[A][w];(y<e[A][0]||y>e[A][1])&&(T=!1)}T&&(l[u++]=t.getRawIndex(m))}return u<s&&(t._indices=l),t._count=u,t._extent=[],t._updateGetRawIdx(),t},n.prototype.map=function(e,t){var r=this.clone(e);return this._updateDims(r,e,t),r},n.prototype.modify=function(e,t){this._updateDims(this,e,t)},n.prototype._updateDims=function(e,t,r){for(var i=e._chunks,a=[],s=t.length,o=e.count(),l=[],u=e._rawExtent,c=0;c<t.length;c++)u[t[c]]=Wf();for(var h=0;h<o;h++){for(var f=e.getRawIndex(h),d=0;d<s;d++)l[d]=i[t[d]][f];l[s]=h;var p=r&&r.apply(null,l);if(p!=null){typeof p!="object"&&(a[0]=p,p=a);for(var c=0;c<p.length;c++){var g=t[c],v=p[c],m=u[g],y=i[g];y&&(y[f]=v),v<m[0]&&(m[0]=v),v>m[1]&&(m[1]=v)}}}},n.prototype.lttbDownSample=function(e,t){var r=this.clone([e],!0),i=r._chunks,a=i[e],s=this.count(),o=0,l=Math.floor(1/t),u=this.getRawIndex(0),c,h,f,d=new(Hf(this._rawCount))(Math.min((Math.ceil(s/l)+2)*2,s));d[o++]=u;for(var p=1;p<s-1;p+=l){for(var g=Math.min(p+l,s-1),v=Math.min(p+l*2,s),m=(v+g)/2,y=0,_=g;_<v;_++){var x=this.getRawIndex(_),b=a[x];isNaN(b)||(y+=b)}y/=v-g;var S=p,w=Math.min(p+l,s),T=p-1,C=a[u];c=-1,f=S;for(var A=-1,M=0,_=S;_<w;_++){var x=this.getRawIndex(_),b=a[x];if(isNaN(b)){M++,A<0&&(A=x);continue}h=Math.abs((T-m)*(b-C)-(T-_)*(y-C)),h>c&&(c=h,f=x)}M>0&&M<w-S&&(d[o++]=Math.min(A,f),f=Math.max(A,f)),d[o++]=f,u=f}return d[o++]=this.getRawIndex(s-1),r._count=o,r._indices=d,r.getRawIndex=this._getRawIdx,r},n.prototype.minmaxDownSample=function(e,t){for(var r=this.clone([e],!0),i=r._chunks,a=Math.floor(1/t),s=i[e],o=this.count(),l=new(Hf(this._rawCount))(Math.ceil(o/a)*2),u=0,c=0;c<o;c+=a){var h=c,f=s[this.getRawIndex(h)],d=c,p=s[this.getRawIndex(d)],g=a;c+a>o&&(g=o-c);for(var v=0;v<g;v++){var m=this.getRawIndex(c+v),y=s[m];y<f&&(f=y,h=c+v),y>p&&(p=y,d=c+v)}var _=this.getRawIndex(h),x=this.getRawIndex(d);h<d?(l[u++]=_,l[u++]=x):(l[u++]=x,l[u++]=_)}return r._count=u,r._indices=l,r._updateGetRawIdx(),r},n.prototype.downSample=function(e,t,r,i){for(var a=this.clone([e],!0),s=a._chunks,o=[],l=Math.floor(1/t),u=s[e],c=this.count(),h=a._rawExtent[e]=Wf(),f=new(Hf(this._rawCount))(Math.ceil(c/l)),d=0,p=0;p<c;p+=l){l>c-p&&(l=c-p,o.length=l);for(var g=0;g<l;g++){var v=this.getRawIndex(p+g);o[g]=u[v]}var m=r(o),y=this.getRawIndex(Math.min(p+i(o,m)||0,c-1));u[y]=m,m<h[0]&&(h[0]=m),m>h[1]&&(h[1]=m),f[d++]=y}return a._count=d,a._indices=f,a._updateGetRawIdx(),a},n.prototype.each=function(e,t){if(this._count)for(var r=e.length,i=this._chunks,a=0,s=this.count();a<s;a++){var o=this.getRawIndex(a);switch(r){case 0:t(a);break;case 1:t(i[e[0]][o],a);break;case 2:t(i[e[0]][o],i[e[1]][o],a);break;default:for(var l=0,u=[];l<r;l++)u[l]=i[e[l]][o];u[l]=a,t.apply(null,u)}}},n.prototype.getDataExtent=function(e){var t=this._chunks[e],r=Wf();if(!t)return r;var i=this.count(),a=!this._indices,s;if(a)return this._rawExtent[e].slice();if(s=this._extent[e],s)return s.slice();s=r;for(var o=s[0],l=s[1],u=0;u<i;u++){var c=this.getRawIndex(u),h=t[c];h<o&&(o=h),h>l&&(l=h)}return s=[o,l],this._extent[e]=s,s},n.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var r=[],i=this._chunks,a=0;a<i.length;a++)r.push(i[a][t]);return r},n.prototype.clone=function(e,t){var r=new n,i=this._chunks,a=e&&Yo(e,function(o,l){return o[l]=!0,o},{});if(a)for(var s=0;s<i.length;s++)r._chunks[s]=a[s]?Kne(i[s]):i[s];else r._chunks=i;return this._copyCommonProps(r),t||(r._indices=this._cloneIndices()),r._updateGetRawIdx(),r},n.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=yt(this._extent),e._rawExtent=yt(this._rawExtent)},n.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var r=this._indices.length;t=new e(r);for(var i=0;i<r;i++)t[i]=this._indices[i]}else t=new e(this._indices);return t}return null},n.prototype._getRawIdxIdentity=function(e){return e},n.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},n.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},n.internalField=function(){function e(t,r,i,a){return Ju(t[a],this._dimensions[a])}yA={arrayRows:e,objectRows:function(t,r,i,a){return Ju(t[r],this._dimensions[a])},keyedColumns:e,original:function(t,r,i,a){var s=t&&(t.value==null?t:t.value);return Ju(s instanceof Array?s[a]:s,this._dimensions[a])},typedArray:function(t,r,i,a){return t[a]}}}(),n}(),uV=function(){function n(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return n.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},n.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},n.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},n.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},n.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),r=!!t.length,i,a;if(Fy(e)){var s=e,o=void 0,l=void 0,u=void 0;if(r){var c=t[0];c.prepareSource(),u=c.getSource(),o=u.data,l=u.sourceFormat,a=[c._getVersionSign()]}else o=s.get("data",!0),l=Pa(o)?Qu:Gs,a=[];var h=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},d=Et(h.seriesLayoutBy,f.seriesLayoutBy)||null,p=Et(h.sourceHeader,f.sourceHeader),g=Et(h.dimensions,f.dimensions),v=d!==f.seriesLayoutBy||!!p!=!!f.sourceHeader||g;i=v?[aC(o,{seriesLayoutBy:d,sourceHeader:p,dimensions:g},l)]:[]}else{var m=e;if(r){var y=this._applyTransform(t);i=y.sourceList,a=y.upstreamSignList}else{var _=m.get("source",!0);i=[aC(_,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},n.prototype._applyTransform=function(e){var t=this._sourceHost,r=t.get("transform",!0),i=t.get("fromTransformResult",!0);if(i!=null){var a="";e.length!==1&&bN(a)}var s,o=[],l=[];return z(e,function(u){u.prepareSource();var c=u.getSource(i||0),h="";i!=null&&!c&&bN(h),o.push(c),l.push(u._getVersionSign())}),r?s=jne(r,o,{datasetIndex:t.componentIndex}):i!=null&&(s=[Cne(o[0])]),{sourceList:s,upstreamSignList:l}},n.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var r=e[t];if(r._isDirty()||this._upstreamSignList[t]!==r._getVersionSign())return!0}},n.prototype.getSource=function(e){e=e||0;var t=this._sourceList[e];if(!t){var r=this._getUpstreamSourceManagers();return r[0]&&r[0].getSource(e)}return t},n.prototype.getSharedDataStore=function(e){var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},n.prototype._innerGetDataStore=function(e,t,r){var i=0,a=this._storeList,s=a[i];s||(s=a[i]={});var o=s[r];if(!o){var l=this._getUpstreamSourceManagers()[0];Fy(this._sourceHost)&&l?o=l._innerGetDataStore(e,t,r):(o=new sC,o.initData(new J7(t,e.length),e)),s[r]=o}return o},n.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(Fy(e)){var t=KP(e);return t?[t.getSourceManager()]:[]}else return Ne(Jte(e),function(r){return r.getSourceManager()})},n.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,t,r,i;if(Fy(e))t=e.get("seriesLayoutBy",!0),r=e.get("sourceHeader",!0),i=e.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var a=e;t=a.get("seriesLayoutBy",!0),r=a.get("sourceHeader",!0),i=a.get("dimensions",!0)}return{seriesLayoutBy:t,sourceHeader:r,dimensions:i}},n}();function xN(n){var e=n.option.transform;e&&vx(n.option.transform)}function Fy(n){return n.mainType==="series"}function bN(n){throw new Error(n)}var Zne="line-height:1";function cV(n){var e=n.lineHeight;return e==null?Zne:"line-height:"+Bi(e+"")+"px"}function hV(n,e){var t=n.color||"#6e7079",r=n.fontSize||12,i=n.fontWeight||"400",a=n.color||"#464646",s=n.fontSize||14,o=n.fontWeight||"900";return e==="html"?{nameStyle:"font-size:"+Bi(r+"")+"px;color:"+Bi(t)+";font-weight:"+Bi(i+""),valueStyle:"font-size:"+Bi(s+"")+"px;color:"+Bi(a)+";font-weight:"+Bi(o+"")}:{nameStyle:{fontSize:r,fill:t,fontWeight:i},valueStyle:{fontSize:s,fill:a,fontWeight:o}}}var Qne=[0,10,20,30],Jne=["",`
`,`
`,`
`];function ii(n,e){return e.type=n,e}function oC(n){return n.type==="section"}function fV(n){return oC(n)?ere:tre}function dV(n){if(oC(n)){var e=0,t=n.blocks.length,r=t>1||t>0&&!n.noHeader;return z(n.blocks,function(i){var a=dV(i);a>=e&&(e=a+ +(r&&(!a||oC(i)&&!i.noHeader)))}),e}return 0}function ere(n,e,t,r){var i=e.noHeader,a=nre(dV(e)),s=[],o=e.blocks||[];sa(!o||Ie(o)),o=o||[];var l=n.orderMode;if(e.sortBlocks&&l){o=o.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(tt(u,l)){var c=new aV(u[l],null);o.sort(function(g,v){return c.evaluate(g.sortParam,v.sortParam)})}else l==="seriesDesc"&&o.reverse()}z(o,function(g,v){var m=e.valueFormatter,y=fV(g)(m?Pe(Pe({},n),{valueFormatter:m}):n,g,v>0?a.html:0,r);y!=null&&s.push(y)});var h=n.renderMode==="richText"?s.join(a.richText):lC(r,s.join(""),i?t:a.html);if(i)return h;var f=nC(e.header,"ordinal",n.useUTC),d=hV(r,n.renderMode).nameStyle,p=cV(r);return n.renderMode==="richText"?pV(n,f,d)+a.richText+h:lC(r,'<div style="'+d+";"+p+';">'+Bi(f)+"</div>"+h,t)}function tre(n,e,t,r){var i=n.renderMode,a=e.noName,s=e.noValue,o=!e.markerType,l=e.name,u=n.useUTC,c=e.valueFormatter||n.valueFormatter||function(x){return x=Ie(x)?x:[x],Ne(x,function(b,S){return nC(b,Ie(d)?d[S]:d,u)})};if(!(a&&s)){var h=o?"":n.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),f=a?"":nC(l,"ordinal",u),d=e.valueType,p=s?[]:c(e.value,e.dataIndex),g=!o||!a,v=!o&&a,m=hV(r,i),y=m.nameStyle,_=m.valueStyle;return i==="richText"?(o?"":h)+(a?"":pV(n,f,y))+(s?"":are(n,p,g,v,_)):lC(r,(o?"":h)+(a?"":rre(f,!o,y))+(s?"":ire(p,g,v,_)),t)}}function SN(n,e,t,r,i,a){if(n){var s=fV(n),o={useUTC:i,renderMode:t,orderMode:r,markupStyleCreator:e,valueFormatter:n.valueFormatter};return s(o,n,0,a)}}function nre(n){return{html:Qne[n],richText:Jne[n]}}function lC(n,e,t){var r='<div style="clear:both"></div>',i="margin: "+t+"px 0 0",a=cV(n);return'<div style="'+i+";"+a+';">'+e+r+"</div>"}function rre(n,e,t){var r=e?"margin-left:2px":"";return'<span style="'+t+";"+r+'">'+Bi(n)+"</span>"}function ire(n,e,t,r){var i=t?"10px":"20px",a=e?"float:right;margin-left:"+i:"";return n=Ie(n)?n:[n],'<span style="'+a+";"+r+'">'+Ne(n,function(s){return Bi(s)}).join("&nbsp;&nbsp;")+"</span>"}function pV(n,e,t){return n.markupStyleCreator.wrapRichTextStyle(e,t)}function are(n,e,t,r,i){var a=[i],s=r?10:20;return t&&a.push({padding:[0,0,0,s],align:"right"}),n.markupStyleCreator.wrapRichTextStyle(Ie(e)?e.join(" "):e,a)}function vV(n,e){var t=n.getData().getItemVisual(e,"style"),r=t[n.visualDrawType];return hf(r)}function gV(n,e){var t=n.get("padding");return t!=null?t:e==="richText"?[8,10]:10}var _A=function(){function n(){this.richTextStyles={},this._nextStyleNameId=gU()}return n.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},n.prototype.makeTooltipMarker=function(e,t,r){var i=r==="richText"?this._generateStyleName():null,a=jte({color:t,type:e,renderMode:r,markerId:i});return Ke(a)?a:(this.richTextStyles[i]=a.style,a.content)},n.prototype.wrapRichTextStyle=function(e,t){var r={};Ie(t)?z(t,function(a){return Pe(r,a)}):Pe(r,t);var i=this._generateStyleName();return this.richTextStyles[i]=r,"{"+i+"|"+e+"}"},n}();function mV(n){var e=n.series,t=n.dataIndex,r=n.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),s=a.length,o=e.getRawValue(t),l=Ie(o),u=vV(e,t),c,h,f,d;if(s>1||l&&!s){var p=sre(o,e,t,a,u);c=p.inlineValues,h=p.inlineValueTypes,f=p.blocks,d=p.inlineValues[0]}else if(s){var g=i.getDimensionInfo(a[0]);d=c=Sp(i,t,a[0]),h=g.type}else d=c=l?o[0]:o;var v=TP(e),m=v&&e.name||"",y=i.getName(t),_=r?m:y;return ii("section",{header:m,noHeader:r||!v,sortParam:d,blocks:[ii("nameValue",{markerType:"item",markerColor:u,name:_,noName:!no(_),value:c,valueType:h,dataIndex:t})].concat(f||[])})}function sre(n,e,t,r,i){var a=e.getData(),s=Yo(n,function(h,f,d){var p=a.getDimensionInfo(d);return h=h||p&&p.tooltip!==!1&&p.displayName!=null},!1),o=[],l=[],u=[];r.length?z(r,function(h){c(Sp(a,t,h),h)}):z(n,c);function c(h,f){var d=a.getDimensionInfo(f);!d||d.otherDims.tooltip===!1||(s?u.push(ii("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:h,valueType:d.type})):(o.push(h),l.push(d.type)))}return{inlineValues:o,inlineValueTypes:l,blocks:u}}var au=en();function By(n,e){return n.getName(e)||n.getId(e)}var z1="__universalTransitionEnabled",mS=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return e.prototype.init=function(t,r,i){this.seriesIndex=this.componentIndex,this.dataTask=sm({count:lre,reset:ure}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,i);var a=au(this).sourceManager=new uV(this);a.prepareSource();var s=this.getInitialData(t,i);AN(s,this),this.dataTask.context.data=s,au(this).dataBeforeProcessed=s,wN(this),this._initSelectedMapFromData(s)},e.prototype.mergeDefaultAndTheme=function(t,r){var i=$m(this),a=i?Jp(t):{},s=this.subType;sn.hasClass(s)&&(s+="Series"),It(t,r.getTheme().get(this.subType)),It(t,this.getDefaultOption()),of(t,"label",["show"]),this.fillDataTextStyle(t.data),i&&fc(t,a,i)},e.prototype.mergeOption=function(t,r){t=It(this.option,t,!0),this.fillDataTextStyle(t.data);var i=$m(this);i&&fc(this.option,t,i);var a=au(this).sourceManager;a.dirty(),a.prepareSource();var s=this.getInitialData(t,r);AN(s,this),this.dataTask.dirty(),this.dataTask.context.data=s,au(this).dataBeforeProcessed=s,wN(this),this._initSelectedMapFromData(s)},e.prototype.fillDataTextStyle=function(t){if(t&&!Pa(t))for(var r=["show"],i=0;i<t.length;i++)t[i]&&t[i].label&&of(t[i],"label",r)},e.prototype.getInitialData=function(t,r){},e.prototype.appendData=function(t){var r=this.getRawData();r.appendData(t.data)},e.prototype.getData=function(t){var r=uC(this);if(r){var i=r.context.data;return t==null||!i.getLinkedData?i:i.getLinkedData(t)}else return au(this).data},e.prototype.getAllData=function(){var t=this.getData();return t&&t.getLinkedDataAll?t.getLinkedDataAll():[{data:t}]},e.prototype.setData=function(t){var r=uC(this);if(r){var i=r.context;i.outputData=t,r!==this.dataTask&&(i.data=t)}au(this).data=t},e.prototype.getEncode=function(){var t=this.get("encode",!0);if(t)return st(t)},e.prototype.getSourceManager=function(){return au(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return au(this).dataBeforeProcessed},e.prototype.getColorBy=function(){var t=this.get("colorBy");return t||"series"},e.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},e.prototype.getBaseAxis=function(){var t=this.coordinateSystem;return t&&t.getBaseAxis&&t.getBaseAxis()},e.prototype.formatTooltip=function(t,r,i){return mV({series:this,dataIndex:t,multipleSeries:r})},e.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(on.node&&!(t&&t.ssr))return!1;var r=this.getShallow("animation");return r&&this.getData().count()>this.getShallow("animationThreshold")&&(r=!1),!!r},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,r,i){var a=this.ecModel,s=ZP.prototype.getColorFromPalette.call(this,t,r,i);return s||(s=a.getColorFromPalette(t,r,i)),s},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,r){this._innerSelect(this.getData(r),t)},e.prototype.unselect=function(t,r){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,s=this.getData(r);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var o=0;o<t.length;o++){var l=t[o],u=By(s,l);i[u]=!1,this._selectedDataIndicesMap[u]=-1}}},e.prototype.toggleSelect=function(t,r){for(var i=[],a=0;a<t.length;a++)i[0]=t[a],this.isSelected(t[a],r)?this.unselect(i,r):this.select(i,r)},e.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var t=this._selectedDataIndicesMap,r=Yt(t),i=[],a=0;a<r.length;a++){var s=t[r[a]];s>=0&&i.push(s)}return i},e.prototype.isSelected=function(t,r){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(r);return(i==="all"||i[By(a,t)])&&!a.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[z1])return!0;var t=this.option.universalTransition;return t?t===!0?!0:t&&t.enabled:!1},e.prototype._innerSelect=function(t,r){var i,a,s=this.option,o=s.selectedMode,l=r.length;if(!(!o||!l)){if(o==="series")s.selectedMap="all";else if(o==="multiple"){gt(s.selectedMap)||(s.selectedMap={});for(var u=s.selectedMap,c=0;c<l;c++){var h=r[c],f=By(t,h);u[f]=!0,this._selectedDataIndicesMap[f]=t.getRawIndex(h)}}else if(o==="single"||o===!0){var d=r[l-1],f=By(t,d);s.selectedMap=(i={},i[f]=!0,i),this._selectedDataIndicesMap=(a={},a[f]=t.getRawIndex(d),a)}}},e.prototype._initSelectedMapFromData=function(t){if(!this.option.selectedMap){var r=[];t.hasItemOption&&t.each(function(i){var a=t.getRawDataItem(i);a&&a.selected&&r.push(i)}),r.length>0&&this._innerSelect(t,r)}},e.registerClass=function(t){return sn.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}(sn);zr(mS,vS);zr(mS,ZP);MU(mS,sn);function wN(n){var e=n.name;TP(n)||(n.name=ore(n)||e)}function ore(n){var e=n.getRawData(),t=e.mapDimensionsAll("seriesName"),r=[];return z(t,function(i){var a=e.getDimensionInfo(i);a.displayName&&r.push(a.displayName)}),r.join(" ")}function lre(n){return n.model.getRawData().count()}function ure(n){var e=n.model;return e.setData(e.getRawData().cloneShallow()),cre}function cre(n,e){e.outputData&&n.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function AN(n,e){z(Nm(n.CHANGABLE_METHODS,n.DOWNSAMPLE_METHODS),function(t){n.wrapMethod(t,Rt(hre,e))})}function hre(n,e){var t=uC(n);return t&&t.setOutputEnd((e||this).count()),e}function uC(n){var e=(n.ecModel||{}).scheduler,t=e&&e.getPipeline(n.uid);if(t){var r=t.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(n.uid))}return r}}const rr=mS;var nL=function(){function n(){this.group=new bt,this.uid=Zp("viewComponent")}return n.prototype.init=function(e,t){},n.prototype.render=function(e,t,r,i){},n.prototype.dispose=function(e,t){},n.prototype.updateView=function(e,t,r,i){},n.prototype.updateLayout=function(e,t,r,i){},n.prototype.updateVisual=function(e,t,r,i){},n.prototype.toggleBlurSeries=function(e,t,r){},n.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},n}();EP(nL);Zb(nL);const fr=nL;function nv(){var n=en();return function(e){var t=n(e),r=e.pipelineContext,i=!!t.large,a=!!t.progressiveRender,s=t.large=!!(r&&r.large),o=t.progressiveRender=!!(r&&r.progressiveRender);return(i!==s||a!==o)&&"reset"}}var yV=en(),fre=nv(),rL=function(){function n(){this.group=new bt,this.uid=Zp("viewChart"),this.renderTask=sm({plan:dre,reset:pre}),this.renderTask.context={view:this}}return n.prototype.init=function(e,t){},n.prototype.render=function(e,t,r,i){},n.prototype.highlight=function(e,t,r,i){var a=e.getData(i&&i.dataType);a&&TN(a,i,"emphasis")},n.prototype.downplay=function(e,t,r,i){var a=e.getData(i&&i.dataType);a&&TN(a,i,"normal")},n.prototype.remove=function(e,t){this.group.removeAll()},n.prototype.dispose=function(e,t){},n.prototype.updateView=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.updateLayout=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.updateVisual=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.eachRendered=function(e){Sc(this.group,e)},n.markUpdateMethod=function(e,t){yV(e).updateMethod=t},n.protoInitialize=function(){var e=n.prototype;e.type="chart"}(),n}();function MN(n,e,t){n&&Vm(n)&&(e==="emphasis"?zl:Ul)(n,t)}function TN(n,e,t){var r=lf(n,e),i=e&&e.highlightKey!=null?Gee(e.highlightKey):null;r!=null?z(Cn(r),function(a){MN(n.getItemGraphicEl(a),t,i)}):n.eachItemGraphicEl(function(a){MN(a,t,i)})}EP(rL);Zb(rL);function dre(n){return fre(n.model)}function pre(n){var e=n.model,t=n.ecModel,r=n.api,i=n.payload,a=e.pipelineContext.progressiveRender,s=n.view,o=i&&yV(i).updateMethod,l=a?"incrementalPrepareRender":o&&s[o]?o:"render";return l!=="render"&&s[l](e,t,r,i),vre[l]}var vre={incrementalPrepareRender:{progress:function(n,e){e.view.incrementalRender(n,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(n,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};const $n=rL;var Dx="\0__throttleOriginMethod",CN="\0__throttleRate",EN="\0__throttleType";function yS(n,e,t){var r,i=0,a=0,s=null,o,l,u,c;e=e||0;function h(){a=new Date().getTime(),s=null,n.apply(l,u||[])}var f=function(){for(var d=[],p=0;p<arguments.length;p++)d[p]=arguments[p];r=new Date().getTime(),l=this,u=d;var g=c||e,v=c||t;c=null,o=r-(v?i:a)-g,clearTimeout(s),v?s=setTimeout(h,g):o>=0?h():s=setTimeout(h,-o),i=r};return f.clear=function(){s&&(clearTimeout(s),s=null)},f.debounceNextCall=function(d){c=d},f}function rv(n,e,t,r){var i=n[e];if(i){var a=i[Dx]||i,s=i[EN],o=i[CN];if(o!==t||s!==r){if(t==null||!r)return n[e]=a;i=n[e]=yS(a,t,r==="debounce"),i[Dx]=a,i[EN]=r,i[CN]=t}return i}}function qm(n,e){var t=n[e];t&&t[Dx]&&(t.clear&&t.clear(),n[e]=t[Dx])}var PN=en(),LN={itemStyle:uf(S7,!0),lineStyle:uf(b7,!0)},gre={lineStyle:"stroke",itemStyle:"fill"};function _V(n,e){var t=n.visualStyleMapper||LN[e];return t||(console.warn("Unknown style type '"+e+"'."),LN.itemStyle)}function xV(n,e){var t=n.visualDrawType||gre[e];return t||(console.warn("Unknown style type '"+e+"'."),"fill")}var mre={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){var t=n.getData(),r=n.visualStyleAccessPath||"itemStyle",i=n.getModel(r),a=_V(n,r),s=a(i),o=i.getShallow("decal");o&&(t.setVisual("decal",o),o.dirty=!0);var l=xV(n,r),u=s[l],c=ct(u)?u:null,h=s.fill==="auto"||s.stroke==="auto";if(!s[l]||c||h){var f=n.getColorFromPalette(n.name,null,e.getSeriesCount());s[l]||(s[l]=f,t.setVisual("colorFromPalette",!0)),s.fill=s.fill==="auto"||ct(s.fill)?f:s.fill,s.stroke=s.stroke==="auto"||ct(s.stroke)?f:s.stroke}if(t.setVisual("style",s),t.setVisual("drawType",l),!e.isSeriesFiltered(n)&&c)return t.setVisual("colorFromPalette",!1),{dataEach:function(d,p){var g=n.getDataParams(p),v=Pe({},s);v[l]=c(g),d.setItemVisual(p,"style",v)}}}},jv=new Wn,yre={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){if(!(n.ignoreStyleOnData||e.isSeriesFiltered(n))){var t=n.getData(),r=n.visualStyleAccessPath||"itemStyle",i=_V(n,r),a=t.getVisual("drawType");return{dataEach:t.hasItemOption?function(s,o){var l=s.getRawDataItem(o);if(l&&l[r]){jv.option=l[r];var u=i(jv),c=s.ensureUniqueItemVisual(o,"style");Pe(c,u),jv.option.decal&&(s.setItemVisual(o,"decal",jv.option.decal),jv.option.decal.dirty=!0),a in u&&s.setItemVisual(o,"colorFromPalette",!1)}}:null}}}},_re={performRawSeries:!0,overallReset:function(n){var e=st();n.eachSeries(function(t){var r=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+r,a=e.get(i);a||(a={},e.set(i,a)),PN(t).scope=a}}),n.eachSeries(function(t){if(!(t.isColorBySeries()||n.isSeriesFiltered(t))){var r=t.getRawData(),i={},a=t.getData(),s=PN(t).scope,o=t.visualStyleAccessPath||"itemStyle",l=xV(t,o);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),r.each(function(u){var c=i[u],h=a.getItemVisual(c,"colorFromPalette");if(h){var f=a.ensureUniqueItemVisual(c,"style"),d=r.getName(u)||u+"",p=r.count();f[l]=t.getColorFromPalette(d,s,p)}})}})}},Gy=Math.PI;function xre(n,e){e=e||{},dt(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 bt,r=new nn({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});t.add(r);var i=new ln({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 nn({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});t.add(a);var s;return e.showSpinner&&(s=new BP({shape:{startAngle:-Gy/2,endAngle:-Gy/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),s.animateShape(!0).when(1e3,{endAngle:Gy*3/2}).start("circularInOut"),s.animateShape(!0).when(1e3,{startAngle:Gy*3/2}).delay(300).start("circularInOut"),t.add(s)),t.resize=function(){var o=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(n.getWidth()-l*2-(e.showSpinner&&o?10:0)-o)/2-(e.showSpinner&&o?0:5+o/2)+(e.showSpinner?0:o/2)+(o?0:l),c=n.getHeight()/2;e.showSpinner&&s.setShape({cx:u,cy:c}),a.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),r.setShape({x:0,y:0,width:n.getWidth(),height:n.getHeight()})},t.resize(),t}var bre=function(){function n(e,t,r,i){this._stageTaskMap=st(),this.ecInstance=e,this.api=t,r=this._dataProcessorHandlers=r.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=r.concat(i)}return n.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(r){var i=r.overallTask;i&&i.dirty()})},n.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var r=this._pipelineMap.get(e.__pipeline.id),i=r.context,a=!t&&r.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>r.blockIndex,s=a?r.step:null,o=i&&i.modDataCount,l=o!=null?Math.ceil(o/s):null;return{step:s,modBy:l,modDataCount:o}}},n.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},n.prototype.updateStreamModes=function(e,t){var r=this._pipelineMap.get(e.uid),i=e.getData(),a=i.count(),s=r.progressiveEnabled&&t.incrementalPrepareRender&&a>=r.threshold,o=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=r.context={progressiveRender:s,modDataCount:l,large:o}},n.prototype.restorePipelines=function(e){var t=this,r=t._pipelineMap=st();e.eachSeries(function(i){var a=i.getProgressive(),s=i.uid;r.set(s,{id:s,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)})},n.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),r=this.api;z(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),s="";sa(!(i.reset&&i.overallReset),s),i.reset&&this._createSeriesStageTask(i,a,t,r),i.overallReset&&this._createOverallStageTask(i,a,t,r)},this)},n.prototype.prepareView=function(e,t,r,i){var a=e.renderTask,s=a.context;s.model=t,s.ecModel=r,s.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},n.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},n.prototype.performVisualTasks=function(e,t,r){this._performStageTasks(this._visualHandlers,e,t,r)},n.prototype._performStageTasks=function(e,t,r,i){i=i||{};var a=!1,s=this;z(e,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=s._stageTaskMap.get(l.uid),h=c.seriesTaskMap,f=c.overallTask;if(f){var d,p=f.agentStubMap;p.each(function(v){o(i,v)&&(v.dirty(),d=!0)}),d&&f.dirty(),s.updatePayload(f,r);var g=s.getPerformArgs(f,i.block);p.each(function(v){v.perform(g)}),f.perform(g)&&(a=!0)}else h&&h.each(function(v,m){o(i,v)&&v.dirty();var y=s.getPerformArgs(v,i.block);y.skip=!l.performRawSeries&&t.isSeriesFiltered(v.context.model),s.updatePayload(v,r),v.perform(y)&&(a=!0)})}});function o(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},n.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(r){t=r.dataTask.perform()||t}),this.unfinished=t||this.unfinished},n.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)})},n.prototype.updatePayload=function(e,t){t!=="remain"&&(e.context.payload=t)},n.prototype._createSeriesStageTask=function(e,t,r,i){var a=this,s=t.seriesTaskMap,o=t.seriesTaskMap=st(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?r.eachRawSeries(c):l?r.eachRawSeriesByType(l,c):u&&u(r,i).each(c);function c(h){var f=h.uid,d=o.set(f,s&&s.get(f)||sm({plan:Tre,reset:Cre,count:Pre}));d.context={model:h,ecModel:r,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(h,d)}},n.prototype._createOverallStageTask=function(e,t,r,i){var a=this,s=t.overallTask=t.overallTask||sm({reset:Sre});s.context={ecModel:r,api:i,overallReset:e.overallReset,scheduler:a};var o=s.agentStubMap,l=s.agentStubMap=st(),u=e.seriesType,c=e.getTargetSeries,h=!0,f=!1,d="";sa(!e.createOnAllSeries,d),u?r.eachRawSeriesByType(u,p):c?c(r,i).each(p):(h=!1,z(r.getSeries(),p));function p(g){var v=g.uid,m=l.set(v,o&&o.get(v)||(f=!0,sm({reset:wre,onDirty:Mre})));m.context={model:g,overallProgress:h},m.agent=s,m.__block=h,a._pipe(g,m)}f&&s.dirty()},n.prototype._pipe=function(e,t){var r=e.uid,i=this._pipelineMap.get(r);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},n.wrapStageHandler=function(e,t){return ct(e)&&(e={overallReset:e,seriesType:Lre(e)}),e.uid=Zp("stageHandler"),t&&(e.visualType=t),e},n}();function Sre(n){n.overallReset(n.ecModel,n.api,n.payload)}function wre(n){return n.overallProgress&&Are}function Are(){this.agent.dirty(),this.getDownstream().dirty()}function Mre(){this.agent&&this.agent.dirty()}function Tre(n){return n.plan?n.plan(n.model,n.ecModel,n.api,n.payload):null}function Cre(n){n.useClearVisual&&n.data.clearAllVisual();var e=n.resetDefines=Cn(n.reset(n.model,n.ecModel,n.api,n.payload));return e.length>1?Ne(e,function(t,r){return bV(r)}):Ere}var Ere=bV(0);function bV(n){return function(e,t){var r=t.data,i=t.resetDefines[n];if(i&&i.dataEach)for(var a=e.start;a<e.end;a++)i.dataEach(r,a);else i&&i.progress&&i.progress(e,r)}}function Pre(n){return n.data.count()}function Lre(n){Ix=null;try{n(Xm,SV)}catch(e){}return Ix}var Xm={},SV={},Ix;wV(Xm,q7);wV(SV,X7);Xm.eachSeriesByType=Xm.eachRawSeriesByType=function(n){Ix=n};Xm.eachComponent=function(n){n.mainType==="series"&&n.subType&&(Ix=n.subType)};function wV(n,e){for(var t in e.prototype)n[t]=Er}const AV=bre;var RN=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const Rre={color:RN,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],RN]};var Ni="#B9B8CE",DN="#100C2A",zy=function(){return{axisLine:{lineStyle:{color:Ni}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},IN=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],MV={darkMode:!0,color:IN,backgroundColor:DN,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:Ni},pageTextStyle:{color:Ni}},textStyle:{color:Ni},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:Ni}},dataZoom:{borderColor:"#71708A",textStyle:{color:Ni},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:Ni}},timeline:{lineStyle:{color:Ni},label:{color:Ni},controlStyle:{color:Ni,borderColor:Ni}},calendar:{itemStyle:{color:DN},dayLabel:{color:Ni},monthLabel:{color:Ni},yearLabel:{color:Ni}},timeAxis:zy(),logAxis:zy(),valueAxis:zy(),categoryAxis:zy(),line:{symbol:"circle"},graph:{color:IN},gauge:{title:{color:Ni},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:Ni},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};MV.categoryAxis.splitLine.show=!1;const Dre=MV;var Ire=function(){function n(){}return n.prototype.normalizeQuery=function(e){var t={},r={},i={};if(Ke(e)){var a=zo(e);t.mainType=a.main||null,t.subType=a.sub||null}else{var s=["Index","Name","Id"],o={name:1,dataIndex:1,dataType:1};z(e,function(l,u){for(var c=!1,h=0;h<s.length;h++){var f=s[h],d=u.lastIndexOf(f);if(d>0&&d===u.length-f.length){var p=u.slice(0,d);p!=="data"&&(t.mainType=p,t[f.toLowerCase()]=l,c=!0)}}o.hasOwnProperty(u)&&(r[u]=l,c=!0),c||(i[u]=l)})}return{cptQuery:t,dataQuery:r,otherQuery:i}},n.prototype.filter=function(e,t){var r=this.eventInfo;if(!r)return!0;var i=r.targetEl,a=r.packedEvent,s=r.model,o=r.view;if(!s||!o)return!0;var l=t.cptQuery,u=t.dataQuery;return c(l,s,"mainType")&&c(l,s,"subType")&&c(l,s,"index","componentIndex")&&c(l,s,"name")&&c(l,s,"id")&&c(u,a,"name")&&c(u,a,"dataIndex")&&c(u,a,"dataType")&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,i,a));function c(h,f,d,p){return h[d]==null||f[p||d]===h[d]}},n.prototype.afterTrigger=function(){this.eventInfo=null},n}(),cC=["symbol","symbolSize","symbolRotate","symbolOffset"],NN=cC.concat(["symbolKeepAspect"]),Nre={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){var t=n.getData();if(n.legendIcon&&t.setVisual("legendIcon",n.legendIcon),!n.hasSymbolVisual)return;for(var r={},i={},a=!1,s=0;s<cC.length;s++){var o=cC[s],l=n.get(o);ct(l)?(a=!0,i[o]=l):r[o]=l}if(r.symbol=r.symbol||n.defaultSymbol,t.setVisual(Pe({legendIcon:n.legendIcon||r.symbol,symbolKeepAspect:n.get("symbolKeepAspect")},r)),e.isSeriesFiltered(n))return;var u=Yt(i);function c(h,f){for(var d=n.getRawValue(f),p=n.getDataParams(f),g=0;g<u.length;g++){var v=u[g];h.setItemVisual(f,v,i[v](d,p))}}return{dataEach:a?c:null}}},kre={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){if(!n.hasSymbolVisual||e.isSeriesFiltered(n))return;var t=n.getData();function r(i,a){for(var s=i.getItemModel(a),o=0;o<NN.length;o++){var l=NN[o],u=s.getShallow(l,!0);u!=null&&i.setItemVisual(a,l,u)}}return{dataEach:t.hasItemOption?r:null}}};function iL(n,e,t){switch(t){case"color":var r=n.getItemVisual(e,"style");return r[n.getVisual("drawType")];case"opacity":return n.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return n.getItemVisual(e,t)}}function O0(n,e){switch(e){case"color":var t=n.getVisual("style");return t[n.getVisual("drawType")];case"opacity":return n.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return n.getVisual(e)}}function TV(n,e,t,r){switch(t){case"color":var i=n.ensureUniqueItemVisual(e,"style");i[n.getVisual("drawType")]=r,n.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":n.ensureUniqueItemVisual(e,"style").opacity=r;break;case"symbol":case"symbolSize":case"liftZ":n.setItemVisual(e,t,r);break}}function CV(n,e){function t(r,i){var a=[];return r.eachComponent({mainType:"series",subType:n,query:i},function(s){a.push(s.seriesIndex)}),a}z([[n+"ToggleSelect","toggleSelect"],[n+"Select","select"],[n+"UnSelect","unselect"]],function(r){e(r[0],function(i,a,s){i=Pe({},i),s.dispatchAction(Pe(i,{type:r[1],seriesIndex:t(a,i)}))})})}function $f(n,e,t,r,i){var a=n+e;t.isSilent(a)||r.eachComponent({mainType:"series",subType:"pie"},function(s){for(var o=s.seriesIndex,l=s.option.selectedMap,u=i.selected,c=0;c<u.length;c++)if(u[c].seriesIndex===o){var h=s.getData(),f=lf(h,i.fromActionPayload);t.trigger(a,{type:a,seriesId:s.id,name:Ie(f)?h.getName(f[0]):h.getName(f),selected:Ke(l)?l:Pe({},l)})}})}function Ore(n,e,t){n.on("selectchanged",function(r){var i=t.getModel();r.isFromClick?($f("map","selectchanged",e,i,r),$f("pie","selectchanged",e,i,r)):r.fromAction==="select"?($f("map","selected",e,i,r),$f("pie","selected",e,i,r)):r.fromAction==="unselect"&&($f("map","unselected",e,i,r),$f("pie","unselected",e,i,r))})}function Rh(n,e,t){for(var r;n&&!(e(n)&&(r=n,t));)n=n.__hostTarget||n.parent;return r}var Fre=Math.round(Math.random()*9),Bre=typeof Object.defineProperty=="function",Gre=function(){function n(){this._id="__ec_inner_"+Fre++}return n.prototype.get=function(e){return this._guard(e)[this._id]},n.prototype.set=function(e,t){var r=this._guard(e);return Bre?Object.defineProperty(r,this._id,{value:t,enumerable:!1,configurable:!0}):r[this._id]=t,this},n.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},n.prototype.has=function(e){return!!this._guard(e)[this._id]},n.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},n}();const zre=Gre;var Ure=Ht.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(n,e){var t=e.cx,r=e.cy,i=e.width/2,a=e.height/2;n.moveTo(t,r-a),n.lineTo(t+i,r+a),n.lineTo(t-i,r+a),n.closePath()}}),Vre=Ht.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(n,e){var t=e.cx,r=e.cy,i=e.width/2,a=e.height/2;n.moveTo(t,r-a),n.lineTo(t+i,r),n.lineTo(t,r+a),n.lineTo(t-i,r),n.closePath()}}),Hre=Ht.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(n,e){var t=e.x,r=e.y,i=e.width/5*3,a=Math.max(i,e.height),s=i/2,o=s*s/(a-s),l=r-a+s+o,u=Math.asin(o/s),c=Math.cos(u)*s,h=Math.sin(u),f=Math.cos(u),d=s*.6,p=s*.7;n.moveTo(t-c,l+o),n.arc(t,l,s,Math.PI-u,Math.PI*2+u),n.bezierCurveTo(t+c-h*d,l+o+f*d,t,r-p,t,r),n.bezierCurveTo(t,r-p,t-c+h*d,l+o+f*d,t-c,l+o),n.closePath()}}),Wre=Ht.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(n,e){var t=e.height,r=e.width,i=e.x,a=e.y,s=r/3*2;n.moveTo(i,a),n.lineTo(i+s,a+t),n.lineTo(i,a+t/4*3),n.lineTo(i-s,a+t),n.lineTo(i,a),n.closePath()}}),$re={line:pi,rect:nn,roundRect:nn,square:nn,circle:bc,diamond:Vre,pin:Hre,arrow:Wre,triangle:Ure},jre={line:function(n,e,t,r,i){i.x1=n,i.y1=e+r/2,i.x2=n+t,i.y2=e+r/2},rect:function(n,e,t,r,i){i.x=n,i.y=e,i.width=t,i.height=r},roundRect:function(n,e,t,r,i){i.x=n,i.y=e,i.width=t,i.height=r,i.r=Math.min(t,r)/4},square:function(n,e,t,r,i){var a=Math.min(t,r);i.x=n,i.y=e,i.width=a,i.height=a},circle:function(n,e,t,r,i){i.cx=n+t/2,i.cy=e+r/2,i.r=Math.min(t,r)/2},diamond:function(n,e,t,r,i){i.cx=n+t/2,i.cy=e+r/2,i.width=t,i.height=r},pin:function(n,e,t,r,i){i.x=n+t/2,i.y=e+r/2,i.width=t,i.height=r},arrow:function(n,e,t,r,i){i.x=n+t/2,i.y=e+r/2,i.width=t,i.height=r},triangle:function(n,e,t,r,i){i.cx=n+t/2,i.cy=e+r/2,i.width=t,i.height=r}},Nx={};z($re,function(n,e){Nx[e]=new n});var qre=Ht.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(n,e,t){var r=Sx(n,e,t),i=this.shape;return i&&i.symbolType==="pin"&&e.position==="inside"&&(r.y=t.y+t.height*.4),r},buildPath:function(n,e,t){var r=e.symbolType;if(r!=="none"){var i=Nx[r];i||(r="rect",i=Nx[r]),jre[r](e.x,e.y,e.width,e.height,i.shape),i.buildPath(n,i.shape,t)}}});function Xre(n,e){if(this.type!=="image"){var t=this.style;this.__isEmptyBrush?(t.stroke=n,t.fill=e||"#fff",t.lineWidth=2):this.shape.symbolType==="line"?t.stroke=n:t.fill=n,this.markRedraw()}}function Br(n,e,t,r,i,a,s){var o=n.indexOf("empty")===0;o&&(n=n.substr(5,1).toLowerCase()+n.substr(6));var l;return n.indexOf("image://")===0?l=d7(n.slice(8),new Ot(e,t,r,i),s?"center":"cover"):n.indexOf("path://")===0?l=aS(n.slice(7),{},new Ot(e,t,r,i),s?"center":"cover"):l=new qre({shape:{symbolType:n,x:e,y:t,width:r,height:i}}),l.__isEmptyBrush=o,l.setColor=Xre,a&&l.setColor(a),l}function iv(n){return Ie(n)||(n=[+n,+n]),[n[0]||0,n[1]||0]}function Tf(n,e){if(n!=null)return Ie(n)||(n=[n,n]),[Xe(n[0],e[0])||0,Xe(Et(n[1],n[0]),e[1])||0]}function Dh(n){return isFinite(n)}function Yre(n,e,t){var r=e.x==null?0:e.x,i=e.x2==null?1:e.x2,a=e.y==null?0:e.y,s=e.y2==null?0:e.y2;e.global||(r=r*t.width+t.x,i=i*t.width+t.x,a=a*t.height+t.y,s=s*t.height+t.y),r=Dh(r)?r:0,i=Dh(i)?i:1,a=Dh(a)?a:0,s=Dh(s)?s:0;var o=n.createLinearGradient(r,a,i,s);return o}function Kre(n,e,t){var r=t.width,i=t.height,a=Math.min(r,i),s=e.x==null?.5:e.x,o=e.y==null?.5:e.y,l=e.r==null?.5:e.r;e.global||(s=s*r+t.x,o=o*i+t.y,l=l*a),s=Dh(s)?s:.5,o=Dh(o)?o:.5,l=l>=0&&Dh(l)?l:.5;var u=n.createRadialGradient(s,o,0,s,o,l);return u}function hC(n,e,t){for(var r=e.type==="radial"?Kre(n,e,t):Yre(n,e,t),i=e.colorStops,a=0;a<i.length;a++)r.addColorStop(i[a].offset,i[a].color);return r}function Zre(n,e){if(n===e||!n&&!e)return!1;if(!n||!e||n.length!==e.length)return!0;for(var t=0;t<n.length;t++)if(n[t]!==e[t])return!0;return!1}function Uy(n){return parseInt(n,10)}function zd(n,e,t){var r=["width","height"][e],i=["clientWidth","clientHeight"][e],a=["paddingLeft","paddingTop"][e],s=["paddingRight","paddingBottom"][e];if(t[r]!=null&&t[r]!=="auto")return parseFloat(t[r]);var o=document.defaultView.getComputedStyle(n);return(n[i]||Uy(o[r])||Uy(n.style[r]))-(Uy(o[a])||0)-(Uy(o[s])||0)|0}function Qre(n,e){return!n||n==="solid"||!(e>0)?null:n==="dashed"?[4*e,2*e]:n==="dotted"?[e]:un(n)?[n]:Ie(n)?n:null}function aL(n){var e=n.style,t=e.lineDash&&e.lineWidth>0&&Qre(e.lineDash,e.lineWidth),r=e.lineDashOffset;if(t){var i=e.strokeNoScale&&n.getLineScale?n.getLineScale():1;i&&i!==1&&(t=Ne(t,function(a){return a/i}),r/=i)}return[t,r]}var Jre=new Jo(!0);function kx(n){var e=n.stroke;return!(e==null||e==="none"||!(n.lineWidth>0))}function kN(n){return typeof n=="string"&&n!=="none"}function Ox(n){var e=n.fill;return e!=null&&e!=="none"}function ON(n,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var t=n.globalAlpha;n.globalAlpha=e.fillOpacity*e.opacity,n.fill(),n.globalAlpha=t}else n.fill()}function FN(n,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var t=n.globalAlpha;n.globalAlpha=e.strokeOpacity*e.opacity,n.stroke(),n.globalAlpha=t}else n.stroke()}function fC(n,e,t){var r=PP(e.image,e.__image,t);if(Qb(r)){var i=n.createPattern(r,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)*T1),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function eie(n,e,t,r){var i,a=kx(t),s=Ox(t),o=t.strokePercent,l=o<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var c=e.path||Jre,h=e.__dirty;if(!r){var f=t.fill,d=t.stroke,p=s&&!!f.colorStops,g=a&&!!d.colorStops,v=s&&!!f.image,m=a&&!!d.image,y=void 0,_=void 0,x=void 0,b=void 0,S=void 0;(p||g)&&(S=e.getBoundingRect()),p&&(y=h?hC(n,f,S):e.__canvasFillGradient,e.__canvasFillGradient=y),g&&(_=h?hC(n,d,S):e.__canvasStrokeGradient,e.__canvasStrokeGradient=_),v&&(x=h||!e.__canvasFillPattern?fC(n,f,e):e.__canvasFillPattern,e.__canvasFillPattern=x),m&&(b=h||!e.__canvasStrokePattern?fC(n,d,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),p?n.fillStyle=y:v&&(x?n.fillStyle=x:s=!1),g?n.strokeStyle=_:m&&(b?n.strokeStyle=b:a=!1)}var w=e.getGlobalScale();c.setScale(w[0],w[1],e.segmentIgnoreThreshold);var T,C;n.setLineDash&&t.lineDash&&(i=aL(e),T=i[0],C=i[1]);var A=!0;(u||h&Cd)&&(c.setDPR(n.dpr),l?c.setContext(null):(c.setContext(n),A=!1),c.reset(),e.buildPath(c,e.shape,r),c.toStatic(),e.pathUpdated()),A&&c.rebuildPath(n,l?o:1),T&&(n.setLineDash(T),n.lineDashOffset=C),r||(t.strokeFirst?(a&&FN(n,t),s&&ON(n,t)):(s&&ON(n,t),a&&FN(n,t))),T&&n.setLineDash([])}function tie(n,e,t){var r=e.__image=PP(t.image,e.__image,e,e.onload);if(!(!r||!Qb(r))){var i=t.x||0,a=t.y||0,s=e.getWidth(),o=e.getHeight(),l=r.width/r.height;if(s==null&&o!=null?s=o*l:o==null&&s!=null?o=s/l:s==null&&o==null&&(s=r.width,o=r.height),t.sWidth&&t.sHeight){var u=t.sx||0,c=t.sy||0;n.drawImage(r,u,c,t.sWidth,t.sHeight,i,a,s,o)}else if(t.sx&&t.sy){var u=t.sx,c=t.sy,h=s-u,f=o-c;n.drawImage(r,u,c,h,f,i,a,s,o)}else n.drawImage(r,i,a,s,o)}}function nie(n,e,t){var r,i=t.text;if(i!=null&&(i+=""),i){n.font=t.font||lc,n.textAlign=t.textAlign,n.textBaseline=t.textBaseline;var a=void 0,s=void 0;n.setLineDash&&t.lineDash&&(r=aL(e),a=r[0],s=r[1]),a&&(n.setLineDash(a),n.lineDashOffset=s),t.strokeFirst?(kx(t)&&n.strokeText(i,t.x,t.y),Ox(t)&&n.fillText(i,t.x,t.y)):(Ox(t)&&n.fillText(i,t.x,t.y),kx(t)&&n.strokeText(i,t.x,t.y)),a&&n.setLineDash([])}}var BN=["shadowBlur","shadowOffsetX","shadowOffsetY"],GN=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function EV(n,e,t,r,i){var a=!1;if(!r&&(t=t||{},e===t))return!1;if(r||e.opacity!==t.opacity){ma(n,i),a=!0;var s=Math.max(Math.min(e.opacity,1),0);n.globalAlpha=isNaN(s)?Wh.opacity:s}(r||e.blend!==t.blend)&&(a||(ma(n,i),a=!0),n.globalCompositeOperation=e.blend||Wh.blend);for(var o=0;o<BN.length;o++){var l=BN[o];(r||e[l]!==t[l])&&(a||(ma(n,i),a=!0),n[l]=n.dpr*(e[l]||0))}return(r||e.shadowColor!==t.shadowColor)&&(a||(ma(n,i),a=!0),n.shadowColor=e.shadowColor||Wh.shadowColor),a}function zN(n,e,t,r,i){var a=Ym(e,i.inHover),s=r?null:t&&Ym(t,i.inHover)||{};if(a===s)return!1;var o=EV(n,a,s,r,i);if((r||a.fill!==s.fill)&&(o||(ma(n,i),o=!0),kN(a.fill)&&(n.fillStyle=a.fill)),(r||a.stroke!==s.stroke)&&(o||(ma(n,i),o=!0),kN(a.stroke)&&(n.strokeStyle=a.stroke)),(r||a.opacity!==s.opacity)&&(o||(ma(n,i),o=!0),n.globalAlpha=a.opacity==null?1:a.opacity),e.hasStroke()){var l=a.lineWidth,u=l/(a.strokeNoScale&&e.getLineScale?e.getLineScale():1);n.lineWidth!==u&&(o||(ma(n,i),o=!0),n.lineWidth=u)}for(var c=0;c<GN.length;c++){var h=GN[c],f=h[0];(r||a[f]!==s[f])&&(o||(ma(n,i),o=!0),n[f]=a[f]||h[1])}return o}function rie(n,e,t,r,i){return EV(n,Ym(e,i.inHover),t&&Ym(t,i.inHover),r,i)}function PV(n,e){var t=e.transform,r=n.dpr||1;t?n.setTransform(r*t[0],r*t[1],r*t[2],r*t[3],r*t[4],r*t[5]):n.setTransform(r,0,0,r,0,0)}function iie(n,e,t){for(var r=!1,i=0;i<n.length;i++){var a=n[i];r=r||a.isZeroArea(),PV(e,a),e.beginPath(),a.buildPath(e,a.shape),e.clip()}t.allClipped=r}function aie(n,e){return n&&e?n[0]!==e[0]||n[1]!==e[1]||n[2]!==e[2]||n[3]!==e[3]||n[4]!==e[4]||n[5]!==e[5]:!(!n&&!e)}var UN=1,VN=2,HN=3,WN=4;function sie(n){var e=Ox(n),t=kx(n);return!(n.lineDash||!(+e^+t)||e&&typeof n.fill!="string"||t&&typeof n.stroke!="string"||n.strokePercent<1||n.strokeOpacity<1||n.fillOpacity<1)}function ma(n,e){e.batchFill&&n.fill(),e.batchStroke&&n.stroke(),e.batchFill="",e.batchStroke=""}function Ym(n,e){return e&&n.__hoverStyle||n.style}function LV(n,e){Ih(n,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function Ih(n,e,t,r){var i=e.transform;if(!e.shouldBePainted(t.viewWidth,t.viewHeight,!1,!1)){e.__dirty&=~Wa,e.__isRendered=!1;return}var a=e.__clipPaths,s=t.prevElClipPaths,o=!1,l=!1;if((!s||Zre(a,s))&&(s&&s.length&&(ma(n,t),n.restore(),l=o=!0,t.prevElClipPaths=null,t.allClipped=!1,t.prevEl=null),a&&a.length&&(ma(n,t),n.save(),iie(a,n,t),o=!0),t.prevElClipPaths=a),t.allClipped){e.__isRendered=!1;return}e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var u=t.prevEl;u||(l=o=!0);var c=e instanceof Ht&&e.autoBatch&&sie(e.style);o||aie(i,u.transform)?(ma(n,t),PV(n,e)):c||ma(n,t);var h=Ym(e,t.inHover);e instanceof Ht?(t.lastDrawType!==UN&&(l=!0,t.lastDrawType=UN),zN(n,e,u,l,t),(!c||!t.batchFill&&!t.batchStroke)&&n.beginPath(),eie(n,e,h,c),c&&(t.batchFill=h.fill||"",t.batchStroke=h.stroke||"")):e instanceof zm?(t.lastDrawType!==HN&&(l=!0,t.lastDrawType=HN),zN(n,e,u,l,t),nie(n,e,h)):e instanceof Pi?(t.lastDrawType!==VN&&(l=!0,t.lastDrawType=VN),rie(n,e,u,l,t),tie(n,e,h)):e.getTemporalDisplayables&&(t.lastDrawType!==WN&&(l=!0,t.lastDrawType=WN),oie(n,e,t)),c&&r&&ma(n,t),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),t.prevEl=e,e.__dirty=0,e.__isRendered=!0}function oie(n,e,t){var r=e.getDisplayables(),i=e.getTemporalDisplayables();n.save();var a={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:t.viewWidth,viewHeight:t.viewHeight,inHover:t.inHover},s,o;for(s=e.getCursor(),o=r.length;s<o;s++){var l=r[s];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),Ih(n,l,a,s===o-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}for(var u=0,c=i.length;u<c;u++){var l=i[u];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),Ih(n,l,a,u===c-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,n.restore()}var xA=new zre,$N=new P0(100),jN=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function wp(n,e){if(n==="none")return null;var t=e.getDevicePixelRatio(),r=e.getZr(),i=r.painter.type==="svg";n.dirty&&xA.delete(n);var a=xA.get(n);if(a)return a;var s=dt(n,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});s.backgroundColor==="none"&&(s.backgroundColor=null);var o={repeat:"repeat"};return l(o),o.rotation=s.rotation,o.scaleX=o.scaleY=i?1:1/t,xA.set(n,o),n.dirty=!1,o;function l(u){for(var c=[t],h=!0,f=0;f<jN.length;++f){var d=s[jN[f]];if(d!=null&&!Ie(d)&&!Ke(d)&&!un(d)&&typeof d!="boolean"){h=!1;break}c.push(d)}var p;if(h){p=c.join(",")+(i?"-svg":"");var g=$N.get(p);g&&(i?u.svgElement=g:u.image=g)}var v=DV(s.dashArrayX),m=lie(s.dashArrayY),y=RV(s.symbol),_=uie(v),x=IV(m),b=!i&&uc.createCanvas(),S=i&&{tag:"g",attrs:{},key:"dcl",children:[]},w=C(),T;b&&(b.width=w.width*t,b.height=w.height*t,T=b.getContext("2d")),A(),h&&$N.put(p,b||S),u.image=b,u.svgElement=S,u.svgWidth=w.width,u.svgHeight=w.height;function C(){for(var M=1,P=0,D=_.length;P<D;++P)M=uI(M,_[P]);for(var L=1,P=0,D=y.length;P<D;++P)L=uI(L,y[P].length);M*=L;var R=x*_.length*y.length;return{width:Math.max(1,Math.min(M,s.maxTileWidth)),height:Math.max(1,Math.min(R,s.maxTileHeight))}}function A(){T&&(T.clearRect(0,0,b.width,b.height),s.backgroundColor&&(T.fillStyle=s.backgroundColor,T.fillRect(0,0,b.width,b.height)));for(var M=0,P=0;P<m.length;++P)M+=m[P];if(M<=0)return;for(var D=-x,L=0,R=0,N=0;D<w.height;){if(L%2===0){for(var F=R/2%y.length,O=0,H=0,U=0;O<w.width*2;){for(var $=0,P=0;P<v[N].length;++P)$+=v[N][P];if($<=0)break;if(H%2===0){var Y=(1-s.symbolSize)*.5,oe=O+v[N][H]*Y,X=D+m[L]*Y,re=v[N][H]*s.symbolSize,_e=m[L]*s.symbolSize,Fe=U/2%y[F].length;Ce(oe,X,re,_e,y[F][Fe])}O+=v[N][H],++U,++H,H===v[N].length&&(H=0)}++N,N===v.length&&(N=0)}D+=m[L],++R,++L,L===m.length&&(L=0)}function Ce(Ae,ze,fe,j,xe){var pe=i?1:t,we=Br(xe,Ae*pe,ze*pe,fe*pe,j*pe,s.color,s.symbolKeepAspect);if(i){var V=r.painter.renderOneToVNode(we);V&&S.children.push(V)}else LV(T,we)}}}}function RV(n){if(!n||n.length===0)return[["rect"]];if(Ke(n))return[[n]];for(var e=!0,t=0;t<n.length;++t)if(!Ke(n[t])){e=!1;break}if(e)return RV([n]);for(var r=[],t=0;t<n.length;++t)Ke(n[t])?r.push([n[t]]):r.push(n[t]);return r}function DV(n){if(!n||n.length===0)return[[0,0]];if(un(n)){var e=Math.ceil(n);return[[e,e]]}for(var t=!0,r=0;r<n.length;++r)if(!un(n[r])){t=!1;break}if(t)return DV([n]);for(var i=[],r=0;r<n.length;++r)if(un(n[r])){var e=Math.ceil(n[r]);i.push([e,e])}else{var e=Ne(n[r],function(o){return Math.ceil(o)});e.length%2===1?i.push(e.concat(e)):i.push(e)}return i}function lie(n){if(!n||typeof n=="object"&&n.length===0)return[0,0];if(un(n)){var e=Math.ceil(n);return[e,e]}var t=Ne(n,function(r){return Math.ceil(r)});return n.length%2?t.concat(t):t}function uie(n){return Ne(n,function(e){return IV(e)})}function IV(n){for(var e=0,t=0;t<n.length;++t)e+=n[t];return n.length%2===1?e*2:e}function cie(n,e){n.eachRawSeries(function(t){if(!n.isSeriesFiltered(t)){var r=t.getData();r.hasItemVisual()&&r.each(function(s){var o=r.getItemVisual(s,"decal");if(o){var l=r.ensureUniqueItemVisual(s,"style");l.decal=wp(o,e)}});var i=r.getVisual("decal");if(i){var a=r.getVisual("style");a.decal=wp(i,e)}}})}var hie=new Bs;const Zs=hie;var NV={};function fie(n,e){NV[n]=e}function die(n){return NV[n]}var pie=1,vie=800,gie=900,mie=1e3,yie=2e3,_ie=5e3,kV=1e3,xie=1100,sL=2e3,OV=3e3,bie=4e3,_S=4500,Sie=4600,wie=5e3,Aie=6e3,FV=7e3,Mie={PROCESSOR:{FILTER:mie,SERIES_FILTER:vie,STATISTIC:_ie},VISUAL:{LAYOUT:kV,PROGRESSIVE_LAYOUT:xie,GLOBAL:sL,CHART:OV,POST_CHART_LAYOUT:Sie,COMPONENT:bie,BRUSH:wie,CHART_ITEM:_S,ARIA:Aie,DECAL:FV}},Ri="__flagInMainProcess",ca="__pendingUpdate",bA="__needsUpdateStatus",qN=/^[a-zA-Z0-9_]+$/,SA="__connectUpdateStatus",XN=0,Tie=1,Cie=2;function BV(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.isDisposed()){this.id;return}return zV(this,n,e)}}function GV(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zV(this,n,e)}}function zV(n,e,t){return t[0]=t[0]&&t[0].toLowerCase(),Bs.prototype[e].apply(n,t)}var UV=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(Bs),VV=UV.prototype;VV.on=GV("on");VV.off=GV("off");var jf,wA,Vy,su,AA,MA,TA,qv,Xv,YN,KN,CA,ZN,Hy,QN,HV,as,JN,WV=function(n){ve(e,n);function e(t,r,i){var a=n.call(this,new Ire)||this;a._chartsViews=[],a._chartsMap={},a._componentsViews=[],a._componentsMap={},a._pendingActions=[],i=i||{},Ke(r)&&(r=$V[r]),a._dom=t;var s="canvas",o="auto",l=!1;i.ssr&&sJ(function(f){var d=St(f),p=d.dataIndex;if(p!=null){var g=st();return g.set("series_index",d.seriesIndex),g.set("data_index",p),d.ssrType&&g.set("ssr_type",d.ssrType),g}});var u=a._zr=aI(t,{renderer:i.renderer||s,devicePixelRatio:i.devicePixelRatio,width:i.width,height:i.height,ssr:i.ssr,useDirtyRect:Et(i.useDirtyRect,l),useCoarsePointer:Et(i.useCoarsePointer,o),pointerSize:i.pointerSize});a._ssr=i.ssr,a._throttledZrFlush=yS(Qe(u.flush,u),17),r=yt(r),r&&K7(r,!0),a._theme=r,a._locale=Gte(i.locale||w7),a._coordSysMgr=new k0;var c=a._api=QN(a);function h(f,d){return f.__prio-d.__prio}return P1(Bx,h),P1(dC,h),a._scheduler=new AV(a,c,dC,Bx),a._messageCenter=new UV,a._initEvents(),a.resize=Qe(a.resize,a),u.animation.on("frame",a._onframe,a),YN(u,a),KN(u,a),vx(a),a}return e.prototype._onframe=function(){if(!this._disposed){JN(this);var t=this._scheduler;if(this[ca]){var r=this[ca].silent;this[Ri]=!0;try{jf(this),su.update.call(this,null,this[ca].updateParams)}catch(l){throw this[Ri]=!1,this[ca]=null,l}this._zr.flush(),this[Ri]=!1,this[ca]=null,qv.call(this,r),Xv.call(this,r)}else if(t.unfinished){var i=pie,a=this._model,s=this._api;t.unfinished=!1;do{var o=+new Date;t.performSeriesTasks(a),t.performDataProcessorTasks(a),MA(this,a),t.performVisualTasks(a),Hy(this,this._model,s,"remain",{}),i-=+new Date-o}while(i>0&&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,r,i){if(!this[Ri]){if(this._disposed){this.id;return}var a,s,o;if(gt(r)&&(i=r.lazyUpdate,a=r.silent,s=r.replaceMerge,o=r.transition,r=r.notMerge),this[Ri]=!0,!this._model||r){var l=new mne(this._api),u=this._theme,c=this._model=new q7;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(t,{replaceMerge:s},pC);var h={seriesTransition:o,optionChanged:!0};if(i)this[ca]={silent:a,updateParams:h},this[Ri]=!1,this.getZr().wakeUp();else{try{jf(this),su.update.call(this,null,h)}catch(f){throw this[ca]=null,this[Ri]=!1,f}this._ssr||this._zr.flush(),this[ca]=null,this[Ri]=!1,qv.call(this,a),Xv.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||on.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var r=this._zr.painter;return r.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var r=this._zr.painter;return r.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(on.svgSupported){var t=this._zr,r=t.storage.getDisplayList();return z(r,function(i){i.stopAnimation(null,!0)}),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(this._disposed){this.id;return}t=t||{};var r=t.excludeComponents,i=this._model,a=[],s=this;z(r,function(l){i.eachComponent({mainType:l},function(u){var c=s._componentsMap[u.__viewId];c.group.ignore||(a.push(c),c.group.ignore=!0)})});var o=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return z(a,function(l){l.group.ignore=!1}),o},e.prototype.getConnectedDataURL=function(t){if(this._disposed){this.id;return}var r=t.type==="svg",i=this.group,a=Math.min,s=Math.max,o=1/0;if(e4[i]){var l=o,u=o,c=-o,h=-o,f=[],d=t&&t.pixelRatio||this.getDevicePixelRatio();z(lm,function(_,x){if(_.group===i){var b=r?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(yt(t)),S=_.getDom().getBoundingClientRect();l=a(S.left,l),u=a(S.top,u),c=s(S.right,c),h=s(S.bottom,h),f.push({dom:b,left:S.left,top:S.top})}}),l*=d,u*=d,c*=d,h*=d;var p=c-l,g=h-u,v=uc.createCanvas(),m=aI(v,{renderer:r?"svg":"canvas"});if(m.resize({width:p,height:g}),r){var y="";return z(f,function(_){var x=_.left-l,b=_.top-u;y+='<g transform="translate('+x+","+b+')">'+_.dom+"</g>"}),m.painter.getSvgRoot().innerHTML=y,t.connectedBackgroundColor&&m.painter.setBackgroundColor(t.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}else return t.connectedBackgroundColor&&m.add(new nn({shape:{x:0,y:0,width:p,height:g},style:{fill:t.connectedBackgroundColor}})),z(f,function(_){var x=new Pi({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,r){return AA(this,"convertToPixel",t,r)},e.prototype.convertFromPixel=function(t,r){return AA(this,"convertFromPixel",t,r)},e.prototype.containPixel=function(t,r){if(this._disposed){this.id;return}var i=this._model,a,s=tm(i,t);return z(s,function(o,l){l.indexOf("Models")>=0&&z(o,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(r);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(r,u))}},this)},this),!!a},e.prototype.getVisual=function(t,r){var i=this._model,a=tm(i,t,{defaultMainType:"series"}),s=a.seriesModel,o=s.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?o.indexOfRawIndex(a.dataIndex):null;return l!=null?iL(o,l,r):O0(o,r)},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;z(Eie,function(r){var i=function(a){var s=t.getModel(),o=a.target,l,u=r==="globalout";if(u?l={}:o&&Rh(o,function(p){var g=St(p);if(g&&g.dataIndex!=null){var v=g.dataModel||s.getSeriesByIndex(g.seriesIndex);return l=v&&v.getDataParams(g.dataIndex,g.dataType,o)||{},!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&&s.getComponent(c,h),d=f&&t[f.mainType==="series"?"_chartsMap":"_componentsMap"][f.__viewId];l.event=a,l.type=r,t._$eventProcessor.eventInfo={targetEl:o,packedEvent:l,model:f,view:d},t.trigger(r,l)}};i.zrEventfulCallAtLast=!0,t._zr.on(r,i,t)}),z(om,function(r,i){t._messageCenter.on(i,function(a){this.trigger(i,a)},t)}),z(["selectchanged"],function(r){t._messageCenter.on(r,function(i){this.trigger(r,i)},t)}),Ore(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&&SU(this.getDom(),lL,"");var r=this,i=r._api,a=r._model;z(r._componentsViews,function(s){s.dispose(a,i)}),z(r._chartsViews,function(s){s.dispose(a,i)}),r._zr.dispose(),r._dom=r._model=r._chartsMap=r._componentsMap=r._chartsViews=r._componentsViews=r._scheduler=r._api=r._zr=r._throttledZrFlush=r._theme=r._coordSysMgr=r._messageCenter=null,delete lm[r.id]},e.prototype.resize=function(t){if(!this[Ri]){if(this._disposed){this.id;return}this._zr.resize(t);var r=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!r){var i=r.resetOption("media"),a=t&&t.silent;this[ca]&&(a==null&&(a=this[ca].silent),i=!0,this[ca]=null),this[Ri]=!0;try{i&&jf(this),su.update.call(this,{type:"resize",animation:Pe({duration:0},t&&t.animation)})}catch(s){throw this[Ri]=!1,s}this[Ri]=!1,qv.call(this,a),Xv.call(this,a)}}},e.prototype.showLoading=function(t,r){if(this._disposed){this.id;return}if(gt(t)&&(r=t,t=""),t=t||"default",this.hideLoading(),!!vC[t]){var i=vC[t](this._api,r),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 r=Pe({},t);return r.type=om[t.type],r},e.prototype.dispatchAction=function(t,r){if(this._disposed){this.id;return}if(gt(r)||(r={silent:!!r}),!!Fx[t.type]&&this._model){if(this[Ri]){this._pendingActions.push(t);return}var i=r.silent;TA.call(this,t,i);var a=r.flush;a?this._zr.flush():a!==!1&&on.browser.weChat&&this._throttledZrFlush(),qv.call(this,i),Xv.call(this,i)}},e.prototype.updateLabelLayout=function(){Zs.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed){this.id;return}var r=t.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(r);a.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){jf=function(h){var f=h._scheduler;f.restorePipelines(h._model),f.prepareStageTasks(),wA(h,!0),wA(h,!1),f.plan()},wA=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;_<g.length;_++)g[_].__alive=!1;f?d.eachComponent(function(S,w){S!=="series"&&x(w)}):d.eachSeries(x);function x(S){var w=S.__requireNewView;S.__requireNewView=!1;var T="_ec_"+S.id+"_"+S.type,C=!w&&v[T];if(!C){var A=zo(S.type),M=f?fr.getClass(A.main,A.sub):$n.getClass(A.sub);C=new M,C.init(d,y),v[T]=C,g.push(C),m.add(C.group)}S.__viewId=C.__id=T,C.__alive=!0,C.__model=S,C.group.__ecComponentInfo={mainType:S.mainType,index:S.componentIndex},!f&&p.prepareView(C,S,d,y)}for(var _=0;_<g.length;){var b=g[_];b.__alive?_++:(!f&&b.renderTask.dispose(),m.remove(b.group),b.dispose(d,y),g.splice(_,1),v[b.__id]===b&&delete v[b.__id],b.__id=b.group.__ecComponentInfo=null)}},Vy=function(h,f,d,p,g){var v=h._model;if(v.setUpdatePayload(d),!p){z([].concat(h._componentsViews).concat(h._chartsViews),b);return}var m={};m[p+"Id"]=d[p+"Id"],m[p+"Index"]=d[p+"Index"],m[p+"Name"]=d[p+"Name"];var y={mainType:p,query:m};g&&(y.subType=g);var _=d.excludeSeriesId,x;_!=null&&(x=st(),z(Cn(_),function(S){var w=Yr(S,null);w!=null&&x.set(w,!0)})),v&&v.eachComponent(y,function(S){var w=x&&x.get(S.id)!=null;if(!w)if(kI(d))if(S instanceof rr)d.type===$h&&!d.notBlur&&!S.get(["emphasis","disabled"])&&Ree(S,d,h._api);else{var T=kP(S.mainType,S.componentIndex,d.name,h._api),C=T.focusSelf,A=T.dispatchers;d.type===$h&&C&&!d.notBlur&&YT(S.mainType,S.componentIndex,h._api),A&&z(A,function(M){d.type===$h?zl(M):Ul(M)})}else ZT(d)&&S instanceof rr&&(Nee(S,d,h._api),II(S),as(h))},h),v&&v.eachComponent(y,function(S){var w=x&&x.get(S.id)!=null;w||b(h[p==="series"?"_chartsMap":"_componentsMap"][S.__viewId])},h);function b(S){S&&S.__alive&&S[f]&&S[f](S.__model,v,h._api,d)}},su={prepareAndUpdate:function(h){jf(this),su.update.call(this,h,{optionChanged:h.newOption!=null})},update:function(h,f){var d=this._model,p=this._api,g=this._zr,v=this._coordSysMgr,m=this._scheduler;if(d){d.setUpdatePayload(h),m.restoreData(d,h),m.performSeriesTasks(d),v.create(d,p),m.performDataProcessorTasks(d,h),MA(this,d),v.update(d,p),t(d),m.performVisualTasks(d,h),CA(this,d,p,h,f);var y=d.get("backgroundColor")||"transparent",_=d.get("darkMode");g.setBackgroundColor(y),_!=null&&_!=="auto"&&g.setDarkMode(_),Zs.trigger("afterupdate",d,p)}},updateTransform:function(h){var f=this,d=this._model,p=this._api;if(d){d.setUpdatePayload(h);var g=[];d.eachComponent(function(m,y){if(m!=="series"){var _=f.getViewOfComponentModel(y);if(_&&_.__alive)if(_.updateTransform){var x=_.updateTransform(y,d,p,h);x&&x.update&&g.push(_)}else g.push(_)}});var v=st();d.eachSeries(function(m){var y=f._chartsMap[m.__viewId];if(y.updateTransform){var _=y.updateTransform(m,d,p,h);_&&_.update&&v.set(m.uid,1)}else v.set(m.uid,1)}),t(d),this._scheduler.performVisualTasks(d,h,{setDirty:!0,dirtyMap:v}),Hy(this,d,p,h,{},v),Zs.trigger("afterupdate",d,p)}},updateView:function(h){var f=this._model;f&&(f.setUpdatePayload(h),$n.markUpdateMethod(h,"updateView"),t(f),this._scheduler.performVisualTasks(f,h,{setDirty:!0}),CA(this,f,this._api,h,{}),Zs.trigger("afterupdate",f,this._api))},updateVisual:function(h){var f=this,d=this._model;d&&(d.setUpdatePayload(h),d.eachSeries(function(p){p.getData().clearAllVisual()}),$n.markUpdateMethod(h,"updateVisual"),t(d),this._scheduler.performVisualTasks(d,h,{visualType:"visual",setDirty:!0}),d.eachComponent(function(p,g){if(p!=="series"){var v=f.getViewOfComponentModel(g);v&&v.__alive&&v.updateVisual(g,d,f._api,h)}}),d.eachSeries(function(p){var g=f._chartsMap[p.__viewId];g.updateVisual(p,d,f._api,h)}),Zs.trigger("afterupdate",d,this._api))},updateLayout:function(h){su.update.call(this,h)}},AA=function(h,f,d,p){if(h._disposed){h.id;return}for(var g=h._model,v=h._coordSysMgr.getCoordinateSystems(),m,y=tm(g,d),_=0;_<v.length;_++){var x=v[_];if(x[f]&&(m=x[f](g,y,p))!=null)return m}},MA=function(h,f){var d=h._chartsMap,p=h._scheduler;f.eachSeries(function(g){p.updateStreamModes(g,d[g.__viewId])})},TA=function(h,f){var d=this,p=this.getModel(),g=h.type,v=h.escapeConnect,m=Fx[g],y=m.actionInfo,_=(y.update||"update").split(":"),x=_.pop(),b=_[0]!=null&&zo(_[0]);this[Ri]=!0;var S=[h],w=!1;h.batch&&(w=!0,S=Ne(h.batch,function(L){return L=dt(Pe({},L),h),L.batch=null,L}));var T=[],C,A=ZT(h),M=kI(h);if(M&&qU(this._api),z(S,function(L){if(C=m.action(L,d._model,d._api),C=C||Pe({},L),C.type=y.event||C.type,T.push(C),M){var R=CP(h),N=R.queryOptionMap,F=R.mainTypeSpecified,O=F?N.keys()[0]:"series";Vy(d,x,L,O),as(d)}else A?(Vy(d,x,L,"series"),as(d)):b&&Vy(d,x,L,b.main,b.sub)}),x!=="none"&&!M&&!A&&!b)try{this[ca]?(jf(this),su.update.call(this,h),this[ca]=null):su[x].call(this,h)}catch(L){throw this[Ri]=!1,L}if(w?C={type:y.event||g,escapeConnect:v,batch:T}:C=T[0],this[Ri]=!1,!f){var P=this._messageCenter;if(P.trigger(C.type,C),A){var D={type:"selectchanged",escapeConnect:v,selected:kee(p),isFromClick:h.isFromClick||!1,fromAction:h.type,fromActionPayload:h};P.trigger(D.type,D)}}},qv=function(h){for(var f=this._pendingActions;f.length;){var d=f.shift();TA.call(this,d,h)}},Xv=function(h){!h&&this.trigger("updated")},YN=function(h,f){h.on("rendered",function(d){f.trigger("rendered",d),h.animation.isFinished()&&!f[ca]&&!f._scheduler.unfinished&&!f._pendingActions.length&&f.trigger("finished")})},KN=function(h,f){h.on("mouseover",function(d){var p=d.target,g=Rh(p,Vm);g&&(Dee(g,d,f._api),as(f))}).on("mouseout",function(d){var p=d.target,g=Rh(p,Vm);g&&(Iee(g,d,f._api),as(f))}).on("click",function(d){var p=d.target,g=Rh(p,function(y){return St(y).dataIndex!=null},!0);if(g){var v=g.selected?"unselect":"select",m=St(g);f._api.dispatchAction({type:v,dataType:m.dataType,dataIndexInside:m.dataIndex,seriesIndex:m.seriesIndex,isFromClick:!0})}})};function t(h){h.clearColorPalette(),h.eachSeries(function(f){f.clearColorPalette()})}function r(h){var f=[],d=[],p=!1;if(h.eachComponent(function(y,_){var x=_.get("zlevel")||0,b=_.get("z")||0,S=_.getZLevelKey();p=p||!!S,(y==="series"?d:f).push({zlevel:x,z:b,idx:_.componentIndex,type:y,key:S})}),p){var g=f.concat(d),v,m;P1(g,function(y,_){return y.zlevel===_.zlevel?y.z-_.z:y.zlevel-_.zlevel}),z(g,function(y){var _=h.getComponent(y.type,y.idx),x=y.zlevel,b=y.key;v!=null&&(x=Math.max(v,x)),b?(x===v&&b!==m&&x++,m=b):m&&(x===v&&x++,m=""),v=x,_.setZLevel(x)})}}CA=function(h,f,d,p,g){r(f),ZN(h,f,d,p,g),z(h._chartsViews,function(v){v.__alive=!1}),Hy(h,f,d,p,g),z(h._chartsViews,function(v){v.__alive||v.remove(f,d)})},ZN=function(h,f,d,p,g,v){z(v||h._componentsViews,function(m){var y=m.__model;u(y,m),m.render(y,f,d,p),o(y,m),c(y,m)})},Hy=function(h,f,d,p,g,v){var m=h._scheduler;g=Pe(g||{},{updatedSeries:f.getSeries()}),Zs.trigger("series:beforeupdate",f,d,g);var y=!1;f.eachSeries(function(_){var x=h._chartsMap[_.__viewId];x.__alive=!0;var b=x.renderTask;m.updatePayload(b,p),u(_,x),v&&v.get(_.uid)&&b.dirty(),b.perform(m.getPerformArgs(b))&&(y=!0),x.group.silent=!!_.get("silent"),s(_,x),II(_)}),m.unfinished=y||m.unfinished,Zs.trigger("series:layoutlabels",f,d,g),Zs.trigger("series:transition",f,d,g),f.eachSeries(function(_){var x=h._chartsMap[_.__viewId];o(_,x),c(_,x)}),a(h,f),Zs.trigger("series:afterupdate",f,d,g)},as=function(h){h[bA]=!0,h.getZr().wakeUp()},JN=function(h){h[bA]&&(h.getZr().storage.traverse(function(f){np(f)||i(f)}),h[bA]=!1)};function i(h){for(var f=[],d=h.currentStates,p=0;p<d.length;p++){var g=d[p];g==="emphasis"||g==="blur"||g==="select"||f.push(g)}h.selected&&h.states.select&&f.push("select"),h.hoverState===tS&&h.states.emphasis?f.push("emphasis"):h.hoverState===D0&&h.states.blur&&f.push("blur"),h.useStates(f)}function a(h,f){var d=h._zr,p=d.storage,g=0;p.traverse(function(v){v.isGroup||g++}),g>f.get("hoverLayerThreshold")&&!on.node&&!on.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 s(h,f){var d=h.get("blendMode")||null;f.eachRendered(function(p){p.isGroup||(p.style.blend=d)})}function o(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;_<y.length;_++)p=Math.max(l(y[_],f,d,p),p);else h.z=f,h.zlevel=d,p=Math.max(h.z2,p);if(g&&(g.z=f,g.zlevel=d,isFinite(p)&&(g.z2=p+2)),v){var x=h.textGuideLineConfig;v.z=f,v.zlevel=d,isFinite(p)&&(v.z2=p+(x&&x.showAbove?1:-1))}return p}function u(h,f){f.eachRendered(function(d){if(!np(d)){var p=d.getTextContent(),g=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function c(h,f){var d=h.getModel("stateAnimation"),p=h.isAnimationEnabled(),g=d.get("duration"),v=g>0?{duration:g,delay:d.get("delay"),easing:d.get("easing")}:null;f.eachRendered(function(m){if(m.states&&m.states.emphasis){if(np(m))return;if(m instanceof Ht&&zee(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)}})}QN=function(h){return new(function(f){ve(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){zl(p,g),as(h)},d.prototype.leaveEmphasis=function(p,g){Ul(p,g),as(h)},d.prototype.enterBlur=function(p){HU(p),as(h)},d.prototype.leaveBlur=function(p){NP(p),as(h)},d.prototype.enterSelect=function(p){WU(p),as(h)},d.prototype.leaveSelect=function(p){$U(p),as(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}(X7))(h)},HV=function(h){function f(d,p){for(var g=0;g<d.length;g++){var v=d[g];v[SA]=p}}z(om,function(d,p){h._messageCenter.on(p,function(g){if(e4[h.group]&&h[SA]!==XN){if(g&&g.escapeConnect)return;var v=h.makeActionFromEvent(g),m=[];z(lm,function(y){y!==h&&y.group===h.group&&m.push(y)}),f(m,XN),z(m,function(y){y[SA]!==Tie&&y.dispatchAction(v)}),f(m,Cie)}})})}}(),e}(Bs),oL=WV.prototype;oL.on=BV("on");oL.off=BV("off");oL.one=function(n,e,t){var r=this;function i(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];e&&e.apply&&e.apply(this,a),r.off(n,i)}this.on.call(this,n,i,t)};var Eie=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];var Fx={},om={},dC=[],pC=[],Bx=[],$V={},vC={},lm={},e4={},Pie=+new Date-0,lL="_echarts_instance_";function Lie(n,e,t){var r=!(t&&t.ssr);if(r){var i=Rie(n);if(i)return i}var a=new WV(n,e,t);return a.id="ec_"+Pie++,lm[a.id]=a,r&&SU(n,lL,a.id),HV(a),Zs.trigger("afterinit",a),a}function Rie(n){return lm[TJ(n,lL)]}function jV(n,e){$V[n]=e}function qV(n){Ft(pC,n)<0&&pC.push(n)}function XV(n,e){cL(dC,n,e,yie)}function Die(n){uL("afterinit",n)}function Iie(n){uL("afterupdate",n)}function uL(n,e){Zs.on(n,e)}function il(n,e,t){ct(e)&&(t=e,e="");var r=gt(n)?n.type:[n,n={event:e}][0];n.event=(n.event||r).toLowerCase(),e=n.event,!om[e]&&(sa(qN.test(r)&&qN.test(e)),Fx[r]||(Fx[r]={action:t,actionInfo:n}),om[e]=r)}function Nie(n,e){k0.register(n,e)}function kie(n,e){cL(Bx,n,e,kV,"layout")}function Cf(n,e){cL(Bx,n,e,OV,"visual")}var t4=[];function cL(n,e,t,r,i){if((ct(e)||gt(e))&&(t=e,e=r),!(Ft(t4,t)>=0)){t4.push(t);var a=AV.wrapStageHandler(t,i);a.__prio=e,a.__raw=t,n.push(a)}}function YV(n,e){vC[n]=e}function Oie(n,e,t){var r=die("registerMap");r&&r(n,e,t)}var Fie=$ne;Cf(sL,mre);Cf(_S,yre);Cf(_S,_re);Cf(sL,Nre);Cf(_S,kre);Cf(FV,cie);qV(K7);XV(gie,Mne);YV("default",xre);il({type:$h,event:$h,update:$h},Er);il({type:k1,event:k1,update:k1},Er);il({type:nm,event:nm,update:nm},Er);il({type:O1,event:O1,update:O1},Er);il({type:rm,event:rm,update:rm},Er);jV("light",Rre);jV("dark",Dre);var n4=[],Bie={registerPreprocessor:qV,registerProcessor:XV,registerPostInit:Die,registerPostUpdate:Iie,registerUpdateLifecycle:uL,registerAction:il,registerCoordinateSystem:Nie,registerLayout:kie,registerVisual:Cf,registerTransform:Fie,registerLoading:YV,registerMap:Oie,registerImpl:fie,PRIORITY:Mie,ComponentModel:sn,ComponentView:fr,SeriesModel:rr,ChartView:$n,registerComponentModel:function(n){sn.registerClass(n)},registerComponentView:function(n){fr.registerClass(n)},registerSeriesModel:function(n){rr.registerClass(n)},registerChartView:function(n){$n.registerClass(n)},registerSubTypeDefaulter:function(n,e){sn.registerSubTypeDefaulter(n,e)},registerPainter:function(n,e){iJ(n,e)}};function Vt(n){if(Ie(n)){z(n,function(e){Vt(e)});return}Ft(n4,n)>=0||(n4.push(n),ct(n)&&(n={install:n}),n.install(Bie))}function Yv(n){return n==null?0:n.length||1}function r4(n){return n}var Gie=function(){function n(e,t,r,i,a,s){this._old=e,this._new=t,this._oldKeyGetter=r||r4,this._newKeyGetter=i||r4,this.context=a,this._diffModeMultiple=s==="multiple"}return n.prototype.add=function(e){return this._add=e,this},n.prototype.update=function(e){return this._update=e,this},n.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},n.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},n.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},n.prototype.remove=function(e){return this._remove=e,this},n.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},n.prototype._executeOneToOne=function(){var e=this._old,t=this._new,r={},i=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,r,a,"_newKeyGetter");for(var s=0;s<e.length;s++){var o=i[s],l=r[o],u=Yv(l);if(u>1){var c=l.shift();l.length===1&&(r[o]=l[0]),this._update&&this._update(c,s)}else u===1?(r[o]=null,this._update&&this._update(l,s)):this._remove&&this._remove(s)}this._performRestAdd(a,r)},n.prototype._executeMultiple=function(){var e=this._old,t=this._new,r={},i={},a=[],s=[];this._initIndexMap(e,r,a,"_oldKeyGetter"),this._initIndexMap(t,i,s,"_newKeyGetter");for(var o=0;o<a.length;o++){var l=a[o],u=r[l],c=i[l],h=Yv(u),f=Yv(c);if(h>1&&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;d<h;d++)this._remove&&this._remove(u[d]);else this._remove&&this._remove(u)}this._performRestAdd(s,i)},n.prototype._performRestAdd=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],a=t[i],s=Yv(a);if(s>1)for(var o=0;o<s;o++)this._add&&this._add(a[o]);else s===1&&this._add&&this._add(a);t[i]=null}},n.prototype._initIndexMap=function(e,t,r,i){for(var a=this._diffModeMultiple,s=0;s<e.length;s++){var o="_ec_"+this[i](e[s],s);if(a||(r[s]=o),!!t){var l=t[o],u=Yv(l);u===0?(t[o]=s,a&&r.push(o)):u===1?t[o]=[l,s]:l.push(s)}}},n}();const Vl=Gie;var zie=function(){function n(e,t){this._encode=e,this._schema=t}return n.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},n.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},n}();function Uie(n,e){var t={},r=t.encode={},i=st(),a=[],s=[],o={};z(n.dimensions,function(f){var d=n.getDimensionInfo(f),p=d.coordDim;if(p){var g=d.coordDimIndex;EA(r,p)[g]=f,d.isExtraCoord||(i.set(p,1),Vie(d.type)&&(a[0]=f),EA(o,p)[g]=n.getDimensionIndex(d.name)),d.defaultTooltip&&s.push(f)}G7.each(function(v,m){var y=EA(r,m),_=d.otherDims[m];_!=null&&_!==!1&&(y[_]=d.name)})});var l=[],u={};i.each(function(f,d){var p=r[d];u[d]=p[0],l=l.concat(p)}),t.dataDimsOnCoord=l,t.dataDimIndicesOnCoord=Ne(l,function(f){return n.getDimensionInfo(f).storeDimIndex}),t.encodeFirstDimNotExtra=u;var c=r.label;c&&c.length&&(a=c.slice());var h=r.tooltip;return h&&h.length?s=h.slice():s.length||(s=a.slice()),r.defaultedLabel=a,r.defaultedTooltip=s,t.userOutput=new zie(o,e),t}function EA(n,e){return n.hasOwnProperty(e)||(n[e]=[]),n[e]}function Gx(n){return n==="category"?"ordinal":n==="time"?"time":"float"}function Vie(n){return!(n==="ordinal"||n==="time")}var Hie=function(){function n(e){this.otherDims={},e!=null&&Pe(this,e)}return n}();const U1=Hie;var Wie=en(),$ie={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},KV=function(){function n(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return n.prototype.isDimensionOmitted=function(){return this._dimOmitted},n.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=JV(this.source)))},n.prototype.getSourceDimensionIndex=function(e){return Et(this._dimNameMap.get(e),-1)},n.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},n.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=Q7(this.source),r=!e9(e),i="",a=[],s=0,o=0;s<e;s++){var l=void 0,u=void 0,c=void 0,h=this.dimensions[o];if(h&&h.storeDimIndex===s)l=t?h.name:null,u=h.type,c=h.ordinalMeta,o++;else{var f=this.getSourceDimension(s);f&&(l=t?f.name:null,u=f.type)}a.push({property:l,type:u,ordinalMeta:c}),t&&l!=null&&(!h||!h.isCalculationCoord)&&(i+=r?l.replace(/\`/g,"`1").replace(/\$/g,"`2"):l),i+="$",i+=$ie[u]||"f",c&&(i+=c.uid),i+="$"}var d=this.source,p=[d.seriesLayoutBy,d.startIndex,i].join("$$");return{dimensions:a,hash:p}},n.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,r=0;t<this._fullDimCount;t++){var i=void 0,a=this.dimensions[r];if(a&&a.storeDimIndex===t)a.isCalculationCoord||(i=a.name),r++;else{var s=this.getSourceDimension(t);s&&(i=s.name)}e.push(i)}return e},n.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},n}();function ZV(n){return n instanceof KV}function QV(n){for(var e=st(),t=0;t<(n||[]).length;t++){var r=n[t],i=gt(r)?r.name:r;i!=null&&e.get(i)==null&&e.set(i,t)}return e}function JV(n){var e=Wie(n);return e.dimNameMap||(e.dimNameMap=QV(n.dimensionsDefine))}function e9(n){return n>30}var Kv=gt,ou=Ne,jie=typeof Int32Array=="undefined"?Array:Int32Array,qie="e\0\0",i4=-1,Xie=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],Yie=["_approximateExtent"],a4,Wy,Zv,Qv,PA,Jv,LA,Kie=function(){function n(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 r,i=!1;ZV(e)?(r=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,r=e),r=r||["x","y"];for(var a={},s=[],o={},l=!1,u={},c=0;c<r.length;c++){var h=r[c],f=Ke(h)?new U1({name:h}):h instanceof U1?h:new U1(h),d=f.name;f.type=f.type||"float",f.coordDim||(f.coordDim=d,f.coordDimIndex=0);var p=f.otherDims=f.otherDims||{};s.push(d),a[d]=f,u[d]!=null&&(l=!0),f.createInvertedIndices&&(o[d]=[]),p.itemName===0&&(this._nameDimIdx=c),p.itemId===0&&(this._idDimIdx=c),i&&(f.storeDimIndex=c)}if(this.dimensions=s,this._dimInfos=a,this._initGetDimensionInfo(l),this.hostModel=t,this._invertedIndicesMap=o,this._dimOmitted){var g=this._dimIdxToName=st();z(s,function(v){g.set(a[v].storeDimIndex,v)})}}return n.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(t==null)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var r=this._dimIdxToName.get(t);if(r!=null)return r;var i=this._schema.getSourceDimension(t);if(i)return i.name},n.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(t!=null)return t;if(e==null)return-1;var r=this._getDimInfo(e);return r?r.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},n.prototype._recognizeDimIndex=function(e){if(un(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},n.prototype._getStoreDimIndex=function(e){var t=this.getDimensionIndex(e);return t},n.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},n.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(r){return t.hasOwnProperty(r)?t[r]:void 0}:function(r){return t[r]}},n.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},n.prototype.mapDimension=function(e,t){var r=this._dimSummary;if(t==null)return r.encodeFirstDimNotExtra[e];var i=r.encode[e];return i?i[t]:null},n.prototype.mapDimensionsAll=function(e){var t=this._dimSummary,r=t.encode[e];return(r||[]).slice()},n.prototype.getStore=function(){return this._store},n.prototype.initData=function(e,t,r){var i=this,a;if(e instanceof sC&&(a=e),!a){var s=this.dimensions,o=QP(e)||Hi(e)?new J7(e,s.length):e;a=new sC;var l=ou(s,function(u){return{type:i._dimInfos[u].type,property:u}});a.initData(o,l,r)}this._store=a,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,a.count()),this._dimSummary=Uie(this,this._schema),this.userOutput=this._dimSummary.userOutput},n.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},n.prototype.appendValues=function(e,t){var r=this._store.appendValues(e,t&&t.length),i=r.start,a=r.end,s=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var o=i;o<a;o++){var l=o-i;this._nameList[o]=t[l],s&&LA(this,o)}},n.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,r=0;r<t.length;r++){var i=this._dimInfos[t[r]];i.ordinalMeta&&e.collectOrdinalMeta(i.storeDimIndex,i.ordinalMeta)}},n.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==Qu&&!e.fillStorage},n.prototype._doInit=function(e,t){if(!(e>=t)){var r=this._store,i=r.getProvider();this._updateOrdinalMeta();var a=this._nameList,s=this._idList,o=i.getSource().sourceFormat,l=o===Gs;if(l&&!i.pure)for(var u=[],c=e;c<t;c++){var h=i.getItem(c,u);if(!this.hasItemOption&&dJ(h)&&(this.hasItemOption=!0),h){var f=h.name;a[c]==null&&f!=null&&(a[c]=Yr(f,null));var d=h.id;s[c]==null&&d!=null&&(s[c]=Yr(d,null))}}if(this._shouldMakeIdFromName())for(var c=e;c<t;c++)LA(this,c);a4(this)}},n.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},n.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},n.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},n.prototype.setCalculationInfo=function(e,t){Kv(e)?Pe(this._calculationInfo,e):this._calculationInfo[e]=t},n.prototype.getName=function(e){var t=this.getRawIndex(e),r=this._nameList[t];return r==null&&this._nameDimIdx!=null&&(r=Zv(this,this._nameDimIdx,t)),r==null&&(r=""),r},n.prototype._getCategory=function(e,t){var r=this._store.get(e,t),i=this._store.getOrdinalMeta(e);return i?i.categories[r]:r},n.prototype.getId=function(e){return Wy(this,this.getRawIndex(e))},n.prototype.count=function(){return this._store.count()},n.prototype.get=function(e,t){var r=this._store,i=this._dimInfos[e];if(i)return r.get(i.storeDimIndex,t)},n.prototype.getByRawIndex=function(e,t){var r=this._store,i=this._dimInfos[e];if(i)return r.getByRawIndex(i.storeDimIndex,t)},n.prototype.getIndices=function(){return this._store.getIndices()},n.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},n.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},n.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},n.prototype.getValues=function(e,t){var r=this,i=this._store;return Ie(e)?i.getValues(ou(e,function(a){return r._getStoreDimIndex(a)}),t):i.getValues(e)},n.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,r=0,i=t.length;r<i;r++)if(isNaN(this._store.get(t[r],e)))return!1;return!0},n.prototype.indexOfName=function(e){for(var t=0,r=this._store.count();t<r;t++)if(this.getName(t)===e)return t;return-1},n.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},n.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},n.prototype.rawIndexOf=function(e,t){var r=e&&this._invertedIndicesMap[e],i=r&&r[t];return i==null||isNaN(i)?i4:i},n.prototype.indicesOfNearest=function(e,t,r){return this._store.indicesOfNearest(this._getStoreDimIndex(e),t,r)},n.prototype.each=function(e,t,r){ct(e)&&(r=t,t=e,e=[]);var i=r||this,a=ou(Qv(e),this._getStoreDimIndex,this);this._store.each(a,i?Qe(t,i):t)},n.prototype.filterSelf=function(e,t,r){ct(e)&&(r=t,t=e,e=[]);var i=r||this,a=ou(Qv(e),this._getStoreDimIndex,this);return this._store=this._store.filter(a,i?Qe(t,i):t),this},n.prototype.selectRange=function(e){var t=this,r={},i=Yt(e);return z(i,function(a){var s=t._getStoreDimIndex(a);r[s]=e[a]}),this._store=this._store.selectRange(r),this},n.prototype.mapArray=function(e,t,r){ct(e)&&(r=t,t=e,e=[]),r=r||this;var i=[];return this.each(e,function(){i.push(t&&t.apply(this,arguments))},r),i},n.prototype.map=function(e,t,r,i){var a=r||i||this,s=ou(Qv(e),this._getStoreDimIndex,this),o=Jv(this);return o._store=this._store.map(s,a?Qe(t,a):t),o},n.prototype.modify=function(e,t,r,i){var a=r||i||this,s=ou(Qv(e),this._getStoreDimIndex,this);this._store.modify(s,a?Qe(t,a):t)},n.prototype.downSample=function(e,t,r,i){var a=Jv(this);return a._store=this._store.downSample(this._getStoreDimIndex(e),t,r,i),a},n.prototype.minmaxDownSample=function(e,t){var r=Jv(this);return r._store=this._store.minmaxDownSample(this._getStoreDimIndex(e),t),r},n.prototype.lttbDownSample=function(e,t){var r=Jv(this);return r._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),r},n.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},n.prototype.getItemModel=function(e){var t=this.hostModel,r=this.getRawDataItem(e);return new Wn(r,t,t&&t.ecModel)},n.prototype.diff=function(e){var t=this;return new Vl(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(r){return Wy(e,r)},function(r){return Wy(t,r)})},n.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},n.prototype.setVisual=function(e,t){this._visual=this._visual||{},Kv(e)?Pe(this._visual,e):this._visual[e]=t},n.prototype.getItemVisual=function(e,t){var r=this._itemVisuals[e],i=r&&r[t];return i==null?this.getVisual(t):i},n.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},n.prototype.ensureUniqueItemVisual=function(e,t){var r=this._itemVisuals,i=r[e];i||(i=r[e]={});var a=i[t];return a==null&&(a=this.getVisual(t),Ie(a)?a=a.slice():Kv(a)&&(a=Pe({},a)),i[t]=a),a},n.prototype.setItemVisual=function(e,t,r){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,Kv(t)?Pe(i,t):i[t]=r},n.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},n.prototype.setLayout=function(e,t){Kv(e)?Pe(this._layout,e):this._layout[e]=t},n.prototype.getLayout=function(e){return this._layout[e]},n.prototype.getItemLayout=function(e){return this._itemLayouts[e]},n.prototype.setItemLayout=function(e,t,r){this._itemLayouts[e]=r?Pe(this._itemLayouts[e]||{},t):t},n.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},n.prototype.setItemGraphicEl=function(e,t){var r=this.hostModel&&this.hostModel.seriesIndex;qT(r,this.dataType,e,t),this._graphicEls[e]=t},n.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},n.prototype.eachItemGraphicEl=function(e,t){z(this._graphicEls,function(r,i){r&&e&&e.call(t,r,i)})},n.prototype.cloneShallow=function(e){return e||(e=new n(this._schema?this._schema:ou(this.dimensions,this._getDimInfo,this),this.hostModel)),PA(e,this),e._store=this._store,e},n.prototype.wrapMethod=function(e,t){var r=this[e];ct(r)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var i=r.apply(this,arguments);return t.apply(this,[i].concat(gP(arguments)))})},n.internalField=function(){a4=function(e){var t=e._invertedIndicesMap;z(t,function(r,i){var a=e._dimInfos[i],s=a.ordinalMeta,o=e._store;if(s){r=t[i]=new jie(s.categories.length);for(var l=0;l<r.length;l++)r[l]=i4;for(var l=0;l<o.count();l++)r[o.get(a.storeDimIndex,l)]=l}})},Zv=function(e,t,r){return Yr(e._getCategory(t,r),null)},Wy=function(e,t){var r=e._idList[t];return r==null&&e._idDimIdx!=null&&(r=Zv(e,e._idDimIdx,t)),r==null&&(r=qie+t),r},Qv=function(e){return Ie(e)||(e=e!=null?[e]:[]),e},Jv=function(e){var t=new n(e._schema?e._schema:ou(e.dimensions,e._getDimInfo,e),e.hostModel);return PA(t,e),t},PA=function(e,t){z(Xie.concat(t.__wrappedMethods||[]),function(r){t.hasOwnProperty(r)&&(e[r]=t[r])}),e.__wrappedMethods=t.__wrappedMethods,z(Yie,function(r){e[r]=yt(t[r])}),e._calculationInfo=Pe({},t._calculationInfo)},LA=function(e,t){var r=e._nameList,i=e._idList,a=e._nameDimIdx,s=e._idDimIdx,o=r[t],l=i[t];if(o==null&&a!=null&&(r[t]=o=Zv(e,a,t)),l==null&&s!=null&&(i[t]=l=Zv(e,s,t)),l==null&&o!=null){var u=e._nameRepeatCount,c=u[o]=(u[o]||0)+1;l=o,c>1&&(l+="__ec__"+c),i[t]=l}}}(),n}();const ia=Kie;function F0(n,e){QP(n)||(n=JP(n)),e=e||{};var t=e.coordDimensions||[],r=e.dimensionsDefine||n.dimensionsDefine||[],i=st(),a=[],s=Qie(n,t,r,e.dimensionsCount),o=e.canOmitUnusedDimensions&&e9(s),l=r===n.dimensionsDefine,u=l?JV(n):QV(r),c=e.encodeDefine;!c&&e.encodeDefaulter&&(c=e.encodeDefaulter(n,s));for(var h=st(c),f=new oV(s),d=0;d<f.length;d++)f[d]=-1;function p(C){var A=f[C];if(A<0){var M=r[C],P=gt(M)?M:{name:M},D=new U1,L=P.name;L!=null&&u.get(L)!=null&&(D.name=D.displayName=L),P.type!=null&&(D.type=P.type),P.displayName!=null&&(D.displayName=P.displayName);var R=a.length;return f[C]=R,D.storeDimIndex=C,a.push(D),D}return a[A]}if(!o)for(var d=0;d<s;d++)p(d);h.each(function(C,A){var M=Cn(C).slice();if(M.length===1&&!Ke(M[0])&&M[0]<0){h.set(A,!1);return}var P=h.set(A,[]);z(M,function(D,L){var R=Ke(D)?u.get(D):D;R!=null&&R<s&&(P[L]=R,v(p(R),A,L))})});var g=0;z(t,function(C){var A,M,P,D;if(Ke(C))A=C,D={};else{D=C,A=D.name;var L=D.ordinalMeta;D.ordinalMeta=null,D=Pe({},D),D.ordinalMeta=L,M=D.dimsDef,P=D.otherDims,D.name=D.coordDim=D.coordDimIndex=D.dimsDef=D.otherDims=null}var R=h.get(A);if(R!==!1){if(R=Cn(R),!R.length)for(var N=0;N<(M&&M.length||1);N++){for(;g<s&&p(g).coordDim!=null;)g++;g<s&&R.push(g++)}z(R,function(F,O){var H=p(F);if(l&&D.type!=null&&(H.type=D.type),v(dt(H,D),A,O),H.name==null&&M){var U=M[O];!gt(U)&&(U={name:U}),H.name=H.displayName=U.name,H.defaultTooltip=U.defaultTooltip}P&&dt(H.otherDims,P)})}});function v(C,A,M){G7.get(A)!=null?C.otherDims[A]=M:(C.coordDim=A,C.coordDimIndex=M,i.set(A,!0))}var m=e.generateCoord,y=e.generateCoordCount,_=y!=null;y=m?y||1:0;var x=m||"value";function b(C){C.name==null&&(C.name=C.coordDim)}if(o)z(a,function(C){b(C)}),a.sort(function(C,A){return C.storeDimIndex-A.storeDimIndex});else for(var S=0;S<s;S++){var w=p(S),T=w.coordDim;T==null&&(w.coordDim=Jie(x,i,_),w.coordDimIndex=0,(!m||y<=0)&&(w.isExtraCoord=!0),y--),b(w),w.type==null&&(H7(n,S)===Si.Must||w.isExtraCoord&&(w.otherDims.itemName!=null||w.otherDims.seriesName!=null))&&(w.type="ordinal")}return Zie(a),new KV({source:n,dimensions:a,fullDimensionCount:s,dimensionOmitted:o})}function Zie(n){for(var e=st(),t=0;t<n.length;t++){var r=n[t],i=r.name,a=e.get(i)||0;a>0&&(r.name=i+(a-1)),a++,e.set(i,a)}}function Qie(n,e,t,r){var i=Math.max(n.dimensionsDetectedCount||1,e.length,t.length,r||0);return z(e,function(a){var s;gt(a)&&(s=a.dimsDef)&&(i=Math.max(i,s.length))}),i}function Jie(n,e,t){if(t||e.hasKey(n)){for(var r=0;e.hasKey(n+r);)r++;n+=r}return e.set(n,!0),n}var eae=function(){function n(e){this.coordSysDims=[],this.axisMap=st(),this.categoryAxisMap=st(),this.coordSysName=e}return n}();function tae(n){var e=n.get("coordinateSystem"),t=new eae(e),r=nae[e];if(r)return r(n,t,t.axisMap,t.categoryAxisMap),t}var nae={cartesian2d:function(n,e,t,r){var i=n.getReferringComponents("xAxis",Fr).models[0],a=n.getReferringComponents("yAxis",Fr).models[0];e.coordSysDims=["x","y"],t.set("x",i),t.set("y",a),qf(i)&&(r.set("x",i),e.firstCategoryDimIndex=0),qf(a)&&(r.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(n,e,t,r){var i=n.getReferringComponents("singleAxis",Fr).models[0];e.coordSysDims=["single"],t.set("single",i),qf(i)&&(r.set("single",i),e.firstCategoryDimIndex=0)},polar:function(n,e,t,r){var i=n.getReferringComponents("polar",Fr).models[0],a=i.findAxisModel("radiusAxis"),s=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],t.set("radius",a),t.set("angle",s),qf(a)&&(r.set("radius",a),e.firstCategoryDimIndex=0),qf(s)&&(r.set("angle",s),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(n,e,t,r){e.coordSysDims=["lng","lat"]},parallel:function(n,e,t,r){var i=n.ecModel,a=i.getComponent("parallel",n.get("parallelIndex")),s=e.coordSysDims=a.dimensions.slice();z(a.parallelAxisIndex,function(o,l){var u=i.getComponent("parallelAxis",o),c=s[l];t.set(c,u),qf(u)&&(r.set(c,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function qf(n){return n.get("type")==="category"}function rae(n,e,t){t=t||{};var r=t.byIndex,i=t.stackedCoordDimension,a,s,o;iae(e)?a=e:(s=e.schema,a=s.dimensions,o=e.store);var l=!!(n&&n.get("stack")),u,c,h,f;if(z(a,function(y,_){Ke(y)&&(a[_]=y={name:y}),l&&!y.isExtraCoord&&(!r&&!u&&y.ordinalMeta&&(u=y),!c&&y.type!=="ordinal"&&y.type!=="time"&&(!i||i===y.coordDim)&&(c=y))}),c&&!r&&!u&&(r=!0),c){h="__\0ecstackresult_"+n.id,f="__\0ecstackedover_"+n.id,u&&(u.createInvertedIndices=!0);var d=c.coordDim,p=c.type,g=0;z(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};s?(o&&(v.storeDimIndex=o.ensureCalculationDimension(f,p),m.storeDimIndex=o.ensureCalculationDimension(h,p)),s.appendCalculationDimension(v),s.appendCalculationDimension(m)):(a.push(v),a.push(m))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:r,stackedOverDimension:f,stackResultDimension:h}}function iae(n){return!ZV(n.schema)}function dc(n,e){return!!e&&e===n.getCalculationInfo("stackedDimension")}function t9(n,e){return dc(n,e)?n.getCalculationInfo("stackResultDimension"):e}function aae(n,e){var t=n.get("coordinateSystem"),r=k0.get(t),i;return e&&e.coordSysDims&&(i=Ne(e.coordSysDims,function(a){var s={name:a},o=e.axisMap.get(a);if(o){var l=o.get("type");s.type=Gx(l)}return s})),i||(i=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),i}function sae(n,e,t){var r,i;return t&&z(n,function(a,s){var o=a.coordDim,l=t.categoryAxisMap.get(o);l&&(r==null&&(r=s),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&r!=null&&(n[r].otherDims.itemName=0),r}function Yl(n,e,t){t=t||{};var r=e.getSourceManager(),i,a=!1;n?(a=!0,i=JP(n)):(i=r.getSource(),a=i.sourceFormat===Gs);var s=tae(e),o=aae(e,s),l=t.useEncodeDefaulter,u=ct(l)?l:l?Rt(V7,o,e):null,c={coordDimensions:o,generateCoord:t.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=F0(i,c),f=sae(h.dimensions,t.createInvertedIndices,s),d=a?null:r.getSharedDataStore(h),p=rae(e,{schema:h,store:d}),g=new ia(h,e);g.setCalculationInfo(p);var v=f!=null&&oae(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 oae(n){if(n.sourceFormat===Gs){var e=lae(n.data||[]);return!Ie(qp(e))}}function lae(n){for(var e=0;e<n.length&&n[e]==null;)e++;return n[e]}var n9=function(){function n(e){this._setting=e||{},this._extent=[1/0,-1/0]}return n.prototype.getSetting=function(e){return this._setting[e]},n.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},n.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},n.prototype.getExtent=function(){return this._extent.slice()},n.prototype.setExtent=function(e,t){var r=this._extent;isNaN(e)||(r[0]=e),isNaN(t)||(r[1]=t)},n.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},n.prototype.isBlank=function(){return this._isBlank},n.prototype.setBlank=function(e){this._isBlank=e},n}();Zb(n9);const Kl=n9;var uae=0,cae=function(){function n(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++uae}return n.createByAxisModel=function(e){var t=e.option,r=t.data,i=r&&Ne(r,hae);return new n({categories:i,needCollect:!i,deduplication:t.dedplication!==!1})},n.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},n.prototype.parseAndCollect=function(e){var t,r=this._needCollect;if(!Ke(e)&&!r)return e;if(r&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return t=i.get(e),t==null&&(r?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},n.prototype._getOrCreateMap=function(){return this._map||(this._map=st(this.categories))},n}();function hae(n){return gt(n)&&n.value!=null?n.value:n+""}const gC=cae;function mC(n){return n.type==="interval"||n.type==="log"}function fae(n,e,t,r){var i={},a=n[1]-n[0],s=i.interval=pU(a/e,!0);t!=null&&s<t&&(s=i.interval=t),r!=null&&s>r&&(s=i.interval=r);var o=i.intervalPrecision=r9(s),l=i.niceTickExtent=[xr(Math.ceil(n[0]/s)*s,o),xr(Math.floor(n[1]/s)*s,o)];return dae(l,n),i}function RA(n){var e=Math.pow(10,MP(n)),t=n/e;return t?t===2?t=3:t===3?t=5:t*=2:t=1,xr(t*e)}function r9(n){return Go(n)+2}function s4(n,e,t){n[e]=Math.max(Math.min(n[e],t[1]),t[0])}function dae(n,e){!isFinite(n[0])&&(n[0]=e[0]),!isFinite(n[1])&&(n[1]=e[1]),s4(n,0,e),s4(n,1,e),n[0]>n[1]&&(n[0]=n[1])}function xS(n,e){return n>=e[0]&&n<=e[1]}function bS(n,e){return e[1]===e[0]?.5:(n-e[0])/(e[1]-e[0])}function SS(n,e){return n*(e[1]-e[0])+e[0]}var i9=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;r.type="ordinal";var i=r.getSetting("ordinalMeta");return i||(i=new gC({})),Ie(i)&&(i=new gC({categories:Ne(i,function(a){return gt(a)?a.value:a})})),r._ordinalMeta=i,r._extent=r.getSetting("extent")||[0,i.categories.length-1],r}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),xS(t,this._extent)&&this._ordinalMeta.categories[t]!=null},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),bS(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(SS(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],r=this._extent,i=r[0];i<=r[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 r=t.ordinalNumbers,i=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],s=0,o=this._ordinalMeta.categories.length,l=Math.min(o,r.length);s<l;++s){var u=r[s];i[s]=u,a[u]=s}for(var c=0;s<o;++s){for(;a[c]!=null;)c++;i.push(c),a[c]=s}},e.prototype._getTickNumber=function(t){var r=this._ticksByOrdinalNumber;return r&&t>=0&&t<r.length?r[t]:t},e.prototype.getRawOrdinalNumber=function(t){var r=this._ordinalNumbersByTick;return r&&t>=0&&t<r.length?r[t]:t},e.prototype.getLabel=function(t){if(!this.isBlank()){var r=this.getRawOrdinalNumber(t.value),i=this._ordinalMeta.categories[r];return i==null?"":i+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.unionExtentFromData=function(t,r){this.unionExtent(t.getApproximateExtent(r))},e.prototype.isInExtentRange=function(t){return t=this._getTickNumber(t),this._extent[0]<=t&&this._extent[1]>=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(Kl);Kl.registerClass(i9);const hL=i9;var Kc=xr,a9=function(n){ve(e,n);function e(){var t=n!==null&&n.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 xS(t,this._extent)},e.prototype.normalize=function(t){return bS(t,this._extent)},e.prototype.scale=function(t){return SS(t,this._extent)},e.prototype.setExtent=function(t,r){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(r)||(i[1]=parseFloat(r))},e.prototype.unionExtent=function(t){var r=this._extent;t[0]<r[0]&&(r[0]=t[0]),t[1]>r[1]&&(r[1]=t[1]),this.setExtent(r[0],r[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=r9(t)},e.prototype.getTicks=function(t){var r=this._interval,i=this._extent,a=this._niceExtent,s=this._intervalPrecision,o=[];if(!r)return o;var l=1e4;i[0]<a[0]&&(t?o.push({value:Kc(a[0]-r,s)}):o.push({value:i[0]}));for(var u=a[0];u<=a[1]&&(o.push({value:u}),u=Kc(u+r,s),u!==o[o.length-1].value);)if(o.length>l)return[];var c=o.length?o[o.length-1].value:a[1];return i[1]>c&&(t?o.push({value:Kc(c+r,s)}):o.push({value:i[1]})),o},e.prototype.getMinorTicks=function(t){for(var r=this.getTicks(!0),i=[],a=this.getExtent(),s=1;s<r.length;s++){for(var o=r[s],l=r[s-1],u=0,c=[],h=o.value-l.value,f=h/t;u<t-1;){var d=Kc(l.value+(u+1)*f);d>a[0]&&d<a[1]&&c.push(d),u++}i.push(c)}return i},e.prototype.getLabel=function(t,r){if(t==null)return"";var i=r&&r.precision;i==null?i=Go(t.value)||0:i==="auto"&&(i=this._intervalPrecision);var a=Kc(t.value,i,!0);return I7(a)},e.prototype.calcNiceTicks=function(t,r,i){t=t||5;var a=this._extent,s=a[1]-a[0];if(isFinite(s)){s<0&&(s=-s,a.reverse());var o=fae(a,t,r,i);this._intervalPrecision=o.intervalPrecision,this._interval=o.interval,this._niceExtent=o.niceTickExtent}},e.prototype.calcNiceExtent=function(t){var r=this._extent;if(r[0]===r[1])if(r[0]!==0){var i=Math.abs(r[0]);t.fixMax||(r[1]+=i/2),r[0]-=i/2}else r[1]=1;var a=r[1]-r[0];isFinite(a)||(r[0]=0,r[1]=1),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);var s=this._interval;t.fixMin||(r[0]=Kc(Math.floor(r[0]/s)*s)),t.fixMax||(r[1]=Kc(Math.ceil(r[1]/s)*s))},e.prototype.setNiceExtent=function(t,r){this._niceExtent=[t,r]},e.type="interval",e}(Kl);Kl.registerClass(a9);const pc=a9;var s9=typeof Float32Array!="undefined",pae=s9?Float32Array:Array;function Uo(n){return Ie(n)?s9?new Float32Array(n):n:new pae(n)}var yC="__ec_stack_";function fL(n){return n.get("stack")||yC+n.seriesIndex}function dL(n){return n.dim+n.index}function vae(n){var e=[],t=n.axis,r="axis0";if(t.type==="category"){for(var i=t.getBandWidth(),a=0;a<n.count;a++)e.push(dt({bandWidth:i,axisKey:r,stackId:yC+a},n));for(var s=u9(e),o=[],a=0;a<n.count;a++){var l=s[r][yC+a];l.offsetCenter=l.offset+l.width/2,o.push(l)}return o}}function o9(n,e){var t=[];return e.eachSeriesByType(n,function(r){f9(r)&&t.push(r)}),t}function gae(n){var e={};z(n,function(l){var u=l.coordinateSystem,c=u.getBaseAxis();if(!(c.type!=="time"&&c.type!=="value"))for(var h=l.getData(),f=c.dim+"_"+c.index,d=h.getDimensionIndex(h.mapDimension(c.dim)),p=h.getStore(),g=0,v=p.count();g<v;++g){var m=p.get(d,g);e[f]?e[f].push(m):e[f]=[m]}});var t={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];if(i){i.sort(function(l,u){return l-u});for(var a=null,s=1;s<i.length;++s){var o=i[s]-i[s-1];o>0&&(a=a===null?o:Math.min(a,o))}t[r]=a}}return t}function l9(n){var e=gae(n),t=[];return z(n,function(r){var i=r.coordinateSystem,a=i.getBaseAxis(),s=a.getExtent(),o;if(a.type==="category")o=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],c=Math.abs(s[1]-s[0]),h=a.scale.getExtent(),f=Math.abs(h[1]-h[0]);o=u?c/f*u:c}else{var d=r.getData();o=Math.abs(s[1]-s[0])/d.count()}var p=Xe(r.get("barWidth"),o),g=Xe(r.get("barMaxWidth"),o),v=Xe(r.get("barMinWidth")||(d9(r)?.5:1),o),m=r.get("barGap"),y=r.get("barCategoryGap");t.push({bandWidth:o,barWidth:p,barMaxWidth:g,barMinWidth:v,barGap:m,barCategoryGap:y,axisKey:dL(a),stackId:fL(r)})}),u9(t)}function u9(n){var e={};z(n,function(r,i){var a=r.axisKey,s=r.bandWidth,o=e[a]||{bandWidth:s,remainedWidth:s,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=o.stacks;e[a]=o;var u=r.stackId;l[u]||o.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var c=r.barWidth;c&&!l[u].width&&(l[u].width=c,c=Math.min(o.remainedWidth,c),o.remainedWidth-=c);var h=r.barMaxWidth;h&&(l[u].maxWidth=h);var f=r.barMinWidth;f&&(l[u].minWidth=f);var d=r.barGap;d!=null&&(o.gap=d);var p=r.barCategoryGap;p!=null&&(o.categoryGap=p)});var t={};return z(e,function(r,i){t[i]={};var a=r.stacks,s=r.bandWidth,o=r.categoryGap;if(o==null){var l=Yt(a).length;o=Math.max(35-l*4,15)+"%"}var u=Xe(o,s),c=Xe(r.gap,1),h=r.remainedWidth,f=r.autoWidthCount,d=(h-u)/(f+(f-1)*c);d=Math.max(d,0),z(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&&y<x&&(x=Math.min(y,h)),_&&_>x&&(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;z(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;z(a,function(m,y){t[i][y]=t[i][y]||{bandWidth:s,offset:v,width:m.width},v+=m.width*(1+c)})}),t}function mae(n,e,t){if(n&&e){var r=n[dL(e)];return r!=null&&t!=null?r[fL(t)]:r}}function c9(n,e){var t=o9(n,e),r=l9(t);z(t,function(i){var a=i.getData(),s=i.coordinateSystem,o=s.getBaseAxis(),l=fL(i),u=r[dL(o)][l],c=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:h})})}function h9(n){return{seriesType:n,plan:nv(),reset:function(e){if(f9(e)){var t=e.getData(),r=e.coordinateSystem,i=r.getBaseAxis(),a=r.getOtherAxis(i),s=t.getDimensionIndex(t.mapDimension(a.dim)),o=t.getDimensionIndex(t.mapDimension(i.dim)),l=e.get("showBackground",!0),u=t.mapDimension(a.dim),c=t.getCalculationInfo("stackResultDimension"),h=dc(t,u)&&!!t.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),d=yae(i,a),p=d9(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 b=_.count,S=p&&Uo(b*3),w=p&&l&&Uo(b*3),T=p&&Uo(b),C=r.master.getRect(),A=f?C.width:C.height,M,P=x.getStore(),D=0;(M=_.next())!=null;){var L=P.get(h?v:s,M),R=P.get(o,M),N=d,F=void 0;h&&(F=+L-P.get(s,M));var O=void 0,H=void 0,U=void 0,$=void 0;if(f){var Y=r.dataToPoint([L,R]);if(h){var oe=r.dataToPoint([F,R]);N=oe[0]}O=N,H=Y[1]+y,U=Y[0]-N,$=m,Math.abs(U)<g&&(U=(U<0?-1:1)*g)}else{var Y=r.dataToPoint([R,L]);if(h){var oe=r.dataToPoint([R,F]);N=oe[1]}O=Y[0]+y,H=N,U=m,$=Y[1]-N,Math.abs($)<g&&($=($<=0?-1:1)*g)}p?(S[D]=O,S[D+1]=H,S[D+2]=f?U:$,w&&(w[D]=f?C.x:O,w[D+1]=f?H:C.y,w[D+2]=A),T[M]=M):x.setItemLayout(M,{x:O,y:H,width:U,height:$}),D+=3}p&&x.setLayout({largePoints:S,largeDataIndices:T,largeBackgroundPoints:w,valueAxisHorizontal:f})}}}}}}function f9(n){return n.coordinateSystem&&n.coordinateSystem.type==="cartesian2d"}function d9(n){return n.pipelineContext&&n.pipelineContext.large}function yae(n,e){var t=e.model.get("startValue");return t||(t=0),e.toGlobalCoord(e.dataToCoord(e.type==="log"?t>0?t:1:t))}var _ae=function(n,e,t,r){for(;t<r;){var i=t+r>>>1;n[i][1]<e?t=i+1:r=i}return t},p9=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="time",r}return e.prototype.getLabel=function(t){var r=this.getSetting("useUTC");return lS(t.value,KI[Vte(ip(this._minLevelUnit))]||KI.second,r,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(t,r,i){var a=this.getSetting("useUTC"),s=this.getSetting("locale");return Hte(t,r,i,s,a)},e.prototype.getTicks=function(){var t=this._interval,r=this._extent,i=[];if(!t)return i;i.push({value:r[0],level:0});var a=this.getSetting("useUTC"),s=Tae(this._minLevelUnit,this._approxInterval,a,r);return i=i.concat(s),i.push({value:r[1],level:0}),i},e.prototype.calcNiceExtent=function(t){var r=this._extent;if(r[0]===r[1]&&(r[0]-=Ts,r[1]+=Ts),r[1]===-1/0&&r[0]===1/0){var i=new Date;r[1]=+new Date(i.getFullYear(),i.getMonth(),i.getDate()),r[0]=r[1]-Ts}this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval)},e.prototype.calcNiceTicks=function(t,r,i){t=t||10;var a=this._extent,s=a[1]-a[0];this._approxInterval=s/t,r!=null&&this._approxInterval<r&&(this._approxInterval=r),i!=null&&this._approxInterval>i&&(this._approxInterval=i);var o=$y.length,l=Math.min(_ae($y,this._approxInterval,0,o),o-1);this._interval=$y[l][1],this._minLevelUnit=$y[Math.max(l-1,0)][0]},e.prototype.parse=function(t){return un(t)?t:+Qo(t)},e.prototype.contain=function(t){return xS(this.parse(t),this._extent)},e.prototype.normalize=function(t){return bS(this.parse(t),this._extent)},e.prototype.scale=function(t){return SS(t,this._extent)},e.type="time",e}(pc),$y=[["second",$P],["minute",jP],["hour",am],["quarter-day",am*6],["half-day",am*12],["day",Ts*1.2],["half-week",Ts*3.5],["week",Ts*7],["month",Ts*31],["quarter",Ts*95],["half-year",YI/2],["year",YI]];function xae(n,e,t,r){var i=Qo(e),a=Qo(t),s=function(p){return ZI(i,p,r)===ZI(a,p,r)},o=function(){return s("year")},l=function(){return o()&&s("month")},u=function(){return l()&&s("day")},c=function(){return u()&&s("hour")},h=function(){return c()&&s("minute")},f=function(){return h()&&s("second")},d=function(){return f()&&s("millisecond")};switch(n){case"year":return o();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 bae(n,e){return n/=Ts,n>16?16:n>7.5?7:n>3.5?4:n>1.5?2:1}function Sae(n){var e=30*Ts;return n/=e,n>6?6:n>3?3:n>2?2:1}function wae(n){return n/=am,n>12?12:n>6?6:n>3.5?4:n>2?2:1}function o4(n,e){return n/=e?jP:$P,n>30?30:n>20?20:n>15?15:n>10?10:n>5?5:n>2?2:1}function Aae(n){return pU(n,!0)}function Mae(n,e,t){var r=new Date(n);switch(ip(e)){case"year":case"month":r[C7(t)](0);case"day":r[E7(t)](1);case"hour":r[P7(t)](0);case"minute":r[L7(t)](0);case"second":r[R7(t)](0),r[D7(t)](0)}return r.getTime()}function Tae(n,e,t,r){var i=1e4,a=M7,s=0;function o(A,M,P,D,L,R,N){for(var F=new Date(M),O=M,H=F[D]();O<P&&O<=r[1];)N.push({value:O}),H+=A,F[L](H),O=F.getTime();N.push({value:O,notAdd:!0})}function l(A,M,P){var D=[],L=!M.length;if(!xae(ip(A),r[0],r[1],t)){L&&(M=[{value:Mae(new Date(r[0]),A,t)},{value:r[1]}]);for(var R=0;R<M.length-1;R++){var N=M[R].value,F=M[R+1].value;if(N!==F){var O=void 0,H=void 0,U=void 0,$=!1;switch(A){case"year":O=Math.max(1,Math.round(e/Ts/365)),H=qP(t),U=Wte(t);break;case"half-year":case"quarter":case"month":O=Sae(e),H=ap(t),U=C7(t);break;case"week":case"half-week":case"day":O=bae(e),H=uS(t),U=E7(t),$=!0;break;case"half-day":case"quarter-day":case"hour":O=wae(e),H=Wm(t),U=P7(t);break;case"minute":O=o4(e,!0),H=cS(t),U=L7(t);break;case"second":O=o4(e,!1),H=hS(t),U=R7(t);break;case"millisecond":O=Aae(e),H=fS(t),U=D7(t);break}o(O,N,F,H,U,$,D),A==="year"&&P.length>1&&R===0&&P.unshift({value:P[0].value-O})}}for(var R=0;R<D.length;R++)P.push(D[R]);return D}}for(var u=[],c=[],h=0,f=0,d=0;d<a.length&&s++<i;++d){var p=ip(a[d]);if(Ute(a[d])){l(a[d],u[u.length-1]||[],c);var g=a[d+1]?ip(a[d+1]):null;if(p!==g){if(c.length){f=h,c.sort(function(A,M){return A.value-M.value});for(var v=[],m=0;m<c.length;++m){var y=c[m].value;(m===0||c[m-1].value!==y)&&(v.push(c[m]),y>=r[0]&&y<=r[1]&&h++)}var _=(r[1]-r[0])/e;if(h>_*1.5&&f>_/1.5||(u.push(v),h>_||n===a[d]))break}c=[]}}}for(var x=_n(Ne(u,function(A){return _n(A,function(M){return M.value>=r[0]&&M.value<=r[1]&&!M.notAdd})}),function(A){return A.length>0}),b=[],S=x.length-1,d=0;d<x.length;++d)for(var w=x[d],T=0;T<w.length;++T)b.push({value:w[T].value,level:S-d});b.sort(function(A,M){return A.value-M.value});for(var C=[],d=0;d<b.length;++d)(d===0||b[d].value!==b[d-1].value)&&C.push(b[d]);return C}Kl.registerClass(p9);const v9=p9;var l4=Kl.prototype,um=pc.prototype,Cae=xr,Eae=Math.floor,Pae=Math.ceil,jy=Math.pow,$s=Math.log,pL=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new pc,t._interval=0,t}return e.prototype.getTicks=function(t){var r=this._originalScale,i=this._extent,a=r.getExtent(),s=um.getTicks.call(this,t);return Ne(s,function(o){var l=o.value,u=xr(jy(this.base,l));return u=l===i[0]&&this._fixMin?qy(u,a[0]):u,u=l===i[1]&&this._fixMax?qy(u,a[1]):u,{value:u}},this)},e.prototype.setExtent=function(t,r){var i=$s(this.base);t=$s(Math.max(0,t))/i,r=$s(Math.max(0,r))/i,um.setExtent.call(this,t,r)},e.prototype.getExtent=function(){var t=this.base,r=l4.getExtent.call(this);r[0]=jy(t,r[0]),r[1]=jy(t,r[1]);var i=this._originalScale,a=i.getExtent();return this._fixMin&&(r[0]=qy(r[0],a[0])),this._fixMax&&(r[1]=qy(r[1],a[1])),r},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var r=this.base;t[0]=$s(t[0])/$s(r),t[1]=$s(t[1])/$s(r),l4.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,r){this.unionExtent(t.getApproximateExtent(r))},e.prototype.calcNiceTicks=function(t){t=t||10;var r=this._extent,i=r[1]-r[0];if(!(i===1/0||i<=0)){var a=fJ(i),s=t/i*a;for(s<=.5&&(a*=10);!isNaN(a)&&Math.abs(a)<1&&Math.abs(a)>0;)a*=10;var o=[xr(Pae(r[0]/a)*a),xr(Eae(r[1]/a)*a)];this._interval=a,this._niceExtent=o}},e.prototype.calcNiceExtent=function(t){um.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=$s(t)/$s(this.base),xS(t,this._extent)},e.prototype.normalize=function(t){return t=$s(t)/$s(this.base),bS(t,this._extent)},e.prototype.scale=function(t){return t=SS(t,this._extent),jy(this.base,t)},e.type="log",e}(Kl),g9=pL.prototype;g9.getMinorTicks=um.getMinorTicks;g9.getLabel=um.getLabel;function qy(n,e){return Cae(n,Go(e))}Kl.registerClass(pL);const Lae=pL;var Rae=function(){function n(e,t,r){this._prepareParams(e,t,r)}return n.prototype._prepareParams=function(e,t,r){r[1]<r[0]&&(r=[NaN,NaN]),this._dataMin=r[0],this._dataMax=r[1];var i=this._isOrdinal=e.type==="ordinal";this._needCrossZero=e.type==="interval"&&t.getNeedCrossZero&&t.getNeedCrossZero();var a=t.get("min",!0);a==null&&(a=t.get("startValue",!0));var s=this._modelMinRaw=a;ct(s)?this._modelMinNum=Xy(e,s({min:r[0],max:r[1]})):s!=="dataMin"&&(this._modelMinNum=Xy(e,s));var o=this._modelMaxRaw=t.get("max",!0);if(ct(o)?this._modelMaxNum=Xy(e,o({min:r[0],max:r[1]})):o!=="dataMax"&&(this._modelMaxNum=Xy(e,o)),i)this._axisDataLen=t.getCategories().length;else{var l=t.get("boundaryGap"),u=Ie(l)?l:[l||0,l||0];typeof u[0]=="boolean"||typeof u[1]=="boolean"?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[uo(u[0],1),uo(u[1],1)]}},n.prototype.calculate=function(){var e=this._isOrdinal,t=this._dataMin,r=this._dataMax,i=this._axisDataLen,a=this._boundaryGapInner,s=e?null:r-t||Math.abs(t),o=this._modelMinRaw==="dataMin"?t:this._modelMinNum,l=this._modelMaxRaw==="dataMax"?r:this._modelMaxNum,u=o!=null,c=l!=null;o==null&&(o=e?i?0:NaN:t-a[0]*s),l==null&&(l=e?i?i-1:NaN:r+a[1]*s),(o==null||!isFinite(o))&&(o=NaN),(l==null||!isFinite(l))&&(l=NaN);var h=Im(o)||Im(l)||e&&!i;this._needCrossZero&&(o>0&&l>0&&!u&&(o=0),o<0&&l<0&&!c&&(l=0));var f=this._determinedMin,d=this._determinedMax;return f!=null&&(o=f,u=!0),d!=null&&(l=d,c=!0),{min:o,max:l,minFixed:u,maxFixed:c,isBlank:h}},n.prototype.modifyDataMinMax=function(e,t){this[Iae[e]]=t},n.prototype.setDeterminedMinMax=function(e,t){var r=Dae[e];this[r]=t},n.prototype.freeze=function(){this.frozen=!0},n}(),Dae={min:"_determinedMin",max:"_determinedMax"},Iae={min:"_dataMin",max:"_dataMax"};function m9(n,e,t){var r=n.rawExtentInfo;return r||(r=new Rae(n,e,t),n.rawExtentInfo=r,r)}function Xy(n,e){return e==null?null:Im(e)?NaN:n.parse(e)}function y9(n,e){var t=n.type,r=m9(n,e,n.getExtent()).calculate();n.setBlank(r.isBlank);var i=r.min,a=r.max,s=e.ecModel;if(s&&t==="time"){var o=o9("bar",s),l=!1;if(z(o,function(h){l=l||h.getBaseAxis()===e.axis}),l){var u=l9(o),c=Nae(i,a,e,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:r.minFixed,fixMax:r.maxFixed}}function Nae(n,e,t,r){var i=t.axis.getExtent(),a=Math.abs(i[1]-i[0]),s=mae(r,t.axis);if(s===void 0)return{min:n,max:e};var o=1/0;z(s,function(d){o=Math.min(d.offset,o)});var l=-1/0;z(s,function(d){l=Math.max(d.offset+d.width,l)}),o=Math.abs(o),l=Math.abs(l);var u=o+l,c=e-n,h=1-(o+l)/a,f=c/h-c;return e+=f*(l/u),n-=f*(o/u),{min:n,max:e}}function Ap(n,e){var t=e,r=y9(n,t),i=r.extent,a=t.get("splitNumber");n instanceof Lae&&(n.base=t.get("logBase"));var s=n.type,o=t.get("interval"),l=s==="interval"||s==="time";n.setExtent(i[0],i[1]),n.calcNiceExtent({splitNumber:a,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:l?t.get("minInterval"):null,maxInterval:l?t.get("maxInterval"):null}),o!=null&&n.setInterval&&n.setInterval(o)}function wS(n,e){if(e=e||n.get("type"),e)switch(e){case"category":return new hL({ordinalMeta:n.getOrdinalMeta?n.getOrdinalMeta():n.getCategories(),extent:[1/0,-1/0]});case"time":return new v9({locale:n.ecModel.getLocaleModel(),useUTC:n.ecModel.get("useUTC")});default:return new(Kl.getClass(e)||pc)}}function kae(n){var e=n.scale.getExtent(),t=e[0],r=e[1];return!(t>0&&r>0||t<0&&r<0)}function av(n){var e=n.getLabelModel().get("formatter"),t=n.type==="category"?n.scale.getExtent()[0]:null;return n.scale.type==="time"?function(r){return function(i,a){return n.scale.getFormattedLabel(i,a,r)}}(e):Ke(e)?function(r){return function(i){var a=n.scale.getLabel(i),s=r.replace("{value}",a!=null?a:"");return s}}(e):ct(e)?function(r){return function(i,a){return t!=null&&(a=i.value-t),r(vL(n,i),a,i.level!=null?{level:i.level}:null)}}(e):function(r){return n.scale.getLabel(r)}}function vL(n,e){return n.type==="category"?n.scale.getLabel(e):e.value}function Oae(n){var e=n.model,t=n.scale;if(!(!e.get(["axisLabel","show"])||t.isBlank())){var r,i,a=t.getExtent();t instanceof hL?i=t.count():(r=t.getTicks(),i=r.length);var s=n.getLabelModel(),o=av(n),l,u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;c<i;c+=u){var h=r?r[c]:{value:a[0]+c},f=o(h,c),d=s.getTextRect(f),p=Fae(d,s.get("rotate")||0);l?l.union(p):l=p}return l}}function Fae(n,e){var t=e*Math.PI/180,r=n.width,i=n.height,a=r*Math.abs(Math.cos(t))+Math.abs(i*Math.sin(t)),s=r*Math.abs(Math.sin(t))+Math.abs(i*Math.cos(t)),o=new Ot(n.x,n.y,a,s);return o}function gL(n){var e=n.get("interval");return e==null?"auto":e}function _9(n){return n.type==="category"&&gL(n.getLabelModel())===0}function zx(n,e){var t={};return z(n.mapDimensionsAll(e),function(r){t[t9(n,r)]=!0}),Yt(t)}function Bae(n,e,t){e&&z(zx(e,t),function(r){var i=e.getApproximateExtent(r);i[0]<n[0]&&(n[0]=i[0]),i[1]>n[1]&&(n[1]=i[1])})}var B0=function(){function n(){}return n.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},n.prototype.getCoordSysModel=function(){},n}(),Gae=1e-8;function u4(n,e){return Math.abs(n-e)<Gae}function bh(n,e,t){var r=0,i=n[0];if(!i)return!1;for(var a=1;a<n.length;a++){var s=n[a];r+=Al(i[0],i[1],s[0],s[1],e,t),i=s}var o=n[0];return(!u4(i[0],o[0])||!u4(i[1],o[1]))&&(r+=Al(i[0],i[1],o[0],o[1],e,t)),r!==0}var zae=[];function DA(n,e){for(var t=0;t<n.length;t++)Mi(n[t],n[t],e)}function c4(n,e,t,r){for(var i=0;i<n.length;i++){var a=n[i];r&&(a=r.project(a)),a&&isFinite(a[0])&&isFinite(a[1])&&(Fu(e,e,a),Bu(t,t,a))}}function Uae(n){for(var e=0,t=0,r=0,i=n.length,a=n[i-1][0],s=n[i-1][1],o=0;o<i;o++){var l=n[o][0],u=n[o][1],c=a*u-l*s;e+=c,t+=(a+l)*c,r+=(s+u)*c,a=l,s=u}return e?[t/e/3,r/e/3,e]:[n[0][0]||0,n[0][1]||0]}var x9=function(){function n(e){this.name=e}return n.prototype.setCenter=function(e){this._center=e},n.prototype.getCenter=function(){var e=this._center;return e||(e=this._center=this.calcCenter()),e},n}(),h4=function(){function n(e,t){this.type="polygon",this.exterior=e,this.interiors=t}return n}(),f4=function(){function n(e){this.type="linestring",this.points=e}return n}(),b9=function(n){ve(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.type="geoJSON",a.geometries=r,a._center=i&&[i[0],i[1]],a}return e.prototype.calcCenter=function(){for(var t=this.geometries,r,i=0,a=0;a<t.length;a++){var s=t[a],o=s.exterior,l=o&&o.length;l>i&&(r=s,i=l)}if(r)return Uae(r.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(t){var r=this._rect;if(r&&!t)return r;var i=[1/0,1/0],a=[-1/0,-1/0],s=this.geometries;return z(s,function(o){o.type==="polygon"?c4(o.exterior,i,a,t):z(o.points,function(l){c4(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),r=new Ot(i[0],i[1],a[0]-i[0],a[1]-i[1]),t||(this._rect=r),r},e.prototype.contain=function(t){var r=this.getBoundingRect(),i=this.geometries;if(!r.contain(t[0],t[1]))return!1;e:for(var a=0,s=i.length;a<s;a++){var o=i[a];if(o.type==="polygon"){var l=o.exterior,u=o.interiors;if(bh(l,t[0],t[1])){for(var c=0;c<(u?u.length:0);c++)if(bh(u[c],t[0],t[1]))continue e;return!0}}}return!1},e.prototype.transformTo=function(t,r,i,a){var s=this.getBoundingRect(),o=s.width/s.height;i?a||(a=i/o):i=o*a;for(var l=new Ot(t,r,i,a),u=s.calculateTransform(l),c=this.geometries,h=0;h<c.length;h++){var f=c[h];f.type==="polygon"?(DA(f.exterior,u),z(f.interiors,function(d){DA(d,u)})):z(f.points,function(d){DA(d,u)})}s=this._rect,s.copy(l),this._center=[s.x+s.width/2,s.y+s.height/2]},e.prototype.cloneShallow=function(t){t==null&&(t=this.name);var r=new e(t,this.geometries,this._center);return r._rect=this._rect,r.transformTo=null,r},e}(x9),Vae=function(n){ve(e,n);function e(t,r){var i=n.call(this,t)||this;return i.type="geoSVG",i._elOnlyForCalculate=r,i}return e.prototype.calcCenter=function(){for(var t=this._elOnlyForCalculate,r=t.getBoundingRect(),i=[r.x+r.width/2,r.y+r.height/2],a=Xb(zae),s=t;s&&!s.isGeoSVGGraphicRoot;)Dl(a,s.getLocalTransform(),a),s=s.parent;return jp(a,a),Mi(i,i,a),i},e}(x9);function Hae(n){if(!n.UTF8Encoding)return n;var e=n,t=e.UTF8Scale;t==null&&(t=1024);var r=e.features;return z(r,function(i){var a=i.geometry,s=a.encodeOffsets,o=a.coordinates;if(s)switch(a.type){case"LineString":a.coordinates=S9(o,s,t);break;case"Polygon":IA(o,s,t);break;case"MultiLineString":IA(o,s,t);break;case"MultiPolygon":z(o,function(l,u){return IA(l,s[u],t)})}}),e.UTF8Encoding=!1,e}function IA(n,e,t){for(var r=0;r<n.length;r++)n[r]=S9(n[r],e[r],t)}function S9(n,e,t){for(var r=[],i=e[0],a=e[1],s=0;s<n.length;s+=2){var o=n.charCodeAt(s)-64,l=n.charCodeAt(s+1)-64;o=o>>1^-(o&1),l=l>>1^-(l&1),o+=i,l+=a,i=o,a=l,r.push([o/t,l/t])}return r}function Wae(n,e){return n=Hae(n),Ne(_n(n.features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var r=t.properties,i=t.geometry,a=[];switch(i.type){case"Polygon":var s=i.coordinates;a.push(new h4(s[0],s.slice(1)));break;case"MultiPolygon":z(i.coordinates,function(l){l[0]&&a.push(new h4(l[0],l.slice(1)))});break;case"LineString":a.push(new f4([i.coordinates]));break;case"MultiLineString":a.push(new f4(i.coordinates))}var o=new b9(r[e||"name"],a,r.cp);return o.properties=r,o})}var Km=en();function w9(n,e){var t=Ne(e,function(r){return n.scale.parse(r)});return n.type==="time"&&t.length>0&&(t.sort(),t.unshift(t[0]),t.push(t[t.length-1])),t}function $ae(n){var e=n.getLabelModel().get("customValues");if(e){var t=av(n),r=n.scale.getExtent(),i=w9(n,e),a=_n(i,function(s){return s>=r[0]&&s<=r[1]});return{labels:Ne(a,function(s){var o={value:s};return{formattedLabel:t(o),rawLabel:n.scale.getLabel(o),tickValue:s}})}}return n.type==="category"?qae(n):Yae(n)}function jae(n,e){var t=n.getTickModel().get("customValues");if(t){var r=n.scale.getExtent(),i=w9(n,t);return{ticks:_n(i,function(a){return a>=r[0]&&a<=r[1]})}}return n.type==="category"?Xae(n,e):{ticks:Ne(n.scale.getTicks(),function(a){return a.value})}}function qae(n){var e=n.getLabelModel(),t=A9(n,e);return!e.get("show")||n.scale.isBlank()?{labels:[],labelCategoryInterval:t.labelCategoryInterval}:t}function A9(n,e){var t=M9(n,"labels"),r=gL(e),i=T9(t,r);if(i)return i;var a,s;return ct(r)?a=P9(n,r):(s=r==="auto"?Kae(n):r,a=E9(n,s)),C9(t,r,{labels:a,labelCategoryInterval:s})}function Xae(n,e){var t=M9(n,"ticks"),r=gL(e),i=T9(t,r);if(i)return i;var a,s;if((!e.get("show")||n.scale.isBlank())&&(a=[]),ct(r))a=P9(n,r,!0);else if(r==="auto"){var o=A9(n,n.getLabelModel());s=o.labelCategoryInterval,a=Ne(o.labels,function(l){return l.tickValue})}else s=r,a=E9(n,s,!0);return C9(t,r,{ticks:a,tickCategoryInterval:s})}function Yae(n){var e=n.scale.getTicks(),t=av(n);return{labels:Ne(e,function(r,i){return{level:r.level,formattedLabel:t(r,i),rawLabel:n.scale.getLabel(r),tickValue:r.value}})}}function M9(n,e){return Km(n)[e]||(Km(n)[e]=[])}function T9(n,e){for(var t=0;t<n.length;t++)if(n[t].key===e)return n[t].value}function C9(n,e,t){return n.push({key:e,value:t}),t}function Kae(n){var e=Km(n).autoInterval;return e!=null?e:Km(n).autoInterval=n.calculateCategoryInterval()}function Zae(n){var e=Qae(n),t=av(n),r=(e.axisRotate-e.labelRotate)/180*Math.PI,i=n.scale,a=i.getExtent(),s=i.count();if(a[1]-a[0]<1)return 0;var o=1;s>40&&(o=Math.max(1,Math.floor(s/40)));for(var l=a[0],u=n.dataToCoord(l+1)-n.dataToCoord(l),c=Math.abs(u*Math.cos(r)),h=Math.abs(u*Math.sin(r)),f=0,d=0;l<=a[1];l+=o){var p=0,g=0,v=L0(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=Km(n.model),b=n.getExtent(),S=x.lastAutoInterval,w=x.lastTickCount;return S!=null&&w!=null&&Math.abs(S-_)<=1&&Math.abs(w-s)<=1&&S>_&&x.axisExtent0===b[0]&&x.axisExtent1===b[1]?_=S:(x.lastTickCount=s,x.lastAutoInterval=_,x.axisExtent0=b[0],x.axisExtent1=b[1]),_}function Qae(n){var e=n.getLabelModel();return{axisRotate:n.getRotate?n.getRotate():n.isHorizontal&&!n.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function E9(n,e,t){var r=av(n),i=n.scale,a=i.getExtent(),s=n.getLabelModel(),o=[],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=_9(n),f=s.get("showMinLabel")||h,d=s.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};o.push(t?v:{formattedLabel:r(m),rawLabel:i.getLabel(m),tickValue:v})}return o}function P9(n,e,t){var r=n.scale,i=av(n),a=[];return z(r.getTicks(),function(s){var o=r.getLabel(s),l=s.value;e(s.value,o)&&a.push(t?l:{formattedLabel:i(s),rawLabel:o,tickValue:l})}),a}var d4=[0,1],Jae=function(){function n(e,t,r){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=r||[0,0]}return n.prototype.contain=function(e){var t=this._extent,r=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=r&&e<=i},n.prototype.containData=function(e){return this.scale.contain(e)},n.prototype.getExtent=function(){return this._extent.slice()},n.prototype.getPixelPrecision=function(e){return fU(e||this.scale.getExtent(),this._extent)},n.prototype.setExtent=function(e,t){var r=this._extent;r[0]=e,r[1]=t},n.prototype.dataToCoord=function(e,t){var r=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&i.type==="ordinal"&&(r=r.slice(),p4(r,i.count())),Sn(e,d4,r,t)},n.prototype.coordToData=function(e,t){var r=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(r=r.slice(),p4(r,i.count()));var a=Sn(e,r,d4,t);return this.scale.scale(a)},n.prototype.pointToData=function(e,t){},n.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),r=jae(this,t),i=r.ticks,a=Ne(i,function(o){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(o):o),tickValue:o}},this),s=t.get("alignWithLabel");return ese(this,a,s,e.clamp),a},n.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 r=this.scale.getMinorTicks(t),i=Ne(r,function(a){return Ne(a,function(s){return{coord:this.dataToCoord(s),tickValue:s}},this)},this);return i},n.prototype.getViewLabels=function(){return $ae(this).labels},n.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},n.prototype.getTickModel=function(){return this.model.getModel("axisTick")},n.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),r=t[1]-t[0]+(this.onBand?1:0);r===0&&(r=1);var i=Math.abs(e[1]-e[0]);return Math.abs(i)/r},n.prototype.calculateCategoryInterval=function(){return Zae(this)},n}();function p4(n,e){var t=n[1]-n[0],r=e,i=t/r/2;n[0]+=i,n[1]-=i}function ese(n,e,t,r){var i=e.length;if(!n.onBand||t||!i)return;var a=n.getExtent(),s,o;if(i===1)e[0].coord=a[0],s=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;z(e,function(d){d.coord-=u/2});var c=n.scale.getExtent();o=1+c[1]-e[i-1].tickValue,s={coord:e[i-1].coord+u*o,tickValue:c[1]+1},e.push(s)}var h=a[0]>a[1];f(e[0].coord,a[0])&&(r?e[0].coord=a[0]:e.shift()),r&&f(a[0],e[0].coord)&&e.unshift({coord:a[0]}),f(a[1],s.coord)&&(r?s.coord=a[1]:e.pop()),r&&f(s.coord,a[1])&&e.push({coord:a[1]});function f(d,p){return d=xr(d),p=xr(p),h?d>p:d<p}}const po=Jae;var eg=Math.PI*2,Zc=Jo.CMD,tse=["top","right","bottom","left"];function nse(n,e,t,r,i){var a=t.width,s=t.height;switch(n){case"top":r.set(t.x+a/2,t.y-e),i.set(0,-1);break;case"bottom":r.set(t.x+a/2,t.y+s+e),i.set(0,1);break;case"left":r.set(t.x-e,t.y+s/2),i.set(-1,0);break;case"right":r.set(t.x+a+e,t.y+s/2),i.set(1,0);break}}function rse(n,e,t,r,i,a,s,o,l){s-=n,o-=e;var u=Math.sqrt(s*s+o*o);s/=u,o/=u;var c=s*t+n,h=o*t+e;if(Math.abs(r-i)%eg<1e-4)return l[0]=c,l[1]=h,u-t;if(a){var f=r;r=Xa(i),i=Xa(f)}else r=Xa(r),i=Xa(i);r>i&&(i+=eg);var d=Math.atan2(o,s);if(d<0&&(d+=eg),d>=r&&d<=i||d+eg>=r&&d+eg<=i)return l[0]=c,l[1]=h,u-t;var p=t*Math.cos(r)+n,g=t*Math.sin(r)+e,v=t*Math.cos(i)+n,m=t*Math.sin(i)+e,y=(p-s)*(p-s)+(g-o)*(g-o),_=(v-s)*(v-s)+(m-o)*(m-o);return y<_?(l[0]=p,l[1]=g,Math.sqrt(y)):(l[0]=v,l[1]=m,Math.sqrt(_))}function Ux(n,e,t,r,i,a,s,o){var l=i-n,u=a-e,c=t-n,h=r-e,f=Math.sqrt(c*c+h*h);c/=f,h/=f;var d=l*c+u*h,p=d/f;o&&(p=Math.min(Math.max(p,0),1)),p*=f;var g=s[0]=n+p*c,v=s[1]=e+p*h;return Math.sqrt((g-i)*(g-i)+(v-a)*(v-a))}function L9(n,e,t,r,i,a,s){t<0&&(n=n+t,t=-t),r<0&&(e=e+r,r=-r);var o=n+t,l=e+r,u=s[0]=Math.min(Math.max(i,n),o),c=s[1]=Math.min(Math.max(a,e),l);return Math.sqrt((u-i)*(u-i)+(c-a)*(c-a))}var Qs=[];function ise(n,e,t){var r=L9(e.x,e.y,e.width,e.height,n.x,n.y,Qs);return t.set(Qs[0],Qs[1]),r}function ase(n,e,t){for(var r=0,i=0,a=0,s=0,o,l,u=1/0,c=e.data,h=n.x,f=n.y,d=0;d<c.length;){var p=c[d++];d===1&&(r=c[d],i=c[d+1],a=r,s=i);var g=u;switch(p){case Zc.M:a=c[d++],s=c[d++],r=a,i=s;break;case Zc.L:g=Ux(r,i,c[d],c[d+1],h,f,Qs,!0),r=c[d++],i=c[d++];break;case Zc.C:g=jz(r,i,c[d++],c[d++],c[d++],c[d++],c[d],c[d+1],h,f,Qs),r=c[d++],i=c[d++];break;case Zc.Q:g=Xz(r,i,c[d++],c[d++],c[d],c[d+1],h,f,Qs),r=c[d++],i=c[d++];break;case Zc.A:var v=c[d++],m=c[d++],y=c[d++],_=c[d++],x=c[d++],b=c[d++];d+=1;var S=!!(1-c[d++]);o=Math.cos(x)*y+v,l=Math.sin(x)*_+m,d<=1&&(a=o,s=l);var w=(h-v)*_/y+v;g=rse(v,m,_,x,x+b,S,w,f,Qs),r=Math.cos(x+b)*y+v,i=Math.sin(x+b)*_+m;break;case Zc.R:a=r=c[d++],s=i=c[d++];var T=c[d++],C=c[d++];g=L9(a,s,T,C,h,f,Qs);break;case Zc.Z:g=Ux(r,i,a,s,h,f,Qs,!0),r=a,i=s;break}g<u&&(u=g,t.set(Qs[0],Qs[1]))}return u}var ro=new Nt,Un=new Nt,Ar=new Nt,Vo=new Nt,No=new Nt;function v4(n,e){if(n){var t=n.getTextGuideLine(),r=n.getTextContent();if(r&&t){var i=n.textGuideLineConfig||{},a=[[0,0],[0,0],[0,0]],s=i.candidates||tse,o=r.getBoundingRect().clone();o.applyTransform(r.getComputedTransform());var l=1/0,u=i.anchor,c=n.getComputedTransform(),h=c&&jp([],c),f=e.get("length2")||0;u&&Ar.copy(u);for(var d=0;d<s.length;d++){var p=s[d];nse(p,0,o,ro,Vo),Nt.scaleAndAdd(Un,ro,Vo,f),Un.transform(h);var g=n.getBoundingRect(),v=u?u.distance(Un):n instanceof Ht?ase(Un,n.path,Ar):ise(Un,g,Ar);v<l&&(l=v,Un.transform(c),Ar.transform(c),Ar.toArray(a[0]),Un.toArray(a[1]),ro.toArray(a[2]))}R9(a,e.get("minTurnAngle")),t.setShape({points:a})}}}var Vx=[],ta=new Nt;function R9(n,e){if(e<=180&&e>0){e=e/180*Math.PI,ro.fromArray(n[0]),Un.fromArray(n[1]),Ar.fromArray(n[2]),Nt.sub(Vo,ro,Un),Nt.sub(No,Ar,Un);var t=Vo.len(),r=No.len();if(!(t<.001||r<.001)){Vo.scale(1/t),No.scale(1/r);var i=Vo.dot(No),a=Math.cos(e);if(a<i){var s=Ux(Un.x,Un.y,Ar.x,Ar.y,ro.x,ro.y,Vx,!1);ta.fromArray(Vx),ta.scaleAndAdd(No,s/Math.tan(Math.PI-e));var o=Ar.x!==Un.x?(ta.x-Un.x)/(Ar.x-Un.x):(ta.y-Un.y)/(Ar.y-Un.y);if(isNaN(o))return;o<0?Nt.copy(ta,Un):o>1&&Nt.copy(ta,Ar),ta.toArray(n[1])}}}}function sse(n,e,t){if(t<=180&&t>0){t=t/180*Math.PI,ro.fromArray(n[0]),Un.fromArray(n[1]),Ar.fromArray(n[2]),Nt.sub(Vo,Un,ro),Nt.sub(No,Ar,Un);var r=Vo.len(),i=No.len();if(!(r<.001||i<.001)){Vo.scale(1/r),No.scale(1/i);var a=Vo.dot(e),s=Math.cos(t);if(a<s){var o=Ux(Un.x,Un.y,Ar.x,Ar.y,ro.x,ro.y,Vx,!1);ta.fromArray(Vx);var l=Math.PI/2,u=Math.acos(No.dot(e)),c=l+u-t;if(c>=l)Nt.copy(ta,Ar);else{ta.scaleAndAdd(No,o/Math.tan(Math.PI/2-c));var h=Ar.x!==Un.x?(ta.x-Un.x)/(Ar.x-Un.x):(ta.y-Un.y)/(Ar.y-Un.y);if(isNaN(h))return;h<0?Nt.copy(ta,Un):h>1&&Nt.copy(ta,Ar)}ta.toArray(n[1])}}}}function NA(n,e,t,r){var i=t==="normal",a=i?n:n.ensureState(t);a.ignore=e;var s=r.get("smooth");s&&s===!0&&(s=.3),a.shape=a.shape||{},s>0&&(a.shape.smooth=s);var o=r.getModel("lineStyle").getLineStyle();i?n.useStyle(o):a.style=o}function ose(n,e){var t=e.smooth,r=e.points;if(r)if(n.moveTo(r[0][0],r[0][1]),t>0&&r.length>=3){var i=Ou(r[0],r[1]),a=Ou(r[1],r[2]);if(!i||!a){n.lineTo(r[1][0],r[1][1]),n.lineTo(r[2][0],r[2][1]);return}var s=Math.min(i,a)*t,o=E1([],r[1],r[0],s/i),l=E1([],r[1],r[2],s/a),u=E1([],o,l,.5);n.bezierCurveTo(o[0],o[1],o[0],o[1],u[0],u[1]),n.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var c=1;c<r.length;c++)n.lineTo(r[c][0],r[c][1])}function mL(n,e,t){var r=n.getTextGuideLine(),i=n.getTextContent();if(!i){r&&n.removeTextGuideLine();return}for(var a=e.normal,s=a.get("show"),o=i.ignore,l=0;l<Um.length;l++){var u=Um[l],c=e[u],h=u==="normal";if(c){var f=c.get("show"),d=h?o:Et(i.states[u]&&i.states[u].ignore,o);if(d||!Et(f,s)){var p=h?r:r&&r.states[u];p&&(p.ignore=!0),r&&NA(r,!0,u,c);continue}r||(r=new Na,n.setTextGuideLine(r),!h&&(o||!s)&&NA(r,!0,"normal",e.normal),n.stateProxy&&(r.stateProxy=n.stateProxy)),NA(r,!1,u,c)}}if(r){dt(r.style,t),r.style.fill=null;var g=a.get("showAbove"),v=n.textGuideLineConfig=n.textGuideLineConfig||{};v.showAbove=g||!1,r.buildPath=ose}}function yL(n,e){e=e||"labelLine";for(var t={normal:n.getModel(e)},r=0;r<oa.length;r++){var i=oa[r];t[i]=n.getModel([i,e])}return t}function D9(n){for(var e=[],t=0;t<n.length;t++){var r=n[t];if(!r.defaultAttr.ignore){var i=r.label,a=i.getComputedTransform(),s=i.getBoundingRect(),o=!a||a[1]<1e-5&&a[2]<1e-5,l=i.style.margin||0,u=s.clone();u.applyTransform(a),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var c=o?new Tx(s,a):null;e.push({label:i,labelLine:r.labelLine,rect:u,localRect:s,obb:c,priority:r.priority,defaultAttr:r.defaultAttr,layoutOption:r.computedLayoutOption,axisAligned:o,transform:a})}}return e}function I9(n,e,t,r,i,a){var s=n.length;if(s<2)return;n.sort(function(T,C){return T.rect[e]-C.rect[e]});for(var o=0,l,u=!1,c=0,h=0;h<s;h++){var f=n[h],d=f.rect;l=d[e]-o,l<0&&(d[e]-=l,f.label[e]-=l,u=!0);var p=Math.max(-l,0);c+=p,o=d[e]+d[t]}c>0&&a&&b(-c/s,0,s);var g=n[0],v=n[s-1],m,y;_(),m<0&&S(-m,.8),y<0&&S(y,.8),_(),x(m,y,1),x(y,m,-1),_(),m<0&&w(-m),y<0&&w(y);function _(){m=g.rect[e]-r,y=i-v.rect[e]-v.rect[t]}function x(T,C,A){if(T<0){var M=Math.min(C,-T);if(M>0){b(M*A,0,s);var P=M+T;P<0&&S(-P*A,1)}else S(-T*A,1)}}function b(T,C,A){T!==0&&(u=!0);for(var M=C;M<A;M++){var P=n[M],D=P.rect;D[e]+=T,P.label[e]+=T}}function S(T,C){for(var A=[],M=0,P=1;P<s;P++){var D=n[P-1].rect,L=Math.max(n[P].rect[e]-D[e]-D[t],0);A.push(L),M+=L}if(M){var R=Math.min(Math.abs(T)/M,C);if(T>0)for(var P=0;P<s-1;P++){var N=A[P]*R;b(N,0,P+1)}else for(var P=s-1;P>0;P--){var N=A[P-1]*R;b(-N,P,s)}}}function w(T){var C=T<0?-1:1;T=Math.abs(T);for(var A=Math.ceil(T/(s-1)),M=0;M<s-1;M++)if(C>0?b(A,0,M+1):b(-A,s-M-1,s),T-=A,T<=0)return}return u}function lse(n,e,t,r){return I9(n,"x","width",e,t,r)}function N9(n,e,t,r){return I9(n,"y","height",e,t,r)}function k9(n){var e=[];n.sort(function(g,v){return v.priority-g.priority});var t=new Ot(0,0,0,0);function r(g){if(!g.ignore){var v=g.ensureState("emphasis");v.ignore==null&&(v.ignore=!1)}g.ignore=!0}for(var i=0;i<n.length;i++){var a=n[i],s=a.axisAligned,o=a.localRect,l=a.transform,u=a.label,c=a.labelLine;t.copy(a.rect),t.width-=.1,t.height-=.1,t.x+=.05,t.y+=.05;for(var h=a.obb,f=!1,d=0;d<e.length;d++){var p=e[d];if(t.intersect(p.rect)){if(s&&p.axisAligned){f=!0;break}if(p.obb||(p.obb=new Tx(p.localRect,p.transform)),h||(h=new Tx(o,l)),h.intersect(p.obb)){f=!0;break}}}f?(r(u),c&&r(c)):(u.attr("ignore",a.defaultAttr.ignore),c&&c.attr("ignore",a.defaultAttr.labelGuideIgnore),e.push(a))}}function use(n){if(n){for(var e=[],t=0;t<n.length;t++)e.push(n[t].slice());return e}}function cse(n,e){var t=n.label,r=e&&e.getTextGuideLine();return{dataIndex:n.dataIndex,dataType:n.dataType,seriesIndex:n.seriesModel.seriesIndex,text:n.label.style.text,rect:n.hostRect,labelRect:n.rect,align:t.style.align,verticalAlign:t.style.verticalAlign,labelLinePoints:use(r&&r.shape.points)}}var g4=["align","verticalAlign","width","height","fontSize"],Yi=new Cl,kA=en(),hse=en();function Yy(n,e,t){for(var r=0;r<t.length;r++){var i=t[r];e[i]!=null&&(n[i]=e[i])}}var Ky=["x","y","rotation"],fse=function(){function n(){this._labelList=[],this._chartViewList=[]}return n.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},n.prototype._addLabel=function(e,t,r,i,a){var s=i.style,o=i.__hostTarget,l=o.textConfig||{},u=i.getComputedTransform(),c=i.getBoundingRect().plain();Ot.applyTransform(c,c,u),u?Yi.setLocalTransform(u):(Yi.x=Yi.y=Yi.rotation=Yi.originX=Yi.originY=0,Yi.scaleX=Yi.scaleY=1),Yi.rotation=Xa(Yi.rotation);var h=i.__hostTarget,f;if(h){f=h.getBoundingRect().plain();var d=h.getComputedTransform();Ot.applyTransform(f,f,d)}var p=f&&h.getTextGuideLine();this._labelList.push({label:i,labelLine:p,seriesModel:r,dataIndex:e,dataType:t,layoutOption:a,computedLayoutOption:null,rect:c,hostRect:f,priority:f?f.width*f.height:0,defaultAttr:{ignore:i.ignore,labelGuideIgnore:p&&p.ignore,x:Yi.x,y:Yi.y,scaleX:Yi.scaleX,scaleY:Yi.scaleY,rotation:Yi.rotation,style:{x:s.x,y:s.y,align:s.align,verticalAlign:s.verticalAlign,width:s.width,height:s.height,fontSize:s.fontSize},cursor:i.cursor,attachedPos:l.position,attachedRot:l.rotation}})},n.prototype.addLabelsOfSeries=function(e){var t=this;this._chartViewList.push(e);var r=e.__model,i=r.get("labelLayout");(ct(i)||Yt(i).length)&&e.group.traverse(function(a){if(a.ignore)return!0;var s=a.getTextContent(),o=St(a);s&&!s.disableLabelLayout&&t._addLabel(o.dataIndex,o.dataType,r,s,i)})},n.prototype.updateLayoutConfig=function(e){var t=e.getWidth(),r=e.getHeight();function i(_,x){return function(){v4(_,x)}}for(var a=0;a<this._labelList.length;a++){var s=this._labelList[a],o=s.label,l=o.__hostTarget,u=s.defaultAttr,c=void 0;ct(s.layoutOption)?c=s.layoutOption(cse(s,l)):c=s.layoutOption,c=c||{},s.computedLayoutOption=c;var h=Math.PI/180;l&&l.setTextConfig({local:!1,position:c.x!=null||c.y!=null?null:u.attachedPos,rotation:c.rotate!=null?c.rotate*h:u.attachedRot,offset:[c.dx||0,c.dy||0]});var f=!1;if(c.x!=null?(o.x=Xe(c.x,t),o.setStyle("x",0),f=!0):(o.x=u.x,o.setStyle("x",u.style.x)),c.y!=null?(o.y=Xe(c.y,r),o.setStyle("y",0),f=!0):(o.y=u.y,o.setStyle("y",u.style.y)),c.labelLinePoints){var d=l.getTextGuideLine();d&&(d.setShape({points:c.labelLinePoints}),f=!1)}var p=kA(o);p.needsUpdateLabelLine=f,o.rotation=c.rotate!=null?c.rotate*h:u.rotation,o.scaleX=u.scaleX,o.scaleY=u.scaleY;for(var g=0;g<g4.length;g++){var v=g4[g];o.setStyle(v,c[v]!=null?c[v]:u.style[v])}if(c.draggable){if(o.draggable=!0,o.cursor="move",l){var m=s.seriesModel;if(s.dataIndex!=null){var y=s.seriesModel.getData(s.dataType);m=y.getItemModel(s.dataIndex)}o.on("drag",i(l,m.getModel("labelLine")))}}else o.off("drag"),o.cursor=u.cursor}},n.prototype.layout=function(e){var t=e.getWidth(),r=e.getHeight(),i=D9(this._labelList),a=_n(i,function(l){return l.layoutOption.moveOverlap==="shiftX"}),s=_n(i,function(l){return l.layoutOption.moveOverlap==="shiftY"});lse(a,0,t),N9(s,0,r);var o=_n(i,function(l){return l.layoutOption.hideOverlap});k9(o)},n.prototype.processLabelsOverall=function(){var e=this;z(this._chartViewList,function(t){var r=t.__model,i=t.ignoreLabelLineUpdate,a=r.isAnimationEnabled();t.group.traverse(function(s){if(s.ignore&&!s.forceLabelAnimation)return!0;var o=!i,l=s.getTextContent();!o&&l&&(o=kA(l).needsUpdateLabelLine),o&&e._updateLabelLine(s,r),a&&e._animateLabels(s,r)})})},n.prototype._updateLabelLine=function(e,t){var r=e.getTextContent(),i=St(e),a=i.dataIndex;if(r&&a!=null){var s=t.getData(i.dataType),o=s.getItemModel(a),l={},u=s.getItemVisual(a,"style");if(u){var c=s.getVisual("drawType");l.stroke=u[c]}var h=o.getModel("labelLine");mL(e,yL(o),l),v4(e,h)}},n.prototype._animateLabels=function(e,t){var r=e.getTextContent(),i=e.getTextGuideLine();if(r&&(e.forceLabelAnimation||!r.ignore&&!r.invisible&&!e.disableLabelAnimation&&!np(e))){var a=kA(r),s=a.oldLayout,o=St(e),l=o.dataIndex,u={x:r.x,y:r.y,rotation:r.rotation},c=t.getData(o.dataType);if(s){r.attr(s);var f=e.prevStates;f&&(Ft(f,"select")>=0&&r.attr(a.oldLayoutSelect),Ft(f,"emphasis")>=0&&r.attr(a.oldLayoutEmphasis)),cn(r,u,t,l)}else if(r.attr(u),!Kp(r).valueAnimation){var h=Et(r.style.opacity,1);r.style.opacity=0,Jn(r,{style:{opacity:h}},t,l)}if(a.oldLayout=u,r.states.select){var d=a.oldLayoutSelect={};Yy(d,u,Ky),Yy(d,r.states.select,Ky)}if(r.states.emphasis){var p=a.oldLayoutEmphasis={};Yy(p,u,Ky),Yy(p,r.states.emphasis,Ky)}x7(r,l,c,t,t)}if(i&&!i.ignore&&!i.invisible){var a=hse(i),s=a.oldLayout,g={points:i.shape.points};s?(i.attr({shape:s}),cn(i,{shape:g},t)):(i.setShape(g),i.style.strokePercent=0,Jn(i,{style:{strokePercent:1}},t)),a.oldLayout=g}},n}();const dse=fse;var OA=en();function pse(n){n.registerUpdateLifecycle("series:beforeupdate",function(e,t,r){var i=OA(t).labelManager;i||(i=OA(t).labelManager=new dse),i.clearLabels()}),n.registerUpdateLifecycle("series:layoutlabels",function(e,t,r){var i=OA(t).labelManager;r.updatedSeries.forEach(function(a){i.addLabelsOfSeries(t.getViewOfSeriesModel(a))}),i.updateLayoutConfig(t),i.layout(t),i.processLabelsOverall()})}var FA=Math.sin,BA=Math.cos,O9=Math.PI,Qc=Math.PI*2,vse=180/O9,gse=function(){function n(){}return n.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},n.prototype.moveTo=function(e,t){this._add("M",e,t)},n.prototype.lineTo=function(e,t){this._add("L",e,t)},n.prototype.bezierCurveTo=function(e,t,r,i,a,s){this._add("C",e,t,r,i,a,s)},n.prototype.quadraticCurveTo=function(e,t,r,i){this._add("Q",e,t,r,i)},n.prototype.arc=function(e,t,r,i,a,s){this.ellipse(e,t,r,r,0,i,a,s)},n.prototype.ellipse=function(e,t,r,i,a,s,o,l){var u=o-s,c=!l,h=Math.abs(u),f=Uu(h-Qc)||(c?u>=Qc:-u>=Qc),d=u>0?u%Qc:u%Qc+Qc,p=!1;f?p=!0:Uu(h)?p=!1:p=d>=O9==!!c;var g=e+r*BA(s),v=t+i*FA(s);this._start&&this._add("M",g,v);var m=Math.round(a*vse);if(f){var y=1/this._p,_=(c?1:-1)*(Qc-y);this._add("A",r,i,m,1,+c,e+r*BA(s+_),t+i*FA(s+_)),y>.01&&this._add("A",r,i,m,0,+c,g,v)}else{var x=e+r*BA(o),b=t+i*FA(o);this._add("A",r,i,m,+p,+c,x,b)}},n.prototype.rect=function(e,t,r,i){this._add("M",e,t),this._add("l",r,0),this._add("l",0,i),this._add("l",-r,0),this._add("Z")},n.prototype.closePath=function(){this._d.length>0&&this._add("Z")},n.prototype._add=function(e,t,r,i,a,s,o,l,u){for(var c=[],h=this._p,f=1;f<arguments.length;f++){var d=arguments[f];if(isNaN(d)){this._invalid=!0;return}c.push(Math.round(d*h)/h)}this._d.push(e+c.join(" ")),this._start=e==="Z"},n.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},n.prototype.getStr=function(){return this._str},n}();const F9=gse;var cm="none",mse=Math.round;function yse(n){var e=n.fill;return e!=null&&e!==cm}function _se(n){var e=n.stroke;return e!=null&&e!==cm}var _C=["lineCap","miterLimit","lineJoin"],xse=Ne(_C,function(n){return"stroke-"+n.toLowerCase()});function bse(n,e,t,r){var i=e.opacity==null?1:e.opacity;if(t instanceof Pi){n("opacity",i);return}if(yse(e)){var a=Fm(e.fill);n("fill",a.color);var s=e.fillOpacity!=null?e.fillOpacity*a.opacity*i:a.opacity*i;(r||s<1)&&n("fill-opacity",s)}else n("fill",cm);if(_se(e)){var o=Fm(e.stroke);n("stroke",o.color);var l=e.strokeNoScale?t.getLineScale():1,u=l?(e.lineWidth||0)/l:0,c=e.strokeOpacity!=null?e.strokeOpacity*o.opacity*i:o.opacity*i,h=e.strokeFirst;if((r||u!==1)&&n("stroke-width",u),(r||h)&&n("paint-order",h?"stroke":"fill"),(r||c<1)&&n("stroke-opacity",c),e.lineDash){var f=aL(t),d=f[0],p=f[1];d&&(p=mse(p||0),n("stroke-dasharray",d.join(",")),(p||r)&&n("stroke-dashoffset",p))}else r&&n("stroke-dasharray",cm);for(var g=0;g<_C.length;g++){var v=_C[g];if(r||e[v]!==Ax[v]){var m=e[v]||Ax[v];m&&n(xse[g],m)}}}else r&&n("stroke",cm)}var B9="http://www.w3.org/2000/svg",G9="http://www.w3.org/1999/xlink",Sse="http://www.w3.org/2000/xmlns/",wse="http://www.w3.org/XML/1998/namespace",m4="ecmeta_";function z9(n){return document.createElementNS(B9,n)}function ti(n,e,t,r,i){return{tag:n,attrs:t||{},children:r,text:i,key:e}}function Ase(n,e){var t=[];if(e)for(var r in e){var i=e[r],a=r;i!==!1&&(i!==!0&&i!=null&&(a+='="'+i+'"'),t.push(a))}return"<"+n+" "+t.join(" ")+">"}function Mse(n){return"</"+n+">"}function _L(n,e){e=e||{};var t=e.newline?`
`:"";function r(i){var a=i.children,s=i.tag,o=i.attrs,l=i.text;return Ase(s,o)+(s!=="style"?Bi(l):l||"")+(a?""+t+Ne(a,function(u){return r(u)}).join(t)+t:"")+Mse(s)}return r(n)}function Tse(n,e,t){t=t||{};var r=t.newline?`
`:"",i=" {"+r,a=r+"}",s=Ne(Yt(n),function(l){return l+i+Ne(Yt(n[l]),function(u){return u+":"+n[l][u]+";"}).join(r)+a}).join(r),o=Ne(Yt(e),function(l){return"@keyframes "+l+i+Ne(Yt(e[l]),function(u){return u+i+Ne(Yt(e[l][u]),function(c){var h=e[l][u][c];return c==="d"&&(h='path("'+h+'")'),c+":"+h+";"}).join(r)+a}).join(r)+a}).join(r);return!s&&!o?"":["<![CDATA[",s,o,"]]>"].join(r)}function xC(n){return{zrId:n,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function y4(n,e,t,r){return ti("svg","root",{width:n,height:e,xmlns:B9,"xmlns:xlink":G9,version:"1.1",baseProfile:"full",viewBox:r?"0 0 "+n+" "+e:!1},t)}var Cse=0;function U9(){return Cse++}var _4={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"},ch="transform-origin";function Ese(n,e,t){var r=Pe({},n.shape);Pe(r,e),n.buildPath(t,r);var i=new F9;return i.reset(tU(n)),t.rebuildPath(i,1),i.generateStr(),i.getStr()}function Pse(n,e){var t=e.originX,r=e.originY;(t||r)&&(n[ch]=t+"px "+r+"px")}var Lse={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function V9(n,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=n,t}function Rse(n,e,t){var r=n.shape.paths,i={},a,s;if(z(r,function(l){var u=xC(t.zrId);u.animation=!0,AS(l,{},u,!0);var c=u.cssAnims,h=u.cssNodes,f=Yt(c),d=f.length;if(d){s=f[d-1];var p=c[s];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(s)>=0&&(a=y)}}}),!!a){e.d=!1;var o=V9(i,t);return a.replace(s,o)}}function x4(n){return Ke(n)?_4[n]?"cubic-bezier("+_4[n]+")":bP(n)?n:"":""}function AS(n,e,t,r){var i=n.animators,a=i.length,s=[];if(n instanceof GP){var o=Rse(n,e,t);if(o)s.push(o);else if(!a)return}else if(!a)return;for(var l={},u=0;u<a;u++){var c=i[u],h=[c.getMaxTime()/1e3+"s"],f=x4(c.getClip().easing),d=c.getDelay();f?h.push(f):h.push("linear"),d&&h.push(d/1e3+"s"),c.getLoop()&&h.push("infinite");var p=h.join(" ");l[p]=l[p]||[p,[]],l[p][1].push(c)}function g(y){var _=y[1],x=_.length,b={},S={},w={},T="animation-timing-function";function C(Ce,Ae,ze){for(var fe=Ce.getTracks(),j=Ce.getMaxTime(),xe=0;xe<fe.length;xe++){var pe=fe[xe];if(pe.needsAnimate()){var we=pe.keyframes,V=pe.propName;if(ze&&(V=ze(V)),V)for(var ee=0;ee<we.length;ee++){var ae=we[ee],I=Math.round(ae.time/j*100)+"%",G=x4(ae.easing),K=ae.rawValue;(Ke(K)||un(K))&&(Ae[I]=Ae[I]||{},Ae[I][V]=ae.rawValue,G&&(Ae[I][T]=G))}}}}for(var A=0;A<x;A++){var M=_[A],P=M.targetName;P?P==="shape"&&C(M,S):!r&&C(M,b)}for(var D in b){var L={};sU(L,n),Pe(L,b[D]);var R=nU(L),N=b[D][T];w[D]=R?{transform:R}:{},Pse(w[D],L),N&&(w[D][T]=N)}var F,O=!0;for(var D in S){w[D]=w[D]||{};var H=!F,N=S[D][T];H&&(F=new Jo);var U=F.len();F.reset(),w[D].d=Ese(n,S[D],F);var $=F.len();if(!H&&U!==$){O=!1;break}N&&(w[D][T]=N)}if(!O)for(var D in w)delete w[D].d;if(!r)for(var A=0;A<x;A++){var M=_[A],P=M.targetName;P==="style"&&C(M,w,function(fe){return Lse[fe]})}for(var Y=Yt(w),oe=!0,X,A=1;A<Y.length;A++){var re=Y[A-1],_e=Y[A];if(w[re][ch]!==w[_e][ch]){oe=!1;break}X=w[re][ch]}if(oe&&X){for(var D in w)w[D][ch]&&delete w[D][ch];e[ch]=X}if(_n(Y,function(Ce){return Yt(w[Ce]).length>0}).length){var Fe=V9(w,t);return Fe+" "+y[0]+" both"}}for(var v in l){var o=g(l[v]);o&&s.push(o)}if(s.length){var m=t.zrId+"-cls-"+U9();t.cssNodes["."+m]={animation:s.join(",")},e.class=m}}function Dse(n,e,t){if(!n.ignore)if(n.isSilent()){var r={"pointer-events":"none"};b4(r,e,t,!0)}else{var i=n.states.emphasis&&n.states.emphasis.style?n.states.emphasis.style:{},a=i.fill;if(!a){var s=n.style&&n.style.fill,o=n.states.select&&n.states.select.style&&n.states.select.style.fill,l=n.currentStates.indexOf("select")>=0&&o||s;l&&(a=DT(l))}var u=i.lineWidth;if(u){var c=!i.strokeNoScale&&n.transform?n.transform[0]:1;u=u/c}var r={cursor:"pointer"};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),u&&(r["stroke-width"]=u),b4(r,e,t,!0)}}function b4(n,e,t,r){var i=JSON.stringify(n),a=t.cssStyleCache[i];a||(a=t.zrId+"-cls-"+U9(),t.cssStyleCache[i]=a,t.cssNodes["."+a+(r?":hover":"")]=n),e.class=e.class?e.class+" "+a:a}var Zm=Math.round;function H9(n){return n&&Ke(n.src)}function W9(n){return n&&ct(n.toDataURL)}function xL(n,e,t,r){bse(function(i,a){var s=i==="fill"||i==="stroke";s&&eU(a)?j9(e,n,i,r):s&&SP(a)?q9(t,n,i,r):n[i]=a,s&&r.ssr&&a==="none"&&(n["pointer-events"]="visible")},e,t,!1),Gse(t,n,r)}function bL(n,e){var t=aJ(e);t&&(t.each(function(r,i){r!=null&&(n[(m4+i).toLowerCase()]=r+"")}),e.isSilent()&&(n[m4+"silent"]="true"))}function S4(n){return Uu(n[0]-1)&&Uu(n[1])&&Uu(n[2])&&Uu(n[3]-1)}function Ise(n){return Uu(n[4])&&Uu(n[5])}function SL(n,e,t){if(e&&!(Ise(e)&&S4(e))){var r=t?10:1e4;n.transform=S4(e)?"translate("+Zm(e[4]*r)/r+" "+Zm(e[5]*r)/r+")":MQ(e)}}function w4(n,e,t){for(var r=n.points,i=[],a=0;a<r.length;a++)i.push(Zm(r[a][0]*t)/t),i.push(Zm(r[a][1]*t)/t);e.points=i.join(" ")}function A4(n){return!n.smooth}function Nse(n){var e=Ne(n,function(t){return typeof t=="string"?[t,t]:t});return function(t,r,i){for(var a=0;a<e.length;a++){var s=e[a],o=t[s[0]];o!=null&&(r[s[1]]=Zm(o*i)/i)}}}var kse={circle:[Nse(["cx","cy","r"])],polyline:[w4,A4],polygon:[w4,A4]};function Ose(n){for(var e=n.animators,t=0;t<e.length;t++)if(e[t].targetName==="shape")return!0;return!1}function $9(n,e){var t=n.style,r=n.shape,i=kse[n.type],a={},s=e.animation,o="path",l=n.style.strokePercent,u=e.compress&&tU(n)||4;if(i&&!e.willUpdate&&!(i[1]&&!i[1](r))&&!(s&&Ose(n))&&!(l<1)){o=n.type;var c=Math.pow(10,u);i[0](r,a,c)}else{var h=!n.path||n.shapeChanged();n.path||n.createPathProxy();var f=n.path;h&&(f.beginPath(),n.buildPath(f,n.shape),n.pathUpdated());var d=f.getVersion(),p=n,g=p.__svgPathBuilder;(p.__svgPathVersion!==d||!g||l!==p.__svgPathStrokePercent)&&(g||(g=p.__svgPathBuilder=new F9),g.reset(u),f.rebuildPath(g,l),g.generateStr(),p.__svgPathVersion=d,p.__svgPathStrokePercent=l),a.d=g.getStr()}return SL(a,n.transform),xL(a,t,n,e),bL(a,n),e.animation&&AS(n,a,e),e.emphasis&&Dse(n,a,e),ti(o,n.id+"",a)}function Fse(n,e){var t=n.style,r=t.image;if(r&&!Ke(r)&&(H9(r)?r=r.src:W9(r)&&(r=r.toDataURL())),!!r){var i=t.x||0,a=t.y||0,s=t.width,o=t.height,l={href:r,width:s,height:o};return i&&(l.x=i),a&&(l.y=a),SL(l,n.transform),xL(l,t,n,e),bL(l,n),e.animation&&AS(n,l,e),ti("image",n.id+"",l)}}function Bse(n,e){var t=n.style,r=t.text;if(r!=null&&(r+=""),!(!r||isNaN(t.x)||isNaN(t.y))){var i=t.font||lc,a=t.x||0,s=CQ(t.y||0,Kb(i),t.textBaseline),o=TQ[t.textAlign]||t.textAlign,l={"dominant-baseline":"central","text-anchor":o};if(BU(t)){var u="",c=t.fontStyle,h=FU(t.fontSize);if(!parseFloat(h))return;var f=t.fontFamily||Pz,d=t.fontWeight;u+="font-size:"+h+";font-family:"+f+";",c&&c!=="normal"&&(u+="font-style:"+c+";"),d&&d!=="normal"&&(u+="font-weight:"+d+";"),l.style=u}else l.style="font: "+i;return r.match(/\s/)&&(l["xml:space"]="preserve"),a&&(l.x=a),s&&(l.y=s),SL(l,n.transform),xL(l,t,n,e),bL(l,n),e.animation&&AS(n,l,e),ti("text",n.id+"",l,void 0,r)}}function M4(n,e){if(n instanceof Ht)return $9(n,e);if(n instanceof Pi)return Fse(n,e);if(n instanceof zm)return Bse(n,e)}function Gse(n,e,t){var r=n.style;if(EQ(r)){var i=PQ(n),a=t.shadowCache,s=a[i];if(!s){var o=n.getGlobalScale(),l=o[0],u=o[1];if(!l||!u)return;var c=r.shadowOffsetX||0,h=r.shadowOffsetY||0,f=r.shadowBlur,d=Fm(r.shadowColor),p=d.opacity,g=d.color,v=f/2/l,m=f/2/u,y=v+" "+m;s=t.zrId+"-s"+t.shadowIdx++,t.defs[s]=ti("filter",s,{id:s,x:"-100%",y:"-100%",width:"300%",height:"300%"},[ti("feDropShadow","",{dx:c/l,dy:h/u,stdDeviation:y,"flood-color":g,"flood-opacity":p})]),a[i]=s}e.filter=Yb(s)}}function j9(n,e,t,r){var i=n[t],a,s={gradientUnits:i.global?"userSpaceOnUse":"objectBoundingBox"};if(Qz(i))a="linearGradient",s.x1=i.x,s.y1=i.y,s.x2=i.x2,s.y2=i.y2;else if(Jz(i))a="radialGradient",s.cx=Et(i.x,.5),s.cy=Et(i.y,.5),s.r=Et(i.r,.5);else return;for(var o=i.colorStops,l=[],u=0,c=o.length;u<c;++u){var h=IT(o[u].offset)*100+"%",f=o[u].color,d=Fm(f),p=d.color,g=d.opacity,v={offset:h};v["stop-color"]=p,g<1&&(v["stop-opacity"]=g),l.push(ti("stop",u+"",v))}var m=ti(a,"",s,l),y=_L(m),_=r.gradientCache,x=_[y];x||(x=r.zrId+"-g"+r.gradientIdx++,_[y]=x,s.id=x,r.defs[x]=ti(a,x,s,l)),e[t]=Yb(x)}function q9(n,e,t,r){var i=n.style[t],a=n.getBoundingRect(),s={},o=i.repeat,l=o==="no-repeat",u=o==="repeat-x",c=o==="repeat-y",h;if(Zz(i)){var f=i.imageWidth,d=i.imageHeight,p=void 0,g=i.image;if(Ke(g)?p=g:H9(g)?p=g.src:W9(g)&&(p=g.toDataURL()),typeof Image=="undefined"){var v="Image width/height must been given explictly in svg-ssr renderer.";sa(f,v),sa(d,v)}else if(f==null||d==null){var m=function(A,M){if(A){var P=A.elm,D=f||M.width,L=d||M.height;A.tag==="pattern"&&(u?(L=1,D/=a.width):c&&(D=1,L/=a.height)),A.attrs.width=D,A.attrs.height=L,P&&(P.setAttribute("width",D),P.setAttribute("height",L))}},y=PP(p,null,n,function(A){l||m(S,A),m(h,A)});y&&y.width&&y.height&&(f=f||y.width,d=d||y.height)}h=ti("image","img",{href:p,width:f,height:d}),s.width=f,s.height=d}else i.svgElement&&(h=yt(i.svgElement),s.width=i.svgWidth,s.height=i.svgHeight);if(h){var _,x;l?_=x=1:u?(x=1,_=s.width/a.width):c?(_=1,x=s.height/a.height):s.patternUnits="userSpaceOnUse",_!=null&&!isNaN(_)&&(s.width=_),x!=null&&!isNaN(x)&&(s.height=x);var b=nU(i);b&&(s.patternTransform=b);var S=ti("pattern","",s,[h]),w=_L(S),T=r.patternCache,C=T[w];C||(C=r.zrId+"-p"+r.patternIdx++,T[w]=C,s.id=C,S=r.defs[C]=ti("pattern",C,s,[h])),e[t]=Yb(C)}}function zse(n,e,t){var r=t.clipPathCache,i=t.defs,a=r[n.id];if(!a){a=t.zrId+"-c"+t.clipPathIdx++;var s={id:a};r[n.id]=a,i[a]=ti("clipPath",a,s,[$9(n,t)])}e["clip-path"]=Yb(a)}function T4(n){return document.createTextNode(n)}function Sh(n,e,t){n.insertBefore(e,t)}function C4(n,e){n.removeChild(e)}function E4(n,e){n.appendChild(e)}function X9(n){return n.parentNode}function Y9(n){return n.nextSibling}function GA(n,e){n.textContent=e}var P4=58,Use=120,Vse=ti("","");function bC(n){return n===void 0}function Ro(n){return n!==void 0}function Hse(n,e,t){for(var r={},i=e;i<=t;++i){var a=n[i].key;a!==void 0&&(r[a]=i)}return r}function Fg(n,e){var t=n.key===e.key,r=n.tag===e.tag;return r&&t}function Qm(n){var e,t=n.children,r=n.tag;if(Ro(r)){var i=n.elm=z9(r);if(wL(Vse,n),Ie(t))for(e=0;e<t.length;++e){var a=t[e];a!=null&&E4(i,Qm(a))}else Ro(n.text)&&!gt(n.text)&&E4(i,T4(n.text))}else n.elm=T4(n.text);return n.elm}function K9(n,e,t,r,i){for(;r<=i;++r){var a=t[r];a!=null&&Sh(n,Qm(a),e)}}function Hx(n,e,t,r){for(;t<=r;++t){var i=e[t];if(i!=null)if(Ro(i.tag)){var a=X9(i.elm);C4(a,i.elm)}else C4(n,i.elm)}}function wL(n,e){var t,r=e.elm,i=n&&n.attrs||{},a=e.attrs||{};if(i!==a){for(t in a){var s=a[t],o=i[t];o!==s&&(s===!0?r.setAttribute(t,""):s===!1?r.removeAttribute(t):t==="style"?r.style.cssText=s:t.charCodeAt(0)!==Use?r.setAttribute(t,s):t==="xmlns:xlink"||t==="xmlns"?r.setAttributeNS(Sse,t,s):t.charCodeAt(3)===P4?r.setAttributeNS(wse,t,s):t.charCodeAt(5)===P4?r.setAttributeNS(G9,t,s):r.setAttribute(t,s))}for(t in i)t in a||r.removeAttribute(t)}}function Wse(n,e,t){for(var r=0,i=0,a=e.length-1,s=e[0],o=e[a],l=t.length-1,u=t[0],c=t[l],h,f,d,p;r<=a&&i<=l;)s==null?s=e[++r]:o==null?o=e[--a]:u==null?u=t[++i]:c==null?c=t[--l]:Fg(s,u)?(Pd(s,u),s=e[++r],u=t[++i]):Fg(o,c)?(Pd(o,c),o=e[--a],c=t[--l]):Fg(s,c)?(Pd(s,c),Sh(n,s.elm,Y9(o.elm)),s=e[++r],c=t[--l]):Fg(o,u)?(Pd(o,u),Sh(n,o.elm,s.elm),o=e[--a],u=t[++i]):(bC(h)&&(h=Hse(e,r,a)),f=h[u.key],bC(f)?Sh(n,Qm(u),s.elm):(d=e[f],d.tag!==u.tag?Sh(n,Qm(u),s.elm):(Pd(d,u),e[f]=void 0,Sh(n,d.elm,s.elm))),u=t[++i]);(r<=a||i<=l)&&(r>a?(p=t[l+1]==null?null:t[l+1].elm,K9(n,p,t,i,l)):Hx(n,e,r,a))}function Pd(n,e){var t=e.elm=n.elm,r=n.children,i=e.children;n!==e&&(wL(n,e),bC(e.text)?Ro(r)&&Ro(i)?r!==i&&Wse(t,r,i):Ro(i)?(Ro(n.text)&&GA(t,""),K9(t,null,i,0,i.length-1)):Ro(r)?Hx(t,r,0,r.length-1):Ro(n.text)&&GA(t,""):n.text!==e.text&&(Ro(r)&&Hx(t,r,0,r.length-1),GA(t,e.text)))}function $se(n,e){if(Fg(n,e))Pd(n,e);else{var t=n.elm,r=X9(t);Qm(e),r!==null&&(Sh(r,e.elm,Y9(t)),Hx(r,[n],0,0))}return e}var jse=0,qse=function(){function n(e,t,r){if(this.type="svg",this.refreshHover=L4(),this.configLayer=L4(),this.storage=t,this._opts=r=Pe({},r),this.root=e,this._id="zr"+jse++,this._oldVNode=y4(r.width,r.height),e&&!r.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=z9("svg");wL(null,this._oldVNode),i.appendChild(a),e.appendChild(i)}this.resize(r.width,r.height)}return n.prototype.getType=function(){return this.type},n.prototype.getViewportRoot=function(){return this._viewport},n.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},n.prototype.getSvgDom=function(){return this._svgDom},n.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",$se(this._oldVNode,e),this._oldVNode=e}},n.prototype.renderOneToVNode=function(e){return M4(e,xC(this._id))},n.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),r=this._width,i=this._height,a=xC(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis,a.ssr=this._opts.ssr;var s=[],o=this._bgVNode=Xse(r,i,this._backgroundColor,a);o&&s.push(o);var l=e.compress?null:this._mainVNode=ti("g","main",{},[]);this._paintList(t,a,l?l.children:s),l&&s.push(l);var u=Ne(Yt(a.defs),function(f){return a.defs[f]});if(u.length&&s.push(ti("defs","defs",{},u)),e.animation){var c=Tse(a.cssNodes,a.cssAnims,{newline:!0});if(c){var h=ti("style","stl",{},[],c);s.push(h)}}return y4(r,i,s,e.useViewBox)},n.prototype.renderToString=function(e){return e=e||{},_L(this.renderToVNode({animation:Et(e.cssAnimation,!0),emphasis:Et(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Et(e.useViewBox,!0)}),{newline:!0})},n.prototype.setBackgroundColor=function(e){this._backgroundColor=e},n.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},n.prototype._paintList=function(e,t,r){for(var i=e.length,a=[],s=0,o,l,u=0,c=0;c<i;c++){var h=e[c];if(!h.invisible){var f=h.__clipPaths,d=f&&f.length||0,p=l&&l.length||0,g=void 0;for(g=Math.max(d-1,p-1);g>=0&&!(f&&l&&f[g]===l[g]);g--);for(var v=p-1;v>g;v--)s--,o=a[s-1];for(var m=g+1;m<d;m++){var y={};zse(f[m],y,t);var _=ti("g","clip-g-"+u++,y,[]);(o?o.children:r).push(_),a[s++]=_,o=_}l=f;var x=M4(h,t);x&&(o?o.children:r).push(x)}}},n.prototype.resize=function(e,t){var r=this._opts,i=this.root,a=this._viewport;if(e!=null&&(r.width=e),t!=null&&(r.height=t),i&&a&&(a.style.display="none",e=zd(i,0,r),t=zd(i,1,r),a.style.display=""),this._width!==e||this._height!==t){if(this._width=e,this._height=t,a){var s=a.style;s.width=e+"px",s.height=t+"px"}if(SP(this._backgroundColor))this.refresh();else{var o=this._svgDom;o&&(o.setAttribute("width",e),o.setAttribute("height",t));var l=this._bgVNode&&this._bgVNode.elm;l&&(l.setAttribute("width",e),l.setAttribute("height",t))}}},n.prototype.getWidth=function(){return this._width},n.prototype.getHeight=function(){return this._height},n.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},n.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},n.prototype.toDataURL=function(e){var t=this.renderToString(),r="data:image/svg+xml;";return e?(t=RQ(t),t&&r+"base64,"+t):r+"charset=UTF-8,"+encodeURIComponent(t)},n}();function L4(n){return function(){}}function Xse(n,e,t,r){var i;if(t&&t!=="none")if(i=ti("rect","bg",{width:n,height:e,x:"0",y:"0"}),eU(t))j9({fill:t},i.attrs,"fill",r);else if(SP(t))q9({style:{fill:t},dirty:Er,getBoundingRect:function(){return{width:n,height:e}}},i.attrs,"fill",r);else{var a=Fm(t),s=a.color,o=a.opacity;i.attrs.fill=s,o<1&&(i.attrs["fill-opacity"]=o)}return i}const Yse=qse;function Kse(n){n.registerPainter("svg",Yse)}function R4(n,e,t){var r=uc.createCanvas(),i=e.getWidth(),a=e.getHeight(),s=r.style;return s&&(s.position="absolute",s.left="0",s.top="0",s.width=i+"px",s.height=a+"px",r.setAttribute("data-zr-dom-id",n)),r.width=i*t,r.height=a*t,r}var Zse=function(n){ve(e,n);function e(t,r,i){var a=n.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var s;i=i||bx,typeof t=="string"?s=R4(t,r,i):gt(t)&&(s=t,t=s.id),a.id=t,a.dom=s;var o=s.style;return o&&(kz(s),s.onselectstart=function(){return!1},o.padding="0",o.margin="0",o.borderWidth="0"),a.painter=r,a.dpr=i,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var t=this.dpr;this.domBack=R4("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),t!==1&&this.ctxBack.scale(t,t)},e.prototype.createRepaintRects=function(t,r,i,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var s=[],o=this.maxRepaintRectCount,l=!1,u=new Ot(0,0,0,0);function c(y){if(!(!y.isFinite()||y.isZero()))if(s.length===0){var _=new Ot(0,0,0,0);_.copy(y),s.push(_)}else{for(var x=!1,b=1/0,S=0,w=0;w<s.length;++w){var T=s[w];if(T.intersect(y)){var C=new Ot(0,0,0,0);C.copy(T),C.union(y),s[w]=C,x=!0;break}else if(l){u.copy(y),u.union(T);var A=y.width*y.height,M=T.width*T.height,P=u.width*u.height,D=P-A-M;D<b&&(b=D,S=w)}}if(l&&(s[S].union(y),x=!0),!x){var _=new Ot(0,0,0,0);_.copy(y),s.push(_)}l||(l=s.length>=o)}}for(var h=this.__startIndex;h<this.__endIndex;++h){var f=t[h];if(f){var d=f.shouldBePainted(i,a,!0,!0),p=f.__isRendered&&(f.__dirty&Wa||!d)?f.getPrevPaintRect():null;p&&c(p);var g=d&&(f.__dirty&Wa||!f.__isRendered)?f.getPaintRect():null;g&&c(g)}}for(var h=this.__prevStartIndex;h<this.__prevEndIndex;++h){var f=r[h],d=f&&f.shouldBePainted(i,a,!0,!0);if(f&&(!d||!f.__zr)&&f.__isRendered){var p=f.getPrevPaintRect();p&&c(p)}}var v;do{v=!1;for(var h=0;h<s.length;){if(s[h].isZero()){s.splice(h,1);continue}for(var m=h+1;m<s.length;)s[h].intersect(s[m])?(v=!0,s[h].union(s[m]),s.splice(m,1)):m++;h++}}while(v);return this._paintRects=s,s},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(t,r){var i=this.dpr,a=this.dom,s=a.style,o=this.domBack;s&&(s.width=t+"px",s.height=r+"px"),a.width=t*i,a.height=r*i,o&&(o.width=t*i,o.height=r*i,i!==1&&this.ctxBack.scale(i,i))},e.prototype.clear=function(t,r,i){var a=this.dom,s=this.ctx,o=a.width,l=a.height;r=r||this.clearColor;var u=this.motionBlur&&!t,c=this.lastFrameAlpha,h=this.dpr,f=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(a,0,0,o/h,l/h));var d=this.domBack;function p(g,v,m,y){if(s.clearRect(g,v,m,y),r&&r!=="transparent"){var _=void 0;if(jb(r)){var x=r.global||r.__width===m&&r.__height===y;_=x&&r.__canvasGradient||hC(s,r,{x:0,y:0,width:m,height:y}),r.__canvasGradient=_,r.__width=m,r.__height=y}else RZ(r)&&(r.scaleX=r.scaleX||h,r.scaleY=r.scaleY||h,_=fC(s,r,{dirty:function(){f.setUnpainted(),f.painter.refresh()}}));s.save(),s.fillStyle=_||r,s.fillRect(g,v,m,y),s.restore()}u&&(s.save(),s.globalAlpha=c,s.drawImage(d,g,v,m,y),s.restore())}!i||u?p(0,0,o,l):i.length&&z(i,function(g){p(g.x*h,g.y*h,g.width*h,g.height*h)})},e}(Bs);const zA=Zse;var D4=1e5,Jc=314159,Zy=.01,Qse=.001;function Jse(n){return n?n.__builtin__?!0:!(typeof n.resize!="function"||typeof n.refresh!="function"):!1}function eoe(n,e){var t=document.createElement("div");return t.style.cssText=["position:relative","width:"+n+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",t}var toe=function(){function n(e,t,r,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var a=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=r=Pe({},r||{}),this.dpr=r.devicePixelRatio||bx,this._singleCanvas=a,this.root=e;var s=e.style;s&&(kz(e),e.innerHTML=""),this.storage=t;var o=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(a){var c=e,h=c.width,f=c.height;r.width!=null&&(h=r.width),r.height!=null&&(f=r.height),this.dpr=r.devicePixelRatio||1,c.width=h*this.dpr,c.height=f*this.dpr,this._width=h,this._height=f;var d=new zA(c,this,this.dpr);d.__builtin__=!0,d.initContext(),l[Jc]=d,d.zlevel=Jc,o.push(Jc),this._domRoot=e}else{this._width=zd(e,0,r),this._height=zd(e,1,r);var u=this._domRoot=eoe(this._width,this._height);e.appendChild(u)}}return n.prototype.getType=function(){return"canvas"},n.prototype.isSingleCanvas=function(){return this._singleCanvas},n.prototype.getViewportRoot=function(){return this._domRoot},n.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},n.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),r=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,r,e,this._redrawId);for(var a=0;a<i.length;a++){var s=i[a],o=this._layers[s];if(!o.__builtin__&&o.refresh){var l=a===0?this._backgroundColor:null;o.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},n.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},n.prototype._paintHoverList=function(e){var t=e.length,r=this._hoverlayer;if(r&&r.clear(),!!t){for(var i={inHover:!0,viewWidth:this._width,viewHeight:this._height},a,s=0;s<t;s++){var o=e[s];o.__inHover&&(r||(r=this._hoverlayer=this.getLayer(D4)),a||(a=r.ctx,a.save()),Ih(a,o,i,s===t-1))}a&&a.restore()}},n.prototype.getHoverLayer=function(){return this.getLayer(D4)},n.prototype.paintOne=function(e,t){LV(e,t)},n.prototype._paintList=function(e,t,r,i){if(this._redrawId===i){r=r||!1,this._updateLayerStatus(e);var a=this._doPaintList(e,t,r),s=a.finished,o=a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),o&&this._paintHoverList(e),s)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;CT(function(){l._paintList(e,t,r,i)})}}},n.prototype._compositeManually=function(){var e=this.getLayer(Jc).ctx,t=this._domRoot.width,r=this._domRoot.height;e.clearRect(0,0,t,r),this.eachBuiltinLayer(function(i){i.virtual&&e.drawImage(i.dom,0,0,t,r)})},n.prototype._doPaintList=function(e,t,r){for(var i=this,a=[],s=this._opts.useDirtyRect,o=0;o<this._zlevelList.length;o++){var l=this._zlevelList[o],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||r)&&a.push(u)}for(var c=!0,h=!1,f=function(g){var v=a[g],m=v.ctx,y=s&&v.createRepaintRects(e,t,d._width,d._height),_=r?v.__startIndex:v.__drawIndex,x=!r&&v.incremental&&Date.now,b=x&&Date.now(),S=v.zlevel===d._zlevelList[0]?d._backgroundColor:null;if(v.__startIndex===v.__endIndex)v.clear(!1,S,y);else if(_===v.__startIndex){var w=e[_];(!w.incremental||!w.notClear||r)&&v.clear(!1,S,y)}_===-1&&(console.error("For some unknown reason. drawIndex is -1"),_=v.__startIndex);var T,C=function(D){var L={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(T=_;T<v.__endIndex;T++){var R=e[T];if(R.__inHover&&(h=!0),i._doPaintEl(R,v,s,D,L,T===v.__endIndex-1),x){var N=Date.now()-b;if(N>15)break}}L.prevElClipPaths&&m.restore()};if(y)if(y.length===0)T=v.__endIndex;else for(var A=d.dpr,M=0;M<y.length;++M){var P=y[M];m.save(),m.beginPath(),m.rect(P.x*A,P.y*A,P.width*A,P.height*A),m.clip(),C(P),m.restore()}else m.save(),C(),m.restore();v.__drawIndex=T,v.__drawIndex<v.__endIndex&&(c=!1)},d=this,p=0;p<a.length;p++)f(p);return on.wxa&&z(this._layers,function(g){g&&g.ctx&&g.ctx.draw&&g.ctx.draw()}),{finished:c,needsRefreshHover:h}},n.prototype._doPaintEl=function(e,t,r,i,a,s){var o=t.ctx;if(r){var l=e.getPaintRect();(!i||l&&l.intersect(i))&&(Ih(o,e,a,s),e.setPrevPaintRect(l))}else Ih(o,e,a,s)},n.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Jc);var r=this._layers[e];return r||(r=new zA("zr_"+e,this,this.dpr),r.zlevel=e,r.__builtin__=!0,this._layerConfig[e]?It(r,this._layerConfig[e],!0):this._layerConfig[e-Zy]&&It(r,this._layerConfig[e-Zy],!0),t&&(r.virtual=t),this.insertLayer(e,r),r.initContext()),r},n.prototype.insertLayer=function(e,t){var r=this._layers,i=this._zlevelList,a=i.length,s=this._domRoot,o=null,l=-1;if(!r[e]&&Jse(t)){if(a>0&&e>i[0]){for(l=0;l<a-1&&!(i[l]<e&&i[l+1]>e);l++);o=r[i[l]]}if(i.splice(l+1,0,e),r[e]=t,!t.virtual)if(o){var u=o.dom;u.nextSibling?s.insertBefore(t.dom,u.nextSibling):s.appendChild(t.dom)}else s.firstChild?s.insertBefore(t.dom,s.firstChild):s.appendChild(t.dom);t.painter||(t.painter=this)}},n.prototype.eachLayer=function(e,t){for(var r=this._zlevelList,i=0;i<r.length;i++){var a=r[i];e.call(t,this._layers[a],a)}},n.prototype.eachBuiltinLayer=function(e,t){for(var r=this._zlevelList,i=0;i<r.length;i++){var a=r[i],s=this._layers[a];s.__builtin__&&e.call(t,s,a)}},n.prototype.eachOtherLayer=function(e,t){for(var r=this._zlevelList,i=0;i<r.length;i++){var a=r[i],s=this._layers[a];s.__builtin__||e.call(t,s,a)}},n.prototype.getLayers=function(){return this._layers},n.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(h,f){h.__dirty=h.__used=!1});function t(h){a&&(a.__endIndex!==h&&(a.__dirty=!0),a.__endIndex=h)}if(this._singleCanvas)for(var r=1;r<e.length;r++){var i=e[r];if(i.zlevel!==e[r-1].zlevel||i.incremental){this._needsManuallyCompositing=!0;break}}var a=null,s=0,o,l;for(l=0;l<e.length;l++){var i=e[l],u=i.zlevel,c=void 0;o!==u&&(o=u,s=0),i.incremental?(c=this.getLayer(u+Qse,this._needsManuallyCompositing),c.incremental=!0,s=1):c=this.getLayer(u+(s>0?Zy:0),this._needsManuallyCompositing),c.__builtin__||pP("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&Wa&&!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)})},n.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},n.prototype._clearLayer=function(e){e.clear()},n.prototype.setBackgroundColor=function(e){this._backgroundColor=e,z(this._layers,function(t){t.setUnpainted()})},n.prototype.configLayer=function(e,t){if(t){var r=this._layerConfig;r[e]?It(r[e],t,!0):r[e]=t;for(var i=0;i<this._zlevelList.length;i++){var a=this._zlevelList[i];if(a===e||a===e+Zy){var s=this._layers[a];It(s,r[e],!0)}}}},n.prototype.delLayer=function(e){var t=this._layers,r=this._zlevelList,i=t[e];i&&(i.dom.parentNode.removeChild(i.dom),delete t[e],r.splice(Ft(r,e),1))},n.prototype.resize=function(e,t){if(this._domRoot.style){var r=this._domRoot;r.style.display="none";var i=this._opts,a=this.root;if(e!=null&&(i.width=e),t!=null&&(i.height=t),e=zd(a,0,i),t=zd(a,1,i),r.style.display="",this._width!==e||t!==this._height){r.style.width=e+"px",r.style.height=t+"px";for(var s in this._layers)this._layers.hasOwnProperty(s)&&this._layers[s].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this.getLayer(Jc).resize(e,t)}return this},n.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},n.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},n.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[Jc].dom;var t=new zA("image",this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var r=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=t.dom.width,a=t.dom.height;this.eachLayer(function(h){h.__builtin__?r.drawImage(h.dom,0,0,i,a):h.renderToCanvas&&(r.save(),h.renderToCanvas(r),r.restore())})}else for(var s={inHover:!1,viewWidth:this._width,viewHeight:this._height},o=this.storage.getDisplayList(!0),l=0,u=o.length;l<u;l++){var c=o[l];Ih(r,c,s,l===u-1)}return t.dom},n.prototype.getWidth=function(){return this._width},n.prototype.getHeight=function(){return this._height},n}();const noe=toe;function roe(n){n.registerPainter("canvas",noe)}var ioe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t){return Yl(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(t){var r=new bt,i=Br("line",0,t.itemHeight/2,t.itemWidth,0,t.lineStyle.stroke,!1);r.add(i),i.setStyle(t.lineStyle);var a=this.getData().getVisual("symbol"),s=this.getData().getVisual("symbolRotate"),o=a==="none"?"circle":a,l=t.itemHeight*.8,u=Br(o,(t.itemWidth-l)/2,(t.itemHeight-l)/2,l,l,t.itemStyle.fill);r.add(u),u.setStyle(t.itemStyle);var c=t.iconRotate==="inherit"?s:t.iconRotate||0;return u.rotation=c*Math.PI/180,u.setOrigin([t.itemWidth/2,t.itemHeight/2]),o.indexOf("empty")>-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),r},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}(rr);const aoe=ioe;function Mp(n,e){var t=n.mapDimensionsAll("defaultedLabel"),r=t.length;if(r===1){var i=Sp(n,e,t[0]);return i!=null?i+"":null}else if(r){for(var a=[],s=0;s<t.length;s++)a.push(Sp(n,e,t[s]));return a.join(" ")}}function Z9(n,e){var t=n.mapDimensionsAll("defaultedLabel");if(!Ie(e))return e+"";for(var r=[],i=0;i<t.length;i++){var a=n.getDimensionIndex(t[i]);a>=0&&r.push(e[a])}return r.join(" ")}var soe=function(n){ve(e,n);function e(t,r,i,a){var s=n.call(this)||this;return s.updateData(t,r,i,a),s}return e.prototype._createSymbol=function(t,r,i,a,s){this.removeAll();var o=Br(t,-1,-1,2,2,null,s);o.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),o.drift=ooe,this._symbolType=t,this.add(o)},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(){zl(this.childAt(0))},e.prototype.downplay=function(){Ul(this.childAt(0))},e.prototype.setZ=function(t,r){var i=this.childAt(0);i.zlevel=t,i.z=r},e.prototype.setDraggable=function(t,r){var i=this.childAt(0);i.draggable=t,i.cursor=!r&&t?"move":i.cursor},e.prototype.updateData=function(t,r,i,a){this.silent=!1;var s=t.getItemVisual(r,"symbol")||"circle",o=t.hostModel,l=e.getSymbolSize(t,r),u=s!==this._symbolType,c=a&&a.disableAnimation;if(u){var h=t.getItemVisual(r,"symbolKeepAspect");this._createSymbol(s,t,r,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):cn(f,d,o,r),co(f)}if(this._updateCommon(t,r,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,Jn(f,d,o,r)}}c&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,r,i,a,s){var o=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(r),_=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=ri(y),v=_.getShallow("scale"),m=y.getShallow("cursor")}var x=t.getItemVisual(r,"symbolRotate");o.attr("rotation",(x||0)*Math.PI/180||0);var b=Tf(t.getItemVisual(r,"symbolOffset"),i);b&&(o.x=b[0],o.y=b[1]),m&&o.attr("cursor",m);var S=t.getItemVisual(r,"style"),w=S.fill;if(o instanceof Pi){var T=o.style;o.useStyle(Pe({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},S))}else o.__isEmptyBrush?o.useStyle(Pe({},S)):o.useStyle(S),o.style.decal=null,o.setColor(w,s&&s.symbolInnerColor),o.style.strokeNoScale=!0;var C=t.getItemVisual(r,"liftZ"),A=this._z2;C!=null?A==null&&(this._z2=o.z2,o.z2+=C):A!=null&&(o.z2=A,this._z2=null);var M=s&&s.useNameLabel;Ei(o,g,{labelFetcher:l,labelDataIndex:r,defaultText:P,inheritColor:w,defaultOpacity:S.opacity});function P(R){return M?t.getName(R):Mp(t,R)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var D=o.ensureState("emphasis");D.style=u,o.ensureState("select").style=h,o.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),lr(this,f,d,p)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,r,i){var a=this.childAt(0),s=St(this).dataIndex,o=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&hc(l,{style:{opacity:0}},r,{dataIndex:s,removeOpt:o,cb:function(){a.removeTextContent()}})}else a.removeTextContent();hc(a,{style:{opacity:0},scaleX:0,scaleY:0},r,{dataIndex:s,cb:t,removeOpt:o})},e.getSymbolSize=function(t,r){return iv(t.getItemVisual(r,"symbolSize"))},e}(bt);function ooe(n,e){this.parent.drift(n,e)}const G0=soe;function UA(n,e,t,r){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(r.isIgnore&&r.isIgnore(t))&&!(r.clipShape&&!r.clipShape.contain(e[0],e[1]))&&n.getItemVisual(t,"symbol")!=="none"}function I4(n){return n!=null&&!gt(n)&&(n={isIgnore:n}),n||{}}function N4(n){var e=n.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:ri(e),cursorStyle:e.get("cursor")}}var loe=function(){function n(e){this.group=new bt,this._SymbolCtor=e||G0}return n.prototype.updateData=function(e,t){this._progressiveEls=null,t=I4(t);var r=this.group,i=e.hostModel,a=this._data,s=this._SymbolCtor,o=t.disableAnimation,l=N4(e),u={disableAnimation:o},c=t.getSymbolPoint||function(h){return e.getItemLayout(h)};a||r.removeAll(),e.diff(a).add(function(h){var f=c(h);if(UA(e,f,h,t)){var d=new s(e,h,l,u);d.setPosition(f),e.setItemGraphicEl(h,d),r.add(d)}}).update(function(h,f){var d=a.getItemGraphicEl(f),p=c(h);if(!UA(e,p,h,t)){r.remove(d);return}var g=e.getItemVisual(h,"symbol")||"circle",v=d&&d.getSymbolType&&d.getSymbolType();if(!d||v&&v!==g)r.remove(d),d=new s(e,h,l,u),d.setPosition(p);else{d.updateData(e,h,l,u);var m={x:p[0],y:p[1]};o?d.attr(m):cn(d,m,i)}r.add(d),e.setItemGraphicEl(h,d)}).remove(function(h){var f=a.getItemGraphicEl(h);f&&f.fadeOut(function(){r.remove(f)},i)}).execute(),this._getSymbolPoint=c,this._data=e},n.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(r,i){var a=e._getSymbolPoint(i);r.setPosition(a),r.markRedraw()})},n.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=N4(e),this._data=null,this.group.removeAll()},n.prototype.incrementalUpdate=function(e,t,r){this._progressiveEls=[],r=I4(r);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a<e.end;a++){var s=t.getItemLayout(a);if(UA(t,s,a,r)){var o=new this._SymbolCtor(t,a,this._seriesScope);o.traverse(i),o.setPosition(s),this.group.add(o),t.setItemGraphicEl(a,o),this._progressiveEls.push(o)}}},n.prototype.eachRendered=function(e){Sc(this._progressiveEls||this.group,e)},n.prototype.remove=function(e){var t=this.group,r=this._data;r&&e?r.eachItemGraphicEl(function(i){i.fadeOut(function(){t.remove(i)},r.hostModel)}):t.removeAll()},n}();const z0=loe;function Q9(n,e,t){var r=n.getBaseAxis(),i=n.getOtherAxis(r),a=uoe(i,t),s=r.dim,o=i.dim,l=e.mapDimension(o),u=e.mapDimension(s),c=o==="x"||o==="radius"?1:0,h=Ne(n.dimensions,function(p){return e.mapDimension(p)}),f=!1,d=e.getCalculationInfo("stackResultDimension");return dc(e,h[0])&&(f=!0,h[0]=d),dc(e,h[1])&&(f=!0,h[1]=d),{dataDimsForPoint:h,valueStart:a,valueAxisDim:o,baseAxisDim:s,stacked:!!f,valueDim:l,baseDim:u,baseDataOffset:c,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function uoe(n,e){var t=0,r=n.scale.getExtent();return e==="start"?t=r[0]:e==="end"?t=r[1]:un(e)&&!isNaN(e)?t=e:r[0]>0?t=r[0]:r[1]<0&&(t=r[1]),t}function J9(n,e,t,r){var i=NaN;n.stacked&&(i=t.get(t.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=n.valueStart);var a=n.baseDataOffset,s=[];return s[a]=t.get(n.baseDim,r),s[1-a]=i,e.dataToPoint(s)}function coe(n,e){var t=[];return e.diff(n).add(function(r){t.push({cmd:"+",idx:r})}).update(function(r,i){t.push({cmd:"=",idx:i,idx1:r})}).remove(function(r){t.push({cmd:"-",idx:r})}).execute(),t}function hoe(n,e,t,r,i,a,s,o){for(var l=coe(n,e),u=[],c=[],h=[],f=[],d=[],p=[],g=[],v=Q9(i,e,s),m=n.getLayout("points")||[],y=e.getLayout("points")||[],_=0;_<l.length;_++){var x=l[_],b=!0,S=void 0,w=void 0;switch(x.cmd){case"=":S=x.idx*2,w=x.idx1*2;var T=m[S],C=m[S+1],A=y[w],M=y[w+1];(isNaN(T)||isNaN(C))&&(T=A,C=M),u.push(T,C),c.push(A,M),h.push(t[S],t[S+1]),f.push(r[w],r[w+1]),g.push(e.getRawIndex(x.idx1));break;case"+":var P=x.idx,D=v.dataDimsForPoint,L=i.dataToPoint([e.get(D[0],P),e.get(D[1],P)]);w=P*2,u.push(L[0],L[1]),c.push(y[w],y[w+1]);var R=J9(v,i,e,P);h.push(R[0],R[1]),f.push(r[w],r[w+1]),g.push(e.getRawIndex(P));break;case"-":b=!1}b&&(d.push(x),p.push(p.length))}p.sort(function(re,_e){return g[re]-g[_e]});for(var N=u.length,F=Uo(N),O=Uo(N),H=Uo(N),U=Uo(N),$=[],_=0;_<p.length;_++){var Y=p[_],oe=_*2,X=Y*2;F[oe]=u[X],F[oe+1]=u[X+1],O[oe]=c[X],O[oe+1]=c[X+1],H[oe]=h[X],H[oe+1]=h[X+1],U[oe]=f[X],U[oe+1]=f[X+1],$[_]=d[Y]}return{current:F,next:O,stackedOnCurrent:H,stackedOnNext:U,status:$}}var lu=Math.min,uu=Math.max;function Yh(n,e){return isNaN(n)||isNaN(e)}function SC(n,e,t,r,i,a,s,o,l){for(var u,c,h,f,d,p,g=t,v=0;v<r;v++){var m=e[g*2],y=e[g*2+1];if(g>=i||g<0)break;if(Yh(m,y)){if(l){g+=a;continue}break}if(g===t)n[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(s>0){for(var b=g+a,S=e[b*2],w=e[b*2+1];S===m&&w===y&&v<r;)v++,b+=a,g+=a,S=e[b*2],w=e[b*2+1],m=e[g*2],y=e[g*2+1],_=m-u,x=y-c;var T=v+1;if(l)for(;Yh(S,w)&&T<r;)T++,b+=a,S=e[b*2],w=e[b*2+1];var C=.5,A=0,M=0,P=void 0,D=void 0;if(T>=r||Yh(S,w))d=m,p=y;else{A=S-u,M=w-c;var L=m-u,R=S-m,N=y-c,F=w-y,O=void 0,H=void 0;if(o==="x"){O=Math.abs(L),H=Math.abs(R);var U=A>0?1:-1;d=m-U*O*s,p=y,P=m+U*H*s,D=y}else if(o==="y"){O=Math.abs(N),H=Math.abs(F);var $=M>0?1:-1;d=m,p=y-$*O*s,P=m,D=y+$*H*s}else O=Math.sqrt(L*L+N*N),H=Math.sqrt(R*R+F*F),C=H/(H+O),d=m-A*s*(1-C),p=y-M*s*(1-C),P=m+A*s*C,D=y+M*s*C,P=lu(P,uu(S,m)),D=lu(D,uu(w,y)),P=uu(P,lu(S,m)),D=uu(D,lu(w,y)),A=P-m,M=D-y,d=m-A*O/H,p=y-M*O/H,d=lu(d,uu(u,m)),p=lu(p,uu(c,y)),d=uu(d,lu(u,m)),p=uu(p,lu(c,y)),A=m-d,M=y-p,P=m+A*H/O,D=y+M*H/O}n.bezierCurveTo(h,f,d,p,m,y),h=P,f=D}else n.lineTo(m,y)}u=m,c=y,g+=a}return v}var eH=function(){function n(){this.smooth=0,this.smoothConstraint=!0}return n}(),foe=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="ec-polyline",r}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new eH},e.prototype.buildPath=function(t,r){var i=r.points,a=0,s=i.length/2;if(r.connectNulls){for(;s>0&&Yh(i[s*2-2],i[s*2-1]);s--);for(;a<s&&Yh(i[a*2],i[a*2+1]);a++);}for(;a<s;)a+=SC(t,i,a,s,s,1,r.smooth,r.smoothMonotone,r.connectNulls)+1},e.prototype.getPointOn=function(t,r){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var i=this.path,a=i.data,s=Jo.CMD,o,l,u=r==="x",c=[],h=0;h<a.length;){var f=a[h++],d=void 0,p=void 0,g=void 0,v=void 0,m=void 0,y=void 0,_=void 0;switch(f){case s.M:o=a[h++],l=a[h++];break;case s.L:if(d=a[h++],p=a[h++],_=u?(t-o)/(d-o):(t-l)/(p-l),_<=1&&_>=0){var x=u?(p-l)*_+l:(d-o)*_+o;return u?[t,x]:[x,t]}o=d,l=p;break;case s.C:d=a[h++],p=a[h++],g=a[h++],v=a[h++],m=a[h++],y=a[h++];var b=u?mx(o,d,g,m,t,c):mx(l,p,v,y,t,c);if(b>0)for(var S=0;S<b;S++){var w=c[S];if(w<=1&&w>=0){var x=u?Qr(l,p,v,y,w):Qr(o,d,g,m,w);return u?[t,x]:[x,t]}}o=m,l=y;break}}},e}(Ht),doe=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(eH),tH=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="ec-polygon",r}return e.prototype.getDefaultShape=function(){return new doe},e.prototype.buildPath=function(t,r){var i=r.points,a=r.stackedOnPoints,s=0,o=i.length/2,l=r.smoothMonotone;if(r.connectNulls){for(;o>0&&Yh(i[o*2-2],i[o*2-1]);o--);for(;s<o&&Yh(i[s*2],i[s*2+1]);s++);}for(;s<o;){var u=SC(t,i,s,o,o,1,r.smooth,l,r.connectNulls);SC(t,a,s+u-1,u,o,-1,r.stackedOnSmooth,l,r.connectNulls),s+=u+1,t.closePath()}},e}(Ht);function nH(n,e,t,r,i){var a=n.getArea(),s=a.x,o=a.y,l=a.width,u=a.height,c=t.get(["lineStyle","width"])||0;s-=c/2,o-=c/2,l+=c,u+=c,l=Math.ceil(l),s!==Math.floor(s)&&(s=Math.floor(s),l++);var h=new nn({shape:{x:s,y:o,width:l,height:u}});if(e){var f=n.getBaseAxis(),d=f.isHorizontal(),p=f.inverse;d?(p&&(h.shape.x+=l),h.shape.width=0):(p||(h.shape.y+=u),h.shape.height=0);var g=ct(i)?function(v){i(v,h)}:null;Jn(h,{shape:{width:l,height:u,x:s,y:o}},t,null,r,g)}return h}function rH(n,e,t){var r=n.getArea(),i=xr(r.r0,1),a=xr(r.r,1),s=new La({shape:{cx:xr(n.cx,1),cy:xr(n.cy,1),r0:i,r:a,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});if(e){var o=n.getBaseAxis().dim==="angle";o?s.shape.endAngle=r.startAngle:s.shape.r=i,Jn(s,{shape:{endAngle:r.endAngle,r:a}},t)}return s}function U0(n,e,t,r,i){if(n){if(n.type==="polar")return rH(n,e,t);if(n.type==="cartesian2d")return nH(n,e,t,r,i)}else return null;return null}function Ef(n,e){return n.type===e}function k4(n,e){if(n.length===e.length){for(var t=0;t<n.length;t++)if(n[t]!==e[t])return;return!0}}function O4(n){for(var e=1/0,t=1/0,r=-1/0,i=-1/0,a=0;a<n.length;){var s=n[a++],o=n[a++];isNaN(s)||(e=Math.min(s,e),r=Math.max(s,r)),isNaN(o)||(t=Math.min(o,t),i=Math.max(o,i))}return[[e,t],[r,i]]}function F4(n,e){var t=O4(n),r=t[0],i=t[1],a=O4(e),s=a[0],o=a[1];return Math.max(Math.abs(r[0]-s[0]),Math.abs(r[1]-s[1]),Math.abs(i[0]-o[0]),Math.abs(i[1]-o[1]))}function B4(n){return un(n)?n:n?.5:0}function poe(n,e,t){if(!t.valueDim)return[];for(var r=e.count(),i=Uo(r*2),a=0;a<r;a++){var s=J9(t,n,e,a);i[a*2]=s[0],i[a*2+1]=s[1]}return i}function cu(n,e,t,r,i){var a=t.getBaseAxis(),s=a.dim==="x"||a.dim==="radius"?0:1,o=[],l=0,u=[],c=[],h=[],f=[];if(i){for(l=0;l<n.length;l+=2){var d=e||n;!isNaN(d[l])&&!isNaN(d[l+1])&&f.push(n[l],n[l+1])}n=f}for(l=0;l<n.length-2;l+=2)switch(h[0]=n[l+2],h[1]=n[l+3],c[0]=n[l],c[1]=n[l+1],o.push(c[0],c[1]),r){case"end":u[s]=h[s],u[1-s]=c[1-s],o.push(u[0],u[1]);break;case"middle":var p=(c[s]+h[s])/2,g=[];u[s]=g[s]=p,u[1-s]=c[1-s],g[1-s]=h[1-s],o.push(u[0],u[1]),o.push(g[0],g[1]);break;default:u[s]=c[s],u[1-s]=h[1-s],o.push(u[0],u[1])}return o.push(n[l++],n[l++]),o}function voe(n,e){var t=[],r=n.length,i,a;function s(c,h,f){var d=c.coord,p=(f-d)/(h.coord-d),g=AQ(p,[c.color,h.color]);return{coord:f,color:g}}for(var o=0;o<r;o++){var l=n[o],u=l.coord;if(u<0)i=l;else if(u>e){a?t.push(s(a,l,e)):i&&t.push(s(i,l,0),s(i,l,e));break}else i&&(t.push(s(i,l,0)),i=null),t.push(l),a=l}return t}function goe(n,e,t){var r=n.getVisual("visualMeta");if(!(!r||!r.length||!n.count())&&e.type==="cartesian2d"){for(var i,a,s=r.length-1;s>=0;s--){var o=n.getDimensionInfo(r[s].dimension);if(i=o&&o.coordDim,i==="x"||i==="y"){a=r[s];break}}if(a){var l=e.getAxis(i),u=Ne(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=voe(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";z(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 Zr(0,0,0,0,f,!0);return y[i]=g,y[i+"2"]=v,y}}}function moe(n,e,t){var r=n.get("showAllSymbol"),i=r==="auto";if(!(r&&!i)){var a=t.getAxesByScale("ordinal")[0];if(a&&!(i&&yoe(a,e))){var s=e.mapDimension(a.dim),o={};return z(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);o[u]=1}),function(l){return!o.hasOwnProperty(e.get(s,l))}}}}function yoe(n,e){var t=n.getExtent(),r=Math.abs(t[1]-t[0])/n.scale.count();isNaN(r)&&(r=0);for(var i=e.count(),a=Math.max(1,Math.round(i/5)),s=0;s<i;s+=a)if(G0.getSymbolSize(e,s)[n.isHorizontal()?1:0]*1.5>r)return!1;return!0}function _oe(n,e){return isNaN(n)||isNaN(e)}function xoe(n){for(var e=n.length/2;e>0&&_oe(n[e*2-2],n[e*2-1]);e--);return e-1}function G4(n,e){return[n[e*2],n[e*2+1]]}function boe(n,e,t){for(var r=n.length/2,i=t==="x"?0:1,a,s,o=0,l=-1,u=0;u<r;u++)if(s=n[u*2+i],!(isNaN(s)||isNaN(n[u*2+1-i]))){if(u===0){a=s;continue}if(a<=e&&s>=e||a>=e&&s<=e){l=u;break}o=u,a=s}return{range:[o,l],t:(e-a)/(s-a)}}function iH(n){if(n.get(["endLabel","show"]))return!0;for(var e=0;e<oa.length;e++)if(n.get([oa[e],"endLabel","show"]))return!0;return!1}function VA(n,e,t,r){if(Ef(e,"cartesian2d")){var i=r.getModel("endLabel"),a=i.get("valueAnimation"),s=r.getData(),o={lastFrameIndex:0},l=iH(r)?function(d,p){n._endLabelOnDuring(d,p,s,o,a,i,e)}:null,u=e.getBaseAxis().isHorizontal(),c=nH(e,t,r,function(){var d=n._endLabel;d&&t&&o.originalX!=null&&d.attr({x:o.originalX,y:o.originalY})},l);if(!r.get("clip",!0)){var h=c.shape,f=Math.max(h.width,h.height);u?(h.y-=f,h.height+=f*2):(h.x-=f,h.width+=f*2)}return l&&l(1,c),c}else return rH(e,t,r)}function Soe(n,e){var t=e.getBaseAxis(),r=t.isHorizontal(),i=t.inverse,a=r?i?"right":"left":"center",s=r?"middle":i?"top":"bottom";return{normal:{align:n.get("align")||a,verticalAlign:n.get("verticalAlign")||s}}}var woe=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(){var t=new bt,r=new z0;this.group.add(r.group),this._symbolDraw=r,this._lineGroup=t,this._changePolyState=Qe(this._changePolyState,this)},e.prototype.render=function(t,r,i){var a=t.coordinateSystem,s=this.group,o=t.getData(),l=t.getModel("lineStyle"),u=t.getModel("areaStyle"),c=o.getLayout("points")||[],h=a.type==="polar",f=this._coordSys,d=this._symbolDraw,p=this._polyline,g=this._polygon,v=this._lineGroup,m=!r.ssr&&t.get("animation"),y=!u.isEmpty(),_=u.get("origin"),x=Q9(a,o,_),b=y&&poe(a,o,x),S=t.get("showSymbol"),w=t.get("connectNulls"),T=S&&!h&&moe(t,o,a),C=this._data;C&&C.eachItemGraphicEl(function(re,_e){re.__temp&&(s.remove(re),C.setItemGraphicEl(_e,null))}),S||d.remove(),s.add(v);var A=h?!1:t.get("step"),M;a&&a.getArea&&t.get("clip",!0)&&(M=a.getArea(),M.width!=null?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M;var P=goe(o,a,i)||o.getVisual("style")[o.getVisual("drawType")];if(!(p&&f.type===a.type&&A===this._step))S&&d.updateData(o,{isIgnore:T,clipShape:M,disableAnimation:!0,getSymbolPoint:function(re){return[c[re*2],c[re*2+1]]}}),m&&this._initSymbolLabelAnimation(o,a,M),A&&(b&&(b=cu(b,c,a,A,w)),c=cu(c,null,a,A,w)),p=this._newPolyline(c),y?g=this._newPolygon(c,b):g&&(v.remove(g),g=this._polygon=null),h||this._initOrUpdateEndLabel(t,a,hf(P)),v.setClipPath(VA(this,a,!0,t));else{y&&!g?g=this._newPolygon(c,b):g&&!y&&(v.remove(g),g=this._polygon=null),h||this._initOrUpdateEndLabel(t,a,hf(P));var D=v.getClipPath();if(D){var L=VA(this,a,!1,t);Jn(D,{shape:L.shape},t)}else v.setClipPath(VA(this,a,!0,t));S&&d.updateData(o,{isIgnore:T,clipShape:M,disableAnimation:!0,getSymbolPoint:function(re){return[c[re*2],c[re*2+1]]}}),(!k4(this._stackedOnPoints,b)||!k4(this._points,c))&&(m?this._doUpdateAnimation(o,b,a,i,A,_,w):(A&&(b&&(b=cu(b,c,a,A,w)),c=cu(c,null,a,A,w)),p.setShape({points:c}),g&&g.setShape({points:c,stackedOnPoints:b})))}var R=t.getModel("emphasis"),N=R.get("focus"),F=R.get("blurScope"),O=R.get("disabled");if(p.useStyle(dt(l.getLineStyle(),{fill:"none",stroke:P,lineJoin:"bevel"})),Ci(p,t,"lineStyle"),p.style.lineWidth>0&&t.get(["emphasis","lineStyle","width"])==="bolder"){var H=p.getState("emphasis").style;H.lineWidth=+p.style.lineWidth+1}St(p).seriesIndex=t.seriesIndex,lr(p,N,F,O);var U=B4(t.get("smooth")),$=t.get("smoothMonotone");if(p.setShape({smooth:U,smoothMonotone:$,connectNulls:w}),g){var Y=o.getCalculationInfo("stackedOnSeries"),oe=0;g.useStyle(dt(u.getAreaStyle(),{fill:P,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),Y&&(oe=B4(Y.get("smooth"))),g.setShape({smooth:U,stackedOnSmooth:oe,smoothMonotone:$,connectNulls:w}),Ci(g,t,"areaStyle"),St(g).seriesIndex=t.seriesIndex,lr(g,N,F,O)}var X=this._changePolyState;o.eachItemGraphicEl(function(re){re&&(re.onHoverStateChange=X)}),this._polyline.onHoverStateChange=X,this._data=o,this._coordSys=a,this._stackedOnPoints=b,this._points=c,this._step=A,this._valueOrigin=_,t.get("triggerLineEvent")&&(this.packEventData(t,p),g&&this.packEventData(t,g))},e.prototype.packEventData=function(t,r){St(r).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,r,i,a){var s=t.getData(),o=lf(s,a);if(this._changePolyState("emphasis"),!(o instanceof Array)&&o!=null&&o>=0){var l=s.getLayout("points"),u=s.getItemGraphicEl(o);if(!u){var c=l[o*2],h=l[o*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 G0(s,o),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,s.setItemGraphicEl(o,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else $n.prototype.highlight.call(this,t,r,i,a)},e.prototype.downplay=function(t,r,i,a){var s=t.getData(),o=lf(s,a);if(this._changePolyState("normal"),o!=null&&o>=0){var l=s.getItemGraphicEl(o);l&&(l.__temp?(s.setItemGraphicEl(o,null),this.group.remove(l)):l.downplay())}else $n.prototype.downplay.call(this,t,r,i,a)},e.prototype._changePolyState=function(t){var r=this._polygon;Mx(this._polyline,t),r&&Mx(r,t)},e.prototype._newPolyline=function(t){var r=this._polyline;return r&&this._lineGroup.remove(r),r=new foe({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(r),this._polyline=r,r},e.prototype._newPolygon=function(t,r){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new tH({shape:{points:t,stackedOnPoints:r},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(t,r,i){var a,s,o=r.getBaseAxis(),l=o.inverse;r.type==="cartesian2d"?(a=o.isHorizontal(),s=!1):r.type==="polar"&&(a=o.dim==="angle",s=!0);var u=t.hostModel,c=u.get("animationDuration");ct(c)&&(c=c(null));var h=u.get("animationDelay")||0,f=ct(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(s){var x=i,b=r.pointToCoord(v);a?(m=x.startAngle,y=x.endAngle,_=-b[1]/180*Math.PI):(m=x.r0,y=x.r,_=b[0])}else{var S=i;a?(m=S.x,y=S.x+S.width,_=d.x):(m=S.y+S.height,y=S.y,_=d.y)}var w=y===m?0:(_-m)/(y-m);l&&(w=1-w);var T=ct(h)?h(p):c*w+f,C=g.getSymbolPath(),A=C.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),A&&A.animateFrom({style:{opacity:0}},{duration:300,delay:T}),C.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(t,r,i){var a=t.getModel("endLabel");if(iH(t)){var s=t.getData(),o=this._polyline,l=s.getLayout("points");if(!l){o.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new ln({z2:200}),u.ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var c=xoe(l);c>=0&&(Ei(o,ri(t,"endLabel"),{inheritColor:i,labelFetcher:t,labelDataIndex:c,defaultText:function(h,f,d){return d!=null?Z9(s,d):Mp(s,h)},enableTextSetter:!0},Soe(a,r)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,r,i,a,s,o,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=o.get("precision"),g=o.get("distance")||0,v=l.getBaseAxis(),m=v.isHorizontal(),y=v.inverse,_=r.shape,x=y?m?_.x:_.y+_.height:m?_.x+_.width:_.y,b=(m?g:0)*(y?-1:1),S=(m?0:-g)*(y?-1:1),w=m?"x":"y",T=boe(h,x,w),C=T.range,A=C[1]-C[0],M=void 0;if(A>=1){if(A>1&&!d){var P=G4(h,C[0]);u.attr({x:P[0]+b,y:P[1]+S}),s&&(M=f.getRawValue(C[0]))}else{var P=c.getPointOn(x,w);P&&u.attr({x:P[0]+b,y:P[1]+S});var D=f.getRawValue(C[0]),L=f.getRawValue(C[1]);s&&(M=wU(i,p,D,L,T.t))}a.lastFrameIndex=C[0]}else{var R=t===1||a.lastFrameIndex>0?C[0]:0,P=G4(h,R);s&&(M=f.getRawValue(R)),u.attr({x:P[0]+b,y:P[1]+S})}if(s){var N=Kp(u);typeof N.setLabelText=="function"&&N.setLabelText(M)}}},e.prototype._doUpdateAnimation=function(t,r,i,a,s,o,l){var u=this._polyline,c=this._polygon,h=t.hostModel,f=hoe(this._data,t,this._stackedOnPoints,r,this._coordSys,i,this._valueOrigin),d=f.current,p=f.stackedOnCurrent,g=f.next,v=f.stackedOnNext;if(s&&(p=cu(f.stackedOnCurrent,f.current,i,s,l),d=cu(f.current,null,i,s,l),v=cu(f.stackedOnNext,f.next,i,s,l),g=cu(f.next,null,i,s,l)),F4(d,g)>3e3||c&&F4(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(),cn(u,m,h),c&&(c.setShape({points:d,stackedOnPoints:p}),c.stopAnimation(),cn(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 b=_[x].cmd;if(b==="="){var S=t.getItemGraphicEl(_[x].idx1);S&&y.push({el:S,ptIdx:x})}}u.animators&&u.animators.length&&u.animators[0].during(function(){c&&c.dirtyShape();for(var w=u.shape.__points,T=0;T<y.length;T++){var C=y[T].el,A=y[T].ptIdx*2;C.x=w[A],C.y=w[A+1],C.markRedraw()}})},e.prototype.remove=function(t){var r=this.group,i=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),i&&i.eachItemGraphicEl(function(a,s){a.__temp&&(r.remove(a),i.setItemGraphicEl(s,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e}($n);const Aoe=woe;function V0(n,e){return{seriesType:n,plan:nv(),reset:function(t){var r=t.getData(),i=t.coordinateSystem,a=t.pipelineContext,s=e||a.large;if(i){var o=Ne(i.dimensions,function(d){return r.mapDimension(d)}).slice(0,2),l=o.length,u=r.getCalculationInfo("stackResultDimension");dc(r,o[0])&&(o[0]=u),dc(r,o[1])&&(o[1]=u);var c=r.getStore(),h=r.getDimensionIndex(o[0]),f=r.getDimensionIndex(o[1]);return l&&{progress:function(d,p){for(var g=d.end-d.start,v=s&&Uo(g*l),m=[],y=[],_=d.start,x=0;_<d.end;_++){var b=void 0;if(l===1){var S=c.get(h,_);b=i.dataToPoint(S,null,y)}else m[0]=c.get(h,_),m[1]=c.get(f,_),b=i.dataToPoint(m,null,y);s?(v[x++]=b[0],v[x++]=b[1]):p.setItemLayout(_,b.slice())}s&&p.setLayout("points",v)}}}}}}var Moe={average:function(n){for(var e=0,t=0,r=0;r<n.length;r++)isNaN(n[r])||(e+=n[r],t++);return t===0?NaN:e/t},sum:function(n){for(var e=0,t=0;t<n.length;t++)e+=n[t]||0;return e},max:function(n){for(var e=-1/0,t=0;t<n.length;t++)n[t]>e&&(e=n[t]);return isFinite(e)?e:NaN},min:function(n){for(var e=1/0,t=0;t<n.length;t++)n[t]<e&&(e=n[t]);return isFinite(e)?e:NaN},nearest:function(n){return n[0]}},Toe=function(n){return Math.round(n.length/2)};function aH(n){return{seriesType:n,reset:function(e,t,r){var i=e.getData(),a=e.get("sampling"),s=e.coordinateSystem,o=i.count();if(o>10&&s.type==="cartesian2d"&&a){var l=s.getBaseAxis(),u=s.getOtherAxis(l),c=l.getExtent(),h=r.getDevicePixelRatio(),f=Math.abs(c[1]-c[0])*(h||1),d=Math.round(o/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=Moe[a]:ct(a)&&(p=a),p&&e.setData(i.downSample(i.mapDimension(u.dim),1/d,p,Toe))}}}}}function Coe(n){n.registerChartView(Aoe),n.registerSeriesModel(aoe),n.registerLayout(V0("line",!0)),n.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),r=e.getModel("lineStyle").getLineStyle();r&&!r.stroke&&(r.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",r)}}),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,aH("line"))}var sH=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){return Yl(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,r,i){var a=this.coordinateSystem;if(a&&a.clampData){var s=a.clampData(t),o=a.dataToPoint(s);if(i)z(a.getAxes(),function(f,d){if(f.type==="category"&&r!=null){var p=f.getTicksCoords(),g=f.getTickModel().get("alignWithLabel"),v=s[d],m=r[d]==="x1"||r[d]==="y1";if(m&&!g&&(v+=1),p.length<2)return;if(p.length===2){o[d]=f.toGlobalCoord(f.getExtent()[m?1:0]);return}for(var y=void 0,_=void 0,x=1,b=0;b<p.length;b++){var S=p[b].coord,w=b===p.length-1?p[b-1].tickValue+x:p[b].tickValue;if(w===v){_=S;break}else if(w<v)y=S;else if(y!=null&&w>v){_=(S+y)/2;break}b===1&&(x=w-p[0].tickValue)}_==null&&(y?y&&(_=p[p.length-1].coord):_=p[0].coord),o[d]=f.toGlobalCoord(_)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;o[h]+=u+c/2}return o}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}(rr);rr.registerClass(sH);const Wx=sH;var Eoe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(){return Yl(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"),r=this.get("largeThreshold");return r>t&&(t=r),t},e.prototype.brushSelector=function(t,r,i){return i.rect(r.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=wc(Wx.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}(Wx);const Poe=Eoe;var Loe=function(){function n(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return n}(),Roe=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="sausage",r}return e.prototype.getDefaultShape=function(){return new Loe},e.prototype.buildPath=function(t,r){var i=r.cx,a=r.cy,s=Math.max(r.r0||0,0),o=Math.max(r.r,0),l=(o-s)*.5,u=s+l,c=r.startAngle,h=r.endAngle,f=r.clockwise,d=Math.PI*2,p=f?h-c<d:c-h<d;p||(c=h-(f?d:-d));var g=Math.cos(c),v=Math.sin(c),m=Math.cos(h),y=Math.sin(h);p?(t.moveTo(g*s+i,v*s+a),t.arc(g*u+i,v*u+a,l,-Math.PI+c,c,!f)):t.moveTo(g*o+i,v*o+a),t.arc(i,a,o,c,h,!f),t.arc(m*u+i,y*u+a,l,h-Math.PI*2,h-Math.PI,!f),s!==0&&t.arc(i,a,s,h,c,f)},e}(Ht);const $x=Roe;function Doe(n,e){e=e||{};var t=e.isRoundCap;return function(r,i,a){var s=i.position;if(!s||s instanceof Array)return Sx(r,i,a);var o=n(s),l=i.distance!=null?i.distance:5,u=this.shape,c=u.cx,h=u.cy,f=u.r,d=u.r0,p=(f+d)/2,g=u.startAngle,v=u.endAngle,m=(g+v)/2,y=t?Math.abs(f-d)/2:0,_=Math.cos,x=Math.sin,b=c+f*_(g),S=h+f*x(g),w="left",T="top";switch(o){case"startArc":b=c+(d-l)*_(m),S=h+(d-l)*x(m),w="center",T="top";break;case"insideStartArc":b=c+(d+l)*_(m),S=h+(d+l)*x(m),w="center",T="bottom";break;case"startAngle":b=c+p*_(g)+Qy(g,l+y,!1),S=h+p*x(g)+Jy(g,l+y,!1),w="right",T="middle";break;case"insideStartAngle":b=c+p*_(g)+Qy(g,-l+y,!1),S=h+p*x(g)+Jy(g,-l+y,!1),w="left",T="middle";break;case"middle":b=c+p*_(m),S=h+p*x(m),w="center",T="middle";break;case"endArc":b=c+(f+l)*_(m),S=h+(f+l)*x(m),w="center",T="bottom";break;case"insideEndArc":b=c+(f-l)*_(m),S=h+(f-l)*x(m),w="center",T="top";break;case"endAngle":b=c+p*_(v)+Qy(v,l+y,!0),S=h+p*x(v)+Jy(v,l+y,!0),w="left",T="middle";break;case"insideEndAngle":b=c+p*_(v)+Qy(v,-l+y,!0),S=h+p*x(v)+Jy(v,-l+y,!0),w="right",T="middle";break;default:return Sx(r,i,a)}return r=r||{},r.x=b,r.y=S,r.align=w,r.verticalAlign=T,r}}function Ioe(n,e,t,r){if(un(r)){n.setTextConfig({rotation:r});return}else if(Ie(e)){n.setTextConfig({rotation:0});return}var i=n.shape,a=i.clockwise?i.startAngle:i.endAngle,s=i.clockwise?i.endAngle:i.startAngle,o=(a+s)/2,l,u=t(e);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":l=o;break;case"startAngle":case"insideStartAngle":l=a;break;case"endAngle":case"insideEndAngle":l=s;break;default:n.setTextConfig({rotation:0});return}var c=Math.PI*1.5-l;u==="middle"&&c>Math.PI/2&&c<Math.PI*1.5&&(c-=Math.PI),n.setTextConfig({rotation:c})}function Qy(n,e,t){return e*Math.sin(n)*(t?-1:1)}function Jy(n,e,t){return e*Math.cos(n)*(t?1:-1)}function Nh(n,e,t){var r=n.get("borderRadius");if(r==null)return t?{cornerRadius:0}:null;Ie(r)||(r=[r,r,r,r]);var i=Math.abs(e.r||0-e.r0||0);return{cornerRadius:Ne(r,function(a){return uo(a,i)})}}var HA=Math.max,WA=Math.min;function Noe(n,e){var t=n.getArea&&n.getArea();if(Ef(n,"cartesian2d")){var r=n.getBaseAxis();if(r.type!=="category"||!r.onBand){var i=e.getLayout("bandWidth");r.isHorizontal()?(t.x-=i,t.width+=i*2):(t.y-=i,t.height+=i*2)}}return t}var koe=function(n){ve(e,n);function e(){var t=n.call(this)||this;return t.type=e.type,t._isFirstFrame=!0,t}return e.prototype.render=function(t,r,i,a){this._model=t,this._removeOnRenderedListener(i),this._updateDrawMode(t);var s=t.get("coordinateSystem");(s==="cartesian2d"||s==="polar")&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,r,i):this._renderNormal(t,r,i,a))},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,r){this._progressiveEls=[],this._incrementalRenderLarge(t,r)},e.prototype.eachRendered=function(t){Sc(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var r=t.pipelineContext.large;(this._isLargeDraw==null||r!==this._isLargeDraw)&&(this._isLargeDraw=r,this._clear())},e.prototype._renderNormal=function(t,r,i,a){var s=this.group,o=t.getData(),l=this._data,u=t.coordinateSystem,c=u.getBaseAxis(),h;u.type==="cartesian2d"?h=c.isHorizontal():u.type==="polar"&&(h=c.dim==="angle");var f=t.isAnimationEnabled()?t:null,d=Ooe(t,u);d&&this._enableRealtimeSort(d,o,i);var p=t.get("clip",!0)||d,g=Noe(u,o);s.removeClipPath();var v=t.get("roundCap",!0),m=t.get("showBackground",!0),y=t.getModel("backgroundStyle"),_=y.get("borderRadius")||0,x=[],b=this._backgroundEls,S=a&&a.isInitSort,w=a&&a.type==="changeAxisOrder";function T(M){var P=e_[u.type](o,M),D=Hoe(u,h,P);return D.useStyle(y.getItemStyle()),u.type==="cartesian2d"?D.setShape("r",_):D.setShape("cornerRadius",_),x[M]=D,D}o.diff(l).add(function(M){var P=o.getItemModel(M),D=e_[u.type](o,M,P);if(m&&T(M),!(!o.hasValue(M)||!W4[u.type](D))){var L=!1;p&&(L=z4[u.type](g,D));var R=U4[u.type](t,o,M,D,h,f,c.model,!1,v);d&&(R.forceLabelAnimation=!0),$4(R,o,M,P,D,t,h,u.type==="polar"),S?R.attr({shape:D}):d?V4(d,f,R,D,M,h,!1,!1):Jn(R,{shape:D},t,M),o.setItemGraphicEl(M,R),s.add(R),R.ignore=L}}).update(function(M,P){var D=o.getItemModel(M),L=e_[u.type](o,M,D);if(m){var R=void 0;b.length===0?R=T(P):(R=b[P],R.useStyle(y.getItemStyle()),u.type==="cartesian2d"?R.setShape("r",_):R.setShape("cornerRadius",_),x[M]=R);var N=e_[u.type](o,M),F=lH(h,N,u);cn(R,{shape:F},f,M)}var O=l.getItemGraphicEl(P);if(!o.hasValue(M)||!W4[u.type](L)){s.remove(O);return}var H=!1;if(p&&(H=z4[u.type](g,L),H&&s.remove(O)),O?co(O):O=U4[u.type](t,o,M,L,h,f,c.model,!!O,v),d&&(O.forceLabelAnimation=!0),w){var U=O.getTextContent();if(U){var $=Kp(U);$.prevValue!=null&&($.prevValue=$.value)}}else $4(O,o,M,D,L,t,h,u.type==="polar");S?O.attr({shape:L}):d?V4(d,f,O,L,M,h,!0,w):cn(O,{shape:L},t,M,null),o.setItemGraphicEl(M,O),O.ignore=H,s.add(O)}).remove(function(M){var P=l.getItemGraphicEl(M);P&&Hm(P,t,M)}).execute();var C=this._backgroundGroup||(this._backgroundGroup=new bt);C.removeAll();for(var A=0;A<x.length;++A)C.add(x[A]);s.add(C),this._backgroundEls=x,this._data=o},e.prototype._renderLarge=function(t,r,i){this._clear(),q4(t,this.group),this._updateLargeClip(t)},e.prototype._incrementalRenderLarge=function(t,r){this._removeBackground(),q4(r,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(t){var r=t.get("clip",!0)&&U0(t.coordinateSystem,!1,t),i=this.group;r?i.setClipPath(r):i.removeClipPath()},e.prototype._enableRealtimeSort=function(t,r,i){var a=this;if(r.count()){var s=t.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(r,t,i),this._isFirstFrame=!1;else{var o=function(l){var u=r.getItemGraphicEl(l),c=u&&u.shape;return c&&Math.abs(s.isHorizontal()?c.height:c.width)||0};this._onRendered=function(){a._updateSortWithinSameData(r,o,s,i)},i.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(t,r,i){var a=[];return t.each(t.mapDimension(r.dim),function(s,o){var l=i(o);l=l==null?NaN:l,a.push({dataIndex:o,mappedValue:l,ordinalNumber:s})}),a.sort(function(s,o){return o.mappedValue-s.mappedValue}),{ordinalNumbers:Ne(a,function(s){return s.ordinalNumber})}},e.prototype._isOrderChangedWithinSameData=function(t,r,i){for(var a=i.scale,s=t.mapDimension(i.dim),o=Number.MAX_VALUE,l=0,u=a.getOrdinalMeta().categories.length;l<u;++l){var c=t.rawIndexOf(s,a.getRawOrdinalNumber(l)),h=c<0?Number.MIN_VALUE:r(t.indexOfRawIndex(c));if(h>o)return!0;o=h}return!1},e.prototype._isOrderDifferentInView=function(t,r){for(var i=r.scale,a=i.getExtent(),s=Math.max(0,a[0]),o=Math.min(a[1],i.getOrdinalMeta().categories.length-1);s<=o;++s)if(t.ordinalNumbers[s]!==i.getRawOrdinalNumber(s))return!0},e.prototype._updateSortWithinSameData=function(t,r,i,a){if(this._isOrderChangedWithinSameData(t,r,i)){var s=this._dataSort(t,i,r);this._isOrderDifferentInView(s,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:s}))}},e.prototype._dispatchInitSort=function(t,r,i){var a=r.baseAxis,s=this._dataSort(t,a,function(o){return t.get(t.mapDimension(r.otherAxis.dim),o)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:s})},e.prototype.remove=function(t,r){this._clear(this._model),this._removeOnRenderedListener(r)},e.prototype.dispose=function(t,r){this._removeOnRenderedListener(r)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var r=this.group,i=this._data;t&&t.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){Hm(a,t,St(a).dataIndex)})):r.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}($n),z4={cartesian2d:function(n,e){var t=e.width<0?-1:1,r=e.height<0?-1:1;t<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height);var i=n.x+n.width,a=n.y+n.height,s=HA(e.x,n.x),o=WA(e.x+e.width,i),l=HA(e.y,n.y),u=WA(e.y+e.height,a),c=o<s,h=u<l;return e.x=c&&s>i?o:s,e.y=h&&l>a?u:l,e.width=c?0:o-s,e.height=h?0:u-l,t<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height),c||h},polar:function(n,e){var t=e.r0<=e.r?1:-1;if(t<0){var r=e.r;e.r=e.r0,e.r0=r}var i=WA(e.r,n.r),a=HA(e.r0,n.r0);e.r=i,e.r0=a;var s=i-a<0;if(t<0){var r=e.r;e.r=e.r0,e.r0=r}return s}},U4={cartesian2d:function(n,e,t,r,i,a,s,o,l){var u=new nn({shape:Pe({},r),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(n,e,t,r,i,a,s,o,l){var u=!i&&l?$x:La,c=new u({shape:r,z2:1});c.name="item";var h=oH(i);if(c.calculateTextPosition=Doe(h,{isRoundCap:u===$x}),a){var f=c.shape,d=i?"r":"endAngle",p={};f[d]=i?r.r0:r.startAngle,p[d]=r[d],(o?cn:Jn)(c,{shape:p},a)}return c}};function Ooe(n,e){var t=n.get("realtimeSort",!0),r=e.getBaseAxis();if(t&&r.type==="category"&&e.type==="cartesian2d")return{baseAxis:r,otherAxis:e.getOtherAxis(r)}}function V4(n,e,t,r,i,a,s,o){var l,u;a?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),o||(s?cn:Jn)(t,{shape:l},e,i,null);var c=e?n.baseAxis.model:null;(s?cn:Jn)(t,{shape:u},c,i)}function H4(n,e){for(var t=0;t<e.length;t++)if(!isFinite(n[e[t]]))return!0;return!1}var Foe=["x","y","width","height"],Boe=["cx","cy","r","startAngle","endAngle"],W4={cartesian2d:function(n){return!H4(n,Foe)},polar:function(n){return!H4(n,Boe)}},e_={cartesian2d:function(n,e,t){var r=n.getItemLayout(e),i=t?zoe(t,r):0,a=r.width>0?1:-1,s=r.height>0?1:-1;return{x:r.x+a*i/2,y:r.y+s*i/2,width:r.width-a*i,height:r.height-s*i}},polar:function(n,e,t){var r=n.getItemLayout(e);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function Goe(n){return n.startAngle!=null&&n.endAngle!=null&&n.startAngle===n.endAngle}function oH(n){return function(e){var t=e?"Arc":"Angle";return function(r){switch(r){case"start":case"insideStart":case"end":case"insideEnd":return r+t;default:return r}}}(n)}function $4(n,e,t,r,i,a,s,o){var l=e.getItemVisual(t,"style");if(o){if(!a.get("roundCap")){var c=n.shape,h=Nh(r.getModel("itemStyle"),c,!0);Pe(c,h),n.setShape(c)}}else{var u=r.get(["itemStyle","borderRadius"])||0;n.setShape("r",u)}n.useStyle(l);var f=r.getShallow("cursor");f&&n.attr("cursor",f);var d=o?s?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":s?i.height>=0?"bottom":"top":i.width>=0?"right":"left",p=ri(r);Ei(n,p,{labelFetcher:a,labelDataIndex:t,defaultText:Mp(a.getData(),t),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var g=n.getTextContent();if(o&&g){var v=r.get(["label","position"]);n.textConfig.inside=v==="middle"?!0:null,Ioe(n,v==="outside"?d:v,oH(s),r.get(["label","rotate"]))}_7(g,p,a.getRawValue(t),function(y){return Z9(e,y)});var m=r.getModel(["emphasis"]);lr(n,m.get("focus"),m.get("blurScope"),m.get("disabled")),Ci(n,r),Goe(i)&&(n.style.fill="none",n.style.stroke="none",z(n.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function zoe(n,e){var t=n.get(["itemStyle","borderColor"]);if(!t||t==="none")return 0;var r=n.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(r,i,a)}var Uoe=function(){function n(){}return n}(),j4=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="largeBar",r}return e.prototype.getDefaultShape=function(){return new Uoe},e.prototype.buildPath=function(t,r){for(var i=r.points,a=this.baseDimIdx,s=1-this.baseDimIdx,o=[],l=[],u=this.barWidth,c=0;c<i.length;c+=3)l[a]=u,l[s]=i[c+2],o[a]=i[c+a],o[s]=i[c+s],t.rect(o[0],o[1],l[0],l[1])},e}(Ht);function q4(n,e,t,r){var i=n.getData(),a=i.getLayout("valueAxisHorizontal")?1:0,s=i.getLayout("largeDataIndices"),o=i.getLayout("size"),l=n.getModel("backgroundStyle"),u=i.getLayout("largeBackgroundPoints");if(u){var c=new j4({shape:{points:u},incremental:!!r,silent:!0,z2:0});c.baseDimIdx=a,c.largeDataIndices=s,c.barWidth=o,c.useStyle(l.getItemStyle()),e.add(c),t&&t.push(c)}var h=new j4({shape:{points:i.getLayout("largePoints")},incremental:!!r,ignoreCoarsePointer:!0,z2:1});h.baseDimIdx=a,h.largeDataIndices=s,h.barWidth=o,e.add(h),h.useStyle(i.getVisual("style")),h.style.stroke=null,St(h).seriesIndex=n.seriesIndex,n.get("silent")||(h.on("mousedown",X4),h.on("mousemove",X4)),t&&t.push(h)}var X4=yS(function(n){var e=this,t=Voe(e,n.offsetX,n.offsetY);St(e).dataIndex=t>=0?t:null},30,!1);function Voe(n,e,t){for(var r=n.baseDimIdx,i=1-r,a=n.shape.points,s=n.largeDataIndices,o=[],l=[],u=n.barWidth,c=0,h=a.length/3;c<h;c++){var f=c*3;if(l[r]=u,l[i]=a[f+2],o[r]=a[f+r],o[i]=a[f+i],l[i]<0&&(o[i]+=l[i],l[i]=-l[i]),e>=o[0]&&e<=o[0]+l[0]&&t>=o[1]&&t<=o[1]+l[1])return s[c]}return-1}function lH(n,e,t){if(Ef(t,"cartesian2d")){var r=e,i=t.getArea();return{x:n?r.x:i.x,y:n?i.y:r.y,width:n?r.width:i.width,height:n?i.height:r.height}}else{var i=t.getArea(),a=e;return{cx:i.cx,cy:i.cy,r0:n?i.r0:a.r0,r:n?i.r:a.r,startAngle:n?a.startAngle:0,endAngle:n?a.endAngle:Math.PI*2}}}function Hoe(n,e,t){var r=n.type==="polar"?La:nn;return new r({shape:lH(e,t,n),silent:!0,z2:0})}const Woe=koe;function $oe(n){n.registerChartView(Woe),n.registerSeriesModel(Poe),n.registerLayout(n.PRIORITY.VISUAL.LAYOUT,Rt(c9,"bar")),n.registerLayout(n.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,h9("bar")),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,aH("bar")),n.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var r=e.componentType||"series";t.eachComponent({mainType:r,query:e},function(i){e.sortInfo&&i.axis.setCategorySortInfo(e.sortInfo)})})}var Y4=Math.PI*2,t_=Math.PI/180;function uH(n,e){return Kr(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function cH(n,e){var t=uH(n,e),r=n.get("center"),i=n.get("radius");Ie(i)||(i=[0,i]);var a=Xe(t.width,e.getWidth()),s=Xe(t.height,e.getHeight()),o=Math.min(a,s),l=Xe(i[0],o/2),u=Xe(i[1],o/2),c,h,f=n.coordinateSystem;if(f){var d=f.dataToPoint(r);c=d[0]||0,h=d[1]||0}else Ie(r)||(r=[r,r]),c=Xe(r[0],a)+t.x,h=Xe(r[1],s)+t.y;return{cx:c,cy:h,r0:l,r:u}}function joe(n,e,t){e.eachSeriesByType(n,function(r){var i=r.getData(),a=i.mapDimension("value"),s=uH(r,t),o=cH(r,t),l=o.cx,u=o.cy,c=o.r,h=o.r0,f=-r.get("startAngle")*t_,d=r.get("endAngle"),p=r.get("padAngle")*t_;d=d==="auto"?f-Y4:-d*t_;var g=r.get("minAngle")*t_,v=g+p,m=0;i.each(a,function(F){!isNaN(F)&&m++});var y=i.getSum(a),_=Math.PI/(y||m)*2,x=r.get("clockwise"),b=r.get("roseType"),S=r.get("stillShowZeroSum"),w=i.getDataExtent(a);w[0]=0;var T=x?1:-1,C=[f,d],A=T*p/2;LP(C,!x),f=C[0],d=C[1];var M=hH(r);M.startAngle=f,M.endAngle=d,M.clockwise=x;var P=Math.abs(d-f),D=P,L=0,R=f;if(i.setLayout({viewRect:s,r:c}),i.each(a,function(F,O){var H;if(isNaN(F)){i.setItemLayout(O,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:x,cx:l,cy:u,r0:h,r:b?NaN:c});return}b!=="area"?H=y===0&&S?_:F*_:H=P/m,H<v?(H=v,D-=v):L+=F;var U=R+T*H,$=0,Y=0;p>H?($=R+T*H/2,Y=$):($=R+A,Y=U-A),i.setItemLayout(O,{angle:H,startAngle:$,endAngle:Y,clockwise:x,cx:l,cy:u,r0:h,r:b?Sn(F,w,[h,c]):c}),R=U}),D<Y4&&m)if(D<=.001){var N=P/m;i.each(a,function(F,O){if(!isNaN(F)){var H=i.getItemLayout(O);H.angle=N;var U=0,$=0;N<p?(U=f+T*(O+1/2)*N,$=U):(U=f+T*O*N+A,$=f+T*(O+1)*N-A),H.startAngle=U,H.endAngle=$}})}else _=D/L,R=f,i.each(a,function(F,O){if(!isNaN(F)){var H=i.getItemLayout(O),U=H.angle===v?v:F*_,$=0,Y=0;U<p?($=R+T*U/2,Y=$):($=R+A,Y=R+T*U-A),H.startAngle=$,H.endAngle=Y,R+=T*U}})})}var hH=en();function H0(n){return{seriesType:n,reset:function(e,t){var r=t.findComponents({mainType:"legend"});if(!(!r||!r.length)){var i=e.getData();i.filterSelf(function(a){for(var s=i.getName(a),o=0;o<r.length;o++)if(!r[o].isSelected(s))return!1;return!0})}}}}var qoe=Math.PI/180;function K4(n,e,t,r,i,a,s,o,l,u){if(n.length<2)return;function c(g){for(var v=g.rB,m=v*v,y=0;y<g.list.length;y++){var _=g.list[y],x=Math.abs(_.label.y-t),b=r+_.len,S=b*b,w=Math.sqrt(Math.abs((1-x*x/m)*S)),T=e+(w+_.len2)*i,C=T-_.label.x,A=_.targetTextWidth-C*i;fH(_,A,!0),_.label.x=T}}function h(g){for(var v={list:[],maxY:0},m={list:[],maxY:0},y=0;y<g.length;y++)if(g[y].labelAlignTo==="none"){var _=g[y],x=_.label.y>t?m:v,b=Math.abs(_.label.y-t);if(b>=x.maxY){var S=_.label.x-e-_.len2*i,w=r+_.len,T=Math.abs(S)<w?Math.sqrt(b*b/(1-S*S/w/w)):w;x.rB=T,x.maxY=b}x.list.push(_)}c(v),c(m)}for(var f=n.length,d=0;d<f;d++)if(n[d].position==="outer"&&n[d].labelAlignTo==="labelLine"){var p=n[d].label.x-u;n[d].linePoints[1][0]+=p,n[d].label.x=u}N9(n,l,l+s)&&h(n)}function Xoe(n,e,t,r,i,a,s,o){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,f=0;f<n.length;f++){var d=n[f].label;$A(n[f])||(d.x<e?(c=Math.min(c,d.x),l.push(n[f])):(h=Math.max(h,d.x),u.push(n[f])))}for(var f=0;f<n.length;f++){var p=n[f];if(!$A(p)&&p.linePoints){if(p.labelStyleWidth!=null)continue;var d=p.label,g=p.linePoints,v=void 0;p.labelAlignTo==="edge"?d.x<e?v=g[2][0]-p.labelDistance-s-p.edgeDistance:v=s+i-p.edgeDistance-g[2][0]-p.labelDistance:p.labelAlignTo==="labelLine"?d.x<e?v=c-s-p.bleedMargin:v=s+i-h-p.bleedMargin:d.x<e?v=d.x-s-p.bleedMargin:v=s+i-d.x-p.bleedMargin,p.targetTextWidth=v,fH(p,v)}}K4(u,e,t,r,1,i,a,s,o,h),K4(l,e,t,r,-1,i,a,s,o,c);for(var f=0;f<n.length;f++){var p=n[f];if(!$A(p)&&p.linePoints){var d=p.label,g=p.linePoints,m=p.labelAlignTo==="edge",y=d.style.padding,_=y?y[1]+y[3]:0,x=d.style.backgroundColor?0:_,b=p.rect.width+x,S=g[1][0]-g[2][0];m?d.x<e?g[2][0]=s+p.edgeDistance+b+p.labelDistance:g[2][0]=s+i-p.edgeDistance-b-p.labelDistance:(d.x<e?g[2][0]=d.x+p.labelDistance:g[2][0]=d.x-p.labelDistance,g[1][0]=g[2][0]+S),g[1][1]=g[2][1]=d.y}}}function fH(n,e,t){if(t===void 0&&(t=!1),n.labelStyleWidth==null){var r=n.label,i=r.style,a=n.rect,s=i.backgroundColor,o=i.padding,l=o?o[1]+o[3]:0,u=i.overflow,c=a.width+(s?0:l);if(e<c||t){var h=a.height;if(u&&u.match("break")){r.setStyle("backgroundColor",null),r.setStyle("width",e-l);var f=r.getBoundingRect();r.setStyle("width",Math.ceil(f.width)),r.setStyle("backgroundColor",s)}else{var d=e-l,p=e<c?d:t?d>n.unconstrainedWidth?null:d:null;r.setStyle("width",p)}var g=r.getBoundingRect();a.width=g.width;var v=(r.style.margin||0)+2.1;a.height=g.height+v,a.y-=(a.height-h)/2}}}function $A(n){return n.position==="center"}function Yoe(n){var e=n.getData(),t=[],r,i,a=!1,s=(n.get("minShowLabelAngle")||0)*qoe,o=e.getLayout("viewRect"),l=e.getLayout("r"),u=o.width,c=o.x,h=o.y,f=o.height;function d(S){S.ignore=!0}function p(S){if(!S.ignore)return!0;for(var w in S.states)if(S.states[w].ignore===!1)return!0;return!1}e.each(function(S){var w=e.getItemGraphicEl(S),T=w.shape,C=w.getTextContent(),A=w.getTextGuideLine(),M=e.getItemModel(S),P=M.getModel("label"),D=P.get("position")||M.get(["emphasis","label","position"]),L=P.get("distanceToLabelLine"),R=P.get("alignTo"),N=Xe(P.get("edgeDistance"),u),F=P.get("bleedMargin"),O=M.getModel("labelLine"),H=O.get("length");H=Xe(H,u);var U=O.get("length2");if(U=Xe(U,u),Math.abs(T.endAngle-T.startAngle)<s){z(C.states,d),C.ignore=!0,A&&(z(A.states,d),A.ignore=!0);return}if(p(C)){var $=(T.startAngle+T.endAngle)/2,Y=Math.cos($),oe=Math.sin($),X,re,_e,Fe;r=T.cx,i=T.cy;var Ce=D==="inside"||D==="inner";if(D==="center")X=T.cx,re=T.cy,Fe="center";else{var Ae=(Ce?(T.r+T.r0)/2*Y:T.r*Y)+r,ze=(Ce?(T.r+T.r0)/2*oe:T.r*oe)+i;if(X=Ae+Y*3,re=ze+oe*3,!Ce){var fe=Ae+Y*(H+l-T.r),j=ze+oe*(H+l-T.r),xe=fe+(Y<0?-1:1)*U,pe=j;R==="edge"?X=Y<0?c+N:c+u-N:X=xe+(Y<0?-L:L),re=pe,_e=[[Ae,ze],[fe,j],[xe,pe]]}Fe=Ce?"center":R==="edge"?Y>0?"right":"left":Y>0?"left":"right"}var we=Math.PI,V=0,ee=P.get("rotate");if(un(ee))V=ee*(we/180);else if(D==="center")V=0;else if(ee==="radial"||ee===!0){var ae=Y<0?-$+we:-$;V=ae}else if(ee==="tangential"&&D!=="outside"&&D!=="outer"){var I=Math.atan2(Y,oe);I<0&&(I=we*2+I);var G=oe>0;G&&(I=we+I),V=I-we}if(a=!!V,C.x=X,C.y=re,C.rotation=V,C.setStyle({verticalAlign:"middle"}),Ce){C.setStyle({align:Fe});var Ee=C.states.select;Ee&&(Ee.x+=C.x,Ee.y+=C.y)}else{var K=C.getBoundingRect().clone();K.applyTransform(C.getComputedTransform());var ge=(C.style.margin||0)+2.1;K.y-=ge/2,K.height+=ge,t.push({label:C,labelLine:A,position:D,len:H,len2:U,minTurnAngle:O.get("minTurnAngle"),maxSurfaceAngle:O.get("maxSurfaceAngle"),surfaceNormal:new Nt(Y,oe),linePoints:_e,textAlign:Fe,labelDistance:L,labelAlignTo:R,edgeDistance:N,bleedMargin:F,rect:K,unconstrainedWidth:K.width,labelStyleWidth:C.style.width})}w.setTextConfig({inside:Ce})}}),!a&&n.get("avoidLabelOverlap")&&Xoe(t,r,i,l,u,f,c,h);for(var g=0;g<t.length;g++){var v=t[g],m=v.label,y=v.labelLine,_=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:v.textAlign}),_&&(z(m.states,d),m.ignore=!0);var x=m.states.select;x&&(x.x+=m.x,x.y+=m.y)}if(y){var b=v.linePoints;_||!b?(z(y.states,d),y.ignore=!0):(R9(b,v.minTurnAngle),sse(b,v.surfaceNormal,v.maxSurfaceAngle),y.setShape({points:b}),m.__hostTarget.textGuideLineConfig={anchor:new Nt(b[0][0],b[0][1])})}}}var Koe=function(n){ve(e,n);function e(t,r,i){var a=n.call(this)||this;a.z2=2;var s=new ln;return a.setTextContent(s),a.updateData(t,r,i,!0),a}return e.prototype.updateData=function(t,r,i,a){var s=this,o=t.hostModel,l=t.getItemModel(r),u=l.getModel("emphasis"),c=t.getItemLayout(r),h=Pe(Nh(l.getModel("itemStyle"),c,!0),c);if(isNaN(h.startAngle)){s.setShape(h);return}if(a){s.setShape(h);var f=o.getShallow("animationType");o.ecModel.ssr?(Jn(s,{scaleX:0,scaleY:0},o,{dataIndex:r,isFrom:!0}),s.originX=h.cx,s.originY=h.cy):f==="scale"?(s.shape.r=c.r0,Jn(s,{shape:{r:c.r}},o,r)):i!=null?(s.setShape({startAngle:i,endAngle:i}),Jn(s,{shape:{startAngle:c.startAngle,endAngle:c.endAngle}},o,r)):(s.shape.endAngle=c.startAngle,cn(s,{shape:{endAngle:c.endAngle}},o,r))}else co(s),cn(s,{shape:h},o,r);s.useStyle(t.getItemVisual(r,"style")),Ci(s,l);var d=(c.startAngle+c.endAngle)/2,p=o.get("selectedOffset"),g=Math.cos(d)*p,v=Math.sin(d)*p,m=l.getShallow("cursor");m&&s.attr("cursor",m),this._updateLabel(o,t,r),s.ensureState("emphasis").shape=Pe({r:c.r+(u.get("scale")&&u.get("scaleSize")||0)},Nh(u.getModel("itemStyle"),c)),Pe(s.ensureState("select"),{x:g,y:v,shape:Nh(l.getModel(["select","itemStyle"]),c)}),Pe(s.ensureState("blur"),{shape:Nh(l.getModel(["blur","itemStyle"]),c)});var y=s.getTextGuideLine(),_=s.getTextContent();y&&Pe(y.ensureState("select"),{x:g,y:v}),Pe(_.ensureState("select"),{x:g,y:v}),lr(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,r,i){var a=this,s=r.getItemModel(i),o=s.getModel("labelLine"),l=r.getItemVisual(i,"style"),u=l&&l.fill,c=l&&l.opacity;Ei(a,ri(s),{labelFetcher:r.hostModel,labelDataIndex:i,inheritColor:u,defaultOpacity:c,defaultText:t.getFormattedLabel(i,"normal")||r.getName(i)});var h=a.getTextContent();a.setTextConfig({position:null,rotation:null}),h.attr({z2:10});var f=t.get(["label","position"]);if(f!=="outside"&&f!=="outer")a.removeTextGuideLine();else{var d=this.getTextGuideLine();d||(d=new Na,this.setTextGuideLine(d)),mL(this,yL(s),{stroke:u,opacity:Ho(o.get(["lineStyle","opacity"]),c,1)})}},e}(La),Zoe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,r,i,a){var s=t.getData(),o=this._data,l=this.group,u;if(!o&&s.count()>0){for(var c=s.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h<s.count();++h)c=s.getItemLayout(h);c&&(u=c.startAngle)}if(this._emptyCircleSector&&l.remove(this._emptyCircleSector),s.count()===0&&t.get("showEmptyCircle")){var f=hH(t),d=new La({shape:Pe(cH(t,i),f)});d.useStyle(t.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=d,l.add(d)}s.diff(o).add(function(p){var g=new Koe(s,p,u);s.setItemGraphicEl(p,g),l.add(g)}).update(function(p,g){var v=o.getItemGraphicEl(g);v.updateData(s,p,u),v.off("click"),l.add(v),s.setItemGraphicEl(p,v)}).remove(function(p){var g=o.getItemGraphicEl(p);Hm(g,t,p)}).execute(),Yoe(t),t.get("animationTypeUpdate")!=="expansion"&&(this._data=s)},e.prototype.dispose=function(){},e.prototype.containPoint=function(t,r){var i=r.getData(),a=i.getItemLayout(0);if(a){var s=t[0]-a.cx,o=t[1]-a.cy,l=Math.sqrt(s*s+o*o);return l<=a.r&&l>=a.r0}},e.type="pie",e}($n);const Qoe=Zoe;function sv(n,e,t){e=Ie(e)&&{coordDimensions:e}||Pe({encodeDefine:n.getEncode()},e);var r=n.getSource(),i=F0(r,e).dimensions,a=new ia(i,n);return a.initData(r,t),a}var Joe=function(){function n(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return n.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},n.prototype.containName=function(e){var t=this._getRawData();return t.indexOfName(e)>=0},n.prototype.indexOfName=function(e){var t=this._getDataWithEncodedVisual();return t.indexOfName(e)},n.prototype.getItemVisual=function(e,t){var r=this._getDataWithEncodedVisual();return r.getItemVisual(e,t)},n}();const W0=Joe;var ele=en(),tle=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new W0(Qe(this.getData,this),Qe(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.mergeOption=function(){n.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return sv(this,{coordDimensions:["value"],encodeDefaulter:Rt(YP,this)})},e.prototype.getDataParams=function(t){var r=this.getData(),i=ele(r),a=i.seats;if(!a){var s=[];r.each(r.mapDimension("value"),function(l){s.push(l)}),a=i.seats=uJ(s,r.hostModel.get("percentPrecision"))}var o=n.prototype.getDataParams.call(this,t);return o.percent=a[t]||0,o.$vars.push("percent"),o},e.prototype._defaultLabelLine=function(t){of(t,"labelLine",["show"]);var r=t.labelLine,i=t.emphasis.labelLine;r.show=r.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}(rr);const nle=tle;function rle(n){return{seriesType:n,reset:function(e,t){var r=e.getData();r.filterSelf(function(i){var a=r.mapDimension("value"),s=r.get(a,i);return!(un(s)&&!isNaN(s)&&s<0)})}}}function ile(n){n.registerChartView(Qoe),n.registerSeriesModel(nle),CV("pie",n.registerAction),n.registerLayout(Rt(joe,"pie")),n.registerProcessor(H0("pie")),n.registerProcessor(rle("pie"))}var ale=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,r){return Yl(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,r,i){return i.point(r.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}(rr);const sle=ale;var dH=4,ole=function(){function n(){}return n}(),lle=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r._off=0,r.hoverDataIdx=-1,r}return e.prototype.getDefaultShape=function(){return new ole},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,r){var i=r.points,a=r.size,s=this.symbolProxy,o=s.shape,l=t.getContext?t.getContext():t,u=l&&a[0]<dH,c=this.softClipShape,h;if(u){this._ctx=l;return}for(this._ctx=null,h=this._off;h<i.length;){var f=i[h++],d=i[h++];isNaN(f)||isNaN(d)||c&&!c.contain(f,d)||(o.x=f-a[0]/2,o.y=d-a[1]/2,o.width=a[0],o.height=a[1],s.buildPath(t,o,!0))}this.incremental&&(this._off=h,this.notClear=!0)},e.prototype.afterBrush=function(){var t=this.shape,r=t.points,i=t.size,a=this._ctx,s=this.softClipShape,o;if(a){for(o=this._off;o<r.length;){var l=r[o++],u=r[o++];isNaN(l)||isNaN(u)||s&&!s.contain(l,u)||a.fillRect(l-i[0]/2,u-i[1]/2,i[0],i[1])}this.incremental&&(this._off=o,this.notClear=!0)}},e.prototype.findDataIndex=function(t,r){for(var i=this.shape,a=i.points,s=i.size,o=Math.max(s[0],4),l=Math.max(s[1],4),u=a.length/2-1;u>=0;u--){var c=u*2,h=a[c]-o/2,f=a[c+1]-l/2;if(t>=h&&r>=f&&t<=h+o&&r<=f+l)return u}return-1},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();if(t=i[0],r=i[1],a.contain(t,r)){var s=this.hoverDataIdx=this.findDataIndex(t,r);return s>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var r=this.shape,i=r.points,a=r.size,s=a[0],o=a[1],l=1/0,u=1/0,c=-1/0,h=-1/0,f=0;f<i.length;){var d=i[f++],p=i[f++];l=Math.min(d,l),c=Math.max(d,c),u=Math.min(p,u),h=Math.max(p,h)}t=this._rect=new Ot(l-s/2,u-o/2,c-l+s,h-u+o)}return t},e}(Ht),ule=function(){function n(){this.group=new bt}return n.prototype.updateData=function(e,t){this._clear();var r=this._create();r.setShape({points:e.getLayout("points")}),this._setCommon(r,e,t)},n.prototype.updateLayout=function(e){var t=e.getLayout("points");this.group.eachChild(function(r){if(r.startIndex!=null){var i=(r.endIndex-r.startIndex)*2,a=r.startIndex*4*2;t=new Float32Array(t.buffer,a,i)}r.setShape("points",t),r.reset()})},n.prototype.incrementalPrepareUpdate=function(e){this._clear()},n.prototype.incrementalUpdate=function(e,t,r){var i=this._newAdded[0],a=t.getLayout("points"),s=i&&i.shape.points;if(s&&s.length<2e4){var o=s.length,l=new Float32Array(o+a.length);l.set(s),l.set(a,o),i.endIndex=e.end,i.setShape({points:l})}else{this._newAdded=[];var u=this._create();u.startIndex=e.start,u.endIndex=e.end,u.incremental=!0,u.setShape({points:a}),this._setCommon(u,t,r)}},n.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},n.prototype._create=function(){var e=new lle({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},n.prototype._setCommon=function(e,t,r){var i=t.hostModel;r=r||{};var a=t.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=r.clipShape||null,e.symbolProxy=Br(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var s=e.shape.size[0]<dH;e.useStyle(i.getModel("itemStyle").getItemStyle(s?["color","shadowBlur","shadowColor"]:["color"]));var o=t.getVisual("style"),l=o&&o.fill;l&&e.setColor(l);var u=St(e);u.seriesIndex=i.seriesIndex,e.on("mousemove",function(c){u.dataIndex=null;var h=e.hoverDataIdx;h>=0&&(u.dataIndex=h+(e.startIndex||0))})},n.prototype.remove=function(){this._clear()},n.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},n}();const cle=ule;var hle=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.getData(),s=this._updateSymbolDraw(a,t);s.updateData(a,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,r,i){var a=t.getData(),s=this._updateSymbolDraw(a,t);s.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(t,r,i){this._symbolDraw.incrementalUpdate(t,r.getData(),{clipShape:this._getClipShape(r)}),this._finished=t.end===r.getData().count()},e.prototype.updateTransform=function(t,r,i){var a=t.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var s=V0("").reset(t,r,i);s.progress&&s.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 r=t.coordinateSystem;return r&&r.getArea&&r.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,r){var i=this._symbolDraw,a=r.pipelineContext,s=a.large;return(!i||s!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=s?new cle:new z0,this._isLargeDraw=s,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(t,r){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}($n);const fle=hle;var dle=function(n){ve(e,n);function e(){return n!==null&&n.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}(sn);const ple=dle;var wC=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Fr).models[0]},e.type="cartesian2dAxis",e}(sn);zr(wC,B0);var pH={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)"]}}},vle=It({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},pH),AL=It({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}}},pH),gle=It({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},AL),mle=dt({logBase:10},AL);const vH={category:vle,value:AL,time:gle,log:mle};var yle={value:1,category:1,time:1,log:1};function Tp(n,e,t,r){z(yle,function(i,a){var s=It(It({},vH[a],!0),r,!0),o=function(l){ve(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=$m(this),d=f?Jp(c):{},p=h.getTheme();It(c,p.get(a+"Axis")),It(c,this.getDefaultOption()),c.type=Z4(c),f&&fc(c,d,f)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=gC.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=s,u}(t);n.registerComponentModel(o)}),n.registerSubTypeDefaulter(e+"Axis",Z4)}function Z4(n){return n.type||(n.data?"category":"value")}var _le=function(){function n(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return n.prototype.getAxis=function(e){return this._axes[e]},n.prototype.getAxes=function(){return Ne(this._dimList,function(e){return this._axes[e]},this)},n.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),_n(this.getAxes(),function(t){return t.scale.type===e})},n.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},n}();const xle=_le;var AC=["x","y"];function Q4(n){return n.type==="interval"||n.type==="time"}var ble=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=AC,t}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,r=this.getAxis("y").scale;if(!(!Q4(t)||!Q4(r))){var i=t.getExtent(),a=r.getExtent(),s=this.dataToPoint([i[0],a[0]]),o=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var c=(o[0]-s[0])/l,h=(o[1]-s[1])/u,f=s[0]-i[0]*c,d=s[1]-a[0]*h,p=this._transform=[c,0,0,h,f,d];this._invTransform=jp([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var r=this.getAxis("x"),i=this.getAxis("y");return r.contain(r.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,r){var i=this.dataToPoint(t),a=this.dataToPoint(r),s=this.getArea(),o=new Ot(i[0],i[1],a[0]-i[0],a[1]-i[1]);return s.intersect(o)},e.prototype.dataToPoint=function(t,r,i){i=i||[];var a=t[0],s=t[1];if(this._transform&&a!=null&&isFinite(a)&&s!=null&&isFinite(s))return Mi(i,t,this._transform);var o=this.getAxis("x"),l=this.getAxis("y");return i[0]=o.toGlobalCoord(o.dataToCoord(a,r)),i[1]=l.toGlobalCoord(l.dataToCoord(s,r)),i},e.prototype.clampData=function(t,r){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,s=i.getExtent(),o=a.getExtent(),l=i.parse(t[0]),u=a.parse(t[1]);return r=r||[],r[0]=Math.min(Math.max(Math.min(s[0],s[1]),l),Math.max(s[0],s[1])),r[1]=Math.min(Math.max(Math.min(o[0],o[1]),u),Math.max(o[0],o[1])),r},e.prototype.pointToData=function(t,r){var i=[];if(this._invTransform)return Mi(i,t,this._invTransform);var a=this.getAxis("x"),s=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(t[0]),r),i[1]=s.coordToData(s.toLocalCoord(t[1]),r),i},e.prototype.getOtherAxis=function(t){return this.getAxis(t.dim==="x"?"y":"x")},e.prototype.getArea=function(t){t=t||0;var r=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(r[0],r[1])-t,s=Math.min(i[0],i[1])-t,o=Math.max(r[0],r[1])-a+t,l=Math.max(i[0],i[1])-s+t;return new Ot(a,s,o,l)},e}(xle),Sle=function(n){ve(e,n);function e(t,r,i,a,s){var o=n.call(this,t,r,i)||this;return o.index=0,o.type=a||"value",o.position=s||"bottom",o}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.getGlobalExtent=function(t){var r=this.getExtent();return r[0]=this.toGlobalCoord(r[0]),r[1]=this.toGlobalCoord(r[1]),t&&r[0]>r[1]&&r.reverse(),r},e.prototype.pointToData=function(t,r){return this.coordToData(this.toLocalCoord(t[this.dim==="x"?0:1]),r)},e.prototype.setCategorySortInfo=function(t){if(this.type!=="category")return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(po);const wle=Sle;function MC(n,e,t){t=t||{};var r=n.coordinateSystem,i=e.axis,a={},s=i.getAxesOnZeroOf()[0],o=i.position,l=s?"onZero":o,u=i.dim,c=r.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(s){var g=s.toGlobalCoord(s.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[o],a.labelOffset=s?p[f[o]]-p[f.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),di(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 J4(n){return n.get("coordinateSystem")==="cartesian2d"}function ek(n){var e={xAxisModel:null,yAxisModel:null};return z(e,function(t,r){var i=r.replace(/Model$/,""),a=n.getReferringComponents(i,Fr).models[0];e[r]=a}),e}var jA=Math.log;function gH(n,e,t){var r=pc.prototype,i=r.getTicks.call(t),a=r.getTicks.call(t,!0),s=i.length-1,o=r.getInterval.call(t),l=y9(n,e),u=l.extent,c=l.fixMin,h=l.fixMax;if(n.type==="log"){var f=jA(n.base);u=[jA(u[0])/f,jA(u[1])/f]}n.setExtent(u[0],u[1]),n.calcNiceExtent({splitNumber:s,fixMin:c,fixMax:h});var d=r.getExtent.call(n);c&&(u[0]=d[0]),h&&(u[1]=d[1]);var p=r.getInterval.call(n),g=u[0],v=u[1];if(c&&h)p=(v-g)/s;else if(c)for(v=u[0]+p*s;v<u[1]&&isFinite(v)&&isFinite(u[1]);)p=RA(p),v=u[0]+p*s;else if(h)for(g=u[1]-p*s;g>u[0]&&isFinite(g)&&isFinite(u[0]);)p=RA(p),g=u[1]-p*s;else{var m=n.getTicks().length-1;m>s&&(p=RA(p));var y=p*s;v=Math.ceil(u[1]/p)*p,g=xr(v-y),g<0&&u[0]>=0?(g=0,v=xr(y)):v>0&&u[1]<=0&&(v=0,g=-xr(y))}var _=(i[0].value-a[0].value)/o,x=(i[s].value-a[s].value)/o;r.setExtent.call(n,g+p*_,v+p*x),r.setInterval.call(n,p),(_||x)&&r.setNiceExtent.call(n,g+p,v-p)}var Ale=function(){function n(e,t,r){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=AC,this._initCartesian(e,t,r),this.model=e}return n.prototype.getRect=function(){return this._rect},n.prototype.update=function(e,t){var r=this._axesMap;this._updateScale(e,this.model);function i(s){var o,l=Yt(s),u=l.length;if(u){for(var c=[],h=u-1;h>=0;h--){var f=+l[h],d=s[f],p=d.model,g=d.scale;mC(g)&&p.get("alignTicks")&&p.get("interval")==null?c.push(d):(Ap(g,p),mC(g)&&(o=d))}c.length&&(o||(o=c.pop(),Ap(o.scale,o.model)),z(c,function(v){gH(v.scale,v.model,o.scale)}))}}i(r.x),i(r.y);var a={};z(r.x,function(s){tk(r,"y",s,a)}),z(r.y,function(s){tk(r,"x",s,a)}),this.resize(this.model,t)},n.prototype.resize=function(e,t,r){var i=e.getBoxLayoutParams(),a=!r&&e.get("containLabel"),s=Kr(i,{width:t.getWidth(),height:t.getHeight()});this._rect=s;var o=this._axesList;l(),a&&(z(o,function(u){if(!u.model.get(["axisLabel","inside"])){var c=Oae(u);if(c){var h=u.isHorizontal()?"height":"width",f=u.model.get(["axisLabel","margin"]);s[h]-=c[h]+f,u.position==="top"?s.y+=c.height+f:u.position==="left"&&(s.x+=c.width+f)}}}),l()),z(this._coordsList,function(u){u.calcAffineTransform()});function l(){z(o,function(u){var c=u.isHorizontal(),h=c?[0,s.width]:[0,s.height],f=u.inverse?1:0;u.setExtent(h[f],h[1-f]),Mle(u,c?s.x:s.y)})}},n.prototype.getAxis=function(e,t){var r=this._axesMap[e];if(r!=null)return r[t||0]},n.prototype.getAxes=function(){return this._axesList.slice()},n.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var r="x"+e+"y"+t;return this._coordsMap[r]}gt(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,a=this._coordsList;i<a.length;i++)if(a[i].getAxis("x").index===e||a[i].getAxis("y").index===t)return a[i]},n.prototype.getCartesians=function(){return this._coordsList.slice()},n.prototype.convertToPixel=function(e,t,r){var i=this._findConvertTarget(t);return i.cartesian?i.cartesian.dataToPoint(r):i.axis?i.axis.toGlobalCoord(i.axis.dataToCoord(r)):null},n.prototype.convertFromPixel=function(e,t,r){var i=this._findConvertTarget(t);return i.cartesian?i.cartesian.pointToData(r):i.axis?i.axis.coordToData(i.axis.toLocalCoord(r)):null},n.prototype._findConvertTarget=function(e){var t=e.seriesModel,r=e.xAxisModel||t&&t.getReferringComponents("xAxis",Fr).models[0],i=e.yAxisModel||t&&t.getReferringComponents("yAxis",Fr).models[0],a=e.gridModel,s=this._coordsList,o,l;if(t)o=t.coordinateSystem,Ft(s,o)<0&&(o=null);else if(r&&i)o=this.getCartesian(r.componentIndex,i.componentIndex);else if(r)l=this.getAxis("x",r.componentIndex);else if(i)l=this.getAxis("y",i.componentIndex);else if(a){var u=a.coordinateSystem;u===this&&(o=this._coordsList[0])}return{cartesian:o,axis:l}},n.prototype.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},n.prototype._initCartesian=function(e,t,r){var i=this,a=this,s={left:!1,right:!1,top:!1,bottom:!1},o={x:{},y:{}},l={x:0,y:0};if(t.eachComponent("xAxis",u("x"),this),t.eachComponent("yAxis",u("y"),this),!l.x||!l.y){this._axesMap={},this._axesList=[];return}this._axesMap=o,z(o.x,function(c,h){z(o.y,function(f,d){var p="x"+h+"y"+d,g=new ble(p);g.master=i,g.model=e,i._coordsMap[p]=g,i._coordsList.push(g),g.addAxis(c),g.addAxis(f)})});function u(c){return function(h,f){if(qA(h,e)){var d=h.get("position");c==="x"?d!=="top"&&d!=="bottom"&&(d=s.bottom?"top":"bottom"):d!=="left"&&d!=="right"&&(d=s.left?"right":"left"),s[d]=!0;var p=new wle(c,wS(h),[0,0],h.get("type"),d),g=p.type==="category";p.onBand=g&&h.get("boundaryGap"),p.inverse=h.get("inverse"),h.axis=p,p.model=h,p.grid=a,p.index=f,a._axesList.push(p),o[c][f]=p,l[c]++}}}},n.prototype._updateScale=function(e,t){z(this._axesList,function(i){if(i.scale.setExtent(1/0,-1/0),i.type==="category"){var a=i.model.get("categorySortInfo");i.scale.setSortInfo(a)}}),e.eachSeries(function(i){if(J4(i)){var a=ek(i),s=a.xAxisModel,o=a.yAxisModel;if(!qA(s,t)||!qA(o,t))return;var l=this.getCartesian(s.componentIndex,o.componentIndex),u=i.getData(),c=l.getAxis("x"),h=l.getAxis("y");r(u,c),r(u,h)}},this);function r(i,a){z(zx(i,a.dim),function(s){a.scale.unionExtentFromData(i,s)})}},n.prototype.getTooltipAxes=function(e){var t=[],r=[];return z(this.getCartesians(),function(i){var a=e!=null&&e!=="auto"?i.getAxis(e):i.getBaseAxis(),s=i.getOtherAxis(a);Ft(t,a)<0&&t.push(a),Ft(r,s)<0&&r.push(s)}),{baseAxes:t,otherAxes:r}},n.create=function(e,t){var r=[];return e.eachComponent("grid",function(i,a){var s=new n(i,e,t);s.name="grid_"+a,s.resize(i,t,!0),i.coordinateSystem=s,r.push(s)}),e.eachSeries(function(i){if(J4(i)){var a=ek(i),s=a.xAxisModel,o=a.yAxisModel,l=s.getCoordSysModel(),u=l.coordinateSystem;i.coordinateSystem=u.getCartesian(s.componentIndex,o.componentIndex)}}),r},n.dimensions=AC,n}();function qA(n,e){return n.getCoordSysModel()===e}function tk(n,e,t,r){t.getAxesOnZeroOf=function(){return a?[a]:[]};var i=n[e],a,s=t.model,o=s.get(["axisLine","onZero"]),l=s.get(["axisLine","onZeroAxisIndex"]);if(!o)return;if(l!=null)nk(i[l])&&(a=i[l]);else for(var u in i)if(i.hasOwnProperty(u)&&nk(i[u])&&!r[c(i[u])]){a=i[u];break}a&&(r[c(a)]=!0);function c(h){return h.dim+"_"+h.index}}function nk(n){return n&&n.type!=="category"&&n.type!=="time"&&kae(n)}function Mle(n,e){var t=n.getExtent(),r=t[0]+t[1];n.toGlobalCoord=n.dim==="x"?function(i){return i+e}:function(i){return r-i+e},n.toLocalCoord=n.dim==="x"?function(i){return i-e}:function(i){return r-i+e}}const Tle=Ale;var Vu=Math.PI,Kh=function(){function n(e,t){this.group=new bt,this.opt=t,this.axisModel=e,dt(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var r=new bt({x:t.position[0],y:t.position[1],rotation:t.rotation});r.updateTransform(),this._transformGroup=r}return n.prototype.hasBuilder=function(e){return!!rk[e]},n.prototype.add=function(e){rk[e](this.opt,this.axisModel,this.group,this._transformGroup)},n.prototype.getGroup=function(){return this.group},n.innerTextLayout=function(e,t,r){var i=dU(t-e),a,s;return Bm(i)?(s=r>0?"top":"bottom",a="center"):Bm(i-Vu)?(s=r>0?"bottom":"top",a="center"):(s="middle",i>0&&i<Vu?a=r>0?"right":"left":a=r>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:s}},n.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},n.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},n}(),rk={axisLine:function(n,e,t,r){var i=e.get(["axisLine","show"]);if(i==="auto"&&n.handleAutoShown&&(i=n.handleAutoShown("axisLine")),!!i){var a=e.axis.getExtent(),s=r.transform,o=[a[0],0],l=[a[1],0],u=o[0]>l[0];s&&(Mi(o,o,s),Mi(l,l,s));var c=Pe({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new pi({shape:{x1:o[0],y1:o[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:n.strokeContainThreshold||5,silent:!0,z2:1});bp(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)||un(d))&&(d=[d,d]);var p=Tf(e.get(["axisLine","symbolOffset"])||0,d),g=d[0],v=d[1];z([{rotate:n.rotation+Math.PI/2,offset:p[0],r:0},{rotate:n.rotation-Math.PI/2,offset:p[1],r:Math.sqrt((o[0]-l[0])*(o[0]-l[0])+(o[1]-l[1])*(o[1]-l[1]))}],function(m,y){if(f[y]!=="none"&&f[y]!=null){var _=Br(f[y],-g/2,-v/2,g,v,c.stroke,!0),x=m.r+m.offset,b=u?l:o;_.attr({rotation:m.rotate,x:b[0]+x*Math.cos(n.rotation),y:b[1]-x*Math.sin(n.rotation),silent:!0,z2:11}),t.add(_)}})}}},axisTickLabel:function(n,e,t,r){var i=Ple(t,r,e,n),a=Rle(t,r,e,n);if(Ele(e,a,i),Lle(t,r,e,n.tickDirection),e.get(["axisLabel","hideOverlap"])){var s=D9(Ne(a,function(o){return{label:o,priority:o.z2,defaultAttr:{ignore:o.ignore}}}));k9(s)}},axisName:function(n,e,t,r){var i=di(n.axisName,e.get("name"));if(i){var a=e.get("nameLocation"),s=n.nameDirection,o=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,ak(a)?n.labelOffset+s*l:0],f,d=e.get("nameRotate");d!=null&&(d=d*Vu/180);var p;ak(a)?f=Kh.innerTextLayout(n.rotation,d!=null?d:n.rotation,s):(f=Cle(n.rotation,a,d||0,u),p=n.axisNameAvailableWidth,p!=null&&(p=Math.abs(p/Math.sin(f.rotation)),!isFinite(p)&&(p=null)));var g=o.getFont(),v=e.get("nameTruncate",!0)||{},m=v.ellipsis,y=di(n.nameTruncateMaxWidth,v.maxWidth,p),_=new ln({x:h[0],y:h[1],rotation:f.rotation,silent:Kh.isLabelSilent(e),style:Hn(o,{text:i,font:g,overflow:"truncate",width:y,ellipsis:m,fill:o.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:o.get("align")||f.textAlign,verticalAlign:o.get("verticalAlign")||f.textVerticalAlign}),z2:1});if(wf({el:_,componentModel:e,itemName:i}),_.__fullText=i,_.anid="name",e.get("triggerEvent")){var x=Kh.makeAxisEventDataBase(e);x.targetType="axisName",x.name=i,St(_).eventData=x}r.add(_),_.updateTransform(),t.add(_),_.decomposeTransform()}}};function Cle(n,e,t,r){var i=dU(t-n),a,s,o=r[0]>r[1],l=e==="start"&&!o||e!=="start"&&o;return Bm(i-Vu/2)?(s=l?"bottom":"top",a="center"):Bm(i-Vu*1.5)?(s=l?"top":"bottom",a="center"):(s="middle",i<Vu*1.5&&i>Vu/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:s}}function Ele(n,e,t){if(!_9(n.axis)){var r=n.get(["axisLabel","showMinLabel"]),i=n.get(["axisLabel","showMaxLabel"]);e=e||[],t=t||[];var a=e[0],s=e[1],o=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];r===!1?(ss(a),ss(u)):ik(a,s)&&(r?(ss(s),ss(c)):(ss(a),ss(u))),i===!1?(ss(o),ss(h)):ik(l,o)&&(i?(ss(l),ss(f)):(ss(o),ss(h)))}}function ss(n){n&&(n.ignore=!0)}function ik(n,e){var t=n&&n.getBoundingRect().clone(),r=e&&e.getBoundingRect().clone();if(!(!t||!r)){var i=Xb([]);return Sf(i,i,-n.rotation),t.applyTransform(Dl([],i,n.getLocalTransform())),r.applyTransform(Dl([],i,e.getLocalTransform())),t.intersect(r)}}function ak(n){return n==="middle"||n==="center"}function mH(n,e,t,r,i){for(var a=[],s=[],o=[],l=0;l<n.length;l++){var u=n[l].coord;s[0]=u,s[1]=0,o[0]=u,o[1]=t,e&&(Mi(s,s,e),Mi(o,o,e));var c=new pi({shape:{x1:s[0],y1:s[1],x2:o[0],y2:o[1]},style:r,z2:2,autoBatch:!0,silent:!0});bp(c.shape,c.style.lineWidth),c.anid=i+"_"+n[l].tickValue,a.push(c)}return a}function Ple(n,e,t,r){var i=t.axis,a=t.getModel("axisTick"),s=a.get("show");if(s==="auto"&&r.handleAutoShown&&(s=r.handleAutoShown("axisTick")),!(!s||i.scale.isBlank())){for(var o=a.getModel("lineStyle"),l=r.tickDirection*a.get("length"),u=i.getTicksCoords(),c=mH(u,e.transform,l,dt(o.getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])}),"ticks"),h=0;h<c.length;h++)n.add(c[h]);return c}}function Lle(n,e,t,r){var i=t.axis,a=t.getModel("minorTick");if(!(!a.get("show")||i.scale.isBlank())){var s=i.getMinorTicksCoords();if(s.length)for(var o=a.getModel("lineStyle"),l=r*a.get("length"),u=dt(o.getLineStyle(),dt(t.getModel("axisTick").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})),c=0;c<s.length;c++)for(var h=mH(s[c],e.transform,l,u,"minorticks_"+c),f=0;f<h.length;f++)n.add(h[f])}}function Rle(n,e,t,r){var i=t.axis,a=di(r.axisLabelShow,t.get(["axisLabel","show"]));if(!(!a||i.scale.isBlank())){var s=t.getModel("axisLabel"),o=s.get("margin"),l=i.getViewLabels(),u=(di(r.labelRotate,s.get("rotate"))||0)*Vu/180,c=Kh.innerTextLayout(r.rotation,u,r.labelDirection),h=t.getCategories&&t.getCategories(!0),f=[],d=Kh.isLabelSilent(t),p=t.get("triggerEvent");return z(l,function(g,v){var m=i.scale.type==="ordinal"?i.scale.getRawOrdinalNumber(g.tickValue):g.tickValue,y=g.formattedLabel,_=g.rawLabel,x=s;if(h&&h[m]){var b=h[m];gt(b)&&b.textStyle&&(x=new Wn(b.textStyle,s,t.ecModel))}var S=x.getTextColor()||t.get(["axisLine","lineStyle","color"]),w=i.dataToCoord(m),T=x.getShallow("align",!0)||c.textAlign,C=Et(x.getShallow("alignMinLabel",!0),T),A=Et(x.getShallow("alignMaxLabel",!0),T),M=x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||c.textVerticalAlign,P=Et(x.getShallow("verticalAlignMinLabel",!0),M),D=Et(x.getShallow("verticalAlignMaxLabel",!0),M),L=new ln({x:w,y:r.labelOffset+r.labelDirection*o,rotation:c.rotation,silent:d,z2:10+(g.level||0),style:Hn(x,{text:y,align:v===0?C:v===l.length-1?A:T,verticalAlign:v===0?P:v===l.length-1?D:M,fill:ct(S)?S(i.type==="category"?_:i.type==="value"?m+"":m,v):S})});if(L.anid="label_"+m,wf({el:L,componentModel:t,itemName:y,formatterParamsExtra:{isTruncated:function(){return L.isTruncated},value:_,tickIndex:v}}),p){var R=Kh.makeAxisEventDataBase(t);R.targetType="axisLabel",R.value=_,R.tickIndex=v,i.type==="category"&&(R.dataIndex=m),St(L).eventData=R}e.add(L),L.updateTransform(),f.push(L),n.add(L),L.decomposeTransform()}),f}}const Hl=Kh;function Dle(n,e){var t={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return Ile(t,n,e),t.seriesInvolved&&kle(t,n),t}function Ile(n,e,t){var r=e.getComponent("tooltip"),i=e.getComponent("axisPointer"),a=i.get("link",!0)||[],s=[];z(t.getCoordinateSystems(),function(o){if(!o.axisPointerEnabled)return;var l=Jm(o.model),u=n.coordSysAxesInfo[l]={};n.coordSysMap[l]=o;var c=o.model,h=c.getModel("tooltip",r);if(z(o.getAxes(),Rt(g,!1,null)),o.getTooltipAxes&&r&&h.get("show")){var f=h.get("trigger")==="axis",d=h.get(["axisPointer","type"])==="cross",p=o.getTooltipAxes(h.get(["axisPointer","axis"]));(f||d)&&z(p.baseAxes,Rt(g,d?"cross":!0,f)),d&&z(p.otherAxes,Rt(g,"cross",!1))}function g(v,m,y){var _=y.model.getModel("axisPointer",i),x=_.get("show");if(!(!x||x==="auto"&&!v&&!TC(_))){m==null&&(m=_.get("triggerTooltip")),_=v?Nle(y,h,i,e,v,m):_;var b=_.get("snap"),S=_.get("triggerEmphasis"),w=Jm(y.model),T=m||b||y.type==="category",C=n.axesInfo[w]={key:w,axis:y,coordSys:o,axisPointerModel:_,triggerTooltip:m,triggerEmphasis:S,involveSeries:T,snap:b,useHandle:TC(_),seriesModels:[],linkGroup:null};u[w]=C,n.seriesInvolved=n.seriesInvolved||T;var A=Ole(a,y);if(A!=null){var M=s[A]||(s[A]={axesInfo:{}});M.axesInfo[w]=C,M.mapper=a[A].mapper,C.linkGroup=M}}}})}function Nle(n,e,t,r,i,a){var s=e.getModel("axisPointer"),o=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};z(o,function(f){l[f]=yt(s.get(f))}),l.snap=n.type!=="category"&&!!a,s.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var c=s.get(["label","show"]);if(u.show=c!=null?c:!0,!a){var h=l.lineStyle=s.get("crossStyle");h&&dt(u,h.textStyle)}}return n.model.getModel("axisPointer",new Wn(l,t,r))}function kle(n,e){e.eachSeries(function(t){var r=t.coordinateSystem,i=t.get(["tooltip","trigger"],!0),a=t.get(["tooltip","show"],!0);!r||i==="none"||i===!1||i==="item"||a===!1||t.get(["axisPointer","show"],!0)===!1||z(n.coordSysAxesInfo[Jm(r.model)],function(s){var o=s.axis;r.getAxis(o.dim)===o&&(s.seriesModels.push(t),s.seriesDataCount==null&&(s.seriesDataCount=0),s.seriesDataCount+=t.getData().count())})})}function Ole(n,e){for(var t=e.model,r=e.dim,i=0;i<n.length;i++){var a=n[i]||{};if(XA(a[r+"AxisId"],t.id)||XA(a[r+"AxisIndex"],t.componentIndex)||XA(a[r+"AxisName"],t.name))return i}}function XA(n,e){return n==="all"||Ie(n)&&Ft(n,e)>=0||n===e}function Fle(n){var e=ML(n);if(e){var t=e.axisPointerModel,r=e.axis.scale,i=t.option,a=t.get("status"),s=t.get("value");s!=null&&(s=r.parse(s));var o=TC(t);a==null&&(i.status=o?"show":"hide");var l=r.getExtent().slice();l[0]>l[1]&&l.reverse(),(s==null||s>l[1])&&(s=l[1]),s<l[0]&&(s=l[0]),i.value=s,o&&(i.status=e.axis.scale.isBlank()?"hide":"show")}}function ML(n){var e=(n.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[Jm(n)]}function Ble(n){var e=ML(n);return e&&e.axisPointerModel}function TC(n){return!!n.get(["handle","show"])}function Jm(n){return n.type+"||"+n.id}var sk={},Gle=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i,a){this.axisPointerClass&&Fle(t),n.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,i,!0)},e.prototype.updateAxisPointer=function(t,r,i,a){this._doUpdateAxisPointerClass(t,i,!1)},e.prototype.remove=function(t,r){var i=this._axisPointer;i&&i.remove(r)},e.prototype.dispose=function(t,r){this._disposeAxisPointer(r),n.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(t,r,i){var a=e.getAxisPointerClass(this.axisPointerClass);if(a){var s=Ble(t);s?(this._axisPointer||(this._axisPointer=new a)).render(t,s,r,i):this._disposeAxisPointer(r)}},e.prototype._disposeAxisPointer=function(t){this._axisPointer&&this._axisPointer.dispose(t),this._axisPointer=null},e.registerAxisPointerClass=function(t,r){sk[t]=r},e.getAxisPointerClass=function(t){return t&&sk[t]},e.type="axis",e}(fr);const Pf=Gle;var CC=en();function yH(n,e,t,r){var i=t.axis;if(!i.scale.isBlank()){var a=t.getModel("splitArea"),s=a.getModel("areaStyle"),o=s.get("color"),l=r.coordinateSystem.getRect(),u=i.getTicksCoords({tickModel:a,clamp:!0});if(u.length){var c=o.length,h=CC(n).splitAreaColors,f=st(),d=0;if(h)for(var p=0;p<u.length;p++){var g=h.get(u[p].tickValue);if(g!=null){d=(g+(c-1)*p)%c;break}}var v=i.toGlobalCoord(u[0].coord),m=s.getAreaStyle();o=Ie(o)?o:[o];for(var p=1;p<u.length;p++){var y=i.toGlobalCoord(u[p].coord),_=void 0,x=void 0,b=void 0,S=void 0;i.isHorizontal()?(_=v,x=l.y,b=y-_,S=l.height,v=_+b):(_=l.x,x=v,b=l.width,S=y-x,v=x+S);var w=u[p-1].tickValue;w!=null&&f.set(w,d),e.add(new nn({anid:w!=null?"area_"+w:null,shape:{x:_,y:x,width:b,height:S},style:dt({fill:o[d]},m),autoBatch:!0,silent:!0})),d=(d+1)%c}CC(n).splitAreaColors=f}}}function _H(n){CC(n).splitAreaColors=null}var zle=["axisLine","axisTickLabel","axisName"],Ule=["splitArea","splitLine","minorSplitLine"],xH=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="CartesianAxisPointer",t}return e.prototype.render=function(t,r,i,a){this.group.removeAll();var s=this._axisGroup;if(this._axisGroup=new bt,this.group.add(this._axisGroup),!!t.get("show")){var o=t.getCoordSysModel(),l=MC(o,t),u=new Hl(t,Pe({handleAutoShown:function(h){for(var f=o.coordinateSystem.getCartesians(),d=0;d<f.length;d++)if(mC(f[d].getOtherAxis(t.axis).scale))return!0;return!1}},l));z(zle,u.add,u),this._axisGroup.add(u.getGroup()),z(Ule,function(h){t.get([h,"show"])&&Vle[h](this,this._axisGroup,t,o)},this);var c=a&&a.type==="changeAxisOrder"&&a.isInitSort;c||I0(s,this._axisGroup,t),n.prototype.render.call(this,t,r,i,a)}},e.prototype.remove=function(){_H(this)},e.type="cartesianAxis",e}(Pf),Vle={splitLine:function(n,e,t,r){var i=t.axis;if(!i.scale.isBlank()){var a=t.getModel("splitLine"),s=a.getModel("lineStyle"),o=s.get("color"),l=a.get("showMinLine")!==!1,u=a.get("showMaxLine")!==!1;o=Ie(o)?o:[o];for(var c=r.coordinateSystem.getRect(),h=i.isHorizontal(),f=0,d=i.getTicksCoords({tickModel:a}),p=[],g=[],v=s.getLineStyle(),m=0;m<d.length;m++){var y=i.toGlobalCoord(d[m].coord);if(!(m===0&&!l||m===d.length-1&&!u)){var _=d[m].tickValue;h?(p[0]=y,p[1]=c.y,g[0]=y,g[1]=c.y+c.height):(p[0]=c.x,p[1]=y,g[0]=c.x+c.width,g[1]=y);var x=f++%o.length,b=new pi({anid:_!=null?"line_"+_:null,autoBatch:!0,shape:{x1:p[0],y1:p[1],x2:g[0],y2:g[1]},style:dt({stroke:o[x]},v),silent:!0});bp(b.shape,v.lineWidth),e.add(b)}}}},minorSplitLine:function(n,e,t,r){var i=t.axis,a=t.getModel("minorSplitLine"),s=a.getModel("lineStyle"),o=r.coordinateSystem.getRect(),l=i.isHorizontal(),u=i.getMinorTicksCoords();if(u.length)for(var c=[],h=[],f=s.getLineStyle(),d=0;d<u.length;d++)for(var p=0;p<u[d].length;p++){var g=i.toGlobalCoord(u[d][p].coord);l?(c[0]=g,c[1]=o.y,h[0]=g,h[1]=o.y+o.height):(c[0]=o.x,c[1]=g,h[0]=o.x+o.width,h[1]=g);var v=new pi({anid:"minor_line_"+u[d][p].tickValue,autoBatch:!0,shape:{x1:c[0],y1:c[1],x2:h[0],y2:h[1]},style:f,silent:!0});bp(v.shape,f.lineWidth),e.add(v)}},splitArea:function(n,e,t,r){yH(n,e,t,r)}},bH=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="xAxis",e}(xH),Hle=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=bH.type,t}return e.type="yAxis",e}(xH),Wle=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="grid",t}return e.prototype.render=function(t,r){this.group.removeAll(),t.get("show")&&this.group.add(new nn({shape:t.coordinateSystem.getRect(),style:dt({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e}(fr),ok={offset:0};function SH(n){n.registerComponentView(Wle),n.registerComponentModel(ple),n.registerCoordinateSystem("cartesian2d",Tle),Tp(n,"x",wC,ok),Tp(n,"y",wC,ok),n.registerComponentView(bH),n.registerComponentView(Hle),n.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}function $le(n){Vt(SH),n.registerSeriesModel(sle),n.registerChartView(fle),n.registerLayout(V0("scatter"))}function jle(n){n.eachSeriesByType("radar",function(e){var t=e.getData(),r=[],i=e.coordinateSystem;if(i){var a=i.getIndicatorAxes();z(a,function(s,o){t.each(t.mapDimension(a[o].dim),function(l,u){r[u]=r[u]||[];var c=i.dataToPoint(l,o);r[u][o]=lk(c)?c:uk(i)})}),t.each(function(s){var o=PZ(r[s],function(l){return lk(l)})||uk(i);r[s].push(o.slice()),t.setItemLayout(s,r[s])})}})}function lk(n){return!isNaN(n[0])&&!isNaN(n[1])}function uk(n){return[n.cx,n.cy]}function qle(n){var e=n.polar;if(e){Ie(e)||(e=[e]);var t=[];z(e,function(r,i){r.indicator?(r.type&&!r.shape&&(r.shape=r.type),n.radar=n.radar||[],Ie(n.radar)||(n.radar=[n.radar]),n.radar.push(r)):t.push(r)}),n.polar=t}z(n.series,function(r){r&&r.type==="radar"&&r.polarIndex&&(r.radarIndex=r.polarIndex)})}var Xle=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.coordinateSystem,s=this.group,o=t.getData(),l=this._data;function u(f,d){var p=f.getItemVisual(d,"symbol")||"circle";if(p!=="none"){var g=iv(f.getItemVisual(d,"symbolSize")),v=Br(p,-1,-1,2,2),m=f.getItemVisual(d,"symbolRotate")||0;return v.attr({style:{strokeNoScale:!0},z2:100,scaleX:g[0]/2,scaleY:g[1]/2,rotation:m*Math.PI/180||0}),v}}function c(f,d,p,g,v,m){p.removeAll();for(var y=0;y<d.length-1;y++){var _=u(g,v);_&&(_.__dimIdx=y,f[y]?(_.setPosition(f[y]),Af[m?"initProps":"updateProps"](_,{x:d[y][0],y:d[y][1]},t,v)):_.setPosition(d[y]),p.add(_))}}function h(f){return Ne(f,function(d){return[a.cx,a.cy]})}o.diff(l).add(function(f){var d=o.getItemLayout(f);if(d){var p=new Ra,g=new Na,v={shape:{points:d}};p.shape.points=h(d),g.shape.points=h(d),Jn(p,v,t,f),Jn(g,v,t,f);var m=new bt,y=new bt;m.add(g),m.add(p),m.add(y),c(g.shape.points,d,y,o,f,!0),o.setItemGraphicEl(f,m)}}).update(function(f,d){var p=l.getItemGraphicEl(d),g=p.childAt(0),v=p.childAt(1),m=p.childAt(2),y={shape:{points:o.getItemLayout(f)}};y.shape.points&&(c(g.shape.points,y.shape.points,m,o,f,!1),co(v),co(g),cn(g,y,t),cn(v,y,t),o.setItemGraphicEl(f,p))}).remove(function(f){s.remove(l.getItemGraphicEl(f))}).execute(),o.eachItemGraphicEl(function(f,d){var p=o.getItemModel(d),g=f.childAt(0),v=f.childAt(1),m=f.childAt(2),y=o.getItemVisual(d,"style"),_=y.fill;s.add(f),g.useStyle(dt(p.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:_})),Ci(g,p,"lineStyle"),Ci(v,p,"areaStyle");var x=p.getModel("areaStyle"),b=x.isEmpty()&&x.parentModel.isEmpty();v.ignore=b,z(["emphasis","select","blur"],function(T){var C=p.getModel([T,"areaStyle"]),A=C.isEmpty()&&C.parentModel.isEmpty();v.ensureState(T).ignore=A&&b}),v.useStyle(dt(x.getAreaStyle(),{fill:_,opacity:.7,decal:y.decal}));var S=p.getModel("emphasis"),w=S.getModel("itemStyle").getItemStyle();m.eachChild(function(T){if(T instanceof Pi){var C=T.style;T.useStyle(Pe({image:C.image,x:C.x,y:C.y,width:C.width,height:C.height},y))}else T.useStyle(y),T.setColor(_),T.style.strokeNoScale=!0;var A=T.ensureState("emphasis");A.style=yt(w);var M=o.getStore().get(o.getDimensionIndex(T.__dimIdx),d);(M==null||isNaN(M))&&(M=""),Ei(T,ri(p),{labelFetcher:o.hostModel,labelDataIndex:d,labelDimIndex:T.__dimIdx,defaultText:M,inheritColor:_,defaultOpacity:y.opacity})}),lr(f,S.get("focus"),S.get("blurScope"),S.get("disabled"))}),this._data=o},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.type="radar",e}($n);const Yle=Xle;var Kle=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new W0(Qe(this.getData,this),Qe(this.getRawData,this))},e.prototype.getInitialData=function(t,r){return sv(this,{generateCoord:"indicator_",generateCoordCount:1/0})},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),s=this.coordinateSystem,o=s.getIndicatorAxes(),l=this.getData().getName(t),u=l===""?this.name:l,c=vV(this,t);return ii("section",{header:u,sortBlocks:!0,blocks:Ne(o,function(h){var f=a.get(a.mapDimension(h.dim),t);return ii("nameValue",{markerType:"subItem",markerColor:c,name:h.name,value:f,sortParam:f})})})},e.prototype.getTooltipPosition=function(t){if(t!=null){for(var r=this.getData(),i=this.coordinateSystem,a=r.getValues(Ne(i.dimensions,function(u){return r.mapDimension(u)}),t),s=0,o=a.length;s<o;s++)if(!isNaN(a[s])){var l=i.getIndicatorAxes();return i.coordToPoint(l[s].dataToCoord(a[s]),s)}}},e.type="series.radar",e.dependencies=["radar"],e.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},e}(rr);const Zle=Kle;var tg=vH.value;function n_(n,e){return dt({show:e},n)}var Qle=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){var t=this.get("boundaryGap"),r=this.get("splitNumber"),i=this.get("scale"),a=this.get("axisLine"),s=this.get("axisTick"),o=this.get("axisLabel"),l=this.get("axisName"),u=this.get(["axisName","show"]),c=this.get(["axisName","formatter"]),h=this.get("axisNameGap"),f=this.get("triggerEvent"),d=Ne(this.get("indicator")||[],function(p){p.max!=null&&p.max>0&&!p.min?p.min=0:p.min!=null&&p.min<0&&!p.max&&(p.max=0);var g=l;p.color!=null&&(g=dt({color:p.color},l));var v=It(yt(p),{boundaryGap:t,splitNumber:r,scale:i,axisLine:a,axisTick:s,axisLabel:o,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 ct(c)&&(v.name=c(v.name,v));var y=new Wn(v,null,this.ecModel);return zr(y,B0.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:It({lineStyle:{color:"#bbb"}},tg.axisLine),axisLabel:n_(tg.axisLabel,!1),axisTick:n_(tg.axisTick,!1),splitLine:n_(tg.splitLine,!0),splitArea:n_(tg.splitArea,!0),indicator:[]},e}(sn);const Jle=Qle;var eue=["axisLine","axisTickLabel","axisName"],tue=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group;a.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var r=t.coordinateSystem,i=r.getIndicatorAxes(),a=Ne(i,function(s){var o=s.model.get("showName")?s.name:"",l=new Hl(s.model,{axisName:o,position:[r.cx,r.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return l});z(a,function(s){z(eue,s.add,s),this.group.add(s.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(t){var r=t.coordinateSystem,i=r.getIndicatorAxes();if(!i.length)return;var a=t.get("shape"),s=t.getModel("splitLine"),o=t.getModel("splitArea"),l=s.getModel("lineStyle"),u=o.getModel("areaStyle"),c=s.get("show"),h=o.get("show"),f=l.get("color"),d=u.get("color"),p=Ie(f)?f:[f],g=Ie(d)?d:[d],v=[],m=[];function y(R,N,F){var O=F%N.length;return R[O]=R[O]||[],O}if(a==="circle")for(var _=i[0].getTicksCoords(),x=r.cx,b=r.cy,S=0;S<_.length;S++){if(c){var w=y(v,p,S);v[w].push(new bc({shape:{cx:x,cy:b,r:_[S].coord}}))}if(h&&S<_.length-1){var w=y(m,g,S);m[w].push(new rS({shape:{cx:x,cy:b,r0:_[S].coord,r:_[S+1].coord}}))}}else for(var T,C=Ne(i,function(R,N){var F=R.getTicksCoords();return T=T==null?F.length-1:Math.min(F.length-1,T),Ne(F,function(O){return r.coordToPoint(O.coord,N)})}),A=[],S=0;S<=T;S++){for(var M=[],P=0;P<i.length;P++)M.push(C[P][S]);if(M[0]&&M.push(M[0].slice()),c){var w=y(v,p,S);v[w].push(new Na({shape:{points:M}}))}if(h&&A){var w=y(m,g,S-1);m[w].push(new Ra({shape:{points:M.concat(A)}}))}A=M.slice().reverse()}var D=l.getLineStyle(),L=u.getAreaStyle();z(m,function(R,N){this.group.add(Ms(R,{style:dt({stroke:"none",fill:g[N%g.length]},L),silent:!0}))},this),z(v,function(R,N){this.group.add(Ms(R,{style:dt({fill:"none",stroke:p[N%p.length]},D),silent:!0}))},this)},e.type="radar",e}(fr);const nue=tue;var rue=function(n){ve(e,n);function e(t,r,i){var a=n.call(this,t,r,i)||this;return a.type="value",a.angle=0,a.name="",a}return e}(po);const iue=rue;var aue=function(){function n(e,t,r){this.dimensions=[],this._model=e,this._indicatorAxes=Ne(e.getIndicatorModels(),function(i,a){var s="indicator_"+a,o=new iue(s,new pc);return o.name=i.get("name"),o.model=i,i.axis=o,this.dimensions.push(s),o},this),this.resize(e,r)}return n.prototype.getIndicatorAxes=function(){return this._indicatorAxes},n.prototype.dataToPoint=function(e,t){var r=this._indicatorAxes[t];return this.coordToPoint(r.dataToCoord(e),t)},n.prototype.coordToPoint=function(e,t){var r=this._indicatorAxes[t],i=r.angle,a=this.cx+e*Math.cos(i),s=this.cy-e*Math.sin(i);return[a,s]},n.prototype.pointToData=function(e){var t=e[0]-this.cx,r=e[1]-this.cy,i=Math.sqrt(t*t+r*r);t/=i,r/=i;for(var a=Math.atan2(-r,t),s=1/0,o,l=-1,u=0;u<this._indicatorAxes.length;u++){var c=this._indicatorAxes[u],h=Math.abs(a-c.angle);h<s&&(o=c,l=u,s=h)}return[l,+(o&&o.coordToData(i))]},n.prototype.resize=function(e,t){var r=e.get("center"),i=t.getWidth(),a=t.getHeight(),s=Math.min(i,a)/2;this.cx=Xe(r[0],i),this.cy=Xe(r[1],a),this.startAngle=e.get("startAngle")*Math.PI/180;var o=e.get("radius");(Ke(o)||un(o))&&(o=[0,o]),this.r0=Xe(o[0],s),this.r=Xe(o[1],s),z(this._indicatorAxes,function(l,u){l.setExtent(this.r0,this.r);var c=this.startAngle+u*Math.PI*2/this._indicatorAxes.length;c=Math.atan2(Math.sin(c),Math.cos(c)),l.angle=c},this)},n.prototype.update=function(e,t){var r=this._indicatorAxes,i=this._model;z(r,function(o){o.scale.setExtent(1/0,-1/0)}),e.eachSeriesByType("radar",function(o,l){if(!(o.get("coordinateSystem")!=="radar"||e.getComponent("radar",o.get("radarIndex"))!==i)){var u=o.getData();z(r,function(c){c.scale.unionExtentFromData(u,u.mapDimension(c.dim))})}},this);var a=i.get("splitNumber"),s=new pc;s.setExtent(0,a),s.setInterval(1),z(r,function(o,l){gH(o.scale,o.model,s)})},n.prototype.convertToPixel=function(e,t,r){return console.warn("Not implemented."),null},n.prototype.convertFromPixel=function(e,t,r){return console.warn("Not implemented."),null},n.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},n.create=function(e,t){var r=[];return e.eachComponent("radar",function(i){var a=new n(i,e,t);r.push(a),i.coordinateSystem=a}),e.eachSeriesByType("radar",function(i){i.get("coordinateSystem")==="radar"&&(i.coordinateSystem=r[i.get("radarIndex")||0])}),r},n.dimensions=[],n}();const sue=aue;function oue(n){n.registerCoordinateSystem("radar",sue),n.registerComponentModel(Jle),n.registerComponentView(nue),n.registerVisual({seriesType:"radar",reset:function(e){var t=e.getData();t.each(function(r){t.setItemVisual(r,"legendIcon","roundRect")}),t.setVisual("legendIcon","roundRect")}})}function lue(n){Vt(oue),n.registerChartView(Yle),n.registerSeriesModel(Zle),n.registerLayout(jle),n.registerProcessor(H0("radar")),n.registerPreprocessor(qle)}var ck="\0_ec_interaction_mutex";function uue(n,e,t){var r=TL(n);r[e]=t}function cue(n,e,t){var r=TL(n),i=r[e];i===t&&(r[e]=null)}function hk(n,e){return!!TL(n)[e]}function TL(n){return n[ck]||(n[ck]={})}il({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Er);var hue=function(n){ve(e,n);function e(t){var r=n.call(this)||this;r._zr=t;var i=Qe(r._mousedownHandler,r),a=Qe(r._mousemoveHandler,r),s=Qe(r._mouseupHandler,r),o=Qe(r._mousewheelHandler,r),l=Qe(r._pinchHandler,r);return r.enable=function(u,c){this.disable(),this._opt=dt(yt(c)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),u==null&&(u=!0),(u===!0||u==="move"||u==="pan")&&(t.on("mousedown",i),t.on("mousemove",a),t.on("mouseup",s)),(u===!0||u==="scale"||u==="zoom")&&(t.on("mousewheel",o),t.on("pinch",l))},r.disable=function(){t.off("mousedown",i),t.off("mousemove",a),t.off("mouseup",s),t.off("mousewheel",o),t.off("pinch",l)},r}return e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(t){this.pointerChecker=t},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(t){if(!FD(t)){for(var r=t.target;r;){if(r.draggable)return;r=r.__hostTarget||r.parent}var i=t.offsetX,a=t.offsetY;this.pointerChecker&&this.pointerChecker(t,i,a)&&(this._x=i,this._y=a,this._dragging=!0)}},e.prototype._mousemoveHandler=function(t){if(!(!this._dragging||!V1("moveOnMouseMove",t,this._opt)||t.gestureEvent==="pinch"||hk(this._zr,"globalPan"))){var r=t.offsetX,i=t.offsetY,a=this._x,s=this._y,o=r-a,l=i-s;this._x=r,this._y=i,this._opt.preventDefaultMouseMove&&Bl(t.event),wH(this,"pan","moveOnMouseMove",t,{dx:o,dy:l,oldX:a,oldY:s,newX:r,newY:i,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(t){FD(t)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(t){var r=V1("zoomOnMouseWheel",t,this._opt),i=V1("moveOnMouseWheel",t,this._opt),a=t.wheelDelta,s=Math.abs(a),o=t.offsetX,l=t.offsetY;if(!(a===0||!r&&!i)){if(r){var u=s>3?1.4:s>1?1.2:1.1,c=a>0?u:1/u;YA(this,"zoom","zoomOnMouseWheel",t,{scale:c,originX:o,originY:l,isAvailableBehavior:null})}if(i){var h=Math.abs(a),f=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);YA(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:f,originX:o,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!hk(this._zr,"globalPan")){var r=t.pinchScale>1?1.1:1/1.1;YA(this,"zoom",null,t,{scale:r,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(Bs);function YA(n,e,t,r,i){n.pointerChecker&&n.pointerChecker(r,i.originX,i.originY)&&(Bl(r.event),wH(n,e,t,r,i))}function wH(n,e,t,r,i){i.isAvailableBehavior=Qe(V1,null,t,r),n.trigger(e,i)}function V1(n,e,t){var r=t[n];return!n||r&&(!Ke(r)||e.event[r+"Key"])}const $0=hue;function CL(n,e,t){var r=n.target;r.x+=e,r.y+=t,r.dirty()}function EL(n,e,t,r){var i=n.target,a=n.zoomLimit,s=n.zoom=n.zoom||1;if(s*=e,a){var o=a.min||0,l=a.max||1/0;s=Math.max(Math.min(l,s),o)}var u=s/n.zoom;n.zoom=s,i.x-=(t-i.x)*(u-1),i.y-=(r-i.y)*(u-1),i.scaleX*=u,i.scaleY*=u,i.dirty()}var fue={axisPointer:1,tooltip:1,brush:1};function MS(n,e,t){var r=e.getComponentByElement(n.topTarget),i=r&&r.coordinateSystem;return r&&r!==t&&!fue.hasOwnProperty(r.mainType)&&i&&i.model!==t}function AH(n){if(Ke(n)){var e=new DOMParser;n=e.parseFromString(n,"text/xml")}var t=n;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!=="svg"||t.nodeType!==1;)t=t.nextSibling;return t}var KA,jx={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"},fk=Yt(jx),qx={"alignment-baseline":"textBaseline","stop-color":"stopColor"},dk=Yt(qx),due=function(){function n(){this._defs={},this._root=null}return n.prototype.parse=function(e,t){t=t||{};var r=AH(e);this._defsUsePending=[];var i=new bt;this._root=i;var a=[],s=r.getAttribute("viewBox")||"",o=parseFloat(r.getAttribute("width")||t.width),l=parseFloat(r.getAttribute("height")||t.height);isNaN(o)&&(o=null),isNaN(l)&&(l=null),Oa(r,i,null,!0,!1);for(var u=r.firstChild;u;)this._parseNode(u,i,a,null,!1,!1),u=u.nextSibling;gue(this._defs,this._defsUsePending),this._defsUsePending=[];var c,h;if(s){var f=TS(s);f.length>=4&&(c={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(c&&o!=null&&l!=null&&(h=TH(c,{x:0,y:0,width:o,height:l}),!t.ignoreViewBox)){var d=i;i=new bt,i.add(d),d.scaleX=d.scaleY=h.scale,d.x=h.x,d.y=h.y}return!t.ignoreRootClip&&o!=null&&l!=null&&i.setClipPath(new nn({shape:{x:0,y:0,width:o,height:l}})),{root:i,width:o,height:l,viewBoxRect:c,viewBoxTransform:h,named:a}},n.prototype._parseNode=function(e,t,r,i,a,s){var o=e.nodeName.toLowerCase(),l,u=i;if(o==="defs"&&(a=!0),o==="text"&&(s=!0),o==="defs"||o==="switch")l=t;else{if(!a){var c=KA[o];if(c&&tt(KA,o)){l=c.call(this,e,t);var h=e.getAttribute("name");if(h){var f={name:h,namedFrom:null,svgNodeTagLower:o,el:l};r.push(f),o==="g"&&(u=f)}else i&&r.push({name:i.name,namedFrom:i,svgNodeTagLower:o,el:l});t.add(l)}}var d=pk[o];if(d&&tt(pk,o)){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,r,u,a,s):v.nodeType===3&&s&&this._parseText(v,l),v=v.nextSibling},n.prototype._parseText=function(e,t){var r=new zm({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});os(t,r),Oa(e,r,this._defsUsePending,!1,!1),pue(r,t);var i=r.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,r.scaleX*=a/9,r.scaleY*=a/9);var s=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=s;var o=r.getBoundingRect();return this._textX+=o.width,t.add(r),r},n.internalField=function(){KA={g:function(e,t){var r=new bt;return os(t,r),Oa(e,r,this._defsUsePending,!1,!1),r},rect:function(e,t){var r=new nn;return os(t,r),Oa(e,r,this._defsUsePending,!1,!1),r.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")}),r.silent=!0,r},circle:function(e,t){var r=new bc;return os(t,r),Oa(e,r,this._defsUsePending,!1,!1),r.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),r.silent=!0,r},line:function(e,t){var r=new pi;return os(t,r),Oa(e,r,this._defsUsePending,!1,!1),r.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")}),r.silent=!0,r},ellipse:function(e,t){var r=new FP;return os(t,r),Oa(e,r,this._defsUsePending,!1,!1),r.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")}),r.silent=!0,r},polygon:function(e,t){var r=e.getAttribute("points"),i;r&&(i=mk(r));var a=new Ra({shape:{points:i||[]},silent:!0});return os(t,a),Oa(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var r=e.getAttribute("points"),i;r&&(i=mk(r));var a=new Na({shape:{points:i||[]},silent:!0});return os(t,a),Oa(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var r=new Pi;return os(t,r),Oa(e,r,this._defsUsePending,!1,!1),r.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")}),r.silent=!0,r},text:function(e,t){var r=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",s=e.getAttribute("dy")||"0";this._textX=parseFloat(r)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(s);var o=new bt;return os(t,o),Oa(e,o,this._defsUsePending,!1,!0),o},tspan:function(e,t){var r=e.getAttribute("x"),i=e.getAttribute("y");r!=null&&(this._textX=parseFloat(r)),i!=null&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",s=e.getAttribute("dy")||"0",o=new bt;return os(t,o),Oa(e,o,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(s),o},path:function(e,t){var r=e.getAttribute("d")||"",i=QU(r);return os(t,i),Oa(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),n}(),pk={lineargradient:function(n){var e=parseInt(n.getAttribute("x1")||"0",10),t=parseInt(n.getAttribute("y1")||"0",10),r=parseInt(n.getAttribute("x2")||"10",10),i=parseInt(n.getAttribute("y2")||"0",10),a=new Zr(e,t,r,i);return vk(n,a),gk(n,a),a},radialgradient:function(n){var e=parseInt(n.getAttribute("cx")||"0",10),t=parseInt(n.getAttribute("cy")||"0",10),r=parseInt(n.getAttribute("r")||"0",10),i=new h7(e,t,r);return vk(n,i),gk(n,i),i}};function vk(n,e){var t=n.getAttribute("gradientUnits");t==="userSpaceOnUse"&&(e.global=!0)}function gk(n,e){for(var t=n.firstChild;t;){if(t.nodeType===1&&t.nodeName.toLocaleLowerCase()==="stop"){var r=t.getAttribute("offset"),i=void 0;r&&r.indexOf("%")>0?i=parseInt(r,10)/100:r?i=parseFloat(r):i=0;var a={};MH(t,a,a);var s=a.stopColor||t.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:i,color:s})}t=t.nextSibling}}function os(n,e){n&&n.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),dt(e.__inheritedStyle,n.__inheritedStyle))}function mk(n){for(var e=TS(n),t=[],r=0;r<e.length;r+=2){var i=parseFloat(e[r]),a=parseFloat(e[r+1]);t.push([i,a])}return t}function Oa(n,e,t,r,i){var a=e,s=a.__inheritedStyle=a.__inheritedStyle||{},o={};n.nodeType===1&&(_ue(n,e),MH(n,s,o),r||xue(n,s,o)),a.style=a.style||{},s.fill!=null&&(a.style.fill=yk(a,"fill",s.fill,t)),s.stroke!=null&&(a.style.stroke=yk(a,"stroke",s.stroke,t)),z(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],function(l){s[l]!=null&&(a.style[l]=parseFloat(s[l]))}),z(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign"],function(l){s[l]!=null&&(a.style[l]=s[l])}),i&&(a.__selfStyle=o),s.lineDash&&(a.style.lineDash=Ne(TS(s.lineDash),function(l){return parseFloat(l)})),(s.visibility==="hidden"||s.visibility==="collapse")&&(a.invisible=!0),s.display==="none"&&(a.ignore=!0)}function pue(n,e){var t=e.__selfStyle;if(t){var r=t.textBaseline,i=r;!r||r==="auto"||r==="baseline"?i="alphabetic":r==="before-edge"||r==="text-before-edge"?i="top":r==="after-edge"||r==="text-after-edge"?i="bottom":(r==="central"||r==="mathematical")&&(i="middle"),n.style.textBaseline=i}var a=e.__inheritedStyle;if(a){var s=a.textAlign,o=s;s&&(s==="middle"&&(o="center"),n.style.textAlign=o)}}var vue=/^url\(\s*#(.*?)\)/;function yk(n,e,t,r){var i=t&&t.match(vue);if(i){var a=no(i[1]);r.push([n,e,a]);return}return t==="none"&&(t=null),t}function gue(n,e){for(var t=0;t<e.length;t++){var r=e[t];r[0].style[r[1]]=n[r[2]]}}var mue=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function TS(n){return n.match(mue)||[]}var yue=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g,ZA=Math.PI/180;function _ue(n,e){var t=n.getAttribute("transform");if(t){t=t.replace(/,/g," ");var r=[],i=null;t.replace(yue,function(h,f,d){return r.push(f,d),""});for(var a=r.length-1;a>0;a-=2){var s=r[a],o=r[a-1],l=TS(s);switch(i=i||Za(),o){case"translate":Ko(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":xP(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Sf(i,i,-parseFloat(l[0])*ZA,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*ZA);Dl(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*ZA);Dl(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 _k=/([^\s:;]+)\s*:\s*([^:;]+)/g;function MH(n,e,t){var r=n.getAttribute("style");if(r){_k.lastIndex=0;for(var i;(i=_k.exec(r))!=null;){var a=i[1],s=tt(jx,a)?jx[a]:null;s&&(e[s]=i[2]);var o=tt(qx,a)?qx[a]:null;o&&(t[o]=i[2])}}}function xue(n,e,t){for(var r=0;r<fk.length;r++){var i=fk[r],a=n.getAttribute(i);a!=null&&(e[jx[i]]=a)}for(var r=0;r<dk.length;r++){var i=dk[r],a=n.getAttribute(i);a!=null&&(t[qx[i]]=a)}}function TH(n,e){var t=e.width/n.width,r=e.height/n.height,i=Math.min(t,r);return{scale:i,x:-(n.x+n.width/2)*i+(e.x+e.width/2),y:-(n.y+n.height/2)*i+(e.y+e.height/2)}}function bue(n,e){var t=new due;return t.parse(n,e)}var Sue=st(["rect","circle","line","ellipse","polygon","polyline","path","text","tspan","g"]),wue=function(){function n(e,t){this.type="geoSVG",this._usedGraphicMap=st(),this._freedGraphics=[],this._mapName=e,this._parsedXML=AH(t)}return n.prototype.load=function(){var e=this._firstGraphic;if(!e){e=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(e),this._boundingRect=this._firstGraphic.boundingRect.clone();var t=Mue(e.named),r=t.regions,i=t.regionsMap;this._regions=r,this._regionsMap=i}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},n.prototype._buildGraphic=function(e){var t,r;try{t=e&&bue(e,{ignoreViewBox:!0,ignoreRootClip:!0})||{},r=t.root,sa(r!=null)}catch(v){throw new Error(`Invalid svg format
`+v.message)}var i=new bt;i.add(r),i.isGeoSVGGraphicRoot=!0;var a=t.width,s=t.height,o=t.viewBoxRect,l=this._boundingRect;if(!l){var u=void 0,c=void 0,h=void 0,f=void 0;if(a!=null?(u=0,h=a):o&&(u=o.x,h=o.width),s!=null?(c=0,f=s):o&&(c=o.y,f=o.height),u==null||c==null){var d=r.getBoundingRect();u==null&&(u=d.x,h=d.width),c==null&&(c=d.y,f=d.height)}l=this._boundingRect=new Ot(u,c,h,f)}if(o){var p=TH(o,l);r.scaleX=r.scaleY=p.scale,r.x=p.x,r.y=p.y}i.setClipPath(new nn({shape:l.plain()}));var g=[];return z(t.named,function(v){Sue.get(v.svgNodeTagLower)!=null&&(g.push(v),Aue(v.el))}),{root:i,boundingRect:l,named:g}},n.prototype.useGraphic=function(e){var t=this._usedGraphicMap,r=t.get(e);return r||(r=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),t.set(e,r),r)},n.prototype.freeGraphic=function(e){var t=this._usedGraphicMap,r=t.get(e);r&&(t.removeKey(e),this._freedGraphics.push(r))},n}();function Aue(n){n.silent=!1,n.isGroup&&n.traverse(function(e){e.silent=!1})}function Mue(n){var e=[],t=st();return z(n,function(r){if(r.namedFrom==null){var i=new Vae(r.name,r.el);e.push(i),t.set(r.name,i)}}),{regions:e,regionsMap:t}}var EC=[126,25],xk="南海诸岛",hh=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]];for(var eh=0;eh<hh.length;eh++)for(var Xf=0;Xf<hh[eh].length;Xf++)hh[eh][Xf][0]/=10.5,hh[eh][Xf][1]/=-10.5/.75,hh[eh][Xf][0]+=EC[0],hh[eh][Xf][1]+=EC[1];function Tue(n,e){if(n==="china"){for(var t=0;t<e.length;t++)if(e[t].name===xk)return;e.push(new b9(xk,Ne(hh,function(r){return{type:"polygon",exterior:r}}),EC))}}var Cue={南海诸岛:[32,80],广东:[0,-10],香港:[10,5],澳门:[-10,10],天津:[5,5]};function Eue(n,e){if(n==="china"){var t=Cue[e.name];if(t){var r=e.getCenter();r[0]+=t[0]/10.5,r[1]+=-t[1]/(10.5/.75),e.setCenter(r)}}}var Pue=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];function Lue(n,e){n==="china"&&e.name==="台湾"&&e.geometries.push({type:"polygon",exterior:Pue[0]})}var Rue="name",Due=function(){function n(e,t,r){this.type="geoJSON",this._parsedMap=st(),this._mapName=e,this._specialAreas=r,this._geoJSON=Nue(t)}return n.prototype.load=function(e,t){t=t||Rue;var r=this._parsedMap.get(t);if(!r){var i=this._parseToRegions(t);r=this._parsedMap.set(t,{regions:i,boundingRect:Iue(i)})}var a=st(),s=[];return z(r.regions,function(o){var l=o.name;e&&tt(e,l)&&(o=o.cloneShallow(l=e[l])),s.push(o),a.set(l,o)}),{regions:s,boundingRect:r.boundingRect||new Ot(0,0,0,0),regionsMap:a}},n.prototype._parseToRegions=function(e){var t=this._mapName,r=this._geoJSON,i;try{i=r?Wae(r,e):[]}catch(a){throw new Error(`Invalid geoJson format
`+a.message)}return Tue(t,i),z(i,function(a){var s=a.name;Eue(t,a),Lue(t,a);var o=this._specialAreas&&this._specialAreas[s];o&&a.transformTo(o.left,o.top,o.width,o.height)},this),i},n.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},n}();function Iue(n){for(var e,t=0;t<n.length;t++){var r=n[t].getBoundingRect();e=e||r.clone(),e.union(r)}return e}function Nue(n){return Ke(n)?typeof JSON!="undefined"&&JSON.parse?JSON.parse(n):new Function("return ("+n+");")():n}var ng=st();const Wl={registerMap:function(n,e,t){if(e.svg){var r=new wue(n,e.svg);ng.set(n,r)}else{var i=e.geoJson||e.geoJSON;i&&!e.features?t=e.specialAreas:i=e;var r=new Due(n,i,t);ng.set(n,r)}},getGeoResource:function(n){return ng.get(n)},getMapForUser:function(n){var e=ng.get(n);return e&&e.type==="geoJSON"&&e.getMapForUser()},load:function(n,e,t){var r=ng.get(n);if(r)return r.load(e,t)}};var PL=["rect","circle","line","ellipse","polygon","polyline","path"],kue=st(PL),Oue=st(PL.concat(["g"])),Fue=st(PL.concat(["g"])),CH=en();function r_(n){var e=n.getItemStyle(),t=n.get("areaColor");return t!=null&&(e.fill=t),e}function bk(n){var e=n.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var Bue=function(){function n(e){var t=new bt;this.uid=Zp("ec_map_draw"),this._controller=new $0(e.getZr()),this._controllerHost={target:t},this.group=t,t.add(this._regionsGroup=new bt),t.add(this._svgGroup=new bt)}return n.prototype.draw=function(e,t,r,i,a){var s=e.mainType==="geo",o=e.getData&&e.getData();s&&t.eachComponent({mainType:"series",subType:"map"},function(m){!o&&m.getHostGeoModel()===e&&(o=m.getData())});var l=e.coordinateSystem,u=this._regionsGroup,c=this.group,h=l.getTransformInfo(),f=h.raw,d=h.roam,p=!u.childAt(0)||a;p?(c.x=d.x,c.y=d.y,c.scaleX=d.scaleX,c.scaleY=d.scaleY,c.dirty()):cn(c,d,e);var g=o&&o.getVisual("visualMeta")&&o.getVisual("visualMeta").length>0,v={api:r,geo:l,mapOrGeoModel:e,data:o,isVisualEncodedByVisualMap:g,isGeo:s,transformInfoRaw:f};l.resourceType==="geoJSON"?this._buildGeoJSON(v):l.resourceType==="geoSVG"&&this._buildSVG(v),this._updateController(e,t,r),this._updateMapSelectHandler(e,u,r,i)},n.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=st(),r=st(),i=this._regionsGroup,a=e.transformInfoRaw,s=e.mapOrGeoModel,o=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<d.length;++v){var m=c(d[v],g);m&&p.push(m)}return p}function f(d){return{shape:{points:h(d)}}}i.removeAll(),z(e.geo.regions,function(d){var p=d.name,g=t.get(p),v=r.get(p)||{},m=v.dataIdx,y=v.regionModel;if(!g){g=t.set(p,new bt),i.add(g),m=o?o.indexOfName(p):null,y=e.isGeo?s.getRegionModel(p):o?o.getItemModel(m):null;var _=y.get("silent",!0);_!=null&&(g.silent=_),r.set(p,{dataIdx:m,regionModel:y})}var x=[],b=[];z(d.geometries,function(T){if(T.type==="polygon"){var C=[T.exterior].concat(T.interiors||[]);u&&(C=Ck(C,u)),z(C,function(M){x.push(new Ra(f(M)))})}else{var A=T.points;u&&(A=Ck(A,u,!0)),z(A,function(M){b.push(new Na(f(M)))})}});var S=c(d.getCenter(),l&&l.project);function w(T,C){if(T.length){var A=new GP({culling:!0,segmentIgnoreThreshold:1,shape:{paths:T}});g.add(A),Sk(e,A,m,y),wk(e,A,p,y,s,m,S),C&&(bk(A),z(A.states,bk))}}w(x),w(b,!0)}),t.each(function(d,p){var g=r.get(p),v=g.dataIdx,m=g.regionModel;Ak(e,d,p,m,s,v),Mk(e,d,p,m,s),Tk(e,d,p,m,s)},this)},n.prototype._buildSVG=function(e){var t=e.geo.map,r=e.transformInfoRaw;this._svgGroup.x=r.x,this._svgGroup.y=r.y,this._svgGroup.scaleX=r.scaleX,this._svgGroup.scaleY=r.scaleY,this._svgResourceChanged(t)&&(this._freeSVG(),this._useSVG(t));var i=this._svgDispatcherMap=st(),a=!1;z(this._svgGraphicRecord.named,function(s){var o=s.name,l=e.mapOrGeoModel,u=e.data,c=s.svgNodeTagLower,h=s.el,f=u?u.indexOfName(o):null,d=l.getRegionModel(o);kue.get(c)!=null&&h instanceof Os&&Sk(e,h,f,d),h instanceof Os&&(h.culling=!0);var p=d.get("silent",!0);if(p!=null&&(h.silent=p),h.z2EmphasisLift=0,!s.namedFrom&&(Fue.get(c)!=null&&wk(e,h,o,d,l,f,null),Ak(e,h,o,d,l,f),Mk(e,h,o,d,l),Oue.get(c)!=null)){var g=Tk(e,h,o,d,l);g==="self"&&(a=!0);var v=i.get(o)||i.set(o,[]);v.push(h)}},this),this._enableBlurEntireSVG(a,e)},n.prototype._enableBlurEntireSVG=function(e,t){if(e&&t.isGeo){var r=t.mapOrGeoModel.getModel(["blur","itemStyle"]).getItemStyle(),i=r.opacity;this._svgGraphicRecord.root.traverse(function(a){if(!a.isGroup){cf(a);var s=a.ensureState("blur").style||{};s.opacity==null&&i!=null&&(s.opacity=i),a.ensureState("emphasis")}})}},n.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.dispose(),this._controllerHost=null},n.prototype.findHighDownDispatchers=function(e,t){if(e==null)return[];var r=t.coordinateSystem;if(r.resourceType==="geoJSON"){var i=this._regionsGroupByName;if(i){var a=i.get(e);return a?[a]:[]}}else if(r.resourceType==="geoSVG")return this._svgDispatcherMap&&this._svgDispatcherMap.get(e)||[]},n.prototype._svgResourceChanged=function(e){return this._svgMapName!==e},n.prototype._useSVG=function(e){var t=Wl.getGeoResource(e);if(t&&t.type==="geoSVG"){var r=t.useGraphic(this.uid);this._svgGroup.add(r.root),this._svgGraphicRecord=r,this._svgMapName=e}},n.prototype._freeSVG=function(){var e=this._svgMapName;if(e!=null){var t=Wl.getGeoResource(e);t&&t.type==="geoSVG"&&t.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},n.prototype._updateController=function(e,t,r){var i=e.coordinateSystem,a=this._controller,s=this._controllerHost;s.zoomLimit=e.get("scaleLimit"),s.zoom=i.getZoom(),a.enable(e.get("roam")||!1);var o=e.mainType;function l(){var u={type:"geoRoam",componentType:o};return u[o+"Id"]=e.id,u}a.off("pan").on("pan",function(u){this._mouseDownFlag=!1,CL(s,u.dx,u.dy),r.dispatchAction(Pe(l(),{dx:u.dx,dy:u.dy,animation:{duration:0}}))},this),a.off("zoom").on("zoom",function(u){this._mouseDownFlag=!1,EL(s,u.scale,u.originX,u.originY),r.dispatchAction(Pe(l(),{totalZoom:s.zoom,zoom:u.scale,originX:u.originX,originY:u.originY,animation:{duration:0}}))},this),a.setPointerChecker(function(u,c,h){return i.containPoint([c,h])&&!MS(u,r,e)})},n.prototype.resetForLabelLayout=function(){this.group.traverse(function(e){var t=e.getTextContent();t&&(t.ignore=CH(t).ignore)})},n.prototype._updateMapSelectHandler=function(e,t,r,i){var a=this;t.off("mousedown"),t.off("click"),e.get("selectedMode")&&(t.on("mousedown",function(){a._mouseDownFlag=!0}),t.on("click",function(s){a._mouseDownFlag&&(a._mouseDownFlag=!1)}))},n}();function Sk(n,e,t,r){var i=r.getModel("itemStyle"),a=r.getModel(["emphasis","itemStyle"]),s=r.getModel(["blur","itemStyle"]),o=r.getModel(["select","itemStyle"]),l=r_(i),u=r_(a),c=r_(o),h=r_(s),f=n.data;if(f){var d=f.getItemVisual(t,"style"),p=f.getItemVisual(t,"decal");n.isVisualEncodedByVisualMap&&d.fill&&(l.fill=d.fill),p&&(l.decal=wp(p,n.api))}e.setStyle(l),e.style.strokeNoScale=!0,e.ensureState("emphasis").style=u,e.ensureState("select").style=c,e.ensureState("blur").style=h,cf(e)}function wk(n,e,t,r,i,a,s){var o=n.data,l=n.isGeo,u=o&&isNaN(o.get(o.mapDimension("value"),a)),c=o&&o.getItemLayout(a);if(l||u||c&&c.showLabel){var h=l?t:a,f=void 0;(!o||a>=0)&&(f=i);var d=s?{normal:{align:"center",verticalAlign:"middle"}}:null;Ei(e,ri(r),{labelFetcher:f,labelDataIndex:h,defaultText:t},d);var p=e.getTextContent();if(p&&(CH(p).ignore=p.ignore,e.textConfig&&s)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(s[0]-g.x)/g.width*100+"%",(s[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function Ak(n,e,t,r,i,a){n.data?n.data.setItemGraphicEl(a,e):St(e).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:t,region:r&&r.option||{}}}function Mk(n,e,t,r,i){n.data||wf({el:e,componentModel:i,itemName:t,itemTooltipOption:r.get("tooltip")})}function Tk(n,e,t,r,i){e.highDownSilentOnTouch=!!i.get("selectedMode");var a=r.getModel("emphasis"),s=a.get("focus");return lr(e,s,a.get("blurScope"),a.get("disabled")),n.isGeo&&Bee(e,i,t),s}function Ck(n,e,t){var r=[],i;function a(){i=[]}function s(){i.length&&(r.push(i),i=[])}var o=e({polygonStart:a,polygonEnd:s,lineStart:a,lineEnd:s,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!t&&o.polygonStart(),z(n,function(l){o.lineStart();for(var u=0;u<l.length;u++)o.point(l[u][0],l[u][1]);o.lineEnd()}),!t&&o.polygonEnd(),r}const EH=Bue;var Gue=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i,a){if(!(a&&a.type==="mapToggleSelect"&&a.from===this.uid)){var s=this.group;if(s.removeAll(),!t.getHostGeoModel()){if(this._mapDraw&&a&&a.type==="geoRoam"&&this._mapDraw.resetForLabelLayout(),a&&a.type==="geoRoam"&&a.componentType==="series"&&a.seriesId===t.id){var o=this._mapDraw;o&&s.add(o.group)}else if(t.needsDrawMap){var o=this._mapDraw||new EH(i);s.add(o.group),o.draw(t,r,i,this,a),this._mapDraw=o}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&r.getComponent("legend")&&this._renderSymbols(t,r,i)}}},e.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(t,r,i){var a=t.originalData,s=this.group;a.each(a.mapDimension("value"),function(o,l){if(!isNaN(o)){var u=a.getItemLayout(l);if(!(!u||!u.point)){var c=u.point,h=u.offset,f=new bc({style:{fill:t.getData().getVisual("style").fill},shape:{cx:c[0]+h*9,cy:c[1],r:3},silent:!0,z2:8+(h?0:Xp+1)});if(!h){var d=t.mainSeries.getData(),p=a.getName(l),g=d.indexOfName(p),v=a.getItemModel(l),m=v.getModel("label"),y=d.getItemGraphicEl(g);Ei(f,ri(v),{labelFetcher:{getFormattedLabel:function(_,x){return t.getFormattedLabel(g,x)}},defaultText:p}),f.disableLabelAnimation=!0,m.get("position")||f.setTextConfig({position:"bottom"}),y.onHoverStateChange=function(_){Mx(f,_)}}s.add(f)}}})},e.type="map",e}($n);const zue=Gue;var Uue=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.needsDrawMap=!1,t.seriesGroup=[],t.getTooltipPosition=function(r){if(r!=null){var i=this.getData().getName(r),a=this.coordinateSystem,s=a.getRegion(i);return s&&a.dataToPoint(s.getCenter())}},t}return e.prototype.getInitialData=function(t){for(var r=sv(this,{coordDimensions:["value"],encodeDefaulter:Rt(YP,this)}),i=st(),a=[],s=0,o=r.count();s<o;s++){var l=r.getName(s);i.set(l,s)}var u=Wl.load(this.getMapType(),this.option.nameMap,this.option.nameProperty);return z(u.regions,function(c){var h=c.name,f=i.get(h),d=c.properties&&c.properties.echartsStyle,p;f==null?(p={name:h},a.push(p)):p=r.getRawDataItem(f),d&&It(p,d)}),r.appendData(a),r},e.prototype.getHostGeoModel=function(){var t=this.option.geoIndex;return t!=null?this.ecModel.getComponent("geo",t):null},e.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},e.prototype.getRawValue=function(t){var r=this.getData();return r.get(r.mapDimension("value"),t)},e.prototype.getRegionModel=function(t){var r=this.getData();return r.getItemModel(r.indexOfName(t))},e.prototype.formatTooltip=function(t,r,i){for(var a=this.getData(),s=this.getRawValue(t),o=a.getName(t),l=this.seriesGroup,u=[],c=0;c<l.length;c++){var h=l[c].originalData.indexOfName(o),f=a.mapDimension("value");isNaN(l[c].originalData.get(f,h))||u.push(l[c].name)}return ii("section",{header:u.join(", "),noHeader:!u.length,blocks:[ii("nameValue",{name:o,value:s})]})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.getLegendIcon=function(t){var r=t.icon||"roundRect",i=Br(r,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill);return i.setStyle(t.itemStyle),i.style.stroke="none",r.indexOf("empty")>-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}(rr);const Vue=Uue;function Hue(n,e){var t={};return z(n,function(r){r.each(r.mapDimension("value"),function(i,a){var s="ec-"+r.getName(a);t[s]=t[s]||[],isNaN(i)||t[s].push(i)})}),n[0].map(n[0].mapDimension("value"),function(r,i){for(var a="ec-"+n[0].getName(i),s=0,o=1/0,l=-1/0,u=t[a].length,c=0;c<u;c++)o=Math.min(o,t[a][c]),l=Math.max(l,t[a][c]),s+=t[a][c];var h;return e==="min"?h=o:e==="max"?h=l:e==="average"?h=s/u:h=s,u===0?NaN:h})}function Wue(n){var e={};n.eachSeriesByType("map",function(t){var r=t.getHostGeoModel(),i=r?"o"+r.id:"i"+t.getMapType();(e[i]=e[i]||[]).push(t)}),z(e,function(t,r){for(var i=Hue(Ne(t,function(s){return s.getData()}),t[0].get("mapValueCalculation")),a=0;a<t.length;a++)t[a].originalData=t[a].getData();for(var a=0;a<t.length;a++)t[a].seriesGroup=t,t[a].needsDrawMap=a===0&&!t[a].getHostGeoModel(),t[a].setData(i.cloneShallow()),t[a].mainSeries=t[0]})}function $ue(n){var e={};n.eachSeriesByType("map",function(t){var r=t.getMapType();if(!(t.getHostGeoModel()||e[r])){var i={};z(t.seriesGroup,function(s){var o=s.coordinateSystem,l=s.originalData;s.get("showLegendSymbol")&&n.getComponent("legend")&&l.each(l.mapDimension("value"),function(u,c){var h=l.getName(c),f=o.getRegion(h);if(!(!f||isNaN(u))){var d=i[h]||0,p=o.dataToPoint(f.getCenter());i[h]=d+1,l.setItemLayout(c,{point:p,offset:d})}})});var a=t.getData();a.each(function(s){var o=a.getName(s),l=a.getItemLayout(s)||{};l.showLabel=!i[o],a.setItemLayout(s,l)}),e[r]=!0}})}var Ek=Mi,jue=function(n){ve(e,n);function e(t){var r=n.call(this)||this;return r.type="view",r.dimensions=["x","y"],r._roamTransformable=new Cl,r._rawTransformable=new Cl,r.name=t,r}return e.prototype.setBoundingRect=function(t,r,i,a){return this._rect=new Ot(t,r,i,a),this._rect},e.prototype.getBoundingRect=function(){return this._rect},e.prototype.setViewRect=function(t,r,i,a){this._transformTo(t,r,i,a),this._viewRect=new Ot(t,r,i,a)},e.prototype._transformTo=function(t,r,i,a){var s=this.getBoundingRect(),o=this._rawTransformable;o.transform=s.calculateTransform(new Ot(t,r,i,a));var l=o.parent;o.parent=null,o.decomposeTransform(),o.parent=l,this._updateTransform()},e.prototype.setCenter=function(t,r){t&&(this._center=[Xe(t[0],r.getWidth()),Xe(t[1],r.getHeight())],this._updateCenterAndZoom())},e.prototype.setZoom=function(t){t=t||1;var r=this.zoomLimit;r&&(r.max!=null&&(t=Math.min(r.max,t)),r.min!=null&&(t=Math.max(r.min,t))),this._zoom=t,this._updateCenterAndZoom()},e.prototype.getDefaultCenter=function(){var t=this.getBoundingRect(),r=t.x+t.width/2,i=t.y+t.height/2;return[r,i]},e.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},e.prototype.getZoom=function(){return this._zoom||1},e.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},e.prototype._updateCenterAndZoom=function(){var t=this._rawTransformable.getLocalTransform(),r=this._roamTransformable,i=this.getDefaultCenter(),a=this.getCenter(),s=this.getZoom();a=Mi([],a,t),i=Mi([],i,t),r.originX=a[0],r.originY=a[1],r.x=i[0]-a[0],r.y=i[1]-a[1],r.scaleX=r.scaleY=s,this._updateTransform()},e.prototype._updateTransform=function(){var t=this._roamTransformable,r=this._rawTransformable;r.parent=t,t.updateTransform(),r.updateTransform(),_P(this.transform||(this.transform=[]),r.transform||Za()),this._rawTransform=r.getLocalTransform(),this.invTransform=this.invTransform||[],jp(this.invTransform,this.transform),this.decomposeTransform()},e.prototype.getTransformInfo=function(){var t=this._rawTransformable,r=this._roamTransformable,i=new Cl;return i.transform=r.transform,i.decomposeTransform(),{roam:{x:i.x,y:i.y,scaleX:i.scaleX,scaleY:i.scaleY},raw:{x:t.x,y:t.y,scaleX:t.scaleX,scaleY:t.scaleY}}},e.prototype.getViewRect=function(){return this._viewRect},e.prototype.getViewRectAfterRoam=function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},e.prototype.dataToPoint=function(t,r,i){var a=r?this._rawTransform:this.transform;return i=i||[],a?Ek(i,t,a):Qi(i,t)},e.prototype.pointToData=function(t){var r=this.invTransform;return r?Ek([],t,r):[t[0],t[1]]},e.prototype.convertToPixel=function(t,r,i){var a=Pk(r);return a===this?a.dataToPoint(i):null},e.prototype.convertFromPixel=function(t,r,i){var a=Pk(r);return a===this?a.pointToData(i):null},e.prototype.containPoint=function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])},e.dimensions=["x","y"],e}(Cl);function Pk(n){var e=n.seriesModel;return e?e.coordinateSystem:null}const j0=jue;var que={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},PH=["lng","lat"],LH=function(n){ve(e,n);function e(t,r,i){var a=n.call(this,t)||this;a.dimensions=PH,a.type="geo",a._nameCoordMap=st(),a.map=r;var s=i.projection,o=Wl.load(r,i.nameMap,i.nameProperty),l=Wl.getGeoResource(r);a.resourceType=l?l.type:null;var u=a.regions=o.regions,c=que[l.type];a._regionsMap=o.regionsMap,a.regions=o.regions,a.projection=s;var h;if(s)for(var f=0;f<u.length;f++){var d=u[f].getBoundingRect(s);h=h||d.clone(),h.union(d)}else h=o.boundingRect;return a.setBoundingRect(h.x,h.y,h.width,h.height),a.aspectScale=s?1:Et(i.aspectScale,c.aspectScale),a._invertLongitute=s?!1:c.invertLongitute,a}return e.prototype._transformTo=function(t,r,i,a){var s=this.getBoundingRect(),o=this._invertLongitute;s=s.clone(),o&&(s.y=-s.y-s.height);var l=this._rawTransformable;l.transform=s.calculateTransform(new Ot(t,r,i,a));var u=l.parent;l.parent=null,l.decomposeTransform(),l.parent=u,o&&(l.scaleY=-l.scaleY),this._updateTransform()},e.prototype.getRegion=function(t){return this._regionsMap.get(t)},e.prototype.getRegionByCoord=function(t){for(var r=this.regions,i=0;i<r.length;i++){var a=r[i];if(a.type==="geoJSON"&&a.contain(t))return r[i]}},e.prototype.addGeoCoord=function(t,r){this._nameCoordMap.set(t,r)},e.prototype.getGeoCoord=function(t){var r=this._regionsMap.get(t);return this._nameCoordMap.get(t)||r&&r.getCenter()},e.prototype.dataToPoint=function(t,r,i){if(Ke(t)&&(t=this.getGeoCoord(t)),t){var a=this.projection;return a&&(t=a.project(t)),t&&this.projectedToPoint(t,r,i)}},e.prototype.pointToData=function(t){var r=this.projection;return r&&(t=r.unproject(t)),t&&this.pointToProjected(t)},e.prototype.pointToProjected=function(t){return n.prototype.pointToData.call(this,t)},e.prototype.projectedToPoint=function(t,r,i){return n.prototype.dataToPoint.call(this,t,r,i)},e.prototype.convertToPixel=function(t,r,i){var a=Lk(r);return a===this?a.dataToPoint(i):null},e.prototype.convertFromPixel=function(t,r,i){var a=Lk(r);return a===this?a.pointToData(i):null},e}(j0);zr(LH,j0);function Lk(n){var e=n.geoModel,t=n.seriesModel;return e?e.coordinateSystem:t?t.coordinateSystem||(t.getReferringComponents("geo",Fr).models[0]||{}).coordinateSystem:null}const Rk=LH;function Dk(n,e){var t=n.get("boundingCoords");if(t!=null){var r=t[0],i=t[1];if(isFinite(r[0])&&isFinite(r[1])&&isFinite(i[0])&&isFinite(i[1])){var a=this.projection;if(a){var s=r[0],o=r[1],l=i[0],u=i[1];r=[1/0,1/0],i=[-1/0,-1/0];var c=function(S,w,T,C){for(var A=T-S,M=C-w,P=0;P<=100;P++){var D=P/100,L=a.project([S+A*D,w+M*D]);Fu(r,r,L),Bu(i,i,L)}};c(s,o,l,o),c(l,o,l,u),c(l,u,s,u),c(s,u,l,o)}this.setBoundingRect(r[0],r[1],i[0]-r[0],i[1]-r[1])}}var h=this.getBoundingRect(),f=n.get("layoutCenter"),d=n.get("layoutSize"),p=e.getWidth(),g=e.getHeight(),v=h.width/h.height*this.aspectScale,m=!1,y,_;f&&d&&(y=[Xe(f[0],p),Xe(f[1],g)],_=Xe(d,Math.min(p,g)),!isNaN(y[0])&&!isNaN(y[1])&&!isNaN(_)&&(m=!0));var x;if(m)x={},v>1?(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 b=n.getBoxLayoutParams();b.aspect=v,x=Kr(b,{width:p,height:g})}this.setViewRect(x.x,x.y,x.width,x.height),this.setCenter(n.get("center"),e),this.setZoom(n.get("zoom"))}function Xue(n,e){z(e.get("geoCoord"),function(t,r){n.addGeoCoord(r,t)})}var Yue=function(){function n(){this.dimensions=PH}return n.prototype.create=function(e,t){var r=[];function i(s){return{nameProperty:s.get("nameProperty"),aspectScale:s.get("aspectScale"),projection:s.get("projection")}}e.eachComponent("geo",function(s,o){var l=s.get("map"),u=new Rk(l+o,l,Pe({nameMap:s.get("nameMap")},i(s)));u.zoomLimit=s.get("scaleLimit"),r.push(u),s.coordinateSystem=u,u.model=s,u.resize=Dk,u.resize(s,t)}),e.eachSeries(function(s){var o=s.get("coordinateSystem");if(o==="geo"){var l=s.get("geoIndex")||0;s.coordinateSystem=r[l]}});var a={};return e.eachSeriesByType("map",function(s){if(!s.getHostGeoModel()){var o=s.getMapType();a[o]=a[o]||[],a[o].push(s)}}),z(a,function(s,o){var l=Ne(s,function(c){return c.get("nameMap")}),u=new Rk(o,o,Pe({nameMap:vP(l)},i(s[0])));u.zoomLimit=di.apply(null,Ne(s,function(c){return c.get("scaleLimit")})),r.push(u),u.resize=Dk,u.resize(s[0],t),z(s,function(c){c.coordinateSystem=u,Xue(u,c)})}),r},n.prototype.getFilledRegions=function(e,t,r,i){for(var a=(e||[]).slice(),s=st(),o=0;o<a.length;o++)s.set(a[o].name,a[o]);var l=Wl.load(t,r,i);return z(l.regions,function(u){var c=u.name,h=s.get(c),f=u.properties&&u.properties.echartsStyle;h||(h={name:c},a.push(h)),f&&It(h,f)}),a},n}(),Kue=new Yue;const RH=Kue;var Zue=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r,i){var a=Wl.getGeoResource(t.map);if(a&&a.type==="geoJSON"){var s=t.itemStyle=t.itemStyle||{};"color"in s||(s.color="#eee")}this.mergeDefaultAndTheme(t,i),of(t,"label",["show"])},e.prototype.optionUpdated=function(){var t=this,r=this.option;r.regions=RH.getFilledRegions(r.regions,r.map,r.nameMap,r.nameProperty);var i={};this._optionModelMap=Yo(r.regions||[],function(a,s){var o=s.name;return o&&(a.set(o,new Wn(s,t,t.ecModel)),s.selected&&(i[o]=!0)),a},st()),r.selectedMap||(r.selectedMap=i)},e.prototype.getRegionModel=function(t){return this._optionModelMap.get(t)||new Wn(null,this,this.ecModel)},e.prototype.getFormattedLabel=function(t,r){var i=this.getRegionModel(t),a=r==="normal"?i.get(["label","formatter"]):i.get(["emphasis","label","formatter"]),s={name:t};if(ct(a))return s.status=r,a(s);if(Ke(a))return a.replace("{a}",t!=null?t:"")},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.select=function(t){var r=this.option,i=r.selectedMode;if(i){i!=="multiple"&&(r.selectedMap=null);var a=r.selectedMap||(r.selectedMap={});a[t]=!0}},e.prototype.unSelect=function(t){var r=this.option.selectedMap;r&&(r[t]=!1)},e.prototype.toggleSelected=function(t){this[this.isSelected(t)?"unSelect":"select"](t)},e.prototype.isSelected=function(t){var r=this.option.selectedMap;return!!(r&&r[t])},e.type="geo",e.layoutMode="box",e.defaultOption={z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},e}(sn);const Que=Zue;function Ik(n,e){return n.pointToProjected?n.pointToProjected(e):n.pointToData(e)}function LL(n,e,t,r){var i=n.getZoom(),a=n.getCenter(),s=e.zoom,o=n.projectedToPoint?n.projectedToPoint(a):n.dataToPoint(a);if(e.dx!=null&&e.dy!=null&&(o[0]-=e.dx,o[1]-=e.dy,n.setCenter(Ik(n,o),r)),s!=null){if(t){var l=t.min||0,u=t.max||1/0;s=Math.max(Math.min(i*s,u),l)/i}n.scaleX*=s,n.scaleY*=s;var c=(e.originX-n.x)*(s-1),h=(e.originY-n.y)*(s-1);n.x-=c,n.y-=h,n.updateTransform(),n.setCenter(Ik(n,o),r),n.setZoom(s*i)}return{center:n.getCenter(),zoom:n.getZoom()}}var Jue=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.focusBlurEnabled=!0,t}return e.prototype.init=function(t,r){this._api=r},e.prototype.render=function(t,r,i,a){if(this._model=t,!t.get("show")){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;return}this._mapDraw||(this._mapDraw=new EH(i));var s=this._mapDraw;s.draw(t,r,i,this,a),s.group.on("click",this._handleRegionClick,this),s.group.silent=t.get("silent"),this.group.add(s.group),this.updateSelectStatus(t,r,i)},e.prototype._handleRegionClick=function(t){var r;Rh(t.target,function(i){return(r=St(i).eventData)!=null},!0),r&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:r.name})},e.prototype.updateSelectStatus=function(t,r,i){var a=this;this._mapDraw.group.traverse(function(s){var o=St(s).eventData;if(o)return a._model.isSelected(o.name)?i.enterSelect(s):i.leaveSelect(s),!0})},e.prototype.findHighDownDispatchers=function(t){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(t,this._model)},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},e.type="geo",e}(fr);const ece=Jue;function tce(n,e,t){Wl.registerMap(n,e,t)}function DH(n){n.registerCoordinateSystem("geo",RH),n.registerComponentModel(Que),n.registerComponentView(ece),n.registerImpl("registerMap",tce),n.registerImpl("getMap",function(t){return Wl.getMapForUser(t)});function e(t,r){r.update="geo:updateSelectStatus",n.registerAction(r,function(i,a){var s={},o=[];return a.eachComponent({mainType:"geo",query:i},function(l){l[t](i.name);var u=l.coordinateSystem;z(u.regions,function(h){s[h.name]=l.isSelected(h.name)||!1});var c=[];z(s,function(h,f){s[f]&&c.push(f)}),o.push({geoIndex:l.componentIndex,name:c})}),{selected:s,allSelected:o,name:i.name}})}e("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),e("select",{type:"geoSelect",event:"geoselected"}),e("unSelect",{type:"geoUnSelect",event:"geounselected"}),n.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(t,r,i){var a=t.componentType||"series";r.eachComponent({mainType:a,query:t},function(s){var o=s.coordinateSystem;if(o.type==="geo"){var l=LL(o,t,s.get("scaleLimit"),i);s.setCenter&&s.setCenter(l.center),s.setZoom&&s.setZoom(l.zoom),a==="series"&&z(s.seriesGroup,function(u){u.setCenter(l.center),u.setZoom(l.zoom)})}})})}function nce(n){Vt(DH),n.registerChartView(zue),n.registerSeriesModel(Vue),n.registerLayout($ue),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,Wue),CV("map",n.registerAction)}function rce(n){var e=n;e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var t=[e],r,i;r=t.pop();)if(i=r.children,r.isExpand&&i.length)for(var a=i.length,s=a-1;s>=0;s--){var o=i[s];o.hierNode={defaultAncestor:null,ancestor:o,prelim:0,modifier:0,change:0,shift:0,i:s,thread:null},t.push(o)}}function ice(n,e){var t=n.isExpand?n.children:[],r=n.parentNode.children,i=n.hierNode.i?r[n.hierNode.i-1]:null;if(t.length){oce(n);var a=(t[0].hierNode.prelim+t[t.length-1].hierNode.prelim)/2;i?(n.hierNode.prelim=i.hierNode.prelim+e(n,i),n.hierNode.modifier=n.hierNode.prelim-a):n.hierNode.prelim=a}else i&&(n.hierNode.prelim=i.hierNode.prelim+e(n,i));n.parentNode.hierNode.defaultAncestor=lce(n,i,n.parentNode.hierNode.defaultAncestor||r[0],e)}function ace(n){var e=n.hierNode.prelim+n.parentNode.hierNode.modifier;n.setLayout({x:e},!0),n.hierNode.modifier+=n.parentNode.hierNode.modifier}function Nk(n){return arguments.length?n:hce}function Bg(n,e){return n-=Math.PI/2,{x:e*Math.cos(n),y:e*Math.sin(n)}}function sce(n,e){return Kr(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function oce(n){for(var e=n.children,t=e.length,r=0,i=0;--t>=0;){var a=e[t];a.hierNode.prelim+=r,a.hierNode.modifier+=r,i+=a.hierNode.change,r+=a.hierNode.shift+i}}function lce(n,e,t,r){if(e){for(var i=n,a=n,s=a.parentNode.children[0],o=e,l=i.hierNode.modifier,u=a.hierNode.modifier,c=s.hierNode.modifier,h=o.hierNode.modifier;o=QA(o),a=JA(a),o&&a;){i=QA(i),s=JA(s),i.hierNode.ancestor=n;var f=o.hierNode.prelim+h-a.hierNode.prelim-u+r(o,a);f>0&&(cce(uce(o,n,t),n,f),u+=f,l+=f),h+=o.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=s.hierNode.modifier}o&&!QA(i)&&(i.hierNode.thread=o,i.hierNode.modifier+=h-l),a&&!JA(s)&&(s.hierNode.thread=a,s.hierNode.modifier+=u-c,t=n)}return t}function QA(n){var e=n.children;return e.length&&n.isExpand?e[e.length-1]:n.hierNode.thread}function JA(n){var e=n.children;return e.length&&n.isExpand?e[0]:n.hierNode.thread}function uce(n,e,t){return n.hierNode.ancestor.parentNode===e.parentNode?n.hierNode.ancestor:t}function cce(n,e,t){var r=t/(e.hierNode.i-n.hierNode.i);e.hierNode.change-=r,e.hierNode.shift+=t,e.hierNode.modifier+=t,e.hierNode.prelim+=t,n.hierNode.change+=r}function hce(n,e){return n.parentNode===e.parentNode?1:2}var fce=function(){function n(){this.parentPoint=[],this.childPoints=[]}return n}(),dce=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new fce},e.prototype.buildPath=function(t,r){var i=r.childPoints,a=i.length,s=r.parentPoint,o=i[0],l=i[a-1];if(a===1){t.moveTo(s[0],s[1]),t.lineTo(o[0],o[1]);return}var u=r.orient,c=u==="TB"||u==="BT"?0:1,h=1-c,f=Xe(r.forkPosition,1),d=[];d[c]=s[c],d[h]=s[h]+(l[h]-s[h])*f,t.moveTo(s[0],s[1]),t.lineTo(d[0],d[1]),t.moveTo(o[0],o[1]),d[c]=o[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;p<a-1;p++){var g=i[p];t.moveTo(g[0],g[1]),d[c]=g[c],t.lineTo(d[0],d[1])}},e}(Ht),pce=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._mainGroup=new bt,t}return e.prototype.init=function(t,r){this._controller=new $0(r.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},e.prototype.render=function(t,r,i){var a=t.getData(),s=t.layoutInfo,o=this._mainGroup,l=t.get("layout");l==="radial"?(o.x=s.x+s.width/2,o.y=s.y+s.height/2):(o.x=s.x,o.y=s.y),this._updateViewCoordSys(t,i),this._updateController(t,r,i);var u=this._data;a.diff(u).add(function(c){kk(a,c)&&Ok(a,c,null,o,t)}).update(function(c,h){var f=u.getItemGraphicEl(h);if(!kk(a,c)){f&&Bk(u,h,f,o,t);return}Ok(a,c,f,o,t)}).remove(function(c){var h=u.getItemGraphicEl(c);h&&Bk(u,c,h,o,t)}).execute(),this._nodeScaleRatio=t.get("nodeScaleRatio"),this._updateNodeAndLinkScale(t),t.get("expandAndCollapse")===!0&&a.eachItemGraphicEl(function(c,h){c.off("click").on("click",function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:h})})}),this._data=a},e.prototype._updateViewCoordSys=function(t,r){var i=t.getData(),a=[];i.each(function(h){var f=i.getItemLayout(h);f&&!isNaN(f.x)&&!isNaN(f.y)&&a.push([+f.x,+f.y])});var s=[],o=[];eS(a,s,o);var l=this._min,u=this._max;o[0]-s[0]===0&&(s[0]=l?l[0]:s[0]-1,o[0]=u?u[0]:o[0]+1),o[1]-s[1]===0&&(s[1]=l?l[1]:s[1]-1,o[1]=u?u[1]:o[1]+1);var c=t.coordinateSystem=new j0;c.zoomLimit=t.get("scaleLimit"),c.setBoundingRect(s[0],s[1],o[0]-s[0],o[1]-s[1]),c.setCenter(t.get("center"),r),c.setZoom(t.get("zoom")),this.group.attr({x:c.x,y:c.y,scaleX:c.scaleX,scaleY:c.scaleY}),this._min=s,this._max=o},e.prototype._updateController=function(t,r,i){var a=this,s=this._controller,o=this._controllerHost,l=this.group;s.setPointerChecker(function(u,c,h){var f=l.getBoundingRect();return f.applyTransform(l.transform),f.contain(c,h)&&!MS(u,i,t)}),s.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),s.off("pan").off("zoom").on("pan",function(u){CL(o,u.dx,u.dy),i.dispatchAction({seriesId:t.id,type:"treeRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){EL(o,u.scale,u.originX,u.originY),i.dispatchAction({seriesId:t.id,type:"treeRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(t),i.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(t){var r=t.getData(),i=this._getNodeGlobalScale(t);r.eachItemGraphicEl(function(a,s){a.setSymbolScale(i)})},e.prototype._getNodeGlobalScale=function(t){var r=t.coordinateSystem;if(r.type!=="view")return 1;var i=this._nodeScaleRatio,a=r.scaleX||1,s=r.getZoom(),o=(s-1)*i+1;return o/a},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},e.type="tree",e}($n);function kk(n,e){var t=n.getItemLayout(e);return t&&!isNaN(t.x)&&!isNaN(t.y)}function Ok(n,e,t,r,i){var a=!t,s=n.tree.getNodeByDataIndex(e),o=s.getModel(),l=s.getVisual("style").fill,u=s.isExpand===!1&&s.children.length!==0?l:"#fff",c=n.tree.root,h=s.parentNode===c?s:s.parentNode||s,f=n.getItemGraphicEl(h.dataIndex),d=h.getLayout(),p=f?{x:f.__oldX,y:f.__oldY,rawX:f.__radialOldRawX,rawY:f.__radialOldRawY}:d,g=s.getLayout();a?(t=new G0(n,e,null,{symbolInnerColor:u,useNameLabel:!0}),t.x=p.x,t.y=p.y):t.updateData(n,e,null,{symbolInnerColor:u,useNameLabel:!0}),t.__radialOldRawX=t.__radialRawX,t.__radialOldRawY=t.__radialRawY,t.__radialRawX=g.rawX,t.__radialRawY=g.rawY,r.add(t),n.setItemGraphicEl(e,t),t.__oldX=t.x,t.__oldY=t.y,cn(t,{x:g.x,y:g.y},i);var v=t.getSymbolPath();if(i.get("layout")==="radial"){var m=c.children[0],y=m.getLayout(),_=m.children.length,x=void 0,b=void 0;if(g.x===y.x&&s.isExpand===!0&&m.children.length){var S={x:(m.children[0].getLayout().x+m.children[_-1].getLayout().x)/2,y:(m.children[0].getLayout().y+m.children[_-1].getLayout().y)/2};x=Math.atan2(S.y-y.y,S.x-y.x),x<0&&(x=Math.PI*2+x),b=S.x<y.x,b&&(x=x-Math.PI)}else x=Math.atan2(g.y-y.y,g.x-y.x),x<0&&(x=Math.PI*2+x),s.children.length===0||s.children.length!==0&&s.isExpand===!1?(b=g.x<y.x,b&&(x=x-Math.PI)):(b=g.x>y.x,b||(x=x-Math.PI));var w=b?"left":"right",T=o.getModel("label"),C=T.get("rotate"),A=C*(Math.PI/180),M=v.getTextContent();M&&(v.setTextConfig({position:T.get("position")||w,rotation:C==null?-x:A,origin:"center"}),M.setStyle("verticalAlign","middle"))}var P=o.get(["emphasis","focus"]),D=P==="relative"?Nm(s.getAncestorsIndices(),s.getDescendantIndices()):P==="ancestor"?s.getAncestorsIndices():P==="descendant"?s.getDescendantIndices():null;D&&(St(t).focus=D),vce(i,s,c,t,p,d,g,r),t.__edge&&(t.onHoverStateChange=function(L){if(L!=="blur"){var R=s.parentNode&&n.getItemGraphicEl(s.parentNode.dataIndex);R&&R.hoverState===D0||Mx(t.__edge,L)}})}function vce(n,e,t,r,i,a,s,o){var l=e.getModel(),u=n.get("edgeShape"),c=n.get("layout"),h=n.getOrient(),f=n.get(["lineStyle","curveness"]),d=n.get("edgeForkPosition"),p=l.getModel("lineStyle").getLineStyle(),g=r.__edge;if(u==="curve")e.parentNode&&e.parentNode!==t&&(g||(g=r.__edge=new iS({shape:PC(c,h,f,i,i)})),cn(g,{shape:PC(c,h,f,a,s)},n));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;y<v.length;y++){var _=v[y].getLayout();m.push([_.x,_.y])}g||(g=r.__edge=new dce({shape:{parentPoint:[s.x,s.y],childPoints:[[s.x,s.y]],orient:h,forkPosition:d}})),cn(g,{shape:{parentPoint:[s.x,s.y],childPoints:m}},n)}g&&!(u==="polyline"&&!e.isExpand)&&(g.useStyle(dt({strokeNoScale:!0,fill:null},p)),Ci(g,l,"lineStyle"),cf(g),o.add(g))}function Fk(n,e,t,r,i){var a=e.tree.root,s=IH(a,n),o=s.source,l=s.sourceLayout,u=e.getItemGraphicEl(n.dataIndex);if(u){var c=e.getItemGraphicEl(o.dataIndex),h=c.__edge,f=u.__edge||(o.isExpand===!1||o.children.length===1?h:void 0),d=r.get("edgeShape"),p=r.get("layout"),g=r.get("orient"),v=r.get(["lineStyle","curveness"]);f&&(d==="curve"?hc(f,{shape:PC(p,g,v,l,l),style:{opacity:0}},r,{cb:function(){t.remove(f)},removeOpt:i}):d==="polyline"&&r.get("layout")==="orthogonal"&&hc(f,{shape:{parentPoint:[l.x,l.y],childPoints:[[l.x,l.y]]},style:{opacity:0}},r,{cb:function(){t.remove(f)},removeOpt:i}))}}function IH(n,e){for(var t=e.parentNode===n?e:e.parentNode||e,r;r=t.getLayout(),r==null;)t=t.parentNode===n?t:t.parentNode||t;return{source:t,sourceLayout:r}}function Bk(n,e,t,r,i){var a=n.tree.getNodeByDataIndex(e),s=n.tree.root,o=IH(s,a).sourceLayout,l={duration:i.get("animationDurationUpdate"),easing:i.get("animationEasingUpdate")};hc(t,{x:o.x+1,y:o.y+1},i,{cb:function(){r.remove(t),n.setItemGraphicEl(e,null)},removeOpt:l}),t.fadeOut(null,n.hostModel,{fadeLabel:!0,animation:l}),a.children.forEach(function(u){Fk(u,n,r,i,l)}),Fk(a,n,r,i,l)}function PC(n,e,t,r,i){var a,s,o,l,u,c,h,f;if(n==="radial"){u=r.rawX,h=r.rawY,c=i.rawX,f=i.rawY;var d=Bg(u,h),p=Bg(u,h+(f-h)*t),g=Bg(c,f+(h-f)*t),v=Bg(c,f);return{x1:d.x||0,y1:d.y||0,x2:v.x||0,y2:v.y||0,cpx1:p.x||0,cpy1:p.y||0,cpx2:g.x||0,cpy2:g.y||0}}else u=r.x,h=r.y,c=i.x,f=i.y,(e==="LR"||e==="RL")&&(a=u+(c-u)*t,s=h,o=c+(u-c)*t,l=f),(e==="TB"||e==="BT")&&(a=u,s=h+(f-h)*t,o=c,l=f+(h-f)*t);return{x1:u,y1:h,x2:c,y2:f,cpx1:a,cpy1:s,cpx2:o,cpy2:l}}const gce=pce;var Ds=en();function NH(n){var e=n.mainData,t=n.datas;t||(t={main:e},n.datasAttr={main:"data"}),n.datas=n.mainData=null,kH(e,t,n),z(t,function(r){z(e.TRANSFERABLE_METHODS,function(i){r.wrapMethod(i,Rt(mce,n))})}),e.wrapMethod("cloneShallow",Rt(_ce,n)),z(e.CHANGABLE_METHODS,function(r){e.wrapMethod(r,Rt(yce,n))}),sa(t[e.dataType]===e)}function mce(n,e){if(Sce(this)){var t=Pe({},Ds(this).datas);t[this.dataType]=e,kH(e,t,n)}else RL(e,this.dataType,Ds(this).mainData,n);return e}function yce(n,e){return n.struct&&n.struct.update(),e}function _ce(n,e){return z(Ds(e).datas,function(t,r){t!==e&&RL(t.cloneShallow(),r,e,n)}),e}function xce(n){var e=Ds(this).mainData;return n==null||e==null?e:Ds(e).datas[n]}function bce(){var n=Ds(this).mainData;return n==null?[{data:n}]:Ne(Yt(Ds(n).datas),function(e){return{type:e,data:Ds(n).datas[e]}})}function Sce(n){return Ds(n).mainData===n}function kH(n,e,t){Ds(n).datas={},z(e,function(r,i){RL(r,i,n,t)})}function RL(n,e,t,r){Ds(t).datas[e]=n,Ds(n).mainData=t,n.dataType=e,r.struct&&(n[r.structAttr]=r.struct,r.struct[r.datasAttr[e]]=n),n.getLinkedData=xce,n.getLinkedDataAll=bce}var wce=function(){function n(e,t){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=e||"",this.hostTree=t}return n.prototype.isRemoved=function(){return this.dataIndex<0},n.prototype.eachNode=function(e,t,r){ct(e)&&(r=t,t=e,e=null),e=e||{},Ke(e)&&(e={order:e});var i=e.order||"preorder",a=this[e.attr||"children"],s;i==="preorder"&&(s=t.call(r,this));for(var o=0;!s&&o<a.length;o++)a[o].eachNode(e,t,r);i==="postorder"&&t.call(r,this)},n.prototype.updateDepthAndHeight=function(e){var t=0;this.depth=e;for(var r=0;r<this.children.length;r++){var i=this.children[r];i.updateDepthAndHeight(e+1),i.height>t&&(t=i.height)}this.height=t+1},n.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,r=this.children,i=r.length;t<i;t++){var a=r[t].getNodeById(e);if(a)return a}},n.prototype.contains=function(e){if(e===this)return!0;for(var t=0,r=this.children,i=r.length;t<i;t++){var a=r[t].contains(e);if(a)return a}},n.prototype.getAncestors=function(e){for(var t=[],r=e?this:this.parentNode;r;)t.push(r),r=r.parentNode;return t.reverse(),t},n.prototype.getAncestorsIndices=function(){for(var e=[],t=this;t;)e.push(t.dataIndex),t=t.parentNode;return e.reverse(),e},n.prototype.getDescendantIndices=function(){var e=[];return this.eachNode(function(t){e.push(t.dataIndex)}),e},n.prototype.getValue=function(e){var t=this.hostTree.data;return t.getStore().get(t.getDimensionIndex(e||"value"),this.dataIndex)},n.prototype.setLayout=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},n.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},n.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostTree,r=t.data.getItemModel(this.dataIndex);return r.getModel(e)}},n.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},n.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},n.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},n.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},n.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},n.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t<e.length;++t)if(e[t]===this)return t;return-1}return-1},n.prototype.isAncestorOf=function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},n.prototype.isDescendantOf=function(e){return e!==this&&e.isAncestorOf(this)},n}(),Ace=function(){function n(e){this.type="tree",this._nodes=[],this.hostModel=e}return n.prototype.eachNode=function(e,t,r){this.root.eachNode(e,t,r)},n.prototype.getNodeByDataIndex=function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},n.prototype.getNodeById=function(e){return this.root.getNodeById(e)},n.prototype.update=function(){for(var e=this.data,t=this._nodes,r=0,i=t.length;r<i;r++)t[r].dataIndex=-1;for(var r=0,i=e.count();r<i;r++)t[e.getRawIndex(r)].dataIndex=r},n.prototype.clearLayouts=function(){this.data.clearItemLayouts()},n.createTree=function(e,t,r){var i=new n(t),a=[],s=1;o(e);function o(c,h){var f=c.value;s=Math.max(s,Ie(f)?f.length:1),a.push(c);var d=new wce(Yr(c.name,""),i);h?Mce(d,h):i.root=d,i._nodes.push(d);var p=c.children;if(p)for(var g=0;g<p.length;g++)o(p[g],d)}i.root.updateDepthAndHeight(0);var l=F0(a,{coordDimensions:["value"],dimensionsCount:s}).dimensions,u=new ia(l,t);return u.initData(a),r&&r(u),NH({mainData:u,struct:i,structAttr:"tree"}),i.update(),i},n}();function Mce(n,e){var t=e.children;n.parentNode!==e&&(t.push(n),n.parentNode=e)}const DL=Ace;function e0(n,e,t){if(n&&Ft(e,n.type)>=0){var r=t.getData().tree.root,i=n.targetNode;if(Ke(i)&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var a=n.targetNodeId;if(a!=null&&(i=r.getNodeById(a)))return{node:i}}}function OH(n){for(var e=[];n;)n=n.parentNode,n&&e.push(n);return e.reverse()}function IL(n,e){var t=OH(n);return Ft(t,e)>=0}function CS(n,e){for(var t=[];n;){var r=n.dataIndex;t.push({name:n.name,dataIndex:r,value:e.getRawValue(r)}),n=n.parentNode}return t.reverse(),t}var Tce=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t){var r={name:t.name,children:t.data},i=t.leaves||{},a=new Wn(i,this,this.ecModel),s=DL.createTree(r,this,o);function o(h){h.wrapMethod("getItemModel",function(f,d){var p=s.getNodeByDataIndex(d);return p&&p.children.length&&p.isExpand||(f.parentModel=a),f})}var l=0;s.eachNode("preorder",function(h){h.depth>l&&(l=h.depth)});var u=t.expandAndCollapse,c=u&&t.initialTreeDepth>=0?t.initialTreeDepth:l;return s.root.eachNode("preorder",function(h){var f=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=f&&f.collapsed!=null?!f.collapsed:h.depth<=c}),s.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,r,i){for(var a=this.getData().tree,s=a.root.children[0],o=a.getNodeByDataIndex(t),l=o.getValue(),u=o.name;o&&o!==s;)u=o.parentNode.name+"."+u,o=o.parentNode;return ii("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treeAncestors=CS(i,this),r.collapsed=!i.isExpand,r},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}(rr);const Cce=Tce;function Ece(n,e,t){for(var r=[n],i=[],a;a=r.pop();)if(i.push(a),a.isExpand){var s=a.children;if(s.length)for(var o=0;o<s.length;o++)r.push(s[o])}for(;a=i.pop();)e(a,t)}function rg(n,e){for(var t=[n],r;r=t.pop();)if(e(r),r.isExpand){var i=r.children;if(i.length)for(var a=i.length-1;a>=0;a--)t.push(i[a])}}function Pce(n,e){n.eachSeriesByType("tree",function(t){Lce(t,e)})}function Lce(n,e){var t=sce(n,e);n.layoutInfo=t;var r=n.get("layout"),i=0,a=0,s=null;r==="radial"?(i=2*Math.PI,a=Math.min(t.height,t.width)/2,s=Nk(function(_,x){return(_.parentNode===x.parentNode?1:2)/_.depth})):(i=t.width,a=t.height,s=Nk());var o=n.getData().tree.root,l=o.children[0];if(l){rce(o),Ece(l,ice,s),o.hierNode.modifier=-l.hierNode.prelim,rg(l,ace);var u=l,c=l,h=l;rg(l,function(_){var x=_.getLayout().x;x<u.getLayout().x&&(u=_),x>c.getLayout().x&&(c=_),_.depth>h.depth&&(h=_)});var f=u===c?1:s(u,c)/2,d=f-u.getLayout().x,p=0,g=0,v=0,m=0;if(r==="radial")p=i/(c.getLayout().x+f+d),g=a/(h.depth-1||1),rg(l,function(_){v=(_.getLayout().x+d)*p,m=(_.depth-1)*g;var x=Bg(v,m);_.setLayout({x:x.x,y:x.y,rawX:v,rawY:m},!0)});else{var y=n.getOrient();y==="RL"||y==="LR"?(g=a/(c.getLayout().x+f+d),p=i/(h.depth-1||1),rg(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),rg(l,function(_){v=(_.getLayout().x+d)*p,m=y==="TB"?(_.depth-1)*g:a-(_.depth-1)*g,_.setLayout({x:v,y:m},!0)}))}}}function Rce(n){n.eachSeriesByType("tree",function(e){var t=e.getData(),r=t.tree;r.eachNode(function(i){var a=i.getModel(),s=a.getModel("itemStyle").getItemStyle(),o=t.ensureUniqueItemVisual(i.dataIndex,"style");Pe(o,s)})})}function Dce(n){n.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},function(r){var i=e.dataIndex,a=r.getData().tree,s=a.getNodeByDataIndex(i);s.isExpand=!s.isExpand})}),n.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(e,t,r){t.eachComponent({mainType:"series",subType:"tree",query:e},function(i){var a=i.coordinateSystem,s=LL(a,e,void 0,r);i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}function Ice(n){n.registerChartView(gce),n.registerSeriesModel(Cce),n.registerLayout(Pce),n.registerVisual(Rce),Dce(n)}var Gk=["treemapZoomToNode","treemapRender","treemapMove"];function Nce(n){for(var e=0;e<Gk.length;e++)n.registerAction({type:Gk[e],update:"updateView"},Er);n.registerAction({type:"treemapRootToNode",update:"updateView"},function(t,r){r.eachComponent({mainType:"series",subType:"treemap",query:t},i);function i(a,s){var o=["treemapZoomToNode","treemapRootToNode"],l=e0(t,o,a);if(l){var u=a.getViewRoot();u&&(t.direction=IL(u,l.node)?"rollUp":"drillDown"),a.resetViewRoot(l.node)}}})}function FH(n){var e=n.getData(),t=e.tree,r={};t.eachNode(function(i){for(var a=i;a&&a.depth>1;)a=a.parentNode;var s=iC(n.ecModel,a.name||a.dataIndex+"",r);i.setVisual("decal",s)})}var kce=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.preventUsingHoverLayer=!0,t}return e.prototype.getInitialData=function(t,r){var i={name:t.name,children:t.data};BH(i);var a=t.levels||[],s=this.designatedVisualItemStyle={},o=new Wn({itemStyle:s},this,r);a=t.levels=Oce(a,r);var l=Ne(a||[],function(h){return new Wn(h,o,r)},this),u=DL.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||o,f})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),s=this.getRawValue(t),o=a.getName(t);return ii("nameValue",{name:o,value:s})},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treeAncestors=CS(i,this),r.treePathInfo=r.treeAncestors,r},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},Pe(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var r=this._idIndexMap;r||(r=this._idIndexMap=st(),this._idIndexMapCount=0);var i=r.get(t);return i==null&&r.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 r=this.getRawData().tree.root;(!t||t!==r&&!r.contains(t))&&(this._viewRoot=r)},e.prototype.enableAriaDecal=function(){FH(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}(rr);function BH(n){var e=0;z(n.children,function(r){BH(r);var i=r.value;Ie(i)&&(i=i[0]),e+=i});var t=n.value;Ie(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),Ie(n.value)?n.value[0]=t:n.value=t}function Oce(n,e){var t=Cn(e.get("color")),r=Cn(e.get(["aria","decal","decals"]));if(t){n=n||[];var i,a;z(n,function(o){var l=new Wn(o),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 s=n[0]||(n[0]={});return i||(s.color=t.slice()),!a&&r&&(s.decal=r.slice()),n}}const Fce=kce;var Bce=8,zk=8,eM=5,Gce=function(){function n(e){this.group=new bt,e.add(this.group)}return n.prototype.render=function(e,t,r,i){var a=e.getModel("breadcrumb"),s=this.group;if(s.removeAll(),!(!a.get("show")||!r)){var o=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=o.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(r,h,u),this._renderContent(e,h,o,l,u,c,i),dS(s,h.pos,h.box)}},n.prototype._prepare=function(e,t,r){for(var i=e;i;i=i.parentNode){var a=Yr(i.getModel().get("name"),""),s=r.getTextRect(a),o=Math.max(s.width+Bce*2,t.emptyItemWidth);t.totalWidth+=o+zk,t.renderList.push({node:i,text:a,width:o})}},n.prototype._renderContent=function(e,t,r,i,a,s,o){for(var l=0,u=t.emptyItemWidth,c=e.get(["breadcrumb","height"]),h=qte(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 Ra({shape:{points:zce(l,0,y,c,g===d.length-1,g===0)},style:dt(r.getItemStyle(),{lineJoin:"bevel"}),textContent:new ln({style:Hn(a,{text:_})}),textConfig:{position:"inside"},z2:Xp*1e4,onclick:Rt(o,m)});x.disableLabelAnimation=!0,x.getTextContent().ensureState("emphasis").style=Hn(s,{text:_}),x.ensureState("emphasis").style=p,lr(x,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(x),Uce(x,e,m),l+=y+zk}},n.prototype.remove=function(){this.group.removeAll()},n}();function zce(n,e,t,r,i,a){var s=[[i?n:n-eM,e],[n+t,e],[n+t,e+r],[i?n:n-eM,e+r]];return!a&&s.splice(2,0,[n+t+eM,e+r/2]),!i&&s.push([n,e+r/2]),s}function Uce(n,e,t){St(n).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&&CS(t,e)}}const Vce=Gce;var Hce=function(){function n(){this._storage=[],this._elExistsMap={}}return n.prototype.add=function(e,t,r,i,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:r,delay:i,easing:a}),!0)},n.prototype.finished=function(e){return this._finishedCallback=e,this},n.prototype.start=function(){for(var e=this,t=this._storage.length,r=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;i<a;i++){var s=this._storage[i];s.el.animateTo(s.target,{duration:s.duration,delay:s.delay,easing:s.easing,setToFinal:!0,done:r,aborted:r})}return this},n}();function Wce(){return new Hce}var LC=bt,Uk=nn,Vk=3,Hk="label",Wk="upperLabel",$ce=Xp*10,jce=Xp*2,qce=Xp*3,fh=uf([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),$k=function(n){var e=fh(n);return e.stroke=e.fill=e.lineWidth=null,e},Xx=en(),Xce=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._state="ready",t._storage=ig(),t}return e.prototype.render=function(t,r,i,a){var s=r.findComponents({mainType:"series",subType:"treemap",query:a});if(!(Ft(s,t)<0)){this.seriesModel=t,this.api=i,this.ecModel=r;var o=["treemapZoomToNode","treemapRootToNode"],l=e0(a,o,t),u=a&&a.type,c=t.layoutInfo,h=!this._oldTree,f=this._storage,d=u==="treemapRootToNode"&&l&&f?{rootNodeGroup:f.nodeGroup[l.node.getRawIndex()],direction:a.direction}:null,p=this._giveContainerGroup(c),g=t.get("animation"),v=this._doRender(p,t,d);g&&!h&&(!u||u==="treemapZoomToNode"||u==="treemapRootToNode")?this._doAnimation(p,v,t,d):v.renderFinally(),this._resetController(i),this._renderBreadcrumb(t,i,l)}},e.prototype._giveContainerGroup=function(t){var r=this._containerGroup;return r||(r=this._containerGroup=new LC,this._initEvents(r),this.group.add(r)),r.x=t.x,r.y=t.y,r},e.prototype._doRender=function(t,r,i){var a=r.getData().tree,s=this._oldTree,o=ig(),l=ig(),u=this._storage,c=[];function h(y,_,x,b){return Yce(r,l,u,i,o,c,y,_,x,b)}g(a.root?[a.root]:[],s&&s.root?[s.root]:[],t,a===s||!s,0);var f=v(u);if(this._oldTree=a,this._storage=l,this._controllerHost){var d=this.seriesModel.layoutInfo,p=a.root.getLayout();p.width===d.width&&p.height===d.height&&(this._controllerHost.zoom=1)}return{lastsForAnimation:o,willDeleteEls:f,renderFinally:m};function g(y,_,x,b,S){b?(_=y,z(y,function(C,A){!C.isRemoved()&&T(A,A)})):new Vl(_,y,w,w).add(T).update(T).remove(Rt(T,null)).execute();function w(C){return C.getId()}function T(C,A){var M=C!=null?y[C]:null,P=A!=null?_[A]:null,D=h(M,P,x,S);D&&g(M&&M.viewChildren||[],P&&P.viewChildren||[],D,b,S+1)}}function v(y){var _=ig();return y&&z(y,function(x,b){var S=_[b];z(x,function(w){w&&(S.push(w),Xx(w).willDelete=!0)})}),_}function m(){z(f,function(y){z(y,function(_){_.parent&&_.parent.remove(_)})}),z(c,function(y){y.invisible=!0,y.dirty()})}},e.prototype._doAnimation=function(t,r,i,a){var s=i.get("animationDurationUpdate"),o=i.get("animationEasing"),l=(ct(s)?0:s)||0,u=(ct(o)?null:o)||"cubicOut",c=Wce();z(r.willDeleteEls,function(h,f){z(h,function(d,p){if(!d.invisible){var g=d.parent,v,m=Xx(g);if(a&&a.direction==="drillDown")v=g===a.rootNodeGroup?{shape:{x:0,y:0,width:m.nodeWidth,height:m.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var y=0,_=0;m.willDelete||(y=m.nodeWidth/2,_=m.nodeHeight/2),v=f==="nodeGroup"?{x:y,y:_,style:{opacity:0}}:{shape:{x:y,y:_,width:0,height:0},style:{opacity:0}}}v&&c.add(d,v,l,0,u)}})}),z(this._storage,function(h,f){z(h,function(d,p){var g=r.lastsForAnimation[f][p],v={};g&&(d instanceof bt?g.oldX!=null&&(v.x=d.x,v.y=d.y,d.x=g.oldX,d.y=g.oldY):(g.oldShape&&(v.shape=Pe({},d.shape),d.setShape(g.oldShape)),g.fadein?(d.setStyle("opacity",0),v.style={opacity:1}):d.style.opacity!==1&&(v.style={opacity:1})),c.add(d,v,l,0,u))})},this),this._state="animating",c.finished(Qe(function(){this._state="ready",r.renderFinally()},this)).start()},e.prototype._resetController=function(t){var r=this._controller,i=this._controllerHost;i||(this._controllerHost={target:this.group},i=this._controllerHost),r||(r=this._controller=new $0(t.getZr()),r.enable(this.seriesModel.get("roam")),i.zoomLimit=this.seriesModel.get("scaleLimit"),i.zoom=this.seriesModel.get("zoom"),r.on("pan",Qe(this._onPan,this)),r.on("zoom",Qe(this._onZoom,this)));var a=new Ot(0,0,t.getWidth(),t.getHeight());r.setPointerChecker(function(s,o,l){return a.contain(o,l)})},e.prototype._clearController=function(){var t=this._controller;this._controllerHost=null,t&&(t.dispose(),t=null)},e.prototype._onPan=function(t){if(this._state!=="animating"&&(Math.abs(t.dx)>Vk||Math.abs(t.dy)>Vk)){var r=this.seriesModel.getData().tree.root;if(!r)return;var i=r.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 r=t.originX,i=t.originY,a=t.scale;if(this._state!=="animating"){var s=this.seriesModel.getData().tree.root;if(!s)return;var o=s.getLayout();if(!o)return;var l=new Ot(o.x,o.y,o.width,o.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;r-=g.x,i-=g.y;var v=Za();Ko(v,v,[-r,-i]),xP(v,v,[p,p]),Ko(v,v,[r,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 r=this;t.on("click",function(i){if(r._state==="ready"){var a=r.seriesModel.get("nodeClick",!0);if(a){var s=r.findTarget(i.offsetX,i.offsetY);if(s){var o=s.node;if(o.getLayout().isLeafRoot)r._rootToNode(s);else if(a==="zoomToNode")r._zoomToNode(s);else if(a==="link"){var l=o.hostTree.data.getItemModel(o.dataIndex),u=l.get("link",!0),c=l.get("target",!0)||"blank";u&&Rx(u,c)}}}}},this)},e.prototype._renderBreadcrumb=function(t,r,i){var a=this;i||(i=t.get("leafDepth",!0)!=null?{node:t.getViewRoot()}:this.findTarget(r.getWidth()/2,r.getHeight()/2),i||(i={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new Vce(this.group))).render(t,r,i.node,function(s){a._state!=="animating"&&(IL(t.getViewRoot(),s)?a._rootToNode({node:s}):a._zoomToNode({node:s}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=ig(),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,r){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(s){var o=this._storage.background[s.getRawIndex()];if(o){var l=o.transformCoordToLocal(t,r),u=o.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:s,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}($n);function ig(){return{nodeGroup:[],background:[],content:[]}}function Yce(n,e,t,r,i,a,s,o,l,u){if(!s)return;var c=s.getLayout(),h=n.getData(),f=s.getModel();if(h.setItemGraphicEl(s.dataIndex,null),!c||!c.isInView)return;var d=c.width,p=c.height,g=c.borderWidth,v=c.invisible,m=s.getRawIndex(),y=o&&o.getRawIndex(),_=s.viewChildren,x=c.upperHeight,b=_&&_.length,S=f.getModel("itemStyle"),w=f.getModel(["emphasis","itemStyle"]),T=f.getModel(["blur","itemStyle"]),C=f.getModel(["select","itemStyle"]),A=S.get("borderRadius")||0,M=re("nodeGroup",LC);if(!M)return;if(l.add(M),M.x=c.x||0,M.y=c.y||0,M.markRedraw(),Xx(M).nodeWidth=d,Xx(M).nodeHeight=p,c.isAboveViewRoot)return M;var P=re("background",Uk,u,jce);P&&U(M,P,b&&c.upperLabelHeight);var D=f.getModel("emphasis"),L=D.get("focus"),R=D.get("blurScope"),N=D.get("disabled"),F=L==="ancestor"?s.getAncestorsIndices():L==="descendant"?s.getDescendantIndices():L;if(b)Vm(M)&&Ph(M,!1),P&&(Ph(P,!N),h.setItemGraphicEl(s.dataIndex,P),KT(P,F,R));else{var O=re("content",Uk,u,qce);O&&$(M,O),P.disableMorphing=!0,P&&Vm(P)&&Ph(P,!1),Ph(M,!N),h.setItemGraphicEl(s.dataIndex,M);var H=f.getShallow("cursor");H&&O.attr("cursor",H),KT(M,F,R)}return M;function U(Ce,Ae,ze){var fe=St(Ae);if(fe.dataIndex=s.dataIndex,fe.seriesIndex=n.seriesIndex,Ae.setShape({x:0,y:0,width:d,height:p,r:A}),v)Y(Ae);else{Ae.invisible=!1;var j=s.getVisual("style"),xe=j.stroke,pe=$k(S);pe.fill=xe;var we=fh(w);we.fill=w.get("borderColor");var V=fh(T);V.fill=T.get("borderColor");var ee=fh(C);if(ee.fill=C.get("borderColor"),ze){var ae=d-2*g;oe(Ae,xe,j.opacity,{x:g,y:0,width:ae,height:x})}else Ae.removeTextContent();Ae.setStyle(pe),Ae.ensureState("emphasis").style=we,Ae.ensureState("blur").style=V,Ae.ensureState("select").style=ee,cf(Ae)}Ce.add(Ae)}function $(Ce,Ae){var ze=St(Ae);ze.dataIndex=s.dataIndex,ze.seriesIndex=n.seriesIndex;var fe=Math.max(d-2*g,0),j=Math.max(p-2*g,0);if(Ae.culling=!0,Ae.setShape({x:g,y:g,width:fe,height:j,r:A}),v)Y(Ae);else{Ae.invisible=!1;var xe=s.getVisual("style"),pe=xe.fill,we=$k(S);we.fill=pe,we.decal=xe.decal;var V=fh(w),ee=fh(T),ae=fh(C);oe(Ae,pe,xe.opacity,null),Ae.setStyle(we),Ae.ensureState("emphasis").style=V,Ae.ensureState("blur").style=ee,Ae.ensureState("select").style=ae,cf(Ae)}Ce.add(Ae)}function Y(Ce){!Ce.invisible&&a.push(Ce)}function oe(Ce,Ae,ze,fe){var j=f.getModel(fe?Wk:Hk),xe=Yr(f.get("name"),null),pe=j.getShallow("show");Ei(Ce,ri(f,fe?Wk:Hk),{defaultText:pe?xe:null,inheritColor:Ae,defaultOpacity:ze,labelFetcher:n,labelDataIndex:s.dataIndex});var we=Ce.getTextContent();if(we){var V=we.style,ee=mP(V.padding||0);fe&&(Ce.setTextConfig({layoutRect:fe}),we.disableLabelLayout=!0),we.beforeUpdate=function(){var I=Math.max((fe?fe.width:Ce.shape.width)-ee[1]-ee[3],0),G=Math.max((fe?fe.height:Ce.shape.height)-ee[0]-ee[2],0);(V.width!==I||V.height!==G)&&we.setStyle({width:I,height:G})},V.truncateMinChar=2,V.lineOverflow="truncate",X(V,fe,c);var ae=we.getState("emphasis");X(ae?ae.style:null,fe,c)}}function X(Ce,Ae,ze){var fe=Ce?Ce.text:null;if(!Ae&&ze.isLeafRoot&&fe!=null){var j=n.get("drillDownIcon",!0);Ce.text=j?j+" "+fe:fe}}function re(Ce,Ae,ze,fe){var j=y!=null&&t[Ce][y],xe=i[Ce];return j?(t[Ce][y]=null,_e(xe,j)):v||(j=new Ae,j instanceof Os&&(j.z2=Kce(ze,fe)),Fe(xe,j)),e[Ce][m]=j}function _e(Ce,Ae){var ze=Ce[m]={};Ae instanceof LC?(ze.oldX=Ae.x,ze.oldY=Ae.y):ze.oldShape=Pe({},Ae.shape)}function Fe(Ce,Ae){var ze=Ce[m]={},fe=s.parentNode,j=Ae instanceof bt;if(fe&&(!r||r.direction==="drillDown")){var xe=0,pe=0,we=i.background[fe.getRawIndex()];!r&&we&&we.oldShape&&(xe=we.oldShape.width,pe=we.oldShape.height),j?(ze.oldX=0,ze.oldY=pe):ze.oldShape={x:xe,y:pe,width:0,height:0}}ze.fadein=!j}}function Kce(n,e){return n*$ce+e}const Zce=Xce;var t0=z,Qce=gt,Yx=-1,NL=function(){function n(e){var t=e.mappingMethod,r=e.type,i=this.option=yt(e);this.type=r,this.mappingMethod=t,this._normalizeData=the[t];var a=n.visualHandlers[r];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[t],t==="piecewise"?(tM(i),Jce(i)):t==="category"?i.categories?ehe(i):tM(i,!0):(sa(t!=="linear"||i.dataExtent),tM(i))}return n.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},n.prototype.getNormalizer=function(){return Qe(this._normalizeData,this)},n.listVisualTypes=function(){return Yt(n.visualHandlers)},n.isValidType=function(e){return n.visualHandlers.hasOwnProperty(e)},n.eachVisual=function(e,t,r){gt(e)?z(e,t,r):t.call(r,e)},n.mapVisual=function(e,t,r){var i,a=Ie(e)?[]:gt(e)?{}:(i=!0,null);return n.eachVisual(e,function(s,o){var l=t.call(r,s,o);i?a=l:a[o]=l}),a},n.retrieveVisuals=function(e){var t={},r;return e&&t0(n.visualHandlers,function(i,a){e.hasOwnProperty(a)&&(t[a]=e[a],r=!0)}),r?t:null},n.prepareVisualTypes=function(e){if(Ie(e))e=e.slice();else if(Qce(e)){var t=[];t0(e,function(r,i){t.push(i)}),e=t}else return[];return e.sort(function(r,i){return i==="color"&&r!=="color"&&r.indexOf("color")===0?1:-1}),e},n.dependsOn=function(e,t){return t==="color"?!!(e&&e.indexOf(t)===0):e===t},n.findPieceIndex=function(e,t,r){for(var i,a=1/0,s=0,o=t.length;s<o;s++){var l=t[s].value;if(l!=null){if(l===e||Ke(l)&&l===e+"")return s;r&&f(l,s)}}for(var s=0,o=t.length;s<o;s++){var u=t[s],c=u.interval,h=u.close;if(c){if(c[0]===-1/0){if(a_(h[1],e,c[1]))return s}else if(c[1]===1/0){if(a_(h[0],c[0],e))return s}else if(a_(h[0],c[0],e)&&a_(h[1],e,c[1]))return s;r&&f(c[0],s),r&&f(c[1],s)}}if(r)return e===1/0?t.length-1:e===-1/0?0:i;function f(d,p){var g=Math.abs(d-e);g<a&&(a=g,i=p)}},n.visualHandlers={color:{applyVisual:ag("color"),getColorMapper:function(){var e=this.option;return Qe(e.mappingMethod==="category"?function(t,r){return!r&&(t=this._normalizeData(t)),Gg.call(this,t)}:function(t,r,i){var a=!!i;return!r&&(t=this._normalizeData(t)),i=kw(t,e.parsedVisual,i),a?i:Il(i,"rgba")},this)},_normalizedToVisual:{linear:function(e){return Il(kw(e,this.option.parsedVisual),"rgba")},category:Gg,piecewise:function(e,t){var r=DC.call(this,t);return r==null&&(r=Il(kw(e,this.option.parsedVisual),"rgba")),r},fixed:dh}},colorHue:i_(function(e,t){return Qg(e,t)}),colorSaturation:i_(function(e,t){return Qg(e,null,t)}),colorLightness:i_(function(e,t){return Qg(e,null,null,t)}),colorAlpha:i_(function(e,t){return yx(e,t)}),decal:{applyVisual:ag("decal"),_normalizedToVisual:{linear:null,category:Gg,piecewise:null,fixed:null}},opacity:{applyVisual:ag("opacity"),_normalizedToVisual:RC([0,1])},liftZ:{applyVisual:ag("liftZ"),_normalizedToVisual:{linear:dh,category:dh,piecewise:dh,fixed:dh}},symbol:{applyVisual:function(e,t,r){var i=this.mapValueToVisual(e);r("symbol",i)},_normalizedToVisual:{linear:jk,category:Gg,piecewise:function(e,t){var r=DC.call(this,t);return r==null&&(r=jk.call(this,e)),r},fixed:dh}},symbolSize:{applyVisual:ag("symbolSize"),_normalizedToVisual:RC([0,1])}},n}();function Jce(n){var e=n.pieceList;n.hasSpecialVisual=!1,z(e,function(t,r){t.originIndex=r,t.visual!=null&&(n.hasSpecialVisual=!0)})}function ehe(n){var e=n.categories,t=n.categoryMap={},r=n.visual;if(t0(e,function(s,o){t[s]=o}),!Ie(r)){var i=[];gt(r)?t0(r,function(s,o){var l=t[o];i[l!=null?l:Yx]=s}):i[Yx]=r,r=GH(n,i)}for(var a=e.length-1;a>=0;a--)r[a]==null&&(delete t[e[a]],e.pop())}function tM(n,e){var t=n.visual,r=[];gt(t)?t0(t,function(a){r.push(a)}):t!=null&&r.push(t);var i={color:1,symbol:1};!e&&r.length===1&&!i.hasOwnProperty(n.type)&&(r[1]=r[0]),GH(n,r)}function i_(n){return{applyVisual:function(e,t,r){var i=this.mapValueToVisual(e);r("color",n(t("color"),i))},_normalizedToVisual:RC([0,1])}}function jk(n){var e=this.option.visual;return e[Math.round(Sn(n,[0,1],[0,e.length-1],!0))]||{}}function ag(n){return function(e,t,r){r(n,this.mapValueToVisual(e))}}function Gg(n){var e=this.option.visual;return e[this.option.loop&&n!==Yx?n%e.length:n]}function dh(){return this.option.visual[0]}function RC(n){return{linear:function(e){return Sn(e,n,this.option.visual,!0)},category:Gg,piecewise:function(e,t){var r=DC.call(this,t);return r==null&&(r=Sn(e,n,this.option.visual,!0)),r},fixed:dh}}function DC(n){var e=this.option,t=e.pieceList;if(e.hasSpecialVisual){var r=NL.findPieceIndex(n,t),i=t[r];if(i&&i.visual)return i.visual[this.type]}}function GH(n,e){return n.visual=e,n.type==="color"&&(n.parsedVisual=Ne(e,function(t){var r=Qa(t);return r||[0,0,0,1]})),e}var the={linear:function(n){return Sn(n,this.option.dataExtent,[0,1],!0)},piecewise:function(n){var e=this.option.pieceList,t=NL.findPieceIndex(n,e,!0);if(t!=null)return Sn(t,[0,e.length-1],[0,1],!0)},category:function(n){var e=this.option.categories?this.option.categoryMap[n]:n;return e==null?Yx:e},fixed:Er};function a_(n,e,t){return n?e<=t:e<t}const Ti=NL;var nhe="itemStyle",zH=en();const rhe={seriesType:"treemap",reset:function(n){var e=n.getData().tree,t=e.root;t.isRemoved()||UH(t,{},n.getViewRoot().getAncestors(),n)}};function UH(n,e,t,r){var i=n.getModel(),a=n.getLayout(),s=n.hostTree.data;if(!(!a||a.invisible||!a.isInView)){var o=i.getModel(nhe),l=ihe(o,e,r),u=s.ensureUniqueItemVisual(n.dataIndex,"style"),c=o.get("borderColor"),h=o.get("borderColorSaturation"),f;h!=null&&(f=qk(l),c=ahe(h,f)),u.stroke=c;var d=n.viewChildren;if(!d||!d.length)f=qk(l),u.fill=f;else{var p=she(n,i,a,o,l,d);z(d,function(g,v){if(g.depth>=t.length||g===t[g.depth]){var m=ohe(i,l,g,v,p,r);UH(g,m,t,r)}})}}}function ihe(n,e,t){var r=Pe({},e),i=t.designatedVisualItemStyle;return z(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var s=n.get(a);i[a]=null,s!=null&&(r[a]=s)}),r}function qk(n){var e=nM(n,"color");if(e){var t=nM(n,"colorAlpha"),r=nM(n,"colorSaturation");return r&&(e=Qg(e,null,null,r)),t&&(e=yx(e,t)),e}}function ahe(n,e){return e!=null?Qg(e,null,null,n):null}function nM(n,e){var t=n[e];if(t!=null&&t!=="none")return t}function she(n,e,t,r,i,a){if(!(!a||!a.length)){var s=rM(e,"color")||i.color!=null&&i.color!=="none"&&(rM(e,"colorAlpha")||rM(e,"colorSaturation"));if(s){var o=e.get("visualMin"),l=e.get("visualMax"),u=t.dataExtent.slice();o!=null&&o<u[0]&&(u[0]=o),l!=null&&l>u[1]&&(u[1]=l);var c=e.get("colorMappingBy"),h={type:s.name,dataExtent:u,visual:s.range};h.type==="color"&&(c==="index"||c==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var f=new Ti(h);return zH(f).drColorMappingBy=c,f}}}function rM(n,e){var t=n.get(e);return Ie(t)&&t.length?{name:e,range:t}:null}function ohe(n,e,t,r,i,a){var s=Pe({},e);if(i){var o=i.type,l=o==="color"&&zH(i).drColorMappingBy,u=l==="index"?r:l==="id"?a.mapIdToIndex(t.getId()):t.getValue(n.get("visualDimension"));s[o]=i.mapValueToVisual(u)}return s}var n0=Math.max,Kx=Math.min,Xk=di,kL=z,VH=["itemStyle","borderWidth"],lhe=["itemStyle","gapWidth"],uhe=["upperLabel","show"],che=["upperLabel","height"];const hhe={seriesType:"treemap",reset:function(n,e,t,r){var i=t.getWidth(),a=t.getHeight(),s=n.option,o=Kr(n.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),l=s.size||[],u=Xe(Xk(o.width,l[0]),i),c=Xe(Xk(o.height,l[1]),a),h=r&&r.type,f=["treemapZoomToNode","treemapRootToNode"],d=e0(r,f,n),p=h==="treemapRender"||h==="treemapMove"?r.rootRect:null,g=n.getViewRoot(),v=OH(g);if(h!=="treemapMove"){var m=h==="treemapZoomToNode"?mhe(n,d,g,u,c):p?[p.width,p.height]:[u,c],y=s.sort;y&&y!=="asc"&&y!=="desc"&&(y="desc");var _={squareRatio:s.squareRatio,sort:y,leafDepth:s.leafDepth};g.hostTree.clearLayouts();var x={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};g.setLayout(x),HH(g,_,!1,0),x=g.getLayout(),kL(v,function(S,w){var T=(v[w+1]||g).getValue();S.setLayout(Pe({dataExtent:[T,T],borderWidth:0,upperHeight:0},x))})}var b=n.getData().tree.root;b.setLayout(yhe(o,p,d),!0),n.setLayoutInfo(o),WH(b,new Ot(-o.x,-o.y,i,a),v,g,0)}};function HH(n,e,t,r){var i,a;if(!n.isRemoved()){var s=n.getLayout();i=s.width,a=s.height;var o=n.getModel(),l=o.get(VH),u=o.get(lhe)/2,c=$H(o),h=Math.max(l,c),f=l-u,d=h-u;n.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0),i=n0(i-2*f,0),a=n0(a-f-d,0);var p=i*a,g=fhe(n,o,p,e,t,r);if(g.length){var v={x:f,y:d,width:i,height:a},m=Kx(i,a),y=1/0,_=[];_.area=0;for(var x=0,b=g.length;x<b;){var S=g[x];_.push(S),_.area+=S.getLayout().area;var w=ghe(_,m,e.squareRatio);w<=y?(x++,y=w):(_.area-=_.pop().getLayout().area,Yk(_,m,v,u,!1),m=Kx(v.width,v.height),_.length=_.area=0,y=1/0)}if(_.length&&Yk(_,m,v,u,!0),!t){var T=o.get("childrenVisibleMin");T!=null&&p<T&&(t=!0)}for(var x=0,b=g.length;x<b;x++)HH(g[x],e,t,r+1)}}}function fhe(n,e,t,r,i,a){var s=n.children||[],o=r.sort;o!=="asc"&&o!=="desc"&&(o=null);var l=r.leafDepth!=null&&r.leafDepth<=a;if(i&&!l)return n.viewChildren=[];s=_n(s,function(d){return!d.isRemoved()}),phe(s,o);var u=vhe(e,s,o);if(u.sum===0)return n.viewChildren=[];if(u.sum=dhe(e,t,u.sum,o,s),u.sum===0)return n.viewChildren=[];for(var c=0,h=s.length;c<h;c++){var f=s[c].getValue()/u.sum*t;s[c].setLayout({area:f})}return l&&(s.length&&n.setLayout({isLeafRoot:!0},!0),s.length=0),n.viewChildren=s,n.setLayout({dataExtent:u.dataExtent},!0),s}function dhe(n,e,t,r,i){if(!r)return t;for(var a=n.get("visibleMin"),s=i.length,o=s,l=s-1;l>=0;l--){var u=i[r==="asc"?s-l-1:l].getValue();u/t*e<a&&(o=l,t-=u)}return r==="asc"?i.splice(0,s-o):i.splice(o,s-o),t}function phe(n,e){return e&&n.sort(function(t,r){var i=e==="asc"?t.getValue()-r.getValue():r.getValue()-t.getValue();return i===0?e==="asc"?t.dataIndex-r.dataIndex:r.dataIndex-t.dataIndex:i}),n}function vhe(n,e,t){for(var r=0,i=0,a=e.length;i<a;i++)r+=e[i].getValue();var s=n.get("visualDimension"),o;return!e||!e.length?o=[NaN,NaN]:s==="value"&&t?(o=[e[e.length-1].getValue(),e[0].getValue()],t==="asc"&&o.reverse()):(o=[1/0,-1/0],kL(e,function(l){var u=l.getValue(s);u<o[0]&&(o[0]=u),u>o[1]&&(o[1]=u)})),{sum:r,dataExtent:o}}function ghe(n,e,t){for(var r=0,i=1/0,a=0,s=void 0,o=n.length;a<o;a++)s=n[a].getLayout().area,s&&(s<i&&(i=s),s>r&&(r=s));var l=n.area*n.area,u=e*e*t;return l?n0(u*r/l,l/(u*i)):1/0}function Yk(n,e,t,r,i){var a=e===t.width?0:1,s=1-a,o=["x","y"],l=["width","height"],u=t[o[a]],c=e?n.area/e:0;(i||c>t[l[s]])&&(c=t[l[s]]);for(var h=0,f=n.length;h<f;h++){var d=n[h],p={},g=c?d.getLayout().area/c:0,v=p[l[s]]=n0(c-2*r,0),m=t[o[a]]+t[l[a]]-u,y=h===f-1||m<g?m:g,_=p[l[a]]=n0(y-2*r,0);p[o[s]]=t[o[s]]+Kx(r,v/2),p[o[a]]=u+Kx(r,_/2),u+=y,d.setLayout(p,!0)}t[o[s]]+=c,t[l[s]]-=c}function mhe(n,e,t,r,i){var a=(e||{}).node,s=[r,i];if(!a||a===t)return s;for(var o,l=r*i,u=l*n.option.zoomToNodeRatio;o=a.parentNode;){for(var c=0,h=o.children,f=0,d=h.length;f<d;f++)c+=h[f].getValue();var p=a.getValue();if(p===0)return s;u*=c/p;var g=o.getModel(),v=g.get(VH),m=Math.max(v,$H(g));u+=4*v*v+(3*v+m)*Math.pow(u,.5),u>oI&&(u=oI),a=o}u<l&&(u=l);var y=Math.pow(u/l,.5);return[r*y,i*y]}function yhe(n,e,t){if(e)return{x:e.x,y:e.y};var r={x:0,y:0};if(!t)return r;var i=t.node,a=i.getLayout();if(!a)return r;for(var s=[a.width/2,a.height/2],o=i;o;){var l=o.getLayout();s[0]+=l.x,s[1]+=l.y,o=o.parentNode}return{x:n.width/2-s[0],y:n.height/2-s[1]}}function WH(n,e,t,r,i){var a=n.getLayout(),s=t[i],o=s&&s===n;if(!(s&&!o||i===t.length&&n!==r)){n.setLayout({isInView:!0,invisible:!o&&!e.intersect(a),isAboveViewRoot:o},!0);var l=new Ot(e.x-a.x,e.y-a.y,e.width,e.height);kL(n.viewChildren||[],function(u){WH(u,l,t,r,i+1)})}}function $H(n){return n.get(uhe)?n.get(che):0}function _he(n){n.registerSeriesModel(Fce),n.registerChartView(Zce),n.registerVisual(rhe),n.registerLayout(hhe),Nce(n)}function xhe(n){var e=n.findComponents({mainType:"legend"});!e||!e.length||n.eachSeriesByType("graph",function(t){var r=t.getCategoriesData(),i=t.getGraph(),a=i.data,s=r.mapArray(r.getName);a.filterSelf(function(o){var l=a.getItemModel(o),u=l.getShallow("category");if(u!=null){un(u)&&(u=s[u]);for(var c=0;c<e.length;c++)if(!e[c].isSelected(u))return!1}return!0})})}function bhe(n){var e={};n.eachSeriesByType("graph",function(t){var r=t.getCategoriesData(),i=t.getData(),a={};r.each(function(s){var o=r.getName(s);a["ec-"+o]=s;var l=r.getItemModel(s),u=l.getModel("itemStyle").getItemStyle();u.fill||(u.fill=t.getColorFromPalette(o,e)),r.setItemVisual(s,"style",u);for(var c=["symbol","symbolSize","symbolKeepAspect"],h=0;h<c.length;h++){var f=l.getShallow(c[h],!0);f!=null&&r.setItemVisual(s,c[h],f)}}),r.count()&&i.each(function(s){var o=i.getItemModel(s),l=o.getShallow("category");if(l!=null){Ke(l)&&(l=a["ec-"+l]);var u=r.getItemVisual(l,"style"),c=i.ensureUniqueItemVisual(s,"style");Pe(c,u);for(var h=["symbol","symbolSize","symbolKeepAspect"],f=0;f<h.length;f++)i.setItemVisual(s,h[f],r.getItemVisual(l,h[f]))}})})}function s_(n){return n instanceof Array||(n=[n,n]),n}function She(n){n.eachSeriesByType("graph",function(e){var t=e.getGraph(),r=e.getEdgeData(),i=s_(e.get("edgeSymbol")),a=s_(e.get("edgeSymbolSize"));r.setVisual("fromSymbol",i&&i[0]),r.setVisual("toSymbol",i&&i[1]),r.setVisual("fromSymbolSize",a&&a[0]),r.setVisual("toSymbolSize",a&&a[1]),r.setVisual("style",e.getModel("lineStyle").getLineStyle()),r.each(function(s){var o=r.getItemModel(s),l=t.getEdgeByIndex(s),u=s_(o.getShallow("symbol",!0)),c=s_(o.getShallow("symbolSize",!0)),h=o.getModel("lineStyle").getLineStyle(),f=r.ensureUniqueItemVisual(s,"style");switch(Pe(f,h),f.stroke){case"source":{var d=l.node1.getVisual("style");f.stroke=d&&d.fill;break}case"target":{var d=l.node2.getVisual("style");f.stroke=d&&d.fill;break}}u[0]&&l.setVisual("fromSymbol",u[0]),u[1]&&l.setVisual("toSymbol",u[1]),c[0]&&l.setVisual("fromSymbolSize",c[0]),c[1]&&l.setVisual("toSymbolSize",c[1])})})}var IC="-->",ES=function(n){return n.get("autoCurveness")||null},jH=function(n,e){var t=ES(n),r=20,i=[];if(un(t))r=t;else if(Ie(t)){n.__curvenessList=t;return}e>r&&(r=e);var a=r%2?r+2:r+3;i=[];for(var s=0;s<a;s++)i.push((s%2?s+1:s)/10*(s%2?-1:1));n.__curvenessList=i},r0=function(n,e,t){var r=[n.id,n.dataIndex].join("."),i=[e.id,e.dataIndex].join(".");return[t.uid,r,i].join(IC)},qH=function(n){var e=n.split(IC);return[e[0],e[2],e[1]].join(IC)},whe=function(n,e){var t=r0(n.node1,n.node2,e);return e.__edgeMap[t]},Ahe=function(n,e){var t=NC(r0(n.node1,n.node2,e),e),r=NC(r0(n.node2,n.node1,e),e);return t+r},NC=function(n,e){var t=e.__edgeMap;return t[n]?t[n].length:0};function Mhe(n){ES(n)&&(n.__curvenessList=[],n.__edgeMap={},jH(n))}function The(n,e,t,r){if(ES(t)){var i=r0(n,e,t),a=t.__edgeMap,s=a[qH(i)];a[i]&&!s?a[i].isForward=!0:s&&a[i]&&(s.isForward=!0,a[i].isForward=!1),a[i]=a[i]||[],a[i].push(r)}}function OL(n,e,t,r){var i=ES(e),a=Ie(i);if(!i)return null;var s=whe(n,e);if(!s)return null;for(var o=-1,l=0;l<s.length;l++)if(s[l]===t){o=l;break}var u=Ahe(n,e);jH(e,u),n.lineStyle=n.lineStyle||{};var c=r0(n.node1,n.node2,e),h=e.__curvenessList,f=a||u%2?0:1;if(s.isForward)return h[f+o];var d=qH(c),p=NC(d,e),g=h[o+p+f];return r?a?i&&i[0]===0?(p+f)%2?g:-g:((p%2?0:1)+f)%2?g:-g:(p+f)%2?g:-g:h[o+p+f]}function XH(n){var e=n.coordinateSystem;if(!(e&&e.type!=="view")){var t=n.getGraph();t.eachNode(function(r){var i=r.getModel();r.setLayout([+i.get("x"),+i.get("y")])}),FL(t,n)}}function FL(n,e){n.eachEdge(function(t,r){var i=Ho(t.getModel().get(["lineStyle","curveness"]),-OL(t,e,r,!0),0),a=Rl(t.node1.getLayout()),s=Rl(t.node2.getLayout()),o=[a,s];+i&&o.push([(a[0]+s[0])/2-(a[1]-s[1])*i,(a[1]+s[1])/2-(s[0]-a[0])*i]),t.setLayout(o)})}function Che(n,e){n.eachSeriesByType("graph",function(t){var r=t.get("layout"),i=t.coordinateSystem;if(i&&i.type!=="view"){var a=t.getData(),s=[];z(i.dimensions,function(f){s=s.concat(a.mapDimensionsAll(f))});for(var o=0;o<a.count();o++){for(var l=[],u=!1,c=0;c<s.length;c++){var h=a.get(s[c],o);isNaN(h)||(u=!0),l.push(h)}u?a.setItemLayout(o,i.dataToPoint(l)):a.setItemLayout(o,[NaN,NaN])}FL(a.graph,t)}else(!r||r==="none")&&XH(t)})}function zg(n){var e=n.coordinateSystem;if(e.type!=="view")return 1;var t=n.option.nodeScaleRatio,r=e.scaleX,i=e.getZoom(),a=(i-1)*t+1;return a/r}function Ug(n){var e=n.getVisual("symbolSize");return e instanceof Array&&(e=(e[0]+e[1])/2),+e}var Kk=Math.PI,iM=[];function BL(n,e,t,r){var i=n.coordinateSystem;if(!(i&&i.type!=="view")){var a=i.getBoundingRect(),s=n.getData(),o=s.graph,l=a.width/2+a.x,u=a.height/2+a.y,c=Math.min(a.width,a.height)/2,h=s.count();if(s.setLayout({cx:l,cy:u}),!!h){if(t){var f=i.pointToData(r),d=f[0],p=f[1],g=[d-l,p-u];$p(g,g),C1(g,g,c),t.setLayout([l+g[0],u+g[1]],!0);var v=n.get(["circular","rotateLabel"]);YH(t,v,l,u)}Ehe[e](n,o,s,c,l,u,h),o.eachEdge(function(m,y){var _=Ho(m.getModel().get(["lineStyle","curveness"]),OL(m,n,y),0),x=Rl(m.node1.getLayout()),b=Rl(m.node2.getLayout()),S,w=(x[0]+b[0])/2,T=(x[1]+b[1])/2;+_&&(_*=3,S=[l*_+w*(1-_),u*_+T*(1-_)]),m.setLayout([x,b,S])})}}}var Ehe={value:function(n,e,t,r,i,a,s){var o=0,l=t.getSum("value"),u=Math.PI*2/(l||s);e.eachNode(function(c){var h=c.getValue("value"),f=u*(l?h:1)/2;o+=f,c.setLayout([r*Math.cos(o)+i,r*Math.sin(o)+a]),o+=f})},symbolSize:function(n,e,t,r,i,a,s){var o=0;iM.length=s;var l=zg(n);e.eachNode(function(h){var f=Ug(h);isNaN(f)&&(f=2),f<0&&(f=0),f*=l;var d=Math.asin(f/2/r);isNaN(d)&&(d=Kk/2),iM[h.dataIndex]=d,o+=d*2});var u=(2*Kk-o)/s/2,c=0;e.eachNode(function(h){var f=u+iM[h.dataIndex];c+=f,(!h.getLayout()||!h.getLayout().fixed)&&h.setLayout([r*Math.cos(c)+i,r*Math.sin(c)+a]),c+=f})}};function YH(n,e,t,r){var i=n.getGraphicEl();if(i){var a=n.getModel(),s=a.get(["label","rotate"])||0,o=i.getSymbolPath();if(e){var l=n.getLayout(),u=Math.atan2(l[1]-r,l[0]-t);u<0&&(u=Math.PI*2+u);var c=l[0]<t;c&&(u=u-Math.PI);var h=c?"left":"right";o.setTextConfig({rotation:-u,position:h,origin:"center"});var f=o.ensureState("emphasis");Pe(f.textConfig||(f.textConfig={}),{position:h})}else o.setTextConfig({rotation:s*=Math.PI/180})}}function Phe(n){n.eachSeriesByType("graph",function(e){e.get("layout")==="circular"&&BL(e,"symbolSize")})}var Yf=xT;function Lhe(n,e,t){for(var r=n,i=e,a=t.rect,s=a.width,o=a.height,l=[a.x+s/2,a.y+o/2],u=t.gravity==null?.1:t.gravity,c=0;c<r.length;c++){var h=r[c];h.p||(h.p=bf(s*(Math.random()-.5)+l[0],o*(Math.random()-.5)+l[1])),h.pp=Rl(h.p),h.edges=null}var f=t.friction==null?.6:t.friction,d=f,p,g;return{warmUp:function(){d=f*.8},setFixed:function(v){r[v].fixed=!0},setUnfixed:function(v){r[v].fixed=!1},beforeStep:function(v){p=v},afterStep:function(v){g=v},step:function(v){p&&p(r,i);for(var m=[],y=r.length,_=0;_<i.length;_++){var x=i[_];if(!x.ignoreForceLayout){var b=x.n1,S=x.n2;Ch(m,S.p,b.p);var w=bT(m)-x.d,T=S.w/(b.w+S.w);isNaN(T)&&(T=0),$p(m,m),!b.fixed&&Yf(b.p,b.p,m,T*w*d),!S.fixed&&Yf(S.p,S.p,m,-(1-T)*w*d)}}for(var _=0;_<y;_++){var C=r[_];C.fixed||(Ch(m,l,C.p),Yf(C.p,C.p,m,u*d))}for(var _=0;_<y;_++)for(var b=r[_],A=_+1;A<y;A++){var S=r[A];Ch(m,S.p,b.p);var w=bT(m);w===0&&(OZ(m,Math.random()-.5,Math.random()-.5),w=1);var M=(b.rep+S.rep)/w/w;!b.fixed&&Yf(b.pp,b.pp,m,M),!S.fixed&&Yf(S.pp,S.pp,m,-M)}for(var P=[],_=0;_<y;_++){var C=r[_];C.fixed||(Ch(P,C.p,C.pp),Yf(C.p,C.p,P,d),Qi(C.pp,C.p))}d=d*.992;var D=d<.01;g&&g(r,i,D),v&&v(D)}}}function Rhe(n){n.eachSeriesByType("graph",function(e){var t=e.coordinateSystem;if(!(t&&t.type!=="view"))if(e.get("layout")==="force"){var r=e.preservedPoints||{},i=e.getGraph(),a=i.data,s=i.edgeData,o=e.getModel("force"),l=o.get("initLayout");e.preservedPoints?a.each(function(_){var x=a.getId(_);a.setItemLayout(_,r[x]||[NaN,NaN])}):!l||l==="none"?XH(e):l==="circular"&&BL(e,"value");var u=a.getDataExtent("value"),c=s.getDataExtent("value"),h=o.get("repulsion"),f=o.get("edgeLength"),d=Ie(h)?h:[h,h],p=Ie(f)?f:[f,f];p=[p[1],p[0]];var g=a.mapArray("value",function(_,x){var b=a.getItemLayout(x),S=Sn(_,u,d);return isNaN(S)&&(S=(d[0]+d[1])/2),{w:S,rep:S,fixed:a.getItemModel(x).get("fixed"),p:!b||isNaN(b[0])||isNaN(b[1])?null:b}}),v=s.mapArray("value",function(_,x){var b=i.getEdgeByIndex(x),S=Sn(_,c,p);isNaN(S)&&(S=(p[0]+p[1])/2);var w=b.getModel(),T=Ho(b.getModel().get(["lineStyle","curveness"]),-OL(b,e,x,!0),0);return{n1:g[b.node1.dataIndex],n2:g[b.node2.dataIndex],d:S,curveness:T,ignoreForceLayout:w.get("ignoreForceLayout")}}),m=t.getBoundingRect(),y=Lhe(g,v,{rect:m,gravity:o.get("gravity"),friction:o.get("friction")});y.beforeStep(function(_,x){for(var b=0,S=_.length;b<S;b++)_[b].fixed&&Qi(_[b].p,i.getNodeByIndex(b).getLayout())}),y.afterStep(function(_,x,b){for(var S=0,w=_.length;S<w;S++)_[S].fixed||i.getNodeByIndex(S).setLayout(_[S].p),r[a.getId(S)]=_[S].p;for(var S=0,w=x.length;S<w;S++){var T=x[S],C=i.getEdgeByIndex(S),A=T.n1.p,M=T.n2.p,P=C.getLayout();P=P?P.slice():[],P[0]=P[0]||[],P[1]=P[1]||[],Qi(P[0],A),Qi(P[1],M),+T.curveness&&(P[2]=[(A[0]+M[0])/2-(A[1]-M[1])*T.curveness,(A[1]+M[1])/2-(M[0]-A[0])*T.curveness]),C.setLayout(P)}}),e.forceLayout=y,e.preservedPoints=r,y.step()}else e.forceLayout=null})}function Dhe(n,e,t){var r=Pe(n.getBoxLayoutParams(),{aspect:t});return Kr(r,{width:e.getWidth(),height:e.getHeight()})}function Ihe(n,e){var t=[];return n.eachSeriesByType("graph",function(r){var i=r.get("coordinateSystem");if(!i||i==="view"){var a=r.getData(),s=a.mapArray(function(v){var m=a.getItemModel(v);return[+m.get("x"),+m.get("y")]}),o=[],l=[];eS(s,o,l),l[0]-o[0]===0&&(l[0]+=1,o[0]-=1),l[1]-o[1]===0&&(l[1]+=1,o[1]-=1);var u=(l[0]-o[0])/(l[1]-o[1]),c=Dhe(r,e,u);isNaN(u)&&(o=[c.x,c.y],l=[c.x+c.width,c.y+c.height]);var h=l[0]-o[0],f=l[1]-o[1],d=c.width,p=c.height,g=r.coordinateSystem=new j0;g.zoomLimit=r.get("scaleLimit"),g.setBoundingRect(o[0],o[1],h,f),g.setViewRect(c.x,c.y,d,p),g.setCenter(r.get("center"),e),g.setZoom(r.get("zoom")),t.push(g)}}),t}var Zk=pi.prototype,aM=iS.prototype,KH=function(){function n(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return n}();(function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e})(KH);function sM(n){return isNaN(+n.cpx1)||isNaN(+n.cpy1)}var Nhe=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="ec-line",r}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new KH},e.prototype.buildPath=function(t,r){sM(r)?Zk.buildPath.call(this,t,r):aM.buildPath.call(this,t,r)},e.prototype.pointAt=function(t){return sM(this.shape)?Zk.pointAt.call(this,t):aM.pointAt.call(this,t)},e.prototype.tangentAt=function(t){var r=this.shape,i=sM(r)?[r.x2-r.x1,r.y2-r.y1]:aM.tangentAt.call(this,t);return $p(i,i)},e}(Ht);const khe=Nhe;var oM=["fromSymbol","toSymbol"];function Qk(n){return"_"+n+"Type"}function Jk(n,e,t){var r=e.getItemVisual(t,n);if(!r||r==="none")return r;var i=e.getItemVisual(t,n+"Size"),a=e.getItemVisual(t,n+"Rotate"),s=e.getItemVisual(t,n+"Offset"),o=e.getItemVisual(t,n+"KeepAspect"),l=iv(i),u=Tf(s||0,l);return r+l+u+(a||"")+(o||"")}function e5(n,e,t){var r=e.getItemVisual(t,n);if(!(!r||r==="none")){var i=e.getItemVisual(t,n+"Size"),a=e.getItemVisual(t,n+"Rotate"),s=e.getItemVisual(t,n+"Offset"),o=e.getItemVisual(t,n+"KeepAspect"),l=iv(i),u=Tf(s||0,l),c=Br(r,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,o);return c.__specifiedRotation=a==null||isNaN(a)?void 0:+a*Math.PI/180||0,c.name=n,c}}function Ohe(n){var e=new khe({name:"line",subPixelOptimize:!0});return kC(e.shape,n),e}function kC(n,e){n.x1=e[0][0],n.y1=e[0][1],n.x2=e[1][0],n.y2=e[1][1],n.percent=1;var t=e[2];t?(n.cpx1=t[0],n.cpy1=t[1]):(n.cpx1=NaN,n.cpy1=NaN)}var Fhe=function(n){ve(e,n);function e(t,r,i){var a=n.call(this)||this;return a._createLine(t,r,i),a}return e.prototype._createLine=function(t,r,i){var a=t.hostModel,s=t.getItemLayout(r),o=Ohe(s);o.shape.percent=0,Jn(o,{shape:{percent:1}},a,r),this.add(o),z(oM,function(l){var u=e5(l,t,r);this.add(u),this[Qk(l)]=Jk(l,t,r)},this),this._updateCommonStl(t,r,i)},e.prototype.updateData=function(t,r,i){var a=t.hostModel,s=this.childOfName("line"),o=t.getItemLayout(r),l={shape:{}};kC(l.shape,o),cn(s,l,a,r),z(oM,function(u){var c=Jk(u,t,r),h=Qk(u);if(this[h]!==c){this.remove(this.childOfName(u));var f=e5(u,t,r);this.add(f)}this[h]=c},this),this._updateCommonStl(t,r,i)},e.prototype.getLinePath=function(){return this.childAt(0)},e.prototype._updateCommonStl=function(t,r,i){var a=t.hostModel,s=this.childOfName("line"),o=i&&i.emphasisLineStyle,l=i&&i.blurLineStyle,u=i&&i.selectLineStyle,c=i&&i.labelStatesModels,h=i&&i.emphasisDisabled,f=i&&i.focus,d=i&&i.blurScope;if(!i||t.hasItemOption){var p=t.getItemModel(r),g=p.getModel("emphasis");o=g.getModel("lineStyle").getLineStyle(),l=p.getModel(["blur","lineStyle"]).getLineStyle(),u=p.getModel(["select","lineStyle"]).getLineStyle(),h=g.get("disabled"),f=g.get("focus"),d=g.get("blurScope"),c=ri(p)}var v=t.getItemVisual(r,"style"),m=v.stroke;s.useStyle(v),s.style.fill=null,s.style.strokeNoScale=!0,s.ensureState("emphasis").style=o,s.ensureState("blur").style=l,s.ensureState("select").style=u,z(oM,function(S){var w=this.childOfName(S);if(w){w.setColor(m),w.style.opacity=v.opacity;for(var T=0;T<oa.length;T++){var C=oa[T],A=s.getState(C);if(A){var M=A.style||{},P=w.ensureState(C),D=P.style||(P.style={});M.stroke!=null&&(D[w.__isEmptyBrush?"stroke":"fill"]=M.stroke),M.opacity!=null&&(D.opacity=M.opacity)}}w.markRedraw()}},this);var y=a.getRawValue(r);Ei(this,c,{labelDataIndex:r,labelFetcher:{getFormattedLabel:function(S,w){return a.getFormattedLabel(S,w,t.dataType)}},inheritColor:m||"#000",defaultOpacity:v.opacity,defaultText:(y==null?t.getName(r):isFinite(y)?xr(y):y)+""});var _=this.getTextContent();if(_){var x=c.normal;_.__align=_.style.align,_.__verticalAlign=_.style.verticalAlign,_.__position=x.get("position")||"middle";var b=x.get("distance");Ie(b)||(b=[b,b]),_.__labelDistance=b}this.setTextConfig({position:null,local:!0,inside:!1}),lr(this,f,d,h)},e.prototype.highlight=function(){zl(this)},e.prototype.downplay=function(){Ul(this)},e.prototype.updateLayout=function(t,r){this.setLinePoints(t.getItemLayout(r))},e.prototype.setLinePoints=function(t){var r=this.childOfName("line");kC(r.shape,t),r.dirty()},e.prototype.beforeUpdate=function(){var t=this,r=t.childOfName("fromSymbol"),i=t.childOfName("toSymbol"),a=t.getTextContent();if(!r&&!i&&(!a||a.ignore))return;for(var s=1,o=this.parent;o;)o.scaleX&&(s/=o.scaleX),o=o.parent;var l=t.childOfName("line");if(!this.__dirty&&!l.__dirty)return;var u=l.shape.percent,c=l.pointAt(0),h=l.pointAt(u),f=Ch([],h,c);$p(f,f);function d(A,M){var P=A.__specifiedRotation;if(P==null){var D=l.tangentAt(M);A.attr("rotation",(M===1?-1:1)*Math.PI/2-Math.atan2(D[1],D[0]))}else A.attr("rotation",P)}if(r&&(r.setPosition(c),d(r,0),r.scaleX=r.scaleY=s*u,r.markRedraw()),i&&(i.setPosition(h),d(i,1),i.scaleX=i.scaleY=s*u,i.markRedraw()),a&&!a.ignore){a.x=a.y=0,a.originX=a.originY=0;var p=void 0,g=void 0,v=a.__labelDistance,m=v[0]*s,y=v[1]*s,_=u/2,x=l.tangentAt(_),b=[x[1],-x[0]],S=l.pointAt(_);b[1]>0&&(b[0]=-b[0],b[1]=-b[1]);var w=x[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var T=-Math.atan2(x[1],x[0]);h[0]<c[0]&&(T=Math.PI+T),a.rotation=T}var C=void 0;switch(a.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":C=-y,g="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":C=y,g="top";break;default:C=0,g="middle"}switch(a.__position){case"end":a.x=f[0]*m+h[0],a.y=f[1]*y+h[1],p=f[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=S[0],a.y=S[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=s,a.setStyle({verticalAlign:a.__verticalAlign||g,align:a.__align||p})}},e}(bt);const GL=Fhe;var Bhe=function(){function n(e){this.group=new bt,this._LineCtor=e||GL}return n.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var r=this,i=r.group,a=r._lineData;r._lineData=e,a||i.removeAll();var s=t5(e);e.diff(a).add(function(o){t._doAdd(e,o,s)}).update(function(o,l){t._doUpdate(a,e,l,o,s)}).remove(function(o){i.remove(a.getItemGraphicEl(o))}).execute()},n.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,r){t.updateLayout(e,r)},this)},n.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=t5(e),this._lineData=null,this.group.removeAll()},n.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function r(o){!o.isGroup&&!Ghe(o)&&(o.incremental=!0,o.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i<e.end;i++){var a=t.getItemLayout(i);if(lM(a)){var s=new this._LineCtor(t,i,this._seriesScope);s.traverse(r),this.group.add(s),t.setItemGraphicEl(i,s),this._progressiveEls.push(s)}}},n.prototype.remove=function(){this.group.removeAll()},n.prototype.eachRendered=function(e){Sc(this._progressiveEls||this.group,e)},n.prototype._doAdd=function(e,t,r){var i=e.getItemLayout(t);if(lM(i)){var a=new this._LineCtor(e,t,r);e.setItemGraphicEl(t,a),this.group.add(a)}},n.prototype._doUpdate=function(e,t,r,i,a){var s=e.getItemGraphicEl(r);if(!lM(t.getItemLayout(i))){this.group.remove(s);return}s?s.updateData(t,i,a):s=new this._LineCtor(t,i,a),t.setItemGraphicEl(i,s),this.group.add(s)},n}();function Ghe(n){return n.animators&&n.animators.length>0}function t5(n){var e=n.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:ri(e)}}function n5(n){return isNaN(n[0])||isNaN(n[1])}function lM(n){return n&&!n5(n[0])&&!n5(n[1])}const zL=Bhe;var uM=[],cM=[],hM=[],Kf=fi,fM=Vh,r5=Math.abs;function i5(n,e,t){for(var r=n[0],i=n[1],a=n[2],s=1/0,o,l=t*t,u=.1,c=.1;c<=.9;c+=.1){uM[0]=Kf(r[0],i[0],a[0],c),uM[1]=Kf(r[1],i[1],a[1],c);var h=r5(fM(uM,e)-l);h<s&&(s=h,o=c)}for(var f=0;f<32;f++){var d=o+u;cM[0]=Kf(r[0],i[0],a[0],o),cM[1]=Kf(r[1],i[1],a[1],o),hM[0]=Kf(r[0],i[0],a[0],d),hM[1]=Kf(r[1],i[1],a[1],d);var h=fM(cM,e)-l;if(r5(h)<.01)break;var p=fM(hM,e)-l;u/=2,h<0?p>=0?o=o+u:o=o-u:p>=0?o=o-u:o=o+u}return o}function dM(n,e){var t=[],r=km,i=[[],[],[]],a=[[],[]],s=[];e/=2,n.eachEdge(function(o,l){var u=o.getLayout(),c=o.getVisual("fromSymbol"),h=o.getVisual("toSymbol");u.__original||(u.__original=[Rl(u[0]),Rl(u[1])],u[2]&&u.__original.push(Rl(u[2])));var f=u.__original;if(u[2]!=null){if(Qi(i[0],f[0]),Qi(i[1],f[2]),Qi(i[2],f[1]),c&&c!=="none"){var d=Ug(o.node1),p=i5(i,f[0],d*e);r(i[0][0],i[1][0],i[2][0],p,t),i[0][0]=t[3],i[1][0]=t[4],r(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=Ug(o.node2),p=i5(i,f[1],d*e);r(i[0][0],i[1][0],i[2][0],p,t),i[1][0]=t[1],i[2][0]=t[2],r(i[0][1],i[1][1],i[2][1],p,t),i[1][1]=t[1],i[2][1]=t[2]}Qi(u[0],i[0]),Qi(u[1],i[2]),Qi(u[2],i[1])}else{if(Qi(a[0],f[0]),Qi(a[1],f[1]),Ch(s,a[1],a[0]),$p(s,s),c&&c!=="none"){var d=Ug(o.node1);xT(a[0],a[0],s,d*e)}if(h&&h!=="none"){var d=Ug(o.node2);xT(a[1],a[1],s,-d*e)}Qi(u[0],a[0]),Qi(u[1],a[1])}})}function a5(n){return n.type==="view"}var zhe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){var i=new z0,a=new zL,s=this.group;this._controller=new $0(r.getZr()),this._controllerHost={target:s},s.add(i.group),s.add(a.group),this._symbolDraw=i,this._lineDraw=a,this._firstRender=!0},e.prototype.render=function(t,r,i){var a=this,s=t.coordinateSystem;this._model=t;var o=this._symbolDraw,l=this._lineDraw,u=this.group;if(a5(s)){var c={x:s.x,y:s.y,scaleX:s.scaleX,scaleY:s.scaleY};this._firstRender?u.attr(c):cn(u,c,t)}dM(t.getGraph(),zg(t));var h=t.getData();o.updateData(h);var f=t.getEdgeData();l.updateData(f),this._updateNodeAndLinkScale(),this._updateController(t,r,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,b=_.getGraphicEl(),S=_.getModel();if(b){b.off("drag").off("dragend");var w=S.get("draggable");w&&b.on("drag",function(C){switch(g){case"force":d.warmUp(),!a._layouting&&a._startForceLayoutIteration(d,p),d.setFixed(x),h.setItemLayout(x,[b.x,b.y]);break;case"circular":h.setItemLayout(x,[b.x,b.y]),_.setLayout({fixed:!0},!0),BL(t,"symbolSize",_,[C.offsetX,C.offsetY]),a.updateLayout(t);break;case"none":default:h.setItemLayout(x,[b.x,b.y]),FL(t.getGraph(),t),a.updateLayout(t);break}}).on("dragend",function(){d&&d.setUnfixed(x)}),b.setDraggable(w,!!S.get("cursor"));var T=S.get(["emphasis","focus"]);T==="adjacency"&&(St(b).focus=_.getAdjacentDataIndices())}}),h.graph.eachEdge(function(_){var x=_.getGraphicEl(),b=_.getModel().get(["emphasis","focus"]);x&&b==="adjacency"&&(St(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(_){YH(_,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,r){var i=this;(function a(){t.step(function(s){i.updateLayout(i._model),(i._layouting=!s)&&(r?i._layoutTimeout=setTimeout(a,16):a())})})()},e.prototype._updateController=function(t,r,i){var a=this,s=this._controller,o=this._controllerHost,l=this.group;if(s.setPointerChecker(function(u,c,h){var f=l.getBoundingRect();return f.applyTransform(l.transform),f.contain(c,h)&&!MS(u,i,t)}),!a5(t.coordinateSystem)){s.disable();return}s.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),s.off("pan").off("zoom").on("pan",function(u){CL(o,u.dx,u.dy),i.dispatchAction({seriesId:t.id,type:"graphRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){EL(o,u.scale,u.originX,u.originY),i.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(),dM(t.getGraph(),zg(t)),a._lineDraw.updateLayout(),i.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,r=t.getData(),i=zg(t);r.eachItemGraphicEl(function(a,s){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(t){dM(t.getGraph(),zg(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}($n);const Uhe=zhe;function Zf(n){return"_EC_"+n}var Vhe=function(){function n(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return n.prototype.isDirected=function(){return this._directed},n.prototype.addNode=function(e,t){e=e==null?""+t:""+e;var r=this._nodesMap;if(!r[Zf(e)]){var i=new ph(e,t);return i.hostGraph=this,this.nodes.push(i),r[Zf(e)]=i,i}},n.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},n.prototype.getNodeById=function(e){return this._nodesMap[Zf(e)]},n.prototype.addEdge=function(e,t,r){var i=this._nodesMap,a=this._edgesMap;if(un(e)&&(e=this.nodes[e]),un(t)&&(t=this.nodes[t]),e instanceof ph||(e=i[Zf(e)]),t instanceof ph||(t=i[Zf(t)]),!(!e||!t)){var s=e.id+"-"+t.id,o=new ZH(e,t,r);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),a[s]=o,o}},n.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},n.prototype.getEdge=function(e,t){e instanceof ph&&(e=e.id),t instanceof ph&&(t=t.id);var r=this._edgesMap;return this._directed?r[e+"-"+t]:r[e+"-"+t]||r[t+"-"+e]},n.prototype.eachNode=function(e,t){for(var r=this.nodes,i=r.length,a=0;a<i;a++)r[a].dataIndex>=0&&e.call(t,r[a],a)},n.prototype.eachEdge=function(e,t){for(var r=this.edges,i=r.length,a=0;a<i;a++)r[a].dataIndex>=0&&r[a].node1.dataIndex>=0&&r[a].node2.dataIndex>=0&&e.call(t,r[a],a)},n.prototype.breadthFirstTraverse=function(e,t,r,i){if(t instanceof ph||(t=this._nodesMap[Zf(t)]),!!t){for(var a=r==="out"?"outEdges":r==="in"?"inEdges":"edges",s=0;s<this.nodes.length;s++)this.nodes[s].__visited=!1;if(!e.call(i,t,null))for(var o=[t];o.length;)for(var l=o.shift(),u=l[a],s=0;s<u.length;s++){var c=u[s],h=c.node1===l?c.node2:c.node1;if(!h.__visited){if(e.call(i,h,l))return;o.push(h),h.__visited=!0}}}},n.prototype.update=function(){for(var e=this.data,t=this.edgeData,r=this.nodes,i=this.edges,a=0,s=r.length;a<s;a++)r[a].dataIndex=-1;for(var a=0,s=e.count();a<s;a++)r[e.getRawIndex(a)].dataIndex=a;t.filterSelf(function(o){var l=i[t.getRawIndex(o)];return l.node1.dataIndex>=0&&l.node2.dataIndex>=0});for(var a=0,s=i.length;a<s;a++)i[a].dataIndex=-1;for(var a=0,s=t.count();a<s;a++)i[t.getRawIndex(a)].dataIndex=a},n.prototype.clone=function(){for(var e=new n(this._directed),t=this.nodes,r=this.edges,i=0;i<t.length;i++)e.addNode(t[i].id,t[i].dataIndex);for(var i=0;i<r.length;i++){var a=r[i];e.addEdge(a.node1.id,a.node2.id,a.dataIndex)}return e},n}(),ph=function(){function n(e,t){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=e==null?"":e,this.dataIndex=t==null?-1:t}return n.prototype.degree=function(){return this.edges.length},n.prototype.inDegree=function(){return this.inEdges.length},n.prototype.outDegree=function(){return this.outEdges.length},n.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostGraph,r=t.data.getItemModel(this.dataIndex);return r.getModel(e)}},n.prototype.getAdjacentDataIndices=function(){for(var e={edge:[],node:[]},t=0;t<this.edges.length;t++){var r=this.edges[t];r.dataIndex<0||(e.edge.push(r.dataIndex),e.node.push(r.node1.dataIndex,r.node2.dataIndex))}return e},n.prototype.getTrajectoryDataIndices=function(){for(var e=st(),t=st(),r=0;r<this.edges.length;r++){var i=this.edges[r];if(!(i.dataIndex<0)){e.set(i.dataIndex,!0);for(var a=[i.node1],s=[i.node2],o=0;o<a.length;){var l=a[o];o++,t.set(l.dataIndex,!0);for(var u=0;u<l.inEdges.length;u++)e.set(l.inEdges[u].dataIndex,!0),a.push(l.inEdges[u].node1)}for(o=0;o<s.length;){var c=s[o];o++,t.set(c.dataIndex,!0);for(var u=0;u<c.outEdges.length;u++)e.set(c.outEdges[u].dataIndex,!0),s.push(c.outEdges[u].node2)}}}return{edge:e.keys(),node:t.keys()}},n}(),ZH=function(){function n(e,t,r){this.dataIndex=-1,this.node1=e,this.node2=t,this.dataIndex=r==null?-1:r}return n.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostGraph,r=t.edgeData.getItemModel(this.dataIndex);return r.getModel(e)}},n.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},n.prototype.getTrajectoryDataIndices=function(){var e=st(),t=st();e.set(this.dataIndex,!0);for(var r=[this.node1],i=[this.node2],a=0;a<r.length;){var s=r[a];a++,t.set(s.dataIndex,!0);for(var o=0;o<s.inEdges.length;o++)e.set(s.inEdges[o].dataIndex,!0),r.push(s.inEdges[o].node1)}for(a=0;a<i.length;){var l=i[a];a++,t.set(l.dataIndex,!0);for(var o=0;o<l.outEdges.length;o++)e.set(l.outEdges[o].dataIndex,!0),i.push(l.outEdges[o].node2)}return{edge:e.keys(),node:t.keys()}},n}();function QH(n,e){return{getValue:function(t){var r=this[n][e];return r.getStore().get(r.getDimensionIndex(t||"value"),this.dataIndex)},setVisual:function(t,r){this.dataIndex>=0&&this[n][e].setItemVisual(this.dataIndex,t,r)},getVisual:function(t){return this[n][e].getItemVisual(this.dataIndex,t)},setLayout:function(t,r){this.dataIndex>=0&&this[n][e].setItemLayout(this.dataIndex,t,r)},getLayout:function(){return this[n][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[n][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[n][e].getRawIndex(this.dataIndex)}}}zr(ph,QH("hostGraph","data"));zr(ZH,QH("hostGraph","edgeData"));const Hhe=Vhe;function JH(n,e,t,r,i){for(var a=new Hhe(r),s=0;s<n.length;s++)a.addNode(di(n[s].id,n[s].name,s),s);for(var o=[],l=[],u=0,s=0;s<e.length;s++){var c=e[s],h=c.source,f=c.target;a.addEdge(h,f,u)&&(l.push(c),o.push(di(Yr(c.id,null),h+" > "+f)),u++)}var d=t.get("coordinateSystem"),p;if(d==="cartesian2d"||d==="polar")p=Yl(n,t);else{var g=k0.get(d),v=g?g.dimensions||[]:[];Ft(v,"value")<0&&v.concat(["value"]);var m=F0(n,{coordDimensions:v,encodeDefine:t.getEncode()}).dimensions;p=new ia(m,t),p.initData(n)}var y=new ia(["value"],t);return y.initData(l,o),i&&i(p,y),NH({mainData:p,struct:a,structAttr:"graph",datas:{node:p,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var Whe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments);var r=this;function i(){return r._categoriesData}this.legendVisualProvider=new W0(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(t){n.prototype.mergeDefaultAndTheme.apply(this,arguments),of(t,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,r){var i=t.edges||t.links||[],a=t.data||t.nodes||[],s=this;if(a&&i){Mhe(this);var o=JH(a,i,this,!0,l);return z(o.edges,function(u){The(u.node1,u.node2,this,u.dataIndex)},this),o.data}function l(u,c){u.wrapMethod("getItemModel",function(p){var g=s._categoriesModels,v=p.getShallow("category"),m=g[v];return m&&(m.parentModel=p.parentModel,p.parentModel=m),p});var h=Wn.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,r,i){if(i==="edge"){var a=this.getData(),s=this.getDataParams(t,i),o=a.graph.getEdgeByIndex(t),l=a.getName(o.node1.dataIndex),u=a.getName(o.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),ii("nameValue",{name:c.join(" > "),value:s.value,noValue:s.value==null})}var h=mV({series:this,dataIndex:t,multipleSeries:r});return h},e.prototype._updateCategoriesData=function(){var t=Ne(this.option.categories||[],function(i){return i.value!=null?i:Pe({value:0},i)}),r=new ia(["value"],this);r.initData(t),this._categoriesData=r,this._categoriesModels=r.mapArray(function(i){return r.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 n.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}(rr);const $he=Whe;var jhe={type:"graphRoam",event:"graphRoam",update:"none"};function qhe(n){n.registerChartView(Uhe),n.registerSeriesModel($he),n.registerProcessor(xhe),n.registerVisual(bhe),n.registerVisual(She),n.registerLayout(Che),n.registerLayout(n.PRIORITY.VISUAL.POST_CHART_LAYOUT,Phe),n.registerLayout(Rhe),n.registerCoordinateSystem("graphView",{dimensions:j0.dimensions,create:Ihe}),n.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Er),n.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Er),n.registerAction(jhe,function(e,t,r){t.eachComponent({mainType:"series",query:e},function(i){var a=i.coordinateSystem,s=LL(a,e,void 0,r);i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}var Xhe=function(){function n(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return n}(),Yhe=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="pointer",r}return e.prototype.getDefaultShape=function(){return new Xhe},e.prototype.buildPath=function(t,r){var i=Math.cos,a=Math.sin,s=r.r,o=r.width,l=r.angle,u=r.x-i(l)*o*(o>=s/3?1:2),c=r.y-a(l)*o*(o>=s/3?1:2);l=r.angle-Math.PI/2,t.moveTo(u,c),t.lineTo(r.x+i(l)*o,r.y+a(l)*o),t.lineTo(r.x+i(r.angle)*s,r.y+a(r.angle)*s),t.lineTo(r.x-i(l)*o,r.y-a(l)*o),t.lineTo(u,c)},e}(Ht);const Khe=Yhe;function Zhe(n,e){var t=n.get("center"),r=e.getWidth(),i=e.getHeight(),a=Math.min(r,i),s=Xe(t[0],e.getWidth()),o=Xe(t[1],e.getHeight()),l=Xe(n.get("radius"),a/2);return{cx:s,cy:o,r:l}}function o_(n,e){var t=n==null?"":n+"";return e&&(Ke(e)?t=e.replace("{value}",t):ct(e)&&(t=e(n))),t}var Qhe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){this.group.removeAll();var a=t.get(["axisLine","lineStyle","color"]),s=Zhe(t,i);this._renderMain(t,r,i,a,s),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,r,i,a,s){var o=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?$x:La,p=h.get("show"),g=h.getModel("lineStyle"),v=g.get("width"),m=[u,c];LP(m,!l),u=m[0],c=m[1];for(var y=c-u,_=u,x=[],b=0;p&&b<a.length;b++){var S=Math.min(Math.max(a[b][0],0),1);c=u+y*S;var w=new d({shape:{startAngle:_,endAngle:c,cx:s.cx,cy:s.cy,clockwise:l,r0:s.r-v,r:s.r},silent:!0});w.setStyle({fill:a[b][1]}),w.setStyle(g.getLineStyle(["color","width"])),x.push(w),_=c}x.reverse(),z(x,function(C){return o.add(C)});var T=function(C){if(C<=0)return a[0][1];var A;for(A=0;A<a.length;A++)if(a[A][0]>=C&&(A===0?0:a[A-1][0])<C)return a[A][1];return a[A-1][1]};this._renderTicks(t,r,i,T,s,u,c,l,v),this._renderTitleAndDetail(t,r,i,T,s),this._renderAnchor(t,s),this._renderPointer(t,r,i,T,s,u,c,l,v)},e.prototype._renderTicks=function(t,r,i,a,s,o,l,u,c){for(var h=this.group,f=s.cx,d=s.cy,p=s.r,g=+t.get("min"),v=+t.get("max"),m=t.getModel("splitLine"),y=t.getModel("axisTick"),_=t.getModel("axisLabel"),x=t.get("splitNumber"),b=y.get("splitNumber"),S=Xe(m.get("length"),p),w=Xe(y.get("length"),p),T=o,C=(l-o)/x,A=C/b,M=m.getModel("lineStyle").getLineStyle(),P=y.getModel("lineStyle").getLineStyle(),D=m.get("distance"),L,R,N=0;N<=x;N++){if(L=Math.cos(T),R=Math.sin(T),m.get("show")){var F=D?D+c:c,O=new pi({shape:{x1:L*(p-F)+f,y1:R*(p-F)+d,x2:L*(p-S-F)+f,y2:R*(p-S-F)+d},style:M,silent:!0});M.stroke==="auto"&&O.setStyle({stroke:a(N/x)}),h.add(O)}if(_.get("show")){var F=_.get("distance")+D,H=o_(xr(N/x*(v-g)+g),_.get("formatter")),U=a(N/x),$=L*(p-S-F)+f,Y=R*(p-S-F)+d,oe=_.get("rotate"),X=0;oe==="radial"?(X=-T+2*Math.PI,X>Math.PI/2&&(X+=Math.PI)):oe==="tangential"?X=-T-Math.PI/2:un(oe)&&(X=oe*Math.PI/180),X===0?h.add(new ln({style:Hn(_,{text:H,x:$,y:Y,verticalAlign:R<-.8?"top":R>.8?"bottom":"middle",align:L<-.4?"left":L>.4?"right":"center"},{inheritColor:U}),silent:!0})):h.add(new ln({style:Hn(_,{text:H,x:$,y:Y,verticalAlign:"middle",align:"center"},{inheritColor:U}),silent:!0,originX:$,originY:Y,rotation:X}))}if(y.get("show")&&N!==x){var F=y.get("distance");F=F?F+c:c;for(var re=0;re<=b;re++){L=Math.cos(T),R=Math.sin(T);var _e=new pi({shape:{x1:L*(p-F)+f,y1:R*(p-F)+d,x2:L*(p-w-F)+f,y2:R*(p-w-F)+d},silent:!0,style:P});P.stroke==="auto"&&_e.setStyle({stroke:a((N+re/b)/x)}),h.add(_e),T+=A}T-=A}else T+=C}},e.prototype._renderPointer=function(t,r,i,a,s,o,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"),b=+t.get("max"),S=[x,b],w=[o,l];function T(A,M){var P=y.getItemModel(A),D=P.getModel("pointer"),L=Xe(D.get("width"),s.r),R=Xe(D.get("length"),s.r),N=t.get(["pointer","icon"]),F=D.get("offsetCenter"),O=Xe(F[0],s.r),H=Xe(F[1],s.r),U=D.get("keepAspect"),$;return N?$=Br(N,O-L/2,H-R,L,R,null,U):$=new Khe({shape:{angle:-Math.PI/2,width:L,r:R,x:O,y:H}}),$.rotation=-(M+Math.PI/2),$.x=s.cx,$.y=s.cy,$}function C(A,M){var P=v.get("roundCap"),D=P?$x:La,L=v.get("overlap"),R=L?v.get("width"):c/y.count(),N=L?s.r-R:s.r-(A+1)*R,F=L?s.r:s.r-A*R,O=new D({shape:{startAngle:o,endAngle:M,cx:s.cx,cy:s.cy,clockwise:u,r0:N,r:F}});return L&&(O.z2=Sn(y.get(_,A),[x,b],[100,0],!0)),O}(m||g)&&(y.diff(f).add(function(A){var M=y.get(_,A);if(g){var P=T(A,o);Jn(P,{rotation:-((isNaN(+M)?w[0]:Sn(M,S,w,!0))+Math.PI/2)},t),h.add(P),y.setItemGraphicEl(A,P)}if(m){var D=C(A,o),L=v.get("clip");Jn(D,{shape:{endAngle:Sn(M,S,w,L)}},t),h.add(D),qT(t.seriesIndex,y.dataType,A,D),p[A]=D}}).update(function(A,M){var P=y.get(_,A);if(g){var D=f.getItemGraphicEl(M),L=D?D.rotation:o,R=T(A,L);R.rotation=L,cn(R,{rotation:-((isNaN(+P)?w[0]:Sn(P,S,w,!0))+Math.PI/2)},t),h.add(R),y.setItemGraphicEl(A,R)}if(m){var N=d[M],F=N?N.shape.endAngle:o,O=C(A,F),H=v.get("clip");cn(O,{shape:{endAngle:Sn(P,S,w,H)}},t),h.add(O),qT(t.seriesIndex,y.dataType,A,O),p[A]=O}}).execute(),y.each(function(A){var M=y.getItemModel(A),P=M.getModel("emphasis"),D=P.get("focus"),L=P.get("blurScope"),R=P.get("disabled");if(g){var N=y.getItemGraphicEl(A),F=y.getItemVisual(A,"style"),O=F.fill;if(N instanceof Pi){var H=N.style;N.useStyle(Pe({image:H.image,x:H.x,y:H.y,width:H.width,height:H.height},F))}else N.useStyle(F),N.type!=="pointer"&&N.setColor(O);N.setStyle(M.getModel(["pointer","itemStyle"]).getItemStyle()),N.style.fill==="auto"&&N.setStyle("fill",a(Sn(y.get(_,A),S,[0,1],!0))),N.z2EmphasisLift=0,Ci(N,M),lr(N,D,L,R)}if(m){var U=p[A];U.useStyle(y.getItemVisual(A,"style")),U.setStyle(M.getModel(["progress","itemStyle"]).getItemStyle()),U.z2EmphasisLift=0,Ci(U,M),lr(U,D,L,R)}}),this._progressEls=p)},e.prototype._renderAnchor=function(t,r){var i=t.getModel("anchor"),a=i.get("show");if(a){var s=i.get("size"),o=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),c=Br(o,r.cx-s/2+Xe(l[0],r.r),r.cy-s/2+Xe(l[1],r.r),s,s,null,u);c.z2=i.get("showAbove")?1:0,c.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(c)}},e.prototype._renderTitleAndDetail=function(t,r,i,a,s){var o=this,l=t.getData(),u=l.mapDimension("value"),c=+t.get("min"),h=+t.get("max"),f=new bt,d=[],p=[],g=t.isAnimationEnabled(),v=t.get(["pointer","showAbove"]);l.diff(this._data).add(function(m){d[m]=new ln({silent:!0}),p[m]=new ln({silent:!0})}).update(function(m,y){d[m]=o._titleEls[y],p[m]=o._detailEls[y]}).execute(),l.each(function(m){var y=l.getItemModel(m),_=l.get(u,m),x=new bt,b=a(Sn(_,[c,h],[0,1],!0)),S=y.getModel("title");if(S.get("show")){var w=S.get("offsetCenter"),T=s.cx+Xe(w[0],s.r),C=s.cy+Xe(w[1],s.r),A=d[m];A.attr({z2:v?0:2,style:Hn(S,{x:T,y:C,text:l.getName(m),align:"center",verticalAlign:"middle"},{inheritColor:b})}),x.add(A)}var M=y.getModel("detail");if(M.get("show")){var P=M.get("offsetCenter"),D=s.cx+Xe(P[0],s.r),L=s.cy+Xe(P[1],s.r),R=Xe(M.get("width"),s.r),N=Xe(M.get("height"),s.r),F=t.get(["progress","show"])?l.getItemVisual(m,"style").fill:b,A=p[m],O=M.get("formatter");A.attr({z2:v?0:2,style:Hn(M,{x:D,y:L,text:o_(_,O),width:isNaN(R)?null:R,height:isNaN(N)?null:N,align:"center",verticalAlign:"middle"},{inheritColor:F})}),_7(A,{normal:M},_,function(U){return o_(U,O)}),g&&x7(A,m,l,t,{getFormattedLabel:function(U,$,Y,oe,X,re){return o_(re?re.interpolatedValue:_,O)}}),x.add(A)}f.add(x)}),this.group.add(f),this._titleEls=d,this._detailEls=p},e.type="gauge",e}($n);const Jhe=Qhe;var efe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="itemStyle",t}return e.prototype.getInitialData=function(t,r){return sv(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}(rr);const tfe=efe;function nfe(n){n.registerChartView(Jhe),n.registerSeriesModel(tfe)}var rfe=["itemStyle","opacity"],ife=function(n){ve(e,n);function e(t,r){var i=n.call(this)||this,a=i,s=new Na,o=new ln;return a.setTextContent(o),i.setTextGuideLine(s),i.updateData(t,r,!0),i}return e.prototype.updateData=function(t,r,i){var a=this,s=t.hostModel,o=t.getItemModel(r),l=t.getItemLayout(r),u=o.getModel("emphasis"),c=o.get(rfe);c=c==null?1:c,i||co(a),a.useStyle(t.getItemVisual(r,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Jn(a,{style:{opacity:c}},s,r)):cn(a,{style:{opacity:c},shape:{points:l.points}},s,r),Ci(a,o),this._updateLabel(t,r),lr(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,r){var i=this,a=this.getTextGuideLine(),s=i.getTextContent(),o=t.hostModel,l=t.getItemModel(r),u=t.getItemLayout(r),c=u.label,h=t.getItemVisual(r,"style"),f=h.fill;Ei(s,ri(l),{labelFetcher:t.hostModel,labelDataIndex:r,defaultOpacity:h.opacity,defaultText:t.getName(r)},{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 Nt(d[0][0],d[0][1]):null},cn(s,{style:{x:c.x,y:c.y}},o,r),s.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),mL(i,yL(l),{stroke:f})},e}(Ra),afe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,r,i){var a=t.getData(),s=this._data,o=this.group;a.diff(s).add(function(l){var u=new ife(a,l);a.setItemGraphicEl(l,u),o.add(u)}).update(function(l,u){var c=s.getItemGraphicEl(u);c.updateData(a,l),o.add(c),a.setItemGraphicEl(l,c)}).remove(function(l){var u=s.getItemGraphicEl(l);Hm(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}($n);const sfe=afe;var ofe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new W0(Qe(this.getData,this),Qe(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.getInitialData=function(t,r){return sv(this,{coordDimensions:["value"],encodeDefaulter:Rt(YP,this)})},e.prototype._defaultLabelLine=function(t){of(t,"labelLine",["show"]);var r=t.labelLine,i=t.emphasis.labelLine;r.show=r.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.prototype.getDataParams=function(t){var r=this.getData(),i=n.prototype.getDataParams.call(this,t),a=r.mapDimension("value"),s=r.getSum(a);return i.percent=s?+(r.get(a,t)/s*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}(rr);const lfe=ofe;function ufe(n,e){return Kr(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function cfe(n,e){for(var t=n.mapDimension("value"),r=n.mapArray(t,function(l){return l}),i=[],a=e==="ascending",s=0,o=n.count();s<o;s++)i[s]=s;return ct(e)?i.sort(e):e!=="none"&&i.sort(function(l,u){return a?r[l]-r[u]:r[u]-r[l]}),i}function hfe(n){var e=n.hostModel,t=e.get("orient");n.each(function(r){var i=n.getItemModel(r),a=i.getModel("label"),s=a.get("position"),o=i.getModel("labelLine"),l=n.getItemLayout(r),u=l.points,c=s==="inner"||s==="inside"||s==="center"||s==="insideLeft"||s==="insideRight",h,f,d,p;if(c)s==="insideLeft"?(f=(u[0][0]+u[3][0])/2+5,d=(u[0][1]+u[3][1])/2,h="left"):s==="insideRight"?(f=(u[1][0]+u[2][0])/2-5,d=(u[1][1]+u[2][1])/2,h="right"):(f=(u[0][0]+u[1][0]+u[2][0]+u[3][0])/4,d=(u[0][1]+u[1][1]+u[2][1]+u[3][1])/4,h="center"),p=[[f,d],[f,d]];else{var g=void 0,v=void 0,m=void 0,y=void 0,_=o.get("length");s==="left"?(g=(u[3][0]+u[0][0])/2,v=(u[3][1]+u[0][1])/2,m=g-_,f=m-5,h="right"):s==="right"?(g=(u[1][0]+u[2][0])/2,v=(u[1][1]+u[2][1])/2,m=g+_,f=m+5,h="left"):s==="top"?(g=(u[3][0]+u[0][0])/2,v=(u[3][1]+u[0][1])/2,y=v-_,d=y-5,h="center"):s==="bottom"?(g=(u[1][0]+u[2][0])/2,v=(u[1][1]+u[2][1])/2,y=v+_,d=y+5,h="center"):s==="rightTop"?(g=t==="horizontal"?u[3][0]:u[1][0],v=t==="horizontal"?u[3][1]:u[1][1],t==="horizontal"?(y=v-_,d=y-5,h="center"):(m=g+_,f=m+5,h="top")):s==="rightBottom"?(g=u[2][0],v=u[2][1],t==="horizontal"?(y=v+_,d=y+5,h="center"):(m=g+_,f=m+5,h="bottom")):s==="leftTop"?(g=u[0][0],v=t==="horizontal"?u[0][1]:u[1][1],t==="horizontal"?(y=v-_,d=y-5,h="center"):(m=g-_,f=m-5,h="right")):s==="leftBottom"?(g=t==="horizontal"?u[1][0]:u[3][0],v=t==="horizontal"?u[1][1]:u[2][1],t==="horizontal"?(y=v+_,d=y+5,h="center"):(m=g-_,f=m-5,h="right")):(g=(u[1][0]+u[2][0])/2,v=(u[1][1]+u[2][1])/2,t==="horizontal"?(y=v+_,d=y+5,h="center"):(m=g+_,f=m+5,h="left")),t==="horizontal"?(m=g,f=m):(y=v,d=y),p=[[g,v],[m,y]]}l.label={linePoints:p,x:f,y:d,verticalAlign:"middle",textAlign:h,inside:c}})}function ffe(n,e){n.eachSeriesByType("funnel",function(t){var r=t.getData(),i=r.mapDimension("value"),a=t.get("sort"),s=ufe(t,e),o=t.get("orient"),l=s.width,u=s.height,c=cfe(r,a),h=s.x,f=s.y,d=o==="horizontal"?[Xe(t.get("minSize"),u),Xe(t.get("maxSize"),u)]:[Xe(t.get("minSize"),l),Xe(t.get("maxSize"),l)],p=r.getDataExtent(i),g=t.get("min"),v=t.get("max");g==null&&(g=Math.min(p[0],0)),v==null&&(v=p[1]);var m=t.get("funnelAlign"),y=t.get("gap"),_=o==="horizontal"?l:u,x=(_-y*(r.count()-1))/r.count(),b=function(L,R){if(o==="horizontal"){var N=r.get(i,L)||0,F=Sn(N,[g,v],d,!0),O=void 0;switch(m){case"top":O=f;break;case"center":O=f+(u-F)/2;break;case"bottom":O=f+(u-F);break}return[[R,O],[R,O+F]]}var H=r.get(i,L)||0,U=Sn(H,[g,v],d,!0),$;switch(m){case"left":$=h;break;case"center":$=h+(l-U)/2;break;case"right":$=h+l-U;break}return[[$,R],[$+U,R]]};a==="ascending"&&(x=-x,y=-y,o==="horizontal"?h+=l:f+=u,c=c.reverse());for(var S=0;S<c.length;S++){var w=c[S],T=c[S+1],C=r.getItemModel(w);if(o==="horizontal"){var A=C.get(["itemStyle","width"]);A==null?A=x:(A=Xe(A,l),a==="ascending"&&(A=-A));var M=b(w,h),P=b(T,h+A);h+=A+y,r.setItemLayout(w,{points:M.concat(P.slice().reverse())})}else{var D=C.get(["itemStyle","height"]);D==null?D=x:(D=Xe(D,u),a==="ascending"&&(D=-D));var M=b(w,f),P=b(T,f+D);f+=D+y,r.setItemLayout(w,{points:M.concat(P.slice().reverse())})}}hfe(r)})}function dfe(n){n.registerChartView(sfe),n.registerSeriesModel(lfe),n.registerLayout(ffe),n.registerProcessor(H0("funnel"))}var pfe=.3,vfe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._dataGroup=new bt,t._initialized=!1,t}return e.prototype.init=function(){this.group.add(this._dataGroup)},e.prototype.render=function(t,r,i,a){this._progressiveEls=null;var s=this._dataGroup,o=t.getData(),l=this._data,u=t.coordinateSystem,c=u.dimensions,h=o5(t);o.diff(l).add(f).update(d).remove(p).execute();function f(v){var m=s5(o,s,v,c,u);pM(m,o,v,h)}function d(v,m){var y=l.getItemGraphicEl(m),_=eW(o,v,c,u);o.setItemGraphicEl(v,y),cn(y,{shape:{points:_}},t,v),co(y),pM(y,o,v,h)}function p(v){var m=l.getItemGraphicEl(v);s.remove(m)}if(!this._initialized){this._initialized=!0;var g=gfe(u,t,function(){setTimeout(function(){s.removeClipPath()})});s.setClipPath(g)}this._data=o},e.prototype.incrementalPrepareRender=function(t,r,i){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},e.prototype.incrementalRender=function(t,r,i){for(var a=r.getData(),s=r.coordinateSystem,o=s.dimensions,l=o5(r),u=this._progressiveEls=[],c=t.start;c<t.end;c++){var h=s5(a,this._dataGroup,c,o,s);h.incremental=!0,pM(h,a,c,l),u.push(h)}},e.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},e.type="parallel",e}($n);function gfe(n,e,t){var r=n.model,i=n.getRect(),a=new nn({shape:{x:i.x,y:i.y,width:i.width,height:i.height}}),s=r.get("layout")==="horizontal"?"width":"height";return a.setShape(s,0),Jn(a,{shape:{width:i.width,height:i.height}},e,t),a}function eW(n,e,t,r){for(var i=[],a=0;a<t.length;a++){var s=t[a],o=n.get(n.mapDimension(s),e);mfe(o,r.getAxis(s).type)||i.push(r.dataToPoint(o,s))}return i}function s5(n,e,t,r,i){var a=eW(n,t,r,i),s=new Na({shape:{points:a},z2:10});return e.add(s),n.setItemGraphicEl(t,s),s}function o5(n){var e=n.get("smooth",!0);return e===!0&&(e=pfe),e=Gl(e),Im(e)&&(e=0),{smooth:e}}function pM(n,e,t,r){n.useStyle(e.getItemVisual(t,"style")),n.style.fill=null,n.setShape("smooth",r.smooth);var i=e.getItemModel(t),a=i.getModel("emphasis");Ci(n,i,"lineStyle"),lr(n,a.get("focus"),a.get("blurScope"),a.get("disabled"))}function mfe(n,e){return e==="category"?n==null:n==null||isNaN(n)}const yfe=vfe;var _fe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return e.prototype.getInitialData=function(t,r){return Yl(null,this,{useEncodeDefaulter:Qe(xfe,null,this)})},e.prototype.getRawIndicesByActiveState=function(t){var r=this.coordinateSystem,i=this.getData(),a=[];return r.eachActiveState(i,function(s,o){t===s&&a.push(i.getRawIndex(o))}),a},e.type="series.parallel",e.dependencies=["parallel"],e.defaultOption={z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},e}(rr);function xfe(n){var e=n.ecModel.getComponent("parallel",n.get("parallelIndex"));if(e){var t={};return z(e.dimensions,function(r){var i=bfe(r);t[r]=i}),t}}function bfe(n){return+n.replace("dim","")}const Sfe=_fe;var wfe=["lineStyle","opacity"],Afe={seriesType:"parallel",reset:function(n,e){var t=n.coordinateSystem,r={normal:n.get(["lineStyle","opacity"]),active:n.get("activeOpacity"),inactive:n.get("inactiveOpacity")};return{progress:function(i,a){t.eachActiveState(a,function(s,o){var l=r[s];if(s==="normal"&&a.hasItemOption){var u=a.getItemModel(o).get(wfe,!0);u!=null&&(l=u)}var c=a.ensureUniqueItemVisual(o,"style");c.opacity=l},i.start,i.end)}}}};const Mfe=Afe;function Tfe(n){Cfe(n),Efe(n)}function Cfe(n){if(!n.parallel){var e=!1;z(n.series,function(t){t&&t.type==="parallel"&&(e=!0)}),e&&(n.parallel=[{}])}}function Efe(n){var e=Cn(n.parallelAxis);z(e,function(t){if(gt(t)){var r=t.parallelIndex||0,i=Cn(n.parallel)[r];i&&i.parallelAxisDefault&&It(t,i.parallelAxisDefault,!1)}})}var Pfe=5,Lfe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){this._model=t,this._api=i,this._handlers||(this._handlers={},z(Rfe,function(a,s){i.getZr().on(s,this._handlers[s]=Qe(a,this))},this)),rv(this,"_throttledDispatchExpand",t.get("axisExpandRate"),"fixRate")},e.prototype.dispose=function(t,r){qm(this,"_throttledDispatchExpand"),z(this._handlers,function(i,a){r.getZr().off(a,i)}),this._handlers=null},e.prototype._throttledDispatchExpand=function(t){this._dispatchExpand(t)},e.prototype._dispatchExpand=function(t){t&&this._api.dispatchAction(Pe({type:"parallelAxisExpand"},t))},e.type="parallel",e}(fr),Rfe={mousedown:function(n){vM(this,"click")&&(this._mouseDownPoint=[n.offsetX,n.offsetY])},mouseup:function(n){var e=this._mouseDownPoint;if(vM(this,"click")&&e){var t=[n.offsetX,n.offsetY],r=Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2);if(r>Pfe)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([n.offsetX,n.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(n){if(!(this._mouseDownPoint||!vM(this,"mousemove"))){var e=this._model,t=e.coordinateSystem.getSlidedAxisExpandWindow([n.offsetX,n.offsetY]),r=t.behavior;r==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(r==="none"?null:{axisExpandWindow:t.axisExpandWindow,animation:r==="jump"?null:{duration:0}})}}};function vM(n,e){var t=n._model;return t.get("axisExpandable")&&t.get("axisExpandTriggerOn")===e}const Dfe=Lfe;var Ife=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){n.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var r=this.option;t&&It(r,t,!0),this._initDimensions()},e.prototype.contains=function(t,r){var i=t.get("parallelIndex");return i!=null&&r.getComponent("parallel",i)===this},e.prototype.setAxisExpand=function(t){z(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(r){t.hasOwnProperty(r)&&(this.option[r]=t[r])},this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],r=this.parallelAxisIndex=[],i=_n(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);z(i,function(a){t.push("dim"+a.get("dim")),r.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}(sn);const Nfe=Ife;var kfe=function(n){ve(e,n);function e(t,r,i,a,s){var o=n.call(this,t,r,i)||this;return o.type=a||"value",o.axisIndex=s,o}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(po);const Ofe=kfe;function Lf(n,e,t,r,i,a){n=n||0;var s=t[1]-t[0];if(i!=null&&(i=Qf(i,[0,s])),a!=null&&(a=Math.max(a,i!=null?i:0)),r==="all"){var o=Math.abs(e[1]-e[0]);o=Qf(o,[0,s]),i=a=Qf(o,[i,a]),r=0}e[0]=Qf(e[0],t),e[1]=Qf(e[1],t);var l=gM(e,r);e[r]+=n;var u=i||0,c=t.slice();l.sign<0?c[0]+=u:c[1]-=u,e[r]=Qf(e[r],c);var h;return h=gM(e,r),i!=null&&(h.sign!==l.sign||h.span<i)&&(e[1-r]=e[r]+l.sign*i),h=gM(e,r),a!=null&&h.span>a&&(e[1-r]=e[r]+h.sign*a),e}function gM(n,e){var t=n[e]-n[1-e];return{span:Math.abs(t),sign:t>0?-1:t<0?1:e?-1:1}}function Qf(n,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,n))}var mM=z,tW=Math.min,nW=Math.max,l5=Math.floor,Ffe=Math.ceil,u5=xr,Bfe=Math.PI,Gfe=function(){function n(e,t,r){this.type="parallel",this._axesMap=st(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,r)}return n.prototype._init=function(e,t,r){var i=e.dimensions,a=e.parallelAxisIndex;mM(i,function(s,o){var l=a[o],u=t.getComponent("parallelAxis",l),c=this._axesMap.set(s,new Ofe(s,wS(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)},n.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},n.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),r=t.axisBase,i=t.layoutBase,a=t.pixelDimIndex,s=e[1-a],o=e[a];return s>=r&&s<=r+t.axisLength&&o>=i&&o<=i+t.layoutLength},n.prototype.getModel=function(){return this._model},n.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(r){if(e.contains(r,t)){var i=r.getData();mM(this.dimensions,function(a){var s=this._axesMap.get(a);s.scale.unionExtentFromData(i,i.mapDimension(a)),Ap(s.scale,s.model)},this)}},this)},n.prototype.resize=function(e,t){this._rect=Kr(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},n.prototype.getRect=function(){return this._rect},n.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,r=["x","y"],i=["width","height"],a=e.get("layout"),s=a==="horizontal"?0:1,o=t[i[s]],l=[0,o],u=this.dimensions.length,c=l_(e.get("axisExpandWidth"),l),h=l_(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&o>0,d=e.get("axisExpandWindow"),p;if(d)p=l_(d[1]-d[0],l),d[1]=d[0]+p;else{p=l_(c*(h-1),l);var g=e.get("axisExpandCenter")||l5(u/2);d=[c*g-p/2],d[1]=d[0]+p}var v=(o-p)/(u-h);v<3&&(v=0);var m=[l5(u5(d[0]/c,1))+1,Ffe(u5(d[1]/c,1))-1],y=v/c*d[0];return{layout:a,pixelDimIndex:s,layoutBase:t[r[s]],layoutLength:o,axisBase:t[r[1-s]],axisLength:t[i[1-s]],axisExpandable:f,axisExpandWidth:c,axisCollapseWidth:v,axisExpandWindow:d,axisCount:u,winInnerIndices:m,axisExpandWindow0Pos:y}},n.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,r=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;t.each(function(s){var o=[0,i.axisLength],l=s.inverse?1:0;s.setExtent(o[l],o[1-l])}),mM(r,function(s,o){var l=(i.axisExpandable?Ufe:zfe)(o,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:Bfe/2,vertical:0},h=[u[a].x+e.x,u[a].y+e.y],f=c[a],d=Za();Sf(d,d,f),Ko(d,d,h),this._axesLayout[s]={position:h,rotation:f,transform:d,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},n.prototype.getAxis=function(e){return this._axesMap.get(e)},n.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},n.prototype.eachActiveState=function(e,t,r,i){r==null&&(r=0),i==null&&(i=e.count());var a=this._axesMap,s=this.dimensions,o=[],l=[];z(s,function(v){o.push(e.mapDimension(v)),l.push(a.get(v).model)});for(var u=this.hasAxisBrushed(),c=r;c<i;c++){var h=void 0;if(!u)h="normal";else{h="active";for(var f=e.getValues(o,c),d=0,p=s.length;d<p;d++){var g=l[d].getActiveState(f[d]);if(g==="inactive"){h="inactive";break}}}t(h,c)}},n.prototype.hasAxisBrushed=function(){for(var e=this.dimensions,t=this._axesMap,r=!1,i=0,a=e.length;i<a;i++)t.get(e[i]).model.getActiveState()!=="normal"&&(r=!0);return r},n.prototype.axisCoordToPoint=function(e,t){var r=this._axesLayout[t];return so([e,0],r.transform)},n.prototype.getAxisLayout=function(e){return yt(this._axesLayout[e])},n.prototype.getSlidedAxisExpandWindow=function(e){var t=this._makeLayoutInfo(),r=t.pixelDimIndex,i=t.axisExpandWindow.slice(),a=i[1]-i[0],s=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:"none",axisExpandWindow:i};var o=e[r]-t.layoutBase-t.axisExpandWindow0Pos,l,u="slide",c=t.axisCollapseWidth,h=this._model.get("axisExpandSlideTriggerArea"),f=h[0]!=null;if(c)f&&c&&o<a*h[0]?(u="jump",l=o-a*h[2]):f&&c&&o>a*(1-h[0])?(u="jump",l=o-a*(1-h[2])):(l=o-a*h[1])>=0&&(l=o-a*(1-h[1]))<=0&&(l=0),l*=t.axisExpandWidth/c,l?Lf(l,i,s,"all"):u="none";else{var d=i[1]-i[0],p=s[1]*o/d;i=[nW(0,p-d/2)],i[1]=tW(s[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},n}();function l_(n,e){return tW(nW(n,e[0]),e[1])}function zfe(n,e){var t=e.layoutLength/(e.axisCount-1);return{position:t*n,axisNameAvailableWidth:t,axisLabelShow:!0}}function Ufe(n,e){var t=e.layoutLength,r=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,s=e.winInnerIndices,o,l=a,u=!1,c;return n<s[0]?(o=n*a,c=a):n<=s[1]?(o=e.axisExpandWindow0Pos+n*r-e.axisExpandWindow[0],l=r,u=!0):(o=t-(i-1-n)*a,c=a),{position:o,axisNameAvailableWidth:l,axisLabelShow:u,nameTruncateMaxWidth:c}}const Vfe=Gfe;function Hfe(n,e){var t=[];return n.eachComponent("parallel",function(r,i){var a=new Vfe(r,n,e);a.name="parallel_"+i,a.resize(r,e),r.coordinateSystem=a,a.model=r,t.push(a)}),n.eachSeries(function(r){if(r.get("coordinateSystem")==="parallel"){var i=r.getReferringComponents("parallel",Fr).models[0];r.coordinateSystem=i.coordinateSystem}}),t}var Wfe={create:Hfe};const $fe=Wfe;var rW=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.activeIntervals=[],t}return e.prototype.getAreaSelectStyle=function(){return uf([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},e.prototype.setActiveIntervals=function(t){var r=this.activeIntervals=yt(t);if(r)for(var i=r.length-1;i>=0;i--)Rs(r[i])},e.prototype.getActiveState=function(t){var r=this.activeIntervals;if(!r.length)return"normal";if(t==null||isNaN(+t))return"inactive";if(r.length===1){var i=r[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var a=0,s=r.length;a<s;a++)if(r[a][0]<=t&&t<=r[a][1])return"active";return"inactive"},e}(sn);zr(rW,B0);const c5=rW;var ff=!0,i0=Math.min,Cp=Math.max,jfe=Math.pow,qfe=1e4,Xfe=6,Yfe=6,h5="globalPan",Kfe={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},Zfe={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},f5={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},Qfe=0,Jfe=function(n){ve(e,n);function e(t){var r=n.call(this)||this;return r._track=[],r._covers=[],r._handlers={},r._zr=t,r.group=new bt,r._uid="brushController_"+Qfe++,z(sde,function(i,a){this._handlers[a]=Qe(i,this)},r),r}return e.prototype.enableBrush=function(t){return this._brushType&&this._doDisableBrush(),t.brushType&&this._doEnableBrush(t),this},e.prototype._doEnableBrush=function(t){var r=this._zr;this._enableGlobalPan||uue(r,h5,this._uid),z(this._handlers,function(i,a){r.on(a,i)}),this._brushType=t.brushType,this._brushOption=It(yt(f5),t,!0)},e.prototype._doDisableBrush=function(){var t=this._zr;cue(t,h5,this._uid),z(this._handlers,function(r,i){t.off(i,r)}),this._brushType=this._brushOption=null},e.prototype.setPanels=function(t){if(t&&t.length){var r=this._panels={};z(t,function(i){r[i.panelId]=yt(i)})}else this._panels=null;return this},e.prototype.mount=function(t){t=t||{},this._enableGlobalPan=t.enableGlobalPan;var r=this.group;return this._zr.add(r),r.attr({x:t.x||0,y:t.y||0,rotation:t.rotation||0,scaleX:t.scaleX||1,scaleY:t.scaleY||1}),this._transform=r.getLocalTransform(),this},e.prototype.updateCovers=function(t){t=Ne(t,function(f){return It(yt(f5),f,!0)});var r="\0-brush-index-",i=this._covers,a=this._covers=[],s=this,o=this._creatingCover;return new Vl(i,t,u,l).add(c).update(c).remove(h).execute(),this;function l(f,d){return(f.id!=null?f.id:r+d)+"-"+f.brushType}function u(f,d){return l(f.__brushOption,d)}function c(f,d){var p=t[f];if(d!=null&&i[d]===o)a[f]=i[d];else{var g=a[f]=d!=null?(i[d].__brushOption=p,i[d]):aW(s,iW(s,p));UL(s,g)}}function h(f){i[f]!==o&&s.group.remove(i[f])}},e.prototype.unmount=function(){return this.enableBrush(!1),OC(this),this._zr.remove(this.group),this},e.prototype.dispose=function(){this.unmount(),this.off()},e}(Bs);function iW(n,e){var t=PS[e.brushType].createCover(n,e);return t.__brushOption=e,oW(t,e),n.group.add(t),t}function aW(n,e){var t=VL(e);return t.endCreating&&(t.endCreating(n,e),oW(e,e.__brushOption)),e}function sW(n,e){var t=e.__brushOption;VL(e).updateCoverShape(n,e,t.range,t)}function oW(n,e){var t=e.z;t==null&&(t=qfe),n.traverse(function(r){r.z=t,r.z2=t})}function UL(n,e){VL(e).updateCommon(n,e),sW(n,e)}function VL(n){return PS[n.__brushOption.brushType]}function HL(n,e,t){var r=n._panels;if(!r)return ff;var i,a=n._transform;return z(r,function(s){s.isTargetByCursor(e,t,a)&&(i=s)}),i}function lW(n,e){var t=n._panels;if(!t)return ff;var r=e.__brushOption.panelId;return r!=null?t[r]:ff}function OC(n){var e=n._covers,t=e.length;return z(e,function(r){n.group.remove(r)},n),e.length=0,!!t}function df(n,e){var t=Ne(n._covers,function(r){var i=r.__brushOption,a=yt(i.range);return{brushType:i.brushType,panelId:i.panelId,range:a}});n.trigger("brush",{areas:t,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function ede(n){var e=n._track;if(!e.length)return!1;var t=e[e.length-1],r=e[0],i=t[0]-r[0],a=t[1]-r[1],s=jfe(i*i+a*a,.5);return s>Xfe}function uW(n){var e=n.length-1;return e<0&&(e=0),[n[0],n[e]]}function cW(n,e,t,r){var i=new bt;return i.add(new nn({name:"main",style:WL(t),silent:!0,draggable:!0,cursor:"move",drift:Rt(d5,n,e,i,["n","s","w","e"]),ondragend:Rt(df,e,{isEnd:!0})})),z(r,function(a){i.add(new nn({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Rt(d5,n,e,i,a),ondragend:Rt(df,e,{isEnd:!0})}))}),i}function hW(n,e,t,r){var i=r.brushStyle.lineWidth||0,a=Cp(i,Yfe),s=t[0][0],o=t[1][0],l=s-i/2,u=o-i/2,c=t[0][1],h=t[1][1],f=c-a+i/2,d=h-a+i/2,p=c-s,g=h-o,v=p+i,m=g+i;dl(n,e,"main",s,o,p,g),r.transformable&&(dl(n,e,"w",l,u,a,m),dl(n,e,"e",f,u,a,m),dl(n,e,"n",l,u,v,a),dl(n,e,"s",l,d,v,a),dl(n,e,"nw",l,u,a,a),dl(n,e,"ne",f,u,a,a),dl(n,e,"sw",l,d,a,a),dl(n,e,"se",f,d,a,a))}function FC(n,e){var t=e.__brushOption,r=t.transformable,i=e.childAt(0);i.useStyle(WL(t)),i.attr({silent:!r,cursor:r?"move":"default"}),z([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var s=e.childOfName(a.join("")),o=a.length===1?BC(n,a[0]):nde(n,a);s&&s.attr({silent:!r,invisible:!r,cursor:r?Zfe[o]+"-resize":null})})}function dl(n,e,t,r,i,a,s){var o=e.childOfName(t);o&&o.setShape(ide($L(n,e,[[r,i],[r+a,i+s]])))}function WL(n){return dt({strokeNoScale:!0},n.brushStyle)}function fW(n,e,t,r){var i=[i0(n,t),i0(e,r)],a=[Cp(n,t),Cp(e,r)];return[[i[0],a[0]],[i[1],a[1]]]}function tde(n){return qh(n.group)}function BC(n,e){var t={w:"left",e:"right",n:"top",s:"bottom"},r={left:"w",right:"e",top:"n",bottom:"s"},i=sS(t[e],tde(n));return r[i]}function nde(n,e){var t=[BC(n,e[0]),BC(n,e[1])];return(t[0]==="e"||t[0]==="w")&&t.reverse(),t.join("")}function d5(n,e,t,r,i,a){var s=t.__brushOption,o=n.toRectRange(s.range),l=dW(e,i,a);z(r,function(u){var c=Kfe[u];o[c[0]][c[1]]+=l[c[0]]}),s.range=n.fromRectRange(fW(o[0][0],o[1][0],o[0][1],o[1][1])),UL(e,t),df(e,{isEnd:!1})}function rde(n,e,t,r){var i=e.__brushOption.range,a=dW(n,t,r);z(i,function(s){s[0]+=a[0],s[1]+=a[1]}),UL(n,e),df(n,{isEnd:!1})}function dW(n,e,t){var r=n.group,i=r.transformCoordToLocal(e,t),a=r.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function $L(n,e,t){var r=lW(n,e);return r&&r!==ff?r.clipPath(t,n._transform):yt(t)}function ide(n){var e=i0(n[0][0],n[1][0]),t=i0(n[0][1],n[1][1]),r=Cp(n[0][0],n[1][0]),i=Cp(n[0][1],n[1][1]);return{x:e,y:t,width:r-e,height:i-t}}function ade(n,e,t){if(!(!n._brushType||ode(n,e.offsetX,e.offsetY))){var r=n._zr,i=n._covers,a=HL(n,e,t);if(!n._dragging)for(var s=0;s<i.length;s++){var o=i[s].__brushOption;if(a&&(a===ff||o.panelId===a.panelId)&&PS[o.brushType].contain(i[s],t[0],t[1]))return}a&&r.setCursorStyle("crosshair")}}function GC(n){var e=n.event;e.preventDefault&&e.preventDefault()}function zC(n,e,t){return n.childOfName("main").contain(e,t)}function pW(n,e,t,r){var i=n._creatingCover,a=n._creatingPanel,s=n._brushOption,o;if(n._track.push(t.slice()),ede(n)||i){if(a&&!i){s.brushMode==="single"&&OC(n);var l=yt(s);l.brushType=p5(l.brushType,a),l.panelId=a===ff?null:a.panelId,i=n._creatingCover=iW(n,l),n._covers.push(i)}if(i){var u=PS[p5(n._brushType,a)],c=i.__brushOption;c.range=u.getCreatingRange($L(n,i,n._track)),r&&(aW(n,i),u.updateCommon(n,i)),sW(n,i),o={isEnd:r}}}else r&&s.brushMode==="single"&&s.removeOnClick&&HL(n,e,t)&&OC(n)&&(o={isEnd:r,removeOnClick:!0});return o}function p5(n,e){return n==="auto"?e.defaultBrushType:n}var sde={mousedown:function(n){if(this._dragging)v5(this,n);else if(!n.target||!n.target.draggable){GC(n);var e=this.group.transformCoordToLocal(n.offsetX,n.offsetY);this._creatingCover=null;var t=this._creatingPanel=HL(this,n,e);t&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(n){var e=n.offsetX,t=n.offsetY,r=this.group.transformCoordToLocal(e,t);if(ade(this,n,r),this._dragging){GC(n);var i=pW(this,n,r,!1);i&&df(this,i)}},mouseup:function(n){v5(this,n)}};function v5(n,e){if(n._dragging){GC(e);var t=e.offsetX,r=e.offsetY,i=n.group.transformCoordToLocal(t,r),a=pW(n,e,i,!0);n._dragging=!1,n._track=[],n._creatingCover=null,a&&df(n,a)}}function ode(n,e,t){var r=n._zr;return e<0||e>r.getWidth()||t<0||t>r.getHeight()}var PS={lineX:g5(0),lineY:g5(1),rect:{createCover:function(n,e){function t(r){return r}return cW({toRectRange:t,fromRectRange:t},n,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(n){var e=uW(n);return fW(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(n,e,t,r){hW(n,e,t,r)},updateCommon:FC,contain:zC},polygon:{createCover:function(n,e){var t=new bt;return t.add(new Na({name:"main",style:WL(e),silent:!0})),t},getCreatingRange:function(n){return n},endCreating:function(n,e){e.remove(e.childAt(0)),e.add(new Ra({name:"main",draggable:!0,drift:Rt(rde,n,e),ondragend:Rt(df,n,{isEnd:!0})}))},updateCoverShape:function(n,e,t,r){e.childAt(0).setShape({points:$L(n,e,t)})},updateCommon:FC,contain:zC}};function g5(n){return{createCover:function(e,t){return cW({toRectRange:function(r){var i=[r,[0,100]];return n&&i.reverse(),i},fromRectRange:function(r){return r[n]}},e,t,[[["w"],["e"]],[["n"],["s"]]][n])},getCreatingRange:function(e){var t=uW(e),r=i0(t[0][n],t[1][n]),i=Cp(t[0][n],t[1][n]);return[r,i]},updateCoverShape:function(e,t,r,i){var a,s=lW(e,t);if(s!==ff&&s.getLinearBrushOtherExtent)a=s.getLinearBrushOtherExtent(n);else{var o=e._zr;a=[0,[o.getWidth(),o.getHeight()][1-n]]}var l=[r,a];n&&l.reverse(),hW(e,t,l,i)},updateCommon:FC,contain:zC}}const jL=Jfe;function vW(n){return n=qL(n),function(e){return g7(e,n)}}function gW(n,e){return n=qL(n),function(t){var r=e!=null?e:t,i=r?n.width:n.height,a=r?n.x:n.y;return[a,a+(i||0)]}}function mW(n,e,t){var r=qL(n);return function(i,a){return r.contain(a[0],a[1])&&!MS(i,e,t)}}function qL(n){return Ot.create(n)}var lde=["axisLine","axisTickLabel","axisName"],ude=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){n.prototype.init.apply(this,arguments),(this._brushController=new jL(r.getZr())).on("brush",Qe(this._onBrush,this))},e.prototype.render=function(t,r,i,a){if(!cde(t,r,a)){this.axisModel=t,this.api=i,this.group.removeAll();var s=this._axisGroup;if(this._axisGroup=new bt,this.group.add(this._axisGroup),!!t.get("show")){var o=fde(t,r),l=o.coordinateSystem,u=t.getAreaSelectStyle(),c=u.width,h=t.axis.dim,f=l.getAxisLayout(h),d=Pe({strokeContainThreshold:c},f),p=new Hl(t,d);z(lde,p.add,p),this._axisGroup.add(p.getGroup()),this._refreshBrushController(d,u,t,o,c,i),I0(s,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,r,i,a,s,o){var l=i.axis.getExtent(),u=l[1]-l[0],c=Math.min(30,Math.abs(u)*.1),h=Ot.create({x:l[0],y:-s/2,width:u,height:s});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:vW(h),isTargetByCursor:mW(h,o,a),getLinearBrushOtherExtent:gW(h,0)}]).enableBrush({brushType:"lineX",brushStyle:r,removeOnClick:!0}).updateCovers(hde(i))},e.prototype._onBrush=function(t){var r=t.areas,i=this.axisModel,a=i.axis,s=Ne(r,function(o){return[a.coordToData(o.range[0],!0),a.coordToData(o.range[1],!0)]});(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:s})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(fr);function cde(n,e,t){return t&&t.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:t})[0]===n}function hde(n){var e=n.axis;return Ne(n.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function fde(n,e){return e.getComponent("parallel",n.get("parallelIndex"))}const dde=ude;var pde={type:"axisAreaSelect",event:"axisAreaSelected"};function vde(n){n.registerAction(pde,function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(r){r.axis.model.setActiveIntervals(e.intervals)})}),n.registerAction("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(r){r.setAxisExpand(e)})})}var gde={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function yW(n){n.registerComponentView(Dfe),n.registerComponentModel(Nfe),n.registerCoordinateSystem("parallel",$fe),n.registerPreprocessor(Tfe),n.registerComponentModel(c5),n.registerComponentView(dde),Tp(n,"parallel",c5,gde),vde(n)}function mde(n){Vt(yW),n.registerChartView(yfe),n.registerSeriesModel(Sfe),n.registerVisual(n.PRIORITY.VISUAL.BRUSH,Mfe)}var yde=function(){function n(){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 n}(),_de=function(n){ve(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new yde},e.prototype.buildPath=function(t,r){var i=r.extent;t.moveTo(r.x1,r.y1),t.bezierCurveTo(r.cpx1,r.cpy1,r.cpx2,r.cpy2,r.x2,r.y2),r.orient==="vertical"?(t.lineTo(r.x2+i,r.y2),t.bezierCurveTo(r.cpx2+i,r.cpy2,r.cpx1+i,r.cpy1,r.x1+i,r.y1)):(t.lineTo(r.x2,r.y2+i),t.bezierCurveTo(r.cpx2,r.cpy2+i,r.cpx1,r.cpy1+i,r.x1,r.y1+i)),t.closePath()},e.prototype.highlight=function(){zl(this)},e.prototype.downplay=function(){Ul(this)},e}(Ht),xde=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._focusAdjacencyDisabled=!1,t}return e.prototype.render=function(t,r,i){var a=this,s=t.getGraph(),o=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,o.removeAll(),o.x=l.x,o.y=l.y,s.eachEdge(function(p){var g=new _de,v=St(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(),b=p.node1.getModel(),S=b.get("localX"),w=b.get("localY"),T=p.node2.getLayout(),C=p.node2.getModel(),A=C.get("localX"),M=C.get("localY"),P=p.getLayout(),D,L,R,N,F,O,H,U;g.shape.extent=Math.max(1,P.dy),g.shape.orient=d,d==="vertical"?(D=(S!=null?S*u:x.x)+P.sy,L=(w!=null?w*c:x.y)+x.dy,R=(A!=null?A*u:T.x)+P.ty,N=M!=null?M*c:T.y,F=D,O=L*(1-_)+N*_,H=R,U=L*_+N*(1-_)):(D=(S!=null?S*u:x.x)+x.dx,L=(w!=null?w*c:x.y)+P.sy,R=A!=null?A*u:T.x,N=(M!=null?M*c:T.y)+P.ty,F=D*(1-_)+R*_,O=L,H=D*_+R*(1-_),U=N),g.setShape({x1:D,y1:L,x2:R,y2:N,cpx1:F,cpy1:O,cpx2:H,cpy2:U}),g.useStyle(y.getItemStyle()),m5(g.style,d,p);var $=""+m.get("value"),Y=ri(m,"edgeLabel");Ei(g,Y,{labelFetcher:{getFormattedLabel:function(re,_e,Fe,Ce,Ae,ze){return t.getFormattedLabel(re,_e,"edge",Ce,Ho(Ae,Y.normal&&Y.normal.get("formatter"),$),ze)}},labelDataIndex:p.dataIndex,defaultText:$}),g.setTextConfig({position:"inside"});var oe=m.getModel("emphasis");Ci(g,m,"lineStyle",function(re){var _e=re.getItemStyle();return m5(_e,d,p),_e}),o.add(g),f.setItemGraphicEl(p.dataIndex,g);var X=oe.get("focus");lr(g,X==="adjacency"?p.getAdjacentDataIndices():X==="trajectory"?p.getTrajectoryDataIndices():X,oe.get("blurScope"),oe.get("disabled"))}),s.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,b=new nn({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});Ei(b,ri(v),{labelFetcher:{getFormattedLabel:function(w,T){return t.getFormattedLabel(w,T,"node")}},labelDataIndex:p.dataIndex,defaultText:p.id}),b.disableLabelAnimation=!0,b.setStyle("fill",p.getVisual("color")),b.setStyle("decal",p.getVisual("style").decal),Ci(b,v),o.add(b),h.setItemGraphicEl(p.dataIndex,b),St(b).dataType="node";var S=_.get("focus");lr(b,S==="adjacency"?p.getAdjacentDataIndices():S==="trajectory"?p.getTrajectoryDataIndices():S,_.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()&&o.setClipPath(bde(o.getBoundingRect(),t,function(){o.removeClipPath()})),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}($n);function m5(n,e,t){switch(n.fill){case"source":n.fill=t.node1.getVisual("color"),n.decal=t.node1.getVisual("style").decal;break;case"target":n.fill=t.node2.getVisual("color"),n.decal=t.node2.getVisual("style").decal;break;case"gradient":var r=t.node1.getVisual("color"),i=t.node2.getVisual("color");Ke(r)&&Ke(i)&&(n.fill=new Zr(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:r,offset:0},{color:i,offset:1}]))}}function bde(n,e,t){var r=new nn({shape:{x:n.x-10,y:n.y-10,width:0,height:n.height+20}});return Jn(r,{shape:{width:n.width+20}},e,t),r}const Sde=xde;var wde=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){var i=t.edges||t.links||[],a=t.data||t.nodes||[],s=t.levels||[];this.levelModels=[];for(var o=this.levelModels,l=0;l<s.length;l++)s[l].depth!=null&&s[l].depth>=0&&(o[s[l].depth]=new Wn(s[l],this,r));var u=JH(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,r){var i=this.option.data||this.option.nodes,a=i[t];a.localX=r[0],a.localY=r[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,r,i){function a(d){return isNaN(d)||d==null}if(i==="edge"){var s=this.getDataParams(t,i),o=s.data,l=s.value,u=o.source+" -- "+o.target;return ii("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 ii("nameValue",{name:f!=null?f+"":null,value:h,noValue:a(h)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(t,r){var i=n.prototype.getDataParams.call(this,t,r);if(i.value==null&&r==="node"){var a=this.getGraph().getNodeByIndex(t),s=a.getLayout().value;i.value=s}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}(rr);const Ade=wde;function Mde(n,e){n.eachSeriesByType("sankey",function(t){var r=t.get("nodeWidth"),i=t.get("nodeGap"),a=Tde(t,e);t.layoutInfo=a;var s=a.width,o=a.height,l=t.getGraph(),u=l.nodes,c=l.edges;Ede(u);var h=_n(u,function(g){return g.getLayout().value===0}),f=h.length!==0?0:t.get("layoutIterations"),d=t.get("orient"),p=t.get("nodeAlign");Cde(u,c,r,i,s,o,f,d,p)})}function Tde(n,e){return Kr(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Cde(n,e,t,r,i,a,s,o,l){Pde(n,e,t,i,a,o,l),Ide(n,e,a,i,r,s,o),Vde(n,o)}function Ede(n){z(n,function(e){var t=ec(e.outEdges,Zx),r=ec(e.inEdges,Zx),i=e.getValue()||0,a=Math.max(t,r,i);e.setLayout({value:a},!0)})}function Pde(n,e,t,r,i,a,s){for(var o=[],l=[],u=[],c=[],h=0,f=0;f<e.length;f++)o[f]=1;for(var f=0;f<n.length;f++)l[f]=n[f].inEdges.length,l[f]===0&&u.push(n[f]);for(var d=-1;u.length;){for(var p=0;p<u.length;p++){var g=u[p],v=g.hostGraph.data.getRawDataItem(g.dataIndex),m=v.depth!=null&&v.depth>=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;y<g.outEdges.length;y++){var _=g.outEdges[y],x=e.indexOf(_);o[x]=0;var b=_.node2,S=n.indexOf(b);--l[S]===0&&c.indexOf(b)<0&&c.push(b)}}++h,u=c,c=[]}for(var f=0;f<o.length;f++)if(o[f]===1)throw new Error("Sankey is a DAG, the original data has cycle!");var w=d>h-1?d:h-1;s&&s!=="left"&&Lde(n,s,a,w);var T=a==="vertical"?(i-t)/w:(r-t)/w;Dde(n,T,a)}function _W(n){var e=n.hostGraph.data.getRawDataItem(n.dataIndex);return e.depth!=null&&e.depth>=0}function Lde(n,e,t,r){if(e==="right"){for(var i=[],a=n,s=0;a.length;){for(var o=0;o<a.length;o++){var l=a[o];l.setLayout({skNodeHeight:s},!0);for(var u=0;u<l.inEdges.length;u++){var c=l.inEdges[u];i.indexOf(c.node1)<0&&i.push(c.node1)}}a=i,i=[],++s}z(n,function(h){_W(h)||h.setLayout({depth:Math.max(0,r-h.getLayout().skNodeHeight)},!0)})}else e==="justify"&&Rde(n,r)}function Rde(n,e){z(n,function(t){!_W(t)&&!t.outEdges.length&&t.setLayout({depth:e},!0)})}function Dde(n,e,t){z(n,function(r){var i=r.getLayout().depth*e;t==="vertical"?r.setLayout({y:i},!0):r.setLayout({x:i},!0)})}function Ide(n,e,t,r,i,a,s){var o=Nde(n,s);kde(o,e,t,r,i,s),yM(o,i,t,r,s);for(var l=1;a>0;a--)l*=.99,Ode(o,l,s),yM(o,i,t,r,s),Ude(o,l,s),yM(o,i,t,r,s)}function Nde(n,e){var t=[],r=e==="vertical"?"y":"x",i=HT(n,function(a){return a.getLayout()[r]});return i.keys.sort(function(a,s){return a-s}),z(i.keys,function(a){t.push(i.buckets.get(a))}),t}function kde(n,e,t,r,i,a){var s=1/0;z(n,function(o){var l=o.length,u=0;z(o,function(h){u+=h.getLayout().value});var c=a==="vertical"?(r-(l-1)*i)/u:(t-(l-1)*i)/u;c<s&&(s=c)}),z(n,function(o){z(o,function(l,u){var c=l.getLayout().value*s;a==="vertical"?(l.setLayout({x:u},!0),l.setLayout({dx:c},!0)):(l.setLayout({y:u},!0),l.setLayout({dy:c},!0))})}),z(e,function(o){var l=+o.getValue()*s;o.setLayout({dy:l},!0)})}function yM(n,e,t,r,i){var a=i==="vertical"?"x":"y";z(n,function(s){s.sort(function(g,v){return g.getLayout()[a]-v.getLayout()[a]});for(var o,l,u,c=0,h=s.length,f=i==="vertical"?"dx":"dy",d=0;d<h;d++)l=s[d],u=c-l.getLayout()[a],u>0&&(o=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0)),c=l.getLayout()[a]+l.getLayout()[f]+e;var p=i==="vertical"?r:t;if(u=c-e-p,u>0){o=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0),c=o;for(var d=h-2;d>=0;--d)l=s[d],u=l.getLayout()[a]+l.getLayout()[f]+e-c,u>0&&(o=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0)),c=l.getLayout()[a]}})}function Ode(n,e,t){z(n.slice().reverse(),function(r){z(r,function(i){if(i.outEdges.length){var a=ec(i.outEdges,Fde,t)/ec(i.outEdges,Zx);if(isNaN(a)){var s=i.outEdges.length;a=s?ec(i.outEdges,Bde,t)/s:0}if(t==="vertical"){var o=i.getLayout().x+(a-vc(i,t))*e;i.setLayout({x:o},!0)}else{var l=i.getLayout().y+(a-vc(i,t))*e;i.setLayout({y:l},!0)}}})})}function Fde(n,e){return vc(n.node2,e)*n.getValue()}function Bde(n,e){return vc(n.node2,e)}function Gde(n,e){return vc(n.node1,e)*n.getValue()}function zde(n,e){return vc(n.node1,e)}function vc(n,e){return e==="vertical"?n.getLayout().x+n.getLayout().dx/2:n.getLayout().y+n.getLayout().dy/2}function Zx(n){return n.getValue()}function ec(n,e,t){for(var r=0,i=n.length,a=-1;++a<i;){var s=+e(n[a],t);isNaN(s)||(r+=s)}return r}function Ude(n,e,t){z(n,function(r){z(r,function(i){if(i.inEdges.length){var a=ec(i.inEdges,Gde,t)/ec(i.inEdges,Zx);if(isNaN(a)){var s=i.inEdges.length;a=s?ec(i.inEdges,zde,t)/s:0}if(t==="vertical"){var o=i.getLayout().x+(a-vc(i,t))*e;i.setLayout({x:o},!0)}else{var l=i.getLayout().y+(a-vc(i,t))*e;i.setLayout({y:l},!0)}}})})}function Vde(n,e){var t=e==="vertical"?"x":"y";z(n,function(r){r.outEdges.sort(function(i,a){return i.node2.getLayout()[t]-a.node2.getLayout()[t]}),r.inEdges.sort(function(i,a){return i.node1.getLayout()[t]-a.node1.getLayout()[t]})}),z(n,function(r){var i=0,a=0;z(r.outEdges,function(s){s.setLayout({sy:i},!0),i+=s.getLayout().dy}),z(r.inEdges,function(s){s.setLayout({ty:a},!0),a+=s.getLayout().dy})})}function Hde(n){n.eachSeriesByType("sankey",function(e){var t=e.getGraph(),r=t.nodes,i=t.edges;if(r.length){var a=1/0,s=-1/0;z(r,function(o){var l=o.getLayout().value;l<a&&(a=l),l>s&&(s=l)}),z(r,function(o){var l=new Ti({type:"color",mappingMethod:"linear",dataExtent:[a,s],visual:e.get("color")}),u=l.mapValueToVisual(o.getLayout().value),c=o.getModel().get(["itemStyle","color"]);c!=null?(o.setVisual("color",c),o.setVisual("style",{fill:c})):(o.setVisual("color",u),o.setVisual("style",{fill:u}))})}i.length&&z(i,function(o){var l=o.getModel().get("lineStyle");o.setVisual("style",l)})})}function Wde(n){n.registerChartView(Sde),n.registerSeriesModel(Ade),n.registerLayout(Mde),n.registerVisual(Hde),n.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(r){r.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var xW=function(){function n(){}return n.prototype._hasEncodeRule=function(e){var t=this.getEncode();return t&&t.get(e)!=null},n.prototype.getInitialData=function(e,t){var r,i=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),s=i.get("type"),o=a.get("type"),l;s==="category"?(e.layout="horizontal",r=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):o==="category"?(e.layout="vertical",r=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=[];z(v,function(x,b){var S;Ie(x)?(S=x.slice(),x.unshift(b)):Ie(x.value)?(S=Pe({},x),S.value=S.value.slice(),x.value.unshift(b)):S=x,m.push(S)}),e.data=m}var y=this.defaultValueDimensions,_=[{name:h,type:Gx(p),ordinalMeta:r,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:Gx(g),dimsDef:y.slice()}];return sv(this,{coordDimensions:_,dimensionsCount:y.length+1,encodeDefaulter:Rt(V7,_,this)})},n.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},n}(),bW=function(n){ve(e,n);function e(){var t=n!==null&&n.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}(rr);zr(bW,xW,!0);const $de=bW;var jde=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.getData(),s=this.group,o=this._data;this._data||s.removeAll();var l=t.get("layout")==="horizontal"?1:0;a.diff(o).add(function(u){if(a.hasValue(u)){var c=a.getItemLayout(u),h=y5(c,a,u,l,!0);a.setItemGraphicEl(u,h),s.add(h)}}).update(function(u,c){var h=o.getItemGraphicEl(c);if(!a.hasValue(u)){s.remove(h);return}var f=a.getItemLayout(u);h?(co(h),SW(f,h,a,u)):h=y5(f,a,u,l),s.add(h),a.setItemGraphicEl(u,h)}).remove(function(u){var c=o.getItemGraphicEl(u);c&&s.remove(c)}).execute(),this._data=a},e.prototype.remove=function(t){var r=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(a){a&&r.remove(a)})},e.type="boxplot",e}($n),qde=function(){function n(){}return n}(),Xde=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="boxplotBoxPath",r}return e.prototype.getDefaultShape=function(){return new qde},e.prototype.buildPath=function(t,r){var i=r.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();a<i.length;a++)t.moveTo(i[a][0],i[a][1]),a++,t.lineTo(i[a][0],i[a][1])},e}(Ht);function y5(n,e,t,r,i){var a=n.ends,s=new Xde({shape:{points:i?Yde(a,r,n):a}});return SW(n,s,e,t,i),s}function SW(n,e,t,r,i){var a=t.hostModel,s=Af[i?"initProps":"updateProps"];s(e,{shape:{points:n.ends}},a,r),e.useStyle(t.getItemVisual(r,"style")),e.style.strokeNoScale=!0,e.z2=100;var o=t.getItemModel(r),l=o.getModel("emphasis");Ci(e,o),lr(e,l.get("focus"),l.get("blurScope"),l.get("disabled"))}function Yde(n,e,t){return Ne(n,function(r){return r=r.slice(),r[e]=t.initBaseline,r})}const Kde=jde;var hm=z;function Zde(n){var e=Qde(n);hm(e,function(t){var r=t.seriesModels;r.length&&(Jde(t),hm(r,function(i,a){epe(i,t.boxOffsetList[a],t.boxWidthList[a])}))})}function Qde(n){var e=[],t=[];return n.eachSeriesByType("boxplot",function(r){var i=r.getBaseAxis(),a=Ft(t,i);a<0&&(a=t.length,t[a]=i,e[a]={axis:i,seriesModels:[]}),e[a].seriesModels.push(r)}),e}function Jde(n){var e=n.axis,t=n.seriesModels,r=t.length,i=n.boxWidthList=[],a=n.boxOffsetList=[],s=[],o;if(e.type==="category")o=e.getBandWidth();else{var l=0;hm(t,function(p){l=Math.max(l,p.getData().count())});var u=e.getExtent();o=Math.abs(u[1]-u[0])/l}hm(t,function(p){var g=p.get("boxWidth");Ie(g)||(g=[g,g]),s.push([Xe(g[0],o)||0,Xe(g[1],o)||0])});var c=o*.8-2,h=c/r*.3,f=(c-h*(r-1))/r,d=f/2-c/2;hm(t,function(p,g){a.push(d),d+=h+f,i.push(Math.min(Math.max(f,s[g][0]),s[g][1]))})}function epe(n,e,t){var r=n.coordinateSystem,i=n.getData(),a=t/2,s=n.get("layout")==="horizontal"?0:1,o=1-s,l=["x","y"],u=i.mapDimension(l[s]),c=i.mapDimensionsAll(l[o]);if(u==null||c.length<5)return;for(var h=0;h<i.count();h++){var f=i.get(u,h),d=_(f,c[2],h),p=_(f,c[0],h),g=_(f,c[1],h),v=_(f,c[3],h),m=_(f,c[4],h),y=[];x(y,g,!1),x(y,v,!0),y.push(p,g,m,v),b(y,p),b(y,m),b(y,d),i.setItemLayout(h,{initBaseline:d[o],ends:y})}function _(S,w,T){var C=i.get(w,T),A=[];A[s]=S,A[o]=C;var M;return isNaN(S)||isNaN(C)?M=[NaN,NaN]:(M=r.dataToPoint(A),M[s]+=e),M}function x(S,w,T){var C=w.slice(),A=w.slice();C[s]+=a,A[s]-=a,T?S.push(C,A):S.push(A,C)}function b(S,w){var T=w.slice(),C=w.slice();T[s]-=a,C[s]+=a,S.push(T,C)}}function tpe(n,e){e=e||{};for(var t=[],r=[],i=e.boundIQR,a=i==="none"||i===0,s=0;s<n.length;s++){var o=Rs(n[s].slice()),l=qw(o,.25),u=qw(o,.5),c=qw(o,.75),h=o[0],f=o[o.length-1],d=(i==null?1.5:i)*(c-l),p=a?h:Math.max(h,l-d),g=a?f:Math.min(f,c+d),v=e.itemNameFormatter,m=ct(v)?v({value:s}):Ke(v)?v.replace("{value}",s+""):s+"";t.push([m,p,l,u,c,g]);for(var y=0;y<o.length;y++){var _=o[y];if(_<p||_>g){var x=[m,_];r.push(x)}}}return{boxData:t,outliers:r}}var npe={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==Wi){var r="";mn(r)}var i=tpe(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function rpe(n){n.registerSeriesModel($de),n.registerChartView(Kde),n.registerLayout(Zde),n.registerTransform(npe)}var ipe=["itemStyle","borderColor"],ape=["itemStyle","borderColor0"],spe=["itemStyle","borderColorDoji"],ope=["itemStyle","color"],lpe=["itemStyle","color0"];function XL(n,e){return e.get(n>0?ope:lpe)}function YL(n,e){return e.get(n===0?spe:n>0?ipe:ape)}var upe={seriesType:"candlestick",plan:nv(),performRawSeries:!0,reset:function(n,e){if(!e.isSeriesFiltered(n)){var t=n.pipelineContext.large;return!t&&{progress:function(r,i){for(var a;(a=r.next())!=null;){var s=i.getItemModel(a),o=i.getItemLayout(a).sign,l=s.getItemStyle();l.fill=XL(o,s),l.stroke=YL(o,s)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");Pe(u,l)}}}}}};const cpe=upe;var hpe=["color","borderColor"],fpe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,r,i){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,r,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,r):this._incrementalRenderNormal(t,r)},e.prototype.eachRendered=function(t){Sc(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var r=t.pipelineContext.large;(this._isLargeDraw==null||r!==this._isLargeDraw)&&(this._isLargeDraw=r,this._clear())},e.prototype._renderNormal=function(t){var r=t.getData(),i=this._data,a=this.group,s=r.getLayout("isSimpleBox"),o=t.get("clip",!0),l=t.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),r.diff(i).add(function(c){if(r.hasValue(c)){var h=r.getItemLayout(c);if(o&&_5(u,h))return;var f=_M(h,c,!0);Jn(f,{shape:{points:h.ends}},t,c),xM(f,r,c,s),a.add(f),r.setItemGraphicEl(c,f)}}).update(function(c,h){var f=i.getItemGraphicEl(h);if(!r.hasValue(c)){a.remove(f);return}var d=r.getItemLayout(c);if(o&&_5(u,d)){a.remove(f);return}f?(cn(f,{shape:{points:d.ends}},t,c),co(f)):f=_M(d),xM(f,r,c,s),a.add(f),r.setItemGraphicEl(c,f)}).remove(function(c){var h=i.getItemGraphicEl(c);h&&a.remove(h)}).execute(),this._data=r},e.prototype._renderLarge=function(t){this._clear(),x5(t,this.group);var r=t.get("clip",!0)?U0(t.coordinateSystem,!1,t):null;r?this.group.setClipPath(r):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,r){for(var i=r.getData(),a=i.getLayout("isSimpleBox"),s;(s=t.next())!=null;){var o=i.getItemLayout(s),l=_M(o);xM(l,i,s,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},e.prototype._incrementalRenderLarge=function(t,r){x5(r,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}($n),dpe=function(){function n(){}return n}(),ppe=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="normalCandlestickBox",r}return e.prototype.getDefaultShape=function(){return new dpe},e.prototype.buildPath=function(t,r){var i=r.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}(Ht);function _M(n,e,t){var r=n.ends;return new ppe({shape:{points:t?vpe(r,n):r},z2:100})}function _5(n,e){for(var t=!0,r=0;r<e.ends.length;r++)if(n.contain(e.ends[r][0],e.ends[r][1])){t=!1;break}return t}function xM(n,e,t,r){var i=e.getItemModel(t);n.useStyle(e.getItemVisual(t,"style")),n.style.strokeNoScale=!0,n.__simpleBox=r,Ci(n,i);var a=e.getItemLayout(t).sign;z(n.states,function(o,l){var u=i.getModel(l),c=XL(a,u),h=YL(a,u)||c,f=o.style||(o.style={});c&&(f.fill=c),h&&(f.stroke=h)});var s=i.getModel("emphasis");lr(n,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function vpe(n,e){return Ne(n,function(t){return t=t.slice(),t[1]=e.initBaseline,t})}var gpe=function(){function n(){}return n}(),bM=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r.type="largeCandlestickBox",r}return e.prototype.getDefaultShape=function(){return new gpe},e.prototype.buildPath=function(t,r){for(var i=r.points,a=0;a<i.length;)if(this.__sign===i[a++]){var s=i[a++];t.moveTo(s,i[a++]),t.lineTo(s,i[a++])}else a+=3},e}(Ht);function x5(n,e,t,r){var i=n.getData(),a=i.getLayout("largePoints"),s=new bM({shape:{points:a},__sign:1,ignoreCoarsePointer:!0});e.add(s);var o=new bM({shape:{points:a},__sign:-1,ignoreCoarsePointer:!0});e.add(o);var l=new bM({shape:{points:a},__sign:0,ignoreCoarsePointer:!0});e.add(l),SM(1,s,n),SM(-1,o,n),SM(0,l,n),r&&(s.incremental=!0,o.incremental=!0),t&&t.push(s,o)}function SM(n,e,t,r){var i=YL(n,t)||XL(n,t),a=t.getModel("itemStyle").getItemStyle(hpe);e.useStyle(a),e.style.fill=null,e.style.stroke=i}const mpe=fpe;var wW=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],t}return e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,r,i){var a=r.getItemLayout(t);return a&&i.rect(a.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(rr);zr(wW,xW,!0);const ype=wW;function _pe(n){!n||!Ie(n.series)||z(n.series,function(e){gt(e)&&e.type==="k"&&(e.type="candlestick")})}var xpe={seriesType:"candlestick",plan:nv(),reset:function(n){var e=n.coordinateSystem,t=n.getData(),r=bpe(n,t),i=0,a=1,s=["x","y"],o=t.getDimensionIndex(t.mapDimension(s[i])),l=Ne(t.mapDimensionsAll(s[a]),t.getDimensionIndex,t),u=l[0],c=l[1],h=l[2],f=l[3];if(t.setLayout({candleWidth:r,isSimpleBox:r<=1.3}),o<0||l.length<4)return;return{progress:n.pipelineContext.large?p:d};function d(g,v){for(var m,y=v.getStore();(m=g.next())!=null;){var _=y.get(o,m),x=y.get(u,m),b=y.get(c,m),S=y.get(h,m),w=y.get(f,m),T=Math.min(x,b),C=Math.max(x,b),A=F(T,_),M=F(C,_),P=F(S,_),D=F(w,_),L=[];O(L,M,0),O(L,A,1),L.push(U(D),U(M),U(P),U(A));var R=v.getItemModel(m),N=!!R.get(["itemStyle","borderColorDoji"]);v.setItemLayout(m,{sign:b5(y,m,x,b,c,N),initBaseline:x>b?M[a]:A[a],ends:L,brushRect:H(S,w,_)})}function F($,Y){var oe=[];return oe[i]=Y,oe[a]=$,isNaN(Y)||isNaN($)?[NaN,NaN]:e.dataToPoint(oe)}function O($,Y,oe){var X=Y.slice(),re=Y.slice();X[i]=F1(X[i]+r/2,1,!1),re[i]=F1(re[i]-r/2,1,!0),oe?$.push(X,re):$.push(re,X)}function H($,Y,oe){var X=F($,oe),re=F(Y,oe);return X[i]-=r/2,re[i]-=r/2,{x:X[0],y:X[1],width:r,height:re[1]-X[1]}}function U($){return $[i]=F1($[i],1),$}}function p(g,v){for(var m=Uo(g.count*4),y=0,_,x=[],b=[],S,w=v.getStore(),T=!!n.get(["itemStyle","borderColorDoji"]);(S=g.next())!=null;){var C=w.get(o,S),A=w.get(u,S),M=w.get(c,S),P=w.get(h,S),D=w.get(f,S);if(isNaN(C)||isNaN(P)||isNaN(D)){m[y++]=NaN,y+=3;continue}m[y++]=b5(w,S,A,M,c,T),x[i]=C,x[a]=P,_=e.dataToPoint(x,null,b),m[y++]=_?_[0]:NaN,m[y++]=_?_[1]:NaN,x[a]=D,_=e.dataToPoint(x,null,b),m[y++]=_?_[1]:NaN}v.setLayout("largePoints",m)}}};function b5(n,e,t,r,i,a){var s;return t>r?s=-1:t<r?s=1:s=a?0:e>0?n.get(i,e-1)<=r?1:-1:1,s}function bpe(n,e){var t=n.getBaseAxis(),r,i=t.type==="category"?t.getBandWidth():(r=t.getExtent(),Math.abs(r[1]-r[0])/e.count()),a=Xe(Et(n.get("barMaxWidth"),i),i),s=Xe(Et(n.get("barMinWidth"),1),i),o=n.get("barWidth");return o!=null?Xe(o,i):Math.max(Math.min(i/2,a),s)}const Spe=xpe;function wpe(n){n.registerChartView(mpe),n.registerSeriesModel(ype),n.registerPreprocessor(_pe),n.registerVisual(cpe),n.registerLayout(Spe)}function S5(n,e){var t=e.rippleEffectColor||e.color;n.eachChild(function(r){r.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?t:null,fill:e.brushType==="fill"?t:null}})})}var Ape=function(n){ve(e,n);function e(t,r){var i=n.call(this)||this,a=new G0(t,r),s=new bt;return i.add(a),i.add(s),i.updateData(t,r),i}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var r=t.symbolType,i=t.color,a=t.rippleNumber,s=this.childAt(1),o=0;o<a;o++){var l=Br(r,-1,-1,2,2,i);l.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var u=-o/a*t.period+t.effectOffset;l.animate("",!0).when(t.period,{scaleX:t.rippleScale/2,scaleY:t.rippleScale/2}).delay(u).start(),l.animateStyle(!0).when(t.period,{opacity:0}).delay(u).start(),s.add(l)}S5(s,t)},e.prototype.updateEffectAnimation=function(t){for(var r=this._effectCfg,i=this.childAt(1),a=["symbolType","period","rippleScale","rippleNumber"],s=0;s<a.length;s++){var o=a[s];if(r[o]!==t[o]){this.stopEffectAnimation(),this.startEffectAnimation(t);return}}S5(i,t)},e.prototype.highlight=function(){zl(this)},e.prototype.downplay=function(){Ul(this)},e.prototype.getSymbolType=function(){var t=this.childAt(0);return t&&t.getSymbolType()},e.prototype.updateData=function(t,r){var i=this,a=t.hostModel;this.childAt(0).updateData(t,r);var s=this.childAt(1),o=t.getItemModel(r),l=t.getItemVisual(r,"symbol"),u=iv(t.getItemVisual(r,"symbolSize")),c=t.getItemVisual(r,"style"),h=c&&c.fill,f=o.getModel("emphasis");s.setScale(u),s.traverse(function(v){v.setStyle("fill",h)});var d=Tf(t.getItemVisual(r,"symbolOffset"),u);d&&(s.x=d[0],s.y=d[1]);var p=t.getItemVisual(r,"symbolRotate");s.rotation=(p||0)*Math.PI/180||0;var g={};g.showEffectOn=a.get("showEffectOn"),g.rippleScale=o.get(["rippleEffect","scale"]),g.brushType=o.get(["rippleEffect","brushType"]),g.period=o.get(["rippleEffect","period"])*1e3,g.effectOffset=r/t.count(),g.z=a.getShallow("z")||0,g.zlevel=a.getShallow("zlevel")||0,g.symbolType=l,g.color=h,g.rippleEffectColor=o.get(["rippleEffect","color"]),g.rippleNumber=o.get(["rippleEffect","number"]),g.showEffectOn==="render"?(this._effectCfg?this.updateEffectAnimation(g):this.startEffectAnimation(g),this._effectCfg=g):(this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(v){v==="emphasis"?g.showEffectOn!=="render"&&i.startEffectAnimation(g):v==="normal"&&g.showEffectOn!=="render"&&i.stopEffectAnimation()}),this._effectCfg=g,lr(this,f.get("focus"),f.get("blurScope"),f.get("disabled"))},e.prototype.fadeOut=function(t){t&&t()},e}(bt);const Mpe=Ape;var Tpe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this._symbolDraw=new z0(Mpe)},e.prototype.render=function(t,r,i){var a=t.getData(),s=this._symbolDraw;s.updateData(a,{clipShape:this._getClipShape(t)}),this.group.add(s.group)},e.prototype._getClipShape=function(t){var r=t.coordinateSystem,i=r&&r.getArea&&r.getArea();return t.get("clip",!0)?i:null},e.prototype.updateTransform=function(t,r,i){var a=t.getData();this.group.dirty();var s=V0("").reset(t,r,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout()},e.prototype._updateGroupTransform=function(t){var r=t.coordinateSystem;r&&r.getRoamTransform&&(this.group.transform=eQ(r.getRoamTransform()),this.group.decomposeTransform())},e.prototype.remove=function(t,r){this._symbolDraw&&this._symbolDraw.remove(!0)},e.type="effectScatter",e}($n);const Cpe=Tpe;var Epe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,r){return Yl(null,this,{useEncodeDefaulter:!0})},e.prototype.brushSelector=function(t,r,i){return i.point(r.getItemLayout(t))},e.type="series.effectScatter",e.dependencies=["grid","polar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",clip:!0,rippleEffect:{period:4,scale:2.5,brushType:"fill",number:3},universalTransition:{divideShape:"clone"},symbolSize:10},e}(rr);const Ppe=Epe;function Lpe(n){n.registerChartView(Cpe),n.registerSeriesModel(Ppe),n.registerLayout(V0("effectScatter"))}var Rpe=function(n){ve(e,n);function e(t,r,i){var a=n.call(this)||this;return a.add(a.createLine(t,r,i)),a._updateEffectSymbol(t,r),a}return e.prototype.createLine=function(t,r,i){return new GL(t,r,i)},e.prototype._updateEffectSymbol=function(t,r){var i=t.getItemModel(r),a=i.getModel("effect"),s=a.get("symbolSize"),o=a.get("symbol");Ie(s)||(s=[s,s]);var l=t.getItemVisual(r,"style"),u=a.get("color")||l&&l.stroke,c=this.childAt(1);this._symbolType!==o&&(this.remove(c),c=Br(o,-.5,-.5,1,1,u),c.z2=100,c.culling=!0,this.add(c)),c&&(c.setStyle("shadowColor",u),c.setStyle(a.getItemStyle(["color"])),c.scaleX=s[0],c.scaleY=s[1],c.setColor(u),this._symbolType=o,this._symbolScale=s,this._updateEffectAnimation(t,a,r))},e.prototype._updateEffectAnimation=function(t,r,i){var a=this.childAt(1);if(a){var s=t.getItemLayout(i),o=r.get("period")*1e3,l=r.get("loop"),u=r.get("roundTrip"),c=r.get("constantSpeed"),h=di(r.get("delay"),function(d){return d/t.count()*o/3});if(a.ignore=!0,this._updateAnimationPoints(a,s),c>0&&(o=this._getLineLength(a)/c*1e3),o!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;ct(h)?f=h(i):f=h,a.__t>0&&(f=-o*a.__t),this._animateSymbol(a,o,f,l,u)}this._period=o,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(t,r,i,a,s){if(r>0){t.__t=0;var o=this,l=t.animate("",a).when(s?r*2:r,{__t:s?2:1}).delay(i).during(function(){o._updateSymbolPosition(t)});a||l.done(function(){o.remove(t)}),l.start()}},e.prototype._getLineLength=function(t){return Ou(t.__p1,t.__cp1)+Ou(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,r){t.__p1=r[0],t.__p2=r[1],t.__cp1=r[2]||[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2]},e.prototype.updateData=function(t,r,i){this.childAt(0).updateData(t,r,i),this._updateEffectSymbol(t,r)},e.prototype._updateSymbolPosition=function(t){var r=t.__p1,i=t.__p2,a=t.__cp1,s=t.__t<1?t.__t:2-t.__t,o=[t.x,t.y],l=o.slice(),u=fi,c=ET;o[0]=u(r[0],a[0],i[0],s),o[1]=u(r[1],a[1],i[1],s);var h=t.__t<1?c(r[0],a[0],i[0],s):c(i[0],a[0],r[0],1-s),f=t.__t<1?c(r[1],a[1],i[1],s):c(i[1],a[1],r[1],1-s);t.rotation=-Math.atan2(f,h)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(t.__lastT!==void 0&&t.__lastT<t.__t?(t.scaleY=Ou(l,o)*1.05,s===1&&(o[0]=l[0]+(o[0]-l[0])/2,o[1]=l[1]+(o[1]-l[1])/2)):t.__lastT===1?t.scaleY=2*Ou(r,o):t.scaleY=this._symbolScale[1]),t.__lastT=t.__t,t.ignore=!1,t.x=o[0],t.y=o[1]},e.prototype.updateLayout=function(t,r){this.childAt(0).updateLayout(t,r);var i=t.getItemModel(r).getModel("effect");this._updateEffectAnimation(t,i,r)},e}(bt);const AW=Rpe;var Dpe=function(n){ve(e,n);function e(t,r,i){var a=n.call(this)||this;return a._createPolyline(t,r,i),a}return e.prototype._createPolyline=function(t,r,i){var a=t.getItemLayout(r),s=new Na({shape:{points:a}});this.add(s),this._updateCommonStl(t,r,i)},e.prototype.updateData=function(t,r,i){var a=t.hostModel,s=this.childAt(0),o={shape:{points:t.getItemLayout(r)}};cn(s,o,a,r),this._updateCommonStl(t,r,i)},e.prototype._updateCommonStl=function(t,r,i){var a=this.childAt(0),s=t.getItemModel(r),o=i&&i.emphasisLineStyle,l=i&&i.focus,u=i&&i.blurScope,c=i&&i.emphasisDisabled;if(!i||t.hasItemOption){var h=s.getModel("emphasis");o=h.getModel("lineStyle").getLineStyle(),c=h.get("disabled"),l=h.get("focus"),u=h.get("blurScope")}a.useStyle(t.getItemVisual(r,"style")),a.style.fill=null,a.style.strokeNoScale=!0;var f=a.ensureState("emphasis");f.style=o,lr(this,l,u,c)},e.prototype.updateLayout=function(t,r){var i=this.childAt(0);i.setShape("points",t.getItemLayout(r))},e}(bt);const MW=Dpe;var Ipe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._lastFrame=0,t._lastFramePercent=0,t}return e.prototype.createLine=function(t,r,i){return new MW(t,r,i)},e.prototype._updateAnimationPoints=function(t,r){this._points=r;for(var i=[0],a=0,s=1;s<r.length;s++){var o=r[s-1],l=r[s];a+=Ou(o,l),i.push(a)}if(a===0){this._length=0;return}for(var s=0;s<i.length;s++)i[s]/=a;this._offsets=i,this._length=a},e.prototype._getLineLength=function(){return this._length},e.prototype._updateSymbolPosition=function(t){var r=t.__t<1?t.__t:2-t.__t,i=this._points,a=this._offsets,s=i.length;if(a){var o=this._lastFrame,l;if(r<this._lastFramePercent){var u=Math.min(o+1,s-1);for(l=u;l>=0&&!(a[l]<=r);l--);l=Math.min(l,s-2)}else{for(l=o;l<s&&!(a[l]>r);l++);l=Math.min(l-1,s-2)}var c=(r-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=r,t.ignore=!1}},e}(AW);const Npe=Ipe;var kpe=function(){function n(){this.polyline=!1,this.curveness=0,this.segs=[]}return n}(),Ope=function(n){ve(e,n);function e(t){var r=n.call(this,t)||this;return r._off=0,r.hoverDataIdx=-1,r}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 kpe},e.prototype.buildPath=function(t,r){var i=r.segs,a=r.curveness,s;if(r.polyline)for(s=this._off;s<i.length;){var o=i[s++];if(o>0){t.moveTo(i[s++],i[s++]);for(var l=1;l<o;l++)t.lineTo(i[s++],i[s++])}}else for(s=this._off;s<i.length;){var u=i[s++],c=i[s++],h=i[s++],f=i[s++];if(t.moveTo(u,c),a>0){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=s,this.notClear=!0)},e.prototype.findDataIndex=function(t,r){var i=this.shape,a=i.segs,s=i.curveness,o=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u<a.length;){var c=a[u++];if(c>0)for(var h=a[u++],f=a[u++],d=1;d<c;d++){var p=a[u++],g=a[u++];if(Au(h,f,p,g,o,t,r))return l}l++}else for(var l=0,u=0;u<a.length;){var h=a[u++],f=a[u++],p=a[u++],g=a[u++];if(s>0){var v=(h+p)/2-(f-g)*s,m=(f+g)/2-(p-h)*s;if(PU(h,f,v,m,p,g,o,t,r))return l}else if(Au(h,f,p,g,o,t,r))return l;l++}return-1},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();if(t=i[0],r=i[1],a.contain(t,r)){var s=this.hoverDataIdx=this.findDataIndex(t,r);return s>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var r=this.shape,i=r.segs,a=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u<i.length;){var c=i[u++],h=i[u++];a=Math.min(c,a),o=Math.max(c,o),s=Math.min(h,s),l=Math.max(h,l)}t=this._rect=new Ot(a,s,o,l)}return t},e}(Ht),Fpe=function(){function n(){this.group=new bt}return n.prototype.updateData=function(e){this._clear();var t=this._create();t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e)},n.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clear()},n.prototype.incrementalUpdate=function(e,t){var r=this._newAdded[0],i=t.getLayout("linesPoints"),a=r&&r.shape.segs;if(a&&a.length<2e4){var s=a.length,o=new Float32Array(s+i.length);o.set(a),o.set(i,s),r.setShape({segs:o})}else{this._newAdded=[];var l=this._create();l.incremental=!0,l.setShape({segs:i}),this._setCommon(l,t),l.__startIndex=e.start}},n.prototype.remove=function(){this._clear()},n.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},n.prototype._create=function(){var e=new Ope({cursor:"default",ignoreCoarsePointer:!0});return this._newAdded.push(e),this.group.add(e),e},n.prototype._setCommon=function(e,t,r){var i=t.hostModel;e.setShape({polyline:i.get("polyline"),curveness:i.get(["lineStyle","curveness"])}),e.useStyle(i.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var a=t.getVisual("style");a&&a.stroke&&e.setStyle("stroke",a.stroke),e.setStyle("fill",null);var s=St(e);s.seriesIndex=i.seriesIndex,e.on("mousemove",function(o){s.dataIndex=null;var l=e.hoverDataIdx;l>0&&(s.dataIndex=l+e.__startIndex)})},n.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},n}();const Bpe=Fpe;var Gpe={seriesType:"lines",plan:nv(),reset:function(n){var e=n.coordinateSystem;if(e){var t=n.get("polyline"),r=n.pipelineContext.large;return{progress:function(i,a){var s=[];if(r){var o=void 0,l=i.end-i.start;if(t){for(var u=0,c=i.start;c<i.end;c++)u+=n.getLineCoordsCount(c);o=new Float32Array(l+u*2)}else o=new Float32Array(l*4);for(var h=0,f=[],c=i.start;c<i.end;c++){var d=n.getLineCoords(c,s);t&&(o[h++]=d);for(var p=0;p<d;p++)f=e.dataToPoint(s[p],!1,f),o[h++]=f[0],o[h++]=f[1]}a.setLayout("linesPoints",o)}else for(var c=i.start;c<i.end;c++){var g=a.getItemModel(c),d=n.getLineCoords(c,s),v=[];if(t)for(var m=0;m<d;m++)v.push(e.dataToPoint(s[m]));else{v[0]=e.dataToPoint(s[0]),v[1]=e.dataToPoint(s[1]);var y=g.get(["lineStyle","curveness"]);+y&&(v[2]=[(v[0][0]+v[1][0])/2-(v[0][1]-v[1][1])*y,(v[0][1]+v[1][1])/2-(v[1][0]-v[0][0])*y])}a.setItemLayout(c,v)}}}}}};const TW=Gpe;var zpe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.getData(),s=this._updateLineDraw(a,t),o=t.get("zlevel"),l=t.get(["effect","trailLength"]),u=i.getZr(),c=u.painter.getType()==="svg";c||u.painter.getLayer(o).clear(!0),this._lastZlevel!=null&&!c&&u.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(t)&&l>0&&(c||u.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),s.updateData(a);var h=t.get("clip",!0)&&U0(t.coordinateSystem,!1,t);h?this.group.setClipPath(h):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,r,i){var a=t.getData(),s=this._updateLineDraw(a,t);s.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(t,r,i){this._lineDraw.incrementalUpdate(t,r.getData()),this._finished=t.end===r.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,r,i){var a=t.getData(),s=t.pipelineContext;if(!this._finished||s.large||s.progressiveRender)return{update:!0};var o=TW.reset(t,r,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(t,r){var i=this._lineDraw,a=this._showEffect(r),s=!!r.get("polyline"),o=r.pipelineContext,l=o.large;return(!i||a!==this._hasEffet||s!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new Bpe:new zL(s?a?Npe:MW:a?AW:GL),this._hasEffet=a,this._isPolyline=s,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 r=t.getZr(),i=r.painter.getType()==="svg";!i&&this._lastZlevel!=null&&r.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,r){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(r)},e.prototype.dispose=function(t,r){this.remove(t,r)},e.type="lines",e}($n);const Upe=zpe;var Vpe=typeof Uint32Array=="undefined"?Array:Uint32Array,Hpe=typeof Float64Array=="undefined"?Array:Float64Array;function w5(n){var e=n.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(n.data=Ne(e,function(t){var r=[t[0].coord,t[1].coord],i={coords:r};return t[0].name&&(i.fromName=t[0].name),t[1].name&&(i.toName=t[1].name),vP([i,t[0],t[1]])}))}var Wpe=function(n){ve(e,n);function e(){var t=n!==null&&n.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||[],w5(t);var r=this._processFlatCoordsArray(t.data);this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset,r.flatCoords&&(t.data=new Float32Array(r.count)),n.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(t){if(w5(t),t.data){var r=this._processFlatCoordsArray(t.data);this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset,r.flatCoords&&(t.data=new Float32Array(r.count))}n.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var r=this._processFlatCoordsArray(t.data);r.flatCoords&&(this._flatCoords?(this._flatCoords=Nm(this._flatCoords,r.flatCoords),this._flatCoordsOffset=Nm(this._flatCoordsOffset,r.flatCoordsOffset)):(this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset),t.data=new Float32Array(r.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var r=this.getData().getItemModel(t),i=r.option instanceof Array?r.option:r.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,r){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[t*2],a=this._flatCoordsOffset[t*2+1],s=0;s<a;s++)r[s]=r[s]||[],r[s][0]=this._flatCoords[i+s*2],r[s][1]=this._flatCoords[i+s*2+1];return a}else{for(var o=this._getCoordsFromItemModel(t),s=0;s<o.length;s++)r[s]=r[s]||[],r[s][0]=o[s][0],r[s][1]=o[s][1];return o.length}},e.prototype._processFlatCoordsArray=function(t){var r=0;if(this._flatCoords&&(r=this._flatCoords.length),un(t[0])){for(var i=t.length,a=new Vpe(i),s=new Hpe(i),o=0,l=0,u=0,c=0;c<i;){u++;var h=t[c++];a[l++]=o+r,a[l++]=h;for(var f=0;f<h;f++){var d=t[c++],p=t[c++];s[o++]=d,s[o++]=p}}return{flatCoordsOffset:new Uint32Array(a.buffer,0,l),flatCoords:s,count:u}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},e.prototype.getInitialData=function(t,r){var i=new ia(["value"],this);return i.hasItemOption=!1,i.initData(t.data,[],function(a,s,o,l){if(a instanceof Array)return NaN;i.hasItemOption=!0;var u=a.value;if(u!=null)return u instanceof Array?u[l]:u}),i},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),s=a.getItemModel(t),o=s.get("name");if(o)return o;var l=s.get("fromName"),u=s.get("toName"),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),ii("nameValue",{name:c.join(" > ")})},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"),r=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&r>0?r+"":""},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}(rr);const $pe=Wpe;function u_(n){return n instanceof Array||(n=[n,n]),n}var jpe={seriesType:"lines",reset:function(n){var e=u_(n.get("symbol")),t=u_(n.get("symbolSize")),r=n.getData();r.setVisual("fromSymbol",e&&e[0]),r.setVisual("toSymbol",e&&e[1]),r.setVisual("fromSymbolSize",t&&t[0]),r.setVisual("toSymbolSize",t&&t[1]);function i(a,s){var o=a.getItemModel(s),l=u_(o.getShallow("symbol",!0)),u=u_(o.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(s,"fromSymbol",l[0]),l[1]&&a.setItemVisual(s,"toSymbol",l[1]),u[0]&&a.setItemVisual(s,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(s,"toSymbolSize",u[1])}return{dataEach:r.hasItemOption?i:null}}};const qpe=jpe;function Xpe(n){n.registerChartView(Upe),n.registerSeriesModel($pe),n.registerLayout(TW),n.registerVisual(qpe)}var Ype=256,Kpe=function(){function n(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=uc.createCanvas();this.canvas=e}return n.prototype.update=function(e,t,r,i,a,s){var o=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=r;for(var p=0;p<d;++p){var g=e[p],v=g[0],m=g[1],y=g[2],_=i(y);f.globalAlpha=_,f.drawImage(o,v-c,m-c)}if(!h.width||!h.height)return h;for(var x=f.getImageData(0,0,h.width,h.height),b=x.data,S=0,w=b.length,T=this.minOpacity,C=this.maxOpacity,A=C-T;S<w;){var _=b[S+3]/256,M=Math.floor(_*(Ype-1))*4;if(_>0){var P=s(_)?l:u;_>0&&(_=_*A+T),b[S++]=P[M],b[S++]=P[M+1],b[S++]=P[M+2],b[S++]=P[M+3]*_*256}else S+=4}return f.putImageData(x,0,0),h},n.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=uc.createCanvas()),t=this.pointSize+this.blurSize,r=t*2;e.width=r,e.height=r;var i=e.getContext("2d");return i.clearRect(0,0,r,r),i.shadowOffsetX=r,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},n.prototype._getGradient=function(e,t){for(var r=this._gradientPixels,i=r[t]||(r[t]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],s=0,o=0;o<256;o++)e[t](o/255,!0,a),i[s++]=a[0],i[s++]=a[1],i[s++]=a[2],i[s++]=a[3];return i},n}();const Zpe=Kpe;function Qpe(n,e,t){var r=n[1]-n[0];e=Ne(e,function(s){return{interval:[(s.interval[0]-n[0])/r,(s.interval[1]-n[0])/r]}});var i=e.length,a=0;return function(s){var o;for(o=a;o<i;o++){var l=e[o].interval;if(l[0]<=s&&s<=l[1]){a=o;break}}if(o===i)for(o=a-1;o>=0;o--){var l=e[o].interval;if(l[0]<=s&&s<=l[1]){a=o;break}}return o>=0&&o<i&&t[o]}}function Jpe(n,e){var t=n[1]-n[0];return e=[(e[0]-n[0])/t,(e[1]-n[0])/t],function(r){return r>=e[0]&&r<=e[1]}}function A5(n){var e=n.dimensions;return e[0]==="lng"&&e[1]==="lat"}var eve=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a;r.eachComponent("visualMap",function(o){o.eachTargetSeries(function(l){l===t&&(a=o)})}),this._progressiveEls=null,this.group.removeAll();var s=t.coordinateSystem;s.type==="cartesian2d"||s.type==="calendar"?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):A5(s)&&this._renderOnGeo(s,t,a,i)},e.prototype.incrementalPrepareRender=function(t,r,i){this.group.removeAll()},e.prototype.incrementalRender=function(t,r,i,a){var s=r.coordinateSystem;s&&(A5(s)?this.render(r,i,a):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(r,a,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){Sc(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,r,i,a,s){var o=t.coordinateSystem,l=Ef(o,"cartesian2d"),u,c,h,f;if(l){var d=o.getAxis("x"),p=o.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"]),b=ri(t),S=t.getModel("emphasis"),w=S.get("focus"),T=S.get("blurScope"),C=S.get("disabled"),A=l?[v.mapDimension("x"),v.mapDimension("y"),v.mapDimension("value")]:[v.mapDimension("time"),v.mapDimension("value")],M=i;M<a;M++){var P=void 0,D=v.getItemVisual(M,"style");if(l){var L=v.get(A[0],M),R=v.get(A[1],M);if(isNaN(v.get(A[2],M))||isNaN(L)||isNaN(R)||L<h[0]||L>h[1]||R<f[0]||R>f[1])continue;var N=o.dataToPoint([L,R]);P=new nn({shape:{x:N[0]-u/2,y:N[1]-c/2,width:u,height:c},style:D})}else{if(isNaN(v.get(A[1],M)))continue;P=new nn({z2:1,shape:o.dataToRect([v.get(A[0],M)]).contentShape,style:D})}if(v.hasItemOption){var F=v.getItemModel(M),O=F.getModel("emphasis");m=O.getModel("itemStyle").getItemStyle(),y=F.getModel(["blur","itemStyle"]).getItemStyle(),_=F.getModel(["select","itemStyle"]).getItemStyle(),x=F.get(["itemStyle","borderRadius"]),w=O.get("focus"),T=O.get("blurScope"),C=O.get("disabled"),b=ri(F)}P.shape.r=x;var H=t.getRawValue(M),U="-";H&&H[2]!=null&&(U=H[2]+""),Ei(P,b,{labelFetcher:t,labelDataIndex:M,defaultOpacity:D.opacity,defaultText:U}),P.ensureState("emphasis").style=m,P.ensureState("blur").style=y,P.ensureState("select").style=_,lr(P,w,T,C),P.incremental=s,s&&(P.states.emphasis.hoverLayer=!0),g.add(P),v.setItemGraphicEl(M,P),this._progressiveEls&&this._progressiveEls.push(P)}},e.prototype._renderOnGeo=function(t,r,i,a){var s=i.targetVisuals.inRange,o=i.targetVisuals.outOfRange,l=r.getData(),u=this._hmLayer||this._hmLayer||new Zpe;u.blurSize=r.get("blurSize"),u.pointSize=r.get("pointSize"),u.minOpacity=r.get("minOpacity"),u.maxOpacity=r.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,T,C){var A=t.dataToPoint([w,T]);return A[0]-=f,A[1]-=d,A.push(C),A}),x=i.getExtent(),b=i.type==="visualMap.continuous"?Jpe(x,i.option.range):Qpe(x,i.getPieceList(),i.option.selected);u.update(_,v,m,s.color.getNormalizer(),{inRange:s.color.getColorMapper(),outOfRange:o.color.getColorMapper()},b);var S=new Pi({style:{width:v,height:m,x:f,y:d,image:u.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}($n);const tve=eve;var nve=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){return Yl(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=k0.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}(rr);const rve=nve;function ive(n){n.registerChartView(tve),n.registerSeriesModel(rve)}var ave=["itemStyle","borderWidth"],M5=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],wM=new bc,sve=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group,s=t.getData(),o=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:M5[+c],categoryDim:M5[1-+c]};s.diff(o).add(function(p){if(s.hasValue(p)){var g=C5(s,p),v=T5(s,p,g,f),m=E5(s,f,v);s.setItemGraphicEl(p,m),a.add(m),L5(m,f,v)}}).update(function(p,g){var v=o.getItemGraphicEl(g);if(!s.hasValue(p)){a.remove(v);return}var m=C5(s,p),y=T5(s,p,m,f),_=DW(s,y);v&&_!==v.__pictorialShapeStr&&(a.remove(v),s.setItemGraphicEl(p,null),v=null),v?dve(v,f,y):v=E5(s,f,y,!0),s.setItemGraphicEl(p,v),v.__pictorialSymbolMeta=y,a.add(v),L5(v,f,y)}).remove(function(p){var g=o.getItemGraphicEl(p);g&&P5(o,p,g.__pictorialSymbolMeta.animationModel,g)}).execute();var d=t.get("clip",!0)?U0(t.coordinateSystem,!1,t):null;return d?a.setClipPath(d):a.removeClipPath(),this._data=s,this.group},e.prototype.remove=function(t,r){var i=this.group,a=this._data;t.get("animation")?a&&a.eachItemGraphicEl(function(s){P5(a,St(s).dataIndex,t,s)}):i.removeAll()},e.type="pictorialBar",e}($n);function T5(n,e,t,r){var i=n.getItemLayout(e),a=t.get("symbolRepeat"),s=t.get("symbolClip"),o=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:n.getItemVisual(e,"symbol")||"circle",style:n.getItemVisual(e,"style"),symbolClip:s,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};ove(t,a,i,r,f),lve(n,e,i,a,s,f.boundingLength,f.pxSign,c,r,f),uve(t,f.symbolScale,u,r,f);var d=f.symbolSize,p=Tf(t.get("symbolOffset"),d);return cve(t,d,i,a,s,p,o,f.valueLineWidth,f.boundingLength,f.repeatCutLength,r,f),f}function ove(n,e,t,r,i){var a=r.valueDim,s=n.get("symbolBoundingData"),o=r.coordSys.getOtherAxis(r.coordSys.getBaseAxis()),l=o.toGlobalCoord(o.dataToCoord(0)),u=1-+(t[a.wh]<=0),c;if(Ie(s)){var h=[AM(o,s[0])-l,AM(o,s[1])-l];h[1]<h[0]&&h.reverse(),c=h[u]}else s!=null?c=AM(o,s)-l:e?c=r.coordSysExtent[a.index][u]-l:c=t[a.wh];i.boundingLength=c,e&&(i.repeatCutLength=t[a.wh]);var f=a.xy==="x",d=o.inverse;i.pxSign=f&&!d||!f&&d?c>=0?1:-1:c>0?1:-1}function AM(n,e){return n.toGlobalCoord(n.dataToCoord(n.scale.parse(e)))}function lve(n,e,t,r,i,a,s,o,l,u){var c=l.valueDim,h=l.categoryDim,f=Math.abs(t[h.wh]),d=n.getItemVisual(e,"symbolSize"),p;Ie(d)?p=d.slice():d==null?p=["100%","100%"]:p=[d,d],p[h.index]=Xe(p[h.index],f),p[c.index]=Xe(p[c.index],r?f:Math.abs(a)),u.symbolSize=p;var g=u.symbolScale=[p[0]/o,p[1]/o];g[c.index]*=(l.isHorizontal?-1:1)*s}function uve(n,e,t,r,i){var a=n.get(ave)||0;a&&(wM.attr({scaleX:e[0],scaleY:e[1],rotation:t}),wM.updateTransform(),a/=wM.getLineScale(),a*=e[r.valueDim.index]),i.valueLineWidth=a||0}function cve(n,e,t,r,i,a,s,o,l,u,c,h){var f=c.categoryDim,d=c.valueDim,p=h.pxSign,g=Math.max(e[d.index]+o,0),v=g;if(r){var m=Math.abs(l),y=di(n.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1));var x=Xe(y,e[d.index]),b=Math.max(g+x*2,0),S=_?0:x*2,w=vU(r),T=w?r:R5((m+S)/b),C=m-T*g;x=C/2/(_?T:Math.max(T-1,1)),b=g+x*2,S=_?0:x*2,!w&&r!=="fixed"&&(T=u?R5((Math.abs(u)+S)/b):0),v=T*b-S,h.repeatTimes=T,h.symbolMargin=x}var A=p*(v/2),M=h.pathPosition=[];M[f.index]=t[f.wh]/2,M[d.index]=s==="start"?A:s==="end"?l-A:l/2,a&&(M[0]+=a[0],M[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(M[d.index]+A)),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 CW(n){var e=n.symbolPatternSize,t=Br(n.symbolType,-e/2,-e/2,e,e);return t.attr({culling:!0}),t.type!=="image"&&t.setStyle({strokeNoScale:!0}),t}function EW(n,e,t,r){var i=n.__pictorialBundle,a=t.symbolSize,s=t.valueLineWidth,o=t.pathPosition,l=e.valueDim,u=t.repeatTimes||0,c=0,h=a[e.valueDim.index]+s+t.symbolMargin*2;for(KL(n,function(g){g.__pictorialAnimationIndex=c,g.__pictorialRepeatTimes=u,c<u?sp(g,null,p(c),t,r):sp(g,null,{scaleX:0,scaleY:0},t,r,function(){i.remove(g)}),c++});c<u;c++){var f=CW(t);f.__pictorialAnimationIndex=c,f.__pictorialRepeatTimes=u,i.add(f);var d=p(c);sp(f,{x:d.x,y:d.y,scaleX:0,scaleY:0},{scaleX:d.scaleX,scaleY:d.scaleY,rotation:d.rotation},t,r)}function p(g){var v=o.slice(),m=t.pxSign,y=g;return(t.symbolRepeatDirection==="start"?m>0:m<0)&&(y=u-1-g),v[l.index]=h*(y-u/2+.5)+o[l.index],{x:v[0],y:v[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation}}}function PW(n,e,t,r){var i=n.__pictorialBundle,a=n.__pictorialMainPath;a?sp(a,null,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation},t,r):(a=n.__pictorialMainPath=CW(t),i.add(a),sp(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,r))}function LW(n,e,t){var r=Pe({},e.barRectShape),i=n.__pictorialBarRect;i?sp(i,null,{shape:r},e,t):(i=n.__pictorialBarRect=new nn({z2:2,shape:r,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,n.add(i))}function RW(n,e,t,r){if(t.symbolClip){var i=n.__pictorialClipPath,a=Pe({},t.clipShape),s=e.valueDim,o=t.animationModel,l=t.dataIndex;if(i)cn(i,{shape:a},o,l);else{a[s.wh]=0,i=new nn({shape:a}),n.__pictorialBundle.setClipPath(i),n.__pictorialClipPath=i;var u={};u[s.wh]=t.clipShape[s.wh],Af[r?"updateProps":"initProps"](i,{shape:u},o,l)}}}function C5(n,e){var t=n.getItemModel(e);return t.getAnimationDelayParams=hve,t.isAnimationEnabled=fve,t}function hve(n){return{index:n.__pictorialAnimationIndex,count:n.__pictorialRepeatTimes}}function fve(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function E5(n,e,t,r){var i=new bt,a=new bt;return i.add(a),i.__pictorialBundle=a,a.x=t.bundlePosition[0],a.y=t.bundlePosition[1],t.symbolRepeat?EW(i,e,t):PW(i,e,t),LW(i,t,r),RW(i,e,t,r),i.__pictorialShapeStr=DW(n,t),i.__pictorialSymbolMeta=t,i}function dve(n,e,t){var r=t.animationModel,i=t.dataIndex,a=n.__pictorialBundle;cn(a,{x:t.bundlePosition[0],y:t.bundlePosition[1]},r,i),t.symbolRepeat?EW(n,e,t,!0):PW(n,e,t,!0),LW(n,t,!0),RW(n,e,t,!0)}function P5(n,e,t,r){var i=r.__pictorialBarRect;i&&i.removeTextContent();var a=[];KL(r,function(s){a.push(s)}),r.__pictorialMainPath&&a.push(r.__pictorialMainPath),r.__pictorialClipPath&&(t=null),z(a,function(s){hc(s,{scaleX:0,scaleY:0},t,e,function(){r.parent&&r.parent.remove(r)})}),n.setItemGraphicEl(e,null)}function DW(n,e){return[n.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function KL(n,e,t){z(n.__pictorialBundle.children(),function(r){r!==n.__pictorialBarRect&&e.call(t,r)})}function sp(n,e,t,r,i,a){e&&n.attr(e),r.symbolClip&&!i?t&&n.attr(t):t&&Af[i?"updateProps":"initProps"](n,t,r.animationModel,r.dataIndex,a)}function L5(n,e,t){var r=t.dataIndex,i=t.itemModel,a=i.getModel("emphasis"),s=a.getModel("itemStyle").getItemStyle(),o=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");KL(n,function(g){if(g instanceof Pi){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=s,f&&(m.scaleX=g.scaleX*1.1,m.scaleY=g.scaleY*1.1),g.ensureState("blur").style=o,g.ensureState("select").style=l,u&&(g.cursor=u),g.z2=t.z2});var d=e.valueDim.posDesc[+(t.boundingLength>0)],p=n.__pictorialBarRect;p.ignoreClip=!0,Ei(p,ri(i),{labelFetcher:e.seriesModel,labelDataIndex:r,defaultText:Mp(e.seriesModel.getData(),r),inheritColor:t.style.fill,defaultOpacity:t.style.opacity,defaultOutsidePosition:d}),lr(n,c,h,a.get("disabled"))}function R5(n){var e=Math.round(n);return Math.abs(n-e)<1e-4?e:Math.ceil(n)}const pve=sve;var vve=function(n){ve(e,n);function e(){var t=n!==null&&n.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,n.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=wc(Wx.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}(Wx);const gve=vve;function mve(n){n.registerChartView(pve),n.registerSeriesModel(gve),n.registerLayout(n.PRIORITY.VISUAL.LAYOUT,Rt(c9,"pictorialBar")),n.registerLayout(n.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,h9("pictorialBar"))}var yve=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._layers=[],t}return e.prototype.render=function(t,r,i){var a=t.getData(),s=this,o=this.group,l=t.getLayerSeries(),u=a.getLayout("layoutInfo"),c=u.rect,h=u.boundaryGap;o.x=0,o.y=c.y+h[0];function f(v){return v.name}var d=new Vl(this._layersSeries||[],l,f,f),p=[];d.add(Qe(g,this,"add")).update(Qe(g,this,"update")).remove(Qe(g,this,"remove")).execute();function g(v,m,y){var _=s._layers;if(v==="remove"){o.remove(_[m]);return}for(var x=[],b=[],S,w=l[m].indices,T=0;T<w.length;T++){var C=a.getItemLayout(w[T]),A=C.x,M=C.y0,P=C.y;x.push(A,M),b.push(A,M+P),S=a.getItemVisual(w[T],"style")}var D,L=a.getItemLayout(w[0]),R=t.getModel("label"),N=R.get("margin"),F=t.getModel("emphasis");if(v==="add"){var O=p[m]=new bt;D=new tH({shape:{points:x,stackedOnPoints:b,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),O.add(D),o.add(O),t.isAnimationEnabled()&&D.setClipPath(_ve(D.getBoundingRect(),t,function(){D.removeClipPath()}))}else{var O=_[y];D=O.childAt(0),o.add(O),p[m]=O,cn(D,{shape:{points:x,stackedOnPoints:b}},t),co(D)}Ei(D,ri(t),{labelDataIndex:w[T-1],defaultText:a.getName(w[T-1]),inheritColor:S.fill},{normal:{verticalAlign:"middle"}}),D.setTextConfig({position:null,local:!0});var H=D.getTextContent();H&&(H.x=L.x-N,H.y=L.y0+L.y/2),D.useStyle(S),a.setItemGraphicEl(m,D),Ci(D,t),lr(D,F.get("focus"),F.get("blurScope"),F.get("disabled"))}this._layersSeries=l,this._layers=p},e.type="themeRiver",e}($n);function _ve(n,e,t){var r=new nn({shape:{x:n.x-10,y:n.y-10,width:0,height:n.height+20}});return Jn(r,{shape:{x:n.x-50,width:n.width+100,height:n.height+20}},e,t),r}const xve=yve;var MM=2,bve=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new W0(Qe(this.getData,this),Qe(this.getRawData,this))},e.prototype.fixData=function(t){var r=t.length,i={},a=HT(t,function(f){return i.hasOwnProperty(f[0]+"")||(i[f[0]+""]=-1),f[2]}),s=[];a.buckets.each(function(f,d){s.push({name:d,dataList:f})});for(var o=s.length,l=0;l<o;++l){for(var u=s[l].name,c=0;c<s[l].dataList.length;++c){var h=s[l].dataList[c][0]+"";i[h]=l}for(var h in i)i.hasOwnProperty(h)&&i[h]!==l&&(i[h]=l,t[r]=[h,0,u],r++)}return t},e.prototype.getInitialData=function(t,r){for(var i=this.getReferringComponents("singleAxis",Fr).models[0],a=i.get("type"),s=_n(t.data,function(p){return p[2]!==void 0}),o=this.fixData(s||[]),l=[],u=this.nameMap=st(),c=0,h=0;h<o.length;++h)l.push(o[h][MM]),u.get(o[h][MM])||(u.set(o[h][MM],c),c++);var f=F0(o,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:Gx(a)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,d=new ia(f,this);return d.initData(o),d},e.prototype.getLayerSeries=function(){for(var t=this.getData(),r=t.count(),i=[],a=0;a<r;++a)i[a]=a;var s=t.mapDimension("single"),o=HT(i,function(u){return t.get("name",u)}),l=[];return o.buckets.each(function(u,c){u.sort(function(h,f){return t.get(s,h)-t.get(s,f)}),l.push({name:c,indices:u})}),l},e.prototype.getAxisTooltipData=function(t,r,i){Ie(t)||(t=t?[t]:[]);for(var a=this.getData(),s=this.getLayerSeries(),o=[],l=s.length,u,c=0;c<l;++c){for(var h=Number.MAX_VALUE,f=-1,d=s[c].indices.length,p=0;p<d;++p){var g=a.get(t[0],s[c].indices[p]),v=Math.abs(g-r);v<=h&&(u=g,h=v,f=s[c].indices[p])}o.push(f)}return{dataIndices:o,nestestValue:u}},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),s=a.getName(t),o=a.get(a.mapDimension("value"),t);return ii("nameValue",{name:s,value:o})},e.type="series.themeRiver",e.dependencies=["singleAxis"],e.defaultOption={z:2,colorBy:"data",coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},e}(rr);const Sve=bve;function wve(n,e){n.eachSeriesByType("themeRiver",function(t){var r=t.getData(),i=t.coordinateSystem,a={},s=i.getRect();a.rect=s;var o=t.get("boundaryGap"),l=i.getAxis();if(a.boundaryGap=o,l.orient==="horizontal"){o[0]=Xe(o[0],s.height),o[1]=Xe(o[1],s.height);var u=s.height-o[0]-o[1];D5(r,t,u)}else{o[0]=Xe(o[0],s.width),o[1]=Xe(o[1],s.width);var c=s.width-o[0]-o[1];D5(r,t,c)}r.setLayout("layoutInfo",a)})}function D5(n,e,t){if(n.count())for(var r=e.coordinateSystem,i=e.getLayerSeries(),a=n.mapDimension("single"),s=n.mapDimension("value"),o=Ne(i,function(v){return Ne(v.indices,function(m){var y=r.dataToPoint(n.get(a,m));return y[1]=n.get(s,m),y})}),l=Ave(o),u=l.y0,c=t/l.max,h=i.length,f=i[0].indices.length,d,p=0;p<f;++p){d=u[p]*c,n.setItemLayout(i[0].indices[p],{layerIndex:0,x:o[0][p][0],y0:d,y:o[0][p][1]*c});for(var g=1;g<h;++g)d+=o[g-1][p][1]*c,n.setItemLayout(i[g].indices[p],{layerIndex:g,x:o[g][p][0],y0:d,y:o[g][p][1]*c})}}function Ave(n){for(var e=n.length,t=n[0].length,r=[],i=[],a=0,s=0;s<t;++s){for(var o=0,l=0;l<e;++l)o+=n[l][s][1];o>a&&(a=o),r.push(o)}for(var u=0;u<t;++u)i[u]=(a-r[u])/2;a=0;for(var c=0;c<t;++c){var h=r[c]+i[c];h>a&&(a=h)}return{y0:i,max:a}}function Mve(n){n.registerChartView(xve),n.registerSeriesModel(Sve),n.registerLayout(wve),n.registerProcessor(H0("themeRiver"))}var Tve=2,Cve=4,Eve=function(n){ve(e,n);function e(t,r,i,a){var s=n.call(this)||this;s.z2=Tve,s.textConfig={inside:!0},St(s).seriesIndex=r.seriesIndex;var o=new ln({z2:Cve,silent:t.getModel().get(["label","silent"])});return s.setTextContent(o),s.updateData(!0,t,r,i,a),s}return e.prototype.updateData=function(t,r,i,a,s){this.node=r,r.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var o=this;St(o).dataIndex=r.dataIndex;var l=r.getModel(),u=l.getModel("emphasis"),c=r.getLayout(),h=Pe({},c);h.label=null;var f=r.getVisual("style");f.lineJoin="bevel";var d=r.getVisual("decal");d&&(f.decal=wp(d,s));var p=Nh(l.getModel("itemStyle"),h,!0);Pe(h,p),z(oa,function(y){var _=o.ensureState(y),x=l.getModel([y,"itemStyle"]);_.style=x.getItemStyle();var b=Nh(x,h);b&&(_.shape=b)}),t?(o.setShape(h),o.shape.r=c.r0,Jn(o,{shape:{r:c.r}},i,r.dataIndex)):(cn(o,{shape:h},i),co(o)),o.useStyle(f),this._updateLabel(i);var g=l.getShallow("cursor");g&&o.attr("cursor",g),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var v=u.get("focus"),m=v==="relative"?Nm(r.getAncestorsIndices(),r.getDescendantIndices()):v==="ancestor"?r.getAncestorsIndices():v==="descendant"?r.getDescendantIndices():v;lr(this,m,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t){var r=this,i=this.node.getModel(),a=i.getModel("label"),s=this.node.getLayout(),o=s.endAngle-s.startAngle,l=(s.startAngle+s.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(o)<p);f.ignore=!g,z(Um,function(m){var y=m==="normal"?i.getModel("label"):i.getModel([m,"label"]),_=m==="normal",x=_?f:f.ensureState(m),b=t.getFormattedLabel(d,m);_&&(b=b||r.node.name),x.style=Hn(y,{},null,m!=="normal",!0),b&&(x.style.text=b);var S=y.get("show");S!=null&&!_&&(x.ignore=!S);var w=v(y,"position"),T=_?h:h.states[m],C=T.style.fill;T.textConfig={outsideFill:y.get("color")==="inherit"?C:null,inside:w!=="outside"};var A,M=v(y,"distance")||0,P=v(y,"align"),D=v(y,"rotate"),L=Math.PI*.5,R=Math.PI*1.5,N=Xa(D==="tangential"?Math.PI/2-l:l),F=N>L&&!Bm(N-L)&&N<R;w==="outside"?(A=s.r+M,P=F?"right":"left"):!P||P==="center"?(o===2*Math.PI&&s.r0===0?A=0:A=(s.r+s.r0)/2,P="center"):P==="left"?(A=s.r0+M,P=F?"right":"left"):P==="right"&&(A=s.r-M,P=F?"left":"right"),x.style.align=P,x.style.verticalAlign=v(y,"verticalAlign")||"middle",x.x=A*u+s.cx,x.y=A*c+s.cy;var O=0;D==="radial"?O=Xa(-l)+(F?Math.PI:0):D==="tangential"?O=Xa(Math.PI/2-l)+(F?Math.PI:0):un(D)&&(O=D*Math.PI/180),x.rotation=Xa(O)});function v(m,y){var _=m.get(y);return _==null?a.get(y):_}f.dirtyStyle()},e}(La);const I5=Eve;var UC="sunburstRootToNode",N5="sunburstHighlight",Pve="sunburstUnhighlight";function Lve(n){n.registerAction({type:UC,update:"updateView"},function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},r);function r(i,a){var s=e0(e,[UC],i);if(s){var o=i.getViewRoot();o&&(e.direction=IL(o,s.node)?"rollUp":"drillDown"),i.resetViewRoot(s.node)}}}),n.registerAction({type:N5,update:"none"},function(e,t,r){e=Pe({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},i);function i(a){var s=e0(e,[N5],a);s&&(e.dataIndex=s.node.dataIndex)}r.dispatchAction(Pe(e,{type:"highlight"}))}),n.registerAction({type:Pve,update:"updateView"},function(e,t,r){e=Pe({},e),r.dispatchAction(Pe(e,{type:"downplay"}))})}var Rve=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i,a){var s=this;this.seriesModel=t,this.api=i,this.ecModel=r;var o=t.getData(),l=o.tree.root,u=t.getViewRoot(),c=this.group,h=t.get("renderLabelForZeroData"),f=[];u.eachNode(function(y){f.push(y)});var d=this._oldChildren||[];p(f,d),m(l,u),this._initEvents(),this._oldChildren=f;function p(y,_){if(y.length===0&&_.length===0)return;new Vl(_,y,x,x).add(b).update(b).remove(Rt(b,null)).execute();function x(S){return S.getId()}function b(S,w){var T=S==null?null:y[S],C=w==null?null:_[w];g(T,C)}}function g(y,_){if(!h&&y&&!y.getValue()&&(y=null),y!==l&&_!==l){if(_&&_.piece)y?(_.piece.updateData(!1,y,t,r,i),o.setItemGraphicEl(y.dataIndex,_.piece)):v(_);else if(y){var x=new I5(y,t,r,i);c.add(x),o.setItemGraphicEl(y.dataIndex,x)}}}function v(y){y&&y.piece&&(c.remove(y.piece),y.piece=null)}function m(y,_){_.depth>0?(s.virtualPiece?s.virtualPiece.updateData(!1,y,t,r,i):(s.virtualPiece=new I5(y,t,r,i),c.add(s.virtualPiece)),_.piece.off("click"),s.virtualPiece.on("click",function(x){s._rootToNode(_.parentNode)})):s.virtualPiece&&(c.remove(s.virtualPiece),s.virtualPiece=null)}},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(r){var i=!1,a=t.seriesModel.getViewRoot();a.eachNode(function(s){if(!i&&s.piece&&s.piece===r.target){var o=s.getModel().get("nodeClick");if(o==="rootToNode")t._rootToNode(s);else if(o==="link"){var l=s.getModel(),u=l.get("link");if(u){var c=l.get("target",!0)||"_blank";Rx(u,c)}}i=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:UC,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,r){var i=r.getData(),a=i.getItemLayout(0);if(a){var s=t[0]-a.cx,o=t[1]-a.cy,l=Math.sqrt(s*s+o*o);return l<=a.r&&l>=a.r0}},e.type="sunburst",e}($n);const Dve=Rve;var Ive=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t,r){var i={name:t.name,children:t.data};IW(i);var a=this._levelModels=Ne(t.levels||[],function(l){return new Wn(l,this,r)},this),s=DL.createTree(i,this,o);function o(l){l.wrapMethod("getItemModel",function(u,c){var h=s.getNodeByDataIndex(c),f=a[h.depth];return f&&(u.parentModel=f),u})}return s.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treePathInfo=CS(i,this),r},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 r=this.getRawData().tree.root;(!t||t!==r&&!r.contains(t))&&(this._viewRoot=r)},e.prototype.enableAriaDecal=function(){FH(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}(rr);function IW(n){var e=0;z(n.children,function(r){IW(r);var i=r.value;Ie(i)&&(i=i[0]),e+=i});var t=n.value;Ie(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),Ie(n.value)?n.value[0]=t:n.value=t}const Nve=Ive;var k5=Math.PI/180;function kve(n,e,t){e.eachSeriesByType(n,function(r){var i=r.get("center"),a=r.get("radius");Ie(a)||(a=[0,a]),Ie(i)||(i=[i,i]);var s=t.getWidth(),o=t.getHeight(),l=Math.min(s,o),u=Xe(i[0],s),c=Xe(i[1],o),h=Xe(a[0],l/2),f=Xe(a[1],l/2),d=-r.get("startAngle")*k5,p=r.get("minAngle")*k5,g=r.getData().tree.root,v=r.getViewRoot(),m=v.depth,y=r.get("sort");y!=null&&NW(v,y);var _=0;z(v.children,function(N){!isNaN(N.getValue())&&_++});var x=v.getValue(),b=Math.PI/(x||_)*2,S=v.depth>0,w=v.height-(S?-1:1),T=(f-h)/(w||1),C=r.get("clockwise"),A=r.get("stillShowZeroSum"),M=C?1:-1,P=function(N,F){if(N){var O=F;if(N!==g){var H=N.getValue(),U=x===0&&A?b:H*b;U<p&&(U=p),O=F+M*U;var $=N.depth-m-(S?-1:1),Y=h+T*$,oe=h+T*($+1),X=r.getLevelModel(N);if(X){var re=X.get("r0",!0),_e=X.get("r",!0),Fe=X.get("radius",!0);Fe!=null&&(re=Fe[0],_e=Fe[1]),re!=null&&(Y=Xe(re,l/2)),_e!=null&&(oe=Xe(_e,l/2))}N.setLayout({angle:U,startAngle:F,endAngle:O,clockwise:C,cx:u,cy:c,r0:Y,r:oe})}if(N.children&&N.children.length){var Ce=0;z(N.children,function(Ae){Ce+=P(Ae,F+Ce)})}return O-F}};if(S){var D=h,L=h+T,R=Math.PI*2;g.setLayout({angle:R,startAngle:d,endAngle:d+R,clockwise:C,cx:u,cy:c,r0:D,r:L})}P(v,d)})}function NW(n,e){var t=n.children||[];n.children=Ove(t,e),t.length&&z(n.children,function(r){NW(r,e)})}function Ove(n,e){if(ct(e)){var t=Ne(n,function(i,a){var s=i.getValue();return{params:{depth:i.depth,height:i.height,dataIndex:i.dataIndex,getValue:function(){return s}},index:a}});return t.sort(function(i,a){return e(i.params,a.params)}),Ne(t,function(i){return n[i.index]})}else{var r=e==="asc";return n.sort(function(i,a){var s=(i.getValue()-a.getValue())*(r?1:-1);return s===0?(i.dataIndex-a.dataIndex)*(r?-1:1):s})}}function Fve(n){var e={};function t(r,i,a){for(var s=r;s&&s.depth>1;)s=s.parentNode;var o=i.getColorFromPalette(s.name||s.dataIndex+"",e);return r.depth>1&&Ke(o)&&(o=RT(o,(r.depth-1)/(a-1)*.5)),o}n.eachSeriesByType("sunburst",function(r){var i=r.getData(),a=i.tree;a.eachNode(function(s){var o=s.getModel(),l=o.getModel("itemStyle").getItemStyle();l.fill||(l.fill=t(s,r,a.root.height));var u=i.ensureUniqueItemVisual(s.dataIndex,"style");Pe(u,l)})})}function Bve(n){n.registerChartView(Dve),n.registerSeriesModel(Nve),n.registerLayout(Rt(kve,"sunburst")),n.registerProcessor(Rt(H0,"sunburst")),n.registerVisual(Fve),Lve(n)}var O5={color:"fill",borderColor:"stroke"},Gve={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Nl=en(),zve=function(n){ve(e,n);function e(){var t=n!==null&&n.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,r){return Yl(null,this)},e.prototype.getDataParams=function(t,r,i){var a=n.prototype.getDataParams.call(this,t,r);return i&&(a.info=Nl(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}(rr);const Uve=zve;function Vve(n,e){return e=e||[0,0],Ne(["x","y"],function(t,r){var i=this.getAxis(t),a=e[r],s=n[r]/2;return i.type==="category"?i.getBandWidth():Math.abs(i.dataToCoord(a-s)-i.dataToCoord(a+s))},this)}function Hve(n){var e=n.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return n.dataToPoint(t)},size:Qe(Vve,n)}}}function Wve(n,e){return e=e||[0,0],Ne([0,1],function(t){var r=e[t],i=n[t]/2,a=[],s=[];return a[t]=r-i,s[t]=r+i,a[1-t]=s[1-t]=e[1-t],Math.abs(this.dataToPoint(a)[t]-this.dataToPoint(s)[t])},this)}function $ve(n){var e=n.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:n.getZoom()},api:{coord:function(t){return n.dataToPoint(t)},size:Qe(Wve,n)}}}function jve(n,e){var t=this.getAxis(),r=e instanceof Array?e[0]:e,i=(n instanceof Array?n[0]:n)/2;return t.type==="category"?t.getBandWidth():Math.abs(t.dataToCoord(r-i)-t.dataToCoord(r+i))}function qve(n){var e=n.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return n.dataToPoint(t)},size:Qe(jve,n)}}}function Xve(n,e){return e=e||[0,0],Ne(["Radius","Angle"],function(t,r){var i="get"+t+"Axis",a=this[i](),s=e[r],o=n[r]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(s-o)-a.dataToCoord(s+o));return t==="Angle"&&(l=l*Math.PI/180),l},this)}function Yve(n){var e=n.getRadiusAxis(),t=n.getAngleAxis(),r=e.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:n.cx,cy:n.cy,r:r[1],r0:r[0]},api:{coord:function(i){var a=e.dataToRadius(i[0]),s=t.dataToAngle(i[1]),o=n.coordToPoint([a,s]);return o.push(a,s*Math.PI/180),o},size:Qe(Xve,n)}}}function Kve(n){var e=n.getRect(),t=n.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:n.getCellWidth(),cellHeight:n.getCellHeight(),rangeInfo:{start:t.start,end:t.end,weeks:t.weeks,dayCount:t.allDay}},api:{coord:function(r,i){return n.dataToPoint(r,i)}}}}function kW(n,e,t,r){return n&&(n.legacy||n.legacy!==!1&&!t&&!r&&e!=="tspan"&&(e==="text"||tt(n,"text")))}function OW(n,e,t){var r=n,i,a,s;if(e==="text")s=r;else{s={},tt(r,"text")&&(s.text=r.text),tt(r,"rich")&&(s.rich=r.rich),tt(r,"textFill")&&(s.fill=r.textFill),tt(r,"textStroke")&&(s.stroke=r.textStroke),tt(r,"fontFamily")&&(s.fontFamily=r.fontFamily),tt(r,"fontSize")&&(s.fontSize=r.fontSize),tt(r,"fontStyle")&&(s.fontStyle=r.fontStyle),tt(r,"fontWeight")&&(s.fontWeight=r.fontWeight),a={type:"text",style:s,silent:!0},i={};var o=tt(r,"textPosition");t?i.position=o?r.textPosition:"inside":o&&(i.position=r.textPosition),tt(r,"textPosition")&&(i.position=r.textPosition),tt(r,"textOffset")&&(i.offset=r.textOffset),tt(r,"textRotation")&&(i.rotation=r.textRotation),tt(r,"textDistance")&&(i.distance=r.textDistance)}return F5(s,n),z(s.rich,function(l){F5(l,l)}),{textConfig:i,textContent:a}}function F5(n,e){e&&(e.font=e.textFont||e.font,tt(e,"textStrokeWidth")&&(n.lineWidth=e.textStrokeWidth),tt(e,"textAlign")&&(n.align=e.textAlign),tt(e,"textVerticalAlign")&&(n.verticalAlign=e.textVerticalAlign),tt(e,"textLineHeight")&&(n.lineHeight=e.textLineHeight),tt(e,"textWidth")&&(n.width=e.textWidth),tt(e,"textHeight")&&(n.height=e.textHeight),tt(e,"textBackgroundColor")&&(n.backgroundColor=e.textBackgroundColor),tt(e,"textPadding")&&(n.padding=e.textPadding),tt(e,"textBorderColor")&&(n.borderColor=e.textBorderColor),tt(e,"textBorderWidth")&&(n.borderWidth=e.textBorderWidth),tt(e,"textBorderRadius")&&(n.borderRadius=e.textBorderRadius),tt(e,"textBoxShadowColor")&&(n.shadowColor=e.textBoxShadowColor),tt(e,"textBoxShadowBlur")&&(n.shadowBlur=e.textBoxShadowBlur),tt(e,"textBoxShadowOffsetX")&&(n.shadowOffsetX=e.textBoxShadowOffsetX),tt(e,"textBoxShadowOffsetY")&&(n.shadowOffsetY=e.textBoxShadowOffsetY))}function B5(n,e,t){var r=n;r.textPosition=r.textPosition||t.position||"inside",t.offset!=null&&(r.textOffset=t.offset),t.rotation!=null&&(r.textRotation=t.rotation),t.distance!=null&&(r.textDistance=t.distance);var i=r.textPosition.indexOf("inside")>=0,a=n.fill||"#000";G5(r,e);var s=r.textFill==null;return i?s&&(r.textFill=t.insideFill||"#fff",!r.textStroke&&t.insideStroke&&(r.textStroke=t.insideStroke),!r.textStroke&&(r.textStroke=a),r.textStrokeWidth==null&&(r.textStrokeWidth=2)):(s&&(r.textFill=n.fill||t.outsideFill||"#000"),!r.textStroke&&t.outsideStroke&&(r.textStroke=t.outsideStroke)),r.text=e.text,r.rich=e.rich,z(e.rich,function(o){G5(o,o)}),r}function G5(n,e){e&&(tt(e,"fill")&&(n.textFill=e.fill),tt(e,"stroke")&&(n.textStroke=e.fill),tt(e,"lineWidth")&&(n.textStrokeWidth=e.lineWidth),tt(e,"font")&&(n.font=e.font),tt(e,"fontStyle")&&(n.fontStyle=e.fontStyle),tt(e,"fontWeight")&&(n.fontWeight=e.fontWeight),tt(e,"fontSize")&&(n.fontSize=e.fontSize),tt(e,"fontFamily")&&(n.fontFamily=e.fontFamily),tt(e,"align")&&(n.textAlign=e.align),tt(e,"verticalAlign")&&(n.textVerticalAlign=e.verticalAlign),tt(e,"lineHeight")&&(n.textLineHeight=e.lineHeight),tt(e,"width")&&(n.textWidth=e.width),tt(e,"height")&&(n.textHeight=e.height),tt(e,"backgroundColor")&&(n.textBackgroundColor=e.backgroundColor),tt(e,"padding")&&(n.textPadding=e.padding),tt(e,"borderColor")&&(n.textBorderColor=e.borderColor),tt(e,"borderWidth")&&(n.textBorderWidth=e.borderWidth),tt(e,"borderRadius")&&(n.textBorderRadius=e.borderRadius),tt(e,"shadowColor")&&(n.textBoxShadowColor=e.shadowColor),tt(e,"shadowBlur")&&(n.textBoxShadowBlur=e.shadowBlur),tt(e,"shadowOffsetX")&&(n.textBoxShadowOffsetX=e.shadowOffsetX),tt(e,"shadowOffsetY")&&(n.textBoxShadowOffsetY=e.shadowOffsetY),tt(e,"textShadowColor")&&(n.textShadowColor=e.textShadowColor),tt(e,"textShadowBlur")&&(n.textShadowBlur=e.textShadowBlur),tt(e,"textShadowOffsetX")&&(n.textShadowOffsetX=e.textShadowOffsetX),tt(e,"textShadowOffsetY")&&(n.textShadowOffsetY=e.textShadowOffsetY))}var FW={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},z5=Yt(FW);Yo(Zo,function(n,e){return n[e]=1,n},{});Zo.join(", ");var Qx=["","style","shape","extra"],Ep=en();function ZL(n,e,t,r,i){var a=n+"Animation",s=Yp(n,r,i)||{},o=Ep(e).userDuring;return s.duration>0&&(s.during=o?Qe(tge,{el:e,userDuring:o}):null,s.setToFinal=!0,s.scope=n),Pe(s,t[a]),s}function H1(n,e,t,r){r=r||{};var i=r.dataIndex,a=r.isInit,s=r.clearStyle,o=t.isAnimationEnabled(),l=Ep(n),u=e.style;l.userDuring=e.during;var c={},h={};if(rge(n,e,h),V5("shape",e,h),V5("extra",e,h),!a&&o&&(nge(n,e,c),U5("shape",n,e,c),U5("extra",n,e,c),ige(n,e,u,c)),h.style=u,Zve(n,h,s),Jve(n,e),o)if(a){var f={};z(Qx,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=ZL("enter",n,e,t,i);d.duration>0&&n.animateFrom(f,d)}else Qve(n,e,i||0,t,c);BW(n,e),u?n.dirty():n.markRedraw()}function BW(n,e){for(var t=Ep(n).leaveToProps,r=0;r<Qx.length;r++){var i=Qx[r],a=i?e[i]:e;a&&a.leaveTo&&(t||(t=Ep(n).leaveToProps={}),i&&(t[i]=t[i]||{}),Pe(i?t[i]:t,a.leaveTo))}}function LS(n,e,t,r){if(n){var i=n.parent,a=Ep(n).leaveToProps;if(a){var s=ZL("update",n,e,t,0);s.done=function(){i.remove(n),r&&r()},n.animateTo(a,s)}else i.remove(n),r&&r()}}function Zh(n){return n==="all"}function Zve(n,e,t){var r=e.style;if(!n.isGroup&&r){if(t){n.useStyle({});for(var i=n.animators,a=0;a<i.length;a++){var s=i[a];s.targetName==="style"&&s.changeTarget(n.style)}}n.setStyle(r)}e&&(e.style=null,e&&n.attr(e),e.style=r)}function Qve(n,e,t,r,i){if(i){var a=ZL("update",n,e,r,t);a.duration>0&&n.animateFrom(i,a)}}function Jve(n,e){tt(e,"silent")&&(n.silent=e.silent),tt(e,"ignore")&&(n.ignore=e.ignore),n instanceof Os&&tt(e,"invisible")&&(n.invisible=e.invisible),n instanceof Ht&&tt(e,"autoBatch")&&(n.autoBatch=e.autoBatch)}var Mo={},ege={setTransform:function(n,e){return Mo.el[n]=e,this},getTransform:function(n){return Mo.el[n]},setShape:function(n,e){var t=Mo.el,r=t.shape||(t.shape={});return r[n]=e,t.dirtyShape&&t.dirtyShape(),this},getShape:function(n){var e=Mo.el.shape;if(e)return e[n]},setStyle:function(n,e){var t=Mo.el,r=t.style;return r&&(r[n]=e,t.dirtyStyle&&t.dirtyStyle()),this},getStyle:function(n){var e=Mo.el.style;if(e)return e[n]},setExtra:function(n,e){var t=Mo.el.extra||(Mo.el.extra={});return t[n]=e,this},getExtra:function(n){var e=Mo.el.extra;if(e)return e[n]}};function tge(){var n=this,e=n.el;if(e){var t=Ep(e).userDuring,r=n.userDuring;if(t!==r){n.el=n.userDuring=null;return}Mo.el=e,r(ege)}}function U5(n,e,t,r){var i=t[n];if(i){var a=e[n],s;if(a){var o=t.transition,l=i.transition;if(l)if(!s&&(s=r[n]={}),Zh(l))Pe(s,a);else for(var u=Cn(l),c=0;c<u.length;c++){var h=u[c],f=a[h];s[h]=f}else if(Zh(o)||Ft(o,n)>=0){!s&&(s=r[n]={});for(var d=Yt(a),c=0;c<d.length;c++){var h=d[c],f=a[h];age(i[h],f)&&(s[h]=f)}}}}}function V5(n,e,t){var r=e[n];if(r)for(var i=t[n]={},a=Yt(r),s=0;s<a.length;s++){var o=a[s];i[o]=Jg(r[o])}}function nge(n,e,t){for(var r=e.transition,i=Zh(r)?Zo:Cn(r||[]),a=0;a<i.length;a++){var s=i[a];if(!(s==="style"||s==="shape"||s==="extra")){var o=n[s];t[s]=o}}}function rge(n,e,t){for(var r=0;r<z5.length;r++){var i=z5[r],a=FW[i],s=e[i];s&&(t[a[0]]=s[0],t[a[1]]=s[1])}for(var r=0;r<Zo.length;r++){var o=Zo[r];e[o]!=null&&(t[o]=e[o])}}function ige(n,e,t,r){if(t){var i=n.style,a;if(i){var s=t.transition,o=e.transition;if(s&&!Zh(s)){var l=Cn(s);!a&&(a=r.style={});for(var u=0;u<l.length;u++){var c=l[u],h=i[c];a[c]=h}}else if(n.getAnimationStyleProps&&(Zh(o)||Zh(s)||Ft(o,"style")>=0)){var f=n.getAnimationStyleProps(),d=f?f.style:null;if(d){!a&&(a=r.style={});for(var p=Yt(t),u=0;u<p.length;u++){var c=p[u];if(d[c]){var h=i[c];a[c]=h}}}}}}}function age(n,e){return Hi(n)?n!==e:n!=null&&isFinite(n)}var GW=en(),sge=["percent","easing","shape","style","extra"];function zW(n){n.stopAnimation("keyframe"),n.attr(GW(n))}function Jx(n,e,t){if(!(!t.isAnimationEnabled()||!e)){if(Ie(e)){z(e,function(o){Jx(n,o,t)});return}var r=e.keyframes,i=e.duration;if(t&&i==null){var a=Yp("enter",t,0);i=a&&a.duration}if(!(!r||!i)){var s=GW(n);z(Qx,function(o){if(!(o&&!n[o])){var l;r.sort(function(u,c){return u.percent-c.percent}),z(r,function(u){var c=n.animators,h=o?u[o]:u;if(h){var f=Yt(h);if(o||(f=_n(f,function(g){return Ft(sge,g)<0})),!!f.length){l||(l=n.animate(o,e.loop,!0),l.scope="keyframe");for(var d=0;d<c.length;d++)c[d]!==l&&c[d].targetName===l.targetName&&c[d].stopTracks(f);o&&(s[o]=s[o]||{});var p=o?s[o]:s;z(f,function(g){p[g]=((o?n[o]:n)||{})[g]}),l.whenWithKeys(i*u.percent,h,f,u.easing)}}}),l&&l.delay(e.delay||0).duration(i).start(e.easing)}})}}}var kl="emphasis",Hu="normal",QL="blur",JL="select",gc=[Hu,kl,QL,JL],TM={normal:["itemStyle"],emphasis:[kl,"itemStyle"],blur:[QL,"itemStyle"],select:[JL,"itemStyle"]},CM={normal:["label"],emphasis:[kl,"label"],blur:[QL,"label"],select:[JL,"label"]},oge=["x","y"],lge="e\0\0",ls={normal:{},emphasis:{},blur:{},select:{}},uge={cartesian2d:Hve,geo:$ve,single:qve,polar:Yve,calendar:Kve};function VC(n){return n instanceof Ht}function HC(n){return n instanceof Os}function cge(n,e){e.copyTransform(n),HC(e)&&HC(n)&&(e.setStyle(n.style),e.z=n.z,e.z2=n.z2,e.zlevel=n.zlevel,e.invisible=n.invisible,e.ignore=n.ignore,VC(e)&&VC(n)&&e.setShape(n.shape))}var hge=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i,a){this._progressiveEls=null;var s=this._data,o=t.getData(),l=this.group,u=H5(t,o,r,i);s||l.removeAll(),o.diff(s).add(function(h){EM(i,null,h,u(h,a),t,l,o)}).remove(function(h){var f=s.getItemGraphicEl(h);f&&LS(f,Nl(f).option,t)}).update(function(h,f){var d=s.getItemGraphicEl(f);EM(i,d,h,u(h,a),t,l,o)}).execute();var c=t.get("clip",!0)?U0(t.coordinateSystem,!1,t):null;c?l.setClipPath(c):l.removeClipPath(),this._data=o},e.prototype.incrementalPrepareRender=function(t,r,i){this.group.removeAll(),this._data=null},e.prototype.incrementalRender=function(t,r,i,a,s){var o=r.getData(),l=H5(r,o,i,a),u=this._progressiveEls=[];function c(d){d.isGroup||(d.incremental=!0,d.ensureState("emphasis").hoverLayer=!0)}for(var h=t.start;h<t.end;h++){var f=EM(null,null,h,l(h,s),r,this.group,o);f&&(f.traverse(c),u.push(f))}},e.prototype.eachRendered=function(t){Sc(this._progressiveEls||this.group,t)},e.prototype.filterForExposedEvent=function(t,r,i,a){var s=r.element;if(s==null||i.name===s)return!0;for(;(i=i.__hostTarget||i.parent)&&i!==this.group;)if(i.name===s)return!0;return!1},e.type="custom",e}($n);const fge=hge;function eR(n){var e=n.type,t;if(e==="path"){var r=n.shape,i=r.width!=null&&r.height!=null?{x:r.x||0,y:r.y||0,width:r.width,height:r.height}:null,a=HW(r);t=aS(a,null,i,r.layout||"center"),Nl(t).customPathData=a}else if(e==="image")t=new Pi({}),Nl(t).customImagePath=n.style.image;else if(e==="text")t=new ln({});else if(e==="group")t=new bt;else{if(e==="compoundPath")throw new Error('"compoundPath" is not supported yet.');var s=UP(e);if(!s){var o="";mn(o)}t=new s}return Nl(t).customGraphicType=e,t.name=n.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function tR(n,e,t,r,i,a,s){zW(e);var o=i&&i.normal.cfg;o&&e.setTextConfig(o),r&&r.transition==null&&(r.transition=oge);var l=r&&r.style;if(l){if(e.type==="text"){var u=l;tt(u,"textFill")&&(u.fill=u.textFill),tt(u,"textStroke")&&(u.stroke=u.textStroke)}var c=void 0,h=VC(e)?l.decal:null;n&&h&&(h.dirty=!0,c=wp(h,n)),l.__decalPattern=c}if(HC(e)&&l){var c=l.__decalPattern;c&&(l.decal=c)}H1(e,r,a,{dataIndex:t,isInit:s,clearStyle:!0}),Jx(e,r.keyframeAnimation,a)}function UW(n,e,t,r,i){var a=e.isGroup?null:e,s=i&&i[n].cfg;if(a){var o=a.ensureState(n);if(r===!1){var l=a.getState(n);l&&(l.style=null)}else o.style=r||null;s&&(o.textConfig=s),cf(a)}}function dge(n,e,t){if(!n.isGroup){var r=n,i=t.currentZ,a=t.currentZLevel;r.z=i,r.zlevel=a;var s=e.z2;s!=null&&(r.z2=s||0);for(var o=0;o<gc.length;o++)pge(r,e,gc[o])}}function pge(n,e,t){var r=t===Hu,i=r?e:eb(e,t),a=i?i.z2:null,s;a!=null&&(s=r?n:n.ensureState(t),s.z2=a||0)}function H5(n,e,t,r){var i=n.get("renderItem"),a=n.coordinateSystem,s={};a&&(s=a.prepareCustoms?a.prepareCustoms(a):uge[a.type](a));for(var o=dt({getWidth:r.getWidth,getHeight:r.getHeight,getZr:r.getZr,getDevicePixelRatio:r.getDevicePixelRatio,value:x,style:S,ordinalRawValue:b,styleEmphasis:w,visual:A,barLayout:M,currentSeriesIndices:P,font:D},s.api||{}),l={context:{},seriesId:n.id,seriesName:n.name,seriesIndex:n.seriesIndex,coordSys:s.coordSys,dataInsideLength:e.count(),encode:vge(n.getData())},u,c,h={},f={},d={},p={},g=0;g<gc.length;g++){var v=gc[g];d[v]=n.getModel(TM[v]),p[v]=n.getModel(CM[v])}function m(L){return L===u?c||(c=e.getItemModel(L)):e.getItemModel(L)}function y(L,R){return e.hasItemOption?L===u?h[R]||(h[R]=m(L).getModel(TM[R])):m(L).getModel(TM[R]):d[R]}function _(L,R){return e.hasItemOption?L===u?f[R]||(f[R]=m(L).getModel(CM[R])):m(L).getModel(CM[R]):p[R]}return function(L,R){return u=L,c=null,h={},f={},i&&i(dt({dataIndexInside:L,dataIndex:e.getRawIndex(L),actionType:R?R.type:null},l),o)};function x(L,R){return R==null&&(R=u),e.getStore().get(e.getDimensionIndex(L||0),R)}function b(L,R){R==null&&(R=u),L=L||0;var N=e.getDimensionInfo(L);if(!N){var F=e.getDimensionIndex(L);return F>=0?e.getStore().get(F,R):void 0}var O=e.get(N.name,R),H=N&&N.ordinalMeta;return H?H.categories[O]:O}function S(L,R){R==null&&(R=u);var N=e.getItemVisual(R,"style"),F=N&&N.fill,O=N&&N.opacity,H=y(R,Hu).getItemStyle();F!=null&&(H.fill=F),O!=null&&(H.opacity=O);var U={inheritColor:Ke(F)?F:"#000"},$=_(R,Hu),Y=Hn($,null,U,!1,!0);Y.text=$.getShallow("show")?Et(n.getFormattedLabel(R,Hu),Mp(e,R)):null;var oe=Px($,U,!1);return C(L,H),H=B5(H,Y,oe),L&&T(H,L),H.legacy=!0,H}function w(L,R){R==null&&(R=u);var N=y(R,kl).getItemStyle(),F=_(R,kl),O=Hn(F,null,null,!0,!0);O.text=F.getShallow("show")?Ho(n.getFormattedLabel(R,kl),n.getFormattedLabel(R,Hu),Mp(e,R)):null;var H=Px(F,null,!0);return C(L,N),N=B5(N,O,H),L&&T(N,L),N.legacy=!0,N}function T(L,R){for(var N in R)tt(R,N)&&(L[N]=R[N])}function C(L,R){L&&(L.textFill&&(R.textFill=L.textFill),L.textPosition&&(R.textPosition=L.textPosition))}function A(L,R){if(R==null&&(R=u),tt(O5,L)){var N=e.getItemVisual(R,"style");return N?N[O5[L]]:null}if(tt(Gve,L))return e.getItemVisual(R,L)}function M(L){if(a.type==="cartesian2d"){var R=a.getBaseAxis();return vae(dt({axis:R},L))}}function P(){return t.getCurrentSeriesIndices()}function D(L){return VP(L,t)}}function vge(n){var e={};return z(n.dimensions,function(t){var r=n.getDimensionInfo(t);if(!r.isExtraCoord){var i=r.coordDim,a=e[i]=e[i]||[];a[r.coordDimIndex]=n.getDimensionIndex(t)}}),e}function EM(n,e,t,r,i,a,s){if(!r){a.remove(e);return}var o=nR(n,e,t,r,i,a);return o&&s.setItemGraphicEl(t,o),o&&lr(o,r.focus,r.blurScope,r.emphasisDisabled),o}function nR(n,e,t,r,i,a){var s=-1,o=e;e&&VW(e,r,i)&&(s=Ft(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=eR(r),o&&cge(o,u)),r.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),ls.normal.cfg=ls.normal.conOpt=ls.emphasis.cfg=ls.emphasis.conOpt=ls.blur.cfg=ls.blur.conOpt=ls.select.cfg=ls.select.conOpt=null,ls.isLegacy=!1,mge(u,t,r,i,l,ls),gge(u,t,r,i,l),tR(n,u,t,r,ls,i,l),tt(r,"info")&&(Nl(u).info=r.info);for(var c=0;c<gc.length;c++){var h=gc[c];if(h!==Hu){var f=eb(r,h),d=rR(r,f,h);UW(h,u,f,d,ls)}}return dge(u,r,i),r.type==="group"&&yge(n,u,t,r,i),s>=0?a.replaceAt(u,s):a.add(u),u}function VW(n,e,t){var r=Nl(n),i=e.type,a=e.shape,s=e.style;return t.isUniversalTransitionEnabled()||i!=null&&i!==r.customGraphicType||i==="path"&&Sge(a)&&HW(a)!==r.customPathData||i==="image"&&tt(s,"image")&&s.image!==r.customImagePath}function gge(n,e,t,r,i){var a=t.clipPath;if(a===!1)n&&n.getClipPath()&&n.removeClipPath();else if(a){var s=n.getClipPath();s&&VW(s,a,r)&&(s=null),s||(s=eR(a),n.setClipPath(s)),tR(null,s,e,a,null,r,i)}}function mge(n,e,t,r,i,a){if(!n.isGroup){W5(t,null,a),W5(t,kl,a);var s=a.normal.conOpt,o=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(s!=null||o!=null||u!=null||l!=null){var c=n.getTextContent();if(s===!1)c&&n.removeTextContent();else{s=a.normal.conOpt=s||{type:"text"},c?c.clearStates():(c=eR(s),n.setTextContent(c)),tR(null,c,e,s,null,r,i);for(var h=s&&s.style,f=0;f<gc.length;f++){var d=gc[f];if(d!==Hu){var p=a[d].conOpt;UW(d,c,p,rR(s,p,d),null)}}h?c.dirty():c.markRedraw()}}}}function W5(n,e,t){var r=e?eb(n,e):n,i=e?rR(n,r,kl):n.style,a=n.type,s=r?r.textConfig:null,o=n.textContent,l=o?e?eb(o,e):o:null;if(i&&(t.isLegacy||kW(i,a,!!s,!!l))){t.isLegacy=!0;var u=OW(i,a,!e);!s&&u.textConfig&&(s=u.textConfig),!l&&u.textContent&&(l=u.textContent)}if(!e&&l){var c=l;!c.type&&(c.type="text")}var h=e?t[e]:t.normal;h.cfg=s,h.conOpt=l}function eb(n,e){return e?n?n[e]:null:n}function rR(n,e,t){var r=e&&e.style;return r==null&&t===kl&&n&&(r=n.styleEmphasis),r}function yge(n,e,t,r,i){var a=r.children,s=a?a.length:0,o=r.$mergeChildren,l=o==="byName"||r.diffChildrenByName,u=o===!1;if(!(!s&&!l&&!u)){if(l){xge({api:n,oldChildren:e.children()||[],newChildren:a||[],dataIndex:t,seriesModel:i,group:e});return}u&&e.removeAll();for(var c=0;c<s;c++){var h=a[c],f=e.childAt(c);h?(h.ignore==null&&(h.ignore=!1),nR(n,f,t,h,i,e)):f.ignore=!0}for(var d=e.childCount()-1;d>=c;d--){var p=e.childAt(d);_ge(e,p,i)}}}function _ge(n,e,t){e&&LS(e,Nl(n).option,t)}function xge(n){new Vl(n.oldChildren,n.newChildren,$5,$5,n).add(j5).update(j5).remove(bge).execute()}function $5(n,e){var t=n&&n.name;return t!=null?t:lge+e}function j5(n,e){var t=this.context,r=n!=null?t.newChildren[n]:null,i=e!=null?t.oldChildren[e]:null;nR(t.api,i,t.dataIndex,r,t.seriesModel,t.group)}function bge(n){var e=this.context,t=e.oldChildren[n];t&&LS(t,Nl(t).option,e.seriesModel)}function HW(n){return n&&(n.pathData||n.d)}function Sge(n){return n&&(tt(n,"pathData")||tt(n,"d"))}function wge(n){n.registerChartView(fge),n.registerSeriesModel(Uve)}var wh=en(),q5=yt,PM=Qe,Age=function(){function n(){this._dragging=!1,this.animationThreshold=15}return n.prototype.render=function(e,t,r,i){var a=t.get("value"),s=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=r,!(!i&&this._lastValue===a&&this._lastStatus===s)){this._lastValue=a,this._lastStatus=s;var o=this._group,l=this._handle;if(!s||s==="hide"){o&&o.hide(),l&&l.hide();return}o&&o.show(),l&&l.show();var u={};this.makeElOption(u,a,e,t,r);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(r),this._lastGraphicKey=c;var h=this._moveAnimation=this.determineAnimation(e,t);if(!o)o=this._group=new bt,this.createPointerEl(o,u,e,t),this.createLabelEl(o,u,e,t),r.getZr().add(o);else{var f=Rt(X5,t,h);this.updatePointerEl(o,u,f),this.updateLabelEl(o,u,f,t)}K5(o,t,!0),this._renderHandle(a)}},n.prototype.remove=function(e){this.clear(e)},n.prototype.dispose=function(e){this.clear(e)},n.prototype.determineAnimation=function(e,t){var r=t.get("animation"),i=e.axis,a=i.type==="category",s=t.get("snap");if(!s&&!a)return!1;if(r==="auto"||r==null){var o=this.animationThreshold;if(a&&i.getBandWidth()>o)return!0;if(s){var l=ML(e).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>o}return!1}return r===!0},n.prototype.makeElOption=function(e,t,r,i,a){},n.prototype.createPointerEl=function(e,t,r,i){var a=t.pointer;if(a){var s=wh(e).pointerEl=new Af[a.type](q5(t.pointer));e.add(s)}},n.prototype.createLabelEl=function(e,t,r,i){if(t.label){var a=wh(e).labelEl=new ln(q5(t.label));e.add(a),Y5(a,i)}},n.prototype.updatePointerEl=function(e,t,r){var i=wh(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),r(i,{shape:t.pointer.shape}))},n.prototype.updateLabelEl=function(e,t,r,i){var a=wh(e).labelEl;a&&(a.setStyle(t.label.style),r(a,{x:t.label.x,y:t.label.y}),Y5(a,i))},n.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,r=this._api.getZr(),i=this._handle,a=t.getModel("handle"),s=t.get("status");if(!a.get("show")||!s||s==="hide"){i&&r.remove(i),this._handle=null;return}var o;this._handle||(o=!0,i=this._handle=N0(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Bl(u.event)},onmousedown:PM(this._onHandleDragMove,this,0,0),drift:PM(this._onHandleDragMove,this),ondragend:PM(this._onHandleDragEnd,this)}),r.add(i)),K5(i,t,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");Ie(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,rv(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,o)}},n.prototype._moveHandleToValue=function(e,t){X5(this._axisPointerModel,!t&&this._moveAnimation,this._handle,LM(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},n.prototype._onHandleDragMove=function(e,t){var r=this._handle;if(r){this._dragging=!0;var i=this.updateHandleTransform(LM(r),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,r.stopAnimation(),r.attr(LM(i)),wh(r).lastProp=null,this._doDispatchAxisPointer()}},n.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var t=this._payloadInfo,r=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:r.axis.dim,axisIndex:r.componentIndex}]})}},n.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"})}},n.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),r=this._group,i=this._handle;t&&r&&(this._lastGraphicKey=null,r&&t.remove(r),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),qm(this,"_doDispatchAxisPointer")},n.prototype.doClear=function(){},n.prototype.buildLabel=function(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}},n}();function X5(n,e,t,r){WW(wh(t).lastProp,r)||(wh(t).lastProp=r,e?cn(t,r,n):(t.stopAnimation(),t.attr(r)))}function WW(n,e){if(gt(n)&&gt(e)){var t=!0;return z(e,function(r,i){t=t&&WW(n[i],r)}),!!t}else return n===e}function Y5(n,e){n[e.get(["label","show"])?"show":"hide"]()}function LM(n){return{x:n.x||0,y:n.y||0,rotation:n.rotation||0}}function K5(n,e,t){var r=e.get("z"),i=e.get("zlevel");n&&n.traverse(function(a){a.type!=="group"&&(r!=null&&(a.z=r),i!=null&&(a.zlevel=i),a.silent=t)})}const iR=Age;function aR(n){var e=n.get("type"),t=n.getModel(e+"Style"),r;return e==="line"?(r=t.getLineStyle(),r.fill=null):e==="shadow"&&(r=t.getAreaStyle(),r.stroke=null),r}function $W(n,e,t,r,i){var a=t.get("value"),s=jW(a,e.axis,e.ecModel,t.get("seriesDataIndices"),{precision:t.get(["label","precision"]),formatter:t.get(["label","formatter"])}),o=t.getModel("label"),l=Qp(o.get("padding")||0),u=o.getFont(),c=L0(s,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),Mge(h,f,d,r);var v=o.get("backgroundColor");(!v||v==="auto")&&(v=e.get(["axisLine","lineStyle","color"])),n.label={x:h[0],y:h[1],style:Hn(o,{text:s,font:u,fill:o.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function Mge(n,e,t,r){var i=r.getWidth(),a=r.getHeight();n[0]=Math.min(n[0]+e,i)-e,n[1]=Math.min(n[1]+t,a)-t,n[0]=Math.max(n[0],0),n[1]=Math.max(n[1],0)}function jW(n,e,t,r,i){n=e.scale.parse(n);var a=e.scale.getLabel({value:n},{precision:i.precision}),s=i.formatter;if(s){var o={value:vL(e,{value:n}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};z(r,function(l){var u=t.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,h=u&&u.getDataParams(c);h&&o.seriesData.push(h)}),Ke(s)?a=s.replace("{value}",a):ct(s)&&(a=s(o))}return a}function sR(n,e,t){var r=Za();return Sf(r,r,t.rotation),Ko(r,r,t.position),so([n.dataToCoord(e),(t.labelOffset||0)+(t.labelDirection||1)*(t.labelMargin||0)],r)}function qW(n,e,t,r,i,a){var s=Hl.innerTextLayout(t.rotation,0,t.labelDirection);t.labelMargin=i.get(["label","margin"]),$W(e,r,i,a,{position:sR(r.axis,n,t),align:s.textAlign,verticalAlign:s.textVerticalAlign})}function oR(n,e,t){return t=t||0,{x1:n[t],y1:n[1-t],x2:e[t],y2:e[1-t]}}function XW(n,e,t){return t=t||0,{x:n[t],y:n[1-t],width:e[t],height:e[1-t]}}function Z5(n,e,t,r,i,a){return{cx:n,cy:e,r0:t,r,startAngle:i,endAngle:a,clockwise:!0}}var Tge=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,s){var o=i.axis,l=o.grid,u=a.get("type"),c=Q5(l,o).getOtherAxis(o).getGlobalExtent(),h=o.toGlobalCoord(o.dataToCoord(r,!0));if(u&&u!=="none"){var f=aR(a),d=Cge[u](o,h,c);d.style=f,t.graphicKey=d.type,t.pointer=d}var p=MC(l.model,i);qW(r,t,p,i,a,s)},e.prototype.getHandleTransform=function(t,r,i){var a=MC(r.axis.grid.model,r,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var s=sR(r.axis,t,a);return{x:s[0],y:s[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,r,i,a){var s=i.axis,o=s.grid,l=s.getGlobalExtent(!0),u=Q5(o,s).getOtherAxis(s).getGlobalExtent(),c=s.dim==="x"?0:1,h=[t.x,t.y];h[c]+=r[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}(iR);function Q5(n,e){var t={};return t[e.dim+"AxisIndex"]=e.index,n.getCartesian(t)}var Cge={line:function(n,e,t){var r=oR([e,t[0]],[e,t[1]],J5(n));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(n,e,t){var r=Math.max(1,n.getBandWidth()),i=t[1]-t[0];return{type:"Rect",shape:XW([e-r/2,t[0]],[r,i],J5(n))}}};function J5(n){return n.dim==="x"?0:1}const Ege=Tge;var Pge=function(n){ve(e,n);function e(){var t=n!==null&&n.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}(sn);const Lge=Pge;var El=en(),Rge=z;function YW(n,e,t){if(!on.node){var r=e.getZr();El(r).records||(El(r).records={}),Dge(r,e);var i=El(r).records[n]||(El(r).records[n]={});i.handler=t}}function Dge(n,e){if(El(n).initialized)return;El(n).initialized=!0,t("click",Rt(eO,"click")),t("mousemove",Rt(eO,"mousemove")),t("globalout",Nge);function t(r,i){n.on(r,function(a){var s=kge(e);Rge(El(n).records,function(o){o&&i(o,a,s.dispatchAction)}),Ige(s.pendings,e)})}}function Ige(n,e){var t=n.showTip.length,r=n.hideTip.length,i;t?i=n.showTip[t-1]:r&&(i=n.hideTip[r-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function Nge(n,e,t){n.handler("leave",null,t)}function eO(n,e,t,r){e.handler(n,t,r)}function kge(n){var e={showTip:[],hideTip:[]},t=function(r){var i=e[r.type];i?i.push(r):(r.dispatchAction=t,n.dispatchAction(r))};return{dispatchAction:t,pendings:e}}function WC(n,e){if(!on.node){var t=e.getZr(),r=(El(t).records||{})[n];r&&(El(t).records[n]=null)}}var Oge=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=r.getComponent("tooltip"),s=t.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";YW("axisPointer",i,function(o,l,u){s!=="none"&&(o==="leave"||s.indexOf(o)>=0)&&u({type:"updateAxisPointer",currTrigger:o,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(t,r){WC("axisPointer",r)},e.prototype.dispose=function(t,r){WC("axisPointer",r)},e.type="axisPointer",e}(fr);const Fge=Oge;function KW(n,e){var t=[],r=n.seriesIndex,i;if(r==null||!(i=e.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),s=lf(a,n);if(s==null||s<0||Ie(s))return{point:[]};var o=a.getItemGraphicEl(s),l=i.coordinateSystem;if(i.getTooltipPosition)t=i.getTooltipPosition(s)||[];else if(l&&l.dataToPoint)if(n.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,s),g[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),s),t=l.dataToPoint(g)||[]}else t=l.dataToPoint(a.getValues(Ne(l.dimensions,function(m){return a.mapDimension(m)}),s))||[];else if(o){var v=o.getBoundingRect().clone();v.applyTransform(o.transform),t=[v.x+v.width/2,v.y+v.height/2]}return{point:t,el:o}}var tO=en();function Bge(n,e,t){var r=n.currTrigger,i=[n.x,n.y],a=n,s=n.dispatchAction||Qe(t.dispatchAction,t),o=e.getComponent("axisPointer").coordSysAxesInfo;if(o){W1(i)&&(i=KW({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=W1(i),u=a.axesInfo,c=o.axesInfo,h=r==="leave"||W1(i),f={},d={},p={list:[],map:{}},g={showPointer:Rt(zge,d),showTooltip:Rt(Uge,p)};z(o.coordSysMap,function(m,y){var _=l||m.containPoint(i);z(o.coordSysAxesInfo[y],function(x,b){var S=x.axis,w=$ge(u,x);if(!h&&_&&(!u||w)){var T=w&&w.value;T==null&&!l&&(T=S.pointToData(i)),T!=null&&nO(x,T,g,!1,f)}})});var v={};return z(c,function(m,y){var _=m.linkGroup;_&&!d[y]&&z(_.axesInfo,function(x,b){var S=d[b];if(x!==m&&S){var w=S.value;_.mapper&&(w=m.axis.scale.parse(_.mapper(w,rO(x),rO(m)))),v[m.key]=w}})}),z(v,function(m,y){nO(c[y],m,g,!0,f)}),Vge(d,c,f),Hge(p,i,n,s),Wge(c,s,t),f}}function nO(n,e,t,r,i){var a=n.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!n.involveSeries){t.showPointer(n,e);return}var s=Gge(e,n),o=s.payloadBatch,l=s.snapToValue;o[0]&&i.seriesIndex==null&&Pe(i,o[0]),!r&&n.snap&&a.containData(l)&&l!=null&&(e=l),t.showPointer(n,e,o),t.showTooltip(n,s,l)}}function Gge(n,e){var t=e.axis,r=t.dim,i=n,a=[],s=Number.MAX_VALUE,o=-1;return z(e.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(r),h,f;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,n,t);f=d.dataIndices,h=d.nestestValue}else{if(f=l.getData().indicesOfNearest(c[0],n,t.type==="category"?.5:null),!f.length)return;h=l.getData().get(c[0],f[0])}if(!(h==null||!isFinite(h))){var p=n-h,g=Math.abs(p);g<=s&&((g<s||p>=0&&o<0)&&(s=g,o=p,i=h,a.length=0),z(f,function(v){a.push({seriesIndex:l.seriesIndex,dataIndexInside:v,dataIndex:l.getData().getRawIndex(v)})}))}}),{payloadBatch:a,snapToValue:i}}function zge(n,e,t,r){n[e.key]={value:t,payloadBatch:r}}function Uge(n,e,t,r){var i=t.payloadBatch,a=e.axis,s=a.model,o=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,u=Jm(l),c=n.map[u];c||(c=n.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},n.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:s.componentIndex,axisType:s.type,axisId:s.id,value:r,valueLabelOpt:{precision:o.get(["label","precision"]),formatter:o.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function Vge(n,e,t){var r=t.axesInfo=[];z(e,function(i,a){var s=i.axisPointerModel.option,o=n[a];o?(!i.useHandle&&(s.status="show"),s.value=o.value,s.seriesDataIndices=(o.payloadBatch||[]).slice()):!i.useHandle&&(s.status="hide"),s.status==="show"&&r.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:s.value})})}function Hge(n,e,t,r){if(W1(e)||!n.list.length){r({type:"hideTip"});return}var i=((n.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({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:n.list})}function Wge(n,e,t){var r=t.getZr(),i="axisPointerLastHighlights",a=tO(r)[i]||{},s=tO(r)[i]={};z(n,function(u,c){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&z(h.seriesDataIndices,function(f){var d=f.seriesIndex+" | "+f.dataIndex;s[d]=f})});var o=[],l=[];z(a,function(u,c){!s[c]&&l.push(u)}),z(s,function(u,c){!a[c]&&o.push(u)}),l.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),o.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:o})}function $ge(n,e){for(var t=0;t<(n||[]).length;t++){var r=n[t];if(e.axis.dim===r.axisDim&&e.axis.model.componentIndex===r.axisIndex)return r}}function rO(n){var e=n.axis.model,t={},r=t.axisDim=n.axis.dim;return t.axisIndex=t[r+"AxisIndex"]=e.componentIndex,t.axisName=t[r+"AxisName"]=e.name,t.axisId=t[r+"AxisId"]=e.id,t}function W1(n){return!n||n[0]==null||isNaN(n[0])||n[1]==null||isNaN(n[1])}function q0(n){Pf.registerAxisPointerClass("CartesianAxisPointer",Ege),n.registerComponentModel(Lge),n.registerComponentView(Fge),n.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!Ie(t)&&(e.axisPointer.link=[t])}}),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=Dle(e,t)}),n.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},Bge)}function jge(n){Vt(SH),Vt(q0)}var qge=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,s){var o=i.axis;o.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=o.polar,u=l.getOtherAxis(o),c=u.getExtent(),h=o.dataToCoord(r),f=a.get("type");if(f&&f!=="none"){var d=aR(a),p=Yge[f](o,l,h,c);p.style=d,t.graphicKey=p.type,t.pointer=p}var g=a.get(["label","margin"]),v=Xge(r,i,a,l,g);$W(t,i,a,s,v)},e}(iR);function Xge(n,e,t,r,i){var a=e.axis,s=a.dataToCoord(n),o=r.getAngleAxis().getExtent()[0];o=o/180*Math.PI;var l=r.getRadiusAxis().getExtent(),u,c,h;if(a.dim==="radius"){var f=Za();Sf(f,f,o),Ko(f,f,[r.cx,r.cy]),u=so([s,-i],f);var d=e.getModel("axisLabel").get("rotate")||0,p=Hl.innerTextLayout(o,d*Math.PI/180,-1);c=p.textAlign,h=p.textVerticalAlign}else{var g=l[1];u=r.coordToPoint([g+i,s]);var v=r.cx,m=r.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 Yge={line:function(n,e,t,r){return n.dim==="angle"?{type:"Line",shape:oR(e.coordToPoint([r[0],t]),e.coordToPoint([r[1],t]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:t}}},shadow:function(n,e,t,r){var i=Math.max(1,n.getBandWidth()),a=Math.PI/180;return n.dim==="angle"?{type:"Sector",shape:Z5(e.cx,e.cy,r[0],r[1],(-t-i/2)*a,(-t+i/2)*a)}:{type:"Sector",shape:Z5(e.cx,e.cy,t-i/2,t+i/2,0,Math.PI*2)}}};const Kge=qge;var Zge=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.findAxisModel=function(t){var r,i=this.ecModel;return i.eachComponent(t,function(a){a.getCoordSysModel()===this&&(r=a)},this),r},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(sn);const Qge=Zge;var lR=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Fr).models[0]},e.type="polarAxis",e}(sn);zr(lR,B0);var Jge=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="angleAxis",e}(lR),eme=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="radiusAxis",e}(lR),uR=function(n){ve(e,n);function e(t,r){return n.call(this,"radius",t,r)||this}return e.prototype.pointToData=function(t,r){return this.polar.pointToData(t,r)[this.dim==="radius"?0:1]},e}(po);uR.prototype.dataToRadius=po.prototype.dataToCoord;uR.prototype.radiusToData=po.prototype.coordToData;const tme=uR;var nme=en(),cR=function(n){ve(e,n);function e(t,r){return n.call(this,"angle",t,r||[0,360])||this}return e.prototype.pointToData=function(t,r){return this.polar.pointToData(t,r)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,r=t.getLabelModel(),i=t.scale,a=i.getExtent(),s=i.count();if(a[1]-a[0]<1)return 0;var o=a[0],l=t.dataToCoord(o+1)-t.dataToCoord(o),u=Math.abs(l),c=L0(o==null?"":o+"",r.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=nme(t.model),g=p.lastAutoInterval,v=p.lastTickCount;return g!=null&&v!=null&&Math.abs(g-d)<=1&&Math.abs(v-s)<=1&&g>d?d=g:(p.lastTickCount=s,p.lastAutoInterval=d),d},e}(po);cR.prototype.dataToAngle=po.prototype.dataToCoord;cR.prototype.angleToData=po.prototype.coordToData;const rme=cR;var ZW=["radius","angle"],ime=function(){function n(e){this.dimensions=ZW,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new tme,this._angleAxis=new rme,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return n.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},n.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},n.prototype.getAxis=function(e){var t="_"+e+"Axis";return this[t]},n.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},n.prototype.getAxesByScale=function(e){var t=[],r=this._angleAxis,i=this._radiusAxis;return r.scale.type===e&&t.push(r),i.scale.type===e&&t.push(i),t},n.prototype.getAngleAxis=function(){return this._angleAxis},n.prototype.getRadiusAxis=function(){return this._radiusAxis},n.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},n.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},n.prototype.getTooltipAxes=function(e){var t=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},n.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},n.prototype.pointToData=function(e,t){var r=this.pointToCoord(e);return[this._radiusAxis.radiusToData(r[0],t),this._angleAxis.angleToData(r[1],t)]},n.prototype.pointToCoord=function(e){var t=e[0]-this.cx,r=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),s=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);i.inverse?s=o-360:o=s+360;var l=Math.sqrt(t*t+r*r);t/=l,r/=l;for(var u=Math.atan2(-r,t)/Math.PI*180,c=u<s?1:-1;u<s||u>o;)u+=c*360;return[l,u]},n.prototype.coordToPoint=function(e){var t=e[0],r=e[1]/180*Math.PI,i=Math.cos(r)*t+this.cx,a=-Math.sin(r)*t+this.cy;return[i,a]},n.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis(),r=t.getExtent().slice();r[0]>r[1]&&r.reverse();var i=e.getExtent(),a=Math.PI/180,s=1e-4;return{cx:this.cx,cy:this.cy,r0:r[0],r:r[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:e.inverse,contain:function(o,l){var u=o-this.cx,c=l-this.cy,h=u*u+c*c,f=this.r,d=this.r0;return f!==d&&h-s<=f*f&&h+s>=d*d}}},n.prototype.convertToPixel=function(e,t,r){var i=iO(t);return i===this?this.dataToPoint(r):null},n.prototype.convertFromPixel=function(e,t,r){var i=iO(t);return i===this?this.pointToData(r):null},n}();function iO(n){var e=n.seriesModel,t=n.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}const ame=ime;function sme(n,e,t){var r=e.get("center"),i=t.getWidth(),a=t.getHeight();n.cx=Xe(r[0],i),n.cy=Xe(r[1],a);var s=n.getRadiusAxis(),o=Math.min(i,a)/2,l=e.get("radius");l==null?l=[0,"100%"]:Ie(l)||(l=[0,l]);var u=[Xe(l[0],o),Xe(l[1],o)];s.inverse?s.setExtent(u[1],u[0]):s.setExtent(u[0],u[1])}function ome(n,e){var t=this,r=t.getAngleAxis(),i=t.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),n.eachSeries(function(o){if(o.coordinateSystem===t){var l=o.getData();z(zx(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),z(zx(l,"angle"),function(u){r.scale.unionExtentFromData(l,u)})}}),Ap(r.scale,r.model),Ap(i.scale,i.model),r.type==="category"&&!r.onBand){var a=r.getExtent(),s=360/r.scale.count();r.inverse?a[1]+=s:a[1]-=s,r.setExtent(a[0],a[1])}}function lme(n){return n.mainType==="angleAxis"}function aO(n,e){var t;if(n.type=e.get("type"),n.scale=wS(e),n.onBand=e.get("boundaryGap")&&n.type==="category",n.inverse=e.get("inverse"),lme(e)){n.inverse=n.inverse!==e.get("clockwise");var r=e.get("startAngle"),i=(t=e.get("endAngle"))!==null&&t!==void 0?t:r+(n.inverse?-360:360);n.setExtent(r,i)}e.axis=n,n.model=e}var ume={dimensions:ZW,create:function(n,e){var t=[];return n.eachComponent("polar",function(r,i){var a=new ame(i+"");a.update=ome;var s=a.getRadiusAxis(),o=a.getAngleAxis(),l=r.findAxisModel("radiusAxis"),u=r.findAxisModel("angleAxis");aO(s,l),aO(o,u),sme(a,r,e),t.push(a),r.coordinateSystem=a,a.model=r}),n.eachSeries(function(r){if(r.get("coordinateSystem")==="polar"){var i=r.getReferringComponents("polar",Fr).models[0];r.coordinateSystem=i.coordinateSystem}}),t}};const cme=ume;var hme=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function c_(n,e,t){e[1]>e[0]&&(e=e.slice().reverse());var r=n.coordToPoint([e[0],t]),i=n.coordToPoint([e[1],t]);return{x1:r[0],y1:r[1],x2:i[0],y2:i[1]}}function h_(n){var e=n.getRadiusAxis();return e.inverse?0:1}function sO(n){var e=n[0],t=n[n.length-1];e&&t&&Math.abs(Math.abs(e.coord-t.coord)-360)<1e-4&&n.pop()}var fme=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,r){if(this.group.removeAll(),!!t.get("show")){var i=t.axis,a=i.polar,s=a.getRadiusAxis().getExtent(),o=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=Ne(i.getViewLabels(),function(c){c=yt(c);var h=i.scale,f=h.type==="ordinal"?h.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(f),c});sO(u),sO(o),z(hme,function(c){t.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&dme[c](this.group,t,a,o,l,s,u)},this)}},e.type="angleAxis",e}(Pf),dme={axisLine:function(n,e,t,r,i,a){var s=e.getModel(["axisLine","lineStyle"]),o=t.getAngleAxis(),l=Math.PI/180,u=o.getExtent(),c=h_(t),h=c?0:1,f,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[h]===0?f=new Af[d]({shape:{cx:t.cx,cy:t.cy,r:a[c],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:o.inverse},style:s.getLineStyle(),z2:1,silent:!0}):f=new rS({shape:{cx:t.cx,cy:t.cy,r:a[c],r0:a[h]},style:s.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,n.add(f)},axisTick:function(n,e,t,r,i,a){var s=e.getModel("axisTick"),o=(s.get("inside")?-1:1)*s.get("length"),l=a[h_(t)],u=Ne(r,function(c){return new pi({shape:c_(t,[l,l+o],c.coord)})});n.add(Ms(u,{style:dt(s.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(n,e,t,r,i,a){if(i.length){for(var s=e.getModel("axisTick"),o=e.getModel("minorTick"),l=(s.get("inside")?-1:1)*o.get("length"),u=a[h_(t)],c=[],h=0;h<i.length;h++)for(var f=0;f<i[h].length;f++)c.push(new pi({shape:c_(t,[u,u+l],i[h][f].coord)}));n.add(Ms(c,{style:dt(o.getModel("lineStyle").getLineStyle(),dt(s.getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(n,e,t,r,i,a,s){var o=e.getCategories(!0),l=e.getModel("axisLabel"),u=l.get("margin"),c=e.get("triggerEvent");z(s,function(h,f){var d=l,p=h.tickValue,g=a[h_(t)],v=t.coordToPoint([g+u,h.coord]),m=t.cx,y=t.cy,_=Math.abs(v[0]-m)/g<.3?"center":v[0]>m?"left":"right",x=Math.abs(v[1]-y)/g<.3?"middle":v[1]>y?"top":"bottom";if(o&&o[p]){var b=o[p];gt(b)&&b.textStyle&&(d=new Wn(b.textStyle,l,l.ecModel))}var S=new ln({silent:Hl.isLabelSilent(e),style:Hn(d,{x:v[0],y:v[1],fill:d.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:h.formattedLabel,align:_,verticalAlign:x})});if(n.add(S),c){var w=Hl.makeAxisEventDataBase(e);w.targetType="axisLabel",w.value=h.rawLabel,St(S).eventData=w}},this)},splitLine:function(n,e,t,r,i,a){var s=e.getModel("splitLine"),o=s.getModel("lineStyle"),l=o.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=0;h<r.length;h++){var f=u++%l.length;c[f]=c[f]||[],c[f].push(new pi({shape:c_(t,a,r[h].coord)}))}for(var h=0;h<c.length;h++)n.add(Ms(c[h],{style:dt({stroke:l[h%l.length]},o.getLineStyle()),silent:!0,z:e.get("z")}))},minorSplitLine:function(n,e,t,r,i,a){if(i.length){for(var s=e.getModel("minorSplitLine"),o=s.getModel("lineStyle"),l=[],u=0;u<i.length;u++)for(var c=0;c<i[u].length;c++)l.push(new pi({shape:c_(t,a,i[u][c].coord)}));n.add(Ms(l,{style:o.getLineStyle(),silent:!0,z:e.get("z")}))}},splitArea:function(n,e,t,r,i,a){if(r.length){var s=e.getModel("splitArea"),o=s.getModel("areaStyle"),l=o.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=Math.PI/180,f=-r[0].coord*h,d=Math.min(a[0],a[1]),p=Math.max(a[0],a[1]),g=e.get("clockwise"),v=1,m=r.length;v<=m;v++){var y=v===m?r[0].coord:r[v].coord,_=u++%l.length;c[_]=c[_]||[],c[_].push(new La({shape:{cx:t.cx,cy:t.cy,r0:d,r:p,startAngle:f,endAngle:-y*h,clockwise:g},silent:!0})),f=-y*h}for(var v=0;v<c.length;v++)n.add(Ms(c[v],{style:dt({fill:l[v%l.length]},o.getAreaStyle()),silent:!0}))}}};const pme=fme;var vme=["axisLine","axisTickLabel","axisName"],gme=["splitLine","splitArea","minorSplitLine"],mme=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,r){if(this.group.removeAll(),!!t.get("show")){var i=this._axisGroup,a=this._axisGroup=new bt;this.group.add(a);var s=t.axis,o=s.polar,l=o.getAngleAxis(),u=s.getTicksCoords(),c=s.getMinorTicksCoords(),h=l.getExtent()[0],f=s.getExtent(),d=_me(o,t,h),p=new Hl(t,d);z(vme,p.add,p),a.add(p.getGroup()),I0(i,a,t),z(gme,function(g){t.get([g,"show"])&&!s.scale.isBlank()&&yme[g](this.group,t,o,h,f,u,c)},this)}},e.type="radiusAxis",e}(Pf),yme={splitLine:function(n,e,t,r,i,a){var s=e.getModel("splitLine"),o=s.getModel("lineStyle"),l=o.get("color"),u=0,c=t.getAngleAxis(),h=Math.PI/180,f=c.getExtent(),d=Math.abs(f[1]-f[0])===360?"Circle":"Arc";l=l instanceof Array?l:[l];for(var p=[],g=0;g<a.length;g++){var v=u++%l.length;p[v]=p[v]||[],p[v].push(new Af[d]({shape:{cx:t.cx,cy:t.cy,r:Math.max(a[g].coord,0),startAngle:-f[0]*h,endAngle:-f[1]*h,clockwise:c.inverse}}))}for(var g=0;g<p.length;g++)n.add(Ms(p[g],{style:dt({stroke:l[g%l.length],fill:null},o.getLineStyle()),silent:!0}))},minorSplitLine:function(n,e,t,r,i,a,s){if(s.length){for(var o=e.getModel("minorSplitLine"),l=o.getModel("lineStyle"),u=[],c=0;c<s.length;c++)for(var h=0;h<s[c].length;h++)u.push(new bc({shape:{cx:t.cx,cy:t.cy,r:s[c][h].coord}}));n.add(Ms(u,{style:dt({fill:null},l.getLineStyle()),silent:!0}))}},splitArea:function(n,e,t,r,i,a){if(a.length){var s=e.getModel("splitArea"),o=s.getModel("areaStyle"),l=o.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=a[0].coord,f=1;f<a.length;f++){var d=u++%l.length;c[d]=c[d]||[],c[d].push(new La({shape:{cx:t.cx,cy:t.cy,r0:h,r:a[f].coord,startAngle:0,endAngle:Math.PI*2},silent:!0})),h=a[f].coord}for(var f=0;f<c.length;f++)n.add(Ms(c[f],{style:dt({fill:l[f%l.length]},o.getAreaStyle()),silent:!0}))}}};function _me(n,e,t){return{position:[n.cx,n.cy],rotation:t/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}const xme=mme;function QW(n){return n.get("stack")||"__ec_stack_"+n.seriesIndex}function JW(n,e){return e.dim+n.model.componentIndex}function bme(n,e,t){var r={},i=Sme(_n(e.getSeriesByType(n),function(a){return!e.isSeriesFiltered(a)&&a.coordinateSystem&&a.coordinateSystem.type==="polar"}));e.eachSeriesByType(n,function(a){if(a.coordinateSystem.type==="polar"){var s=a.getData(),o=a.coordinateSystem,l=o.getBaseAxis(),u=JW(o,l),c=QW(a),h=i[u][c],f=h.offset,d=h.width,p=o.getOtherAxis(l),g=a.coordinateSystem.cx,v=a.coordinateSystem.cy,m=a.get("barMinHeight")||0,y=a.get("barMinAngle")||0;r[c]=r[c]||[];for(var _=s.mapDimension(p.dim),x=s.mapDimension(l.dim),b=dc(s,_),S=l.dim!=="radius"||!a.get("roundCap",!0),w=p.model,T=w.get("startValue"),C=p.dataToCoord(T||0),A=0,M=s.count();A<M;A++){var P=s.get(_,A),D=s.get(x,A),L=P>=0?"p":"n",R=C;b&&(r[c][D]||(r[c][D]={p:C,n:C}),R=r[c][D][L]);var N=void 0,F=void 0,O=void 0,H=void 0;if(p.dim==="radius"){var U=p.dataToCoord(P)-C,$=l.dataToCoord(D);Math.abs(U)<m&&(U=(U<0?-1:1)*m),N=R,F=R+U,O=$-f,H=O-d,b&&(r[c][D][L]=F)}else{var Y=p.dataToCoord(P,S)-C,oe=l.dataToCoord(D);Math.abs(Y)<y&&(Y=(Y<0?-1:1)*y),N=oe+f,F=N+d,O=R,H=R+Y,b&&(r[c][D][L]=H)}s.setItemLayout(A,{cx:g,cy:v,r0:N,r:F,startAngle:-O*Math.PI/180,endAngle:-H*Math.PI/180,clockwise:O>=H})}}})}function Sme(n){var e={};z(n,function(r,i){var a=r.getData(),s=r.coordinateSystem,o=s.getBaseAxis(),l=JW(s,o),u=o.getExtent(),c=o.type==="category"?o.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=QW(r);f[d]||h.autoWidthCount++,f[d]=f[d]||{width:0,maxWidth:0};var p=Xe(r.get("barWidth"),c),g=Xe(r.get("barMaxWidth"),c),v=r.get("barGap"),m=r.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 z(e,function(r,i){t[i]={};var a=r.stacks,s=r.bandWidth,o=Xe(r.categoryGap,s),l=Xe(r.gap,1),u=r.remainedWidth,c=r.autoWidthCount,h=(u-o)/(c+(c-1)*l);h=Math.max(h,0),z(a,function(g,v){var m=g.maxWidth;m&&m<h&&(m=Math.min(m,u),g.width&&(m=Math.min(m,g.width)),u-=m,g.width=m,c--)}),h=(u-o)/(c+(c-1)*l),h=Math.max(h,0);var f=0,d;z(a,function(g,v){g.width||(g.width=h),d=g,f+=g.width*(1+l)}),d&&(f-=d.width*l);var p=-f/2;z(a,function(g,v){t[i][v]=t[i][v]||{offset:p,width:g.width},p+=g.width*(1+l)})}),t}var wme={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},Ame={splitNumber:5},Mme=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="polar",e}(fr);function Tme(n){Vt(q0),Pf.registerAxisPointerClass("PolarAxisPointer",Kge),n.registerCoordinateSystem("polar",cme),n.registerComponentModel(Qge),n.registerComponentView(Mme),Tp(n,"angle",Jge,wme),Tp(n,"radius",eme,Ame),n.registerComponentView(pme),n.registerComponentView(xme),n.registerLayout(Rt(bme,"bar"))}function $C(n,e){e=e||{};var t=n.coordinateSystem,r=n.axis,i={},a=r.position,s=r.orient,o=t.getRect(),l=[o.x,o.x+o.width,o.y,o.y+o.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};i.position=[s==="vertical"?u.vertical[a]:l[0],s==="horizontal"?u.horizontal[a]:l[3]];var c={horizontal:0,vertical:1};i.rotation=Math.PI/2*c[s];var h={top:-1,bottom:1,right:1,left:-1};i.labelDirection=i.tickDirection=i.nameDirection=h[a],n.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),di(e.labelInside,n.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var f=e.rotate;return f==null&&(f=n.get(["axisLabel","rotate"])),i.labelRotation=a==="top"?-f:f,i.z2=1,i}var Cme=["axisLine","axisTickLabel","axisName"],Eme=["splitArea","splitLine"],Pme=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="SingleAxisPointer",t}return e.prototype.render=function(t,r,i,a){var s=this.group;s.removeAll();var o=this._axisGroup;this._axisGroup=new bt;var l=$C(t),u=new Hl(t,l);z(Cme,u.add,u),s.add(this._axisGroup),s.add(u.getGroup()),z(Eme,function(c){t.get([c,"show"])&&Lme[c](this,this.group,this._axisGroup,t)},this),I0(o,this._axisGroup,t),n.prototype.render.call(this,t,r,i,a)},e.prototype.remove=function(){_H(this)},e.type="singleAxis",e}(Pf),Lme={splitLine:function(n,e,t,r){var i=r.axis;if(!i.scale.isBlank()){var a=r.getModel("splitLine"),s=a.getModel("lineStyle"),o=s.get("color");o=o instanceof Array?o:[o];for(var l=s.get("width"),u=r.coordinateSystem.getRect(),c=i.isHorizontal(),h=[],f=0,d=i.getTicksCoords({tickModel:a}),p=[],g=[],v=0;v<d.length;++v){var m=i.toGlobalCoord(d[v].coord);c?(p[0]=m,p[1]=u.y,g[0]=m,g[1]=u.y+u.height):(p[0]=u.x,p[1]=m,g[0]=u.x+u.width,g[1]=m);var y=new pi({shape:{x1:p[0],y1:p[1],x2:g[0],y2:g[1]},silent:!0});bp(y.shape,l);var _=f++%o.length;h[_]=h[_]||[],h[_].push(y)}for(var x=s.getLineStyle(["color"]),v=0;v<h.length;++v)e.add(Ms(h[v],{style:dt({stroke:o[v%o.length]},x),silent:!0}))}},splitArea:function(n,e,t,r){yH(n,t,r,r)}};const Rme=Pme;var e$=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getCoordSysModel=function(){return this},e.type="singleAxis",e.layoutMode="box",e.defaultOption={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}},e}(sn);zr(e$,B0.prototype);const RM=e$;var Dme=function(n){ve(e,n);function e(t,r,i,a,s){var o=n.call(this,t,r,i)||this;return o.type=a||"value",o.position=s||"bottom",o}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.pointToData=function(t,r){return this.coordinateSystem.pointToData(t)[0]},e}(po);const Ime=Dme;var t$=["single"],Nme=function(){function n(e,t,r){this.type="single",this.dimension="single",this.dimensions=t$,this.axisPointerEnabled=!0,this.model=e,this._init(e,t,r)}return n.prototype._init=function(e,t,r){var i=this.dimension,a=new Ime(i,wS(e),[0,0],e.get("type"),e.get("position")),s=a.type==="category";a.onBand=s&&e.get("boundaryGap"),a.inverse=e.get("inverse"),a.orient=e.get("orient"),e.axis=a,a.model=e,a.coordinateSystem=this,this._axis=a},n.prototype.update=function(e,t){e.eachSeries(function(r){if(r.coordinateSystem===this){var i=r.getData();z(i.mapDimensionsAll(this.dimension),function(a){this._axis.scale.unionExtentFromData(i,a)},this),Ap(this._axis.scale,this._axis.model)}},this)},n.prototype.resize=function(e,t){this._rect=Kr({left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")},{width:t.getWidth(),height:t.getHeight()}),this._adjustAxis()},n.prototype.getRect=function(){return this._rect},n.prototype._adjustAxis=function(){var e=this._rect,t=this._axis,r=t.isHorizontal(),i=r?[0,e.width]:[0,e.height],a=t.inverse?1:0;t.setExtent(i[a],i[1-a]),this._updateAxisTransform(t,r?e.x:e.y)},n.prototype._updateAxisTransform=function(e,t){var r=e.getExtent(),i=r[0]+r[1],a=e.isHorizontal();e.toGlobalCoord=a?function(s){return s+t}:function(s){return i-s+t},e.toLocalCoord=a?function(s){return s-t}:function(s){return i-s+t}},n.prototype.getAxis=function(){return this._axis},n.prototype.getBaseAxis=function(){return this._axis},n.prototype.getAxes=function(){return[this._axis]},n.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},n.prototype.containPoint=function(e){var t=this.getRect(),r=this.getAxis(),i=r.orient;return i==="horizontal"?r.contain(r.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:r.contain(r.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},n.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e[t.orient==="horizontal"?0:1]))]},n.prototype.dataToPoint=function(e){var t=this.getAxis(),r=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?r.y+r.height/2:r.x+r.width/2,i},n.prototype.convertToPixel=function(e,t,r){var i=oO(t);return i===this?this.dataToPoint(r):null},n.prototype.convertFromPixel=function(e,t,r){var i=oO(t);return i===this?this.pointToData(r):null},n}();function oO(n){var e=n.seriesModel,t=n.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function kme(n,e){var t=[];return n.eachComponent("singleAxis",function(r,i){var a=new Nme(r,n,e);a.name="single_"+i,a.resize(r,e),r.coordinateSystem=a,t.push(a)}),n.eachSeries(function(r){if(r.get("coordinateSystem")==="singleAxis"){var i=r.getReferringComponents("singleAxis",Fr).models[0];r.coordinateSystem=i&&i.coordinateSystem}}),t}var Ome={create:kme,dimensions:t$};const Fme=Ome;var lO=["x","y"],Bme=["width","height"],Gme=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,s){var o=i.axis,l=o.coordinateSystem,u=DM(l,1-tb(o)),c=l.dataToPoint(r)[0],h=a.get("type");if(h&&h!=="none"){var f=aR(a),d=zme[h](o,c,u);d.style=f,t.graphicKey=d.type,t.pointer=d}var p=$C(i);qW(r,t,p,i,a,s)},e.prototype.getHandleTransform=function(t,r,i){var a=$C(r,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var s=sR(r.axis,t,a);return{x:s[0],y:s[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,r,i,a){var s=i.axis,o=s.coordinateSystem,l=tb(s),u=DM(o,l),c=[t.x,t.y];c[l]+=r[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var h=DM(o,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}(iR),zme={line:function(n,e,t){var r=oR([e,t[0]],[e,t[1]],tb(n));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(n,e,t){var r=n.getBandWidth(),i=t[1]-t[0];return{type:"Rect",shape:XW([e-r/2,t[0]],[r,i],tb(n))}}};function tb(n){return n.isHorizontal()?0:1}function DM(n,e){var t=n.getRect();return[t[lO[e]],t[lO[e]]+t[Bme[e]]]}const Ume=Gme;var Vme=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="single",e}(fr);function Hme(n){Vt(q0),Pf.registerAxisPointerClass("SingleAxisPointer",Ume),n.registerComponentView(Vme),n.registerComponentView(Rme),n.registerComponentModel(RM),Tp(n,"single",RM,RM.defaultOption),n.registerCoordinateSystem("single",Fme)}var Wme=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r,i){var a=Jp(t);n.prototype.init.apply(this,arguments),uO(t,a)},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),uO(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}(sn);function uO(n,e){var t=n.cellSize,r;Ie(t)?r=t:r=n.cellSize=[t,t],r.length===1&&(r[1]=r[0]);var i=Ne([0,1],function(a){return Xte(e,a)&&(r[a]="auto"),r[a]!=null&&r[a]!=="auto"});fc(n,e,{type:"box",ignoreSize:i})}const $me=Wme;var jme=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group;a.removeAll();var s=t.coordinateSystem,o=s.getRangeInfo(),l=s.getOrient(),u=r.getLocaleModel();this._renderDayRect(t,o,a),this._renderLines(t,o,l,a),this._renderYearText(t,o,l,a),this._renderMonthText(t,u,l,a),this._renderWeekText(t,u,o,l,a)},e.prototype._renderDayRect=function(t,r,i){for(var a=t.coordinateSystem,s=t.getModel("itemStyle").getItemStyle(),o=a.getCellWidth(),l=a.getCellHeight(),u=r.start.time;u<=r.end.time;u=a.getNextNDay(u,1).time){var c=a.dataToRect([u],!1).tl,h=new nn({shape:{x:c[0],y:c[1],width:o,height:l},cursor:"default",style:s});i.add(h)}},e.prototype._renderLines=function(t,r,i,a){var s=this,o=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=r.start,f=0;h.time<=r.end.time;f++){p(h.formatedDate),f===0&&(h=o.getDateInfo(r.start.y+"-"+r.start.m));var d=h.date;d.setMonth(d.getMonth()+1),h=o.getDateInfo(d)}p(o.getNextNDay(r.end.time,1).formatedDate);function p(g){s._firstDayOfMonth.push(o.getDateInfo(g)),s._firstDayPoints.push(o.dataToRect([g],!1).tl);var v=s._getLinePointsOfOneWeek(t,g,i);s._tlpoints.push(v[0]),s._blpoints.push(v[v.length-1]),u&&s._drawSplitline(v,l,a)}u&&this._drawSplitline(s._getEdgesPoints(s._tlpoints,c,i),l,a),u&&this._drawSplitline(s._getEdgesPoints(s._blpoints,c,i),l,a)},e.prototype._getEdgesPoints=function(t,r,i){var a=[t[0].slice(),t[t.length-1].slice()],s=i==="horizontal"?0:1;return a[0][s]=a[0][s]-r/2,a[1][s]=a[1][s]+r/2,a},e.prototype._drawSplitline=function(t,r,i){var a=new Na({z2:20,shape:{points:t},style:r});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(t,r,i){for(var a=t.coordinateSystem,s=a.getDateInfo(r),o=[],l=0;l<7;l++){var u=a.getNextNDay(s.time,l),c=a.dataToRect([u.time],!1);o[2*u.day]=c.tl,o[2*u.day+1]=c[i==="horizontal"?"bl":"tr"]}return o},e.prototype._formatterLabel=function(t,r){return Ke(t)&&t?$te(t,r):ct(t)?t(r):r.nameMap},e.prototype._yearTextPositionControl=function(t,r,i,a,s){var o=r[0],l=r[1],u=["center","bottom"];a==="bottom"?(l+=s,u=["center","top"]):a==="left"?o-=s:a==="right"?(o+=s,u=["center","top"]):l-=s;var c=0;return(a==="left"||a==="right")&&(c=Math.PI/2),{rotation:c,x:o,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(t,r,i,a){var s=t.getModel("yearLabel");if(s.get("show")){var o=s.get("margin"),l=s.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=r.start.y;+r.end.y>+r.start.y&&(p=p+"-"+r.end.y);var g=s.get("formatter"),v={start:r.start.y,end:r.end.y,nameMap:p},m=this._formatterLabel(g,v),y=new ln({z2:30,style:Hn(s,{text:m}),silent:s.get("silent")});y.attr(this._yearTextPositionControl(y,d[l],i,l,o)),a.add(y)}},e.prototype._monthTextPositionControl=function(t,r,i,a,s){var o="left",l="top",u=t[0],c=t[1];return i==="horizontal"?(c=c+s,r&&(o="center"),a==="start"&&(l="bottom")):(u=u+s,r&&(l="middle"),a==="start"&&(o="right")),{x:u,y:c,align:o,verticalAlign:l}},e.prototype._renderMonthText=function(t,r,i,a){var s=t.getModel("monthLabel");if(s.get("show")){var o=s.get("nameMap"),l=s.get("margin"),u=s.get("position"),c=s.get("align"),h=[this._tlpoints,this._blpoints];(!o||Ke(o))&&(o&&(r=tC(o)||r),o=r.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=s.get("silent"),v=0;v<h[f].length-1;v++){var m=h[f][v].slice(),y=this._firstDayOfMonth[v];if(p){var _=this._firstDayPoints[v];m[d]=(_[d]+h[0][v+1][d])/2}var x=s.get("formatter"),b=o[+y.m-1],S={yyyy:y.y,yy:(y.y+"").slice(2),MM:y.m,M:+y.m,nameMap:b},w=this._formatterLabel(x,S),T=new ln({z2:30,style:Pe(Hn(s,{text:w}),this._monthTextPositionControl(m,p,i,u,l)),silent:g});a.add(T)}}},e.prototype._weekTextPositionControl=function(t,r,i,a,s){var o="center",l="middle",u=t[0],c=t[1],h=i==="start";return r==="horizontal"?(u=u+a+(h?1:-1)*s[0]/2,o=h?"right":"left"):(c=c+a+(h?1:-1)*s[1]/2,l=h?"bottom":"top"),{x:u,y:c,align:o,verticalAlign:l}},e.prototype._renderWeekText=function(t,r,i,a,s){var o=t.getModel("dayLabel");if(o.get("show")){var l=t.coordinateSystem,u=o.get("position"),c=o.get("nameMap"),h=o.get("margin"),f=l.getFirstDayOfWeek();if(!c||Ke(c)){c&&(r=tC(c)||r);var d=r.get(["time","dayOfWeekShort"]);c=d||Ne(r.get(["time","dayOfWeekAbbr"]),function(S){return S[0]})}var p=l.getNextNDay(i.end.time,7-i.lweek).time,g=[l.getCellWidth(),l.getCellHeight()];h=Xe(h,Math.min(g[1],g[0])),u==="start"&&(p=l.getNextNDay(i.start.time,-(7+i.fweek)).time,h=-h);for(var v=o.get("silent"),m=0;m<7;m++){var y=l.getNextNDay(p,m),_=l.dataToRect([y.time],!1).center,x=m;x=Math.abs((m+f)%7);var b=new ln({z2:30,style:Pe(Hn(o,{text:c[x]}),this._weekTextPositionControl(_,a,u,h,g)),silent:v});s.add(b)}}},e.type="calendar",e}(fr);const qme=jme;var IM=864e5,Xme=function(){function n(e,t,r){this.type="calendar",this.dimensions=n.dimensions,this.getDimensionsInfo=n.getDimensionsInfo,this._model=e}return n.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},n.prototype.getRangeInfo=function(){return this._rangeInfo},n.prototype.getModel=function(){return this._model},n.prototype.getRect=function(){return this._rect},n.prototype.getCellWidth=function(){return this._sw},n.prototype.getCellHeight=function(){return this._sh},n.prototype.getOrient=function(){return this._orient},n.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},n.prototype.getDateInfo=function(e){e=Qo(e);var t=e.getFullYear(),r=e.getMonth()+1,i=r<10?"0"+r:""+r,a=e.getDate(),s=a<10?"0"+a:""+a,o=e.getDay();return o=Math.abs((o+7-this.getFirstDayOfWeek())%7),{y:t+"",m:i,d:s,day:o,time:e.getTime(),formatedDate:t+"-"+i+"-"+s,date:e}},n.prototype.getNextNDay=function(e,t){return t=t||0,t===0?this.getDateInfo(e):(e=new Date(this.getDateInfo(e).time),e.setDate(e.getDate()+t),this.getDateInfo(e))},n.prototype.update=function(e,t){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var r=this._rangeInfo.weeks||1,i=["width","height"],a=this._model.getCellSize().slice(),s=this._model.getBoxLayoutParams(),o=this._orient==="horizontal"?[r,7]:[7,r];z([0,1],function(h){c(a,h)&&(s[i[h]]=a[h]*o[h])});var l={width:t.getWidth(),height:t.getHeight()},u=this._rect=Kr(s,l);z([0,1],function(h){c(a,h)||(a[h]=u[i[h]]/o[h])});function c(h,f){return h[f]!=null&&h[f]!=="auto"}this._sw=a[0],this._sh=a[1]},n.prototype.dataToPoint=function(e,t){Ie(e)&&(e=e[0]),t==null&&(t=!0);var r=this.getDateInfo(e),i=this._rangeInfo,a=r.formatedDate;if(t&&!(r.time>=i.start.time&&r.time<i.end.time+IM))return[NaN,NaN];var s=r.day,o=this._getRangeInfo([i.start.time,a]).nthWeek;return this._orient==="vertical"?[this._rect.x+s*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]:[this._rect.x+o*this._sw+this._sw/2,this._rect.y+s*this._sh+this._sh/2]},n.prototype.pointToData=function(e){var t=this.pointToDate(e);return t&&t.time},n.prototype.dataToRect=function(e,t){var r=this.dataToPoint(e,t);return{contentShape:{x:r[0]-(this._sw-this._lineWidth)/2,y:r[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:r,tl:[r[0]-this._sw/2,r[1]-this._sh/2],tr:[r[0]+this._sw/2,r[1]-this._sh/2],br:[r[0]+this._sw/2,r[1]+this._sh/2],bl:[r[0]-this._sw/2,r[1]+this._sh/2]}},n.prototype.pointToDate=function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,r=Math.floor((e[1]-this._rect.y)/this._sh)+1,i=this._rangeInfo.range;return this._orient==="vertical"?this._getDateByWeeksAndDay(r,t-1,i):this._getDateByWeeksAndDay(t,r-1,i)},n.prototype.convertToPixel=function(e,t,r){var i=cO(t);return i===this?i.dataToPoint(r):null},n.prototype.convertFromPixel=function(e,t,r){var i=cO(t);return i===this?i.pointToData(r):null},n.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},n.prototype._initRangeOption=function(){var e=this._model.get("range"),t;if(Ie(e)&&e.length===1&&(e=e[0]),Ie(e))t=e;else{var r=e.toString();if(/^\d{4}$/.test(r)&&(t=[r+"-01-01",r+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(r)){var i=this.getDateInfo(r),a=i.date;a.setMonth(a.getMonth()+1);var s=this.getNextNDay(a,-1);t=[i.formatedDate,s.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(r)&&(t=[r,r])}if(!t)return e;var o=this._getRangeInfo(t);return o.start.time>o.end.time&&t.reverse(),t},n.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],r;t[0].time>t[1].time&&(r=!0,t.reverse());var i=Math.floor(t[1].time/IM)-Math.floor(t[0].time/IM)+1,a=new Date(t[0].time),s=a.getDate(),o=t[1].date.getDate();a.setDate(s+i-1);var l=a.getDate();if(l!==o)for(var u=a.getTime()-t[1].time>0?1:-1;(l=a.getDate())!==o&&(a.getTime()-t[1].time)*u>0;)i-=u,a.setDate(l-u);var c=Math.floor((i+t[0].day+6)/7),h=r?-c+1:c-1;return r&&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}},n.prototype._getDateByWeeksAndDay=function(e,t,r){var i=this._getRangeInfo(r);if(e>i.weeks||e===0&&t<i.fweek||e===i.weeks&&t>i.lweek)return null;var a=(e-1)*7-i.fweek+t,s=new Date(i.start.time);return s.setDate(+i.start.d+a),this.getDateInfo(s)},n.create=function(e,t){var r=[];return e.eachComponent("calendar",function(i){var a=new n(i);r.push(a),i.coordinateSystem=a}),e.eachSeries(function(i){i.get("coordinateSystem")==="calendar"&&(i.coordinateSystem=r[i.get("calendarIndex")||0])}),r},n.dimensions=["time","value"],n}();function cO(n){var e=n.calendarModel,t=n.seriesModel,r=e?e.coordinateSystem:t?t.coordinateSystem:null;return r}const Yme=Xme;function Kme(n){n.registerComponentModel($me),n.registerComponentView(qme),n.registerCoordinateSystem("calendar",Yme)}function Zme(n,e){var t=n.existing;if(e.id=n.keyInfo.id,!e.type&&t&&(e.type=t.type),e.parentId==null){var r=e.parentOption;r?e.parentId=r.id:t&&(e.parentId=t.parentId)}e.parentOption=null}function hO(n,e){var t;return z(e,function(r){n[r]!=null&&n[r]!=="auto"&&(t=!0)}),t}function Qme(n,e,t){var r=Pe({},t),i=n[e],a=t.$action||"merge";a==="merge"?i?(It(i,r,!0),fc(i,r,{ignoreSize:!0}),F7(t,i),f_(t,i),f_(t,i,"shape"),f_(t,i,"style"),f_(t,i,"extra"),t.clipPath=i.clipPath):n[e]=r:a==="replace"?n[e]=r:a==="remove"&&i&&(n[e]=null)}var n$=["transition","enterFrom","leaveTo"],Jme=n$.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function f_(n,e,t){if(t&&(!n[t]&&e[t]&&(n[t]={}),n=n[t],e=e[t]),!(!n||!e))for(var r=t?n$:Jme,i=0;i<r.length;i++){var a=r[i];n[a]==null&&e[a]!=null&&(n[a]=e[a])}}function e0e(n,e){if(n&&(n.hv=e.hv=[hO(e,["left","right"]),hO(e,["top","bottom"])],n.type==="group")){var t=n,r=e;t.width==null&&(t.width=r.width=0),t.height==null&&(t.height=r.height=0)}}var t0e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.preventAutoZ=!0,t}return e.prototype.mergeOption=function(t,r){var i=this.option.elements;this.option.elements=null,n.prototype.mergeOption.call(this,t,r),this.option.elements=i},e.prototype.optionUpdated=function(t,r){var i=this.option,a=(r?i:t).elements,s=i.elements=r?[]:i.elements,o=[];this._flatten(a,o,null);var l=xU(s,o,"normalMerge"),u=this._elOptionsToUpdate=[];z(l,function(c,h){var f=c.newOption;f&&(u.push(f),Zme(c,f),Qme(s,h,f),e0e(s[h],f))},this),i.elements=_n(s,function(c){return c&&delete c.$action,c!=null})},e.prototype._flatten=function(t,r,i){z(t,function(a){if(a){i&&(a.parentOption=i),r.push(a);var s=a.children;s&&s.length&&this._flatten(s,r,a),delete a.children}},this)},e.prototype.useElOptionsToUpdate=function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t},e.type="graphic",e.defaultOption={elements:[]},e}(sn),fO={path:null,compoundPath:null,group:bt,image:Pi,text:ln},_s=en(),n0e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this._elMap=st()},e.prototype.render=function(t,r,i){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,i)},e.prototype._updateElements=function(t){var r=t.useElOptionsToUpdate();if(r){var i=this._elMap,a=this.group,s=t.get("z"),o=t.get("zlevel");z(r,function(l){var u=Yr(l.id,null),c=u!=null?i.get(u):null,h=Yr(l.parentId,null),f=h!=null?i.get(h):a,d=l.type,p=l.style;d==="text"&&p&&l.hv&&l.hv[1]&&(p.textVerticalAlign=p.textBaseline=p.verticalAlign=p.align=null);var g=l.textContent,v=l.textConfig;if(p&&kW(p,d,!!v,!!g)){var m=OW(p,d,!0);!v&&m.textConfig&&(v=l.textConfig=m.textConfig),!g&&m.textContent&&(g=m.textContent)}var y=r0e(l),_=l.$action||"merge",x=_==="merge",b=_==="replace";if(x){var S=!c,w=c;S?w=dO(u,f,l.type,i):(w&&(_s(w).isNew=!1),zW(w)),w&&(H1(w,y,t,{isInit:S}),pO(w,l,s,o))}else if(b){$1(c,l,i,t);var T=dO(u,f,l.type,i);T&&(H1(T,y,t,{isInit:!0}),pO(T,l,s,o))}else _==="remove"&&(BW(c,l),$1(c,l,i,t));var C=i.get(u);if(C&&g)if(x){var A=C.getTextContent();A?A.attr(g):C.setTextContent(new ln(g))}else b&&C.setTextContent(new ln(g));if(C){var M=l.clipPath;if(M){var P=M.type,D=void 0,S=!1;if(x){var L=C.getClipPath();S=!L||_s(L).type!==P,D=S?jC(P):L}else b&&(S=!0,D=jC(P));C.setClipPath(D),H1(D,M,t,{isInit:S}),Jx(D,M.keyframeAnimation,t)}var R=_s(C);C.setTextConfig(v),R.option=l,i0e(C,t,l),wf({el:C,componentModel:t,itemName:C.name,itemTooltipOption:l.tooltip}),Jx(C,l.keyframeAnimation,t)}})}},e.prototype._relocate=function(t,r){for(var i=t.option.elements,a=this.group,s=this._elMap,o=r.getWidth(),l=r.getHeight(),u=["x","y"],c=0;c<i.length;c++){var h=i[c],f=Yr(h.id,null),d=f!=null?s.get(f):null;if(!(!d||!d.isGroup)){var p=d.parent,g=p===a,v=_s(d),m=_s(p);v.width=Xe(v.option.width,g?o:m.width)||0,v.height=Xe(v.option.height,g?l:m.height)||0}}for(var c=i.length-1;c>=0;c--){var h=i[c],f=Yr(h.id,null),d=f!=null?s.get(f):null;if(d){var p=d.parent,m=_s(p),y=p===a?{width:o,height:l}:{width:m.width,height:m.height},_={},x=dS(d,h,y,null,{hv:h.hv,boundingMode:h.bounding},_);if(!_s(d).isNew&&x){for(var b=h.transition,S={},w=0;w<u.length;w++){var T=u[w],C=_[T];b&&(Zh(b)||Ft(b,T)>=0)?S[T]=C:d[T]=C}cn(d,S,t,0)}else d.attr(_)}}},e.prototype._clear=function(){var t=this,r=this._elMap;r.each(function(i){$1(i,_s(i).option,r,t._lastGraphicModel)}),this._elMap=st()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(fr);function jC(n){var e=tt(fO,n)?fO[n]:UP(n),t=new e({});return _s(t).type=n,t}function dO(n,e,t,r){var i=jC(t);return e.add(i),r.set(n,i),_s(i).id=n,_s(i).isNew=!0,i}function $1(n,e,t,r){var i=n&&n.parent;i&&(n.type==="group"&&n.traverse(function(a){$1(a,e,t,r)}),LS(n,e,r),t.removeKey(_s(n).id))}function pO(n,e,t,r){n.isGroup||z([["cursor",Os.prototype.cursor],["zlevel",r||0],["z",t||0],["z2",0]],function(i){var a=i[0];tt(e,a)?n[a]=Et(e[a],i[1]):n[a]==null&&(n[a]=i[1])}),z(Yt(e),function(i){if(i.indexOf("on")===0){var a=e[i];n[i]=ct(a)?a:null}}),tt(e,"draggable")&&(n.draggable=e.draggable),e.name!=null&&(n.name=e.name),e.id!=null&&(n.id=e.id)}function r0e(n){return n=Pe({},n),z(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(O7),function(e){delete n[e]}),n}function i0e(n,e,t){var r=St(n).eventData;!n.silent&&!n.ignore&&!r&&(r=St(n).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:n.name}),r&&(r.info=t.info)}function a0e(n){n.registerComponentModel(t0e),n.registerComponentView(n0e),n.registerPreprocessor(function(e){var t=e.graphic;Ie(t)?!t[0]||!t[0].elements?e.graphic=[{elements:t}]:e.graphic=[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var vO=["x","y","radius","angle","single"],s0e=["cartesian2d","polar","singleAxis"];function o0e(n){var e=n.get("coordinateSystem");return Ft(s0e,e)>=0}function Wu(n){return n+"Axis"}function l0e(n,e){var t=st(),r=[],i=st();n.eachComponent({mainType:"dataZoom",query:e},function(c){i.get(c.uid)||o(c)});var a;do a=!1,n.eachComponent("dataZoom",s);while(a);function s(c){!i.get(c.uid)&&l(c)&&(o(c),a=!0)}function o(c){i.set(c.uid,!0),r.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 r}function r$(n){var e=n.ecModel,t={infoList:[],infoMap:st()};return n.eachTargetAxis(function(r,i){var a=e.getComponent(Wu(r),i);if(a){var s=a.getCoordSysModel();if(s){var o=s.uid,l=t.infoMap.get(o);l||(l={model:s,axisModels:[]},t.infoList.push(l),t.infoMap.set(o,l)),l.axisModels.push(a)}}}),t}var NM=function(){function n(){this.indexList=[],this.indexMap=[]}return n.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},n}(),u0e=function(n){ve(e,n);function e(){var t=n!==null&&n.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,r,i){var a=gO(t);this.settledOption=a,this.mergeDefaultAndTheme(t,i),this._doInit(a)},e.prototype.mergeOption=function(t){var r=gO(t);It(this.option,t,!0),It(this.settledOption,r,!0),this._doInit(r)},e.prototype._doInit=function(t){var r=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var i=this.settledOption;z([["start","startValue"],["end","endValue"]],function(a,s){this._rangePropMode[s]==="value"&&(r[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),r=this._targetAxisInfoMap=st(),i=this._fillSpecifiedTargetAxis(r);i?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(r,this._orient)),this._noTarget=!0,r.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var r=!1;return z(vO,function(i){var a=this.getReferringComponents(Wu(i),MJ);if(a.specified){r=!0;var s=new NM;z(a.models,function(o){s.add(o.componentIndex)}),t.set(i,s)}},this),r},e.prototype._fillAutoTargetAxisByOrient=function(t,r){var i=this.ecModel,a=!0;if(a){var s=r==="vertical"?"y":"x",o=i.findComponents({mainType:s+"Axis"});l(o,s)}if(a){var o=i.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===r}});l(o,"single")}function l(u,c){var h=u[0];if(h){var f=new NM;if(f.add(h.componentIndex),t.set(c,f),a=!1,c==="x"||c==="y"){var d=h.getReferringComponents("grid",Fr).models[0];d&&z(u,function(p){h.componentIndex!==p.componentIndex&&d===p.getReferringComponents("grid",Fr).models[0]&&f.add(p.componentIndex)})}}}a&&z(vO,function(u){if(a){var c=i.findComponents({mainType:Wu(u),filter:function(f){return f.get("type",!0)==="category"}});if(c[0]){var h=new NM;h.add(c[0].componentIndex),t.set(u,h),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(r){!t&&(t=r)},this),t==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var r=this.ecModel.option;this.option.throttle=r.animation&&r.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var r=this._rangePropMode,i=this.get("rangeMode");z([["start","startValue"],["end","endValue"]],function(a,s){var o=t[a[0]]!=null,l=t[a[1]]!=null;o&&!l?r[s]="percent":!o&&l?r[s]="value":i?r[s]=i[s]:o&&(r[s]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(r,i){t==null&&(t=this.ecModel.getComponent(Wu(r),i))},this),t},e.prototype.eachTargetAxis=function(t,r){this._targetAxisInfoMap.each(function(i,a){z(i.indexList,function(s){t.call(r,a,s)})})},e.prototype.getAxisProxy=function(t,r){var i=this.getAxisModel(t,r);if(i)return i.__dzAxisProxy},e.prototype.getAxisModel=function(t,r){var i=this._targetAxisInfoMap.get(t);if(i&&i.indexMap[r])return this.ecModel.getComponent(Wu(t),r)},e.prototype.setRawRange=function(t){var r=this.option,i=this.settledOption;z([["start","startValue"],["end","endValue"]],function(a){(t[a[0]]!=null||t[a[1]]!=null)&&(r[a[0]]=i[a[0]]=t[a[0]],r[a[1]]=i[a[1]]=t[a[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var r=this.option;z(["start","startValue","end","endValue"],function(i){r[i]=t[i]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,r){if(t==null&&r==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getDataValueWindow()}else return this.getAxisProxy(t,r).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var r,i=this._targetAxisInfoMap.keys(),a=0;a<i.length;a++)for(var s=i[a],o=this._targetAxisInfoMap.get(s),l=0;l<o.indexList.length;l++){var u=this.getAxisProxy(s,o.indexList[l]);if(u.hostedBy(this))return u;r||(r=u)}return r},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={z:4,filterMode:"filter",start:0,end:100},e}(sn);function gO(n){var e={};return z(["start","end","startValue","endValue","throttle"],function(t){n.hasOwnProperty(t)&&(e[t]=n[t])}),e}const a0=u0e;var c0e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.select",e}(a0);const h0e=c0e;var f0e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i,a){this.dataZoomModel=t,this.ecModel=r,this.api=i},e.type="dataZoom",e}(fr);const hR=f0e;var d0e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.select",e}(hR);const p0e=d0e;var Ld=z,mO=Rs,v0e=function(){function n(e,t,r,i){this._dimName=e,this._axisIndex=t,this.ecModel=i,this._dataZoomModel=r}return n.prototype.hostedBy=function(e){return this._dataZoomModel===e},n.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},n.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},n.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(t){if(o0e(t)){var r=Wu(this._dimName),i=t.getReferringComponents(r,Fr).models[0];i&&this._axisIndex===i.componentIndex&&e.push(t)}},this),e},n.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},n.prototype.getMinMaxSpan=function(){return yt(this._minMaxSpan)},n.prototype.calculateDataWindow=function(e){var t=this._dataExtent,r=this.getAxisModel(),i=r.axis.scale,a=this._dataZoomModel.getRangePropMode(),s=[0,100],o=[],l=[],u;Ld(["start","end"],function(f,d){var p=e[f],g=e[f+"Value"];a[d]==="percent"?(p==null&&(p=s[d]),g=i.parse(Sn(p,s,t))):(u=!0,g=g==null?t[d]:i.parse(g),p=Sn(g,t,s)),l[d]=g==null||isNaN(g)?t[d]:g,o[d]=p==null||isNaN(p)?s[d]:p}),mO(l),mO(o);var c=this._minMaxSpan;u?h(l,o,t,s,!1):h(o,l,s,t,!0);function h(f,d,p,g,v){var m=v?"Span":"ValueSpan";Lf(0,f,p,"all",c["min"+m],c["max"+m]);for(var y=0;y<2;y++)d[y]=Sn(f[y],p,g,!0),v&&(d[y]=i.parse(d[y]))}return{valueWindow:l,percentWindow:o}},n.prototype.reset=function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=g0e(this,this._dimName,t),this._updateMinMaxSpan();var r=this.calculateDataWindow(e.settledOption);this._valueWindow=r.valueWindow,this._percentWindow=r.percentWindow,this._setAxisModel()}},n.prototype.filterData=function(e,t){if(e!==this._dataZoomModel)return;var r=this._dimName,i=this.getTargetSeriesModels(),a=e.get("filterMode"),s=this._valueWindow;if(a==="none")return;Ld(i,function(l){var u=l.getData(),c=u.mapDimensionsAll(r);if(c.length){if(a==="weakFilter"){var h=u.getStore(),f=Ne(c,function(d){return u.getDimensionIndex(d)},u);u.filterSelf(function(d){for(var p,g,v,m=0;m<c.length;m++){var y=h.get(f[m],d),_=!isNaN(y),x=y<s[0],b=y>s[1];if(_&&!x&&!b)return!0;_&&(v=!0),x&&(p=!0),b&&(g=!0)}return v&&p&&g})}else Ld(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(g){return o(g)?g:NaN}));else{var p={};p[d]=s,u.selectRange(p)}});Ld(c,function(d){u.setApproximateExtent(s,d)})}});function o(l){return l>=s[0]&&l<=s[1]}},n.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,r=this._dataExtent;Ld(["min","max"],function(i){var a=t.get(i+"Span"),s=t.get(i+"ValueSpan");s!=null&&(s=this.getAxisModel().axis.scale.parse(s)),s!=null?a=Sn(r[0]+s,r,[0,100],!0):a!=null&&(s=Sn(a,[0,100],r,!0)-r[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=s},this)},n.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,r=this._valueWindow;if(t){var i=fU(r,[0,500]);i=Math.min(i,20);var a=e.axis.scale.rawExtentInfo;t[0]!==0&&a.setDeterminedMinMax("min",+r[0].toFixed(i)),t[1]!==100&&a.setDeterminedMinMax("max",+r[1].toFixed(i)),a.freeze()}},n}();function g0e(n,e,t){var r=[1/0,-1/0];Ld(t,function(s){Bae(r,s.getData(),e)});var i=n.getAxisModel(),a=m9(i.axis.scale,i,r).calculate();return[a.min,a.max]}const m0e=v0e;var y0e={getTargetSeries:function(n){function e(i){n.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(s,o){var l=n.getComponent(Wu(s),o);i(s,o,l,a)})})}e(function(i,a,s,o){s.__dzAxisProxy=null});var t=[];e(function(i,a,s,o){s.__dzAxisProxy||(s.__dzAxisProxy=new m0e(i,a,o,n),t.push(s.__dzAxisProxy))});var r=st();return z(t,function(i){z(i.getTargetSeriesModels(),function(a){r.set(a.uid,a)})}),r},overallReset:function(n,e){n.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(r,i){t.getAxisProxy(r,i).reset(t)}),t.eachTargetAxis(function(r,i){t.getAxisProxy(r,i).filterData(t,e)})}),n.eachComponent("dataZoom",function(t){var r=t.findRepresentativeAxisProxy();if(r){var i=r.getDataPercentWindow(),a=r.getDataValueWindow();t.setCalculatedRange({start:i[0],end:i[1],startValue:a[0],endValue:a[1]})}})}};const _0e=y0e;function x0e(n){n.registerAction("dataZoom",function(e,t){var r=l0e(t,e);z(r,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var yO=!1;function fR(n){yO||(yO=!0,n.registerProcessor(n.PRIORITY.PROCESSOR.FILTER,_0e),x0e(n),n.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function b0e(n){n.registerComponentModel(h0e),n.registerComponentView(p0e),fR(n)}var bs=function(){function n(){}return n}(),i$={};function Rd(n,e){i$[n]=e}function a$(n){return i$[n]}var S0e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){n.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;z(this.option.feature,function(r,i){var a=a$(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(t)),It(r,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}(sn);const w0e=S0e;function A0e(n,e,t){var r=e.getBoxLayoutParams(),i=e.get("padding"),a={width:t.getWidth(),height:t.getHeight()},s=Kr(r,a,i);Xh(e.get("orient"),n,e.get("itemGap"),s.width,s.height),dS(n,r,a,i)}function s$(n,e){var t=Qp(e.get("padding")),r=e.getItemStyle(["color","opacity"]);return r.fill=e.get("backgroundColor"),n=new nn({shape:{x:n.x-t[3],y:n.y-t[0],width:n.width+t[1]+t[3],height:n.height+t[0]+t[2],r:e.get("borderRadius")},style:r,silent:!0,z2:-1}),n}var M0e=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i,a){var s=this.group;if(s.removeAll(),!t.get("show"))return;var o=+t.get("itemSize"),l=t.get("orient")==="vertical",u=t.get("feature")||{},c=this._features||(this._features={}),h=[];z(u,function(p,g){h.push(g)}),new Vl(this._featureNames||[],h).add(f).update(f).remove(Rt(f,null)).execute(),this._featureNames=h;function f(p,g){var v=h[p],m=h[g],y=u[v],_=new Wn(y,t,t.ecModel),x;if(a&&a.newTitle!=null&&a.featureName===v&&(y.title=a.newTitle),v&&!m){if(T0e(v))x={onclick:_.option.onclick,featureName:v};else{var b=a$(v);if(!b)return;x=new b}c[v]=x}else if(x=c[m],!x)return;x.uid=Zp("toolbox-feature"),x.model=_,x.ecModel=r,x.api=i;var S=x instanceof bs;if(!v&&m){S&&x.dispose&&x.dispose(r,i);return}if(!_.get("show")||S&&x.unusable){S&&x.remove&&x.remove(r,i);return}d(_,x,v),_.setIconStatus=function(w,T){var C=this.option,A=this.iconPaths;C.iconStatus=C.iconStatus||{},C.iconStatus[w]=T,A[w]&&(T==="emphasis"?zl:Ul)(A[w])},x instanceof bs&&x.render&&x.render(_,r,i,a)}function d(p,g,v){var m=p.getModel("iconStyle"),y=p.getModel(["emphasis","iconStyle"]),_=g instanceof bs&&g.getIcons?g.getIcons():p.get("icon"),x=p.get("title")||{},b,S;Ke(_)?(b={},b[v]=_):b=_,Ke(x)?(S={},S[v]=x):S=x;var w=p.iconPaths={};z(b,function(T,C){var A=N0(T,{},{x:-o/2,y:-o/2,width:o,height:o});A.setStyle(m.getItemStyle());var M=A.ensureState("emphasis");M.style=y.getItemStyle();var P=new ln({style:{text:S[C],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null,font:VP({fontStyle:y.get("textFontStyle"),fontFamily:y.get("textFontFamily"),fontSize:y.get("textFontSize"),fontWeight:y.get("textFontWeight")},r)},ignore:!0});A.setTextContent(P),wf({el:A,componentModel:t,itemName:C,formatterParamsExtra:{title:S[C]}}),A.__title=S[C],A.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")}),A.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"?zl:Ul)(A),s.add(A),A.on("click",Qe(g.onclick,g,r,i,C)),w[C]=A})}A0e(s,t,i),s.add(s$(s.getBoundingRect(),t)),l||s.eachChild(function(p){var g=p.__title,v=p.ensureState("emphasis"),m=v.textConfig||(v.textConfig={}),y=p.getTextContent(),_=y&&y.ensureState("emphasis");if(_&&!ct(_)&&g){var x=_.style||(_.style={}),b=L0(g,ln.makeFont(x)),S=p.x+s.x,w=p.y+s.y+o,T=!1;w+b.height>i.getHeight()&&(m.position="top",T=!0);var C=T?-5-b.height:o+10;S+b.width/2>i.getWidth()?(m.position=["100%",C],x.align="right"):S-b.width/2<0&&(m.position=[0,C],x.align="left")}})},e.prototype.updateView=function(t,r,i,a){z(this._features,function(s){s instanceof bs&&s.updateView&&s.updateView(s.model,r,i,a)})},e.prototype.remove=function(t,r){z(this._features,function(i){i instanceof bs&&i.remove&&i.remove(t,r)}),this.group.removeAll()},e.prototype.dispose=function(t,r){z(this._features,function(i){i instanceof bs&&i.dispose&&i.dispose(t,r)})},e.type="toolbox",e}(fr);function T0e(n){return n.indexOf("my")===0}const C0e=M0e;var E0e=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,r){var i=this.model,a=i.get("name")||t.get("title.0.text")||"echarts",s=r.getZr().painter.getType()==="svg",o=s?"svg":i.get("type",!0)||"png",l=r.getConnectedDataURL({type:o,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=on.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=a+"."+o,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||s){var f=l.split(","),d=f[0].indexOf("base64")>-1,p=s?decodeURIComponent(f[1]):f[1];d&&(p=window.atob(p));var g=a+"."+o;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,b=x.document;b.open("image/svg+xml","replace"),b.write(p),b.close(),x.focus(),b.execCommand("SaveAs",!0,g),document.body.removeChild(_)}}else{var S=i.get("lang"),w='<body style="margin:0;"><img src="'+l+'" style="max-width:100%;" title="'+(S&&S[0]||"")+'" /></body>',T=window.open();T.document.write(w),T.document.title=a}},e.getDefaultOption=function(t){var r={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 r},e}(bs);const P0e=E0e;var _O="__ec_magicType_stack__",L0e=[["line","bar"],["stack"]],R0e=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getIcons=function(){var t=this.model,r=t.get("icon"),i={};return z(t.get("type"),function(a){r[a]&&(i[a]=r[a])}),i},e.getDefaultOption=function(t){var r={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 r},e.prototype.onclick=function(t,r,i){var a=this.model,s=a.get(["seriesIndex",i]);if(xO[i]){var o={series:[]},l=function(h){var f=h.subType,d=h.id,p=xO[i](f,d,h,a);p&&(dt(p,h.option),o.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,Fr).models[0],x=_.componentIndex;o[y]=o[y]||[];for(var b=0;b<=x;b++)o[y][x]=o[y][x]||{};o[y][x].boundaryGap=i==="bar"}}};z(L0e,function(h){Ft(h,i)>=0&&z(h,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:s==null?null:{seriesIndex:s}},l);var u,c=i;i==="stack"&&(u=It({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(c="tiled")),r.dispatchAction({type:"changeMagicType",currentType:c,newOption:o,newTitle:u,featureName:"magicType"})}},e}(bs),xO={line:function(n,e,t,r){if(n==="bar")return It({id:e,type:"line",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(n,e,t,r){if(n==="line")return It({id:e,type:"bar",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(n,e,t,r){var i=t.get("stack")===_O;if(n==="line"||n==="bar")return r.setIconStatus("stack",i?"normal":"emphasis"),It({id:e,stack:i?"":_O},r.get(["option","stack"])||{},!0)}};il({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(n,e){e.mergeOption(n.newOption)});const D0e=R0e;var RS=new Array(60).join("-"),Pp=" ";function I0e(n){var e={},t=[],r=[];return n.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var s=a.getBaseAxis();if(s.type==="category"){var o=s.dim+"_"+s.index;e[o]||(e[o]={categoryAxis:s,valueAxis:a.getOtherAxis(s),series:[]},r.push({axisDim:s.dim,axisIndex:s.index})),e[o].series.push(i)}else t.push(i)}else t.push(i)}),{seriesGroupByCategoryAxis:e,other:t,meta:r}}function N0e(n){var e=[];return z(n,function(t,r){var i=t.categoryAxis,a=t.valueAxis,s=a.dim,o=[" "].concat(Ne(t.series,function(d){return d.name})),l=[i.model.getCategories()];z(t.series,function(d){var p=d.getRawData();l.push(d.getRawData().mapArray(p.mapDimension(s),function(g){return g}))});for(var u=[o.join(Pp)],c=0;c<l[0].length;c++){for(var h=[],f=0;f<l.length;f++)h.push(l[f][c]);u.push(h.join(Pp))}e.push(u.join(`
`))}),e.join(`
`+RS+`
`)}function k0e(n){return Ne(n,function(e){var t=e.getRawData(),r=[e.name],i=[];return t.each(t.dimensions,function(){for(var a=arguments.length,s=arguments[a-1],o=t.getName(s),l=0;l<a-1;l++)i[l]=arguments[l];r.push((o?o+Pp:"")+i.join(Pp))}),r.join(`
`)}).join(`
`+RS+`
`)}function O0e(n){var e=I0e(n);return{value:_n([N0e(e.seriesGroupByCategoryAxis),k0e(e.other)],function(t){return!!t.replace(/[\n\t\s]/g,"")}).join(`
`+RS+`
`),meta:e.meta}}function nb(n){return n.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function F0e(n){var e=n.slice(0,n.indexOf(`
`));if(e.indexOf(Pp)>=0)return!0}var qC=new RegExp("["+Pp+"]+","g");function B0e(n){for(var e=n.split(/\n+/g),t=nb(e.shift()).split(qC),r=[],i=Ne(t,function(l){return{name:l,data:[]}}),a=0;a<e.length;a++){var s=nb(e[a]).split(qC);r.push(s.shift());for(var o=0;o<s.length;o++)i[o]&&(i[o].data[a]=s[o])}return{series:i,categories:r}}function G0e(n){for(var e=n.split(/\n+/g),t=nb(e.shift()),r=[],i=0;i<e.length;i++){var a=nb(e[i]);if(a){var s=a.split(qC),o="",l=void 0,u=!1;isNaN(s[0])?(u=!0,o=s[0],s=s.slice(1),r[i]={name:o,value:[]},l=r[i].value):l=r[i]=[];for(var c=0;c<s.length;c++)l.push(+s[c]);l.length===1&&(u?r[i].value=l[0]:r[i]=l[0])}}return{name:t,data:r}}function z0e(n,e){var t=n.split(new RegExp(`
*`+RS+`
*`,"g")),r={series:[]};return z(t,function(i,a){if(F0e(i)){var s=B0e(i),o=e[a],l=o.axisDim+"Axis";o&&(r[l]=r[l]||[],r[l][o.axisIndex]={data:s.categories},r.series=r.series.concat(s.series))}else{var s=G0e(i);r.series.push(s)}}),r}var U0e=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,r){setTimeout(function(){r.dispatchAction({type:"hideTip"})});var i=r.getDom(),a=this.model;this._dom&&i.removeChild(this._dom);var s=document.createElement("div");s.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",s.style.backgroundColor=a.get("backgroundColor")||"#fff";var o=document.createElement("h4"),l=a.get("lang")||[];o.innerHTML=l[0]||a.get("title"),o.style.cssText="margin:10px 20px",o.style.color=a.get("textColor");var u=document.createElement("div"),c=document.createElement("textarea");u.style.cssText="overflow:auto";var h=a.get("optionToContent"),f=a.get("contentToOption"),d=O0e(t);if(ct(h)){var p=h(r.getOption());Ke(p)?u.innerHTML=p:xp(p)&&u.appendChild(p)}else{c.readOnly=a.get("readOnly");var g=c.style;g.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",g.color=a.get("textColor"),g.borderColor=a.get("textareaBorderColor"),g.backgroundColor=a.get("textareaColor"),c.value=d.value,u.appendChild(c)}var v=d.meta,m=document.createElement("div");m.style.cssText="position:absolute;bottom:5px;left:0;right:0";var y="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",_=document.createElement("div"),x=document.createElement("div");y+=";background-color:"+a.get("buttonColor"),y+=";color:"+a.get("buttonTextColor");var b=this;function S(){i.removeChild(s),b._dom=null}TT(_,"click",S),TT(x,"click",function(){if(f==null&&h!=null||f!=null&&h==null){S();return}var w;try{ct(f)?w=f(u,r.getOption()):w=z0e(c.value,v)}catch(T){throw S(),new Error("Data view format error "+T)}w&&r.dispatchAction({type:"changeDataView",newOption:w}),S()}),_.innerHTML=l[1],x.innerHTML=l[2],x.style.cssText=_.style.cssText=y,!a.get("readOnly")&&m.appendChild(x),m.appendChild(_),s.appendChild(o),s.appendChild(u),s.appendChild(m),u.style.height=i.clientHeight-80+"px",i.appendChild(s),this._dom=s},e.prototype.remove=function(t,r){this._dom&&r.getDom().removeChild(this._dom)},e.prototype.dispose=function(t,r){this.remove(t,r)},e.getDefaultOption=function(t){var r={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:t.getLocaleModel().get(["toolbox","dataView","title"]),lang:t.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"};return r},e}(bs);function V0e(n,e){return Ne(n,function(t,r){var i=e&&e[r];if(gt(i)&&!Ie(i)){var a=gt(t)&&!Ie(t);a||(t={value:t});var s=i.name!=null&&t.name==null;return t=dt(t,i),s&&delete t.name,t}else return t})}il({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(n,e){var t=[];z(n.newOption.series,function(r){var i=e.getSeriesByName(r.name)[0];if(!i)t.push(Pe({type:"scatter"},r));else{var a=i.get("data");t.push({name:r.name,data:V0e(r.data,a)})}}),e.mergeOption(dt({series:t},n.newOption))});const H0e=U0e;var o$=z,l$=en();function W0e(n,e){var t=dR(n);o$(e,function(r,i){for(var a=t.length-1;a>=0;a--){var s=t[a];if(s[i])break}if(a<0){var o=n.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(o){var l=o.getPercentRange();t[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),t.push(e)}function $0e(n){var e=dR(n),t=e[e.length-1];e.length>1&&e.pop();var r={};return o$(t,function(i,a){for(var s=e.length-1;s>=0;s--)if(i=e[s][a],i){r[a]=i;break}}),r}function j0e(n){l$(n).snapshots=null}function q0e(n){return dR(n).length}function dR(n){var e=l$(n);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var X0e=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,r){j0e(t),r.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var r={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 r},e}(bs);il({type:"restore",event:"restore",update:"prepareAndUpdate"},function(n,e){e.resetOption("recreate")});const Y0e=X0e;var K0e=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],Z0e=function(){function n(e,t,r){var i=this;this._targetInfoList=[];var a=bO(t,e);z(Q0e,function(s,o){(!r||!r.include||Ft(r.include,o)>=0)&&s(a,i._targetInfoList)})}return n.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(r,i,a){if((r.coordRanges||(r.coordRanges=[])).push(i),!r.coordRange){r.coordRange=i;var s=kM[r.brushType](0,a,i);r.__rangeOffset={offset:MO[r.brushType](s.values,r.range,[1,1]),xyMinMax:s.xyMinMax}}}),e},n.prototype.matchOutputRanges=function(e,t,r){z(e,function(i){var a=this.findTargetInfo(i,t);a&&a!==!0&&z(a.coordSyses,function(s){var o=kM[i.brushType](1,s,i.range,!0);r(i,o.values,s,t)})},this)},n.prototype.setInputRanges=function(e,t){z(e,function(r){var i=this.findTargetInfo(r,t);if(r.range=r.range||[],i&&i!==!0){r.panelId=i.panelId;var a=kM[r.brushType](0,i.coordSys,r.coordRange),s=r.__rangeOffset;r.range=s?MO[r.brushType](a.values,s.offset,J0e(a.xyMinMax,s.xyMinMax)):a.values}},this)},n.prototype.makePanelOpts=function(e,t){return Ne(this._targetInfoList,function(r){var i=r.getPanelRect();return{panelId:r.panelId,defaultBrushType:t?t(r):null,clipPath:vW(i),isTargetByCursor:mW(i,e,r.coordSysModel),getLinearBrushOtherExtent:gW(i)}})},n.prototype.controlSeries=function(e,t,r){var i=this.findTargetInfo(e,r);return i===!0||i&&Ft(i.coordSyses,t.coordinateSystem)>=0},n.prototype.findTargetInfo=function(e,t){for(var r=this._targetInfoList,i=bO(t,e),a=0;a<r.length;a++){var s=r[a],o=e.panelId;if(o){if(s.panelId===o)return s}else for(var l=0;l<SO.length;l++)if(SO[l](i,s))return s}return!0},n}();function XC(n){return n[0]>n[1]&&n.reverse(),n}function bO(n,e){return tm(n,e,{includeMainTypes:K0e})}var Q0e={grid:function(n,e){var t=n.xAxisModels,r=n.yAxisModels,i=n.gridModels,a=st(),s={},o={};!t&&!r&&!i||(z(t,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),z(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),z(i,function(l){a.set(l.id,l),s[l.id]=!0,o[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,c=[];z(u.getCartesians(),function(h,f){(Ft(t,h.getAxis("x").model)>=0||Ft(r,h.getAxis("y").model)>=0)&&c.push(h)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:wO.grid,xAxisDeclared:s[l.id],yAxisDeclared:o[l.id]})}))},geo:function(n,e){z(n.geoModels,function(t){var r=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:r,coordSyses:[r],getPanelRect:wO.geo})})}},SO=[function(n,e){var t=n.xAxisModel,r=n.yAxisModel,i=n.gridModel;return!i&&t&&(i=t.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===e.gridModel},function(n,e){var t=n.geoModel;return t&&t===e.geoModel}],wO={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var n=this.coordSys,e=n.getBoundingRect().clone();return e.applyTransform(qh(n)),e}},kM={lineX:Rt(AO,0),lineY:Rt(AO,1),rect:function(n,e,t,r){var i=n?e.pointToData([t[0][0],t[1][0]],r):e.dataToPoint([t[0][0],t[1][0]],r),a=n?e.pointToData([t[0][1],t[1][1]],r):e.dataToPoint([t[0][1],t[1][1]],r),s=[XC([i[0],a[0]]),XC([i[1],a[1]])];return{values:s,xyMinMax:s}},polygon:function(n,e,t,r){var i=[[1/0,-1/0],[1/0,-1/0]],a=Ne(t,function(s){var o=n?e.pointToData(s,r):e.dataToPoint(s,r);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o});return{values:a,xyMinMax:i}}};function AO(n,e,t,r){var i=t.getAxis(["x","y"][n]),a=XC(Ne([0,1],function(o){return e?i.coordToData(i.toLocalCoord(r[o]),!0):i.toGlobalCoord(i.dataToCoord(r[o]))})),s=[];return s[n]=a,s[1-n]=[NaN,NaN],{values:a,xyMinMax:s}}var MO={lineX:Rt(TO,0),lineY:Rt(TO,1),rect:function(n,e,t){return[[n[0][0]-t[0]*e[0][0],n[0][1]-t[0]*e[0][1]],[n[1][0]-t[1]*e[1][0],n[1][1]-t[1]*e[1][1]]]},polygon:function(n,e,t){return Ne(n,function(r,i){return[r[0]-t[0]*e[i][0],r[1]-t[1]*e[i][1]]})}};function TO(n,e,t,r){return[e[0]-r[n]*t[0],e[1]-r[n]*t[1]]}function J0e(n,e){var t=CO(n),r=CO(e),i=[t[0]/r[0],t[1]/r[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function CO(n){return n?[n[0][1]-n[0][0],n[1][1]-n[1][0]]:[NaN,NaN]}const pR=Z0e;var YC=z,eye=xJ("toolbox-dataZoom_"),tye=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i,a){this._brushController||(this._brushController=new jL(i.getZr()),this._brushController.on("brush",Qe(this._onBrush,this)).mount()),iye(t,r,this,a,i),rye(t,r)},e.prototype.onclick=function(t,r,i){nye[i].call(this)},e.prototype.remove=function(t,r){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,r){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var r=t.areas;if(!t.isEnd||!r.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var s=new pR(vR(this.model),a,{include:["grid"]});s.matchOutputRanges(r,a,function(u,c,h){if(h.type==="cartesian2d"){var f=u.brushType;f==="rect"?(o("x",h,c[0]),o("y",h,c[1])):o({lineX:"x",lineY:"y"}[f],h,c)}}),W0e(a,i),this._dispatchZoomAction(i);function o(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=Lf(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 r=[];YC(t,function(i,a){r.push(yt(i))}),r.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:r})},e.getDefaultOption=function(t){var r={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 r},e}(bs),nye={zoom:function(){var n=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:n})},back:function(){this._dispatchZoomAction($0e(this.ecModel))}};function vR(n){var e={xAxisIndex:n.get("xAxisIndex",!0),yAxisIndex:n.get("yAxisIndex",!0),xAxisId:n.get("xAxisId",!0),yAxisId:n.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function rye(n,e){n.setIconStatus("back",q0e(e)>1?"emphasis":"normal")}function iye(n,e,t,r,i){var a=t._isZoomActive;r&&r.type==="takeGlobalCursor"&&(a=r.key==="dataZoomSelect"?r.dataZoomSelectActive:!1),t._isZoomActive=a,n.setIconStatus("zoom",a?"emphasis":"normal");var s=new pR(vR(n),e,{include:["grid"]}),o=s.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});t._brushController.setPanels(o).enableBrush(a&&o.length?{brushType:"auto",brushStyle:n.getModel("brushStyle").getItemStyle()}:!1)}ene("dataZoom",function(n){var e=n.getComponent("toolbox",0),t=["feature","dataZoom"];if(!e||e.get(t)==null)return;var r=e.getModel(t),i=[],a=vR(r),s=tm(n,a);YC(s.xAxisModels,function(l){return o(l,"xAxis","xAxisIndex")}),YC(s.yAxisModels,function(l){return o(l,"yAxis","yAxisIndex")});function o(l,u,c){var h=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:eye+u+h};f[c]=h,i.push(f)}return i});const aye=tye;function sye(n){n.registerComponentModel(w0e),n.registerComponentView(C0e),Rd("saveAsImage",P0e),Rd("magicType",D0e),Rd("dataView",H0e),Rd("dataZoom",aye),Rd("restore",Y0e),Vt(b0e)}var oye=function(n){ve(e,n);function e(){var t=n!==null&&n.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}(sn);const lye=oye;function u$(n){var e=n.get("confine");return e!=null?!!e:n.get("renderMode")==="richText"}function c$(n){if(on.domSupported){for(var e=document.documentElement.style,t=0,r=n.length;t<r;t++)if(n[t]in e)return n[t]}}var h$=c$(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),uye=c$(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function f$(n,e){if(!n)return e;e=N7(e,!0);var t=n.indexOf(e);return n=t===-1?e:"-"+n.slice(0,t)+"-"+e,n.toLowerCase()}function cye(n,e){var t=n.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(n);return t?e?t[e]:t:null}var hye=f$(uye,"transition"),gR=f$(h$,"transform"),fye="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(on.transform3dSupported?"will-change:transform;":"");function dye(n){return n=n==="left"?"right":n==="right"?"left":n==="top"?"bottom":"top",n}function pye(n,e,t){if(!Ke(t)||t==="inside")return"";var r=n.get("backgroundColor"),i=n.get("borderWidth");e=hf(e);var a=dye(t),s=Math.max(Math.round(i)*1.5,6),o="",l=gR+":",u;Ft(["left","right"],a)>-1?(o+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(o+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var c=u*Math.PI/180,h=s+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;o+=";"+a+":-"+d+"px";var p=e+" solid "+i+"px;",g=["position:absolute;width:"+s+"px;height:"+s+"px;z-index:-1;",o+";"+l+";","border-bottom:"+p,"border-right:"+p,"background-color:"+r+";"];return'<div style="'+g.join("")+'"></div>'}function vye(n,e){var t="cubic-bezier(0.23,1,0.32,1)",r=" "+n/2+"s "+t,i="opacity"+r+",visibility"+r;return e||(r=" "+n+"s "+t,i+=on.transformSupported?","+gR+r:",left"+r+",top"+r),hye+":"+i}function EO(n,e,t){var r=n.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!on.transformSupported)return t?"top:"+i+";left:"+r+";":[["top",i],["left",r]];var a=on.transform3dSupported,s="translate"+(a?"3d":"")+"("+r+","+i+(a?",0":"")+")";return t?"top:0;left:0;"+gR+":"+s+";":[["top",0],["left",0],[h$,s]]}function gye(n){var e=[],t=n.get("fontSize"),r=n.getTextColor();r&&e.push("color:"+r),e.push("font:"+n.getFont());var i=Et(n.get("lineHeight"),Math.round(t*3/2));t&&e.push("line-height:"+i+"px");var a=n.get("textShadowColor"),s=n.get("textShadowBlur")||0,o=n.get("textShadowOffsetX")||0,l=n.get("textShadowOffsetY")||0;return a&&s&&e.push("text-shadow:"+o+"px "+l+"px "+s+"px "+a),z(["decoration","align"],function(u){var c=n.get(u);c&&e.push("text-"+u+":"+c)}),e.join(";")}function mye(n,e,t){var r=[],i=n.get("transitionDuration"),a=n.get("backgroundColor"),s=n.get("shadowBlur"),o=n.get("shadowColor"),l=n.get("shadowOffsetX"),u=n.get("shadowOffsetY"),c=n.getModel("textStyle"),h=gV(n,"html"),f=l+"px "+u+"px "+s+"px "+o;return r.push("box-shadow:"+f),e&&i&&r.push(vye(i,t)),a&&r.push("background-color:"+a),z(["width","color","radius"],function(d){var p="border-"+d,g=N7(p),v=n.get(g);v!=null&&r.push(p+":"+v+(d==="color"?"":"px"))}),r.push(gye(c)),h!=null&&r.push("padding:"+Qp(h).join("px ")+"px"),r.join(";")+";"}function PO(n,e,t,r,i){var a=e&&e.painter;if(t){var s=a&&a.getViewportRoot();s&&HZ(n,s,t,r,i)}else{n[0]=r,n[1]=i;var o=a&&a.getViewportRootOffset();o&&(n[0]+=o.offsetLeft,n[1]+=o.offsetTop)}n[2]=n[0]/e.getWidth(),n[3]=n[1]/e.getHeight()}var yye=function(){function n(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,on.wxa)return null;var r=document.createElement("div");r.domBelongToZr=!0,this.el=r;var i=this._zr=e.getZr(),a=t.appendTo,s=a&&(Ke(a)?document.querySelector(a):xp(a)?a:ct(a)&&a(e.getDom()));PO(this._styleCoord,i,s,e.getWidth()/2,e.getHeight()/2),(s||e.getDom()).appendChild(r),this._api=e,this._container=s;var o=this;r.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},r.onmousemove=function(l){if(l=l||window.event,!o._enterable){var u=i.handler,c=i.painter.getViewportRoot();vs(c,l,!0),u.dispatch("mousemove",l)}},r.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return n.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),r=cye(t,"position"),i=t.style;i.position!=="absolute"&&r!=="absolute"&&(i.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},n.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var r=this.el,i=r.style,a=this._styleCoord;r.innerHTML?i.cssText=fye+mye(e,!this._firstShow,this._longHide)+EO(a[0],a[1],!0)+("border-color:"+hf(t)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},n.prototype.setContent=function(e,t,r,i,a){var s=this.el;if(e==null){s.innerHTML="";return}var o="";if(Ke(a)&&r.get("trigger")==="item"&&!u$(r)&&(o=pye(r,i,a)),Ke(e))s.innerHTML=e+o;else if(e){s.innerHTML="",Ie(e)||(e=[e]);for(var l=0;l<e.length;l++)xp(e[l])&&e[l].parentNode!==s&&s.appendChild(e[l]);if(o&&s.childNodes.length){var u=document.createElement("div");u.innerHTML=o,s.appendChild(u)}}},n.prototype.setEnterable=function(e){this._enterable=e},n.prototype.getSize=function(){var e=this.el;return e?[e.offsetWidth,e.offsetHeight]:[0,0]},n.prototype.moveTo=function(e,t){if(this.el){var r=this._styleCoord;if(PO(r,this._zr,this._container,e,t),r[0]!=null&&r[1]!=null){var i=this.el.style,a=EO(r[0],r[1]);z(a,function(s){i[s[0]]=s[1]})}}},n.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},n.prototype.hide=function(){var e=this,t=this.el.style;t.visibility="hidden",t.opacity="0",on.transform3dSupported&&(t.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},n.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Qe(this.hide,this),e)):this.hide())},n.prototype.isShow=function(){return this._show},n.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},n}();const _ye=yye;var xye=function(){function n(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),RO(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return n.prototype.update=function(e){var t=e.get("alwaysShowContent");t&&this._moveIfResized(),this._alwaysShowContent=t},n.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},n.prototype.setContent=function(e,t,r,i,a){var s=this;gt(e)&&mn(""),this.el&&this._zr.remove(this.el);var o=r.getModel("textStyle");this.el=new ln({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:i,textShadowColor:o.get("textShadowColor"),fill:r.get(["textStyle","color"]),padding:gV(r,"richText"),verticalAlign:"top",align:"left"},z:r.get("z")}),z(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(u){s.el.style[u]=r.get(u)}),z(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(u){s.el.style[u]=o.get(u)||0}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},n.prototype.setEnterable=function(e){this._enterable=e},n.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),r=LO(e.style);return[t.width+r.left+r.right,t.height+r.top+r.bottom]},n.prototype.moveTo=function(e,t){var r=this.el;if(r){var i=this._styleCoord;RO(i,this._zr,e,t),e=i[0],t=i[1];var a=r.style,s=wu(a.borderWidth||0),o=LO(a);r.x=e+s+o.left,r.y=t+s+o.top,r.markRedraw()}},n.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},n.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},n.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Qe(this.hide,this),e)):this.hide())},n.prototype.isShow=function(){return this._show},n.prototype.dispose=function(){this._zr.remove(this.el)},n}();function wu(n){return Math.max(0,n)}function LO(n){var e=wu(n.shadowBlur||0),t=wu(n.shadowOffsetX||0),r=wu(n.shadowOffsetY||0);return{left:wu(e-t),right:wu(e+t),top:wu(e-r),bottom:wu(e+r)}}function RO(n,e,t,r){n[0]=t,n[1]=r,n[2]=n[0]/e.getWidth(),n[3]=n[1]/e.getHeight()}const bye=xye;var Sye=new nn({shape:{x:-1,y:-1,width:2,height:2}}),wye=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){if(!(on.node||!r.getDom())){var i=t.getComponent("tooltip"),a=this._renderMode=CJ(i.get("renderMode"));this._tooltipContent=a==="richText"?new bye(r):new _ye(r,{appendTo:i.get("appendToBody",!0)?"body":i.get("appendTo",!0)})}},e.prototype.render=function(t,r,i){if(!(on.node||!i.getDom())){this.group.removeAll(),this._tooltipModel=t,this._ecModel=r,this._api=i;var a=this._tooltipContent;a.update(t),a.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow(),this._renderMode!=="richText"&&t.get("transitionDuration")?rv(this,"_updatePosition",50,"fixRate"):qm(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var t=this._tooltipModel,r=t.get("triggerOn");YW("itemTooltip",this._api,Qe(function(i,a,s){r!=="none"&&(r.indexOf(i)>=0?this._tryShow(a,s):i==="leave"&&this._hide(s))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,r=this._ecModel,i=this._api,a=t.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var s=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&s.manuallyShowTip(t,r,i,{x:s._lastX,y:s._lastY,dataByCoordSys:s._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,r,i,a){if(!(a.from===this.uid||on.node||!i.getDom())){var s=DO(a,i);this._ticket="";var o=a.dataByCoordSys,l=Cye(a,r,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"},s)}else if(a.tooltip&&a.x!=null&&a.y!=null){var c=Sye;c.x=a.x,c.y=a.y,c.update(),St(c).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:c},s)}else if(o)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:o,tooltipOption:a.tooltipOption},s);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(t,r,i,a))return;var h=KW(a,r),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"},s)}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},s))}},e.prototype.manuallyHideTip=function(t,r,i,a){var s=this._tooltipContent;this._tooltipModel&&s.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(DO(a,i))},e.prototype._manuallyAxisShowTip=function(t,r,i,a){var s=a.seriesIndex,o=a.dataIndex,l=r.getComponent("axisPointer").coordSysAxesInfo;if(!(s==null||o==null||l==null)){var u=r.getSeriesByIndex(s);if(u){var c=u.getData(),h=sg([c.getItemModel(o),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:s,dataIndex:o,position:a.position}),!0}}},e.prototype._tryShow=function(t,r){var i=t.target,a=this._tooltipModel;if(a){this._lastX=t.offsetX,this._lastY=t.offsetY;var s=t.dataByCoordSys;if(s&&s.length)this._showAxisTooltip(s,t);else if(i){var o=St(i);if(o.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Rh(i,function(c){if(St(c).dataIndex!=null)return l=c,!0;if(St(c).tooltipConfig!=null)return u=c,!0},!0),l?this._showSeriesItemTooltip(t,l,r):u?this._showComponentItemTooltip(t,u,r):this._hide(r)}else this._lastDataByCoordSys=null,this._hide(r)}},e.prototype._showOrMove=function(t,r){var i=t.get("showDelay");r=Qe(r,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(r,i):r()},e.prototype._showAxisTooltip=function(t,r){var i=this._ecModel,a=this._tooltipModel,s=[r.offsetX,r.offsetY],o=sg([r.tooltipOption],a),l=this._renderMode,u=[],c=ii("section",{blocks:[],noHeader:!0}),h=[],f=new _A;z(t,function(y){z(y.dataByAxis,function(_){var x=i.getComponent(_.axisDim+"Axis",_.axisIndex),b=_.value;if(!(!x||b==null)){var S=jW(b,x.axis,i,_.seriesDataIndices,_.valueLabelOpt),w=ii("section",{header:S,noHeader:!no(S),sortBlocks:!0,blocks:[]});c.blocks.push(w),z(_.seriesDataIndices,function(T){var C=i.getSeriesByIndex(T.seriesIndex),A=T.dataIndexInside,M=C.getDataParams(A);if(!(M.dataIndex<0)){M.axisDim=_.axisDim,M.axisIndex=_.axisIndex,M.axisType=_.axisType,M.axisId=_.axisId,M.axisValue=vL(x.axis,{value:b}),M.axisValueLabel=S,M.marker=f.makeTooltipMarker("item",hf(M.color),l);var P=gN(C.formatTooltip(A,!0,null)),D=P.frag;if(D){var L=sg([C],a).get("valueFormatter");w.blocks.push(L?Pe({valueFormatter:L},D):D)}P.text&&h.push(P.text),u.push(M)}})}})}),c.blocks.reverse(),h.reverse();var d=r.position,p=o.get("order"),g=SN(c,f,l,p,i.get("useUTC"),o.get("textStyle"));g&&h.unshift(g);var v=l==="richText"?`
`:"<br/>",m=h.join(v);this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(o,d,s[0],s[1],this._tooltipContent,u):this._showTooltipContent(o,m,u,Math.random()+"",s[0],s[1],d,null,f)})},e.prototype._showSeriesItemTooltip=function(t,r,i){var a=this._ecModel,s=St(r),o=s.seriesIndex,l=a.getSeriesByIndex(o),u=s.dataModel||l,c=s.dataIndex,h=s.dataType,f=u.getData(h),d=this._renderMode,p=t.positionDefault,g=sg([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 _A;m.marker=y.makeTooltipMarker("item",hf(m.color),d);var _=gN(u.formatTooltip(c,!1,h)),x=g.get("order"),b=g.get("valueFormatter"),S=_.frag,w=S?SN(b?Pe({valueFormatter:b},S):S,y,d,x,a.get("useUTC"),g.get("textStyle")):_.text,T="item_"+u.name+"_"+c;this._showOrMove(g,function(){this._showTooltipContent(g,w,m,T,t.offsetX,t.offsetY,t.position,t.target,y)}),i({type:"showTip",dataIndexInside:c,dataIndex:f.getRawIndex(c),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,r,i){var a=this._renderMode==="html",s=St(r),o=s.tooltipConfig,l=o.option||{},u=l.encodeHTMLContent;if(Ke(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=yt(l),l.content=Bi(l.content));var h=[l],f=this._ecModel.getComponent(s.componentMainType,s.componentIndex);f&&h.push(f),h.push({formatter:l.content});var d=t.positionDefault,p=sg(h,this._tooltipModel,d?{position:d}:null),g=p.get("content"),v=Math.random()+"",m=new _A;this._showOrMove(p,function(){var y=yt(p.get("formatterParams")||{});this._showTooltipContent(p,g,y,v,t.offsetX,t.offsetY,t.position,r,m)}),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,r,i,a,s,o,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=r,p=this._getNearestPoint([s,o],i,t.get("trigger"),t.get("borderColor")),g=p.color;if(f)if(Ke(f)){var v=t.ecModel.get("useUTC"),m=Ie(i)?i[0]:i,y=m&&m.axisType&&m.axisType.indexOf("time")>=0;d=f,y&&(d=lS(m.axisValue,d,v)),d=k7(d,i,!0)}else if(ct(f)){var _=Qe(function(x,b){x===this._ticket&&(h.setContent(b,c,t,g,l),this._updatePosition(t,l,s,o,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,s,o,h,i,u)}},e.prototype._getNearestPoint=function(t,r,i,a){if(i==="axis"||Ie(r))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!Ie(r))return{color:a||r.color||r.borderColor}},e.prototype._updatePosition=function(t,r,i,a,s,o,l){var u=this._api.getWidth(),c=this._api.getHeight();r=r||t.get("position");var h=s.getSize(),f=t.get("align"),d=t.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),ct(r)&&(r=r([i,a],o,s.el,p,{viewSize:[u,c],contentSize:h.slice()})),Ie(r))i=Xe(r[0],u),a=Xe(r[1],c);else if(gt(r)){var g=r;g.width=h[0],g.height=h[1];var v=Kr(g,{width:u,height:c});i=v.x,a=v.y,f=null,d=null}else if(Ke(r)&&l){var m=Tye(r,p,h,t.get("borderWidth"));i=m[0],a=m[1]}else{var m=Aye(i,a,s,u,c,f?null:20,d?null:20);i=m[0],a=m[1]}if(f&&(i-=IO(f)?h[0]/2:f==="right"?h[0]:0),d&&(a-=IO(d)?h[1]/2:d==="bottom"?h[1]:0),u$(t)){var m=Mye(i,a,s,u,c);i=m[0],a=m[1]}s.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(t,r){var i=this._lastDataByCoordSys,a=this._cbParamsList,s=!!i&&i.length===t.length;return s&&z(i,function(o,l){var u=o.dataByAxis||[],c=t[l]||{},h=c.dataByAxis||[];s=s&&u.length===h.length,s&&z(u,function(f,d){var p=h[d]||{},g=f.seriesDataIndices||[],v=p.seriesDataIndices||[];s=s&&f.value===p.value&&f.axisType===p.axisType&&f.axisId===p.axisId&&g.length===v.length,s&&z(g,function(m,y){var _=v[y];s=s&&m.seriesIndex===_.seriesIndex&&m.dataIndex===_.dataIndex}),a&&z(f.seriesDataIndices,function(m){var y=m.seriesIndex,_=r[y],x=a[y];_&&x&&x.data!==_.data&&(s=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=r,!!s},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,r){on.node||!r.getDom()||(qm(this,"_updatePosition"),this._tooltipContent.dispose(),WC("itemTooltip",r))},e.type="tooltip",e}(fr);function sg(n,e,t){var r=e.ecModel,i;t?(i=new Wn(t,r,r),i=new Wn(e.option,i,r)):i=e;for(var a=n.length-1;a>=0;a--){var s=n[a];s&&(s instanceof Wn&&(s=s.get("tooltip",!0)),Ke(s)&&(s={formatter:s}),s&&(i=new Wn(s,i,r)))}return i}function DO(n,e){return n.dispatchAction||Qe(e.dispatchAction,e)}function Aye(n,e,t,r,i,a,s){var o=t.getSize(),l=o[0],u=o[1];return a!=null&&(n+l+a+2>r?n-=l+a:n+=a),s!=null&&(e+u+s>i?e-=u+s:e+=s),[n,e]}function Mye(n,e,t,r,i){var a=t.getSize(),s=a[0],o=a[1];return n=Math.min(n+s,r)-s,e=Math.min(e+o,i)-o,n=Math.max(n,0),e=Math.max(e,0),[n,e]}function Tye(n,e,t,r){var i=t[0],a=t[1],s=Math.ceil(Math.SQRT2*r)+8,o=0,l=0,u=e.width,c=e.height;switch(n){case"inside":o=e.x+u/2-i/2,l=e.y+c/2-a/2;break;case"top":o=e.x+u/2-i/2,l=e.y-a-s;break;case"bottom":o=e.x+u/2-i/2,l=e.y+c+s;break;case"left":o=e.x-i-s,l=e.y+c/2-a/2;break;case"right":o=e.x+u+s,l=e.y+c/2-a/2}return[o,l]}function IO(n){return n==="center"||n==="middle"}function Cye(n,e,t){var r=CP(n).queryOptionMap,i=r.keys()[0];if(!(!i||i==="series")){var a=R0(e,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),s=a.models[0];if(s){var o=t.getViewOfComponentModel(s),l;if(o.group.traverse(function(u){var c=St(u).tooltipConfig;if(c&&c.name===n.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:s.componentIndex,el:l}}}}const Eye=wye;function Pye(n){Vt(q0),n.registerComponentModel(lye),n.registerComponentView(Eye),n.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Er),n.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Er)}var Lye=["rect","polygon","keep","clear"];function Rye(n,e){var t=Cn(n?n.brush:[]);if(t.length){var r=[];z(t,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(r=r.concat(u))});var i=n&&n.toolbox;Ie(i)&&(i=i[0]),i||(i={feature:{}},n.toolbox=[i]);var a=i.feature||(i.feature={}),s=a.brush||(a.brush={}),o=s.type||(s.type=[]);o.push.apply(o,r),Dye(o),e&&!o.length&&o.push.apply(o,Lye)}}function Dye(n){var e={};z(n,function(t){e[t]=1}),n.length=0,z(e,function(t,r){n.push(r)})}var NO=z;function kO(n){if(n){for(var e in n)if(n.hasOwnProperty(e))return!0}}function KC(n,e,t){var r={};return NO(e,function(a){var s=r[a]=i();NO(n[a],function(o,l){if(Ti.isValidType(l)){var u={type:l,visual:o};t&&t(u,a),s[l]=new Ti(u),l==="opacity"&&(u=yt(u),u.type="colorAlpha",s.__hidden.__alphaForOpacity=new Ti(u))}})}),r;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var s=new a;return s}}function d$(n,e,t){var r;z(t,function(i){e.hasOwnProperty(i)&&kO(e[i])&&(r=!0)}),r&&z(t,function(i){e.hasOwnProperty(i)&&kO(e[i])?n[i]=yt(e[i]):delete n[i]})}function Iye(n,e,t,r,i,a){var s={};z(n,function(h){var f=Ti.prepareVisualTypes(e[h]);s[h]=f});var o;function l(h){return iL(t,o,h)}function u(h,f){TV(t,o,h,f)}a==null?t.each(c):t.each([a],c);function c(h,f){o=a==null?h:f;var d=t.getRawDataItem(o);if(!(d&&d.visualMap===!1))for(var p=r.call(i,h),g=e[p],v=s[p],m=0,y=v.length;m<y;m++){var _=v[m];g[_]&&g[_].applyVisual(h,l,u)}}}function Nye(n,e,t,r){var i={};return z(n,function(a){var s=Ti.prepareVisualTypes(e[a]);i[a]=s}),{progress:function(s,o){var l;r!=null&&(l=o.getDimensionIndex(r));function u(b){return iL(o,h,b)}function c(b,S){TV(o,h,b,S)}for(var h,f=o.getStore();(h=s.next())!=null;){var d=o.getRawDataItem(h);if(!(d&&d.visualMap===!1))for(var p=r!=null?f.get(l,h):h,g=t(p),v=e[g],m=i[g],y=0,_=m.length;y<_;y++){var x=m[y];v[x]&&v[x].applyVisual(p,u,c)}}}}}function kye(n){var e=n.brushType,t={point:function(r){return OO[e].point(r,t,n)},rect:function(r){return OO[e].rect(r,t,n)}};return t}var OO={lineX:FO(0),lineY:FO(1),rect:{point:function(n,e,t){return n&&t.boundingRect.contain(n[0],n[1])},rect:function(n,e,t){return n&&t.boundingRect.intersect(n)}},polygon:{point:function(n,e,t){return n&&t.boundingRect.contain(n[0],n[1])&&bh(t.range,n[0],n[1])},rect:function(n,e,t){var r=t.range;if(!n||r.length<=1)return!1;var i=n.x,a=n.y,s=n.width,o=n.height,l=r[0];if(bh(r,i,a)||bh(r,i+s,a)||bh(r,i,a+o)||bh(r,i+s,a+o)||Ot.create(n).contain(l[0],l[1])||Ng(i,a,i+s,a,r)||Ng(i,a,i,a+o,r)||Ng(i+s,a,i+s,a+o,r)||Ng(i,a+o,i+s,a+o,r))return!0}}};function FO(n){var e=["x","y"],t=["width","height"];return{point:function(r,i,a){if(r){var s=a.range,o=r[n];return og(o,s)}},rect:function(r,i,a){if(r){var s=a.range,o=[r[e[n]],r[e[n]]+r[t[n]]];return o[1]<o[0]&&o.reverse(),og(o[0],s)||og(o[1],s)||og(s[0],o)||og(s[1],o)}}}}function og(n,e){return e[0]<=n&&n<=e[1]}var BO=["inBrush","outOfBrush"],OM="__ecBrushSelect",ZC="__ecInBrushSelectEvent";function p$(n){n.eachComponent({mainType:"brush"},function(e){var t=e.brushTargetManager=new pR(e.option,n);t.setInputRanges(e.areas,n)})}function Oye(n,e,t){var r=[],i,a;n.eachComponent({mainType:"brush"},function(s){t&&t.type==="takeGlobalCursor"&&s.setBrushOption(t.key==="brush"?t.brushOption:{brushType:!1})}),p$(n),n.eachComponent({mainType:"brush"},function(s,o){var l={brushId:s.id,brushIndex:o,brushName:s.name,areas:yt(s.areas),selected:[]};r.push(l);var u=s.option,c=u.brushLink,h=[],f=[],d=[],p=!1;o||(i=u.throttleType,a=u.throttleDelay);var g=Ne(s.areas,function(b){var S=zye[b.brushType],w=dt({boundingRect:S?S(b):void 0},b);return w.selectors=kye(w),w}),v=KC(s.option,BO,function(b){b.mappingMethod="fixed"});Ie(c)&&z(c,function(b){h[b]=1});function m(b){return c==="all"||!!h[b]}function y(b){return!!b.length}n.eachSeries(function(b,S){var w=d[S]=[];b.subType==="parallel"?_(b,S):x(b,S,w)});function _(b,S){var w=b.coordinateSystem;p=p||w.hasAxisBrushed(),m(S)&&w.eachActiveState(b.getData(),function(T,C){T==="active"&&(f[C]=1)})}function x(b,S,w){if(!(!b.brushSelector||Gye(s,S))&&(z(g,function(C){s.brushTargetManager.controlSeries(C,b,n)&&w.push(C),p=p||y(w)}),m(S)&&y(w))){var T=b.getData();T.each(function(C){GO(b,w,T,C)&&(f[C]=1)})}}n.eachSeries(function(b,S){var w={seriesId:b.id,seriesIndex:S,seriesName:b.name,dataIndex:[]};l.selected.push(w);var T=d[S],C=b.getData(),A=m(S)?function(M){return f[M]?(w.dataIndex.push(C.getRawIndex(M)),"inBrush"):"outOfBrush"}:function(M){return GO(b,T,C,M)?(w.dataIndex.push(C.getRawIndex(M)),"inBrush"):"outOfBrush"};(m(S)?p:y(T))&&Iye(BO,v,C,A)})}),Fye(e,i,a,r,t)}function Fye(n,e,t,r,i){if(i){var a=n.getZr();if(!a[ZC]){a[OM]||(a[OM]=Bye);var s=rv(a,OM,t,e);s(n,r)}}}function Bye(n,e){if(!n.isDisposed()){var t=n.getZr();t[ZC]=!0,n.dispatchAction({type:"brushSelect",batch:e}),t[ZC]=!1}}function GO(n,e,t,r){for(var i=0,a=e.length;i<a;i++){var s=e[i];if(n.brushSelector(r,t,s.selectors,s))return!0}}function Gye(n,e){var t=n.option.seriesIndex;return t!=null&&t!=="all"&&(Ie(t)?Ft(t,e)<0:e!==t)}var zye={rect:function(n){return zO(n.range)},polygon:function(n){for(var e,t=n.range,r=0,i=t.length;r<i;r++){e=e||[[1/0,-1/0],[1/0,-1/0]];var a=t[r];a[0]<e[0][0]&&(e[0][0]=a[0]),a[0]>e[0][1]&&(e[0][1]=a[0]),a[1]<e[1][0]&&(e[1][0]=a[1]),a[1]>e[1][1]&&(e[1][1]=a[1])}return e&&zO(e)}};function zO(n){return new Ot(n[0][0],n[1][0],n[0][1]-n[0][0],n[1][1]-n[1][0])}var Uye=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){this.ecModel=t,this.api=r,this.model,(this._brushController=new jL(r.getZr())).on("brush",Qe(this._onBrush,this)).mount()},e.prototype.render=function(t,r,i,a){this.model=t,this._updateController(t,r,i,a)},e.prototype.updateTransform=function(t,r,i,a){p$(r),this._updateController(t,r,i,a)},e.prototype.updateVisual=function(t,r,i,a){this.updateTransform(t,r,i,a)},e.prototype.updateView=function(t,r,i,a){this._updateController(t,r,i,a)},e.prototype._updateController=function(t,r,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 r=this.model.id,i=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:r,areas:yt(i),$from:r}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:r,areas:yt(i),$from:r})},e.type="brush",e}(fr);const Vye=Uye;var Hye="#ddd",Wye=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.areas=[],t.brushOption={},t}return e.prototype.optionUpdated=function(t,r){var i=this.option;!r&&d$(i,t,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:Hye},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=Ne(t,function(r){return UO(this.option,r)},this))},e.prototype.setBrushOption=function(t){this.brushOption=UO(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}(sn);function UO(n,e){return It({brushType:n.brushType,brushMode:n.brushMode,transformable:n.transformable,brushStyle:new Wn(n.brushStyle).getItemStyle(),removeOnClick:n.removeOnClick,z:n.z},e,!0)}const $ye=Wye;var jye=["rect","polygon","lineX","lineY","keep","clear"],qye=function(n){ve(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i){var a,s,o;r.eachComponent({mainType:"brush"},function(l){a=l.brushType,s=l.brushOption.brushMode||"single",o=o||!!l.areas.length}),this._brushType=a,this._brushMode=s,z(t.get("type",!0),function(l){t.setIconStatus(l,(l==="keep"?s==="multiple":l==="clear"?o:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(t,r,i){this.render(t,r,i)},e.prototype.getIcons=function(){var t=this.model,r=t.get("icon",!0),i={};return z(t.get("type",!0),function(a){r[a]&&(i[a]=r[a])}),i},e.prototype.onclick=function(t,r,i){var a=this._brushType,s=this._brushMode;i==="clear"?(r.dispatchAction({type:"axisAreaSelect",intervals:[]}),r.dispatchAction({type:"brush",command:"clear",areas:[]})):r.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?s==="multiple"?"single":"multiple":s}})},e.getDefaultOption=function(t){var r={show:!0,type:jye.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 r},e}(bs);const Xye=qye;function Yye(n){n.registerComponentView(Vye),n.registerComponentModel($ye),n.registerPreprocessor(Rye),n.registerVisual(n.PRIORITY.VISUAL.BRUSH,Oye),n.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(r){r.setAreas(e.areas)})}),n.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Er),n.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Er),Rd("brush",Xye)}var Kye=function(n){ve(e,n);function e(){var t=n!==null&&n.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}(sn),Zye=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){if(this.group.removeAll(),!!t.get("show")){var a=this.group,s=t.getModel("textStyle"),o=t.getModel("subtextStyle"),l=t.get("textAlign"),u=Et(t.get("textBaseline"),t.get("textVerticalAlign")),c=new ln({style:Hn(s,{text:t.get("text"),fill:s.getTextColor()},{disableBox:!0}),z2:10}),h=c.getBoundingRect(),f=t.get("subtext"),d=new ln({style:Hn(o,{text:f,fill:o.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(){Rx(p,"_"+t.get("target"))}),g&&d.on("click",function(){Rx(g,"_"+t.get("subtarget"))}),St(c).eventData=St(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 _=Kr(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 b=_.margin,S=t.getItemStyle(["color","opacity"]);S.fill=t.get("backgroundColor");var w=new nn({shape:{x:m.x-b[3],y:m.y-b[0],width:m.width+b[1]+b[3],height:m.height+b[0]+b[2],r:t.get("borderRadius")},style:S,subPixelOptimize:!0,silent:!0});a.add(w)}},e.type="title",e}(fr);function Qye(n){n.registerComponentModel(Kye),n.registerComponentView(Zye)}var Jye=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode="box",t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i),this._initData()},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){t==null&&(t=this.option.currentIndex);var r=this._data.count();this.option.loop?t=(t%r+r)%r:(t>=r&&(t=r-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,r=t.data||[],i=t.axisType,a=this._names=[],s;i==="category"?(s=[],z(r,function(u,c){var h=Yr(qp(u),""),f;gt(u)?(f=yt(u),f.value=c):f=c,s.push(f),a.push(h)})):s=r;var o={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new ia([{name:"value",type:o}],this);l.initData(s,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}(sn);const VO=Jye;var v$=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline.slider",e.defaultOption=wc(VO.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}(VO);zr(v$,vS.prototype);const e_e=v$;var t_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline",e}(fr);const n_e=t_e;var r_e=function(n){ve(e,n);function e(t,r,i,a){var s=n.call(this,t,r,i)||this;return s.type=a||"value",s}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(po);const i_e=r_e;var FM=Math.PI,HO=en(),a_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){this.api=r},e.prototype.render=function(t,r,i){if(this.model=t,this.api=i,this.ecModel=r,this.group.removeAll(),t.get("show",!0)){var a=this._layout(t,i),s=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,t);t.formatTooltip=function(u){var c=l.scale.getLabel({value:u});return ii("nameValue",{noName:!0,value:c})},z(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,s,l,t)},this),this._renderAxisLabel(a,o,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,r){var i=t.get(["label","position"]),a=t.get("orient"),s=o_e(t,r),o;i==null||i==="auto"?o=a==="horizontal"?s.y+s.height/2<r.getHeight()/2?"-":"+":s.x+s.width/2<r.getWidth()/2?"+":"-":Ke(i)?o={horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[a][i]:o=i;var l={horizontal:"center",vertical:o>=0||o==="+"?"left":"right"},u={horizontal:o>=0||o==="+"?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:FM/2},h=a==="vertical"?s.height:s.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*FM/180;var y,_,x,b=f.get("position",!0),S=d&&f.get("showPlayBtn",!0),w=d&&f.get("showPrevBtn",!0),T=d&&f.get("showNextBtn",!0),C=0,A=h;b==="left"||b==="bottom"?(S&&(y=[0,0],C+=v),w&&(_=[C,0],C+=v),T&&(x=[A-p,0],A-=v)):(S&&(y=[A-p,0],A-=v),w&&(_=[0,0],C+=v),T&&(x=[A-p,0],A-=v));var M=[C,A];return t.get("inverse")&&M.reverse(),{viewRect:s,mainLength:h,orient:a,rotation:c[a],labelRotation:m,labelPosOpt:o,labelAlign:t.get(["label","align"])||l[a],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[a],playPosition:y,prevBtnPosition:_,nextBtnPosition:x,axisExtent:M,controlSize:p,controlGap:g}},e.prototype._position=function(t,r){var i=this._mainGroup,a=this._labelGroup,s=t.viewRect;if(t.orient==="vertical"){var o=Za(),l=s.x,u=s.y+s.height;Ko(o,o,[-l,-u]),Sf(o,o,-FM/2),Ko(o,o,[l,u]),s=s.clone(),s.applyTransform(o)}var c=y(s),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,b,S,w,T){x[w]+=S[w][T]-b[w][T]}},e.prototype._createAxis=function(t,r){var i=r.getData(),a=r.get("axisType"),s=s_e(r,a);s.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var o=i.getDataExtent("value");s.setExtent(o[0],o[1]),s.calcNiceTicks();var l=new i_e("value",s,t.axisExtent,a);return l.model=r,l},e.prototype._createGroup=function(t){var r=this[t]=new bt;return this.group.add(r),r},e.prototype._renderAxisLine=function(t,r,i,a){var s=i.getExtent();if(a.get(["lineStyle","show"])){var o=new pi({shape:{x1:s[0],y1:0,x2:s[1],y2:0},style:Pe({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});r.add(o);var l=this._progressLine=new pi({shape:{x1:s[0],x2:this._currentPointer?this._currentPointer.x:s[0],y1:0,y2:0},style:dt({lineCap:"round",lineWidth:o.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});r.add(l)}},e.prototype._renderAxisTick=function(t,r,i,a){var s=this,o=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],z(l,function(u){var c=i.dataToCoord(u.value),h=o.getItemModel(u.value),f=h.getModel("itemStyle"),d=h.getModel(["emphasis","itemStyle"]),p=h.getModel(["progress","itemStyle"]),g={x:c,y:0,onclick:Qe(s._changeTimeline,s,u.value)},v=WO(h,f,r,g);v.ensureState("emphasis").style=d.getItemStyle(),v.ensureState("progress").style=p.getItemStyle(),jh(v);var m=St(v);h.get("tooltip")?(m.dataIndex=u.value,m.dataModel=a):m.dataIndex=m.dataModel=null,s._tickSymbols.push(v)})},e.prototype._renderAxisLabel=function(t,r,i,a){var s=this,o=i.getLabelModel();if(o.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],z(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 ln({x:v,y:0,rotation:t.labelRotation-t.rotation,onclick:Qe(s._changeTimeline,s,h),silent:!1,style:Hn(d,{text:c.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});m.ensureState("emphasis").style=Hn(p),m.ensureState("progress").style=Hn(g),r.add(m),jh(m),HO(m).dataIndex=h,s._tickLabels.push(m)})}},e.prototype._renderControl=function(t,r,i,a){var s=t.controlSize,o=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",Qe(this._changeTimeline,this,h?"-":"+")),f(t.prevBtnPosition,"prev",Qe(this._changeTimeline,this,h?"+":"-")),f(t.playPosition,c?"stop":"play",Qe(this._handlePlayClick,this,!c),!0);function f(d,p,g,v){if(d){var m=uo(Et(a.get(["controlStyle",p+"BtnSize"]),s),s),y=[0,-m/2,m,m],_=l_e(a,p+"Icon",y,{x:d[0],y:d[1],originX:s/2,originY:0,rotation:v?-o:0,rectHover:!0,style:l,onclick:g});_.ensureState("emphasis").style=u,r.add(_),jh(_)}}},e.prototype._renderCurrentPointer=function(t,r,i,a){var s=a.getData(),o=a.getCurrentIndex(),l=s.getItemModel(o).getModel("checkpointStyle"),u=this,c={onCreate:function(h){h.draggable=!0,h.drift=Qe(u._handlePointerDrag,u),h.ondragend=Qe(u._handlePointerDragend,u),$O(h,u._progressLine,o,i,a,!0)},onUpdate:function(h){$O(h,u._progressLine,o,i,a)}};this._currentPointer=WO(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,r,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,r){var i=this._toAxisCoord(t)[0],a=this._axis,s=Rs(a.getExtent().slice());i>s[1]&&(i=s[1]),i<s[0]&&(i=s[0]),this._currentPointer.x=i,this._currentPointer.markRedraw();var o=this._progressLine;o&&(o.shape.x2=i,o.dirty());var l=this._findNearestTick(i),u=this.model;(r||l!==u.getCurrentIndex()&&u.get("realtime"))&&this._changeTimeline(l)},e.prototype._doPlayStop=function(){var t=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(function(){var r=t.model;t._changeTimeline(r.getCurrentIndex()+(r.get("rewind",!0)?-1:1))},this.model.get("playInterval")))},e.prototype._toAxisCoord=function(t){var r=this._mainGroup.getLocalTransform();return so(t,r,!0)},e.prototype._findNearestTick=function(t){var r=this.model.getData(),i=1/0,a,s=this._axis;return r.each(["value"],function(o,l){var u=s.dataToCoord(o),c=Math.abs(u-t);c<i&&(i=c,a=l)}),a},e.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},e.prototype._changeTimeline=function(t){var r=this.model.getCurrentIndex();t==="+"?t=r+1:t==="-"&&(t=r-1),this.api.dispatchAction({type:"timelineChange",currentIndex:t,from:this.uid})},e.prototype._updateTicksStatus=function(){var t=this.model.getCurrentIndex(),r=this._tickSymbols,i=this._tickLabels;if(r)for(var a=0;a<r.length;a++)r&&r[a]&&r[a].toggleState("progress",a<t);if(i)for(var a=0;a<i.length;a++)i&&i[a]&&i[a].toggleState("progress",HO(i[a]).dataIndex<=t)},e.type="timeline.slider",e}(n_e);function s_e(n,e){if(e=e||n.get("type"),e)switch(e){case"category":return new hL({ordinalMeta:n.getCategories(),extent:[1/0,-1/0]});case"time":return new v9({locale:n.ecModel.getLocaleModel(),useUTC:n.ecModel.get("useUTC")});default:return new pc}}function o_e(n,e){return Kr(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},n.get("padding"))}function l_e(n,e,t,r){var i=r.style,a=N0(n.get(["controlStyle",e]),r||{},new Ot(t[0],t[1],t[2],t[3]));return i&&a.setStyle(i),a}function WO(n,e,t,r,i,a){var s=e.get("color");if(i)i.setColor(s),t.add(i),a&&a.onUpdate(i);else{var o=n.get("symbol");i=Br(o,-1,-1,2,2,s),i.setStyle("strokeNoScale",!0),t.add(i),a&&a.onCreate(i)}var l=e.getItemStyle(["color"]);i.setStyle(l),r=It({rectHover:!0,z2:100},r,!0);var u=iv(n.get("symbolSize"));r.scaleX=u[0]/2,r.scaleY=u[1]/2;var c=Tf(n.get("symbolOffset"),u);c&&(r.x=(r.x||0)+c[0],r.y=(r.y||0)+c[1]);var h=n.get("symbolRotate");return r.rotation=(h||0)*Math.PI/180||0,i.attr(r),i.updateTransform(),i}function $O(n,e,t,r,i,a){if(!n.dragging){var s=i.getModel("checkpointStyle"),o=r.dataToCoord(i.getData().get("value",t));if(a||!s.get("animation",!0))n.attr({x:o,y:0}),e&&e.attr({shape:{x2:o}});else{var l={duration:s.get("animationDuration",!0),easing:s.get("animationEasing",!0)};n.stopAnimation(null,!0),n.animateTo({x:o,y:0},l),e&&e.animateTo({shape:{x2:o}},l)}}}const u_e=a_e;function c_e(n){n.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(e,t,r){var i=t.getComponent("timeline");return i&&e.currentIndex!=null&&(i.setCurrentIndex(e.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.getPlayState()&&(i.setPlayState(!1),r.dispatchAction({type:"timelinePlayChange",playState:!1,from:e.from}))),t.resetOption("timeline",{replaceMerge:i.get("replaceMerge",!0)}),dt({currentIndex:i.option.currentIndex},e)}),n.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(e,t){var r=t.getComponent("timeline");r&&e.playState!=null&&r.setPlayState(e.playState)})}function h_e(n){var e=n&&n.timeline;Ie(e)||(e=e?[e]:[]),z(e,function(t){t&&f_e(t)})}function f_e(n){var e=n.type,t={number:"value",time:"time"};if(t[e]&&(n.axisType=t[e],delete n.type),jO(n),Ah(n,"controlPosition")){var r=n.controlStyle||(n.controlStyle={});Ah(r,"position")||(r.position=n.controlPosition),r.position==="none"&&!Ah(r,"show")&&(r.show=!1,delete r.position),delete n.controlPosition}z(n.data||[],function(i){gt(i)&&!Ie(i)&&(!Ah(i,"value")&&Ah(i,"name")&&(i.value=i.name),jO(i))})}function jO(n){var e=n.itemStyle||(n.itemStyle={}),t=e.emphasis||(e.emphasis={}),r=n.label||n.label||{},i=r.normal||(r.normal={}),a={normal:1,emphasis:1};z(r,function(s,o){!a[o]&&!Ah(i,o)&&(i[o]=s)}),t.label&&!Ah(r,"emphasis")&&(r.emphasis=t.label,delete t.label)}function Ah(n,e){return n.hasOwnProperty(e)}function d_e(n){n.registerComponentModel(e_e),n.registerComponentView(u_e),n.registerSubTypeDefaulter("timeline",function(){return"slider"}),c_e(n),n.registerPreprocessor(h_e)}function mR(n,e){if(!n)return!1;for(var t=Ie(n)?n:[n],r=0;r<t.length;r++)if(t[r]&&t[r][e])return!0;return!1}function d_(n){of(n,"label",["show"])}var p_=en(),g$=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.createdBySelf=!1,t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i),this._mergeOption(t,i,!1,!0)},e.prototype.isAnimationEnabled=function(){if(on.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},e.prototype.mergeOption=function(t,r){this._mergeOption(t,r,!1,!1)},e.prototype._mergeOption=function(t,r,i,a){var s=this.mainType;i||r.eachSeries(function(o){var l=o.get(this.mainType,!0),u=p_(o)[s];if(!l||!l.data){p_(o)[s]=null;return}u?u._mergeOption(l,r,!0):(a&&d_(l),z(l.data,function(c){c instanceof Array?(d_(c[0]),d_(c[1])):d_(c)}),u=this.createMarkerModelFromSeries(l,this,r),Pe(u,{mainType:this.mainType,seriesIndex:o.seriesIndex,name:o.name,createdBySelf:!0}),u.__hostSeries=o),p_(o)[s]=u},this)},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),s=this.getRawValue(t),o=a.getName(t);return ii("section",{header:this.name,blocks:[ii("nameValue",{name:o,value:s,noName:!o,noValue:s==null})]})},e.prototype.getData=function(){return this._data},e.prototype.setData=function(t){this._data=t},e.prototype.getDataParams=function(t,r){var i=vS.prototype.getDataParams.call(this,t,r),a=this.__hostSeries;return a&&(i.seriesId=a.id,i.seriesName=a.name,i.seriesType=a.subType),i},e.getMarkerModelFromSeries=function(t,r){return p_(t)[r]},e.type="marker",e.dependencies=["series","grid","polar","geo"],e}(sn);zr(g$,vS.prototype);const mc=g$;var p_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,r,i){return new e(t,r,i)},e.type="markPoint",e.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},e}(mc);const v_e=p_e;function QC(n){return!(isNaN(parseFloat(n.x))&&isNaN(parseFloat(n.y)))}function g_e(n){return!isNaN(parseFloat(n.x))&&!isNaN(parseFloat(n.y))}function v_(n,e,t,r,i,a){var s=[],o=dc(e,r),l=o?e.getCalculationInfo("stackResultDimension"):r,u=yR(e,l,n),c=e.indicesOfNearest(l,u)[0];s[i]=e.get(t,c),s[a]=e.get(l,c);var h=e.get(r,c),f=Go(e.get(r,c));return f=Math.min(f,20),f>=0&&(s[a]=+s[a].toFixed(f)),[s,h]}var BM={min:Rt(v_,"min"),max:Rt(v_,"max"),average:Rt(v_,"average"),median:Rt(v_,"median")};function s0(n,e){if(e){var t=n.getData(),r=n.coordinateSystem,i=r&&r.dimensions;if(!g_e(e)&&!Ie(e.coord)&&Ie(i)){var a=m$(e,t,r,n);if(e=yt(e),e.type&&BM[e.type]&&a.baseAxis&&a.valueAxis){var s=Ft(i,a.baseAxis.dim),o=Ft(i,a.valueAxis.dim),l=BM[e.type](t,a.baseDataDim,a.valueDataDim,s,o);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||!Ie(i))e.coord=[];else for(var u=e.coord,c=0;c<2;c++)BM[u[c]]&&(u[c]=yR(t,t.mapDimension(i[c]),u[c]));return e}}function m$(n,e,t,r){var i={};return n.valueIndex!=null||n.valueDim!=null?(i.valueDataDim=n.valueIndex!=null?e.getDimension(n.valueIndex):n.valueDim,i.valueAxis=t.getAxis(m_e(r,i.valueDataDim)),i.baseAxis=t.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=t.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function m_e(n,e){var t=n.getData().getDimensionInfo(e);return t&&t.coordDim}function o0(n,e){return n&&n.containData&&e.coord&&!QC(e)?n.containData(e.coord):!0}function y_e(n,e,t){return n&&n.containZone&&e.coord&&t.coord&&!QC(e)&&!QC(t)?n.containZone(e.coord,t.coord):!0}function y$(n,e){return n?function(t,r,i,a){var s=a<2?t.coord&&t.coord[a]:t.value;return Ju(s,e[a])}:function(t,r,i,a){return Ju(t.value,e[a])}}function yR(n,e,t){if(t==="average"){var r=0,i=0;return n.each(e,function(a,s){isNaN(a)||(r+=a,i++)}),r/i}else return t==="median"?n.getMedian(e):n.getDataExtent(e)[t==="max"?1:0]}var GM=en(),__e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this.markerGroupMap=st()},e.prototype.render=function(t,r,i){var a=this,s=this.markerGroupMap;s.each(function(o){GM(o).keep=!1}),r.eachSeries(function(o){var l=mc.getMarkerModelFromSeries(o,a.type);l&&a.renderSeries(o,l,r,i)}),s.each(function(o){!GM(o).keep&&a.group.remove(o.group)})},e.prototype.markKeep=function(t){GM(t).keep=!0},e.prototype.toggleBlurSeries=function(t,r){var i=this;z(t,function(a){var s=mc.getMarkerModelFromSeries(a,i.type);if(s){var o=s.getData();o.eachItemGraphicEl(function(l){l&&(r?HU(l):NP(l))})}})},e.type="marker",e}(fr);const _R=__e;function qO(n,e,t){var r=e.coordinateSystem;n.each(function(i){var a=n.getItemModel(i),s,o=Xe(a.get("x"),t.getWidth()),l=Xe(a.get("y"),t.getHeight());if(!isNaN(o)&&!isNaN(l))s=[o,l];else if(e.getMarkerPosition)s=e.getMarkerPosition(n.getValues(n.dimensions,i));else if(r){var u=n.get(r.dimensions[0],i),c=n.get(r.dimensions[1],i);s=r.dataToPoint([u,c])}isNaN(o)||(s[0]=o),isNaN(l)||(s[1]=l),n.setItemLayout(i,s)})}var x_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var s=mc.getMarkerModelFromSeries(a,"markPoint");s&&(qO(s.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(t,r,i,a){var s=t.coordinateSystem,o=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(o)||u.set(o,new z0),h=b_e(s,t,r);r.setData(h),qO(r.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(ct(p)||ct(g)||ct(v)||ct(m)){var _=r.getRawValue(f),x=r.getDataParams(f);ct(p)&&(p=p(_,x)),ct(g)&&(g=g(_,x)),ct(v)&&(v=v(_,x)),ct(m)&&(m=m(_,x))}var b=d.getModel("itemStyle").getItemStyle(),S=O0(l,"color");b.fill||(b.fill=S),h.setItemVisual(f,{symbol:p,symbolSize:g,symbolRotate:v,symbolOffset:m,symbolKeepAspect:y,style:b})}),c.updateData(h),this.group.add(c.group),h.eachItemGraphicEl(function(f){f.traverse(function(d){St(d).dataModel=r})}),this.markKeep(c),c.group.silent=r.get("silent")||t.get("silent")},e.type="markPoint",e}(_R);function b_e(n,e,t){var r;n?r=Ne(n&&n.dimensions,function(o){var l=e.getData().getDimensionInfo(e.getData().mapDimension(o))||{};return Pe(Pe({},l),{name:o,ordinalMeta:null})}):r=[{name:"value",type:"float"}];var i=new ia(r,t),a=Ne(t.get("data"),Rt(s0,e));n&&(a=_n(a,Rt(o0,n)));var s=y$(!!n,r);return i.initData(a,null,s),i}const S_e=x_e;function w_e(n){n.registerComponentModel(v_e),n.registerComponentView(S_e),n.registerPreprocessor(function(e){mR(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var A_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,r,i){return new e(t,r,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}(mc);const M_e=A_e;var g_=en(),T_e=function(n,e,t,r){var i=n.getData(),a;if(Ie(r))a=r;else{var s=r.type;if(s==="min"||s==="max"||s==="average"||s==="median"||r.xAxis!=null||r.yAxis!=null){var o=void 0,l=void 0;if(r.yAxis!=null||r.xAxis!=null)o=e.getAxis(r.yAxis!=null?"y":"x"),l=di(r.yAxis,r.xAxis);else{var u=m$(r,i,e,n);o=u.valueAxis;var c=t9(i,u.valueDataDim);l=yR(i,c,s)}var h=o.dim==="x"?0:1,f=1-h,d=yt(r),p={coord:[]};d.type=null,d.coord=[],d.coord[f]=-1/0,p.coord[f]=1/0;var g=t.get("precision");g>=0&&un(l)&&(l=+l.toFixed(Math.min(g,20))),d.coord[h]=p.coord[h]=l,a=[d,p,{type:s,valueIndex:r.valueIndex,value:l}]}else a=[]}var v=[s0(n,a[0]),s0(n,a[1]),Pe({},a[2])];return v[2].type=v[2].type||null,It(v[2],v[0]),It(v[2],v[1]),v};function rb(n){return!isNaN(n)&&!isFinite(n)}function XO(n,e,t,r){var i=1-n,a=r.dimensions[n];return rb(e[i])&&rb(t[i])&&e[n]===t[n]&&r.getAxis(a).containData(e[n])}function C_e(n,e){if(n.type==="cartesian2d"){var t=e[0].coord,r=e[1].coord;if(t&&r&&(XO(1,t,r,n)||XO(0,t,r,n)))return!0}return o0(n,e[0])&&o0(n,e[1])}function zM(n,e,t,r,i){var a=r.coordinateSystem,s=n.getItemModel(e),o,l=Xe(s.get("x"),i.getWidth()),u=Xe(s.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))o=[l,u];else{if(r.getMarkerPosition)o=r.getMarkerPosition(n.getValues(n.dimensions,e));else{var c=a.dimensions,h=n.get(c[0],e),f=n.get(c[1],e);o=a.dataToPoint([h,f])}if(Ef(a,"cartesian2d")){var d=a.getAxis("x"),p=a.getAxis("y"),c=a.dimensions;rb(n.get(c[0],e))?o[0]=d.toGlobalCoord(d.getExtent()[t?0:1]):rb(n.get(c[1],e))&&(o[1]=p.toGlobalCoord(p.getExtent()[t?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}n.setItemLayout(e,o)}var E_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var s=mc.getMarkerModelFromSeries(a,"markLine");if(s){var o=s.getData(),l=g_(s).from,u=g_(s).to;l.each(function(c){zM(l,c,!0,a,i),zM(u,c,!1,a,i)}),o.each(function(c){o.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,r,i,a){var s=t.coordinateSystem,o=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(o)||u.set(o,new zL);this.group.add(c.group);var h=P_e(s,t,r),f=h.from,d=h.to,p=h.line;g_(r).from=f,g_(r).to=d,r.setData(p);var g=r.get("symbol"),v=r.get("symbolSize"),m=r.get("symbolRotate"),y=r.get("symbolOffset");Ie(g)||(g=[g,g]),Ie(v)||(v=[v,v]),Ie(m)||(m=[m,m]),Ie(y)||(y=[y,y]),h.from.each(function(x){_(f,x,!0),_(d,x,!1)}),p.each(function(x){var b=p.getItemModel(x).getModel("lineStyle").getLineStyle();p.setItemLayout(x,[f.getItemLayout(x),d.getItemLayout(x)]),b.stroke==null&&(b.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:b})}),c.updateData(p),h.line.eachItemGraphicEl(function(x){St(x).dataModel=r,x.traverse(function(b){St(b).dataModel=r})});function _(x,b,S){var w=x.getItemModel(b);zM(x,b,S,t,a);var T=w.getModel("itemStyle").getItemStyle();T.fill==null&&(T.fill=O0(l,"color")),x.setItemVisual(b,{symbolKeepAspect:w.get("symbolKeepAspect"),symbolOffset:Et(w.get("symbolOffset",!0),y[S?0:1]),symbolRotate:Et(w.get("symbolRotate",!0),m[S?0:1]),symbolSize:Et(w.get("symbolSize"),v[S?0:1]),symbol:Et(w.get("symbol",!0),g[S?0:1]),style:T})}this.markKeep(c),c.group.silent=r.get("silent")||t.get("silent")},e.type="markLine",e}(_R);function P_e(n,e,t){var r;n?r=Ne(n&&n.dimensions,function(u){var c=e.getData().getDimensionInfo(e.getData().mapDimension(u))||{};return Pe(Pe({},c),{name:u,ordinalMeta:null})}):r=[{name:"value",type:"float"}];var i=new ia(r,t),a=new ia(r,t),s=new ia([],t),o=Ne(t.get("data"),Rt(T_e,e,n,t));n&&(o=_n(o,Rt(C_e,n)));var l=y$(!!n,r);return i.initData(Ne(o,function(u){return u[0]}),null,l),a.initData(Ne(o,function(u){return u[1]}),null,l),s.initData(Ne(o,function(u){return u[2]})),s.hasItemOption=!0,{from:i,to:a,line:s}}const L_e=E_e;function R_e(n){n.registerComponentModel(M_e),n.registerComponentView(L_e),n.registerPreprocessor(function(e){mR(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var D_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,r,i){return new e(t,r,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}(mc);const I_e=D_e;var m_=en(),N_e=function(n,e,t,r){var i=r[0],a=r[1];if(!(!i||!a)){var s=s0(n,i),o=s0(n,a),l=s.coord,u=o.coord;l[0]=di(l[0],-1/0),l[1]=di(l[1],-1/0),u[0]=di(u[0],1/0),u[1]=di(u[1],1/0);var c=vP([{},s,o]);return c.coord=[s.coord,o.coord],c.x0=s.x,c.y0=s.y,c.x1=o.x,c.y1=o.y,c}};function ib(n){return!isNaN(n)&&!isFinite(n)}function YO(n,e,t,r){var i=1-n;return ib(e[i])&&ib(t[i])}function k_e(n,e){var t=e.coord[0],r=e.coord[1],i={coord:t,x:e.x0,y:e.y0},a={coord:r,x:e.x1,y:e.y1};return Ef(n,"cartesian2d")?t&&r&&(YO(1,t,r)||YO(0,t,r))?!0:y_e(n,i,a):o0(n,i)||o0(n,a)}function KO(n,e,t,r,i){var a=r.coordinateSystem,s=n.getItemModel(e),o,l=Xe(s.get(t[0]),i.getWidth()),u=Xe(s.get(t[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))o=[l,u];else{if(r.getMarkerPosition){var c=n.getValues(["x0","y0"],e),h=n.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],o=r.getMarkerPosition(p,t,!0)}else{var g=n.get(t[0],e),v=n.get(t[1],e),m=[g,v];a.clampData&&a.clampData(m,m),o=a.dataToPoint(m,!0)}if(Ef(a,"cartesian2d")){var y=a.getAxis("x"),_=a.getAxis("y"),g=n.get(t[0],e),v=n.get(t[1],e);ib(g)?o[0]=y.toGlobalCoord(y.getExtent()[t[0]==="x0"?0:1]):ib(v)&&(o[1]=_.toGlobalCoord(_.getExtent()[t[1]==="y0"?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}return o}var ZO=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],O_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var s=mc.getMarkerModelFromSeries(a,"markArea");if(s){var o=s.getData();o.each(function(l){var u=Ne(ZO,function(h){return KO(o,l,h,a,i)});o.setItemLayout(l,u);var c=o.getItemGraphicEl(l);c.setShape("points",u)})}},this)},e.prototype.renderSeries=function(t,r,i,a){var s=t.coordinateSystem,o=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(o)||u.set(o,{group:new bt});this.group.add(c.group),this.markKeep(c);var h=F_e(s,t,r);r.setData(h),h.each(function(f){var d=Ne(ZO,function(T){return KO(h,f,T,t,a)}),p=s.getAxis("x").scale,g=s.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))];Rs(y),Rs(_);var x=!(v[0]>y[1]||v[1]<y[0]||m[0]>_[1]||m[1]<_[0]),b=!x;h.setItemLayout(f,{points:d,allClipped:b});var S=h.getItemModel(f).getModel("itemStyle").getItemStyle(),w=O0(l,"color");S.fill||(S.fill=w,Ke(S.fill)&&(S.fill=yx(S.fill,.4))),S.stroke||(S.stroke=w),h.setItemVisual(f,"style",S)}),h.diff(m_(c).data).add(function(f){var d=h.getItemLayout(f);if(!d.allClipped){var p=new Ra({shape:{points:d.points}});h.setItemGraphicEl(f,p),c.group.add(p)}}).update(function(f,d){var p=m_(c).data.getItemGraphicEl(d),g=h.getItemLayout(f);g.allClipped?p&&c.group.remove(p):(p?cn(p,{shape:{points:g.points}},r,f):p=new Ra({shape:{points:g.points}}),h.setItemGraphicEl(f,p),c.group.add(p))}).remove(function(f){var d=m_(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")),Ei(f,ri(p),{labelFetcher:r,labelDataIndex:d,defaultText:h.getName(d)||"",inheritColor:Ke(g.fill)?yx(g.fill,1):"#000"}),Ci(f,p),lr(f,null,null,p.get(["emphasis","disabled"])),St(f).dataModel=r}),m_(c).data=h,c.group.silent=r.get("silent")||t.get("silent")},e.type="markArea",e}(_R);function F_e(n,e,t){var r,i,a=["x0","y0","x1","y1"];if(n){var s=Ne(n&&n.dimensions,function(u){var c=e.getData(),h=c.getDimensionInfo(c.mapDimension(u))||{};return Pe(Pe({},h),{name:u,ordinalMeta:null})});i=Ne(a,function(u,c){return{name:u,type:s[c%2].type}}),r=new ia(i,t)}else i=[{name:"value",type:"float"}],r=new ia(i,t);var o=Ne(t.get("data"),Rt(N_e,e,n,t));n&&(o=_n(o,Rt(k_e,n)));var l=n?function(u,c,h,f){var d=u.coord[Math.floor(f/2)][f%2];return Ju(d,i[f])}:function(u,c,h,f){return Ju(u.value,i[f])};return r.initData(o,null,l),r.hasItemOption=!0,r}const B_e=O_e;function G_e(n){n.registerComponentModel(I_e),n.registerComponentView(B_e),n.registerPreprocessor(function(e){mR(e.series,"markArea")&&(e.markArea=e.markArea||{})})}var z_e=function(n,e){if(e==="all")return{type:"all",title:n.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:n.getLocaleModel().get(["legend","selector","inverse"])}},U_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(t,r){n.prototype.mergeOption.call(this,t,r),this._updateSelector(t)},e.prototype._updateSelector=function(t){var r=t.selector,i=this.ecModel;r===!0&&(r=t.selector=["all","inverse"]),Ie(r)&&z(r,function(a,s){Ke(a)&&(a={type:a}),r[s]=It(a,z_e(i,a.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&this.get("selectedMode")==="single"){for(var r=!1,i=0;i<t.length;i++){var a=t[i].get("name");if(this.isSelected(a)){this.select(a),r=!0;break}}!r&&this.select(t[0].get("name"))}},e.prototype._updateData=function(t){var r=[],i=[];t.eachRawSeries(function(l){var u=l.name;i.push(u);var c;if(l.legendVisualProvider){var h=l.legendVisualProvider,f=h.getAllNames();t.isSeriesFiltered(l)||(i=i.concat(f)),f.length?r=r.concat(f):c=!0}else c=!0;c&&TP(l)&&r.push(l.name)}),this._availableNames=i;var a=this.get("data")||r,s=st(),o=Ne(a,function(l){return(Ke(l)||un(l))&&(l={name:l}),s.get(l.name)?null:(s.set(l.name,!0),new Wn(l,this,this.ecModel))},this);this._data=_n(o,function(l){return!!l})},e.prototype.getData=function(){return this._data},e.prototype.select=function(t){var r=this.option.selected,i=this.get("selectedMode");if(i==="single"){var a=this._data;z(a,function(s){r[s.get("name")]=!1})}r[t]=!0},e.prototype.unSelect=function(t){this.get("selectedMode")!=="single"&&(this.option.selected[t]=!1)},e.prototype.toggleSelected=function(t){var r=this.option.selected;r.hasOwnProperty(t)||(r[t]=!0),this[r[t]?"unSelect":"select"](t)},e.prototype.allSelect=function(){var t=this._data,r=this.option.selected;z(t,function(i){r[i.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var t=this._data,r=this.option.selected;z(t,function(i){var a=i.get("name",!0);r.hasOwnProperty(a)||(r[a]=!0),r[a]=!r[a]})},e.prototype.isSelected=function(t){var r=this.option.selected;return!(r.hasOwnProperty(t)&&!r[t])&&Ft(this._availableNames,t)>=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}(sn);const JC=U_e;var Jf=Rt,eE=z,y_=bt,V_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!1,t}return e.prototype.init=function(){this.group.add(this._contentGroup=new y_),this.group.add(this._selectorGroup=new y_),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,r,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!t.get("show",!0)){var s=t.get("align"),o=t.get("orient");(!s||s==="auto")&&(s=t.get("left")==="right"&&o==="vertical"?"right":"left");var l=t.get("selector",!0),u=t.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=o==="horizontal"?"end":"start"),this.renderInner(s,t,r,i,l,o,u);var c=t.getBoxLayoutParams(),h={width:i.getWidth(),height:i.getHeight()},f=t.get("padding"),d=Kr(c,h,f),p=this.layoutInner(t,s,d,a,l,u),g=Kr(dt({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=s$(p,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,r,i,a,s,o,l){var u=this.getContentGroup(),c=st(),h=r.get("selectedMode"),f=[];i.eachRawSeries(function(d){!d.get("legendHoverLink")&&f.push(d.id)}),eE(r.getData(),function(d,p){var g=d.get("name");if(!this.newlineDisabled&&(g===""||g===`
`)){var v=new y_;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"),b=y.getVisual("style"),S=this._createItem(m,g,p,d,r,t,_,b,x,h,a);S.on("click",Jf(QO,g,null,a,f)).on("mouseover",Jf(tE,m.name,null,a,f)).on("mouseout",Jf(nE,m.name,null,a,f)),i.ssr&&S.eachChild(function(w){var T=St(w);T.seriesIndex=m.seriesIndex,T.dataIndex=p,T.ssrType="legend"}),c.set(g,!0)}else i.eachRawSeries(function(w){if(!c.get(g)&&w.legendVisualProvider){var T=w.legendVisualProvider;if(!T.containName(g))return;var C=T.indexOfName(g),A=T.getItemVisual(C,"style"),M=T.getItemVisual(C,"legendIcon"),P=Qa(A.fill);P&&P[3]===0&&(P[3]=.2,A=Pe(Pe({},A),{fill:Il(P,"rgba")}));var D=this._createItem(w,g,p,d,r,t,{},A,M,h,a);D.on("click",Jf(QO,null,g,a,f)).on("mouseover",Jf(tE,null,g,a,f)).on("mouseout",Jf(nE,null,g,a,f)),i.ssr&&D.eachChild(function(L){var R=St(L);R.seriesIndex=w.seriesIndex,R.dataIndex=p,R.ssrType="legend"}),c.set(g,!0)}},this)},this),s&&this._createSelector(s,r,a,o,l)},e.prototype._createSelector=function(t,r,i,a,s){var o=this.getSelectorGroup();eE(t,function(u){var c=u.type,h=new ln({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:r.id})}});o.add(h);var f=r.getModel("selectorLabel"),d=r.getModel(["emphasis","selectorLabel"]);Ei(h,{normal:f,emphasis:d},{defaultText:u.title}),jh(h)})},e.prototype._createItem=function(t,r,i,a,s,o,l,u,c,h,f){var d=t.visualDrawType,p=s.get("itemWidth"),g=s.get("itemHeight"),v=s.isSelected(r),m=a.get("symbolRotate"),y=a.get("symbolKeepAspect"),_=a.get("icon");c=_||c||"roundRect";var x=H_e(c,a,l,u,d,v,f),b=new y_,S=a.getModel("textStyle");if(ct(t.getLegendIcon)&&(!_||_==="inherit"))b.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;b.add(W_e({itemWidth:p,itemHeight:g,icon:c,iconRotate:w,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}))}var T=o==="left"?p+5:-5,C=o,A=s.get("formatter"),M=r;Ke(A)&&A?M=A.replace("{name}",r!=null?r:""):ct(A)&&(M=A(r));var P=v?S.getTextColor():a.get("inactiveColor");b.add(new ln({style:Hn(S,{text:M,x:T,y:g/2,fill:P,align:C,verticalAlign:"middle"},{inheritColor:P})}));var D=new nn({shape:b.getBoundingRect(),style:{fill:"transparent"}}),L=a.getModel("tooltip");return L.get("show")&&wf({el:D,componentModel:s,itemName:r,itemTooltipOption:L.option}),b.add(D),b.eachChild(function(R){R.silent=!0}),D.silent=!h,this.getContentGroup().add(b),jh(b),b.__legendDataIndex=i,b},e.prototype.layoutInner=function(t,r,i,a,s,o){var l=this.getContentGroup(),u=this.getSelectorGroup();Xh(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(),s){Xh("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";o==="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}(fr);function H_e(n,e,t,r,i,a,s){function o(v,m){v.lineWidth==="auto"&&(v.lineWidth=m.lineWidth>0?2:0),eE(v,function(y,_){v[_]==="inherit"&&(v[_]=m[_])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),c=n.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?r.decal:wp(h,s),u.fill==="inherit"&&(u.fill=r[i]),u.stroke==="inherit"&&(u.stroke=r[c]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?r:t).opacity),o(u,r);var f=e.getModel("lineStyle"),d=f.getLineStyle();if(o(d,t),u.fill==="auto"&&(u.fill=r.fill),u.stroke==="auto"&&(u.stroke=r.fill),d.stroke==="auto"&&(d.stroke=r.fill),!a){var p=e.get("inactiveBorderWidth"),g=u[c];u.lineWidth=p==="auto"?r.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 W_e(n){var e=n.icon||"roundRect",t=Br(e,0,0,n.itemWidth,n.itemHeight,n.itemStyle.fill,n.symbolKeepAspect);return t.setStyle(n.itemStyle),t.rotation=(n.iconRotate||0)*Math.PI/180,t.setOrigin([n.itemWidth/2,n.itemHeight/2]),e.indexOf("empty")>-1&&(t.style.stroke=t.style.fill,t.style.fill="#fff",t.style.lineWidth=2),t}function QO(n,e,t,r){nE(n,e,t,r),t.dispatchAction({type:"legendToggleSelect",name:n!=null?n:e}),tE(n,e,t,r)}function _$(n){for(var e=n.getZr().storage.getDisplayList(),t,r=0,i=e.length;r<i&&!(t=e[r].states.emphasis);)r++;return t&&t.hoverLayer}function tE(n,e,t,r){_$(t)||t.dispatchAction({type:"highlight",seriesName:n,name:e,excludeSeriesId:r})}function nE(n,e,t,r){_$(t)||t.dispatchAction({type:"downplay",seriesName:n,name:e,excludeSeriesId:r})}const x$=V_e;function $_e(n){var e=n.findComponents({mainType:"legend"});e&&e.length&&n.filterSeries(function(t){for(var r=0;r<e.length;r++)if(!e[r].isSelected(t.name))return!1;return!0})}function lg(n,e,t){var r=n==="allSelect"||n==="inverseSelect",i={},a=[];t.eachComponent({mainType:"legend",query:e},function(o){r?o[n]():o[n](e.name),JO(o,i),a.push(o.componentIndex)});var s={};return t.eachComponent("legend",function(o){z(i,function(l,u){o[l?"select":"unSelect"](u)}),JO(o,s)}),r?{selected:s,legendIndex:a}:{name:e.name,selected:s}}function JO(n,e){var t=e||{};return z(n.getData(),function(r){var i=r.get("name");if(!(i===`
`||i==="")){var a=n.isSelected(i);tt(t,i)?t[i]=t[i]&&a:t[i]=a}}),t}function j_e(n){n.registerAction("legendToggleSelect","legendselectchanged",Rt(lg,"toggleSelected")),n.registerAction("legendAllSelect","legendselectall",Rt(lg,"allSelect")),n.registerAction("legendInverseSelect","legendinverseselect",Rt(lg,"inverseSelect")),n.registerAction("legendSelect","legendselected",Rt(lg,"select")),n.registerAction("legendUnSelect","legendunselected",Rt(lg,"unSelect"))}function b$(n){n.registerComponentModel(JC),n.registerComponentView(x$),n.registerProcessor(n.PRIORITY.PROCESSOR.SERIES_FILTER,$_e),n.registerSubTypeDefaulter("legend",function(){return"plain"}),j_e(n)}var q_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(t,r,i){var a=Jp(t);n.prototype.init.call(this,t,r,i),eF(this,t,a)},e.prototype.mergeOption=function(t,r){n.prototype.mergeOption.call(this,t,r),eF(this,this.option,t)},e.type="legend.scroll",e.defaultOption=wc(JC.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e}(JC);function eF(n,e,t){var r=n.getOrient(),i=[1,1];i[r.index]=0,fc(e,t,{type:"box",ignoreSize:!!i})}const X_e=q_e;var tF=bt,UM=["width","height"],VM=["x","y"],Y_e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!0,t._currentIndex=0,t}return e.prototype.init=function(){n.prototype.init.call(this),this.group.add(this._containerGroup=new tF),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new tF)},e.prototype.resetInner=function(){n.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(t,r,i,a,s,o,l){var u=this;n.prototype.renderInner.call(this,t,r,i,a,s,o,l);var c=this._controllerGroup,h=r.get("pageIconSize",!0),f=Ie(h)?h:[h,h];p("pagePrev",0);var d=r.getModel("pageTextStyle");c.add(new ln({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1);function p(g,v){var m=g+"DataIndex",y=N0(r.get("pageIcons",!0)[r.getOrient().name][v],{onclick:Qe(u._pageGo,u,m,r,a)},{x:-f[0]/2,y:-f[1]/2,width:f[0],height:f[1]});y.name=g,c.add(y)}},e.prototype.layoutInner=function(t,r,i,a,s,o){var l=this.getSelectorGroup(),u=t.getOrient().index,c=UM[u],h=VM[u],f=UM[1-u],d=VM[1-u];s&&Xh("horizontal",l,t.get("selectorItemGap",!0));var p=t.get("selectorButtonGap",!0),g=l.getBoundingRect(),v=[-g.x,-g.y],m=yt(i);s&&(m[c]=i[c]-g[c]-p);var y=this._layoutContentAndController(t,a,m,u,c,f,d,h);if(s){if(o==="end")v[u]+=y[c]+p;else{var _=g[c]+p;v[u]-=_,y[h]-=_}y[c]+=g[c]+p,v[1-u]+=y[d]+y[f]/2-g[f]/2,y[f]=Math.max(y[f],g[f]),y[d]=Math.min(y[d],g[d]+v[1-u]),l.x=v[0],l.y=v[1],l.markRedraw()}return y},e.prototype._layoutContentAndController=function(t,r,i,a,s,o,l,u){var c=this.getContentGroup(),h=this._containerGroup,f=this._controllerGroup;Xh(t.get("orient"),c,t.get("itemGap"),a?i.width:null,a?null:i.height),Xh("horizontal",f,t.get("pageButtonItemGap",!0));var d=c.getBoundingRect(),p=f.getBoundingRect(),g=this._showController=d[s]>i[s],v=[-d.x,-d.y];r||(v[a]=c[u]);var m=[0,0],y=[-p.x,-p.y],_=Et(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(g){var x=t.get("pageButtonPosition",!0);x==="end"?y[a]+=i[s]-p[s]:m[a]+=p[s]+_}y[1-a]+=d[o]/2-p[o]/2,c.setPosition(v),h.setPosition(m),f.setPosition(y);var b={x:0,y:0};if(b[s]=g?i[s]:d[s],b[o]=Math.max(d[o],p[o]),b[l]=Math.min(0,p[l]+y[1-a]),h.__rectSize=i[s],g){var S={x:0,y:0};S[s]=Math.max(i[s]-p[s]-_,0),S[o]=b[o],h.setClipPath(new nn({shape:S})),h.__rectSize=S[s]}else f.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var w=this._getPageInfo(t);return w.pageIndex!=null&&cn(c,{x:w.contentPosition[0],y:w.contentPosition[1]},g?t:null),this._updatePageInfoView(t,w),b},e.prototype._pageGo=function(t,r,i){var a=this._getPageInfo(r)[t];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:r.id})},e.prototype._updatePageInfoView=function(t,r){var i=this._controllerGroup;z(["pagePrev","pageNext"],function(c){var h=c+"DataIndex",f=r[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"),s=t.get("pageFormatter"),o=r.pageIndex,l=o!=null?o+1:0,u=r.pageCount;a&&s&&a.setStyle("text",Ke(s)?s.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):s({current:l,total:u}))},e.prototype._getPageInfo=function(t){var r=t.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,s=t.getOrient().index,o=UM[s],l=VM[s],u=this._findTargetItemIndex(r),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[s]=-g.s;for(var v=u+1,m=g,y=g,_=null;v<=f;++v)_=x(c[v]),(!_&&y.e>m.s+a||_&&!b(_,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]),(!_||!b(y,_.s))&&m.i<y.i&&(y=m,p.pagePrevDataIndex==null&&(p.pagePrevDataIndex=m.i),++p.pageCount,++p.pageIndex),m=_;return p;function x(S){if(S){var w=S.getBoundingRect(),T=w[l]+S[l];return{s:T,e:T+w[o],i:S.__legendDataIndex}}}function b(S,w){return S.e>=w&&S.s<=w+a}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var r,i=this.getContentGroup(),a;return i.eachChild(function(s,o){var l=s.__legendDataIndex;a==null&&l!=null&&(a=o),l===t&&(r=o)}),r!=null?r:a},e.type="legend.scroll",e}(x$);const K_e=Y_e;function Z_e(n){n.registerAction("legendScroll","legendscroll",function(e,t){var r=e.scrollDataIndex;r!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(i){i.setScrollDataIndex(r)})})}function Q_e(n){Vt(b$),n.registerComponentModel(X_e),n.registerComponentView(K_e),Z_e(n)}function J_e(n){Vt(b$),Vt(Q_e)}var e1e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.inside",e.defaultOption=wc(a0.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(a0);const t1e=e1e;var xR=en();function n1e(n,e,t){xR(n).coordSysRecordMap.each(function(r){var i=r.dataZoomInfoMap.get(e.uid);i&&(i.getRange=t)})}function r1e(n,e){for(var t=xR(n).coordSysRecordMap,r=t.keys(),i=0;i<r.length;i++){var a=r[i],s=t.get(a),o=s.dataZoomInfoMap;if(o){var l=e.uid,u=o.get(l);u&&(o.removeKey(l),o.keys().length||S$(t,s))}}}function S$(n,e){if(e){n.removeKey(e.model.uid);var t=e.controller;t&&t.dispose()}}function i1e(n,e){var t={model:e,containsPoint:Rt(s1e,e),dispatchAction:Rt(a1e,n),dataZoomInfoMap:null,controller:null},r=t.controller=new $0(n.getZr());return z(["pan","zoom","scrollMove"],function(i){r.on(i,function(a){var s=[];t.dataZoomInfoMap.each(function(o){if(a.isAvailableBehavior(o.model.option)){var l=(o.getRange||{})[i],u=l&&l(o.dzReferCoordSysInfo,t.model.mainType,t.controller,a);!o.model.get("disabled",!0)&&u&&s.push({dataZoomId:o.model.id,start:u[0],end:u[1]})}}),s.length&&t.dispatchAction(s)})}),t}function a1e(n,e){n.isDisposed()||n.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function s1e(n,e,t,r){return n.coordinateSystem.containPoint([t,r])}function o1e(n){var e,t="type_",r={type_true:2,type_move:1,type_false:0,type_undefined:-1},i=!0;return n.each(function(a){var s=a.model,o=s.get("disabled",!0)?!1:s.get("zoomLock",!0)?"move":!0;r[t+o]>r[t+e]&&(e=o),i=i&&s.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}function l1e(n){n.registerProcessor(n.PRIORITY.PROCESSOR.FILTER,function(e,t){var r=xR(t),i=r.coordSysRecordMap||(r.coordSysRecordMap=st());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var s=r$(a);z(s.infoList,function(o){var l=o.model.uid,u=i.get(l)||i.set(l,i1e(t,o.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=st());c.set(a.uid,{dzReferCoordSysInfo:o,model:a,getRange:null})})}),i.each(function(a){var s=a.controller,o,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(o=l.get(u))}if(!o){S$(i,a);return}var c=o1e(l);s.enable(c.controlType,c.opt),s.setPointerChecker(a.containsPoint),rv(a,"dispatchAction",o.model.get("throttle",!0),"fixRate")})})}var u1e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return e.prototype.render=function(t,r,i){if(n.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),n1e(i,t,{pan:Qe(HM.pan,this),zoom:Qe(HM.zoom,this),scrollMove:Qe(HM.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),n.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){r1e(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(hR),HM={zoom:function(n,e,t,r){var i=this.range,a=i.slice(),s=n.axisModels[0];if(s){var o=WM[e](null,[r.originX,r.originY],s,t,n),l=(o.signal>0?o.pixelStart+o.pixelLength-o.pixel:o.pixel-o.pixelStart)/o.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/r.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Lf(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:nF(function(n,e,t,r,i,a){var s=WM[r]([a.oldX,a.oldY],[a.newX,a.newY],e,i,t);return s.signal*(n[1]-n[0])*s.pixel/s.pixelLength}),scrollMove:nF(function(n,e,t,r,i,a){var s=WM[r]([0,0],[a.scrollDelta,a.scrollDelta],e,i,t);return s.signal*(n[1]-n[0])*a.scrollDelta})};function nF(n){return function(e,t,r,i){var a=this.range,s=a.slice(),o=e.axisModels[0];if(o){var l=n(s,o,e,t,r,i);if(Lf(l,s,[0,100],"all"),this.range=s,a[0]!==s[0]||a[1]!==s[1])return s}}}var WM={grid:function(n,e,t,r,i){var a=t.axis,s={},o=i.model.coordinateSystem.getRect();return n=n||[0,0],a.dim==="x"?(s.pixel=e[0]-n[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-n[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s},polar:function(n,e,t,r,i){var a=t.axis,s={},o=i.model.coordinateSystem,l=o.getRadiusAxis().getExtent(),u=o.getAngleAxis().getExtent();return n=n?o.pointToCoord(n):[0,0],e=o.pointToCoord(e),t.mainType==="radiusAxis"?(s.pixel=e[0]-n[0],s.pixelLength=l[1]-l[0],s.pixelStart=l[0],s.signal=a.inverse?1:-1):(s.pixel=e[1]-n[1],s.pixelLength=u[1]-u[0],s.pixelStart=u[0],s.signal=a.inverse?-1:1),s},singleAxis:function(n,e,t,r,i){var a=t.axis,s=i.model.coordinateSystem.getRect(),o={};return n=n||[0,0],a.orient==="horizontal"?(o.pixel=e[0]-n[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-n[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o}};const c1e=u1e;function w$(n){fR(n),n.registerComponentModel(t1e),n.registerComponentView(c1e),l1e(n)}var h1e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=wc(a0.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}(a0);const f1e=h1e;var ug=nn,rF=7,d1e=1,$M=30,p1e=7,cg="horizontal",iF="vertical",v1e=5,g1e=["line","bar","candlestick","scatter"],m1e={easing:"cubicOut",duration:100,delay:0},y1e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._displayables={},t}return e.prototype.init=function(t,r){this.api=r,this._onBrush=Qe(this._onBrush,this),this._onBrushEnd=Qe(this._onBrushEnd,this)},e.prototype.render=function(t,r,i,a){if(n.prototype.render.apply(this,arguments),rv(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(),n.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){qm(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 r=this._displayables.sliderGroup=new bt;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(r),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,r=this.api,i=t.get("brushSelect"),a=i?p1e:0,s=this._findCoordRect(),o={width:r.getWidth(),height:r.getHeight()},l=this._orient===cg?{right:o.width-s.x-s.width,top:o.height-$M-rF-a,width:s.width,height:$M}:{right:rF,top:s.y,width:$M,height:s.height},u=Jp(t.option);z(["right","top","width","height"],function(h){u[h]==="ph"&&(u[h]=l[h])});var c=Kr(u,o);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===iF&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,r=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),s=a&&a.get("inverse"),o=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(i===cg&&!s?{scaleY:l?1:-1,scaleX:1}:i===cg&&s?{scaleY:l?1:-1,scaleX:-1}:i===iF&&!s?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=t.getBoundingRect([o]);t.x=r.x-u.x,t.y=r.y-u.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,r=this._size,i=this._displayables.sliderGroup,a=t.get("brushSelect");i.add(new ug({silent:!0,shape:{x:0,y:0,width:r[0],height:r[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var s=new ug({shape:{x:0,y:0,width:r[0],height:r[1]},style:{fill:"transparent"},z2:0,onclick:Qe(this._onClickPanel,this)}),o=this.api.getZr();a?(s.on("mousedown",this._onBrushStart,this),s.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),i.add(s)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!t)return;var r=this._size,i=this._shadowSize||[],a=t.series,s=a.getRawData(),o=a.getShadowDim&&a.getShadowDim(),l=o&&s.getDimensionInfo(o)?a.getShadowDim():t.otherDim;if(l==null)return;var u=this._shadowPolygonPts,c=this._shadowPolylinePts;if(s!==this._shadowData||l!==this._shadowDim||r[0]!==i[0]||r[1]!==i[1]){var h=s.getDataExtent(l),f=(h[1]-h[0])*.3;h=[h[0]-f,h[1]+f];var d=[0,r[1]],p=[0,r[0]],g=[[r[0],0],[0,0]],v=[],m=p[1]/(s.count()-1),y=0,_=Math.round(s.count()/r[0]),x;s.each([l],function(C,A){if(_>0&&A%_){y+=m;return}var M=C==null||isNaN(C)||C==="",P=M?0:Sn(C,h,d,!0);M&&!x&&A?(g.push([g[g.length-1][0],0]),v.push([v[v.length-1][0],0])):!M&&x&&(g.push([y,0]),v.push([y,0])),g.push([y,P]),v.push([y,P]),y+=m,x=M}),u=this._shadowPolygonPts=g,c=this._shadowPolylinePts=v}this._shadowData=s,this._shadowDim=l,this._shadowSize=[r[0],r[1]];var b=this.dataZoomModel;function S(C){var A=b.getModel(C?"selectedDataBackground":"dataBackground"),M=new bt,P=new Ra({shape:{points:u},segmentIgnoreThreshold:1,style:A.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),D=new Na({shape:{points:c},segmentIgnoreThreshold:1,style:A.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return M.add(P),M.add(D),M}for(var w=0;w<3;w++){var T=S(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,r=t.get("showDataShadow");if(r!==!1){var i,a=this.ecModel;return t.eachTargetAxis(function(s,o){var l=t.getAxisProxy(s,o).getTargetSeriesModels();z(l,function(u){if(!i&&!(r!==!0&&Ft(g1e,u.get("type"))<0)){var c=a.getComponent(Wu(s),o).axis,h=_1e(s),f,d=u.coordinateSystem;h!=null&&d.getOtherAxis&&(f=d.getOtherAxis(c).inverse),h=u.getData().mapDimension(h),i={thisAxis:c,series:u,thisDim:s,otherDim:h,otherAxisInverse:f}}},this)},this),i}},e.prototype._renderHandle=function(){var t=this.group,r=this._displayables,i=r.handles=[null,null],a=r.handleLabels=[null,null],s=this._displayables.sliderGroup,o=this._size,l=this.dataZoomModel,u=this.api,c=l.get("borderRadius")||0,h=l.get("brushSelect"),f=r.filler=new ug({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});s.add(f),s.add(new ug({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:c},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:d1e,fill:"rgba(0,0,0,0)"}})),z([0,1],function(_){var x=l.get("handleIcon");!Nx[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var b=Br(x,-1,0,2,2,null,!0);b.attr({cursor:aF(this._orient),draggable:!0,drift:Qe(this._onDragMove,this,_),ondragend:Qe(this._onDragEnd,this),onmouseover:Qe(this._showDataInfo,this,!0),onmouseout:Qe(this._showDataInfo,this,!1),z2:5});var S=b.getBoundingRect(),w=l.get("handleSize");this._handleHeight=Xe(w,this._size[1]),this._handleWidth=S.width/S.height*this._handleHeight,b.setStyle(l.getModel("handleStyle").getItemStyle()),b.style.strokeNoScale=!0,b.rectHover=!0,b.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),jh(b);var T=l.get("handleColor");T!=null&&(b.style.fill=T),s.add(i[_]=b);var C=l.getModel("textStyle"),A=l.get("handleLabel")||{},M=A.show||!1;t.add(a[_]=new ln({silent:!0,invisible:!M,style:Hn(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=Xe(l.get("moveHandleSize"),o[1]),g=r.moveHandle=new nn({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:p}}),v=p*.8,m=r.moveHandleIcon=Br(l.get("moveHandleIcon"),-v/2,-v/2,v,v,"#fff",!0);m.silent=!0,m.y=o[1]+p/2-.5,g.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var y=Math.min(o[1]/2,Math.max(p,10));d=r.moveZone=new nn({invisible:!0,shape:{y:o[1]-y,height:p+y}}),d.on("mouseover",function(){u.enterEmphasis(g)}).on("mouseout",function(){u.leaveEmphasis(g)}),s.add(g),s.add(m),s.add(d)}d.attr({draggable:!0,cursor:aF(this._orient),drift:Qe(this._onDragMove,this,"all"),ondragstart:Qe(this._showDataInfo,this,!0),ondragend:Qe(this._onDragEnd,this),onmouseover:Qe(this._showDataInfo,this,!0),onmouseout:Qe(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),r=this._getViewExtent();this._handleEnds=[Sn(t[0],[0,100],r,!0),Sn(t[1],[0,100],r,!0)]},e.prototype._updateInterval=function(t,r){var i=this.dataZoomModel,a=this._handleEnds,s=this._getViewExtent(),o=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Lf(r,a,s,i.get("zoomLock")?"all":t,o.minSpan!=null?Sn(o.minSpan,l,s,!0):null,o.maxSpan!=null?Sn(o.maxSpan,l,s,!0):null);var u=this._range,c=this._range=Rs([Sn(a[0],s,l,!0),Sn(a[1],s,l,!0)]);return!u||u[0]!==c[0]||u[1]!==c[1]},e.prototype._updateView=function(t){var r=this._displayables,i=this._handleEnds,a=Rs(i.slice()),s=this._size;z([0,1],function(d){var p=r.handles[d],g=this._handleHeight;p.attr({scaleX:g/2,scaleY:g/2,x:i[d]+(d?-1:1),y:s[1]/2-g/2})},this),r.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:s[1]});var o={x:a[0],width:a[1]-a[0]};r.moveHandle&&(r.moveHandle.setShape(o),r.moveZone.setShape(o),r.moveZone.getBoundingRect(),r.moveHandleIcon&&r.moveHandleIcon.attr("x",o.x+o.width/2));for(var l=r.dataShadowSegs,u=[0,a[0],a[1],s[0]],c=0;c<l.length;c++){var h=l[c],f=h.getClipPath();f||(f=new nn,h.setClipPath(f)),f.setShape({x:u[c],y:0,width:u[c+1]-u[c],height:s[1]})}this._updateDataInfo(t)},e.prototype._updateDataInfo=function(t){var r=this.dataZoomModel,i=this._displayables,a=i.handleLabels,s=this._orient,o=["",""];if(r.get("showDetail")){var l=r.findRepresentativeAxisProxy();if(l){var u=l.getAxisModel().axis,c=this._range,h=t?l.calculateDataWindow({start:c[0],end:c[1]}).valueWindow:l.getDataValueWindow();o=[this._formatLabel(h[0],u),this._formatLabel(h[1],u)]}}var f=Rs(this._handleEnds.slice());d.call(this,0),d.call(this,1);function d(p){var g=qh(i.handles[p].parent,this.group),v=sS(p===0?"right":"left",g),m=this._handleWidth/2+v1e,y=so([f[p]+(p===0?-m:m),this._size[1]/2],g);a[p].setStyle({x:y[0],y:y[1],verticalAlign:s===cg?"middle":v,align:s===cg?v:"center",text:o[p]})}},e.prototype._formatLabel=function(t,r){var i=this.dataZoomModel,a=i.get("labelFormatter"),s=i.get("labelPrecision");(s==null||s==="auto")&&(s=r.getPixelPrecision());var o=t==null||isNaN(t)?"":r.type==="category"||r.type==="time"?r.scale.getLabel({value:Math.round(t)}):t.toFixed(Math.min(s,20));return ct(a)?a(t,o):Ke(a)?a.replace("{value}",o):o},e.prototype._showDataInfo=function(t){var r=this.dataZoomModel.get("handleLabel")||{},i=r.show||!1,a=this.dataZoomModel.getModel(["emphasis","handleLabel"]),s=a.get("show")||!1,o=t||this._dragging?s:i,l=this._displayables,u=l.handleLabels;u[0].attr("invisible",!o),u[1].attr("invisible",!o),l.moveHandle&&this.api[o?"enterEmphasis":"leaveEmphasis"](l.moveHandle,1)},e.prototype._onDragMove=function(t,r,i,a){this._dragging=!0,Bl(a.event);var s=this._displayables.sliderGroup.getLocalTransform(),o=so([r,i],s,!0),l=this._updateInterval(t,o[0]),u=this.dataZoomModel.get("realtime");this._updateView(!u),l&&u&&this._dispatchZoomAction(!0)},e.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1);var t=this.dataZoomModel.get("realtime");!t&&this._dispatchZoomAction(!1)},e.prototype._onClickPanel=function(t){var r=this._size,i=this._displayables.sliderGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(i[0]<0||i[0]>r[0]||i[1]<0||i[1]>r[1])){var a=this._handleEnds,s=(a[0]+a[1])/2,o=this._updateInterval("all",i[0]-s);this._updateView(),o&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var r=t.offsetX,i=t.offsetY;this._brushStart=new Nt(r,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var r=this._displayables.brushRect;if(this._brushing=!1,!!r){r.attr("ignore",!0);var i=r.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var s=this._getViewExtent(),o=[0,100];this._range=Rs([Sn(i.x,s,o,!0),Sn(i.x+i.width,s,o,!0)]),this._handleEnds=[i.x,i.x+i.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(Bl(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,r){var i=this._displayables,a=this.dataZoomModel,s=i.brushRect;s||(s=i.brushRect=new ug({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(s)),s.attr("ignore",!1);var o=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(t,r),c=l.transformCoordToLocal(o.x,o.y),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),s.setShape({x:c[0],y:0,width:u[0]-c[0],height:h[1]})},e.prototype._dispatchZoomAction=function(t){var r=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?m1e:null,start:r[0],end:r[1]})},e.prototype._findCoordRect=function(){var t,r=r$(this.dataZoomModel).infoList;if(!t&&r.length){var i=r[0].model.coordinateSystem;t=i.getRect&&i.getRect()}if(!t){var a=this.api.getWidth(),s=this.api.getHeight();t={x:a*.2,y:s*.2,width:a*.6,height:s*.6}}return t},e.type="dataZoom.slider",e}(hR);function _1e(n){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[n]}function aF(n){return n==="vertical"?"ns-resize":"ew-resize"}const x1e=y1e;function A$(n){n.registerComponentModel(f1e),n.registerComponentView(x1e),fR(n)}function b1e(n){Vt(w$),Vt(A$)}var S1e={get:function(n,e,t){var r=yt((w1e[n]||{})[e]);return t&&Ie(r)?r[r.length-1]:r}},w1e={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 M$=S1e;var sF=Ti.mapVisual,A1e=Ti.eachVisual,M1e=Ie,oF=z,T1e=Rs,C1e=Sn,E1e=function(n){ve(e,n);function e(){var t=n!==null&&n.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,r,i){this.mergeDefaultAndTheme(t,i)},e.prototype.optionUpdated=function(t,r){var i=this.option;!r&&d$(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var r=this.stateList;t=Qe(t,this),this.controllerVisuals=KC(this.option.controller,r,t),this.targetVisuals=KC(this.option.target,r,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,r=[];return t==null||t==="all"?this.ecModel.eachSeries(function(i,a){r.push(a)}):r=Cn(t),r},e.prototype.eachTargetSeries=function(t,r){z(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&t.call(r,a)},this)},e.prototype.isTargetSeries=function(t){var r=!1;return this.eachTargetSeries(function(i){i===t&&(r=!0)}),r},e.prototype.formatValueText=function(t,r,i){var a=this.option,s=a.precision,o=this.dataBound,l=a.formatter,u;i=i||["<",">"],Ie(t)&&(t=t.slice(),u=!0);var c=r?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(ct(l))return u?l(t[0],t[1]):l(t);if(u)return t[0]===o[0]?i[0]+" "+c[1]:t[1]===o[1]?i[1]+" "+c[0]:c[0]+" - "+c[1];return c;function h(f){return f===o[0]?"min":f===o[1]?"max":(+f).toFixed(Math.min(s,20))}},e.prototype.resetExtent=function(){var t=this.option,r=T1e([t.min,t.max]);this._dataExtent=r},e.prototype.getDataDimensionIndex=function(t){var r=this.option.dimension;if(r!=null)return t.getDimensionIndex(r);for(var i=t.dimensions,a=i.length-1;a>=0;a--){var s=i[a],o=t.getDimensionInfo(s);if(!o.isCalculationCoord)return o.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,r=this.option,i={inRange:r.inRange,outOfRange:r.outOfRange},a=r.target||(r.target={}),s=r.controller||(r.controller={});It(a,i),It(s,i);var o=this.isCategory();l.call(this,a),l.call(this,s),u.call(this,a,"inRange","outOfRange"),c.call(this,s);function l(h){M1e(r.color)&&!h.inRange&&(h.inRange={color:r.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]={},oF(p,function(v,m){if(Ti.isValidType(m)){var y=M$.get(m,"inactive",o);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";oF(this.stateList,function(m){var y=this.itemSize,_=h[m];_||(_=h[m]={color:o?p:[p]}),_.symbol==null&&(_.symbol=f&&yt(f)||(o?v:[v])),_.symbolSize==null&&(_.symbolSize=d&&yt(d)||(o?y[0]:[y[0],y[0]])),_.symbol=sF(_.symbol,function(S){return S==="none"?v:S});var x=_.symbolSize;if(x!=null){var b=-1/0;A1e(x,function(S){S>b&&(b=S)}),_.symbolSize=sF(x,function(S){return C1e(S,[0,b],[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}(sn);const ab=E1e;var lF=[20,140],P1e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(t,r){n.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){n.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=lF[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=lF[1])},e.prototype._resetRange=function(){var t=this.getExtent(),r=this.option.range;!r||r.auto?(t.auto=1,this.option.range=t):Ie(r)&&(r[0]>r[1]&&r.reverse(),r[0]=Math.max(r[0],t[0]),r[1]=Math.min(r[1],t[1]))},e.prototype.completeVisualOption=function(){n.prototype.completeVisualOption.apply(this,arguments),z(this.stateList,function(t){var r=this.option.controller[t].symbolSize;r&&r[0]!==r[1]&&(r[0]=r[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),r=Rs((this.get("range")||[]).slice());return r[0]>t[1]&&(r[0]=t[1]),r[1]>t[1]&&(r[1]=t[1]),r[0]<t[0]&&(r[0]=t[0]),r[1]<t[0]&&(r[1]=t[0]),r},e.prototype.getValueState=function(t){var r=this.option.range,i=this.getExtent();return(r[0]<=i[0]||r[0]<=t)&&(r[1]>=i[1]||t<=r[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var r=[];return this.eachTargetSeries(function(i){var a=[],s=i.getData();s.each(this.getDataDimensionIndex(s),function(o,l){t[0]<=o&&o<=t[1]&&a.push(l)},this),r.push({seriesId:i.id,dataIndex:a})},this),r},e.prototype.getVisualMeta=function(t){var r=uF(this,"outOfRange",this.getExtent()),i=uF(this,"inRange",this.option.range.slice()),a=[];function s(d,p){a.push({value:d,color:t(d,p)})}for(var o=0,l=0,u=i.length,c=r.length;l<c&&(!i.length||r[l]<=i[0]);l++)r[l]<i[o]&&s(r[l],"outOfRange");for(var h=1;o<u;o++,h=0)h&&a.length&&s(i[o],"outOfRange"),s(i[o],"inRange");for(var h=1;l<c;l++)(!i.length||i[i.length-1]<r[l])&&(h&&(a.length&&s(a[a.length-1].value,"outOfRange"),h=0),s(r[l],"outOfRange"));var f=a.length;return{stops:a,outerColors:[f?a[0].color:"transparent",f?a[f-1].color:"transparent"]}},e.type="visualMap.continuous",e.defaultOption=wc(ab.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),e}(ab);function uF(n,e,t){if(t[0]===t[1])return t.slice();for(var r=200,i=(t[1]-t[0])/r,a=t[0],s=[],o=0;o<=r&&a<t[1];o++)s.push(a),a+=i;return s.push(t[1]),s}const L1e=P1e;var R1e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.autoPositionValues={left:1,right:1,top:1,bottom:1},t}return e.prototype.init=function(t,r){this.ecModel=t,this.api=r},e.prototype.render=function(t,r,i,a){if(this.visualMapModel=t,t.get("show")===!1){this.group.removeAll();return}this.doRender(t,r,i,a)},e.prototype.renderBackground=function(t){var r=this.visualMapModel,i=Qp(r.get("padding")||0),a=t.getBoundingRect();t.add(new nn({z2:-1,silent:!0,shape:{x:a.x-i[3],y:a.y-i[0],width:a.width+i[3]+i[1],height:a.height+i[0]+i[2]},style:{fill:r.get("backgroundColor"),stroke:r.get("borderColor"),lineWidth:r.get("borderWidth")}}))},e.prototype.getControllerVisual=function(t,r,i){i=i||{};var a=i.forceState,s=this.visualMapModel,o={};if(r==="color"){var l=s.get("contentColor");o.color=l}function u(d){return o[d]}function c(d,p){o[d]=p}var h=s.controllerVisuals[a||s.getValueState(t)],f=Ti.prepareVisualTypes(h);return z(f,function(d){var p=h[d];i.convertOpacityToAlpha&&d==="opacity"&&(d="colorAlpha",p=h.__alphaForOpacity),Ti.dependsOn(d,r)&&p&&p.applyVisual(t,u,c)}),o[r]},e.prototype.positionGroup=function(t){var r=this.visualMapModel,i=this.api;dS(t,r.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()})},e.prototype.doRender=function(t,r,i,a){},e.type="visualMap",e}(fr);const T$=R1e;var cF=[["left","right","width"],["top","bottom","height"]];function C$(n,e,t){var r=n.option,i=r.align;if(i!=null&&i!=="auto")return i;for(var a={width:e.getWidth(),height:e.getHeight()},s=r.orient==="horizontal"?1:0,o=cF[s],l=[0,null,10],u={},c=0;c<3;c++)u[cF[1-s][c]]=l[c],u[o[c]]=c===2?t[0]:r[o[c]];var h=[["x","width",3],["y","height",0]][s],f=Kr(u,a,r.padding);return o[(f.margin[h[2]]||0)+f[h[0]]+f[h[1]]*.5<a[h[1]]*.5?0:1]}function j1(n,e){return z(n||[],function(t){t.dataIndex!=null&&(t.dataIndexInside=t.dataIndex,t.dataIndex=null),t.highlightKey="visualMap"+(e?e.componentIndex:"")}),n}var To=Sn,D1e=z,hF=Math.min,jM=Math.max,I1e=12,N1e=6,k1e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._shapes={},t._dataInterval=[],t._handleEnds=[],t._hoverLinkDataIndices=[],t}return e.prototype.init=function(t,r){n.prototype.init.call(this,t,r),this._hoverLinkFromSeriesMouseOver=Qe(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=Qe(this._hideIndicator,this)},e.prototype.doRender=function(t,r,i,a){(!a||a.type!=="selectDataRange"||a.from!==this.uid)&&this._buildView()},e.prototype._buildView=function(){this.group.removeAll();var t=this.visualMapModel,r=this.group;this._orient=t.get("orient"),this._useHandle=t.get("calculable"),this._resetInterval(),this._renderBar(r);var i=t.get("text");this._renderEndsText(r,i,0),this._renderEndsText(r,i,1),this._updateView(!0),this.renderBackground(r),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(r)},e.prototype._renderEndsText=function(t,r,i){if(r){var a=r[1-i];a=a!=null?a+"":"";var s=this.visualMapModel,o=s.get("textGap"),l=s.itemSize,u=this._shapes.mainGroup,c=this._applyTransform([l[0]/2,i===0?-o:l[1]+o],u),h=this._applyTransform(i===0?"bottom":"top",u),f=this._orient,d=this.visualMapModel.textStyleModel;this.group.add(new ln({style:Hn(d,{x:c[0],y:c[1],verticalAlign:f==="horizontal"?"middle":h,align:f==="horizontal"?h:"center",text:a})}))}},e.prototype._renderBar=function(t){var r=this.visualMapModel,i=this._shapes,a=r.itemSize,s=this._orient,o=this._useHandle,l=C$(r,this.api,a),u=i.mainGroup=this._createBarGroup(l),c=new bt;u.add(c),c.add(i.outOfRange=fF()),c.add(i.inRange=fF(null,o?pF(this._orient):null,Qe(this._dragHandle,this,"all",!1),Qe(this._dragHandle,this,"all",!0))),c.setClipPath(new nn({shape:{x:0,y:0,width:a[0],height:a[1],r:3}}));var h=r.textStyleModel.getTextRect("国"),f=jM(h.width,h.height);o&&(i.handleThumbs=[],i.handleLabels=[],i.handleLabelPoints=[],this._createHandle(r,u,0,a,f,s),this._createHandle(r,u,1,a,f,s)),this._createIndicator(r,u,a,f,s),t.add(u)},e.prototype._createHandle=function(t,r,i,a,s,o){var l=Qe(this._dragHandle,this,i,!1),u=Qe(this._dragHandle,this,i,!0),c=uo(t.get("handleSize"),a[0]),h=Br(t.get("handleIcon"),-c/2,-c/2,c,c,null,!0),f=pF(this._orient);h.attr({cursor:f,draggable:!0,drift:l,ondragend:u,onmousemove:function(m){Bl(m.event)}}),h.x=a[0]/2,h.useStyle(t.getModel("handleStyle").getItemStyle()),h.setStyle({strokeNoScale:!0,strokeFirst:!0}),h.style.lineWidth*=2,h.ensureState("emphasis").style=t.getModel(["emphasis","handleStyle"]).getItemStyle(),Ph(h,!0),r.add(h);var d=this.visualMapModel.textStyleModel,p=new ln({cursor:f,draggable:!0,drift:l,onmousemove:function(m){Bl(m.event)},ondragend:u,style:Hn(d,{x:0,y:0,text:""})});p.ensureState("blur").style={opacity:.1},p.stateTransition={duration:200},this.group.add(p);var g=[c,0],v=this._shapes;v.handleThumbs[i]=h,v.handleLabelPoints[i]=g,v.handleLabels[i]=p},e.prototype._createIndicator=function(t,r,i,a,s){var o=uo(t.get("indicatorSize"),i[0]),l=Br(t.get("indicatorIcon"),-o/2,-o/2,o,o,null,!0);l.attr({cursor:"move",invisible:!0,silent:!0,x:i[0]/2});var u=t.getModel("indicatorStyle").getItemStyle();if(l instanceof Pi){var c=l.style;l.useStyle(Pe({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},u))}else l.useStyle(u);r.add(l);var h=this.visualMapModel.textStyleModel,f=new ln({silent:!0,invisible:!0,style:Hn(h,{x:0,y:0,text:""})});this.group.add(f);var d=[(s==="horizontal"?a/2:N1e)+i[0]/2,0],p=this._shapes;p.indicator=l,p.indicatorLabel=f,p.indicatorLabelPoint=d,this._firstShowIndicator=!0},e.prototype._dragHandle=function(t,r,i,a){if(this._useHandle){if(this._dragging=!r,!r){var s=this._applyTransform([i,a],this._shapes.mainGroup,!0);this._updateInterval(t,s[1]),this._hideIndicator(),this._updateView()}r===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),r?!this._hovering&&this._clearHoverLinkToSeries():dF(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[t],!1)}},e.prototype._resetInterval=function(){var t=this.visualMapModel,r=this._dataInterval=t.getSelected(),i=t.getExtent(),a=[0,t.itemSize[1]];this._handleEnds=[To(r[0],i,a,!0),To(r[1],i,a,!0)]},e.prototype._updateInterval=function(t,r){r=r||0;var i=this.visualMapModel,a=this._handleEnds,s=[0,i.itemSize[1]];Lf(r,a,s,t,0);var o=i.getExtent();this._dataInterval=[To(a[0],s,o,!0),To(a[1],s,o,!0)]},e.prototype._updateView=function(t){var r=this.visualMapModel,i=r.getExtent(),a=this._shapes,s=[0,r.itemSize[1]],o=t?s:this._handleEnds,l=this._createBarVisual(this._dataInterval,i,o,"inRange"),u=this._createBarVisual(i,i,s,"outOfRange");a.inRange.setStyle({fill:l.barColor}).setShape("points",l.barPoints),a.outOfRange.setStyle({fill:u.barColor}).setShape("points",u.barPoints),this._updateHandle(o,l)},e.prototype._createBarVisual=function(t,r,i,a){var s={forceState:a,convertOpacityToAlpha:!0},o=this._makeColorGradient(t,s),l=[this.getControllerVisual(t[0],"symbolSize",s),this.getControllerVisual(t[1],"symbolSize",s)],u=this._createBarPoints(i,l);return{barColor:new Zr(0,0,0,1,o),barPoints:u,handlesColor:[o[0].color,o[o.length-1].color]}},e.prototype._makeColorGradient=function(t,r){var i=100,a=[],s=(t[1]-t[0])/i;a.push({color:this.getControllerVisual(t[0],"color",r),offset:0});for(var o=1;o<i;o++){var l=t[0]+s*o;if(l>t[1])break;a.push({color:this.getControllerVisual(l,"color",r),offset:o/i})}return a.push({color:this.getControllerVisual(t[1],"color",r),offset:1}),a},e.prototype._createBarPoints=function(t,r){var i=this.visualMapModel.itemSize;return[[i[0]-r[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-r[1],t[1]]]},e.prototype._createBarGroup=function(t){var r=this._orient,i=this.visualMapModel.get("inverse");return new bt(r==="horizontal"&&!i?{scaleX:t==="bottom"?1:-1,rotation:Math.PI/2}:r==="horizontal"&&i?{scaleX:t==="bottom"?-1:1,rotation:-Math.PI/2}:r==="vertical"&&!i?{scaleX:t==="left"?1:-1,scaleY:-1}:{scaleX:t==="left"?1:-1})},e.prototype._updateHandle=function(t,r){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,s=i.handleThumbs,o=i.handleLabels,l=a.itemSize,u=a.getExtent(),c=this._applyTransform("left",i.mainGroup);D1e([0,1],function(h){var f=s[h];f.setStyle("fill",r.handlesColor[h]),f.y=t[h];var d=To(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=so(i.handleLabelPoints[h],qh(f,this.group));if(this._orient==="horizontal"){var v=c==="left"||c==="top"?(l[0]-p)/2:(l[0]-p)/-2;g[1]+=v}o[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,r,i,a){var s=this.visualMapModel,o=s.getExtent(),l=s.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=To(t,o,u,!0),v=l[0]-p/2,m={x:h.x,y:h.y};h.y=g,h.x=v;var y=so(c.indicatorLabelPoint,qh(h,this.group)),_=c.indicatorLabel;_.attr("invisible",!1);var x=this._applyTransform("left",c.mainGroup),b=this._orient,S=b==="horizontal";_.setStyle({text:(i||"")+s.formatValueText(r),verticalAlign:S?x:"middle",align:S?"center":x});var w={x:v,y:g,style:{fill:d}},T={style:{x:y[0],y:y[1]}};if(s.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(T,C)}else h.attr(w),_.attr(T);this._firstShowIndicator=!1;var A=this._shapes.handleLabels;if(A)for(var M=0;M<A.length;M++)this.api.enterBlur(A[M])}},e.prototype._enableHoverLinkToSeries=function(){var t=this;this._shapes.mainGroup.on("mousemove",function(r){if(t._hovering=!0,!t._dragging){var i=t.visualMapModel.itemSize,a=t._applyTransform([r.offsetX,r.offsetY],t._shapes.mainGroup,!0,!0);a[1]=hF(jM(0,a[1]),i[1]),t._doHoverLinkToSeries(a[1],0<=a[0]&&a[0]<=i[0])}}).on("mouseout",function(){t._hovering=!1,!t._dragging&&t._clearHoverLinkToSeries()})},e.prototype._enableHoverLinkFromSeries=function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},e.prototype._doHoverLinkToSeries=function(t,r){var i=this.visualMapModel,a=i.itemSize;if(i.option.hoverLink){var s=[0,a[1]],o=i.getExtent();t=hF(jM(s[0],t),s[1]);var l=O1e(i,o,s),u=[t-l,t+l],c=To(t,s,o,!0),h=[To(u[0],s,o,!0),To(u[1],s,o,!0)];u[0]<s[0]&&(h[0]=-1/0),u[1]>s[1]&&(h[1]=1/0),r&&(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=[];(r||dF(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(h));var p=wJ(f,d);this._dispatchHighDown("downplay",j1(p[0],i)),this._dispatchHighDown("highlight",j1(p[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var r;if(Rh(t.target,function(l){var u=St(l);if(u.dataIndex!=null)return r=u,!0},!0),!!r){var i=this.ecModel.getSeriesByIndex(r.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(i)){var s=i.getData(r.dataType),o=s.getStore().get(a.getDataDimensionIndex(s),r.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var r=this._shapes.handleLabels;if(r)for(var i=0;i<r.length;i++)this.api.leaveBlur(r[i])},e.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",j1(t,this.visualMapModel)),t.length=0},e.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},e.prototype._applyTransform=function(t,r,i,a){var s=qh(r,a?null:this.group);return Ie(t)?so(t,s,i):sS(t,s,i)},e.prototype._dispatchHighDown=function(t,r){r&&r.length&&this.api.dispatchAction({type:t,batch:r})},e.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.type="visualMap.continuous",e}(T$);function fF(n,e,t,r){return new Ra({shape:{points:n},draggable:!!t,cursor:e,drift:t,onmousemove:function(i){Bl(i.event)},ondragend:r})}function O1e(n,e,t){var r=I1e/2,i=n.get("hoverLinkDataSize");return i&&(r=To(i,e,t,!0)/2),r}function dF(n){var e=n.get("hoverLinkOnHandle");return!!(e==null?n.get("realtime"):e)}function pF(n){return n==="vertical"?"ns-resize":"ew-resize"}const F1e=k1e;var B1e={type:"selectDataRange",event:"dataRangeSelected",update:"update"},G1e=function(n,e){e.eachComponent({mainType:"visualMap",query:n},function(t){t.setSelected(n.selected)})},z1e=[{createOnAllSeries:!0,reset:function(n,e){var t=[];return e.eachComponent("visualMap",function(r){var i=n.pipelineContext;!r.isTargetSeries(n)||i&&i.large||t.push(Nye(r.stateList,r.targetVisuals,Qe(r.getValueState,r),r.getDataDimensionIndex(n.getData())))}),t}},{createOnAllSeries:!0,reset:function(n,e){var t=n.getData(),r=[];e.eachComponent("visualMap",function(i){if(i.isTargetSeries(n)){var a=i.getVisualMeta(Qe(U1e,null,n,i))||{stops:[],outerColors:[]},s=i.getDataDimensionIndex(t);s>=0&&(a.dimension=s,r.push(a))}}),n.getData().setVisual("visualMeta",r)}}];function U1e(n,e,t,r){for(var i=e.targetVisuals[r],a=Ti.prepareVisualTypes(i),s={color:O0(n.getData(),"color")},o=0,l=a.length;o<l;o++){var u=a[o],c=i[u==="opacity"?"__alphaForOpacity":u];c&&c.applyVisual(t,h,f)}return s.color;function h(d){return s[d]}function f(d,p){s[d]=p}}var vF=z;function V1e(n){var e=n&&n.visualMap;Ie(e)||(e=e?[e]:[]),vF(e,function(t){if(t){ed(t,"splitList")&&!ed(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var r=t.pieces;r&&Ie(r)&&vF(r,function(i){gt(i)&&(ed(i,"start")&&!ed(i,"min")&&(i.min=i.start),ed(i,"end")&&!ed(i,"max")&&(i.max=i.end))})}})}function ed(n,e){return n&&n.hasOwnProperty&&n.hasOwnProperty(e)}var gF=!1;function E$(n){gF||(gF=!0,n.registerSubTypeDefaulter("visualMap",function(e){return!e.categories&&(!(e.pieces?e.pieces.length>0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),n.registerAction(B1e,G1e),z(z1e,function(e){n.registerVisual(n.PRIORITY.VISUAL.COMPONENT,e)}),n.registerPreprocessor(V1e))}function P$(n){n.registerComponentModel(L1e),n.registerComponentView(F1e),E$(n)}var H1e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._pieceList=[],t}return e.prototype.optionUpdated=function(t,r){n.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],W1e[this._mode].call(this,this._pieceList),this._resetSelected(t,r);var a=this.option.categories;this.resetVisual(function(s,o){i==="categories"?(s.mappingMethod="category",s.categories=yt(a)):(s.dataExtent=this.getExtent(),s.mappingMethod="piecewise",s.pieceList=Ne(this._pieceList,function(l){return l=yt(l),o!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var t=this.option,r={},i=Ti.listVisualTypes(),a=this.isCategory();z(t.pieces,function(o){z(i,function(l){o.hasOwnProperty(l)&&(r[l]=1)})}),z(r,function(o,l){var u=!1;z(this.stateList,function(c){u=u||s(t,c,l)||s(t.target,c,l)},this),!u&&z(this.stateList,function(c){(t[c]||(t[c]={}))[l]=M$.get(l,c==="inRange"?"active":"inactive",a)})},this);function s(o,l,u){return o&&o[l]&&o[l].hasOwnProperty(u)}n.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,r){var i=this.option,a=this._pieceList,s=(r?i:t).selected||{};if(i.selected=s,z(a,function(l,u){var c=this.getSelectedMapKey(l);s.hasOwnProperty(c)||(s[c]=!0)},this),i.selectedMode==="single"){var o=!1;z(a,function(l,u){var c=this.getSelectedMapKey(l);s[c]&&(o?s[c]=!1:o=!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=yt(t)},e.prototype.getValueState=function(t){var r=Ti.findPieceIndex(t,this._pieceList);return r!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[r])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var r=[],i=this._pieceList;return this.eachTargetSeries(function(a){var s=[],o=a.getData();o.each(this.getDataDimensionIndex(o),function(l,u){var c=Ti.findPieceIndex(l,i);c===t&&s.push(u)},this),r.push({seriesId:a.id,dataIndex:s})},this),r},e.prototype.getRepresentValue=function(t){var r;if(this.isCategory())r=t.value;else if(t.value!=null)r=t.value;else{var i=t.interval||[];r=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return r},e.prototype.getVisualMeta=function(t){if(this.isCategory())return;var r=[],i=["",""],a=this;function s(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:r.push({value:c[0],color:d},{value:c[1],color:d})}var o=this._pieceList.slice();if(!o.length)o.push({interval:[-1/0,1/0]});else{var l=o[0].interval[0];l!==-1/0&&o.unshift({interval:[-1/0,l]}),l=o[o.length-1].interval[1],l!==1/0&&o.push({interval:[l,1/0]})}var u=-1/0;return z(o,function(c){var h=c.interval;h&&(h[0]>u&&s([u,h[0]],"outOfRange"),s(h.slice()),u=h[1])},this),{stops:r,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=wc(ab.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}(ab),W1e={splitNumber:function(n){var e=this.option,t=Math.min(e.precision,20),r=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(t)!==a&&t<5;)t++;e.precision=t,a=+a.toFixed(t),e.minOpen&&n.push({interval:[-1/0,r[0]],close:[0,0]});for(var s=0,o=r[0];s<i;o+=a,s++){var l=s===i-1?r[1]:o+a;n.push({interval:[o,l],close:[1,1]})}e.maxOpen&&n.push({interval:[r[1],1/0],close:[0,0]}),lI(n),z(n,function(u,c){u.index=c,u.text=this.formatValueText(u.interval)},this)},categories:function(n){var e=this.option;z(e.categories,function(t){n.push({text:this.formatValueText(t,!0),value:t})},this),mF(e,n)},pieces:function(n){var e=this.option;z(e.pieces,function(t,r){gt(t)||(t={value:t});var i={text:"",index:r};if(t.label!=null&&(i.text=t.label),t.hasOwnProperty("value")){var a=i.value=t.value;i.interval=[a,a],i.close=[1,1]}else{for(var s=i.interval=[],o=i.close=[0,0],l=[1,0,1],u=[-1/0,1/0],c=[],h=0;h<2;h++){for(var f=[["gte","gt","min"],["lte","lt","max"]][h],d=0;d<3&&s[h]==null;d++)s[h]=t[f[d]],o[h]=l[d],c[h]=d===2;s[h]==null&&(s[h]=u[h])}c[0]&&s[1]===1/0&&(o[0]=0),c[1]&&s[0]===-1/0&&(o[1]=0),s[0]===s[1]&&o[0]&&o[1]&&(i.value=s[0])}i.visual=Ti.retrieveVisuals(t),n.push(i)},this),mF(e,n),lI(n),z(n,function(t){var r=t.close,i=[["<","≤"][r[1]],[">","≥"][r[0]]];t.text=t.text||this.formatValueText(t.value!=null?t.value:t.interval,!1,i)},this)}};function mF(n,e){var t=n.inverse;(n.orient==="vertical"?!t:t)&&e.reverse()}const $1e=H1e;var j1e=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.doRender=function(){var t=this.group;t.removeAll();var r=this.visualMapModel,i=r.get("textGap"),a=r.textStyleModel,s=a.getFont(),o=a.getTextColor(),l=this._getItemAlign(),u=r.itemSize,c=this._getViewData(),h=c.endsText,f=di(r.get("showLabel",!0),!h),d=!r.get("selectedMode");h&&this._renderEndsText(t,h[0],u,f,l),z(c.viewPieceList,function(p){var g=p.piece,v=new bt;v.onclick=Qe(this._onItemClick,this,g),this._enableHoverLink(v,p.indexInModelPieceList);var m=r.getRepresentValue(g);if(this._createItemSymbol(v,m,[0,0,u[0],u[1]],d),f){var y=this.visualMapModel.getValueState(m);v.add(new ln({style:{x:l==="right"?-i:u[0]+i,y:u[1]/2,text:g.text,verticalAlign:"middle",align:l,font:s,fill:o,opacity:y==="outOfRange"?.5:1},silent:d}))}t.add(v)},this),h&&this._renderEndsText(t,h[1],u,f,l),Xh(r.get("orient"),t,r.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,r){var i=this;t.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(s){var o=i.visualMapModel;o.option.hoverLink&&i.api.dispatchAction({type:s,batch:j1(o.findTargetDataIndices(r),o)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,r=t.option;if(r.orient==="vertical")return C$(t,this.api,t.itemSize);var i=r.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(t,r,i,a,s){if(r){var o=new bt,l=this.visualMapModel.textStyleModel;o.add(new ln({style:Hn(l,{x:a?s==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?s:"center",text:r})})),t.add(o)}},e.prototype._getViewData=function(){var t=this.visualMapModel,r=Ne(t.getPieceList(),function(o,l){return{piece:o,indexInModelPieceList:l}}),i=t.get("text"),a=t.get("orient"),s=t.get("inverse");return(a==="horizontal"?s:!s)?r.reverse():i&&(i=i.slice().reverse()),{viewPieceList:r,endsText:i}},e.prototype._createItemSymbol=function(t,r,i,a){var s=Br(this.getControllerVisual(r,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(r,"color"));s.silent=a,t.add(s)},e.prototype._onItemClick=function(t){var r=this.visualMapModel,i=r.option,a=i.selectedMode;if(a){var s=yt(i.selected),o=r.getSelectedMapKey(t);a==="single"||a===!0?(s[o]=!0,z(s,function(l,u){s[u]=u===o})):s[o]=!s[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:s})}},e.type="visualMap.piecewise",e}(T$);const q1e=j1e;function L$(n){n.registerComponentModel($1e),n.registerComponentView(q1e),E$(n)}function X1e(n){Vt(P$),Vt(L$)}var Y1e={label:{enabled:!0},decal:{show:!1}},yF=en(),K1e={};function Z1e(n,e){var t=n.getModel("aria");if(!t.get("enabled"))return;var r=yt(Y1e);It(r.label,n.getLocaleModel().get("aria"),!1),It(t.option,r,!1),i(),a();function i(){var u=t.getModel("decal"),c=u.get("show");if(c){var h=st();n.eachSeries(function(f){if(!f.isColorBySeries()){var d=h.get(f.type);d||(d={},h.set(f.type,d)),yF(f).scope=d}}),n.eachRawSeries(function(f){if(n.isSeriesFiltered(f))return;if(ct(f.enableAriaDecal)){f.enableAriaDecal();return}var d=f.getData();if(f.isColorBySeries()){var y=iC(f.ecModel,f.name,K1e,n.getSeriesCount()),_=d.getVisual("decal");d.setVisual("decal",x(_,y))}else{var p=f.getRawData(),g={},v=yF(f).scope;d.each(function(b){var S=d.getRawIndex(b);g[S]=b});var m=p.count();p.each(function(b){var S=g[b],w=p.getName(b)||b+"",T=iC(f.ecModel,w,v,m),C=d.getItemVisual(S,"decal");d.setItemVisual(S,"decal",x(C,T))})}function x(b,S){var w=b?Pe(Pe({},S),b):S;return w.dirty=!0,w}})}}function a(){var u=e.getZr().dom;if(u){var c=n.getLocaleModel().get("aria"),h=t.getModel("label");if(h.option=dt(h.option,c),!!h.get("enabled")){if(u.setAttribute("role","img"),h.get("description")){u.setAttribute("aria-label",h.get("description"));return}var f=n.getSeriesCount(),d=h.get(["data","maxCount"])||10,p=h.get(["series","maxCount"])||10,g=Math.min(f,p),v;if(!(f<1)){var m=o();if(m){var y=h.get(["general","withTitle"]);v=s(y,{title:m})}else v=h.get(["general","withoutTitle"]);var _=[],x=f>1?h.get(["series","multiple","prefix"]):h.get(["series","single","prefix"]);v+=s(x,{seriesCount:f}),n.eachSeries(function(T,C){if(C<g){var A=void 0,M=T.get("name"),P=M?"withName":"withoutName";A=f>1?h.get(["series","multiple",P]):h.get(["series","single",P]),A=s(A,{seriesId:T.seriesIndex,seriesName:T.get("name"),seriesType:l(T.subType)});var D=T.getData();if(D.count()>d){var L=h.get(["data","partialData"]);A+=s(L,{displayCnt:d})}else A+=h.get(["data","allData"]);for(var R=h.get(["data","separator","middle"]),N=h.get(["data","separator","end"]),F=h.get(["data","excludeDimensionId"]),O=[],H=0;H<D.count();H++)if(H<d){var U=D.getName(H),$=F?_n(D.getValues(H),function(oe,X){return Ft(F,X)===-1}):D.getValues(H),Y=h.get(["data",U?"withName":"withoutName"]);O.push(s(Y,{name:U,value:$.join(R)}))}A+=O.join(R)+N,_.push(A)}});var b=h.getModel(["series","multiple","separator"]),S=b.get("middle"),w=b.get("end");v+=_.join(S)+w,u.setAttribute("aria-label",v)}}}}function s(u,c){if(!Ke(u))return u;var h=u;return z(c,function(f,d){h=h.replace(new RegExp("\\{\\s*"+d+"\\s*\\}","g"),f)}),h}function o(){var u=n.get("title");return u&&u.length&&(u=u[0]),u&&u.text}function l(u){var c=n.getLocaleModel().get(["series","typeNames"]);return c[u]||c.chart}}function Q1e(n){if(!(!n||!n.aria)){var e=n.aria;e.show!=null&&(e.enabled=e.show),e.label=e.label||{},z(["description","general","series","data"],function(t){e[t]!=null&&(e.label[t]=e[t])})}}function J1e(n){n.registerPreprocessor(Q1e),n.registerVisual(n.PRIORITY.VISUAL.ARIA,Z1e)}var _F={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},exe=function(){function n(e){var t=this._condVal=Ke(e)?new RegExp(e):DZ(e)?e:null;if(t==null){var r="";mn(r)}}return n.prototype.evaluate=function(e){var t=typeof e;return Ke(t)?this._condVal.test(e):un(t)?this._condVal.test(e+""):!1},n}(),txe=function(){function n(){}return n.prototype.evaluate=function(){return this.value},n}(),nxe=function(){function n(){}return n.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(!e[t].evaluate())return!1;return!0},n}(),rxe=function(){function n(){}return n.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(e[t].evaluate())return!0;return!1},n}(),ixe=function(){function n(){}return n.prototype.evaluate=function(){return!this.child.evaluate()},n}(),axe=function(){function n(){}return n.prototype.evaluate=function(){for(var e=!!this.valueParser,t=this.getValue,r=t(this.valueGetterParam),i=e?this.valueParser(r):null,a=0;a<this.subCondList.length;a++)if(!this.subCondList[a].evaluate(e?i:r))return!1;return!0},n}();function bR(n,e){if(n===!0||n===!1){var t=new txe;return t.value=n,t}var r="";return R$(n)||mn(r),n.and?xF("and",n,e):n.or?xF("or",n,e):n.not?sxe(n,e):oxe(n,e)}function xF(n,e,t){var r=e[n],i="";Ie(r)||mn(i),r.length||mn(i);var a=n==="and"?new nxe:new rxe;return a.children=Ne(r,function(s){return bR(s,t)}),a.children.length||mn(i),a}function sxe(n,e){var t=n.not,r="";R$(t)||mn(r);var i=new ixe;return i.child=bR(t,e),i.child||mn(r),i}function oxe(n,e){for(var t="",r=e.prepareGetValue(n),i=[],a=Yt(n),s=n.parser,o=s?rV(s):null,l=0;l<a.length;l++){var u=a[l];if(!(u==="parser"||e.valueGetterAttrMap.get(u))){var c=tt(_F,u)?_F[u]:u,h=n[u],f=o?o(h):h,d=Bne(c,f)||c==="reg"&&new exe(f);d||mn(t),i.push(d)}}i.length||mn(t);var p=new axe;return p.valueGetterParam=r,p.valueParser=o,p.getValue=e.getValue,p.subCondList=i,p}function R$(n){return gt(n)&&!Hi(n)}var lxe=function(){function n(e,t){this._cond=bR(e,t)}return n.prototype.evaluate=function(){return this._cond.evaluate()},n}();function uxe(n,e){return new lxe(n,e)}var cxe={type:"echarts:filter",transform:function(n){for(var e=n.upstream,t,r=uxe(n.config,{valueGetterAttrMap:st({dimension:!0}),prepareGetValue:function(o){var l="",u=o.dimension;tt(o,"dimension")||mn(l);var c=e.getDimensionInfo(u);return c||mn(l),{dimIdx:c.index}},getValue:function(o){return e.retrieveValueFromItem(t,o.dimIdx)}}),i=[],a=0,s=e.count();a<s;a++)t=e.getRawDataItem(a),r.evaluate()&&i.push(t);return{data:i}}},hxe={type:"echarts:sort",transform:function(n){var e=n.upstream,t=n.config,r="",i=Cn(t);i.length||mn(r);var a=[];z(i,function(c){var h=c.dimension,f=c.order,d=c.parser,p=c.incomparable;if(h==null&&mn(r),f!=="asc"&&f!=="desc"&&mn(r),p&&p!=="min"&&p!=="max"){var g="";mn(g)}if(f!=="asc"&&f!=="desc"){var v="";mn(v)}var m=e.getDimensionInfo(h);m||mn(r);var y=d?rV(d):null;d&&!y&&mn(r),a.push({dimIdx:m.index,parser:y,comparator:new aV(f,p)})});var s=e.sourceFormat;s!==Wi&&s!==zs&&mn(r);for(var o=[],l=0,u=e.count();l<u;l++)o.push(e.getRawDataItem(l));return o.sort(function(c,h){for(var f=0;f<a.length;f++){var d=a[f],p=e.retrieveValueFromItem(c,d.dimIdx),g=e.retrieveValueFromItem(h,d.dimIdx);d.parser&&(p=d.parser(p),g=d.parser(g));var v=d.comparator.evaluate(p,g);if(v!==0)return v}return 0}),{data:o}}};function fxe(n){n.registerTransform(cxe),n.registerTransform(hxe)}var dxe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="dataset",t}return e.prototype.init=function(t,r,i){n.prototype.init.call(this,t,r,i),this._sourceManager=new uV(this),xN(this)},e.prototype.mergeOption=function(t,r){n.prototype.mergeOption.call(this,t,r),xN(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:Wo},e}(sn),pxe=function(n){ve(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="dataset",t}return e.type="dataset",e}(fr);function vxe(n){n.registerComponentModel(dxe),n.registerComponentView(pxe)}var _o=Jo.CMD;function Ud(n,e){return Math.abs(n-e)<1e-5}function rE(n){var e=n.data,t=n.len(),r=[],i,a=0,s=0,o=0,l=0;function u(D,L){i&&i.length>2&&r.push(i),i=[D,L]}function c(D,L,R,N){Ud(D,R)&&Ud(L,N)||i.push(D,L,R,N,R,N)}function h(D,L,R,N,F,O){var H=Math.abs(L-D),U=Math.tan(H/4)*4/3,$=L<D?-1:1,Y=Math.cos(D),oe=Math.sin(D),X=Math.cos(L),re=Math.sin(L),_e=Y*F+R,Fe=oe*O+N,Ce=X*F+R,Ae=re*O+N,ze=F*U*$,fe=O*U*$;i.push(_e-ze*oe,Fe+fe*Y,Ce+ze*re,Ae-fe*X,Ce,Ae)}for(var f,d,p,g,v=0;v<t;){var m=e[v++],y=v===1;switch(y&&(a=e[v],s=e[v+1],o=a,l=s,(m===_o.L||m===_o.C||m===_o.Q)&&(i=[o,l])),m){case _o.M:a=o=e[v++],s=l=e[v++],u(o,l);break;case _o.L:f=e[v++],d=e[v++],c(a,s,f,d),a=f,s=d;break;case _o.C:i.push(e[v++],e[v++],e[v++],e[v++],a=e[v++],s=e[v++]);break;case _o.Q:f=e[v++],d=e[v++],p=e[v++],g=e[v++],i.push(a+2/3*(f-a),s+2/3*(d-s),p+2/3*(f-p),g+2/3*(d-g),p,g),a=p,s=g;break;case _o.A:var _=e[v++],x=e[v++],b=e[v++],S=e[v++],w=e[v++],T=e[v++]+w;v+=1;var C=!e[v++];f=Math.cos(w)*b+_,d=Math.sin(w)*S+x,y?(o=f,l=d,u(o,l)):c(a,s,f,d),a=Math.cos(T)*b+_,s=Math.sin(T)*S+x;for(var A=(C?-1:1)*Math.PI/2,M=w;C?M>T:M<T;M+=A){var P=C?Math.max(M+A,T):Math.min(M+A,T);h(M,P,_,x,b,S)}break;case _o.R:o=a=e[v++],l=s=e[v++],f=o+e[v++],d=l+e[v++],u(f,l),c(f,l,f,d),c(f,d,o,d),c(o,d,o,l),c(o,l,f,l);break;case _o.Z:i&&c(a,s,o,l),a=o,s=l;break}}return i&&i.length>2&&r.push(i),r}function iE(n,e,t,r,i,a,s,o,l,u){if(Ud(n,t)&&Ud(e,r)&&Ud(i,s)&&Ud(a,o)){l.push(s,o);return}var c=2/u,h=c*c,f=s-n,d=o-e,p=Math.sqrt(f*f+d*d);f/=p,d/=p;var g=t-n,v=r-e,m=i-s,y=a-o,_=g*g+v*v,x=m*m+y*y;if(_<h&&x<h){l.push(s,o);return}var b=f*g+d*v,S=-f*m-d*y,w=_-b*b,T=x-S*S;if(w<h&&b>=0&&T<h&&S>=0){l.push(s,o);return}var C=[],A=[];cc(n,t,i,s,.5,C),cc(e,r,a,o,.5,A),iE(C[0],A[0],C[1],A[1],C[2],A[2],C[3],A[3],l,u),iE(C[4],A[4],C[5],A[5],C[6],A[6],C[7],A[7],l,u)}function gxe(n,e){var t=rE(n),r=[];e=e||1;for(var i=0;i<t.length;i++){var a=t[i],s=[],o=a[0],l=a[1];s.push(o,l);for(var u=2;u<a.length;){var c=a[u++],h=a[u++],f=a[u++],d=a[u++],p=a[u++],g=a[u++];iE(o,l,c,h,f,d,p,g,s,e),o=p,l=g}r.push(s)}return r}function D$(n,e,t){var r=n[e],i=n[1-e],a=Math.abs(r/i),s=Math.ceil(Math.sqrt(a*t)),o=Math.floor(t/s);o===0&&(o=1,s=t);for(var l=[],u=0;u<s;u++)l.push(o);var c=s*o,h=t-c;if(h>0)for(var u=0;u<h;u++)l[u%s]+=1;return l}function bF(n,e,t){for(var r=n.r0,i=n.r,a=n.startAngle,s=n.endAngle,o=Math.abs(s-a),l=o*i,u=i-r,c=l>Math.abs(u),h=D$([l,u],c?0:1,e),f=(c?o:u)/h.length,d=0;d<h.length;d++)for(var p=(c?u:o)/h[d],g=0;g<h[d];g++){var v={};c?(v.startAngle=a+f*d,v.endAngle=a+f*(d+1),v.r0=r+p*g,v.r=r+p*(g+1)):(v.startAngle=a+p*g,v.endAngle=a+p*(g+1),v.r0=r+f*d,v.r=r+f*(d+1)),v.clockwise=n.clockwise,v.cx=n.cx,v.cy=n.cy,t.push(v)}}function mxe(n,e,t){for(var r=n.width,i=n.height,a=r>i,s=D$([r,i],a?0:1,e),o=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",h=n[o]/s.length,f=0;f<s.length;f++)for(var d=n[l]/s[f],p=0;p<s[f];p++){var g={};g[u]=f*h,g[c]=p*d,g[o]=h,g[l]=d,g.x+=n.x,g.y+=n.y,t.push(g)}}function SF(n,e,t,r){return n*r-t*e}function yxe(n,e,t,r,i,a,s,o){var l=t-n,u=r-e,c=s-i,h=o-a,f=SF(c,h,l,u);if(Math.abs(f)<1e-6)return null;var d=n-i,p=e-a,g=SF(d,p,c,h)/f;return g<0||g>1?null:new Nt(g*l+n,g*u+e)}function _xe(n,e,t){var r=new Nt;Nt.sub(r,t,e),r.normalize();var i=new Nt;Nt.sub(i,n,e);var a=i.dot(r);return a}function td(n,e){var t=n[n.length-1];t&&t[0]===e[0]&&t[1]===e[1]||n.push(e)}function xxe(n,e,t){for(var r=n.length,i=[],a=0;a<r;a++){var s=n[a],o=n[(a+1)%r],l=yxe(s[0],s[1],o[0],o[1],e.x,e.y,t.x,t.y);l&&i.push({projPt:_xe(l,e,t),pt:l,idx:a})}if(i.length<2)return[{points:n},{points:n}];i.sort(function(v,m){return v.projPt-m.projPt});var u=i[0],c=i[i.length-1];if(c.idx<u.idx){var h=u;u=c,c=h}for(var f=[u.pt.x,u.pt.y],d=[c.pt.x,c.pt.y],p=[f],g=[d],a=u.idx+1;a<=c.idx;a++)td(p,n[a].slice());td(p,d),td(p,f);for(var a=c.idx+1;a<=u.idx+r;a++)td(g,n[a%r].slice());return td(g,f),td(g,d),[{points:p},{points:g}]}function wF(n){var e=n.points,t=[],r=[];eS(e,t,r);var i=new Ot(t[0],t[1],r[0]-t[0],r[1]-t[1]),a=i.width,s=i.height,o=i.x,l=i.y,u=new Nt,c=new Nt;return a>s?(u.x=c.x=o+a/2,u.y=l,c.y=l+s):(u.y=c.y=l+s/2,u.x=o,c.x=o+a),xxe(e,u,c)}function sb(n,e,t,r){if(t===1)r.push(e);else{var i=Math.floor(t/2),a=n(e);sb(n,a[0],i,r),sb(n,a[1],t-i,r)}return r}function bxe(n,e){for(var t=[],r=0;r<e;r++)t.push(OP(n));return t}function Sxe(n,e){e.setStyle(n.style),e.z=n.z,e.z2=n.z2,e.zlevel=n.zlevel}function wxe(n){for(var e=[],t=0;t<n.length;)e.push([n[t++],n[t++]]);return e}function Axe(n,e){var t=[],r=n.shape,i;switch(n.type){case"rect":mxe(r,e,t),i=nn;break;case"sector":bF(r,e,t),i=La;break;case"circle":bF({r0:0,r:r.r,startAngle:0,endAngle:Math.PI*2,cx:r.cx,cy:r.cy},e,t),i=La;break;default:var a=n.getComputedTransform(),s=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,o=Ne(gxe(n.getUpdatedPathProxy(),s),function(m){return wxe(m)}),l=o.length;if(l===0)sb(wF,{points:o[0]},e,t);else if(l===e)for(var u=0;u<l;u++)t.push({points:o[u]});else{var c=0,h=Ne(o,function(m){var y=[],_=[];eS(m,y,_);var x=(_[1]-y[1])*(_[0]-y[0]);return c+=x,{poly:m,area:x}});h.sort(function(m,y){return y.area-m.area});for(var f=e,u=0;u<l;u++){var d=h[u];if(f<=0)break;var p=u===l-1?f:Math.ceil(d.area/c*e);p<0||(sb(wF,{points:d.poly},p,t),f-=p)}}i=Ra;break}if(!i)return bxe(n,e);for(var g=[],u=0;u<t.length;u++){var v=new i;v.setShape(t[u]),Sxe(n,v),g.push(v)}return g}function Mxe(n,e){var t=n.length,r=e.length;if(t===r)return[n,e];for(var i=[],a=[],s=t<r?n:e,o=Math.min(t,r),l=Math.abs(r-t)/6,u=(o-2)/6,c=Math.ceil(l/u)+1,h=[s[0],s[1]],f=l,d=2;d<o;){var p=s[d-2],g=s[d-1],v=s[d++],m=s[d++],y=s[d++],_=s[d++],x=s[d++],b=s[d++];if(f<=0){h.push(v,m,y,_,x,b);continue}for(var S=Math.min(f,c-1)+1,w=1;w<=S;w++){var T=w/S;cc(p,v,y,x,T,i),cc(g,m,_,b,T,a),p=i[3],g=a[3],h.push(i[1],a[1],i[2],a[2],p,g),v=i[5],m=a[5],y=i[6],_=a[6]}f-=S-1}return s===n?[h,e]:[n,h]}function AF(n,e){for(var t=n.length,r=n[t-2],i=n[t-1],a=[],s=0;s<e.length;)a[s++]=r,a[s++]=i;return a}function Txe(n,e){for(var t,r,i,a=[],s=[],o=0;o<Math.max(n.length,e.length);o++){var l=n[o],u=e[o],c=void 0,h=void 0;l?u?(t=Mxe(l,u),c=t[0],h=t[1],r=c,i=h):(h=AF(i||l,l),c=l):(c=AF(r||u,u),h=u),a.push(c),s.push(h)}return[a,s]}function MF(n){for(var e=0,t=0,r=0,i=n.length,a=0,s=i-2;a<i;s=a,a+=2){var o=n[s],l=n[s+1],u=n[a],c=n[a+1],h=o*c-u*l;e+=h,t+=(o+u)*h,r+=(l+c)*h}return e===0?[n[0]||0,n[1]||0]:[t/e/3,r/e/3,e]}function Cxe(n,e,t,r){for(var i=(n.length-2)/6,a=1/0,s=0,o=n.length,l=o-2,u=0;u<i;u++){for(var c=u*6,h=0,f=0;f<o;f+=2){var d=f===0?c:(c+f-2)%l+2,p=n[d]-t[0],g=n[d+1]-t[1],v=e[f]-r[0],m=e[f+1]-r[1],y=v-p,_=m-g;h+=y*y+_*_}h<a&&(a=h,s=u)}return s}function Exe(n){for(var e=[],t=n.length,r=0;r<t;r+=2)e[r]=n[t-r-2],e[r+1]=n[t-r-1];return e}function Pxe(n,e,t,r){for(var i=[],a,s=0;s<n.length;s++){var o=n[s],l=e[s],u=MF(o),c=MF(l);a==null&&(a=u[2]<0!=c[2]<0);var h=[],f=[],d=0,p=1/0,g=[],v=o.length;a&&(o=Exe(o));for(var m=Cxe(o,l,u,c)*6,y=v-2,_=0;_<y;_+=2){var x=(m+_)%y+2;h[_+2]=o[x]-u[0],h[_+3]=o[x+1]-u[1]}if(h[0]=o[m]-u[0],h[1]=o[m+1]-u[1],t>0)for(var b=r/t,S=-r/2;S<=r/2;S+=b){for(var w=Math.sin(S),T=Math.cos(S),C=0,_=0;_<o.length;_+=2){var A=h[_],M=h[_+1],P=l[_]-c[0],D=l[_+1]-c[1],L=P*T-D*w,R=P*w+D*T;g[_]=L,g[_+1]=R;var N=L-A,F=R-M;C+=N*N+F*F}if(C<p){p=C,d=S;for(var O=0;O<g.length;O++)f[O]=g[O]}}else for(var H=0;H<v;H+=2)f[H]=l[H]-c[0],f[H+1]=l[H+1]-c[1];i.push({from:h,to:f,fromCp:u,toCp:c,rotation:-d})}return i}function ob(n){return n.__isCombineMorphing}var I$="__mOriginal_";function lb(n,e,t){var r=I$+e,i=n[r]||n[e];n[r]||(n[r]=n[e]);var a=t.replace,s=t.after,o=t.before;n[e]=function(){var l=arguments,u;return o&&o.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),s&&s.apply(this,l),u}}function fm(n,e){var t=I$+e;n[t]&&(n[e]=n[t],n[t]=null)}function TF(n,e){for(var t=0;t<n.length;t++)for(var r=n[t],i=0;i<r.length;){var a=r[i],s=r[i+1];r[i++]=e[0]*a+e[2]*s+e[4],r[i++]=e[1]*a+e[3]*s+e[5]}}function N$(n,e){var t=n.getUpdatedPathProxy(),r=e.getUpdatedPathProxy(),i=Txe(rE(t),rE(r)),a=i[0],s=i[1],o=n.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}o&&TF(a,o),l&&TF(s,l),lb(e,"updateTransform",{replace:u}),e.transform=null;var c=Pxe(a,s,10,Math.PI),h=[];lb(e,"buildPath",{replace:function(f){for(var d=e.__morphT,p=1-d,g=[],v=0;v<c.length;v++){var m=c[v],y=m.from,_=m.to,x=m.rotation*d,b=m.fromCp,S=m.toCp,w=Math.sin(x),T=Math.cos(x);E1(g,b,S,d);for(var C=0;C<y.length;C+=2){var A=y[C],M=y[C+1],P=_[C],D=_[C+1],L=A*p+P*d,R=M*p+D*d;h[C]=L*T-R*w+g[0],h[C+1]=L*w+R*T+g[1]}var N=h[0],F=h[1];f.moveTo(N,F);for(var C=2;C<y.length;){var P=h[C++],D=h[C++],O=h[C++],H=h[C++],U=h[C++],$=h[C++];N===P&&F===D&&O===U&&H===$?f.lineTo(U,$):f.bezierCurveTo(P,D,O,H,U,$),N=U,F=$}}}})}function SR(n,e,t){if(!n||!e)return e;var r=t.done,i=t.during;N$(n,e),e.__morphT=0;function a(){fm(e,"buildPath"),fm(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},dt({during:function(s){e.dirtyShape(),i&&i(s)},done:function(){a(),r&&r()}},t)),e}function Lxe(n,e,t,r,i,a){var s=16;n=i===t?0:Math.round(32767*(n-t)/(i-t)),e=a===r?0:Math.round(32767*(e-r)/(a-r));for(var o=0,l,u=(1<<s)/2;u>0;u/=2){var c=0,h=0;(n&u)>0&&(c=1),(e&u)>0&&(h=1),o+=u*u*(3*c^h),h===0&&(c===1&&(n=u-1-n,e=u-1-e),l=n,n=e,e=l)}return o}function ub(n){var e=1/0,t=1/0,r=-1/0,i=-1/0,a=Ne(n,function(o){var l=o.getBoundingRect(),u=o.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),r=Math.max(c,r),i=Math.max(h,i),[c,h]}),s=Ne(a,function(o,l){return{cp:o,z:Lxe(o[0],o[1],e,t,r,i),path:n[l]}});return s.sort(function(o,l){return o.z-l.z}).map(function(o){return o.path})}function k$(n){return Axe(n.path,n.count)}function aE(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Rxe(n,e,t){var r=[];function i(b){for(var S=0;S<b.length;S++){var w=b[S];ob(w)?i(w.childrenRef()):w instanceof Ht&&r.push(w)}}i(n);var a=r.length;if(!a)return aE();var s=t.dividePath||k$,o=s({path:e,count:a});if(o.length!==a)return console.error("Invalid morphing: unmatched splitted path"),aE();r=ub(r),o=ub(o);for(var l=t.done,u=t.during,c=t.individualDelay,h=new Cl,f=0;f<a;f++){var d=r[f],p=o[f];p.parent=e,p.copyTransform(h),c||N$(d,p)}e.__isCombineMorphing=!0,e.childrenRef=function(){return o};function g(b){for(var S=0;S<o.length;S++)o[S].addSelfToZr(b)}lb(e,"addSelfToZr",{after:function(b){g(b)}}),lb(e,"removeSelfFromZr",{after:function(b){for(var S=0;S<o.length;S++)o[S].removeSelfFromZr(b)}});function v(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,fm(e,"addSelfToZr"),fm(e,"removeSelfFromZr")}var m=o.length;if(c)for(var y=m,_=function(){y--,y===0&&(v(),l&&l())},f=0;f<m;f++){var x=c?dt({delay:(t.delay||0)+c(f,m,r[f],o[f]),done:_},t):t;SR(r[f],o[f],x)}else e.__morphT=0,e.animateTo({__morphT:1},dt({during:function(b){for(var S=0;S<m;S++){var w=o[S];w.__morphT=e.__morphT,w.dirtyShape()}u&&u(b)},done:function(){v();for(var b=0;b<n.length;b++)fm(n[b],"updateTransform");l&&l()}},t));return e.__zr&&g(e.__zr),{fromIndividuals:r,toIndividuals:o,count:m}}function Dxe(n,e,t){var r=e.length,i=[],a=t.dividePath||k$;function s(d){for(var p=0;p<d.length;p++){var g=d[p];ob(g)?s(g.childrenRef()):g instanceof Ht&&i.push(g)}}if(ob(n)){s(n.childrenRef());var o=i.length;if(o<r)for(var l=0,u=o;u<r;u++)i.push(OP(i[l++%o]));i.length=r}else{i=a({path:n,count:r});for(var c=n.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(c);if(i.length!==r)return console.error("Invalid morphing: unmatched splitted path"),aE()}i=ub(i),e=ub(e);for(var h=t.individualDelay,u=0;u<r;u++){var f=h?dt({delay:(t.delay||0)+h(u,r,i[u],e[u])},t):t;SR(i[u],e[u],f)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function CF(n){return Ie(n[0])}function EF(n,e){for(var t=[],r=n.length,i=0;i<r;i++)t.push({one:n[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,s=void 0;for(s=0;s<a;s++)t[s%r].many.push(e[i][s])}for(var o=0,i=r-1;i>=0;i--)if(!t[i].many.length){var l=t[o].many;if(l.length<=1)if(o)o=0;else return t;var a=l.length,u=Math.ceil(a/2);t[i].many=l.slice(u,a),t[o].many=l.slice(0,u),o++}return t}var Ixe={clone:function(n){for(var e=[],t=1-Math.pow(1-n.path.style.opacity,1/n.count),r=0;r<n.count;r++){var i=OP(n.path);i.setStyle("opacity",t),e.push(i)}return e},split:null};function qM(n,e,t,r,i,a){if(!n.length||!e.length)return;var s=Yp("update",r,i);if(!(s&&s.duration>0))return;var o=r.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},s),u,c;CF(n)&&(u=n,c=e),CF(e)&&(u=e,c=n);function h(m,y,_,x,b){var S=m.many,w=m.one;if(S.length===1&&!b){var T=y?S[0]:w,C=y?w:S[0];if(ob(T))h({many:[T],one:C},!0,_,x,!0);else{var A=o?dt({delay:o(_,x)},l):l;SR(T,C,A),a(T,C,T,C,A)}}else for(var M=dt({dividePath:Ixe[t],individualDelay:o&&function(F,O,H,U){return o(F+_,x)}},l),P=y?Rxe(S,w,M):Dxe(w,S,M),D=P.fromIndividuals,L=P.toIndividuals,R=D.length,N=0;N<R;N++){var A=o?dt({delay:o(N,R)},l):l;a(D[N],L[N],y?S[N]:m.one,y?m.one:S[N],A)}}for(var f=u?u===n:n.length>e.length,d=u?EF(c,u):EF(f?e:n,[f?n:e]),p=0,g=0;g<d.length;g++)p+=d[g].many.length;for(var v=0,g=0;g<d.length;g++)h(d[g],f,v,p),v+=d[g].many.length}function vh(n){if(!n)return[];if(Ie(n)){for(var e=[],t=0;t<n.length;t++)e.push(vh(n[t]));return e}var r=[];return n.traverse(function(i){i instanceof Ht&&!i.disableMorphing&&!i.invisible&&!i.ignore&&r.push(i)}),r}var O$=1e4,Nxe=0,PF=1,LF=2,kxe=en();function Oxe(n,e){for(var t=n.dimensions,r=0;r<t.length;r++){var i=n.getDimensionInfo(t[r]);if(i&&i.otherDims[e]===0)return t[r]}}function Fxe(n,e,t){var r=n.getDimensionInfo(t),i=r&&r.ordinalMeta;if(r){var a=n.get(r.name,e);return i&&i.categories[a]||a+""}}function RF(n,e,t,r){var i=r?"itemChildGroupId":"itemGroupId",a=Oxe(n,i);if(a){var s=Fxe(n,e,a);return s}var o=n.getRawDataItem(e),l=r?"childGroupId":"groupId";if(o&&o[l])return o[l]+"";if(!r)return t||n.getId(e)}function DF(n){var e=[];return z(n,function(t){var r=t.data,i=t.dataGroupId;if(!(r.count()>O$))for(var a=r.getIndices(),s=0;s<a.length;s++)e.push({data:r,groupId:RF(r,s,i,!1),childGroupId:RF(r,s,i,!0),divide:t.divide,dataIndex:s})}),e}function XM(n,e,t){n.traverse(function(r){r instanceof Ht&&Jn(r,{style:{opacity:0}},e,{dataIndex:t,isFrom:!0})})}function YM(n){if(n.parent){var e=n.getComputedTransform();n.setLocalTransform(e),n.parent.remove(n)}}function nd(n){n.stopAnimation(),n.isGroup&&n.traverse(function(e){e.stopAnimation()})}function Bxe(n,e,t){var r=Yp("update",t,e);r&&n.traverse(function(i){if(i instanceof Os){var a=mte(i);a&&i.animateFrom({style:a},r)}})}function Gxe(n,e){var t=n.length;if(t!==e.length)return!1;for(var r=0;r<t;r++){var i=n[r],a=e[r];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function F$(n,e,t){var r=DF(n),i=DF(e);function a(_,x,b,S,w){(b||_)&&x.animateFrom({style:b&&b!==_?Pe(Pe({},b.style),_.style):_.style},w)}var s=!1,o=Nxe,l=st(),u=st();r.forEach(function(_){_.groupId&&l.set(_.groupId,!0),_.childGroupId&&u.set(_.childGroupId,!0)});for(var c=0;c<i.length;c++){var h=i[c].groupId;if(u.get(h)){o=PF;break}var f=i[c].childGroupId;if(f&&l.get(f)){o=LF;break}}function d(_,x){return function(b){var S=b.data,w=b.dataIndex;return x?S.getId(w):_?o===PF?b.childGroupId:b.groupId:o===LF?b.childGroupId:b.groupId}}var p=Gxe(r,i),g={};if(!p)for(var c=0;c<i.length;c++){var v=i[c],m=v.data.getItemGraphicEl(v.dataIndex);m&&(g[m.id]=!0)}function y(_,x){var b=r[x],S=i[_],w=S.data.hostModel,T=b.data.getItemGraphicEl(b.dataIndex),C=S.data.getItemGraphicEl(S.dataIndex);if(T===C){C&&Bxe(C,S.dataIndex,w);return}T&&g[T.id]||C&&(nd(C),T?(nd(T),YM(T),s=!0,qM(vh(T),vh(C),S.divide,w,_,a)):XM(C,w,_))}new Vl(r,i,d(!0,p),d(!1,p),null,"multiple").update(y).updateManyToOne(function(_,x){var b=i[_],S=b.data,w=S.hostModel,T=S.getItemGraphicEl(b.dataIndex),C=_n(Ne(x,function(A){return r[A].data.getItemGraphicEl(r[A].dataIndex)}),function(A){return A&&A!==T&&!g[A.id]});T&&(nd(T),C.length?(z(C,function(A){nd(A),YM(A)}),s=!0,qM(vh(C),vh(T),b.divide,w,_,a)):XM(T,w,b.dataIndex))}).updateOneToMany(function(_,x){var b=r[x],S=b.data.getItemGraphicEl(b.dataIndex);if(!(S&&g[S.id])){var w=_n(Ne(_,function(C){return i[C].data.getItemGraphicEl(i[C].dataIndex)}),function(C){return C&&C!==S}),T=i[_[0]].data.hostModel;w.length&&(z(w,function(C){return nd(C)}),S?(nd(S),YM(S),s=!0,qM(vh(S),vh(w),b.divide,T,_[0],a)):z(w,function(C){return XM(C,T,_[0])}))}}).updateManyToMany(function(_,x){new Vl(x,_,function(b){return r[b].data.getId(r[b].dataIndex)},function(b){return i[b].data.getId(i[b].dataIndex)}).update(function(b,S){y(_[b],x[S])}).execute()}).execute(),s&&z(e,function(_){var x=_.data,b=x.hostModel,S=b&&t.getViewOfSeriesModel(b),w=Yp("update",b,0);S&&b.isAnimationEnabled()&&w&&w.duration>0&&S.group.traverse(function(T){T instanceof Ht&&!T.animators.length&&T.animateFrom({style:{opacity:0}},w)})})}function IF(n){var e=n.getModel("universalTransition").get("seriesKey");return e||n.id}function NF(n){return Ie(n)?n.sort().join(","):n}function Mu(n){if(n.hostModel)return n.hostModel.getModel("universalTransition").get("divideShape")}function zxe(n,e){var t=st(),r=st(),i=st();return z(n.oldSeries,function(a,s){var o=n.oldDataGroupIds[s],l=n.oldData[s],u=IF(a),c=NF(u);r.set(c,{dataGroupId:o,data:l}),Ie(u)&&z(u,function(h){i.set(h,{key:c,dataGroupId:o,data:l})})}),z(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var s=a.get("dataGroupId"),o=a.getData(),l=IF(a),u=NF(l),c=r.get(u);if(c)t.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:Mu(c.data),data:c.data}],newSeries:[{dataGroupId:s,divide:Mu(o),data:o}]});else if(Ie(l)){var h=[];z(l,function(p){var g=r.get(p);g.data&&h.push({dataGroupId:g.dataGroupId,divide:Mu(g.data),data:g.data})}),h.length&&t.set(u,{oldSeries:h,newSeries:[{dataGroupId:s,data:o,divide:Mu(o)}]})}else{var f=i.get(l);if(f){var d=t.get(f.key);d||(d={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:Mu(f.data)}],newSeries:[]},t.set(f.key,d)),d.newSeries.push({dataGroupId:s,data:o,divide:Mu(o)})}}}}),t}function kF(n,e){for(var t=0;t<n.length;t++){var r=e.seriesIndex!=null&&e.seriesIndex===n[t].seriesIndex||e.seriesId!=null&&e.seriesId===n[t].id;if(r)return t}}function Uxe(n,e,t,r){var i=[],a=[];z(Cn(n.from),function(s){var o=kF(e.oldSeries,s);o>=0&&i.push({dataGroupId:e.oldDataGroupIds[o],data:e.oldData[o],divide:Mu(e.oldData[o]),groupIdDim:s.dimension})}),z(Cn(n.to),function(s){var o=kF(t.updatedSeries,s);if(o>=0){var l=t.updatedSeries[o].getData();a.push({dataGroupId:e.oldDataGroupIds[o],data:l,divide:Mu(l),groupIdDim:s.dimension})}}),i.length>0&&a.length>0&&F$(i,a,r)}function Vxe(n){n.registerUpdateLifecycle("series:beforeupdate",function(e,t,r){z(Cn(r.seriesTransition),function(i){z(Cn(i.to),function(a){for(var s=r.updatedSeries,o=0;o<s.length;o++)(a.seriesIndex!=null&&a.seriesIndex===s[o].seriesIndex||a.seriesId!=null&&a.seriesId===s[o].id)&&(s[o][z1]=!0)})})}),n.registerUpdateLifecycle("series:transition",function(e,t,r){var i=kxe(t);if(i.oldSeries&&r.updatedSeries&&r.optionChanged){var a=r.seriesTransition;if(a)z(Cn(a),function(d){Uxe(d,i,r,t)});else{var s=zxe(i,r);z(s.keys(),function(d){var p=s.get(d);F$(p.oldSeries,p.newSeries,t)})}z(r.updatedSeries,function(d){d[z1]&&(d[z1]=!1)})}for(var o=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],c=i.oldData=[],h=0;h<o.length;h++){var f=o[h].getData();f.count()<O$&&(l.push(o[h]),u.push(o[h].get("dataGroupId")),c.push(f))}})}Vt([roe]);Vt([Kse]);Vt([Coe,$oe,ile,$le,lue,nce,Ice,_he,qhe,nfe,dfe,mde,Wde,rpe,wpe,Lpe,Xpe,ive,mve,Mve,Bve,wge]);Vt(jge);Vt(Tme);Vt(DH);Vt(Hme);Vt(yW);Vt(Kme);Vt(a0e);Vt(sye);Vt(Pye);Vt(q0);Vt(Yye);Vt(Qye);Vt(d_e);Vt(w_e);Vt(R_e);Vt(G_e);Vt(J_e);Vt(b1e);Vt(w$);Vt(A$);Vt(X1e);Vt(P$);Vt(L$);Vt(J1e);Vt(fxe);Vt(vxe);Vt(Vxe);Vt(pse);var KM=null;function Hxe(n){return KM||(KM=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),KM(n)}var ZM=null;function Wxe(n){ZM||(ZM=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),ZM(n)}function $xe(n){var e=document.createElement("style");return e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n)),(document.querySelector("head")||document.body).appendChild(e),e}function __(n,e){e===void 0&&(e={});var t=document.createElement(n);return Object.keys(e).forEach(function(r){t[r]=e[r]}),t}function B$(n,e,t){var r=window.getComputedStyle(n,t||null)||{display:"none"};return r[e]}function sE(n){if(!document.documentElement.contains(n))return{detached:!0,rendered:!1};for(var e=n;e!==document;){if(B$(e,"display")==="none")return{detached:!1,rendered:!1};e=e.parentNode}return{detached:!1,rendered:!0}}var jxe='.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}',oE=0,q1=null;function qxe(n,e){n.__resize_mutation_handler__||(n.__resize_mutation_handler__=Kxe.bind(n));var t=n.__resize_listeners__;if(!t){if(n.__resize_listeners__=[],window.ResizeObserver){var r=n.offsetWidth,i=n.offsetHeight,a=new ResizeObserver(function(){!n.__resize_observer_triggered__&&(n.__resize_observer_triggered__=!0,n.offsetWidth===r&&n.offsetHeight===i)||cb(n)}),s=sE(n),o=s.detached,l=s.rendered;n.__resize_observer_triggered__=o===!1&&l===!1,n.__resize_observer__=a,a.observe(n)}else if(n.attachEvent&&n.addEventListener)n.__resize_legacy_resize_handler__=function(){cb(n)},n.attachEvent("onresize",n.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",n.__resize_mutation_handler__);else if(oE||(q1=$xe(jxe)),Zxe(n),n.__resize_rendered__=sE(n).rendered,window.MutationObserver){var u=new MutationObserver(n.__resize_mutation_handler__);u.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),n.__resize_mutation_observer__=u}}n.__resize_listeners__.push(e),oE++}function Xxe(n,e){var t=n.__resize_listeners__;if(t){if(e&&t.splice(t.indexOf(e),1),!t.length||!e){if(n.detachEvent&&n.removeEventListener){n.detachEvent("onresize",n.__resize_legacy_resize_handler__),document.removeEventListener("DOMSubtreeModified",n.__resize_mutation_handler__);return}n.__resize_observer__?(n.__resize_observer__.unobserve(n),n.__resize_observer__.disconnect(),n.__resize_observer__=null):(n.__resize_mutation_observer__&&(n.__resize_mutation_observer__.disconnect(),n.__resize_mutation_observer__=null),n.removeEventListener("scroll",wR),n.removeChild(n.__resize_triggers__.triggers),n.__resize_triggers__=null),n.__resize_listeners__=null}!--oE&&q1&&q1.parentNode.removeChild(q1)}}function Yxe(n){var e=n.__resize_last__,t=e.width,r=e.height,i=n.offsetWidth,a=n.offsetHeight;return i!==t||a!==r?{width:i,height:a}:null}function Kxe(){var n=sE(this),e=n.rendered,t=n.detached;e!==this.__resize_rendered__&&(!t&&this.__resize_triggers__&&(AR(this),this.addEventListener("scroll",wR,!0)),this.__resize_rendered__=e,cb(this))}function wR(){var n=this;AR(this),this.__resize_raf__&&Wxe(this.__resize_raf__),this.__resize_raf__=Hxe(function(){var e=Yxe(n);e&&(n.__resize_last__=e,cb(n))})}function cb(n){!n||!n.__resize_listeners__||n.__resize_listeners__.forEach(function(e){e.call(n,n)})}function Zxe(n){var e=B$(n,"position");(!e||e==="static")&&(n.style.position="relative"),n.__resize_old_position__=e,n.__resize_last__={};var t=__("div",{className:"resize-triggers"}),r=__("div",{className:"resize-expand-trigger"}),i=__("div"),a=__("div",{className:"resize-contract-trigger"});r.appendChild(i),t.appendChild(r),t.appendChild(a),n.appendChild(t),n.__resize_triggers__={triggers:t,expand:r,expandChild:i,contract:a},AR(n),n.addEventListener("scroll",wR,!0),n.__resize_last__={width:n.offsetWidth,height:n.offsetHeight}}function AR(n){var e=n.__resize_triggers__,t=e.expand,r=e.expandChild,i=e.contract,a=i.scrollWidth,s=i.scrollHeight,o=t.offsetWidth,l=t.offsetHeight,u=t.scrollWidth,c=t.scrollHeight;i.scrollLeft=a,i.scrollTop=s,r.style.width=o+1+"px",r.style.height=l+1+"px",t.scrollLeft=u,t.scrollTop=c}var Co=function(){return Co=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},Co.apply(this,arguments)};var Qxe=["getWidth","getHeight","getDom","getOption","resize","dispatchAction","convertToPixel","convertFromPixel","containPixel","getDataURL","getConnectedDataURL","appendData","clear","isDisposed","dispose"];function Jxe(n){return e=Object.create(null),Qxe.forEach(function(t){e[t]=function(r){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(!n.value)throw new Error("ECharts is not initialized yet.");return n.value[r].apply(n.value,i)}}(t)}),e;var e}var ebe={autoresize:[Boolean,Object]},tbe=/^on[^a-z]/,OF=function(n){return tbe.test(n)};function x_(n,e){var t=gY(n)?dn(n):n;return t&&typeof t=="object"&&"value"in t?t.value||e:t||e}var nbe="ecLoadingOptions",rbe={loading:Boolean,loadingOptions:Object},hg=null,G$="x-vue-echarts",FF=[],fg=[];(function(n,e){if(n&&typeof document!="undefined"){var t,r=e.prepend===!0?"prepend":"append",i=e.singleTag===!0,a=typeof e.container=="string"?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(i){var s=FF.indexOf(a);s===-1&&(s=FF.push(a)-1,fg[s]={}),t=fg[s]&&fg[s][r]?fg[s][r]:fg[s][r]=o()}else t=o();n.charCodeAt(0)===65279&&(n=n.substring(1)),t.styleSheet?t.styleSheet.cssText+=n:t.appendChild(document.createTextNode(n))}function o(){var l=document.createElement("style");if(l.setAttribute("type","text/css"),e.attributes)for(var u=Object.keys(e.attributes),c=0;c<u.length;c++)l.setAttribute(u[c],e.attributes[u[c]]);var h=r==="prepend"?"afterbegin":"beforeend";return a.insertAdjacentElement(h,l),l}})(`x-vue-echarts{display:flex;flex-direction:column;width:100%;height:100%;min-width:0}
.vue-echarts-inner{flex-grow:1;min-width:0;width:auto!important;height:auto!important}
`,{});var ibe=function(){if(hg!=null)return hg;if(typeof HTMLElement=="undefined"||typeof customElements=="undefined")return hg=!1;try{new Function("tag",`class EChartsElement extends HTMLElement {
__dispose = null;
disconnectedCallback() {
if (this.__dispose) {
this.__dispose();
this.__dispose = null;
}
}
}
if (customElements.get(tag) == null) {
customElements.define(tag, EChartsElement);
}
`)(G$)}catch(n){return hg=!1}return hg=!0}(),abe="ecTheme",sbe="ecInitOptions",obe="ecUpdateOptions",BF=/(^&?~?!?)native:/,Pr=pY({name:"echarts",props:Co(Co({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},ebe),rbe),emits:{},inheritAttrs:!1,setup:function(n,e){var t=e.attrs,r=Cg(),i=Cg(),a=Cg(),s=Cg(),o=kd(abe,null),l=kd(sbe,null),u=kd(obe,null),c=vY(n),h=c.autoresize,f=c.manualUpdate,d=c.loading,p=c.loadingOptions,g=he(function(){return s.value||n.option||null}),v=he(function(){return n.theme||x_(o,{})}),m=he(function(){return n.initOptions||x_(l,{})}),y=he(function(){return n.updateOptions||x_(u,{})}),_=he(function(){return function(M){var P={};for(var D in M)OF(D)||(P[D]=M[D]);return P}(t)}),x={},b=EG().proxy.$listeners,S={};function w(M){if(i.value){var P=a.value=Lie(i.value,v.value,m.value);n.group&&(P.group=n.group),Object.keys(S).forEach(function(L){var R=S[L];if(R){var N=L.toLowerCase();N.charAt(0)==="~"&&(N=N.substring(1),R.__once__=!0);var F=P;if(N.indexOf("zr:")===0&&(F=P.getZr(),N=N.substring(3)),R.__once__){delete R.__once__;var O=R;R=function(){for(var H=[],U=0;U<arguments.length;U++)H[U]=arguments[U];O.apply(void 0,H),F.off(N,R)}}F.on(N,R)}}),h.value?Ya(function(){P&&!P.isDisposed()&&P.resize(),D()}):D()}function D(){var L=M||g.value;L&&P.setOption(L,y.value)}}function T(){a.value&&(a.value.dispose(),a.value=void 0)}b?Object.keys(b).forEach(function(M){BF.test(M)?x[M.replace(BF,"$1")]=b[M]:S[M]=b[M]}):Object.keys(t).filter(function(M){return OF(M)}).forEach(function(M){var P=M.charAt(2).toLowerCase()+M.slice(3);if(P.indexOf("native:")!==0)P.substring(P.length-4)==="Once"&&(P="~".concat(P.substring(0,P.length-4))),S[P]=t[M];else{var D="on".concat(P.charAt(7).toUpperCase()).concat(P.slice(8));x[D]=t[M]}});var C=null;ei(f,function(M){typeof C=="function"&&(C(),C=null),M||(C=ei(function(){return n.option},function(P,D){P&&(a.value?a.value.setOption(P,Co({notMerge:P!==D},y.value)):w())},{deep:!0}))},{immediate:!0}),ei([v,m],function(){T(),w()},{deep:!0}),oD(function(){n.group&&a.value&&(a.value.group=n.group)});var A=Jxe(a);return function(M,P,D){var L=kd(nbe,{}),R=he(function(){return Co(Co({},x_(L,{})),D==null?void 0:D.value)});oD(function(){var N=M.value;N&&(P.value?N.showLoading(R.value):N.hideLoading())})}(a,d,p),function(M,P,D){var L=null;ei([D,M,P],function(R,N,F){var O=R[0],H=R[1],U=R[2];if(O&&H&&U){var $=U===!0?{}:U,Y=$.throttle,oe=Y===void 0?100:Y,X=$.onResize,re=function(){H.resize(),X==null||X()};L=oe?yS(re,oe):re,qxe(O,L)}F(function(){O&&L&&Xxe(O,L)})})}(a,h,i),Ia(function(){w()}),ns(function(){ibe&&r.value?r.value.__dispose=T:T()}),Co({chart:a,root:r,inner:i,setOption:function(M,P){n.manualUpdate&&(s.value=M),a.value?a.value.setOption(M,P||{}):w(M)},nonEventAttrs:_,nativeListeners:x},A)},render:function(){var n=Co(Co({},this.nonEventAttrs),this.nativeListeners);return n.ref="root",n.class=n.class?["echarts"].concat(n.class):"echarts",lD(G$,n,[lD("div",{ref:"inner",class:"vue-echarts-inner"})])}});const lbe=""+new URL("title-zs1-c15a5ee8-balabala-1782661552655.svg",import.meta.url).href,ube=""+new URL("saoguang-ccf84a88-balabala-1782661552655.svg",import.meta.url).href,cbe=""+new URL("content-bottom-left-arrow-3a8a61f3-balabala-1782661552655.svg",import.meta.url).href,hbe=""+new URL("content-bottom-right-arrow-a3c5270d-balabala-1782661552655.svg",import.meta.url).href,GF=""+new URL("content-middle-line-162bc0d5-balabala-1782661552655.svg",import.meta.url).href;const fbe={class:"m-card-hd"},dbe={class:"m-card-hd-bg"},pbe=["width","viewBox"],vbe=["clip-path"],gbe=["width"],mbe=["id"],ybe=["d"],_be=["d","fill"],xbe=["d","fill","mask"],bbe=["clip-path"],Sbe=["x1"],wbe=["id","x1"],Abe=["id"],Mbe=["id"],Tbe=["width"],Cbe=["id"],Ebe={class:"m-card-hd-title"},Pbe=["width","height","viewBox"],Lbe={opacity:"0.6"},Rbe=["d"],Dbe=["d"],Ibe={class:"m-card-bd-content"},Dt={__name:"index",props:{width:{type:Number,default:398},height:{type:Number,default:200},title:{type:String,default:"标题"}},setup(n){const e=n,t=Be(1),r=he(()=>{let s=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${s} 10.5
H${s+1}
V9.5
H${s}
V10.5Z
M${s} 34.5
V35.5
H${s+1}
V34.5
H${s}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${s} 9.5
H175
V11.5
H${s}
V9.5Z
M${s+1} 34.5
V10.5
H397
V34.5
H${s+1}Z
M0 35.5
H${s}
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=he(()=>{let o=e.height-156,l=e.width;return`M3.485 ${46.0565+o/2}
V${45.8735+o/2}
L3.36682 ${45.7337+o/2}
L0.5 ${42.343+o/2}
V1
H${l-.5}
V${42.3431+o/2}
L${l-3.367} ${45.7337+o/2}
L${l-3.485} ${45.8735+o/2}
V${46.0565+o/2}
L${l-3.367} ${88.745+o/2}
L${l-.5} ${92.135+o/2}
V${155+o}
H0.5
V${92.135+o/2}
L3.36682 ${88.745+o/2}
L3.485 ${88.605+o/2}
V${88.422+o/2}
V${46.0565+o/2}Z`}),a=he(()=>`width:${e.width}px;height:${e.height}px;`);return Ia(()=>{t.value="__"+EG().uid}),(s,o)=>(Z(),ne("div",{class:"m-card",style:pn(a.value)},[E("div",fbe,[E("div",dbe,[(Z(),ne("svg",{width:n.width,height:"36",viewBox:`0 0 ${n.width} 36`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[E("g",{"clip-path":`url(#clip0_70_69244${t.value})`},[E("rect",{y:"34.5",width:n.width,height:"1",fill:"url(#paint0_linear_70_69244)"},null,8,gbe),E("mask",{id:`path-2-inside-1_70_69244${t.value}`,fill:"white"},[E("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:`M10 0.5H165L175 10.5H${n.width}V34.5H0V10.5L10 0.5Z`},null,8,ybe)],8,mbe),E("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:`M10 0.5H165L175 10.5H${n.width}V34.5H0V10.5L10 0.5Z`,fill:`url(#paint1_linear_70_69244${t.value})`},null,8,_be),E("path",{d:r.value,fill:`url(#paint2_linear_70_69244${t.value})`,mask:`url(#path-2-inside-1_70_69244${t.value})`},null,8,xbe),o[1]||(o[1]=Fh('<g opacity="0.5"><mask id="mask0_70_69244" style="mask-type:alpha;" maskUnits="userSpaceOnUse" x="12" y="-12" width="165" height="29"><g style="mix-blend-mode:plus-lighter;" opacity="0.8"><path d="M177 2.5C177 -4.22 139.531 -11.5 93.9677 -11.5C48.4043 -11.5 12 -5.23199 12 2.5C12 10.232 48.4043 16.5 93.9677 16.5C139.531 16.5 177 9.22 177 2.5Z" fill="url(#paint3_diamond_70_69244)"></path></g></mask><g mask="url(#mask0_70_69244)"><g style="mix-blend-mode:plus-lighter;" opacity="0.8"><path d="M177 0.999998C177 -6 137.934 -11.5 92.371 -11.5C46.8075 -11.5 12 -5.90356 12 0.999998C12 7.90356 46.8075 13.5 92.371 13.5C137.934 13.5 177 8 177 0.999998Z" fill="url(#paint4_diamond_70_69244)"></path></g></g></g><g style="mix-blend-mode:plus-lighter;" opacity="0.1"><ellipse cx="81.5264" cy="12.5" rx="81.5264" ry="12.5" transform="matrix(1 0 0 -1 12 13.5)" fill="url(#paint5_radial_70_69244)"></ellipse></g><path d="M0 0.5H6L0 6.5V0.5Z" fill="#30DCFF"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M170 0.5H398V7.5H177L170 0.5Z" fill="url(#paint6_linear_70_69244)"></path>',4)),E("g",{style:{"mix-blend-mode":"plus-lighter"},"clip-path":`url(#clip1_70_69244${t.value})`},[...o[0]||(o[0]=[Fh('<g style="mix-blend-mode:plus-lighter;" opacity="0.8"><ellipse cx="65" cy="2.16667" rx="65" ry="2.16667" transform="matrix(1 1.64302e-07 0.0495776 0.99877 27.6855 -1.82568)" fill="url(#paint7_radial_70_69244)"></ellipse></g><g style="mix-blend-mode:plus-lighter;" opacity="0.5"><ellipse cx="28.7857" cy="4.16667" rx="28.7857" ry="4.16667" transform="matrix(1 1.64302e-07 0.0495776 0.99877 63.8008 -3.82324)" fill="url(#paint8_radial_70_69244)"></ellipse></g><g style="mix-blend-mode:plus-lighter;" opacity="0.54"><ellipse cx="23.2143" cy="2.16667" rx="23.2143" ry="2.16667" transform="matrix(1 1.64302e-07 0.0495776 0.99877 69.4727 -1.82568)" fill="url(#paint9_radial_70_69244)"></ellipse></g><g style="mix-blend-mode:plus-lighter;" opacity="0.8"><ellipse cx="9.28571" cy="2.16667" rx="9.28571" ry="2.16667" transform="matrix(1 1.64302e-07 0.0495776 0.99877 83.4004 -1.82568)" fill="url(#paint10_radial_70_69244)"></ellipse></g>',4)])],8,bbe)],8,vbe),E("defs",null,[E("linearGradient",{id:"paint0_linear_70_69244",x1:n.width,y1:"35.5021",x2:"0",y2:"35.5021",gradientUnits:"userSpaceOnUse"},[...o[2]||(o[2]=[E("stop",{"stop-color":"#35A8EB","stop-opacity":"0.1"},null,-1),E("stop",{offset:"1","stop-color":"#30DCFF"},null,-1)])],8,Sbe),E("linearGradient",{id:`paint1_linear_70_69244${t.value}`,x1:n.width,y1:"17.5",x2:"7.94819",y2:"17.5",gradientUnits:"userSpaceOnUse"},[...o[3]||(o[3]=[E("stop",{offset:"0.0364889","stop-color":"#35A8EB","stop-opacity":"0.11"},null,-1),E("stop",{offset:"1","stop-color":"#30C1FF","stop-opacity":"0.27"},null,-1)])],8,wbe),E("linearGradient",{id:`paint2_linear_70_69244${t.value}`,x1:"40.8948",y1:"13.5",x2:"40.895",y2:"-6.50005",gradientUnits:"userSpaceOnUse"},[...o[4]||(o[4]=[E("stop",{"stop-color":"#35A8EB","stop-opacity":"0"},null,-1),E("stop",{offset:"1","stop-color":"#30DCFF"},null,-1)])],8,Abe),o[6]||(o[6]=Fh('<radialGradient id="paint3_diamond_70_69244" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(94.5 3.62) rotate(-90) scale(41.1199 76.576)"><stop stop-color="#B7EEFF"></stop><stop offset="0.302515" stop-color="#9BE2FF" stop-opacity="0.76"></stop><stop offset="1" stop-color="#6BD4FF" stop-opacity="0"></stop></radialGradient><radialGradient id="paint4_diamond_70_69244" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(84.3871 2.00005) rotate(-90) scale(14.0001 188.259)"><stop stop-color="#B7EEFF"></stop><stop offset="0.302515" stop-color="#9BE2FF" stop-opacity="0.76"></stop><stop offset="1" stop-color="#6BD4FF" stop-opacity="0"></stop></radialGradient><radialGradient id="paint5_radial_70_69244" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(80.7192 12.5) rotate(90) scale(12.5 73.8747)"><stop stop-color="#00B1E9"></stop><stop offset="1" stop-color="#6BD4FF" stop-opacity="0"></stop></radialGradient><linearGradient id="paint6_linear_70_69244" x1="567.258" y1="5.49999" x2="177.933" y2="5.49993" gradientUnits="userSpaceOnUse"><stop offset="0.429792" stop-color="#35A8EB" stop-opacity="0"></stop><stop offset="1" stop-color="#30C1FF" stop-opacity="0.27"></stop></linearGradient><radialGradient id="paint7_radial_70_69244" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(64.3564 2.16667) rotate(90.0001) scale(2.16667 64.3564)"><stop stop-color="#B7EEFF"></stop><stop offset="0.302515" stop-color="#9BE2FF" stop-opacity="0.76"></stop><stop offset="1" stop-color="#6BD4FF" stop-opacity="0"></stop></radialGradient><radialGradient id="paint8_radial_70_69244" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(28.5007 4.16667) rotate(90) scale(4.16667 28.5007)"><stop stop-color="#B7EEFF"></stop><stop offset="1" stop-color="#6BD4FF" stop-opacity="0"></stop></radialGradient><radialGradient id="paint9_radial_70_69244" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(22.9844 2.16667) rotate(90) scale(2.16667 22.9844)"><stop stop-color="#B7EEFF"></stop><stop offset="0.302515" stop-color="#9BE2FF" stop-opacity="0.76"></stop><stop offset="1" stop-color="#6BD4FF" stop-opacity="0"></stop></radialGradient><radialGradient id="paint10_radial_70_69244" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(9.19377 2.16667) rotate(90) scale(2.16667 9.19377)"><stop stop-color="#B7EEFF"></stop><stop offset="0.302515" stop-color="#9BE2FF" stop-opacity="0.76"></stop><stop offset="1" stop-color="#6BD4FF" stop-opacity="0"></stop></radialGradient>',8)),E("clipPath",{id:`clip0_70_69244${t.value}`},[E("rect",{width:n.width,height:"35",fill:"white",transform:"translate(0 0.5)"},null,8,Tbe)],8,Mbe),E("clipPath",{id:`clip1_70_69244${t.value}`},[...o[5]||(o[5]=[E("rect",{width:"130",height:"4",fill:"white",transform:"matrix(1 1.64302e-07 -0.0495776 -0.99877 28 4.5)"},null,-1)])],8,Cbe)])],8,pbe))]),o[7]||(o[7]=E("img",{class:"m-card-hd-zs1",src:lbe,alt:""},null,-1)),o[8]||(o[8]=E("div",{class:"saoguang"},[E("img",{src:ube,alt:""})],-1)),E("div",Ebe,ie(n.title),1)]),E("div",{class:"m-card-bd",style:pn(a.value)},[E("div",{class:"m-card-bd-bg",style:pn(a.value)},[(Z(),ne("svg",{width:n.width,height:n.height,viewBox:`0 0 ${n.width} ${n.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[E("g",Lbe,[E("path",{d:i.value,fill:"rgba(26, 57, 77,1)"},null,8,Rbe),E("path",{d:i.value,stroke:"url(#paint1_linear_70_69585)"},null,8,Dbe)]),o[9]||(o[9]=E("defs",null,[E("linearGradient",{id:"paint1_linear_70_69585",x1:"199",y1:"203.499",x2:"199",y2:"0.499359",gradientUnits:"userSpaceOnUse"},[E("stop",{"stop-color":"#4FC5DD"}),E("stop",{offset:"1","stop-color":"#05839D","stop-opacity":"0"})])],-1))],8,Pbe)),o[10]||(o[10]=E("img",{class:"m-card-bd-bottom-left-arrow",src:cbe,alt:""},null,-1)),o[11]||(o[11]=E("img",{class:"m-card-bd-bottom-right-arrow",src:hbe,alt:""},null,-1)),o[12]||(o[12]=E("img",{class:"m-card-bd-middle-left-line",src:GF,alt:""},null,-1)),o[13]||(o[13]=E("img",{class:"m-card-bd-middle-right-line",src:GF,alt:""},null,-1))],4),E("div",Ibe,[dp(s.$slots,"default")])],4)],4))}};/**
* @license
* Copyright 2010-2023 Three.js Authors
* SPDX-License-Identifier: MIT
*/const MR="161",rd={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},id={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Nbe=0,zF=1,kbe=2,z$=1,Obe=2,bl=3,$l=0,Ta=1,tr=2,tc=0,Qh=1,yi=2,UF=3,VF=4,U$=5,Lu=100,Fbe=101,Bbe=102,HF=103,WF=104,Gbe=200,V$=201,zbe=202,Ube=203,lE=204,uE=205,Vbe=206,Hbe=207,H$=208,Wbe=209,$be=210,jbe=211,qbe=212,Xbe=213,Ybe=214,Kbe=0,Zbe=1,Qbe=2,hb=3,Jbe=4,eSe=5,tSe=6,nSe=7,TR=0,rSe=1,iSe=2,nc=0,aSe=1,sSe=2,oSe=3,lSe=4,uSe=5,cSe=6,$F="attached",hSe="detached",W$=300,Lp=301,Rp=302,cE=303,hE=304,DS=306,hi=1e3,Ui=1001,fb=1002,Jr=1003,fE=1004,Dd=1005,jr=1006,X1=1007,Pl=1008,rc=1009,fSe=1010,dSe=1011,CR=1012,$$=1013,$u=1014,ko=1015,l0=1016,j$=1017,q$=1018,Jh=1020,pSe=1021,Cs=1023,vSe=1024,gSe=1025,ef=1026,Dp=1027,mSe=1028,X$=1029,ySe=1030,Y$=1031,K$=1033,QM=33776,JM=33777,e2=33778,t2=33779,jF=35840,qF=35841,XF=35842,YF=35843,Z$=36196,KF=37492,ZF=37496,QF=37808,JF=37809,e8=37810,t8=37811,n8=37812,r8=37813,i8=37814,a8=37815,s8=37816,o8=37817,l8=37818,u8=37819,c8=37820,h8=37821,n2=36492,f8=36494,d8=36495,_Se=36283,p8=36284,v8=36285,g8=36286,u0=2300,Ip=2301,r2=2302,m8=2400,y8=2401,_8=2402,xSe=2500,bSe=0,Q$=1,dE=2,J$=3e3,tf=3001,SSe=3200,wSe=3201,ER=0,ASe=1,Es="",Vn="srgb",ai="srgb-linear",PR="display-p3",IS="display-p3-linear",db="linear",sr="srgb",pb="rec709",vb="p3",ad=7680,x8=519,MSe=512,TSe=513,CSe=514,ej=515,ESe=516,PSe=517,LSe=518,RSe=519,pE=35044,b8="300 es",vE=1035,Ll=2e3,gb=2001;class Rf{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[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 r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let a=0,s=i.length;a<s;a++)i[a].call(this,e);e.target=null}}}const Di=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let S8=1234567;const dm=Math.PI/180,Np=180/Math.PI;function Is(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(Di[n&255]+Di[n>>8&255]+Di[n>>16&255]+Di[n>>24&255]+"-"+Di[e&255]+Di[e>>8&255]+"-"+Di[e>>16&15|64]+Di[e>>24&255]+"-"+Di[t&63|128]+Di[t>>8&255]+"-"+Di[t>>16&255]+Di[t>>24&255]+Di[r&255]+Di[r>>8&255]+Di[r>>16&255]+Di[r>>24&255]).toLowerCase()}function Xr(n,e,t){return Math.max(e,Math.min(t,n))}function LR(n,e){return(n%e+e)%e}function DSe(n,e,t,r,i){return r+(n-e)*(i-r)/(t-e)}function ISe(n,e,t){return n!==e?(t-n)/(e-n):0}function pm(n,e,t){return(1-t)*n+t*e}function NSe(n,e,t,r){return pm(n,e,1-Math.exp(-t*r))}function kSe(n,e=1){return e-Math.abs(LR(n,e*2)-e)}function OSe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function FSe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function BSe(n,e){return n+Math.floor(Math.random()*(e-n+1))}function GSe(n,e){return n+Math.random()*(e-n)}function zSe(n){return n*(.5-Math.random())}function USe(n){n!==void 0&&(S8=n);let e=S8+=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 VSe(n){return n*dm}function HSe(n){return n*Np}function gE(n){return(n&n-1)===0&&n!==0}function WSe(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function mb(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function $Se(n,e,t,r,i){const a=Math.cos,s=Math.sin,o=a(t/2),l=s(t/2),u=a((e+r)/2),c=s((e+r)/2),h=a((e-r)/2),f=s((e-r)/2),d=a((r-e)/2),p=s((r-e)/2);switch(i){case"XYX":n.set(o*c,l*h,l*f,o*u);break;case"YZY":n.set(l*f,o*c,l*h,o*u);break;case"ZXZ":n.set(l*h,l*f,o*c,o*u);break;case"XZX":n.set(o*c,l*p,l*d,o*u);break;case"YXY":n.set(l*d,o*c,l*p,o*u);break;case"ZYZ":n.set(l*p,l*d,o*c,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Js(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Gn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const RR={DEG2RAD:dm,RAD2DEG:Np,generateUUID:Is,clamp:Xr,euclideanModulo:LR,mapLinear:DSe,inverseLerp:ISe,lerp:pm,damp:NSe,pingpong:kSe,smoothstep:OSe,smootherstep:FSe,randInt:BSe,randFloat:GSe,randFloatSpread:zSe,seededRandom:USe,degToRad:VSe,radToDeg:HSe,isPowerOfTwo:gE,ceilPowerOfTwo:WSe,floorPowerOfTwo:mb,setQuaternionFromProperEuler:$Se,normalize:Gn,denormalize:Js};class Ge{constructor(e=0,t=0){Ge.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,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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 r=this.dot(e)/t;return Math.acos(Xr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,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 r=Math.cos(t),i=Math.sin(t),a=this.x-e.x,s=this.y-e.y;return this.x=a*r-s*i+e.x,this.y=a*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class fn{constructor(e,t,r,i,a,s,o,l,u){fn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,r,i,a,s,o,l,u)}set(e,t,r,i,a,s,o,l,u){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=a,c[5]=l,c[6]=r,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.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 r=e.elements,i=t.elements,a=this.elements,s=r[0],o=r[3],l=r[6],u=r[1],c=r[4],h=r[7],f=r[2],d=r[5],p=r[8],g=i[0],v=i[3],m=i[6],y=i[1],_=i[4],x=i[7],b=i[2],S=i[5],w=i[8];return a[0]=s*g+o*y+l*b,a[3]=s*v+o*_+l*S,a[6]=s*m+o*x+l*w,a[1]=u*g+c*y+h*b,a[4]=u*v+c*_+h*S,a[7]=u*m+c*x+h*w,a[2]=f*g+d*y+p*b,a[5]=f*v+d*_+p*S,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],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8];return t*s*c-t*o*u-r*a*c+r*o*l+i*a*u-i*s*l}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=c*s-o*u,f=o*l-c*a,d=u*a-s*l,p=t*h+r*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*r)*g,e[2]=(o*r-i*s)*g,e[3]=f*g,e[4]=(c*t-i*l)*g,e[5]=(i*a-o*t)*g,e[6]=d*g,e[7]=(r*l-u*t)*g,e[8]=(s*t-r*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,r,i,a,s,o){const l=Math.cos(a),u=Math.sin(a);return this.set(r*l,r*u,-r*(l*s+u*o)+s+e,-i*u,i*l,-i*(-u*s+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(i2.makeScale(e,t)),this}rotate(e){return this.premultiply(i2.makeRotation(-e)),this}translate(e,t){return this.premultiply(i2.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),r=Math.sin(e);return this.set(t,-r,0,r,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,r=e.elements;for(let i=0;i<9;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const i2=new fn;function tj(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function c0(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function jSe(){const n=c0("canvas");return n.style.display="block",n}const w8={};function nf(n){n in w8||(w8[n]=!0,console.warn(n))}const A8=new fn().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),M8=new fn().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),b_={[ai]:{transfer:db,primaries:pb,toReference:n=>n,fromReference:n=>n},[Vn]:{transfer:sr,primaries:pb,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[IS]:{transfer:db,primaries:vb,toReference:n=>n.applyMatrix3(M8),fromReference:n=>n.applyMatrix3(A8)},[PR]:{transfer:sr,primaries:vb,toReference:n=>n.convertSRGBToLinear().applyMatrix3(M8),fromReference:n=>n.applyMatrix3(A8).convertLinearToSRGB()}},qSe=new Set([ai,IS]),Bn={enabled:!0,_workingColorSpace:ai,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!qSe.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const r=b_[e].toReference,i=b_[t].fromReference;return i(r(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return b_[n].primaries},getTransfer:function(n){return n===Es?db:b_[n].transfer}};function op(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function a2(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let sd;class nj{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{sd===void 0&&(sd=c0("canvas")),sd.width=e.width,sd.height=e.height;const r=sd.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=sd}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=c0("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),a=i.data;for(let s=0;s<a.length;s++)a[s]=op(a[s]/255)*255;return r.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let r=0;r<t.length;r++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[r]=Math.floor(op(t[r]/255)*255):t[r]=op(t[r]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let XSe=0;class rj{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:XSe++}),this.uuid=Is(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const r={uuid:this.uuid,url:""},i=this.data;if(i!==null){let a;if(Array.isArray(i)){a=[];for(let s=0,o=i.length;s<o;s++)i[s].isDataTexture?a.push(s2(i[s].image)):a.push(s2(i[s]))}else a=s2(i);r.url=a}return t||(e.images[this.uuid]=r),r}}function s2(n){return typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?nj.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let YSe=0;class ni extends Rf{constructor(e=ni.DEFAULT_IMAGE,t=ni.DEFAULT_MAPPING,r=Ui,i=Ui,a=jr,s=Pl,o=Cs,l=rc,u=ni.DEFAULT_ANISOTROPY,c=Es){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:YSe++}),this.uuid=Is(),this.name="",this.source=new rj(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=a,this.minFilter=s,this.anisotropy=u,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Ge(0,0),this.repeat=new Ge(1,1),this.center=new Ge(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new fn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,typeof c=="string"?this.colorSpace=c:(nf("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=c===tf?Vn:Es),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==W$)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case hi:e.x=e.x-Math.floor(e.x);break;case Ui:e.x=e.x<0?0:1;break;case fb: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 hi:e.y=e.y-Math.floor(e.y);break;case Ui:e.y=e.y<0?0:1;break;case fb: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 nf("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Vn?tf:J$}set encoding(e){nf("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===tf?Vn:Es}}ni.DEFAULT_IMAGE=null;ni.DEFAULT_MAPPING=W$;ni.DEFAULT_ANISOTROPY=1;class En{constructor(e=0,t=0,r=0,i=1){En.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,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,r,i){return this.x=e,this.y=t,this.z=r,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,r=this.y,i=this.z,a=this.w,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i+s[12]*a,this.y=s[1]*t+s[5]*r+s[9]*i+s[13]*a,this.z=s[2]*t+s[6]*r+s[10]*i+s[14]*a,this.w=s[3]*t+s[7]*r+s[11]*i+s[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,r,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,b=(m+1)/2,S=(c+f)/4,w=(h+g)/4,T=(p+v)/4;return _>x&&_>b?_<.01?(r=0,i=.707106781,a=.707106781):(r=Math.sqrt(_),i=S/r,a=w/r):x>b?x<.01?(r=.707106781,i=0,a=.707106781):(i=Math.sqrt(x),r=S/i,a=T/i):b<.01?(r=.707106781,i=.707106781,a=0):(a=Math.sqrt(b),r=w/a,i=T/a),this.set(r,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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,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 KSe extends Rf{constructor(e=1,t=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new En(0,0,e,t),this.scissorTest=!1,this.viewport=new En(0,0,e,t);const i={width:e,height:t,depth:1};r.encoding!==void 0&&(nf("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===tf?Vn:Es),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:jr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},r),this.texture=new ni(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps,this.texture.internalFormat=r.internalFormat,this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this.samples=r.samples}setSize(e,t,r=1){(this.width!==e||this.height!==t||this.depth!==r)&&(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,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 rj(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 pf extends KSe{constructor(e=1,t=1,r={}){super(e,t,r),this.isWebGLRenderTarget=!0}}class ij extends ni{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Jr,this.minFilter=Jr,this.wrapR=Ui,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ZSe extends ni{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Jr,this.minFilter=Jr,this.wrapR=Ui,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ho{constructor(e=0,t=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=i}static slerpFlat(e,t,r,i,a,s,o){let l=r[i+0],u=r[i+1],c=r[i+2],h=r[i+3];const f=a[s+0],d=a[s+1],p=a[s+2],g=a[s+3];if(o===0){e[t+0]=l,e[t+1]=u,e[t+2]=c,e[t+3]=h;return}if(o===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-o;const m=l*f+u*d+c*p+h*g,y=m>=0?1:-1,_=1-m*m;if(_>Number.EPSILON){const b=Math.sqrt(_),S=Math.atan2(b,m*y);v=Math.sin(v*S)/b,o=Math.sin(o*S)/b}const x=o*y;if(l=l*v+f*x,u=u*v+d*x,c=c*v+p*x,h=h*v+g*x,v===1-o){const b=1/Math.sqrt(l*l+u*u+c*c+h*h);l*=b,u*=b,c*=b,h*=b}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,r,i,a,s){const o=r[i],l=r[i+1],u=r[i+2],c=r[i+3],h=a[s],f=a[s+1],d=a[s+2],p=a[s+3];return e[t]=o*p+c*h+l*d-u*f,e[t+1]=l*p+c*f+u*h-o*d,e[t+2]=u*p+c*d+o*f-l*h,e[t+3]=c*p-o*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,r,i){return this._x=e,this._y=t,this._z=r,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 r=e._x,i=e._y,a=e._z,s=e._order,o=Math.cos,l=Math.sin,u=o(r/2),c=o(i/2),h=o(a/2),f=l(r/2),d=l(i/2),p=l(a/2);switch(s){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: "+s)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],i=t[4],a=t[8],s=t[1],o=t[5],l=t[9],u=t[2],c=t[6],h=t[10],f=r+o+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=(s-i)*d}else if(r>o&&r>h){const d=2*Math.sqrt(1+r-o-h);this._w=(c-l)/d,this._x=.25*d,this._y=(i+s)/d,this._z=(a+u)/d}else if(o>h){const d=2*Math.sqrt(1+o-r-h);this._w=(a-u)/d,this._x=(i+s)/d,this._y=.25*d,this._z=(l+c)/d}else{const d=2*Math.sqrt(1+h-r-o);this._w=(s-i)/d,this._x=(a+u)/d,this._y=(l+c)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Xr(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,t/r);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 r=e._x,i=e._y,a=e._z,s=e._w,o=t._x,l=t._y,u=t._z,c=t._w;return this._x=r*c+s*o+i*u-a*l,this._y=i*c+s*l+a*o-r*u,this._z=a*c+s*u+r*l-i*o,this._w=s*c-r*o-i*l-a*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,i=this._y,a=this._z,s=this._w;let o=s*e._w+r*e._x+i*e._y+a*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=r,this._y=i,this._z=a,this;const l=1-o*o;if(l<=Number.EPSILON){const d=1-t;return this._w=d*s+t*this._w,this._x=d*r+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,o),h=Math.sin((1-t)*c)/u,f=Math.sin(t*c)/u;return this._w=s*h+this._w*f,this._x=r*h+this._x*f,this._y=i*h+this._y*f,this._z=a*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),a=2*Math.PI*Math.random();return this.set(t*Math.cos(i),r*Math.sin(a),r*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 te{constructor(e=0,t=0,r=0){te.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,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(T8.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(T8.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*t+a[3]*r+a[6]*i,this.y=a[1]*t+a[4]*r+a[7]*i,this.z=a[2]*t+a[5]*r+a[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,a=e.elements,s=1/(a[3]*t+a[7]*r+a[11]*i+a[15]);return this.x=(a[0]*t+a[4]*r+a[8]*i+a[12])*s,this.y=(a[1]*t+a[5]*r+a[9]*i+a[13])*s,this.z=(a[2]*t+a[6]*r+a[10]*i+a[14])*s,this}applyQuaternion(e){const t=this.x,r=this.y,i=this.z,a=e.x,s=e.y,o=e.z,l=e.w,u=2*(s*i-o*r),c=2*(o*t-a*i),h=2*(a*r-s*t);return this.x=t+l*u+s*h-o*c,this.y=r+l*c+o*u-a*h,this.z=i+l*h+a*c-s*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,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*t+a[4]*r+a[8]*i,this.y=a[1]*t+a[5]*r+a[9]*i,this.z=a[2]*t+a[6]*r+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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,a=e.z,s=t.x,o=t.y,l=t.z;return this.x=i*l-a*o,this.y=a*s-r*l,this.z=r*o-i*s,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return o2.copy(this).projectOnVector(e),this.sub(o2)}reflect(e){return this.sub(o2.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 r=this.dot(e)/t;return Math.acos(Xr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+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,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,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(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,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,r=Math.sqrt(1-eu(e,2));return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const o2=new te,T8=new ho;class Us{constructor(e=new te(1/0,1/0,1/0),t=new te(-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,r=e.length;t<r;t+=3)this.expandByPoint(js.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,r=e.count;t<r;t++)this.expandByPoint(js.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=js.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const r=e.geometry;if(r!==void 0){const a=r.getAttribute("position");if(t===!0&&a!==void 0&&e.isInstancedMesh!==!0)for(let s=0,o=a.count;s<o;s++)e.isMesh===!0?e.getVertexPosition(s,js):js.fromBufferAttribute(a,s),js.applyMatrix4(e.matrixWorld),this.expandByPoint(js);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),S_.copy(e.boundingBox)):(r.boundingBox===null&&r.computeBoundingBox(),S_.copy(r.boundingBox)),S_.applyMatrix4(e.matrixWorld),this.union(S_)}const i=e.children;for(let a=0,s=i.length;a<s;a++)this.expandByObject(i[a],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.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.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,js),js.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(dg),w_.subVectors(this.max,dg),od.subVectors(e.a,dg),ld.subVectors(e.b,dg),ud.subVectors(e.c,dg),hu.subVectors(ld,od),fu.subVectors(ud,ld),th.subVectors(od,ud);let t=[0,-hu.z,hu.y,0,-fu.z,fu.y,0,-th.z,th.y,hu.z,0,-hu.x,fu.z,0,-fu.x,th.z,0,-th.x,-hu.y,hu.x,0,-fu.y,fu.x,0,-th.y,th.x,0];return!l2(t,od,ld,ud,w_)||(t=[1,0,0,0,1,0,0,0,1],!l2(t,od,ld,ud,w_))?!1:(A_.crossVectors(hu,fu),t=[A_.x,A_.y,A_.z],l2(t,od,ld,ud,w_))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,js).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(js).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:(pl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),pl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),pl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),pl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),pl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),pl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),pl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),pl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(pl),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 pl=[new te,new te,new te,new te,new te,new te,new te,new te],js=new te,S_=new Us,od=new te,ld=new te,ud=new te,hu=new te,fu=new te,th=new te,dg=new te,w_=new te,A_=new te,nh=new te;function l2(n,e,t,r,i){for(let a=0,s=n.length-3;a<=s;a+=3){nh.fromArray(n,a);const o=i.x*Math.abs(nh.x)+i.y*Math.abs(nh.y)+i.z*Math.abs(nh.z),l=e.dot(nh),u=t.dot(nh),c=r.dot(nh);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>o)return!1}return!0}const QSe=new Us,pg=new te,u2=new te;class Vs{constructor(e=new te,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 r=this.center;t!==void 0?r.copy(t):QSe.setFromPoints(e).getCenter(r);let i=0;for(let a=0,s=e.length;a<s;a++)i=Math.max(i,r.distanceToSquared(e[a]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const r=this.center.distanceToSquared(e);return t.copy(e),r>this.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;pg.subVectors(e,this.center);const t=pg.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),i=(r-this.radius)*.5;this.center.addScaledVector(pg,i/r),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):(u2.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(pg.copy(e.center).add(u2)),this.expandByPoint(pg.copy(e.center).sub(u2))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const vl=new te,c2=new te,M_=new te,du=new te,h2=new te,T_=new te,f2=new te;class ov{constructor(e=new te,t=new te(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,vl)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=vl.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(vl.copy(this.origin).addScaledVector(this.direction,t),vl.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){c2.copy(e).add(t).multiplyScalar(.5),M_.copy(t).sub(e).normalize(),du.copy(this.origin).sub(c2);const a=e.distanceTo(t)*.5,s=-this.direction.dot(M_),o=du.dot(this.direction),l=-du.dot(M_),u=du.lengthSq(),c=Math.abs(1-s*s);let h,f,d,p;if(c>0)if(h=s*l-o,f=s*o-l,p=a*c,h>=0)if(f>=-p)if(f<=p){const g=1/c;h*=g,f*=g,d=h*(h+s*f+2*o)+f*(s*h+f+2*l)+u}else f=a,h=Math.max(0,-(s*f+o)),d=-h*h+f*(f+2*l)+u;else f=-a,h=Math.max(0,-(s*f+o)),d=-h*h+f*(f+2*l)+u;else f<=-p?(h=Math.max(0,-(-s*a+o)),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,-(s*a+o)),f=h>0?a:Math.min(Math.max(-a,-l),a),d=-h*h+f*(f+2*l)+u);else f=s>0?-a:a,h=Math.max(0,-(s*f+o)),d=-h*h+f*(f+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(c2).addScaledVector(M_,f),d}intersectSphere(e,t){vl.subVectors(e.center,this.origin);const r=vl.dot(this.direction),i=vl.dot(vl)-r*r,a=e.radius*e.radius;if(i>a)return null;const s=Math.sqrt(a-i),o=r-s,l=r+s;return l<0?null:o<0?this.at(l,t):this.at(o,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 r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,a,s,o,l;const u=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,f=this.origin;return u>=0?(r=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(r=(e.max.x-f.x)*u,i=(e.min.x-f.x)*u),c>=0?(a=(e.min.y-f.y)*c,s=(e.max.y-f.y)*c):(a=(e.max.y-f.y)*c,s=(e.min.y-f.y)*c),r>s||a>i||((a>r||isNaN(r))&&(r=a),(s<i||isNaN(i))&&(i=s),h>=0?(o=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(o=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),r>l||o>i)||((o>r||r!==r)&&(r=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(r>=0?r:i,t)}intersectsBox(e){return this.intersectBox(e,vl)!==null}intersectTriangle(e,t,r,i,a){h2.subVectors(t,e),T_.subVectors(r,e),f2.crossVectors(h2,T_);let s=this.direction.dot(f2),o;if(s>0){if(i)return null;o=1}else if(s<0)o=-1,s=-s;else return null;du.subVectors(this.origin,e);const l=o*this.direction.dot(T_.crossVectors(du,T_));if(l<0)return null;const u=o*this.direction.dot(h2.cross(du));if(u<0||l+u>s)return null;const c=-o*du.dot(f2);return c<0?null:this.at(c/s,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 Jt{constructor(e,t,r,i,a,s,o,l,u,c,h,f,d,p,g,v){Jt.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,r,i,a,s,o,l,u,c,h,f,d,p,g,v)}set(e,t,r,i,a,s,o,l,u,c,h,f,d,p,g,v){const m=this.elements;return m[0]=e,m[4]=t,m[8]=r,m[12]=i,m[1]=a,m[5]=s,m[9]=o,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 Jt().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[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,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,i=1/cd.setFromMatrixColumn(e,0).length(),a=1/cd.setFromMatrixColumn(e,1).length(),s=1/cd.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*a,t[5]=r[5]*a,t[6]=r[6]*a,t[7]=0,t[8]=r[8]*s,t[9]=r[9]*s,t[10]=r[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,a=e.z,s=Math.cos(r),o=Math.sin(r),l=Math.cos(i),u=Math.sin(i),c=Math.cos(a),h=Math.sin(a);if(e.order==="XYZ"){const f=s*c,d=s*h,p=o*c,g=o*h;t[0]=l*c,t[4]=-l*h,t[8]=u,t[1]=d+p*u,t[5]=f-g*u,t[9]=-o*l,t[2]=g-f*u,t[6]=p+d*u,t[10]=s*l}else if(e.order==="YXZ"){const f=l*c,d=l*h,p=u*c,g=u*h;t[0]=f+g*o,t[4]=p*o-d,t[8]=s*u,t[1]=s*h,t[5]=s*c,t[9]=-o,t[2]=d*o-p,t[6]=g+f*o,t[10]=s*l}else if(e.order==="ZXY"){const f=l*c,d=l*h,p=u*c,g=u*h;t[0]=f-g*o,t[4]=-s*h,t[8]=p+d*o,t[1]=d+p*o,t[5]=s*c,t[9]=g-f*o,t[2]=-s*u,t[6]=o,t[10]=s*l}else if(e.order==="ZYX"){const f=s*c,d=s*h,p=o*c,g=o*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]=o*l,t[10]=s*l}else if(e.order==="YZX"){const f=s*l,d=s*u,p=o*l,g=o*u;t[0]=l*c,t[4]=g-f*h,t[8]=p*h+d,t[1]=h,t[5]=s*c,t[9]=-o*c,t[2]=-u*c,t[6]=d*h+p,t[10]=f-g*h}else if(e.order==="XZY"){const f=s*l,d=s*u,p=o*l,g=o*u;t[0]=l*c,t[4]=-h,t[8]=u*c,t[1]=f*h+g,t[5]=s*c,t[9]=d*h-p,t[2]=p*h-d,t[6]=o*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(JSe,e,ewe)}lookAt(e,t,r){const i=this.elements;return Fa.subVectors(e,t),Fa.lengthSq()===0&&(Fa.z=1),Fa.normalize(),pu.crossVectors(r,Fa),pu.lengthSq()===0&&(Math.abs(r.z)===1?Fa.x+=1e-4:Fa.z+=1e-4,Fa.normalize(),pu.crossVectors(r,Fa)),pu.normalize(),C_.crossVectors(Fa,pu),i[0]=pu.x,i[4]=C_.x,i[8]=Fa.x,i[1]=pu.y,i[5]=C_.y,i[9]=Fa.y,i[2]=pu.z,i[6]=C_.z,i[10]=Fa.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,a=this.elements,s=r[0],o=r[4],l=r[8],u=r[12],c=r[1],h=r[5],f=r[9],d=r[13],p=r[2],g=r[6],v=r[10],m=r[14],y=r[3],_=r[7],x=r[11],b=r[15],S=i[0],w=i[4],T=i[8],C=i[12],A=i[1],M=i[5],P=i[9],D=i[13],L=i[2],R=i[6],N=i[10],F=i[14],O=i[3],H=i[7],U=i[11],$=i[15];return a[0]=s*S+o*A+l*L+u*O,a[4]=s*w+o*M+l*R+u*H,a[8]=s*T+o*P+l*N+u*U,a[12]=s*C+o*D+l*F+u*$,a[1]=c*S+h*A+f*L+d*O,a[5]=c*w+h*M+f*R+d*H,a[9]=c*T+h*P+f*N+d*U,a[13]=c*C+h*D+f*F+d*$,a[2]=p*S+g*A+v*L+m*O,a[6]=p*w+g*M+v*R+m*H,a[10]=p*T+g*P+v*N+m*U,a[14]=p*C+g*D+v*F+m*$,a[3]=y*S+_*A+x*L+b*O,a[7]=y*w+_*M+x*R+b*H,a[11]=y*T+_*P+x*N+b*U,a[15]=y*C+_*D+x*F+b*$,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],r=e[4],i=e[8],a=e[12],s=e[1],o=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*o*f+r*u*f+i*o*d-r*l*d)+g*(+t*l*d-t*u*f+a*s*f-i*s*d+i*u*c-a*l*c)+v*(+t*u*h-t*o*d-a*s*h+r*s*d+a*o*c-r*u*c)+m*(-i*o*c-t*l*h+t*o*f+i*s*h-r*s*f+r*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,r){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]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=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-o*v*d-h*l*m+o*f*m,_=p*f*u-c*v*u-p*l*d+s*v*d+c*l*m-s*f*m,x=c*g*u-p*h*u+p*o*d-s*g*d-c*o*m+s*h*m,b=p*h*l-c*g*l-p*o*f+s*g*f+c*o*v-s*h*v,S=t*y+r*_+i*x+a*b;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/S;return e[0]=y*w,e[1]=(g*f*a-h*v*a-g*i*d+r*v*d+h*i*m-r*f*m)*w,e[2]=(o*v*a-g*l*a+g*i*u-r*v*u-o*i*m+r*l*m)*w,e[3]=(h*l*a-o*f*a-h*i*u+r*f*u+o*i*d-r*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-s*v*a-p*i*u+t*v*u+s*i*m-t*l*m)*w,e[7]=(s*f*a-c*l*a+c*i*u-t*f*u-s*i*d+t*l*d)*w,e[8]=x*w,e[9]=(p*h*a-c*g*a-p*r*d+t*g*d+c*r*m-t*h*m)*w,e[10]=(s*g*a-p*o*a+p*r*u-t*g*u-s*r*m+t*o*m)*w,e[11]=(c*o*a-s*h*a-c*r*u+t*h*u+s*r*d-t*o*d)*w,e[12]=b*w,e[13]=(c*g*i-p*h*i+p*r*f-t*g*f-c*r*v+t*h*v)*w,e[14]=(p*o*i-s*g*i-p*r*l+t*g*l+s*r*v-t*o*v)*w,e[15]=(s*h*i-c*o*i+c*r*l-t*h*l-s*r*f+t*o*f)*w,this}scale(e){const t=this.elements,r=e.x,i=e.y,a=e.z;return t[0]*=r,t[4]*=i,t[8]*=a,t[1]*=r,t[5]*=i,t[9]*=a,t[2]*=r,t[6]*=i,t[10]*=a,t[3]*=r,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],r=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,r,i))}makeTranslation(e,t,r){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,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),a=1-r,s=e.x,o=e.y,l=e.z,u=a*s,c=a*o;return this.set(u*s+r,u*o-i*l,u*l+i*o,0,u*o+i*l,c*o+r,c*l-i*s,0,u*l-i*o,c*l+i*s,a*l*l+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,a,s){return this.set(1,r,a,0,e,1,s,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,a=t._x,s=t._y,o=t._z,l=t._w,u=a+a,c=s+s,h=o+o,f=a*u,d=a*c,p=a*h,g=s*c,v=s*h,m=o*h,y=l*u,_=l*c,x=l*h,b=r.x,S=r.y,w=r.z;return i[0]=(1-(g+m))*b,i[1]=(d+x)*b,i[2]=(p-_)*b,i[3]=0,i[4]=(d-x)*S,i[5]=(1-(f+m))*S,i[6]=(v+y)*S,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,r){const i=this.elements;let a=cd.set(i[0],i[1],i[2]).length();const s=cd.set(i[4],i[5],i[6]).length(),o=cd.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],qs.copy(this);const u=1/a,c=1/s,h=1/o;return qs.elements[0]*=u,qs.elements[1]*=u,qs.elements[2]*=u,qs.elements[4]*=c,qs.elements[5]*=c,qs.elements[6]*=c,qs.elements[8]*=h,qs.elements[9]*=h,qs.elements[10]*=h,t.setFromRotationMatrix(qs),r.x=a,r.y=s,r.z=o,this}makePerspective(e,t,r,i,a,s,o=Ll){const l=this.elements,u=2*a/(t-e),c=2*a/(r-i),h=(t+e)/(t-e),f=(r+i)/(r-i);let d,p;if(o===Ll)d=-(s+a)/(s-a),p=-2*s*a/(s-a);else if(o===gb)d=-s/(s-a),p=-s*a/(s-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);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,r,i,a,s,o=Ll){const l=this.elements,u=1/(t-e),c=1/(r-i),h=1/(s-a),f=(t+e)*u,d=(r+i)*c;let p,g;if(o===Ll)p=(s+a)*h,g=-2*h;else if(o===gb)p=a*h,g=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);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,r=e.elements;for(let i=0;i<16;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const cd=new te,qs=new Jt,JSe=new te(0,0,0),ewe=new te(1,1,1),pu=new te,C_=new te,Fa=new te,C8=new Jt,E8=new ho;class NS{constructor(e=0,t=0,r=0,i=NS.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,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,r,i=this._order){return this._x=e,this._y=t,this._z=r,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,r=!0){const i=e.elements,a=i[0],s=i[4],o=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(Xr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Xr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,a),this._z=0);break;case"ZXY":this._x=Math.asin(Xr(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-Xr(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(-s,u));break;case"YZX":this._z=Math.asin(Xr(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(o,d));break;case"XZY":this._z=Math.asin(-Xr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(o,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,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return C8.makeRotationFromQuaternion(e),this.setFromRotationMatrix(C8,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return E8.setFromEuler(this),this.setFromQuaternion(E8,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}}NS.DEFAULT_ORDER="XYZ";class DR{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let twe=0;const P8=new te,hd=new ho,gl=new Jt,E_=new te,vg=new te,nwe=new te,rwe=new ho,L8=new te(1,0,0),R8=new te(0,1,0),D8=new te(0,0,1),iwe={type:"added"},awe={type:"removed"};class er extends Rf{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:twe++}),this.uuid=Is(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=er.DEFAULT_UP.clone();const e=new te,t=new NS,r=new ho,i=new te(1,1,1);function a(){r.setFromEuler(t,!1)}function s(){t.setFromQuaternion(r,void 0,!1)}t._onChange(a),r._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Jt},normalMatrix:{value:new fn}}),this.matrix=new Jt,this.matrixWorld=new Jt,this.matrixAutoUpdate=er.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=er.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new DR,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return hd.setFromAxisAngle(e,t),this.quaternion.multiply(hd),this}rotateOnWorldAxis(e,t){return hd.setFromAxisAngle(e,t),this.quaternion.premultiply(hd),this}rotateX(e){return this.rotateOnAxis(L8,e)}rotateY(e){return this.rotateOnAxis(R8,e)}rotateZ(e){return this.rotateOnAxis(D8,e)}translateOnAxis(e,t){return P8.copy(e).applyQuaternion(this.quaternion),this.position.add(P8.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(L8,e)}translateY(e){return this.translateOnAxis(R8,e)}translateZ(e){return this.translateOnAxis(D8,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(gl.copy(this.matrixWorld).invert())}lookAt(e,t,r){e.isVector3?E_.copy(e):E_.set(e,t,r);const i=this.parent;this.updateWorldMatrix(!0,!1),vg.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?gl.lookAt(vg,E_,this.up):gl.lookAt(E_,vg,this.up),this.quaternion.setFromRotationMatrix(gl),i&&(gl.extractRotation(i.matrixWorld),hd.setFromRotationMatrix(gl),this.quaternion.premultiply(hd.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(iwe)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(awe)),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),gl.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),gl.multiply(e.parent.matrixWorld)),e.applyMatrix4(gl),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let r=0,i=this.children.length;r<i;r++){const s=this.children[r].getObjectByProperty(e,t);if(s!==void 0)return s}}getObjectsByProperty(e,t,r=[]){this[e]===t&&r.push(this);const i=this.children;for(let a=0,s=i.length;a<s;a++)i[a].getObjectsByProperty(e,t,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(vg,e,nwe),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(vg,rwe,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let r=0,i=t.length;r<i;r++){const a=t[r];(a.matrixWorldAutoUpdate===!0||e===!0)&&a.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const r=this.parent;if(e===!0&&r!==null&&r.matrixWorldAutoUpdate===!0&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let a=0,s=i.length;a<s;a++){const o=i[a];o.matrixWorldAutoUpdate===!0&&o.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=e===void 0||typeof e=="string",r={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(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(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.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(o,l){return o[l.uuid]===void 0&&(o[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 o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u<c;u++){const h=l[u];a(e.shapes,h)}else a(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,u=this.material.length;l<u;l++)o.push(a(e.materials,this.material[l]));i.material=o}else i.material=a(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(a(e.animations,l))}}if(t){const o=s(e.geometries),l=s(e.materials),u=s(e.textures),c=s(e.images),h=s(e.shapes),f=s(e.skeletons),d=s(e.animations),p=s(e.nodes);o.length>0&&(r.geometries=o),l.length>0&&(r.materials=l),u.length>0&&(r.textures=u),c.length>0&&(r.images=c),h.length>0&&(r.shapes=h),f.length>0&&(r.skeletons=f),d.length>0&&(r.animations=d),p.length>0&&(r.nodes=p)}return r.object=i,r;function s(o){const l=[];for(const u in o){const c=o[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 r=0;r<e.children.length;r++){const i=e.children[r];this.add(i.clone())}return this}}er.DEFAULT_UP=new te(0,1,0);er.DEFAULT_MATRIX_AUTO_UPDATE=!0;er.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Xs=new te,ml=new te,d2=new te,yl=new te,fd=new te,dd=new te,I8=new te,p2=new te,v2=new te,g2=new te;class eo{constructor(e=new te,t=new te,r=new te){this.a=e,this.b=t,this.c=r}static getNormal(e,t,r,i){i.subVectors(r,t),Xs.subVectors(e,t),i.cross(Xs);const a=i.lengthSq();return a>0?i.multiplyScalar(1/Math.sqrt(a)):i.set(0,0,0)}static getBarycoord(e,t,r,i,a){Xs.subVectors(i,t),ml.subVectors(r,t),d2.subVectors(e,t);const s=Xs.dot(Xs),o=Xs.dot(ml),l=Xs.dot(d2),u=ml.dot(ml),c=ml.dot(d2),h=s*u-o*o;if(h===0)return a.set(0,0,0),null;const f=1/h,d=(u*l-o*c)*f,p=(s*c-o*l)*f;return a.set(1-d-p,p,d)}static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,yl)===null?!1:yl.x>=0&&yl.y>=0&&yl.x+yl.y<=1}static getInterpolation(e,t,r,i,a,s,o,l){return this.getBarycoord(e,t,r,i,yl)===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,yl.x),l.addScaledVector(s,yl.y),l.addScaledVector(o,yl.z),l)}static isFrontFacing(e,t,r,i){return Xs.subVectors(r,t),ml.subVectors(e,t),Xs.cross(ml).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),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 Xs.subVectors(this.c,this.b),ml.subVectors(this.a,this.b),Xs.cross(ml).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return eo.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return eo.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,i,a){return eo.getInterpolation(e,this.a,this.b,this.c,t,r,i,a)}containsPoint(e){return eo.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return eo.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,a=this.c;let s,o;fd.subVectors(i,r),dd.subVectors(a,r),p2.subVectors(e,r);const l=fd.dot(p2),u=dd.dot(p2);if(l<=0&&u<=0)return t.copy(r);v2.subVectors(e,i);const c=fd.dot(v2),h=dd.dot(v2);if(c>=0&&h<=c)return t.copy(i);const f=l*h-c*u;if(f<=0&&l>=0&&c<=0)return s=l/(l-c),t.copy(r).addScaledVector(fd,s);g2.subVectors(e,a);const d=fd.dot(g2),p=dd.dot(g2);if(p>=0&&d<=p)return t.copy(a);const g=d*u-l*p;if(g<=0&&u>=0&&p<=0)return o=u/(u-p),t.copy(r).addScaledVector(dd,o);const v=c*p-d*h;if(v<=0&&h-c>=0&&d-p>=0)return I8.subVectors(a,i),o=(h-c)/(h-c+(d-p)),t.copy(i).addScaledVector(I8,o);const m=1/(v+g+f);return s=g*m,o=f*m,t.copy(r).addScaledVector(fd,s).addScaledVector(dd,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const aj={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},vu={h:0,s:0,l:0},P_={h:0,s:0,l:0};function m2(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class xt{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(t===void 0&&r===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,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Vn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Bn.toWorkingColorSpace(this,t),this}setRGB(e,t,r,i=Bn.workingColorSpace){return this.r=e,this.g=t,this.b=r,Bn.toWorkingColorSpace(this,i),this}setHSL(e,t,r,i=Bn.workingColorSpace){if(e=LR(e,1),t=Xr(t,0,1),r=Xr(r,0,1),t===0)this.r=this.g=this.b=r;else{const a=r<=.5?r*(1+t):r+t-r*t,s=2*r-a;this.r=m2(s,a,e+1/3),this.g=m2(s,a,e),this.b=m2(s,a,e-1/3)}return Bn.toWorkingColorSpace(this,i),this}setStyle(e,t=Vn){function r(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 s=i[1],o=i[2];switch(s){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(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(o))return r(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(o))return r(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],s=a.length;if(s===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(s===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=Vn){const r=aj[e.toLowerCase()];return r!==void 0?this.setHex(r,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=op(e.r),this.g=op(e.g),this.b=op(e.b),this}copyLinearToSRGB(e){return this.r=a2(e.r),this.g=a2(e.g),this.b=a2(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Vn){return Bn.fromWorkingColorSpace(Ii.copy(this),e),Math.round(Xr(Ii.r*255,0,255))*65536+Math.round(Xr(Ii.g*255,0,255))*256+Math.round(Xr(Ii.b*255,0,255))}getHexString(e=Vn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Bn.workingColorSpace){Bn.fromWorkingColorSpace(Ii.copy(this),t);const r=Ii.r,i=Ii.g,a=Ii.b,s=Math.max(r,i,a),o=Math.min(r,i,a);let l,u;const c=(o+s)/2;if(o===s)l=0,u=0;else{const h=s-o;switch(u=c<=.5?h/(s+o):h/(2-s-o),s){case r:l=(i-a)/h+(i<a?6:0);break;case i:l=(a-r)/h+2;break;case a:l=(r-i)/h+4;break}l/=6}return e.h=l,e.s=u,e.l=c,e}getRGB(e,t=Bn.workingColorSpace){return Bn.fromWorkingColorSpace(Ii.copy(this),t),e.r=Ii.r,e.g=Ii.g,e.b=Ii.b,e}getStyle(e=Vn){Bn.fromWorkingColorSpace(Ii.copy(this),e);const t=Ii.r,r=Ii.g,i=Ii.b;return e!==Vn?`color(${e} ${t.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(r*255)},${Math.round(i*255)})`}offsetHSL(e,t,r){return this.getHSL(vu),this.setHSL(vu.h+e,vu.s+t,vu.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(vu),e.getHSL(P_);const r=pm(vu.h,P_.h,t),i=pm(vu.s,P_.s,t),a=pm(vu.l,P_.l,t);return this.setHSL(r,i,a),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,r=this.g,i=this.b,a=e.elements;return this.r=a[0]*t+a[3]*r+a[6]*i,this.g=a[1]*t+a[4]*r+a[7]*i,this.b=a[2]*t+a[5]*r+a[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Ii=new xt;xt.NAMES=aj;let swe=0;class Ns extends Rf{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:swe++}),this.uuid=Is(),this.name="",this.type="Material",this.blending=Qh,this.side=$l,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=lE,this.blendDst=uE,this.blendEquation=Lu,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new xt(0,0,0),this.blendAlpha=0,this.depthFunc=hb,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=x8,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ad,this.stencilZFail=ad,this.stencilZPass=ad,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=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 r=e[t];if(r===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(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==Qh&&(r.blending=this.blending),this.side!==$l&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==lE&&(r.blendSrc=this.blendSrc),this.blendDst!==uE&&(r.blendDst=this.blendDst),this.blendEquation!==Lu&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==hb&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==x8&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ad&&(r.stencilFail=this.stencilFail),this.stencilZFail!==ad&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==ad&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(a){const s=[];for(const o in a){const l=a[o];delete l.metadata,s.push(l)}return s}if(t){const a=i(e.textures),s=i(e.images);a.length>0&&(r.textures=a),s.length>0&&(r.images=s)}return r}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 r=null;if(t!==null){const i=t.length;r=new Array(i);for(let a=0;a!==i;++a)r[a]=t[a].clone()}return this.clippingPlanes=r,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 Nn extends Ns{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new xt(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=TR,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 Vr=new te,L_=new Ge;class br{constructor(e,t,r=!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=r,this.usage=pE,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ko,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return nf("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,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,a=this.itemSize;i<a;i++)this.array[e+i]=t.array[r+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,r=this.count;t<r;t++)L_.fromBufferAttribute(this,t),L_.applyMatrix3(e),this.setXY(t,L_.x,L_.y);else if(this.itemSize===3)for(let t=0,r=this.count;t<r;t++)Vr.fromBufferAttribute(this,t),Vr.applyMatrix3(e),this.setXYZ(t,Vr.x,Vr.y,Vr.z);return this}applyMatrix4(e){for(let t=0,r=this.count;t<r;t++)Vr.fromBufferAttribute(this,t),Vr.applyMatrix4(e),this.setXYZ(t,Vr.x,Vr.y,Vr.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)Vr.fromBufferAttribute(this,t),Vr.applyNormalMatrix(e),this.setXYZ(t,Vr.x,Vr.y,Vr.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)Vr.fromBufferAttribute(this,t),Vr.transformDirection(e),this.setXYZ(t,Vr.x,Vr.y,Vr.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let r=this.array[e*this.itemSize+t];return this.normalized&&(r=Js(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=Gn(r,this.array)),this.array[e*this.itemSize+t]=r,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Js(t,this.array)),t}setX(e,t){return this.normalized&&(t=Gn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Js(t,this.array)),t}setY(e,t){return this.normalized&&(t=Gn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Js(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Gn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Js(t,this.array)),t}setW(e,t){return this.normalized&&(t=Gn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=Gn(t,this.array),r=Gn(r,this.array)),this.array[e+0]=t,this.array[e+1]=r,this}setXYZ(e,t,r,i){return e*=this.itemSize,this.normalized&&(t=Gn(t,this.array),r=Gn(r,this.array),i=Gn(i,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this}setXYZW(e,t,r,i,a){return e*=this.itemSize,this.normalized&&(t=Gn(t,this.array),r=Gn(r,this.array),i=Gn(i,this.array),a=Gn(a,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this.array[e+3]=a,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==pE&&(e.usage=this.usage),e}}class sj extends br{constructor(e,t,r){super(new Uint16Array(e),t,r)}}class oj extends br{constructor(e,t,r){super(new Uint32Array(e),t,r)}}class or extends br{constructor(e,t,r){super(new Float32Array(e),t,r)}}let owe=0;const us=new Jt,y2=new er,pd=new te,Ba=new Us,gg=new Us,ci=new te;class qn extends Rf{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:owe++}),this.uuid=Is(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(tj(e)?oj:sj)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,r=0){this.groups.push({start:e,count:t,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const r=this.attributes.normal;if(r!==void 0){const a=new fn().getNormalMatrix(e);r.applyNormalMatrix(a),r.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return us.makeRotationFromQuaternion(e),this.applyMatrix4(us),this}rotateX(e){return us.makeRotationX(e),this.applyMatrix4(us),this}rotateY(e){return us.makeRotationY(e),this.applyMatrix4(us),this}rotateZ(e){return us.makeRotationZ(e),this.applyMatrix4(us),this}translate(e,t,r){return us.makeTranslation(e,t,r),this.applyMatrix4(us),this}scale(e,t,r){return us.makeScale(e,t,r),this.applyMatrix4(us),this}lookAt(e){return y2.lookAt(e),y2.updateMatrix(),this.applyMatrix4(y2.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(pd).negate(),this.translate(pd.x,pd.y,pd.z),this}setFromPoints(e){const t=[];for(let r=0,i=e.length;r<i;r++){const a=e[r];t.push(a.x,a.y,a.z||0)}return this.setAttribute("position",new or(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Us);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingBox.set(new te(-1/0,-1/0,-1/0),new te(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let r=0,i=t.length;r<i;r++){const a=t[r];Ba.setFromBufferAttribute(a),this.morphTargetsRelative?(ci.addVectors(this.boundingBox.min,Ba.min),this.boundingBox.expandByPoint(ci),ci.addVectors(this.boundingBox.max,Ba.max),this.boundingBox.expandByPoint(ci)):(this.boundingBox.expandByPoint(Ba.min),this.boundingBox.expandByPoint(Ba.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Vs);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingSphere.set(new te,1/0);return}if(e){const r=this.boundingSphere.center;if(Ba.setFromBufferAttribute(e),t)for(let a=0,s=t.length;a<s;a++){const o=t[a];gg.setFromBufferAttribute(o),this.morphTargetsRelative?(ci.addVectors(Ba.min,gg.min),Ba.expandByPoint(ci),ci.addVectors(Ba.max,gg.max),Ba.expandByPoint(ci)):(Ba.expandByPoint(gg.min),Ba.expandByPoint(gg.max))}Ba.getCenter(r);let i=0;for(let a=0,s=e.count;a<s;a++)ci.fromBufferAttribute(e,a),i=Math.max(i,r.distanceToSquared(ci));if(t)for(let a=0,s=t.length;a<s;a++){const o=t[a],l=this.morphTargetsRelative;for(let u=0,c=o.count;u<c;u++)ci.fromBufferAttribute(o,u),l&&(pd.fromBufferAttribute(e,u),ci.add(pd)),i=Math.max(i,r.distanceToSquared(ci))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const r=e.array,i=t.position.array,a=t.normal.array,s=t.uv.array,o=i.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new br(new Float32Array(4*o),4));const l=this.getAttribute("tangent").array,u=[],c=[];for(let A=0;A<o;A++)u[A]=new te,c[A]=new te;const h=new te,f=new te,d=new te,p=new Ge,g=new Ge,v=new Ge,m=new te,y=new te;function _(A,M,P){h.fromArray(i,A*3),f.fromArray(i,M*3),d.fromArray(i,P*3),p.fromArray(s,A*2),g.fromArray(s,M*2),v.fromArray(s,P*2),f.sub(h),d.sub(h),g.sub(p),v.sub(p);const D=1/(g.x*v.y-v.x*g.y);isFinite(D)&&(m.copy(f).multiplyScalar(v.y).addScaledVector(d,-g.y).multiplyScalar(D),y.copy(d).multiplyScalar(g.x).addScaledVector(f,-v.x).multiplyScalar(D),u[A].add(m),u[M].add(m),u[P].add(m),c[A].add(y),c[M].add(y),c[P].add(y))}let x=this.groups;x.length===0&&(x=[{start:0,count:r.length}]);for(let A=0,M=x.length;A<M;++A){const P=x[A],D=P.start,L=P.count;for(let R=D,N=D+L;R<N;R+=3)_(r[R+0],r[R+1],r[R+2])}const b=new te,S=new te,w=new te,T=new te;function C(A){w.fromArray(a,A*3),T.copy(w);const M=u[A];b.copy(M),b.sub(w.multiplyScalar(w.dot(M))).normalize(),S.crossVectors(T,M);const D=S.dot(c[A])<0?-1:1;l[A*4]=b.x,l[A*4+1]=b.y,l[A*4+2]=b.z,l[A*4+3]=D}for(let A=0,M=x.length;A<M;++A){const P=x[A],D=P.start,L=P.count;for(let R=D,N=D+L;R<N;R+=3)C(r[R+0]),C(r[R+1]),C(r[R+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new br(new Float32Array(t.count*3),3),this.setAttribute("normal",r);else for(let f=0,d=r.count;f<d;f++)r.setXYZ(f,0,0,0);const i=new te,a=new te,s=new te,o=new te,l=new te,u=new te,c=new te,h=new te;if(e)for(let f=0,d=e.count;f<d;f+=3){const p=e.getX(f+0),g=e.getX(f+1),v=e.getX(f+2);i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,g),s.fromBufferAttribute(t,v),c.subVectors(s,a),h.subVectors(i,a),c.cross(h),o.fromBufferAttribute(r,p),l.fromBufferAttribute(r,g),u.fromBufferAttribute(r,v),o.add(c),l.add(c),u.add(c),r.setXYZ(p,o.x,o.y,o.z),r.setXYZ(g,l.x,l.y,l.z),r.setXYZ(v,u.x,u.y,u.z)}else for(let f=0,d=t.count;f<d;f+=3)i.fromBufferAttribute(t,f+0),a.fromBufferAttribute(t,f+1),s.fromBufferAttribute(t,f+2),c.subVectors(s,a),h.subVectors(i,a),c.cross(h),r.setXYZ(f+0,c.x,c.y,c.z),r.setXYZ(f+1,c.x,c.y,c.z),r.setXYZ(f+2,c.x,c.y,c.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,r=e.count;t<r;t++)ci.fromBufferAttribute(e,t),ci.normalize(),e.setXYZ(t,ci.x,ci.y,ci.z)}toNonIndexed(){function e(o,l){const u=o.array,c=o.itemSize,h=o.normalized,f=new u.constructor(l.length*c);let d=0,p=0;for(let g=0,v=l.length;g<v;g++){o.isInterleavedBufferAttribute?d=l[g]*o.data.stride+o.offset:d=l[g]*c;for(let m=0;m<c;m++)f[p++]=u[d++]}return new br(f,c,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new qn,r=this.index.array,i=this.attributes;for(const o in i){const l=i[o],u=e(l,r);t.setAttribute(o,u)}const a=this.morphAttributes;for(const o in a){const l=[],u=a[o];for(let c=0,h=u.length;c<h;c++){const f=u[c],d=e(f,r);l.push(d)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let o=0,l=s.length;o<l;o++){const u=s[o];t.addGroup(u.start,u.count,u.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(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 r=this.attributes;for(const l in r){const u=r[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;h<f;h++){const d=u[h];c.push(d.toJSON(e.data))}c.length>0&&(i[l]=c,a=!0)}a&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.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 r=e.index;r!==null&&this.setIndex(r.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;f<d;f++)c.push(h[f].clone(t));this.morphAttributes[u]=c}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let u=0,c=s.length;u<c;u++){const h=s[u];this.addGroup(h.start,h.count,h.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const N8=new Jt,rh=new ov,R_=new Vs,k8=new te,vd=new te,gd=new te,md=new te,_2=new te,D_=new te,I_=new Ge,N_=new Ge,k_=new Ge,O8=new te,F8=new te,B8=new te,O_=new te,F_=new te;class An extends er{constructor(e=new qn,t=new Nn){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;a<s;a++){const o=i[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}getVertexPosition(e,t){const r=this.geometry,i=r.attributes.position,a=r.morphAttributes.position,s=r.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(a&&o){D_.set(0,0,0);for(let l=0,u=a.length;l<u;l++){const c=o[l],h=a[l];c!==0&&(_2.fromBufferAttribute(h,e),s?D_.addScaledVector(_2,c):D_.addScaledVector(_2.sub(t),c))}t.add(D_)}return t}raycast(e,t){const r=this.geometry,i=this.material,a=this.matrixWorld;i!==void 0&&(r.boundingSphere===null&&r.computeBoundingSphere(),R_.copy(r.boundingSphere),R_.applyMatrix4(a),rh.copy(e.ray).recast(e.near),!(R_.containsPoint(rh.origin)===!1&&(rh.intersectSphere(R_,k8)===null||rh.origin.distanceToSquared(k8)>eu(e.far-e.near,2)))&&(N8.copy(a).invert(),rh.copy(e.ray).applyMatrix4(N8),!(r.boundingBox!==null&&rh.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,t,rh)))}_computeIntersections(e,t,r){let i;const a=this.geometry,s=this.material,o=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(o!==null)if(Array.isArray(s))for(let p=0,g=f.length;p<g;p++){const v=f[p],m=s[v.materialIndex],y=Math.max(v.start,d.start),_=Math.min(o.count,Math.min(v.start+v.count,d.start+d.count));for(let x=y,b=_;x<b;x+=3){const S=o.getX(x),w=o.getX(x+1),T=o.getX(x+2);i=B_(this,m,e,r,u,c,h,S,w,T),i&&(i.faceIndex=Math.floor(x/3),i.face.materialIndex=v.materialIndex,t.push(i))}}else{const p=Math.max(0,d.start),g=Math.min(o.count,d.start+d.count);for(let v=p,m=g;v<m;v+=3){const y=o.getX(v),_=o.getX(v+1),x=o.getX(v+2);i=B_(this,s,e,r,u,c,h,y,_,x),i&&(i.faceIndex=Math.floor(v/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(s))for(let p=0,g=f.length;p<g;p++){const v=f[p],m=s[v.materialIndex],y=Math.max(v.start,d.start),_=Math.min(l.count,Math.min(v.start+v.count,d.start+d.count));for(let x=y,b=_;x<b;x+=3){const S=x,w=x+1,T=x+2;i=B_(this,m,e,r,u,c,h,S,w,T),i&&(i.faceIndex=Math.floor(x/3),i.face.materialIndex=v.materialIndex,t.push(i))}}else{const p=Math.max(0,d.start),g=Math.min(l.count,d.start+d.count);for(let v=p,m=g;v<m;v+=3){const y=v,_=v+1,x=v+2;i=B_(this,s,e,r,u,c,h,y,_,x),i&&(i.faceIndex=Math.floor(v/3),t.push(i))}}}}function lwe(n,e,t,r,i,a,s,o){let l;if(e.side===Ta?l=r.intersectTriangle(s,a,i,!0,o):l=r.intersectTriangle(i,a,s,e.side===$l,o),l===null)return null;F_.copy(o),F_.applyMatrix4(n.matrixWorld);const u=t.ray.origin.distanceTo(F_);return u<t.near||u>t.far?null:{distance:u,point:F_.clone(),object:n}}function B_(n,e,t,r,i,a,s,o,l,u){n.getVertexPosition(o,vd),n.getVertexPosition(l,gd),n.getVertexPosition(u,md);const c=lwe(n,e,t,r,vd,gd,md,O_);if(c){i&&(I_.fromBufferAttribute(i,o),N_.fromBufferAttribute(i,l),k_.fromBufferAttribute(i,u),c.uv=eo.getInterpolation(O_,vd,gd,md,I_,N_,k_,new Ge)),a&&(I_.fromBufferAttribute(a,o),N_.fromBufferAttribute(a,l),k_.fromBufferAttribute(a,u),c.uv1=eo.getInterpolation(O_,vd,gd,md,I_,N_,k_,new Ge),c.uv2=c.uv1),s&&(O8.fromBufferAttribute(s,o),F8.fromBufferAttribute(s,l),B8.fromBufferAttribute(s,u),c.normal=eo.getInterpolation(O_,vd,gd,md,O8,F8,B8,new te),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const h={a:o,b:l,c:u,normal:new te,materialIndex:0};eo.getNormal(vd,gd,md,h.normal),c.face=h}return c}class lv extends qn{constructor(e=1,t=1,r=1,i=1,a=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:a,depthSegments:s};const o=this;i=Math.floor(i),a=Math.floor(a),s=Math.floor(s);const l=[],u=[],c=[],h=[];let f=0,d=0;p("z","y","x",-1,-1,r,t,e,s,a,0),p("z","y","x",1,-1,r,t,-e,s,a,1),p("x","z","y",1,1,e,r,t,i,s,2),p("x","z","y",1,-1,e,r,-t,i,s,3),p("x","y","z",1,-1,e,t,r,i,a,4),p("x","y","z",-1,-1,e,t,-r,i,a,5),this.setIndex(l),this.setAttribute("position",new or(u,3)),this.setAttribute("normal",new or(c,3)),this.setAttribute("uv",new or(h,2));function p(g,v,m,y,_,x,b,S,w,T,C){const A=x/w,M=b/T,P=x/2,D=b/2,L=S/2,R=w+1,N=T+1;let F=0,O=0;const H=new te;for(let U=0;U<N;U++){const $=U*M-D;for(let Y=0;Y<R;Y++){const oe=Y*A-P;H[g]=oe*y,H[v]=$*_,H[m]=L,u.push(H.x,H.y,H.z),H[g]=0,H[v]=0,H[m]=S>0?1:-1,c.push(H.x,H.y,H.z),h.push(Y/w),h.push(1-U/T),F+=1}}for(let U=0;U<T;U++)for(let $=0;$<w;$++){const Y=f+$+R*U,oe=f+$+R*(U+1),X=f+($+1)+R*(U+1),re=f+($+1)+R*U;l.push(Y,oe,re),l.push(oe,X,re),O+=6}o.addGroup(d,O,C),d+=O,f+=F}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new lv(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function kp(n){const e={};for(const t in n){e[t]={};for(const r in n[t]){const i=n[t][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][r]=null):e[t][r]=i.clone():Array.isArray(i)?e[t][r]=i.slice():e[t][r]=i}}return e}function Zi(n){const e={};for(let t=0;t<n.length;t++){const r=kp(n[t]);for(const i in r)e[i]=r[i]}return e}function uwe(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function lj(n){return n.getRenderTarget()===null?n.outputColorSpace:Bn.workingColorSpace}const IR={clone:kp,merge:Zi};var cwe=`void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,hwe=`void main() {
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class jl extends Ns{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=cwe,this.fragmentShader=hwe,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=kp(e.uniforms),this.uniformsGroups=uwe(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const s=this.uniforms[i].value;s&&s.isTexture?t.uniforms[i]={type:"t",value:s.toJSON(e).uuid}:s&&s.isColor?t.uniforms[i]={type:"c",value:s.getHex()}:s&&s.isVector2?t.uniforms[i]={type:"v2",value:s.toArray()}:s&&s.isVector3?t.uniforms[i]={type:"v3",value:s.toArray()}:s&&s.isVector4?t.uniforms[i]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?t.uniforms[i]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?t.uniforms[i]={type:"m4",value:s.toArray()}:t.uniforms[i]={value:s}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}let uj=class extends er{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Jt,this.projectionMatrix=new Jt,this.projectionMatrixInverse=new Jt,this.coordinateSystem=Ll}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 gu=new te,G8=new Ge,z8=new Ge;class Gi extends uj{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,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=Np*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(dm*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Np*2*Math.atan(Math.tan(dm*.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,r){gu.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(gu.x,gu.y).multiplyScalar(-e/gu.z),gu.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(gu.x,gu.y).multiplyScalar(-e/gu.z)}getViewSize(e,t){return this.getViewBounds(e,G8,z8),t.subVectors(z8,G8)}setViewOffset(e,t,r,i,a,s){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=r,this.view.offsetY=i,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(dm*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,a=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,u=s.fullHeight;a+=s.offsetX*i/l,t-=s.offsetY*r/u,i*=s.width/l,r*=s.height/u}const o=this.filmOffset;o!==0&&(a+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+i,t,t-r,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 yd=-90,_d=1;class fwe extends er{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Gi(yd,_d,e,t);i.layers=this.layers,this.add(i);const a=new Gi(yd,_d,e,t);a.layers=this.layers,this.add(a);const s=new Gi(yd,_d,e,t);s.layers=this.layers,this.add(s);const o=new Gi(yd,_d,e,t);o.layers=this.layers,this.add(o);const l=new Gi(yd,_d,e,t);l.layers=this.layers,this.add(l);const u=new Gi(yd,_d,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[r,i,a,s,o,l]=t;for(const u of t)this.remove(u);if(e===Ll)r.up.set(0,1,0),r.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),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===gb)r.up.set(0,-1,0),r.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),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.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:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,s,o,l,u,c]=this.children,h=e.getRenderTarget(),f=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const g=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(t,a),e.setRenderTarget(r,1,i),e.render(t,s),e.setRenderTarget(r,2,i),e.render(t,o),e.setRenderTarget(r,3,i),e.render(t,l),e.setRenderTarget(r,4,i),e.render(t,u),r.texture.generateMipmaps=g,e.setRenderTarget(r,5,i),e.render(t,c),e.setRenderTarget(h,f,d),e.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class cj extends ni{constructor(e,t,r,i,a,s,o,l,u,c){e=e!==void 0?e:[],t=t!==void 0?t:Lp,super(e,t,r,i,a,s,o,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class dwe extends pf{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];t.encoding!==void 0&&(nf("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===tf?Vn:Es),this.texture=new cj(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:jr}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 r={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 <begin_vertex>
#include <project_vertex>
}
`,fragmentShader:`
uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
gl_FragColor = texture2D( tEquirect, sampleUV );
}
`},i=new lv(5,5,5),a=new jl({name:"CubemapFromEquirect",uniforms:kp(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Ta,blending:tc});a.uniforms.tEquirect.value=t;const s=new An(i,a),o=t.minFilter;return t.minFilter===Pl&&(t.minFilter=jr),new fwe(1,10,this).update(e,s),t.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,r,i){const a=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,r,i);e.setRenderTarget(a)}}const x2=new te,pwe=new te,vwe=new fn;let Tu=class{constructor(e=new te(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,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=x2.subVectors(r,t).cross(pwe.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 r=e.delta(x2),i=this.normal.dot(r);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(r,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<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 r=t||vwe.getNormalMatrix(e),i=this.coplanarPoint(x2).applyMatrix4(e),a=this.normal.applyMatrix3(r).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 ih=new Vs,G_=new te;class NR{constructor(e=new Tu,t=new Tu,r=new Tu,i=new Tu,a=new Tu,s=new Tu){this.planes=[e,t,r,i,a,s]}set(e,t,r,i,a,s){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(r),o[3].copy(i),o[4].copy(a),o[5].copy(s),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=Ll){const r=this.planes,i=e.elements,a=i[0],s=i[1],o=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(r[0].setComponents(l-a,f-u,v-d,x-m).normalize(),r[1].setComponents(l+a,f+u,v+d,x+m).normalize(),r[2].setComponents(l+s,f+c,v+p,x+y).normalize(),r[3].setComponents(l-s,f-c,v-p,x-y).normalize(),r[4].setComponents(l-o,f-h,v-g,x-_).normalize(),t===Ll)r[5].setComponents(l+o,f+h,v+g,x+_).normalize();else if(t===gb)r[5].setComponents(o,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(),ih.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ih.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ih)}intersectsSprite(e){return ih.center.set(0,0,0),ih.radius=.7071067811865476,ih.applyMatrix4(e.matrixWorld),this.intersectsSphere(ih)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let r=0;r<6;r++){const i=t[r];if(G_.x=i.normal.x>0?e.max.x:e.min.x,G_.y=i.normal.y>0?e.max.y:e.min.y,G_.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(G_)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function hj(){let n=null,e=!1,t=null,r=null;function i(a,s){t(a,s),r=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){n=a}}}function gwe(n,e){const t=e.isWebGL2,r=new WeakMap;function i(u,c){const h=u.array,f=u.usage,d=h.byteLength,p=n.createBuffer();n.bindBuffer(c,p),n.bufferData(c,h,f),u.onUploadCallback();let g;if(h instanceof Float32Array)g=n.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)g=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=n.UNSIGNED_SHORT;else if(h instanceof Int16Array)g=n.SHORT;else if(h instanceof Uint32Array)g=n.UNSIGNED_INT;else if(h instanceof Int32Array)g=n.INT;else if(h instanceof Int8Array)g=n.BYTE;else if(h instanceof Uint8Array)g=n.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)g=n.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(n.bindBuffer(h,u),d.count===-1&&p.length===0&&n.bufferSubData(h,0,f),p.length!==0){for(let g=0,v=p.length;g<v;g++){const m=p[g];t?n.bufferSubData(h,m.start*f.BYTES_PER_ELEMENT,f,m.start,m.count):n.bufferSubData(h,m.start*f.BYTES_PER_ELEMENT,f.subarray(m.start,m.start+m.count))}c.clearUpdateRanges()}d.count!==-1&&(t?n.bufferSubData(h,d.offset*f.BYTES_PER_ELEMENT,f,d.offset,d.count):n.bufferSubData(h,d.offset*f.BYTES_PER_ELEMENT,f.subarray(d.offset,d.offset+d.count)),d.count=-1),c.onUploadCallback()}function s(u){return u.isInterleavedBufferAttribute&&(u=u.data),r.get(u)}function o(u){u.isInterleavedBufferAttribute&&(u=u.data);const c=r.get(u);c&&(n.deleteBuffer(c.buffer),r.delete(u))}function l(u,c){if(u.isGLBufferAttribute){const f=r.get(u);(!f||f.version<u.version)&&r.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}u.isInterleavedBufferAttribute&&(u=u.data);const h=r.get(u);if(h===void 0)r.set(u,i(u,c));else if(h.version<u.version){if(h.size!==u.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");a(h.buffer,u,c),h.version=u.version}}return{get:s,remove:o,update:l}}class Ss extends qn{constructor(e=1,t=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:i};const a=e/2,s=t/2,o=Math.floor(r),l=Math.floor(i),u=o+1,c=l+1,h=e/o,f=t/l,d=[],p=[],g=[],v=[];for(let m=0;m<c;m++){const y=m*f-s;for(let _=0;_<u;_++){const x=_*h-a;p.push(x,-y,0),g.push(0,0,1),v.push(_/o),v.push(1-m/l)}}for(let m=0;m<l;m++)for(let y=0;y<o;y++){const _=y+u*m,x=y+u*(m+1),b=y+1+u*(m+1),S=y+1+u*m;d.push(_,x,S),d.push(x,b,S)}this.setIndex(d),this.setAttribute("position",new or(p,3)),this.setAttribute("normal",new or(g,3)),this.setAttribute("uv",new or(v,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ss(e.width,e.height,e.widthSegments,e.heightSegments)}}var mwe=`#ifdef USE_ALPHAHASH
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,ywe=`#ifdef USE_ALPHAHASH
const float ALPHA_HASH_SCALE = 0.05;
float hash2D( vec2 value ) {
return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
}
float hash3D( vec3 value ) {
return hash2D( vec2( hash2D( value.xy ), value.z ) );
}
float getAlphaHashThreshold( vec3 position ) {
float maxDeriv = max(
length( dFdx( position.xyz ) ),
length( dFdy( position.xyz ) )
);
float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
vec2 pixScales = vec2(
exp2( floor( log2( pixScale ) ) ),
exp2( ceil( log2( pixScale ) ) )
);
vec2 alpha = vec2(
hash3D( floor( pixScales.x * position.xyz ) ),
hash3D( floor( pixScales.y * position.xyz ) )
);
float lerpFactor = fract( log2( pixScale ) );
float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
float a = min( lerpFactor, 1.0 - lerpFactor );
vec3 cases = vec3(
x * x / ( 2.0 * a * ( 1.0 - a ) ),
( x - 0.5 * a ) / ( 1.0 - a ),
1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
);
float threshold = ( x < ( 1.0 - a ) )
? ( ( x < a ) ? cases.x : cases.y )
: cases.z;
return clamp( threshold , 1.0e-6, 1.0 );
}
#endif`,_we=`#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,xwe=`#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`,bwe=`#ifdef USE_ALPHATEST
#ifdef ALPHA_TO_COVERAGE
diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
if ( diffuseColor.a == 0.0 ) discard;
#else
if ( diffuseColor.a < alphaTest ) discard;
#endif
#endif`,Swe=`#ifdef USE_ALPHATEST
uniform float alphaTest;
#endif`,wwe=`#ifdef USE_AOMAP
float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
reflectedLight.indirectDiffuse *= ambientOcclusion;
#if defined( USE_CLEARCOAT )
clearcoatSpecularIndirect *= ambientOcclusion;
#endif
#if defined( USE_SHEEN )
sheenSpecularIndirect *= ambientOcclusion;
#endif
#if defined( USE_ENVMAP ) && defined( STANDARD )
float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
#endif
#endif`,Awe=`#ifdef USE_AOMAP
uniform sampler2D aoMap;
uniform float aoMapIntensity;
#endif`,Mwe=`#ifdef USE_BATCHING
attribute float batchId;
uniform highp sampler2D batchingTexture;
mat4 getBatchingMatrix( const in float i ) {
int size = textureSize( batchingTexture, 0 ).x;
int j = int( i ) * 4;
int x = j % size;
int y = j / size;
vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
return mat4( v1, v2, v3, v4 );
}
#endif`,Twe=`#ifdef USE_BATCHING
mat4 batchingMatrix = getBatchingMatrix( batchId );
#endif`,Cwe=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
vPosition = vec3( position );
#endif`,Ewe=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
vec3 objectTangent = vec3( tangent.xyz );
#endif`,Pwe=`float G_BlinnPhong_Implicit( ) {
return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
vec3 halfDir = normalize( lightDir + viewDir );
float dotNH = saturate( dot( normal, halfDir ) );
float dotVH = saturate( dot( viewDir, halfDir ) );
vec3 F = F_Schlick( specularColor, 1.0, dotVH );
float G = G_BlinnPhong_Implicit( );
float D = D_BlinnPhong( shininess, dotNH );
return F * ( G * D );
} // validated`,Lwe=`#ifdef USE_IRIDESCENCE
const mat3 XYZ_TO_REC709 = mat3(
3.2404542, -0.9692660, 0.0556434,
-1.5371385, 1.8760108, -0.2040259,
-0.4985314, 0.0415560, 1.0572252
);
vec3 Fresnel0ToIor( vec3 fresnel0 ) {
vec3 sqrtF0 = sqrt( fresnel0 );
return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
}
vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
}
float IorToFresnel0( float transmittedIor, float incidentIor ) {
return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
}
vec3 evalSensitivity( float OPD, vec3 shift ) {
float phase = 2.0 * PI * OPD * 1.0e-9;
vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
xyz /= 1.0685e-7;
vec3 rgb = XYZ_TO_REC709 * xyz;
return rgb;
}
vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
vec3 I;
float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
float cosTheta2Sq = 1.0 - sinTheta2Sq;
if ( cosTheta2Sq < 0.0 ) {
return vec3( 1.0 );
}
float cosTheta2 = sqrt( cosTheta2Sq );
float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
float R12 = F_Schlick( R0, 1.0, cosTheta1 );
float T121 = 1.0 - R12;
float phi12 = 0.0;
if ( iridescenceIOR < outsideIOR ) phi12 = PI;
float phi21 = PI - phi12;
vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
vec3 phi23 = vec3( 0.0 );
if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
vec3 phi = vec3( phi21 ) + phi23;
vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
vec3 r123 = sqrt( R123 );
vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
vec3 C0 = R12 + Rs;
I = C0;
vec3 Cm = Rs - T121;
for ( int m = 1; m <= 2; ++ m ) {
Cm *= r123;
vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
I += Cm * Sm;
}
return max( I, vec3( 0.0 ) );
}
#endif`,Rwe=`#ifdef USE_BUMPMAP
uniform sampler2D bumpMap;
uniform float bumpScale;
vec2 dHdxy_fwd() {
vec2 dSTdx = dFdx( vBumpMapUv );
vec2 dSTdy = dFdy( vBumpMapUv );
float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
return vec2( dBx, dBy );
}
vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
vec3 vN = surf_norm;
vec3 R1 = cross( vSigmaY, vN );
vec3 R2 = cross( vN, vSigmaX );
float fDet = dot( vSigmaX, R1 ) * faceDirection;
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
return normalize( abs( fDet ) * surf_norm - vGrad );
}
#endif`,Dwe=`#if NUM_CLIPPING_PLANES > 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`,Iwe=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,Nwe=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
#endif`,kwe=`#if NUM_CLIPPING_PLANES > 0
vClipPosition = - mvPosition.xyz;
#endif`,Owe=`#if defined( USE_COLOR_ALPHA )
diffuseColor *= vColor;
#elif defined( USE_COLOR )
diffuseColor.rgb *= vColor;
#endif`,Fwe=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR )
varying vec3 vColor;
#endif`,Bwe=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
varying vec3 vColor;
#endif`,Gwe=`#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`,zwe=`#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`,Uwe=`#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`,Vwe=`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`,Hwe=`#ifdef USE_DISPLACEMENTMAP
uniform sampler2D displacementMap;
uniform float displacementScale;
uniform float displacementBias;
#endif`,Wwe=`#ifdef USE_DISPLACEMENTMAP
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,$we=`#ifdef USE_EMISSIVEMAP
vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,jwe=`#ifdef USE_EMISSIVEMAP
uniform sampler2D emissiveMap;
#endif`,qwe="gl_FragColor = linearToOutputTexel( gl_FragColor );",Xwe=`
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 );
}`,Ywe=`#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`,Kwe=`#ifdef USE_ENVMAP
uniform float envMapIntensity;
uniform float flipEnvMap;
#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#else
uniform sampler2D envMap;
#endif
#endif`,Zwe=`#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`,Qwe=`#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`,Jwe=`#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`,eAe=`#ifdef USE_FOG
vFogDepth = - mvPosition.z;
#endif`,tAe=`#ifdef USE_FOG
varying float vFogDepth;
#endif`,nAe=`#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`,rAe=`#ifdef USE_FOG
uniform vec3 fogColor;
varying float vFogDepth;
#ifdef FOG_EXP2
uniform float fogDensity;
#else
uniform float fogNear;
uniform float fogFar;
#endif
#endif`,iAe=`#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
}`,aAe=`#ifdef USE_LIGHTMAP
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
reflectedLight.indirectDiffuse += lightMapIrradiance;
#endif`,sAe=`#ifdef USE_LIGHTMAP
uniform sampler2D lightMap;
uniform float lightMapIntensity;
#endif`,oAe=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,lAe=`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`,uAe=`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`,cAe=`#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`,hAe=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,fAe=`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`,dAe=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,pAe=`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`,vAe=`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`,gAe=`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 );
}`,mAe=`
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`,yAe=`#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`,_Ae=`#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`,xAe=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,bAe=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
uniform float logDepthBufFC;
varying float vFragDepth;
varying float vIsPerspective;
#endif`,SAe=`#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
varying float vFragDepth;
varying float vIsPerspective;
#else
uniform float logDepthBufFC;
#endif
#endif`,wAe=`#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`,AAe=`#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`,MAe=`#ifdef USE_MAP
uniform sampler2D map;
#endif`,TAe=`#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`,CAe=`#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`,EAe=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
metalnessFactor *= texelMetalness.b;
#endif`,PAe=`#ifdef USE_METALNESSMAP
uniform sampler2D metalnessMap;
#endif`,LAe=`#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`,RAe=`#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`,DAe=`#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`,IAe=`#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`,NAe=`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;`,kAe=`#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`,OAe=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,FAe=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,BAe=`#ifndef FLAT_SHADED
vNormal = normalize( transformedNormal );
#ifdef USE_TANGENT
vTangent = normalize( transformedTangent );
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
#endif
#endif`,GAe=`#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`,zAe=`#ifdef USE_CLEARCOAT
vec3 clearcoatNormal = nonPerturbedNormal;
#endif`,UAe=`#ifdef USE_CLEARCOAT_NORMALMAP
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
clearcoatMapN.xy *= clearcoatNormalScale;
clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,VAe=`#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`,HAe=`#ifdef USE_IRIDESCENCEMAP
uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
uniform sampler2D iridescenceThicknessMap;
#endif`,WAe=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,$Ae=`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 );
}`,jAe=`#ifdef PREMULTIPLIED_ALPHA
gl_FragColor.rgb *= gl_FragColor.a;
#endif`,qAe=`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;`,XAe=`#ifdef DITHERING
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,YAe=`#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`,KAe=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
roughnessFactor *= texelRoughness.g;
#endif`,ZAe=`#ifdef USE_ROUGHNESSMAP
uniform sampler2D roughnessMap;
#endif`,QAe=`#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`,JAe=`#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`,eMe=`#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`,tMe=`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;
}`,nMe=`#ifdef USE_SKINNING
mat4 boneMatX = getBoneMatrix( skinIndex.x );
mat4 boneMatY = getBoneMatrix( skinIndex.y );
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,rMe=`#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`,iMe=`#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`,aMe=`#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`,sMe=`float specularStrength;
#ifdef USE_SPECULARMAP
vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
specularStrength = texelSpecular.r;
#else
specularStrength = 1.0;
#endif`,oMe=`#ifdef USE_SPECULARMAP
uniform sampler2D specularMap;
#endif`,lMe=`#if defined( TONE_MAPPING )
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,uMe=`#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; }`,cMe=`#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`,hMe=`#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`,fMe=`#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`,dMe=`#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`,pMe=`#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`,vMe=`#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 gMe=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,mMe=`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 <tonemapping_fragment>
#include <colorspace_fragment>
}`,yMe=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
gl_Position.z = gl_Position.w;
}`,_Me=`#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 <cube_uv_reflection_fragment>
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 <tonemapping_fragment>
#include <colorspace_fragment>
}`,xMe=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
gl_Position.z = gl_Position.w;
}`,bMe=`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 <tonemapping_fragment>
#include <colorspace_fragment>
}`,SMe=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;
void main() {
#include <uv_vertex>
#include <batching_vertex>
#include <skinbase_vertex>
#ifdef USE_DISPLACEMENTMAP
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vHighPrecisionZW = gl_Position.zw;
}`,wMe=`#if DEPTH_PACKING == 3200
uniform float opacity;
#endif
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
vec4 diffuseColor = vec4( 1.0 );
#include <clipping_planes_fragment>
#if DEPTH_PACKING == 3200
diffuseColor.a = opacity;
#endif
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <logdepthbuf_fragment>
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
}`,AMe=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <batching_vertex>
#include <skinbase_vertex>
#ifdef USE_DISPLACEMENTMAP
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <worldpos_vertex>
#include <clipping_planes_vertex>
vWorldPosition = worldPosition.xyz;
}`,MMe=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
vec4 diffuseColor = vec4( 1.0 );
#include <clipping_planes_fragment>
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
float dist = length( vWorldPosition - referencePosition );
dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
dist = saturate( dist );
gl_FragColor = packDepthToRGBA( dist );
}`,TMe=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
}`,CMe=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
gl_FragColor = texture2D( tEquirect, sampleUV );
#include <tonemapping_fragment>
#include <colorspace_fragment>
}`,EMe=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
vLineDistance = scale * lineDistance;
#include <uv_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}`,PMe=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
if ( mod( vLineDistance, totalSize ) > dashSize ) {
discard;
}
vec3 outgoingLight = vec3( 0.0 );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
outgoingLight = diffuseColor.rgb;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}`,LMe=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <worldpos_vertex>
#include <envmap_vertex>
#include <fog_vertex>
}`,RMe=`uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
varying vec3 vNormal;
#endif
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <specularmap_fragment>
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 <aomap_fragment>
reflectedLight.indirectDiffuse *= diffuseColor.rgb;
vec3 outgoingLight = reflectedLight.indirectDiffuse;
#include <envmap_fragment>
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,DMe=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <envmap_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,IMe=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_lambert_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <specularmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_lambert_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
#include <envmap_fragment>
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,NMe=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <displacementmap_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
vViewPosition = - mvPosition.xyz;
}`,kMe=`#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
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 <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,OMe=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
varying vec3 vViewPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
vViewPosition = - mvPosition.xyz;
#endif
}`,FMe=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
varying vec3 vViewPosition;
#endif
#include <packing>
#include <uv_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
#ifdef OPAQUE
gl_FragColor.a = 1.0;
#endif
}`,BMe=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <envmap_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,GMe=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_phong_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <specularmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_phong_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
#include <envmap_fragment>
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,zMe=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
varying vec3 vWorldPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
#ifdef USE_TRANSMISSION
vWorldPosition = worldPosition.xyz;
#endif
}`,UMe=`#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 <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <iridescence_fragment>
#include <cube_uv_reflection_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_physical_pars_fragment>
#include <transmission_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <clearcoat_pars_fragment>
#include <iridescence_pars_fragment>
#include <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <roughnessmap_fragment>
#include <metalnessmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <clearcoat_normal_fragment_begin>
#include <clearcoat_normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_physical_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
#include <transmission_fragment>
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 <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,VMe=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,HMe=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_toon_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_toon_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,WMe=`uniform float size;
uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
#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 <color_vertex>
#include <morphcolor_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <project_vertex>
gl_PointSize = size;
#ifdef USE_SIZEATTENUATION
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
#endif
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <worldpos_vertex>
#include <fog_vertex>
}`,$Me=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
#include <logdepthbuf_fragment>
#include <map_particle_fragment>
#include <color_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
outgoingLight = diffuseColor.rgb;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}`,jMe=`#include <common>
#include <batching_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,qMe=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <logdepthbuf_pars_fragment>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
#include <logdepthbuf_fragment>
gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
}`,XMe=`uniform float rotation;
uniform vec2 center;
#include <common>
#include <uv_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
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 <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}`,YMe=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
outgoingLight = diffuseColor.rgb;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
}`,an={alphahash_fragment:mwe,alphahash_pars_fragment:ywe,alphamap_fragment:_we,alphamap_pars_fragment:xwe,alphatest_fragment:bwe,alphatest_pars_fragment:Swe,aomap_fragment:wwe,aomap_pars_fragment:Awe,batching_pars_vertex:Mwe,batching_vertex:Twe,begin_vertex:Cwe,beginnormal_vertex:Ewe,bsdfs:Pwe,iridescence_fragment:Lwe,bumpmap_pars_fragment:Rwe,clipping_planes_fragment:Dwe,clipping_planes_pars_fragment:Iwe,clipping_planes_pars_vertex:Nwe,clipping_planes_vertex:kwe,color_fragment:Owe,color_pars_fragment:Fwe,color_pars_vertex:Bwe,color_vertex:Gwe,common:zwe,cube_uv_reflection_fragment:Uwe,defaultnormal_vertex:Vwe,displacementmap_pars_vertex:Hwe,displacementmap_vertex:Wwe,emissivemap_fragment:$we,emissivemap_pars_fragment:jwe,colorspace_fragment:qwe,colorspace_pars_fragment:Xwe,envmap_fragment:Ywe,envmap_common_pars_fragment:Kwe,envmap_pars_fragment:Zwe,envmap_pars_vertex:Qwe,envmap_physical_pars_fragment:cAe,envmap_vertex:Jwe,fog_vertex:eAe,fog_pars_vertex:tAe,fog_fragment:nAe,fog_pars_fragment:rAe,gradientmap_pars_fragment:iAe,lightmap_fragment:aAe,lightmap_pars_fragment:sAe,lights_lambert_fragment:oAe,lights_lambert_pars_fragment:lAe,lights_pars_begin:uAe,lights_toon_fragment:hAe,lights_toon_pars_fragment:fAe,lights_phong_fragment:dAe,lights_phong_pars_fragment:pAe,lights_physical_fragment:vAe,lights_physical_pars_fragment:gAe,lights_fragment_begin:mAe,lights_fragment_maps:yAe,lights_fragment_end:_Ae,logdepthbuf_fragment:xAe,logdepthbuf_pars_fragment:bAe,logdepthbuf_pars_vertex:SAe,logdepthbuf_vertex:wAe,map_fragment:AAe,map_pars_fragment:MAe,map_particle_fragment:TAe,map_particle_pars_fragment:CAe,metalnessmap_fragment:EAe,metalnessmap_pars_fragment:PAe,morphcolor_vertex:LAe,morphnormal_vertex:RAe,morphtarget_pars_vertex:DAe,morphtarget_vertex:IAe,normal_fragment_begin:NAe,normal_fragment_maps:kAe,normal_pars_fragment:OAe,normal_pars_vertex:FAe,normal_vertex:BAe,normalmap_pars_fragment:GAe,clearcoat_normal_fragment_begin:zAe,clearcoat_normal_fragment_maps:UAe,clearcoat_pars_fragment:VAe,iridescence_pars_fragment:HAe,opaque_fragment:WAe,packing:$Ae,premultiplied_alpha_fragment:jAe,project_vertex:qAe,dithering_fragment:XAe,dithering_pars_fragment:YAe,roughnessmap_fragment:KAe,roughnessmap_pars_fragment:ZAe,shadowmap_pars_fragment:QAe,shadowmap_pars_vertex:JAe,shadowmap_vertex:eMe,shadowmask_pars_fragment:tMe,skinbase_vertex:nMe,skinning_pars_vertex:rMe,skinning_vertex:iMe,skinnormal_vertex:aMe,specularmap_fragment:sMe,specularmap_pars_fragment:oMe,tonemapping_fragment:lMe,tonemapping_pars_fragment:uMe,transmission_fragment:cMe,transmission_pars_fragment:hMe,uv_pars_fragment:fMe,uv_pars_vertex:dMe,uv_vertex:pMe,worldpos_vertex:vMe,background_vert:gMe,background_frag:mMe,backgroundCube_vert:yMe,backgroundCube_frag:_Me,cube_vert:xMe,cube_frag:bMe,depth_vert:SMe,depth_frag:wMe,distanceRGBA_vert:AMe,distanceRGBA_frag:MMe,equirect_vert:TMe,equirect_frag:CMe,linedashed_vert:EMe,linedashed_frag:PMe,meshbasic_vert:LMe,meshbasic_frag:RMe,meshlambert_vert:DMe,meshlambert_frag:IMe,meshmatcap_vert:NMe,meshmatcap_frag:kMe,meshnormal_vert:OMe,meshnormal_frag:FMe,meshphong_vert:BMe,meshphong_frag:GMe,meshphysical_vert:zMe,meshphysical_frag:UMe,meshtoon_vert:VMe,meshtoon_frag:HMe,points_vert:WMe,points_frag:$Me,shadow_vert:jMe,shadow_frag:qMe,sprite_vert:XMe,sprite_frag:YMe},rt={common:{diffuse:{value:new xt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new fn},alphaMap:{value:null},alphaMapTransform:{value:new fn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new fn}},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 fn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new fn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new fn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new fn},normalScale:{value:new Ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new fn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new fn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new fn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new fn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new xt(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 xt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new fn},alphaTest:{value:0},uvTransform:{value:new fn}},sprite:{diffuse:{value:new xt(16777215)},opacity:{value:1},center:{value:new Ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new fn},alphaMap:{value:null},alphaMapTransform:{value:new fn},alphaTest:{value:0}}},ga={basic:{uniforms:Zi([rt.common,rt.specularmap,rt.envmap,rt.aomap,rt.lightmap,rt.fog]),vertexShader:an.meshbasic_vert,fragmentShader:an.meshbasic_frag},lambert:{uniforms:Zi([rt.common,rt.specularmap,rt.envmap,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.fog,rt.lights,{emissive:{value:new xt(0)}}]),vertexShader:an.meshlambert_vert,fragmentShader:an.meshlambert_frag},phong:{uniforms:Zi([rt.common,rt.specularmap,rt.envmap,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.fog,rt.lights,{emissive:{value:new xt(0)},specular:{value:new xt(1118481)},shininess:{value:30}}]),vertexShader:an.meshphong_vert,fragmentShader:an.meshphong_frag},standard:{uniforms:Zi([rt.common,rt.envmap,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.roughnessmap,rt.metalnessmap,rt.fog,rt.lights,{emissive:{value:new xt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:an.meshphysical_vert,fragmentShader:an.meshphysical_frag},toon:{uniforms:Zi([rt.common,rt.aomap,rt.lightmap,rt.emissivemap,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.gradientmap,rt.fog,rt.lights,{emissive:{value:new xt(0)}}]),vertexShader:an.meshtoon_vert,fragmentShader:an.meshtoon_frag},matcap:{uniforms:Zi([rt.common,rt.bumpmap,rt.normalmap,rt.displacementmap,rt.fog,{matcap:{value:null}}]),vertexShader:an.meshmatcap_vert,fragmentShader:an.meshmatcap_frag},points:{uniforms:Zi([rt.points,rt.fog]),vertexShader:an.points_vert,fragmentShader:an.points_frag},dashed:{uniforms:Zi([rt.common,rt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:an.linedashed_vert,fragmentShader:an.linedashed_frag},depth:{uniforms:Zi([rt.common,rt.displacementmap]),vertexShader:an.depth_vert,fragmentShader:an.depth_frag},normal:{uniforms:Zi([rt.common,rt.bumpmap,rt.normalmap,rt.displacementmap,{opacity:{value:1}}]),vertexShader:an.meshnormal_vert,fragmentShader:an.meshnormal_frag},sprite:{uniforms:Zi([rt.sprite,rt.fog]),vertexShader:an.sprite_vert,fragmentShader:an.sprite_frag},background:{uniforms:{uvTransform:{value:new fn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:an.background_vert,fragmentShader:an.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:an.backgroundCube_vert,fragmentShader:an.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:an.cube_vert,fragmentShader:an.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:an.equirect_vert,fragmentShader:an.equirect_frag},distanceRGBA:{uniforms:Zi([rt.common,rt.displacementmap,{referencePosition:{value:new te},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:an.distanceRGBA_vert,fragmentShader:an.distanceRGBA_frag},shadow:{uniforms:Zi([rt.lights,rt.fog,{color:{value:new xt(0)},opacity:{value:1}}]),vertexShader:an.shadow_vert,fragmentShader:an.shadow_frag}};ga.physical={uniforms:Zi([ga.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new fn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new fn},clearcoatNormalScale:{value:new Ge(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new fn},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new fn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new fn},sheen:{value:0},sheenColor:{value:new xt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new fn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new fn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new fn},transmissionSamplerSize:{value:new Ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new fn},attenuationDistance:{value:0},attenuationColor:{value:new xt(0)},specularColor:{value:new xt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new fn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new fn},anisotropyVector:{value:new Ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new fn}}]),vertexShader:an.meshphysical_vert,fragmentShader:an.meshphysical_frag};const z_={r:0,b:0,g:0};function KMe(n,e,t,r,i,a,s){const o=new xt(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(o,l):_&&_.isColor&&(g(_,1),y=!0);const x=n.xr.getEnvironmentBlendMode();x==="additive"?r.buffers.color.setClear(0,0,0,1,s):x==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,s),(n.autoClear||y)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),_&&(_.isCubeTexture||_.mapping===DS)?(c===void 0&&(c=new An(new lv(1,1,1),new jl({name:"BackgroundCubeMaterial",uniforms:kp(ga.backgroundCube.uniforms),vertexShader:ga.backgroundCube.vertexShader,fragmentShader:ga.backgroundCube.fragmentShader,side:Ta,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(b,S,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=Bn.getTransfer(_.colorSpace)!==sr,(h!==_||f!==_.version||d!==n.toneMapping)&&(c.material.needsUpdate=!0,h=_,f=_.version,d=n.toneMapping),c.layers.enableAll(),v.unshift(c,c.geometry,c.material,0,0,null)):_&&_.isTexture&&(u===void 0&&(u=new An(new Ss(2,2),new jl({name:"BackgroundMaterial",uniforms:kp(ga.background.uniforms),vertexShader:ga.background.vertexShader,fragmentShader:ga.background.fragmentShader,side:$l,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=Bn.getTransfer(_.colorSpace)!==sr,_.matrixAutoUpdate===!0&&_.updateMatrix(),u.material.uniforms.uvTransform.value.copy(_.matrix),(h!==_||f!==_.version||d!==n.toneMapping)&&(u.material.needsUpdate=!0,h=_,f=_.version,d=n.toneMapping),u.layers.enableAll(),v.unshift(u,u.geometry,u.material,0,0,null))}function g(v,m){v.getRGB(z_,lj(n)),r.buffers.color.setClear(z_.r,z_.g,z_.b,m,s)}return{getClearColor:function(){return o},setClearColor:function(v,m=1){o.set(v),l=m,g(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(v){l=v,g(o,l)},render:p}}function ZMe(n,e,t,r){const i=n.getParameter(n.MAX_VERTEX_ATTRIBS),a=r.isWebGL2?null:e.get("OES_vertex_array_object"),s=r.isWebGL2||a!==null,o={},l=v(null);let u=l,c=!1;function h(L,R,N,F,O){let H=!1;if(s){const U=g(F,N,R);u!==U&&(u=U,d(u.object)),H=m(L,F,N,O),H&&y(L,F,N,O)}else{const U=R.wireframe===!0;(u.geometry!==F.id||u.program!==N.id||u.wireframe!==U)&&(u.geometry=F.id,u.program=N.id,u.wireframe=U,H=!0)}O!==null&&t.update(O,n.ELEMENT_ARRAY_BUFFER),(H||c)&&(c=!1,T(L,R,N,F),O!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(O).buffer))}function f(){return r.isWebGL2?n.createVertexArray():a.createVertexArrayOES()}function d(L){return r.isWebGL2?n.bindVertexArray(L):a.bindVertexArrayOES(L)}function p(L){return r.isWebGL2?n.deleteVertexArray(L):a.deleteVertexArrayOES(L)}function g(L,R,N){const F=N.wireframe===!0;let O=o[L.id];O===void 0&&(O={},o[L.id]=O);let H=O[R.id];H===void 0&&(H={},O[R.id]=H);let U=H[F];return U===void 0&&(U=v(f()),H[F]=U),U}function v(L){const R=[],N=[],F=[];for(let O=0;O<i;O++)R[O]=0,N[O]=0,F[O]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:N,attributeDivisors:F,object:L,attributes:{},index:null}}function m(L,R,N,F){const O=u.attributes,H=R.attributes;let U=0;const $=N.getAttributes();for(const Y in $)if($[Y].location>=0){const X=O[Y];let re=H[Y];if(re===void 0&&(Y==="instanceMatrix"&&L.instanceMatrix&&(re=L.instanceMatrix),Y==="instanceColor"&&L.instanceColor&&(re=L.instanceColor)),X===void 0||X.attribute!==re||re&&X.data!==re.data)return!0;U++}return u.attributesNum!==U||u.index!==F}function y(L,R,N,F){const O={},H=R.attributes;let U=0;const $=N.getAttributes();for(const Y in $)if($[Y].location>=0){let X=H[Y];X===void 0&&(Y==="instanceMatrix"&&L.instanceMatrix&&(X=L.instanceMatrix),Y==="instanceColor"&&L.instanceColor&&(X=L.instanceColor));const re={};re.attribute=X,X&&X.data&&(re.data=X.data),O[Y]=re,U++}u.attributes=O,u.attributesNum=U,u.index=F}function _(){const L=u.newAttributes;for(let R=0,N=L.length;R<N;R++)L[R]=0}function x(L){b(L,0)}function b(L,R){const N=u.newAttributes,F=u.enabledAttributes,O=u.attributeDivisors;N[L]=1,F[L]===0&&(n.enableVertexAttribArray(L),F[L]=1),O[L]!==R&&((r.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](L,R),O[L]=R)}function S(){const L=u.newAttributes,R=u.enabledAttributes;for(let N=0,F=R.length;N<F;N++)R[N]!==L[N]&&(n.disableVertexAttribArray(N),R[N]=0)}function w(L,R,N,F,O,H,U){U===!0?n.vertexAttribIPointer(L,R,N,O,H):n.vertexAttribPointer(L,R,N,F,O,H)}function T(L,R,N,F){if(r.isWebGL2===!1&&(L.isInstancedMesh||F.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;_();const O=F.attributes,H=N.getAttributes(),U=R.defaultAttributeValues;for(const $ in H){const Y=H[$];if(Y.location>=0){let oe=O[$];if(oe===void 0&&($==="instanceMatrix"&&L.instanceMatrix&&(oe=L.instanceMatrix),$==="instanceColor"&&L.instanceColor&&(oe=L.instanceColor)),oe!==void 0){const X=oe.normalized,re=oe.itemSize,_e=t.get(oe);if(_e===void 0)continue;const Fe=_e.buffer,Ce=_e.type,Ae=_e.bytesPerElement,ze=r.isWebGL2===!0&&(Ce===n.INT||Ce===n.UNSIGNED_INT||oe.gpuType===$$);if(oe.isInterleavedBufferAttribute){const fe=oe.data,j=fe.stride,xe=oe.offset;if(fe.isInstancedInterleavedBuffer){for(let pe=0;pe<Y.locationSize;pe++)b(Y.location+pe,fe.meshPerAttribute);L.isInstancedMesh!==!0&&F._maxInstanceCount===void 0&&(F._maxInstanceCount=fe.meshPerAttribute*fe.count)}else for(let pe=0;pe<Y.locationSize;pe++)x(Y.location+pe);n.bindBuffer(n.ARRAY_BUFFER,Fe);for(let pe=0;pe<Y.locationSize;pe++)w(Y.location+pe,re/Y.locationSize,Ce,X,j*Ae,(xe+re/Y.locationSize*pe)*Ae,ze)}else{if(oe.isInstancedBufferAttribute){for(let fe=0;fe<Y.locationSize;fe++)b(Y.location+fe,oe.meshPerAttribute);L.isInstancedMesh!==!0&&F._maxInstanceCount===void 0&&(F._maxInstanceCount=oe.meshPerAttribute*oe.count)}else for(let fe=0;fe<Y.locationSize;fe++)x(Y.location+fe);n.bindBuffer(n.ARRAY_BUFFER,Fe);for(let fe=0;fe<Y.locationSize;fe++)w(Y.location+fe,re/Y.locationSize,Ce,X,re*Ae,re/Y.locationSize*fe*Ae,ze)}}else if(U!==void 0){const X=U[$];if(X!==void 0)switch(X.length){case 2:n.vertexAttrib2fv(Y.location,X);break;case 3:n.vertexAttrib3fv(Y.location,X);break;case 4:n.vertexAttrib4fv(Y.location,X);break;default:n.vertexAttrib1fv(Y.location,X)}}}}S()}function C(){P();for(const L in o){const R=o[L];for(const N in R){const F=R[N];for(const O in F)p(F[O].object),delete F[O];delete R[N]}delete o[L]}}function A(L){if(o[L.id]===void 0)return;const R=o[L.id];for(const N in R){const F=R[N];for(const O in F)p(F[O].object),delete F[O];delete R[N]}delete o[L.id]}function M(L){for(const R in o){const N=o[R];if(N[L.id]===void 0)continue;const F=N[L.id];for(const O in F)p(F[O].object),delete F[O];delete N[L.id]}}function P(){D(),c=!0,u!==l&&(u=l,d(u.object))}function D(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:h,reset:P,resetDefaultState:D,dispose:C,releaseStatesOfGeometry:A,releaseStatesOfProgram:M,initAttributes:_,enableAttribute:x,disableUnusedAttributes:S}}function QMe(n,e,t,r){const i=r.isWebGL2;let a;function s(c){a=c}function o(c,h){n.drawArrays(a,c,h),t.update(h,a,1)}function l(c,h,f){if(f===0)return;let d,p;if(i)d=n,p="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),p="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[p](a,c,h,f),t.update(h,a,f)}function u(c,h,f){if(f===0)return;const d=e.get("WEBGL_multi_draw");if(d===null)for(let p=0;p<f;p++)this.render(c[p],h[p]);else{d.multiDrawArraysWEBGL(a,c,0,h,0,f);let p=0;for(let g=0;g<f;g++)p+=h[g];t.update(p,a,1)}}this.setMode=s,this.render=o,this.renderInstances=l,this.renderMultiDraw=u}function JMe(n,e,t){let r;function i(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const w=e.get("EXT_texture_filter_anisotropic");r=n.getParameter(w.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function a(w){if(w==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext!="undefined"&&n.constructor.name==="WebGL2RenderingContext";let o=t.precision!==void 0?t.precision:"highp";const l=a(o);l!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",l,"instead."),o=l);const u=s||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=n.getParameter(n.MAX_TEXTURE_SIZE),p=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),g=n.getParameter(n.MAX_VERTEX_ATTRIBS),v=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),m=n.getParameter(n.MAX_VARYING_VECTORS),y=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),_=f>0,x=s||e.has("OES_texture_float"),b=_&&x,S=s?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:s,drawBuffers:u,getMaxAnisotropy:i,getMaxPrecision:a,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:f,maxTextureSize:d,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:v,maxVaryings:m,maxFragmentUniforms:y,vertexTextures:_,floatFragmentTextures:x,floatVertexTextures:b,maxSamples:S}}function e2e(n){const e=this;let t=null,r=0,i=!1,a=!1;const s=new Tu,o=new fn,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||r!==0||i;return i=f,r=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=n.get(h);if(!i||p===null||p.length===0||a&&!v)a?c(null):u();else{const y=a?0:r,_=y*4;let x=m.clippingState||null;l.value=x,x=c(p,f,_,d);for(let b=0;b!==_;++b)x[b]=t[b];m.clippingState=x,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=y}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=r>0),e.numPlanes=r,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;o.getNormalMatrix(y),(v===null||v.length<m)&&(v=new Float32Array(m));for(let _=0,x=d;_!==g;++_,x+=4)s.copy(h[_]).applyMatrix4(y,o),s.normal.toArray(v,x),v[x+3]=s.constant}l.value=v,l.needsUpdate=!0}return e.numPlanes=g,e.numIntersection=0,v}}function t2e(n){let e=new WeakMap;function t(s,o){return o===cE?s.mapping=Lp:o===hE&&(s.mapping=Rp),s}function r(s){if(s&&s.isTexture){const o=s.mapping;if(o===cE||o===hE)if(e.has(s)){const l=e.get(s).texture;return t(l,s.mapping)}else{const l=s.image;if(l&&l.height>0){const u=new dwe(l.height);return u.fromEquirectangularTexture(n,s),e.set(s,u),s.addEventListener("dispose",i),t(u.texture,s.mapping)}else return null}}return s}function i(s){const o=s.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function a(){e=new WeakMap}return{get:r,dispose:a}}class kS extends uj{constructor(e=-1,t=1,r=1,i=-1,a=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=i,this.near=a,this.far=s,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,r,i,a,s){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=r,this.view.offsetY=i,this.view.width=a,this.view.height=s,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),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let a=r-e,s=r+e,o=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,s=a+u*this.view.width,o-=c*this.view.offsetY,l=o-c*this.view.height}this.projectionMatrix.makeOrthographic(a,s,o,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 Vd=4,U8=[.125,.215,.35,.446,.526,.582],Mh=20,b2=new kS,V8=new xt;let S2=null,w2=0,A2=0;const gh=(1+Math.sqrt(5))/2,xd=1/gh,H8=[new te(1,1,1),new te(-1,1,1),new te(1,1,-1),new te(-1,1,-1),new te(0,gh,xd),new te(0,gh,-xd),new te(xd,0,gh),new te(-xd,0,gh),new te(gh,xd,0),new te(-gh,xd,0)];class W8{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,r=.1,i=100){S2=this._renderer.getRenderTarget(),w2=this._renderer.getActiveCubeFace(),A2=this._renderer.getActiveMipmapLevel(),this._setSize(256);const a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,r,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=q8(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=j8(),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;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(S2,w2,A2),e.scissorTest=!1,U_(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Lp||e.mapping===Rp?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),S2=this._renderer.getRenderTarget(),w2=this._renderer.getActiveCubeFace(),A2=this._renderer.getActiveMipmapLevel();const r=t||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,r={magFilter:jr,minFilter:jr,generateMipmaps:!1,type:l0,format:Cs,colorSpace:ai,depthBuffer:!1},i=$8(e,t,r);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=$8(e,t,r);const{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=n2e(a)),this._blurMaterial=r2e(a,e,t)}return i}_compileMaterial(e){const t=new An(this._lodPlanes[0],e);this._renderer.compile(t,b2)}_sceneToCubeUV(e,t,r,i){const o=new Gi(90,1,t,r),l=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],c=this._renderer,h=c.autoClear,f=c.toneMapping;c.getClearColor(V8),c.toneMapping=nc,c.autoClear=!1;const d=new Nn({name:"PMREM.Background",side:Ta,depthWrite:!1,depthTest:!1}),p=new An(new lv,d);let g=!1;const v=e.background;v?v.isColor&&(d.color.copy(v),e.background=null,g=!0):(d.color.copy(V8),g=!0);for(let m=0;m<6;m++){const y=m%3;y===0?(o.up.set(0,l[m],0),o.lookAt(u[m],0,0)):y===1?(o.up.set(0,0,l[m]),o.lookAt(0,u[m],0)):(o.up.set(0,l[m],0),o.lookAt(0,0,u[m]));const _=this._cubeSize;U_(i,y*_,m>2?_:0,_,_),c.setRenderTarget(i),g&&c.render(p,o),c.render(e,o)}p.geometry.dispose(),p.material.dispose(),c.toneMapping=f,c.autoClear=h,e.background=v}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===Lp||e.mapping===Rp;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=q8()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=j8());const a=i?this._cubemapMaterial:this._equirectMaterial,s=new An(this._lodPlanes[0],a),o=a.uniforms;o.envMap.value=e;const l=this._cubeSize;U_(t,0,0,3*l,2*l),r.setRenderTarget(t),r.render(s,b2)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const a=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),s=H8[(i-1)%H8.length];this._blur(e,i-1,i,a,s)}t.autoClear=r}_blur(e,t,r,i,a){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,r,i,"latitudinal",a),this._halfBlur(s,e,r,r,i,"longitudinal",a)}_halfBlur(e,t,r,i,a,s,o){const l=this._renderer,u=this._blurMaterial;s!=="latitudinal"&&s!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const c=3,h=new An(this._lodPlanes[i],u),f=u.uniforms,d=this._sizeLods[r]-1,p=isFinite(a)?Math.PI/(2*d):2*Math.PI/(2*Mh-1),g=a/p,v=isFinite(a)?1+Math.floor(c*g):Mh;v>Mh&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${Mh}`);const m=[];let y=0;for(let w=0;w<Mh;++w){const T=w/g,C=Math.exp(-T*T/2);m.push(C),w===0?y+=C:w<v&&(y+=2*C)}for(let w=0;w<m.length;w++)m[w]=m[w]/y;f.envMap.value=e.texture,f.samples.value=v,f.weights.value=m,f.latitudinal.value=s==="latitudinal",o&&(f.poleAxis.value=o);const{_lodMax:_}=this;f.dTheta.value=p,f.mipInt.value=_-r;const x=this._sizeLods[i],b=3*x*(i>_-Vd?i-_+Vd:0),S=4*(this._cubeSize-x);U_(t,b,S,3*x,2*x),l.setRenderTarget(t),l.render(h,b2)}}function n2e(n){const e=[],t=[],r=[];let i=n;const a=n-Vd+1+U8.length;for(let s=0;s<a;s++){const o=Math.pow(2,i);t.push(o);let l=1/o;s>n-Vd?l=U8[s-n+Vd-1]:s===0&&(l=0),r.push(l);const u=1/(o-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 S=0;S<d;S++){const w=S%3*2/3-1,T=S>2?0:-1,C=[w,T,0,w+2/3,T,0,w+2/3,T+1,0,w,T,0,w+2/3,T+1,0,w,T+1,0];y.set(C,g*p*S),_.set(f,v*p*S);const A=[S,S,S,S,S,S];x.set(A,m*p*S)}const b=new qn;b.setAttribute("position",new br(y,g)),b.setAttribute("uv",new br(_,v)),b.setAttribute("faceIndex",new br(x,m)),e.push(b),i>Vd&&i--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function $8(n,e,t){const r=new pf(n,e,t);return r.texture.mapping=DS,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function U_(n,e,t,r,i){n.viewport.set(e,t,r,i),n.scissor.set(e,t,r,i)}function r2e(n,e,t){const r=new Float32Array(Mh),i=new te(0,1,0);return new jl({name:"SphericalGaussianBlur",defines:{n:Mh,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:kR(),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 <cube_uv_reflection_fragment>
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:tc,depthTest:!1,depthWrite:!1})}function j8(){return new jl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:kR(),fragmentShader:`
precision mediump float;
precision mediump int;
varying vec3 vOutputDirection;
uniform sampler2D envMap;
#include <common>
void main() {
vec3 outputDirection = normalize( vOutputDirection );
vec2 uv = equirectUv( outputDirection );
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
}
`,blending:tc,depthTest:!1,depthWrite:!1})}function q8(){return new jl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:kR(),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:tc,depthTest:!1,depthWrite:!1})}function kR(){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 i2e(n){let e=new WeakMap,t=null;function r(o){if(o&&o.isTexture){const l=o.mapping,u=l===cE||l===hE,c=l===Lp||l===Rp;if(u||c)if(o.isRenderTargetTexture&&o.needsPMREMUpdate===!0){o.needsPMREMUpdate=!1;let h=e.get(o);return t===null&&(t=new W8(n)),h=u?t.fromEquirectangular(o,h):t.fromCubemap(o,h),e.set(o,h),h.texture}else{if(e.has(o))return e.get(o).texture;{const h=o.image;if(u&&h&&h.height>0||c&&h&&i(h)){t===null&&(t=new W8(n));const f=u?t.fromEquirectangular(o):t.fromCubemap(o);return e.set(o,f),o.addEventListener("dispose",a),f.texture}else return null}}}return o}function i(o){let l=0;const u=6;for(let c=0;c<u;c++)o[c]!==void 0&&l++;return l===u}function a(o){const l=o.target;l.removeEventListener("dispose",a);const u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function s(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:r,dispose:s}}function a2e(n){const e={};function t(r){if(e[r]!==void 0)return e[r];let i;switch(r){case"WEBGL_depth_texture":i=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=n.getExtension(r)}return e[r]=i,i}return{has:function(r){return t(r)!==null},init:function(r){r.isWebGL2?(t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance")):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(r){const i=t(r);return i===null&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),i}}}function s2e(n,e,t,r){const i={},a=new WeakMap;function s(h){const f=h.target;f.index!==null&&e.remove(f.index);for(const p in f.attributes)e.remove(f.attributes[p]);for(const p in f.morphAttributes){const g=f.morphAttributes[p];for(let v=0,m=g.length;v<m;v++)e.remove(g[v])}f.removeEventListener("dispose",s),delete i[f.id];const d=a.get(f);d&&(e.remove(d),a.delete(f)),r.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,t.memory.geometries--}function o(h,f){return i[f.id]===!0||(f.addEventListener("dispose",s),i[f.id]=!0,t.memory.geometries++),f}function l(h){const f=h.attributes;for(const p in f)e.update(f[p],n.ARRAY_BUFFER);const d=h.morphAttributes;for(const p in d){const g=d[p];for(let v=0,m=g.length;v<m;v++)e.update(g[v],n.ARRAY_BUFFER)}}function u(h){const f=[],d=h.index,p=h.attributes.position;let g=0;if(d!==null){const y=d.array;g=d.version;for(let _=0,x=y.length;_<x;_+=3){const b=y[_+0],S=y[_+1],w=y[_+2];f.push(b,S,S,w,w,b)}}else if(p!==void 0){const y=p.array;g=p.version;for(let _=0,x=y.length/3-1;_<x;_+=3){const b=_+0,S=_+1,w=_+2;f.push(b,S,S,w,w,b)}}else return;const v=new(tj(f)?oj:sj)(f,1);v.version=g;const m=a.get(h);m&&e.remove(m),a.set(h,v)}function c(h){const f=a.get(h);if(f){const d=h.index;d!==null&&f.version<d.version&&u(h)}else u(h);return a.get(h)}return{get:o,update:l,getWireframeAttribute:c}}function o2e(n,e,t,r){const i=r.isWebGL2;let a;function s(d){a=d}let o,l;function u(d){o=d.type,l=d.bytesPerElement}function c(d,p){n.drawElements(a,p,o,d*l),t.update(p,a,1)}function h(d,p,g){if(g===0)return;let v,m;if(i)v=n,m="drawElementsInstanced";else if(v=e.get("ANGLE_instanced_arrays"),m="drawElementsInstancedANGLE",v===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}v[m](a,p,o,d*l,g),t.update(p,a,g)}function f(d,p,g){if(g===0)return;const v=e.get("WEBGL_multi_draw");if(v===null)for(let m=0;m<g;m++)this.render(d[m]/l,p[m]);else{v.multiDrawElementsWEBGL(a,p,0,o,d,0,g);let m=0;for(let y=0;y<g;y++)m+=p[y];t.update(m,a,1)}}this.setMode=s,this.setIndex=u,this.render=c,this.renderInstances=h,this.renderMultiDraw=f}function l2e(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function r(a,s,o){switch(t.calls++,s){case n.TRIANGLES:t.triangles+=o*(a/3);break;case n.LINES:t.lines+=o*(a/2);break;case n.LINE_STRIP:t.lines+=o*(a-1);break;case n.LINE_LOOP:t.lines+=o*a;break;case n.POINTS:t.points+=o*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",s);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:r}}function u2e(n,e){return n[0]-e[0]}function c2e(n,e){return Math.abs(e[1])-Math.abs(n[1])}function h2e(n,e,t){const r={},i=new Float32Array(8),a=new WeakMap,s=new En,o=[];for(let u=0;u<8;u++)o[u]=[u,0];function l(u,c,h){const f=u.morphTargetInfluences;if(e.isWebGL2===!0){const d=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,p=d!==void 0?d.length:0;let g=a.get(c);if(g===void 0||g.count!==p){let L=function(){P.dispose(),a.delete(c),c.removeEventListener("dispose",L)};g!==void 0&&g.texture.dispose();const y=c.morphAttributes.position!==void 0,_=c.morphAttributes.normal!==void 0,x=c.morphAttributes.color!==void 0,b=c.morphAttributes.position||[],S=c.morphAttributes.normal||[],w=c.morphAttributes.color||[];let T=0;y===!0&&(T=1),_===!0&&(T=2),x===!0&&(T=3);let C=c.attributes.position.count*T,A=1;C>e.maxTextureSize&&(A=Math.ceil(C/e.maxTextureSize),C=e.maxTextureSize);const M=new Float32Array(C*A*4*p),P=new ij(M,C,A,p);P.type=ko,P.needsUpdate=!0;const D=T*4;for(let R=0;R<p;R++){const N=b[R],F=S[R],O=w[R],H=C*A*4*R;for(let U=0;U<N.count;U++){const $=U*D;y===!0&&(s.fromBufferAttribute(N,U),M[H+$+0]=s.x,M[H+$+1]=s.y,M[H+$+2]=s.z,M[H+$+3]=0),_===!0&&(s.fromBufferAttribute(F,U),M[H+$+4]=s.x,M[H+$+5]=s.y,M[H+$+6]=s.z,M[H+$+7]=0),x===!0&&(s.fromBufferAttribute(O,U),M[H+$+8]=s.x,M[H+$+9]=s.y,M[H+$+10]=s.z,M[H+$+11]=O.itemSize===4?s.w:1)}}g={count:p,texture:P,size:new Ge(C,A)},a.set(c,g),c.addEventListener("dispose",L)}let v=0;for(let y=0;y<f.length;y++)v+=f[y];const m=c.morphTargetsRelative?1:1-v;h.getUniforms().setValue(n,"morphTargetBaseInfluence",m),h.getUniforms().setValue(n,"morphTargetInfluences",f),h.getUniforms().setValue(n,"morphTargetsTexture",g.texture,t),h.getUniforms().setValue(n,"morphTargetsTextureSize",g.size)}else{const d=f===void 0?0:f.length;let p=r[c.id];if(p===void 0||p.length!==d){p=[];for(let _=0;_<d;_++)p[_]=[_,0];r[c.id]=p}for(let _=0;_<d;_++){const x=p[_];x[0]=_,x[1]=f[_]}p.sort(c2e);for(let _=0;_<8;_++)_<d&&p[_][1]?(o[_][0]=p[_][0],o[_][1]=p[_][1]):(o[_][0]=Number.MAX_SAFE_INTEGER,o[_][1]=0);o.sort(u2e);const g=c.morphAttributes.position,v=c.morphAttributes.normal;let m=0;for(let _=0;_<8;_++){const x=o[_],b=x[0],S=x[1];b!==Number.MAX_SAFE_INTEGER&&S?(g&&c.getAttribute("morphTarget"+_)!==g[b]&&c.setAttribute("morphTarget"+_,g[b]),v&&c.getAttribute("morphNormal"+_)!==v[b]&&c.setAttribute("morphNormal"+_,v[b]),i[_]=S,m+=S):(g&&c.hasAttribute("morphTarget"+_)===!0&&c.deleteAttribute("morphTarget"+_),v&&c.hasAttribute("morphNormal"+_)===!0&&c.deleteAttribute("morphNormal"+_),i[_]=0)}const y=c.morphTargetsRelative?1:1-m;h.getUniforms().setValue(n,"morphTargetBaseInfluence",y),h.getUniforms().setValue(n,"morphTargetInfluences",i)}}return{update:l}}function f2e(n,e,t,r){let i=new WeakMap;function a(l){const u=r.render.frame,c=l.geometry,h=e.get(l,c);if(i.get(h)!==u&&(e.update(h),i.set(h,u)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),i.get(l)!==u&&(t.update(l.instanceMatrix,n.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,n.ARRAY_BUFFER),i.set(l,u))),l.isSkinnedMesh){const f=l.skeleton;i.get(f)!==u&&(f.update(),i.set(f,u))}return h}function s(){i=new WeakMap}function o(l){const u=l.target;u.removeEventListener("dispose",o),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:a,dispose:s}}class fj extends ni{constructor(e,t,r,i,a,s,o,l,u,c){if(c=c!==void 0?c:ef,c!==ef&&c!==Dp)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&c===ef&&(r=$u),r===void 0&&c===Dp&&(r=Jh),super(null,i,a,s,o,l,c,r,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=o!==void 0?o:Jr,this.minFilter=l!==void 0?l:Jr,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}const dj=new ni,pj=new fj(1,1);pj.compareFunction=ej;const vj=new ij,gj=new ZSe,mj=new cj,X8=[],Y8=[],K8=new Float32Array(16),Z8=new Float32Array(9),Q8=new Float32Array(4);function uv(n,e,t){const r=n[0];if(r<=0||r>0)return n;const i=e*t;let a=X8[i];if(a===void 0&&(a=new Float32Array(i),X8[i]=a),e!==0){r.toArray(a,0);for(let s=1,o=0;s!==e;++s)o+=t,n[s].toArray(a,o)}return a}function si(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t<r;t++)if(n[t]!==e[t])return!1;return!0}function oi(n,e){for(let t=0,r=e.length;t<r;t++)n[t]=e[t]}function OS(n,e){let t=Y8[e];t===void 0&&(t=new Int32Array(e),Y8[e]=t);for(let r=0;r!==e;++r)t[r]=n.allocateTextureUnit();return t}function d2e(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function p2e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(si(t,e))return;n.uniform2fv(this.addr,e),oi(t,e)}}function v2e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(si(t,e))return;n.uniform3fv(this.addr,e),oi(t,e)}}function g2e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(si(t,e))return;n.uniform4fv(this.addr,e),oi(t,e)}}function m2e(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(si(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),oi(t,e)}else{if(si(t,r))return;Q8.set(r),n.uniformMatrix2fv(this.addr,!1,Q8),oi(t,r)}}function y2e(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(si(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),oi(t,e)}else{if(si(t,r))return;Z8.set(r),n.uniformMatrix3fv(this.addr,!1,Z8),oi(t,r)}}function _2e(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(si(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),oi(t,e)}else{if(si(t,r))return;K8.set(r),n.uniformMatrix4fv(this.addr,!1,K8),oi(t,r)}}function x2e(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function b2e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(si(t,e))return;n.uniform2iv(this.addr,e),oi(t,e)}}function S2e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(si(t,e))return;n.uniform3iv(this.addr,e),oi(t,e)}}function w2e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(si(t,e))return;n.uniform4iv(this.addr,e),oi(t,e)}}function A2e(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function M2e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(si(t,e))return;n.uniform2uiv(this.addr,e),oi(t,e)}}function T2e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(si(t,e))return;n.uniform3uiv(this.addr,e),oi(t,e)}}function C2e(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(si(t,e))return;n.uniform4uiv(this.addr,e),oi(t,e)}}function E2e(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i);const a=this.type===n.SAMPLER_2D_SHADOW?pj:dj;t.setTexture2D(e||a,i)}function P2e(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture3D(e||gj,i)}function L2e(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTextureCube(e||mj,i)}function R2e(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture2DArray(e||vj,i)}function D2e(n){switch(n){case 5126:return d2e;case 35664:return p2e;case 35665:return v2e;case 35666:return g2e;case 35674:return m2e;case 35675:return y2e;case 35676:return _2e;case 5124:case 35670:return x2e;case 35667:case 35671:return b2e;case 35668:case 35672:return S2e;case 35669:case 35673:return w2e;case 5125:return A2e;case 36294:return M2e;case 36295:return T2e;case 36296:return C2e;case 35678:case 36198:case 36298:case 36306:case 35682:return E2e;case 35679:case 36299:case 36307:return P2e;case 35680:case 36300:case 36308:case 36293:return L2e;case 36289:case 36303:case 36311:case 36292:return R2e}}function I2e(n,e){n.uniform1fv(this.addr,e)}function N2e(n,e){const t=uv(e,this.size,2);n.uniform2fv(this.addr,t)}function k2e(n,e){const t=uv(e,this.size,3);n.uniform3fv(this.addr,t)}function O2e(n,e){const t=uv(e,this.size,4);n.uniform4fv(this.addr,t)}function F2e(n,e){const t=uv(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function B2e(n,e){const t=uv(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function G2e(n,e){const t=uv(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function z2e(n,e){n.uniform1iv(this.addr,e)}function U2e(n,e){n.uniform2iv(this.addr,e)}function V2e(n,e){n.uniform3iv(this.addr,e)}function H2e(n,e){n.uniform4iv(this.addr,e)}function W2e(n,e){n.uniform1uiv(this.addr,e)}function $2e(n,e){n.uniform2uiv(this.addr,e)}function j2e(n,e){n.uniform3uiv(this.addr,e)}function q2e(n,e){n.uniform4uiv(this.addr,e)}function X2e(n,e,t){const r=this.cache,i=e.length,a=OS(t,i);si(r,a)||(n.uniform1iv(this.addr,a),oi(r,a));for(let s=0;s!==i;++s)t.setTexture2D(e[s]||dj,a[s])}function Y2e(n,e,t){const r=this.cache,i=e.length,a=OS(t,i);si(r,a)||(n.uniform1iv(this.addr,a),oi(r,a));for(let s=0;s!==i;++s)t.setTexture3D(e[s]||gj,a[s])}function K2e(n,e,t){const r=this.cache,i=e.length,a=OS(t,i);si(r,a)||(n.uniform1iv(this.addr,a),oi(r,a));for(let s=0;s!==i;++s)t.setTextureCube(e[s]||mj,a[s])}function Z2e(n,e,t){const r=this.cache,i=e.length,a=OS(t,i);si(r,a)||(n.uniform1iv(this.addr,a),oi(r,a));for(let s=0;s!==i;++s)t.setTexture2DArray(e[s]||vj,a[s])}function Q2e(n){switch(n){case 5126:return I2e;case 35664:return N2e;case 35665:return k2e;case 35666:return O2e;case 35674:return F2e;case 35675:return B2e;case 35676:return G2e;case 5124:case 35670:return z2e;case 35667:case 35671:return U2e;case 35668:case 35672:return V2e;case 35669:case 35673:return H2e;case 5125:return W2e;case 36294:return $2e;case 36295:return j2e;case 36296:return q2e;case 35678:case 36198:case 36298:case 36306:case 35682:return X2e;case 35679:case 36299:case 36307:return Y2e;case 35680:case 36300:case 36308:case 36293:return K2e;case 36289:case 36303:case 36311:case 36292:return Z2e}}class J2e{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.setValue=D2e(t.type)}}class eTe{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=Q2e(t.type)}}class tTe{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,r){const i=this.seq;for(let a=0,s=i.length;a!==s;++a){const o=i[a];o.setValue(e,t[o.id],r)}}}const M2=/(\w+)(\])?(\[|\.)?/g;function J8(n,e){n.seq.push(e),n.map[e.id]=e}function nTe(n,e,t){const r=n.name,i=r.length;for(M2.lastIndex=0;;){const a=M2.exec(r),s=M2.lastIndex;let o=a[1];const l=a[2]==="]",u=a[3];if(l&&(o=o|0),u===void 0||u==="["&&s+2===i){J8(t,u===void 0?new J2e(o,n,e):new eTe(o,n,e));break}else{let h=t.map[o];h===void 0&&(h=new tTe(o),J8(t,h)),t=h}}}class Y1{constructor(e,t){this.seq=[],this.map={};const r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<r;++i){const a=e.getActiveUniform(t,i),s=e.getUniformLocation(t,a.name);nTe(a,s,this)}}setValue(e,t,r,i){const a=this.map[t];a!==void 0&&a.setValue(e,r,i)}setOptional(e,t,r){const i=t[r];i!==void 0&&this.setValue(e,r,i)}static upload(e,t,r,i){for(let a=0,s=t.length;a!==s;++a){const o=t[a],l=r[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,i)}}static seqWithValue(e,t){const r=[];for(let i=0,a=e.length;i!==a;++i){const s=e[i];s.id in t&&r.push(s)}return r}}function e6(n,e,t){const r=n.createShader(e);return n.shaderSource(r,t),n.compileShader(r),r}const rTe=37297;let iTe=0;function aTe(n,e){const t=n.split(`
`),r=[],i=Math.max(e-6,0),a=Math.min(e+6,t.length);for(let s=i;s<a;s++){const o=s+1;r.push(`${o===e?">":" "} ${o}: ${t[s]}`)}return r.join(`
`)}function sTe(n){const e=Bn.getPrimaries(Bn.workingColorSpace),t=Bn.getPrimaries(n);let r;switch(e===t?r="":e===vb&&t===pb?r="LinearDisplayP3ToLinearSRGB":e===pb&&t===vb&&(r="LinearSRGBToLinearDisplayP3"),n){case ai:case IS:return[r,"LinearTransferOETF"];case Vn:case PR:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[r,"LinearTransferOETF"]}}function t6(n,e,t){const r=n.getShaderParameter(e,n.COMPILE_STATUS),i=n.getShaderInfoLog(e).trim();if(r&&i==="")return"";const a=/ERROR: 0:(\d+)/.exec(i);if(a){const s=parseInt(a[1]);return t.toUpperCase()+`
`+i+`
`+aTe(n.getShaderSource(e),s)}else return i}function oTe(n,e){const t=sTe(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function lTe(n,e){let t;switch(e){case aSe:t="Linear";break;case sSe:t="Reinhard";break;case oSe:t="OptimizedCineon";break;case lSe:t="ACESFilmic";break;case cSe:t="AgX";break;case uSe:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function uTe(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.alphaToCoverage||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Hd).join(`
`)}function cTe(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Hd).join(`
`)}function hTe(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join(`
`)}function fTe(n,e){const t={},r=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const a=n.getActiveAttrib(e,i),s=a.name;let o=1;a.type===n.FLOAT_MAT2&&(o=2),a.type===n.FLOAT_MAT3&&(o=3),a.type===n.FLOAT_MAT4&&(o=4),t[s]={type:a.type,location:n.getAttribLocation(e,s),locationSize:o}}return t}function Hd(n){return n!==""}function n6(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function r6(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const dTe=/^[ \t]*#include +<([\w\d./]+)>/gm;function mE(n){return n.replace(dTe,vTe)}const pTe=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function vTe(n,e){let t=an[e];if(t===void 0){const r=pTe.get(e);if(r!==void 0)t=an[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return mE(t)}const gTe=/#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 i6(n){return n.replace(gTe,mTe)}function mTe(n,e,t,r){let i="";for(let a=parseInt(e);a<parseInt(t);a++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function a6(n){let e=`precision ${n.precision} float;
precision ${n.precision} int;
precision ${n.precision} sampler2D;
precision ${n.precision} samplerCube;
`;return n.isWebGL2&&(e+=`precision ${n.precision} sampler3D;
precision ${n.precision} sampler2DArray;
precision ${n.precision} sampler2DShadow;
precision ${n.precision} samplerCubeShadow;
precision ${n.precision} sampler2DArrayShadow;
precision ${n.precision} isampler2D;
precision ${n.precision} isampler3D;
precision ${n.precision} isamplerCube;
precision ${n.precision} isampler2DArray;
precision ${n.precision} usampler2D;
precision ${n.precision} usampler3D;
precision ${n.precision} usamplerCube;
precision ${n.precision} usampler2DArray;
`),n.precision==="highp"?e+=`
#define HIGH_PRECISION`:n.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function yTe(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===z$?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===Obe?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===bl&&(e="SHADOWMAP_TYPE_VSM"),e}function _Te(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Lp:case Rp:e="ENVMAP_TYPE_CUBE";break;case DS:e="ENVMAP_TYPE_CUBE_UV";break}return e}function xTe(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case Rp:e="ENVMAP_MODE_REFRACTION";break}return e}function bTe(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case TR:e="ENVMAP_BLENDING_MULTIPLY";break;case rSe:e="ENVMAP_BLENDING_MIX";break;case iSe:e="ENVMAP_BLENDING_ADD";break}return e}function STe(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:r,maxMip:t}}function wTe(n,e,t,r){const i=n.getContext(),a=t.defines;let s=t.vertexShader,o=t.fragmentShader;const l=yTe(t),u=_Te(t),c=xTe(t),h=bTe(t),f=STe(t),d=t.isWebGL2?"":uTe(t),p=cTe(t),g=hTe(a),v=i.createProgram();let m,y,_=t.glslVersion?"#version "+t.glslVersion+`
`:"";t.isRawShaderMaterial?(m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(Hd).join(`
`),m.length>0&&(m+=`
`),y=[d,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(Hd).join(`
`),y.length>0&&(y+=`
`)):(m=[a6(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(Hd).join(`
`),y=[d,a6(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!==nc?"#define TONE_MAPPING":"",t.toneMapping!==nc?an.tonemapping_pars_fragment:"",t.toneMapping!==nc?lTe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",an.colorspace_pars_fragment,oTe("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
`].filter(Hd).join(`
`)),s=mE(s),s=n6(s,t),s=r6(s,t),o=mE(o),o=n6(o,t),o=r6(o,t),s=i6(s),o=i6(o),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===b8?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===b8?"":"#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+s,b=_+y+o,S=e6(i,i.VERTEX_SHADER,x),w=e6(i,i.FRAGMENT_SHADER,b);i.attachShader(v,S),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 T(P){if(n.debug.checkShaderErrors){const D=i.getProgramInfoLog(v).trim(),L=i.getShaderInfoLog(S).trim(),R=i.getShaderInfoLog(w).trim();let N=!0,F=!0;if(i.getProgramParameter(v,i.LINK_STATUS)===!1)if(N=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(i,v,S,w);else{const O=t6(i,S,"vertex"),H=t6(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+`
`+O+`
`+H)}else D!==""?console.warn("THREE.WebGLProgram: Program Info Log:",D):(L===""||R==="")&&(F=!1);F&&(P.diagnostics={runnable:N,programLog:D,vertexShader:{log:L,prefix:m},fragmentShader:{log:R,prefix:y}})}i.deleteShader(S),i.deleteShader(w),C=new Y1(i,v),A=fTe(i,v)}let C;this.getUniforms=function(){return C===void 0&&T(this),C};let A;this.getAttributes=function(){return A===void 0&&T(this),A};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(v,rTe)),M},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=iTe++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=S,this.fragmentShader=w,this}let ATe=0;class MTe{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),a=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(a)===!1&&(s.add(a),a.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.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 r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new TTe(e),t.set(e,r)),r}}class TTe{constructor(e){this.id=ATe++,this.code=e,this.usedTimes=0}}function CTe(n,e,t,r,i,a,s){const o=new DR,l=new MTe,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(A){return u.add(A),A===0?"uv":`uv${A}`}function m(A,M,P,D,L){const R=D.fog,N=L.geometry,F=A.isMeshStandardMaterial?D.environment:null,O=(A.isMeshStandardMaterial?t:e).get(A.envMap||F),H=O&&O.mapping===DS?O.image.height:null,U=g[A.type];A.precision!==null&&(p=i.getMaxPrecision(A.precision),p!==A.precision&&console.warn("THREE.WebGLProgram.getParameters:",A.precision,"not supported, using",p,"instead."));const $=N.morphAttributes.position||N.morphAttributes.normal||N.morphAttributes.color,Y=$!==void 0?$.length:0;let oe=0;N.morphAttributes.position!==void 0&&(oe=1),N.morphAttributes.normal!==void 0&&(oe=2),N.morphAttributes.color!==void 0&&(oe=3);let X,re,_e,Fe;if(U){const _t=ga[U];X=_t.vertexShader,re=_t.fragmentShader}else X=A.vertexShader,re=A.fragmentShader,l.update(A),_e=l.getVertexShaderID(A),Fe=l.getFragmentShaderID(A);const Ce=n.getRenderTarget(),Ae=L.isInstancedMesh===!0,ze=L.isBatchedMesh===!0,fe=!!A.map,j=!!A.matcap,xe=!!O,pe=!!A.aoMap,we=!!A.lightMap,V=!!A.bumpMap,ee=!!A.normalMap,ae=!!A.displacementMap,I=!!A.emissiveMap,G=!!A.metalnessMap,K=!!A.roughnessMap,ge=A.anisotropy>0,Ee=A.clearcoat>0,q=A.iridescence>0,le=A.sheen>0,ue=A.transmission>0,be=ge&&!!A.anisotropyMap,He=Ee&&!!A.clearcoatMap,nt=Ee&&!!A.clearcoatNormalMap,ke=Ee&&!!A.clearcoatRoughnessMap,Tt=q&&!!A.iridescenceMap,wt=q&&!!A.iridescenceThicknessMap,pt=le&&!!A.sheenColorMap,lt=le&&!!A.sheenRoughnessMap,Ze=!!A.specularMap,At=!!A.specularColorMap,ce=!!A.specularIntensityMap,We=ue&&!!A.transmissionMap,at=ue&&!!A.thicknessMap,vt=!!A.gradientMap,se=!!A.alphaMap,Ye=A.alphaTest>0,je=!!A.alphaHash,Q=!!A.extensions;let me=nc;A.toneMapped&&(Ce===null||Ce.isXRRenderTarget===!0)&&(me=n.toneMapping);const Oe={isWebGL2:h,shaderID:U,shaderType:A.type,shaderName:A.name,vertexShader:X,fragmentShader:re,defines:A.defines,customVertexShaderID:_e,customFragmentShaderID:Fe,isRawShaderMaterial:A.isRawShaderMaterial===!0,glslVersion:A.glslVersion,precision:p,batching:ze,instancing:Ae,instancingColor:Ae&&L.instanceColor!==null,supportsVertexTextures:d,outputColorSpace:Ce===null?n.outputColorSpace:Ce.isXRRenderTarget===!0?Ce.texture.colorSpace:ai,alphaToCoverage:!!A.alphaToCoverage,map:fe,matcap:j,envMap:xe,envMapMode:xe&&O.mapping,envMapCubeUVHeight:H,aoMap:pe,lightMap:we,bumpMap:V,normalMap:ee,displacementMap:d&&ae,emissiveMap:I,normalMapObjectSpace:ee&&A.normalMapType===ASe,normalMapTangentSpace:ee&&A.normalMapType===ER,metalnessMap:G,roughnessMap:K,anisotropy:ge,anisotropyMap:be,clearcoat:Ee,clearcoatMap:He,clearcoatNormalMap:nt,clearcoatRoughnessMap:ke,iridescence:q,iridescenceMap:Tt,iridescenceThicknessMap:wt,sheen:le,sheenColorMap:pt,sheenRoughnessMap:lt,specularMap:Ze,specularColorMap:At,specularIntensityMap:ce,transmission:ue,transmissionMap:We,thicknessMap:at,gradientMap:vt,opaque:A.transparent===!1&&A.blending===Qh&&A.alphaToCoverage===!1,alphaMap:se,alphaTest:Ye,alphaHash:je,combine:A.combine,mapUv:fe&&v(A.map.channel),aoMapUv:pe&&v(A.aoMap.channel),lightMapUv:we&&v(A.lightMap.channel),bumpMapUv:V&&v(A.bumpMap.channel),normalMapUv:ee&&v(A.normalMap.channel),displacementMapUv:ae&&v(A.displacementMap.channel),emissiveMapUv:I&&v(A.emissiveMap.channel),metalnessMapUv:G&&v(A.metalnessMap.channel),roughnessMapUv:K&&v(A.roughnessMap.channel),anisotropyMapUv:be&&v(A.anisotropyMap.channel),clearcoatMapUv:He&&v(A.clearcoatMap.channel),clearcoatNormalMapUv:nt&&v(A.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ke&&v(A.clearcoatRoughnessMap.channel),iridescenceMapUv:Tt&&v(A.iridescenceMap.channel),iridescenceThicknessMapUv:wt&&v(A.iridescenceThicknessMap.channel),sheenColorMapUv:pt&&v(A.sheenColorMap.channel),sheenRoughnessMapUv:lt&&v(A.sheenRoughnessMap.channel),specularMapUv:Ze&&v(A.specularMap.channel),specularColorMapUv:At&&v(A.specularColorMap.channel),specularIntensityMapUv:ce&&v(A.specularIntensityMap.channel),transmissionMapUv:We&&v(A.transmissionMap.channel),thicknessMapUv:at&&v(A.thicknessMap.channel),alphaMapUv:se&&v(A.alphaMap.channel),vertexTangents:!!N.attributes.tangent&&(ee||ge),vertexColors:A.vertexColors,vertexAlphas:A.vertexColors===!0&&!!N.attributes.color&&N.attributes.color.itemSize===4,pointsUvs:L.isPoints===!0&&!!N.attributes.uv&&(fe||se),fog:!!R,useFog:A.fog===!0,fogExp2:!!R&&R.isFogExp2,flatShading:A.flatShading===!0,sizeAttenuation:A.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:L.isSkinnedMesh===!0,morphTargets:N.morphAttributes.position!==void 0,morphNormals:N.morphAttributes.normal!==void 0,morphColors:N.morphAttributes.color!==void 0,morphTargetsCount:Y,morphTextureStride:oe,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:A.dithering,shadowMapEnabled:n.shadowMap.enabled&&P.length>0,shadowMapType:n.shadowMap.type,toneMapping:me,useLegacyLights:n._useLegacyLights,decodeVideoTexture:fe&&A.map.isVideoTexture===!0&&Bn.getTransfer(A.map.colorSpace)===sr,premultipliedAlpha:A.premultipliedAlpha,doubleSided:A.side===tr,flipSided:A.side===Ta,useDepthPacking:A.depthPacking>=0,depthPacking:A.depthPacking||0,index0AttributeName:A.index0AttributeName,extensionDerivatives:Q&&A.extensions.derivatives===!0,extensionFragDepth:Q&&A.extensions.fragDepth===!0,extensionDrawBuffers:Q&&A.extensions.drawBuffers===!0,extensionShaderTextureLOD:Q&&A.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Q&&A.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Q&&A.extensions.multiDraw===!0&&r.has("WEBGL_multi_draw"),rendererExtensionFragDepth:h||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:A.customProgramCacheKey()};return Oe.vertexUv1s=u.has(1),Oe.vertexUv2s=u.has(2),Oe.vertexUv3s=u.has(3),u.clear(),Oe}function y(A){const M=[];if(A.shaderID?M.push(A.shaderID):(M.push(A.customVertexShaderID),M.push(A.customFragmentShaderID)),A.defines!==void 0)for(const P in A.defines)M.push(P),M.push(A.defines[P]);return A.isRawShaderMaterial===!1&&(_(M,A),x(M,A),M.push(n.outputColorSpace)),M.push(A.customProgramCacheKey),M.join()}function _(A,M){A.push(M.precision),A.push(M.outputColorSpace),A.push(M.envMapMode),A.push(M.envMapCubeUVHeight),A.push(M.mapUv),A.push(M.alphaMapUv),A.push(M.lightMapUv),A.push(M.aoMapUv),A.push(M.bumpMapUv),A.push(M.normalMapUv),A.push(M.displacementMapUv),A.push(M.emissiveMapUv),A.push(M.metalnessMapUv),A.push(M.roughnessMapUv),A.push(M.anisotropyMapUv),A.push(M.clearcoatMapUv),A.push(M.clearcoatNormalMapUv),A.push(M.clearcoatRoughnessMapUv),A.push(M.iridescenceMapUv),A.push(M.iridescenceThicknessMapUv),A.push(M.sheenColorMapUv),A.push(M.sheenRoughnessMapUv),A.push(M.specularMapUv),A.push(M.specularColorMapUv),A.push(M.specularIntensityMapUv),A.push(M.transmissionMapUv),A.push(M.thicknessMapUv),A.push(M.combine),A.push(M.fogExp2),A.push(M.sizeAttenuation),A.push(M.morphTargetsCount),A.push(M.morphAttributeCount),A.push(M.numDirLights),A.push(M.numPointLights),A.push(M.numSpotLights),A.push(M.numSpotLightMaps),A.push(M.numHemiLights),A.push(M.numRectAreaLights),A.push(M.numDirLightShadows),A.push(M.numPointLightShadows),A.push(M.numSpotLightShadows),A.push(M.numSpotLightShadowsWithMaps),A.push(M.numLightProbes),A.push(M.shadowMapType),A.push(M.toneMapping),A.push(M.numClippingPlanes),A.push(M.numClipIntersection),A.push(M.depthPacking)}function x(A,M){o.disableAll(),M.isWebGL2&&o.enable(0),M.supportsVertexTextures&&o.enable(1),M.instancing&&o.enable(2),M.instancingColor&&o.enable(3),M.matcap&&o.enable(4),M.envMap&&o.enable(5),M.normalMapObjectSpace&&o.enable(6),M.normalMapTangentSpace&&o.enable(7),M.clearcoat&&o.enable(8),M.iridescence&&o.enable(9),M.alphaTest&&o.enable(10),M.vertexColors&&o.enable(11),M.vertexAlphas&&o.enable(12),M.vertexUv1s&&o.enable(13),M.vertexUv2s&&o.enable(14),M.vertexUv3s&&o.enable(15),M.vertexTangents&&o.enable(16),M.anisotropy&&o.enable(17),M.alphaHash&&o.enable(18),M.batching&&o.enable(19),A.push(o.mask),o.disableAll(),M.fog&&o.enable(0),M.useFog&&o.enable(1),M.flatShading&&o.enable(2),M.logarithmicDepthBuffer&&o.enable(3),M.skinning&&o.enable(4),M.morphTargets&&o.enable(5),M.morphNormals&&o.enable(6),M.morphColors&&o.enable(7),M.premultipliedAlpha&&o.enable(8),M.shadowMapEnabled&&o.enable(9),M.useLegacyLights&&o.enable(10),M.doubleSided&&o.enable(11),M.flipSided&&o.enable(12),M.useDepthPacking&&o.enable(13),M.dithering&&o.enable(14),M.transmission&&o.enable(15),M.sheen&&o.enable(16),M.opaque&&o.enable(17),M.pointsUvs&&o.enable(18),M.decodeVideoTexture&&o.enable(19),M.alphaToCoverage&&o.enable(20),A.push(o.mask)}function b(A){const M=g[A.type];let P;if(M){const D=ga[M];P=IR.clone(D.uniforms)}else P=A.uniforms;return P}function S(A,M){let P;for(let D=0,L=c.length;D<L;D++){const R=c[D];if(R.cacheKey===M){P=R,++P.usedTimes;break}}return P===void 0&&(P=new wTe(n,M,A,a),c.push(P)),P}function w(A){if(--A.usedTimes===0){const M=c.indexOf(A);c[M]=c[c.length-1],c.pop(),A.destroy()}}function T(A){l.remove(A)}function C(){l.dispose()}return{getParameters:m,getProgramCacheKey:y,getUniforms:b,acquireProgram:S,releaseProgram:w,releaseShaderCache:T,programs:c,dispose:C}}function ETe(){let n=new WeakMap;function e(a){let s=n.get(a);return s===void 0&&(s={},n.set(a,s)),s}function t(a){n.delete(a)}function r(a,s,o){n.get(a)[s]=o}function i(){n=new WeakMap}return{get:e,remove:t,update:r,dispose:i}}function PTe(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function s6(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function o6(){const n=[];let e=0;const t=[],r=[],i=[];function a(){e=0,t.length=0,r.length=0,i.length=0}function s(h,f,d,p,g,v){let m=n[e];return m===void 0?(m={id:h.id,object:h,geometry:f,material:d,groupOrder:p,renderOrder:h.renderOrder,z:g,group:v},n[e]=m):(m.id=h.id,m.object=h,m.geometry=f,m.material=d,m.groupOrder=p,m.renderOrder=h.renderOrder,m.z=g,m.group=v),e++,m}function o(h,f,d,p,g,v){const m=s(h,f,d,p,g,v);d.transmission>0?r.push(m):d.transparent===!0?i.push(m):t.push(m)}function l(h,f,d,p,g,v){const m=s(h,f,d,p,g,v);d.transmission>0?r.unshift(m):d.transparent===!0?i.unshift(m):t.unshift(m)}function u(h,f){t.length>1&&t.sort(h||PTe),r.length>1&&r.sort(f||s6),i.length>1&&i.sort(f||s6)}function c(){for(let h=e,f=n.length;h<f;h++){const d=n[h];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.group=null}}return{opaque:t,transmissive:r,transparent:i,init:a,push:o,unshift:l,finish:c,sort:u}}function LTe(){let n=new WeakMap;function e(r,i){const a=n.get(r);let s;return a===void 0?(s=new o6,n.set(r,[s])):i>=a.length?(s=new o6,a.push(s)):s=a[i],s}function t(){n=new WeakMap}return{get:e,dispose:t}}function RTe(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new te,color:new xt};break;case"SpotLight":t={position:new te,direction:new te,color:new xt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new te,color:new xt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new te,skyColor:new xt,groundColor:new xt};break;case"RectAreaLight":t={color:new xt,position:new te,halfWidth:new te,halfHeight:new te};break}return n[e.id]=t,t}}}function DTe(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let ITe=0;function NTe(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function kTe(n,e){const t=new RTe,r=DTe(),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 te);const a=new te,s=new Jt,o=new Jt;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,b=0,S=0,w=0,T=0,C=0;c.sort(NTe);const A=h===!0?Math.PI:1;for(let P=0,D=c.length;P<D;P++){const L=c[P],R=L.color,N=L.intensity,F=L.distance,O=L.shadow&&L.shadow.map?L.shadow.map.texture:null;if(L.isAmbientLight)f+=R.r*N*A,d+=R.g*N*A,p+=R.b*N*A;else if(L.isLightProbe){for(let H=0;H<9;H++)i.probe[H].addScaledVector(L.sh.coefficients[H],N);C++}else if(L.isDirectionalLight){const H=t.get(L);if(H.color.copy(L.color).multiplyScalar(L.intensity*A),L.castShadow){const U=L.shadow,$=r.get(L);$.shadowBias=U.bias,$.shadowNormalBias=U.normalBias,$.shadowRadius=U.radius,$.shadowMapSize=U.mapSize,i.directionalShadow[g]=$,i.directionalShadowMap[g]=O,i.directionalShadowMatrix[g]=L.shadow.matrix,x++}i.directional[g]=H,g++}else if(L.isSpotLight){const H=t.get(L);H.position.setFromMatrixPosition(L.matrixWorld),H.color.copy(R).multiplyScalar(N*A),H.distance=F,H.coneCos=Math.cos(L.angle),H.penumbraCos=Math.cos(L.angle*(1-L.penumbra)),H.decay=L.decay,i.spot[m]=H;const U=L.shadow;if(L.map&&(i.spotLightMap[w]=L.map,w++,U.updateMatrices(L),L.castShadow&&T++),i.spotLightMatrix[m]=U.matrix,L.castShadow){const $=r.get(L);$.shadowBias=U.bias,$.shadowNormalBias=U.normalBias,$.shadowRadius=U.radius,$.shadowMapSize=U.mapSize,i.spotShadow[m]=$,i.spotShadowMap[m]=O,S++}m++}else if(L.isRectAreaLight){const H=t.get(L);H.color.copy(R).multiplyScalar(N),H.halfWidth.set(L.width*.5,0,0),H.halfHeight.set(0,L.height*.5,0),i.rectArea[y]=H,y++}else if(L.isPointLight){const H=t.get(L);if(H.color.copy(L.color).multiplyScalar(L.intensity*A),H.distance=L.distance,H.decay=L.decay,L.castShadow){const U=L.shadow,$=r.get(L);$.shadowBias=U.bias,$.shadowNormalBias=U.normalBias,$.shadowRadius=U.radius,$.shadowMapSize=U.mapSize,$.shadowCameraNear=U.camera.near,$.shadowCameraFar=U.camera.far,i.pointShadow[v]=$,i.pointShadowMap[v]=O,i.pointShadowMatrix[v]=L.shadow.matrix,b++}i.point[v]=H,v++}else if(L.isHemisphereLight){const H=t.get(L);H.skyColor.copy(L.color).multiplyScalar(N*A),H.groundColor.copy(L.groundColor).multiplyScalar(N*A),i.hemi[_]=H,_++}}y>0&&(e.isWebGL2?n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=rt.LTC_FLOAT_1,i.rectAreaLTC2=rt.LTC_FLOAT_2):(i.rectAreaLTC1=rt.LTC_HALF_1,i.rectAreaLTC2=rt.LTC_HALF_2):n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=rt.LTC_FLOAT_1,i.rectAreaLTC2=rt.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=rt.LTC_HALF_1,i.rectAreaLTC2=rt.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 M=i.hash;(M.directionalLength!==g||M.pointLength!==v||M.spotLength!==m||M.rectAreaLength!==y||M.hemiLength!==_||M.numDirectionalShadows!==x||M.numPointShadows!==b||M.numSpotShadows!==S||M.numSpotMaps!==w||M.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=b,i.pointShadowMap.length=b,i.spotShadow.length=S,i.spotShadowMap.length=S,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=S+w-T,i.spotLightMap.length=w,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=C,M.directionalLength=g,M.pointLength=v,M.spotLength=m,M.rectAreaLength=y,M.hemiLength=_,M.numDirectionalShadows=x,M.numPointShadows=b,M.numSpotShadows=S,M.numSpotMaps=w,M.numLightProbes=C,i.version=ITe++)}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 b=i.directional[f];b.direction.setFromMatrixPosition(x.matrixWorld),a.setFromMatrixPosition(x.target.matrixWorld),b.direction.sub(a),b.direction.transformDirection(m),f++}else if(x.isSpotLight){const b=i.spot[p];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(m),b.direction.setFromMatrixPosition(x.matrixWorld),a.setFromMatrixPosition(x.target.matrixWorld),b.direction.sub(a),b.direction.transformDirection(m),p++}else if(x.isRectAreaLight){const b=i.rectArea[g];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(m),o.identity(),s.copy(x.matrixWorld),s.premultiply(m),o.extractRotation(s),b.halfWidth.set(x.width*.5,0,0),b.halfHeight.set(0,x.height*.5,0),b.halfWidth.applyMatrix4(o),b.halfHeight.applyMatrix4(o),g++}else if(x.isPointLight){const b=i.point[d];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(m),d++}else if(x.isHemisphereLight){const b=i.hemi[v];b.direction.setFromMatrixPosition(x.matrixWorld),b.direction.transformDirection(m),v++}}}return{setup:l,setupView:u,state:i}}function l6(n,e){const t=new kTe(n,e),r=[],i=[];function a(){r.length=0,i.length=0}function s(h){r.push(h)}function o(h){i.push(h)}function l(h){t.setup(r,h)}function u(h){t.setupView(r,h)}return{init:a,state:{lightsArray:r,shadowsArray:i,lights:t},setupLights:l,setupLightsView:u,pushLight:s,pushShadow:o}}function OTe(n,e){let t=new WeakMap;function r(a,s=0){const o=t.get(a);let l;return o===void 0?(l=new l6(n,e),t.set(a,[l])):s>=o.length?(l=new l6(n,e),o.push(l)):l=o[s],l}function i(){t=new WeakMap}return{get:r,dispose:i}}class FTe extends Ns{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=SSe,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 BTe extends Ns{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 GTe=`void main() {
gl_Position = vec4( position, 1.0 );
}`,zTe=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
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 UTe(n,e,t){let r=new NR;const i=new Ge,a=new Ge,s=new En,o=new FTe({depthPacking:wSe}),l=new BTe,u={},c=t.maxTextureSize,h={[$l]:Ta,[Ta]:$l,[tr]:tr},f=new jl({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ge},radius:{value:4}},vertexShader:GTe,fragmentShader:zTe}),d=f.clone();d.defines.HORIZONTAL_PASS=1;const p=new qn;p.setAttribute("position",new br(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new An(p,f),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=z$;let m=this.type;this.render=function(S,w,T){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||S.length===0)return;const C=n.getRenderTarget(),A=n.getActiveCubeFace(),M=n.getActiveMipmapLevel(),P=n.state;P.setBlending(tc),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const D=m!==bl&&this.type===bl,L=m===bl&&this.type!==bl;for(let R=0,N=S.length;R<N;R++){const F=S[R],O=F.shadow;if(O===void 0){console.warn("THREE.WebGLShadowMap:",F,"has no shadow.");continue}if(O.autoUpdate===!1&&O.needsUpdate===!1)continue;i.copy(O.mapSize);const H=O.getFrameExtents();if(i.multiply(H),a.copy(O.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/H.x),i.x=a.x*H.x,O.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/H.y),i.y=a.y*H.y,O.mapSize.y=a.y)),O.map===null||D===!0||L===!0){const $=this.type!==bl?{minFilter:Jr,magFilter:Jr}:{};O.map!==null&&O.map.dispose(),O.map=new pf(i.x,i.y,$),O.map.texture.name=F.name+".shadowMap",O.camera.updateProjectionMatrix()}n.setRenderTarget(O.map),n.clear();const U=O.getViewportCount();for(let $=0;$<U;$++){const Y=O.getViewport($);s.set(a.x*Y.x,a.y*Y.y,a.x*Y.z,a.y*Y.w),P.viewport(s),O.updateMatrices(F,$),r=O.getFrustum(),x(w,T,O.camera,F,this.type)}O.isPointLightShadow!==!0&&this.type===bl&&y(O,T),O.needsUpdate=!1}m=this.type,v.needsUpdate=!1,n.setRenderTarget(C,A,M)};function y(S,w){const T=e.update(g);f.defines.VSM_SAMPLES!==S.blurSamples&&(f.defines.VSM_SAMPLES=S.blurSamples,d.defines.VSM_SAMPLES=S.blurSamples,f.needsUpdate=!0,d.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new pf(i.x,i.y)),f.uniforms.shadow_pass.value=S.map.texture,f.uniforms.resolution.value=S.mapSize,f.uniforms.radius.value=S.radius,n.setRenderTarget(S.mapPass),n.clear(),n.renderBufferDirect(w,null,T,f,g,null),d.uniforms.shadow_pass.value=S.mapPass.texture,d.uniforms.resolution.value=S.mapSize,d.uniforms.radius.value=S.radius,n.setRenderTarget(S.map),n.clear(),n.renderBufferDirect(w,null,T,d,g,null)}function _(S,w,T,C){let A=null;const M=T.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(M!==void 0)A=M;else if(A=T.isPointLight===!0?l:o,n.localClippingEnabled&&w.clipShadows===!0&&Array.isArray(w.clippingPlanes)&&w.clippingPlanes.length!==0||w.displacementMap&&w.displacementScale!==0||w.alphaMap&&w.alphaTest>0||w.map&&w.alphaTest>0){const P=A.uuid,D=w.uuid;let L=u[P];L===void 0&&(L={},u[P]=L);let R=L[D];R===void 0&&(R=A.clone(),L[D]=R,w.addEventListener("dispose",b)),A=R}if(A.visible=w.visible,A.wireframe=w.wireframe,C===bl?A.side=w.shadowSide!==null?w.shadowSide:w.side:A.side=w.shadowSide!==null?w.shadowSide:h[w.side],A.alphaMap=w.alphaMap,A.alphaTest=w.alphaTest,A.map=w.map,A.clipShadows=w.clipShadows,A.clippingPlanes=w.clippingPlanes,A.clipIntersection=w.clipIntersection,A.displacementMap=w.displacementMap,A.displacementScale=w.displacementScale,A.displacementBias=w.displacementBias,A.wireframeLinewidth=w.wireframeLinewidth,A.linewidth=w.linewidth,T.isPointLight===!0&&A.isMeshDistanceMaterial===!0){const P=n.properties.get(A);P.light=T}return A}function x(S,w,T,C,A){if(S.visible===!1)return;if(S.layers.test(w.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&A===bl)&&(!S.frustumCulled||r.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,S.matrixWorld);const D=e.update(S),L=S.material;if(Array.isArray(L)){const R=D.groups;for(let N=0,F=R.length;N<F;N++){const O=R[N],H=L[O.materialIndex];if(H&&H.visible){const U=_(S,H,C,A);S.onBeforeShadow(n,S,w,T,D,U,O),n.renderBufferDirect(T,null,D,U,S,O),S.onAfterShadow(n,S,w,T,D,U,O)}}}else if(L.visible){const R=_(S,L,C,A);S.onBeforeShadow(n,S,w,T,D,R,null),n.renderBufferDirect(T,null,D,R,S,null),S.onAfterShadow(n,S,w,T,D,R,null)}}const P=S.children;for(let D=0,L=P.length;D<L;D++)x(P[D],w,T,C,A)}function b(S){S.target.removeEventListener("dispose",b);for(const T in u){const C=u[T],A=S.target.uuid;A in C&&(C[A].dispose(),delete C[A])}}}function VTe(n,e,t){const r=t.isWebGL2;function i(){let se=!1;const Ye=new En;let je=null;const Q=new En(0,0,0,0);return{setMask:function(me){je!==me&&!se&&(n.colorMask(me,me,me,me),je=me)},setLocked:function(me){se=me},setClear:function(me,Oe,_t,zt,xn){xn===!0&&(me*=zt,Oe*=zt,_t*=zt),Ye.set(me,Oe,_t,zt),Q.equals(Ye)===!1&&(n.clearColor(me,Oe,_t,zt),Q.copy(Ye))},reset:function(){se=!1,je=null,Q.set(-1,0,0,0)}}}function a(){let se=!1,Ye=null,je=null,Q=null;return{setTest:function(me){me?Ae(n.DEPTH_TEST):ze(n.DEPTH_TEST)},setMask:function(me){Ye!==me&&!se&&(n.depthMask(me),Ye=me)},setFunc:function(me){if(je!==me){switch(me){case Kbe:n.depthFunc(n.NEVER);break;case Zbe:n.depthFunc(n.ALWAYS);break;case Qbe:n.depthFunc(n.LESS);break;case hb:n.depthFunc(n.LEQUAL);break;case Jbe:n.depthFunc(n.EQUAL);break;case eSe:n.depthFunc(n.GEQUAL);break;case tSe:n.depthFunc(n.GREATER);break;case nSe:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}je=me}},setLocked:function(me){se=me},setClear:function(me){Q!==me&&(n.clearDepth(me),Q=me)},reset:function(){se=!1,Ye=null,je=null,Q=null}}}function s(){let se=!1,Ye=null,je=null,Q=null,me=null,Oe=null,_t=null,zt=null,xn=null;return{setTest:function(jt){se||(jt?Ae(n.STENCIL_TEST):ze(n.STENCIL_TEST))},setMask:function(jt){Ye!==jt&&!se&&(n.stencilMask(jt),Ye=jt)},setFunc:function(jt,Tn,dr){(je!==jt||Q!==Tn||me!==dr)&&(n.stencilFunc(jt,Tn,dr),je=jt,Q=Tn,me=dr)},setOp:function(jt,Tn,dr){(Oe!==jt||_t!==Tn||zt!==dr)&&(n.stencilOp(jt,Tn,dr),Oe=jt,_t=Tn,zt=dr)},setLocked:function(jt){se=jt},setClear:function(jt){xn!==jt&&(n.clearStencil(jt),xn=jt)},reset:function(){se=!1,Ye=null,je=null,Q=null,me=null,Oe=null,_t=null,zt=null,xn=null}}}const o=new i,l=new a,u=new s,c=new WeakMap,h=new WeakMap;let f={},d={},p=new WeakMap,g=[],v=null,m=!1,y=null,_=null,x=null,b=null,S=null,w=null,T=null,C=new xt(0,0,0),A=0,M=!1,P=null,D=null,L=null,R=null,N=null;const F=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let O=!1,H=0;const U=n.getParameter(n.VERSION);U.indexOf("WebGL")!==-1?(H=parseFloat(/^WebGL (\d)/.exec(U)[1]),O=H>=1):U.indexOf("OpenGL ES")!==-1&&(H=parseFloat(/^OpenGL ES (\d)/.exec(U)[1]),O=H>=2);let $=null,Y={};const oe=n.getParameter(n.SCISSOR_BOX),X=n.getParameter(n.VIEWPORT),re=new En().fromArray(oe),_e=new En().fromArray(X);function Fe(se,Ye,je,Q){const me=new Uint8Array(4),Oe=n.createTexture();n.bindTexture(se,Oe),n.texParameteri(se,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(se,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let _t=0;_t<je;_t++)r&&(se===n.TEXTURE_3D||se===n.TEXTURE_2D_ARRAY)?n.texImage3D(Ye,0,n.RGBA,1,1,Q,0,n.RGBA,n.UNSIGNED_BYTE,me):n.texImage2D(Ye+_t,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,me);return Oe}const Ce={};Ce[n.TEXTURE_2D]=Fe(n.TEXTURE_2D,n.TEXTURE_2D,1),Ce[n.TEXTURE_CUBE_MAP]=Fe(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),r&&(Ce[n.TEXTURE_2D_ARRAY]=Fe(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),Ce[n.TEXTURE_3D]=Fe(n.TEXTURE_3D,n.TEXTURE_3D,1,1)),o.setClear(0,0,0,1),l.setClear(1),u.setClear(0),Ae(n.DEPTH_TEST),l.setFunc(hb),ae(!1),I(zF),Ae(n.CULL_FACE),V(tc);function Ae(se){f[se]!==!0&&(n.enable(se),f[se]=!0)}function ze(se){f[se]!==!1&&(n.disable(se),f[se]=!1)}function fe(se,Ye){return d[se]!==Ye?(n.bindFramebuffer(se,Ye),d[se]=Ye,r&&(se===n.DRAW_FRAMEBUFFER&&(d[n.FRAMEBUFFER]=Ye),se===n.FRAMEBUFFER&&(d[n.DRAW_FRAMEBUFFER]=Ye)),!0):!1}function j(se,Ye){let je=g,Q=!1;if(se)if(je=p.get(Ye),je===void 0&&(je=[],p.set(Ye,je)),se.isWebGLMultipleRenderTargets){const me=se.texture;if(je.length!==me.length||je[0]!==n.COLOR_ATTACHMENT0){for(let Oe=0,_t=me.length;Oe<_t;Oe++)je[Oe]=n.COLOR_ATTACHMENT0+Oe;je.length=me.length,Q=!0}}else je[0]!==n.COLOR_ATTACHMENT0&&(je[0]=n.COLOR_ATTACHMENT0,Q=!0);else je[0]!==n.BACK&&(je[0]=n.BACK,Q=!0);Q&&(t.isWebGL2?n.drawBuffers(je):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(je))}function xe(se){return v!==se?(n.useProgram(se),v=se,!0):!1}const pe={[Lu]:n.FUNC_ADD,[Fbe]:n.FUNC_SUBTRACT,[Bbe]:n.FUNC_REVERSE_SUBTRACT};if(r)pe[HF]=n.MIN,pe[WF]=n.MAX;else{const se=e.get("EXT_blend_minmax");se!==null&&(pe[HF]=se.MIN_EXT,pe[WF]=se.MAX_EXT)}const we={[Gbe]:n.ZERO,[V$]:n.ONE,[zbe]:n.SRC_COLOR,[lE]:n.SRC_ALPHA,[$be]:n.SRC_ALPHA_SATURATE,[H$]:n.DST_COLOR,[Vbe]:n.DST_ALPHA,[Ube]:n.ONE_MINUS_SRC_COLOR,[uE]:n.ONE_MINUS_SRC_ALPHA,[Wbe]:n.ONE_MINUS_DST_COLOR,[Hbe]:n.ONE_MINUS_DST_ALPHA,[jbe]:n.CONSTANT_COLOR,[qbe]:n.ONE_MINUS_CONSTANT_COLOR,[Xbe]:n.CONSTANT_ALPHA,[Ybe]:n.ONE_MINUS_CONSTANT_ALPHA};function V(se,Ye,je,Q,me,Oe,_t,zt,xn,jt){if(se===tc){m===!0&&(ze(n.BLEND),m=!1);return}if(m===!1&&(Ae(n.BLEND),m=!0),se!==U$){if(se!==y||jt!==M){if((_!==Lu||S!==Lu)&&(n.blendEquation(n.FUNC_ADD),_=Lu,S=Lu),jt)switch(se){case Qh:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case yi:n.blendFunc(n.ONE,n.ONE);break;case UF:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case VF:n.blendFuncSeparate(n.ZERO,n.SRC_COLOR,n.ZERO,n.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",se);break}else switch(se){case Qh:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case yi:n.blendFunc(n.SRC_ALPHA,n.ONE);break;case UF:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case VF:n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",se);break}x=null,b=null,w=null,T=null,C.set(0,0,0),A=0,y=se,M=jt}return}me=me||Ye,Oe=Oe||je,_t=_t||Q,(Ye!==_||me!==S)&&(n.blendEquationSeparate(pe[Ye],pe[me]),_=Ye,S=me),(je!==x||Q!==b||Oe!==w||_t!==T)&&(n.blendFuncSeparate(we[je],we[Q],we[Oe],we[_t]),x=je,b=Q,w=Oe,T=_t),(zt.equals(C)===!1||xn!==A)&&(n.blendColor(zt.r,zt.g,zt.b,xn),C.copy(zt),A=xn),y=se,M=!1}function ee(se,Ye){se.side===tr?ze(n.CULL_FACE):Ae(n.CULL_FACE);let je=se.side===Ta;Ye&&(je=!je),ae(je),se.blending===Qh&&se.transparent===!1?V(tc):V(se.blending,se.blendEquation,se.blendSrc,se.blendDst,se.blendEquationAlpha,se.blendSrcAlpha,se.blendDstAlpha,se.blendColor,se.blendAlpha,se.premultipliedAlpha),l.setFunc(se.depthFunc),l.setTest(se.depthTest),l.setMask(se.depthWrite),o.setMask(se.colorWrite);const Q=se.stencilWrite;u.setTest(Q),Q&&(u.setMask(se.stencilWriteMask),u.setFunc(se.stencilFunc,se.stencilRef,se.stencilFuncMask),u.setOp(se.stencilFail,se.stencilZFail,se.stencilZPass)),K(se.polygonOffset,se.polygonOffsetFactor,se.polygonOffsetUnits),se.alphaToCoverage===!0?Ae(n.SAMPLE_ALPHA_TO_COVERAGE):ze(n.SAMPLE_ALPHA_TO_COVERAGE)}function ae(se){P!==se&&(se?n.frontFace(n.CW):n.frontFace(n.CCW),P=se)}function I(se){se!==Nbe?(Ae(n.CULL_FACE),se!==D&&(se===zF?n.cullFace(n.BACK):se===kbe?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):ze(n.CULL_FACE),D=se}function G(se){se!==L&&(O&&n.lineWidth(se),L=se)}function K(se,Ye,je){se?(Ae(n.POLYGON_OFFSET_FILL),(R!==Ye||N!==je)&&(n.polygonOffset(Ye,je),R=Ye,N=je)):ze(n.POLYGON_OFFSET_FILL)}function ge(se){se?Ae(n.SCISSOR_TEST):ze(n.SCISSOR_TEST)}function Ee(se){se===void 0&&(se=n.TEXTURE0+F-1),$!==se&&(n.activeTexture(se),$=se)}function q(se,Ye,je){je===void 0&&($===null?je=n.TEXTURE0+F-1:je=$);let Q=Y[je];Q===void 0&&(Q={type:void 0,texture:void 0},Y[je]=Q),(Q.type!==se||Q.texture!==Ye)&&($!==je&&(n.activeTexture(je),$=je),n.bindTexture(se,Ye||Ce[se]),Q.type=se,Q.texture=Ye)}function le(){const se=Y[$];se!==void 0&&se.type!==void 0&&(n.bindTexture(se.type,null),se.type=void 0,se.texture=void 0)}function ue(){try{n.compressedTexImage2D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function be(){try{n.compressedTexImage3D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function He(){try{n.texSubImage2D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function nt(){try{n.texSubImage3D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function ke(){try{n.compressedTexSubImage2D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function Tt(){try{n.compressedTexSubImage3D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function wt(){try{n.texStorage2D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function pt(){try{n.texStorage3D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function lt(){try{n.texImage2D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function Ze(){try{n.texImage3D.apply(n,arguments)}catch(se){console.error("THREE.WebGLState:",se)}}function At(se){re.equals(se)===!1&&(n.scissor(se.x,se.y,se.z,se.w),re.copy(se))}function ce(se){_e.equals(se)===!1&&(n.viewport(se.x,se.y,se.z,se.w),_e.copy(se))}function We(se,Ye){let je=h.get(Ye);je===void 0&&(je=new WeakMap,h.set(Ye,je));let Q=je.get(se);Q===void 0&&(Q=n.getUniformBlockIndex(Ye,se.name),je.set(se,Q))}function at(se,Ye){const Q=h.get(Ye).get(se);c.get(Ye)!==Q&&(n.uniformBlockBinding(Ye,Q,se.__bindingPointIndex),c.set(Ye,Q))}function vt(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),r===!0&&(n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),f={},$=null,Y={},d={},p=new WeakMap,g=[],v=null,m=!1,y=null,_=null,x=null,b=null,S=null,w=null,T=null,C=new xt(0,0,0),A=0,M=!1,P=null,D=null,L=null,R=null,N=null,re.set(0,0,n.canvas.width,n.canvas.height),_e.set(0,0,n.canvas.width,n.canvas.height),o.reset(),l.reset(),u.reset()}return{buffers:{color:o,depth:l,stencil:u},enable:Ae,disable:ze,bindFramebuffer:fe,drawBuffers:j,useProgram:xe,setBlending:V,setMaterial:ee,setFlipSided:ae,setCullFace:I,setLineWidth:G,setPolygonOffset:K,setScissorTest:ge,activeTexture:Ee,bindTexture:q,unbindTexture:le,compressedTexImage2D:ue,compressedTexImage3D:be,texImage2D:lt,texImage3D:Ze,updateUBOMapping:We,uniformBlockBinding:at,texStorage2D:wt,texStorage3D:pt,texSubImage2D:He,texSubImage3D:nt,compressedTexSubImage2D:ke,compressedTexSubImage3D:Tt,scissor:At,viewport:ce,reset:vt}}function HTe(n,e,t,r,i,a,s){const o=i.isWebGL2,l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,u=typeof navigator=="undefined"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new WeakMap;let h;const f=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(I){}function p(I,G){return d?new OffscreenCanvas(I,G):c0("canvas")}function g(I,G,K,ge){let Ee=1;if((I.width>ge||I.height>ge)&&(Ee=ge/Math.max(I.width,I.height)),Ee<1||G===!0)if(typeof HTMLImageElement!="undefined"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&I instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&I instanceof ImageBitmap){const q=G?mb:Math.floor,le=q(Ee*I.width),ue=q(Ee*I.height);h===void 0&&(h=p(le,ue));const be=K?p(le,ue):h;return be.width=le,be.height=ue,be.getContext("2d").drawImage(I,0,0,le,ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+I.width+"x"+I.height+") to ("+le+"x"+ue+")."),be}else return"data"in I&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+I.width+"x"+I.height+")."),I;return I}function v(I){return gE(I.width)&&gE(I.height)}function m(I){return o?!1:I.wrapS!==Ui||I.wrapT!==Ui||I.minFilter!==Jr&&I.minFilter!==jr}function y(I,G){return I.generateMipmaps&&G&&I.minFilter!==Jr&&I.minFilter!==jr}function _(I){n.generateMipmap(I)}function x(I,G,K,ge,Ee=!1){if(o===!1)return G;if(I!==null){if(n[I]!==void 0)return n[I];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+I+"'")}let q=G;if(G===n.RED&&(K===n.FLOAT&&(q=n.R32F),K===n.HALF_FLOAT&&(q=n.R16F),K===n.UNSIGNED_BYTE&&(q=n.R8)),G===n.RED_INTEGER&&(K===n.UNSIGNED_BYTE&&(q=n.R8UI),K===n.UNSIGNED_SHORT&&(q=n.R16UI),K===n.UNSIGNED_INT&&(q=n.R32UI),K===n.BYTE&&(q=n.R8I),K===n.SHORT&&(q=n.R16I),K===n.INT&&(q=n.R32I)),G===n.RG&&(K===n.FLOAT&&(q=n.RG32F),K===n.HALF_FLOAT&&(q=n.RG16F),K===n.UNSIGNED_BYTE&&(q=n.RG8)),G===n.RGBA){const le=Ee?db:Bn.getTransfer(ge);K===n.FLOAT&&(q=n.RGBA32F),K===n.HALF_FLOAT&&(q=n.RGBA16F),K===n.UNSIGNED_BYTE&&(q=le===sr?n.SRGB8_ALPHA8:n.RGBA8),K===n.UNSIGNED_SHORT_4_4_4_4&&(q=n.RGBA4),K===n.UNSIGNED_SHORT_5_5_5_1&&(q=n.RGB5_A1)}return(q===n.R16F||q===n.R32F||q===n.RG16F||q===n.RG32F||q===n.RGBA16F||q===n.RGBA32F)&&e.get("EXT_color_buffer_float"),q}function b(I,G,K){return y(I,K)===!0||I.isFramebufferTexture&&I.minFilter!==Jr&&I.minFilter!==jr?Math.log2(Math.max(G.width,G.height))+1:I.mipmaps!==void 0&&I.mipmaps.length>0?I.mipmaps.length:I.isCompressedTexture&&Array.isArray(I.image)?G.mipmaps.length:1}function S(I){return I===Jr||I===fE||I===Dd?n.NEAREST:n.LINEAR}function w(I){const G=I.target;G.removeEventListener("dispose",w),C(G),G.isVideoTexture&&c.delete(G)}function T(I){const G=I.target;G.removeEventListener("dispose",T),M(G)}function C(I){const G=r.get(I);if(G.__webglInit===void 0)return;const K=I.source,ge=f.get(K);if(ge){const Ee=ge[G.__cacheKey];Ee.usedTimes--,Ee.usedTimes===0&&A(I),Object.keys(ge).length===0&&f.delete(K)}r.remove(I)}function A(I){const G=r.get(I);n.deleteTexture(G.__webglTexture);const K=I.source,ge=f.get(K);delete ge[G.__cacheKey],s.memory.textures--}function M(I){const G=I.texture,K=r.get(I),ge=r.get(G);if(ge.__webglTexture!==void 0&&(n.deleteTexture(ge.__webglTexture),s.memory.textures--),I.depthTexture&&I.depthTexture.dispose(),I.isWebGLCubeRenderTarget)for(let Ee=0;Ee<6;Ee++){if(Array.isArray(K.__webglFramebuffer[Ee]))for(let q=0;q<K.__webglFramebuffer[Ee].length;q++)n.deleteFramebuffer(K.__webglFramebuffer[Ee][q]);else n.deleteFramebuffer(K.__webglFramebuffer[Ee]);K.__webglDepthbuffer&&n.deleteRenderbuffer(K.__webglDepthbuffer[Ee])}else{if(Array.isArray(K.__webglFramebuffer))for(let Ee=0;Ee<K.__webglFramebuffer.length;Ee++)n.deleteFramebuffer(K.__webglFramebuffer[Ee]);else n.deleteFramebuffer(K.__webglFramebuffer);if(K.__webglDepthbuffer&&n.deleteRenderbuffer(K.__webglDepthbuffer),K.__webglMultisampledFramebuffer&&n.deleteFramebuffer(K.__webglMultisampledFramebuffer),K.__webglColorRenderbuffer)for(let Ee=0;Ee<K.__webglColorRenderbuffer.length;Ee++)K.__webglColorRenderbuffer[Ee]&&n.deleteRenderbuffer(K.__webglColorRenderbuffer[Ee]);K.__webglDepthRenderbuffer&&n.deleteRenderbuffer(K.__webglDepthRenderbuffer)}if(I.isWebGLMultipleRenderTargets)for(let Ee=0,q=G.length;Ee<q;Ee++){const le=r.get(G[Ee]);le.__webglTexture&&(n.deleteTexture(le.__webglTexture),s.memory.textures--),r.remove(G[Ee])}r.remove(G),r.remove(I)}let P=0;function D(){P=0}function L(){const I=P;return I>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+I+" texture units while this GPU supports only "+i.maxTextures),P+=1,I}function R(I){const G=[];return G.push(I.wrapS),G.push(I.wrapT),G.push(I.wrapR||0),G.push(I.magFilter),G.push(I.minFilter),G.push(I.anisotropy),G.push(I.internalFormat),G.push(I.format),G.push(I.type),G.push(I.generateMipmaps),G.push(I.premultiplyAlpha),G.push(I.flipY),G.push(I.unpackAlignment),G.push(I.colorSpace),G.join()}function N(I,G){const K=r.get(I);if(I.isVideoTexture&&ee(I),I.isRenderTargetTexture===!1&&I.version>0&&K.__version!==I.version){const ge=I.image;if(ge===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ge.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(K,I,G);return}}t.bindTexture(n.TEXTURE_2D,K.__webglTexture,n.TEXTURE0+G)}function F(I,G){const K=r.get(I);if(I.version>0&&K.__version!==I.version){re(K,I,G);return}t.bindTexture(n.TEXTURE_2D_ARRAY,K.__webglTexture,n.TEXTURE0+G)}function O(I,G){const K=r.get(I);if(I.version>0&&K.__version!==I.version){re(K,I,G);return}t.bindTexture(n.TEXTURE_3D,K.__webglTexture,n.TEXTURE0+G)}function H(I,G){const K=r.get(I);if(I.version>0&&K.__version!==I.version){_e(K,I,G);return}t.bindTexture(n.TEXTURE_CUBE_MAP,K.__webglTexture,n.TEXTURE0+G)}const U={[hi]:n.REPEAT,[Ui]:n.CLAMP_TO_EDGE,[fb]:n.MIRRORED_REPEAT},$={[Jr]:n.NEAREST,[fE]:n.NEAREST_MIPMAP_NEAREST,[Dd]:n.NEAREST_MIPMAP_LINEAR,[jr]:n.LINEAR,[X1]:n.LINEAR_MIPMAP_NEAREST,[Pl]:n.LINEAR_MIPMAP_LINEAR},Y={[MSe]:n.NEVER,[RSe]:n.ALWAYS,[TSe]:n.LESS,[ej]:n.LEQUAL,[CSe]:n.EQUAL,[LSe]:n.GEQUAL,[ESe]:n.GREATER,[PSe]:n.NOTEQUAL};function oe(I,G,K){if(G.type===ko&&e.has("OES_texture_float_linear")===!1&&(G.magFilter===jr||G.magFilter===X1||G.magFilter===Dd||G.magFilter===Pl||G.minFilter===jr||G.minFilter===X1||G.minFilter===Dd||G.minFilter===Pl)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),K?(n.texParameteri(I,n.TEXTURE_WRAP_S,U[G.wrapS]),n.texParameteri(I,n.TEXTURE_WRAP_T,U[G.wrapT]),(I===n.TEXTURE_3D||I===n.TEXTURE_2D_ARRAY)&&n.texParameteri(I,n.TEXTURE_WRAP_R,U[G.wrapR]),n.texParameteri(I,n.TEXTURE_MAG_FILTER,$[G.magFilter]),n.texParameteri(I,n.TEXTURE_MIN_FILTER,$[G.minFilter])):(n.texParameteri(I,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(I,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(I===n.TEXTURE_3D||I===n.TEXTURE_2D_ARRAY)&&n.texParameteri(I,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(G.wrapS!==Ui||G.wrapT!==Ui)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(I,n.TEXTURE_MAG_FILTER,S(G.magFilter)),n.texParameteri(I,n.TEXTURE_MIN_FILTER,S(G.minFilter)),G.minFilter!==Jr&&G.minFilter!==jr&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),G.compareFunction&&(n.texParameteri(I,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(I,n.TEXTURE_COMPARE_FUNC,Y[G.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ge=e.get("EXT_texture_filter_anisotropic");if(G.magFilter===Jr||G.minFilter!==Dd&&G.minFilter!==Pl||G.type===ko&&e.has("OES_texture_float_linear")===!1||o===!1&&G.type===l0&&e.has("OES_texture_half_float_linear")===!1)return;(G.anisotropy>1||r.get(G).__currentAnisotropy)&&(n.texParameterf(I,ge.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(G.anisotropy,i.getMaxAnisotropy())),r.get(G).__currentAnisotropy=G.anisotropy)}}function X(I,G){let K=!1;I.__webglInit===void 0&&(I.__webglInit=!0,G.addEventListener("dispose",w));const ge=G.source;let Ee=f.get(ge);Ee===void 0&&(Ee={},f.set(ge,Ee));const q=R(G);if(q!==I.__cacheKey){Ee[q]===void 0&&(Ee[q]={texture:n.createTexture(),usedTimes:0},s.memory.textures++,K=!0),Ee[q].usedTimes++;const le=Ee[I.__cacheKey];le!==void 0&&(Ee[I.__cacheKey].usedTimes--,le.usedTimes===0&&A(G)),I.__cacheKey=q,I.__webglTexture=Ee[q].texture}return K}function re(I,G,K){let ge=n.TEXTURE_2D;(G.isDataArrayTexture||G.isCompressedArrayTexture)&&(ge=n.TEXTURE_2D_ARRAY),G.isData3DTexture&&(ge=n.TEXTURE_3D);const Ee=X(I,G),q=G.source;t.bindTexture(ge,I.__webglTexture,n.TEXTURE0+K);const le=r.get(q);if(q.version!==le.__version||Ee===!0){t.activeTexture(n.TEXTURE0+K);const ue=Bn.getPrimaries(Bn.workingColorSpace),be=G.colorSpace===Es?null:Bn.getPrimaries(G.colorSpace),He=G.colorSpace===Es||ue===be?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,G.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,G.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,G.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,He);const nt=m(G)&&v(G.image)===!1;let ke=g(G.image,nt,!1,i.maxTextureSize);ke=ae(G,ke);const Tt=v(ke)||o,wt=a.convert(G.format,G.colorSpace);let pt=a.convert(G.type),lt=x(G.internalFormat,wt,pt,G.colorSpace,G.isVideoTexture);oe(ge,G,Tt);let Ze;const At=G.mipmaps,ce=o&&G.isVideoTexture!==!0&&lt!==Z$,We=le.__version===void 0||Ee===!0,at=q.dataReady,vt=b(G,ke,Tt);if(G.isDepthTexture)lt=n.DEPTH_COMPONENT,o?G.type===ko?lt=n.DEPTH_COMPONENT32F:G.type===$u?lt=n.DEPTH_COMPONENT24:G.type===Jh?lt=n.DEPTH24_STENCIL8:lt=n.DEPTH_COMPONENT16:G.type===ko&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),G.format===ef&&lt===n.DEPTH_COMPONENT&&G.type!==CR&&G.type!==$u&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),G.type=$u,pt=a.convert(G.type)),G.format===Dp&&lt===n.DEPTH_COMPONENT&&(lt=n.DEPTH_STENCIL,G.type!==Jh&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),G.type=Jh,pt=a.convert(G.type))),We&&(ce?t.texStorage2D(n.TEXTURE_2D,1,lt,ke.width,ke.height):t.texImage2D(n.TEXTURE_2D,0,lt,ke.width,ke.height,0,wt,pt,null));else if(G.isDataTexture)if(At.length>0&&Tt){ce&&We&&t.texStorage2D(n.TEXTURE_2D,vt,lt,At[0].width,At[0].height);for(let se=0,Ye=At.length;se<Ye;se++)Ze=At[se],ce?at&&t.texSubImage2D(n.TEXTURE_2D,se,0,0,Ze.width,Ze.height,wt,pt,Ze.data):t.texImage2D(n.TEXTURE_2D,se,lt,Ze.width,Ze.height,0,wt,pt,Ze.data);G.generateMipmaps=!1}else ce?(We&&t.texStorage2D(n.TEXTURE_2D,vt,lt,ke.width,ke.height),at&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,ke.width,ke.height,wt,pt,ke.data)):t.texImage2D(n.TEXTURE_2D,0,lt,ke.width,ke.height,0,wt,pt,ke.data);else if(G.isCompressedTexture)if(G.isCompressedArrayTexture){ce&&We&&t.texStorage3D(n.TEXTURE_2D_ARRAY,vt,lt,At[0].width,At[0].height,ke.depth);for(let se=0,Ye=At.length;se<Ye;se++)Ze=At[se],G.format!==Cs?wt!==null?ce?at&&t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,se,0,0,0,Ze.width,Ze.height,ke.depth,wt,Ze.data,0,0):t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,se,lt,Ze.width,Ze.height,ke.depth,0,Ze.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ce?at&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,se,0,0,0,Ze.width,Ze.height,ke.depth,wt,pt,Ze.data):t.texImage3D(n.TEXTURE_2D_ARRAY,se,lt,Ze.width,Ze.height,ke.depth,0,wt,pt,Ze.data)}else{ce&&We&&t.texStorage2D(n.TEXTURE_2D,vt,lt,At[0].width,At[0].height);for(let se=0,Ye=At.length;se<Ye;se++)Ze=At[se],G.format!==Cs?wt!==null?ce?at&&t.compressedTexSubImage2D(n.TEXTURE_2D,se,0,0,Ze.width,Ze.height,wt,Ze.data):t.compressedTexImage2D(n.TEXTURE_2D,se,lt,Ze.width,Ze.height,0,Ze.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ce?at&&t.texSubImage2D(n.TEXTURE_2D,se,0,0,Ze.width,Ze.height,wt,pt,Ze.data):t.texImage2D(n.TEXTURE_2D,se,lt,Ze.width,Ze.height,0,wt,pt,Ze.data)}else if(G.isDataArrayTexture)ce?(We&&t.texStorage3D(n.TEXTURE_2D_ARRAY,vt,lt,ke.width,ke.height,ke.depth),at&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,ke.width,ke.height,ke.depth,wt,pt,ke.data)):t.texImage3D(n.TEXTURE_2D_ARRAY,0,lt,ke.width,ke.height,ke.depth,0,wt,pt,ke.data);else if(G.isData3DTexture)ce?(We&&t.texStorage3D(n.TEXTURE_3D,vt,lt,ke.width,ke.height,ke.depth),at&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,ke.width,ke.height,ke.depth,wt,pt,ke.data)):t.texImage3D(n.TEXTURE_3D,0,lt,ke.width,ke.height,ke.depth,0,wt,pt,ke.data);else if(G.isFramebufferTexture){if(We)if(ce)t.texStorage2D(n.TEXTURE_2D,vt,lt,ke.width,ke.height);else{let se=ke.width,Ye=ke.height;for(let je=0;je<vt;je++)t.texImage2D(n.TEXTURE_2D,je,lt,se,Ye,0,wt,pt,null),se>>=1,Ye>>=1}}else if(At.length>0&&Tt){ce&&We&&t.texStorage2D(n.TEXTURE_2D,vt,lt,At[0].width,At[0].height);for(let se=0,Ye=At.length;se<Ye;se++)Ze=At[se],ce?at&&t.texSubImage2D(n.TEXTURE_2D,se,0,0,wt,pt,Ze):t.texImage2D(n.TEXTURE_2D,se,lt,wt,pt,Ze);G.generateMipmaps=!1}else ce?(We&&t.texStorage2D(n.TEXTURE_2D,vt,lt,ke.width,ke.height),at&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,wt,pt,ke)):t.texImage2D(n.TEXTURE_2D,0,lt,wt,pt,ke);y(G,Tt)&&_(ge),le.__version=q.version,G.onUpdate&&G.onUpdate(G)}I.__version=G.version}function _e(I,G,K){if(G.image.length!==6)return;const ge=X(I,G),Ee=G.source;t.bindTexture(n.TEXTURE_CUBE_MAP,I.__webglTexture,n.TEXTURE0+K);const q=r.get(Ee);if(Ee.version!==q.__version||ge===!0){t.activeTexture(n.TEXTURE0+K);const le=Bn.getPrimaries(Bn.workingColorSpace),ue=G.colorSpace===Es?null:Bn.getPrimaries(G.colorSpace),be=G.colorSpace===Es||le===ue?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,G.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,G.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,G.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,be);const He=G.isCompressedTexture||G.image[0].isCompressedTexture,nt=G.image[0]&&G.image[0].isDataTexture,ke=[];for(let se=0;se<6;se++)!He&&!nt?ke[se]=g(G.image[se],!1,!0,i.maxCubemapSize):ke[se]=nt?G.image[se].image:G.image[se],ke[se]=ae(G,ke[se]);const Tt=ke[0],wt=v(Tt)||o,pt=a.convert(G.format,G.colorSpace),lt=a.convert(G.type),Ze=x(G.internalFormat,pt,lt,G.colorSpace),At=o&&G.isVideoTexture!==!0,ce=q.__version===void 0||ge===!0,We=Ee.dataReady;let at=b(G,Tt,wt);oe(n.TEXTURE_CUBE_MAP,G,wt);let vt;if(He){At&&ce&&t.texStorage2D(n.TEXTURE_CUBE_MAP,at,Ze,Tt.width,Tt.height);for(let se=0;se<6;se++){vt=ke[se].mipmaps;for(let Ye=0;Ye<vt.length;Ye++){const je=vt[Ye];G.format!==Cs?pt!==null?At?We&&t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,Ye,0,0,je.width,je.height,pt,je.data):t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,Ye,Ze,je.width,je.height,0,je.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):At?We&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,Ye,0,0,je.width,je.height,pt,lt,je.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,Ye,Ze,je.width,je.height,0,pt,lt,je.data)}}}else{vt=G.mipmaps,At&&ce&&(vt.length>0&&at++,t.texStorage2D(n.TEXTURE_CUBE_MAP,at,Ze,ke[0].width,ke[0].height));for(let se=0;se<6;se++)if(nt){At?We&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,0,0,ke[se].width,ke[se].height,pt,lt,ke[se].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,Ze,ke[se].width,ke[se].height,0,pt,lt,ke[se].data);for(let Ye=0;Ye<vt.length;Ye++){const Q=vt[Ye].image[se].image;At?We&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,Ye+1,0,0,Q.width,Q.height,pt,lt,Q.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,Ye+1,Ze,Q.width,Q.height,0,pt,lt,Q.data)}}else{At?We&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,0,0,pt,lt,ke[se]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,0,Ze,pt,lt,ke[se]);for(let Ye=0;Ye<vt.length;Ye++){const je=vt[Ye];At?We&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,Ye+1,0,0,pt,lt,je.image[se]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+se,Ye+1,Ze,pt,lt,je.image[se])}}}y(G,wt)&&_(n.TEXTURE_CUBE_MAP),q.__version=Ee.version,G.onUpdate&&G.onUpdate(G)}I.__version=G.version}function Fe(I,G,K,ge,Ee,q){const le=a.convert(K.format,K.colorSpace),ue=a.convert(K.type),be=x(K.internalFormat,le,ue,K.colorSpace);if(!r.get(G).__hasExternalTextures){const nt=Math.max(1,G.width>>q),ke=Math.max(1,G.height>>q);Ee===n.TEXTURE_3D||Ee===n.TEXTURE_2D_ARRAY?t.texImage3D(Ee,q,be,nt,ke,G.depth,0,le,ue,null):t.texImage2D(Ee,q,be,nt,ke,0,le,ue,null)}t.bindFramebuffer(n.FRAMEBUFFER,I),V(G)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ge,Ee,r.get(K).__webglTexture,0,we(G)):(Ee===n.TEXTURE_2D||Ee>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Ee<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ge,Ee,r.get(K).__webglTexture,q),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ce(I,G,K){if(n.bindRenderbuffer(n.RENDERBUFFER,I),G.depthBuffer&&!G.stencilBuffer){let ge=o===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(K||V(G)){const Ee=G.depthTexture;Ee&&Ee.isDepthTexture&&(Ee.type===ko?ge=n.DEPTH_COMPONENT32F:Ee.type===$u&&(ge=n.DEPTH_COMPONENT24));const q=we(G);V(G)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,q,ge,G.width,G.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,q,ge,G.width,G.height)}else n.renderbufferStorage(n.RENDERBUFFER,ge,G.width,G.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,I)}else if(G.depthBuffer&&G.stencilBuffer){const ge=we(G);K&&V(G)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,ge,n.DEPTH24_STENCIL8,G.width,G.height):V(G)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ge,n.DEPTH24_STENCIL8,G.width,G.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,G.width,G.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,I)}else{const ge=G.isWebGLMultipleRenderTargets===!0?G.texture:[G.texture];for(let Ee=0;Ee<ge.length;Ee++){const q=ge[Ee],le=a.convert(q.format,q.colorSpace),ue=a.convert(q.type),be=x(q.internalFormat,le,ue,q.colorSpace),He=we(G);K&&V(G)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,He,be,G.width,G.height):V(G)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,He,be,G.width,G.height):n.renderbufferStorage(n.RENDERBUFFER,be,G.width,G.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function Ae(I,G){if(G&&G.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,I),!(G.depthTexture&&G.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(G.depthTexture).__webglTexture||G.depthTexture.image.width!==G.width||G.depthTexture.image.height!==G.height)&&(G.depthTexture.image.width=G.width,G.depthTexture.image.height=G.height,G.depthTexture.needsUpdate=!0),N(G.depthTexture,0);const ge=r.get(G.depthTexture).__webglTexture,Ee=we(G);if(G.depthTexture.format===ef)V(G)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,ge,0,Ee):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,ge,0);else if(G.depthTexture.format===Dp)V(G)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,ge,0,Ee):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,ge,0);else throw new Error("Unknown depthTexture format")}function ze(I){const G=r.get(I),K=I.isWebGLCubeRenderTarget===!0;if(I.depthTexture&&!G.__autoAllocateDepthBuffer){if(K)throw new Error("target.depthTexture not supported in Cube render targets");Ae(G.__webglFramebuffer,I)}else if(K){G.__webglDepthbuffer=[];for(let ge=0;ge<6;ge++)t.bindFramebuffer(n.FRAMEBUFFER,G.__webglFramebuffer[ge]),G.__webglDepthbuffer[ge]=n.createRenderbuffer(),Ce(G.__webglDepthbuffer[ge],I,!1)}else t.bindFramebuffer(n.FRAMEBUFFER,G.__webglFramebuffer),G.__webglDepthbuffer=n.createRenderbuffer(),Ce(G.__webglDepthbuffer,I,!1);t.bindFramebuffer(n.FRAMEBUFFER,null)}function fe(I,G,K){const ge=r.get(I);G!==void 0&&Fe(ge.__webglFramebuffer,I,I.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),K!==void 0&&ze(I)}function j(I){const G=I.texture,K=r.get(I),ge=r.get(G);I.addEventListener("dispose",T),I.isWebGLMultipleRenderTargets!==!0&&(ge.__webglTexture===void 0&&(ge.__webglTexture=n.createTexture()),ge.__version=G.version,s.memory.textures++);const Ee=I.isWebGLCubeRenderTarget===!0,q=I.isWebGLMultipleRenderTargets===!0,le=v(I)||o;if(Ee){K.__webglFramebuffer=[];for(let ue=0;ue<6;ue++)if(o&&G.mipmaps&&G.mipmaps.length>0){K.__webglFramebuffer[ue]=[];for(let be=0;be<G.mipmaps.length;be++)K.__webglFramebuffer[ue][be]=n.createFramebuffer()}else K.__webglFramebuffer[ue]=n.createFramebuffer()}else{if(o&&G.mipmaps&&G.mipmaps.length>0){K.__webglFramebuffer=[];for(let ue=0;ue<G.mipmaps.length;ue++)K.__webglFramebuffer[ue]=n.createFramebuffer()}else K.__webglFramebuffer=n.createFramebuffer();if(q)if(i.drawBuffers){const ue=I.texture;for(let be=0,He=ue.length;be<He;be++){const nt=r.get(ue[be]);nt.__webglTexture===void 0&&(nt.__webglTexture=n.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(o&&I.samples>0&&V(I)===!1){const ue=q?G:[G];K.__webglMultisampledFramebuffer=n.createFramebuffer(),K.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,K.__webglMultisampledFramebuffer);for(let be=0;be<ue.length;be++){const He=ue[be];K.__webglColorRenderbuffer[be]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,K.__webglColorRenderbuffer[be]);const nt=a.convert(He.format,He.colorSpace),ke=a.convert(He.type),Tt=x(He.internalFormat,nt,ke,He.colorSpace,I.isXRRenderTarget===!0),wt=we(I);n.renderbufferStorageMultisample(n.RENDERBUFFER,wt,Tt,I.width,I.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+be,n.RENDERBUFFER,K.__webglColorRenderbuffer[be])}n.bindRenderbuffer(n.RENDERBUFFER,null),I.depthBuffer&&(K.__webglDepthRenderbuffer=n.createRenderbuffer(),Ce(K.__webglDepthRenderbuffer,I,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}}if(Ee){t.bindTexture(n.TEXTURE_CUBE_MAP,ge.__webglTexture),oe(n.TEXTURE_CUBE_MAP,G,le);for(let ue=0;ue<6;ue++)if(o&&G.mipmaps&&G.mipmaps.length>0)for(let be=0;be<G.mipmaps.length;be++)Fe(K.__webglFramebuffer[ue][be],I,G,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+ue,be);else Fe(K.__webglFramebuffer[ue],I,G,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+ue,0);y(G,le)&&_(n.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(q){const ue=I.texture;for(let be=0,He=ue.length;be<He;be++){const nt=ue[be],ke=r.get(nt);t.bindTexture(n.TEXTURE_2D,ke.__webglTexture),oe(n.TEXTURE_2D,nt,le),Fe(K.__webglFramebuffer,I,nt,n.COLOR_ATTACHMENT0+be,n.TEXTURE_2D,0),y(nt,le)&&_(n.TEXTURE_2D)}t.unbindTexture()}else{let ue=n.TEXTURE_2D;if((I.isWebGL3DRenderTarget||I.isWebGLArrayRenderTarget)&&(o?ue=I.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(ue,ge.__webglTexture),oe(ue,G,le),o&&G.mipmaps&&G.mipmaps.length>0)for(let be=0;be<G.mipmaps.length;be++)Fe(K.__webglFramebuffer[be],I,G,n.COLOR_ATTACHMENT0,ue,be);else Fe(K.__webglFramebuffer,I,G,n.COLOR_ATTACHMENT0,ue,0);y(G,le)&&_(ue),t.unbindTexture()}I.depthBuffer&&ze(I)}function xe(I){const G=v(I)||o,K=I.isWebGLMultipleRenderTargets===!0?I.texture:[I.texture];for(let ge=0,Ee=K.length;ge<Ee;ge++){const q=K[ge];if(y(q,G)){const le=I.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D,ue=r.get(q).__webglTexture;t.bindTexture(le,ue),_(le),t.unbindTexture()}}}function pe(I){if(o&&I.samples>0&&V(I)===!1){const G=I.isWebGLMultipleRenderTargets?I.texture:[I.texture],K=I.width,ge=I.height;let Ee=n.COLOR_BUFFER_BIT;const q=[],le=I.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ue=r.get(I),be=I.isWebGLMultipleRenderTargets===!0;if(be)for(let He=0;He<G.length;He++)t.bindFramebuffer(n.FRAMEBUFFER,ue.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+He,n.RENDERBUFFER,null),t.bindFramebuffer(n.FRAMEBUFFER,ue.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+He,n.TEXTURE_2D,null,0);t.bindFramebuffer(n.READ_FRAMEBUFFER,ue.__webglMultisampledFramebuffer),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,ue.__webglFramebuffer);for(let He=0;He<G.length;He++){q.push(n.COLOR_ATTACHMENT0+He),I.depthBuffer&&q.push(le);const nt=ue.__ignoreDepthValues!==void 0?ue.__ignoreDepthValues:!1;if(nt===!1&&(I.depthBuffer&&(Ee|=n.DEPTH_BUFFER_BIT),I.stencilBuffer&&(Ee|=n.STENCIL_BUFFER_BIT)),be&&n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,ue.__webglColorRenderbuffer[He]),nt===!0&&(n.invalidateFramebuffer(n.READ_FRAMEBUFFER,[le]),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[le])),be){const ke=r.get(G[He]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,ke,0)}n.blitFramebuffer(0,0,K,ge,0,0,K,ge,Ee,n.NEAREST),u&&n.invalidateFramebuffer(n.READ_FRAMEBUFFER,q)}if(t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),be)for(let He=0;He<G.length;He++){t.bindFramebuffer(n.FRAMEBUFFER,ue.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+He,n.RENDERBUFFER,ue.__webglColorRenderbuffer[He]);const nt=r.get(G[He]).__webglTexture;t.bindFramebuffer(n.FRAMEBUFFER,ue.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+He,n.TEXTURE_2D,nt,0)}t.bindFramebuffer(n.DRAW_FRAMEBUFFER,ue.__webglMultisampledFramebuffer)}}function we(I){return Math.min(i.maxSamples,I.samples)}function V(I){const G=r.get(I);return o&&I.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&G.__useRenderToTexture!==!1}function ee(I){const G=s.render.frame;c.get(I)!==G&&(c.set(I,G),I.update())}function ae(I,G){const K=I.colorSpace,ge=I.format,Ee=I.type;return I.isCompressedTexture===!0||I.isVideoTexture===!0||I.format===vE||K!==ai&&K!==Es&&(Bn.getTransfer(K)===sr?o===!1?e.has("EXT_sRGB")===!0&&ge===Cs?(I.format=vE,I.minFilter=jr,I.generateMipmaps=!1):G=nj.sRGBToLinear(G):(ge!==Cs||Ee!==rc)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",K)),G}this.allocateTextureUnit=L,this.resetTextureUnits=D,this.setTexture2D=N,this.setTexture2DArray=F,this.setTexture3D=O,this.setTextureCube=H,this.rebindTextures=fe,this.setupRenderTarget=j,this.updateRenderTargetMipmap=xe,this.updateMultisampleRenderTarget=pe,this.setupDepthRenderbuffer=ze,this.setupFrameBufferTexture=Fe,this.useMultisampledRTT=V}function WTe(n,e,t){const r=t.isWebGL2;function i(a,s=Es){let o;const l=Bn.getTransfer(s);if(a===rc)return n.UNSIGNED_BYTE;if(a===j$)return n.UNSIGNED_SHORT_4_4_4_4;if(a===q$)return n.UNSIGNED_SHORT_5_5_5_1;if(a===fSe)return n.BYTE;if(a===dSe)return n.SHORT;if(a===CR)return n.UNSIGNED_SHORT;if(a===$$)return n.INT;if(a===$u)return n.UNSIGNED_INT;if(a===ko)return n.FLOAT;if(a===l0)return r?n.HALF_FLOAT:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(a===pSe)return n.ALPHA;if(a===Cs)return n.RGBA;if(a===vSe)return n.LUMINANCE;if(a===gSe)return n.LUMINANCE_ALPHA;if(a===ef)return n.DEPTH_COMPONENT;if(a===Dp)return n.DEPTH_STENCIL;if(a===vE)return o=e.get("EXT_sRGB"),o!==null?o.SRGB_ALPHA_EXT:null;if(a===mSe)return n.RED;if(a===X$)return n.RED_INTEGER;if(a===ySe)return n.RG;if(a===Y$)return n.RG_INTEGER;if(a===K$)return n.RGBA_INTEGER;if(a===QM||a===JM||a===e2||a===t2)if(l===sr)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(a===QM)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(a===JM)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(a===e2)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(a===t2)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(a===QM)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===JM)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===e2)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===t2)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===jF||a===qF||a===XF||a===YF)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(a===jF)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===qF)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===XF)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===YF)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===Z$)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(a===KF||a===ZF)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(a===KF)return l===sr?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(a===ZF)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(a===QF||a===JF||a===e8||a===t8||a===n8||a===r8||a===i8||a===a8||a===s8||a===o8||a===l8||a===u8||a===c8||a===h8)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(a===QF)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(a===JF)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(a===e8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(a===t8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(a===n8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(a===r8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(a===i8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(a===a8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(a===s8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(a===o8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(a===l8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(a===u8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(a===c8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(a===h8)return l===sr?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(a===n2||a===f8||a===d8)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(a===n2)return l===sr?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(a===f8)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(a===d8)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(a===_Se||a===p8||a===v8||a===g8)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(a===n2)return o.COMPRESSED_RED_RGTC1_EXT;if(a===p8)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(a===v8)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(a===g8)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return a===Jh?r?n.UNSIGNED_INT_24_8:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):n[a]!==void 0?n[a]:null}return{convert:i}}class $Te extends Gi{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class kn extends er{constructor(){super(),this.isGroup=!0,this.type="Group"}}const jTe={type:"move"};class T2{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new kn,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 kn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new te,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new te),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new kn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new te,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new te),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 r of e.hand.values())this._getHandJoint(t,r)}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,r){let i=null,a=null,s=null;const o=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){s=!0;for(const g of e.hand.values()){const v=t.getJointPose(g,r),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,r),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));o!==null&&(i=t.getPose(e.targetRaySpace,r),i===null&&a!==null&&(i=a),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(jTe)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=s!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const r=new kn;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}const qTe=`
void main() {
gl_Position = vec4( position, 1.0 );
}`,XTe=`
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 YTe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,r){if(this.texture===null){const i=new ni,a=e.properties.get(i);a.__webglTexture=t.texture,(t.depthNear!=r.depthNear||t.depthFar!=r.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const r=t.cameras[0].viewport,i=new jl({extensions:{fragDepth:!0},vertexShader:qTe,fragmentShader:XTe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:r.z},depthHeight:{value:r.w}}});this.mesh=new An(new Ss(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class KTe extends Rf{constructor(e,t){super();const r=this;let i=null,a=1,s=null,o="local-floor",l=1,u=null,c=null,h=null,f=null,d=null,p=null;const g=new YTe,v=t.getContextAttributes();let m=null,y=null;const _=[],x=[],b=new Ge;let S=null;const w=new Gi;w.layers.enable(1),w.viewport=new En;const T=new Gi;T.layers.enable(2),T.viewport=new En;const C=[w,T],A=new $Te;A.layers.enable(1),A.layers.enable(2);let M=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let re=_[X];return re===void 0&&(re=new T2,_[X]=re),re.getTargetRaySpace()},this.getControllerGrip=function(X){let re=_[X];return re===void 0&&(re=new T2,_[X]=re),re.getGripSpace()},this.getHand=function(X){let re=_[X];return re===void 0&&(re=new T2,_[X]=re),re.getHandSpace()};function D(X){const re=x.indexOf(X.inputSource);if(re===-1)return;const _e=_[re];_e!==void 0&&(_e.update(X.inputSource,X.frame,u||s),_e.dispatchEvent({type:X.type,data:X.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",R);for(let X=0;X<_.length;X++){const re=x[X];re!==null&&(x[X]=null,_[X].disconnect(re))}M=null,P=null,g.reset(),e.setRenderTarget(m),d=null,f=null,h=null,i=null,y=null,oe.stop(),r.isPresenting=!1,e.setPixelRatio(S),e.setSize(b.width,b.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(X){a=X,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(X){o=X,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||s},this.setReferenceSpace=function(X){u=X},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(X){return $e(this,null,function*(){if(i=X,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",R),v.xrCompatible!==!0&&(yield t.makeXRCompatible()),S=e.getPixelRatio(),e.getSize(b),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const re={antialias:i.renderState.layers===void 0?v.antialias:!0,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:a};d=new XRWebGLLayer(i,t,re),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),y=new pf(d.framebufferWidth,d.framebufferHeight,{format:Cs,type:rc,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil})}else{let re=null,_e=null,Fe=null;v.depth&&(Fe=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,re=v.stencil?Dp:ef,_e=v.stencil?Jh:$u);const Ce={colorFormat:t.RGBA8,depthFormat:Fe,scaleFactor:a};h=new XRWebGLBinding(i,t),f=h.createProjectionLayer(Ce),i.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),y=new pf(f.textureWidth,f.textureHeight,{format:Cs,type:rc,depthTexture:new fj(f.textureWidth,f.textureHeight,_e,void 0,void 0,void 0,void 0,void 0,void 0,re),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:v.antialias?4:0});const Ae=e.properties.get(y);Ae.__ignoreDepthValues=f.ignoreDepthValues}y.isXRRenderTarget=!0,this.setFoveation(l),u=null,s=yield i.requestReferenceSpace(o),oe.setContext(i),oe.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function R(X){for(let re=0;re<X.removed.length;re++){const _e=X.removed[re],Fe=x.indexOf(_e);Fe>=0&&(x[Fe]=null,_[Fe].disconnect(_e))}for(let re=0;re<X.added.length;re++){const _e=X.added[re];let Fe=x.indexOf(_e);if(Fe===-1){for(let Ae=0;Ae<_.length;Ae++)if(Ae>=x.length){x.push(_e),Fe=Ae;break}else if(x[Ae]===null){x[Ae]=_e,Fe=Ae;break}if(Fe===-1)break}const Ce=_[Fe];Ce&&Ce.connect(_e)}}const N=new te,F=new te;function O(X,re,_e){N.setFromMatrixPosition(re.matrixWorld),F.setFromMatrixPosition(_e.matrixWorld);const Fe=N.distanceTo(F),Ce=re.projectionMatrix.elements,Ae=_e.projectionMatrix.elements,ze=Ce[14]/(Ce[10]-1),fe=Ce[14]/(Ce[10]+1),j=(Ce[9]+1)/Ce[5],xe=(Ce[9]-1)/Ce[5],pe=(Ce[8]-1)/Ce[0],we=(Ae[8]+1)/Ae[0],V=ze*pe,ee=ze*we,ae=Fe/(-pe+we),I=ae*-pe;re.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(I),X.translateZ(ae),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert();const G=ze+ae,K=fe+ae,ge=V-I,Ee=ee+(Fe-I),q=j*fe/K*G,le=xe*fe/K*G;X.projectionMatrix.makePerspective(ge,Ee,q,le,G,K),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}function H(X,re){re===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(re.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(i===null)return;g.texture!==null&&(X.near=g.depthNear,X.far=g.depthFar),A.near=T.near=w.near=X.near,A.far=T.far=w.far=X.far,(M!==A.near||P!==A.far)&&(i.updateRenderState({depthNear:A.near,depthFar:A.far}),M=A.near,P=A.far,w.near=M,w.far=P,T.near=M,T.far=P,w.updateProjectionMatrix(),T.updateProjectionMatrix(),X.updateProjectionMatrix());const re=X.parent,_e=A.cameras;H(A,re);for(let Fe=0;Fe<_e.length;Fe++)H(_e[Fe],re);_e.length===2?O(A,w,T):A.projectionMatrix.copy(w.projectionMatrix),U(X,A,re)};function U(X,re,_e){_e===null?X.matrix.copy(re.matrixWorld):(X.matrix.copy(_e.matrixWorld),X.matrix.invert(),X.matrix.multiply(re.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(re.projectionMatrix),X.projectionMatrixInverse.copy(re.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=Np*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return A},this.getFoveation=function(){if(!(f===null&&d===null))return l},this.setFoveation=function(X){l=X,f!==null&&(f.fixedFoveation=X),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=X)},this.hasDepthSensing=function(){return g.texture!==null};let $=null;function Y(X,re){if(c=re.getViewerPose(u||s),p=re,c!==null){const _e=c.views;d!==null&&(e.setRenderTargetFramebuffer(y,d.framebuffer),e.setRenderTarget(y));let Fe=!1;_e.length!==A.cameras.length&&(A.cameras.length=0,Fe=!0);for(let Ae=0;Ae<_e.length;Ae++){const ze=_e[Ae];let fe=null;if(d!==null)fe=d.getViewport(ze);else{const xe=h.getViewSubImage(f,ze);fe=xe.viewport,Ae===0&&(e.setRenderTargetTextures(y,xe.colorTexture,f.ignoreDepthValues?void 0:xe.depthStencilTexture),e.setRenderTarget(y))}let j=C[Ae];j===void 0&&(j=new Gi,j.layers.enable(Ae),j.viewport=new En,C[Ae]=j),j.matrix.fromArray(ze.transform.matrix),j.matrix.decompose(j.position,j.quaternion,j.scale),j.projectionMatrix.fromArray(ze.projectionMatrix),j.projectionMatrixInverse.copy(j.projectionMatrix).invert(),j.viewport.set(fe.x,fe.y,fe.width,fe.height),Ae===0&&(A.matrix.copy(j.matrix),A.matrix.decompose(A.position,A.quaternion,A.scale)),Fe===!0&&A.cameras.push(j)}const Ce=i.enabledFeatures;if(Ce&&Ce.includes("depth-sensing")){const Ae=h.getDepthInformation(_e[0]);Ae&&Ae.isValid&&Ae.texture&&g.init(e,Ae,i.renderState)}}for(let _e=0;_e<_.length;_e++){const Fe=x[_e],Ce=_[_e];Fe!==null&&Ce!==void 0&&Ce.update(Fe,re,u||s)}g.render(e,A),$&&$(X,re),re.detectedPlanes&&r.dispatchEvent({type:"planesdetected",data:re}),p=null}const oe=new hj;oe.setAnimationLoop(Y),this.setAnimationLoop=function(X){$=X},this.dispose=function(){}}}function ZTe(n,e){function t(v,m){v.matrixAutoUpdate===!0&&v.updateMatrix(),m.value.copy(v.matrix)}function r(v,m){m.color.getRGB(v.fogColor.value,lj(n)),m.isFog?(v.fogNear.value=m.near,v.fogFar.value=m.far):m.isFogExp2&&(v.fogDensity.value=m.density)}function i(v,m,y,_,x){m.isMeshBasicMaterial||m.isMeshLambertMaterial?a(v,m):m.isMeshToonMaterial?(a(v,m),h(v,m)):m.isMeshPhongMaterial?(a(v,m),c(v,m)):m.isMeshStandardMaterial?(a(v,m),f(v,m),m.isMeshPhysicalMaterial&&d(v,m,x)):m.isMeshMatcapMaterial?(a(v,m),p(v,m)):m.isMeshDepthMaterial?a(v,m):m.isMeshDistanceMaterial?(a(v,m),g(v,m)):m.isMeshNormalMaterial?a(v,m):m.isLineBasicMaterial?(s(v,m),m.isLineDashedMaterial&&o(v,m)):m.isPointsMaterial?l(v,m,y,_):m.isSpriteMaterial?u(v,m):m.isShadowMaterial?(v.color.value.copy(m.color),v.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function a(v,m){v.opacity.value=m.opacity,m.color&&v.diffuse.value.copy(m.color),m.emissive&&v.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),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.bumpMap&&(v.bumpMap.value=m.bumpMap,t(m.bumpMap,v.bumpMapTransform),v.bumpScale.value=m.bumpScale,m.side===Ta&&(v.bumpScale.value*=-1)),m.normalMap&&(v.normalMap.value=m.normalMap,t(m.normalMap,v.normalMapTransform),v.normalScale.value.copy(m.normalScale),m.side===Ta&&v.normalScale.value.negate()),m.displacementMap&&(v.displacementMap.value=m.displacementMap,t(m.displacementMap,v.displacementMapTransform),v.displacementScale.value=m.displacementScale,v.displacementBias.value=m.displacementBias),m.emissiveMap&&(v.emissiveMap.value=m.emissiveMap,t(m.emissiveMap,v.emissiveMapTransform)),m.specularMap&&(v.specularMap.value=m.specularMap,t(m.specularMap,v.specularMapTransform)),m.alphaTest>0&&(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 _=n._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 s(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 o(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===Ta&&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:r,refreshMaterialUniforms:i}}function QTe(n,e,t,r){let i={},a={},s=[];const o=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(y,_){const x=_.program;r.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 b=_.program;r.updateUBOMapping(y,b);const S=e.render.frame;a[y.id]!==S&&(f(y),a[y.id]=S)}function c(y){const _=h();y.__bindingPointIndex=_;const x=n.createBuffer(),b=y.__size,S=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,x),n.bufferData(n.UNIFORM_BUFFER,b,S),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,_,x),x}function h(){for(let y=0;y<o;y++)if(s.indexOf(y)===-1)return s.push(y),y;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(y){const _=i[y.id],x=y.uniforms,b=y.__cache;n.bindBuffer(n.UNIFORM_BUFFER,_);for(let S=0,w=x.length;S<w;S++){const T=Array.isArray(x[S])?x[S]:[x[S]];for(let C=0,A=T.length;C<A;C++){const M=T[C];if(d(M,S,C,b)===!0){const P=M.__offset,D=Array.isArray(M.value)?M.value:[M.value];let L=0;for(let R=0;R<D.length;R++){const N=D[R],F=g(N);typeof N=="number"||typeof N=="boolean"?(M.__data[0]=N,n.bufferSubData(n.UNIFORM_BUFFER,P+L,M.__data)):N.isMatrix3?(M.__data[0]=N.elements[0],M.__data[1]=N.elements[1],M.__data[2]=N.elements[2],M.__data[3]=0,M.__data[4]=N.elements[3],M.__data[5]=N.elements[4],M.__data[6]=N.elements[5],M.__data[7]=0,M.__data[8]=N.elements[6],M.__data[9]=N.elements[7],M.__data[10]=N.elements[8],M.__data[11]=0):(N.toArray(M.__data,L),L+=F.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,P,M.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function d(y,_,x,b){const S=y.value,w=_+"_"+x;if(b[w]===void 0)return typeof S=="number"||typeof S=="boolean"?b[w]=S:b[w]=S.clone(),!0;{const T=b[w];if(typeof S=="number"||typeof S=="boolean"){if(T!==S)return b[w]=S,!0}else if(T.equals(S)===!1)return T.copy(S),!0}return!1}function p(y){const _=y.uniforms;let x=0;const b=16;for(let w=0,T=_.length;w<T;w++){const C=Array.isArray(_[w])?_[w]:[_[w]];for(let A=0,M=C.length;A<M;A++){const P=C[A],D=Array.isArray(P.value)?P.value:[P.value];for(let L=0,R=D.length;L<R;L++){const N=D[L],F=g(N),O=x%b;O!==0&&b-O<F.boundary&&(x+=b-O),P.__data=new Float32Array(F.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=x,x+=F.storage}}}const S=x%b;return S>0&&(x+=b-S),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=s.indexOf(_.__bindingPointIndex);s.splice(x,1),n.deleteBuffer(i[_.id]),delete i[_.id],delete a[_.id]}function m(){for(const y in i)n.deleteBuffer(i[y]);s=[],i={},a={}}return{bind:l,update:u,dispose:m}}class OR{constructor(e={}){const{canvas:t=jSe(),context:r=null,depth:i=!0,stencil:a=!0,alpha:s=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let f;r!==null?f=r.getContextAttributes().alpha:f=s;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=Vn,this._useLegacyLights=!1,this.toneMapping=nc,this.toneMappingExposure=1;const _=this;let x=!1,b=0,S=0,w=null,T=-1,C=null;const A=new En,M=new En;let P=null;const D=new xt(0);let L=0,R=t.width,N=t.height,F=1,O=null,H=null;const U=new En(0,0,R,N),$=new En(0,0,R,N);let Y=!1;const oe=new NR;let X=!1,re=!1,_e=null;const Fe=new Jt,Ce=new Ge,Ae=new te,ze={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function fe(){return w===null?F:1}let j=r;function xe(J,Se){for(let Re=0;Re<J.length;Re++){const Me=J[Re],De=t.getContext(Me,Se);if(De!==null)return De}return null}try{const J={alpha:!0,depth:i,stencil:a,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${MR}`),t.addEventListener("webglcontextlost",vt,!1),t.addEventListener("webglcontextrestored",se,!1),t.addEventListener("webglcontextcreationerror",Ye,!1),j===null){const Se=["webgl2","webgl","experimental-webgl"];if(_.isWebGL1Renderer===!0&&Se.shift(),j=xe(Se,J),j===null)throw xe(Se)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&j instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),j.getShaderPrecisionFormat===void 0&&(j.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(J){throw console.error("THREE.WebGLRenderer: "+J.message),J}let pe,we,V,ee,ae,I,G,K,ge,Ee,q,le,ue,be,He,nt,ke,Tt,wt,pt,lt,Ze,At,ce;function We(){pe=new a2e(j),we=new JMe(j,pe,e),pe.init(we),Ze=new WTe(j,pe,we),V=new VTe(j,pe,we),ee=new l2e(j),ae=new ETe,I=new HTe(j,pe,V,ae,we,Ze,ee),G=new t2e(_),K=new i2e(_),ge=new gwe(j,we),At=new ZMe(j,pe,ge,we),Ee=new s2e(j,ge,ee,At),q=new f2e(j,Ee,ge,ee),wt=new h2e(j,we,I),nt=new e2e(ae),le=new CTe(_,G,K,pe,we,At,nt),ue=new ZTe(_,ae),be=new LTe,He=new OTe(pe,we),Tt=new KMe(_,G,K,V,q,f,l),ke=new UTe(_,q,we),ce=new QTe(j,ee,we,V),pt=new QMe(j,pe,ee,we),lt=new o2e(j,pe,ee,we),ee.programs=le.programs,_.capabilities=we,_.extensions=pe,_.properties=ae,_.renderLists=be,_.shadowMap=ke,_.state=V,_.info=ee}We();const at=new KTe(_,j);this.xr=at,this.getContext=function(){return j},this.getContextAttributes=function(){return j.getContextAttributes()},this.forceContextLoss=function(){const J=pe.get("WEBGL_lose_context");J&&J.loseContext()},this.forceContextRestore=function(){const J=pe.get("WEBGL_lose_context");J&&J.restoreContext()},this.getPixelRatio=function(){return F},this.setPixelRatio=function(J){J!==void 0&&(F=J,this.setSize(R,N,!1))},this.getSize=function(J){return J.set(R,N)},this.setSize=function(J,Se,Re=!0){if(at.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}R=J,N=Se,t.width=Math.floor(J*F),t.height=Math.floor(Se*F),Re===!0&&(t.style.width=J+"px",t.style.height=Se+"px"),this.setViewport(0,0,J,Se)},this.getDrawingBufferSize=function(J){return J.set(R*F,N*F).floor()},this.setDrawingBufferSize=function(J,Se,Re){R=J,N=Se,F=Re,t.width=Math.floor(J*Re),t.height=Math.floor(Se*Re),this.setViewport(0,0,J,Se)},this.getCurrentViewport=function(J){return J.copy(A)},this.getViewport=function(J){return J.copy(U)},this.setViewport=function(J,Se,Re,Me){J.isVector4?U.set(J.x,J.y,J.z,J.w):U.set(J,Se,Re,Me),V.viewport(A.copy(U).multiplyScalar(F).floor())},this.getScissor=function(J){return J.copy($)},this.setScissor=function(J,Se,Re,Me){J.isVector4?$.set(J.x,J.y,J.z,J.w):$.set(J,Se,Re,Me),V.scissor(M.copy($).multiplyScalar(F).floor())},this.getScissorTest=function(){return Y},this.setScissorTest=function(J){V.setScissorTest(Y=J)},this.setOpaqueSort=function(J){O=J},this.setTransparentSort=function(J){H=J},this.getClearColor=function(J){return J.copy(Tt.getClearColor())},this.setClearColor=function(){Tt.setClearColor.apply(Tt,arguments)},this.getClearAlpha=function(){return Tt.getClearAlpha()},this.setClearAlpha=function(){Tt.setClearAlpha.apply(Tt,arguments)},this.clear=function(J=!0,Se=!0,Re=!0){let Me=0;if(J){let De=!1;if(w!==null){const ft=w.texture.format;De=ft===K$||ft===Y$||ft===X$}if(De){const ft=w.texture.type,Pt=ft===rc||ft===$u||ft===CR||ft===Jh||ft===j$||ft===q$,Bt=Tt.getClearColor(),Wt=Tt.getClearAlpha(),tn=Bt.r,$t=Bt.g,Zt=Bt.b;Pt?(d[0]=tn,d[1]=$t,d[2]=Zt,d[3]=Wt,j.clearBufferuiv(j.COLOR,0,d)):(p[0]=tn,p[1]=$t,p[2]=Zt,p[3]=Wt,j.clearBufferiv(j.COLOR,0,p))}else Me|=j.COLOR_BUFFER_BIT}Se&&(Me|=j.DEPTH_BUFFER_BIT),Re&&(Me|=j.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),j.clear(Me)},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",vt,!1),t.removeEventListener("webglcontextrestored",se,!1),t.removeEventListener("webglcontextcreationerror",Ye,!1),be.dispose(),He.dispose(),ae.dispose(),G.dispose(),K.dispose(),q.dispose(),At.dispose(),ce.dispose(),le.dispose(),at.dispose(),at.removeEventListener("sessionstart",xn),at.removeEventListener("sessionend",jt),_e&&(_e.dispose(),_e=null),Tn.stop()};function vt(J){J.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function se(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;const J=ee.autoReset,Se=ke.enabled,Re=ke.autoUpdate,Me=ke.needsUpdate,De=ke.type;We(),ee.autoReset=J,ke.enabled=Se,ke.autoUpdate=Re,ke.needsUpdate=Me,ke.type=De}function Ye(J){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",J.statusMessage)}function je(J){const Se=J.target;Se.removeEventListener("dispose",je),Q(Se)}function Q(J){me(J),ae.remove(J)}function me(J){const Se=ae.get(J).programs;Se!==void 0&&(Se.forEach(function(Re){le.releaseProgram(Re)}),J.isShaderMaterial&&le.releaseShaderCache(J))}this.renderBufferDirect=function(J,Se,Re,Me,De,ft){Se===null&&(Se=ze);const Pt=De.isMesh&&De.matrixWorld.determinant()<0,Bt=_v(J,Se,Re,Me,De);V.setMaterial(Me,Pt);let Wt=Re.index,tn=1;if(Me.wireframe===!0){if(Wt=Ee.getWireframeAttribute(Re),Wt===void 0)return;tn=2}const $t=Re.drawRange,Zt=Re.attributes.position;let pr=$t.start*tn,$i=($t.start+$t.count)*tn;ft!==null&&(pr=Math.max(pr,ft.start*tn),$i=Math.min($i,(ft.start+ft.count)*tn)),Wt!==null?(pr=Math.max(pr,0),$i=Math.min($i,Wt.count)):Zt!=null&&(pr=Math.max(pr,0),$i=Math.min($i,Zt.count));const Ur=$i-pr;if(Ur<0||Ur===1/0)return;At.setup(De,Me,Bt,Re,Wt);let Hs,ir=pt;if(Wt!==null&&(Hs=ge.get(Wt),ir=lt,ir.setIndex(Hs)),De.isMesh)Me.wireframe===!0?(V.setLineWidth(Me.wireframeLinewidth*fe()),ir.setMode(j.LINES)):ir.setMode(j.TRIANGLES);else if(De.isLine){let rn=Me.linewidth;rn===void 0&&(rn=1),V.setLineWidth(rn*fe()),De.isLineSegments?ir.setMode(j.LINES):De.isLineLoop?ir.setMode(j.LINE_LOOP):ir.setMode(j.LINE_STRIP)}else De.isPoints?ir.setMode(j.POINTS):De.isSprite&&ir.setMode(j.TRIANGLES);if(De.isBatchedMesh)ir.renderMultiDraw(De._multiDrawStarts,De._multiDrawCounts,De._multiDrawCount);else if(De.isInstancedMesh)ir.renderInstances(pr,Ur,De.count);else if(Re.isInstancedBufferGeometry){const rn=Re._maxInstanceCount!==void 0?Re._maxInstanceCount:1/0,bv=Math.min(Re.instanceCount,rn);ir.renderInstances(pr,Ur,bv)}else ir.render(pr,Ur)};function Oe(J,Se,Re){J.transparent===!0&&J.side===tr&&J.forceSinglePass===!1?(J.side=Ta,J.needsUpdate=!0,Cc(J,Se,Re),J.side=$l,J.needsUpdate=!0,Cc(J,Se,Re),J.side=tr):Cc(J,Se,Re)}this.compile=function(J,Se,Re=null){Re===null&&(Re=J),v=He.get(Re),v.init(),y.push(v),Re.traverseVisible(function(De){De.isLight&&De.layers.test(Se.layers)&&(v.pushLight(De),De.castShadow&&v.pushShadow(De))}),J!==Re&&J.traverseVisible(function(De){De.isLight&&De.layers.test(Se.layers)&&(v.pushLight(De),De.castShadow&&v.pushShadow(De))}),v.setupLights(_._useLegacyLights);const Me=new Set;return J.traverse(function(De){const ft=De.material;if(ft)if(Array.isArray(ft))for(let Pt=0;Pt<ft.length;Pt++){const Bt=ft[Pt];Oe(Bt,Re,De),Me.add(Bt)}else Oe(ft,Re,De),Me.add(ft)}),y.pop(),v=null,Me},this.compileAsync=function(J,Se,Re=null){const Me=this.compile(J,Se,Re);return new Promise(De=>{function ft(){if(Me.forEach(function(Pt){ae.get(Pt).currentProgram.isReady()&&Me.delete(Pt)}),Me.size===0){De(J);return}setTimeout(ft,10)}pe.get("KHR_parallel_shader_compile")!==null?ft():setTimeout(ft,10)})};let _t=null;function zt(J){_t&&_t(J)}function xn(){Tn.stop()}function jt(){Tn.start()}const Tn=new hj;Tn.setAnimationLoop(zt),typeof self!="undefined"&&Tn.setContext(self),this.setAnimationLoop=function(J){_t=J,at.setAnimationLoop(J),J===null?Tn.stop():Tn.start()},at.addEventListener("sessionstart",xn),at.addEventListener("sessionend",jt),this.render=function(J,Se){if(Se!==void 0&&Se.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;J.matrixWorldAutoUpdate===!0&&J.updateMatrixWorld(),Se.parent===null&&Se.matrixWorldAutoUpdate===!0&&Se.updateMatrixWorld(),at.enabled===!0&&at.isPresenting===!0&&(at.cameraAutoUpdate===!0&&at.updateCamera(Se),Se=at.getCamera()),J.isScene===!0&&J.onBeforeRender(_,J,Se,w),v=He.get(J,y.length),v.init(),y.push(v),Fe.multiplyMatrices(Se.projectionMatrix,Se.matrixWorldInverse),oe.setFromProjectionMatrix(Fe),re=this.localClippingEnabled,X=nt.init(this.clippingPlanes,re),g=be.get(J,m.length),g.init(),m.push(g),dr(J,Se,0,_.sortObjects),g.finish(),_.sortObjects===!0&&g.sort(O,H),this.info.render.frame++,X===!0&&nt.beginShadows();const Re=v.state.shadowsArray;if(ke.render(Re,J,Se),X===!0&&nt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(at.enabled===!1||at.isPresenting===!1||at.hasDepthSensing()===!1)&&Tt.render(g,J),v.setupLights(_._useLegacyLights),Se.isArrayCamera){const Me=Se.cameras;for(let De=0,ft=Me.length;De<ft;De++){const Pt=Me[De];ye(g,J,Pt,Pt.viewport)}}else ye(g,J,Se);w!==null&&(I.updateMultisampleRenderTarget(w),I.updateRenderTargetMipmap(w)),J.isScene===!0&&J.onAfterRender(_,J,Se),At.resetDefaultState(),T=-1,C=null,y.pop(),y.length>0?v=y[y.length-1]:v=null,m.pop(),m.length>0?g=m[m.length-1]:g=null};function dr(J,Se,Re,Me){if(J.visible===!1)return;if(J.layers.test(Se.layers)){if(J.isGroup)Re=J.renderOrder;else if(J.isLOD)J.autoUpdate===!0&&J.update(Se);else if(J.isLight)v.pushLight(J),J.castShadow&&v.pushShadow(J);else if(J.isSprite){if(!J.frustumCulled||oe.intersectsSprite(J)){Me&&Ae.setFromMatrixPosition(J.matrixWorld).applyMatrix4(Fe);const Pt=q.update(J),Bt=J.material;Bt.visible&&g.push(J,Pt,Bt,Re,Ae.z,null)}}else if((J.isMesh||J.isLine||J.isPoints)&&(!J.frustumCulled||oe.intersectsObject(J))){const Pt=q.update(J),Bt=J.material;if(Me&&(J.boundingSphere!==void 0?(J.boundingSphere===null&&J.computeBoundingSphere(),Ae.copy(J.boundingSphere.center)):(Pt.boundingSphere===null&&Pt.computeBoundingSphere(),Ae.copy(Pt.boundingSphere.center)),Ae.applyMatrix4(J.matrixWorld).applyMatrix4(Fe)),Array.isArray(Bt)){const Wt=Pt.groups;for(let tn=0,$t=Wt.length;tn<$t;tn++){const Zt=Wt[tn],pr=Bt[Zt.materialIndex];pr&&pr.visible&&g.push(J,Pt,pr,Re,Ae.z,Zt)}}else Bt.visible&&g.push(J,Pt,Bt,Re,Ae.z,null)}}const ft=J.children;for(let Pt=0,Bt=ft.length;Pt<Bt;Pt++)dr(ft[Pt],Se,Re,Me)}function ye(J,Se,Re,Me){const De=J.opaque,ft=J.transmissive,Pt=J.transparent;v.setupLightsView(Re),X===!0&&nt.setGlobalState(_.clippingPlanes,Re),ft.length>0&&ht(De,ft,Se,Re),Me&&V.viewport(A.copy(Me)),De.length>0&&rs(De,Se,Re),ft.length>0&&rs(ft,Se,Re),Pt.length>0&&rs(Pt,Se,Re),V.buffers.depth.setTest(!0),V.buffers.depth.setMask(!0),V.buffers.color.setMask(!0),V.setPolygonOffset(!1)}function ht(J,Se,Re,Me){if((Re.isScene===!0?Re.overrideMaterial:null)!==null)return;const ft=we.isWebGL2;_e===null&&(_e=new pf(1,1,{generateMipmaps:!0,type:pe.has("EXT_color_buffer_half_float")?l0:rc,minFilter:Pl,samples:ft?4:0})),_.getDrawingBufferSize(Ce),ft?_e.setSize(Ce.x,Ce.y):_e.setSize(mb(Ce.x),mb(Ce.y));const Pt=_.getRenderTarget();_.setRenderTarget(_e),_.getClearColor(D),L=_.getClearAlpha(),L<1&&_.setClearColor(16777215,.5),_.clear();const Bt=_.toneMapping;_.toneMapping=nc,rs(J,Re,Me),I.updateMultisampleRenderTarget(_e),I.updateRenderTargetMipmap(_e);let Wt=!1;for(let tn=0,$t=Se.length;tn<$t;tn++){const Zt=Se[tn],pr=Zt.object,$i=Zt.geometry,Ur=Zt.material,Hs=Zt.group;if(Ur.side===tr&&pr.layers.test(Me.layers)){const ir=Ur.side;Ur.side=Ta,Ur.needsUpdate=!0,iy(pr,Re,Me,$i,Ur,Hs),Ur.side=ir,Ur.needsUpdate=!0,Wt=!0}}Wt===!0&&(I.updateMultisampleRenderTarget(_e),I.updateRenderTargetMipmap(_e)),_.setRenderTarget(Pt),_.setClearColor(D,L),_.toneMapping=Bt}function rs(J,Se,Re){const Me=Se.isScene===!0?Se.overrideMaterial:null;for(let De=0,ft=J.length;De<ft;De++){const Pt=J[De],Bt=Pt.object,Wt=Pt.geometry,tn=Me===null?Pt.material:Me,$t=Pt.group;Bt.layers.test(Re.layers)&&iy(Bt,Se,Re,Wt,tn,$t)}}function iy(J,Se,Re,Me,De,ft){J.onBeforeRender(_,Se,Re,Me,De,ft),J.modelViewMatrix.multiplyMatrices(Re.matrixWorldInverse,J.matrixWorld),J.normalMatrix.getNormalMatrix(J.modelViewMatrix),De.onBeforeRender(_,Se,Re,Me,J,ft),De.transparent===!0&&De.side===tr&&De.forceSinglePass===!1?(De.side=Ta,De.needsUpdate=!0,_.renderBufferDirect(Re,Se,Me,De,J,ft),De.side=$l,De.needsUpdate=!0,_.renderBufferDirect(Re,Se,Me,De,J,ft),De.side=tr):_.renderBufferDirect(Re,Se,Me,De,J,ft),J.onAfterRender(_,Se,Re,Me,De,ft)}function Cc(J,Se,Re){Se.isScene!==!0&&(Se=ze);const Me=ae.get(J),De=v.state.lights,ft=v.state.shadowsArray,Pt=De.state.version,Bt=le.getParameters(J,De.state,ft,Se,Re),Wt=le.getProgramCacheKey(Bt);let tn=Me.programs;Me.environment=J.isMeshStandardMaterial?Se.environment:null,Me.fog=Se.fog,Me.envMap=(J.isMeshStandardMaterial?K:G).get(J.envMap||Me.environment),tn===void 0&&(J.addEventListener("dispose",je),tn=new Map,Me.programs=tn);let $t=tn.get(Wt);if($t!==void 0){if(Me.currentProgram===$t&&Me.lightsStateVersion===Pt)return ay(J,Bt),$t}else Bt.uniforms=le.getUniforms(J),J.onBuild(Re,Bt,_),J.onBeforeCompile(Bt,_),$t=le.acquireProgram(Bt,Wt),tn.set(Wt,$t),Me.uniforms=Bt.uniforms;const Zt=Me.uniforms;return(!J.isShaderMaterial&&!J.isRawShaderMaterial||J.clipping===!0)&&(Zt.clippingPlanes=nt.uniform),ay(J,Bt),Me.needsLights=xv(J),Me.lightsStateVersion=Pt,Me.needsLights&&(Zt.ambientLightColor.value=De.state.ambient,Zt.lightProbe.value=De.state.probe,Zt.directionalLights.value=De.state.directional,Zt.directionalLightShadows.value=De.state.directionalShadow,Zt.spotLights.value=De.state.spot,Zt.spotLightShadows.value=De.state.spotShadow,Zt.rectAreaLights.value=De.state.rectArea,Zt.ltc_1.value=De.state.rectAreaLTC1,Zt.ltc_2.value=De.state.rectAreaLTC2,Zt.pointLights.value=De.state.point,Zt.pointLightShadows.value=De.state.pointShadow,Zt.hemisphereLights.value=De.state.hemi,Zt.directionalShadowMap.value=De.state.directionalShadowMap,Zt.directionalShadowMatrix.value=De.state.directionalShadowMatrix,Zt.spotShadowMap.value=De.state.spotShadowMap,Zt.spotLightMatrix.value=De.state.spotLightMatrix,Zt.spotLightMap.value=De.state.spotLightMap,Zt.pointShadowMap.value=De.state.pointShadowMap,Zt.pointShadowMatrix.value=De.state.pointShadowMatrix),Me.currentProgram=$t,Me.uniformsList=null,$t}function yv(J){if(J.uniformsList===null){const Se=J.currentProgram.getUniforms();J.uniformsList=Y1.seqWithValue(Se.seq,J.uniforms)}return J.uniformsList}function ay(J,Se){const Re=ae.get(J);Re.outputColorSpace=Se.outputColorSpace,Re.batching=Se.batching,Re.instancing=Se.instancing,Re.instancingColor=Se.instancingColor,Re.skinning=Se.skinning,Re.morphTargets=Se.morphTargets,Re.morphNormals=Se.morphNormals,Re.morphColors=Se.morphColors,Re.morphTargetsCount=Se.morphTargetsCount,Re.numClippingPlanes=Se.numClippingPlanes,Re.numIntersection=Se.numClipIntersection,Re.vertexAlphas=Se.vertexAlphas,Re.vertexTangents=Se.vertexTangents,Re.toneMapping=Se.toneMapping}function _v(J,Se,Re,Me,De){Se.isScene!==!0&&(Se=ze),I.resetTextureUnits();const ft=Se.fog,Pt=Me.isMeshStandardMaterial?Se.environment:null,Bt=w===null?_.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:ai,Wt=(Me.isMeshStandardMaterial?K:G).get(Me.envMap||Pt),tn=Me.vertexColors===!0&&!!Re.attributes.color&&Re.attributes.color.itemSize===4,$t=!!Re.attributes.tangent&&(!!Me.normalMap||Me.anisotropy>0),Zt=!!Re.morphAttributes.position,pr=!!Re.morphAttributes.normal,$i=!!Re.morphAttributes.color;let Ur=nc;Me.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(Ur=_.toneMapping);const Hs=Re.morphAttributes.position||Re.morphAttributes.normal||Re.morphAttributes.color,ir=Hs!==void 0?Hs.length:0,rn=ae.get(Me),bv=v.state.lights;if(X===!0&&(re===!0||J!==C)){const la=J===C&&Me.id===T;nt.setState(Me,J,la)}let ur=!1;Me.version===rn.__version?(rn.needsLights&&rn.lightsStateVersion!==bv.state.version||rn.outputColorSpace!==Bt||De.isBatchedMesh&&rn.batching===!1||!De.isBatchedMesh&&rn.batching===!0||De.isInstancedMesh&&rn.instancing===!1||!De.isInstancedMesh&&rn.instancing===!0||De.isSkinnedMesh&&rn.skinning===!1||!De.isSkinnedMesh&&rn.skinning===!0||De.isInstancedMesh&&rn.instancingColor===!0&&De.instanceColor===null||De.isInstancedMesh&&rn.instancingColor===!1&&De.instanceColor!==null||rn.envMap!==Wt||Me.fog===!0&&rn.fog!==ft||rn.numClippingPlanes!==void 0&&(rn.numClippingPlanes!==nt.numPlanes||rn.numIntersection!==nt.numIntersection)||rn.vertexAlphas!==tn||rn.vertexTangents!==$t||rn.morphTargets!==Zt||rn.morphNormals!==pr||rn.morphColors!==$i||rn.toneMapping!==Ur||we.isWebGL2===!0&&rn.morphTargetsCount!==ir)&&(ur=!0):(ur=!0,rn.__version=Me.version);let ul=rn.currentProgram;ur===!0&&(ul=Cc(Me,Se,De));let oy=!1,Ec=!1,Sv=!1;const li=ul.getUniforms(),cl=rn.uniforms;if(V.useProgram(ul.program)&&(oy=!0,Ec=!0,Sv=!0),Me.id!==T&&(T=Me.id,Ec=!0),oy||C!==J){li.setValue(j,"projectionMatrix",J.projectionMatrix),li.setValue(j,"viewMatrix",J.matrixWorldInverse);const la=li.map.cameraPosition;la!==void 0&&la.setValue(j,Ae.setFromMatrixPosition(J.matrixWorld)),we.logarithmicDepthBuffer&&li.setValue(j,"logDepthBufFC",2/(Math.log(J.far+1)/Math.LN2)),(Me.isMeshPhongMaterial||Me.isMeshToonMaterial||Me.isMeshLambertMaterial||Me.isMeshBasicMaterial||Me.isMeshStandardMaterial||Me.isShaderMaterial)&&li.setValue(j,"isOrthographic",J.isOrthographicCamera===!0),C!==J&&(C=J,Ec=!0,Sv=!0)}if(De.isSkinnedMesh){li.setOptional(j,De,"bindMatrix"),li.setOptional(j,De,"bindMatrixInverse");const la=De.skeleton;la&&(we.floatVertexTextures?(la.boneTexture===null&&la.computeBoneTexture(),li.setValue(j,"boneTexture",la.boneTexture,I)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}De.isBatchedMesh&&(li.setOptional(j,De,"batchingTexture"),li.setValue(j,"batchingTexture",De._matricesTexture,I));const wv=Re.morphAttributes;if((wv.position!==void 0||wv.normal!==void 0||wv.color!==void 0&&we.isWebGL2===!0)&&wt.update(De,Re,ul),(Ec||rn.receiveShadow!==De.receiveShadow)&&(rn.receiveShadow=De.receiveShadow,li.setValue(j,"receiveShadow",De.receiveShadow)),Me.isMeshGouraudMaterial&&Me.envMap!==null&&(cl.envMap.value=Wt,cl.flipEnvMap.value=Wt.isCubeTexture&&Wt.isRenderTargetTexture===!1?-1:1),Ec&&(li.setValue(j,"toneMappingExposure",_.toneMappingExposure),rn.needsLights&&sy(cl,Sv),ft&&Me.fog===!0&&ue.refreshFogUniforms(cl,ft),ue.refreshMaterialUniforms(cl,Me,F,N,_e),Y1.upload(j,yv(rn),cl,I)),Me.isShaderMaterial&&Me.uniformsNeedUpdate===!0&&(Y1.upload(j,yv(rn),cl,I),Me.uniformsNeedUpdate=!1),Me.isSpriteMaterial&&li.setValue(j,"center",De.center),li.setValue(j,"modelViewMatrix",De.modelViewMatrix),li.setValue(j,"normalMatrix",De.normalMatrix),li.setValue(j,"modelMatrix",De.matrixWorld),Me.isShaderMaterial||Me.isRawShaderMaterial){const la=Me.uniformsGroups;for(let Av=0,iw=la.length;Av<iw;Av++)if(we.isWebGL2){const ly=la[Av];ce.update(ly,ul),ce.bind(ly,ul)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return ul}function sy(J,Se){J.ambientLightColor.needsUpdate=Se,J.lightProbe.needsUpdate=Se,J.directionalLights.needsUpdate=Se,J.directionalLightShadows.needsUpdate=Se,J.pointLights.needsUpdate=Se,J.pointLightShadows.needsUpdate=Se,J.spotLights.needsUpdate=Se,J.spotLightShadows.needsUpdate=Se,J.rectAreaLights.needsUpdate=Se,J.hemisphereLights.needsUpdate=Se}function xv(J){return J.isMeshLambertMaterial||J.isMeshToonMaterial||J.isMeshPhongMaterial||J.isMeshStandardMaterial||J.isShadowMaterial||J.isShaderMaterial&&J.lights===!0}this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(J,Se,Re){ae.get(J.texture).__webglTexture=Se,ae.get(J.depthTexture).__webglTexture=Re;const Me=ae.get(J);Me.__hasExternalTextures=!0,Me.__hasExternalTextures&&(Me.__autoAllocateDepthBuffer=Re===void 0,Me.__autoAllocateDepthBuffer||pe.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),Me.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(J,Se){const Re=ae.get(J);Re.__webglFramebuffer=Se,Re.__useDefaultFramebuffer=Se===void 0},this.setRenderTarget=function(J,Se=0,Re=0){w=J,b=Se,S=Re;let Me=!0,De=null,ft=!1,Pt=!1;if(J){const Wt=ae.get(J);Wt.__useDefaultFramebuffer!==void 0?(V.bindFramebuffer(j.FRAMEBUFFER,null),Me=!1):Wt.__webglFramebuffer===void 0?I.setupRenderTarget(J):Wt.__hasExternalTextures&&I.rebindTextures(J,ae.get(J.texture).__webglTexture,ae.get(J.depthTexture).__webglTexture);const tn=J.texture;(tn.isData3DTexture||tn.isDataArrayTexture||tn.isCompressedArrayTexture)&&(Pt=!0);const $t=ae.get(J).__webglFramebuffer;J.isWebGLCubeRenderTarget?(Array.isArray($t[Se])?De=$t[Se][Re]:De=$t[Se],ft=!0):we.isWebGL2&&J.samples>0&&I.useMultisampledRTT(J)===!1?De=ae.get(J).__webglMultisampledFramebuffer:Array.isArray($t)?De=$t[Re]:De=$t,A.copy(J.viewport),M.copy(J.scissor),P=J.scissorTest}else A.copy(U).multiplyScalar(F).floor(),M.copy($).multiplyScalar(F).floor(),P=Y;if(V.bindFramebuffer(j.FRAMEBUFFER,De)&&we.drawBuffers&&Me&&V.drawBuffers(J,De),V.viewport(A),V.scissor(M),V.setScissorTest(P),ft){const Wt=ae.get(J.texture);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Wt.__webglTexture,Re)}else if(Pt){const Wt=ae.get(J.texture),tn=Se||0;j.framebufferTextureLayer(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,Wt.__webglTexture,Re||0,tn)}T=-1},this.readRenderTargetPixels=function(J,Se,Re,Me,De,ft,Pt){if(!(J&&J.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Bt=ae.get(J).__webglFramebuffer;if(J.isWebGLCubeRenderTarget&&Pt!==void 0&&(Bt=Bt[Pt]),Bt){V.bindFramebuffer(j.FRAMEBUFFER,Bt);try{const Wt=J.texture,tn=Wt.format,$t=Wt.type;if(tn!==Cs&&Ze.convert(tn)!==j.getParameter(j.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Zt=$t===l0&&(pe.has("EXT_color_buffer_half_float")||we.isWebGL2&&pe.has("EXT_color_buffer_float"));if($t!==rc&&Ze.convert($t)!==j.getParameter(j.IMPLEMENTATION_COLOR_READ_TYPE)&&!($t===ko&&(we.isWebGL2||pe.has("OES_texture_float")||pe.has("WEBGL_color_buffer_float")))&&!Zt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Se>=0&&Se<=J.width-Me&&Re>=0&&Re<=J.height-De&&j.readPixels(Se,Re,Me,De,Ze.convert(tn),Ze.convert($t),ft)}finally{const Wt=w!==null?ae.get(w).__webglFramebuffer:null;V.bindFramebuffer(j.FRAMEBUFFER,Wt)}}},this.copyFramebufferToTexture=function(J,Se,Re=0){const Me=Math.pow(2,-Re),De=Math.floor(Se.image.width*Me),ft=Math.floor(Se.image.height*Me);I.setTexture2D(Se,0),j.copyTexSubImage2D(j.TEXTURE_2D,Re,0,0,J.x,J.y,De,ft),V.unbindTexture()},this.copyTextureToTexture=function(J,Se,Re,Me=0){const De=Se.image.width,ft=Se.image.height,Pt=Ze.convert(Re.format),Bt=Ze.convert(Re.type);I.setTexture2D(Re,0),j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,Re.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Re.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,Re.unpackAlignment),Se.isDataTexture?j.texSubImage2D(j.TEXTURE_2D,Me,J.x,J.y,De,ft,Pt,Bt,Se.image.data):Se.isCompressedTexture?j.compressedTexSubImage2D(j.TEXTURE_2D,Me,J.x,J.y,Se.mipmaps[0].width,Se.mipmaps[0].height,Pt,Se.mipmaps[0].data):j.texSubImage2D(j.TEXTURE_2D,Me,J.x,J.y,Pt,Bt,Se.image),Me===0&&Re.generateMipmaps&&j.generateMipmap(j.TEXTURE_2D),V.unbindTexture()},this.copyTextureToTexture3D=function(J,Se,Re,Me,De=0){if(_.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ft=J.max.x-J.min.x+1,Pt=J.max.y-J.min.y+1,Bt=J.max.z-J.min.z+1,Wt=Ze.convert(Me.format),tn=Ze.convert(Me.type);let $t;if(Me.isData3DTexture)I.setTexture3D(Me,0),$t=j.TEXTURE_3D;else if(Me.isDataArrayTexture||Me.isCompressedArrayTexture)I.setTexture2DArray(Me,0),$t=j.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,Me.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Me.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,Me.unpackAlignment);const Zt=j.getParameter(j.UNPACK_ROW_LENGTH),pr=j.getParameter(j.UNPACK_IMAGE_HEIGHT),$i=j.getParameter(j.UNPACK_SKIP_PIXELS),Ur=j.getParameter(j.UNPACK_SKIP_ROWS),Hs=j.getParameter(j.UNPACK_SKIP_IMAGES),ir=Re.isCompressedTexture?Re.mipmaps[De]:Re.image;j.pixelStorei(j.UNPACK_ROW_LENGTH,ir.width),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,ir.height),j.pixelStorei(j.UNPACK_SKIP_PIXELS,J.min.x),j.pixelStorei(j.UNPACK_SKIP_ROWS,J.min.y),j.pixelStorei(j.UNPACK_SKIP_IMAGES,J.min.z),Re.isDataTexture||Re.isData3DTexture?j.texSubImage3D($t,De,Se.x,Se.y,Se.z,ft,Pt,Bt,Wt,tn,ir.data):Re.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),j.compressedTexSubImage3D($t,De,Se.x,Se.y,Se.z,ft,Pt,Bt,Wt,ir.data)):j.texSubImage3D($t,De,Se.x,Se.y,Se.z,ft,Pt,Bt,Wt,tn,ir),j.pixelStorei(j.UNPACK_ROW_LENGTH,Zt),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,pr),j.pixelStorei(j.UNPACK_SKIP_PIXELS,$i),j.pixelStorei(j.UNPACK_SKIP_ROWS,Ur),j.pixelStorei(j.UNPACK_SKIP_IMAGES,Hs),De===0&&Me.generateMipmaps&&j.generateMipmap($t),V.unbindTexture()},this.initTexture=function(J){J.isCubeTexture?I.setTextureCube(J,0):J.isData3DTexture?I.setTexture3D(J,0):J.isDataArrayTexture||J.isCompressedArrayTexture?I.setTexture2DArray(J,0):I.setTexture2D(J,0),V.unbindTexture()},this.resetState=function(){b=0,S=0,w=null,V.reset(),At.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ll}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===PR?"display-p3":"srgb",t.unpackColorSpace=Bn.workingColorSpace===IS?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Vn?tf:J$}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===tf?Vn:ai}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 JTe extends OR{}JTe.prototype.isWebGL1Renderer=!0;class FR{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new xt(e),this.near=t,this.far=r}clone(){return new FR(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class yj extends er{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 BR{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=pE,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Is()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return nf("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,r){e*=this.stride,r*=t.stride;for(let i=0,a=this.stride;i<a;i++)this.array[e+i]=t.array[r+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Is()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Is()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Ki=new te;class io{constructor(e,t,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,r=this.data.count;t<r;t++)Ki.fromBufferAttribute(this,t),Ki.applyMatrix4(e),this.setXYZ(t,Ki.x,Ki.y,Ki.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)Ki.fromBufferAttribute(this,t),Ki.applyNormalMatrix(e),this.setXYZ(t,Ki.x,Ki.y,Ki.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)Ki.fromBufferAttribute(this,t),Ki.transformDirection(e),this.setXYZ(t,Ki.x,Ki.y,Ki.z);return this}getComponent(e,t){let r=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(r=Js(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=Gn(r,this.array)),this.data.array[e*this.data.stride+this.offset+t]=r,this}setX(e,t){return this.normalized&&(t=Gn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Gn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Gn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Gn(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Js(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Js(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Js(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Js(t,this.array)),t}setXY(e,t,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Gn(t,this.array),r=Gn(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Gn(t,this.array),r=Gn(r,this.array),i=Gn(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this}setXYZW(e,t,r,i,a){return e=e*this.data.stride+this.offset,this.normalized&&(t=Gn(t,this.array),r=Gn(r,this.array),i=Gn(i,this.array),a=Gn(a,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this.data.array[e+3]=a,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)t.push(this.data.array[i+a])}return new br(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new io(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)t.push(this.data.array[i+a])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class mh extends Ns{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new xt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let bd;const mg=new te,Sd=new te,wd=new te,Ad=new Ge,yg=new Ge,_j=new Jt,V_=new te,_g=new te,H_=new te,u6=new Ge,C2=new Ge,c6=new Ge;class Md extends er{constructor(e=new mh){if(super(),this.isSprite=!0,this.type="Sprite",bd===void 0){bd=new qn;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),r=new BR(t,5);bd.setIndex([0,1,2,0,2,3]),bd.setAttribute("position",new io(r,3,0,!1)),bd.setAttribute("uv",new io(r,2,3,!1))}this.geometry=bd,this.material=e,this.center=new Ge(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Sd.setFromMatrixScale(this.matrixWorld),_j.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),wd.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Sd.multiplyScalar(-wd.z);const r=this.material.rotation;let i,a;r!==0&&(a=Math.cos(r),i=Math.sin(r));const s=this.center;W_(V_.set(-.5,-.5,0),wd,s,Sd,i,a),W_(_g.set(.5,-.5,0),wd,s,Sd,i,a),W_(H_.set(.5,.5,0),wd,s,Sd,i,a),u6.set(0,0),C2.set(1,0),c6.set(1,1);let o=e.ray.intersectTriangle(V_,_g,H_,!1,mg);if(o===null&&(W_(_g.set(-.5,.5,0),wd,s,Sd,i,a),C2.set(0,1),o=e.ray.intersectTriangle(V_,H_,_g,!1,mg),o===null))return;const l=e.ray.origin.distanceTo(mg);l<e.near||l>e.far||t.push({distance:l,point:mg.clone(),uv:eo.getInterpolation(mg,V_,_g,H_,u6,C2,c6,new Ge),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 W_(n,e,t,r,i,a){Ad.subVectors(n,t).addScalar(.5).multiply(r),i!==void 0?(yg.x=a*Ad.x-i*Ad.y,yg.y=i*Ad.x+a*Ad.y):yg.copy(Ad),n.copy(e),n.x+=yg.x,n.y+=yg.y,n.applyMatrix4(_j)}const h6=new te,f6=new En,d6=new En,eCe=new te,p6=new Jt,$_=new te,E2=new Vs,v6=new Jt,P2=new ov;class tCe extends An{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=$F,this.bindMatrix=new Jt,this.bindMatrixInverse=new Jt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Us),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let r=0;r<t.count;r++)this.getVertexPosition(r,$_),this.boundingBox.expandByPoint($_)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Vs),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let r=0;r<t.count;r++)this.getVertexPosition(r,$_),this.boundingSphere.expandByPoint($_)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const r=this.material,i=this.matrixWorld;r!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),E2.copy(this.boundingSphere),E2.applyMatrix4(i),e.ray.intersectsSphere(E2)!==!1&&(v6.copy(i).invert(),P2.copy(e.ray).applyMatrix4(v6),!(this.boundingBox!==null&&P2.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,P2)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new En,t=this.geometry.attributes.skinWeight;for(let r=0,i=t.count;r<i;r++){e.fromBufferAttribute(t,r);const a=1/e.manhattanLength();a!==1/0?e.multiplyScalar(a):e.set(1,0,0,0),t.setXYZW(r,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===$F?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===hSe?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const r=this.skeleton,i=this.geometry;f6.fromBufferAttribute(i.attributes.skinIndex,e),d6.fromBufferAttribute(i.attributes.skinWeight,e),h6.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let a=0;a<4;a++){const s=d6.getComponent(a);if(s!==0){const o=f6.getComponent(a);p6.multiplyMatrices(r.bones[o].matrixWorld,r.boneInverses[o]),t.addScaledVector(eCe.copy(h6).applyMatrix4(p6),s)}}return t.applyMatrix4(this.bindMatrixInverse)}}class xj extends er{constructor(){super(),this.isBone=!0,this.type="Bone"}}class nCe extends ni{constructor(e=null,t=1,r=1,i,a,s,o,l,u=Jr,c=Jr,h,f){super(null,s,o,l,u,c,i,a,h,f),this.isDataTexture=!0,this.image={data:e,width:t,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const g6=new Jt,rCe=new Jt;class GR{constructor(e=[],t=[]){this.uuid=Is(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let r=0,i=this.bones.length;r<i;r++)this.boneInverses.push(new Jt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const r=new Jt;this.bones[e]&&r.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(r)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const r=this.bones[e];r&&r.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const r=this.bones[e];r&&(r.parent&&r.parent.isBone?(r.matrix.copy(r.parent.matrixWorld).invert(),r.matrix.multiply(r.matrixWorld)):r.matrix.copy(r.matrixWorld),r.matrix.decompose(r.position,r.quaternion,r.scale))}}update(){const e=this.bones,t=this.boneInverses,r=this.boneMatrices,i=this.boneTexture;for(let a=0,s=e.length;a<s;a++){const o=e[a]?e[a].matrixWorld:rCe;g6.multiplyMatrices(o,t[a]),g6.toArray(r,a*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new GR(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const r=new nCe(t,e,e,Cs,ko);return r.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=r,this}getBoneByName(e){for(let t=0,r=this.bones.length;t<r;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let r=0,i=e.bones.length;r<i;r++){const a=e.bones[r];let s=t[a];s===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",a),s=new xj),this.bones.push(s),this.boneInverses.push(new Jt().fromArray(e.boneInverses[r]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,r=this.boneInverses;for(let i=0,a=t.length;i<a;i++){const s=t[i];e.bones.push(s.uuid);const o=r[i];e.boneInverses.push(o.toArray())}return e}}class yE extends br{constructor(e,t,r,i=1){super(e,t,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Td=new Jt,m6=new Jt,j_=[],y6=new Us,iCe=new Jt,xg=new An,bg=new Vs;class aCe extends An{constructor(e,t,r){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new yE(new Float32Array(r*16),16),this.instanceColor=null,this.count=r,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<r;i++)this.setMatrixAt(i,iCe)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Us),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,Td),y6.copy(e.boundingBox).applyMatrix4(Td),this.boundingBox.union(y6)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Vs),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,Td),bg.copy(e.boundingSphere).applyMatrix4(Td),this.boundingSphere.union(bg)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const r=this.matrixWorld,i=this.count;if(xg.geometry=this.geometry,xg.material=this.material,xg.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),bg.copy(this.boundingSphere),bg.applyMatrix4(r),e.ray.intersectsSphere(bg)!==!1))for(let a=0;a<i;a++){this.getMatrixAt(a,Td),m6.multiplyMatrices(r,Td),xg.matrixWorld=m6,xg.raycast(e,j_);for(let s=0,o=j_.length;s<o;s++){const l=j_[s];l.instanceId=a,l.object=this,t.push(l)}j_.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new yE(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class Oo extends Ns{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new xt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const _6=new te,x6=new te,b6=new Jt,L2=new ov,q_=new Vs;let h0=class extends er{constructor(e=new qn,t=new Oo){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,r=[0];for(let i=1,a=t.count;i<a;i++)_6.fromBufferAttribute(t,i-1),x6.fromBufferAttribute(t,i),r[i]=r[i-1],r[i]+=_6.distanceTo(x6);e.setAttribute("lineDistance",new or(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,a=e.params.Line.threshold,s=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),q_.copy(r.boundingSphere),q_.applyMatrix4(i),q_.radius+=a,e.ray.intersectsSphere(q_)===!1)return;b6.copy(i).invert(),L2.copy(e.ray).applyMatrix4(b6);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,u=new te,c=new te,h=new te,f=new te,d=this.isLineSegments?2:1,p=r.index,v=r.attributes.position;if(p!==null){const m=Math.max(0,s.start),y=Math.min(p.count,s.start+s.count);for(let _=m,x=y-1;_<x;_+=d){const b=p.getX(_),S=p.getX(_+1);if(u.fromBufferAttribute(v,b),c.fromBufferAttribute(v,S),L2.distanceSqToSegment(u,c,f,h)>l)continue;f.applyMatrix4(this.matrixWorld);const T=e.ray.origin.distanceTo(f);T<e.near||T>e.far||t.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,s.start),y=Math.min(v.count,s.start+s.count);for(let _=m,x=y-1;_<x;_+=d){if(u.fromBufferAttribute(v,_),c.fromBufferAttribute(v,_+1),L2.distanceSqToSegment(u,c,f,h)>l)continue;f.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(f);S<e.near||S>e.far||t.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;a<s;a++){const o=i[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}};const S6=new te,w6=new te;class zR extends h0{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,r=[];for(let i=0,a=t.count;i<a;i+=2)S6.fromBufferAttribute(t,i),w6.fromBufferAttribute(t,i+1),r[i]=i===0?0:r[i-1],r[i+1]=r[i]+S6.distanceTo(w6);e.setAttribute("lineDistance",new or(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class yb extends h0{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class X0 extends Ns{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new xt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const A6=new Jt,_E=new ov,X_=new Vs,Y_=new te;class UR extends er{constructor(e=new qn,t=new X0){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,a=e.params.Points.threshold,s=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),X_.copy(r.boundingSphere),X_.applyMatrix4(i),X_.radius+=a,e.ray.intersectsSphere(X_)===!1)return;A6.copy(i).invert(),_E.copy(e.ray).applyMatrix4(A6);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,u=r.index,h=r.attributes.position;if(u!==null){const f=Math.max(0,s.start),d=Math.min(u.count,s.start+s.count);for(let p=f,g=d;p<g;p++){const v=u.getX(p);Y_.fromBufferAttribute(h,v),M6(Y_,v,l,i,e,t,this)}}else{const f=Math.max(0,s.start),d=Math.min(h.count,s.start+s.count);for(let p=f,g=d;p<g;p++)Y_.fromBufferAttribute(h,p),M6(Y_,p,l,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=i.length;a<s;a++){const o=i[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}}function M6(n,e,t,r,i,a,s){const o=_E.distanceSqToPoint(n);if(o<t){const l=new te;_E.closestPointToPoint(n,l),l.applyMatrix4(r);const u=i.ray.origin.distanceTo(l);if(u<i.near||u>i.far)return;a.push({distance:u,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,object:s})}}class VR extends ni{constructor(e,t,r,i,a,s,o,l,u){super(e,t,r,i,a,s,o,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class al{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/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 r,i=this.getPoint(0),a=0;t.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),a+=r.distanceTo(i),t.push(a),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let i=0;const a=r.length;let s;t?s=t:s=e*r[a-1];let o=0,l=a-1,u;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),u=r[i]-s,u<0)o=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,r[i]===s)return i/(a-1);const c=r[i],f=r[i+1]-c,d=(s-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 s=this.getPoint(i),o=this.getPoint(a),l=t||(s.isVector2?new Ge:new te);return l.copy(o).sub(s).normalize(),l}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new te,i=[],a=[],s=[],o=new te,l=new Jt;for(let d=0;d<=e;d++){const p=d/e;i[d]=this.getTangentAt(p,new te)}a[0]=new te,s[0]=new te;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,r.set(1,0,0)),h<=u&&(u=h,r.set(0,1,0)),f<=u&&r.set(0,0,1),o.crossVectors(i[0],r).normalize(),a[0].crossVectors(i[0],o),s[0].crossVectors(i[0],a[0]);for(let d=1;d<=e;d++){if(a[d]=a[d-1].clone(),s[d]=s[d-1].clone(),o.crossVectors(i[d-1],i[d]),o.length()>Number.EPSILON){o.normalize();const p=Math.acos(Xr(i[d-1].dot(i[d]),-1,1));a[d].applyMatrix4(l.makeRotationAxis(o,p))}s[d].crossVectors(i[d],a[d])}if(t===!0){let d=Math.acos(Xr(a[0].dot(a[e]),-1,1));d/=e,i[0].dot(o.crossVectors(a[0],a[e]))>0&&(d=-d);for(let p=1;p<=e;p++)a[p].applyMatrix4(l.makeRotationAxis(i[p],d*p)),s[p].crossVectors(i[p],a[p])}return{tangents:i,normals:a,binormals:s}}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 HR extends al{constructor(e=0,t=0,r=1,i=1,a=0,s=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=a,this.aEndAngle=s,this.aClockwise=o,this.aRotation=l}getPoint(e,t){const r=t||new Ge,i=Math.PI*2;let a=this.aEndAngle-this.aStartAngle;const s=Math.abs(a)<Number.EPSILON;for(;a<0;)a+=i;for(;a>i;)a-=i;a<Number.EPSILON&&(s?a=0:a=i),this.aClockwise===!0&&!s&&(a===i?a=-i:a=a-i);const o=this.aStartAngle+e*a;let l=this.aX+this.xRadius*Math.cos(o),u=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const c=Math.cos(this.aRotation),h=Math.sin(this.aRotation),f=l-this.aX,d=u-this.aY;l=f*c-d*h+this.aX,u=f*h+d*c+this.aY}return r.set(l,u)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class sCe extends HR{constructor(e,t,r,i,a,s){super(e,t,r,r,i,a,s),this.isArcCurve=!0,this.type="ArcCurve"}}function WR(){let n=0,e=0,t=0,r=0;function i(a,s,o,l){n=a,e=o,t=-3*a+3*s-2*o-l,r=2*a-2*s+o+l}return{initCatmullRom:function(a,s,o,l,u){i(s,o,u*(o-a),u*(l-s))},initNonuniformCatmullRom:function(a,s,o,l,u,c,h){let f=(s-a)/u-(o-a)/(u+c)+(o-s)/c,d=(o-s)/c-(l-s)/(c+h)+(l-o)/h;f*=c,d*=c,i(s,o,f,d)},calc:function(a){const s=a*a,o=s*a;return n+e*a+t*s+r*o}}}const K_=new te,R2=new WR,D2=new WR,I2=new WR;class $R extends al{constructor(e=[],t=!1,r="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=r,this.tension=i}getPoint(e,t=new te){const r=t,i=this.points,a=i.length,s=(a-(this.closed?0:1))*e;let o=Math.floor(s),l=s-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:l===0&&o===a-1&&(o=a-2,l=1);let u,c;this.closed||o>0?u=i[(o-1)%a]:(K_.subVectors(i[0],i[1]).add(i[0]),u=K_);const h=i[o%a],f=i[(o+1)%a];if(this.closed||o+2<a?c=i[(o+2)%a]:(K_.subVectors(i[a-1],i[a-2]).add(i[a-1]),c=K_),this.curveType==="centripetal"||this.curveType==="chordal"){const d=this.curveType==="chordal"?.5:.25;let p=Math.pow(u.distanceToSquared(h),d),g=Math.pow(h.distanceToSquared(f),d),v=Math.pow(f.distanceToSquared(c),d);g<1e-4&&(g=1),p<1e-4&&(p=g),v<1e-4&&(v=g),R2.initNonuniformCatmullRom(u.x,h.x,f.x,c.x,p,g,v),D2.initNonuniformCatmullRom(u.y,h.y,f.y,c.y,p,g,v),I2.initNonuniformCatmullRom(u.z,h.z,f.z,c.z,p,g,v)}else this.curveType==="catmullrom"&&(R2.initCatmullRom(u.x,h.x,f.x,c.x,this.tension),D2.initCatmullRom(u.y,h.y,f.y,c.y,this.tension),I2.initCatmullRom(u.z,h.z,f.z,c.z,this.tension));return r.set(R2.calc(l),D2.calc(l),I2.calc(l)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(new te().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function T6(n,e,t,r,i){const a=(r-e)*.5,s=(i-t)*.5,o=n*n,l=n*o;return(2*t-2*r+a+s)*l+(-3*t+3*r-2*a-s)*o+a*n+t}function oCe(n,e){const t=1-n;return t*t*e}function lCe(n,e){return 2*(1-n)*n*e}function uCe(n,e){return n*n*e}function vm(n,e,t,r){return oCe(n,e)+lCe(n,t)+uCe(n,r)}function cCe(n,e){const t=1-n;return t*t*t*e}function hCe(n,e){const t=1-n;return 3*t*t*n*e}function fCe(n,e){return 3*(1-n)*n*n*e}function dCe(n,e){return n*n*n*e}function gm(n,e,t,r,i){return cCe(n,e)+hCe(n,t)+fCe(n,r)+dCe(n,i)}class bj extends al{constructor(e=new Ge,t=new Ge,r=new Ge,i=new Ge){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new Ge){const r=t,i=this.v0,a=this.v1,s=this.v2,o=this.v3;return r.set(gm(e,i.x,a.x,s.x,o.x),gm(e,i.y,a.y,s.y,o.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class pCe extends al{constructor(e=new te,t=new te,r=new te,i=new te){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new te){const r=t,i=this.v0,a=this.v1,s=this.v2,o=this.v3;return r.set(gm(e,i.x,a.x,s.x,o.x),gm(e,i.y,a.y,s.y,o.y),gm(e,i.z,a.z,s.z,o.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Sj extends al{constructor(e=new Ge,t=new Ge){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Ge){const r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Ge){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class vCe extends al{constructor(e=new te,t=new te){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new te){const r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new te){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class wj extends al{constructor(e=new Ge,t=new Ge,r=new Ge){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new Ge){const r=t,i=this.v0,a=this.v1,s=this.v2;return r.set(vm(e,i.x,a.x,s.x),vm(e,i.y,a.y,s.y)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Aj extends al{constructor(e=new te,t=new te,r=new te){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new te){const r=t,i=this.v0,a=this.v1,s=this.v2;return r.set(vm(e,i.x,a.x,s.x),vm(e,i.y,a.y,s.y),vm(e,i.z,a.z,s.z)),r}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Mj extends al{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Ge){const r=t,i=this.points,a=(i.length-1)*e,s=Math.floor(a),o=a-s,l=i[s===0?s:s-1],u=i[s],c=i[s>i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return r.set(T6(o,l.x,u.x,c.x,h.x),T6(o,l.y,u.y,c.y,h.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(new Ge().fromArray(i))}return this}}var _b=Object.freeze({__proto__:null,ArcCurve:sCe,CatmullRomCurve3:$R,CubicBezierCurve:bj,CubicBezierCurve3:pCe,EllipseCurve:HR,LineCurve:Sj,LineCurve3:vCe,QuadraticBezierCurve:wj,QuadraticBezierCurve3:Aj,SplineCurve:Mj});class gCe extends al{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const r=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new _b[r](t,e))}return this}getPoint(e,t){const r=e*this.getLength(),i=this.getCurveLengths();let a=0;for(;a<i.length;){if(i[a]>=r){const s=i[a]-r,o=this.curves[a],l=o.getLength(),u=l===0?0:1-s/l;return o.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 r=0,i=this.curves.length;r<i;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let r;for(let i=0,a=this.curves;i<a.length;i++){const s=a[i],o=s.isEllipseCurve?e*2:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,l=s.getPoints(o);for(let u=0;u<l.length;u++){const c=l[u];r&&r.equals(c)||(t.push(c),r=c)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,r=this.curves.length;t<r;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const i=e.curves[t];this.curves.push(new _b[i.type]().fromJSON(i))}return this}}class C6 extends gCe{constructor(e){super(),this.type="Path",this.currentPoint=new Ge,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const r=new Sj(this.currentPoint.clone(),new Ge(e,t));return this.curves.push(r),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,r,i){const a=new wj(this.currentPoint.clone(),new Ge(e,t),new Ge(r,i));return this.curves.push(a),this.currentPoint.set(r,i),this}bezierCurveTo(e,t,r,i,a,s){const o=new bj(this.currentPoint.clone(),new Ge(e,t),new Ge(r,i),new Ge(a,s));return this.curves.push(o),this.currentPoint.set(a,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),r=new Mj(t);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,r,i,a,s){const o=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+o,t+l,r,i,a,s),this}absarc(e,t,r,i,a,s){return this.absellipse(e,t,r,r,i,a,s),this}ellipse(e,t,r,i,a,s,o,l){const u=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+u,t+c,r,i,a,s,o,l),this}absellipse(e,t,r,i,a,s,o,l){const u=new HR(e,t,r,i,a,s,o,l);if(this.curves.length>0){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 $o extends C6{constructor(e){super(e),this.uuid=Is(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let r=0,i=this.holes.length;r<i;r++)t[r]=this.holes[r].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,r=this.holes.length;t<r;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const i=e.holes[t];this.holes.push(new C6().fromJSON(i))}return this}}const mCe={triangulate:function(n,e,t=2){const r=e&&e.length,i=r?e[0]*t:n.length;let a=Tj(n,0,i,t,!0);const s=[];if(!a||a.next===a.prev)return s;let o,l,u,c,h,f,d;if(r&&(a=SCe(n,e,a,t)),n.length>80*t){o=u=n[0],l=c=n[1];for(let p=t;p<i;p+=t)h=n[p],f=n[p+1],h<o&&(o=h),f<l&&(l=f),h>u&&(u=h),f>c&&(c=f);d=Math.max(u-o,c-l),d=d!==0?32767/d:0}return f0(a,s,t,o,l,d,0),s}};function Tj(n,e,t,r,i){let a,s;if(i===ICe(n,e,t,r)>0)for(a=e;a<t;a+=r)s=E6(a,n[a],n[a+1],s);else for(a=t-r;a>=e;a-=r)s=E6(a,n[a],n[a+1],s);return s&&FS(s,s.next)&&(p0(s),s=s.next),s}function vf(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(FS(t,t.next)||_r(t.prev,t,t.next)===0)){if(p0(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function f0(n,e,t,r,i,a,s){if(!n)return;!s&&a&&CCe(n,r,i,a);let o=n,l,u;for(;n.prev!==n.next;){if(l=n.prev,u=n.next,a?_Ce(n,r,i,a):yCe(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),p0(n),n=u.next,o=u.next;continue}if(n=u,n===o){s?s===1?(n=xCe(vf(n),e,t),f0(n,e,t,r,i,a,2)):s===2&&bCe(n,e,t,r,i,a):f0(vf(n),e,t,r,i,a,1);break}}}function yCe(n){const e=n.prev,t=n,r=n.next;if(_r(e,t,r)>=0)return!1;const i=e.x,a=t.x,s=r.x,o=e.y,l=t.y,u=r.y,c=i<a?i<s?i:s:a<s?a:s,h=o<l?o<u?o:u:l<u?l:u,f=i>a?i>s?i:s:a>s?a:s,d=o>l?o>u?o:u:l>u?l:u;let p=r.next;for(;p!==e;){if(p.x>=c&&p.x<=f&&p.y>=h&&p.y<=d&&Wd(i,o,a,l,s,u,p.x,p.y)&&_r(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function _Ce(n,e,t,r){const i=n.prev,a=n,s=n.next;if(_r(i,a,s)>=0)return!1;const o=i.x,l=a.x,u=s.x,c=i.y,h=a.y,f=s.y,d=o<l?o<u?o:u:l<u?l:u,p=c<h?c<f?c:f:h<f?h:f,g=o>l?o>u?o:u:l>u?l:u,v=c>h?c>f?c:f:h>f?h:f,m=xE(d,p,e,t,r),y=xE(g,v,e,t,r);let _=n.prevZ,x=n.nextZ;for(;_&&_.z>=m&&x&&x.z<=y;){if(_.x>=d&&_.x<=g&&_.y>=p&&_.y<=v&&_!==i&&_!==s&&Wd(o,c,l,h,u,f,_.x,_.y)&&_r(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=d&&x.x<=g&&x.y>=p&&x.y<=v&&x!==i&&x!==s&&Wd(o,c,l,h,u,f,x.x,x.y)&&_r(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=m;){if(_.x>=d&&_.x<=g&&_.y>=p&&_.y<=v&&_!==i&&_!==s&&Wd(o,c,l,h,u,f,_.x,_.y)&&_r(_.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!==s&&Wd(o,c,l,h,u,f,x.x,x.y)&&_r(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function xCe(n,e,t){let r=n;do{const i=r.prev,a=r.next.next;!FS(i,a)&&Cj(i,r,r.next,a)&&d0(i,a)&&d0(a,i)&&(e.push(i.i/t|0),e.push(r.i/t|0),e.push(a.i/t|0),p0(r),p0(r.next),r=n=a),r=r.next}while(r!==n);return vf(r)}function bCe(n,e,t,r,i,a){let s=n;do{let o=s.next.next;for(;o!==s.prev;){if(s.i!==o.i&&LCe(s,o)){let l=Ej(s,o);s=vf(s,s.next),l=vf(l,l.next),f0(s,e,t,r,i,a,0),f0(l,e,t,r,i,a,0);return}o=o.next}s=s.next}while(s!==n)}function SCe(n,e,t,r){const i=[];let a,s,o,l,u;for(a=0,s=e.length;a<s;a++)o=e[a]*r,l=a<s-1?e[a+1]*r:n.length,u=Tj(n,o,l,r,!1),u===u.next&&(u.steiner=!0),i.push(PCe(u));for(i.sort(wCe),a=0;a<i.length;a++)t=ACe(i[a],t);return t}function wCe(n,e){return n.x-e.x}function ACe(n,e){const t=MCe(n,e);if(!t)return e;const r=Ej(t,n);return vf(r,r.next),vf(t,t.next)}function MCe(n,e){let t=e,r=-1/0,i;const a=n.x,s=n.y;do{if(s<=t.y&&s>=t.next.y&&t.next.y!==t.y){const f=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=a&&f>r&&(r=f,i=t.x<t.next.x?t:t.next,f===a))return i}t=t.next}while(t!==e);if(!i)return null;const o=i,l=i.x,u=i.y;let c=1/0,h;t=i;do a>=t.x&&t.x>=l&&a!==t.x&&Wd(s<u?a:r,s,l,u,s<u?r:a,s,t.x,t.y)&&(h=Math.abs(s-t.y)/(a-t.x),d0(t,n)&&(h<c||h===c&&(t.x>i.x||t.x===i.x&&TCe(i,t)))&&(i=t,c=h)),t=t.next;while(t!==o);return i}function TCe(n,e){return _r(n.prev,n,e.prev)<0&&_r(e.next,n,n.next)<0}function CCe(n,e,t,r){let i=n;do i.z===0&&(i.z=xE(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,ECe(i)}function ECe(n){let e,t,r,i,a,s,o,l,u=1;do{for(t=n,n=null,a=null,s=0;t;){for(s++,r=t,o=0,e=0;e<u&&(o++,r=r.nextZ,!!r);e++);for(l=u;o>0||l>0&&r;)o!==0&&(l===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,o--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:n=i,i.prevZ=a,a=i;t=r}a.nextZ=null,u*=2}while(s>1);return n}function xE(n,e,t,r,i){return n=(n-t)*i|0,e=(e-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function PCe(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function Wd(n,e,t,r,i,a,s,o){return(i-s)*(e-o)>=(n-s)*(a-o)&&(n-s)*(r-o)>=(t-s)*(e-o)&&(t-s)*(a-o)>=(i-s)*(r-o)}function LCe(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!RCe(n,e)&&(d0(n,e)&&d0(e,n)&&DCe(n,e)&&(_r(n.prev,n,e.prev)||_r(n,e.prev,e))||FS(n,e)&&_r(n.prev,n,n.next)>0&&_r(e.prev,e,e.next)>0)}function _r(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function FS(n,e){return n.x===e.x&&n.y===e.y}function Cj(n,e,t,r){const i=Q_(_r(n,e,t)),a=Q_(_r(n,e,r)),s=Q_(_r(t,r,n)),o=Q_(_r(t,r,e));return!!(i!==a&&s!==o||i===0&&Z_(n,t,e)||a===0&&Z_(n,r,e)||s===0&&Z_(t,n,r)||o===0&&Z_(t,e,r))}function Z_(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Q_(n){return n>0?1:n<0?-1:0}function RCe(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&Cj(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function d0(n,e){return _r(n.prev,n,n.next)<0?_r(n,e,n.next)>=0&&_r(n,n.prev,e)>=0:_r(n,e,n.prev)<0||_r(n,n.next,e)<0}function DCe(n,e){let t=n,r=!1;const i=(n.x+e.x)/2,a=(n.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&&(r=!r),t=t.next;while(t!==n);return r}function Ej(n,e){const t=new bE(n.i,n.x,n.y),r=new bE(e.i,e.x,e.y),i=n.next,a=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,a.next=r,r.prev=a,r}function E6(n,e,t,r){const i=new bE(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function p0(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function bE(n,e,t){this.i=n,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 ICe(n,e,t,r){let i=0;for(let a=e,s=t-r;a<t;a+=r)i+=(n[s]-n[a])*(n[a+1]+n[s+1]),s=a;return i}class ic{static area(e){const t=e.length;let r=0;for(let i=t-1,a=0;a<t;i=a++)r+=e[i].x*e[a].y-e[a].x*e[i].y;return r*.5}static isClockWise(e){return ic.area(e)<0}static triangulateShape(e,t){const r=[],i=[],a=[];P6(e),L6(r,e);let s=e.length;t.forEach(P6);for(let l=0;l<t.length;l++)i.push(s),s+=t[l].length,L6(r,t[l]);const o=mCe.triangulate(r,i);for(let l=0;l<o.length;l+=3)a.push(o.slice(l,l+3));return a}}function P6(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function L6(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class BS extends qn{constructor(e=new $o([new Ge(.5,.5),new Ge(-.5,.5),new Ge(-.5,-.5),new Ge(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const r=this,i=[],a=[];for(let o=0,l=e.length;o<l;o++){const u=e[o];s(u)}this.setAttribute("position",new or(i,3)),this.setAttribute("uv",new or(a,2)),this.computeVertexNormals();function s(o){const l=[],u=t.curveSegments!==void 0?t.curveSegments:12,c=t.steps!==void 0?t.steps:1,h=t.depth!==void 0?t.depth:1;let f=t.bevelEnabled!==void 0?t.bevelEnabled:!0,d=t.bevelThickness!==void 0?t.bevelThickness:.2,p=t.bevelSize!==void 0?t.bevelSize:d-.1,g=t.bevelOffset!==void 0?t.bevelOffset:0,v=t.bevelSegments!==void 0?t.bevelSegments:3;const m=t.extrudePath,y=t.UVGenerator!==void 0?t.UVGenerator:NCe;let _,x=!1,b,S,w,T;m&&(_=m.getSpacedPoints(c),x=!0,f=!1,b=m.computeFrenetFrames(c,!1),S=new te,w=new te,T=new te),f||(v=0,d=0,p=0,g=0);const C=o.extractPoints(u);let A=C.shape;const M=C.holes;if(!ic.isClockWise(A)){A=A.reverse();for(let j=0,xe=M.length;j<xe;j++){const pe=M[j];ic.isClockWise(pe)&&(M[j]=pe.reverse())}}const D=ic.triangulateShape(A,M),L=A;for(let j=0,xe=M.length;j<xe;j++){const pe=M[j];A=A.concat(pe)}function R(j,xe,pe){return xe||console.error("THREE.ExtrudeGeometry: vec does not exist"),j.clone().addScaledVector(xe,pe)}const N=A.length,F=D.length;function O(j,xe,pe){let we,V,ee;const ae=j.x-xe.x,I=j.y-xe.y,G=pe.x-j.x,K=pe.y-j.y,ge=ae*ae+I*I,Ee=ae*K-I*G;if(Math.abs(Ee)>Number.EPSILON){const q=Math.sqrt(ge),le=Math.sqrt(G*G+K*K),ue=xe.x-I/q,be=xe.y+ae/q,He=pe.x-K/le,nt=pe.y+G/le,ke=((He-ue)*K-(nt-be)*G)/(ae*K-I*G);we=ue+ae*ke-j.x,V=be+I*ke-j.y;const Tt=we*we+V*V;if(Tt<=2)return new Ge(we,V);ee=Math.sqrt(Tt/2)}else{let q=!1;ae>Number.EPSILON?G>Number.EPSILON&&(q=!0):ae<-Number.EPSILON?G<-Number.EPSILON&&(q=!0):Math.sign(I)===Math.sign(K)&&(q=!0),q?(we=-I,V=ae,ee=Math.sqrt(ge)):(we=ae,V=I,ee=Math.sqrt(ge/2))}return new Ge(we/ee,V/ee)}const H=[];for(let j=0,xe=L.length,pe=xe-1,we=j+1;j<xe;j++,pe++,we++)pe===xe&&(pe=0),we===xe&&(we=0),H[j]=O(L[j],L[pe],L[we]);const U=[];let $,Y=H.concat();for(let j=0,xe=M.length;j<xe;j++){const pe=M[j];$=[];for(let we=0,V=pe.length,ee=V-1,ae=we+1;we<V;we++,ee++,ae++)ee===V&&(ee=0),ae===V&&(ae=0),$[we]=O(pe[we],pe[ee],pe[ae]);U.push($),Y=Y.concat($)}for(let j=0;j<v;j++){const xe=j/v,pe=d*Math.cos(xe*Math.PI/2),we=p*Math.sin(xe*Math.PI/2)+g;for(let V=0,ee=L.length;V<ee;V++){const ae=R(L[V],H[V],we);Fe(ae.x,ae.y,-pe)}for(let V=0,ee=M.length;V<ee;V++){const ae=M[V];$=U[V];for(let I=0,G=ae.length;I<G;I++){const K=R(ae[I],$[I],we);Fe(K.x,K.y,-pe)}}}const oe=p+g;for(let j=0;j<N;j++){const xe=f?R(A[j],Y[j],oe):A[j];x?(w.copy(b.normals[0]).multiplyScalar(xe.x),S.copy(b.binormals[0]).multiplyScalar(xe.y),T.copy(_[0]).add(w).add(S),Fe(T.x,T.y,T.z)):Fe(xe.x,xe.y,0)}for(let j=1;j<=c;j++)for(let xe=0;xe<N;xe++){const pe=f?R(A[xe],Y[xe],oe):A[xe];x?(w.copy(b.normals[j]).multiplyScalar(pe.x),S.copy(b.binormals[j]).multiplyScalar(pe.y),T.copy(_[j]).add(w).add(S),Fe(T.x,T.y,T.z)):Fe(pe.x,pe.y,h/c*j)}for(let j=v-1;j>=0;j--){const xe=j/v,pe=d*Math.cos(xe*Math.PI/2),we=p*Math.sin(xe*Math.PI/2)+g;for(let V=0,ee=L.length;V<ee;V++){const ae=R(L[V],H[V],we);Fe(ae.x,ae.y,h+pe)}for(let V=0,ee=M.length;V<ee;V++){const ae=M[V];$=U[V];for(let I=0,G=ae.length;I<G;I++){const K=R(ae[I],$[I],we);x?Fe(K.x,K.y+_[c-1].y,_[c-1].x+pe):Fe(K.x,K.y,h+pe)}}}X(),re();function X(){const j=i.length/3;if(f){let xe=0,pe=N*xe;for(let we=0;we<F;we++){const V=D[we];Ce(V[2]+pe,V[1]+pe,V[0]+pe)}xe=c+v*2,pe=N*xe;for(let we=0;we<F;we++){const V=D[we];Ce(V[0]+pe,V[1]+pe,V[2]+pe)}}else{for(let xe=0;xe<F;xe++){const pe=D[xe];Ce(pe[2],pe[1],pe[0])}for(let xe=0;xe<F;xe++){const pe=D[xe];Ce(pe[0]+N*c,pe[1]+N*c,pe[2]+N*c)}}r.addGroup(j,i.length/3-j,0)}function re(){const j=i.length/3;let xe=0;_e(L,xe),xe+=L.length;for(let pe=0,we=M.length;pe<we;pe++){const V=M[pe];_e(V,xe),xe+=V.length}r.addGroup(j,i.length/3-j,1)}function _e(j,xe){let pe=j.length;for(;--pe>=0;){const we=pe;let V=pe-1;V<0&&(V=j.length-1);for(let ee=0,ae=c+v*2;ee<ae;ee++){const I=N*ee,G=N*(ee+1),K=xe+we+I,ge=xe+V+I,Ee=xe+V+G,q=xe+we+G;Ae(K,ge,Ee,q)}}}function Fe(j,xe,pe){l.push(j),l.push(xe),l.push(pe)}function Ce(j,xe,pe){ze(j),ze(xe),ze(pe);const we=i.length/3,V=y.generateTopUV(r,i,we-3,we-2,we-1);fe(V[0]),fe(V[1]),fe(V[2])}function Ae(j,xe,pe,we){ze(j),ze(xe),ze(we),ze(xe),ze(pe),ze(we);const V=i.length/3,ee=y.generateSideWallUV(r,i,V-6,V-3,V-2,V-1);fe(ee[0]),fe(ee[1]),fe(ee[3]),fe(ee[1]),fe(ee[2]),fe(ee[3])}function ze(j){i.push(l[j*3+0]),i.push(l[j*3+1]),i.push(l[j*3+2])}function fe(j){a.push(j.x),a.push(j.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,r=this.parameters.options;return kCe(t,r,e)}static fromJSON(e,t){const r=[];for(let a=0,s=e.shapes.length;a<s;a++){const o=t[e.shapes[a]];r.push(o)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new _b[i.type]().fromJSON(i)),new BS(r,e.options)}}const NCe={generateTopUV:function(n,e,t,r,i){const a=e[t*3],s=e[t*3+1],o=e[r*3],l=e[r*3+1],u=e[i*3],c=e[i*3+1];return[new Ge(a,s),new Ge(o,l),new Ge(u,c)]},generateSideWallUV:function(n,e,t,r,i,a){const s=e[t*3],o=e[t*3+1],l=e[t*3+2],u=e[r*3],c=e[r*3+1],h=e[r*3+2],f=e[i*3],d=e[i*3+1],p=e[i*3+2],g=e[a*3],v=e[a*3+1],m=e[a*3+2];return Math.abs(o-c)<Math.abs(s-u)?[new Ge(s,1-l),new Ge(u,1-h),new Ge(f,1-p),new Ge(g,1-m)]:[new Ge(o,1-l),new Ge(c,1-h),new Ge(d,1-p),new Ge(v,1-m)]}};function kCe(n,e,t){if(t.shapes=[],Array.isArray(n))for(let r=0,i=n.length;r<i;r++){const a=n[r];t.shapes.push(a.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class Y0 extends qn{constructor(e=new $o([new Ge(0,.5),new Ge(-.5,-.5),new Ge(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const r=[],i=[],a=[],s=[];let o=0,l=0;if(Array.isArray(e)===!1)u(e);else for(let c=0;c<e.length;c++)u(e[c]),this.addGroup(o,l,c),o+=l,l=0;this.setIndex(r),this.setAttribute("position",new or(i,3)),this.setAttribute("normal",new or(a,3)),this.setAttribute("uv",new or(s,2));function u(c){const h=i.length/3,f=c.extractPoints(t);let d=f.shape;const p=f.holes;ic.isClockWise(d)===!1&&(d=d.reverse());for(let v=0,m=p.length;v<m;v++){const y=p[v];ic.isClockWise(y)===!0&&(p[v]=y.reverse())}const g=ic.triangulateShape(d,p);for(let v=0,m=p.length;v<m;v++){const y=p[v];d=d.concat(y)}for(let v=0,m=d.length;v<m;v++){const y=d[v];i.push(y.x,y.y,0),a.push(0,0,1),s.push(y.x,y.y)}for(let v=0,m=g.length;v<m;v++){const y=g[v],_=y[0]+h,x=y[1]+h,b=y[2]+h;r.push(_,x,b),l+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return OCe(t,e)}static fromJSON(e,t){const r=[];for(let i=0,a=e.shapes.length;i<a;i++){const s=t[e.shapes[i]];r.push(s)}return new Y0(r,e.curveSegments)}}function OCe(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const i=n[t];e.shapes.push(i.uuid)}else e.shapes.push(n.uuid);return e}class GS extends qn{constructor(e=new Aj(new te(-1,-1,0),new te(-1,1,0),new te(1,1,0)),t=64,r=1,i=8,a=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:i,closed:a};const s=e.computeFrenetFrames(t,a);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new te,l=new te,u=new Ge;let c=new te;const h=[],f=[],d=[],p=[];g(),this.setIndex(p),this.setAttribute("position",new or(h,3)),this.setAttribute("normal",new or(f,3)),this.setAttribute("uv",new or(d,2));function g(){for(let _=0;_<t;_++)v(_);v(a===!1?t:0),y(),m()}function v(_){c=e.getPointAt(_/t,c);const x=s.normals[_],b=s.binormals[_];for(let S=0;S<=i;S++){const w=S/i*Math.PI*2,T=Math.sin(w),C=-Math.cos(w);l.x=C*x.x+T*b.x,l.y=C*x.y+T*b.y,l.z=C*x.z+T*b.z,l.normalize(),f.push(l.x,l.y,l.z),o.x=c.x+r*l.x,o.y=c.y+r*l.y,o.z=c.z+r*l.z,h.push(o.x,o.y,o.z)}}function m(){for(let _=1;_<=t;_++)for(let x=1;x<=i;x++){const b=(i+1)*(_-1)+(x-1),S=(i+1)*_+(x-1),w=(i+1)*_+x,T=(i+1)*(_-1)+x;p.push(b,S,T),p.push(S,w,T)}}function y(){for(let _=0;_<=t;_++)for(let x=0;x<=i;x++)u.x=_/t,u.y=x/i,d.push(u.x,u.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new GS(new _b[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class FCe extends qn{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],r=new Set,i=new te,a=new te;if(e.index!==null){const s=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let u=0,c=l.length;u<c;++u){const h=l[u],f=h.start,d=h.count;for(let p=f,g=f+d;p<g;p+=3)for(let v=0;v<3;v++){const m=o.getX(p+v),y=o.getX(p+(v+1)%3);i.fromBufferAttribute(s,m),a.fromBufferAttribute(s,y),R6(i,a,r)===!0&&(t.push(i.x,i.y,i.z),t.push(a.x,a.y,a.z))}}}else{const s=e.attributes.position;for(let o=0,l=s.count/3;o<l;o++)for(let u=0;u<3;u++){const c=3*o+u,h=3*o+(u+1)%3;i.fromBufferAttribute(s,c),a.fromBufferAttribute(s,h),R6(i,a,r)===!0&&(t.push(i.x,i.y,i.z),t.push(a.x,a.y,a.z))}}this.setAttribute("position",new or(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function R6(n,e,t){const r=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(r)===!0||t.has(i)===!0?!1:(t.add(r),t.add(i),!0)}class kh extends Ns{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new xt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new xt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ER,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,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.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,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.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,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}}class Zl extends kh{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ge(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Xr(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new xt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new xt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new xt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=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 SE extends Ns{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new xt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new xt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ER,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=TR,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 J_(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function BCe(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function GCe(n){function e(i,a){return n[i]-n[a]}const t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r}function D6(n,e,t){const r=n.length,i=new n.constructor(r);for(let a=0,s=0;s!==r;++a){const o=t[a]*e;for(let l=0;l!==e;++l)i[s++]=n[o+l]}return i}function Pj(n,e,t,r){let i=1,a=n[0];for(;a!==void 0&&a[r]===void 0;)a=n[i++];if(a===void 0)return;let s=a[r];if(s!==void 0)if(Array.isArray(s))do s=a[r],s!==void 0&&(e.push(a.time),t.push.apply(t,s)),a=n[i++];while(a!==void 0);else if(s.toArray!==void 0)do s=a[r],s!==void 0&&(e.push(a.time),s.toArray(t,t.length)),a=n[i++];while(a!==void 0);else do s=a[r],s!==void 0&&(e.push(a.time),t.push(s)),a=n[i++];while(a!==void 0)}class K0{constructor(e,t,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let r=this._cachedIndex,i=t[r],a=t[r-1];e:{t:{let s;n:{r:if(!(e<i)){for(let o=r+2;;){if(i===void 0){if(e<a)break r;return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===o)break;if(a=i,i=t[++r],e<i)break t}s=t.length;break n}if(!(e>=a)){const o=t[1];e<o&&(r=2,a=o);for(let l=r-2;;){if(a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===l)break;if(i=a,a=t[--r-1],e>=a)break t}s=r,r=0;break n}break e}for(;r<s;){const o=r+s>>>1;e<t[o]?s=o:r=o+1}if(i=t[r],a=t[r-1],a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,a,i)}return this.interpolate_(r,a,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,i=this.valueSize,a=e*i;for(let s=0;s!==i;++s)t[s]=r[a+s];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class zCe extends K0{constructor(e,t,r,i){super(e,t,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:m8,endingEnd:m8}}intervalChanged_(e,t,r){const i=this.parameterPositions;let a=e-2,s=e+1,o=i[a],l=i[s];if(o===void 0)switch(this.getSettings_().endingStart){case y8:a=e,o=2*t-r;break;case _8:a=i.length-2,o=t+i[a]-i[a+1];break;default:a=e,o=r}if(l===void 0)switch(this.getSettings_().endingEnd){case y8:s=e,l=2*r-t;break;case _8:s=1,l=r+i[1]-i[0];break;default:s=e-1,l=t}const u=(r-t)*.5,c=this.valueSize;this._weightPrev=u/(t-o),this._weightNext=u/(l-r),this._offsetPrev=a*c,this._offsetNext=s*c}interpolate_(e,t,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=e*o,u=l-o,c=this._offsetPrev,h=this._offsetNext,f=this._weightPrev,d=this._weightNext,p=(r-t)/(i-t),g=p*p,v=g*p,m=-f*v+2*f*g-f*p,y=(1+f)*v+(-1.5-2*f)*g+(-.5+f)*p+1,_=(-1-d)*v+(1.5+d)*g+.5*p,x=d*v-d*g;for(let b=0;b!==o;++b)a[b]=m*s[c+b]+y*s[u+b]+_*s[l+b]+x*s[h+b];return a}}class UCe extends K0{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=e*o,u=l-o,c=(r-t)/(i-t),h=1-c;for(let f=0;f!==o;++f)a[f]=s[u+f]*h+s[l+f]*c;return a}}class VCe extends K0{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class sl{constructor(e,t,r,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=J_(t,this.TimeBufferType),this.values=J_(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let r;if(t.toJSON!==this.toJSON)r=t.toJSON(e);else{r={name:e.name,times:J_(e.times,Array),values:J_(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(r.interpolation=i)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new VCe(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new UCe(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new zCe(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case u0:t=this.InterpolantFactoryMethodDiscrete;break;case Ip:t=this.InterpolantFactoryMethodLinear;break;case r2:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const r="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(r);return console.warn("THREE.KeyframeTrack:",r),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return u0;case this.InterpolantFactoryMethodLinear:return Ip;case this.InterpolantFactoryMethodSmooth:return r2}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]*=e}return this}trim(e,t){const r=this.times,i=r.length;let a=0,s=i-1;for(;a!==i&&r[a]<e;)++a;for(;s!==-1&&r[s]>t;)--s;if(++s,a!==0||s!==i){a>=s&&(s=Math.max(s,1),a=s-1);const o=this.getValueSize();this.times=r.slice(a,s),this.values=this.values.slice(a*o,s*o)}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 r=this.times,i=this.values,a=r.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let o=0;o!==a;o++){const l=r[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,s),e=!1;break}s=l}if(i!==void 0&&BCe(i))for(let o=0,l=i.length;o!==l;++o){const u=i[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===r2,a=e.length-1;let s=1;for(let o=1;o<a;++o){let l=!1;const u=e[o],c=e[o+1];if(u!==c&&(o!==1||u!==e[0]))if(i)l=!0;else{const h=o*r,f=h-r,d=h+r;for(let p=0;p!==r;++p){const g=t[h+p];if(g!==t[f+p]||g!==t[d+p]){l=!0;break}}}if(l){if(o!==s){e[s]=e[o];const h=o*r,f=s*r;for(let d=0;d!==r;++d)t[f+d]=t[h+d]}++s}}if(a>0){e[s]=e[a];for(let o=a*r,l=s*r,u=0;u!==r;++u)t[l+u]=t[o+u];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=t.slice(0,s*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}sl.prototype.TimeBufferType=Float32Array;sl.prototype.ValueBufferType=Float32Array;sl.prototype.DefaultInterpolation=Ip;class cv extends sl{}cv.prototype.ValueTypeName="bool";cv.prototype.ValueBufferType=Array;cv.prototype.DefaultInterpolation=u0;cv.prototype.InterpolantFactoryMethodLinear=void 0;cv.prototype.InterpolantFactoryMethodSmooth=void 0;class Lj extends sl{}Lj.prototype.ValueTypeName="color";class Op extends sl{}Op.prototype.ValueTypeName="number";class HCe extends K0{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=(r-t)/(i-t);let u=e*o;for(let c=u+o;u!==c;u+=4)ho.slerpFlat(a,0,s,u-o,s,u,l);return a}}class gf extends sl{InterpolantFactoryMethodLinear(e){return new HCe(this.times,this.values,this.getValueSize(),e)}}gf.prototype.ValueTypeName="quaternion";gf.prototype.DefaultInterpolation=Ip;gf.prototype.InterpolantFactoryMethodSmooth=void 0;class hv extends sl{}hv.prototype.ValueTypeName="string";hv.prototype.ValueBufferType=Array;hv.prototype.DefaultInterpolation=u0;hv.prototype.InterpolantFactoryMethodLinear=void 0;hv.prototype.InterpolantFactoryMethodSmooth=void 0;class Fp extends sl{}Fp.prototype.ValueTypeName="vector";class WCe{constructor(e,t=-1,r,i=xSe){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=Is(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,i=1/(e.fps||1);for(let s=0,o=r.length;s!==o;++s)t.push(jCe(r[s]).scale(i));const a=new this(e.name,e.duration,t,e.blendMode);return a.uuid=e.uuid,a}static toJSON(e){const t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let a=0,s=r.length;a!==s;++a)t.push(sl.toJSON(r[a]));return i}static CreateFromMorphTargetSequence(e,t,r,i){const a=t.length,s=[];for(let o=0;o<a;o++){let l=[],u=[];l.push((o+a-1)%a,o,(o+1)%a),u.push(0,1,0);const c=GCe(l);l=D6(l,1,c),u=D6(u,1,c),!i&&l[0]===0&&(l.push(a),u.push(u[0])),s.push(new Op(".morphTargetInfluences["+t[o].name+"]",l,u).scale(1/r))}return new this(e,-1,s)}static findByName(e,t){let r=e;if(!Array.isArray(e)){const i=e;r=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<r.length;i++)if(r[i].name===t)return r[i];return null}static CreateClipsFromMorphTargetSequences(e,t,r){const i={},a=/^([\w-]*?)([\d]+)$/;for(let o=0,l=e.length;o<l;o++){const u=e[o],c=u.name.match(a);if(c&&c.length>1){const h=c[1];let f=i[h];f||(i[h]=f=[]),f.push(u)}}const s=[];for(const o in i)s.push(this.CreateFromMorphTargetSequence(o,i[o],t,r));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(h,f,d,p,g){if(d.length!==0){const v=[],m=[];Pj(d,v,m,p),v.length!==0&&g.push(new h(f,v,m))}},i=[],a=e.name||"default",s=e.fps||30,o=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let h=0;h<u.length;h++){const f=u[h].keys;if(!(!f||f.length===0))if(f[0].morphTargets){const d={};let p;for(p=0;p<f.length;p++)if(f[p].morphTargets)for(let g=0;g<f[p].morphTargets.length;g++)d[f[p].morphTargets[g]]=-1;for(const g in d){const v=[],m=[];for(let y=0;y!==f[p].morphTargets.length;++y){const _=f[p];v.push(_.time),m.push(_.morphTarget===g?1:0)}i.push(new Op(".morphTargetInfluence["+g+"]",v,m))}l=d.length*s}else{const d=".bones["+t[h].name+"]";r(Fp,d+".position",f,"pos",i),r(gf,d+".quaternion",f,"rot",i),r(Fp,d+".scale",f,"scl",i)}}return i.length===0?null:new this(a,l,i,o)}resetDuration(){const e=this.tracks;let t=0;for(let r=0,i=e.length;r!==i;++r){const a=this.tracks[r];t=Math.max(t,a.times[a.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function $Ce(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Op;case"vector":case"vector2":case"vector3":case"vector4":return Fp;case"color":return Lj;case"quaternion":return gf;case"bool":case"boolean":return cv;case"string":return hv}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function jCe(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=$Ce(n.type);if(n.times===void 0){const t=[],r=[];Pj(n.keys,t,r,"value"),n.times=t,n.values=r}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const ju={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class Rj{constructor(e,t,r){const i=this;let a=!1,s=0,o=0,l;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(c){o++,a===!1&&i.onStart!==void 0&&i.onStart(c,s,o),a=!0},this.itemEnd=function(c){s++,i.onProgress!==void 0&&i.onProgress(c,s,o),s===o&&(a=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(c){i.onError!==void 0&&i.onError(c)},this.resolveURL=function(c){return l?l(c):c},this.setURLModifier=function(c){return l=c,this},this.addHandler=function(c,h){return u.push(c,h),this},this.removeHandler=function(c){const h=u.indexOf(c);return h!==-1&&u.splice(h,2),this},this.getHandler=function(c){for(let h=0,f=u.length;h<f;h+=2){const d=u[h],p=u[h+1];if(d.global&&(d.lastIndex=0),d.test(c))return p}return null}}}const qCe=new Rj;class Ac{constructor(e){this.manager=e!==void 0?e:qCe,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const r=this;return new Promise(function(i,a){r.load(e,i,t,a)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Ac.DEFAULT_MATERIAL_NAME="__DEFAULT";const _l={};class XCe extends Error{constructor(e,t){super(e),this.response=t}}class v0 extends Ac{constructor(e){super(e)}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=ju.get(e);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(a),this.manager.itemEnd(e)},0),a;if(_l[e]!==void 0){_l[e].push({onLoad:t,onProgress:r,onError:i});return}_l[e]=[],_l[e].push({onLoad:t,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(s).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=_l[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 b=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:d});for(let S=0,w=c.length;S<w;S++){const T=c[S];T.onProgress&&T.onProgress(b)}m.enqueue(x),y()}})}}});return new Response(v)}else throw new XCe(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,o));case"json":return u.json();default:if(o===void 0)return u.text();{const h=/charset="?([^;"\s]*)"?/i.exec(o),f=h&&h[1]?h[1].toLowerCase():void 0,d=new TextDecoder(f);return u.arrayBuffer().then(p=>d.decode(p))}}}).then(u=>{ju.add(e,u);const c=_l[e];delete _l[e];for(let h=0,f=c.length;h<f;h++){const d=c[h];d.onLoad&&d.onLoad(u)}}).catch(u=>{const c=_l[e];if(c===void 0)throw this.manager.itemError(e),u;delete _l[e];for(let h=0,f=c.length;h<f;h++){const d=c[h];d.onError&&d.onError(u)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class YCe extends Ac{constructor(e){super(e)}load(e,t,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,s=ju.get(e);if(s!==void 0)return a.manager.itemStart(e),setTimeout(function(){t&&t(s),a.manager.itemEnd(e)},0),s;const o=c0("img");function l(){c(),ju.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(){o.removeEventListener("load",l,!1),o.removeEventListener("error",u,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),a.manager.itemStart(e),o.src=e,o}}class jR extends Ac{constructor(e){super(e)}load(e,t,r,i){const a=new ni,s=new YCe(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(o){a.image=o,a.needsUpdate=!0,t!==void 0&&t(a)},r,i),a}}class zS extends er{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new xt(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 N2=new Jt,I6=new te,N6=new te;class qR{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ge(512,512),this.map=null,this.mapPass=null,this.matrix=new Jt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new NR,this._frameExtents=new Ge(1,1),this._viewportCount=1,this._viewports=[new En(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;I6.setFromMatrixPosition(e.matrixWorld),t.position.copy(I6),N6.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(N6),t.updateMatrixWorld(),N2.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(N2),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(N2)}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 KCe extends qR{constructor(){super(new Gi(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,r=Np*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,a=e.distance||t.far;(r!==t.fov||i!==t.aspect||a!==t.far)&&(t.fov=r,t.aspect=i,t.far=a,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class ZCe extends zS{constructor(e,t,r=0,i=Math.PI/3,a=0,s=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(er.DEFAULT_UP),this.updateMatrix(),this.target=new er,this.distance=r,this.angle=i,this.penumbra=a,this.decay=s,this.map=null,this.shadow=new KCe}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 k6=new Jt,Sg=new te,k2=new te;class QCe extends qR{constructor(){super(new Gi(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ge(4,2),this._viewportCount=6,this._viewports=[new En(2,1,1,1),new En(0,1,1,1),new En(3,1,1,1),new En(1,1,1,1),new En(3,0,1,1),new En(1,0,1,1)],this._cubeDirections=[new te(1,0,0),new te(-1,0,0),new te(0,0,1),new te(0,0,-1),new te(0,1,0),new te(0,-1,0)],this._cubeUps=[new te(0,1,0),new te(0,1,0),new te(0,1,0),new te(0,1,0),new te(0,0,1),new te(0,0,-1)]}updateMatrices(e,t=0){const r=this.camera,i=this.matrix,a=e.distance||r.far;a!==r.far&&(r.far=a,r.updateProjectionMatrix()),Sg.setFromMatrixPosition(e.matrixWorld),r.position.copy(Sg),k2.copy(r.position),k2.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(k2),r.updateMatrixWorld(),i.makeTranslation(-Sg.x,-Sg.y,-Sg.z),k6.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(k6)}}class Dj extends zS{constructor(e,t,r=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new QCe}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 JCe extends qR{constructor(){super(new kS(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class xb extends zS{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(er.DEFAULT_UP),this.updateMatrix(),this.target=new er,this.shadow=new JCe}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Ij extends zS{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class mm{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let r=0,i=e.length;r<i;r++)t+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(t))}catch(r){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class eEe extends qn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class tEe extends Ac{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap=="undefined"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch=="undefined"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,s=ju.get(e);if(s!==void 0){if(a.manager.itemStart(e),s.then){s.then(u=>{t&&t(u),a.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(s),a.manager.itemEnd(e)},0),s}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const l=fetch(e,o).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(u){return ju.add(e,u),t&&t(u),a.manager.itemEnd(e),u}).catch(function(u){i&&i(u),ju.remove(e),a.manager.itemError(e),a.manager.itemEnd(e)});ju.add(e,l),a.manager.itemStart(e)}}class nEe{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=O6(),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=O6();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function O6(){return(typeof performance=="undefined"?Date:performance).now()}const XR="\\[\\]\\.:\\/",rEe=new RegExp("["+XR+"]","g"),YR="[^"+XR+"]",iEe="[^"+XR.replace("\\.","")+"]",aEe=/((?:WC+[\/:])*)/.source.replace("WC",YR),sEe=/(WCOD+)?/.source.replace("WCOD",iEe),oEe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",YR),lEe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",YR),uEe=new RegExp("^"+aEe+sEe+oEe+lEe+"$"),cEe=["material","materials","bones","map"];class hEe{constructor(e,t,r){const i=r||zn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,a=r.length;i!==a;++i)r[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class zn{constructor(e,t,r){this.path=t,this.parsedPath=r||zn.parseTrackName(t),this.node=zn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new zn.Composite(e,t,r):new zn(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(rEe,"")}static parseTrackName(e){const t=uEe.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const a=r.nodeName.substring(i+1);cEe.indexOf(a)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=a)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(a){for(let s=0;s<a.length;s++){const o=a[s];if(o.name===t||o.uuid===t)return o;const l=r(o.children);if(l)return l}return null},i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const r=this.resolvedProperty;for(let i=0,a=r.length;i!==a;++i)e[t++]=r[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const r=this.resolvedProperty;for(let i=0,a=r.length;i!==a;++i)r[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const r=this.resolvedProperty;for(let i=0,a=r.length;i!==a;++i)r[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const r=this.resolvedProperty;for(let i=0,a=r.length;i!==a;++i)r[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,r=t.objectName,i=t.propertyName;let a=t.propertyIndex;if(e||(e=zn.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(r){let u=t.objectIndex;switch(r){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let c=0;c<e.length;c++)if(e[c].name===u){u=c;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[r]}if(u!==void 0){if(e[u]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const s=e[i];if(s===void 0){const u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?o=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(a!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[a]!==void 0&&(a=e.morphTargetDictionary[a])}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=a}else s.fromArray!==void 0&&s.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}zn.Composite=hEe;zn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};zn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};zn.prototype.GetterByBindingType=[zn.prototype._getValue_direct,zn.prototype._getValue_array,zn.prototype._getValue_arrayElement,zn.prototype._getValue_toArray];zn.prototype.SetterByBindingTypeAndVersioning=[[zn.prototype._setValue_direct,zn.prototype._setValue_direct_setNeedsUpdate,zn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[zn.prototype._setValue_array,zn.prototype._setValue_array_setNeedsUpdate,zn.prototype._setValue_array_setMatrixWorldNeedsUpdate],[zn.prototype._setValue_arrayElement,zn.prototype._setValue_arrayElement_setNeedsUpdate,zn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[zn.prototype._setValue_fromArray,zn.prototype._setValue_fromArray_setNeedsUpdate,zn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class wE extends BR{constructor(e,t,r=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class fEe{constructor(e,t,r=0,i=1/0){this.ray=new ov(e,t),this.near=r,this.far=i,this.camera=null,this.layers=new DR,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,r=[]){return AE(e,this,r,t),r.sort(F6),r}intersectObjects(e,t=!0,r=[]){for(let i=0,a=e.length;i<a;i++)AE(e[i],this,r,t);return r.sort(F6),r}}function F6(n,e){return n.distance-e.distance}function AE(n,e,t,r){if(n.layers.test(e.layers)&&n.raycast(e,t),r===!0){const i=n.children;for(let a=0,s=i.length;a<s;a++)AE(i[a],e,t,!0)}}class B6{constructor(e=1,t=0,r=0){return this.radius=e,this.phi=t,this.theta=r,this}set(e,t,r){return this.radius=e,this.phi=t,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+t*t+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(Xr(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const G6=new te,e1=new te;class dEe{constructor(e=new te,t=new te){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){G6.subVectors(e,this.start),e1.subVectors(this.end,this.start);const r=e1.dot(e1);let a=e1.dot(G6)/r;return t&&(a=Xr(a,0,1)),a}closestPointToPoint(e,t,r){const i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class pEe extends zR{constructor(e=10,t=10,r=4473924,i=8947848){r=new xt(r),i=new xt(i);const a=t/2,s=e/t,o=e/2,l=[],u=[];for(let f=0,d=0,p=-o;f<=t;f++,p+=s){l.push(-o,0,p,o,0,p),l.push(p,0,-o,p,0,o);const g=f===a?r:i;g.toArray(u,d),d+=3,g.toArray(u,d),d+=3,g.toArray(u,d),d+=3,g.toArray(u,d),d+=3}const c=new qn;c.setAttribute("position",new or(l,3)),c.setAttribute("color",new or(u,3));const h=new Oo({vertexColors:!0,toneMapped:!1});super(c,h),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Nj extends zR{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new qn;i.setAttribute("position",new or(t,3)),i.setAttribute("color",new or(r,3));const a=new Oo({vertexColors:!0,toneMapped:!1});super(i,a),this.type="AxesHelper"}setColors(e,t,r){const i=new xt,a=this.geometry.attributes.color.array;return i.set(e),i.toArray(a,0),i.toArray(a,3),i.set(t),i.toArray(a,6),i.toArray(a,9),i.set(r),i.toArray(a,12),i.toArray(a,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:MR}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=MR);function vEe(n){let e=null,t=!1,r=!1;function i(){!t||r||(n(),e=requestAnimationFrame(i))}function a(){t||(t=!0,i())}function s(){t&&(t=!1,r=!0,cancelAnimationFrame(e))}function o(){!t&&r&&(t=!0,r=!1,i())}return{start:a,pause:s,resume:o,isActive:()=>t}}class US{constructor(){this.events=new Map}on(e,t){let r=this.events.get(e);r||(r=new Set,this.events.set(e,r)),r.add(t)}off(e,t){const r=this.events.get(e);r&&(t?r.delete(t):this.events.delete(e))}emit(e,...t){const r=this.events.get(e);r&&r.forEach(i=>{i(...t)})}once(e,t){const r=(...i)=>{t(...i),this.off(e,r)};this.on(e,r)}}class gEe extends US{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 mEe extends US{constructor(){super(),this.start=Date.now(),this.current=this.start,this.elapsed=0,this.delta=16,this.clock=new nEe,this.raf=vEe(()=>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(),r=this.clock.getElapsedTime();this.emit("tick",t,r)}destroy(){this.pause(),this.off("tick")}pause(){this.raf.pause()}resume(){this.raf.resume()}isActive(){this.raf.isActive()}}function kj(n,e=!1){const t=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),i=new Set(Object.keys(n[0].morphAttributes)),a={},s={},o=n[0].morphTargetsRelative,l=new qn;let u=0;for(let c=0;c<n.length;++c){const h=n[c];let f=0;if(t!==(h.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const d in h.attributes){if(!r.has(d))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+'. All geometries must have compatible attributes; make sure "'+d+'" attribute exists among all geometries, or in none of them.'),null;a[d]===void 0&&(a[d]=[]),a[d].push(h.attributes[d]),f++}if(f!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". Make sure all geometries have the same number of attributes."),null;if(o!==h.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const d in h.morphAttributes){if(!i.has(d))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphAttributes must be consistent throughout all geometries."),null;s[d]===void 0&&(s[d]=[]),s[d].push(h.morphAttributes[d])}if(e){let d;if(t)d=h.index.count;else if(h.attributes.position!==void 0)d=h.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". The geometry must have either an index or a position attribute"),null;l.addGroup(u,d,c),u+=d}}if(t){let c=0;const h=[];for(let f=0;f<n.length;++f){const d=n[f].index;for(let p=0;p<d.count;++p)h.push(d.getX(p)+c);c+=n[f].attributes.position.count}l.setIndex(h)}for(const c in a){const h=z6(a[c]);if(!h)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+c+" attribute."),null;l.setAttribute(c,h)}for(const c in s){const h=s[c][0].length;if(h===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[c]=[];for(let f=0;f<h;++f){const d=[];for(let g=0;g<s[c].length;++g)d.push(s[c][g][f]);const p=z6(d);if(!p)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+c+" morphAttribute."),null;l.morphAttributes[c].push(p)}}return l}function z6(n){let e,t,r,i=-1,a=0;for(let u=0;u<n.length;++u){const c=n[u];if(e===void 0&&(e=c.array.constructor),e!==c.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=c.itemSize),t!==c.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(r===void 0&&(r=c.normalized),r!==c.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=c.gpuType),i!==c.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;a+=c.count*t}const s=new e(a),o=new br(s,t,r);let l=0;for(let u=0;u<n.length;++u){const c=n[u];if(c.isInterleavedBufferAttribute){const h=l/t;for(let f=0,d=c.count;f<d;f++)for(let p=0;p<t;p++){const g=c.getComponent(f,p);o.setComponent(f+h,p,g)}}else s.set(c.array,l);l+=c.count*t}return i!==void 0&&(o.gpuType=i),o}function U6(n,e){if(e===bSe)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===dE||e===Q$){let t=n.getIndex();if(t===null){const s=[],o=n.getAttribute("position");if(o!==void 0){for(let l=0;l<o.count;l++)s.push(l);n.setIndex(s),t=n.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const r=t.count-2,i=[];if(e===dE)for(let s=1;s<=r;s++)i.push(t.getX(0)),i.push(t.getX(s)),i.push(t.getX(s+1));else for(let s=0;s<r;s++)s%2===0?(i.push(t.getX(s)),i.push(t.getX(s+1)),i.push(t.getX(s+2))):(i.push(t.getX(s+2)),i.push(t.getX(s+1)),i.push(t.getX(s)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=n.clone();return a.setIndex(i),a.clearGroups(),a}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),n}class yEe extends Ac{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new wEe(t)}),this.register(function(t){return new DEe(t)}),this.register(function(t){return new IEe(t)}),this.register(function(t){return new NEe(t)}),this.register(function(t){return new MEe(t)}),this.register(function(t){return new TEe(t)}),this.register(function(t){return new CEe(t)}),this.register(function(t){return new EEe(t)}),this.register(function(t){return new SEe(t)}),this.register(function(t){return new PEe(t)}),this.register(function(t){return new AEe(t)}),this.register(function(t){return new REe(t)}),this.register(function(t){return new LEe(t)}),this.register(function(t){return new xEe(t)}),this.register(function(t){return new kEe(t)}),this.register(function(t){return new OEe(t)})}load(e,t,r,i){const a=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const u=mm.extractUrlBase(e);s=mm.resolveURL(u,this.path)}else s=mm.extractUrlBase(e);this.manager.itemStart(e);const o=function(u){i?i(u):console.error(u),a.manager.itemError(e),a.manager.itemEnd(e)},l=new v0(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){try{a.parse(u,s,function(c){t(c),a.manager.itemEnd(e)},o)}catch(c){o(c)}},r,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,r,i){let a;const s={},o={},l=new TextDecoder;if(typeof e=="string")a=JSON.parse(e);else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===Oj){try{s[yn.KHR_BINARY_GLTF]=new FEe(e)}catch(h){i&&i(h);return}a=JSON.parse(s[yn.KHR_BINARY_GLTF].content)}else a=JSON.parse(l.decode(e));else a=e;if(a.asset===void 0||a.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const u=new KEe(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<this.pluginCallbacks.length;c++){const h=this.pluginCallbacks[c](u);h.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[h.name]=h,s[h.name]=!0}if(a.extensionsUsed)for(let c=0;c<a.extensionsUsed.length;++c){const h=a.extensionsUsed[c],f=a.extensionsRequired||[];switch(h){case yn.KHR_MATERIALS_UNLIT:s[h]=new bEe;break;case yn.KHR_DRACO_MESH_COMPRESSION:s[h]=new BEe(a,this.dracoLoader);break;case yn.KHR_TEXTURE_TRANSFORM:s[h]=new GEe;break;case yn.KHR_MESH_QUANTIZATION:s[h]=new zEe;break;default:f.indexOf(h)>=0&&o[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}u.setExtensions(s),u.setPlugins(o),u.parse(r,i)}parseAsync(e,t){const r=this;return new Promise(function(i,a){r.parse(e,t,i,a)})}}function _Ee(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const yn={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 xEe{constructor(e){this.parser=e,this.name=yn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,i=t.length;r<i;r++){const a=t[r];a.extensions&&a.extensions[this.name]&&a.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,a.extensions[this.name].light)}}_loadLight(e){const t=this.parser,r="light:"+e;let i=t.cache.get(r);if(i)return i;const a=t.json,l=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e];let u;const c=new xt(16777215);l.color!==void 0&&c.setRGB(l.color[0],l.color[1],l.color[2],ai);const h=l.range!==void 0?l.range:0;switch(l.type){case"directional":u=new xb(c),u.target.position.set(0,0,-1),u.add(u.target);break;case"point":u=new Dj(c),u.distance=h;break;case"spot":u=new ZCe(c),u.distance=h,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,u.angle=l.spot.outerConeAngle,u.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,u.target.position.set(0,0,-1),u.add(u.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return u.position.set(0,0,0),u.decay=2,Cu(u,l),l.intensity!==void 0&&(u.intensity=l.intensity),u.name=t.createUniqueName(l.name||"light_"+e),i=Promise.resolve(u),t.cache.add(r,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,r=this.parser,a=r.json.nodes[e],o=(a.extensions&&a.extensions[this.name]||{}).light;return o===void 0?null:this._loadLight(o).then(function(l){return r._getNodeRef(t.cache,o,l)})}}class bEe{constructor(){this.name=yn.KHR_MATERIALS_UNLIT}getMaterialType(){return Nn}extendParams(e,t,r){const i=[];e.color=new xt(1,1,1),e.opacity=1;const a=t.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){const s=a.baseColorFactor;e.color.setRGB(s[0],s[1],s[2],ai),e.opacity=s[3]}a.baseColorTexture!==void 0&&i.push(r.assignTexture(e,"map",a.baseColorTexture,Vn))}return Promise.all(i)}}class SEe{constructor(e){this.parser=e,this.name=yn.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=i.extensions[this.name].emissiveStrength;return a!==void 0&&(t.emissiveIntensity=a),Promise.resolve()}}class wEe{constructor(e){this.parser=e,this.name=yn.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zl}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];if(s.clearcoatFactor!==void 0&&(t.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&a.push(r.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&a.push(r.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(a.push(r.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const o=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ge(o,o)}return Promise.all(a)}}class AEe{constructor(e){this.parser=e,this.name=yn.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zl}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];return s.iridescenceFactor!==void 0&&(t.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&a.push(r.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(t.iridescenceIOR=s.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&a.push(r.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(a)}}class MEe{constructor(e){this.parser=e,this.name=yn.KHR_MATERIALS_SHEEN}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zl}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[];t.sheenColor=new xt(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=i.extensions[this.name];if(s.sheenColorFactor!==void 0){const o=s.sheenColorFactor;t.sheenColor.setRGB(o[0],o[1],o[2],ai)}return s.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&a.push(r.assignTexture(t,"sheenColorMap",s.sheenColorTexture,Vn)),s.sheenRoughnessTexture!==void 0&&a.push(r.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(a)}}class TEe{constructor(e){this.parser=e,this.name=yn.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zl}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];return s.transmissionFactor!==void 0&&(t.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&a.push(r.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(a)}}class CEe{constructor(e){this.parser=e,this.name=yn.KHR_MATERIALS_VOLUME}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zl}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];t.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&a.push(r.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;const o=s.attenuationColor||[1,1,1];return t.attenuationColor=new xt().setRGB(o[0],o[1],o[2],ai),Promise.all(a)}}class EEe{constructor(e){this.parser=e,this.name=yn.KHR_MATERIALS_IOR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zl}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=i.extensions[this.name];return t.ior=a.ior!==void 0?a.ior:1.5,Promise.resolve()}}class PEe{constructor(e){this.parser=e,this.name=yn.KHR_MATERIALS_SPECULAR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zl}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];t.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&a.push(r.assignTexture(t,"specularIntensityMap",s.specularTexture));const o=s.specularColorFactor||[1,1,1];return t.specularColor=new xt().setRGB(o[0],o[1],o[2],ai),s.specularColorTexture!==void 0&&a.push(r.assignTexture(t,"specularColorMap",s.specularColorTexture,Vn)),Promise.all(a)}}class LEe{constructor(e){this.parser=e,this.name=yn.EXT_MATERIALS_BUMP}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zl}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];return t.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&a.push(r.assignTexture(t,"bumpMap",s.bumpTexture)),Promise.all(a)}}class REe{constructor(e){this.parser=e,this.name=yn.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Zl}extendMaterialParams(e,t){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const a=[],s=i.extensions[this.name];return s.anisotropyStrength!==void 0&&(t.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(t.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&a.push(r.assignTexture(t,"anisotropyMap",s.anisotropyTexture)),Promise.all(a)}}class DEe{constructor(e){this.parser=e,this.name=yn.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,r=t.json,i=r.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const a=i.extensions[this.name],s=t.options.ktx2Loader;if(!s){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,a.source,s)}}class IEe{constructor(e){this.parser=e,this.name=yn.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[t])return null;const s=a.extensions[t],o=i.images[s.source];let l=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.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 NEe{constructor(e){this.parser=e,this.name=yn.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[t])return null;const s=a.extensions[t],o=i.images[s.source];let l=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.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 kEe{constructor(e){this.name=yn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],a=this.parser.getDependency("buffer",i.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.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(o){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,h=i.byteStride,f=new Uint8Array(o,l,u);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(c,h,f,i.mode,i.filter).then(function(d){return d.buffer}):s.ready.then(function(){const d=new ArrayBuffer(c*h);return s.decodeGltfBuffer(new Uint8Array(d),c,h,f,i.mode,i.filter),d})})}else return null}}class OEe{constructor(e){this.name=yn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=t.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==ms.TRIANGLES&&u.mode!==ms.TRIANGLE_STRIP&&u.mode!==ms.TRIANGLE_FAN&&u.mode!==void 0)return null;const s=r.extensions[this.name].attributes,o=[],l={};for(const u in s)o.push(this.parser.getDependency("accessor",s[u]).then(c=>(l[u]=c,l[u])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).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 Jt,v=new te,m=new ho,y=new te(1,1,1),_=new aCe(p.geometry,p.material,f);for(let x=0;x<f;x++)l.TRANSLATION&&v.fromBufferAttribute(l.TRANSLATION,x),l.ROTATION&&m.fromBufferAttribute(l.ROTATION,x),l.SCALE&&y.fromBufferAttribute(l.SCALE,x),_.setMatrixAt(x,g.compose(v,m,y));for(const x in l)if(x==="_COLOR_0"){const b=l[x];_.instanceColor=new yE(b.array,b.itemSize,b.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&p.geometry.setAttribute(x,l[x]);er.prototype.copy.call(_,p),this.parser.assignFinalMaterial(_),d.push(_)}return c.isGroup?(c.clear(),c.add(...d),c):d[0]}))}}const Oj="glTF",wg=12,V6={JSON:1313821514,BIN:5130562};class FEe{constructor(e){this.name=yn.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,wg),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Oj)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-wg,a=new DataView(e,wg);let s=0;for(;s<i;){const o=a.getUint32(s,!0);s+=4;const l=a.getUint32(s,!0);if(s+=4,l===V6.JSON){const u=new Uint8Array(e,wg+s,o);this.content=r.decode(u)}else if(l===V6.BIN){const u=wg+s;this.body=e.slice(u,u+o)}s+=o}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class BEe{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=yn.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const r=this.json,i=this.dracoLoader,a=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,o={},l={},u={};for(const c in s){const h=ME[c]||c.toLowerCase();o[h]=s[c]}for(const c in e.attributes){const h=ME[c]||c.toLowerCase();if(s[c]!==void 0){const f=r.accessors[e.attributes[c]],d=lp[f.componentType];u[h]=d.name,l[h]=f.normalized===!0}}return t.getDependency("bufferView",a).then(function(c){return new Promise(function(h,f){i.decodeDracoFile(c,function(d){for(const p in d.attributes){const g=d.attributes[p],v=l[p];v!==void 0&&(g.normalized=v)}h(d)},o,u,ai,f)})})}}class GEe{constructor(){this.name=yn.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class zEe{constructor(){this.name=yn.KHR_MESH_QUANTIZATION}}class Fj extends K0{constructor(e,t,r,i){super(e,t,r,i)}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,i=this.valueSize,a=e*i*3+i;for(let s=0;s!==i;s++)t[s]=r[a+s];return t}interpolate_(e,t,r,i){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=o*2,u=o*3,c=i-t,h=(r-t)/c,f=h*h,d=f*h,p=e*u,g=p-u,v=-2*d+3*f,m=d-f,y=1-v,_=m-f+h;for(let x=0;x!==o;x++){const b=s[g+x+o],S=s[g+x+l]*c,w=s[p+x+o],T=s[p+x]*c;a[x]=y*b+_*S+v*w+m*T}return a}}const UEe=new ho;class VEe extends Fj{interpolate_(e,t,r,i){const a=super.interpolate_(e,t,r,i);return UEe.fromArray(a).normalize().toArray(a),a}}const ms={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},lp={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},H6={9728:Jr,9729:jr,9984:fE,9985:X1,9986:Dd,9987:Pl},W6={33071:Ui,33648:fb,10497:hi},O2={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ME={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},mu={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},HEe={CUBICSPLINE:void 0,LINEAR:Ip,STEP:u0},F2={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function WEe(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new kh({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:$l})),n.DefaultMaterial}function ah(n,e,t){for(const r in t.extensions)n[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=t.extensions[r])}function Cu(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function $Ee(n,e,t){let r=!1,i=!1,a=!1;for(let u=0,c=e.length;u<c;u++){const h=e[u];if(h.POSITION!==void 0&&(r=!0),h.NORMAL!==void 0&&(i=!0),h.COLOR_0!==void 0&&(a=!0),r&&i&&a)break}if(!r&&!i&&!a)return Promise.resolve(n);const s=[],o=[],l=[];for(let u=0,c=e.length;u<c;u++){const h=e[u];if(r){const f=h.POSITION!==void 0?t.getDependency("accessor",h.POSITION):n.attributes.position;s.push(f)}if(i){const f=h.NORMAL!==void 0?t.getDependency("accessor",h.NORMAL):n.attributes.normal;o.push(f)}if(a){const f=h.COLOR_0!==void 0?t.getDependency("accessor",h.COLOR_0):n.attributes.color;l.push(f)}}return Promise.all([Promise.all(s),Promise.all(o),Promise.all(l)]).then(function(u){const c=u[0],h=u[1],f=u[2];return r&&(n.morphAttributes.position=c),i&&(n.morphAttributes.normal=h),a&&(n.morphAttributes.color=f),n.morphTargetsRelative=!0,n})}function jEe(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,r=e.weights.length;t<r;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let r=0,i=t.length;r<i;r++)n.morphTargetDictionary[t[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function qEe(n){let e;const t=n.extensions&&n.extensions[yn.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+B2(t.attributes):e=n.indices+":"+B2(n.attributes)+":"+n.mode,n.targets!==void 0)for(let r=0,i=n.targets.length;r<i;r++)e+=":"+B2(n.targets[r]);return e}function B2(n){let e="";const t=Object.keys(n).sort();for(let r=0,i=t.length;r<i;r++)e+=t[r]+":"+n[t[r]]+";";return e}function TE(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function XEe(n){return n.search(/\.jpe?g($|\?)/i)>0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const YEe=new Jt;class KEe{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new _Ee,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 r=!1,i=!1,a=-1;typeof navigator!="undefined"&&(r=/^((?!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"||r||i&&a<98?this.textureLoader=new jR(this.options.manager):this.textureLoader=new tEe(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new v0(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 r=this,i=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(s){const o={scene:s[0][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:r,userData:{}};return ah(a,o,i),Cu(o,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(o)})).then(function(){e(o)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let i=0,a=t.length;i<a;i++){const s=t[i].joints;for(let o=0,l=s.length;o<l;o++)e[s[o]].isBone=!0}for(let i=0,a=e.length;i<a;i++){const s=e[i];s.mesh!==void 0&&(this._addNodeRef(this.meshCache,s.mesh),s.skin!==void 0&&(r[s.mesh].isSkinnedMesh=!0)),s.camera!==void 0&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,r){if(e.refs[t]<=1)return r;const i=r.clone(),a=(s,o)=>{const l=this.associations.get(s);l!=null&&this.associations.set(o,l);for(const[u,c]of s.children.entries())a(c,o.children[u])};return a(r,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r<t.length;r++){const i=e(t[r]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const r=[];for(let i=0;i<t.length;i++){const a=e(t[i]);a&&r.push(a)}return r}getDependency(e,t){const r=e+":"+t;let i=this.cache.get(r);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(a){return a.loadNode&&a.loadNode(t)});break;case"mesh":i=this._invokeOne(function(a){return a.loadMesh&&a.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(a){return a.loadBufferView&&a.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(a){return a.loadMaterial&&a.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(a){return a.loadTexture&&a.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(a){return a.loadAnimation&&a.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(a){return a!=this&&a.getDependency&&a.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(r,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const r=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(a,s){return r.getDependency(e,s)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],r=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[yn.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(a,s){r.load(mm.resolveURL(t.uri,i.path),a,void 0,function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(r){const i=t.byteLength||0,a=t.byteOffset||0;return r.slice(a,a+i)})}loadAccessor(e){const t=this,r=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const s=O2[i.type],o=lp[i.componentType],l=i.normalized===!0,u=new o(i.count*s);return Promise.resolve(new br(u,s,l))}const a=[];return i.bufferView!==void 0?a.push(this.getDependency("bufferView",i.bufferView)):a.push(null),i.sparse!==void 0&&(a.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),a.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(a).then(function(s){const o=s[0],l=O2[i.type],u=lp[i.componentType],c=u.BYTES_PER_ELEMENT,h=c*l,f=i.byteOffset||0,d=i.bufferView!==void 0?r.bufferViews[i.bufferView].byteStride:void 0,p=i.normalized===!0;let g,v;if(d&&d!==h){const m=Math.floor(f/d),y="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+m+":"+i.count;let _=t.cache.get(y);_||(g=new u(o,m*d,i.count*d/c),_=new BR(g,d/c),t.cache.add(y,_)),v=new io(_,l,f%d/c,p)}else o===null?g=new u(i.count*l):g=new u(o,f,i.count*l),v=new br(g,l,p);if(i.sparse!==void 0){const m=O2.SCALAR,y=lp[i.sparse.indices.componentType],_=i.sparse.indices.byteOffset||0,x=i.sparse.values.byteOffset||0,b=new y(s[1],_,i.sparse.count*m),S=new u(s[2],x,i.sparse.count*l);o!==null&&(v=new br(v.array.slice(),v.itemSize,v.normalized));for(let w=0,T=b.length;w<T;w++){const C=b[w];if(v.setX(C,S[w*l]),l>=2&&v.setY(C,S[w*l+1]),l>=3&&v.setZ(C,S[w*l+2]),l>=4&&v.setW(C,S[w*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){const t=this.json,r=this.options,a=t.textures[e].source,s=t.images[a];let o=this.textureLoader;if(s.uri){const l=r.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,a,o)}loadTextureImage(e,t,r){const i=this,a=this.json,s=a.textures[e],o=a.images[t],l=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(t,r).then(function(c){c.flipY=!1,c.name=s.name||o.name||"",c.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(c.name=o.uri);const f=(a.samplers||{})[s.sampler]||{};return c.magFilter=H6[f.magFilter]||jr,c.minFilter=H6[f.minFilter]||Pl,c.wrapS=W6[f.wrapS]||hi,c.wrapT=W6[f.wrapT]||hi,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){const r=this,i=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const s=i.images[e],o=self.URL||self.webkitURL;let l=s.uri||"",u=!1;if(s.bufferView!==void 0)l=r.getDependency("bufferView",s.bufferView).then(function(h){u=!0;const f=new Blob([h],{type:s.mimeType});return l=o.createObjectURL(f),l});else if(s.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 ni(g);v.needsUpdate=!0,f(v)}),t.load(mm.resolveURL(h,a.path),p,void 0,d)})}).then(function(h){return u===!0&&o.revokeObjectURL(l),h.userData.mimeType=s.mimeType||XEe(s.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,r,i){const a=this;return this.getDependency("texture",r.index).then(function(s){if(!s)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(s=s.clone(),s.channel=r.texCoord),a.extensions[yn.KHR_TEXTURE_TRANSFORM]){const o=r.extensions!==void 0?r.extensions[yn.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=a.associations.get(s);s=a.extensions[yn.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),a.associations.set(s,l)}}return i!==void 0&&(s.colorSpace=i),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const i=t.attributes.tangent===void 0,a=t.attributes.color!==void 0,s=t.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+r.uuid;let l=this.cache.get(o);l||(l=new X0,Ns.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(o,l)),r=l}else if(e.isLine){const o="LineBasicMaterial:"+r.uuid;let l=this.cache.get(o);l||(l=new Oo,Ns.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(o,l)),r=l}if(i||a||s){let o="ClonedMaterial:"+r.uuid+":";i&&(o+="derivative-tangents:"),a&&(o+="vertex-colors:"),s&&(o+="flat-shading:");let l=this.cache.get(o);l||(l=r.clone(),a&&(l.vertexColors=!0),s&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(o,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return kh}loadMaterial(e){const t=this,r=this.json,i=this.extensions,a=r.materials[e];let s;const o={},l=a.extensions||{},u=[];if(l[yn.KHR_MATERIALS_UNLIT]){const h=i[yn.KHR_MATERIALS_UNLIT];s=h.getMaterialType(),u.push(h.extendParams(o,a,t))}else{const h=a.pbrMetallicRoughness||{};if(o.color=new xt(1,1,1),o.opacity=1,Array.isArray(h.baseColorFactor)){const f=h.baseColorFactor;o.color.setRGB(f[0],f[1],f[2],ai),o.opacity=f[3]}h.baseColorTexture!==void 0&&u.push(t.assignTexture(o,"map",h.baseColorTexture,Vn)),o.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,o.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(o,"metalnessMap",h.metallicRoughnessTexture)),u.push(t.assignTexture(o,"roughnessMap",h.metallicRoughnessTexture))),s=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,o)})))}a.doubleSided===!0&&(o.side=tr);const c=a.alphaMode||F2.OPAQUE;if(c===F2.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,c===F2.MASK&&(o.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&s!==Nn&&(u.push(t.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new Ge(1,1),a.normalTexture.scale!==void 0)){const h=a.normalTexture.scale;o.normalScale.set(h,h)}if(a.occlusionTexture!==void 0&&s!==Nn&&(u.push(t.assignTexture(o,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&s!==Nn){const h=a.emissiveFactor;o.emissive=new xt().setRGB(h[0],h[1],h[2],ai)}return a.emissiveTexture!==void 0&&s!==Nn&&u.push(t.assignTexture(o,"emissiveMap",a.emissiveTexture,Vn)),Promise.all(u).then(function(){const h=new s(o);return a.name&&(h.name=a.name),Cu(h,a),t.associations.set(h,{materials:e}),a.extensions&&ah(i,h,a),h})}createUniqueName(e){const t=zn.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,i=this.primitiveCache;function a(o){return r[yn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,t).then(function(l){return $6(l,o,t)})}const s=[];for(let o=0,l=e.length;o<l;o++){const u=e[o],c=qEe(u),h=i[c];if(h)s.push(h.promise);else{let f;u.extensions&&u.extensions[yn.KHR_DRACO_MESH_COMPRESSION]?f=a(u):f=$6(new qn,u,t),i[c]={primitive:u,promise:f},s.push(f)}}return Promise.all(s)}loadMesh(e){const t=this,r=this.json,i=this.extensions,a=r.meshes[e],s=a.primitives,o=[];for(let l=0,u=s.length;l<u;l++){const c=s[l].material===void 0?WEe(this.cache):this.getDependency("material",s[l].material);o.push(c)}return o.push(t.loadGeometries(s)),Promise.all(o).then(function(l){const u=l.slice(0,l.length-1),c=l[l.length-1],h=[];for(let d=0,p=c.length;d<p;d++){const g=c[d],v=s[d];let m;const y=u[d];if(v.mode===ms.TRIANGLES||v.mode===ms.TRIANGLE_STRIP||v.mode===ms.TRIANGLE_FAN||v.mode===void 0)m=a.isSkinnedMesh===!0?new tCe(g,y):new An(g,y),m.isSkinnedMesh===!0&&m.normalizeSkinWeights(),v.mode===ms.TRIANGLE_STRIP?m.geometry=U6(m.geometry,Q$):v.mode===ms.TRIANGLE_FAN&&(m.geometry=U6(m.geometry,dE));else if(v.mode===ms.LINES)m=new zR(g,y);else if(v.mode===ms.LINE_STRIP)m=new h0(g,y);else if(v.mode===ms.LINE_LOOP)m=new yb(g,y);else if(v.mode===ms.POINTS)m=new UR(g,y);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+v.mode);Object.keys(m.geometry.morphAttributes).length>0&&jEe(m,a),m.name=t.createUniqueName(a.name||"mesh_"+e),Cu(m,a),v.extensions&&ah(i,m,v),t.assignFinalMaterial(m),h.push(m)}for(let d=0,p=h.length;d<p;d++)t.associations.set(h[d],{meshes:e,primitives:d});if(h.length===1)return a.extensions&&ah(i,h[0],a),h[0];const f=new kn;a.extensions&&ah(i,f,a),t.associations.set(f,{meshes:e});for(let d=0,p=h.length;d<p;d++)f.add(h[d]);return f})}loadCamera(e){let t;const r=this.json.cameras[e],i=r[r.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return r.type==="perspective"?t=new Gi(RR.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):r.type==="orthographic"&&(t=new kS(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),r.name&&(t.name=this.createUniqueName(r.name)),Cu(t,r),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],r=[];for(let i=0,a=t.joints.length;i<a;i++)r.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?r.push(this.getDependency("accessor",t.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(i){const a=i.pop(),s=i,o=[],l=[];for(let u=0,c=s.length;u<c;u++){const h=s[u];if(h){o.push(h);const f=new Jt;a!==null&&f.fromArray(a.array,u*16),l.push(f)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[u])}return new GR(o,l)})}loadAnimation(e){const t=this.json,r=this,i=t.animations[e],a=i.name?i.name:"animation_"+e,s=[],o=[],l=[],u=[],c=[];for(let h=0,f=i.channels.length;h<f;h++){const d=i.channels[h],p=i.samplers[d.sampler],g=d.target,v=g.node,m=i.parameters!==void 0?i.parameters[p.input]:p.input,y=i.parameters!==void 0?i.parameters[p.output]:p.output;g.node!==void 0&&(s.push(this.getDependency("node",v)),o.push(this.getDependency("accessor",m)),l.push(this.getDependency("accessor",y)),u.push(p),c.push(g))}return Promise.all([Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(u),Promise.all(c)]).then(function(h){const f=h[0],d=h[1],p=h[2],g=h[3],v=h[4],m=[];for(let y=0,_=f.length;y<_;y++){const x=f[y],b=d[y],S=p[y],w=g[y],T=v[y];if(x===void 0)continue;x.updateMatrix&&x.updateMatrix();const C=r._createAnimationTracks(x,b,S,w,T);if(C)for(let A=0;A<C.length;A++)m.push(C[A])}return new WCe(a,void 0,m)})}createNodeMesh(e){const t=this.json,r=this,i=t.nodes[e];return i.mesh===void 0?null:r.getDependency("mesh",i.mesh).then(function(a){const s=r._getNodeRef(r.meshCache,i.mesh,a);return i.weights!==void 0&&s.traverse(function(o){if(o.isMesh)for(let l=0,u=i.weights.length;l<u;l++)o.morphTargetInfluences[l]=i.weights[l]}),s})}loadNode(e){const t=this.json,r=this,i=t.nodes[e],a=r._loadNodeShallow(e),s=[],o=i.children||[];for(let u=0,c=o.length;u<c;u++)s.push(r.getDependency("node",o[u]));const l=i.skin===void 0?Promise.resolve(null):r.getDependency("skin",i.skin);return Promise.all([a,Promise.all(s),l]).then(function(u){const c=u[0],h=u[1],f=u[2];f!==null&&c.traverse(function(d){d.isSkinnedMesh&&d.bind(f,YEe)});for(let d=0,p=h.length;d<p;d++)c.add(h[d]);return c})}_loadNodeShallow(e){const t=this.json,r=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const a=t.nodes[e],s=a.name?i.createUniqueName(a.name):"",o=[],l=i._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return l&&o.push(l),a.camera!==void 0&&o.push(i.getDependency("camera",a.camera).then(function(u){return i._getNodeRef(i.cameraCache,a.camera,u)})),i._invokeAll(function(u){return u.createNodeAttachment&&u.createNodeAttachment(e)}).forEach(function(u){o.push(u)}),this.nodeCache[e]=Promise.all(o).then(function(u){let c;if(a.isBone===!0?c=new xj:u.length>1?c=new kn:u.length===1?c=u[0]:c=new er,c!==u[0])for(let h=0,f=u.length;h<f;h++)c.add(u[h]);if(a.name&&(c.userData.name=a.name,c.name=s),Cu(c,a),a.extensions&&ah(r,c,a),a.matrix!==void 0){const h=new Jt;h.fromArray(a.matrix),c.applyMatrix4(h)}else a.translation!==void 0&&c.position.fromArray(a.translation),a.rotation!==void 0&&c.quaternion.fromArray(a.rotation),a.scale!==void 0&&c.scale.fromArray(a.scale);return i.associations.has(c)||i.associations.set(c,{}),i.associations.get(c).nodes=e,c}),this.nodeCache[e]}loadScene(e){const t=this.extensions,r=this.json.scenes[e],i=this,a=new kn;r.name&&(a.name=i.createUniqueName(r.name)),Cu(a,r),r.extensions&&ah(t,a,r);const s=r.nodes||[],o=[];for(let l=0,u=s.length;l<u;l++)o.push(i.getDependency("node",s[l]));return Promise.all(o).then(function(l){for(let c=0,h=l.length;c<h;c++)a.add(l[c]);const u=c=>{const h=new Map;for(const[f,d]of i.associations)(f instanceof Ns||f instanceof ni)&&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,r,i,a){const s=[],o=e.name?e.name:e.uuid,l=[];mu[a.path]===mu.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(o);let u;switch(mu[a.path]){case mu.weights:u=Op;break;case mu.rotation:u=gf;break;case mu.position:case mu.scale:u=Fp;break;default:switch(r.itemSize){case 1:u=Op;break;case 2:case 3:default:u=Fp;break}break}const c=i.interpolation!==void 0?HEe[i.interpolation]:Ip,h=this._getArrayFromAccessor(r);for(let f=0,d=l.length;f<d;f++){const p=new u(l[f]+"."+mu[a.path],t.array,h,c);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(p),s.push(p)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const r=TE(t.constructor),i=new Float32Array(t.length);for(let a=0,s=t.length;a<s;a++)i[a]=t[a]*r;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(r){const i=this instanceof gf?VEe:Fj;return new i(this.times,this.values,this.getValueSize()/3,r)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function ZEe(n,e,t){const r=e.attributes,i=new Us;if(r.POSITION!==void 0){const o=t.json.accessors[r.POSITION],l=o.min,u=o.max;if(l!==void 0&&u!==void 0){if(i.set(new te(l[0],l[1],l[2]),new te(u[0],u[1],u[2])),o.normalized){const c=TE(lp[o.componentType]);i.min.multiplyScalar(c),i.max.multiplyScalar(c)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const a=e.targets;if(a!==void 0){const o=new te,l=new te;for(let u=0,c=a.length;u<c;u++){const h=a[u];if(h.POSITION!==void 0){const f=t.json.accessors[h.POSITION],d=f.min,p=f.max;if(d!==void 0&&p!==void 0){if(l.setX(Math.max(Math.abs(d[0]),Math.abs(p[0]))),l.setY(Math.max(Math.abs(d[1]),Math.abs(p[1]))),l.setZ(Math.max(Math.abs(d[2]),Math.abs(p[2]))),f.normalized){const g=TE(lp[f.componentType]);l.multiplyScalar(g)}o.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(o)}n.boundingBox=i;const s=new Vs;i.getCenter(s.center),s.radius=i.min.distanceTo(i.max)/2,n.boundingSphere=s}function $6(n,e,t){const r=e.attributes,i=[];function a(s,o){return t.getDependency("accessor",s).then(function(l){n.setAttribute(o,l)})}for(const s in r){const o=ME[s]||s.toLowerCase();o in n.attributes||i.push(a(r[s],o))}if(e.indices!==void 0&&!n.index){const s=t.getDependency("accessor",e.indices).then(function(o){n.setIndex(o)});i.push(s)}return Bn.workingColorSpace!==ai&&"COLOR_0"in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Bn.workingColorSpace}" not supported.`),Cu(n,e),ZEe(n,e,t),Promise.all(i).then(function(){return e.targets!==void 0?$Ee(n,e.targets,t):n})}const G2=new WeakMap;class QEe extends Ac{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,r,i){const a=new v0(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,s=>{this.parse(s,t,i)},r,i)}parse(e,t,r=()=>{}){this.decodeDracoFile(e,t,null,null,Vn).catch(r)}decodeDracoFile(e,t,r,i,a=ai,s=()=>{}){const o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:a};return this.decodeGeometry(e,o).then(t).catch(s)}decodeGeometry(e,t){const r=JSON.stringify(t);if(G2.has(e)){const l=G2.get(e);if(l.key===r)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++,s=e.byteLength,o=this._getWorker(a,s).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 o.catch(()=>!0).then(()=>{i&&a&&this._releaseTask(i,a)}),G2.set(e,{key:r,promise:o}),o}_createGeometry(e){const t=new qn;e.index&&t.setIndex(new br(e.index.array,1));for(let r=0;r<e.attributes.length;r++){const i=e.attributes[r],a=i.name,s=i.array,o=i.itemSize,l=new br(s,o);a==="color"&&(this._assignVertexColorSpace(l,i.vertexColorSpace),l.normalized=!(s instanceof Float32Array)),t.setAttribute(a,l)}return t}_assignVertexColorSpace(e,t){if(t!==Vn)return;const r=new xt;for(let i=0,a=e.count;i<a;i++)r.fromBufferAttribute(e,i).convertSRGBToLinear(),e.setXYZ(i,r.r,r.g,r.b)}_loadLibrary(e,t){const r=new v0(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),r.setWithCredentials(this.withCredentials),new Promise((i,a)=>{r.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(r=>{const i=r[0];e||(this.decoderConfig.wasmBinary=r[1]);const a=JEe.toString(),s=["/* draco decoder */",i,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(`
`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(a){const s=a.data;switch(s.type){case"decode":i._callbacks[s.id].resolve(s);break;case"error":i._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(i,a){return i._taskLoad>a._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_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<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function JEe(){let n,e;onmessage=function(s){const o=s.data;switch(o.type){case"init":n=o.decoderConfig,e=new Promise(function(c){n.onModuleLoaded=function(h){c({draco:h})},DracoDecoderModule(n)});break;case"decode":const l=o.buffer,u=o.taskConfig;e.then(c=>{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:o.id,geometry:d},p)}catch(d){console.error(d),self.postMessage({type:"error",id:o.id,error:d.message})}finally{h.destroy(f)}});break}};function t(s,o,l,u){const c=u.attributeIDs,h=u.attributeTypes;let f,d;const p=o.GetEncodedGeometryType(l);if(p===s.TRIANGULAR_MESH)f=new s.Mesh,d=o.DecodeArrayToMesh(l,l.byteLength,f);else if(p===s.POINT_CLOUD)f=new s.PointCloud,d=o.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=o.GetAttributeByUniqueId(f,_);else{if(_=o.GetAttributeId(f,s[c[v]]),_===-1)continue;y=o.GetAttribute(f,_)}const x=i(s,o,f,v,m,y);v==="color"&&(x.vertexColorSpace=u.vertexColorSpace),g.attributes.push(x)}return p===s.TRIANGULAR_MESH&&(g.index=r(s,o,f)),s.destroy(f),g}function r(s,o,l){const c=l.num_faces()*3,h=c*4,f=s._malloc(h);o.GetTrianglesUInt32Array(l,h,f);const d=new Uint32Array(s.HEAPF32.buffer,f,c).slice();return s._free(f),{array:d,itemSize:1}}function i(s,o,l,u,c,h){const f=h.num_components(),p=l.num_points()*f,g=p*c.BYTES_PER_ELEMENT,v=a(s,c),m=s._malloc(g);o.GetAttributeDataArrayForAllPoints(l,h,v,g,m);const y=new c(s.HEAPF32.buffer,m,p).slice();return s._free(m),{name:u,array:y,itemSize:f}}function a(s,o){switch(o){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}let CE={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 ePe=Object.values(CE);class tPe extends US{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 Rj;return e.onProgress=(t,r,i)=>{this.itemsLoaded=r,this.itemsTotal=i,this.emit("onProgress",t,r,i)},e.onError=t=>{this.emit("onError",t)},e}initDefaultLoader(){[{loader:yEe,name:"GLTFLoader"},{loader:jR,name:"TextureLoader"}].map(e=>this.addLoader(e.loader,e.name))}initDraco(e){const t=new QEe;t.setDecoderPath(this.dracoPath),t.preload(),e.setDRACOLoader(t)}addLoader(e,t=""){if(e.name&&CE[t]){if(!this.loaders[t]){let i=new e(this.manager),a=t;i instanceof Ac&&(a==="GLTFLoader"&&this.initDraco(i),this.loaders[CE[a]]=i)}}else throw new Error("请配置正确的加载器")}loadItem(e){return new Promise((t,r)=>{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(Ve(Le({},e),{data:i}))},null,i=>{this.emit("onError",i),r(i)})})}loadAll(e){return this.itemsLoaded=0,this.itemsTotal=0,new Promise((t,r)=>{let i=this.matchType(e),a=[];this.itemsTotal=i.length,i.map(s=>{let o=this.loadItem(s);a.push(o)}),Promise.all(a).then(s=>{this.assets=s,this.emit("onLoad"),t(s)}).catch(s=>{this.emit("onError",s),r(s)})})}matchType(e){return this.assets=e.map(t=>({type:ePe.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(r=>r.name===e);if(!t)throw new Error(`资源${e}不存在`);return t.data}destroy(){this.off("onProgress"),this.off("onLoad"),this.off("onError"),this.assets=[]}}const Bj=n=>{n instanceof Array?n.forEach(Bj):(n.map&&n.map.dispose(),n.dispose())},Gj=n=>{n.geometry&&n.geometry.dispose(),n.material&&Bj(n.material),n.texture&&n.texture.dispose(),n.children&&n.children.forEach(Gj)},nPe=n=>{if(n&&n.children)for(;n.children.length;){const e=n.children[0];n.remove(e),Gj(e)}};var KR={exports:{}},rPe=function(e,t,r,i){var a=e[0],s=e[1],o=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=(i-r)/2,u=0,c=l-1;u<l;c=u++){var h=t[r+u*2+0],f=t[r+u*2+1],d=t[r+c*2+0],p=t[r+c*2+1],g=f>s!=p>s&&a<(d-h)*(s-f)/(p-f)+h;g&&(o=!o)}return o},iPe=function(e,t,r,i){var a=e[0],s=e[1],o=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=i-r,u=0,c=l-1;u<l;c=u++){var h=t[u+r][0],f=t[u+r][1],d=t[c+r][0],p=t[c+r][1],g=f>s!=p>s&&a<(d-h)*(s-f)/(p-f)+h;g&&(o=!o)}return o},zj=rPe,Uj=iPe;KR.exports=function(e,t,r,i){return t.length>0&&Array.isArray(t[0])?Uj(e,t,r,i):zj(e,t,r,i)};KR.exports.nested=Uj;KR.exports.flat=zj;function aPe(n=10,e=62){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=[],i;if(e=e||t.length,n)for(i=0;i<n;i++)r[i]=t[0|Math.random()*e];else{var a;for(r[8]=r[13]=r[18]=r[23]="-",r[14]="4",i=0;i<36;i++)r[i]||(a=0|Math.random()*16,r[i]=t[i==19?a&3|8:a])}return r.join("")}const ZR=n=>{console.log(n);let e=JSON.parse(n),t=e.features;for(let r=0;r<t.length;r++){const i=t[r];["Polygon"].includes(i.geometry.type)&&(i.geometry.coordinates=[i.geometry.coordinates])}return e};class sPe{constructor({canvas:e,sizes:t,scene:r,camera:i,postprocessing:a=!1,composer:s=null}){this.canvas=e,this.sizes=t,this.scene=r,this.camera=i,this.postprocessing=a,this.composer=s,this.setInstance()}setInstance(){this.instance=new OR({alpha:!1,antialias:!0,canvas:this.canvas}),this.instance.setSize(this.sizes.width,this.sizes.height),this.instance.setPixelRatio(this.sizes.pixelRatio)}resize(){this.instance.setSize(this.sizes.width,this.sizes.height),this.instance.setPixelRatio(this.sizes.pixelRatio)}update(){this.postprocessing&&this.composer?this.composer.render():this.instance.render(this.scene,this.camera.instance)}destroy(){this.instance.dispose(),this.instance.forceContextLoss()}}const j6={type:"change"},z2={type:"start"},q6={type:"end"},t1=new ov,X6=new Tu,oPe=Math.cos(70*RR.DEG2RAD);class Vj extends Rf{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new te,this.cursor=new te,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:rd.ROTATE,MIDDLE:rd.DOLLY,RIGHT:rd.PAN},this.touches={ONE:id.ROTATE,TWO:id.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return o.phi},this.getAzimuthalAngle=function(){return o.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(ce){ce.addEventListener("keydown",He),this._domElementKeyEvents=ce},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",He),this._domElementKeyEvents=null},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(j6),r.update(),a=i.NONE},this.update=function(){const ce=new te,We=new ho().setFromUnitVectors(e.up,new te(0,1,0)),at=We.clone().invert(),vt=new te,se=new ho,Ye=new te,je=2*Math.PI;return function(me=null){const Oe=r.object.position;ce.copy(Oe).sub(r.target),ce.applyQuaternion(We),o.setFromVector3(ce),r.autoRotate&&a===i.NONE&&P(A(me)),r.enableDamping?(o.theta+=l.theta*r.dampingFactor,o.phi+=l.phi*r.dampingFactor):(o.theta+=l.theta,o.phi+=l.phi);let _t=r.minAzimuthAngle,zt=r.maxAzimuthAngle;isFinite(_t)&&isFinite(zt)&&(_t<-Math.PI?_t+=je:_t>Math.PI&&(_t-=je),zt<-Math.PI?zt+=je:zt>Math.PI&&(zt-=je),_t<=zt?o.theta=Math.max(_t,Math.min(zt,o.theta)):o.theta=o.theta>(_t+zt)/2?Math.max(_t,o.theta):Math.min(zt,o.theta)),o.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,o.phi)),o.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(c,r.dampingFactor):r.target.add(c),r.target.sub(r.cursor),r.target.clampLength(r.minTargetRadius,r.maxTargetRadius),r.target.add(r.cursor),r.zoomToCursor&&S||r.object.isOrthographicCamera?o.radius=U(o.radius):o.radius=U(o.radius*u),ce.setFromSpherical(o),ce.applyQuaternion(at),Oe.copy(r.target).add(ce),r.object.lookAt(r.target),r.enableDamping===!0?(l.theta*=1-r.dampingFactor,l.phi*=1-r.dampingFactor,c.multiplyScalar(1-r.dampingFactor)):(l.set(0,0,0),c.set(0,0,0));let xn=!1;if(r.zoomToCursor&&S){let jt=null;if(r.object.isPerspectiveCamera){const Tn=ce.length();jt=U(Tn*u);const dr=Tn-jt;r.object.position.addScaledVector(x,dr),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const Tn=new te(b.x,b.y,0);Tn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/u)),r.object.updateProjectionMatrix(),xn=!0;const dr=new te(b.x,b.y,0);dr.unproject(r.object),r.object.position.sub(dr).add(Tn),r.object.updateMatrixWorld(),jt=ce.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;jt!==null&&(this.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(jt).add(r.object.position):(t1.origin.copy(r.object.position),t1.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(t1.direction))<oPe?e.lookAt(r.target):(X6.setFromNormalAndCoplanarPoint(r.object.up,r.target),t1.intersectPlane(X6,r.target))))}else r.object.isOrthographicCamera&&(xn=u!==1,xn&&(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/u)),r.object.updateProjectionMatrix()));return u=1,S=!1,xn||vt.distanceToSquared(r.object.position)>s||8*(1-se.dot(r.object.quaternion))>s||Ye.distanceToSquared(r.target)>0?(r.dispatchEvent(j6),vt.copy(r.object.position),se.copy(r.object.quaternion),Ye.copy(r.target),!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",Tt),r.domElement.removeEventListener("pointerdown",I),r.domElement.removeEventListener("pointercancel",K),r.domElement.removeEventListener("wheel",q),r.domElement.removeEventListener("pointermove",G),r.domElement.removeEventListener("pointerup",K),r._domElementKeyEvents!==null&&(r._domElementKeyEvents.removeEventListener("keydown",He),r._domElementKeyEvents=null)};const r=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 s=1e-6,o=new B6,l=new B6;let u=1;const c=new te,h=new Ge,f=new Ge,d=new Ge,p=new Ge,g=new Ge,v=new Ge,m=new Ge,y=new Ge,_=new Ge,x=new te,b=new Ge;let S=!1;const w=[],T={};let C=!1;function A(ce){return ce!==null?2*Math.PI/60*r.autoRotateSpeed*ce:2*Math.PI/60/60*r.autoRotateSpeed}function M(ce){const We=Math.abs(ce*.01);return Math.pow(.95,r.zoomSpeed*We)}function P(ce){l.theta-=ce}function D(ce){l.phi-=ce}const L=function(){const ce=new te;return function(at,vt){ce.setFromMatrixColumn(vt,0),ce.multiplyScalar(-at),c.add(ce)}}(),R=function(){const ce=new te;return function(at,vt){r.screenSpacePanning===!0?ce.setFromMatrixColumn(vt,1):(ce.setFromMatrixColumn(vt,0),ce.crossVectors(r.object.up,ce)),ce.multiplyScalar(at),c.add(ce)}}(),N=function(){const ce=new te;return function(at,vt){const se=r.domElement;if(r.object.isPerspectiveCamera){const Ye=r.object.position;ce.copy(Ye).sub(r.target);let je=ce.length();je*=Math.tan(r.object.fov/2*Math.PI/180),L(2*at*je/se.clientHeight,r.object.matrix),R(2*vt*je/se.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(L(at*(r.object.right-r.object.left)/r.object.zoom/se.clientWidth,r.object.matrix),R(vt*(r.object.top-r.object.bottom)/r.object.zoom/se.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function F(ce){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?u/=ce:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function O(ce){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?u*=ce:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function H(ce,We){if(!r.zoomToCursor)return;S=!0;const at=r.domElement.getBoundingClientRect(),vt=ce-at.left,se=We-at.top,Ye=at.width,je=at.height;b.x=vt/Ye*2-1,b.y=-(se/je)*2+1,x.set(b.x,b.y,1).unproject(r.object).sub(r.object.position).normalize()}function U(ce){return Math.max(r.minDistance,Math.min(r.maxDistance,ce))}function $(ce){h.set(ce.clientX,ce.clientY)}function Y(ce){H(ce.clientX,ce.clientX),m.set(ce.clientX,ce.clientY)}function oe(ce){p.set(ce.clientX,ce.clientY)}function X(ce){f.set(ce.clientX,ce.clientY),d.subVectors(f,h).multiplyScalar(r.rotateSpeed);const We=r.domElement;P(2*Math.PI*d.x/We.clientHeight),D(2*Math.PI*d.y/We.clientHeight),h.copy(f),r.update()}function re(ce){y.set(ce.clientX,ce.clientY),_.subVectors(y,m),_.y>0?F(M(_.y)):_.y<0&&O(M(_.y)),m.copy(y),r.update()}function _e(ce){g.set(ce.clientX,ce.clientY),v.subVectors(g,p).multiplyScalar(r.panSpeed),N(v.x,v.y),p.copy(g),r.update()}function Fe(ce){H(ce.clientX,ce.clientY),ce.deltaY<0?O(M(ce.deltaY)):ce.deltaY>0&&F(M(ce.deltaY)),r.update()}function Ce(ce){let We=!1;switch(ce.code){case r.keys.UP:ce.ctrlKey||ce.metaKey||ce.shiftKey?D(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):N(0,r.keyPanSpeed),We=!0;break;case r.keys.BOTTOM:ce.ctrlKey||ce.metaKey||ce.shiftKey?D(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):N(0,-r.keyPanSpeed),We=!0;break;case r.keys.LEFT:ce.ctrlKey||ce.metaKey||ce.shiftKey?P(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):N(r.keyPanSpeed,0),We=!0;break;case r.keys.RIGHT:ce.ctrlKey||ce.metaKey||ce.shiftKey?P(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):N(-r.keyPanSpeed,0),We=!0;break}We&&(ce.preventDefault(),r.update())}function Ae(ce){if(w.length===1)h.set(ce.pageX,ce.pageY);else{const We=Ze(ce),at=.5*(ce.pageX+We.x),vt=.5*(ce.pageY+We.y);h.set(at,vt)}}function ze(ce){if(w.length===1)p.set(ce.pageX,ce.pageY);else{const We=Ze(ce),at=.5*(ce.pageX+We.x),vt=.5*(ce.pageY+We.y);p.set(at,vt)}}function fe(ce){const We=Ze(ce),at=ce.pageX-We.x,vt=ce.pageY-We.y,se=Math.sqrt(at*at+vt*vt);m.set(0,se)}function j(ce){r.enableZoom&&fe(ce),r.enablePan&&ze(ce)}function xe(ce){r.enableZoom&&fe(ce),r.enableRotate&&Ae(ce)}function pe(ce){if(w.length==1)f.set(ce.pageX,ce.pageY);else{const at=Ze(ce),vt=.5*(ce.pageX+at.x),se=.5*(ce.pageY+at.y);f.set(vt,se)}d.subVectors(f,h).multiplyScalar(r.rotateSpeed);const We=r.domElement;P(2*Math.PI*d.x/We.clientHeight),D(2*Math.PI*d.y/We.clientHeight),h.copy(f)}function we(ce){if(w.length===1)g.set(ce.pageX,ce.pageY);else{const We=Ze(ce),at=.5*(ce.pageX+We.x),vt=.5*(ce.pageY+We.y);g.set(at,vt)}v.subVectors(g,p).multiplyScalar(r.panSpeed),N(v.x,v.y),p.copy(g)}function V(ce){const We=Ze(ce),at=ce.pageX-We.x,vt=ce.pageY-We.y,se=Math.sqrt(at*at+vt*vt);y.set(0,se),_.set(0,Math.pow(y.y/m.y,r.zoomSpeed)),F(_.y),m.copy(y);const Ye=(ce.pageX+We.x)*.5,je=(ce.pageY+We.y)*.5;H(Ye,je)}function ee(ce){r.enableZoom&&V(ce),r.enablePan&&we(ce)}function ae(ce){r.enableZoom&&V(ce),r.enableRotate&&pe(ce)}function I(ce){r.enabled!==!1&&(w.length===0&&(r.domElement.setPointerCapture(ce.pointerId),r.domElement.addEventListener("pointermove",G),r.domElement.addEventListener("pointerup",K)),wt(ce),ce.pointerType==="touch"?nt(ce):ge(ce))}function G(ce){r.enabled!==!1&&(ce.pointerType==="touch"?ke(ce):Ee(ce))}function K(ce){switch(pt(ce),w.length){case 0:r.domElement.releasePointerCapture(ce.pointerId),r.domElement.removeEventListener("pointermove",G),r.domElement.removeEventListener("pointerup",K),r.dispatchEvent(q6),a=i.NONE;break;case 1:const We=w[0],at=T[We];nt({pointerId:We,pageX:at.x,pageY:at.y});break}}function ge(ce){let We;switch(ce.button){case 0:We=r.mouseButtons.LEFT;break;case 1:We=r.mouseButtons.MIDDLE;break;case 2:We=r.mouseButtons.RIGHT;break;default:We=-1}switch(We){case rd.DOLLY:if(r.enableZoom===!1)return;Y(ce),a=i.DOLLY;break;case rd.ROTATE:if(ce.ctrlKey||ce.metaKey||ce.shiftKey){if(r.enablePan===!1)return;oe(ce),a=i.PAN}else{if(r.enableRotate===!1)return;$(ce),a=i.ROTATE}break;case rd.PAN:if(ce.ctrlKey||ce.metaKey||ce.shiftKey){if(r.enableRotate===!1)return;$(ce),a=i.ROTATE}else{if(r.enablePan===!1)return;oe(ce),a=i.PAN}break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(z2)}function Ee(ce){switch(a){case i.ROTATE:if(r.enableRotate===!1)return;X(ce);break;case i.DOLLY:if(r.enableZoom===!1)return;re(ce);break;case i.PAN:if(r.enablePan===!1)return;_e(ce);break}}function q(ce){r.enabled===!1||r.enableZoom===!1||a!==i.NONE||(ce.preventDefault(),r.dispatchEvent(z2),Fe(le(ce)),r.dispatchEvent(q6))}function le(ce){const We=ce.deltaMode,at={clientX:ce.clientX,clientY:ce.clientY,deltaY:ce.deltaY};switch(We){case 1:at.deltaY*=16;break;case 2:at.deltaY*=100;break}return ce.ctrlKey&&!C&&(at.deltaY*=10),at}function ue(ce){ce.key==="Control"&&(C=!0,r.domElement.getRootNode().addEventListener("keyup",be,{passive:!0,capture:!0}))}function be(ce){ce.key==="Control"&&(C=!1,r.domElement.getRootNode().removeEventListener("keyup",be,{passive:!0,capture:!0}))}function He(ce){r.enabled===!1||r.enablePan===!1||Ce(ce)}function nt(ce){switch(lt(ce),w.length){case 1:switch(r.touches.ONE){case id.ROTATE:if(r.enableRotate===!1)return;Ae(ce),a=i.TOUCH_ROTATE;break;case id.PAN:if(r.enablePan===!1)return;ze(ce),a=i.TOUCH_PAN;break;default:a=i.NONE}break;case 2:switch(r.touches.TWO){case id.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;j(ce),a=i.TOUCH_DOLLY_PAN;break;case id.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;xe(ce),a=i.TOUCH_DOLLY_ROTATE;break;default:a=i.NONE}break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(z2)}function ke(ce){switch(lt(ce),a){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;pe(ce),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;we(ce),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ee(ce),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ae(ce),r.update();break;default:a=i.NONE}}function Tt(ce){r.enabled!==!1&&ce.preventDefault()}function wt(ce){w.push(ce.pointerId)}function pt(ce){delete T[ce.pointerId];for(let We=0;We<w.length;We++)if(w[We]==ce.pointerId){w.splice(We,1);return}}function lt(ce){let We=T[ce.pointerId];We===void 0&&(We=new Ge,T[ce.pointerId]=We),We.set(ce.pageX,ce.pageY)}function Ze(ce){const We=ce.pointerId===w[0]?w[1]:w[0];return T[We]}r.domElement.addEventListener("contextmenu",Tt),r.domElement.addEventListener("pointerdown",I),r.domElement.addEventListener("pointercancel",K),r.domElement.addEventListener("wheel",q,{passive:!1}),r.domElement.getRootNode().addEventListener("keydown",ue,{passive:!0,capture:!0}),this.update()}}class lPe{constructor({sizes:e,scene:t,canvas:r},i={isOrthographic:!1}){this.sizes=e,this.scene=t,this.canvas=r,this.options=Object.assign({isOrthographic:!1},i),this.setInstance()}setInstance(){this.instance=null,this.setCamera(this.options.isOrthographic),this.instance.position.set(10,10,10),this.scene.add(this.instance)}setCamera(e=!0){let t=this.sizes.width/this.sizes.height;if(e){let r=120;this.instance=new kS(-r*t,r*t,r,-r,1,1e4)}else this.instance=new Gi(45,t,1,1e4);this.setControls()}setControls(){this.controls=new Vj(this.instance,this.canvas),this.controls.enableDamping=!0,this.controls.update()}resize(){let e=this.sizes.width/this.sizes.height;if(this.options.isOrthographic){let t=120;this.instance.left=-t*e,this.instance.right=t*e,this.instance.top=t,this.instance.bottom=-t}else this.instance.aspect=e;this.instance.updateProjectionMatrix()}update(){this.controls.update()}destroy(){this.controls.dispose()}}class uPe{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const a=t[i],s=e+a,o=Math.abs(e)<Math.abs(a)?e-(s-a):a-(s-e);o&&(t[r++]=o),e=s}return t[r]=e,this._n=r+1,this}valueOf(){const e=this._partials;let t=this._n,r,i,a,s=0;if(t>0){for(s=e[--t];t>0&&(r=s,i=e[--t],s=r+i,a=i-(s-r),!a););t>0&&(a<0&&e[t-1]<0||a>0&&e[t-1]>0)&&(i=a*2,r=s+i,i==r-s&&(s=r))}return s}}function*cPe(n){for(const e of n)yield*aD(e)}function Hj(n){return Array.from(cPe(n))}var nr=1e-6,hPe=1e-12,Mn=Math.PI,_a=Mn/2,Y6=Mn/4,Fs=Mn*2,Ga=180/Mn,Wr=Mn/180,Cr=Math.abs,Wj=Math.atan,g0=Math.atan2,kr=Math.cos,fPe=Math.exp,dPe=Math.log,Or=Math.sin,pPe=Math.sign||function(n){return n>0?1:n<0?-1:0},VS=Math.sqrt,vPe=Math.tan;function gPe(n){return n>1?0:n<-1?Mn:Math.acos(n)}function m0(n){return n>1?_a:n<-1?-_a:Math.asin(n)}function Vg(){}function bb(n,e){n&&Z6.hasOwnProperty(n.type)&&Z6[n.type](n,e)}var K6={Feature:function(n,e){bb(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,r=-1,i=t.length;++r<i;)bb(t[r].geometry,e)}},Z6={Sphere:function(n,e){e.sphere()},Point:function(n,e){n=n.coordinates,e.point(n[0],n[1],n[2])},MultiPoint:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)n=t[r],e.point(n[0],n[1],n[2])},LineString:function(n,e){EE(n.coordinates,e,0)},MultiLineString:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)EE(t[r],e,0)},Polygon:function(n,e){Q6(n.coordinates,e)},MultiPolygon:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)Q6(t[r],e)},GeometryCollection:function(n,e){for(var t=n.geometries,r=-1,i=t.length;++r<i;)bb(t[r],e)}};function EE(n,e,t){var r=-1,i=n.length-t,a;for(e.lineStart();++r<i;)a=n[r],e.point(a[0],a[1],a[2]);e.lineEnd()}function Q6(n,e){var t=-1,r=n.length;for(e.polygonStart();++t<r;)EE(n[t],e,1);e.polygonEnd()}function mPe(n,e){n&&K6.hasOwnProperty(n.type)?K6[n.type](n,e):bb(n,e)}function PE(n){return[g0(n[1],n[0]),m0(n[2])]}function Bp(n){var e=n[0],t=n[1],r=kr(t);return[r*kr(e),r*Or(e),Or(t)]}function n1(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function Sb(n,e){return[n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]]}function U2(n,e){n[0]+=e[0],n[1]+=e[1],n[2]+=e[2]}function r1(n,e){return[n[0]*e,n[1]*e,n[2]*e]}function LE(n){var e=VS(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=e,n[1]/=e,n[2]/=e}function RE(n,e){function t(r,i){return r=n(r,i),e(r[0],r[1])}return n.invert&&e.invert&&(t.invert=function(r,i){return r=e.invert(r,i),r&&n.invert(r[0],r[1])}),t}function DE(n,e){return Cr(n)>Mn&&(n-=Math.round(n/Fs)*Fs),[n,e]}DE.invert=DE;function $j(n,e,t){return(n%=Fs)?e||t?RE(eB(n),tB(e,t)):eB(n):e||t?tB(e,t):DE}function J6(n){return function(e,t){return e+=n,Cr(e)>Mn&&(e-=Math.round(e/Fs)*Fs),[e,t]}}function eB(n){var e=J6(n);return e.invert=J6(-n),e}function tB(n,e){var t=kr(n),r=Or(n),i=kr(e),a=Or(e);function s(o,l){var u=kr(l),c=kr(o)*u,h=Or(o)*u,f=Or(l),d=f*t+c*r;return[g0(h*i-d*a,c*t-f*r),m0(d*i+h*a)]}return s.invert=function(o,l){var u=kr(l),c=kr(o)*u,h=Or(o)*u,f=Or(l),d=f*i-h*a;return[g0(h*i+f*a,c*t+d*r),m0(d*t-c*r)]},s}function yPe(n){n=$j(n[0]*Wr,n[1]*Wr,n.length>2?n[2]*Wr:0);function e(t){return t=n(t[0]*Wr,t[1]*Wr),t[0]*=Ga,t[1]*=Ga,t}return e.invert=function(t){return t=n.invert(t[0]*Wr,t[1]*Wr),t[0]*=Ga,t[1]*=Ga,t},e}function _Pe(n,e,t,r,i,a){if(t){var s=kr(e),o=Or(e),l=r*t;i==null?(i=e+r*Fs,a=e-l/2):(i=nB(s,i),a=nB(s,a),(r>0?i<a:i>a)&&(i+=r*Fs));for(var u,c=i;r>0?c>a:c<a;c-=l)u=PE([s,-o*kr(c),-o*Or(c)]),n.point(u[0],u[1])}}function nB(n,e){e=Bp(e),e[0]-=n,LE(e);var t=gPe(-e[1]);return((-e[2]<0?-t:t)+Fs-nr)%Fs}function jj(){var n=[],e;return{point:function(t,r,i){e.push([t,r,i])},lineStart:function(){n.push(e=[])},lineEnd:Vg,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var t=n;return n=[],e=null,t}}}function K1(n,e){return Cr(n[0]-e[0])<nr&&Cr(n[1]-e[1])<nr}function i1(n,e,t,r){this.x=n,this.z=e,this.o=t,this.e=r,this.v=!1,this.n=this.p=null}function qj(n,e,t,r,i){var a=[],s=[],o,l;if(n.forEach(function(p){if(!((g=p.length-1)<=0)){var g,v=p[0],m=p[g],y;if(K1(v,m)){if(!v[2]&&!m[2]){for(i.lineStart(),o=0;o<g;++o)i.point((v=p[o])[0],v[1]);i.lineEnd();return}m[0]+=2*nr}a.push(y=new i1(v,p,null,!0)),s.push(y.o=new i1(v,null,y,!1)),a.push(y=new i1(m,p,null,!1)),s.push(y.o=new i1(m,null,y,!0))}}),!!a.length){for(s.sort(e),rB(a),rB(s),o=0,l=s.length;o<l;++o)s[o].e=t=!t;for(var u=a[0],c,h;;){for(var f=u,d=!0;f.v;)if((f=f.n)===u)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(o=0,l=c.length;o<l;++o)i.point((h=c[o])[0],h[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(d)for(c=f.p.z,o=c.length-1;o>=0;--o)i.point((h=c[o])[0],h[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,c=f.z,d=!d}while(!f.v);i.lineEnd()}}}function rB(n){if(e=n.length){for(var e,t=0,r=n[0],i;++t<e;)r.n=i=n[t],i.p=r,r=i;r.n=i=n[0],i.p=r}}function V2(n){return Cr(n[0])<=Mn?n[0]:pPe(n[0])*((Cr(n[0])+Mn)%Fs-Mn)}function xPe(n,e){var t=V2(e),r=e[1],i=Or(r),a=[Or(t),-kr(t),0],s=0,o=0,l=new uPe;i===1?r=_a+nr:i===-1&&(r=-_a-nr);for(var u=0,c=n.length;u<c;++u)if(f=(h=n[u]).length)for(var h,f,d=h[f-1],p=V2(d),g=d[1]/2+Y6,v=Or(g),m=kr(g),y=0;y<f;++y,p=x,v=S,m=w,d=_){var _=h[y],x=V2(_),b=_[1]/2+Y6,S=Or(b),w=kr(b),T=x-p,C=T>=0?1:-1,A=C*T,M=A>Mn,P=v*S;if(l.add(g0(P*C*Or(A),m*w+P*kr(A))),s+=M?T+C*Fs:T,M^p>=t^x>=t){var D=Sb(Bp(d),Bp(_));LE(D);var L=Sb(a,D);LE(L);var R=(M^T>=0?-1:1)*m0(L[2]);(r>R||r===R&&(D[0]||D[1]))&&(o+=M^T>=0?1:-1)}}return(s<-nr||s<nr&&l<-hPe)^o&1}function Xj(n,e,t,r){return function(i){var a=e(i),s=jj(),o=e(s),l=!1,u,c,h,f={point:d,lineStart:g,lineEnd:v,polygonStart:function(){f.point=m,f.lineStart=y,f.lineEnd=_,c=[],u=[]},polygonEnd:function(){f.point=d,f.lineStart=g,f.lineEnd=v,c=Hj(c);var x=xPe(u,r);c.length?(l||(i.polygonStart(),l=!0),qj(c,SPe,x,t,i)):x&&(l||(i.polygonStart(),l=!0),i.lineStart(),t(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),c=u=null},sphere:function(){i.polygonStart(),i.lineStart(),t(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(x,b){n(x,b)&&i.point(x,b)}function p(x,b){a.point(x,b)}function g(){f.point=p,a.lineStart()}function v(){f.point=d,a.lineEnd()}function m(x,b){h.push([x,b]),o.point(x,b)}function y(){o.lineStart(),h=[]}function _(){m(h[0][0],h[0][1]),o.lineEnd();var x=o.clean(),b=s.result(),S,w=b.length,T,C,A;if(h.pop(),u.push(h),h=null,!!w){if(x&1){if(C=b[0],(T=C.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<T;++S)i.point((A=C[S])[0],A[1]);i.lineEnd()}return}w>1&&x&2&&b.push(b.pop().concat(b.shift())),c.push(b.filter(bPe))}}return f}}function bPe(n){return n.length>1}function SPe(n,e){return((n=n.x)[0]<0?n[1]-_a-nr:_a-n[1])-((e=e.x)[0]<0?e[1]-_a-nr:_a-e[1])}const iB=Xj(function(){return!0},wPe,MPe,[-Mn,-_a]);function wPe(n){var e=NaN,t=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(a,s){var o=a>0?Mn:-Mn,l=Cr(a-e);Cr(l-Mn)<nr?(n.point(e,t=(t+s)/2>0?_a:-_a),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(o,t),n.point(a,t),i=0):r!==o&&l>=Mn&&(Cr(e-r)<nr&&(e-=r*nr),Cr(a-o)<nr&&(a-=o*nr),t=APe(e,t,a,s),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(o,t),i=0),n.point(e=a,t=s),r=o},lineEnd:function(){n.lineEnd(),e=t=NaN},clean:function(){return 2-i}}}function APe(n,e,t,r){var i,a,s=Or(n-t);return Cr(s)>nr?Wj((Or(e)*(a=kr(r))*Or(t)-Or(r)*(i=kr(e))*Or(n))/(i*a*s)):(e+r)/2}function MPe(n,e,t,r){var i;if(n==null)i=t*_a,r.point(-Mn,i),r.point(0,i),r.point(Mn,i),r.point(Mn,0),r.point(Mn,-i),r.point(0,-i),r.point(-Mn,-i),r.point(-Mn,0),r.point(-Mn,i);else if(Cr(n[0]-e[0])>nr){var a=n[0]<e[0]?Mn:-Mn;i=t*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(e[0],e[1])}function TPe(n){var e=kr(n),t=2*Wr,r=e>0,i=Cr(e)>nr;function a(c,h,f,d){_Pe(d,n,t,f,c,h)}function s(c,h){return kr(c)*kr(h)>e}function o(c){var h,f,d,p,g;return{lineStart:function(){p=d=!1,g=1},point:function(v,m){var y=[v,m],_,x=s(v,m),b=r?x?0:u(v,m):x?u(v+(v<0?Mn:-Mn),m):0;if(!h&&(p=d=x)&&c.lineStart(),x!==d&&(_=l(h,y),(!_||K1(h,_)||K1(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&&r^x){var S;!(b&f)&&(S=l(y,h,!0))&&(g=0,r?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1],3)))}x&&(!h||!K1(h,y))&&c.point(y[0],y[1]),h=y,d=x,f=b},lineEnd:function(){d&&c.lineEnd(),h=null},clean:function(){return g|(p&&d)<<1}}}function l(c,h,f){var d=Bp(c),p=Bp(h),g=[1,0,0],v=Sb(d,p),m=n1(v,v),y=v[0],_=m-y*y;if(!_)return!f&&c;var x=e*m/_,b=-e*y/_,S=Sb(g,v),w=r1(g,x),T=r1(v,b);U2(w,T);var C=S,A=n1(w,C),M=n1(C,C),P=A*A-M*(n1(w,w)-1);if(!(P<0)){var D=VS(P),L=r1(C,(-A-D)/M);if(U2(L,w),L=PE(L),!f)return L;var R=c[0],N=h[0],F=c[1],O=h[1],H;N<R&&(H=R,R=N,N=H);var U=N-R,$=Cr(U-Mn)<nr,Y=$||U<nr;if(!$&&O<F&&(H=F,F=O,O=H),Y?$?F+O>0^L[1]<(Cr(L[0]-R)<nr?F:O):F<=L[1]&&L[1]<=O:U>Mn^(R<=L[0]&&L[0]<=N)){var oe=r1(C,(-A+D)/M);return U2(oe,w),[L,PE(oe)]}}}function u(c,h){var f=r?n:Mn-n,d=0;return c<-f?d|=1:c>f&&(d|=2),h<-f?d|=4:h>f&&(d|=8),d}return Xj(s,o,a,r?[0,-n]:[-Mn,n-Mn])}function CPe(n,e,t,r,i,a){var s=n[0],o=n[1],l=e[0],u=e[1],c=0,h=1,f=l-s,d=u-o,p;if(p=t-s,!(!f&&p>0)){if(p/=f,f<0){if(p<c)return;p<h&&(h=p)}else if(f>0){if(p>h)return;p>c&&(c=p)}if(p=i-s,!(!f&&p<0)){if(p/=f,f<0){if(p>h)return;p>c&&(c=p)}else if(f>0){if(p<c)return;p<h&&(h=p)}if(p=r-o,!(!d&&p>0)){if(p/=d,d<0){if(p<c)return;p<h&&(h=p)}else if(d>0){if(p>h)return;p>c&&(c=p)}if(p=a-o,!(!d&&p<0)){if(p/=d,d<0){if(p>h)return;p>c&&(c=p)}else if(d>0){if(p<c)return;p<h&&(h=p)}return c>0&&(n[0]=s+c*f,n[1]=o+c*d),h<1&&(e[0]=s+h*f,e[1]=o+h*d),!0}}}}}var Hg=1e9,a1=-Hg;function EPe(n,e,t,r){function i(u,c){return n<=u&&u<=t&&e<=c&&c<=r}function a(u,c,h,f){var d=0,p=0;if(u==null||(d=s(u,h))!==(p=s(c,h))||l(u,c)<0^h>0)do f.point(d===0||d===3?n:t,d>1?r:e);while((d=(d+h+4)%4)!==p);else f.point(c[0],c[1])}function s(u,c){return Cr(u[0]-n)<nr?c>0?0:3:Cr(u[0]-t)<nr?c>0?2:1:Cr(u[1]-e)<nr?c>0?1:0:c>0?3:2}function o(u,c){return l(u.x,c.x)}function l(u,c){var h=s(u,1),f=s(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=jj(),f,d,p,g,v,m,y,_,x,b,S,w={point:T,lineStart:P,lineEnd:D,polygonStart:A,polygonEnd:M};function T(R,N){i(R,N)&&c.point(R,N)}function C(){for(var R=0,N=0,F=d.length;N<F;++N)for(var O=d[N],H=1,U=O.length,$=O[0],Y,oe,X=$[0],re=$[1];H<U;++H)Y=X,oe=re,$=O[H],X=$[0],re=$[1],oe<=r?re>r&&(X-Y)*(r-oe)>(re-oe)*(n-Y)&&++R:re<=r&&(X-Y)*(r-oe)<(re-oe)*(n-Y)&&--R;return R}function A(){c=h,f=[],d=[],S=!0}function M(){var R=C(),N=S&&R,F=(f=Hj(f)).length;(N||F)&&(u.polygonStart(),N&&(u.lineStart(),a(null,null,1,u),u.lineEnd()),F&&qj(f,o,R,a,u),u.polygonEnd()),c=u,f=d=p=null}function P(){w.point=L,d&&d.push(p=[]),b=!0,x=!1,y=_=NaN}function D(){f&&(L(g,v),m&&x&&h.rejoin(),f.push(h.result())),w.point=T,x&&c.lineEnd()}function L(R,N){var F=i(R,N);if(d&&p.push([R,N]),b)g=R,v=N,m=F,b=!1,F&&(c.lineStart(),c.point(R,N));else if(F&&x)c.point(R,N);else{var O=[y=Math.max(a1,Math.min(Hg,y)),_=Math.max(a1,Math.min(Hg,_))],H=[R=Math.max(a1,Math.min(Hg,R)),N=Math.max(a1,Math.min(Hg,N))];CPe(O,H,n,e,t,r)?(x||(c.lineStart(),c.point(O[0],O[1])),c.point(H[0],H[1]),F||c.lineEnd(),S=!1):F&&(c.lineStart(),c.point(R,N),S=!1)}y=R,_=N,x=F}return w}}const aB=n=>n;var Gp=1/0,wb=Gp,y0=-Gp,Ab=y0,PPe={point:LPe,lineStart:Vg,lineEnd:Vg,polygonStart:Vg,polygonEnd:Vg,result:function(){var n=[[Gp,wb],[y0,Ab]];return y0=Ab=-(wb=Gp=1/0),n}};function LPe(n,e){n<Gp&&(Gp=n),n>y0&&(y0=n),e<wb&&(wb=e),e>Ab&&(Ab=e)}const sB=PPe;function QR(n){return function(e){var t=new IE;for(var r in n)t[r]=n[r];return t.stream=e,t}}function IE(){}IE.prototype={constructor:IE,point:function(n,e){this.stream.point(n,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 JR(n,e,t){var r=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),r!=null&&n.clipExtent(null),mPe(t,n.stream(sB)),e(sB.result()),r!=null&&n.clipExtent(r),n}function Yj(n,e,t){return JR(n,function(r){var i=e[1][0]-e[0][0],a=e[1][1]-e[0][1],s=Math.min(i/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),o=+e[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(a-s*(r[1][1]+r[0][1]))/2;n.scale(150*s).translate([o,l])},t)}function RPe(n,e,t){return Yj(n,[[0,0],e],t)}function DPe(n,e,t){return JR(n,function(r){var i=+e,a=i/(r[1][0]-r[0][0]),s=(i-a*(r[1][0]+r[0][0]))/2,o=-a*r[0][1];n.scale(150*a).translate([s,o])},t)}function IPe(n,e,t){return JR(n,function(r){var i=+e,a=i/(r[1][1]-r[0][1]),s=-a*r[0][0],o=(i-a*(r[1][1]+r[0][1]))/2;n.scale(150*a).translate([s,o])},t)}var oB=16,NPe=kr(30*Wr);function lB(n,e){return+e?OPe(n,e):kPe(n)}function kPe(n){return QR({point:function(e,t){e=n(e,t),this.stream.point(e[0],e[1])}})}function OPe(n,e){function t(r,i,a,s,o,l,u,c,h,f,d,p,g,v){var m=u-r,y=c-i,_=m*m+y*y;if(_>4*e&&g--){var x=s+f,b=o+d,S=l+p,w=VS(x*x+b*b+S*S),T=m0(S/=w),C=Cr(Cr(S)-1)<nr||Cr(a-h)<nr?(a+h)/2:g0(b,x),A=n(C,T),M=A[0],P=A[1],D=M-r,L=P-i,R=y*D-m*L;(R*R/_>e||Cr((m*D+y*L)/_-.5)>.3||s*f+o*d+l*p<NPe)&&(t(r,i,a,s,o,l,M,P,C,x/=w,b/=w,S,g,v),v.point(M,P),t(M,P,C,x,b,S,u,c,h,f,d,p,g,v))}}return function(r){var i,a,s,o,l,u,c,h,f,d,p,g,v={point:m,lineStart:y,lineEnd:x,polygonStart:function(){r.polygonStart(),v.lineStart=b},polygonEnd:function(){r.polygonEnd(),v.lineStart=y}};function m(T,C){T=n(T,C),r.point(T[0],T[1])}function y(){h=NaN,v.point=_,r.lineStart()}function _(T,C){var A=Bp([T,C]),M=n(T,C);t(h,f,c,d,p,g,h=M[0],f=M[1],c=T,d=A[0],p=A[1],g=A[2],oB,r),r.point(h,f)}function x(){v.point=m,r.lineEnd()}function b(){y(),v.point=S,v.lineEnd=w}function S(T,C){_(i=T,C),a=h,s=f,o=d,l=p,u=g,v.point=_}function w(){t(h,f,c,d,p,g,a,s,i,o,l,u,oB,r),v.lineEnd=x,x()}return v}}var FPe=QR({point:function(n,e){this.stream.point(n*Wr,e*Wr)}});function BPe(n){return QR({point:function(e,t){var r=n(e,t);return this.stream.point(r[0],r[1])}})}function GPe(n,e,t,r,i){function a(s,o){return s*=r,o*=i,[e+n*s,t-n*o]}return a.invert=function(s,o){return[(s-e)/n*r,(t-o)/n*i]},a}function uB(n,e,t,r,i,a){if(!a)return GPe(n,e,t,r,i);var s=kr(a),o=Or(a),l=s*n,u=o*n,c=s/n,h=o/n,f=(o*t-s*e)/n,d=(o*e+s*t)/n;function p(g,v){return g*=r,v*=i,[l*g-u*v+e,t-u*g-l*v]}return p.invert=function(g,v){return[r*(c*g-h*v+f),i*(d-h*g-c*v)]},p}function zPe(n){return UPe(function(){return n})()}function UPe(n){var e,t=150,r=480,i=250,a=0,s=0,o=0,l=0,u=0,c,h=0,f=1,d=1,p=null,g=iB,v=null,m,y,_,x=aB,b=.5,S,w,T,C,A;function M(R){return T(R[0]*Wr,R[1]*Wr)}function P(R){return R=T.invert(R[0],R[1]),R&&[R[0]*Ga,R[1]*Ga]}M.stream=function(R){return C&&A===R?C:C=FPe(BPe(c)(g(S(x(A=R)))))},M.preclip=function(R){return arguments.length?(g=R,p=void 0,L()):g},M.postclip=function(R){return arguments.length?(x=R,v=m=y=_=null,L()):x},M.clipAngle=function(R){return arguments.length?(g=+R?TPe(p=R*Wr):(p=null,iB),L()):p*Ga},M.clipExtent=function(R){return arguments.length?(x=R==null?(v=m=y=_=null,aB):EPe(v=+R[0][0],m=+R[0][1],y=+R[1][0],_=+R[1][1]),L()):v==null?null:[[v,m],[y,_]]},M.scale=function(R){return arguments.length?(t=+R,D()):t},M.translate=function(R){return arguments.length?(r=+R[0],i=+R[1],D()):[r,i]},M.center=function(R){return arguments.length?(a=R[0]%360*Wr,s=R[1]%360*Wr,D()):[a*Ga,s*Ga]},M.rotate=function(R){return arguments.length?(o=R[0]%360*Wr,l=R[1]%360*Wr,u=R.length>2?R[2]%360*Wr:0,D()):[o*Ga,l*Ga,u*Ga]},M.angle=function(R){return arguments.length?(h=R%360*Wr,D()):h*Ga},M.reflectX=function(R){return arguments.length?(f=R?-1:1,D()):f<0},M.reflectY=function(R){return arguments.length?(d=R?-1:1,D()):d<0},M.precision=function(R){return arguments.length?(S=lB(w,b=R*R),L()):VS(b)},M.fitExtent=function(R,N){return Yj(M,R,N)},M.fitSize=function(R,N){return RPe(M,R,N)},M.fitWidth=function(R,N){return DPe(M,R,N)},M.fitHeight=function(R,N){return IPe(M,R,N)};function D(){var R=uB(t,0,0,f,d,h).apply(null,e(a,s)),N=uB(t,r-R[0],i-R[1],f,d,h);return c=$j(o,l,u),w=RE(e,N),T=RE(c,w),S=lB(w,b),L()}function L(){return C=A=null,M}return function(){return e=n.apply(this,arguments),M.invert=e.invert&&P,D()}}function e3(n,e){return[n,dPe(vPe((_a+e)/2))]}e3.invert=function(n,e){return[n,2*Wj(fPe(e))-_a]};function Tl(){return VPe(e3).scale(961/Fs)}function VPe(n){var e=zPe(n),t=e.center,r=e.scale,i=e.translate,a=e.clipExtent,s=null,o,l,u;e.scale=function(h){return arguments.length?(r(h),c()):r()},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?s=o=l=u=null:(s=+h[0][0],o=+h[0][1],l=+h[1][0],u=+h[1][1]),c()):s==null?null:[[s,o],[l,u]]};function c(){var h=Mn*r(),f=e(yPe(e.rotate()).invert([0,0]));return a(s==null?[[f[0]-h,f[1]-h],[f[0]+h,f[1]+h]]:n===e3?[[Math.max(f[0]-h,s),o],[Math.min(f[0]+h,l),u]]:[[s,Math.max(f[1]-h,o)],[l,Math.min(f[1]+h,u)]])}return c()}class HPe extends US{constructor(e,t={}){super();let r={isOrthographic:!1};this.config=Object.assign({},r,t),this.canvas=e,this.scene=new yj,this.sizes=new gEe(this),this.time=new mEe(this),this.camera=new lPe(this,{isOrthographic:this.config.isOrthographic}),this.renderer=new sPe(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 Nj(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(r=>{if(r instanceof An){r.geometry.dispose();for(const i in r.material){const a=r.material[i];a&&typeof a.dispose=="function"&&a.dispose()}}}),(t=(e=this.canvas)==null?void 0:e.parentNode)==null||t.removeChild(this.canvas)}}class WPe{constructor({material:e,time:t,size:r,diffuseColor:i,diffuseSpeed:a,diffuseWidth:s,callback:o=()=>{}}){this.time=t,this.pointShader=null,this.callback=o;let l={size:100,diffuseSpeed:15,diffuseColor:9345950,diffuseWidth:10};this.options=Object.assign({},l,{material:e,size:r,diffuseColor:i,diffuseSpeed:a,diffuseWidth:s}),this.init()}init(){let{material:e,size:t,diffuseColor:r,diffuseSpeed:i,diffuseWidth:a}=this.options,s=t/i;e.onBeforeCompile=o=>{this.pointShader=o,this.callback(o,s),o.uniforms=Ve(Le({},o.uniforms),{uTime:{value:0},uSpeed:{value:i},uWidth:{value:a},uColor:{value:new xt(r)}}),o.vertexShader=o.vertexShader.replace("void main() {",`
varying vec3 vPosition;
void main(){
vPosition = position;
`),o.fragmentShader=o.fragmentShader.replace("void main() {",`
uniform float uTime;
uniform float uSpeed;
uniform float uWidth;
uniform vec3 uColor;
varying vec3 vPosition;
void main(){
`),o.fragmentShader=o.fragmentShader.replace("#include <opaque_fragment>",`
#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);
}
`)}}}class $Pe{constructor({scene:e,time:t},r){this.scene=e,this.time=t,this.instance=null;let i={position:new te(0,0,0),gridSize:100,gridDivision:20,gridColor:2635578,shapeSize:1,shapeColor:9345950,pointSize:.2,pointColor:2635578,pointLayout:{row:200,col:200},pointBlending:Qh};this.options=Object.assign({},i,r),this.init()}init(){let e=new kn;e.name="Grid";let t=this.createGridHelp(),r=this.createShapes(),i=this.createPoint();e.add(t,r,i),e.position.copy(this.options.position),this.instance=e,this.scene.add(e)}createShapes(){let{gridSize:e,gridDivision:t,shapeSize:r,shapeColor:i}=this.options,a=e/t,s=e/2,o=new Nn({color:i,side:tr}),l=[];for(let h=0;h<t+1;h++)for(let f=0;f<t+1;f++){let d=this.createPlus(r);d.translate(-s+h*a,-s+f*a,0),l.push(d)}let u=kj(l),c=new An(u,o);return c.renderOrder=-1,c.rotateX(-Math.PI/2),c.position.y+=.01,c}createGridHelp(){let{gridSize:e,gridDivision:t,gridColor:r}=this.options;return new pEe(e,t,r,r)}createPoint(){let{gridSize:e,pointSize:t,pointColor:r,pointBlending:i,pointLayout:a}=this.options;const s=a.row,o=a.col,l=new Float32Array(s*o*3);for(let f=0;f<s;f++)for(let d=0;d<o;d++){let p=f/(s-1)*e-e/2,g=0,v=d/(o-1)*e-e/2,m=(f*o+d)*3;l[m]=p,l[m+1]=g,l[m+2]=v}var u=new qn;u.setAttribute("position",new br(l,3));let c=new X0({size:t,sizeAttenuation:!0,color:r,blending:i});return new UR(u,c)}setPointMode(){}createPlus(e=50){let t=e/6/3,r=e/3,i=[new Ge(-r,-t),new Ge(-t,-t),new Ge(-t,-r),new Ge(t,-r),new Ge(t,-r),new Ge(t,-t),new Ge(r,-t),new Ge(r,t),new Ge(t,t),new Ge(t,r),new Ge(-t,r),new Ge(-t,t),new Ge(-r,t)],a=new $o(i);return new Y0(a,24)}}const cB=new te,jPe=new ho,hB=new te;class Kj extends er{constructor(e=document.createElement("div")){super(),this.isCSS3DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this}}class qPe extends Kj{constructor(e){super(e),this.isCSS3DSprite=!0,this.rotation2D=0}copy(e,t){return super.copy(e,t),this.rotation2D=e.rotation2D,this}}const xo=new Jt,XPe=new Jt;class YPe{constructor(e={}){const t=this;let r,i,a,s;const o={camera:{style:""},objects:new WeakMap},l=e.element!==void 0?e.element:document.createElement("div");l.style.overflow="hidden",this.domElement=l;const u=document.createElement("div");u.style.transformOrigin="0 0",u.style.pointerEvents="none",l.appendChild(u);const c=document.createElement("div");c.style.transformStyle="preserve-3d",u.appendChild(c),this.getSize=function(){return{width:r,height:i}},this.render=function(g,v){const m=v.projectionMatrix.elements[5]*s;v.view&&v.view.enabled?(u.style.transform=`translate( ${-v.view.offsetX*(r/v.view.width)}px, ${-v.view.offsetY*(i/v.view.height)}px )`,u.style.transform+=`scale( ${v.view.fullWidth/v.view.width}, ${v.view.fullHeight/v.view.height} )`):u.style.transform="",g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),v.parent===null&&v.matrixWorldAutoUpdate===!0&&v.updateMatrixWorld();let y,_;v.isOrthographicCamera&&(y=-(v.right+v.left)/2,_=(v.top+v.bottom)/2);const x=v.view&&v.view.enabled?v.view.height/v.view.fullHeight:1,b=v.isOrthographicCamera?`scale( ${x} )scale(`+m+")translate("+h(y)+"px,"+h(_)+"px)"+f(v.matrixWorldInverse):`scale( ${x} )translateZ(`+m+"px)"+f(v.matrixWorldInverse),w=(v.isPerspectiveCamera?"perspective("+m+"px) ":"")+b+"translate("+a+"px,"+s+"px)";o.camera.style!==w&&(c.style.transform=w,o.camera.style=w),p(g,g,v)},this.setSize=function(g,v){r=g,i=v,a=r/2,s=i/2,l.style.width=g+"px",l.style.height=v+"px",u.style.width=g+"px",u.style.height=v+"px",c.style.width=g+"px",c.style.height=v+"px"};function h(g){return Math.abs(g)<1e-10?0:g}function f(g){const v=g.elements;return"matrix3d("+h(v[0])+","+h(-v[1])+","+h(v[2])+","+h(v[3])+","+h(v[4])+","+h(-v[5])+","+h(v[6])+","+h(v[7])+","+h(v[8])+","+h(-v[9])+","+h(v[10])+","+h(v[11])+","+h(v[12])+","+h(-v[13])+","+h(v[14])+","+h(v[15])+")"}function d(g){const v=g.elements;return"translate(-50%,-50%)"+("matrix3d("+h(v[0])+","+h(v[1])+","+h(v[2])+","+h(v[3])+","+h(-v[4])+","+h(-v[5])+","+h(-v[6])+","+h(-v[7])+","+h(v[8])+","+h(v[9])+","+h(v[10])+","+h(v[11])+","+h(v[12])+","+h(v[13])+","+h(v[14])+","+h(v[15])+")")}function p(g,v,m,y){if(g.isCSS3DObject){const _=g.visible===!0&&g.layers.test(m.layers)===!0;if(g.element.style.display=_===!0?"":"none",_===!0){g.onBeforeRender(t,v,m);let x;g.isCSS3DSprite?(xo.copy(m.matrixWorldInverse),xo.transpose(),g.rotation2D!==0&&xo.multiply(XPe.makeRotationZ(g.rotation2D)),g.matrixWorld.decompose(cB,jPe,hB),xo.setPosition(cB),xo.scale(hB),xo.elements[3]=0,xo.elements[7]=0,xo.elements[11]=0,xo.elements[15]=1,x=d(xo)):x=d(g.matrixWorld);const b=g.element,S=o.objects.get(g);if(S===void 0||S.style!==x){b.style.transform=x;const w={style:x};o.objects.set(g,w)}b.parentNode!==c&&c.appendChild(b),g.onAfterRender(t,v,m)}}for(let _=0,x=g.children.length;_<x;_++)p(g.children[_],v,m)}}}class KPe{constructor({scene:e,camera:t,time:r,sizes:i,canvas:a}){this.scene=e,this.camera=t,this.time=r,this.sizes=i,this.canvas=a,this.parent=null;let{width:s,height:o}=this.sizes,l=new YPe;this.css3dRender=l,l.setSize(s,o),l.domElement.style.position="absolute",l.domElement.style.left="0px",l.domElement.style.top="0px",l.domElement.style.pointerEvents="none",l.domElement.className="label3d-"+aPe(),this.canvas.parentNode.appendChild(l.domElement),this.time.on("tick",()=>{this.update()}),this.sizes.on("resize",()=>{this.resize()})}create(e="",t="",r=!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 r?a=new qPe(i):a=new Kj(i),a.init=(s,o)=>{a.element.innerHTML=s,a.element.style.visibility="visible",a.position.copy(o)},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=s=>{this.parent=s,s.add(a)},a.remove=()=>{this.parent.remove(a)},a}setLabelStyle(e,t=.1,r="x",i=Math.PI/2,a="none"){e.element.style.pointerEvents=a,e.scale.set(t,t,t),e.rotation[r]=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 fB{constructor({time:e},t){this.time=e,this.options=Object.assign({},{width:10,scale:1,position:new te(0,0,0),needRotate:!1,rotateSpeed:.001,material:new Nn({transparent:!0,opacity:1,depthTest:!0})},t);let r=new Ss(this.options.width,this.options.width),i=new An(r,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 Mb{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 X0({map:Mb.createTexture(),size:20,color:16777215,transparent:!0,opacity:1,depthTest:!1,vertexColors:!0,blending:yi,sizeAttenuation:!0})},t),this.create()}create(){const{range:e,speed:t,dir:r,material:i,num:a,renderOrder:s}=this.config,o=[],l=[],u=[];for(let h=0;h<a;h++){o.push(Math.random()*e-e/2,Math.random()*e-e/2,Math.random()*e-e/2);let f=r==="up"?1:-1;u.push(Math.random()*f,(.1+Math.random())*f,.1+Math.random()*f);const d=i.color.clone();let p={};d.getHSL(p),d.setHSL(p.h,p.s,p.l*Math.random()),l.push(d.r,d.g,d.b)}const c=new qn;c.setAttribute("position",new br(new Float32Array(o),3)),c.setAttribute("velocities",new br(new Float32Array(u),3)),c.setAttribute("color",new br(new Float32Array(l),3)),this.instance=new UR(c,i),this.instance.renderOrder=s}static createTexture(){let e=document.createElement("canvas");e.width=1024,e.height=1024;let t=e.getContext("2d"),r=t.createRadialGradient(512,512,0,512,512,512);return r.addColorStop(0,"rgba(255,255,255,1)"),r.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=r,t.fillRect(0,0,1024,1024),new VR(e)}update(e,t){if(!this.instance)return!1;const{range:r,speed:i,dir:a}=this.config;let s=a==="up"?1:-1,o=this.instance.geometry.getAttribute("position"),l=this.instance.geometry.getAttribute("velocities");const u=o.count;for(let c=0;c<u;c++){let h=o.getX(c);o.getY(c);let f=o.getZ(c),d=l.getX(c),p=l.getY(c);l.getZ(c),h+=Math.sin(d*t)*e,f+=i*s,f>r/2&&s===1&&(f=-r/2),f<-r/2&&s==-1&&(f=r/2),o.setX(c,h),o.setZ(c,f),l.setX(c,d),l.setY(c,p)}o.needsUpdate=!0,l.needsUpdate=!0}setParent(e){e.add(this.instance),this.time.on("tick",(t,r)=>{this.enable&&this.update(t,r)})}}class s1{constructor({},e={}){this.mapGroup=new kn,this.coordinates=[],this.config=Object.assign({position:new te(0,0,0),geoProjectionCenter:new Ge(0,0),geoProjectionScale:120,data:"",renderOrder:1,merge:!1,material:new Nn({color:1582651,transparent:!0,opacity:1})},e),this.mapGroup.position.copy(this.config.position);let t=ZR(this.config.data);this.create(t)}geoProjection(e){return Tl().center(this.config.geoProjectionCenter).scale(this.config.geoProjectionScale).translate([0,0])(e)}create(e){let{merge:t}=this.config,r=[];if(e.features.forEach(i=>{const a=new er;let{name:s,center:o=[],centroid:l=[]}=i.properties;this.coordinates.push({name:s,center:o,centroid:l}),a.userData.name=s,i.geometry.coordinates.forEach(u=>{u.forEach(c=>{const h=new $o;for(let d=0;d<c.length;d++){if(!c[d][0]||!c[d][1])return!1;const[p,g]=this.geoProjection(c[d]);d===0&&h.moveTo(p,-g),h.lineTo(p,-g)}const f=new Y0(h);if(t)r.push(f);else{const d=new An(f,this.config.material);d.renderOrder=this.config.renderOrder,d.userData.name=s,a.add(d)}})}),t||this.mapGroup.add(a)}),t){let i=kj(r);const a=new An(i,this.config.material);a.renderOrder=this.config.renderOrder,this.mapGroup.add(a)}}getCoordinates(){return this.coordinates}setParent(e){e.add(this.mapGroup)}}class dB{constructor({assets:e,time:t},r={}){this.mapGroup=new kn,this.assets=e,this.time=t,this.coordinates=[],this.config=Object.assign({position:new te(0,0,0),geoProjectionCenter:new Ge(0,0),geoProjectionScale:120,data:"",renderOrder:1,topFaceMaterial:new Nn({color:1582651,transparent:!0,opacity:1}),sideMaterial:new Nn({color:464171,transparent:!0,opacity:1}),depth:.1},r),this.mapGroup.position.copy(this.config.position);let i=ZR(this.config.data);this.create(i)}geoProjection(e){return Tl().center(this.config.geoProjectionCenter).scale(this.config.geoProjectionScale).translate([0,0])(e)}create(e){e.features.forEach(t=>{var u,c,h;const r=new er;let{name:i,center:a=[],centroid:s=[]}=t.properties;this.coordinates.push({name:i,center:a,centroid:s});const o={depth:this.config.depth,bevelEnabled:(u=this.config.bevelEnabled)!=null?u:!0,bevelSegments:(c=this.config.bevelSegments)!=null?c:1,bevelThickness:(h=this.config.bevelThickness)!=null?h:.1};let l=[this.config.topFaceMaterial,this.config.sideMaterial];t.geometry.coordinates.forEach(f=>{f.forEach((d,p)=>{const g=new $o;for(let y=0;y<d.length;y++){if(!d[y][0]||!d[y][1])return!1;const[_,x]=this.geoProjection(d[y]);y===0&&g.moveTo(_,-x),g.lineTo(_,-x)}const v=new BS(g,o),m=new An(v,l);r.add(m)})}),this.mapGroup.add(r)})}getCoordinates(){return this.coordinates}setParent(e){e.add(this.mapGroup)}}const pB=new Us,o1=new te;class Zj extends eEe{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(r),this.setAttribute("position",new or(e,3)),this.setAttribute("uv",new or(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,r=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),r.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const r=new wE(t,6,1);return this.setAttribute("instanceStart",new io(r,3,0)),this.setAttribute("instanceEnd",new io(r,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const r=new wE(t,6,1);return this.setAttribute("instanceColorStart",new io(r,3,0)),this.setAttribute("instanceColorEnd",new io(r,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new FCe(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Us);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),pB.setFromBufferAttribute(t),this.boundingBox.union(pB))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Vs),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const r=this.boundingSphere.center;this.boundingBox.getCenter(r);let i=0;for(let a=0,s=e.count;a<s;a++)o1.fromBufferAttribute(e,a),i=Math.max(i,r.distanceToSquared(o1)),o1.fromBufferAttribute(t,a),i=Math.max(i,r.distanceToSquared(o1));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}rt.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Ge(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};ga.line={uniforms:IR.merge([rt.common,rt.fog,rt.line]),vertexShader:`
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
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 <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}
`,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 <common>
#include <color_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
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 <clipping_planes_fragment>
#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 <logdepthbuf_fragment>
#include <color_fragment>
gl_FragColor = vec4( diffuseColor.rgb, alpha );
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}
`};class Qj extends jl{constructor(e){super({type:"LineMaterial",uniforms:IR.clone(ga.line.uniforms),vertexShader:ga.line.vertexShader,fragmentShader:ga.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 vB=new te,gB=new te,gi=new En,mi=new En,bo=new En,H2=new te,W2=new Jt,xi=new dEe,mB=new te,l1=new Us,u1=new Vs,So=new En;let Fo,rf;function yB(n,e,t){return So.set(0,0,-e,1).applyMatrix4(n.projectionMatrix),So.multiplyScalar(1/So.w),So.x=rf/t.width,So.y=rf/t.height,So.applyMatrix4(n.projectionMatrixInverse),So.multiplyScalar(1/So.w),Math.abs(Math.max(So.x,So.y))}function ZPe(n,e){const t=n.matrixWorld,r=n.geometry,i=r.attributes.instanceStart,a=r.attributes.instanceEnd,s=Math.min(r.instanceCount,i.count);for(let o=0,l=s;o<l;o++){xi.start.fromBufferAttribute(i,o),xi.end.fromBufferAttribute(a,o),xi.applyMatrix4(t);const u=new te,c=new te;Fo.distanceSqToSegment(xi.start,xi.end,c,u),c.distanceTo(u)<rf*.5&&e.push({point:c,pointOnLine:u,distance:Fo.origin.distanceTo(c),object:n,face:null,faceIndex:o,uv:null,uv1:null})}}function QPe(n,e,t){const r=e.projectionMatrix,a=n.material.resolution,s=n.matrixWorld,o=n.geometry,l=o.attributes.instanceStart,u=o.attributes.instanceEnd,c=Math.min(o.instanceCount,l.count),h=-e.near;Fo.at(1,bo),bo.w=1,bo.applyMatrix4(e.matrixWorldInverse),bo.applyMatrix4(r),bo.multiplyScalar(1/bo.w),bo.x*=a.x/2,bo.y*=a.y/2,bo.z=0,H2.copy(bo),W2.multiplyMatrices(e.matrixWorldInverse,s);for(let f=0,d=c;f<d;f++){if(gi.fromBufferAttribute(l,f),mi.fromBufferAttribute(u,f),gi.w=1,mi.w=1,gi.applyMatrix4(W2),mi.applyMatrix4(W2),gi.z>h&&mi.z>h)continue;if(gi.z>h){const _=gi.z-mi.z,x=(gi.z-h)/_;gi.lerp(mi,x)}else if(mi.z>h){const _=mi.z-gi.z,x=(mi.z-h)/_;mi.lerp(gi,x)}gi.applyMatrix4(r),mi.applyMatrix4(r),gi.multiplyScalar(1/gi.w),mi.multiplyScalar(1/mi.w),gi.x*=a.x/2,gi.y*=a.y/2,mi.x*=a.x/2,mi.y*=a.y/2,xi.start.copy(gi),xi.start.z=0,xi.end.copy(mi),xi.end.z=0;const g=xi.closestPointToPointParameter(H2,!0);xi.at(g,mB);const v=RR.lerp(gi.z,mi.z,g),m=v>=-1&&v<=1,y=H2.distanceTo(mB)<rf*.5;if(m&&y){xi.start.fromBufferAttribute(l,f),xi.end.fromBufferAttribute(u,f),xi.start.applyMatrix4(s),xi.end.applyMatrix4(s);const _=new te,x=new te;Fo.distanceSqToSegment(xi.start,xi.end,x,_),t.push({point:x,pointOnLine:_,distance:Fo.origin.distanceTo(x),object:n,face:null,faceIndex:f,uv:null,uv1:null})}}}class JPe extends An{constructor(e=new Zj,t=new Qj({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let s=0,o=0,l=t.count;s<l;s++,o+=2)vB.fromBufferAttribute(t,s),gB.fromBufferAttribute(r,s),i[o]=o===0?0:i[o-1],i[o+1]=i[o]+vB.distanceTo(gB);const a=new wE(i,2,1);return e.setAttribute("instanceDistanceStart",new io(a,1,0)),e.setAttribute("instanceDistanceEnd",new io(a,1,1)),this}raycast(e,t){const r=this.material.worldUnits,i=e.camera;i===null&&!r&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const a=e.params.Line2!==void 0&&e.params.Line2.threshold||0;Fo=e.ray;const s=this.matrixWorld,o=this.geometry,l=this.material;rf=l.linewidth+a,o.boundingSphere===null&&o.computeBoundingSphere(),u1.copy(o.boundingSphere).applyMatrix4(s);let u;if(r)u=rf*.5;else{const h=Math.max(i.near,u1.distanceToPoint(Fo.origin));u=yB(i,h,l.resolution)}if(u1.radius+=u,Fo.intersectsSphere(u1)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),l1.copy(o.boundingBox).applyMatrix4(s);let c;if(r)c=rf*.5;else{const h=Math.max(i.near,l1.distanceToPoint(Fo.origin));c=yB(i,h,l.resolution)}l1.expandByScalar(c),Fo.intersectsBox(l1)!==!1&&(r?ZPe(this,t):QPe(this,i,t))}}class Jj extends Zj{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,r=new Float32Array(2*t);for(let i=0;i<t;i+=3)r[2*i]=e[i],r[2*i+1]=e[i+1],r[2*i+2]=e[i+2],r[2*i+3]=e[i+3],r[2*i+4]=e[i+4],r[2*i+5]=e[i+5];return super.setPositions(r),this}setColors(e){const t=e.length-3,r=new Float32Array(2*t);for(let i=0;i<t;i+=3)r[2*i]=e[i],r[2*i+1]=e[i+1],r[2*i+2]=e[i+2],r[2*i+3]=e[i+3],r[2*i+4]=e[i+4],r[2*i+5]=e[i+5];return super.setColors(r),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class eLe extends JPe{constructor(e=new Jj,t=new Qj({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class c1{constructor({},e={}){this.config=Object.assign({visibelProvince:"",geoProjectionCenter:[0,0],geoProjectionScale:120,position:new te(0,0,0),data:"",material:new Oo({color:16777215}),type:"LineLoop",renderOrder:1,tubeRadius:.2},e);let t=ZR(this.config.data),r=this.create(t);this.lineGroup=r,this.lineGroup.position.copy(this.config.position)}geoProjection(e){return Tl().center(this.config.geoProjectionCenter).scale(this.config.geoProjectionScale).translate([0,0])(e)}create(e){const{type:t,visibelProvince:r}=this.config;let i=e.features,a=new kn;for(let s=0;s<i.length;s++){const o=i[s];let l=new kn;l.name="meshLineGroup"+s,o.properties.name!==r&&(o.geometry.coordinates.forEach(u=>{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 te(d,-p,0))}),h=this.createLine3(c)):u[0].forEach(f=>{const[d,p]=this.geoProjection(f);c.push(new te(d,-p,0)),h=this.createLine(c)}),l.add(h)}),a.add(l))}return a}createLine3(e){const t=this.config.tubeRadius,r=256*10,i=4,a=!1,{material:s,renderOrder:o}=this.config,l=new $R(e),u=new GS(l,r,t,i,a),c=new An(u,s);return c.name="mapLine3",c.renderOrder=o,c}createLine2(e){const{material:t,renderOrder:r}=this.config,i=new Jj;i.setPositions(e);let a=new eLe(i,t);return a.name="mapLine2",a.renderOrder=r,a.computeLineDistances(),a}createLine(e){const{material:t,renderOrder:r,type:i}=this.config,a=new qn;a.setFromPoints(e);let s=new yb(a,t);return s.renderOrder=r,s.name="mapLine",s}setParent(e){e.add(this.lineGroup)}}class h1{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:r,dir:i,size:a}=this.config,s={x:1,y:2,z:3};e.onBeforeCompile=o=>{this.shader=o,o.uniforms=Ve(Le({},o.uniforms),{uColor1:{value:new xt(t)},uColor2:{value:new xt(r)},uDir:{value:s[i]},uSize:{value:a}}),o.vertexShader=o.vertexShader.replace("void main() {",`
attribute float alpha;
varying vec3 vPosition;
varying float vAlpha;
void main() {
vAlpha = alpha;
vPosition = position;
`),o.fragmentShader=o.fragmentShader.replace("void main() {",`
varying vec3 vPosition;
varying float vAlpha;
uniform vec3 uColor1;
uniform vec3 uColor2;
uniform float uDir;
uniform float uSize;
void main() {
`),o.fragmentShader=o.fragmentShader.replace("#include <opaque_fragment>",`
#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 tLe="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=",nLe=[{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]}],_B=[{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}],rLe=[{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}],iLe=[{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 xB=class{constructor(e,t){Kt(this,"target");Kt(this,"name");Kt(this,"intersected");Kt(this,"wasIntersected",!1);Kt(this,"wasIntersectedOnMouseDown",!1);Kt(this,"distance");this.target=e,this.name=t,this.intersected=!1,this.distance=0}},ha=class{constructor(n,e=null){Kt(this,"type");Kt(this,"cancelBubble");Kt(this,"originalEvent");Kt(this,"coords",new Ge(0,0));Kt(this,"distance",0);Kt(this,"intersected",!1);Kt(this,"wasIntersected",!1);Kt(this,"wasIntersectedOnMouseDown",!1);this.cancelBubble=!1,this.type=n,this.originalEvent=e}stopPropagation(){this.cancelBubble=!0}},aLe=class{constructor(n,e,t,r){Kt(this,"renderer");Kt(this,"camera");Kt(this,"domElement");Kt(this,"bindEventsOnBodyElement");Kt(this,"autoAdd");Kt(this,"scene");Kt(this,"mouse");Kt(this,"supportsPointerEvents");Kt(this,"interactiveObjects");Kt(this,"closestObject");Kt(this,"raycaster");Kt(this,"treatTouchEventsAsMouseEvents");Kt(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)});Kt(this,"add",(n,e=[])=>{if(n&&!this.interactiveObjects.find(t=>t.target===n))if(e.length>0)e.forEach(t=>{let r=n.getObjectByName(t);if(r){let i=new xB(r,t);this.interactiveObjects.push(i)}});else{let t=new xB(n,n.name);this.interactiveObjects.push(t)}});Kt(this,"remove",(n,e=[])=>{!n||(e.length>0?e.forEach(t=>{let r=n.getObjectByName(t);r&&(this.interactiveObjects=this.interactiveObjects.filter(i=>i.target!==r))}):this.interactiveObjects=this.interactiveObjects.filter(t=>t.target!==n))});Kt(this,"update",()=>{var r;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 n=(r=this.interactiveObjects.find(i=>i.intersected))!=null?r:null;if(n!=this.closestObject){if(this.closestObject){let i=new ha("mouseout");this.dispatch(this.closestObject,i)}if(n){let i=new ha("mouseover");this.dispatch(n,i)}this.closestObject=n}let e;this.interactiveObjects.forEach(i=>{!i.intersected&&i.wasIntersected&&(e||(e=new ha("mouseleave")),this.dispatch(i,e))});let t;this.interactiveObjects.forEach(i=>{i.intersected&&!i.wasIntersected&&(t||(t=new ha("mouseenter")),this.dispatch(i,t))})});Kt(this,"checkIntersection",n=>{let e=this.raycaster.intersectObjects([n.target],!0);if(n.wasIntersected=n.intersected,e.length>0){let t=e[0].distance;e.forEach(r=>{r.distance<t&&(t=r.distance)}),n.intersected=!0,n.distance=t}else n.intersected=!1});Kt(this,"onDocumentMouseMove",n=>{this.mapPositionToPoint(this.mouse,n.clientX,n.clientY);let e=new ha("mousemove",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"onDocumentPointerMove",n=>{this.mapPositionToPoint(this.mouse,n.clientX,n.clientY);let e=new ha("pointermove",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"onTouchMove",n=>{n.touches.length>0&&this.mapPositionToPoint(this.mouse,n.touches[0].clientX,n.touches[0].clientY);let e=new ha(this.treatTouchEventsAsMouseEvents?"mousemove":"touchmove",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"onMouseClick",n=>{this.update();let e=new ha("click",n);this.interactiveObjects.forEach(t=>{t.intersected&&this.dispatch(t,e)})});Kt(this,"onMouseDown",n=>{this.mapPositionToPoint(this.mouse,n.clientX,n.clientY),this.update();let e=new ha("mousedown",n);this.interactiveObjects.forEach(t=>{t.intersected?(t.wasIntersectedOnMouseDown=!0,this.dispatch(t,e)):t.wasIntersectedOnMouseDown=!1})});Kt(this,"onPointerDown",n=>{this.mapPositionToPoint(this.mouse,n.clientX,n.clientY),this.update();let e=new ha("pointerdown",n);this.interactiveObjects.forEach(t=>{t.intersected&&this.dispatch(t,e)})});Kt(this,"onTouchStart",n=>{n.touches.length>0&&this.mapPositionToPoint(this.mouse,n.touches[0].clientX,n.touches[0].clientY),this.update();let e=new ha(this.treatTouchEventsAsMouseEvents?"mousedown":"touchstart",n);this.interactiveObjects.forEach(t=>{t.intersected&&this.dispatch(t,e)})});Kt(this,"onMouseUp",n=>{let e=new ha("mouseup",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"onPointerUp",n=>{let e=new ha("pointerup",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"onTouchEnd",n=>{n.touches.length>0&&this.mapPositionToPoint(this.mouse,n.touches[0].clientX,n.touches[0].clientY),this.update();let e=new ha(this.treatTouchEventsAsMouseEvents?"mouseup":"touchend",n);this.interactiveObjects.forEach(t=>{this.dispatch(t,e)})});Kt(this,"dispatch",(n,e)=>{n.target&&!e.cancelBubble&&(e.coords=this.mouse,e.distance=n.distance,e.intersected=n.intersected,e.wasIntersected=n.wasIntersected,e.wasIntersectedOnMouseDown=n.wasIntersectedOnMouseDown,n.target.dispatchEvent(e))});Kt(this,"mapPositionToPoint",(n,e,t)=>{let r=this.renderer.domElement.getBoundingClientRect();n.x=(e-r.left)/r.width*2-1,n.y=-((t-r.top)/r.height)*2+1});this.renderer=n,this.camera=e,this.domElement=t,this.bindEventsOnBodyElement=r&&typeof r.bindEventsOnBodyElement<"u"?r.bindEventsOnBodyElement:!0,this.scene=r&&typeof r.scene<"u"?r.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=r&&typeof r.autoAdd<"u"?r.autoAdd:!1,this.autoAdd&&this.scene===null&&console.error("Attention: Options.scene needs to be set when using options.autoAdd"),this.mouse=new Ge(-1,1),this.supportsPointerEvents=!!window.PointerEvent,this.interactiveObjects=[],this.closestObject=null,this.raycaster=new fEe,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 $d=256,sLe="https://map.shuxitech.com/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}",Wg={west:101.852492,south:31.851389,east:103.347518,north:33.319796};function bB(n,e,t){const r=eu(2,t),i=Math.sin(e*Math.PI/180);return{x:(n+180)/360*r,y:(.5-Math.log((1+i)/(1-i))/(4*Math.PI))*r}}function SB(n,e,t){const r=eu(2,t),i=n/r*360-180,a=Math.PI-2*Math.PI*e/r,s=180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)));return[i,s]}function oLe(n,e){const t=bB(n.west,n.north,e),r=bB(n.east,n.south,e),i=Math.floor(t.x),a=Math.floor(r.x),s=Math.floor(t.y),o=Math.floor(r.y);return{zoom:e,minX:i,maxX:a,minY:s,maxY:o,cols:a-i+1,rows:o-s+1}}function lLe(n,e){const[t,r]=SB(n.minX,n.minY,n.zoom),[i,a]=SB(n.maxX+1,n.maxY+1,n.zoom),[s]=e([t,Wg.south]),[o]=e([i,Wg.south]),[,l]=e([Wg.west,r]),[,u]=e([Wg.west,a]);return{left:s,right:o,bottom:-u,top:-l}}function uLe(n,e){const{width:t,height:r}=e;n.save(),n.globalCompositeOperation="multiply",n.fillStyle="rgba(5, 24, 34, 0.22)",n.fillRect(0,0,t,r),n.globalCompositeOperation="screen";const i=n.createRadialGradient(t*.5,r*.48,t*.1,t*.5,r*.5,t*.72);i.addColorStop(0,"rgba(80, 230, 255, 0.16)"),i.addColorStop(1,"rgba(0, 18, 36, 0.03)"),n.fillStyle=i,n.fillRect(0,0,t,r),n.restore()}function cLe(n,e){const t=n.createLinearGradient(0,0,e.width,e.height);t.addColorStop(0,"#061927"),t.addColorStop(.5,"#0b2c3c"),t.addColorStop(1,"#07131f"),n.fillStyle=t,n.fillRect(0,0,e.width,e.height)}function hLe(n){return new Promise(e=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>e(t),t.onerror=()=>e(null),t.src=n})}function fLe(n,e,t){return sLe.replace("{x}",n).replace("{y}",e).replace("{z}",t)}function dLe(n,e,t,r){return $e(this,null,function*(){const i=[];n.save(),n.filter="brightness(0.92) contrast(1.22) saturate(1.06)";for(let a=r.minX;a<=r.maxX;a+=1)for(let s=r.minY;s<=r.maxY;s+=1)i.push(hLe(fLe(a,s,r.zoom)).then(o=>{o&&(n.drawImage(o,(a-r.minX)*$d,(s-r.minY)*$d,$d,$d),t.needsUpdate=!0)}));yield Promise.allSettled(i),n.restore(),uLe(n,e),t.needsUpdate=!0})}function pLe({geoProjectionCenter:n,geoProjectionScale:e,zoom:t=11}={}){const r=oLe(Wg,t),i=document.createElement("canvas");i.width=r.cols*$d,i.height=r.rows*$d;const a=i.getContext("2d");cLe(a,i);const s=new VR(i);s.colorSpace=Vn,s.wrapS=Ui,s.wrapT=Ui,s.minFilter=jr,s.magFilter=jr,s.needsUpdate=!0;const o=Tl().center(n).scale(e).translate([0,0]),l=lLe(r,o);return dLe(a,i,s,r).catch(u=>{console.warn("load satellite tiles failed:",u)}),{texture:s,uvBounds:l}}function wB(n,e){const t=e.right-e.left,r=e.top-e.bottom;n.mapGroup.traverse(i=>{var o,l;const a=(l=(o=i.geometry)==null?void 0:o.attributes)==null?void 0:l.position;if(!i.isMesh||!a)return;const s=new Float32Array(a.count*2);for(let u=0;u<a.count;u+=1){const c=a.getX(u),h=a.getY(u);s[u*2]=(c-e.left)/t,s[u*2+1]=(h-e.bottom)/r}i.geometry.setAttribute("uv",new br(s,2)),i.geometry.attributes.uv.needsUpdate=!0})}const gn={west:101.852492,south:31.851389,east:103.347518,north:33.319796},Eu={width:2400,height:2400},vLe=12;function gLe(n){return String(n).replace(/'/g,"''")}function Ji(n,e){return`${n} = '${gLe(e)}'`}const AB=[{name:"低地草甸类",fillColor:"#FFFFFF",strokeColor:"#FFFFFF"},{name:"莎草、杂类草型",fillColor:"#F67A7A",strokeColor:"#F67A7A"},{name:"山地草甸类",fillColor:"#FFFFFF",strokeColor:"#FFFFFF"},{name:"羊茅、杂类草型",fillColor:"#E69800",strokeColor:"#E69800"},{name:"早熟禾、杂类草型",fillColor:"#FFD380",strokeColor:"#FFD380"},{name:"垂穗披碱草型",fillColor:"#FFAA01",strokeColor:"#FFAA01"},{name:"苔草、杂类草型",fillColor:"#FFEBB0",strokeColor:"#FFEBB0"},{name:"委陵菜、杂类草型",fillColor:"#F5CA7B",strokeColor:"#F5CA7B"},{name:"披碱草型",fillColor:"#A87001",strokeColor:"#A87001"},{name:"高寒草甸类",fillColor:"#FFFFFF",strokeColor:"#FFFFFF"},{name:"矮生嵩草、杂类草型",fillColor:"#6CB3FF",strokeColor:"#6CB3FF"},{name:"矮生嵩草、圆穗蓼型",fillColor:"#00C7FF",strokeColor:"#00C7FF"},{name:"西藏嵩草、杂类草型",fillColor:"#8FE5FD",strokeColor:"#8FE5FD"},{name:"西藏嵩草、甘肃嵩草型",fillColor:"#7B8FED",strokeColor:"#7B8FED"},{name:"高山嵩草、矮生嵩草型",fillColor:"#71DDFE",strokeColor:"#71DDFE"},{name:"高山嵩草、苔草型",fillColor:"#7BB5F3",strokeColor:"#7BB5F3"},{name:"高山嵩草、杂类草型",fillColor:"#444E87",strokeColor:"#444E87"},{name:"具灌木的矮生嵩草型",fillColor:"#6873D1",strokeColor:"#6873D1"}].map((n,e)=>Ve(Le({},n),{key:`grassland-type-${e+1}`,cqlFilter:Ji("grass_min_type",n.name),rankingPropertyName:["area_code","acreage"],rankingTownCodeKeys:["area_code"],rankingAreaKeys:["acreage"]})),MB=[{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(n=>Ve(Le({},n),{selectable:!1})),ym={1:"一级",2:"二级",3:"三级",4:"四级",5:"五级",6:"六级",7:"七级",8:"八级"},eq=[{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(n=>Ve(Le({},n),{key:`grassland-level-${n.level}`,cqlFilter:`grassland_level IN ('${n.level}','${n.name}','${ym[n.level]}草原','${ym[n.level]}草地')`,rankingPropertyName:["area_code","acreage"],rankingTownCodeKeys:["area_code"],rankingAreaKeys:["acreage"],level:void 0})),mLe=eq.map(n=>{const e=n.key.replace("grassland-level-",""),t=n.name.replace("草原","湿地");return Ve(Le({},n),{key:`wetland-level-${e}`,name:t,cqlFilter:`grassland_level IN ('${e}','${t}','${n.name}','${ym[e]}湿地','${ym[e]}草原','${ym[e]}草地')`})}),yLe=[{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"}],zp=[{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"]}],Z1=[{key:"national-park",name:"若尔盖国家公园",color:"#8AE611",defaultLayerKey:"national-park-zoning"},{key:"restoration",name:"生态修复工程",color:"#33A3DC",defaultLayerKey:"restoration-projects"},{key:"engineering-analysis",name:"工程分析",color:"#24F6C4",defaultLayerKey:"engineering-analysis-projects"}],Q1={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:Ji("gjgyl_bhdj","1")},{key:"woodland-protection-level-2",name:"国家二级公益林",fillColor:"#2BD17E",strokeColor:"#2BD17E",cqlFilter:Ji("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:Ji("dlmc","灌木林地")},{key:"woodland-type-arbor",name:"乔木林地",fillColor:"#0DA368",strokeColor:"#0DA368",cqlFilter:Ji("dlmc","乔木林地")},{key:"woodland-type-swamp",name:"灌丛沼泽",fillColor:"#23C7B7",strokeColor:"#23C7B7",cqlFilter:Ji("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:Ji("zl_dj","2")},{key:"woodland-quality-3",name:"三级质量",fillColor:"#2BD17E",strokeColor:"#2BD17E",cqlFilter:Ji("zl_dj","3")},{key:"woodland-quality-4",name:"四级质量",fillColor:"#23C7B7",strokeColor:"#23C7B7",cqlFilter:Ji("zl_dj","4")},{key:"woodland-quality-5",name:"五级质量",fillColor:"#B7D96B",strokeColor:"#B7D96B",cqlFilter:Ji("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:Ji("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:yLe},{key:"grassland-level",name:"草原级",layerName:"ne:t_grassland_result_level_caodi",opacity:.82,legends:eq},{key:"grassland-type",name:"草原类型",layerName:"ne:t_grassland_result_grass_min_type_caodi",opacity:.82,legends:AB},{key:"grassland-yield",name:"草地产草量/生产力",layerName:"ne:t_grassland_result_yield_caodi",opacity:.82,legends:MB},{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:mLe},{key:"wetland-type",name:"湿地类型",layerName:"ne:t_grassland_result_grass_min_type_shidi",opacity:.82,legends:AB},{key:"wetland-yield",name:"湿地产草量/生产力",layerName:"ne:t_grassland_result_yield_shidi",opacity:.82,legends:MB}]},tq={"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:Ji("project_category","草地修复"),match:{field:"project_category",value:"草地修复"}},{key:"restoration-wetland",name:"湿地修复",fillColor:"#42C6DF",strokeColor:"#9CF7FF",cqlFilter:Ji("project_category","湿地修复"),match:{field:"project_category",value:"湿地修复"}},{key:"restoration-woodland",name:"林地修复",fillColor:"#1FB579",strokeColor:"#57F2A6",cqlFilter:Ji("project_category","林地修复"),match:{field:"project_category",value:"林地修复"}},{key:"restoration-linear",name:"线性设施",fillColor:"#F5C84B",strokeColor:"#FFE289",cqlFilter:Ji("feature_role","线性设施"),match:{field:"feature_role",value:"线性设施"}}]}],"engineering-analysis":[{key:"engineering-analysis-projects",name:"工程分析项目库",sourceType:"geojson",dataPath:"datas/ecological-protection/ecological_restoration_projects.geojson",opacity:.82,mapView:{targetLngLat:[102.58,32.72],distanceScale:.78,targetLocalZ:.72,duration:.85},legends:[{key:"analysis-project-grassland",name:"草地修复",fillColor:"#70D44B",strokeColor:"#B7FF6D",match:{field:"project_category",value:"草地修复"},selectable:!1},{key:"analysis-project-wetland",name:"湿地修复",fillColor:"#42C6DF",strokeColor:"#9CF7FF",match:{field:"project_category",value:"湿地修复"},selectable:!1},{key:"analysis-project-woodland",name:"林地修复",fillColor:"#1FB579",strokeColor:"#57F2A6",match:{field:"project_category",value:"林地修复"},selectable:!1},{key:"analysis-project-linear",name:"线性设施",fillColor:"#F5C84B",strokeColor:"#FFE289",match:{field:"feature_role",value:"线性设施"},selectable:!1}]}]},_Le=Le(Le({},Q1),tq),xLe=[...zp,...Z1];function $2(n){return xLe.find(e=>e.key===n)||zp[0]}function HS(n){return _Le[n]||[]}function fv(n,e){const t=HS(n);return t.find(r=>r.key===e)||t[0]}const bLe=12e3;function SLe(n,e={}){const t=new URLSearchParams;Object.entries(e).forEach(([i,a])=>{a!=null&&a!==""&&t.append(i,a)});const r=t.toString();return r?`${n}${n.includes("?")?"&":"?"}${r}`:n}function ol(t){return $e(this,arguments,function*(n,e={}){const u=e,{params:r,timeout:i=bLe}=u,a=iD(u,["params","timeout"]),s=new AbortController;let o=!1;const l=window.setTimeout(()=>{o=!0,s.abort()},i);try{const c=yield fetch(SLe(n,r),Ve(Le({credentials:"include"},a),{signal:s.signal,headers:Le({Accept:"application/json"},a.headers||{})}));if(!c.ok){const f=new Error(c.status===401?"用户未登录或授权已过期。":`HTTP ${c.status}`);throw f.code=`HTTP_${c.status}`,f.status=c.status,c.status===401&&uD(),f}const h=yield c.json();if((h==null?void 0:h.code)===401||(h==null?void 0:h.code)==="401"){const f=new Error((h==null?void 0:h.msg)||"用户未登录或授权已过期。");throw f.code="HTTP_401",f.status=401,uD(),f}return h}catch(c){if(s.signal.aborted||(c==null?void 0:c.name)==="AbortError"||/aborted/i.test((c==null?void 0:c.message)||"")){const f=new Error(o?"服务响应超时,请稍后再试。":"请求已取消,请重新发送。");throw f.code=o?"REQUEST_TIMEOUT":"REQUEST_ABORTED",f}throw c}finally{window.clearTimeout(l)}})}function Qt(n){return(n==null?void 0:n.data)!==void 0?n.data:(n==null?void 0:n.result)!==void 0?n.result:n}const t3="/geoserver/ne/wms",wLe={}.VITE_GEOSERVER_WFS_URL||t3.replace(/\/wms$/i,"/wfs");function n3(n,e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,i])=>{i!=null&&i!==""&&t.append(r,i)}),`${n}${n.includes("?")?"&":"?"}${t.toString()}`}function TB(n,e={}){const t=e.bounds||gn,r=e.size||Eu;return n3(e.url||t3,{service:"WMS",version:"1.1.1",request:"GetMap",layers:n.layerName,styles:n.styles||"",format:"image/png",transparent:!0,tiled:!0,srs:"EPSG:4326",bbox:[t.west,t.south,t.east,t.north].join(","),width:r.width,height:r.height,CQL_FILTER:e.cqlFilter||n.cqlFilter,_:Date.now()})}function ALe(n,e,t={}){var a,s;const r=t.bounds||gn,i=t.size||Eu;return n3(t.url||t3,{service:"WMS",version:"1.1.1",request:"GetFeatureInfo",layers:n.layerName,query_layers:n.layerName,styles:n.styles||"",info_format:"application/json",feature_count:5,srs:"EPSG:4326",bbox:[r.west,r.south,r.east,r.north].join(","),width:i.width,height:i.height,x:Math.round(e.x),y:Math.round(e.y),buffer:(s=(a=t.buffer)!=null?a:n.queryBuffer)!=null?s:8,CQL_FILTER:t.cqlFilter||n.cqlFilter})}function CB(r,i){return $e(this,arguments,function*(n,e,t={}){const a=ALe(n,e,t);return ol(a,{credentials:"include"})})}function MLe(n,e={}){return n3(e.url||wLe,{service:"WFS",version:e.version||"1.0.0",request:"GetFeature",typeName:n,outputFormat:"json",propertyName:Array.isArray(e.propertyName)?e.propertyName.join(","):e.propertyName,CQL_FILTER:e.cqlFilter,maxFeatures:e.maxFeatures||2e5})}function _0(t){return $e(this,arguments,function*(n,e={}){const r=MLe(n,e);return ol(r,{credentials:"include",timeout:e.timeout||2e4})})}function EB(n){var r;const e=(r=n==null?void 0:n.features)==null?void 0:r[0];if(!e)return null;const t=e.properties||{};return{id:e.id||t.gid||t.objectid||t.OBJECTID,properties:t,feature:e}}function PB(n){return n.sort((e,t)=>t.value-e.value),n}function sh(n){return String(n||"").replace(/\s+/g,"").trim()}function ar(n,e=0){const t=Number(n);return Number.isFinite(t)?t:e}function yu(n){return String(n!=null?n:"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function LB(n){return(n==null?void 0:n.scope)==="village"||(n==null?void 0:n.labelMode)==="village"}function f1(n){return(n==null?void 0:n.scope)==="trade-flow"||(n==null?void 0:n.labelMode)==="trade-flow"}function RB(n){return!!(n!=null&&n.hideTownNames||(n==null?void 0:n.showTownNames)===!1)}function d1(n){return["wkt-api","geojson","wfs"].includes(n==null?void 0:n.sourceType)}function DB(n){return n?/^https?:\/\//.test(n)||n.startsWith("/")?n:`./${n}`:""}function TLe(n){if(!n)return null;if(typeof n=="string")try{return JSON.parse(n)}catch(e){return console.warn("地图 GeoJSON 解析失败",e),null}return n}class CLe extends HPe{constructor(e,t,r={}){var i,a,s,o;super(e),this.geoProjectionCenter=[102.6305459723107,32.72169252326339],this.geoProjectionScale=650,this.tradeGeoProjectionCenter=[104,36],this.tradeGeoProjectionScale=11.4,this.tradeNationalDepth=.24,this.depth=.5,this.mapFocusLabelInfo={name:"红原县",enName:"HONGYUAN COUNTY",center:[102.6305459723107,32.08]},this.clicked=!1,this.scene.fog=new FR(1058614,1,50),this.scene.background=new xt(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 te(-.17427287762525134,13.678992786206543,20.688611202093714),this.defaultMapTarget=new te(0,0,0),this.activeMapViewTweens=[],this.interactionManager=new aLe(this.renderer.instance,this.camera.instance,this.canvas),this.assets=t,this.callbacks=r,this.topicLayerLoadId=0,this.visibleTopicLayers=[],this.mapAnimationComplete=!1,this.showTownRankingBars=!1,this.showTownRankingPointMarkers=!1,this.currentTownRanking=null,this.villageRankingGroup=null,this.villageRankingLabels=[],this.tradeFlowGroup=null,this.tradeFlowMeshGroup=null,this.tradeFlowLabelGroup=null,this.tradeFlowLabels=[],this.tradeFlowMaterials=[],this.tradeFlowPulseSprites=[],this.isTradeNationalMapActive=!1,this.selectedFeatureGroup=null,this.selectedVectorFeatures=[],this.analysisBoundaryFeature=null,this.analysisMatchedFeatures=[],this.boundaryDrawingEnabled=!1,this.boundaryDrawPoints=[],this.lastBoundaryDrawPoint=null,this.currentVectorFeatures=[],this.townMetaByName=new Map(_B.map(l=>[sh(l.name),l])),this.handleCanvasBoundaryPointerDown=this.handleCanvasBoundaryPointerDown.bind(this),this.handleCanvasBoundaryDoubleClick=this.handleCanvasBoundaryDoubleClick.bind(this),(a=(i=this.canvas)==null?void 0:i.addEventListener)==null||a.call(i,"pointerdown",this.handleCanvasBoundaryPointerDown,!0),(o=(s=this.canvas)==null?void 0:s.addEventListener)==null||o.call(s,"dblclick",this.handleCanvasBoundaryDoubleClick,!0),this.initEnvironment(),this.init()}init(){this.labelGroup=new kn,this.label3d=new KPe(this),this.labelGroup.rotation.x=-Math.PI/2,this.scene.add(this.labelGroup),this.flyLineFocusGroup=new kn,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=Mr.timeline({onComplete:()=>{this.mapAnimationComplete=!0,this.applyLayerMapView(this.currentTopicLayer,{force:!0}),this.setTradeNationalMapVisible(f1(this.currentTownRanking)),this.updateVillageRankingLabels(this.currentTownRanking),this.updateTradeFlowLayer(this.currentTownRanking)}});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(),this.setTradeNationalMapVisible(f1(this.currentTownRanking)),this.updateVillageRankingLabels(this.currentTownRanking),this.updateTradeFlowLayer(this.currentTownRanking)}},"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((r,i)=>{let a=r.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 r,i;this.flyLineFocusGroup.visible=!0,(i=(r=this.callbacks).onPlayComplete)==null||i.call(r)}},"focusMapOpacity"),this.showTownRankingBars&&(this.allBar.map((r,i)=>{e.to(r.scale,{duration:1,delay:.1*i,x:1,y:1,z:1,ease:"circ.out"},"bar")}),this.allBarMaterial.map((r,i)=>{e.to(r,{duration:1,delay:.1*i,opacity:1,ease:"circ.out"},"bar")}));const t=this;this.allProvinceLabel.map((r,i)=>{let a=r.element.querySelector(".provinces-label-wrap"),s=r.element.querySelector(".number .value"),o={progress:0};e.to(a,{duration:1,delay:.2*i,translateY:0,opacity:1,ease:"circ.out"},"bar"),e.to(o,{duration:1,delay:.2*i,progress:1,onStart:()=>{o.progress=0},onUpdate:l},"bar");function l(){var c,h;const u=ar((h=(c=r.userData)==null?void 0:c.targetValue)!=null?h:s.dataset.targetValue);s.innerText=t.formatMapRankingValue(u*o.progress)}}),this.showTownRankingBars&&this.allGuangquan.map((r,i)=>{e.to(r.children[0].scale,{duration:1,delay:.1*i,x:1,y:1,z:1,ease:"circ.out"},"bar"),e.to(r.children[1].scale,{duration:1,delay:.1*i,x:1,y:1,z:1,ease:"circ.out"},"bar")})}initEnvironment(){let e=new Ij(16777215,5);this.scene.add(e);let t=new xb(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 Dj(1924702,e.intensity,e.distance);t.position.set(e.x,e.y,e.z),this.scene.add(t)}createMap(){let e=new kn,t=new kn;this.mapGroup=e,this.focusMapGroup=t;let{china:r,chinaTopLine:i}=this.createChina(),{map:a,mapTop:s,mapLine:o}=this.createProvince();r.setParent(e),i.setParent(e),this.createDiffuse(),a.setParent(t),s.setParent(t),o.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"),r=new SE({color:new xt(e.chinaBgMaterialColor),transparent:!0,opacity:1}),i=new s1(this,{data:t,geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,merge:!0,material:r,renderOrder:2}),a=new Oo({color:e.lineColor}),s=new c1(this,{data:t,geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,material:a,renderOrder:3});return s.lineGroup.position.z+=.01,{china:i,chinaTopLine:s}}createTradeNationalMap(){var h;if(this.tradeNationalMapGroup)return!0;let e=null;try{e=this.assets.instance.getResource("chinaMap")}catch(f){return console.warn("牦牛交易全国地图资源未加载",f),!1}const t=TLe(e);if(!e||!((h=t==null?void 0:t.features)!=null&&h.length))return!1;const r=new kn;r.name="trade-national-map",r.visible=!1,r.rotation.x=-Math.PI/2,r.position.set(0,.04,0);const i=new Nn({color:403001,transparent:!0,opacity:.14,side:tr,depthWrite:!1,fog:!1});new s1(this,{data:e,geoProjectionCenter:this.tradeGeoProjectionCenter,geoProjectionScale:this.tradeGeoProjectionScale,position:new te(.05,-.05,-.03),material:i,renderOrder:17}).setParent(r);const{topMaterial:s,sideMaterial:o}=this.createTradeNationalMaterials(),l=new dB(this,{data:e,geoProjectionCenter:this.tradeGeoProjectionCenter,geoProjectionScale:this.tradeGeoProjectionScale,position:new te(0,0,0),depth:this.tradeNationalDepth,topFaceMaterial:s,sideMaterial:o,renderOrder:20,bevelThickness:.024,bevelSegments:1});l.mapGroup.traverse(f=>{f.isMesh&&(f.renderOrder=20)}),l.setParent(r);const u=new Oo({color:4777983,transparent:!0,opacity:.52,fog:!1,depthTest:!1}),c=new c1(this,{data:e,geoProjectionCenter:this.tradeGeoProjectionCenter,geoProjectionScale:this.tradeGeoProjectionScale,material:u,renderOrder:21});return c.lineGroup.position.z+=this.tradeNationalDepth+.055,c.setParent(r),this.scene.add(r),this.tradeNationalMapGroup=r,this.createTradeNationalLabels(t),!0}createTradeNationalMaterials(){const e=new kh({color:16777215,transparent:!0,opacity:.54,roughness:.84,metalness:.08,side:tr,fog:!1});new h1(e,{uColor1:827317,uColor2:403515,size:6.8,dir:"x"});const t=this.assets.instance.getResource("side").clone();t.wrapS=hi,t.wrapT=hi,t.repeat.set(1,1.2),t.needsUpdate=!0;const r=new kh({color:1485501,map:t,transparent:!0,opacity:.58,roughness:.78,metalness:.04,side:tr,fog:!1});return new h1(r,{uColor1:1354174,uColor2:134940,size:Math.max(this.tradeNationalDepth,.1),dir:"y"}),this.time.on("tick",()=>{t.offset.y+=.004}),{topMaterial:e,sideMaterial:r}}createTradeNationalLabels(e){this.tradeNationalLabelGroup=new kn,this.tradeNationalLabelGroup.name="trade-national-label",this.tradeNationalLabelGroup.rotation.x=-Math.PI/2,this.tradeNationalLabelGroup.visible=!1,this.scene.add(this.tradeNationalLabelGroup),this.tradeNationalLabels=[];const t=new Set(["四川","青海","甘肃","陕西","重庆","云南","西藏","新疆"]);(e.features||[]).forEach(r=>{var l;const i=((l=r.properties)==null?void 0:l.name)||"",a=this.normalizeTradeProvinceName(i);if(!t.has(a))return;const s=this.getFeatureCenterLngLat(r);if(!s)return;const o=this.label3d.create("","trade-national-label",!0);o.init(`<div class="trade-national-name">${yu(a)}</div>`,this.getTradeLocalPoint(s.lng,s.lat,.82)),this.label3d.setLabelStyle(o,.012,"x"),o.setParent(this.tradeNationalLabelGroup),o.visible=!0,this.tradeNationalLabels.push(o)})}normalizeTradeProvinceName(e=""){return String(e).replace(/省|市|自治区|壮族|回族|维吾尔|特别行政区/g,"").trim()}getFeatureCenterLngLat(e){var a,s,o;const t=((a=e==null?void 0:e.properties)==null?void 0:a.cp)||((s=e==null?void 0:e.properties)==null?void 0:s.centroid)||((o=e==null?void 0:e.properties)==null?void 0:o.center);if(Array.isArray(t)&&Number.isFinite(Number(t[0]))&&Number.isFinite(Number(t[1])))return{lng:Number(t[0]),lat:Number(t[1])};const r=this.getGeometryCoordinateList(e==null?void 0:e.geometry);if(!r.length)return null;const i=r.reduce((l,u)=>({minLng:Math.min(l.minLng,Number(u[0])),maxLng:Math.max(l.maxLng,Number(u[0])),minLat:Math.min(l.minLat,Number(u[1])),maxLat:Math.max(l.maxLat,Number(u[1]))}),{minLng:1/0,maxLng:-1/0,minLat:1/0,maxLat:-1/0});return{lng:(i.minLng+i.maxLng)/2,lat:(i.minLat+i.maxLat)/2}}createProvince(){let e=this.assets.instance.getResource("mapJson");this.mapJsonData=e;const t=pLe({geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,zoom:vLe});this.enhanceTexture(t.texture);let[r,i]=this.createProvinceMaterial();this.focusMapTopMaterial=r,this.focusMapSideMaterial=i;let a=new dB(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new te(0,0,.11),data:e,depth:this.depth,topFaceMaterial:r,sideMaterial:i,renderOrder:9}),s=new kh({color:16777215,map:t.texture,transparent:!0,opacity:.9,roughness:.9});new h1(s,{uColor1:1227744,uColor2:38069}),this.defaultMaterial=s,this.defaultLightMaterial=this.defaultMaterial.clone(),this.defaultLightMaterial.color=new xt("rgba(115,208,255,1)"),this.defaultLightMaterial.opacity=.8;let o=new s1(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new te(0,0,this.depth+.22),data:e,material:s,renderOrder:8});wB(o,t.uvBounds),o.mapGroup.children.map(u=>{u.children.map(c=>{c.type==="Mesh"&&this.eventElement.push(c)})}),this.mapLineMaterial=new Oo({color:16777215,opacity:0,transparent:!0,fog:!1});let l=new c1(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:o,mapLine:l}}createTopicLayer(){if(!this.mapJsonData)return;const e=document.createElement("canvas");e.width=Eu.width,e.height=Eu.height;const t=e.getContext("2d");t.clearRect(0,0,e.width,e.height);const r=new VR(e);r.colorSpace=Vn,r.wrapS=Ui,r.wrapT=Ui,r.minFilter=jr,r.magFilter=jr,this.enhanceTexture(r),r.needsUpdate=!0;const i=new Nn({map:r,transparent:!0,opacity:0,depthWrite:!1,side:tr,fog:!1}),a=new s1(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new te(0,0,this.depth+.255),data:this.mapJsonData,material:i,renderOrder:18});wB(a,this.createLayerUvBounds()),a.setParent(this.focusMapGroup),this.topicLayerCanvas=e,this.topicLayerContext=t,this.topicLayerTexture=r,this.topicLayerMaterial=i,this.topicLayerMap=a}createSelectedFeatureGroup(){var e;this.selectedFeatureGroup||(this.selectedFeatureGroup=new kn,this.selectedFeatureGroup.name="selected-feature-highlight",this.selectedFeatureGroup.position.z=this.depth+.31,(e=this.focusMapGroup)==null||e.add(this.selectedFeatureGroup))}createLayerUvBounds(){const e=Tl().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0]),[t]=e([gn.west,gn.south]),[r]=e([gn.east,gn.south]),[,i]=e([gn.west,gn.north]),[,a]=e([gn.west,gn.south]);return{left:t,right:r,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(this.currentVectorFeatures=[],this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(a=(i=this.callbacks).onLayerStatus)==null||a.call(i,{type:"loading",text:`正在加载 ${e.name}`}),d1(e)){this.loadVectorTopicLayer(e,t);return}const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{var s,o,l;t===this.topicLayerLoadId&&(this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerContext.drawImage(r,0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=(s=e.opacity)!=null?s:.84,(l=(o=this.callbacks).onLayerStatus)==null||l.call(o,{type:"success",text:"GeoServer 图层已加载"}))},r.onerror=()=>{var s,o;t===this.topicLayerLoadId&&(this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(o=(s=this.callbacks).onLayerStatus)==null||o.call(s,{type:"error",text:"GeoServer 图层加载失败"}))},r.src=TB(e)}setTopicLayers(e=[],t=e[0]){var s,o,l,u;if(!this.topicLayerContext||!this.topicLayerTexture)return;const r=e.filter(Boolean);if(!r.length){this.topicLayerLoadId+=1,this.visibleTopicLayers=[],this.currentTopicLayer=null,this.currentVectorFeatures=[],this.clearSelectedFeature(),this.applyLayerMapView(null),this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(o=(s=this.callbacks).onLayerStatus)==null||o.call(s,{type:"success",text:"图层已关闭"});return}if(r.length===1){this.setTopicLayer(Le(Le({},r[0]),(t==null?void 0:t.key)===r[0].key?t:{}));return}this.currentTopicLayer=t||r[r.length-1],this.visibleTopicLayers=r,this.clearSelectedFeature(),this.applyLayerMapView(this.currentTopicLayer);const i=++this.topicLayerLoadId;this.currentVectorFeatures=[],this.topicLayerContext.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),this.topicLayerTexture.needsUpdate=!0,this.topicLayerMaterial.opacity=0,(u=(l=this.callbacks).onLayerStatus)==null||u.call(l,{type:"loading",text:`正在加载 ${r.length} 个林地图层`});const a=r.filter(c=>!d1(c));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 r=new Image;r.crossOrigin="anonymous",r.onload=()=>t({image:r,layer:e}),r.onerror=()=>t(null),r.src=TB(e)})}applyLayerMapView(e,t={}){var o,l;if(!((o=this.camera)!=null&&o.instance)||!((l=this.camera)!=null&&l.controls)||!this.mapAnimationComplete&&!t.force)return;const r=(e==null?void 0:e.mapView)||(e!=null&&e.cameraPosition?{cameraPosition:e.cameraPosition}:null),i=r?this.getLayerMapViewTarget(r):this.defaultMapTarget.clone(),a=r?this.getLayerMapViewCameraPosition(r,i):this.defaultMapCameraPosition.clone(),s=r&&Number.isFinite(r.duration)?r.duration:.75;this.animateMapCamera(a,i,s)}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 r=Number.isFinite(e==null?void 0:e.distanceScale)?e.distanceScale:1,i=this.defaultMapCameraPosition.clone().sub(this.defaultMapTarget).multiplyScalar(r),a=t.clone().add(i);return e!=null&&e.cameraOffset&&a.add(this.toVector3(e.cameraOffset,new te(0,0,0))),a}lngLatToWorldPoint(e,t=0){const r=Array.isArray(e)?e:[e==null?void 0:e.lng,e==null?void 0:e.lat],i=Number(r==null?void 0:r[0]),a=Number(r==null?void 0:r[1]);if(!Number.isFinite(i)||!Number.isFinite(a))return this.defaultMapTarget.clone();const[s,o]=this.geoProjection([i,a]),l=new te(s,-o,Number(t)||0);return this.focusMapGroup?this.focusMapGroup.localToWorld(l):l}toVector3(e,t){if(Array.isArray(e)){const[s,o,l]=e.map(Number);return[s,o,l].every(Number.isFinite)?new te(s,o,l):t.clone()}const r=Number(e==null?void 0:e.x),i=Number(e==null?void 0:e.y),a=Number(e==null?void 0:e.z);return[r,i,a].every(Number.isFinite)?new te(r,i,a):t.clone()}animateMapCamera(e,t,r=.75){this.activeMapViewTweens.forEach(s=>{var o;return(o=s==null?void 0:s.kill)==null?void 0:o.call(s)}),this.activeMapViewTweens=[];const i=this.camera.controls,a=()=>i.update();this.activeMapViewTweens.push(Mr.to(this.camera.instance.position,{duration:r,x:e.x,y:e.y,z:e.z,ease:"power2.out",onUpdate:a}),Mr.to(i.target,{duration:r,x:t.x,y:t.y,z:t.z,ease:"power2.out",onUpdate:a}))}focusTownByName(e,t={}){var s,o,l;const r=this.townMetaByName.get(sh(e));if(!(r!=null&&r.center))return!1;const i=this.lngLatToWorldPoint(r.center,(s=t.targetLocalZ)!=null?s:.82),a=this.getLayerMapViewCameraPosition({distanceScale:(o=t.distanceScale)!=null?o:.82,cameraOffset:t.cameraOffset||{x:0,y:1.2,z:0}},i);return this.animateMapCamera(a,i,(l=t.duration)!=null?l:.75),!0}loadVectorTopicLayer(e,t){return $e(this,null,function*(){var r,i,a,s,o;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=(r=e.opacity)!=null?r:.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,(o=(s=this.callbacks).onLayerStatus)==null||o.call(s,{type:"error",text:"真实矢量图层加载失败"})}})}fetchVectorLayerGeojson(e){return $e(this,null,function*(){var r;if(e.sourceType==="geojson"){if(((r=e.geojsonData)==null?void 0:r.type)==="FeatureCollection")return e.geojsonData;const i=yield fetch(DB(e.dataPath),{credentials:"include"});if(!i.ok)throw new Error(`HTTP ${i.status}`);return yield i.json()}if(e.sourceType==="wfs"){const i=yield _0(e.layerName,{cqlFilter:e.cqlFilter,maxFeatures:e.maxFeatures||1200,timeout:e.timeout||18e3});return(i==null?void 0:i.type)==="FeatureCollection"?i:{type:"FeatureCollection",features:(i==null?void 0:i.features)||[]}}let t=[];try{const i=yield fetch(e.apiUrl,{credentials:"include"});if(!i.ok)throw new Error(`HTTP ${i.status}`);const a=yield i.json();t=Array.isArray(a==null?void 0:a.data)?a.data:[]}catch(i){const a=yield fetch(DB(e.fallbackPath),{credentials:"include"});if(!a.ok)throw i;const s=yield a.json();t=Array.isArray(s==null?void 0:s.rows)?s.rows:[]}return{type:"FeatureCollection",features:t.map(i=>({type:"Feature",properties:{id:i.id,type:i.type,totalAcreage:i.totalAcreage,cdAcreage:i.cdAcreage,sdAcreage:i.sdAcreage,cdScl:i.cdScl,sdScl:i.sdScl},geometry:this.parseWktGeometry(i.wkt)})).filter(i=>i.geometry)}})}drawVectorTopicLayer(e,t){const r=this.topicLayerContext;r.clearRect(0,0,this.topicLayerCanvas.width,this.topicLayerCanvas.height),r.save(),r.lineJoin="round",r.lineCap="round",this.clipVectorLayerContext(r,e),this.getVisibleVectorFeatures(e,t).sort((s,o)=>{var c,h;const l=this.getGeometryDrawRank((c=s.geometry)==null?void 0:c.type),u=this.getGeometryDrawRank((h=o.geometry)==null?void 0:h.type);return l-u}).forEach(s=>{const o=this.getVectorFeatureStyle(e,s);this.drawVectorFeature(r,s.geometry,o)}),this.drawSelectedVectorOverlay(r),r.restore()}drawSelectedVectorOverlay(e){const t=this.selectedVectorFeatures||[],r=this.analysisMatchedFeatures||[],i=this.analysisBoundaryFeature,a=this.boundaryDrawPoints||[];if(!t.length&&!r.length&&!i&&!a.length)return;const s={fill:"#FFE15A",stroke:"#24F6C4",polygonAlpha:.24,lineAlpha:.98,lineWidth:12,pointRadius:9,glow:!0},o={fill:"#FFF06A",stroke:"#FFFDF2",polygonAlpha:.46,lineAlpha:1,lineWidth:5,pointRadius:6,glow:!1};if(e.save(),t.forEach(l=>{var c;const u=(l==null?void 0:l.geometry)||((c=l==null?void 0:l.feature)==null?void 0:c.geometry);this.drawVectorFeature(e,u,s),this.drawVectorFeature(e,u,o)}),r.forEach(l=>{var c;const u=(l==null?void 0:l.geometry)||((c=l==null?void 0:l.feature)==null?void 0:c.geometry);this.drawVectorFeature(e,u,{fill:"#FF8A3D",stroke:"#FFE15A",polygonAlpha:.28,lineAlpha:.98,lineWidth:5,pointRadius:6,glow:!0})}),i!=null&&i.geometry&&this.drawVectorFeature(e,i.geometry,{fill:"#24F6C4",stroke:"#FFFFFF",polygonAlpha:.18,lineAlpha:1,lineWidth:4,pointRadius:6,glow:!0}),a.length){const l=a.map(c=>[c.lng,c.lat]),u={type:"LineString",coordinates:this.boundaryDrawingEnabled?l:[...l,l[0]].filter(Boolean)};this.drawVectorFeature(e,u,{fill:"#24F6C4",stroke:"#24F6C4",polygonAlpha:.12,lineAlpha:1,lineWidth:4,pointRadius:6,glow:!0}),l.forEach(c=>{this.drawVectorFeature(e,{type:"Point",coordinates:c},{fill:"#FFFFFF",stroke:"#24F6C4",polygonAlpha:.2,lineAlpha:1,lineWidth:3,pointRadius:5.5,glow:!0})})}e.restore()}redrawVectorTopicLayer(){!this.topicLayerContext||!this.topicLayerTexture||!this.currentTopicLayer||!d1(this.currentTopicLayer)||(this.drawVectorTopicLayer(this.currentTopicLayer,this.currentVectorFeatures||[]),this.topicLayerTexture.needsUpdate=!0)}getVisibleVectorFeatures(e,t){const r=e==null?void 0:e.activeLegend,i=r==null?void 0:r.match;if(i!=null&&i.field)return(t||[]).filter(o=>{var l,u;return String((u=(l=o==null?void 0:o.properties)==null?void 0:l[i.field])!=null?u:"")===String(i.value)});const s=String((e==null?void 0:e.cqlFilter)||"").trim().match(/^([a-zA-Z0-9_]+)\s*=\s*'((?:''|[^'])*)'$/);if(s){const[,o,l]=s,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[o])!=null?f:"")===u})}return[...t||[]]}clipVectorLayerContext(e,t){const r=this.getLayerClipBounds(t);if(!r)return;const i=this.lngLatToLayerCanvasPoint([r.west,r.north]),a=this.lngLatToLayerCanvasPoint([r.east,r.south]),s=Math.min(i.x,a.x),o=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(s,o,l,u),e.clip())}getLayerClipBounds(e){const t=e==null?void 0:e.clipBounds;if(!t)return null;const r=Math.max(Number(t.west),gn.west),i=Math.max(Number(t.south),gn.south),a=Math.min(Number(t.east),gn.east),s=Math.min(Number(t.north),gn.north);return![r,i,a,s].every(Number.isFinite)||r>=a||i>=s?null:{west:r,south:i,east:a,north:s}}getGeometryDrawRank(e){return String(e).includes("Polygon")?1:String(e).includes("LineString")?2:3}getVectorFeatureStyle(e,t){var l,u,c;const r=t.properties||{},a=(e.legends||[]).find(h=>{var d;const f=h.match;return f?String((d=r[f.field])!=null?d:"")===String(f.value):!1})||((l=e.legends)==null?void 0:l[0])||{},s=String(((u=t.geometry)==null?void 0:u.type)||"").includes("LineString"),o=((c=t.geometry)==null?void 0:c.type)==="Point";return(e==null?void 0:e.key)==="yak-epidemic-village-boundary"?{fill:a.fillColor||"#24F6C4",stroke:a.strokeColor||"#FFF06A",polygonAlpha:.16,lineAlpha:1,lineWidth:5,pointRadius:4.5,glow:!0}:{fill:s||o?a.strokeColor||a.fillColor||"#30DCFF":a.fillColor||"#30DCFF",stroke:a.strokeColor||a.fillColor||"#30DCFF",polygonAlpha:.36,lineAlpha:s?.92:.9,lineWidth:s?5:2.4,pointRadius:o?this.getVectorPointRadius(e,t):4.5,glow:!0}}getVectorPointRadius(e,t){var i,a;const r=Number(((i=t==null?void 0:t.properties)==null?void 0:i.count)||((a=t==null?void 0:t.properties)==null?void 0:a.value)||0);return(e==null?void 0:e.key)==="yak-recognition-layer"?Math.max(3.8,Math.min(8.6,3.6+Math.sqrt(r)/68)):4.5}drawVectorFeature(e,t,r){if(t!=null&&t.coordinates){if(t.type==="Polygon"){this.drawPolygonPath(e,t.coordinates,r);return}if(t.type==="MultiPolygon"){t.coordinates.forEach(i=>this.drawPolygonPath(e,i,r));return}if(t.type==="LineString"){this.drawLinePath(e,t.coordinates,r);return}if(t.type==="MultiLineString"){t.coordinates.forEach(i=>this.drawLinePath(e,i,r));return}t.type==="Point"&&this.drawPointPath(e,t.coordinates,r)}}drawPolygonPath(e,t,r){Array.isArray(t==null?void 0:t[0])&&(e.save(),e.beginPath(),t.forEach(i=>{i.forEach((a,s)=>{const o=this.lngLatToLayerCanvasPoint(a);s===0?e.moveTo(o.x,o.y):e.lineTo(o.x,o.y)}),e.closePath()}),e.fillStyle=this.hexToRgba(r.fill,r.polygonAlpha),e.strokeStyle=this.hexToRgba(r.stroke,r.lineAlpha),e.lineWidth=r.lineWidth,r.glow&&(e.shadowColor=r.stroke,e.shadowBlur=14),e.fill("evenodd"),e.stroke(),e.restore())}drawLinePath(e,t,r){!Array.isArray(t)||t.length<2||(e.save(),e.beginPath(),t.forEach((i,a)=>{const s=this.lngLatToLayerCanvasPoint(i);a===0?e.moveTo(s.x,s.y):e.lineTo(s.x,s.y)}),e.strokeStyle=this.hexToRgba(r.stroke,r.lineAlpha),e.lineWidth=r.lineWidth,e.shadowColor=r.stroke,e.shadowBlur=12,e.stroke(),e.restore())}drawPointPath(e,t,r){const i=this.lngLatToLayerCanvasPoint(t);e.save(),e.beginPath(),e.arc(i.x,i.y,r.pointRadius,0,Math.PI*2),e.fillStyle=this.hexToRgba(r.fill,.88),e.shadowColor=r.stroke,e.shadowBlur=12,e.fill(),e.restore()}lngLatToLayerCanvasPoint(e){const t=Number(e==null?void 0:e[0]),r=Number(e==null?void 0:e[1]);return{x:(t-gn.west)/(gn.east-gn.west)*this.topicLayerCanvas.width,y:(gn.north-r)/(gn.north-gn.south)*this.topicLayerCanvas.height}}hexToRgba(e,t=1){const r=String(e||"#30DCFF").replace("#",""),i=r.length===3?r.split("").map(u=>u+u).join(""):r,a=Number.parseInt(i,16);if(!Number.isFinite(a))return`rgba(48, 220, 255, ${t})`;const s=a>>16&255,o=a>>8&255,l=a&255;return`rgba(${s}, ${o}, ${l}, ${t})`}parseWktGeometry(e){var s;const t=String(e||"").trim();if(!t)return null;const r=t.match(/^([A-Z]+)(?:\s+[A-Z]+)?\s*\(/i),i=(s=r==null?void 0:r[1])==null?void 0:s.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(),r=t.startsWith("(")&&t.endsWith(")")?t.slice(1,-1):t,i=[];let a=0,s=-1;for(let o=0;o<r.length;o+=1){const l=r[o];l==="("?(a===0&&(s=o),a+=1):l===")"&&(a-=1,a===0&&s>=0&&(i.push(r.slice(s,o+1)),s=-1))}return i.length?i:[r]}parseWktRing(e){return String(e||"").replace(/^\(+|\)+$/g,"").split(",").map(r=>r.trim().split(/\s+/).slice(0,2).map(Number)).filter(([r,i])=>Number.isFinite(r)&&Number.isFinite(i))}createProvinceMaterial(){let e=new SE({color:16777215,transparent:!0,opacity:0,fog:!1,side:tr});e.onBeforeCompile=i=>{i.uniforms=Ve(Le({},i.uniforms),{uColor1:{value:new xt(2780818)},uColor2:{value:new xt(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 <opaque_fragment>",`
#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=hi,t.wrapT=hi,t.repeat.set(1,1.5),t.offset.y+=.065;let r=new kh({color:16777215,map:t,fog:!1,opacity:0,side:tr});return this.time.on("tick",()=>{t.offset.y+=.005}),r.onBeforeCompile=i=>{i.uniforms=Ve(Le({},i.uniforms),{uColor1:{value:new xt(2780818)},uColor2:{value:new xt(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 <opaque_fragment>",`
#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,r]}getDefaultTownRanking(){return{title:"乡镇统计加载中",unit:"",rows:_B.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)||"",hideTownNames:RB(e)}}getTownRankingRows(e=this.currentTownRanking,t=7,r=!0){var l;const i=this.getDefaultTownRanking(),a=(l=e==null?void 0:e.rows)!=null&&l.length?e.rows:r?i.rows:[],s=this.getTownRankingMeta(e),o=a.map(u=>{const c=this.townMetaByName.get(sh(u.name));return c?Ve(Le(Le({},c),u),{name:c.name,enName:c.enName,center:c.center,centroid:c.centroid,value:ar(u.value),unit:u.unit||s.unit,metricTitle:s.title}):null}).filter(Boolean).sort((u,c)=>c.value-u.value).map((u,c)=>Ve(Le({},u),{rank:c+1}));return Number.isFinite(t)?o.slice(0,t):o}getVillageRankingRows(e=this.currentTownRanking){const t=this.getTownRankingMeta(e);return((e==null?void 0:e.rows)||[]).map((r,i)=>{var u,c,h,f,d,p,g,v;const a=ar((u=r.lng)!=null?u:r.longitude,NaN),s=ar((c=r.lat)!=null?c:r.latitude,NaN);if(!Number.isFinite(a)||!Number.isFinite(s))return null;const o=ar((h=r.displayValue)!=null?h:r.value),l=ar((p=(d=(f=r.rawValue)!=null?f:r.earTagCount)!=null?d:r.ear_tag_count)!=null?p:r.value);return Ve(Le({},r),{key:r.key||`${r.town||""}-${r.village||r.name||i}`,name:r.name||r.village||`村${i+1}`,town:r.town||"",lng:a,lat:s,value:o,rawValue:l,recordCount:ar((g=r.recordCount)!=null?g:r.record_count,0),imageRate:ar((v=r.imageRate)!=null?v:r.image_rate,0),unit:r.displayUnit||r.unit||t.unit,metricTitle:t.title,metricLabel:r.metricLabel||t.metricLabel||""})}).filter(Boolean).sort((r,i)=>i.rawValue-r.rawValue).map((r,i)=>Ve(Le({},r),{rank:i+1}))}getVillageRankingHtml(e,t){const r=t.hideTownNames?"":`<span>${yu(e.town||"红原县")}</span>`;return`<div class="epidemic-village-card ${e.rank>8?"is-small":""}">
<div class="village-card-head">
<strong>${yu(e.name)}</strong>
${r}
</div>
<div class="village-card-body">
<span class="metric">${yu(e.metricLabel||"防疫")}</span>
<span class="number">${this.formatMapRankingValue(e.value)}</span>
<span class="unit">${yu(e.unit||t.unit||"")}</span>
</div>
<div class="village-card-foot">
<span>台账 ${this.formatMapCompactValue(e.recordCount)}条</span>
<span>耳标 ${this.formatMapCompactValue(e.rawValue)}头</span>
</div>
</div>`}ensureVillageRankingGroup(){this.villageRankingGroup||(this.villageRankingGroup=new kn,this.villageRankingGroup.rotation.x=-Math.PI/2,this.villageRankingGroup.visible=!1,this.scene.add(this.villageRankingGroup),this.villageRankingLabels=[])}hideVillageRankingLabels(){var e;this.villageRankingGroup&&(this.villageRankingGroup.visible=!1),(e=this.villageRankingLabels)==null||e.forEach(t=>{t.visible=!1})}setTownNameLabelsVisible(e=!0){var t;(t=this.townNameLabels)==null||t.forEach(r=>{r.visible=e})}updateVillageRankingLabels(e=this.currentTownRanking){if(this.ensureVillageRankingGroup(),!LB(e)){this.hideVillageRankingLabels();return}const t=this.getVillageRankingRows(e),r=this.getTownRankingMeta(e);if(!t.length){this.hideVillageRankingLabels();return}this.villageRankingGroup.visible=this.mapAnimationComplete,t.forEach((i,a)=>{let s=this.villageRankingLabels[a];s||(s=this.label3d.create("","epidemic-village-label",!0),this.label3d.setLabelStyle(s,.0135,"x"),s.setParent(this.villageRankingGroup),this.villageRankingLabels.push(s));const[o,l]=this.geoProjection([i.lng,i.lat]),u=(a%3-1)*.06,c=Math.floor(a/3)%2*.04;s.init(this.getVillageRankingHtml(i,r),new te(o+u,-l+c,this.depth+1.55+Math.min(a,6)*.015)),s.visible=!0,s.userData=Le({},i)}),this.villageRankingLabels.slice(t.length).forEach(i=>{i.visible=!1})}ensureTradeFlowGroup(){this.tradeFlowGroup||(this.tradeFlowGroup=new kn,this.tradeFlowGroup.name="yak-trade-flow",this.tradeFlowGroup.visible=!1,this.tradeFlowMeshGroup=new kn,this.tradeFlowMeshGroup.name="yak-trade-flow-mesh",this.tradeFlowMeshGroup.rotation.x=-Math.PI/2,this.tradeFlowLabelGroup=new kn,this.tradeFlowLabelGroup.name="yak-trade-flow-label",this.tradeFlowLabelGroup.rotation.x=-Math.PI/2,this.tradeFlowGroup.add(this.tradeFlowMeshGroup,this.tradeFlowLabelGroup),this.scene.add(this.tradeFlowGroup))}hideTradeFlowLayer(){var e,t;this.tradeFlowGroup&&(this.tradeFlowGroup.visible=!1),(e=this.tradeFlowLabels)==null||e.forEach(r=>{r.visible=!1}),(t=this.tradeFlowPulseSprites)==null||t.forEach(r=>{r.visible=!1})}clearTradeFlowLayer(){this.tradeFlowMeshGroup&&(this.tradeFlowMeshGroup.children.forEach(e=>{var t;(t=e.traverse)==null||t.call(e,r=>this.disposeObject3D(r))}),this.tradeFlowMeshGroup.clear(),this.tradeFlowMaterials=[],this.tradeFlowPulseSprites=[])}getTradeFlowSource(e=this.currentTownRanking){var a,s,o,l;const t=(e==null?void 0:e.source)||{},r=ar((a=t.lng)!=null?a:t.longitude,NaN),i=ar((s=t.lat)!=null?s:t.latitude,NaN);return!Number.isFinite(r)||!Number.isFinite(i)?null:{name:t.name||"红原牦牛交易市场",lng:r,lat:i,total:ar((l=(o=t.total)!=null?o:t.headCount)!=null?l:t.value,NaN)}}getTradeFlowRows(e=this.currentTownRanking){const t=this.getTownRankingMeta(e);return((e==null?void 0:e.rows)||[]).map((r,i)=>{var l,u,c,h,f,d;const a=ar((l=r.lng)!=null?l:r.longitude,NaN),s=ar((u=r.lat)!=null?u:r.latitude,NaN),o=ar((f=(h=(c=r.headCount)!=null?c:r.head_count)!=null?h:r.rawValue)!=null?f:r.value);return!Number.isFinite(a)||!Number.isFinite(s)||!Number.isFinite(o)?null:Ve(Le({},r),{key:r.key||`${r.name||r.destRegion||"trade-flow"}-${i}`,name:r.name||r.destRegion||r.destination||`流向${i+1}`,lng:a,lat:s,labelSide:r.labelSide||r.label_side||"",value:o,headCount:o,recordCount:ar((d=r.recordCount)!=null?d:r.record_count,0),unit:r.unit||t.unit||"头"})}).filter(Boolean).sort((r,i)=>i.value-r.value).map((r,i)=>Ve(Le({},r),{rank:i+1}))}getTradeMarketHtml(e,t){const r=Number.isFinite(e.total)?e.total:t.reduce((i,a)=>i+ar(a.value),0);return`<div class="trade-market-card">
<div class="market-title">${yu(e.name)}</div>
<div class="market-total"><span>${this.formatMapIntegerValue(r)}</span><em>头</em></div>
</div>`}getTradeFlowDisplayName(e=""){const t=String(e||"").replace(/维吾尔自治区|壮族自治区|回族自治区|自治区|特别行政区|省|市|区|县|镇|乡|街道/g,"").replace(/\s+/g,""),r=t.match(/[\u4e00-\u9fa5]{2,8}/g)||[],i=r.length?r[r.length-1]:t;return i.length>7?`${i.slice(0,7)}…`:i||"目的地"}getTradeFlowLabelHtml(e){return`<div class="trade-flow-card${e.labelSide?` is-${String(e.labelSide).replace(/[^a-z0-9-]/gi,"")}`:""}">
<div class="flow-head"><span>${String(e.rank).padStart(2,"0")}</span><strong>${yu(this.getTradeFlowDisplayName(e.name))}</strong></div>
<div class="flow-body"><em>${this.formatMapIntegerValue(e.value)}</em><b>${yu(e.unit||"头")}</b></div>
</div>`}getTradeFlowLabelOffset(e,t){return{left:new te(-1.12,.18+t%2*.16,0),right:new te(1.04,.16-t%2*.14,0),top:new te(-.44+t%2*.78,.76,0),bottom:new te(-.4+t%2*.72,-.76,0),"top-left":new te(-1.04,.72,0),"top-right":new te(.96,.72,0),"bottom-left":new te(-1.04,-.68,0),"bottom-right":new te(.96,-.68,0)}[e.labelSide]||[new te(-1.24,.3,0),new te(1.12,.18,0),new te(-1.06,-.44,0),new te(1.04,-.42,0)][t%4]}getTradeLocalPoint(e,t,r=0){const[i,a]=this.tradeGeoProjection([e,t]);return new te(i,-a,this.tradeNationalDepth+r)}getTradeFlowPoint(e,t=0){return this.getTradeLocalPoint(e.lng,e.lat,t)}tradeGeoProjection(e){return Tl().center(this.tradeGeoProjectionCenter).scale(this.tradeGeoProjectionScale).translate([0,0])(e)}setTradeNationalMapVisible(e){const t=!!e;if(!(!t&&!this.isTradeNationalMapActive&&!this.tradeNationalMapGroup&&!this.tradeFlowGroup)){if(t&&!this.createTradeNationalMap()){this.isTradeNationalMapActive=!1;return}this.isTradeNationalMapActive=t,this.tradeNationalMapGroup&&(this.tradeNationalMapGroup.visible=t&&this.mapAnimationComplete),this.tradeNationalLabelGroup&&(this.tradeNationalLabelGroup.visible=t&&this.mapAnimationComplete),this.mapGroup&&(this.mapGroup.visible=!t),this.labelGroup&&(this.labelGroup.visible=!t),this.flyLineGroup&&(this.flyLineGroup.visible=!t&&this.mapAnimationComplete),this.flyLineFocusGroup&&(this.flyLineFocusGroup.visible=!t&&this.mapAnimationComplete),this.scatterGroup&&(this.scatterGroup.visible=!t&&this.mapAnimationComplete),this.topicLayerMaterial&&t&&(this.topicLayerMaterial.opacity=0),t&&this.mapAnimationComplete?this.animateMapCamera(new te(0,11.4,16.2),new te(0,-.05,0),.65):!t&&this.mapAnimationComplete&&this.applyLayerMapView(this.currentTopicLayer,{force:!0})}}getTradeFlowCurve(e,t,r){const i=this.getTradeLocalPoint(e.lng,e.lat,.78),a=this.getTradeFlowPoint(t,.78),s=i.clone().lerp(a,.5),o=i.distanceTo(a);s.z+=Math.max(.55,Math.min(1.45,o*.26+r*.025));const l=new te(-(a.y-i.y),a.x-i.x,0);return l.lengthSq()>0&&(l.normalize().multiplyScalar((r%2===0?1:-1)*Math.min(.28,.1+o*.026)),s.add(l)),new $R([i,s,a])}createTradeFlowLine(e,t,r,i){const a=this.getTradeFlowCurve(e,t,r),s=new xt(r%3===1?16766828:r%3===2?2617536:3202303),o=new Nn({color:s,transparent:!0,opacity:.68,depthWrite:!1,depthTest:!1,fog:!1,blending:yi}),l=.016+Math.min(.036,ar(t.value)/Math.max(i,1)*.03),u=new GS(a,96,l,6,!1),c=new An(u,o);c.renderOrder=26,c.userData=Ve(Le({},t),{curve:a,phase:r/7}),this.tradeFlowMeshGroup.add(c),this.tradeFlowMaterials.push(o);const h=new mh({map:this.assets.instance.getResource("point"),color:s,transparent:!0,opacity:1,depthWrite:!1,depthTest:!1,fog:!1,blending:yi}),f=new Md(h);f.renderOrder=31,f.scale.set(.23,.23,.23),f.userData={curve:a,phase:r/7,speed:.16+r*.012},f.position.copy(a.getPointAt(f.userData.phase%1)),this.tradeFlowMeshGroup.add(f),this.tradeFlowPulseSprites.push(f);const d=a.getPointAt(1),p=new mh({map:this.assets.instance.getResource("arrow"),color:s,transparent:!0,opacity:.9,depthWrite:!1,depthTest:!1,fog:!1,blending:yi}),g=new Md(p);g.renderOrder=30,g.scale.set(.22,.22,.22),g.position.copy(d),this.tradeFlowMeshGroup.add(g);const v=new mh({map:this.assets.instance.getResource("point"),color:s,transparent:!0,opacity:.95,depthWrite:!1,depthTest:!1,fog:!1,blending:yi}),m=new Md(v),y=.16+Math.min(.24,ar(t.value)/Math.max(i,1)*.18);m.renderOrder=34,m.scale.set(y,y,y),m.position.copy(d),this.tradeFlowMeshGroup.add(m)}createTradeMarketMarker(e){const t=this.assets.instance.getResource("point"),r=this.assets.instance.getResource("guangquan1"),i=this.getTradeLocalPoint(e.lng,e.lat,.82),a=new mh({map:t,color:16773997,transparent:!0,opacity:1,depthWrite:!1,depthTest:!1,fog:!1,blending:yi}),s=new Md(a);s.renderOrder=35,s.scale.set(.34,.34,.34),s.position.copy(i),this.tradeFlowMeshGroup.add(s);const o=new Nn({map:r,alphaMap:r,color:16773997,transparent:!0,opacity:.72,depthWrite:!1,depthTest:!1,fog:!1,blending:yi,side:tr}),l=new An(new Ss(.58,.58),o);l.renderOrder=29,l.position.copy(this.getTradeLocalPoint(e.lng,e.lat,.58)),this.tradeFlowMeshGroup.add(l)}disposeObject3D(e){var t,r,i,a;(r=(t=e.geometry)==null?void 0:t.dispose)==null||r.call(t),Array.isArray(e.material)?e.material.forEach(s=>{var o;return(o=s==null?void 0:s.dispose)==null?void 0:o.call(s)}):(a=(i=e.material)==null?void 0:i.dispose)==null||a.call(i)}updateTradeFlowPulses(e=.016){var t,r;!((t=this.tradeFlowGroup)!=null&&t.visible)||!((r=this.tradeFlowPulseSprites)!=null&&r.length)||this.tradeFlowPulseSprites.forEach(i=>{var o;const a=(o=i.userData)==null?void 0:o.curve;if(!a)return;const s=(ar(i.userData.phase)+ar(i.userData.speed,.16)*e)%1;i.userData.phase=s,i.position.copy(a.getPointAt(s))})}updateTradeFlowLayer(e=this.currentTownRanking){if(!f1(e)){this.hideTradeFlowLayer();return}this.ensureTradeFlowGroup();const t=this.getTradeFlowSource(e),r=this.getTradeFlowRows(e);if(!t||!r.length){this.clearTradeFlowLayer(),this.hideTradeFlowLayer();return}this.clearTradeFlowLayer(),this.tradeFlowGroup.visible=this.mapAnimationComplete,this.createTradeMarketMarker(t);const i=Math.max(...r.map(o=>o.value),1);r.forEach((o,l)=>{this.createTradeFlowLine(t,o,l,i)});const a=r.length+1;for(let o=this.tradeFlowLabels.length;o<a;o+=1){const l=this.label3d.create("",o===0?"trade-market-label":"trade-flow-label",!0);this.label3d.setLabelStyle(l,o===0?.014:.0125,"x"),l.setParent(this.tradeFlowLabelGroup),this.tradeFlowLabels.push(l)}const s=this.tradeFlowLabels[0];s.element.className="trade-market-label",s.init(this.getTradeMarketHtml(t,r),this.getTradeLocalPoint(t.lng,t.lat,1.46).add(new te(.52,-.98,0))),s.visible=!0,s.userData=Ve(Le({},t),{rows:r.length}),r.forEach((o,l)=>{const u=this.tradeFlowLabels[l+1];u.element.className="trade-flow-label",u.init(this.getTradeFlowLabelHtml(o),this.getTradeFlowPoint(o,.92+Math.min(l,5)*.035).add(this.getTradeFlowLabelOffset(o,l))),u.visible=!0,u.userData=Le({},o)}),this.tradeFlowLabels.slice(a).forEach(o=>{o.visible=!1})}hasTownRankingRows(e=this.currentTownRanking){return this.getTownRankingRows(e,Number.POSITIVE_INFINITY,!1).length>0}formatMapRankingValue(e){const t=ar(e);return Math.abs(t)>=100?String(Math.round(t)):Math.abs(t)>=10?String(Number(t.toFixed(1))):String(Number(t.toFixed(2)))}formatMapCompactValue(e){const t=ar(e);return Math.abs(t)>=1e4?`${Number((t/1e4).toFixed(Math.abs(t)>=1e5?1:2))}万`:Math.abs(t)>=1e3?`${Number((t/1e3).toFixed(1))}千`:this.formatMapRankingValue(t)}formatMapIntegerValue(e){const t=ar(e);return Math.round(t).toLocaleString("zh-CN")}getBarHeight(e,t){return t?Math.max(2.8*.12,2.8*(ar(e)/t)):2.8*.25}createBarGeometry(e){const r=new lv(.06999999999999999,.06999999999999999,e);return r.translate(0,0,e/2),r}getProvinceLabelHtml(e,t,r){return`<div class="provinces-label ${t>4?"yellow":""}">
<div class="provinces-label-wrap">
<div class="label-main">
<div class="label-title">${r.title}</div>
<div class="number"><span class="value" data-target-value="${e.value}">${this.formatMapRankingValue(e.value)}</span><span class="unit">${e.unit||r.unit}</span></div>
<div class="name">${e.name}</div>
</div>
<div class="no">${t+1}</div>
</div>
</div>`}updateBarItem(e,t,r,i,a=!0){var u,c;const s=this.getBarHeight(t.value,i),[o,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(s),e.position.set(o,-l,this.depth+.45),e.userData=Ve(Le({},t),{targetValue:t.value,geoHeight:s}),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(s,r>3?16776948:7863285)),a?Mr.to(e.scale,{duration:.45,x:1,y:1,z:1,ease:"power2.out"}):this.mapAnimationComplete&&e.scale.set(1,1,1),{x:o,y:l,geoHeight:s}}updateProvinceLabel(e,t,r,i,a,s=!0){var p;const o=ar((p=e.userData)==null?void 0:p.targetValue,t.value);e.visible=!0,e.userData=Ve(Le({},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,r,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=r+1);const d=e.element.querySelector(".provinces-label-wrap");if(this.mapAnimationComplete&&(d.style.opacity="1",d.style.transform="translate(50%, 0)"),s&&this.mapAnimationComplete){const g=e.element.querySelector(".number .value"),m={value:o};Mr.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"),r=e.element.querySelector(".town-stat-value"),i=e.element.querySelector(".town-stat-unit"),a=e.element.querySelector(".town-rank"),s=e.element.querySelector(".town-stat-metric");t==null||t.classList.remove("has-stat"),r&&(r.innerText=""),i&&(i.innerText=""),a&&(a.innerText=""),s&&(s.innerText="")}updateTownNameLabelStats(e=this.currentTownRanking){var a;if(!((a=this.townNameLabels)!=null&&a.length))return;const t=this.getTownRankingRows(e,Number.POSITIVE_INFINITY,!1),r=this.getTownRankingMeta(e),i=new Map(t.map(s=>[sh(s.name),s]));this.townNameLabels.forEach(s=>{var g,v;const o=((g=s.userData)==null?void 0:g.townName)||((v=s.userData)==null?void 0:v.name),l=i.get(sh(o));if(!l){this.clearTownNameLabelStat(s);return}const u=s.element.querySelector(".town-stat-label"),c=s.element.querySelector(".town-name"),h=s.element.querySelector(".town-stat-value"),f=s.element.querySelector(".town-stat-unit"),d=s.element.querySelector(".town-rank"),p=s.element.querySelector(".town-stat-metric");u==null||u.classList.add("has-stat"),c&&(c.innerText=o),p&&(p.innerText=l.metricLabel||r.metricLabel||""),h&&(h.innerText=this.formatMapRankingValue(l.value)),f&&(f.innerText=l.unit||r.unit||""),d&&(d.innerText=l.rank?`第${l.rank}名`:""),s.userData=Ve(Le(Le({},s.userData),l),{townName:o,targetValue:l.value})})}getInfoPointHtml(e,t=this.getTownRankingMeta()){const r=String(t.title||"统计指标").replace(/排行$/,"");return` <div class="info-point-wrap">
<div class="info-point-wrap-inner">
<div class="info-point-line">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</div>
<div class="info-point-content">
<div class="content-item"><span class="label">乡镇</span><span class="value">${e.name}</span></div>
<div class="content-item"><span class="label">指标</span><span class="value">${r}</span></div>
<div class="content-item"><span class="label">数值</span><span class="value">${this.formatMapRankingValue(e.value)}${e.unit||t.unit}</span></div>
<div class="content-item"><span class="label">排名</span><span class="value">第${e.rank||"-"}名</span></div>
</div>
</div>
</div>
`}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(s=>[sh(s.name),s])),r=this.getTownRankingMeta();this.infoPointSprites.forEach((s,o)=>{const l=t.get(sh(s.userData.name));if(!l)return;s.userData=Ve(Le({},s.userData),{value:l.value,unit:l.unit||r.unit,rank:l.rank,metricTitle:r.title});const u=Math.max(...e.map(f=>f.value),1),c=.7+l.value/u*.4;s.scale.set(c,c,c);const h=this.infoLabelElement[o];h&&(h.userData=Le({},l),h.element.innerHTML=this.getInfoPointHtml(l,r))})}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(r=>{r.visible=!1}),(t=this.infoPointSprites)==null||t.forEach(r=>{r.visible=!1,r.scale.set(0,0,0)})}createBar(){const e=this.getTownRankingRows();this.getTownRankingMeta();const t=new kn;this.barGroup=t;const r=Math.max(...e.map(i=>i.value),1);this.allBar=[],this.allBarMaterial=[],this.allGuangquan=[],this.allProvinceLabel=[],e.map((i,a)=>{const s=this.getBarHeight(i.value,r),o=new Nn({color:16777215,transparent:!0,opacity:0,depthTest:!1,fog:!1});new h1(o,{uColor1:a>3?16506760:5291006,uColor2:a>3?16776948:7863285,size:s,dir:"y"});const l=new An(this.createBarGeometry(s),o);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=Ve(Le({},i),{targetValue:i.value,geoHeight:s});const h=this.createQuan(new te(u,this.depth+.44,c),a);l.add(...this.createHUIGUANG(s,a>3?16776948:7863285)),t.add(l),t.rotation.x=-Math.PI/2,this.allBar.push(l),this.allBarMaterial.push(o),this.allGuangquan.push(h)}),this.scene.add(t),this.updateTownNameLabelStats(this.currentTownRanking)}setTownRanking(e){var i,a,s,o,l,u,c,h,f,d,p,g,v,m,y,_;if(this.currentTownRanking=e,f1(e)){this.setTradeNationalMapVisible(!0),this.updateTownNameLabelStats(null),this.setTownNameLabelsVisible(!1),this.hideVillageRankingLabels(),this.clearInfoPointStats(),(i=this.allBar)!=null&&i.length&&(this.allBar.forEach(x=>{x.visible=!1,x.scale.set(1,1,0)}),(a=this.allBarMaterial)==null||a.forEach(x=>{x.opacity=0}),(s=this.allProvinceLabel)==null||s.forEach(x=>{x.visible=!1}),(o=this.allGuangquan)==null||o.forEach(x=>{x.visible=!1})),this.updateTradeFlowLayer(e);return}if(this.setTradeNationalMapVisible(!1),this.hideTradeFlowLayer(),LB(e)){this.updateTownNameLabelStats(null),this.setTownNameLabelsVisible(!RB(e)),this.clearInfoPointStats(),this.updateVillageRankingLabels(e),(l=this.allBar)!=null&&l.length&&(this.allBar.forEach(x=>{x.visible=!1,x.scale.set(1,1,0)}),(u=this.allBarMaterial)==null||u.forEach(x=>{x.opacity=0}),(c=this.allProvinceLabel)==null||c.forEach(x=>{x.visible=!1}),(h=this.allGuangquan)==null||h.forEach(x=>{x.visible=!1}));return}if(this.setTownNameLabelsVisible(!0),this.hideVillageRankingLabels(),this.updateTownNameLabelStats(e),!((f=this.allBar)!=null&&f.length))return;if(!this.showTownRankingBars){this.allBar.forEach(x=>{x.visible=!1,x.scale.set(1,1,0)}),(d=this.allBarMaterial)==null||d.forEach(x=>{x.opacity=0}),(p=this.allProvinceLabel)==null||p.forEach(x=>{x.visible=!1}),(g=this.allGuangquan)==null||g.forEach(x=>{x.visible=!1}),this.clearInfoPointStats();return}const t=this.getTownRankingRows(e,7,!1);if(!t.length){this.allBar.forEach(x=>{x.visible=!1,x.scale.set(1,1,0)}),(v=this.allProvinceLabel)==null||v.forEach(x=>{x.visible=!1}),(m=this.allGuangquan)==null||m.forEach(x=>{x.visible=!1}),this.clearInfoPointStats();return}this.InfoPointGroup&&(this.InfoPointGroup.visible=this.showTownRankingPointMarkers&&this.mapAnimationComplete),(y=this.infoPointSprites)==null||y.forEach(x=>{x.visible=this.showTownRankingPointMarkers});const r=Math.max(...t.map(x=>x.value),1);this.allBar.forEach((x,b)=>{const S=b<t.length;x.visible=S,S||x.scale.set(1,1,0)}),(_=this.allProvinceLabel)==null||_.forEach(x=>{x.visible=!1}),this.allGuangquan.forEach((x,b)=>{x.visible=b<t.length}),t.forEach((x,b)=>{const S=this.allBar[b],w=this.allGuangquan[b];if(!S)return;const{x:T,y:C}=this.updateBarItem(S,x,b,r,this.mapAnimationComplete);w&&(w.visible=!0,w.position.set(0,0,0),w.children.forEach(A=>{A.position.set(T,this.depth+.44,C),this.mapAnimationComplete&&A.scale.set(1,1,1)}))}),this.updateInfoPointStats()}createEvent(){let e=[];const t=i=>{i.traverse(a=>{a.isMesh&&(a.material=this.defaultMaterial)})},r=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",r(a.target.parent)}),i.addEventListener("mouseout",a=>{e=e.filter(s=>s.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 r=new Ss(.35,e);r.translate(0,e/2,0);const i=this.assets.instance.getResource("huiguang");i.colorSpace=Vn,i.wrapS=hi,i.wrapT=hi;let a=new Nn({color:t,map:i,transparent:!0,opacity:.4,depthWrite:!1,side:tr,blending:yi}),s=new An(r,a);s.renderOrder=10,s.rotateX(Math.PI/2);let o=s.clone(),l=s.clone();return o.rotateY(Math.PI/180*60),l.rotateY(Math.PI/180*120),[s,o,l]}createQuan(e,t){const r=this.assets.instance.getResource("guangquan1"),i=this.assets.instance.getResource("guangquan2");let a=new Ss(.5,.5),s=new Nn({color:16777215,map:r,alphaMap:r,opacity:1,transparent:!0,depthTest:!1,fog:!1,blending:yi}),o=new Nn({color:16777215,map:i,alphaMap:i,opacity:1,transparent:!0,depthTest:!1,fog:!1,blending:yi}),l=new An(a,s),u=new An(a,o);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 kn,this.quanGroup.add(l,u),this.scene.add(this.quanGroup),this.time.on("tick",()=>{l.rotation.z+=.05}),this.quanGroup}createDiffuse(){let e=new Ss(200,200),t=new Nn({color:0,depthWrite:!1,transparent:!0,blending:U$});t.blendEquation=Lu,t.blendSrc=H$,t.blendDst=V$,new WPe({material:t,time:this.time,size:60,diffuseSpeed:8,diffuseColor:7442830,diffuseWidth:2,callback:i=>{setTimeout(()=>{Mr.to(i.uniforms.uTime,{value:4,repeat:-1,duration:6,ease:"power1.easeIn"})},3)}});let r=new An(e,t);r.renderOrder=3,r.rotation.x=-Math.PI/2,r.position.set(0,.21,0),this.scene.add(r)}createGrid(){new $Pe(this,{gridSize:50,gridDivision:20,gridColor:1788784,shapeSize:.5,shapeColor:2776970,pointSize:.1,pointColor:1396093})}createBottomBg(){let e=new Ss(20,20);const t=this.assets.instance.getResource("ocean");t.colorSpace=Vn,t.wrapS=hi,t.wrapT=hi,t.repeat.set(1,1);let r=new Nn({map:t,opacity:1,fog:!1}),i=new An(e,r);i.rotation.x=-Math.PI/2,i.position.set(0,-.7,0),this.scene.add(i)}createChinaBlurLine(){let e=new Ss(147,147);const t=this.assets.instance.getResource("chinaBlurLine");t.colorSpace=Vn,t.wrapS=hi,t.wrapT=hi,t.generateMipmaps=!1,t.minFilter=Jr,t.repeat.set(1,1);let r=new Nn({color:4162253,alphaMap:t,transparent:!0,opacity:.5}),i=new An(e,r);i.rotateX(-Math.PI/2),i.position.set(-19.3,-.5,-19.7),this.scene.add(i)}createLabel(){let e=this,t=this.labelGroup,r=this.label3d,i=[],a=[];nLe.map(u=>{if(u.hide==!0)return!1;let c=o(u,r,t);i.push(c),a.push(c)});let s=l(Le({},this.mapFocusLabelInfo),r,t);i.push(s),this.otherLabel=i,this.townNameLabels=a;function o(u,c,h){let f=c.create("",`china-label ${u.blur?" blur":""}`,!1);const[d,p]=e.geoProjection(u.center);return f.init(`<div class="other-label town-stat-label">
<div class="town-name-row"><img class="label-icon" src="${tLe}"><span class="town-name">${u.name}</span><span class="town-rank"></span></div>
<div class="town-stat-row"><span class="town-stat-metric"></span><span class="town-stat-value"></span><span class="town-stat-unit"></span></div>
</div>`,new te(d,-p,e.depth+.85)),c.setLabelStyle(f,.018,"x"),f.setParent(h),f.userData=Ve(Le({},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(`<div class="other-label"><span>${u.name}</span><span>${u.enName}</span></div>`,new te(d,-p,.4)),c.setLabelStyle(f,.015,"x"),f.setParent(h),f}}createRotateBorder(){let e=12,t=this.assets.instance.getResource("rotationBorder1"),r=this.assets.instance.getResource("rotationBorder2"),i=new fB(this,{width:e*1.178,needRotate:!0,rotateSpeed:.001,material:new Nn({map:t,color:4763647,transparent:!0,opacity:.2,side:tr,depthWrite:!1,blending:yi}),position:new te(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 fB(this,{width:e*1.116,needRotate:!0,rotateSpeed:-.004,material:new Nn({map:r,color:4763647,transparent:!0,opacity:.4,side:tr,depthWrite:!1,blending:yi}),position:new te(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 kn,this.flyLineGroup.visible=!1,this.scene.add(this.flyLineGroup)}createFocus(){this.flyLineFocusGroup.clear()}createParticles(){this.particles=new Mb(this,{num:10,range:30,dir:"up",speed:.05,material:new X0({map:Mb.createTexture(),size:1,color:61166,transparent:!0,opacity:1,depthTest:!1,depthWrite:!1,vertexColors:!0,blending:yi,sizeAttenuation:!0})}),this.particleGroup=new kn,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 kn,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 mh({map:e,color:16776948,fog:!1,transparent:!0,depthTest:!1});let r=PB(rLe),i=r[0].value;r.map(a=>{const s=new Md(t);s.renderOrder=23;let o=.1+a.value/i*.2;s.scale.set(o,o,o);let[l,u]=this.geoProjection([a.lng,a.lat]);s.position.set(l,-u,this.depth+.45),s.userData.position=[l,-u,this.depth+.45],this.scatterGroup.add(s)})}createInfoPoint(){let e=this;this.InfoPointGroup=new kn,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 r=this.assets.instance.getResource("point");let i=[16776948,7863285],a=PB(iLe),s=a[0].value;a.map((l,u)=>{const c=new mh({map:r,color:i[u%i.length],fog:!1,transparent:!0,depthTest:!1}),h=new Md(c);h.renderOrder=23;let f=.7+l.value/s*.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=o(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 o(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(Ve(Le({},l),{value:0,rank:h+1,unit:""}),e.getTownRankingMeta()),new te(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=hi,t.repeat.set(2,1);let r=new c1(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new te(0,0,this.depth+.24),data:e,material:new Nn({color:2868444,map:t,alphaMap:t,fog:!1,transparent:!0,opacity:1,blending:yi}),type:"Line3",renderOrder:22,tubeRadius:.03});this.focusMapGroup.add(r.lineGroup),this.time.on("tick",()=>{t.offset.x+=.005})}handleMapClick(e){return $e(this,null,function*(){var a,s,o,l,u,c,h,f,d,p,g,v,m,y,_,x,b,S,w,T,C,A,M,P,D,L,R,N,F,O;if(!this.currentTopicLayer)return;const t=this.getScreenPointFromEvent(e),r=this.getLngLatFromEvent(e);if(!r){this.clearSelectedFeature(),(s=(a=this.callbacks).onFeatureInfo)==null||s.call(a,{feature:null});return}if(this.boundaryDrawingEnabled){const H=((o=e==null?void 0:e.data)==null?void 0:o.originalEvent)||(e==null?void 0:e.originalEvent)||e;if(H!=null&&H.__analysisBoundaryHandled)return;this.addBoundaryDrawPoint(r);return}if(d1(this.currentTopicLayer)){const H=this.pickVectorFeatureAtPoint(r);H?(this.showSelectedFeature(H),(f=(h=this.callbacks).onFeatureInfo)==null||f.call(h,{feature:{id:((l=H.properties)==null?void 0:l.id)||((u=H.properties)==null?void 0:u.feature_id)||((c=H.properties)==null?void 0:c.project_name),properties:H.properties||{},feature:H,layer:this.currentTopicLayer,lngLat:r},screen:t}),(p=(d=this.callbacks).onLayerStatus)==null||p.call(d,{type:"success",text:"真实矢量要素已选中"})):(this.clearSelectedFeature(),(v=(g=this.callbacks).onFeatureInfo)==null||v.call(g,{feature:null}),(y=(m=this.callbacks).onLayerStatus)==null||y.call(m,{type:"success",text:"当前点击位置无生态保护要素"}));return}const i=this.lngLatToWmsPixel(r);(x=(_=this.callbacks).onFeatureInfo)==null||x.call(_,{feature:null}),(S=(b=this.callbacks).onFeatureLoading)==null||S.call(b,!0);try{const H=yield CB(this.currentTopicLayer,i,{size:Eu,buffer:10}),U=EB(H),$=U?null:yield this.queryFallbackFeatureInfo(r),Y=U||($==null?void 0:$.feature);if(Y){const oe=yield this.enrichFeatureInfo(Y,i,r);this.showSelectedFeature(oe.feature||oe),(T=(w=this.callbacks).onFeatureInfo)==null||T.call(w,{feature:Ve(Le({},oe),{layer:($==null?void 0:$.layer)||this.currentTopicLayer,lngLat:r}),screen:t})}else this.clearSelectedFeature(),(A=(C=this.callbacks).onFeatureInfo)==null||A.call(C,{feature:null});Y||(P=(M=this.callbacks).onLayerStatus)==null||P.call(M,{type:"success",text:"当前点击位置无图斑"})}catch(H){this.clearSelectedFeature(),(L=(D=this.callbacks).onFeatureInfo)==null||L.call(D,{feature:null}),(N=(R=this.callbacks).onLayerStatus)==null||N.call(R,{type:"error",text:"图斑信息查询失败"})}finally{(O=(F=this.callbacks).onFeatureLoading)==null||O.call(F,!1)}})}handleCanvasBoundaryPointerDown(e){var r,i;if(!this.boundaryDrawingEnabled)return;const t=this.getLngLatFromCanvasEvent(e);t&&this.addBoundaryDrawPoint(t)&&(e.__analysisBoundaryHandled=!0),(r=e.preventDefault)==null||r.call(e),(i=e.stopPropagation)==null||i.call(e)}handleCanvasBoundaryDoubleClick(e){var r,i;if(!this.boundaryDrawingEnabled)return;const t=this.getLngLatFromCanvasEvent(e);(this.boundaryDrawPoints||[]).length<3&&t&&this.addBoundaryDrawPoint(t),(this.boundaryDrawPoints||[]).length>=3&&(this.finishBoundaryDrawing(),e.__analysisBoundaryHandled=!0),(r=e.preventDefault)==null||r.call(e),(i=e.stopPropagation)==null||i.call(e)}getLngLatFromCanvasEvent(e){var f,d,p;if(!((f=this.camera)!=null&&f.instance)||!this.focusMapGroup||!this.canvas)return null;const t=this.canvas.getBoundingClientRect();if(!t.width||!t.height)return null;const r=(d=this.interactionManager)==null?void 0:d.raycaster;if(!(r!=null&&r.setFromCamera))return null;const i={x:(e.clientX-t.left)/t.width*2-1,y:-((e.clientY-t.top)/t.height)*2+1};r.setFromCamera(i,this.camera.instance);const s=((p=r.intersectObjects(this.eventElement||[],!0)[0])==null?void 0:p.point)||this.getRayMapPlaneIntersection(r.ray);if(!s)return null;const o=this.focusMapGroup.worldToLocal(s.clone()),u=Tl().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0]).invert([o.x,-o.y]);if(!u)return null;const c=Number(u[0]),h=Number(u[1]);return!Number.isFinite(c)||!Number.isFinite(h)?null:c<gn.west-.03||c>gn.east+.03||h<gn.south-.03||h>gn.north+.03?this.getFallbackLngLatFromPointer(e,t):{lng:c,lat:h}}getFallbackLngLatFromPointer(e,t=(i=>(i=(r=>(r=this.canvas)==null?void 0:r.getBoundingClientRect)())==null?void 0:i.call(r))()){if(!(t!=null&&t.width)||!(t!=null&&t.height))return null;const a=Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),s=Math.min(1,Math.max(0,(e.clientY-t.top)/t.height)),o=gn.west+(gn.east-gn.west)*a,l=gn.north-(gn.north-gn.south)*s;return{lng:o,lat:l}}getRayMapPlaneIntersection(e){if(!(e!=null&&e.origin)||!(e!=null&&e.direction)||!this.focusMapGroup)return null;const t=this.focusMapGroup.worldToLocal(e.origin.clone()),i=this.focusMapGroup.worldToLocal(e.origin.clone().add(e.direction.clone())).sub(t),a=this.depth+.22;if(Math.abs(i.z)<1e-8)return null;const s=(a-t.z)/i.z;if(!Number.isFinite(s)||s<0)return null;const o=t.add(i.multiplyScalar(s));return this.focusMapGroup.localToWorld(o)}enrichFeatureInfo(e,t,r){return $e(this,null,function*(){const i=this.getLayerTopicKey(this.currentTopicLayer);if(!["grassland","woodland"].includes(i))return e;const s=(Q1[i]||[]).find(h=>h.key===`${i}-distribution`),o=(this.visibleTopicLayers||[]).filter(h=>this.getLayerTopicKey(h)===i).slice(0,5),l=[s,this.currentTopicLayer,...o].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=>$e(this,null,function*(){const f=yield CB(h,t,{size:Eu,buffer:10}),d=EB(f);return d?{layer:h,feature:d,source:"wms"}:null})),...l.map(h=>$e(this,null,function*(){const f=yield this.queryLayerFeatureByPoint(h,r);return f?{layer:h,feature:f,source:"wfs"}:null}))]),c=Le({},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)}),Ve(Le({},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:Ve(Le({},e.feature||{}),{properties:c})})})}queryFallbackFeatureInfo(e){return $e(this,null,function*(){const t=this.getLayerTopicKey(this.currentTopicLayer);if(!["grassland","woodland"].includes(t))return null;const i=[(Q1[t]||[]).find(a=>a.key===`${t}-distribution`),this.currentTopicLayer,...(this.visibleTopicLayers||[]).filter(a=>this.getLayerTopicKey(a)===t)].filter((a,s,o)=>(a==null?void 0:a.layerName)&&o.findIndex(l=>this.getLayerQueryKey(l)===this.getLayerQueryKey(a))===s);for(const a of i){const s=yield this.queryLayerFeatureByPoint(a,e,{requireContainment:!0});if(s)return{layer:a,feature:s}}return null})}queryLayerFeatureByPoint(i,a){return $e(this,arguments,function*(e,t,r={}){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 s=e.pointQueryTolerance||.0015,o=e.geometryField||"geom",l=t.lng-s,u=t.lat-s,c=t.lng+s,h=t.lat+s,f=yield _0(e.layerName,{cqlFilter:`BBOX(${o},${l},${u},${c},${h})`,maxFeatures:8,timeout:12e3}),d=this.pickFeatureAtPoint((f==null?void 0:f.features)||[],t,r);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,r={}){var a;if(!Array.isArray(e)||!e.length)return null;const i=e.filter(s=>this.isLngLatInGeometry(t,s.geometry)).sort((s,o)=>this.getGeometryAreaScore(s.geometry)-this.getGeometryAreaScore(o.geometry));return i.length?i[0]:r.requireContainment?null:((a=e.map(s=>({feature:s,distance:this.getGeometryDistanceScore(s.geometry,t)})).sort((s,o)=>s.distance-o.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(r=>this.isLngLatInPolygon(e,r)):!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 r=!1;const i=e.lng,a=e.lat;for(let s=0,o=t.length-1;s<t.length;o=s++){const l=t[s],u=t[o],c=Number(l==null?void 0:l[0]),h=Number(l==null?void 0:l[1]),f=Number(u==null?void 0:u[0]),d=Number(u==null?void 0:u[1]);if(this.isPointOnSegment(i,a,c,h,f,d))return!0;h>a!=d>a&&i<(f-c)*(a-h)/(d-h)+c&&(r=!r)}return r}isPointOnSegment(e,t,r,i,a,s){const o=(e-r)*(s-i)-(t-i)*(a-r);return Math.abs(o)>1e-10?!1:(e-r)*(e-a)+(t-i)*(t-s)<=1e-10}getGeometryAreaScore(e){return e!=null&&e.coordinates?e.type==="Polygon"?this.getLngLatPolygonAreaScore(e.coordinates):e.type==="MultiPolygon"?e.coordinates.reduce((t,r)=>t+this.getLngLatPolygonAreaScore(r),0):Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY}getLngLatPolygonAreaScore(e=[]){const t=e[0]||[];if(t.length<3)return Number.POSITIVE_INFINITY;let r=0;for(let i=0;i<t.length;i++){const a=t[i],s=t[(i+1)%t.length];r+=Number((a==null?void 0:a[0])||0)*Number((s==null?void 0:s[1])||0)-Number((s==null?void 0:s[0])||0)*Number((a==null?void 0:a[1])||0)}return Math.abs(r)}getGeometryDistanceScore(e,t){const r=this.getGeometryLngLatBounds(e);if(!r)return Number.POSITIVE_INFINITY;const i=(r.minLng+r.maxLng)/2,a=(r.minLat+r.maxLat)/2;return Math.hypot(i-t.lng,a-t.lat)}getGeometryLngLatBounds(e){const t=this.getGeometryCoordinateList(e);return t.length?t.reduce((r,i)=>({minLng:Math.min(r.minLng,Number((i==null?void 0:i[0])||0)),minLat:Math.min(r.minLat,Number((i==null?void 0:i[1])||0)),maxLng:Math.max(r.maxLng,Number((i==null?void 0:i[0])||0)),maxLat:Math.max(r.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=[],r=i=>{if(Array.isArray(i)){if(typeof i[0]=="number"&&typeof i[1]=="number"){t.push(i);return}i.forEach(r)}};return r(e==null?void 0:e.coordinates),t}pickVectorFeatureAtPoint(e){const t=this.currentVectorFeatures||[],r=t.filter(a=>this.isLngLatInGeometry(e,a.geometry)).sort((a,s)=>this.getGeometryAreaScore(a.geometry)-this.getGeometryAreaScore(s.geometry));if(r.length)return r[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 r=(this.currentVectorFeatures||[]).filter(v=>{var m;return String(((m=v==null?void 0:v.properties)==null?void 0:m.project_name)||"").trim()===t});if(!r.length)return(d=(f=this.callbacks).onLayerStatus)==null||d.call(f,{type:"success",text:"当前项目图斑尚未加载"}),!1;const i=this.getFeatureListLngLatBounds(r);if(!i)return!1;const a=this.getProjectHighlightFeatures(r);a.length?(this.showSelectedFeatures(a),this.setSelectedVectorFeatures(a)):this.clearSelectedFeature();const s=[(i.minLng+i.maxLng)/2,(i.minLat+i.maxLat)/2],o=Math.max(i.maxLng-i.minLng,i.maxLat-i.minLat),l=Math.max(.22,Math.min(.55,o*1.25)),u=this.lngLatToWorldPoint(s,.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}setBoundaryDrawing(e){var t,r,i,a;this.boundaryDrawingEnabled=!!e,this.boundaryDrawingEnabled?(this.boundaryDrawPoints=[],this.lastBoundaryDrawPoint=null,this.analysisBoundaryFeature=null,this.analysisMatchedFeatures=[],this.clearSelectedFeature(),(r=(t=this.callbacks).onLayerStatus)==null||r.call(t,{type:"success",text:"请在地图上依次点击绘制分析边界"})):(a=(i=this.callbacks).onLayerStatus)==null||a.call(i,{type:"success",text:"已退出边界绘制"}),this.redrawVectorTopicLayer()}addBoundaryDrawPoint(e){var a,s,o,l;if(!Number.isFinite(e==null?void 0:e.lng)||!Number.isFinite(e==null?void 0:e.lat))return!1;const t=Date.now(),r=this.lastBoundaryDrawPoint;return r&&t-r.time<350&&Math.hypot(e.lng-r.lng,e.lat-r.lat)<8e-4?!1:(this.lastBoundaryDrawPoint={lng:e.lng,lat:e.lat,time:t},this.boundaryDrawPoints=[...this.boundaryDrawPoints||[],{lng:e.lng,lat:e.lat}],(s=(a=this.callbacks).onDrawBoundary)==null||s.call(a,{status:"drawing",points:this.boundaryDrawPoints,pointCount:this.boundaryDrawPoints.length}),(l=(o=this.callbacks).onLayerStatus)==null||l.call(o,{type:"success",text:`已添加边界点 ${this.boundaryDrawPoints.length} 个`}),this.redrawVectorTopicLayer(),!0)}undoBoundaryPoint(){var e,t,r;return(e=this.boundaryDrawPoints)!=null&&e.length?(this.boundaryDrawPoints=this.boundaryDrawPoints.slice(0,-1),(r=(t=this.callbacks).onDrawBoundary)==null||r.call(t,{status:"drawing",points:this.boundaryDrawPoints,pointCount:this.boundaryDrawPoints.length}),this.redrawVectorTopicLayer(),!0):!1}finishBoundaryDrawing(){var s,o,l,u,c,h;const e=this.boundaryDrawPoints||[];if(e.length<3)return(o=(s=this.callbacks).onLayerStatus)==null||o.call(s,{type:"error",text:"至少需要 3 个点才能形成分析边界"}),null;const t=e.map(f=>[f.lng,f.lat]),r=t[0],i=t[t.length-1];(r[0]!==i[0]||r[1]!==i[1])&&t.push([...r]);const a={type:"Feature",properties:{source:"draw",pointCount:e.length},geometry:{type:"Polygon",coordinates:[t]}};return this.boundaryDrawingEnabled=!1,this.boundaryDrawPoints=[],this.lastBoundaryDrawPoint=null,this.analysisBoundaryFeature=a,(u=(l=this.callbacks).onDrawBoundary)==null||u.call(l,{status:"complete",feature:a,points:e,pointCount:e.length}),(h=(c=this.callbacks).onLayerStatus)==null||h.call(c,{type:"success",text:"分析边界已生成"}),this.focusAnalysisGeometry(a.geometry),this.redrawVectorTopicLayer(),a}clearAnalysisBoundary(){var e,t;return this.boundaryDrawingEnabled=!1,this.boundaryDrawPoints=[],this.lastBoundaryDrawPoint=null,this.analysisBoundaryFeature=null,this.analysisMatchedFeatures=[],this.redrawVectorTopicLayer(),(t=(e=this.callbacks).onDrawBoundary)==null||t.call(e,{status:"clear",points:[],pointCount:0}),!0}showAnalysisResult(e={}){var a;const t=Object.prototype.hasOwnProperty.call(e,"boundary")||Object.prototype.hasOwnProperty.call(e,"boundaryFeature")||Object.prototype.hasOwnProperty.call(e,"feature"),r=e.boundary||e.boundaryFeature||e.feature||null,i=Array.isArray(e.matches)?e.matches:[];return t&&(this.analysisBoundaryFeature=(r==null?void 0:r.type)==="Feature"?r:r!=null&&r.geometry?{type:"Feature",properties:r.properties||{},geometry:r.geometry}:null),this.analysisMatchedFeatures=i.map(s=>(s==null?void 0:s.feature)||s).filter(s=>s==null?void 0:s.geometry),!t&&this.analysisMatchedFeatures.length?this.focusAnalysisFeatures(this.analysisMatchedFeatures):(a=this.analysisBoundaryFeature)!=null&&a.geometry&&this.focusAnalysisGeometry(this.analysisBoundaryFeature.geometry),this.redrawVectorTopicLayer(),!0}focusAnalysisFeatures(e=[]){const t=this.getFeatureListLngLatBounds(e);if(!t)return!1;const r=[(t.minLng+t.maxLng)/2,(t.minLat+t.maxLat)/2];return this.flyToLngLat(r,{span:Math.max(t.maxLng-t.minLng,t.maxLat-t.minLat),statusText:"已定位命中项目"})}focusAnalysisGeometry(e){const t=this.getGeometryLngLatBounds(e);if(!t)return!1;const r=[(t.minLng+t.maxLng)/2,(t.minLat+t.maxLat)/2];return this.flyToLngLat(r,{span:Math.max(t.maxLng-t.minLng,t.maxLat-t.minLat),statusText:"已定位分析边界"})}focusPasture(e={}){var i,a;const r=[...this.normalizePastureGrasslandRows(e==null?void 0:e.grasslands),...this.normalizePastureGrasslandRows(e==null?void 0:e.wkt)].map((s,o)=>{const l=this.normalizePastureGrasslandGeometry(s);if(!l)return null;const u=this.normalizePastureGrasslandProperties(s);return{type:"Feature",properties:Ve(Le({},u),{id:u.id||u.gid||`${(e==null?void 0:e.name)||"pasture"}-${o}`,pasture_name:(e==null?void 0:e.name)||u.pastureName||u.name}),geometry:l}}).filter(Boolean);if(r.length){const s=this.getFeatureListLngLatBounds(r);if(!s)return!1;this.showSelectedFeatures(r,{mode:"pasture"}),this.setSelectedVectorFeatures(r);const o=[(s.minLng+s.maxLng)/2,(s.minLat+s.maxLat)/2];return this.flyToLngLat(o,{span:Math.max(s.maxLng-s.minLng,s.maxLat-s.minLat),statusText:"已定位具体草场"}),!0}return(a=(i=this.callbacks).onLayerStatus)==null||a.call(i,{type:"warning",text:"当前牧户暂无可定位数据"}),!1}normalizePastureGrasslandRows(e){return e?typeof e=="string"?[e]:Array.isArray(e)?e:(e==null?void 0:e.type)==="FeatureCollection"&&Array.isArray(e.features)?e.features:(e==null?void 0:e.type)==="Feature"||this.isGeoJsonGeometry(e)?[e]:Array.isArray(e==null?void 0:e.rows)?e.rows:Array.isArray(e==null?void 0:e.data)?e.data:e!=null&&e.data?this.normalizePastureGrasslandRows(e.data):Array.isArray(e==null?void 0:e.list)?e.list:Array.isArray(e==null?void 0:e.features)?e.features:e!=null&&e.wkt||e!=null&&e.geo||e!=null&&e.geom||e!=null&&e.geometryWkt||e!=null&&e.shape||e!=null&&e.geometry?[e]:[]:[]}normalizePastureGrasslandGeometry(e){var t;return typeof e=="string"?this.parseGeometryText(e):(e==null?void 0:e.type)==="Feature"?this.normalizePastureGrasslandGeometry(e.geometry):this.isGeoJsonGeometry(e)?e:typeof(e==null?void 0:e.geometry)=="string"?this.parseGeometryText(e.geometry):((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Feature"?this.normalizePastureGrasslandGeometry(e.geometry.geometry):this.isGeoJsonGeometry(e==null?void 0:e.geometry)?e.geometry:this.parseGeometryText((e==null?void 0:e.wkt)||(e==null?void 0:e.geo)||(e==null?void 0:e.geom)||(e==null?void 0:e.geometryWkt)||(e==null?void 0:e.shape))}normalizePastureGrasslandProperties(e){return!e||typeof e!="object"||Array.isArray(e)?{wkt:e}:e.type==="Feature"?e.properties||{}:e}parseGeometryText(e){const t=String(e||"").trim();if(!t)return null;if(t.startsWith("{")||t.startsWith("["))try{const r=JSON.parse(t);if((r==null?void 0:r.type)==="Feature")return this.normalizePastureGrasslandGeometry(r);if(this.isGeoJsonGeometry(r))return r}catch(r){return null}return this.parseWktGeometry(t)}isGeoJsonGeometry(e){return!!(e&&["Polygon","MultiPolygon","LineString","MultiLineString","Point"].includes(e.type)&&e.coordinates)}flyToLngLat(e,t={}){var h,f;const r=Array.isArray(e)?e:[e==null?void 0:e.lng,e==null?void 0:e.lat],i=Number(r==null?void 0:r[0]),a=Number(r==null?void 0:r[1]);if(!Number.isFinite(i)||!Number.isFinite(a))return!1;const s=Number(t.span),o=Number.isFinite(s)?Math.max(.2,Math.min(.55,s*1.25)):.32,l=this.lngLatToWorldPoint([i,a],.72),u=this.defaultMapCameraPosition.clone().sub(this.defaultMapTarget).multiplyScalar(o),c=l.clone().add(u);return this.animateMapCamera(c,l,t.duration||.75),(f=(h=this.callbacks).onLayerStatus)==null||f.call(h,{type:"success",text:t.statusText||"已定位"}),!0}getProjectHighlightFeatures(e){const t=e.filter(i=>{var s;const a=String(((s=i==null?void 0:i.geometry)==null?void 0:s.type)||"");return a.includes("Polygon")||a.includes("LineString")}),r=t.filter(i=>{var a;return((a=i==null?void 0:i.properties)==null?void 0:a.feature_role)==="工程范围"});return r.length?r:t}getFeatureListLngLatBounds(e){return e.reduce((t,r)=>{const i=this.getGeometryLngLatBounds(r.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)}:Le({},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(r=>this.isCoordinateNearLine(r,t,.004)):!1:!1}isCoordinateNearLine(e,t,r){if(!Array.isArray(e)||e.length<2)return!1;const i=[t.lng,t.lat];for(let a=1;a<e.length;a+=1)if(this.getCoordinateSegmentDistance(i,e[a-1],e[a])<=r)return!0;return!1}getCoordinateDistance(e,t){return Math.hypot(Number(e==null?void 0:e[0])-Number(t==null?void 0:t[0]),Number(e==null?void 0:e[1])-Number(t==null?void 0:t[1]))}getCoordinateSegmentDistance(e,t,r){const i=Number(t==null?void 0:t[0]),a=Number(t==null?void 0:t[1]),s=Number(r==null?void 0:r[0])-i,o=Number(r==null?void 0:r[1])-a;if(!Number.isFinite(s)||!Number.isFinite(o))return Number.POSITIVE_INFINITY;if(!s&&!o)return this.getCoordinateDistance(e,t);const l=Math.max(0,Math.min(1,((e[0]-i)*s+(e[1]-a)*o)/(s*s+o*o)));return this.getCoordinateDistance(e,[i+l*s,a+l*o])}getLayerTopicKey(e){const t=e==null?void 0:e.layerName,r=e==null?void 0:e.key,i=Object.entries(Le(Le({},Q1),tq)).find(([,a])=>a.some(s=>s.key===r||s.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,r){const i=(r==null?void 0:r.key)||"";if(Object.entries(t||{}).forEach(([a,s])=>{s==null||s===""||(e[a]===void 0||e[a]===null||e[a]==="")&&(e[a]=s)}),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),s=(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),s!=null&&s!==""&&(e.mu_yield=s)}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),s=(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),s!=null&&s!==""&&(e.ndvi=s);const o=(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);o!=null&&o!==""&&(e.degradation_level=o)}}getScreenPointFromEvent(e){var r;const t=((r=e==null?void 0:e.data)==null?void 0:r.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 o,l,u;const r=(u=(((l=(o=this.interactionManager)==null?void 0:o.raycaster)==null?void 0:l.intersectObject(e.target,!1))||[])[0])==null?void 0:u.point;if(!r)return null;const i=this.focusMapGroup.worldToLocal(r.clone()),s=Tl().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0]).invert([i.x,-i.y]);return s?{lng:s[0],lat:s[1]}:null}lngLatToWmsPixel({lng:e,lat:t}){const r=(e-gn.west)/(gn.east-gn.west)*Eu.width,i=(gn.north-t)/(gn.north-gn.south)*Eu.height;return{x:r,y:i}}showSelectedFeature(e,t={}){var i;const r=(e==null?void 0:e.geometry)||((i=e==null?void 0:e.feature)==null?void 0:i.geometry);this.clearSelectedFeature(),this.createSelectedFeatureGroup(),this.addSelectedGeometry(r,t),this.selectedFeatureGroup.children.length||this.clearSelectedFeature()}showSelectedFeatures(e=[],t={}){this.clearSelectedFeature(),this.createSelectedFeatureGroup(),e.forEach(r=>{var a;const i=(r==null?void 0:r.geometry)||((a=r==null?void 0:r.feature)==null?void 0:a.geometry);this.addSelectedGeometry(i,t)}),this.selectedFeatureGroup.children.length||this.clearSelectedFeature()}setSelectedVectorFeatures(e=[]){this.selectedVectorFeatures=[...e],this.redrawVectorTopicLayer()}getSelectedFeatureStyle(e={}){const t=e.mode==="pasture";return{fillColor:t?16765773:16769370,fillOpacity:t?.42:.5,lineColor:16777215,lineOpacity:.98,glowColor:t?2357712:2422468,glowOpacity:t?.92:.96,renderOrderBase:t?42:35,boundary:t,boundaryColor:16773226,boundaryGlowColor:2422468,boundaryWidth:.018,boundaryGlowWidth:.06,boundaryOpacity:.95,boundaryGlowOpacity:.42}}addSelectedGeometry(e,t={}){if(!(e!=null&&e.coordinates)||!this.selectedFeatureGroup)return;const r=this.getSelectedFeatureStyle(t),i=this.getDisplayFeaturePolygons(e),a=new Nn({color:r.fillColor,transparent:!0,opacity:r.fillOpacity,side:tr,depthWrite:!1,fog:!1}),s=new Oo({color:r.lineColor,transparent:!0,opacity:r.lineOpacity,linewidth:2,depthTest:!1,depthWrite:!1,fog:!1}),o=new Oo({color:r.glowColor,transparent:!0,opacity:r.glowOpacity,linewidth:3,depthTest:!1,depthWrite:!1,fog:!1}),l=r.boundary?new Nn({color:r.boundaryColor,transparent:!0,opacity:r.boundaryOpacity,side:tr,depthTest:!1,depthWrite:!1,fog:!1}):null,u=r.boundary?new Nn({color:r.boundaryGlowColor,transparent:!0,opacity:r.boundaryGlowOpacity,side:tr,depthTest:!1,depthWrite:!1,fog:!1,blending:yi}):null;i.length&&i.forEach(h=>{const f=this.createProjectedShape(h);if(!f)return;const d=new Y0(f),p=new An(d,a);p.renderOrder=r.renderOrderBase,this.selectedFeatureGroup.add(p),h.forEach(g=>{const v=this.createProjectedRingPoints(g);if(v.length<3)return;r.boundary&&(this.addSelectedBoundaryBand(v,u,r.boundaryGlowWidth,r.renderOrderBase+1,!0),this.addSelectedBoundaryBand(v,l,r.boundaryWidth,r.renderOrderBase+4,!0));const m=new qn().setFromPoints(v),y=new yb(m,s);y.renderOrder=r.renderOrderBase+5,this.selectedFeatureGroup.add(y);const _=new qn().setFromPoints(v),x=new yb(_,o);x.renderOrder=r.renderOrderBase+3,x.scale.set(1.004,1.004,1),this.selectedFeatureGroup.add(x)})});const c=this.normalizeFeatureLineStrings(e);c.length&&c.forEach(h=>{const f=this.createProjectedRingPoints(h);if(f.length<2)return;r.boundary&&(this.addSelectedBoundaryBand(f,u,r.boundaryGlowWidth,r.renderOrderBase+1,!1),this.addSelectedBoundaryBand(f,l,r.boundaryWidth,r.renderOrderBase+4,!1));const d=new qn().setFromPoints(f),p=new h0(d,o);p.renderOrder=r.renderOrderBase+3,p.scale.set(1.004,1.004,1),this.selectedFeatureGroup.add(p);const g=new qn().setFromPoints(f),v=new h0(g,s);v.renderOrder=r.renderOrderBase+5,this.selectedFeatureGroup.add(v)})}addSelectedBoundaryBand(e,t,r,i,a=!0){if(!t||!this.selectedFeatureGroup)return;const s=this.createPathBandGeometry(e,r,a);if(!s)return;const o=new An(s,t);o.renderOrder=i,this.selectedFeatureGroup.add(o)}createPathBandGeometry(e,t,r=!0){const i=this.normalizePathBandPoints(e,r);if(i.length<(r?3:2))return null;const a=Math.max(Number(t)||0,0)/2;if(!a)return null;const s=[],o=r?i.length:i.length-1;for(let u=0;u<o;u+=1){const c=i[u],h=i[(u+1)%i.length],f=h.x-c.x,d=h.y-c.y,p=Math.hypot(f,d);if(!p)continue;const g=-d/p*a,v=f/p*a,m=[c.x+g,c.y+v,.006],y=[c.x-g,c.y-v,.006],_=[h.x+g,h.y+v,.006],x=[h.x-g,h.y-v,.006];s.push(...m,...y,..._,..._,...y,...x)}if(!s.length)return null;const l=new qn;return l.setAttribute("position",new or(s,3)),l.computeVertexNormals(),l}normalizePathBandPoints(e,t){const r=(e||[]).filter(i=>Number.isFinite(i==null?void 0:i.x)&&Number.isFinite(i==null?void 0:i.y)).map(i=>i.clone());if(t&&r.length>2){const i=r[0],a=r[r.length-1];i.distanceToSquared(a)<1e-10&&r.pop()}return r}clearSelectedFeature(){var r,i,a;const e=!!((r=this.selectedVectorFeatures)!=null&&r.length);if(this.selectedVectorFeatures=[],e&&this.redrawVectorTopicLayer(),!this.selectedFeatureGroup)return;const t=new Set;for(;this.selectedFeatureGroup.children.length;){const s=this.selectedFeatureGroup.children.pop();(a=(i=s.geometry)==null?void 0:i.dispose)==null||a.call(i),Array.isArray(s.material)?s.material.forEach(o=>t.add(o)):t.add(s.material)}t.forEach(s=>{var o;return(o=s==null?void 0:s.dispose)==null?void 0:o.call(s)})}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),r=this.getLayerClipBounds(this.currentTopicLayer);return r?t.map(i=>{const a=this.clipRingToBounds(i==null?void 0:i[0],r);if(a.length<3)return null;const s=i.slice(1).map(o=>this.clipRingToBounds(o,r)).filter(o=>o.length>=3);return[a,...s]}).filter(Boolean):t}clipRingToBounds(e=[],t){let r=e.map(a=>[Number(a==null?void 0:a[0]),Number(a==null?void 0:a[1])]).filter(([a,s])=>Number.isFinite(a)&&Number.isFinite(s));return[{inside:([a])=>a>=t.west,intersect:(a,s)=>this.getLngLatLineIntersection(a,s,"lng",t.west)},{inside:([a])=>a<=t.east,intersect:(a,s)=>this.getLngLatLineIntersection(a,s,"lng",t.east)},{inside:([,a])=>a>=t.south,intersect:(a,s)=>this.getLngLatLineIntersection(a,s,"lat",t.south)},{inside:([,a])=>a<=t.north,intersect:(a,s)=>this.getLngLatLineIntersection(a,s,"lat",t.north)}].forEach(a=>{const s=r;r=[],s.length&&s.forEach((o,l)=>{const u=s[(l+s.length-1)%s.length],c=a.inside(o),h=a.inside(u);c?(h||r.push(a.intersect(u,o)),r.push(o)):h&&r.push(a.intersect(u,o))})}),r}getLngLatLineIntersection(e,t,r,i){const a=r==="lng"?0:1,s=r==="lng"?1:0,o=t[a]-e[a];if(!o)return[...e];const l=(i-e[a])/o,u=[...e];return u[a]=i,u[s]=e[s]+(t[s]-e[s])*l,u}createProjectedShape(e){const t=e==null?void 0:e[0];if(!Array.isArray(t)||t.length<3)return null;const r=new $o;return this.createProjectedRingPoints(t).forEach((a,s)=>{s===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y)}),e.slice(1).forEach(a=>{const s=this.createProjectedRingPoints(a);if(s.length<3)return;const o=new $o;s.forEach((l,u)=>{u===0?o.moveTo(l.x,l.y):o.lineTo(l.x,l.y)}),r.holes.push(o)}),r}createProjectedRingPoints(e){if(!Array.isArray(e))return[];const t=[];return e.forEach(r=>{if(!Array.isArray(r)||r.length<2)return;const i=Number(r[0]),a=Number(r[1]);if(!Number.isFinite(i)||!Number.isFinite(a))return;const[s,o]=this.geoProjection([i,a]);t.push(new te(s,-o,0))}),t}enhanceTexture(e){var r,i,a;const t=(i=(r=this.renderer)==null?void 0:r.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 Tl().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0])(e)}update(e){super.update(e),this.updateTradeFlowPulses(e),this.interactionManager&&this.interactionManager.update()}destroy(){var e,t,r,i;this.callbacks={},(t=(e=this.canvas)==null?void 0:e.removeEventListener)==null||t.call(e,"pointerdown",this.handleCanvasBoundaryPointerDown,!0),(i=(r=this.canvas)==null?void 0:r.removeEventListener)==null||i.call(r,"dblclick",this.handleCanvasBoundaryDoubleClick,!0),this.clearTradeFlowLayer(),this.clearSelectedFeature(),super.destroy(),this.label3d&&this.label3d.destroy()}}const ELe={class:"map"},dv={__name:"map",props:{activeLayer:{type:Object,default:null},mapRanking:{type:Object,default:null}},emits:["feature-loading","feature-info","layer-status","draw-boundary","scene-mounted"],setup(n,{expose:e,emit:t}){const r=n,i=t,a=Be(null),s=Cg(null);let o=null,l=null,u=null,c=null;Ia(()=>{i("scene-mounted")}),ns(()=>{S()});function h(M){s.value||!a.value||(s.value=new CLe(a.value,M,{onFeatureLoading:P=>i("feature-loading",P),onFeatureInfo:P=>i("feature-info",P),onLayerStatus:P=>i("layer-status",P),onDrawBoundary:P=>i("draw-boundary",P)}),s.value.time.pause(),s.value.setTopicLayers(r.activeLayer?[r.activeLayer]:[]),s.value.setTownRanking(r.mapRanking),T(),w())}function f(){return $e(this,null,function*(){s.value&&(s.value.time.resume(),s.value.animateTl.timeScale(1),s.value.animateTl.play())})}function d(){var M,P;(P=(M=s.value)==null?void 0:M.clearSelectedFeature)==null||P.call(M)}function p(M){var P,D;(D=(P=s.value)==null?void 0:P.focusProject)==null||D.call(P,M)}function g(M){var P,D;(D=(P=s.value)==null?void 0:P.focusPasture)==null||D.call(P,M)}function v(M,P){var D,L;return(L=(D=s.value)==null?void 0:D.focusTownByName)==null?void 0:L.call(D,M,P)}function m(M){var P,D;(D=(P=s.value)==null?void 0:P.setBoundaryDrawing)==null||D.call(P,M)}function y(){var M,P;return(P=(M=s.value)==null?void 0:M.finishBoundaryDrawing)==null?void 0:P.call(M)}function _(){var M,P;(P=(M=s.value)==null?void 0:M.undoBoundaryPoint)==null||P.call(M)}function x(){var M,P;(P=(M=s.value)==null?void 0:M.clearAnalysisBoundary)==null||P.call(M)}function b(M){var P,D;(D=(P=s.value)==null?void 0:P.showAnalysisResult)==null||D.call(P,M)}function S(){var M,P;A(),(P=(M=s.value)==null?void 0:M.destroy)==null||P.call(M),s.value=null}function w(){l&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{var M,P,D,L,R;l=null,(D=(P=(M=s.value)==null?void 0:M.sizes)==null?void 0:P.init)==null||D.call(P),(R=(L=s.value)==null?void 0:L.resize)==null||R.call(L)}),u&&window.clearTimeout(u),u=window.setTimeout(()=>{var M,P,D,L,R;u=null,(D=(P=(M=s.value)==null?void 0:M.sizes)==null?void 0:P.init)==null||D.call(P),(R=(L=s.value)==null?void 0:L.resize)==null||R.call(L)},180)}function T(){var P;A();const M=(P=a.value)==null?void 0:P.parentNode;M&&window.ResizeObserver&&(o=new ResizeObserver(()=>w()),o.observe(M)),c=window.setInterval(C,1e3),Ya(w)}function C(){var F;if(!s.value||!a.value)return;const M=a.value.parentNode,P=(M==null?void 0:M.offsetWidth)||window.innerWidth||1,D=(M==null?void 0:M.offsetHeight)||window.innerHeight||1,L=((F=s.value.sizes)==null?void 0:F.pixelRatio)||1,R=Math.floor(P*L),N=Math.floor(D*L);(a.value.width!==R||a.value.height!==N)&&w()}function A(){o&&(o.disconnect(),o=null),l&&(window.cancelAnimationFrame(l),l=null),u&&(window.clearTimeout(u),u=null),c&&(window.clearInterval(c),c=null)}return ei(()=>r.activeLayer,M=>{s.value&&s.value.setTopicLayers(M?[M]:[])},{deep:!0}),ei(()=>r.mapRanking,M=>{s.value&&s.value.setTownRanking(M)},{deep:!0}),e({loadMap:h,play:f,clearSelectedFeature:d,focusProject:p,focusPasture:g,focusTown:v,setBoundaryDrawing:m,finishBoundaryDrawing:y,undoBoundaryPoint:_,clearAnalysisBoundary:x,showAnalysisResult:b,destroyMap:S,canvasMap:s}),(M,P)=>(Z(),ne("div",ELe,[E("canvas",{ref_key:"canvasRef",ref:a},null,512)]))}};const PLe={key:0,class:"business-stat-empty"},LLe={class:"business-stat-rank"},RLe={class:"business-stat-main"},DLe={class:"business-stat-name"},ILe={class:"business-stat-bar"},NLe={class:"business-stat-value"},kLe={key:0},IB={__name:"BusinessStatList",props:{rows:{type:Array,default:()=>[]},compact:{type:Boolean,default:!1}},setup(n){const e=n,t=he(()=>{const i=e.rows.map(a=>Number(a.value)).filter(a=>!Number.isNaN(a));return Math.max(...i,1)});function r(i){const a=Number(i.value);return Number.isNaN(a)?36:Math.max(8,Math.round(a/t.value*100))}return(i,a)=>(Z(),ne("div",{class:Ct(["business-stat-list",{"is-compact":n.compact,"is-dense":n.rows.length>10}])},[n.rows.length?mt("",!0):(Z(),ne("div",PLe,"暂无业务统计数据")),(Z(!0),ne(et,null,ut(n.rows,(s,o)=>(Z(),ne("div",{key:s.key||s.name,class:"business-stat-row"},[E("div",LLe,ie(o+1),1),E("div",RLe,[E("div",DLe,ie(s.name),1),E("div",ILe,[E("span",{style:pn({width:`${r(s)}%`})},null,4)])]),E("div",NLe,[E("strong",null,ie(s.value),1),E("em",null,ie(s.unit),1),s.extra?(Z(),ne("span",kLe,ie(s.extra),1)):mt("",!0)])]))),128))],2))}},OLe=""+new URL("ring2-a1b91808-balabala-1782661552655.png",import.meta.url).href,FLe=""+new URL("ring3-fe0f60d7-balabala-1782661552655.png",import.meta.url).href,BLe=""+new URL("ring4-f2e324d6-balabala-1782661552655.png",import.meta.url).href;const GLe={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 Ve(Le({},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 kn,{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(n=>n.value).reduce((n,e)=>n+e,0),this.init()},beforeUnmount(){clearInterval(this.timer),this.destroy()},methods:{init(){this.scene=new yj,this.initCamera(),this.initRenderer(),this.initLight(),this.initAxes(),this.initControls(),this.createPlane({url:OLe,width:5,position:new te(0,0,-.01),color:"#00ffff"}),this.createPlane({url:FLe,width:6.5,position:new te(0,0,-.02),color:"#00ffff"}),this.createPlane({url:BLe,width:5.5,position:new te(0,0,-.03),animate:!0,color:"#00ffff"}),this.createPie(),this.loop()},createPlane(n){let e={url:"texture/ring1.png",width:5.5,z:0,position:new te(0,0,0),animate:!1,color:null},t=Object.assign(e,n);const r=new Ss(t.width,t.width),i=new Nn({map:this.getTexture(t.url),transparent:!0,side:tr,depthTest:!1});t.color&&(i.color=new xt(t.color));const a=new An(r,i);a.position.copy(t.position),a.rotation.x=-1*Math.PI/2,t.animate&&Mr.to(a.rotation,{z:2*Math.PI,repeat:-1,ease:"none",duration:3}),this.scene.add(a)},getTexture(n){const e=new jR().load(n);return e.wrapS=e.wrapT=hi,e},createPie(){let n=0,e=0;for(var t=0;t<this.data.length;t++){let r=this.data[t].value/this.count;t==0?n=0:n=e+1e-4,e=e+2*Math.PI*r-1e-4;let i=this.addRing({startAngle:n,endAngle:e,color:new xt(this.colors[t%this.colors.length])});i.name="ring"+t,this.pieGroup.add(i)}this.scene.add(this.pieGroup),this.chooseRing(this.activeIndex,!0),this.timer=setInterval(()=>{this.loopChange()},this.delay)},loopChange(){let n=this.activeIndex+1;n>=this.data.length&&(n=0,this.loopComplete&&this.loopComplete()),this.chooseRing(n)},chooseRing(n=0,e=!1){let t=n-1<0?this.data.length-1:n-1,r=this.pieGroup.children[t];this.prevMesh=r,this.activeIndex=n;let i=this.pieGroup.children[n];e||(Mr.to(r.scale,{z:1}),Mr.to(r.material,{opacity:this.opacity})),Mr.to(i.scale,{z:2}),Mr.to(i.material,{opacity:.8})},addRing(n={}){let e={innerRadius:1.5,outerRadius:2,thickness:.5,startAngle:0,endAngle:Math.PI/2,color:65535,segments:120},t=Object.assign(e,n),r=new $o;r.arc(0,0,t.outerRadius,t.startAngle,t.endAngle);let i=r.getPoints(t.segments),a=new $o;a.arc(0,0,t.innerRadius,t.endAngle,t.startAngle,!0);let s=a.getPoints(t.segments),o=new $o(i.concat(s));const l={steps:1,depth:t.thickness,bevelEnabled:!0,bevelThickness:0,bevelSize:0,bevelOffset:0,bevelSegments:0},u=new BS(o,l);let c=new SE({color:t.color,transparent:!0,opacity:this.opacity,side:tr});const h=new An(u,c.clone());return h.renderOrder=10,h.rotation.x=-1*Math.PI/2,h},initCamera(){var n=this.width/this.height;this.camera=new Gi(30,n,.1,1500),this.camera.position.set(6.023813305272227,4.838542633695233,6.111272698256137),this.camera.lookAt(0,0,0)},initRenderer(){this.renderer=new OR({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 n=new xb(16777215,2);n.position.set(200,300,200);let e=new xb(16777215,2);e.position.set(-200,-300,-200);let t=new Ij(16777215,2);this.scene.add(n),this.scene.add(e),this.scene.add(t)},initAxes(){this.axes=new Nj(0),this.scene.add(this.axes)},initControls(){this.controls=new Vj(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 n=this.width/this.height;this.camera.aspect=n,this.camera.updateProjectionMatrix(),this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(window.devicePixelRatio)},destroy(){this.prevMesh&&(Mr.set(this.prevMesh.scale,{z:1}),Mr.set(this.prevMesh.material,{opacity:this.opacity})),this.stop(),window.removeEventListener("resize",()=>{this.resize()}),this.renderer&&(nPe(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)}}},zLe={class:"three-pie-wrap"},ULe={class:"three-pie",ref:"pieDom"},VLe={class:"three-pie-slot"};function HLe(n,e,t,r,i,a){return Z(),ne("div",zLe,[E("div",ULe,null,512),E("div",VLe,[dp(n.$slots,"default",{data:a.currentData})])])}const nq=zb(GLe,[["render",HLe]]);const WLe={key:0,class:"business-panel-empty"},$Le={key:2,class:"business-metrics"},jLe={key:3,class:"business-icon-metrics"},qLe={class:"business-icon-metric-copy"},XLe={key:0},YLe={key:4,class:"business-spotlight"},KLe={class:"business-spotlight-main"},ZLe={class:"business-spotlight-side"},QLe={key:0},JLe={key:1,class:"business-panel-empty"},eRe={key:0,class:"business-ring-visual"},tRe={class:"business-ring-inner"},nRe={key:1,class:"business-donut-visual"},rRe={class:"business-three-pie-center"},iRe={class:"business-donut-legend"},aRe={key:1,class:"business-panel-empty"},sRe={key:6,class:"business-structure"},oRe={class:"business-structure-overview"},lRe={class:"business-structure-band"},uRe=["title"],cRe={class:"business-structure-list"},hRe={key:1,class:"business-panel-empty"},fRe={key:7,class:"business-capacity"},dRe={class:"business-capacity-head"},pRe={class:"business-capacity-band"},vRe=["title"],gRe={class:"business-capacity-list"},mRe={key:0,class:"business-capacity-town"},yRe={key:1,class:"business-panel-empty"},_Re={class:"business-bar-name"},xRe={class:"business-bar-track"},bRe={key:0},SRe={key:1},wRe={class:"business-column-track"},ARe={key:10,class:"business-project-table"},MRe={class:"business-project-search"},TRe=["placeholder"],CRe={class:"business-project-frame"},ERe=["onClick","onKeydown"],PRe=["title"],LRe={key:0},RRe={key:0},DRe={key:1},IRe={key:0,class:"business-project-empty"},NRe={class:"business-table-head"},kRe={class:"business-table-body"},ORe={class:"business-table-name"},FRe={class:"business-table-value"},BRe={key:0},GRe={class:"business-stack-legend"},zRe={class:"business-stack-chart"},URe={class:"business-stack-track"},VRe={key:14,class:"business-line"},HRe={viewBox:"0 0 320 86",preserveAspectRatio:"none","aria-hidden":"true"},WRe=["points"],$Re=["points"],jRe=["cx","cy"],qRe=["cx","cy","onMouseenter"],XRe=["onMouseenter"],YRe={key:0},KRe={key:0},ZRe={class:"business-split-band"},QRe={class:"business-split-list"},NB=3e3,Ir={__name:"BusinessPanelRenderer",props:{panel:{type:Object,default:()=>({rows:[]})},compact:{type:Boolean,default:!1}},emits:["row-select"],setup(n,{emit:e}){const t=n,r=e,i=["#24f6c4","#32dcff","#ffe06b","#7ee269","#ff9a62","#9ea7ff"],a=he(()=>{var Q;return((Q=t.panel)==null?void 0:Q.type)||"rank"}),s=he(()=>{var Q;return(((Q=t.panel)==null?void 0:Q.rows)||[]).filter(me=>me==null?void 0:me.name)}),o=he(()=>s.value.map(Q=>Ve(Le({},Q),{value:pe(Q)})).filter(Q=>Q.value>0)),l=he(()=>s.value.map(Q=>pe(Q)).filter(Q=>Q>0)),u=he(()=>Math.max(...l.value,1)),c=he(()=>l.value.reduce((Q,me)=>Q+me,0)),h=he(()=>s.value.filter(Q=>pe(Q)>0)),f=he(()=>s.value.filter(Q=>pe(Q)>0)),d=he(()=>f.value),p=he(()=>s.value.filter(Q=>pe(Q)>0)),g=he(()=>{var Q;return f.value.slice(0,((Q=t.panel)==null?void 0:Q.limit)||8)}),v=he(()=>{var Q;return((Q=t.panel)==null?void 0:Q.segments)||[]}),m=he(()=>s.value.filter(Q=>we(Q)>0)),y=Be(""),_=Be(null),x=[{key:"name",label:"项目名称",field:"name",width:"45%",className:"business-project-col-name"},{key:"year",label:"年份",field:"year",width:"13%",fallback:"未知",align:"right",className:"business-project-col-year"},{key:"category",label:"类型",field:"category",width:"20%",className:"business-project-col-category"},{key:"scale",label:"规模",field:"value",width:"22%",align:"right",strong:!0,unitField:"unit",className:"business-project-col-scale"}],b=he(()=>{var me;return(Array.isArray((me=t.panel)==null?void 0:me.columns)&&t.panel.columns.length?t.panel.columns:x).map((Oe,_t)=>({key:Oe.key||Oe.field||`column-${_t}`,label:Oe.label||Oe.title||Oe.name||"",field:Oe.field||Oe.dataIndex||Oe.key,fields:Oe.fields||[],width:Oe.width,align:Oe.align,strong:!!Oe.strong,unit:Oe.unit,unitField:Oe.unitField,fallback:Oe.fallback,format:Oe.format,className:Oe.className}))}),S=he(()=>{var Q;return((Q=t.panel)==null?void 0:Q.searchPlaceholder)||"搜索项目"}),w=he(()=>{var Q;return((Q=t.panel)==null?void 0:Q.emptyText)||"无匹配项目"}),T=he(()=>{var me;const Q=Array.isArray((me=t.panel)==null?void 0:me.searchKeys)?t.panel.searchKeys:[];return Q.length?Q:[...b.value.flatMap(Oe=>[Oe.field,...Oe.fields||[]]),"projectName","category","year","measure","townships","metric"].filter(Boolean)}),C=he(()=>{const Q=I(y.value);return Q?s.value.filter(me=>I(G(me)).includes(Q)):s.value}),A=he(()=>s.value.find(Q=>["forage-total","wetland-yield-total"].includes(Q.key))||s.value[0]),M=he(()=>s.value.filter(Q=>["forage-edible","forage-unavailable","wetland-yield-edible","wetland-yield-unavailable"].includes(Q.key))),P=he(()=>s.value.find(Q=>["forage-top-town","wetland-yield-top-town"].includes(Q.key))),D=Be(0),L=Be(null);let R=null;const N=he(()=>{var Q,me;return`${((Q=t.panel)==null?void 0:Q.key)||((me=t.panel)==null?void 0:me.title)||"pie"}-${o.value.map(Oe=>`${Oe.name}:${Oe.value}`).join("|")}`}),F=he(()=>{const Q=O.value;return Q?D.value%Q:0}),O=he(()=>{var Q;return a.value==="structure"?p.value.length:a.value==="donut"?o.value.length:a.value==="bar"&&((Q=t.panel)==null?void 0:Q.variant)==="capacity"?M.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}),H=he(()=>o.value[F.value]||o.value[0]);he(()=>p.value[F.value]||p.value[0]);const U=he(()=>s.value[0]),$=he(()=>s.value.slice(0,4).map((Q,me)=>Ve(Le({},Q),{icon:at(Q,me)}))),Y=he(()=>p.value.map((Q,me)=>Ve(Le({},Q),{displayIndex:me}))),oe=he(()=>{var Q;return a.value!=="donut"?"standard":((Q=t.panel)==null?void 0:Q.variant)==="ring"?"ring":"three"}),X=he(()=>{if(!o.value.length)return{};const Q=c.value||1;let me=-90;return{"--ring-gradient":`conic-gradient(${o.value.map((_t,zt)=>{const xn=pe(_t)/Q*360,jt=me,Tn=me+xn;return me=Tn,`${We(zt)} ${jt}deg ${Tn}deg`}).join(", ")})`,"--ring-active-color":We(F.value)}});Ia(()=>{vt()}),ns(()=>{se()}),ei(()=>{var Q;return[(Q=t.panel)==null?void 0:Q.key,s.value.length]},()=>{D.value=0,L.value=null,y.value="",_.value=null,vt()});const re=he(()=>{const Q=f.value,me=320,Oe=66,_t=10,zt=Q.length>1?me/(Q.length-1):me,xn=Q.map(ye=>pe(ye)).filter(ye=>ye>0),jt=xn.length?Math.min(...xn):0,Tn=xn.length?Math.max(...xn):1,dr=Math.max(Tn-jt,Tn*.08,1);return Q.map((ye,ht)=>{const rs=pe(ye);return{x:Math.round(ht*zt),y:Math.round(_t+Oe-(rs-jt)/dr*Oe),item:ye}})}),_e=he(()=>re.value.map(Q=>`${Q.x},${Q.y}`).join(" ")),Fe=he(()=>re.value.length?`0,86 ${_e.value} 320,86`:""),Ce=he(()=>f.value),Ae=he(()=>({gridTemplateColumns:`repeat(${Math.max(Ce.value.length,1)}, minmax(0, 1fr))`})),ze=he(()=>Number.isInteger(L.value)?re.value[L.value]:null),fe=he(()=>re.value.length?Number.isInteger(L.value)?L.value:F.value:0),j=he(()=>ze.value?ze.value:re.value[fe.value]||re.value[0]),xe=he(()=>{const Q=j.value;if(!Q)return{};const me=Q.x/320*100,Oe=Q.y/86*100,_t=Q.y<42;return{left:`${Math.min(84,Math.max(16,me))}%`,top:`${Oe}%`,transform:_t?"translate(-50%, 10px)":"translate(-50%, calc(-100% - 8px))"}});function pe(Q){const me=Number(Q==null?void 0:Q.value);if(!Number.isNaN(me)&&me>0)return me;const Oe=Number(Q==null?void 0:Q.percent);return Number.isNaN(Oe)?0:Oe}function we(Q){const me=(Q==null?void 0:Q.segments)||(Q==null?void 0:Q.values)||{};return v.value.reduce((Oe,_t)=>Oe+(Number(me[_t.key])||0),0)}function V(Q){const me=we(Q),Oe=(Q==null?void 0:Q.segments)||(Q==null?void 0:Q.values)||{};return me?v.value.map(_t=>{const zt=Number(Oe[_t.key])||0;return Ve(Le({},_t),{value:zt,percent:Math.max(zt>0?3:0,zt/me*100)})}):[]}function ee(Q){const me=Number(Q);return Number.isNaN(me)?"--":Number.isInteger(me)?`${me}`:`${Number(me.toFixed(2))}`}function ae(Q){return(Q==null?void 0:Q.displayValue)!==void 0&&(Q==null?void 0:Q.displayValue)!==null&&(Q==null?void 0:Q.displayValue)!==""?Q.displayValue:(Q==null?void 0:Q.value)===void 0||(Q==null?void 0:Q.value)===null||(Q==null?void 0:Q.value)===""?"--":ee(Q.value)}function I(Q){return String(Q||"").trim().toLowerCase()}function G(Q){const me=T.value.map(Oe=>K(Q,{field:Oe})).filter(Oe=>Oe!=null);return[Q==null?void 0:Q.searchText,...me].filter(Boolean).join(" ")}function K(Q,me){const Oe=[me==null?void 0:me.field,...(me==null?void 0:me.fields)||[]].filter(Boolean);for(const _t of Oe){const zt=String(_t).split(".").reduce((xn,jt)=>xn==null?void 0:xn[jt],Q);if(zt!=null&&zt!=="")return zt}}function ge(Q,me){const Oe=K(Q,me);return Oe==null||Oe===""?(me==null?void 0:me.fallback)||"--":(me==null?void 0:me.format)==="number"?ee(Oe):(me==null?void 0:me.format)==="displayValue"?ae({value:Oe}):String(Oe)}function Ee(Q,me){return me!=null&&me.unitField&&(Q!=null&&Q[me.unitField])?Q[me.unitField]:(me==null?void 0:me.unit)||""}function q(Q){return{"business-project-name":(Q==null?void 0:Q.key)==="name","business-project-locate":(Q==null?void 0:Q.key)==="locate","is-right":(Q==null?void 0:Q.align)==="right","is-center":(Q==null?void 0:Q.align)==="center","is-strong":Q==null?void 0:Q.strong}}function le(Q){(Q==null?void 0:Q.canLocate)!==!1&&(_.value=(Q==null?void 0:Q.key)||(Q==null?void 0:Q.name)||null,r("row-select",Q))}function ue(Q){const me=Number(Q==null?void 0:Q.scaleValue);if(!Number.isNaN(me)&&me>0)return Math.max(8,Math.min(100,Math.round(me)));const Oe=pe(Q);return Oe?Math.max(8,Math.round(Oe/u.value*100)):8}function be(Q,me){const Oe=ue(Q),_t=Math.max(.14,Math.min(.46,Oe/180));return{"--heat-color":We(me),"--heat-bg":He(We(me),_t)}}function He(Q,me=.2){const Oe=String(Q||"").replace("#","");if(Oe.length!==6)return`rgba(48, 220, 255, ${me})`;const _t=parseInt(Oe,16),zt=_t>>16&255,xn=_t>>8&255,jt=_t&255;return`rgba(${zt}, ${xn}, ${jt}, ${me})`}function nt(Q){const me=re.value.length;if(!me)return;const Oe=Q.currentTarget.getBoundingClientRect(),_t=Oe.width?(Q.clientX-Oe.left)/Oe.width:0,zt=Math.min(me-1,Math.max(0,Math.round(_t*(me-1))));L.value=zt}function ke(Q){const me=pe(Q);return!c.value||!me?0:Math.max(6,me/c.value*100)}function Tt(Q){const me=pe(Q);return!c.value||!me?0:Math.max(2,me/c.value*100)}function wt(Q){if(!Q)return"--";if(Q.extra)return Q.extra;const me=pe(Q);return!c.value||!me?"--":`${ee(me/c.value*100)}%`}function pt(){const Q=pe(A.value);return Q>0?Q:M.value.reduce((me,Oe)=>me+pe(Oe),0)}function lt(Q){const me=pt(),Oe=pe(Q);return!me||!Oe?0:Math.max(6,Oe/me*100)}function Ze(Q){const me=pt(),Oe=pe(Q);return!me||!Oe?"--":`${ee(Oe/me*100)}%`}function At(Q,me){return["forage-edible","wetland-yield-edible"].includes(Q==null?void 0:Q.key)?"#24f6c4":["forage-unavailable","wetland-yield-unavailable"].includes(Q==null?void 0:Q.key)?"#ffe06b":We(me)}function ce(Q){const me=pe(Q),Oe=Number(Q==null?void 0:Q.count)||c.value;return!me||!Oe?"0%":`${ee(me/Oe*100)}%`}function We(Q){return i[Q%i.length]}function at(Q,me){if(Q!=null&&Q.icon)return String(Q.icon).replace(/[^a-z0-9-]/gi,"");const Oe=String((Q==null?void 0:Q.name)||"");return Oe.includes("退化率")||Oe.includes("利用率")||Oe.includes("占比")?"rate":Oe.includes("重度")||Oe.includes("退化")?"risk":Oe.includes("可食")||Oe.includes("供给")?"leaf":Oe.includes("不可")?"stack":Oe.includes("产量")||Oe.includes("鲜草")?"yield":Oe.includes("乡镇")?"town":Oe.includes("面积")?"area":["yield","leaf","rate","risk"][me%4]}function vt(){se();const Q=O.value;Q<2||(R=window.setInterval(()=>{D.value=(D.value+1)%Q},NB))}function se(){R&&(window.clearInterval(R),R=null)}function Ye(Q){return`linear-gradient(90deg, rgba(36, 246, 196, 0.18), ${We(Q)})`}function je(Q){return`linear-gradient(180deg, ${We(Q)}, rgba(50, 220, 255, 0.12))`}return(Q,me)=>{var Oe,_t,zt,xn,jt,Tn,dr;return Z(),ne("div",{class:Ct(["business-panel",[`is-${a.value}`,`is-${oe.value}`,{"is-compact":n.compact}]])},[s.value.length?a.value==="rank"?(Z(),wi(IB,{key:1,rows:s.value,compact:""},null,8,["rows"])):a.value==="metric"?(Z(),ne("div",$Le,[(Z(!0),ne(et,null,ut(s.value.slice(0,4),ye=>(Z(),ne("div",{key:ye.key||ye.name,class:"business-metric-item"},[E("span",null,ie(ye.name),1),E("strong",null,ie(ae(ye)),1),E("em",null,ie(ye.unit),1)]))),128))])):a.value==="iconMetric"?(Z(),ne("div",jLe,[(Z(!0),ne(et,null,ut($.value,(ye,ht)=>(Z(),ne("div",{key:ye.key||ye.name,class:Ct(["business-icon-metric-item",`is-tone-${ht%i.length}`])},[E("i",{class:Ct(["business-icon-metric-mark",`is-${ye.icon}`])},[...me[2]||(me[2]=[E("span",null,null,-1)])],2),E("div",qLe,[E("span",null,ie(ye.name),1),E("strong",null,[jn(ie(ae(ye)),1),ye.unit?(Z(),ne("em",XLe,ie(ye.unit),1)):mt("",!0)])])],2))),128))])):a.value==="spotlight"?(Z(),ne("div",YLe,[U.value?(Z(),ne(et,{key:0},[E("div",KLe,[E("span",null,ie(U.value.name),1),E("strong",null,[jn(ie(ae(U.value)),1),E("em",null,ie(U.value.unit),1)]),E("small",null,ie(U.value.extra||((Oe=n.panel)==null?void 0:Oe.note)||"核心业务指标"),1)]),E("div",ZLe,[(Z(!0),ne(et,null,ut(s.value.slice(1,4),(ye,ht)=>(Z(),ne("div",{key:ye.key||ye.name,class:"business-spotlight-chip"},[E("i",{style:pn({borderColor:We(ht+1)})},null,4),E("span",null,ie(ye.name),1),E("strong",null,[jn(ie(ae(ye)),1),E("em",null,ie(ye.unit),1)]),ye.extra?(Z(),ne("small",QLe,ie(ye.extra),1)):mt("",!0)]))),128))])],64)):(Z(),ne("div",JLe,"暂无业务统计数据"))])):a.value==="donut"?(Z(),ne("div",{key:5,class:Ct(["business-donut",[`is-variant-${oe.value}`,{"is-dense":o.value.length>5}]])},[o.value.length?(Z(),ne(et,{key:0},[oe.value==="ring"?(Z(),ne("div",eRe,[E("div",{class:"business-ring-core",style:pn(X.value)},[me[3]||(me[3]=E("div",{class:"business-ring-orbit"},null,-1)),E("div",tRe,[E("strong",null,ie(ce(H.value)),1),E("span",null,ie(((_t=H.value)==null?void 0:_t.name)||"结构占比"),1)])],4)])):(Z(),ne("div",nRe,[(Z(),wi(nq,{key:N.value,data:o.value,delay:NB,colors:i,opacity:.62,class:"business-three-pie"},{default:Mt(({data:ye})=>[E("div",rRe,[E("strong",null,ie(ce(ye)),1),E("span",null,ie((ye==null?void 0:ye.name)||"结构占比"),1)])]),_:1},8,["data"]))])),E("div",iRe,[(Z(!0),ne(et,null,ut(o.value,(ye,ht)=>(Z(),ne("div",{key:ye.key||ye.name,class:Ct(["business-donut-row",{"is-active":ht===F.value}])},[E("i",{style:pn({borderColor:We(ht)})},null,4),E("span",null,ie(ye.name),1),E("strong",null,ie(ae(ye)),1),E("em",null,ie(ye.unit),1)],2))),128))])],64)):(Z(),ne("div",aRe,"暂无业务统计数据"))],2)):a.value==="structure"?(Z(),ne("div",sRe,[p.value.length?(Z(),ne(et,{key:0},[E("div",oRe,[E("div",lRe,[(Z(!0),ne(et,null,ut(p.value,(ye,ht)=>(Z(),ne("i",{key:ye.key||ye.name,class:Ct({"is-active":ht===F.value}),style:pn({width:`${Tt(ye)}%`,background:We(ht),color:We(ht)}),title:`${ye.name}:${ae(ye)}${ye.unit||""} ${wt(ye)}`},null,14,uRe))),128))])]),E("div",cRe,[(Z(!0),ne(et,null,ut(Y.value,ye=>(Z(),ne("div",{key:ye.key||ye.name,class:Ct(["business-structure-row",{"is-active":ye.displayIndex===F.value}])},[E("i",{style:pn({background:We(ye.displayIndex),color:We(ye.displayIndex)})},null,4),E("span",null,ie(ye.name),1),E("strong",null,[jn(ie(ae(ye)),1),E("em",null,ie(ye.unit),1)]),E("small",null,ie(wt(ye)),1)],2))),128))])],64)):(Z(),ne("div",hRe,"暂无业务统计数据"))])):a.value==="bar"&&((zt=n.panel)==null?void 0:zt.variant)==="capacity"?(Z(),ne("div",fRe,[A.value?(Z(),ne(et,{key:0},[E("div",dRe,[E("span",null,ie(A.value.name),1),E("strong",null,[jn(ie(ae(A.value)),1),E("em",null,ie(A.value.unit),1)])]),E("div",pRe,[(Z(!0),ne(et,null,ut(M.value,(ye,ht)=>(Z(),ne("i",{key:ye.key||ye.name,class:Ct({"is-active":ht===F.value}),style:pn({width:`${lt(ye)}%`,background:At(ye,ht),color:At(ye,ht)}),title:`${ye.name}:${ae(ye)}${ye.unit||""} ${Ze(ye)}`},null,14,vRe))),128))]),E("div",gRe,[(Z(!0),ne(et,null,ut(M.value,(ye,ht)=>(Z(),ne("div",{key:ye.key||ye.name,class:Ct(["business-capacity-row",{"is-active":ht===F.value}])},[E("i",{style:pn({background:At(ye,ht),color:At(ye,ht)})},null,4),E("span",null,ie(ye.name),1),E("strong",null,[jn(ie(ae(ye)),1),E("em",null,ie(ye.unit),1)]),E("small",null,ie(Ze(ye)),1)],2))),128))]),P.value?(Z(),ne("div",mRe,[E("span",null,ie(P.value.name),1),E("strong",null,[jn(ie(ae(P.value)),1),E("em",null,ie(P.value.unit),1)])])):mt("",!0)],64)):(Z(),ne("div",yRe,"暂无业务统计数据"))])):a.value==="bar"?(Z(),ne("div",{key:8,class:Ct(["business-bars",{"is-dense":f.value.length>=5,"is-long":f.value.length>10,"is-single":((xn=n.panel)==null?void 0:xn.span)===1,"is-distribution":((jt=n.panel)==null?void 0:jt.variant)==="distribution","is-capacity":((Tn=n.panel)==null?void 0:Tn.variant)==="capacity"}])},[(Z(!0),ne(et,null,ut(f.value,(ye,ht)=>(Z(),ne("div",{key:ye.key||ye.name,class:Ct(["business-bar-row",{"is-active":ht===F.value}])},[E("span",_Re,ie(ye.name),1),E("div",xRe,[E("i",{style:pn({width:`${ue(ye)}%`,background:Ye(ht)})},null,4)]),E("strong",null,[jn(ie(ae(ye))+" ",1),ye.unit?(Z(),ne("em",bRe,ie(ye.unit),1)):mt("",!0),ye.extra?(Z(),ne("small",SRe,ie(ye.extra),1)):mt("",!0)])],2))),128))],2)):a.value==="column"?(Z(),ne("div",{key:9,class:Ct(["business-columns",[`is-variant-${((dr=n.panel)==null?void 0:dr.variant)||"solid"}`,{"is-dense":f.value.length>6}]])},[(Z(!0),ne(et,null,ut(f.value,(ye,ht)=>(Z(),ne("div",{key:ye.key||ye.name,class:Ct(["business-column-item",{"is-active":ht===F.value}])},[E("strong",null,ie(ae(ye)),1),E("div",wRe,[E("i",{style:pn({height:`${ue(ye)}%`,background:je(ht),"--column-load-delay":`${ht*.075}s`})},null,4)]),E("span",null,ie(ye.name),1)],2))),128))],2)):a.value==="projectTable"?(Z(),ne("div",ARe,[E("div",MRe,[Hr(E("input",{"onUpdate:modelValue":me[0]||(me[0]=ye=>y.value=ye),type:"search",placeholder:S.value},null,8,TRe),[[xh,y.value]])]),E("div",CRe,[E("table",null,[E("colgroup",null,[(Z(!0),ne(et,null,ut(b.value,ye=>(Z(),ne("col",{key:ye.key,class:Ct(ye.className),style:pn({width:ye.width||void 0})},null,6))),128))]),E("thead",null,[E("tr",null,[(Z(!0),ne(et,null,ut(b.value,ye=>(Z(),ne("th",{key:ye.key,class:Ct(q(ye))},ie(ye.label),3))),128))])]),E("tbody",null,[(Z(!0),ne(et,null,ut(C.value,ye=>(Z(),ne("tr",{key:ye.key||ye.name,class:Ct({"is-active":_.value===(ye.key||ye.name)}),tabindex:"0",onClick:ht=>le(ye),onKeydown:[Kd(da(ht=>le(ye),["prevent"]),["enter"]),Kd(da(ht=>le(ye),["prevent"]),["space"])]},[(Z(!0),ne(et,null,ut(b.value,ht=>(Z(),ne("td",{key:ht.key,class:Ct(q(ht)),title:ge(ye,ht)},[ht.strong?(Z(),ne("strong",LRe,[jn(ie(ge(ye,ht)),1),Ee(ye,ht)?(Z(),ne("em",RRe,ie(Ee(ye,ht)),1)):mt("",!0)])):(Z(),ne("span",DRe,ie(ge(ye,ht)),1))],10,PRe))),128))],42,ERe))),128))])]),C.value.length?mt("",!0):(Z(),ne("div",IRe,ie(w.value),1))])])):a.value==="table"?(Z(),ne("div",{key:11,class:Ct(["business-table",{"is-dense":d.value.length>8}])},[E("div",NRe,[(Z(),ne(et,null,ut(2,ye=>E("div",{key:ye,class:"business-table-head-group"},[...me[4]||(me[4]=[E("span",null,"乡镇",-1),E("span",null,"亩产",-1)])])),64))]),E("div",kRe,[(Z(!0),ne(et,null,ut(d.value,(ye,ht)=>(Z(),ne("div",{key:ye.key||ye.name,class:Ct(["business-table-row",{"is-active":ht===F.value}])},[E("span",ORe,ie(ye.name),1),E("div",FRe,[E("strong",null,[jn(ie(ae(ye)),1),ye.unit?(Z(),ne("em",BRe,ie(ye.unit),1)):mt("",!0)]),E("i",null,[E("b",{style:pn({width:`${ue(ye)}%`,background:Ye(ht)})},null,4)])])],2))),128))])],2)):a.value==="stackColumn"?(Z(),ne("div",{key:12,class:Ct(["business-stack-columns",{"is-dense":m.value.length>6}])},[E("div",GRe,[(Z(!0),ne(et,null,ut(v.value,(ye,ht)=>(Z(),ne("span",{key:ye.key||ye.name},[E("i",{style:pn({background:We(ht)})},null,4),jn(ie(ye.name),1)]))),128))]),E("div",zRe,[(Z(!0),ne(et,null,ut(m.value,ye=>(Z(),ne("div",{key:ye.key||ye.name,class:"business-stack-item"},[E("div",URe,[(Z(!0),ne(et,null,ut(V(ye),(ht,rs)=>(Z(),ne("i",{key:ht.key||ht.name,style:pn({height:`${ht.percent}%`,background:We(rs)})},null,4))),128))]),E("span",null,ie(ye.name),1)]))),128))])],2)):a.value==="peak"?(Z(),ne("div",{key:13,class:Ct(["business-peaks",{"is-dense":f.value.length>5}])},[(Z(!0),ne(et,null,ut(f.value,(ye,ht)=>(Z(),ne("div",{key:ye.key||ye.name,class:"business-peak-item",style:pn({"--peak-height":`${ue(ye)}%`,"--peak-color":We(ht)})},[E("strong",null,ie(ae(ye)),1),me[5]||(me[5]=E("div",{class:"business-peak-stage"},[E("i")],-1)),E("span",null,ie(ye.name),1)],4))),128))],2)):a.value==="line"?(Z(),ne("div",VRe,[E("div",{class:"business-line-chart",onMousemove:nt,onMouseleave:me[1]||(me[1]=ye=>L.value=null)},[(Z(),ne("svg",HRe,[me[6]||(me[6]=E("path",{class:"business-line-grid",d:"M0 18H320M0 44H320M0 70H320"},null,-1)),E("polyline",{class:"business-line-area",points:Fe.value},null,8,WRe),E("polyline",{class:"business-line-stroke",points:_e.value},null,8,$Re),(Z(!0),ne(et,null,ut(re.value,(ye,ht)=>(Z(),ne("circle",{key:ht,cx:ye.x,cy:ye.y,r:"3",class:Ct(["business-line-dot",{"is-active":ht===fe.value}])},null,10,jRe))),128)),(Z(!0),ne(et,null,ut(re.value,(ye,ht)=>(Z(),ne("circle",{key:`hit-${ht}`,cx:ye.x,cy:ye.y,r:"13",class:"business-line-hit",onMouseenter:rs=>L.value=ht},null,40,qRe))),128))])),E("div",{class:"business-line-hover-zones",style:pn(Ae.value)},[(Z(!0),ne(et,null,ut(re.value,(ye,ht)=>(Z(),ne("i",{key:`zone-${ht}`,onMouseenter:rs=>L.value=ht},null,40,XRe))),128))],4),j.value?(Z(),ne("div",{key:0,class:"business-line-tooltip",style:pn(xe.value)},[E("span",null,ie(j.value.item.name),1),E("strong",null,[jn(ie(ae(j.value.item)),1),j.value.item.unit?(Z(),ne("em",YRe,ie(j.value.item.unit),1)):mt("",!0)])],4)):mt("",!0)],32),E("div",{class:"business-line-labels",style:pn(Ae.value)},[(Z(!0),ne(et,null,ut(Ce.value,ye=>(Z(),ne("span",{key:ye.key||ye.name},ie(ye.name),1))),128))],4)])):a.value==="heat"?(Z(),ne("div",{key:15,class:Ct(["business-heat",{"is-dense":g.value.length>6}])},[(Z(!0),ne(et,null,ut(g.value,(ye,ht)=>(Z(),ne("div",{key:ye.key||ye.name,class:"business-heat-cell",style:pn(be(ye,ht))},[me[7]||(me[7]=E("i",null,null,-1)),E("span",null,ie(ye.name),1),E("strong",null,[jn(ie(ae(ye)),1),ye.unit?(Z(),ne("em",KRe,ie(ye.unit),1)):mt("",!0)])],4))),128))],2)):a.value==="split"?(Z(),ne("div",{key:16,class:Ct(["business-split",{"is-dense":h.value.length>10}])},[E("div",ZRe,[(Z(!0),ne(et,null,ut(h.value,(ye,ht)=>(Z(),ne("i",{key:ye.key||ye.name,style:pn({width:`${ke(ye)}%`,background:We(ht)})},null,4))),128))]),E("div",QRe,[(Z(!0),ne(et,null,ut(h.value,(ye,ht)=>(Z(),ne("div",{key:ye.key||ye.name,class:"business-split-row"},[E("span",null,[E("i",{style:pn({background:We(ht)})},null,4),jn(ie(ye.name),1)]),E("strong",null,ie(ae(ye))+ie(ye.unit),1)]))),128))])],2)):(Z(),wi(IB,{key:17,rows:s.value,compact:""},null,8,["rows"])):(Z(),ne("div",WLe,"暂无业务统计数据"))],2)}}},kB="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAD0SURBVHgB7dEBDcAgEACxZ/5NTgkg40JaC137mgesf57wDSlCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTEHKbcBaYZyb5dAAAAAElFTkSuQmCC",JRe=""+new URL("pathLine2-d4134d4b-balabala-1782661552655.png",import.meta.url).href,e3e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADzSURBVHgB7dEBDcAwDMCw9vw5f4MRTTYF73/NC3bnBd+QIiRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSIyQGCExQmKExAiJERIjJEZIjJAYITFCYoTECIkREiMkRkiMkBghMUJihMQIiRESIyRGSMwBQCIExogIrTYAAAAASUVORK5CYII=",t3e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMxSURBVHgB7dZBDcJQFADBB/kCuHAgAQckHAA3Tf27aIXsjIjNXv7bfgyQdB0gSwAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgTAAgbN2erwGaHACECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCECQCErfv7M0CTA4AwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYAwAYCw9fj+BmhyABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABAmABB2Amb1BS2MWc5zAAAAAElFTkSuQmCC",n3e=""+new URL("ocean-bg-8c848b8f-balabala-1782661552655.png",import.meta.url).href,r3e=""+new URL("rotationBorder1-2ce8e0ef-balabala-1782661552655.png",import.meta.url).href,i3e=""+new URL("rotationBorder2-7496b968-balabala-1782661552655.png",import.meta.url).href,a3e=""+new URL("chinaBlurLine-1a2cbc0f-balabala-1782661552655.png",import.meta.url).href,s3e="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==",o3e="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==",l3e=""+new URL("huiguang-3c5dfda5-balabala-1782661552655.png",import.meta.url).href,u3e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFPSURBVHgB7ddhbcMwEAXglyEoBEPoGARCIYTBymBhMAgrhDFoIZTBIATC21lxtGhdYieOW7u6T7L6x5HvfPXJBpRSSj0jko2MGqWTJL7tQMkkgSN/tSiRBG5cNQadjB1KI0GfeOsDJXHVmFKjFBLseSaRM0rg2q3PAbn7c8Cn2Dn5HnwJ7p3hWuSI/QHvFiRi5xrkhv+3W59P5ITz7danRi4YdsCn5NGOGdZufRo8kgSwi6zGIPoe9oI4bzIM4tkkjngExh3wqaoYrBRTkRbbslW5bzuWnTswnRorVFiB/dPVII1rVVWvWGjxX4t9qzRIZy9rpD34vH2+zrnIaN03dtj3+zXw27TPYvrvUxcXsMH8ZjRu7pw0z2JOt9sh+MU7GJCUwdZG1ejcwg03LP8oqa9RItvew9i325P7Tf6yY3/1GdbcQymllFJKKaUy9gO4eI9ILG1riwAAAABJRU5ErkJggg==",c3e="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",h3e="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==",f3e="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=",d3e=""+new URL("focus_bg-b6803e2d-balabala-1782661552655.png",import.meta.url).href,p3e="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=",v3e=""+new URL("focus_move_bg-cf41417a-balabala-1782661552655.png",import.meta.url).href;class pv{constructor(e={}){this.options=Le({includeChinaMap:!1},e),this.ready=null,this.init()}init(){this.instance=new tPe,this.instance.addLoader(v0,"FileLoader");let e="./",t=[{type:"Texture",name:"flyline",path:kB},{type:"Texture",name:"pathLine",path:kB},{type:"Texture",name:"pathLine2",path:e3e},{type:"Texture",name:"pathLine3",path:JRe},{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:l3e},{type:"Texture",name:"rotationBorder1",path:r3e},{type:"Texture",name:"rotationBorder2",path:i3e},{type:"Texture",name:"guangquan1",path:s3e},{type:"Texture",name:"guangquan2",path:o3e},{type:"Texture",name:"chinaBlurLine",path:a3e},{type:"Texture",name:"ocean",path:n3e},{type:"Texture",name:"side",path:t3e},{type:"Texture",name:"arrow",path:u3e},{type:"Texture",name:"point",path:c3e},{type:"Texture",name:"focusArrows",path:h3e},{type:"Texture",name:"focusBar",path:f3e},{type:"Texture",name:"focusBg",path:d3e},{type:"Texture",name:"focusMidQuan",path:p3e},{type:"Texture",name:"focusMoveBg",path:v3e}];this.options.includeChinaMap&&t.push({type:"File",name:"chinaMap",path:e+"assets/json/中华人民共和国.json"}),this.ready=this.instance.loadAll(t)}}const g3e="/openApi",WS={513233100:"邛溪镇",513233101:"刷经寺镇",513233103:"安曲镇",513233105:"龙日镇",513233202:"江茸乡",513233203:"查尔玛乡",513233204:"瓦切镇",513233205:"阿木乡",513233207:"麦洼乡",513233208:"色地镇"},m3e=Object.values(WS).map(Up);function rq(n){return/^https?:\/\//.test(n)?n:`${g3e}${n.startsWith("/")?n:`/${n}`}`}function Ru(n,e){return ol(rq(n),{method:"POST",body:e?JSON.stringify(e):void 0,headers:{"Content-Type":"application/json"}})}function In(n,e){return ol(rq(n),{params:e})}function Lt(n,e){for(const t of e)if((n==null?void 0:n[t])!==void 0&&(n==null?void 0:n[t])!==null&&(n==null?void 0:n[t])!=="")return n[t]}function Da(n){if(n==null||n==="")return;const e=Number(n);return Number.isNaN(e)?void 0:e}function Xt(n){const e=Da(n);if(e!==void 0)return Number.isInteger(e)?e:Number(e.toFixed(2))}function Ca(n,e){const t=Da(n),r=Da(e);if(!(t===void 0||r===void 0||r===0))return t/r*100}function p1(n,e,t="占比"){var i;const r=Xt((i=Lt(n,["areaPercent","area_percent","percent"]))!=null?i:Ca(Lt(n,["areaWanMu","value"]),e));return r===void 0?"":`${t} ${r}%`}function wo(n,e=""){const t=Xt(Lt(n,["areaPercent","area_percent","percent"]));return t===void 0?"":`${e}${t}%`}function y3e(n,e=0){const t=Lt(n,["name","title","label","zh","itemName","item_name"])||`指标${e+1}`,r=Xt(Lt(n,["value","num","count","area","acreage","total"])),i=Lt(n,["unit","unitName","unit_name"])||"";return{key:Lt(n,["id","key","code"])||`${t}-${e}`,name:t,value:r,unit:i,source:n}}function _3e(n){return(Array.isArray(n)?n:(n==null?void 0:n.rows)||(n==null?void 0:n.list)||[]).map(y3e).filter(t=>t.name)}function x3e(n){const e=(n==null?void 0:n.core)||(n==null?void 0:n.summary)||n||{},t=((n==null?void 0:n.typeDistribution)||(n==null?void 0:n.typeStats)||[])[0]||{},r=((n==null?void 0:n.ecologicalPosition)||[])[0]||{};return[{key:"woodland-area",name:"林地总面积",value:Xt(Lt(e,["totalAreaWanMu","total_area_wan_mu","areaWanMu","area_wan_mu"])),unit:"万亩"},{key:"woodland-main-type-rate",name:`${Lt(t,["name"])||"主导类型"}占比`,value:Xt(Lt(t,["areaPercent","area_percent","percent"])),unit:"%"},{key:"woodland-ecology-area",name:"生态重点区面积",value:Xt(Lt(r,["areaWanMu","value"])),unit:"万亩"}]}function b3e(n){const e=(n==null?void 0:n.overview)||(n==null?void 0:n.summary)||n||{};return[{key:"grassland-total-area",name:"草地总面积",value:Xt(Lt(e,["totalAreaWanMu","total_area_wan_mu","totalArea","total_area","areaWanMu"])),unit:Lt(e,["areaUnit","area_unit"])||"万亩"},{key:"basic-grassland-area",name:"基本草原",value:Xt(Lt(e,["basicAreaWanMu","basic_area_wan_mu","basicArea","basic_area"])),unit:Lt(e,["areaUnit","area_unit"])||"万亩"},{key:"general-grassland-area",name:"一般草原",value:Xt(Lt(e,["generalAreaWanMu","general_area_wan_mu","generalArea","general_area"])),unit:Lt(e,["areaUnit","area_unit"])||"万亩"}]}function Oh(n,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,s)=>{var o,l;return Ve(Le(Le({},a),n[s]||{}),{name:((o=n[s])==null?void 0:o.name)||a.name,unit:((l=n[s])==null?void 0:l.unit)||a.unit})});return i.length?i:n}function S3e(n){return $e(this,null,function*(){let e;for(const t of n)try{return yield t()}catch(r){e=r}throw e||new Error("No request configured")})}function Zn(n=[],e={}){const{nameKeys:t=["name","townName","typeName"],valueKeys:r=["areaWanMu","value","totalAreaWanMu","basicAreaWanMu"],unit:i="万亩",max:a=Number.POSITIVE_INFINITY,extra:s}=e,o=n.map((l,u)=>{const c=Xt(Lt(l,r)),h={key:Lt(l,["key","code","townCode"])||`${Lt(l,t)||u}-${u}`,name:Lt(l,t)||`第${u+1}项`,value:c,unit:i,percent:Xt(Lt(l,["percent","areaPercent","basicRatio","generalRatio"])),source:l};return s?Ve(Le({},h),{extra:s(l)}):h}).sort((l,u)=>(Number(u.value)||0)-(Number(l.value)||0));return Number.isFinite(a)?o.slice(0,a):o}function v1(n=[],e={}){const{nameKeys:t=["name"],valueKeys:r=["value"],unit:i,max:a=Number.POSITIVE_INFINITY,extra:s}=e;return Zn(n,{nameKeys:t,valueKeys:r,unit:i,max:a,extra:s})}function w3e(n=[],e={}){const{nameKeys:t=["grassMinType","name"],valueKeys:r=["acreage"],unit:i="万亩",max:a=Number.POSITIVE_INFINITY}=e,s=n.map((o,l)=>{const u=Lt(o,r),c=Xt(i==="万亩"?Da(u)/1e4:u),h=Lt(o,t)||`第${l+1}项`;return{key:Lt(o,["key","code"])||`${h}-${l}`,name:h,value:c,unit:i,source:o}}).filter(o=>Number(o.value)>0).sort((o,l)=>(Number(l.value)||0)-(Number(o.value)||0));return Number.isFinite(a)?s.slice(0,a):s}function hn(n,e,t,r="rank",i={}){return Le({key:n,title:e,type:r,rows:t||[]},i)}function Tb(n=[],e=[],t={}){const{unit:r="万吨",max:i=Number.POSITIVE_INFINITY,showMuYieldExtra:a=!0}=t,s=new Map(e.map(o=>[o.areaName,o]));return Zn(n,{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:r,max:i,extra:o=>{const l=s.get(o.areaName),u=Xt(Lt(l,["yield","value"])),c=Lt(l,["unit"])||"斤";return a&&u!==void 0?`亩产 ${u} ${c}`:""}})}function Up(n){return String(n||"").replace(/\s+/g,"").trim()}function x0(n=[]){const e=new Map(m3e.map((t,r)=>[t,r]));return[...n].sort((t,r)=>{const i=e.get(Up(t==null?void 0:t.name)),a=e.get(Up(r==null?void 0:r.name));return i!==void 0&&a!==void 0?i-a:i!==void 0?-1:a!==void 0?1:0})}function iq(n){const e=String(n||"");return{用于畜牧业生产的人工草地:"人工草地","对调节气候、涵养水源、保持水土、防风固沙具有特殊作用的草原":"生态调节草原",国家重点保护野生动植物生存环境的草原:"野生动植物栖息草原","草原科研、教学实验基地":"科研教学草原"}[e]||e}function Cb(n){return iq(n).replace(/\s+/g,"").replace(/类$/,"")}function Eb(n){const e=String(n||""),t=e.match(/level-([1-8])/);if(t)return t[1];const r=e.match(/([1-8])\s*级/);if(r)return r[1];if(/^[1-8]$/.test(e.trim()))return e.trim();const a=Object.entries({一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8"}).find(([s])=>e.includes(`${s}级`));return(a==null?void 0:a[1])||""}function aq(n){return Eb(n==null?void 0:n.key)||Eb(n==null?void 0:n.name)}function $S(n=[],e={}){const{nameKeys:t=["name","townName","areaName"],valueKeys:r=["areaWanMu","value","totalAreaWanMu","yield"],unit:i="万亩"}=e;return n.map((a,s)=>{const o=Up(Lt(a,t)),l=Xt(Lt(a,r));return!o||l===void 0?null:{key:Lt(a,["key","code","townCode"])||`${o}-${s}`,name:o,value:l,unit:Lt(a,["unit"])||i,source:a}}).filter(Boolean).sort((a,s)=>(Number(s.value)||0)-(Number(a.value)||0))}function NE(n=[],e={}){const{nameKeys:t=["townName","name","areaName"],valueKeys:r=["areaWanMu","value","totalAreaWanMu","yield"],unit:i="万亩"}=e,a=new Map;return n.forEach(s=>{const o=Up(Lt(s,t)),l=Da(Lt(s,r));if(!o||l===void 0)return;const u=a.get(o)||{key:Lt(s,["townCode","code"])||o,name:o,value:0,unit:Lt(s,["unit"])||i,source:[]};u.value+=l,u.source.push(s),a.set(o,u)}),Array.from(a.values()).map(s=>Ve(Le({},s),{value:Xt(s.value)})).sort((s,o)=>(Number(o.value)||0)-(Number(s.value)||0))}function jo({topicKey:n,layerKey:e,title:t,unit:r="万亩",rows:i=[],note:a="",metricLabel:s=""}){const o=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)=>Ve(Le({},l),{unit:l.unit||r,rank:u+1}));return{status:o.length?"success":"empty",topicKey:n,layerKey:e,title:t,unit:r,metricLabel:s,note:a,rows:o}}function g1(s){return $e(this,arguments,function*({topicKey:n,layerKey:e,layerName:t,title:r,cqlFilter:i="",unit:a="万亩"}){const o=yield _0(t,{propertyName:["xiang","acreage"],cqlFilter:i,maxFeatures:2e5}),l=new Map;return((o==null?void 0:o.features)||[]).forEach(u=>{const c=u.properties||{},h=String(c.xiang||""),f=WS[h],d=Da(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)}),jo({topicKey:n,layerKey:e,title:r,unit:a,rows:Array.from(l.values()).map(u=>Ve(Le({},u),{value:Xt(u.value)})),note:"按 GeoServer 图斑属性汇总到乡镇"})})}function A3e(n,e,t="林地面积排行"){return $e(this,null,function*(){const r=Qt(yield Ru("/woodland/distribution"));return jo({topicKey:n,layerKey:e,title:t,unit:"万亩",rows:$S((r==null?void 0:r.areaDistribution)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],unit:"万亩"})})})}function OB(n,e,t,r){return $e(this,null,function*(){const i=Qt(yield In("/basic_grassland/overview"));return jo({topicKey:n,layerKey:e,title:r,unit:"万亩",rows:$S((i==null?void 0:i.townStats)||[],{nameKeys:["name"],valueKeys:[t],unit:"万亩"})})})}function M3e(n={},e=[],t=[]){const r=Lt(n,t);if(r)return Up(r);const i=e.map(s=>Lt(n,[s])).find(s=>s!==void 0),a=String(i||"").slice(0,9);return WS[a]||""}function T3e(n,e,t,r){return $e(this,null,function*(){const i=(r==null?void 0:r.rankingTownCodeKeys)||(t==null?void 0:t.rankingTownCodeKeys)||["area_code","xiang","town_code"],a=(r==null?void 0:r.rankingTownNameKeys)||(t==null?void 0:t.rankingTownNameKeys)||["town_name","area_name","xiang_name"],s=(r==null?void 0:r.rankingAreaKeys)||(t==null?void 0:t.rankingAreaKeys)||["acreage","area_mu","area"],o=(r==null?void 0:r.rankingPropertyName)||[...i,...a,...s],l=yield _0(t.layerName,{propertyName:o,cqlFilter:r.cqlFilter,maxFeatures:2e5,timeout:25e3}),u=new Map;return((l==null?void 0:l.features)||[]).forEach(c=>{const h=c.properties||{},f=M3e(h,i,a),d=Da(Lt(h,s));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)}),jo({topicKey:n,layerKey:e,title:`${r.name}面积排行`,unit:"万亩",metricLabel:r.name,rows:Array.from(u.values()).map(c=>Ve(Le({},c),{value:Xt(c.value),metricLabel:r.name})),note:"按选中图例过滤 GeoServer 图斑并汇总到乡镇"})})}function C3e(n,e,t){return $e(this,null,function*(){const r=Qt(yield In("/basic_grassland/overview"));return jo({topicKey:n,layerKey:e,title:`${t.name}面积排行`,unit:"万亩",metricLabel:t.name,rows:$S((r==null?void 0:r.townStats)||[],{nameKeys:["name"],valueKeys:[t.rankingValueKey],unit:"万亩"}).map(i=>Ve(Le({},i),{metricLabel:t.name}))})})}function jS(n,e,t,r,i={}){const a=Id(r||[],i).map(s=>Ve(Le({},s),{metricLabel:t.name}));return jo({topicKey:n,layerKey:e,title:`${t.name}面积排行`,unit:"万亩",metricLabel:t.name,rows:a})}function E3e(n,e,t){return $e(this,null,function*(){const r=aq(t);if(!r)return null;const i=Qt(yield In("/grassland_grassland_level/distribution"));return jS(n,e,t,i,{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:a=>Eb(Lt(a,["level","name"]))===r})})}function P3e(n,e,t){return $e(this,null,function*(){const r=Cb(t.name);if(!r)return null;const[i,a]=yield Promise.all([Yn(()=>$e(this,null,function*(){return Qt(yield In("/grassland_grass_type/distribution"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/grassland_grass_type/minTypeAreaDistribution"))}))]);return jS(n,e,t,[...i||[],...a||[]],{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:s=>{const o=Lt(s,["grassMinType","grass_min_type","grassType","grass_type","name"]);return Cb(o)===r}})})}function L3e(n,e,t){return $e(this,null,function*(){const r=aq(t);if(!r)return null;const i=Qt(yield In("/wetland_grassland_level/distribution"));return jS(n,e,t,i,{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:a=>Eb(Lt(a,["level","name"]))===r})})}function R3e(n,e,t){return $e(this,null,function*(){const r=Cb(t.name);if(!r)return null;const[i,a]=yield Promise.all([Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_grass_type_copy/distribution"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_grass_type_copy/minTypeAreaDistribution"))}))]);return jS(n,e,t,[...i||[],...a||[]],{nameKeys:["areaName","area_name","name"],valueKeys:["acreage","areaWanMu","value"],filter:s=>{const o=Lt(s,["grassMinType","grass_min_type","grassType","grass_type","name"]);return Cb(o)===r}})})}function D3e(n,e,t){return $e(this,null,function*(){if(!(t!=null&&t.key))return null;const r=fv(n,e);return r?n==="grassland"&&e==="basic-grassland"&&t.rankingValueKey?C3e(n,e,t):n==="grassland"&&e==="grassland-level"?E3e(n,e,t):n==="grassland"&&e==="grassland-type"?P3e(n,e,t):n==="wetland"&&e==="wetland-level"?L3e(n,e,t):n==="wetland"&&e==="wetland-type"?R3e(n,e,t):t.cqlFilter&&r.layerName?T3e(n,e,r,t):null:null})}function m1(n,e,t,r,i="万吨"){return $e(this,null,function*(){const a=Qt(yield In(t)),s=Lt(a==null?void 0:a[0],["unit"])||i;return jo({topicKey:n,layerKey:e,title:r,unit:s,rows:$S(a||[],{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:s})})})}function Oi(n=[],e=5){return n.slice(0,e)}function _m(n=[],e={}){var c,h;const{limit:t=5,minPercent:r=1,otherName:i="其他类型"}=e,a=n.filter(f=>(f==null?void 0:f.name)&&Number(f.value)>0).sort((f,d)=>(Number(d.value)||0)-(Number(f.value)||0)),s=a.reduce((f,d)=>f+(Number(d.value)||0),0);if(!s||a.length<=t)return a;const o=[],l=[];if(a.forEach((f,d)=>{const p=Ca(f.value,s);d<t-1&&(p===void 0||p>=r)?o.push(f):l.push(f)}),!l.length)return o;const u=l.reduce((f,d)=>f+(Number(d.value)||0),0);return[...o,{key:`${i}-${l.length}`,name:i,value:Xt(u),unit:((c=l[0])==null?void 0:c.unit)||((h=a[0])==null?void 0:h.unit)||"万亩",extra:`${Xt(Ca(u,s))}%`}]}function mf(n=[]){return n.reduce((e,t)=>e+(Number(t.value)||0),0)}function ws(n=[],e=mf(n),t=""){return n.map(r=>{const i=Xt(Ca(r.value,e));return Ve(Le({},r),{extra:i===void 0?r.extra:`${t}${i}%`})})}function FB(n){return Array.isArray(n==null?void 0:n.rows)&&n.rows.length>0}function fs(n=[],e=[],t=4){const r=[],i=new Set,a=o=>{!o||i.has(o.key)||(i.add(o.key),r.push(o))},s=[...n,...e];return s.filter(FB).forEach(a),s.filter(o=>o&&!FB(o)).forEach(a),r.slice(0,t)}function BB(n=[],e={}){const{headCount:t=4,headName:r="重点区域",tailName:i="其他区域"}=e,a=n.filter(u=>(u==null?void 0:u.name)&&Number(u.value)>0);if(!a.length)return[];const s=a.slice(0,t),o=a.slice(t),l=(u,c)=>{var h,f;return{key:u,name:u,value:Xt(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(r,s),o.length?l(i,o):null].filter(u=>u&&Number(u.value)>0)}function up(n,e,t){var o,l,u,c;if(!t)return n;const r={grassland:"grassland-distribution",wetland:"wetland-distribution",woodland:"woodland-distribution"}[e],i=((o=n==null?void 0:n.layerPanels)==null?void 0:o[t])||((l=n==null?void 0:n.layerPanels)==null?void 0:l[r]);if(!i)return n;const a=(u=i.leftPanels)!=null&&u.length?i.leftPanels:n.leftPanels,s=(c=i.rightPanels)!=null&&c.length?i.rightPanels:n.rightPanels;return Ve(Le({},n),{activeLayerKey:t||r,leftPanels:a,rightPanels:s,left:(a==null?void 0:a[0])||n.left,right:(s==null?void 0:s[0])||n.right})}function sq(n,e=["areaWanMu","value","acreage","areaMu"]){for(const t of e){const r=Lt(n,[t]),i=Da(r);if(i===void 0)continue;const a=String(t).toLowerCase(),s=String(Lt(n,["unit","areaUnit","area_unit"])||"");return a.includes("wanmu")||s==="万亩"?i:a.includes("mu")||s==="亩"?i/1e4:i}}function Id(n=[],e={}){const{nameKeys:t=["name","areaName","townName"],valueKeys:r=["areaWanMu","value","acreage","areaMu"],nameTransform:i=l=>l,filter:a,extra:s}=e,o=new Map;return n.forEach(l=>{if(a&&!a(l))return;const u=Lt(l,t),c=i(u,l),h=sq(l,r);if(!c||h===void 0)return;const f=o.get(c)||{key:Lt(l,["key","code","townCode"])||c,name:c,value:0,unit:"万亩",source:[]};f.value+=h,f.source.push(l),o.set(c,f)}),Array.from(o.values()).map(l=>{const u=Ve(Le({},l),{value:Xt(l.value)});return s?Ve(Le({},u),{extra:s(u)}):u}).filter(l=>Number(l.value)>0).sort((l,u)=>(Number(u.value)||0)-(Number(l.value)||0))}function GB(n){return String(n||"").replace(/草原/g,"湿地")}function I3e(n={},e=[]){var o;const t=(n==null?void 0:n.unit)||Lt(e==null?void 0:e[0],["unit"])||"万吨",r=(o=Da(n==null?void 0:n.xc))!=null?o:mf(e),i=Da(n==null?void 0:n.edibleXc),a=r!==void 0&&i!==void 0?Math.max(r-i,0):void 0,s=e[0];return[{key:"wetland-yield-total",name:"鲜草总产",value:Xt(r),unit:t,scaleValue:100},{key:"wetland-yield-edible",name:"可食鲜草",value:Xt(i),unit:t,scaleValue:Xt(Ca(i,r))},{key:"wetland-yield-unavailable",name:"不可食鲜草",value:Xt(a),unit:t,scaleValue:Xt(Ca(a,r))},{key:"wetland-yield-top-town",name:s!=null&&s.name?`${s.name}产量`:"最高乡镇产量",value:s==null?void 0:s.value,unit:(s==null?void 0:s.unit)||t,scaleValue:Xt(Ca(s==null?void 0:s.value,r))}].filter(l=>l.value!==void 0)}function oq({yieldSummary:n,townAreaRows:e,typeRows:t,levelRows:r,yieldRows:i,minTypeRows:a,muYieldRows:s,edibleYieldRows:o,edibleMuRows:l,typeTownRows:u,levelTownRows:c,minTownRows:h}){const f=hn("wetland-town-area","湿地面积分布",x0(e),"line",{span:1,variant:"distribution"}),d=hn("wetland-type","湿地类型结构",t,"donut",{span:1}),p=hn("wetland-level-proportion","湿地级占比",ws(r),"donut",{span:1}),g=hn("wetland-min-type","湿地优势小类",Oi(a,6),"bar",{span:1}),v=hn("wetland-yield-capacity","湿地产能结构",I3e(n,i),"bar",{span:1,variant:"capacity"}),m=hn("wetland-yield","湿地生产力分布",x0(i),"line",{span:1}),y=hn("wetland-edible-yield","可食鲜草产量",Oi(o,6),"column",{span:1,variant:"slim"}),_=hn("wetland-mu-yield","湿地亩产效率",Oi(s,6),"bar",{span:1}),x=hn("wetland-level","湿地级别面积",r,"column",{span:1}),b=hn("wetland-level-town","1级湿地分布",Oi(c,6),"bar",{span:1,variant:"distribution"}),S=hn("wetland-type-town","湿地类型乡镇分布",Oi(u,6),"bar",{span:1,variant:"distribution"}),w=hn("wetland-edible-mu","可食鲜草亩产",Oi(l,6),"bar",{span:1}),T=hn("wetland-min-town","优势小类乡镇分布",Oi(h,6),"bar",{span:1,variant:"distribution"}),C=[f,d,p,g],A=[y,m,_,v];return{leftPanels:C,rightPanels:A,left:C[0],right:A[0],layerPanels:N3e({townAreaPanel:f,typePanel:d,yieldCapacityPanel:v,yieldPanel:m,levelPanel:x,levelTownPanel:b,muYieldPanel:_,levelStructurePanel:p,typeTownPanel:S,minTypePanel:g,edibleYieldPanel:y,edibleMuPanel:w,minTownPanel:T})}}function N3e(n={}){const{townAreaPanel:e,typePanel:t,yieldCapacityPanel:r,yieldPanel:i,levelPanel:a,levelTownPanel:s,muYieldPanel:o,levelStructurePanel:l,typeTownPanel:u,minTypePanel:c,edibleYieldPanel:h,edibleMuPanel:f,minTownPanel:d}=n;return{"wetland-distribution":{leftPanels:[e,t,l,c].filter(Boolean),rightPanels:[h,i,o,r].filter(Boolean)},"wetland-level":{leftPanels:[l,a,s,t].filter(Boolean),rightPanels:[h,i,o,r].filter(Boolean)},"wetland-type":{leftPanels:[t,u,c,d].filter(Boolean),rightPanels:[h,i,f,r].filter(Boolean)},"wetland-yield":{leftPanels:[e,t,l,c].filter(Boolean),rightPanels:[h,i,o,r].filter(Boolean)}}}function k3e(n={}){const{leftPanels:e=[],rightPanels:t=[]}=n,r={leftPanels:e.filter(Boolean),rightPanels:t.filter(Boolean)};return{"grassland-distribution":r,"basic-grassland":r,"grassland-level":r,"grassland-type":r,"grassland-yield":r,"grassland-health":r}}function lq({townRows:n=[],typeRows:e=[],scaleRows:t=[],protectionRows:r=[],ownershipRows:i=[],qualityRows:a=[],originRows:s=[],ageRows:o=[],canopyRows:l=[],forestTypeRows:u=[],manageLevelRows:c=[],regionRows:h=[],ownerRows:f=[],typeTownRows:d=[],qualityLevelRows:p=[],townConcentrationRows:g=BB(n,{headCount:4,headName:"前四乡镇",tailName:"其他乡镇"}),typeConcentrationRows:v=BB(e,{headCount:2,headName:"主要类型",tailName:"其他类型"})}){const m=hn("woodland-town","林地面积分布",x0(n),"line",{span:1,variant:"distribution"}),y=hn("woodland-type","林地类型结构",e,"donut",{span:1}),_=hn("woodland-protection","公益林保护等级",ws(r),"structure",{span:1}),x=hn("woodland-ownership","林地权属结构",ws(i),"structure",{span:1}),b=hn("woodland-quality","优势树种面积",Oi(a,6),"bar",{span:1}),S=hn("woodland-origin","林地起源结构",ws(s),"structure",{span:1}),w=hn("woodland-age","林龄组结构",Oi(o,6),"column",{span:1}),T=hn("woodland-canopy","郁闭度结构",Oi(l,6),"column",{span:1}),C=hn("woodland-area-scale","林地图斑规模",t,"column",{span:1}),A=hn("woodland-forest-type","森林类别结构",Oi(u,6),"bar",{span:1}),M=hn("woodland-manage-level","管护等级分布",Oi(c,6),"bar",{span:1}),P=hn("woodland-public-rank","公益林面积排行",Oi(h,6),"bar",{span:1,variant:"distribution"}),D=hn("woodland-owner-rank","权属单位排行",Oi(f,6),"bar",{span:1}),L=hn("woodland-type-town","乡镇类型构成",Oi(d,6),"bar",{span:1,variant:"distribution"}),R=hn("woodland-quality-level","林地质量等级",ws(p),"donut",{span:1}),N=hn("woodland-town-concentration","林地集中度",ws(g),"structure",{span:1}),F=hn("woodland-type-concentration","类型集中度",ws(v),"structure",{span:1}),O=fs([m,y,_,x],[C,D,A,b]),H=fs([b,S,w,T],[C,D,A,P,N,F]);return{leftPanels:O,rightPanels:H,left:O[0],right:H[0],layerPanels:O3e({townPanel:m,typePanel:y,scalePanel:C,protectionPanel:_,ownershipPanel:x,qualityPanel:b,originPanel:S,agePanel:w,canopyPanel:T,forestTypePanel:A,manageLevelPanel:M,regionPanel:P,ownerPanel:D,typeTownPanel:L,qualityLevelPanel:R,townConcentrationPanel:N,typeConcentrationPanel:F})}}function O3e(n={}){const{townPanel:e,typePanel:t,scalePanel:r,protectionPanel:i,ownershipPanel:a,qualityPanel:s,originPanel:o,agePanel:l,canopyPanel:u,forestTypePanel:c,manageLevelPanel:h,regionPanel:f,ownerPanel:d,typeTownPanel:p,qualityLevelPanel:g,townConcentrationPanel:v,typeConcentrationPanel:m}=n;return{"woodland-distribution":{leftPanels:fs([e,t,i,a],[r,c,d]),rightPanels:fs([s,o,l,u],[r,d,f,v,m,g])},"woodland-protection":{leftPanels:fs([i,c,h,e],[t,a,r]),rightPanels:fs([f,s,o,a],[d,t,r])},"woodland-type":{leftPanels:fs([t,e,p,r],[i,a,c]),rightPanels:fs([s,o,i,a],[l,u,d,m])},"woodland-quality":{leftPanels:fs([s,o,l,u],[g,r,t]),rightPanels:fs([e,t,i,a],[c,d,r])},"woodland-ownership":{leftPanels:fs([a,d,e,t],[r,i,s]),rightPanels:fs([i,s,o,r],[c,l,u])}}}function F3e(n){const e=String(n||"").trim();return e.includes("未")&&e.includes("退")?"未退化":e.includes("轻")?"轻度退化":e.includes("中")?"中度退化":e.includes("重")?"重度退化":e||"未分级"}function B3e(){return $e(this,null,function*(){const n=yield _0("ne:t_grassland_result_caodi",{propertyName:["area_code","degradation_level","acreage"],maxFeatures:2e5,timeout:25e3}),e=new Map,t=new Map;((n==null?void 0:n.features)||[]).forEach(s=>{const o=s.properties||{},l=F3e(o.degradation_level),u=Da(o.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(o.area_code||"").slice(0,9),f=WS[h];f&&t.set(f,(t.get(f)||0)+c)});const r=["未退化","轻度退化","中度退化","重度退化","未分级"],i=Array.from(e.entries()).map(([s,o])=>({key:s,name:s,value:Xt(o),unit:"万亩"})).filter(s=>Number(s.value)>0).sort((s,o)=>{const l=r.indexOf(s.name),u=r.indexOf(o.name);return l!==-1||u!==-1?(l===-1?99:l)-(u===-1?99:u):(Number(o.value)||0)-(Number(s.value)||0)}),a=Array.from(t.entries()).map(([s,o])=>({key:s,name:s,value:Xt(o),unit:"万亩"})).filter(s=>Number(s.value)>0).sort((s,o)=>(Number(o.value)||0)-(Number(s.value)||0));return{levelRows:ws(i),townRows:a}})}function uq(n=[],e={},t=[],r=[]){var s;const i=z3e(t).find(o=>o.key==="degraded-rate"),a=(s=Da(e==null?void 0:e.xc))!=null?s:mf(r);return[n[0],n[1],{key:"grassland-yield-total",name:"鲜草产量",value:Xt(a),unit:(e==null?void 0:e.unit)||"万吨"},i].filter(o=>(o==null?void 0:o.value)!==void 0)}function G3e(n=[]){const e=mf(n);return n.filter(t=>t.name&&t.name!=="未退化"&&Number(t.value)>0).map(t=>Ve(Le({},t),{extra:Xt(Ca(t.value,e))?`${Xt(Ca(t.value,e))}%`:""}))}function cq(n={},e=[]){var o;const t=(n==null?void 0:n.unit)||Lt(e==null?void 0:e[0],["unit"])||"万吨",r=(o=Da(n==null?void 0:n.xc))!=null?o:mf(e),i=Da(n==null?void 0:n.edibleXc),a=r!==void 0&&i!==void 0?Math.max(r-i,0):void 0,s=e.find(l=>Number(l.value)>0);return[{key:"forage-total",name:"鲜草总产",value:Xt(r),unit:t,scaleValue:100},{key:"forage-edible",name:"可食鲜草",value:Xt(i),unit:t,scaleValue:Xt(Ca(i,r))},{key:"forage-unavailable",name:"不可食鲜草",value:Xt(a),unit:t,scaleValue:Xt(Ca(a,r))},{key:"forage-top-town",name:s!=null&&s.name?`最高乡镇:${s.name}`:"最高乡镇产量",value:s==null?void 0:s.value,unit:(s==null?void 0:s.unit)||t,scaleValue:Xt(Ca(s==null?void 0:s.value,r))}].filter(l=>l.value!==void 0)}function hq(){return{levelRows:ws([{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 z3e(n=[]){const e=mf(n),t=n.filter(s=>s.name&&s.name!=="未退化"),r=mf(t),i=t.filter(s=>s.name.includes("中")||s.name.includes("重")).reduce((s,o)=>s+(Number(o.value)||0),0),a=t.find(s=>s.name.includes("重"));return[{key:"degraded-total",name:"退化面积",value:Xt(r),unit:"万亩",icon:"area"},{key:"degraded-rate",name:"退化率",value:Xt(Ca(r,e)),unit:"%",icon:"rate"},{key:"medium-heavy-area",name:"中重度",value:Xt(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(s=>s.value!==void 0)}function zB(n,e){if(n==="grassland"){const t=Oh([{key:"grassland-area",name:"草地总面积",value:756.43,unit:"万亩"},{key:"basic-grassland",name:"基本草原",value:637.13,unit:"万亩"},{key:"general-grassland",name:"一般草原",value:119.31,unit:"万亩"}],n),r=Zn([{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=Zn([{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=_m([{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:"其他草原类型"}),s=Zn([{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=hq().levelRows,u=ws([{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=ws([{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=cq({xc:297.29,edibleXc:192.26,unit:"万吨"},i),f=Zn([{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=dq({core:t,townRows:r,grassTypeRows:a,grassLevelRows:u,healthRows:c,productivityRows:s,edibleYieldRows:f,forageRows:h,degradationRows:l}),p=Ve(Le({status:"fallback"},d),{top:uq(t,{xc:297.29,unit:"万吨"},l,i)});return up(p,n,e)}if(n==="wetland"){const t=Oh([{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:"万亩"}],n),r=_m([{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=Zn([{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:"万吨"}),s=[{name:"瓦切镇",value:944.22,unit:"斤"},{name:"安曲镇",value:913.28,unit:"斤"},{name:"麦洼乡",value:911.14,unit:"斤"},{name:"查尔玛乡",value:873.31,unit:"斤"},{name:"阿木乡",value:872,unit:"斤"}],o=[{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=Zn([{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=Zn([{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=oq({core:t,yieldSummary:{xc:108.84,edibleXc:1.65,unit:"万吨"},townAreaRows:o,typeRows:r,levelRows:i,yieldRows:a,minTypeRows:l,muYieldRows:s,edibleYieldRows:u,edibleMuRows:c,typeTownRows:o,levelTownRows:o,minTownRows:o}),f=Le({status:"fallback",core:t,top:[t[0],t[1],t[2]]},h);return up(f,n,e)}if(n==="woodland"){const t=Oh([{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:"%"}],n),r=Zn([{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=>`占比 ${Xt(h.percent)}%`}),i=_m([{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=lq({townRows:r,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=Le({status:"fallback",core:t,top:[t[0],t[1],t[2]]},u);return up(c,n,e)}return{status:"empty",core:Oh([],n),leftPanels:[],rightPanels:[],left:{title:"业务统计",rows:[]},right:{title:"业务统计",rows:[]}}}function fq(n=[],e=["name"]){const t=new Map;return n.forEach(r=>{const i=Lt(r,e);!i||t.has(i)||t.set(i,r)}),Array.from(t.values())}function Yn(n,e=[]){return n().catch(()=>e)}function j2(n=[],e={}){const{nameKeys:t=["name","health","level"],valueKeys:r=["value","acreage","areaWanMu"],unit:i="万亩",nameTransform:a=l=>l,max:s=Number.POSITIVE_INFINITY}=e,o=Zn(n||[],{nameKeys:t,valueKeys:r,unit:i}).map(l=>Ve(Le({},l),{name:a(l.name)}));return ws(o).filter(l=>Number(l.value)>0).slice(0,s)}function U3e(n){const e=String(n||"");return/^\d+$/.test(e)?`${e}级草原`:e.includes("级")?e.replace(/草地/g,"草原"):e}function V3e(n){const e=String(n||"");return{healthy:"健康",subhealthy:"亚健康",unhealthy:"不健康"}[e]||e}function dq({core:n,townRows:e,grassTypeRows:t,grassLevelRows:r,healthRows:i,productivityRows:a,edibleYieldRows:s,forageRows:o,degradationRows:l}){const u=hn("grassland-town","草地面积分布",x0(e),"line",{span:1}),c=hn("grassland-productivity-town","草地生产力分布",x0(a),"line",{span:1}),h=hn("grassland-type-proportion","草原类占比",t,"donut",{span:1}),f=hn("grassland-edible-yield","可食鲜草产量分布",Oi(s,10),"column",{span:1,variant:"slim"}),d=hn("grassland-degradation","草地退化统计",G3e(l),"structure",{span:1}),p=hn("grassland-health-proportion","草地健康占比",i,"donut",{span:1}),g=hn("grassland-level-proportion","草原级占比",r,"donut",{span:1}),v=hn("grassland-forage-capacity","饲草供给",o,"bar",{span:1,variant:"capacity"}),m=[u,h,d,g],y=[f,c,p,v];return{core:n,leftPanels:m,rightPanels:y,left:m[0],right:y[0],layerPanels:k3e({leftPanels:m,rightPanels:y})}}function H3e(n,e={}){const t=_3e(n),r=fq(e.typeRows||[],["name"]),i=e.yieldRows||[],a=e.levelRows||[],s=e.minTypeRows||[],o=e.edibleRows||[],l=e.edibleMuRows||[],u=e.typeDistributionRows||[],c=e.levelDistributionRows||[],h=e.minTypeDistributionRows||[],f=e.yieldSummary||{},d=_m(v1(r,{nameKeys:["name"],valueKeys:["value"],unit:"万亩"}),{limit:4,minPercent:1,otherName:"其他湿地类型"}),p=Tb(i,e.muYieldRows||[],{showMuYieldExtra:!1}),g=v1(e.muYieldRows||[],{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:"斤",max:5}),v=v1(a,{nameKeys:["name"],valueKeys:["value"],unit:"万亩"}).map(P=>Ve(Le({},P),{name:GB(P.name)})),m=w3e(s),y=Tb(o,l,{showMuYieldExtra:!1}),_=v1(l,{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:Lt(l==null?void 0:l[0],["unit"])||"斤",max:5}),x=Id(u,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"]}),b=Id(u,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"],extra:P=>{var D;return`${((D=P.source)==null?void 0:D.length)||0}类`}}),S=Id(c,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"]}),w=Id(c,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"],filter:P=>GB(Lt(P,["level","name"])).startsWith("1级")}),T=Id(h,{nameKeys:["areaName","name"],valueKeys:["acreage","areaWanMu","value"],extra:P=>{var D;return`${((D=P.source)==null?void 0:D.filter(L=>sq(L,["acreage","areaWanMu","value"])>0).length)||0}型`}}),C=Oh(t,"wetland"),A=v.find(P=>/^1级/.test(P.name))||v[0],M=oq({yieldSummary:f,townAreaRows:x,typeRows:d,levelRows:v,yieldRows:p,minTypeRows:m,muYieldRows:g,edibleYieldRows:y,edibleMuRows:_,typeTownRows:b,levelTownRows:w.length?w:S,minTownRows:T});return Le({core:C,top:[C[0],C[1],{key:"wetland-level-1-area",name:"1级湿地面积",value:A==null?void 0:A.value,unit:(A==null?void 0:A.unit)||"万亩"}].filter(Boolean)},M)}function J1(n,e){return $e(this,null,function*(){var t;try{if(n==="woodland"){const[r,i,a,s,o]=yield Promise.all([Ru("/woodland/distribution").then(Qt),Yn(()=>$e(this,null,function*(){return Qt(yield Ru("/woodland/types"))}),{}),Yn(()=>$e(this,null,function*(){return Qt(yield Ru("/woodland/protection"))}),{}),Yn(()=>$e(this,null,function*(){return Qt(yield Ru("/woodland/quality"))}),{}),Yn(()=>$e(this,null,function*(){return Qt(yield Ru("/woodland/ownership"))}),{})]),l=Oh(x3e(r),n),u=Lt((r==null?void 0:r.core)||(r==null?void 0:r.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:Xt(c),unit:"万亩"},{key:"woodland-public-rate",name:"公益林占比",value:Xt((t=Lt((a==null?void 0:a.summary)||{},["publicAreaPercent","public_area_percent"]))!=null?t:Ca(c,u)),unit:"%"}].filter(Boolean),f=Zn((r==null?void 0:r.areaDistribution)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:D=>p1(D,u)}),d=_m(Zn((i==null?void 0:i.typeStats)||(r==null?void 0:r.typeDistribution)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:wo}),{limit:4,minPercent:1,otherName:"其他林地"}),p=Zn((r==null?void 0:r.patchScale)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:D=>p1(D,u)}),g=Zn((a==null?void 0:a.protectionLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:wo}),v=Zn((s==null?void 0:s.speciesRanks)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:wo}),m=Zn((o==null?void 0:o.ownerRanks)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:D=>p1(D,u)}),y=Zn((o==null?void 0:o.landOwnerships)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:wo}),_=Zn((a==null?void 0:a.forestTypes)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:wo}),x=Zn((a==null?void 0:a.manageLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],max:6,extra:wo}),b=Zn((a==null?void 0:a.regionRanks)||[],{nameKeys:["regionName","name","townName"],valueKeys:["areaWanMu","value"],max:6,extra:D=>p1(D,c)}),S=Zn((s==null?void 0:s.origins)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:wo}),w=Zn((s==null?void 0:s.ageGroups)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:wo}),T=Zn((s==null?void 0:s.canopyLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:D=>{const L=Xt(Lt(D,["avgCanopy","avg_canopy"]));return L!==void 0?`均值 ${L}`:wo(D)}}),C=Zn((s==null?void 0:s.qualityLevels)||[],{nameKeys:["name"],valueKeys:["areaWanMu","value"],extra:wo}),A=NE((i==null?void 0:i.townComposition)||[],{nameKeys:["townName","name"],valueKeys:["areaWanMu","value"]}).slice(0,6),M=lq({townRows:f,typeRows:d,scaleRows:p,protectionRows:g,ownershipRows:y,qualityRows:v,originRows:S,ageRows:w,canopyRows:T,forestTypeRows:_,manageLevelRows:x,regionRows:b,ownerRows:m,typeTownRows:A,qualityLevelRows:C}),P=Le({status:"success",core:l,top:h},M);return up(P,n,e)}if(n==="grassland"){const[r,i,a,s,o,l,u,c,h]=yield Promise.all([In("/basic_grassland/overview").then(Qt),Yn(()=>$e(this,null,function*(){return Qt(yield In("/grassland_yield/yieldProportion"))}),{}),Yn(()=>$e(this,null,function*(){return Qt(yield In("/grassland_yield/distribution"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/grassland_yield/muYieldDistribution"))})),Yn(()=>$e(this,null,function*(){return B3e()}),hq()),Yn(()=>$e(this,null,function*(){return Qt(yield In("/grassland_grass_type/areaProportion"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/grassland_grassland_level/areaProportion"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/grassland_health/proportion"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/grassland_yield/edibleXcDistribution"))}))]),f=o.levelRows||[],d=Oh(b3e(r),n),p=Tb(a||[],s||[],{showMuYieldExtra:!1}),g=Zn(s||[],{nameKeys:["areaName","name"],valueKeys:["yield","value"],unit:Lt(s==null?void 0:s[0],["unit"])||"斤"}),v=Zn((r==null?void 0:r.townStats)||[],{nameKeys:["name"],valueKeys:["totalAreaWanMu"]}),m=j2(fq(l||[],["name"]),{nameKeys:["name"],valueKeys:["value","areaWanMu","acreage"],unit:"万亩",nameTransform:iq}),y=j2(u||[],{nameKeys:["name","level"],valueKeys:["value","areaWanMu","acreage"],unit:"万亩",nameTransform:U3e}),_=j2(c||[],{nameKeys:["health","name"],valueKeys:["acreage","value","areaWanMu"],unit:"万亩",nameTransform:V3e}),x=Tb(h||[],[],{showMuYieldExtra:!1}),b=dq({core:d,townRows:v,grassTypeRows:m,grassLevelRows:y,healthRows:_,productivityRows:g,edibleYieldRows:x,forageRows:cq(i,p),degradationRows:f}),S=Ve(Le({status:"success"},b),{top:uq(d,i,f,p)});return up(S,n,e)}if(n==="wetland"){const[r,i,a,s,o,l,u,c,h,f,d,p]=yield Promise.all([S3e([()=>$e(this,null,function*(){return Qt(yield In("/index/dataItem",{group:"wetland"}))}),()=>$e(this,null,function*(){return Qt(yield In("/index/dataItem",{group:"wetland_grassland_level"}))})]),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_grass_type_copy/areaProportion"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_yield/distribution"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_yield/muYieldDistribution"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_grassland_level/areaProportion"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_grass_type_copy/minTypeAreaProportion"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_yield/edibleXcDistribution"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_yield/edibleXcMuDistribution"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_grass_type_copy/distribution"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_grassland_level/distribution"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_grass_type_copy/minTypeAreaDistribution"))})),Yn(()=>$e(this,null,function*(){return Qt(yield In("/wetland_yield/yieldProportion"))}),{})]),g=H3e(r,{typeRows:i,yieldRows:a,muYieldRows:s,levelRows:o,minTypeRows:l,edibleRows:u,edibleMuRows:c,typeDistributionRows:h,levelDistributionRows:f,minTypeDistributionRows:d,yieldSummary:p}),v=Ve(Le({status:"success"},g),{left:g.leftPanels[0],right:g.rightPanels[0]});return up(v,n,e)}return zB(n,e)}catch(r){return Ve(Le({},zB(n,e)),{status:"error",error:r})}})}function W3e(n,e,t=null){return $e(this,null,function*(){try{const r=yield D3e(n,e,t);return r||(n==="woodland"?e==="woodland-protection"?yield g1({topicKey:n,layerKey:e,layerName:"ne:t_woodland_2023",title:"公益林面积排行",cqlFilter:"gjgyl_bhdj IN ('1','2')"}).catch(()=>$e(this,null,function*(){const i=Qt(yield Ru("/woodland/protection")),a=NE((i==null?void 0:i.regionRanks)||[],{nameKeys:["townName"],valueKeys:["areaWanMu"],unit:"万亩"});return jo({topicKey:n,layerKey:e,title:"公益林面积排行",unit:"万亩",rows:a,note:"按公益林村级榜单汇总到乡镇"})})):e==="woodland-type"?yield g1({topicKey:n,layerKey:e,layerName:"ne:t_woodland_2023",title:"林地类型面积排行"}).catch(()=>$e(this,null,function*(){const i=Qt(yield Ru("/woodland/types")),a=NE((i==null?void 0:i.townComposition)||[],{nameKeys:["townName"],valueKeys:["areaWanMu"],unit:"万亩"});return jo({topicKey:n,layerKey:e,title:"林地类型面积排行",unit:"万亩",rows:a,note:"按林地类型组成汇总到乡镇"})})):e==="woodland-quality"?yield g1({topicKey:n,layerKey:e,layerName:"ne:t_woodland_2023",title:"林地质量面积排行",cqlFilter:"zl_dj IS NOT NULL"}):e==="woodland-ownership"?yield g1({topicKey:n,layerKey:e,layerName:"ne:t_woodland_2023",title:"林地权属面积排行",cqlFilter:"ld_qs IS NOT NULL"}):yield A3e(n,e,"林地面积排行"):n==="grassland"?e==="basic-grassland"?yield OB(n,e,"basicAreaWanMu","基本草原面积排行"):e==="grassland-level"?yield m1(n,e,"/grassland_yield/muYieldDistribution","草地亩产排行","斤"):yield OB(n,e,"totalAreaWanMu","草地面积排行"):n==="wetland"?e==="wetland-level"?yield m1(n,e,"/wetland_yield/muYieldDistribution","湿地亩产排行","斤"):e==="wetland-type"?yield m1(n,e,"/wetland_yield/edibleXcDistribution","可食鲜草产量排行","万吨"):yield m1(n,e,"/wetland_yield/distribution","湿地生产力排行","万吨"):jo({topicKey:n,layerKey:e,title:"乡镇统计排行",rows:[]}))}catch(r){return{status:"error",topicKey:n,layerKey:e,title:"乡镇统计排行",unit:"",rows:[],error:r}}})}const aa={herdsmanCount:129,grasslandArea:7568515,wetArea:2429693,yakCount:10965,projectCount:17,baseCount:12},oo=[{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}],$3e=[{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}],j3e=[{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}],vv=[{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}],b0=vv.reduce((n,e)=>n+e.count,0),q3e=1824,r3=-3672,i3=b0+q3e+r3;function X3e(n,e){const t=n.map(i=>Ve(Le({},i),{count:Math.round(e*i.ratio/100)})),r=e-t.reduce((i,a)=>i+a.count,0);return r&&t[1]&&(t[1].count+=r),t}X3e([{name:"成年母牛",ratio:47},{name:"其他成年牛",ratio:22},{name:"幼畜",ratio:16},{name:"育成牛",ratio:11},{name:"公牛",ratio:4}],i3);const qS=[{label:"屠宰出栏",value:1706,yoy:6},{label:"活畜交易",value:1043,yoy:-3},{label:"外运销售",value:624,yoy:12},{label:"其他出栏",value:299,yoy:-9}],pq=[{name:"饲草储备库",value:7,capacity:10500,unit:"座"},{name:"加工企业",value:7,capacity:13e3,unit:"家"},{name:"工程数量",value:aa.projectCount,capacity:17,unit:"个"},{name:"基地数量",value:aa.baseCount,capacity:12,unit:"个"}],vq=1716,Du=b0+vq+r3,Y3e={色地镇:"色地乡",瓦切镇:"瓦切乡",安曲镇:"安曲乡",龙日镇:"龙日乡"};function kE(n){return Y3e[n]||n}const OE=vv.map(({name:n,count:e})=>({name:n,count:e})).sort((n,e)=>e.count-n.count),Pu=Q3e([{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:"专家共识模型"}],Du),UB=qS.map((n,e)=>Ve(Le({},n),{color:["#ff8f6b","#30dcff","#ffd76c","#7aa7ff"][e%4]})),q2=[{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}],za=[{key:"2026",label:"2026年底",shortLabel:"2026",months:7,stock:781236,births:44763,outflow:21684,correction:-21735,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:-60552,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:-94400,structure:{adultCow:46,otherAdult:22,calf:17,yearling:11,bull:4}}],Pb=[{name:"繁殖补充",value:86},{name:"出栏周转",value:62},{name:"死亡淘汰",value:48},{name:"母牛基础",value:91},{name:"幼畜存活",value:73}];function gq(n){return za.find(e=>e.key===n)||za[1]}function K3e(n){var i,a,s,o,l;const e=(n==null?void 0:n.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:(s=e.calf)!=null?s:16},{key:"yearling",name:"育成牛(1-2岁)",ratio:(o=e.yearling)!=null?o:11},{key:"bull",name:"公牛",ratio:(l=e.bull)!=null?l:4}].map(u=>Ve(Le({},u),{count:Math.round(n.stock*u.ratio/100),source:"预测模型"})),r=n.stock-t.reduce((u,c)=>u+c.count,0);return r&&t[1]&&(t[1].count+=r),t}function Z3e(n){const e=n.stock/b0,t=OE.map((i,a)=>Ve(Le({},i),{forecast:Math.round(i.count*e+(a%3-1)*n.months*18)})),r=n.stock-t.reduce((i,a)=>i+a.forecast,0);if(r){const i=t.reduce((a,s)=>s.count>a.count?s:a,t[0]);i.forecast+=r}return t.map(i=>Ve(Le({},i),{change:i.forecast-i.count})).sort((i,a)=>a.forecast-i.forecast)}function mq(n){const e=n.months+1,t=Array.from({length:e},(s,o)=>o===0?"2026-06":o===n.months?n.label:`+${o}月`),r=t.map((s,o)=>{const l=o/n.months,u=Math.sin(o/2.6)*Math.sin(Math.PI*l)*Math.min(360,n.months*18);return Math.round(Du+(n.stock-Du)*l+u)}),i=t.map((s,o)=>Math.round(n.births/n.months*o)),a=t.map((s,o)=>Math.round(n.outflow/n.months*o));return{labels:t,stock:r,births:i,outflow:a}}function Q3e(n,e){const t=n.map(i=>Ve(Le({},i),{count:Math.round(e*i.ratio/100)})),r=e-t.reduce((i,a)=>i+a.count,0);return r&&t[1]&&(t[1].count+=r),t}function J3e(n){const e=new Map;return n.forEach(t=>{const r=kE(t.name),i=e.get(r)||{name:r,count:0};i.count+=Number(t.count||0),e.set(r,i)}),[...e.values()].sort((t,r)=>r.count-t.count)}const el=(n,e=2)=>{const t=eu(10,e);return Math.round((Number(n)||0)*t)/t},yq=(n,e)=>n.reduce((t,r)=>t+(Number(r[e])||0),0),VB=n=>el((Number(n)||0)/1e4,2),_q=yq(qS,"value"),XS=yq(oo,"yakCount"),a3=el(aa.grasslandArea/1e4,2),eDe=el(aa.wetArea/1e4,2),tDe=177.92,nDe=el(a3+eDe+tDe,2),rDe=el(XS/Math.max(a3,1),1),iDe=108.84,aDe=159.33,sDe=[{key:"forest-grass-wet-area",zh:"林草湿总量",name:"林草湿总量",value:nDe,unit:"万亩",decimals:2},{key:"yak-count",zh:"牦牛存栏",name:"牦牛存栏",value:XS,unit:"头",decimals:0},{key:"trade-flow",zh:"交易流通",name:"交易流通",value:_q,unit:"头",decimals:0},{key:"support-capacity",zh:"产业载体",name:"产业载体",value:aa.baseCount+aa.projectCount,unit:"个",decimals:0}];$3e.map(n=>{const e=oo.find(i=>i.zoneName===n.zoneName)||{},t=VB(n.grasslandArea),r=VB(n.wetArea);return{key:n.zoneName,name:n.zoneName,grasslandArea:t,wetlandArea:r,yakCount:e.yakCount||0,resourceTotal:el(t+r,2),density:el((e.yakCount||0)/Math.max(t+r,1),1)}}).sort((n,e)=>e.yakCount-n.yakCount);oo.map(n=>({key:n.zoneName,name:n.zoneName,value:n.yakCount,unit:"头",percent:el(n.yakCount/Math.max(XS,1)*100,1)})).sort((n,e)=>e.value-n.value);const HB=qS.map(n=>({key:n.label,name:n.label,value:n.value,unit:"头",yoy:n.yoy,percent:el(n.value/Math.max(_q,1)*100,1)})),oDe=Math.max(...pq.map(n=>Number(n.value)||0),1);pq.map(n=>{const e=n.name.includes("储备")||n.name.includes("加工")?`${Number(n.capacity||0).toLocaleString("zh-CN")}吨`:"已接入";return{key:n.name,name:n.name,value:n.value,unit:n.unit,capacity:n.capacity,capacityNote:e,percent:el((Number(n.value)||0)/oDe*100,1)}});var TG,CG;(TG=HB[0])!=null&&TG.value,(CG=HB[1])!=null&&CG.value,aa.baseCount+aa.projectCount;const lDe={class:"home-dashboard"},uDe={class:"home-left home-side-stack"},cDe={class:"home-right home-side-stack"},Ag=186,hDe={__name:"index",emits:["module-stats","loading-progress","map-ready"],setup(n,{emit:e}){const t=e,r=Be(null),i=fv("grassland","grassland-distribution"),a=Be({});let s=null,o=!1;const l=["#30dcff","#27f0c0","#ffd76c","#7aa7ff","#ff8f6b","#a6f06d"],u=gq("2028"),c=he(()=>[y("grassland","grassland-town"),y("grassland","grassland-type-proportion"),y("wetland","wetland-yield"),y("woodland","woodland-type")].filter(Boolean).map((T,C)=>_(T,`forest-grass-wet-${C}`))),h=he(()=>[{key:"yak-structure",title:"畜群结构占比",height:Ag,option:f.value},{key:"yak-three-year-forecast",title:"未来三年牦牛预测",height:Ag,option:d.value},{key:"yak-forecast-trend",title:"未来存栏趋势",height:Ag,option:p.value},{key:"yak-factor-radar",title:"预测因子雷达",height:Ag,option:g.value}]),f=he(()=>({color:l,tooltip:x(T=>`${T.name}<br/>占比:${T.percent}%<br/>估算数量:${S(T.value)}头`),legend:{orient:"vertical",right:0,top:"middle",itemWidth:8,itemHeight:8,itemGap:5,formatter(T){const C=Pu.find(A=>A.name===T);return C?`${T} ${w(C.count)}头`:T},textStyle:{color:"rgba(222, 250, 255, 0.78)",fontSize:9}},series:[{name:"畜群结构",type:"pie",radius:["36%","62%"],center:["30%","54%"],avoidLabelOverlap:!0,label:{color:"#fff",fontSize:9,formatter:"{d}%"},labelLine:{length:7,length2:4,lineStyle:{color:"rgba(223, 250, 255, 0.35)"}},itemStyle:{borderColor:"rgba(3, 18, 31, 0.92)",borderWidth:3},data:Pu.map(T=>({name:T.name,value:T.count}))}]})),d=he(()=>({color:["#30dcff"],tooltip:Ve(Le({},x()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(T){const C=za[T[0].dataIndex];return`${C.label}<br/>预测存栏:${S(C.stock)}头`}}),grid:{left:42,right:18,top:16,bottom:24},xAxis:{type:"category",data:za.map(T=>T.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",min(T){return Math.max(0,Math.floor(T.min/1e4)*1e4)},axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:10,formatter:w},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}}},series:[{name:"预测存栏",type:"bar",barWidth:24,data:za.map(T=>T.stock),itemStyle:{borderRadius:[9,9,1,1],color:new Zr(0,0,0,1,[{offset:0,color:"#30dcff"},{offset:.72,color:"rgba(48, 220, 255, 0.62)"},{offset:1,color:"rgba(48, 220, 255, 0.08)"}])},label:{show:!0,position:"top",color:"#ffffff",fontSize:10,formatter:({value:T})=>w(T)}}]})),p=he(()=>{const T=mq(u);return{color:["#30dcff","#ffd76c","#ff8f6b"],tooltip:Ve(Le({},x()),{trigger:"axis"}),legend:{top:2,right:2,itemWidth:10,itemHeight:7,itemGap:7,textStyle:{color:"rgba(222, 250, 255, 0.76)",fontSize:9}},grid:{left:42,right:32,top:30,bottom:24},xAxis:{type:"category",boundaryGap:!1,data:T.labels,axisLabel:{color:"rgba(223, 250, 255, 0.62)",fontSize:9,interval:4},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.28)"}},axisTick:{show:!1}},yAxis:[{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:9,formatter:w},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}}},{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.48)",fontSize:9,formatter:w},splitLine:{show:!1}}],series:[b("预测存栏",T.stock,"#30dcff",0,!0),b("繁殖补充",T.births,"#ffd76c",1),b("出栏扣减",T.outflow,"#ff8f6b",1)]}}),g=he(()=>({tooltip:x(),radar:{center:["50%","54%"],radius:"66%",splitNumber:4,indicator:Pb.map(T=>({name:T.name,max:100})),axisName:{color:"rgba(223, 250, 255, 0.76)",fontSize:10},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:Pb.map(T=>T.value),areaStyle:{color:"rgba(48, 220, 255, 0.22)"},lineStyle:{color:"#30dcff",width:2},itemStyle:{color:"#ffd76c"}}]}]}));Ia(()=>{t("module-stats",{moduleKey:"home",items:sDe}),m(),v()}),ns(()=>{var T,C;o=!0,(C=(T=r.value)==null?void 0:T.destroyMap)==null||C.call(T)});function v(){var C,A,M;s=new pv,t("loading-progress",{progress:0}),(A=(C=s.instance)==null?void 0:C.on)==null||A.call(C,"onProgress",(P,D,L)=>{t("loading-progress",{progress:Math.floor(D/(L||1)*100),path:P,itemsLoaded:D,itemsTotal:L})});const T=(P=0)=>$e(this,null,function*(){var L,R;if(o)return;yield Ya();const D=r.value;if((L=D==null?void 0:D.loadMap)==null||L.call(D,s),D!=null&&D.canvasMap){t("loading-progress",{progress:100}),t("map-ready"),(R=D.play)==null||R.call(D);return}if(P<24){window.setTimeout(()=>T(P+1),120);return}t("map-ready")});(M=s.ready)==null||M.then(T).catch(()=>{t("map-ready")})}function m(){return $e(this,null,function*(){const[T,C,A]=yield Promise.all([J1("grassland","grassland-distribution"),J1("wetland","wetland-distribution"),J1("woodland","woodland-distribution")]);o||(a.value={grassland:T,wetland:C,woodland:A})})}function y(T,C){const A=a.value[T];return[...(A==null?void 0:A.leftPanels)||[],...(A==null?void 0:A.rightPanels)||[]].find(P=>(P==null?void 0:P.key)===C)}function _(T,C){return Ve(Le({},T),{key:`home-${C}-${T.key}`,height:Ag})}function x(T){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:T}}function b(T,C,A,M=0,P=!1){return{name:T,type:"line",yAxisIndex:M,smooth:!0,symbolSize:5,data:C,lineStyle:{width:2.4,color:A},itemStyle:{color:A},areaStyle:P?{color:new Zr(0,0,0,1,[{offset:0,color:`${A}44`},{offset:1,color:`${A}05`}])}:void 0}}function S(T){const C=Number(T);return Number.isFinite(C)?C.toLocaleString("zh-CN",{maximumFractionDigits:Number.isInteger(C)?0:2}):"--"}function w(T){const C=Number(T);return Number.isFinite(C)?Math.abs(C)>=1e4?`${(C/1e4).toFixed(Math.abs(C)>=1e5?0:1)}万`:Math.round(C).toLocaleString("zh-CN"):"--"}return(T,C)=>(Z(),ne("div",lDe,[Ue(dv,{ref_key:"mapSceneRef",ref:r,class:"home-map-scene","active-layer":dn(i)},null,8,["active-layer"]),C[0]||(C[0]=E("div",{class:"home-map-scrim"},null,-1)),E("div",uDe,[(Z(!0),ne(et,null,ut(c.value,A=>(Z(),wi(Dt,{key:A.key,class:"home-card left-card",title:A.title,width:398,height:A.height},{default:Mt(()=>[Ue(Ir,{panel:A,compact:""},null,8,["panel"])]),_:2},1032,["title","height"]))),128))]),E("div",cDe,[(Z(!0),ne(et,null,ut(h.value,A=>(Z(),wi(Dt,{key:A.key,class:"home-card right-card",title:A.title,width:398,height:A.height},{default:Mt(()=>[A.option?(Z(),wi(dn(Pr),{key:0,class:"home-chart",option:A.option,autoresize:!0},null,8,["option"])):(Z(),wi(Ir,{key:1,panel:A,compact:""},null,8,["panel"]))]),_:2},1032,["title","height"]))),128))])]))}};const fDe={class:"topic-switcher"},dDe={class:"topic-switcher-menu"},pDe=["onPointerup","onClick"],vDe={class:"topic-name"},YS={__name:"TopicSwitcher",props:{modelValue:{type:String,required:!0},topics:{type:Array,default:()=>zp}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e;let i="",a=0;const s=he(()=>{var l;return(l=t.topics)!=null&&l.length?t.topics:zp});function o(l,u){var h,f;(f=(h=l.currentTarget)==null?void 0:h.blur)==null||f.call(h);const c=Date.now();l.type==="click"&&i===u&&c-a<450||(l.type==="pointerup"&&(i=u,a=c),r("update:modelValue",u))}return(l,u)=>(Z(),ne("div",fDe,[u[0]||(u[0]=E("div",{class:"topic-switcher-arrow"},[E("img",{src:ax,alt:""}),E("img",{src:sx,alt:""})],-1)),E("div",dDe,[(Z(!0),ne(et,null,ut(s.value,c=>(Z(),ne("button",{key:c.key,class:Ct(["topic-switcher-item",{"is-active":c.key===n.modelValue}]),style:pn({"--topic-color":c.color}),type:"button",onPointerup:h=>o(h,c.key),onClick:h=>o(h,c.key)},[E("span",vDe,ie(c.name),1)],46,pDe))),128))]),u[1]||(u[1]=E("div",{class:"topic-switcher-arrow is-reverse"},[E("img",{src:ax,alt:""}),E("img",{src:sx,alt:""})],-1))]))}};const gDe={class:"layer-panel"},mDe={class:"layer-panel-list"},yDe=["onClick"],_De={key:0,class:"layer-panel-empty"},xDe={class:"layer-panel-legend"},bDe=["disabled","title","onClick"],SDe={class:"legend-name"},wDe={key:0,class:"legend-check"},ADe={key:1,class:"layer-panel-empty is-legend"},xq={__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(n,{emit:e}){const t=n,r=e,i=he(()=>HS(t.topicKey)),a=he(()=>t.legends.filter(c).length>1),s=he(()=>t.legends.length===1),o=he(()=>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),r("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)&&r("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)=>(Z(),wi(Dt,{title:"图层控制",width:n.width,height:o.value},{default:Mt(()=>[E("div",gDe,[E("div",mDe,[(Z(!0),ne(et,null,ut(i.value,p=>(Z(),ne("button",{key:p.key,class:Ct(["layer-panel-item",{"is-active":p.key===n.modelValue,"is-checked":p.key===n.modelValue}]),type:"button",onMousedown:d[0]||(d[0]=da(()=>{},["prevent"])),onClick:g=>l(g,p.key)},[E("span",null,ie(p.name),1),d[2]||(d[2]=E("i",null,null,-1))],42,yDe))),128)),i.value.length?mt("",!0):(Z(),ne("div",_De,"暂无图层配置"))]),E("div",xDe,[d[3]||(d[3]=E("div",{class:"layer-panel-section-title"},"图例",-1)),n.legends.length?(Z(),ne("div",{key:0,class:Ct(["layer-panel-legend-grid",{"is-single":s.value}])},[(Z(!0),ne(et,null,ut(n.legends,p=>(Z(),ne("button",{key:p.key||p.name,class:Ct(["layer-panel-legend-row",{"is-selected":h(p)&&p.key===n.selectedLegendKey,"is-checkable":h(p),"is-disabled":!h(p)}]),type:"button",disabled:!h(p),title:p.name,onMousedown:d[1]||(d[1]=da(()=>{},["prevent"])),onClick:g=>u(g,p)},[E("span",{class:"legend-swatch",style:pn({backgroundColor:p.fillColor,borderColor:p.strokeColor||p.fillColor})},null,4),E("span",SDe,ie(p.name),1),h(p)?(Z(),ne("i",wDe)):mt("",!0)],42,bDe))),128))],2)):(Z(),ne("div",ADe,"暂无图例"))])])]),_:1},8,["width","height"]))}};const MDe={class:"feature-info"},TDe={key:0,class:"feature-info-state"},CDe={key:1,class:"feature-info-state"},EDe={key:2,class:"feature-info-state"},PDe={key:0,class:"feature-table"},LDe=["title"],RDe={key:1,class:"feature-info-state is-inline"},bq={__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(n){const e=n,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"],"图斑面积"]],r=[[["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"],"土层厚度"],...r],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"],"草地经营权"],...r],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"],"土层厚度"],...r],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":"龙日镇"},s={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:"平地"}},o=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=he(()=>{var U;return((U=e.feature)==null?void 0:U.properties)||{}}),d=he(()=>{var U,$,Y;return(($=(U=e.feature)==null?void 0:U.feature)==null?void 0:$.geometry)||((Y=e.feature)==null?void 0:Y.geometry)||null}),p=he(()=>{var re,_e,Fe,Ce,Ae;const U=String(((re=e.feature)==null?void 0:re.id)||"").toLowerCase(),$=String(((Fe=(_e=e.feature)==null?void 0:_e.layer)==null?void 0:Fe.key)||"").toLowerCase(),Y=String(((Ae=(Ce=e.feature)==null?void 0:Ce.layer)==null?void 0:Ae.layerName)||"").toLowerCase(),oe=`${$} ${Y}`,X=f.value;return oe.includes("national-park")||oe.includes("restoration")||X.project_name||X.project_category||X.totalAcreage?"ecological":X.dlmc||U.includes("woodland")||U.includes("t_woodland")||oe.includes("woodland")?"woodland":oe.includes("wetland")||oe.includes("shidi")||U.includes("shidi")||X.land_type==="shidi"||X.land_type==="湿地"||X.land_type===2?"wetland":oe.includes("grassland")||oe.includes("caodi")||X.grassland_category_name||X.basic_type_name||U.includes("caodi")||X.land_type==="caodi"||X.land_type===1?"grassland":"woodland"}),g=he(()=>{const U=[],$=new Set;return(i[p.value]||i.woodland).forEach(([oe,X])=>{const re=_(f.value,oe,X,$);re&&!U.some(_e=>_e.label===re.label)&&(U.push(re),$.add(re.sourceKey))}),U.some(oe=>oe.label==="图斑面积")||y(U,$,"图斑面积",R(d.value),"geometry-area"),Object.entries(f.value).forEach(([oe,X])=>{if($.has(oe)||D(oe,X))return;const re=b(oe,X);x(re)&&(U.some(_e=>_e.value===re||_e.label===(l[oe]||H(oe)))||(U.push({key:`fallback-${oe}`,sourceKey:oe,label:l[oe]||H(oe),value:re}),$.add(oe)))}),U}),v=he(()=>g.value.map((U,$)=>Ve(Le({},U),{displayOrder:m(U,$)})).sort((U,$)=>U.displayOrder-$.displayOrder));function m(U,$){const Y=(U==null?void 0:U.label)||"",oe=String((U==null?void 0:U.sourceKey)||"").toLowerCase();return["所在乡镇","所在村","所在区域","图斑编号","图斑面积","小班面积","图斑地类面积","地类名称","湿地类型"].includes(Y)?$:["基本草原类型","草原类型","草原类","草原型","湿地草地型","草原级别","湿地级别","退化等级","功能类别","保护等级","森林类别","林种","质量等级","优势树种","起源","龄组"].includes(Y)?100+$:Y.includes("产量")||Y.includes("亩产")||Y.includes("植被")||Y.includes("优势草种")||Y.includes("优势度")||Y.includes("海拔")||Y.includes("地貌")||Y.includes("坡")||Y.includes("土壤")||Y.includes("郁闭度")||Y.includes("树高")||Y.includes("蓄积")||Y.includes("生物量")||Y.includes("碳储量")?200+$:Y.includes("权属")||Y.includes("所有权")||Y.includes("使用权")||Y.includes("经营权")||Y.includes("调查")||Y.includes("调整")||Y.includes("划区")||Y.includes("单位")||oe.includes("owner")||oe.includes("qsdw")||oe.includes("zldw")?300+$:150+$}function y(U,$,Y,oe,X){!x(oe)||U.some(re=>re.label===Y||re.value===oe)||(U.push({key:`static-${X}`,sourceKey:X,label:Y,value:oe}),$.add(X))}function _(U,$,Y,oe=new Set){for(const X of $)if(!(oe.has(X)||P(X))&&x(U==null?void 0:U[X])){const re=b(X,U[X]);if(!x(re))continue;return{key:`${Y}-${X}`,sourceKey:X,label:Y,value:re}}return null}function x(U){return U!=null&&U!==""&&U!==" "&&U!=="null"&&U!=="undefined"}function b(U,$){var X;if(!x($))return"";if((X=s[U])!=null&&X[String($)])return s[U][String($)];if(["xiang","xzqdm","town_code","area_code"].includes(U))return S($);if(["cun","village_code"].includes(U)&&w($))return"";if(["grassland_level","level"].includes(U)&&T($))return p.value==="wetland"?`${Number($)}级湿地`:`${Number($)}级草原`;if(o.has(U)&&w($)||L(U,$))return"";if(A(U))return M($);if(typeof $=="number"||/^-?\d+(\.\d+)?$/.test(String($))){const re=Number($);if(re===0&&c.has(U))return"";const _e=Number.isInteger(re)?`${re}`:`${Number(re.toFixed(2))}`;return["xbmj","tbdlmj","geomj","area_square_meter"].includes(U)?`${C(re/666.6667)} 亩`:["acreage","mj","area_mu"].includes(U)?`${_e} 亩`:["length_meter"].includes(U)?`${_e} 米`:["totalAcreage","cdAcreage","sdAcreage"].includes(U)?`${_e} 万亩`:["cdScl","sdScl"].includes(U)?`${_e} 万吨`:["areaWanMu","area_wan_mu"].includes(U)?`${_e} 万亩`:["xc_yield","xb_xc_yield","gc_yield","xb_gc_yield","edible_xc_yield","grass_yield"].includes(U)?`${_e} 斤`:["mu_yield","xc_mu_yield","gc_mu_yield","xb_xc_mu_yield","xb_gc_mu_yield","edible_xc_mu_yield"].includes(U)?`${_e} 斤`:["vegetation_cover","lbmjbl","yu_bi_du"].includes(U)?`${_e}%`:["elevation","tu_ceng_hd","pingjun_sg"].includes(U)?`${_e} 米`:["po_du","slope"].includes(U)?`${_e}°`:_e}const oe=String($);return p.value==="wetland"&&["grassland_level","level"].includes(U)?oe.replace(/草原/g,"湿地"):oe}function S(U){const $=String(U||"").trim();if(!$)return"";if(a[$])return a[$];const Y=$.replace(/\D/g,"");if(a[Y])return a[Y];for(let oe=Math.min(12,Y.length);oe>=6;oe--){const X=Y.slice(0,oe);if(a[X])return a[X]}return w($)?"":$}function w(U){return/^[0-9A-Za-z_-]{1,12}$/.test(String(U).trim())}function T(U){return/^-?\d+(\.\d+)?$/.test(String(U).trim())}function C(U){return Number.isInteger(U)?`${U}`:`${Number(U.toFixed(2))}`}function A(U){return["survey_time","dc_rq","create_time","update_time"].includes(String(U))}function M(U){const $=String(U);return/^\d{4}-\d{2}-\d{2}/.test($)?$.slice(0,10):$}function P(U){const $=String(U).toLowerCase();return["geom","wkt","geometry","the_geom","raw_properties"].includes($)||["bsm","ysdm","gid","id","objectid","object_id","fid","key_uid"].includes($)||["shape_leng","shape_length","length","perimeter"].includes($)?!0:["xzqdm","area_code","town_code","patch_no","land_number"].includes($)?!1:["di_lei","qykz","stqw","lyfq","tbybh","patch_code"].includes($)||$.endsWith("_code")||$.endsWith("dm")||$.endsWith("_id")||["create_by","create_time","update_by","update_time"].includes($)?!0:$.includes("geom")||$.includes("boundary")||$.includes("wkb")}function D(U,$){var oe;if(P(U)||!x($))return!0;const Y=String(U).toLowerCase();return!!(h.has(Y)||Y.includes("number")||Y.includes("patch_no")||!u.has(U)||w($)&&!((oe=s[U])!=null&&oe[String($)])&&!["xiang","xzqdm","town_code","area_code","cun","land_type","grassland_level","level","gjgyl_bhdj","bh_dj","ld_qs","qsxz","tdsyqs","zl_dj"].includes(U))}function L(U,$){var Y;return!w($)||(Y=s[U])!=null&&Y[String($)]?!1:["resource_type","grassland category","functional_category","aspect","soil_depth","soil texture","cdsyq","cdsyq2","cdjjq"].includes(U)}function R(U){const $=N(U);if(!$)return"";const Y=$/666.6667;return Y>=1e4?`${C(Y/1e4)} 万亩`:`${C(Y)} 亩`}function N(U){return U!=null&&U.coordinates?U.type==="Polygon"?F(U.coordinates):U.type==="MultiPolygon"?U.coordinates.reduce(($,Y)=>$+F(Y),0):0:0}function F(U=[]){if(!U.length)return 0;const[$,...Y]=U,oe=Math.abs(O($)),X=Y.reduce((re,_e)=>re+Math.abs(O(_e)),0);return Math.max(0,oe-X)}function O(U=[]){if(U.length<3)return 0;const $=U.reduce((re,_e)=>re+Number((_e==null?void 0:_e[1])||0),0)/U.length,Y=111320,oe=Y*Math.cos($*Math.PI/180);let X=0;for(let re=0;re<U.length;re++){const _e=U[re],Fe=U[(re+1)%U.length],Ce=Number((_e==null?void 0:_e[0])||0)*oe,Ae=Number((_e==null?void 0:_e[1])||0)*Y,ze=Number((Fe==null?void 0:Fe[0])||0)*oe,fe=Number((Fe==null?void 0:Fe[1])||0)*Y;X+=Ce*fe-ze*Ae}return X/2}function H(U){return String(U).replace(/_/g," ").replace(/\b\w/g,$=>$.toUpperCase())}return(U,$)=>(Z(),wi(Dt,{title:"图斑详情",width:n.width,height:n.height},{default:Mt(()=>[E("div",MDe,[n.loading?(Z(),ne("div",TDe,"正在查询图斑信息")):n.empty?(Z(),ne("div",CDe,"当前点击位置未查询到图斑")):n.feature?(Z(),ne(et,{key:3},[v.value.length?(Z(),ne("div",PDe,[(Z(!0),ne(et,null,ut(v.value,Y=>(Z(),ne("div",{key:Y.key,class:"feature-row"},[E("span",null,ie(Y.label),1),E("strong",{title:Y.value},ie(Y.value),9,LDe)]))),128))])):(Z(),ne("div",RDe,"当前图斑暂无可展示的业务字段"))],64)):(Z(),ne("div",EDe,"点击地图图层查看图斑/要素信息"))])]),_:1},8,["width","height"]))}};const DDe={class:"forest-grass-wet"},IDe={class:"forest-grass-wet-ui",id:"forest-grass-wet-ui"},NDe={class:"fgw-left"},kDe={class:"fgw-side-stack is-left"},ODe={class:"fgw-right"},FDe={class:"fgw-side-stack is-right"},BDe={class:"fgw-map-layer-tools"},GDe={class:"fgw-bottom-topic"},zDe={key:0,class:"loading"},UDe={class:"loading-progress"},VDe={class:"value"},HDe={__name:"index",props:{showLoading:{type:Boolean,default:!0}},emits:["topic-stats"],setup(n,{emit:e}){const t=n,r=e,i=Be(null),a=Be(zp[0].key),s=Be(zp[0].defaultLayerKey),o=Be([]),l=Be("idle"),u=Be(!1),c=Be({title:"业务统计",rows:[]}),h=Be({title:"业务统计",rows:[]}),f=Be([]),d=Be([]),p=Be({}),g=Be(null),v=Be(""),m=Be(null),y=Be(!1),_=Be(!1),x=Be(null),b=Be(0),S=Be(t.showLoading),w=Be({type:"idle",text:"等待 GeoServer 图层加载"});let T=null,C=!1,A=0,M=0;const P=new Set(["grassland-distribution","wetland-distribution","woodland-distribution","woodland-protection","woodland-type","woodland-quality","woodland-ownership"]);he(()=>$2(a.value));const D=he(()=>fv(a.value,s.value)),L=he(()=>{var I;return(((I=D.value)==null?void 0:I.legends)||[]).find(G=>G.key===v.value)||null}),R=he(()=>{var G;const I=D.value;return!I||!((G=L.value)!=null&&G.cqlFilter)?I:Ve(Le({},I),{cqlFilter:L.value.cqlFilter,activeLegend:L.value,name:L.value.name||I.name})}),N=he(()=>190),F=he(()=>12),O=he(()=>N.value*2+F.value),H=he(()=>!!x.value),U=he(()=>{if(_.value||y.value||!m.value)return 186;const I=ze(m.value);return Math.min(480,Math.max(300,86+Math.min(I,12)*34))}),$=he(()=>{if(!x.value)return{};const I=460,G=U.value,K=24,ge=Y(x.value),Ee=ge.x>1420?-I-28:28,q=Math.min(Math.max(ge.x+Ee,K),1920-I-K),le=Math.min(Math.max(ge.y-G-72,188),1080-G-132);return{left:`${q}px`,top:`${le}px`,right:"auto",bottom:"auto"}});function Y(I){const G=document.querySelector(".forest-grass-wet"),K=G==null?void 0:G.getBoundingClientRect();return!(K!=null&&K.width)||!(K!=null&&K.height)?I:{x:(I.x-K.left)/K.width*1920,y:(I.y-K.top)/K.height*1080}}Ia(()=>{document.addEventListener("pointerdown",ee,!0),oe(),X(a.value,s.value),fe(a.value,s.value)}),ns(()=>{C=!0,document.removeEventListener("pointerdown",ee,!0)}),ei(a,I=>{var Ee;const G=$2(I),K=HS(I),ge=G.defaultLayerKey||((Ee=K[0])==null?void 0:Ee.key)||"";v.value="",s.value=ge,V(),X(I,ge),fe(I,ge,null)}),ei(s,()=>{v.value="",V(),w.value={type:"loading",text:"正在加载 GeoServer 图层"},X(a.value,s.value),fe(a.value,s.value,null)}),ei(v,()=>{V(),fe(a.value,s.value,L.value)});function oe(){var ge;T=new pv;let I=!1;const G={progress:0};T.instance.on("onProgress",(Ee,q,le)=>{const ue=Math.floor(q/le*100);Mr.to(G,{progress:ue,onUpdate:()=>{b.value=Math.floor(G.progress)}})});const K=()=>$e(this,null,function*(){var Ee,q;C||I||(I=!0,(Ee=i.value)==null||Ee.loadMap(T),yield ae(),yield Ya(),(q=i.value)==null||q.play())});T.instance.on("onLoad",K),(ge=T.ready)==null||ge.then(K).catch(()=>{C||(w.value={type:"error",text:"地图资源加载失败"})})}function X(K){return $e(this,arguments,function*(I,G=s.value){const ge=`${I}:${G||""}`,Ee=p.value[ge];if(Ee){re(Ee,I);return}const q=++M;u.value=!0,l.value="loading";const le=yield J1(I,G);C||q!==M||I===a.value&&(G||"")===(s.value||"")&&(p.value=Ve(Le({},p.value),{[ge]:le}),re(le,I))})}function re(I,G){var ge,Ee,q;const K=_e(I);o.value=K.core||[],c.value=K.left||{title:"业务统计",rows:[]},h.value=K.right||{title:"业务统计",rows:[]},f.value=(ge=K.leftPanels)!=null&&ge.length?K.leftPanels:[c.value],d.value=(Ee=K.rightPanels)!=null&&Ee.length?K.rightPanels:[h.value],l.value=K.status,u.value=!1,r("topic-stats",{topicKey:G,topicName:$2(G).name,items:((q=K.top)!=null&&q.length?K.top:K.core||[]).slice(0,4)})}function _e(I){return I||{}}function Fe(I,G){return`${a.value}-${G}-${(I==null?void 0:I.key)||(I==null?void 0:I.title)||"panel"}`}function Ce(I){var K;const G=((K=I==null?void 0:I.rows)==null?void 0:K.length)||0;return(I==null?void 0:I.span)===1?!1:(I==null?void 0:I.span)===2?!0:(I==null?void 0:I.type)==="spotlight"||(I==null?void 0:I.type)==="metric"||(I==null?void 0:I.type)==="column"&&G<=5?!1:(I==null?void 0:I.type)==="rank"&&G>4||(I==null?void 0:I.type)==="split"&&G>4||(I==null?void 0:I.type)==="donut"&&G>5||(I==null?void 0:I.type)==="structure"&&G>4||(I==null?void 0:I.type)==="bar"&&G>4||(I==null?void 0:I.type)==="line"&&G>6}function Ae(I){return Ce(I)?O.value:N.value}function ze(I){var Ee;const G=(I==null?void 0:I.properties)||{},K=Object.keys(G).filter(q=>{const le=G[q];if(le==null||le==="")return!1;const ue=q.toLowerCase();return!(["geom","wkt","geometry","the_geom","shape_leng","shape_length","length","perimeter"].includes(ue)||["gid","id","objectid","object_id","fid","key_uid","bsm","ysdm"].includes(ue))}),ge=!!((Ee=I==null?void 0:I.feature)!=null&&Ee.geometry||I!=null&&I.geometry);return K.length+(ge?1:0)}function fe(ge,Ee){return $e(this,arguments,function*(I,G,K=L.value){const q=++A;if(!G||!j(G,K)){g.value=xe(I,G);return}const le=yield W3e(I,G,K);C||q!==A||I!==a.value||G!==s.value||((K==null?void 0:K.key)||"")===v.value&&(g.value=le)})}function j(I,G=null){return!!(G!=null&&G.key)||P.has(I)}function xe(I,G){return{status:"disabled",topicKey:I,layerKey:G,title:"",unit:"",rows:[]}}function pe(I){var K,ge;const G=(ge=(K=I==null?void 0:I.feature)!=null?K:I)!=null?ge:null;if(!G){V();return}m.value=G,y.value=!1,I!=null&&I.screen&&(x.value=I.screen)}function we(I){w.value=I}function V(){var I,G;m.value=null,y.value=!1,x.value=null,(G=(I=i.value)==null?void 0:I.clearSelectedFeature)==null||G.call(I)}function ee(I){if(!H.value)return;const G=document.querySelector(".fgw-map-feature-info"),K=I.target;G&&K instanceof Node&&G.contains(K)||V()}function ae(){return S.value?new Promise(I=>{Mr.to(".forest-grass-wet .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{S.value=!1,I()}})}):Promise.resolve()}return(I,G)=>{var K;return Z(),ne("div",DDe,[Ue(dv,{ref_key:"mapSceneRef",ref:i,"active-layer":R.value,"map-ranking":g.value,onFeatureLoading:G[0]||(G[0]=ge=>_.value=ge),onFeatureInfo:pe,onLayerStatus:we},null,8,["active-layer","map-ranking"]),E("div",IDe,[E("div",NDe,[E("div",kDe,[(Z(!0),ne(et,null,ut(f.value,ge=>(Z(),wi(Dt,{key:Fe(ge,"left"),class:Ct(["fgw-side-card left-card",{"is-double":Ce(ge)}]),title:ge.title,width:398,height:Ae(ge)},{default:Mt(()=>[Ue(Ir,{panel:ge,compact:""},null,8,["panel"])]),_:2},1032,["class","title","height"]))),128))])]),E("div",ODe,[E("div",FDe,[(Z(!0),ne(et,null,ut(d.value,ge=>(Z(),wi(Dt,{key:Fe(ge,"right"),class:Ct(["fgw-side-card right-card",{"is-double":Ce(ge)}]),title:ge.title,width:398,height:Ae(ge)},{default:Mt(()=>[Ue(Ir,{panel:ge,compact:""},null,8,["panel"])]),_:2},1032,["class","title","height"]))),128))])]),E("div",BDe,[Ue(xq,{modelValue:s.value,"onUpdate:modelValue":G[1]||(G[1]=ge=>s.value=ge),"selected-legend-key":v.value,"onUpdate:selectedLegendKey":G[2]||(G[2]=ge=>v.value=ge),"topic-key":a.value,legends:((K=R.value)==null?void 0:K.legends)||[],width:248,height:430},null,8,["modelValue","selected-legend-key","topic-key","legends"])]),H.value?(Z(),ne("div",{key:0,class:"fgw-map-feature-info",style:pn($.value)},[Ue(bq,{feature:m.value,empty:y.value,loading:_.value,width:460,height:U.value},null,8,["feature","empty","loading","height"])],4)):mt("",!0),E("div",GDe,[Ue(YS,{modelValue:a.value,"onUpdate:modelValue":G[3]||(G[3]=ge=>a.value=ge)},null,8,["modelValue"])])]),S.value?(Z(),ne("div",zDe,[G[5]||(G[5]=Fh('<div class="loading-text"><span style="--index:1;">L</span><span style="--index:2;">O</span><span style="--index:3;">A</span><span style="--index:4;">D</span><span style="--index:5;">I</span><span style="--index:6;">N</span><span style="--index:7;">G</span></div>',1)),E("div",UDe,[E("span",VDe,ie(b.value),1),G[4]||(G[4]=E("span",{class:"unit"},"%",-1))])])):mt("",!0)])}}};function WDe(n){n("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),n("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),n("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var e=1;e<=60;++e)n("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),n("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");n("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),n("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),n.WGS84=n["EPSG:4326"],n["EPSG:3785"]=n["EPSG:3857"],n.GOOGLE=n["EPSG:3857"],n["EPSG:900913"]=n["EPSG:3857"],n["EPSG:102113"]=n["EPSG:3857"]}var yf=1,_f=2,cp=3,$De=4,FE=5,WB=6378137,jDe=6356752314e-3,$B=.0066943799901413165,xm=484813681109536e-20,qe=Math.PI/2,qDe=.16666666666666666,XDe=.04722222222222222,YDe=.022156084656084655,it=1e-10,wr=.017453292519943295,xa=57.29577951308232,On=Math.PI/4,S0=Math.PI*2,Nr=3.14159265359,ka={};ka.greenwich=0;ka.lisbon=-9.131906111111;ka.paris=2.337229166667;ka.bogota=-74.080916666667;ka.madrid=-3.687938888889;ka.rome=12.452333333333;ka.bern=7.439583333333;ka.jakarta=106.807719444444;ka.ferro=-17.666666666667;ka.brussels=4.367975;ka.stockholm=18.058277777778;ka.athens=23.7163375;ka.oslo=10.722916666667;const KDe={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var jB=/[\s_\-\/\(\)]/g;function yc(n,e){if(n[e])return n[e];for(var t=Object.keys(n),r=e.toLowerCase().replace(jB,""),i=-1,a,s;++i<t.length;)if(a=t[i],s=a.toLowerCase().replace(jB,""),s===r)return n[a]}function BE(n){var e={},t=n.split("+").map(function(o){return o.trim()}).filter(function(o){return o}).reduce(function(o,l){var u=l.split("=");return u.push(!0),o[u[0].toLowerCase()]=u[1],o},{}),r,i,a,s={proj:"projName",datum:"datumCode",rf:function(o){e.rf=parseFloat(o)},lat_0:function(o){e.lat0=o*wr},lat_1:function(o){e.lat1=o*wr},lat_2:function(o){e.lat2=o*wr},lat_ts:function(o){e.lat_ts=o*wr},lon_0:function(o){e.long0=o*wr},lon_1:function(o){e.long1=o*wr},lon_2:function(o){e.long2=o*wr},alpha:function(o){e.alpha=parseFloat(o)*wr},gamma:function(o){e.rectified_grid_angle=parseFloat(o)*wr},lonc:function(o){e.longc=o*wr},x_0:function(o){e.x0=parseFloat(o)},y_0:function(o){e.y0=parseFloat(o)},k_0:function(o){e.k0=parseFloat(o)},k:function(o){e.k0=parseFloat(o)},a:function(o){e.a=parseFloat(o)},b:function(o){e.b=parseFloat(o)},r:function(o){e.a=e.b=parseFloat(o)},r_a:function(){e.R_A=!0},zone:function(o){e.zone=parseInt(o,10)},south:function(){e.utmSouth=!0},towgs84:function(o){e.datum_params=o.split(",").map(function(l){return parseFloat(l)})},to_meter:function(o){e.to_meter=parseFloat(o)},units:function(o){e.units=o;var l=yc(KDe,o);l&&(e.to_meter=l.to_meter)},from_greenwich:function(o){e.from_greenwich=o*wr},pm:function(o){var l=yc(ka,o);e.from_greenwich=(l||parseFloat(o))*wr},nadgrids:function(o){o==="@null"?e.datumCode="none":e.nadgrids=o},axis:function(o){var l="ewnsud";o.length===3&&l.indexOf(o.substr(0,1))!==-1&&l.indexOf(o.substr(1,1))!==-1&&l.indexOf(o.substr(2,1))!==-1&&(e.axis=o)},approx:function(){e.approx=!0},over:function(){e.over=!0}};for(r in t)i=t[r],r in s?(a=s[r],typeof a=="function"?a(i):e[a]=i):e[r]=i;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=n,e}class Sq{static getId(e){const t=e.find(r=>Array.isArray(r)&&r[0]==="ID");return t&&t.length>=3?{authority:t[1],code:parseInt(t[2],10)}:null}static convertUnit(e,t="unit"){if(!e||e.length<3)return{type:t,name:"unknown",conversion_factor:null};const r=e[1],i=parseFloat(e[2])||null,a=e.find(o=>Array.isArray(o)&&o[0]==="ID"),s=a?{authority:a[1],code:parseInt(a[2],10)}:null;return{type:t,name:r,conversion_factor:i,id:s}}static convertAxis(e){const t=e[1]||"Unknown";let r;const i=t.match(/^\((.)\)$/);if(i){const u=i[1].toUpperCase();if(u==="E")r="east";else if(u==="N")r="north";else if(u==="U")r="up";else if(e[2])r=e[2];else throw new Error(`Unknown axis abbreviation: ${u}`)}else r=e[2]||"unknown";const a=e.find(u=>Array.isArray(u)&&u[0]==="ORDER"),s=a?parseInt(a[1],10):null,o=e.find(u=>Array.isArray(u)&&(u[0]==="LENGTHUNIT"||u[0]==="ANGLEUNIT"||u[0]==="SCALEUNIT")),l=this.convertUnit(o);return{name:t,direction:r,unit:l,order:s}}static extractAxes(e){return e.filter(t=>Array.isArray(t)&&t[0]==="AXIS").map(t=>this.convertAxis(t)).sort((t,r)=>(t.order||0)-(r.order||0))}static convert(e,t={}){switch(e[0]){case"PROJCRS":t.type="ProjectedCRS",t.name=e[1],t.base_crs=e.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")):null,t.conversion=e.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")):null;const r=e.find(f=>Array.isArray(f)&&f[0]==="CS");r&&(t.coordinate_system={type:r[1],axis:this.extractAxes(e)});const i=e.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT");if(i){const f=this.convertUnit(i);t.coordinate_system.unit=f}t.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":case"GEODCRS":t.type=e[0]==="GEODCRS"?"GeodeticCRS":"GeographicCRS",t.name=e[1];const a=e.find(f=>Array.isArray(f)&&(f[0]==="DATUM"||f[0]==="ENSEMBLE"));if(a){const f=this.convert(a);a[0]==="ENSEMBLE"?t.datum_ensemble=f:t.datum=f;const d=e.find(p=>Array.isArray(p)&&p[0]==="PRIMEM");d&&d[1]!=="Greenwich"&&(f.prime_meridian={name:d[1],longitude:parseFloat(d[2])})}t.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},t.id=this.getId(e);break;case"DATUM":t.type="GeodeticReferenceFrame",t.name=e[1],t.ellipsoid=e.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":t.type="DatumEnsemble",t.name=e[1],t.members=e.filter(f=>Array.isArray(f)&&f[0]==="MEMBER").map(f=>({type:"DatumEnsembleMember",name:f[1],id:this.getId(f)}));const s=e.find(f=>Array.isArray(f)&&f[0]==="ENSEMBLEACCURACY");s&&(t.accuracy=parseFloat(s[1]));const o=e.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID");o&&(t.ellipsoid=this.convert(o)),t.id=this.getId(e);break;case"ELLIPSOID":t.type="Ellipsoid",t.name=e[1],t.semi_major_axis=parseFloat(e[2]),t.inverse_flattening=parseFloat(e[3]),e.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT")&&this.convert(e.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT"),t);break;case"CONVERSION":t.type="Conversion",t.name=e[1],t.method=e.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,t.parameters=e.filter(f=>Array.isArray(f)&&f[0]==="PARAMETER").map(f=>this.convert(f));break;case"METHOD":t.type="Method",t.name=e[1],t.id=this.getId(e);break;case"PARAMETER":t.type="Parameter",t.name=e[1],t.value=parseFloat(e[2]),t.unit=this.convertUnit(e.find(f=>Array.isArray(f)&&(f[0]==="LENGTHUNIT"||f[0]==="ANGLEUNIT"||f[0]==="SCALEUNIT"))),t.id=this.getId(e);break;case"BOUNDCRS":t.type="BoundCRS";const l=e.find(f=>Array.isArray(f)&&f[0]==="SOURCECRS");if(l){const f=l.find(d=>Array.isArray(d));t.source_crs=f?this.convert(f):null}const u=e.find(f=>Array.isArray(f)&&f[0]==="TARGETCRS");if(u){const f=u.find(d=>Array.isArray(d));t.target_crs=f?this.convert(f):null}const c=e.find(f=>Array.isArray(f)&&f[0]==="ABRIDGEDTRANSFORMATION");c?t.transformation=this.convert(c):t.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(t.type="Transformation",t.name=e[1],t.method=e.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(e.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,t.parameters=e.filter(f=>Array.isArray(f)&&(f[0]==="PARAMETER"||f[0]==="PARAMETERFILE")).map(f=>{if(f[0]==="PARAMETER")return this.convert(f);if(f[0]==="PARAMETERFILE")return{name:f[1],value:f[2],id:{authority:"EPSG",code:8656}}}),t.parameters.length===7){const f=t.parameters[6];f.name==="Scale difference"&&(f.value=Math.round((f.value-1)*1e12)/1e6)}t.id=this.getId(e);break;case"AXIS":t.coordinate_system||(t.coordinate_system={type:"unspecified",axis:[]}),t.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const h=this.convertUnit(e,"LinearUnit");t.coordinate_system&&t.coordinate_system.axis&&t.coordinate_system.axis.forEach(f=>{f.unit||(f.unit=h)}),h.conversion_factor&&h.conversion_factor!==1&&t.semi_major_axis&&(t.semi_major_axis={value:t.semi_major_axis,unit:h});break;default:t.keyword=e[0];break}return t}}class ZDe extends Sq{static convert(e,t={}){return super.convert(e,t),t.coordinate_system&&t.coordinate_system.subtype==="Cartesian"&&delete t.coordinate_system,t.usage&&delete t.usage,t}}class QDe extends Sq{static convert(e,t={}){super.convert(e,t);const r=e.find(a=>Array.isArray(a)&&a[0]==="CS");r&&(t.coordinate_system={subtype:r[1],axis:this.extractAxes(e)});const i=e.find(a=>Array.isArray(a)&&a[0]==="USAGE");if(i){const a=i.find(l=>Array.isArray(l)&&l[0]==="SCOPE"),s=i.find(l=>Array.isArray(l)&&l[0]==="AREA"),o=i.find(l=>Array.isArray(l)&&l[0]==="BBOX");t.usage={},a&&(t.usage.scope=a[1]),s&&(t.usage.area=s[1]),o&&(t.usage.bbox=o.slice(1))}return t}}function JDe(n){return n.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(n.find(e=>Array.isArray(e)&&e[0]==="CS")||n[0]==="BOUNDCRS"||n[0]==="PROJCRS"||n[0]==="GEOGCRS","2015")}function eIe(n){return(JDe(n)==="2019"?QDe:ZDe).convert(n)}function tIe(n){const e=n.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var w0=1,wq=2,Aq=3,Lb=4,Mq=5,s3=-1,nIe=/\s/,rIe=/[A-Za-z]/,iIe=/[A-Za-z84_]/,KS=/[,\]]/,Tq=/[\d\.E\-\+]/;function Ql(n){if(typeof n!="string")throw new Error("not a string");this.text=n.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=w0}Ql.prototype.readCharicter=function(){var n=this.text[this.place++];if(this.state!==Lb)for(;nIe.test(n);){if(this.place>=this.text.length)return;n=this.text[this.place++]}switch(this.state){case w0:return this.neutral(n);case wq:return this.keyword(n);case Lb:return this.quoted(n);case Mq:return this.afterquote(n);case Aq:return this.number(n);case s3:return}};Ql.prototype.afterquote=function(n){if(n==='"'){this.word+='"',this.state=Lb;return}if(KS.test(n)){this.word=this.word.trim(),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in afterquote yet, index '+this.place)};Ql.prototype.afterItem=function(n){if(n===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=w0;return}if(n==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=w0,this.currentObject=this.stack.pop(),this.currentObject||(this.state=s3);return}};Ql.prototype.number=function(n){if(Tq.test(n)){this.word+=n;return}if(KS.test(n)){this.word=parseFloat(this.word),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in number yet, index '+this.place)};Ql.prototype.quoted=function(n){if(n==='"'){this.state=Mq;return}this.word+=n};Ql.prototype.keyword=function(n){if(iIe.test(n)){this.word+=n;return}if(n==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=w0;return}if(KS.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in keyword yet, index '+this.place)};Ql.prototype.neutral=function(n){if(rIe.test(n)){this.word=n,this.state=wq;return}if(n==='"'){this.word="",this.state=Lb;return}if(Tq.test(n)){this.word=n,this.state=Aq;return}if(KS.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in neutral yet, index '+this.place)};Ql.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===s3)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function aIe(n){var e=new Ql(n);return e.output()}function X2(n,e,t){Array.isArray(e)&&(t.unshift(e),e=null);var r=e?{}:n,i=t.reduce(function(a,s){return jd(s,a),a},r);e&&(n[e]=i)}function jd(n,e){if(!Array.isArray(n)){e[n]=!0;return}var t=n.shift();if(t==="PARAMETER"&&(t=n.shift()),n.length===1){if(Array.isArray(n[0])){e[t]={},jd(n[0],e[t]);return}e[t]=n[0];return}if(!n.length){e[t]=!0;return}if(t==="TOWGS84"){e[t]=n;return}if(t==="AXIS"){t in e||(e[t]=[]),e[t].push(n);return}Array.isArray(t)||(e[t]={});var r;switch(t){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[t]={name:n[0].toLowerCase(),convert:n[1]},n.length===3&&jd(n[2],e[t]);return;case"SPHEROID":case"ELLIPSOID":e[t]={name:n[0],a:n[1],rf:n[2]},n.length===4&&jd(n[3],e[t]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":n[0]=["name",n[0]],X2(e,t,n);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":n[0]=["name",n[0]],X2(e,t,n),e[t].type=t;return;default:for(r=-1;++r<n.length;)if(!Array.isArray(n[r]))return jd(n,e[t]);return X2(e,t,n)}}var sIe=.017453292519943295;function ds(n){return n*sIe}function Cq(n){const e=(n.projName||"").toLowerCase().replace(/_/g," ");n.long0===void 0&&n.longc!==void 0&&(n.long0=n.longc),!n.lat_ts&&n.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(n.lat0=ds(n.lat1>0?90:-90),n.lat_ts=n.lat1,delete n.lat1):!n.lat_ts&&n.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(n.lat_ts=n.lat0,n.lat0=ds(n.lat0>0?90:-90),delete n.lat1)}function qB(n){let e={units:null,to_meter:void 0};return typeof n=="string"?(e.units=n.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):n&&n.name&&(e.units=n.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=n.conversion_factor),e}function XB(n){return typeof n=="object"?n.value*n.unit.conversion_factor:n}function YB(n,e){n.ellipsoid.radius?(e.a=n.ellipsoid.radius,e.rf=0):(e.a=XB(n.ellipsoid.semi_major_axis),n.ellipsoid.inverse_flattening!==void 0?e.rf=n.ellipsoid.inverse_flattening:n.ellipsoid.semi_major_axis!==void 0&&n.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-XB(n.ellipsoid.semi_minor_axis))))}function Rb(n,e={}){return!n||typeof n!="object"?n:n.type==="BoundCRS"?(Rb(n.source_crs,e),n.transformation&&(n.transformation.method&&n.transformation.method.name==="NTv2"?e.nadgrids=n.transformation.parameters[0].value:e.datum_params=n.transformation.parameters.map(t=>t.value)),e):(Object.keys(n).forEach(t=>{const r=n[t];if(r!==null)switch(t){case"name":if(e.srsCode)break;e.name=r,e.srsCode=r;break;case"type":r==="GeographicCRS"?e.projName="longlat":r==="GeodeticCRS"?n.coordinate_system&&n.coordinate_system.subtype==="Cartesian"?e.projName="geocent":e.projName="longlat":r==="ProjectedCRS"&&n.conversion&&n.conversion.method&&(e.projName=n.conversion.method.name);break;case"datum":case"datum_ensemble":r.ellipsoid&&(e.ellps=r.ellipsoid.name,YB(r,e)),r.prime_meridian&&(e.from_greenwich=r.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=r.name,YB(r,e);break;case"prime_meridian":e.long0=(r.longitude||0)*Math.PI/180;break;case"coordinate_system":if(r.axis){const i={east:"e",north:"n",west:"w",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"},a=r.axis.map(s=>i[s.direction.toLowerCase()]);if(a.every(Boolean)&&(e.axis=a.join(""),e.axis.length===2&&(e.axis+="u")),r.unit){const{units:s,to_meter:o}=qB(r.unit);e.units=s,e.to_meter=o}else if(r.axis[0]&&r.axis[0].unit){const{units:s,to_meter:o}=qB(r.axis[0].unit);e.units=s,e.to_meter=o}}break;case"id":r.authority&&r.code&&(e.title=r.authority+":"+r.code);break;case"conversion":r.method&&r.method.name&&(e.projName=r.method.name),r.parameters&&r.parameters.forEach(i=>{const a=i.name.toLowerCase().replace(/\s+/g,"_"),s=i.value;i.unit&&i.unit.conversion_factor?e[a]=s*i.unit.conversion_factor:i.unit==="degree"?e[a]=s*Math.PI/180:e[a]=s});break;case"unit":r.name&&(e.units=r.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),r.conversion_factor&&(e.to_meter=r.conversion_factor);break;case"base_crs":Rb(r,e),e.datumCode=r.id?r.id.authority+"_"+r.id.code:r.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),Cq(e),e)}var oIe=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function lIe(n,e){var t=e[0],r=e[1];!(t in n)&&r in n&&(n[t]=n[r],e.length===3&&(n[t]=e[2](n[t])))}function Eq(n){for(var e=Object.keys(n),t=0,r=e.length;t<r;++t){var i=e[t];oIe.indexOf(i)!==-1&&uIe(n[i]),typeof n[i]=="object"&&Eq(n[i])}}function uIe(n){if(n.AUTHORITY){var e=Object.keys(n.AUTHORITY)[0];e&&e in n.AUTHORITY&&(n.title=e+":"+n.AUTHORITY[e])}if(n.type==="GEOGCS"?n.projName="longlat":n.type==="LOCAL_CS"?(n.projName="identity",n.local=!0):typeof n.PROJECTION=="object"?n.projName=Object.keys(n.PROJECTION)[0]:n.projName=n.PROJECTION,n.AXIS){for(var t="",r=0,i=n.AXIS.length;r<i;++r){var a=[n.AXIS[r][0].toLowerCase(),n.AXIS[r][1].toLowerCase()];a[0].indexOf("north")!==-1||(a[0]==="y"||a[0]==="lat")&&a[1]==="north"?t+="n":a[0].indexOf("south")!==-1||(a[0]==="y"||a[0]==="lat")&&a[1]==="south"?t+="s":a[0].indexOf("east")!==-1||(a[0]==="x"||a[0]==="lon")&&a[1]==="east"?t+="e":(a[0].indexOf("west")!==-1||(a[0]==="x"||a[0]==="lon")&&a[1]==="west")&&(t+="w")}t.length===2&&(t+="u"),t.length===3&&(n.axis=t)}n.UNIT&&(n.units=n.UNIT.name.toLowerCase(),n.units==="metre"&&(n.units="meter"),n.UNIT.convert&&(n.type==="GEOGCS"?n.DATUM&&n.DATUM.SPHEROID&&(n.to_meter=n.UNIT.convert*n.DATUM.SPHEROID.a):n.to_meter=n.UNIT.convert));var s=n.GEOGCS;n.type==="GEOGCS"&&(s=n),s&&(s.PRIMEM&&s.PRIMEM.convert&&(n.from_greenwich=ds(s.PRIMEM.convert)),s.DATUM?n.datumCode=s.DATUM.name.toLowerCase():n.datumCode=s.name.toLowerCase(),n.datumCode.slice(0,2)==="d_"&&(n.datumCode=n.datumCode.slice(2)),n.datumCode==="new_zealand_1949"&&(n.datumCode="nzgd49"),(n.datumCode==="wgs_1984"||n.datumCode==="world_geodetic_system_1984")&&(n.PROJECTION==="Mercator_Auxiliary_Sphere"&&(n.sphere=!0),n.datumCode="wgs84"),n.datumCode==="belge_1972"&&(n.datumCode="rnb72"),s.DATUM&&s.DATUM.SPHEROID&&(n.ellps=s.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),n.ellps.toLowerCase().slice(0,13)==="international"&&(n.ellps="intl"),n.a=s.DATUM.SPHEROID.a,n.rf=parseFloat(s.DATUM.SPHEROID.rf)),s.DATUM&&s.DATUM.TOWGS84&&(n.datum_params=s.DATUM.TOWGS84),~n.datumCode.indexOf("osgb_1936")&&(n.datumCode="osgb36"),~n.datumCode.indexOf("osni_1952")&&(n.datumCode="osni52"),(~n.datumCode.indexOf("tm65")||~n.datumCode.indexOf("geodetic_datum_of_1965"))&&(n.datumCode="ire65"),n.datumCode==="ch1903+"&&(n.datumCode="ch1903"),~n.datumCode.indexOf("israel")&&(n.datumCode="isr93")),n.b&&!isFinite(n.b)&&(n.b=n.a),n.rectified_grid_angle&&(n.rectified_grid_angle=ds(n.rectified_grid_angle));function o(c){var h=n.to_meter||1;return c*h}var l=function(c){return lIe(n,c)},u=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",ds],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",ds],["x0","false_easting",o],["y0","false_northing",o],["long0","central_meridian",ds],["lat0","latitude_of_origin",ds],["lat0","standard_parallel_1",ds],["lat1","standard_parallel_1",ds],["lat2","standard_parallel_2",ds],["azimuth","Azimuth"],["alpha","azimuth",ds],["srsCode","name"]];u.forEach(l),Cq(n)}function Db(n){if(typeof n=="object")return Rb(n);const e=tIe(n);var t=aIe(n);if(e==="WKT2"){const a=eIe(t);return Rb(a)}var r=t[0],i={};return jd(t,i),Eq(i),i[r]}function bi(n){var e=this;if(arguments.length===2){var t=arguments[1];typeof t=="string"?t.charAt(0)==="+"?bi[n]=BE(arguments[1]):bi[n]=Db(arguments[1]):t&&typeof t=="object"&&!("projName"in t)?bi[n]=Db(arguments[1]):(bi[n]=t,t||delete bi[n])}else if(arguments.length===1){if(Array.isArray(n))return n.map(function(r){return Array.isArray(r)?bi.apply(e,r):bi(r)});if(typeof n=="string"){if(n in bi)return bi[n]}else"EPSG"in n?bi["EPSG:"+n.EPSG]=n:"ESRI"in n?bi["ESRI:"+n.ESRI]=n:"IAU2000"in n?bi["IAU2000:"+n.IAU2000]=n:console.log(n);return}}WDe(bi);function cIe(n){return typeof n=="string"}function hIe(n){return n in bi}function fIe(n){return n.indexOf("+")!==0&&n.indexOf("[")!==-1||typeof n=="object"&&!("srsCode"in n)}var KB=["3857","900913","3785","102113"];function dIe(n){if(n.title)return n.title.toLowerCase().indexOf("epsg:")===0&&KB.indexOf(n.title.substr(5))>-1;var e=yc(n,"authority");if(e){var t=yc(e,"epsg");return t&&KB.indexOf(t)>-1}}function pIe(n){var e=yc(n,"extension");if(e)return yc(e,"proj4")}function vIe(n){return n[0]==="+"}function gIe(n){let e;if(cIe(n))if(hIe(n))e=bi[n];else if(fIe(n)){e=Db(n);var t=pIe(e);t&&(e=BE(t))}else vIe(n)&&(e=BE(n));else"projName"in n?e=n:e=Db(n);return e&&dIe(e)?bi["EPSG:3857"]:e}function ZB(n,e){n=n||{};var t,r;if(!e)return n;for(r in e)t=e[r],t!==void 0&&(n[r]=t);return n}function tl(n,e,t){var r=n*e;return t/Math.sqrt(1-r*r)}function Z0(n){return n<0?-1:1}function ot(n,e){return e||Math.abs(n)<=Nr?n:n-Z0(n)*S0}function lo(n,e,t){var r=n*t,i=.5*n;return r=Math.pow((1-r)/(1+r),i),Math.tan(.5*(qe-e))/r}function A0(n,e){for(var t=.5*n,r,i,a=qe-2*Math.atan(e),s=0;s<=15;s++)if(r=n*Math.sin(a),i=qe-2*Math.atan(e*Math.pow((1-r)/(1+r),t))-a,a+=i,Math.abs(i)<=1e-10)return a;return-9999}function mIe(){var n=this.b/this.a;this.es=1-n*n,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=tl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function yIe(n){var e=n.x,t=n.y;if(t*xa>90&&t*xa<-90&&e*xa>180&&e*xa<-180)return null;var r,i;if(Math.abs(Math.abs(t)-qe)<=it)return null;if(this.sphere)r=this.x0+this.a*this.k0*ot(e-this.long0,this.over),i=this.y0+this.a*this.k0*Math.log(Math.tan(On+.5*t));else{var a=Math.sin(t),s=lo(this.e,t,a);r=this.x0+this.a*this.k0*ot(e-this.long0,this.over),i=this.y0-this.a*this.k0*Math.log(s)}return n.x=r,n.y=i,n}function _Ie(n){var e=n.x-this.x0,t=n.y-this.y0,r,i;if(this.sphere)i=qe-2*Math.atan(Math.exp(-t/(this.a*this.k0)));else{var a=Math.exp(-t/(this.a*this.k0));if(i=A0(this.e,a),i===-9999)return null}return r=ot(this.long0+e/(this.a*this.k0),this.over),n.x=r,n.y=i,n}var xIe=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const bIe={init:mIe,forward:yIe,inverse:_Ie,names:xIe};function SIe(){}function QB(n){return n}var Pq=["longlat","identity"];const wIe={init:SIe,forward:QB,inverse:QB,names:Pq};var AIe=[bIe,wIe],yh={},qd=[];function Lq(n,e){var t=qd.length;return n.names?(qd[t]=n,n.names.forEach(function(r){yh[r.toLowerCase()]=t}),this):(console.log(e),!0)}function Rq(n){return n.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function MIe(n){if(!n)return!1;var e=n.toLowerCase();if(typeof yh[e]!="undefined"&&qd[yh[e]]||(e=Rq(e),e in yh&&qd[yh[e]]))return qd[yh[e]]}function TIe(){AIe.forEach(Lq)}const CIe={start:TIe,add:Lq,get:MIe};var Dq={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const EIe=Dq.WGS84;function PIe(n,e,t,r){var i=n*n,a=e*e,s=(i-a)/i,o=0;r?(n*=1-s*(qDe+s*(XDe+s*YDe)),i=n*n,s=0):o=Math.sqrt(s);var l=(i-a)/a;return{es:s,e:o,ep2:l}}function LIe(n,e,t,r,i){if(!n){var a=yc(Dq,r);a||(a=EIe),n=a.a,e=a.b,t=a.rf}return t&&!e&&(e=(1-1/t)*n),(t===0||Math.abs(n-e)<it)&&(i=!0,e=n),{a:n,b:e,rf:t,sphere:i}}var ex={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-0.008393,0.000749,-0.010276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"372.87,149.23,585.29"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"},EPSG_10328:{towgs84:"0,0,0"},EPSG_9782:{towgs84:"0,0,0"},EPSG_9777:{towgs84:"0,0,0"},EPSG_10690:{towgs84:"0,0,0"},EPSG_10639:{towgs84:"0,0,0"},EPSG_10739:{towgs84:"0,0,0"},EPSG_7686:{towgs84:"0,0,0"},EPSG_8900:{towgs84:"0,0,0"},EPSG_5886:{towgs84:"0,0,0"},EPSG_7683:{towgs84:"0,0,0"},EPSG_6668:{towgs84:"0,0,0"},EPSG_20046:{towgs84:"0,0,0"},EPSG_10299:{towgs84:"0,0,0"},EPSG_10310:{towgs84:"0,0,0"},EPSG_10475:{towgs84:"0,0,0"},EPSG_4742:{towgs84:"0,0,0"},EPSG_10671:{towgs84:"0,0,0"},EPSG_10762:{towgs84:"0,0,0"},EPSG_10725:{towgs84:"0,0,0"},EPSG_10791:{towgs84:"0,0,0"},EPSG_10800:{towgs84:"0,0,0"},EPSG_10305:{towgs84:"0,0,0"},EPSG_10941:{towgs84:"0,0,0"},EPSG_10968:{towgs84:"0,0,0"},EPSG_10875:{towgs84:"0,0,0"},EPSG_6318:{towgs84:"0,0,0"},EPSG_10910:{towgs84:"0,0,0"}};for(var RIe in ex){var Y2=ex[RIe];Y2.datumName&&(ex[Y2.datumName]=Y2)}function DIe(n,e,t,r,i,a,s){var o={};return o.datum_type=FE,e&&(o.datum_type=$De,o.datum_params=e.map(parseFloat),(o.datum_params[0]!==0||o.datum_params[1]!==0||o.datum_params[2]!==0)&&(o.datum_type=yf),o.datum_params.length>3&&(o.datum_params[3]!==0||o.datum_params[4]!==0||o.datum_params[5]!==0||o.datum_params[6]!==0)&&(o.datum_type=_f,o.datum_params[3]*=xm,o.datum_params[4]*=xm,o.datum_params[5]*=xm,o.datum_params[6]=o.datum_params[6]/1e6+1)),s&&(o.datum_type=cp,o.grids=s),o.a=t,o.b=r,o.es=i,o.ep2=a,o}var o3={};function IIe(n,e,t){return e instanceof ArrayBuffer?NIe(n,e,t):{ready:kIe(n,e)}}function NIe(n,e,t){var r=!0;t!==void 0&&t.includeErrorFields===!1&&(r=!1);var i=new DataView(e),a=BIe(i),s=GIe(i,a),o=zIe(i,s,a,r),l={header:s,subgrids:o};return o3[n]=l,l}function kIe(n,e){return $e(this,null,function*(){for(var t=[],r=yield e.getImageCount(),i=r-1;i>=0;i--){var a=yield e.getImage(i),s=yield a.readRasters(),o=s,l=[a.getWidth(),a.getHeight()],u=a.getBoundingBox().map(JB),c=typeof a.fileDirectory.getValue=="function"?a.fileDirectory.getValue("ModelPixelScale"):a.fileDirectory.ModelPixelScale,h=[c[0],c[1]].map(JB),f=u[0]+(l[0]-1)*h[0],d=u[3]-(l[1]-1)*h[1],p=o[0],g=o[1],v=[];for(let _=l[1]-1;_>=0;_--)for(let x=l[0]-1;x>=0;x--){var m=_*l[0]+x;v.push([-qu(g[m]),qu(p[m])])}t.push({del:h,lim:l,ll:[-f,d],cvs:v})}var y={header:{nSubgrids:r},subgrids:t};return o3[n]=y,y})}function OIe(n){if(n===void 0)return null;var e=n.split(",");return e.map(FIe)}function FIe(n){if(n.length===0)return null;var e=n[0]==="@";return e&&(n=n.slice(1)),n==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:n,mandatory:!e,grid:o3[n]||null,isNull:!1}}function JB(n){return n*Math.PI/180}function qu(n){return n/3600*Math.PI/180}function BIe(n){var e=n.getInt32(8,!1);return e===11?!1:(e=n.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function GIe(n,e){return{nFields:n.getInt32(8,e),nSubgridFields:n.getInt32(24,e),nSubgrids:n.getInt32(40,e),shiftType:GE(n,56,56+8).trim(),fromSemiMajorAxis:n.getFloat64(120,e),fromSemiMinorAxis:n.getFloat64(136,e),toSemiMajorAxis:n.getFloat64(152,e),toSemiMinorAxis:n.getFloat64(168,e)}}function GE(n,e,t){return String.fromCharCode.apply(null,new Uint8Array(n.buffer.slice(e,t)))}function zIe(n,e,t,r){for(var i=176,a=[],s=0;s<e.nSubgrids;s++){var o=VIe(n,i,t),l=HIe(n,i,o,t,r),u=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),c=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);a.push({ll:[qu(o.lowerLongitude),qu(o.lowerLatitude)],del:[qu(o.longitudeInterval),qu(o.latitudeInterval)],lim:[u,c],count:o.gridNodeCount,cvs:UIe(l)});var h=16;r===!1&&(h=8),i+=176+o.gridNodeCount*h}return a}function UIe(n){return n.map(function(e){return[qu(e.longitudeShift),qu(e.latitudeShift)]})}function VIe(n,e,t){return{name:GE(n,e+8,e+16).trim(),parent:GE(n,e+24,e+24+8).trim(),lowerLatitude:n.getFloat64(e+72,t),upperLatitude:n.getFloat64(e+88,t),lowerLongitude:n.getFloat64(e+104,t),upperLongitude:n.getFloat64(e+120,t),latitudeInterval:n.getFloat64(e+136,t),longitudeInterval:n.getFloat64(e+152,t),gridNodeCount:n.getInt32(e+168,t)}}function HIe(n,e,t,r,i){var a=e+176,s=16;i===!1&&(s=8);for(var o=[],l=0;l<t.gridNodeCount;l++){var u={latitudeShift:n.getFloat32(a+l*s,r),longitudeShift:n.getFloat32(a+l*s+4,r)};i!==!1&&(u.latitudeAccuracy=n.getFloat32(a+l*s+8,r),u.longitudeAccuracy=n.getFloat32(a+l*s+12,r)),o.push(u)}return o}function ks(n,e){if(!(this instanceof ks))return new ks(n);this.forward=null,this.inverse=null,this.init=null,this.name,this.axis,this.names=null,this.title,e=e||function(u){if(u)throw u};var t=gIe(n);if(typeof t!="object"){e("Could not parse to valid json: "+n);return}var r=ks.projections.get(t.projName);if(!r){e("Could not get projection name from: "+n);return}if(t.datumCode&&t.datumCode!=="none"){var i=yc(ex,t.datumCode);i&&(t.datum_params=t.datum_params||(i.towgs84?i.towgs84.split(","):null),t.ellps=i.ellipse,t.datumName=i.datumName?i.datumName:t.datumCode)}t.k0=t.k0||1,t.axis=t.axis||"enu",t.ellps=t.ellps||"wgs84",t.lat1=t.lat1||t.lat0;var a=LIe(t.a,t.b,t.rf,t.ellps,t.sphere),s=PIe(a.a,a.b,a.rf,t.R_A),o=OIe(t.nadgrids),l=t.datum||DIe(t.datumCode,t.datum_params,a.a,a.b,s.es,s.ep2,o);ZB(this,t),ZB(this,r),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=s.es,this.e=s.e,this.ep2=s.ep2,this.datum=l,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}ks.projections=CIe;ks.projections.start();function WIe(n,e){return n.datum_type!==e.datum_type||n.a!==e.a||Math.abs(n.es-e.es)>5e-11?!1:n.datum_type===yf?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]:n.datum_type===_f?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]&&n.datum_params[3]===e.datum_params[3]&&n.datum_params[4]===e.datum_params[4]&&n.datum_params[5]===e.datum_params[5]&&n.datum_params[6]===e.datum_params[6]:!0}function Iq(n,e,t){var r=n.x,i=n.y,a=n.z?n.z:0,s,o,l,u;if(i<-qe&&i>-1.001*qe)i=-qe;else if(i>qe&&i<1.001*qe)i=qe;else{if(i<-qe)return{x:-1/0,y:-1/0,z:n.z};if(i>qe)return{x:1/0,y:1/0,z:n.z}}return r>Math.PI&&(r-=2*Math.PI),o=Math.sin(i),u=Math.cos(i),l=o*o,s=t/Math.sqrt(1-e*l),{x:(s+a)*u*Math.cos(r),y:(s+a)*u*Math.sin(r),z:(s*(1-e)+a)*o}}function Nq(n,e,t,r){var i=1e-12,a=i*i,s=30,o,l,u,c,h,f,d,p,g,v,m,y,_,x=n.x,b=n.y,S=n.z?n.z:0,w,T,C;if(o=Math.sqrt(x*x+b*b),l=Math.sqrt(x*x+b*b+S*S),o/t<i){if(w=0,l/t<i)return T=qe,C=-r,{x:n.x,y:n.y,z:n.z}}else w=Math.atan2(b,x);u=S/l,c=o/l,h=1/Math.sqrt(1-e*(2-e)*c*c),p=c*(1-e)*h,g=u*h,_=0;do _++,d=t/Math.sqrt(1-e*g*g),C=o*p+S*g-d*(1-e*g*g),f=e*d/(d+C),h=1/Math.sqrt(1-f*(2-f)*c*c),v=c*(1-f)*h,m=u*h,y=m*p-v*g,p=v,g=m;while(y*y>a&&_<s);return T=Math.atan(m/Math.abs(v)),{x:w,y:T,z:C}}function $Ie(n,e,t){if(e===yf)return{x:n.x+t[0],y:n.y+t[1],z:n.z+t[2]};if(e===_f){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6];return{x:u*(n.x-l*n.y+o*n.z)+r,y:u*(l*n.x+n.y-s*n.z)+i,z:u*(-o*n.x+s*n.y+n.z)+a}}}function jIe(n,e,t){if(e===yf)return{x:n.x-t[0],y:n.y-t[1],z:n.z-t[2]};if(e===_f){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=(n.x-r)/u,h=(n.y-i)/u,f=(n.z-a)/u;return{x:c+l*h-o*f,y:-l*c+h+s*f,z:o*c-s*h+f}}}function y1(n){return n===yf||n===_f}function qIe(n,e,t){if(WIe(n,e)||n.datum_type===FE||e.datum_type===FE)return t;var r=n.a,i=n.es;if(n.datum_type===cp){var a=eG(n,!1,t);if(a!==0)return;r=WB,i=$B}var s=e.a,o=e.b,l=e.es;if(e.datum_type===cp&&(s=WB,o=jDe,l=$B),i===l&&r===s&&!y1(n.datum_type)&&!y1(e.datum_type))return t;if(t=Iq(t,i,r),y1(n.datum_type)&&(t=$Ie(t,n.datum_type,n.datum_params)),y1(e.datum_type)&&(t=jIe(t,e.datum_type,e.datum_params)),t=Nq(t,l,s,o),e.datum_type===cp){var u=eG(e,!0,t);if(u!==0)return}return t}function eG(n,e,t){if(n.grids===null||n.grids.length===0)return console.log("Grid shift grids not found"),-1;var r={x:-t.x,y:t.y},i={x:Number.NaN,y:Number.NaN},a=[];e:for(var s=0;s<n.grids.length;s++){var o=n.grids[s];if(a.push(o.name),o.isNull){i=r;break}if(o.grid===null){if(o.mandatory)return console.log("Unable to find mandatory grid '"+o.name+"'"),-1;continue}for(var l=o.grid.subgrids,u=0,c=l.length;u<c;u++){var h=l[u],f=(Math.abs(h.del[1])+Math.abs(h.del[0]))/1e4,d=h.ll[0]-f,p=h.ll[1]-f,g=h.ll[0]+(h.lim[0]-1)*h.del[0]+f,v=h.ll[1]+(h.lim[1]-1)*h.del[1]+f;if(!(p>r.y||d>r.x||v<r.y||g<r.x)&&(i=XIe(r,e,h),!isNaN(i.x)))break e}}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*xa+" "+r.y*xa+" tried: '"+a+"'"),-1):(t.x=-i.x,t.y=i.y,0)}function XIe(n,e,t){var r={x:Number.NaN,y:Number.NaN};if(isNaN(n.x))return r;var i={x:n.x,y:n.y};i.x-=t.ll[0],i.y-=t.ll[1],i.x=ot(i.x-Math.PI)+Math.PI;var a=tG(i,t);if(e){if(isNaN(a.x))return r;a.x=i.x-a.x,a.y=i.y-a.y;var s=9,o=1e-12,l,u;do{if(u=tG(a,t),isNaN(u.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}l={x:i.x-(u.x+a.x),y:i.y-(u.y+a.y)},a.x+=l.x,a.y+=l.y}while(s--&&Math.abs(l.x)>o&&Math.abs(l.y)>o);if(s<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=ot(a.x+t.ll[0]),r.y=a.y+t.ll[1]}else isNaN(a.x)||(r.x=n.x+a.x,r.y=n.y+a.y);return r}function tG(n,e){var t={x:n.x/e.del[0],y:n.y/e.del[1]},r={x:Math.floor(t.x),y:Math.floor(t.y)},i={x:t.x-1*r.x,y:t.y-1*r.y},a={x:Number.NaN,y:Number.NaN},s;if(r.x<0||r.x>=e.lim[0]||r.y<0||r.y>=e.lim[1])return a;s=r.y*e.lim[0]+r.x;var o={x:e.cvs[s][0],y:e.cvs[s][1]};s++;var l={x:e.cvs[s][0],y:e.cvs[s][1]};s+=e.lim[0];var u={x:e.cvs[s][0],y:e.cvs[s][1]};s--;var c={x:e.cvs[s][0],y:e.cvs[s][1]},h=i.x*i.y,f=i.x*(1-i.y),d=(1-i.x)*(1-i.y),p=(1-i.x)*i.y;return a.x=d*o.x+f*l.x+p*c.x+h*u.x,a.y=d*o.y+f*l.y+p*c.y+h*u.y,a}var _h=["x","y","z"];function YIe(n,e){const t={};for(let r=0,i=n.axis.length;r<i;r++){if(r===2&&e.z===void 0)continue;let a=e[_h[r]];switch(n.axis[r]){case"e":t.x=a;break;case"w":t.x=-a;break;case"n":t.y=a;break;case"s":t.y=-a;break;case"u":t.z=a;break;case"d":t.z=-a;break;default:return null}}return t}function KIe(n,e){const t={};for(let r=0,i=n.axis.length;r<i;r++)if(!(r===2&&e.z===void 0))switch(n.axis[r]){case"e":t[_h[r]]=e.x;break;case"w":t[_h[r]]=-e.x;break;case"n":t[_h[r]]=e.y;break;case"s":t[_h[r]]=-e.y;break;case"u":t[_h[r]]=e.z;break;case"d":t[_h[r]]=-e.z;break;default:return null}return t}function l3(n){var e={x:n[0],y:n[1]};return n.length>2&&(e.z=n[2]),n.length>3&&(e.m=n[3]),e}function ZIe(n){nG(n.x),nG(n.y)}function nG(n){if(typeof Number.isFinite=="function"){if(Number.isFinite(n))return;throw new TypeError("coordinates must be finite numbers")}if(typeof n!="number"||n!==n||!isFinite(n))throw new TypeError("coordinates must be finite numbers")}function QIe(n,e){return(n.datum.datum_type===yf||n.datum.datum_type===_f||n.datum.datum_type===cp)&&e.datumCode!=="WGS84"||(e.datum.datum_type===yf||e.datum.datum_type===_f||e.datum.datum_type===cp)&&n.datumCode!=="WGS84"}function Ib(n,e,t,r){var i,a=t.z!==void 0;if(ZIe(t),n.datum&&e.datum&&QIe(n,e)&&(i=new ks("WGS84"),t=Ib(n,i,t,r),n=i),r&&n.axis!=="enu"&&(t=YIe(n,t)),n.projName==="longlat")t={x:t.x*wr,y:t.y*wr,z:t.z||0};else if(n.to_meter&&(t={x:t.x*n.to_meter,y:t.y*n.to_meter,z:t.z||0}),t=n.inverse(t),!t)return;if(n.from_greenwich&&(t.x+=n.from_greenwich),t=qIe(n.datum,e.datum,t),!!t)return t=t,e.from_greenwich&&(t={x:t.x-e.from_greenwich,y:t.y,z:t.z||0}),e.projName==="longlat"?t={x:t.x*xa,y:t.y*xa,z:t.z||0}:(t=e.forward(t),e.to_meter&&(t={x:t.x/e.to_meter,y:t.y/e.to_meter,z:t.z||0})),r&&e.axis!=="enu"?KIe(e,t):(t&&!a&&e.projName!=="geocent"&&delete t.z,t)}function JIe(n,e,t,r){var i;return Array.isArray(t)?i=l3(t):i={x:t.x,y:t.y,z:t.z,m:t.m},Ib(n,e,i,r)}var rG=ks("WGS84");function K2(n,e,t,r){var i,a,s;return Array.isArray(t)?(i=Ib(n,e,l3(t),r)||{x:NaN,y:NaN},t.length>2?(a=typeof n.name!="undefined"&&n.name==="geocent"||typeof e.name!="undefined"&&e.name==="geocent",a?typeof i.z=="number"?[i.x,i.y,i.z].concat(t.slice(3)):[i.x,i.y,t[2]].concat(t.slice(3)):r&&typeof i.z=="number"?[i.x,i.y,i.z].concat(t.slice(3)):[i.x,i.y].concat(t.slice(2))):[i.x,i.y]):(i=Ib(n,e,{x:t.x,y:t.y,z:t.z,m:t.m},r)||{x:NaN,y:NaN},s=Object.keys(t),s.length===2||(a=typeof n.name!="undefined"&&n.name==="geocent"||typeof e.name!="undefined"&&e.name==="geocent",s.forEach(function(o){o==="x"||o==="y"||o==="z"&&(a||r)||(i[o]=t[o])})),i)}function _1(n){return n instanceof ks?n:typeof n=="object"&&"oProj"in n?n.oProj:ks(n)}function eNe(n,e,t){var r,i,a=!1,s;return typeof e=="undefined"?(i=_1(n),r=rG,a=!0):(typeof e.x!="undefined"||Array.isArray(e))&&(t=e,i=_1(n),r=rG,a=!0),r||(r=_1(n)),i||(i=_1(e)),t?K2(r,i,t):(s={forward:function(o,l){return K2(r,i,o,l)},inverse:function(o,l){return K2(i,r,o,l)}},a&&(s.oProj=i),s)}var iG=6,kq="AJSAJS",Oq="AFAFAF",Xd=65,fa=73,ps=79,$g=86,jg=90;const tNe={forward:Fq,inverse:nNe,toPoint:Bq};function Fq(n,e){return e=e||5,aNe(rNe({lat:n[1],lon:n[0]}),e)}function nNe(n){var e=u3(zq(n.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function Bq(n){var e=u3(zq(n.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Z2(n){return n*(Math.PI/180)}function aG(n){return 180*(n/Math.PI)}function rNe(n){var e=n.lat,t=n.lon,r=6378137,i=.00669438,a=.9996,s,o,l,u,c,h,f,d=Z2(e),p=Z2(t),g,v;v=Math.floor((t+180)/6)+1,t===180&&(v=60),e>=56&&e<64&&t>=3&&t<12&&(v=32),e>=72&&e<84&&(t>=0&&t<9?v=31:t>=9&&t<21?v=33:t>=21&&t<33?v=35:t>=33&&t<42&&(v=37)),s=(v-1)*6-180+3,g=Z2(s),o=i/(1-i),l=r/Math.sqrt(1-i*Math.sin(d)*Math.sin(d)),u=Math.tan(d)*Math.tan(d),c=o*Math.cos(d)*Math.cos(d),h=Math.cos(d)*(p-g),f=r*((1-i/4-3*i*i/64-5*i*i*i/256)*d-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*d)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*d)-35*i*i*i/3072*Math.sin(6*d));var m=a*l*(h+(1-u+c)*h*h*h/6+(5-18*u+u*u+72*c-58*o)*h*h*h*h*h/120)+5e5,y=a*(f+l*Math.tan(d)*(h*h/2+(5-u+9*c+4*c*c)*h*h*h*h/24+(61-58*u+u*u+600*c-330*o)*h*h*h*h*h*h/720));return e<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(m),zoneNumber:v,zoneLetter:iNe(e)}}function u3(n){var e=n.northing,t=n.easting,r=n.zoneLetter,i=n.zoneNumber;if(i<0||i>60)return null;var a=.9996,s=6378137,o=.00669438,l,u=(1-Math.sqrt(1-o))/(1+Math.sqrt(1-o)),c,h,f,d,p,g,v,m,y,_=t-5e5,x=e;r<"N"&&(x-=1e7),v=(i-1)*6-180+3,l=o/(1-o),g=x/a,m=g/(s*(1-o/4-3*o*o/64-5*o*o*o/256)),y=m+(3*u/2-27*u*u*u/32)*Math.sin(2*m)+(21*u*u/16-55*u*u*u*u/32)*Math.sin(4*m)+151*u*u*u/96*Math.sin(6*m),c=s/Math.sqrt(1-o*Math.sin(y)*Math.sin(y)),h=Math.tan(y)*Math.tan(y),f=l*Math.cos(y)*Math.cos(y),d=s*(1-o)/Math.pow(1-o*Math.sin(y)*Math.sin(y),1.5),p=_/(c*a);var b=y-c*Math.tan(y)/d*(p*p/2-(5+3*h+10*f-4*f*f-9*l)*p*p*p*p/24+(61+90*h+298*f+45*h*h-252*l-3*f*f)*p*p*p*p*p*p/720);b=aG(b);var S=(p-(1+2*h+f)*p*p*p/6+(5-2*f+28*h-3*f*f+8*l+24*h*h)*p*p*p*p*p/120)/Math.cos(y);S=v+aG(S);var w;if(n.accuracy){var T=u3({northing:n.northing+n.accuracy,easting:n.easting+n.accuracy,zoneLetter:n.zoneLetter,zoneNumber:n.zoneNumber});w={top:T.lat,right:T.lon,bottom:b,left:S}}else w={lat:b,lon:S};return w}function iNe(n){var e="Z";return 84>=n&&n>=72?e="X":72>n&&n>=64?e="W":64>n&&n>=56?e="V":56>n&&n>=48?e="U":48>n&&n>=40?e="T":40>n&&n>=32?e="S":32>n&&n>=24?e="R":24>n&&n>=16?e="Q":16>n&&n>=8?e="P":8>n&&n>=0?e="N":0>n&&n>=-8?e="M":-8>n&&n>=-16?e="L":-16>n&&n>=-24?e="K":-24>n&&n>=-32?e="J":-32>n&&n>=-40?e="H":-40>n&&n>=-48?e="G":-48>n&&n>=-56?e="F":-56>n&&n>=-64?e="E":-64>n&&n>=-72?e="D":-72>n&&n>=-80&&(e="C"),e}function aNe(n,e){var t="00000"+n.easting,r="00000"+n.northing;return n.zoneNumber+n.zoneLetter+sNe(n.easting,n.northing,n.zoneNumber)+t.substr(t.length-5,e)+r.substr(r.length-5,e)}function sNe(n,e,t){var r=Gq(t),i=Math.floor(n/1e5),a=Math.floor(e/1e5)%20;return oNe(i,a,r)}function Gq(n){var e=n%iG;return e===0&&(e=iG),e}function oNe(n,e,t){var r=t-1,i=kq.charCodeAt(r),a=Oq.charCodeAt(r),s=i+n-1,o=a+e,l=!1;s>jg&&(s=s-jg+Xd-1,l=!0),(s===fa||i<fa&&s>fa||(s>fa||i<fa)&&l)&&s++,(s===ps||i<ps&&s>ps||(s>ps||i<ps)&&l)&&(s++,s===fa&&s++),s>jg&&(s=s-jg+Xd-1),o>$g?(o=o-$g+Xd-1,l=!0):l=!1,(o===fa||a<fa&&o>fa||(o>fa||a<fa)&&l)&&o++,(o===ps||a<ps&&o>ps||(o>ps||a<ps)&&l)&&(o++,o===fa&&o++),o>$g&&(o=o-$g+Xd-1);var u=String.fromCharCode(s)+String.fromCharCode(o);return u}function zq(n){if(n&&n.length===0)throw"MGRSPoint coverting from nothing";for(var e=n.length,t=null,r="",i,a=0;!/[A-Z]/.test(i=n.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+n;r+=i,a++}var s=parseInt(r,10);if(a===0||a+3>e)throw"MGRSPoint bad conversion from: "+n;var o=n.charAt(a++);if(o<="A"||o==="B"||o==="Y"||o>="Z"||o==="I"||o==="O")throw"MGRSPoint zone letter "+o+" not handled: "+n;t=n.substring(a,a+=2);for(var l=Gq(s),u=lNe(t.charAt(0),l),c=uNe(t.charAt(1),l);c<cNe(o);)c+=2e6;var h=e-a;if(h%2!==0)throw`MGRSPoint has to have an even number
of digits after the zone letter and two 100km letters - front
half for easting meters, second half for
northing meters`+n;var f=h/2,d=0,p=0,g,v,m,y,_;return f>0&&(g=1e5/Math.pow(10,f),v=n.substring(a,a+f),d=parseFloat(v)*g,m=n.substring(a+f),p=parseFloat(m)*g),y=d+u,_=p+c,{easting:y,northing:_,zoneLetter:o,zoneNumber:s,accuracy:g}}function lNe(n,e){for(var t=kq.charCodeAt(e-1),r=1e5,i=!1;t!==n.charCodeAt(0);){if(t++,t===fa&&t++,t===ps&&t++,t>jg){if(i)throw"Bad character: "+n;t=Xd,i=!0}r+=1e5}return r}function uNe(n,e){if(n>"V")throw"MGRSPoint given invalid Northing "+n;for(var t=Oq.charCodeAt(e-1),r=0,i=!1;t!==n.charCodeAt(0);){if(t++,t===fa&&t++,t===ps&&t++,t>$g){if(i)throw"Bad character: "+n;t=Xd,i=!0}r+=1e5}return r}function cNe(n){var e;switch(n){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+n}function Vp(n,e,t){if(!(this instanceof Vp))return new Vp(n,e,t);if(Array.isArray(n))this.x=n[0],this.y=n[1],this.z=n[2]||0;else if(typeof n=="object")this.x=n.x,this.y=n.y,this.z=n.z||0;else if(typeof n=="string"&&typeof e=="undefined"){var r=n.split(",");this.x=parseFloat(r[0]),this.y=parseFloat(r[1]),this.z=parseFloat(r[2])||0}else this.x=n,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Vp.fromMGRS=function(n){return new Vp(Bq(n))};Vp.prototype.toMGRS=function(n){return Fq([this.x,this.y],n)};var hNe=1,fNe=.25,sG=.046875,oG=.01953125,lG=.01068115234375,dNe=.75,pNe=.46875,vNe=.013020833333333334,gNe=.007120768229166667,mNe=.3645833333333333,yNe=.005696614583333333,_Ne=.3076171875;function c3(n){var e=[];e[0]=hNe-n*(fNe+n*(sG+n*(oG+n*lG))),e[1]=n*(dNe-n*(sG+n*(oG+n*lG)));var t=n*n;return e[2]=t*(pNe-n*(vNe+n*gNe)),t*=n,e[3]=t*(mNe-n*yNe),e[4]=t*n*_Ne,e}function gv(n,e,t,r){return t*=e,e*=e,r[0]*n-t*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))}var xNe=20;function h3(n,e,t){for(var r=1/(1-e),i=n,a=xNe;a;--a){var s=Math.sin(i),o=1-e*s*s;if(o=(gv(i,s,Math.cos(i),t)-n)*(o*Math.sqrt(o))*r,i-=o,Math.abs(o)<it)return i}return i}function bNe(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=c3(this.es),this.ml0=gv(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function SNe(n){var e=n.x,t=n.y,r=ot(e-this.long0,this.over),i,a,s,o=Math.sin(t),l=Math.cos(t);if(this.es){var c=l*r,h=Math.pow(c,2),f=this.ep2*Math.pow(l,2),d=Math.pow(f,2),p=Math.abs(l)>it?Math.tan(t):0,g=Math.pow(p,2),v=Math.pow(g,2);i=1-this.es*Math.pow(o,2),c=c/Math.sqrt(i);var m=gv(t,o,l,this.en);a=this.a*(this.k0*c*(1+h/6*(1-g+f+h/20*(5-18*g+v+14*f-58*g*f+h/42*(61+179*v-v*g-479*g)))))+this.x0,s=this.a*(this.k0*(m-this.ml0+o*r*c/2*(1+h/12*(5-g+9*f+4*d+h/30*(61+v-58*g+270*f-330*g*f+h/56*(1385+543*v-v*g-3111*g))))))+this.y0}else{var u=l*Math.sin(r);if(Math.abs(Math.abs(u)-1)<it)return 93;if(a=.5*this.a*this.k0*Math.log((1+u)/(1-u))+this.x0,s=l*Math.cos(r)/Math.sqrt(1-Math.pow(u,2)),u=Math.abs(s),u>=1){if(u-1>it)return 93;s=0}else s=Math.acos(s);t<0&&(s=-s),s=this.a*this.k0*(s-this.lat0)+this.y0}return n.x=a,n.y=s,n}function wNe(n){var e,t,r,i,a=(n.x-this.x0)*(1/this.a),s=(n.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+s/this.k0,t=h3(e,this.es,this.en),Math.abs(t)<qe){var h=Math.sin(t),f=Math.cos(t),d=Math.abs(f)>it?Math.tan(t):0,p=this.ep2*Math.pow(f,2),g=Math.pow(p,2),v=Math.pow(d,2),m=Math.pow(v,2);e=1-this.es*Math.pow(h,2);var y=a*Math.sqrt(e)/this.k0,_=Math.pow(y,2);e=e*d,r=t-e*_/(1-this.es)*.5*(1-_/12*(5+3*v-9*p*v+p-4*g-_/30*(61+90*v-252*p*v+45*m+46*p-_/56*(1385+3633*v+4095*m+1574*m*v)))),i=ot(this.long0+y*(1-_/6*(1+2*v+p-_/20*(5+28*v+24*m+8*p*v+6*p-_/42*(61+662*v+1320*m+720*m*v))))/f,this.over)}else r=qe*Z0(s),i=0;else{var o=Math.exp(a/this.k0),l=.5*(o-1/o),u=this.lat0+s/this.k0,c=Math.cos(u);e=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(l,2))),r=Math.asin(e),s<0&&(r=-r),l===0&&c===0?i=0:i=ot(Math.atan2(l,c)+this.long0,this.over)}return n.x=i,n.y=r,n}var ANe=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const tx={init:bNe,forward:SNe,inverse:wNe,names:ANe};function Uq(n){var e=Math.exp(n);return e=(e-1/e)/2,e}function ya(n,e){n=Math.abs(n),e=Math.abs(e);var t=Math.max(n,e),r=Math.min(n,e)/(t||1);return t*Math.sqrt(1+Math.pow(r,2))}function MNe(n){var e=1+n,t=e-1;return t===0?n:n*Math.log(e)/t}function TNe(n){var e=Math.abs(n);return e=MNe(e*(1+e/(ya(1,e)+1))),n<0?-e:e}function f3(n,e){for(var t=2*Math.cos(2*e),r=n.length-1,i=n[r],a=0,s;--r>=0;)s=-a+t*i+n[r],a=i,i=s;return e+s*Math.sin(2*e)}function CNe(n,e){for(var t=2*Math.cos(e),r=n.length-1,i=n[r],a=0,s;--r>=0;)s=-a+t*i+n[r],a=i,i=s;return Math.sin(e)*s}function ENe(n){var e=Math.exp(n);return e=(e+1/e)/2,e}function Vq(n,e,t){for(var r=Math.sin(e),i=Math.cos(e),a=Uq(t),s=ENe(t),o=2*i*s,l=-2*r*a,u=n.length-1,c=n[u],h=0,f=0,d=0,p,g;--u>=0;)p=f,g=h,f=c,h=d,c=-p+o*f-l*h+n[u],d=-g+l*f+o*h;return o=r*s,l=i*a,[o*c-l*d,o*d+l*c]}function PNe(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(tx.init.apply(this),this.forward=tx.forward,this.inverse=tx.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var n=this.es/(1+Math.sqrt(1-this.es)),e=n/(2-n),t=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),t=t*e,this.cgb[1]=t*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=t*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),t=t*e,this.cgb[2]=t*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=t*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),t=t*e,this.cgb[3]=t*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=t*(1237/630+e*(-12/5+e*(-24832/14175))),t=t*e,this.cgb[4]=t*(4174/315+e*(-144838/6237)),this.cbg[4]=t*(-734/315+e*(109598/31185)),t=t*e,this.cgb[5]=t*(601676/22275),this.cbg[5]=t*(444337/155925),t=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+t*(1/4+t*(1/64+t/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=t*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=t*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),t=t*e,this.utg[2]=t*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=t*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),t=t*e,this.utg[3]=t*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=t*(49561/161280+e*(-179/168+e*(6601661/7257600))),t=t*e,this.utg[4]=t*(-4583/161280+e*(108847/3991680)),this.gtu[4]=t*(34729/80640+e*(-3418889/1995840)),t=t*e,this.utg[5]=t*(-20648693/638668800),this.gtu[5]=t*(212378941/319334400);var r=f3(this.cbg,this.lat0);this.Zb=-this.Qn*(r+CNe(this.gtu,2*r))}function LNe(n){var e=ot(n.x-this.long0,this.over),t=n.y;t=f3(this.cbg,t);var r=Math.sin(t),i=Math.cos(t),a=Math.sin(e),s=Math.cos(e);t=Math.atan2(r,s*i),e=Math.atan2(a*i,ya(r,i*s)),e=TNe(Math.tan(e));var o=Vq(this.gtu,2*t,2*e);t=t+o[0],e=e+o[1];var l,u;return Math.abs(e)<=2.623395162778?(l=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*t+this.Zb)+this.y0):(l=1/0,u=1/0),n.x=l,n.y=u,n}function RNe(n){var e=(n.x-this.x0)*(1/this.a),t=(n.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var r,i;if(Math.abs(e)<=2.623395162778){var a=Vq(this.utg,2*t,2*e);t=t+a[0],e=e+a[1],e=Math.atan(Uq(e));var s=Math.sin(t),o=Math.cos(t),l=Math.sin(e),u=Math.cos(e);t=Math.atan2(s*u,ya(l,u*o)),e=Math.atan2(l,u*o),r=ot(e+this.long0,this.over),i=f3(this.cgb,t)}else r=1/0,i=1/0;return n.x=r,n.y=i,n}var DNe=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const nx={init:PNe,forward:LNe,inverse:RNe,names:DNe};function INe(n,e){if(n===void 0){if(n=Math.floor((ot(e)+Math.PI)*30/Math.PI)+1,n<0)return 0;if(n>60)return 60}return n}var NNe="etmerc";function kNe(){var n=INe(this.zone,this.long0);if(n===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(n)-183)*wr,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,nx.init.apply(this),this.forward=nx.forward,this.inverse=nx.inverse}var ONe=["Universal Transverse Mercator System","utm"];const FNe={init:kNe,names:ONe,dependsOn:NNe};function d3(n,e){return Math.pow((1-n)/(1+n),e)}var BNe=20;function GNe(){var n=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*n*n),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(n/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+On)/(Math.pow(Math.tan(.5*this.lat0+On),this.C)*d3(this.e*n,this.ratexp))}function zNe(n){var e=n.x,t=n.y;return n.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+On),this.C)*d3(this.e*Math.sin(t),this.ratexp))-qe,n.x=this.C*e,n}function UNe(n){for(var e=1e-14,t=n.x/this.C,r=n.y,i=Math.pow(Math.tan(.5*r+On)/this.K,1/this.C),a=BNe;a>0&&(r=2*Math.atan(i*d3(this.e*Math.sin(n.y),-.5*this.e))-qe,!(Math.abs(r-n.y)<e));--a)n.y=r;return a?(n.x=t,n.y=r,n):null}var VNe=["gauss"];const p3={init:GNe,forward:zNe,inverse:UNe,names:VNe};function HNe(){p3.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function WNe(n){var e,t,r,i;return n.x=ot(n.x-this.long0,this.over),p3.forward.apply(this,[n]),e=Math.sin(n.y),t=Math.cos(n.y),r=Math.cos(n.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*t*r),n.x=i*t*Math.sin(n.x),n.y=i*(this.cosc0*e-this.sinc0*t*r),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function $Ne(n){var e,t,r,i,a;if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,a=ya(n.x,n.y)){var s=2*Math.atan2(a,this.R2);e=Math.sin(s),t=Math.cos(s),i=Math.asin(t*this.sinc0+n.y*e*this.cosc0/a),r=Math.atan2(n.x*e,a*this.cosc0*t-n.y*this.sinc0*e)}else i=this.phic0,r=0;return n.x=r,n.y=i,p3.inverse.apply(this,[n]),n.x=ot(n.x+this.long0,this.over),n}var jNe=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const qNe={init:HNe,forward:WNe,inverse:$Ne,names:jNe};function v3(n,e,t){return e*=t,Math.tan(.5*(qe+n))*Math.pow((1-e)/(1+e),.5*t)}function XNe(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=it&&(this.k0=.5*(1+Z0(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=it&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=it&&Math.abs(Math.cos(this.lat_ts))>it&&(this.k0=.5*this.cons*tl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/lo(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=tl(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(v3(this.lat0,this.sinlat0,this.e))-qe,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function YNe(n){var e=n.x,t=n.y,r=Math.sin(t),i=Math.cos(t),a,s,o,l,u,c,h=ot(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=it&&Math.abs(t+this.lat0)<=it?(n.x=NaN,n.y=NaN,n):this.sphere?(a=2*this.k0/(1+this.sinlat0*r+this.coslat0*i*Math.cos(h)),n.x=this.a*a*i*Math.sin(h)+this.x0,n.y=this.a*a*(this.coslat0*r-this.sinlat0*i*Math.cos(h))+this.y0,n):(s=2*Math.atan(v3(t,r,this.e))-qe,l=Math.cos(s),o=Math.sin(s),Math.abs(this.coslat0)<=it?(u=lo(this.e,t*this.con,this.con*r),c=2*this.a*this.k0*u/this.cons,n.x=this.x0+c*Math.sin(e-this.long0),n.y=this.y0-this.con*c*Math.cos(e-this.long0),n):(Math.abs(this.sinlat0)<it?(a=2*this.a*this.k0/(1+l*Math.cos(h)),n.y=a*o):(a=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*o+this.cosX0*l*Math.cos(h))),n.y=a*(this.cosX0*o-this.sinX0*l*Math.cos(h))+this.y0),n.x=a*l*Math.sin(h)+this.x0,n))}function KNe(n){n.x-=this.x0,n.y-=this.y0;var e,t,r,i,a,s=Math.sqrt(n.x*n.x+n.y*n.y);if(this.sphere){var o=2*Math.atan(s/(2*this.a*this.k0));return e=this.long0,t=this.lat0,s<=it?(n.x=e,n.y=t,n):(t=Math.asin(Math.cos(o)*this.sinlat0+n.y*Math.sin(o)*this.coslat0/s),Math.abs(this.coslat0)<it?this.lat0>0?e=ot(this.long0+Math.atan2(n.x,-1*n.y),this.over):e=ot(this.long0+Math.atan2(n.x,n.y),this.over):e=ot(this.long0+Math.atan2(n.x*Math.sin(o),s*this.coslat0*Math.cos(o)-n.y*this.sinlat0*Math.sin(o)),this.over),n.x=e,n.y=t,n)}else if(Math.abs(this.coslat0)<=it){if(s<=it)return t=this.lat0,e=this.long0,n.x=e,n.y=t,n;n.x*=this.con,n.y*=this.con,r=s*this.cons/(2*this.a*this.k0),t=this.con*A0(this.e,r),e=this.con*ot(this.con*this.long0+Math.atan2(n.x,-1*n.y),this.over)}else i=2*Math.atan(s*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,s<=it?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+n.y*Math.sin(i)*this.cosX0/s),e=ot(this.long0+Math.atan2(n.x*Math.sin(i),s*this.cosX0*Math.cos(i)-n.y*this.sinX0*Math.sin(i)),this.over)),t=-1*A0(this.e,Math.tan(.5*(qe+a)));return n.x=e,n.y=t,n}var ZNe=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const QNe={init:XNe,forward:YNe,inverse:KNe,names:ZNe,ssfn_:v3};function JNe(){var n=this.lat0;this.lambda0=this.long0;var e=Math.sin(n),t=this.a,r=this.rf,i=1/r,a=2*i-Math.pow(i,2),s=this.e=Math.sqrt(a);this.R=this.k0*t*Math.sqrt(1-a)/(1-a*Math.pow(e,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(n),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+n/2)),u=Math.log((1+s*e)/(1-s*e));this.K=o-this.alpha*l+this.alpha*s/2*u}function e4e(n){var e=Math.log(Math.tan(Math.PI/4-n.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(n.y))/(1-this.e*Math.sin(n.y))),r=-this.alpha*(e+t)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(n.x-this.lambda0),s=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),o=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return n.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,n.x=this.R*s+this.x0,n}function t4e(n){for(var e=n.x-this.x0,t=n.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(t/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),s=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),o=this.lambda0+s/this.alpha,l=0,u=a,c=-1e3,h=0;Math.abs(u-c)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),c=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return n.x=o,n.y=u,n}var n4e=["somerc"];const r4e={init:JNe,forward:e4e,inverse:t4e,names:n4e};var Nd=1e-7;function i4e(n){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof n.projName=="object"?Object.keys(n.projName)[0]:n.projName;return"no_uoff"in n||"no_off"in n||e.indexOf(t)!==-1||e.indexOf(Rq(t))!==-1}function a4e(){var n,e,t,r,i,a,s,o,l,u,c=0,h,f=0,d=0,p=0,g=0,v=0,m=0;this.no_off=i4e(this),this.no_rot="no_rot"in this;var y=!1;"alpha"in this&&(y=!0);var _=!1;if("rectified_grid_angle"in this&&(_=!0),y&&(m=this.alpha),_&&(c=this.rectified_grid_angle,y||(m=0,y=!0)),y||_)f=this.longc;else if(d=this.long1,g=this.lat1,p=this.long2,v=this.lat2,Math.abs(g-v)<=Nd||(n=Math.abs(g))<=Nd||Math.abs(n-qe)<=Nd||Math.abs(Math.abs(this.lat0)-qe)<=Nd||Math.abs(Math.abs(v)-qe)<=Nd)throw new Error;var x=1-this.es;e=Math.sqrt(x),Math.abs(this.lat0)>it?(o=Math.sin(this.lat0),t=Math.cos(this.lat0),n=1-this.es*o*o,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/x),this.A=this.B*this.k0*e/n,r=this.B*e/(t*Math.sqrt(n)),i=r*r-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Math.pow(lo(this.e,this.lat0,o),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=i=1),y||_?(y?(h=Math.asin(Math.sin(m)/r),_||(c=m)):(h=c,m=Math.asin(r*Math.sin(h))),this.lam0=f-Math.asin(.5*(i-1/i)*Math.tan(h))/this.B):(a=Math.pow(lo(this.e,g,Math.sin(g)),this.B),s=Math.pow(lo(this.e,v,Math.sin(v)),this.B),i=this.E/a,l=(s-a)/(s+a),u=this.E*this.E,u=(u-s*a)/(u+s*a),n=d-p,n<-Math.PI?p-=S0:n>Math.PI&&(p+=S0),this.lam0=ot(.5*(d+p)-Math.atan(u*Math.tan(.5*this.B*(d-p))/l)/this.B,this.over),h=Math.atan(2*Math.sin(this.B*ot(d-this.lam0,this.over))/(i-1/i)),c=m=Math.asin(r*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(m))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(On-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(On+i))}function s4e(n){var e={},t,r,i,a,s,o,l,u;if(n.x=n.x-this.lam0,Math.abs(Math.abs(n.y)-qe)>it){if(s=this.E/Math.pow(lo(this.e,n.y,Math.sin(n.y)),this.B),o=1/s,t=.5*(s-o),r=.5*(s+o),a=Math.sin(this.B*n.x),i=(t*this.singam-a*this.cosgam)/r,Math.abs(Math.abs(i)-1)<it)throw new Error;u=.5*this.ArB*Math.log((1-i)/(1+i)),o=Math.cos(this.B*n.x),Math.abs(o)<Nd?l=this.A*n.x:l=this.ArB*Math.atan2(t*this.cosgam+a*this.singam,o)}else u=n.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*n.y;return this.no_rot?(e.x=l,e.y=u):(l-=this.u_0,e.x=u*this.cosrot+l*this.sinrot,e.y=l*this.cosrot-u*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function o4e(n){var e,t,r,i,a,s,o,l={};if(n.x=(n.x-this.x0)*(1/this.a),n.y=(n.y-this.y0)*(1/this.a),this.no_rot?(t=n.y,e=n.x):(t=n.x*this.cosrot-n.y*this.sinrot,e=n.y*this.cosrot+n.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*t),i=.5*(r-1/r),a=.5*(r+1/r),s=Math.sin(this.BrA*e),o=(s*this.cosgam+i*this.singam)/a,Math.abs(Math.abs(o)-1)<it)l.x=0,l.y=o<0?-qe:qe;else{if(l.y=this.E/Math.sqrt((1+o)/(1-o)),l.y=A0(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(i*this.cosgam-s*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l}var l4e=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const u4e={init:a4e,forward:s4e,inverse:o4e,names:l4e};function c4e(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<it)){var n=this.b/this.a;this.e=Math.sqrt(1-n*n);var e=Math.sin(this.lat1),t=Math.cos(this.lat1),r=tl(this.e,e,t),i=lo(this.e,this.lat1,e),a=Math.sin(this.lat2),s=Math.cos(this.lat2),o=tl(this.e,a,s),l=lo(this.e,this.lat2,a),u=Math.abs(Math.abs(this.lat0)-qe)<it?0:lo(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>it?this.ns=Math.log(r/o)/Math.log(i/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function h4e(n){var e=n.x,t=n.y;Math.abs(2*Math.abs(t)-Math.PI)<=it&&(t=Z0(t)*(qe-2*it));var r=Math.abs(Math.abs(t)-qe),i,a;if(r>it)i=lo(this.e,t,Math.sin(t)),a=this.a*this.f0*Math.pow(i,this.ns);else{if(r=t*this.ns,r<=0)return null;a=0}var s=this.ns*ot(e-this.long0,this.over);return n.x=this.k0*(a*Math.sin(s))+this.x0,n.y=this.k0*(this.rh-a*Math.cos(s))+this.y0,n}function f4e(n){var e,t,r,i,a,s=(n.x-this.x0)/this.k0,o=this.rh-(n.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+o*o),t=1):(e=-Math.sqrt(s*s+o*o),t=-1);var l=0;if(e!==0&&(l=Math.atan2(t*s,t*o)),e!==0||this.ns>0){if(t=1/this.ns,r=Math.pow(e/(this.a*this.f0),t),i=A0(this.e,r),i===-9999)return null}else i=-qe;return a=ot(l/this.ns+this.long0,this.over),n.x=a,n.y=i,n}var d4e=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const p4e={init:c4e,forward:h4e,inverse:f4e,names:d4e};function v4e(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function g4e(n){var e,t,r,i,a,s,o,l=n.x,u=n.y,c=ot(l-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/e)-this.s45),r=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(r)),a=Math.asin(Math.cos(t)*Math.sin(r)/Math.cos(i)),s=this.n*a,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),n.y=o*Math.cos(s)/1,n.x=o*Math.sin(s)/1,this.czech||(n.y*=-1,n.x*=-1),n}function m4e(n){var e,t,r,i,a,s,o,l,u=n.x;n.x=n.y,n.y=u,this.czech||(n.y*=-1,n.x*=-1),s=Math.sqrt(n.x*n.x+n.y*n.y),a=Math.atan2(n.y,n.x),i=a/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),t=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),n.x=this.long0-t/this.alfa,o=e,l=0;var c=0;do n.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-n.y)<1e-10&&(l=1),o=n.y,c+=1;while(l===0&&c<15);return c>=15?null:n}var y4e=["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)","krovak"];const _4e={init:v4e,forward:g4e,inverse:m4e,names:y4e};function ra(n,e,t,r,i){return n*i-e*Math.sin(2*i)+t*Math.sin(4*i)-r*Math.sin(6*i)}function Q0(n){return 1-.25*n*(1+n/16*(3+1.25*n))}function J0(n){return .375*n*(1+.25*n*(1+.46875*n))}function ey(n){return .05859375*n*n*(1+.75*n)}function ty(n){return n*n*n*(35/3072)}function g3(n,e,t){var r=e*t;return n/Math.sqrt(1-r*r)}function Mc(n){return Math.abs(n)<qe?n:n-Z0(n)*Math.PI}function Nb(n,e,t,r,i){var a,s;a=n/e;for(var o=0;o<15;o++)if(s=(n-(e*a-t*Math.sin(2*a)+r*Math.sin(4*a)-i*Math.sin(6*a)))/(e-2*t*Math.cos(2*a)+4*r*Math.cos(4*a)-6*i*Math.cos(6*a)),a+=s,Math.abs(s)<=1e-10)return a;return NaN}function x4e(){this.sphere||(this.e0=Q0(this.es),this.e1=J0(this.es),this.e2=ey(this.es),this.e3=ty(this.es),this.ml0=this.a*ra(this.e0,this.e1,this.e2,this.e3,this.lat0))}function b4e(n){var e,t,r=n.x,i=n.y;if(r=ot(r-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(r)),t=this.a*(Math.atan2(Math.tan(i),Math.cos(r))-this.lat0);else{var a=Math.sin(i),s=Math.cos(i),o=g3(this.a,this.e,a),l=Math.tan(i)*Math.tan(i),u=r*Math.cos(i),c=u*u,h=this.es*s*s/(1-this.es),f=this.a*ra(this.e0,this.e1,this.e2,this.e3,i);e=o*u*(1-c*l*(1/6-(8-l+8*h)*c/120)),t=f-this.ml0+o*a/s*c*(.5+(5-l+6*h)*c/24)}return n.x=e+this.x0,n.y=t+this.y0,n}function S4e(n){n.x-=this.x0,n.y-=this.y0;var e=n.x/this.a,t=n.y/this.a,r,i;if(this.sphere){var a=t+this.lat0;r=Math.asin(Math.sin(a)*Math.cos(e)),i=Math.atan2(Math.tan(e),Math.cos(a))}else{var s=this.ml0/this.a+t,o=Nb(s,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-qe)<=it)return n.x=this.long0,n.y=qe,t<0&&(n.y*=-1),n;var l=g3(this.a,this.e,Math.sin(o)),u=l*l*l/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(o),2),h=e*this.a/l,f=h*h;r=o-l*Math.tan(o)/u*h*h*(.5-(1+3*c)*h*h/24),i=h*(1-f*(c/3+(1+3*c)*c*f/15))/Math.cos(o)}return n.x=ot(i+this.long0,this.over),n.y=Mc(r),n}var w4e=["Cassini","Cassini_Soldner","cass"];const A4e={init:x4e,forward:b4e,inverse:S4e,names:w4e};function qo(n,e){var t;return n>1e-7?(t=n*e,(1-n*n)*(e/(1-t*t)-.5/n*Math.log((1-t)/(1+t)))):2*e}var M4e=.3333333333333333,T4e=.17222222222222222,C4e=.10257936507936508,E4e=.06388888888888888,P4e=.0664021164021164,L4e=.016415012942191543;function Hq(n){var e,t=[];return t[0]=n*M4e,e=n*n,t[0]+=e*T4e,t[1]=e*E4e,e*=n,t[0]+=e*C4e,t[1]+=e*P4e,t[2]=e*L4e,t}function Wq(n,e){var t=n+n;return n+e[0]*Math.sin(t)+e[1]*Math.sin(t+t)+e[2]*Math.sin(t+t+t)}var zE=1,UE=2,VE=3,rx=4;function R4e(){var n=Math.abs(this.lat0);if(Math.abs(n-qe)<it?this.mode=this.lat0<0?zE:UE:Math.abs(n)<it?this.mode=VE:this.mode=rx,this.es>0){var e;switch(this.qp=qo(this.e,1),this.mmf=.5/(1-this.es),this.apa=Hq(this.es),this.mode){case UE:this.dd=1;break;case zE:this.dd=1;break;case VE:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case rx:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=qo(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===rx&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function D4e(n){var e,t,r,i,a,s,o,l,u,c,h=n.x,f=n.y;if(h=ot(h-this.long0,this.over),this.sphere){if(a=Math.sin(f),c=Math.cos(f),r=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+c*r:1+this.sinph0*a+this.cosph0*c*r,t<=it)return null;t=Math.sqrt(2/t),e=t*c*Math.sin(h),t*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*c*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.lat0)<it)return null;t=On-f*.5,t=2*(this.mode===this.S_POLE?Math.cos(t):Math.sin(t)),e=t*Math.sin(h),t*=r}}else{switch(o=0,l=0,u=0,r=Math.cos(h),i=Math.sin(h),a=Math.sin(f),s=qo(this.e,a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(o=s/this.qp,l=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:u=1+this.sinb1*o+this.cosb1*l*r;break;case this.EQUIT:u=1+l*r;break;case this.N_POLE:u=qe+f,s=this.qp-s;break;case this.S_POLE:u=f-qe,s=this.qp+s;break}if(Math.abs(u)<it)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),this.mode===this.OBLIQ?t=this.ymf*u*(this.cosb1*o-this.sinb1*l*r):t=(u=Math.sqrt(2/(1+l*r)))*o*this.ymf,e=this.xmf*u*l*i;break;case this.N_POLE:case this.S_POLE:s>=0?(e=(u=Math.sqrt(s))*i,t=r*(this.mode===this.S_POLE?u:-u)):e=t=0;break}}return n.x=this.a*e+this.x0,n.y=this.a*t+this.y0,n}function I4e(n){n.x-=this.x0,n.y-=this.y0;var e=n.x/this.a,t=n.y/this.a,r,i,a,s,o,l,u;if(this.sphere){var c=0,h,f=0;if(h=Math.sqrt(e*e+t*t),i=h*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(i),c=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(h)<=it?0:Math.asin(t*f/h),e*=f,t=c*h;break;case this.OBLIQ:i=Math.abs(h)<=it?this.lat0:Math.asin(c*this.sinph0+t*f*this.cosph0/h),e*=f*this.cosph0,t=(c-Math.sin(i)*this.sinph0)*h;break;case this.N_POLE:t=-t,i=qe-i;break;case this.S_POLE:i-=qe;break}r=t===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,t)}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,t*=this.dd,l=Math.sqrt(e*e+t*t),l<it)return n.x=this.long0,n.y=this.lat0,n;s=2*Math.asin(.5*l/this.rq),a=Math.cos(s),e*=s=Math.sin(s),this.mode===this.OBLIQ?(u=a*this.sinb1+t*s*this.cosb1/l,o=this.qp*u,t=l*this.cosb1*a-t*this.sinb1*s):(u=t*s/l,o=this.qp*u,t=l*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(t=-t),o=e*e+t*t,!o)return n.x=this.long0,n.y=this.lat0,n;u=1-o/this.qp,this.mode===this.S_POLE&&(u=-u)}r=Math.atan2(e,t),i=Wq(Math.asin(u),this.apa)}return n.x=ot(this.long0+r,this.over),n.y=i,n}var N4e=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const k4e={init:R4e,forward:D4e,inverse:I4e,names:N4e,S_POLE:zE,N_POLE:UE,EQUIT:VE,OBLIQ:rx};function _c(n){return Math.abs(n)>1&&(n=n>1?1:-1),Math.asin(n)}function O4e(){Math.abs(this.lat1+this.lat2)<it||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=tl(this.e3,this.sin_po,this.cos_po),this.qs1=qo(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=tl(this.e3,this.sin_po,this.cos_po),this.qs2=qo(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=qo(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>it?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function F4e(n){var e=n.x,t=n.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var r=qo(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*ot(e-this.long0,this.over),s=i*Math.sin(a)+this.x0,o=this.rh-i*Math.cos(a)+this.y0;return n.x=s,n.y=o,n}function B4e(n){var e,t,r,i,a,s;return n.x-=this.x0,n.y=this.rh-n.y+this.y0,this.ns0>=0?(e=Math.sqrt(n.x*n.x+n.y*n.y),r=1):(e=-Math.sqrt(n.x*n.x+n.y*n.y),r=-1),i=0,e!==0&&(i=Math.atan2(r*n.x,r*n.y)),r=e*this.ns0/this.a,this.sphere?s=Math.asin((this.c-r*r)/(2*this.ns0)):(t=(this.c-r*r)/this.ns0,s=this.phi1z(this.e3,t)),a=ot(i/this.ns0+this.long0,this.over),n.x=a,n.y=s,n}function G4e(n,e){var t,r,i,a,s,o=_c(.5*e);if(n<it)return o;for(var l=n*n,u=1;u<=25;u++)if(t=Math.sin(o),r=Math.cos(o),i=n*t,a=1-i*i,s=.5*a*a/r*(e/(1-l)-t/a+.5/n*Math.log((1-i)/(1+i))),o=o+s,Math.abs(s)<=1e-7)return o;return null}var z4e=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const U4e={init:O4e,forward:F4e,inverse:B4e,names:z4e,phi1z:G4e};function V4e(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function H4e(n){var e,t,r,i,a,s,o,l,u=n.x,c=n.y;return r=ot(u-this.long0,this.over),e=Math.sin(c),t=Math.cos(c),i=Math.cos(r),s=this.sin_p14*e+this.cos_p14*t*i,a=1,s>0||Math.abs(s)<=it?(o=this.x0+this.a*a*t*Math.sin(r)/s,l=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*t*i)/s):(o=this.x0+this.infinity_dist*t*Math.sin(r),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*i)),n.x=o,n.y=l,n}function W4e(n){var e,t,r,i,a,s;return n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,(e=Math.sqrt(n.x*n.x+n.y*n.y))?(i=Math.atan2(e,this.rc),t=Math.sin(i),r=Math.cos(i),s=_c(r*this.sin_p14+n.y*t*this.cos_p14/e),a=Math.atan2(n.x*t,e*this.cos_p14*r-n.y*this.sin_p14*t),a=ot(this.long0+a,this.over)):(s=this.phic0,a=0),n.x=a,n.y=s,n}var $4e=["gnom"];const j4e={init:V4e,forward:H4e,inverse:W4e,names:$4e};function q4e(n,e){var t=1-(1-n*n)/(2*n)*Math.log((1-n)/(1+n));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*qe:qe;for(var r=Math.asin(.5*e),i,a,s,o,l=0;l<30;l++)if(a=Math.sin(r),s=Math.cos(r),o=n*a,i=Math.pow(1-o*o,2)/(2*s)*(e/(1-n*n)-a/(1-o*o)+.5/n*Math.log((1-o)/(1+o))),r+=i,Math.abs(i)<=1e-10)return r;return NaN}function X4e(){this.sphere||(this.k0=tl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Y4e(n){var e=n.x,t=n.y,r,i,a=ot(e-this.long0,this.over);if(this.sphere)r=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(t)/Math.cos(this.lat_ts);else{var s=qo(this.e,Math.sin(t));r=this.x0+this.a*this.k0*a,i=this.y0+this.a*s*.5/this.k0}return n.x=r,n.y=i,n}function K4e(n){n.x-=this.x0,n.y-=this.y0;var e,t;return this.sphere?(e=ot(this.long0+n.x/this.a/Math.cos(this.lat_ts),this.over),t=Math.asin(n.y/this.a*Math.cos(this.lat_ts))):(t=q4e(this.e,2*n.y*this.k0/this.a),e=ot(this.long0+n.x/(this.a*this.k0),this.over)),n.x=e,n.y=t,n}var Z4e=["cea"];const Q4e={init:X4e,forward:Y4e,inverse:K4e,names:Z4e};function J4e(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function eke(n){var e=n.x,t=n.y,r=ot(e-this.long0,this.over),i=Mc(t-this.lat0);return n.x=this.x0+this.a*r*this.rc,n.y=this.y0+this.a*i,n}function tke(n){var e=n.x,t=n.y;return n.x=ot(this.long0+(e-this.x0)/(this.a*this.rc),this.over),n.y=Mc(this.lat0+(t-this.y0)/this.a),n}var nke=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const rke={init:J4e,forward:eke,inverse:tke,names:nke};var uG=20;function ike(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Q0(this.es),this.e1=J0(this.es),this.e2=ey(this.es),this.e3=ty(this.es),this.ml0=this.a*ra(this.e0,this.e1,this.e2,this.e3,this.lat0)}function ake(n){var e=n.x,t=n.y,r,i,a,s=ot(e-this.long0,this.over);if(a=s*Math.sin(t),this.sphere)Math.abs(t)<=it?(r=this.a*s,i=-1*this.a*this.lat0):(r=this.a*Math.sin(a)/Math.tan(t),i=this.a*(Mc(t-this.lat0)+(1-Math.cos(a))/Math.tan(t)));else if(Math.abs(t)<=it)r=this.a*s,i=-1*this.ml0;else{var o=g3(this.a,this.e,Math.sin(t))/Math.tan(t);r=o*Math.sin(a),i=this.a*ra(this.e0,this.e1,this.e2,this.e3,t)-this.ml0+o*(1-Math.cos(a))}return n.x=r+this.x0,n.y=i+this.y0,n}function ske(n){var e,t,r,i,a,s,o,l,u;if(r=n.x-this.x0,i=n.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=it)e=ot(r/this.a+this.long0,this.over),t=0;else{s=this.lat0+i/this.a,o=r*r/this.a/this.a+s*s,l=s;var c;for(a=uG;a;--a)if(c=Math.tan(l),u=-1*(s*(l*c+1)-l-.5*(l*l+o)*c)/((l-s)/c-1),l+=u,Math.abs(u)<=it){t=l;break}e=ot(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(t),this.over)}else if(Math.abs(i+this.ml0)<=it)t=0,e=ot(this.long0+r/this.a,this.over);else{s=(this.ml0+i)/this.a,o=r*r/this.a/this.a+s*s,l=s;var h,f,d,p,g;for(a=uG;a;--a)if(g=this.e*Math.sin(l),h=Math.sqrt(1-g*g)*Math.tan(l),f=this.a*ra(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),p=f/this.a,u=(s*(h*p+1)-p-.5*h*(p*p+o))/(this.es*Math.sin(2*l)*(p*p+o-2*s*p)/(4*h)+(s-p)*(h*d-2/Math.sin(2*l))-d),l-=u,Math.abs(u)<=it){t=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=ot(this.long0+Math.asin(r*h/this.a)/Math.sin(t),this.over)}return n.x=e,n.y=t,n}var oke=["Polyconic","American_Polyconic","poly"];const lke={init:ike,forward:ake,inverse:ske,names:oke};function uke(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function cke(n){var e,t=n.x,r=n.y,i=r-this.lat0,a=t-this.long0,s=i/xm*1e-5,o=a,l=1,u=0;for(e=1;e<=10;e++)l=l*s,u=u+this.A[e]*l;var c=u,h=o,f=1,d=0,p,g,v=0,m=0;for(e=1;e<=6;e++)p=f*c-d*h,g=d*c+f*h,f=p,d=g,v=v+this.B_re[e]*f-this.B_im[e]*d,m=m+this.B_im[e]*f+this.B_re[e]*d;return n.x=m*this.a+this.x0,n.y=v*this.a+this.y0,n}function hke(n){var e,t=n.x,r=n.y,i=t-this.x0,a=r-this.y0,s=a/this.a,o=i/this.a,l=1,u=0,c,h,f=0,d=0;for(e=1;e<=6;e++)c=l*s-u*o,h=u*s+l*o,l=c,u=h,f=f+this.C_re[e]*l-this.C_im[e]*u,d=d+this.C_im[e]*l+this.C_re[e]*u;for(var p=0;p<this.iterations;p++){var g=f,v=d,m,y,_=s,x=o;for(e=2;e<=6;e++)m=g*f-v*d,y=v*f+g*d,g=m,v=y,_=_+(e-1)*(this.B_re[e]*g-this.B_im[e]*v),x=x+(e-1)*(this.B_im[e]*g+this.B_re[e]*v);g=1,v=0;var b=this.B_re[1],S=this.B_im[1];for(e=2;e<=6;e++)m=g*f-v*d,y=v*f+g*d,g=m,v=y,b=b+e*(this.B_re[e]*g-this.B_im[e]*v),S=S+e*(this.B_im[e]*g+this.B_re[e]*v);var w=b*b+S*S;f=(_*b+x*S)/w,d=(x*b-_*S)/w}var T=f,C=d,A=1,M=0;for(e=1;e<=9;e++)A=A*T,M=M+this.D[e]*A;var P=this.lat0+M*xm*1e5,D=this.long0+C;return n.x=D,n.y=P,n}var fke=["New_Zealand_Map_Grid","nzmg"];const dke={init:uke,forward:cke,inverse:hke,names:fke};function pke(){}function vke(n){var e=n.x,t=n.y,r=ot(e-this.long0,this.over),i=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+t/2.5))*1.25;return n.x=i,n.y=a,n}function gke(n){n.x-=this.x0,n.y-=this.y0;var e=ot(this.long0+n.x/this.a,this.over),t=2.5*(Math.atan(Math.exp(.8*n.y/this.a))-Math.PI/4);return n.x=e,n.y=t,n}var mke=["Miller_Cylindrical","mill"];const yke={init:pke,forward:vke,inverse:gke,names:mke};var _ke=20;function xke(){this.long0=this.long0||0,this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=c3(this.es)}function $q(n){var e,t,r=n.x,i=n.y;if(r=ot(r-this.long0,this.over),this.sphere){if(!this.m)i=this.n!==1?Math.asin(this.n*Math.sin(i)):i;else for(var a=this.n*Math.sin(i),s=_ke;s;--s){var o=(this.m*i+Math.sin(i)-a)/(this.m+Math.cos(i));if(i-=o,Math.abs(o)<it)break}e=this.a*this.C_x*r*(this.m+Math.cos(i)),t=this.a*this.C_y*i}else{var l=Math.sin(i),u=Math.cos(i);t=this.a*gv(i,l,u,this.en),e=this.a*r*u/Math.sqrt(1-this.es*l*l)}return n.x=e,n.y=t,n}function jq(n){var e,t,r,i;return n.x-=this.x0,r=n.x/this.a,n.y-=this.y0,e=n.y/this.a,this.sphere?(e/=this.C_y,r=r/(this.C_x*(this.m+Math.cos(e))),this.m?e=_c((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=_c(Math.sin(e)/this.n)),r=ot(r+this.long0,this.over),e=Mc(e)):(e=h3(n.y/this.a,this.es,this.en),i=Math.abs(e),i<qe?(i=Math.sin(e),t=this.long0+n.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(e)),r=ot(t,this.over)):i-it<qe&&(r=this.long0)),n.x=r,n.y=e,n}var bke=["Sinusoidal","sinu"];const Ske={init:xke,forward:$q,inverse:jq,names:bke};function wke(){this.sphere=!0,this.b=this.a,this.m=1,this.n=2.5707963267948966,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)}var Ake=$q,Mke=jq,Tke=["Eckert_VI","eck6"];const Cke={init:wke,forward:Ake,inverse:Mke,names:Tke};function Eke(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0}function Pke(n){for(var e=n.x,t=n.y,r=ot(e-this.long0,this.over),i=t,a=Math.PI*Math.sin(t);;){var s=-(i+Math.sin(i)-a)/(1+Math.cos(i));if(i+=s,Math.abs(s)<it)break}i/=2,Math.PI/2-Math.abs(t)<it&&(r=0);var o=.900316316158*this.a*r*Math.cos(i)+this.x0,l=1.4142135623731*this.a*Math.sin(i)+this.y0;return n.x=o,n.y=l,n}function Lke(n){var e,t;n.x-=this.x0,n.y-=this.y0,t=n.y/(1.4142135623731*this.a),Math.abs(t)>.999999999999&&(t=.999999999999),e=Math.asin(t);var r=ot(this.long0+n.x/(.900316316158*this.a*Math.cos(e)),this.over);r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var i=Math.asin(t);return n.x=r,n.y=i,n}var Rke=["Mollweide","moll"];const Dke={init:Eke,forward:Pke,inverse:Lke,names:Rke};function Ike(){Math.abs(this.lat1+this.lat2)<it||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Q0(this.es),this.e1=J0(this.es),this.e2=ey(this.es),this.e3=ty(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=tl(this.e,this.sin_phi,this.cos_phi),this.ml1=ra(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<it?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=tl(this.e,this.sin_phi,this.cos_phi),this.ml2=ra(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=ra(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Nke(n){var e=n.x,t=n.y,r;if(this.sphere)r=this.a*(this.g-t);else{var i=ra(this.e0,this.e1,this.e2,this.e3,t);r=this.a*(this.g-i)}var a=this.ns*ot(e-this.long0,this.over),s=this.x0+r*Math.sin(a),o=this.y0+this.rh-r*Math.cos(a);return n.x=s,n.y=o,n}function kke(n){n.x-=this.x0,n.y=this.rh-n.y+this.y0;var e,t,r,i;this.ns>=0?(t=Math.sqrt(n.x*n.x+n.y*n.y),e=1):(t=-Math.sqrt(n.x*n.x+n.y*n.y),e=-1);var a=0;if(t!==0&&(a=Math.atan2(e*n.x,e*n.y)),this.sphere)return i=ot(this.long0+a/this.ns,this.over),r=Mc(this.g-t/this.a),n.x=i,n.y=r,n;var s=this.g-t/this.a;return r=Nb(s,this.e0,this.e1,this.e2,this.e3),i=ot(this.long0+a/this.ns,this.over),n.x=i,n.y=r,n}var Oke=["Equidistant_Conic","eqdc"];const Fke={init:Ike,forward:Nke,inverse:kke,names:Oke};function Bke(){this.R=this.a}function Gke(n){var e=n.x,t=n.y,r=ot(e-this.long0,this.over),i,a;Math.abs(t)<=it&&(i=this.x0+this.R*r,a=this.y0);var s=_c(2*Math.abs(t/Math.PI));(Math.abs(r)<=it||Math.abs(Math.abs(t)-qe)<=it)&&(i=this.x0,t>=0?a=this.y0+Math.PI*this.R*Math.tan(.5*s):a=this.y0+Math.PI*this.R*-Math.tan(.5*s));var o=.5*Math.abs(Math.PI/r-r/Math.PI),l=o*o,u=Math.sin(s),c=Math.cos(s),h=c/(u+c-1),f=h*h,d=h*(2/u-1),p=d*d,g=Math.PI*this.R*(o*(h-p)+Math.sqrt(l*(h-p)*(h-p)-(p+l)*(f-p)))/(p+l);r<0&&(g=-g),i=this.x0+g;var v=l+h;return g=Math.PI*this.R*(d*v-o*Math.sqrt((p+l)*(l+1)-v*v))/(p+l),t>=0?a=this.y0+g:a=this.y0-g,n.x=i,n.y=a,n}function zke(n){var e,t,r,i,a,s,o,l,u,c,h,f,d;return n.x-=this.x0,n.y-=this.y0,h=Math.PI*this.R,r=n.x/h,i=n.y/h,a=r*r+i*i,s=-Math.abs(i)*(1+a),o=s-2*i*i+r*r,l=-2*s+1+2*i*i+a*a,d=i*i/l+(2*o*o*o/l/l/l-9*s*o/l/l)/27,u=(s-o*o/3/l)/l,c=2*Math.sqrt(-u/3),h=3*d/u/c,Math.abs(h)>1&&(h>=0?h=1:h=-1),f=Math.acos(h)/3,n.y>=0?t=(-c*Math.cos(f+Math.PI/3)-o/3/l)*Math.PI:t=-(-c*Math.cos(f+Math.PI/3)-o/3/l)*Math.PI,Math.abs(r)<it?e=this.long0:e=ot(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-i*i)+a*a))/2/r,this.over),n.x=e,n.y=t,n}var Uke=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const Vke={init:Bke,forward:Gke,inverse:zke,names:Uke};function Hke(n,e,t,r,i,a){const s=r-e,o=Math.atan((1-a)*Math.tan(n)),l=Math.atan((1-a)*Math.tan(t)),u=Math.sin(o),c=Math.cos(o),h=Math.sin(l),f=Math.cos(l);let d=s,p,g=100,v,m,y,_,x,b,S,w,T,C,A,M,P,D;do{if(v=Math.sin(d),m=Math.cos(d),y=Math.sqrt(f*v*(f*v)+(c*h-u*f*m)*(c*h-u*f*m)),y===0)return{azi1:0,s12:0};_=u*h+c*f*m,x=Math.atan2(y,_),b=c*f*v/y,S=1-b*b,w=S!==0?_-2*u*h/S:0,T=a/16*S*(4+a*(4-3*S)),p=d,d=s+(1-T)*a*b*(x+T*y*(w+T*_*(-1+2*w*w)))}while(Math.abs(d-p)>1e-12&&--g>0);return g===0?{azi1:NaN,s12:NaN}:(C=S*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),A=1+C/16384*(4096+C*(-768+C*(320-175*C))),M=C/1024*(256+C*(-128+C*(74-47*C))),P=M*y*(w+M/4*(_*(-1+2*w*w)-M/6*w*(-3+4*y*y)*(-3+4*w*w))),D=i*(1-a)*A*(x-P),{azi1:Math.atan2(f*v,c*h-u*f*m),s12:D})}function Wke(n,e,t,r,i,a){const s=Math.atan((1-a)*Math.tan(n)),o=Math.sin(s),l=Math.cos(s),u=Math.sin(t),c=Math.cos(t),h=Math.atan2(o,l*c),f=l*u,d=1-f*f,p=d*(i*i-i*(1-a)*(i*(1-a)))/(i*(1-a)*(i*(1-a))),g=1+p/16384*(4096+p*(-768+p*(320-175*p))),v=p/1024*(256+p*(-128+p*(74-47*p)));let m=r/(i*(1-a)*g),y,_=100,x,b,S,w;do x=Math.cos(2*h+m),b=Math.sin(m),S=Math.cos(m),w=v*b*(x+v/4*(S*(-1+2*x*x)-v/6*x*(-3+4*b*b)*(-3+4*x*x))),y=m,m=r/(i*(1-a)*g)+w;while(Math.abs(m-y)>1e-12&&--_>0);if(_===0)return{lat2:NaN,lon2:NaN};const T=o*b-l*S*c,C=Math.atan2(o*S+l*b*c,(1-a)*Math.sqrt(f*f+T*T)),A=Math.atan2(b*u,l*S-o*b*c),M=a/16*d*(4+a*(4-3*d)),P=A-(1-M)*a*f*(m+M*b*(x+M*S*(-1+2*x*x))),D=e+P;return{lat2:C,lon2:D}}function $ke(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function jke(n){var e=n.x,t=n.y,r=Math.sin(n.y),i=Math.cos(n.y),a=ot(e-this.long0,this.over),s,o,l,u,c,h,f,d,p,g,v;return this.sphere?Math.abs(this.sin_p12-1)<=it?(n.x=this.x0+this.a*(qe-t)*Math.sin(a),n.y=this.y0-this.a*(qe-t)*Math.cos(a),n):Math.abs(this.sin_p12+1)<=it?(n.x=this.x0+this.a*(qe+t)*Math.sin(a),n.y=this.y0+this.a*(qe+t)*Math.cos(a),n):(p=this.sin_p12*r+this.cos_p12*i*Math.cos(a),f=Math.acos(p),d=f?f/Math.sin(f):1,n.x=this.x0+this.a*d*i*Math.sin(a),n.y=this.y0+this.a*d*(this.cos_p12*r-this.sin_p12*i*Math.cos(a)),n):(s=Q0(this.es),o=J0(this.es),l=ey(this.es),u=ty(this.es),Math.abs(this.sin_p12-1)<=it?(c=this.a*ra(s,o,l,u,qe),h=this.a*ra(s,o,l,u,t),n.x=this.x0+(c-h)*Math.sin(a),n.y=this.y0-(c-h)*Math.cos(a),n):Math.abs(this.sin_p12+1)<=it?(c=this.a*ra(s,o,l,u,qe),h=this.a*ra(s,o,l,u,t),n.x=this.x0+(c+h)*Math.sin(a),n.y=this.y0+(c+h)*Math.cos(a),n):Math.abs(e)<it&&Math.abs(t-this.lat0)<it?(n.x=n.y=0,n):(g=Hke(this.lat0,this.long0,t,e,this.a,this.f),v=g.azi1,n.x=g.s12*Math.sin(v),n.y=g.s12*Math.cos(v),n))}function qke(n){n.x-=this.x0,n.y-=this.y0;var e,t,r,i,a,s,o,l,u,c,h,f,d,p,g,v;return this.sphere?(e=Math.sqrt(n.x*n.x+n.y*n.y),e>2*qe*this.a?void 0:(t=e/this.a,r=Math.sin(t),i=Math.cos(t),a=this.long0,Math.abs(e)<=it?s=this.lat0:(s=_c(i*this.sin_p12+n.y*r*this.cos_p12/e),o=Math.abs(this.lat0)-qe,Math.abs(o)<=it?this.lat0>=0?a=ot(this.long0+Math.atan2(n.x,-n.y),this.over):a=ot(this.long0-Math.atan2(-n.x,n.y),this.over):a=ot(this.long0+Math.atan2(n.x*r,e*this.cos_p12*i-n.y*this.sin_p12*r),this.over)),n.x=a,n.y=s,n)):(l=Q0(this.es),u=J0(this.es),c=ey(this.es),h=ty(this.es),Math.abs(this.sin_p12-1)<=it?(f=this.a*ra(l,u,c,h,qe),e=Math.sqrt(n.x*n.x+n.y*n.y),d=f-e,s=Nb(d/this.a,l,u,c,h),a=ot(this.long0+Math.atan2(n.x,-1*n.y),this.over),n.x=a,n.y=s,n):Math.abs(this.sin_p12+1)<=it?(f=this.a*ra(l,u,c,h,qe),e=Math.sqrt(n.x*n.x+n.y*n.y),d=e-f,s=Nb(d/this.a,l,u,c,h),a=ot(this.long0+Math.atan2(n.x,n.y),this.over),n.x=a,n.y=s,n):(p=Math.atan2(n.x,n.y),g=Math.sqrt(n.x*n.x+n.y*n.y),v=Wke(this.lat0,this.long0,p,g,this.a,this.f),n.x=v.lon2,n.y=v.lat2,n))}var Xke=["Azimuthal_Equidistant","aeqd"];const Yke={init:$ke,forward:jke,inverse:qke,names:Xke};function Kke(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function Zke(n){var e,t,r,i,a,s,o,l,u=n.x,c=n.y;return r=ot(u-(this.long0||0),this.over),e=Math.sin(c),t=Math.cos(c),i=Math.cos(r),s=this.sin_p14*e+this.cos_p14*t*i,a=1,(s>0||Math.abs(s)<=it)&&(o=this.a*a*t*Math.sin(r),l=(this.y0||0)+this.a*a*(this.cos_p14*e-this.sin_p14*t*i)),n.x=o,n.y=l,n}function Qke(n){var e,t,r,i,a,s,o,l,u;return n.x-=this.x0||0,n.y-=this.y0||0,e=Math.sqrt(n.x*n.x+n.y*n.y),t=_c(e/this.a),r=Math.sin(t),i=Math.cos(t),l=this.long0||0,u=this.lat0||0,s=l,Math.abs(e)<=it?(o=u,n.x=s,n.y=o,n):(o=_c(i*this.sin_p14+n.y*r*this.cos_p14/e),a=Math.abs(u)-qe,Math.abs(a)<=it?(u>=0?s=ot(l+Math.atan2(n.x,-n.y),this.over):s=ot(l-Math.atan2(-n.x,n.y),this.over),n.x=s,n.y=o,n):(s=ot(l+Math.atan2(n.x*r,e*this.cos_p14*i-n.y*this.sin_p14*r),this.over),n.x=s,n.y=o,n))}var Jke=["ortho"];const e5e={init:Kke,forward:Zke,inverse:Qke,names:Jke};var gr={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Fn={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function t5e(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=qe-On/2?this.face=gr.TOP:this.lat0<=-(qe-On/2)?this.face=gr.BOTTOM:Math.abs(this.long0)<=On?this.face=gr.FRONT:Math.abs(this.long0)<=qe+On?this.face=this.long0>0?gr.RIGHT:gr.LEFT:this.face=gr.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function n5e(n){var e={x:0,y:0},t,r,i,a,s,o,l={value:0};if(n.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(n.y)):t=n.y,r=n.x,this.face===gr.TOP)a=qe-t,r>=On&&r<=qe+On?(l.value=Fn.AREA_0,i=r-qe):r>qe+On||r<=-(qe+On)?(l.value=Fn.AREA_1,i=r>0?r-Nr:r+Nr):r>-(qe+On)&&r<=-On?(l.value=Fn.AREA_2,i=r+qe):(l.value=Fn.AREA_3,i=r);else if(this.face===gr.BOTTOM)a=qe+t,r>=On&&r<=qe+On?(l.value=Fn.AREA_0,i=-r+qe):r<On&&r>=-On?(l.value=Fn.AREA_1,i=-r):r<-On&&r>=-(qe+On)?(l.value=Fn.AREA_2,i=-r-qe):(l.value=Fn.AREA_3,i=r>0?-r+Nr:-r-Nr);else{var u,c,h,f,d,p,g;this.face===gr.RIGHT?r=hp(r,+qe):this.face===gr.BACK?r=hp(r,+Nr):this.face===gr.LEFT&&(r=hp(r,-qe)),f=Math.sin(t),d=Math.cos(t),p=Math.sin(r),g=Math.cos(r),u=d*g,c=d*p,h=f,this.face===gr.FRONT?(a=Math.acos(u),i=x1(a,h,c,l)):this.face===gr.RIGHT?(a=Math.acos(c),i=x1(a,h,-u,l)):this.face===gr.BACK?(a=Math.acos(-u),i=x1(a,h,-c,l)):this.face===gr.LEFT?(a=Math.acos(-c),i=x1(a,h,u,l)):(a=i=0,l.value=Fn.AREA_0)}return o=Math.atan(12/Nr*(i+Math.acos(Math.sin(i)*Math.cos(On))-qe)),s=Math.sqrt((1-Math.cos(a))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===Fn.AREA_1?o+=qe:l.value===Fn.AREA_2?o+=Nr:l.value===Fn.AREA_3&&(o+=1.5*Nr),e.x=s*Math.cos(o),e.y=s*Math.sin(o),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,n.x=e.x,n.y=e.y,n}function r5e(n){var e={lam:0,phi:0},t,r,i,a,s,o,l,u,c,h={value:0};if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,r=Math.atan(Math.sqrt(n.x*n.x+n.y*n.y)),t=Math.atan2(n.y,n.x),n.x>=0&&n.x>=Math.abs(n.y)?h.value=Fn.AREA_0:n.y>=0&&n.y>=Math.abs(n.x)?(h.value=Fn.AREA_1,t-=qe):n.x<0&&-n.x>=Math.abs(n.y)?(h.value=Fn.AREA_2,t=t<0?t+Nr:t-Nr):(h.value=Fn.AREA_3,t+=qe),c=Nr/12*Math.tan(t),s=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(s),i=Math.cos(t),a=Math.tan(r),l=1-i*i*a*a*(1-Math.cos(Math.atan(1/Math.cos(o)))),l<-1?l=-1:l>1&&(l=1),this.face===gr.TOP)u=Math.acos(l),e.phi=qe-u,h.value===Fn.AREA_0?e.lam=o+qe:h.value===Fn.AREA_1?e.lam=o<0?o+Nr:o-Nr:h.value===Fn.AREA_2?e.lam=o-qe:e.lam=o;else if(this.face===gr.BOTTOM)u=Math.acos(l),e.phi=u-qe,h.value===Fn.AREA_0?e.lam=-o+qe:h.value===Fn.AREA_1?e.lam=-o:h.value===Fn.AREA_2?e.lam=-o-qe:e.lam=o<0?-o-Nr:-o+Nr;else{var f,d,p;f=l,c=f*f,c>=1?p=0:p=Math.sqrt(1-c)*Math.sin(o),c+=p*p,c>=1?d=0:d=Math.sqrt(1-c),h.value===Fn.AREA_1?(c=d,d=-p,p=c):h.value===Fn.AREA_2?(d=-d,p=-p):h.value===Fn.AREA_3&&(c=d,d=p,p=-c),this.face===gr.RIGHT?(c=f,f=-d,d=c):this.face===gr.BACK?(f=-f,d=-d):this.face===gr.LEFT&&(c=f,f=d,d=-c),e.phi=Math.acos(-p)-qe,e.lam=Math.atan2(d,f),this.face===gr.RIGHT?e.lam=hp(e.lam,-qe):this.face===gr.BACK?e.lam=hp(e.lam,-Nr):this.face===gr.LEFT&&(e.lam=hp(e.lam,+qe))}if(this.es!==0){var g,v,m;g=e.phi<0?1:0,v=Math.tan(e.phi),m=this.b/Math.sqrt(v*v+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-m*m)/(this.one_minus_f*m)),g&&(e.phi=-e.phi)}return e.lam+=this.long0,n.x=e.lam,n.y=e.phi,n}function x1(n,e,t,r){var i;return n<it?(r.value=Fn.AREA_0,i=0):(i=Math.atan2(e,t),Math.abs(i)<=On?r.value=Fn.AREA_0:i>On&&i<=qe+On?(r.value=Fn.AREA_1,i-=qe):i>qe+On||i<=-(qe+On)?(r.value=Fn.AREA_2,i=i>=0?i-Nr:i+Nr):(r.value=Fn.AREA_3,i+=qe)),i}function hp(n,e){var t=n+e;return t<-Nr?t+=S0:t>+Nr&&(t-=S0),t}var i5e=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const a5e={init:t5e,forward:n5e,inverse:r5e,names:i5e};var HE=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],qg=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],qq=.8487,Xq=1.3523,Yq=xa/5,s5e=1/Yq,Yd=18,kb=function(n,e){return n[0]+e*(n[1]+e*(n[2]+e*n[3]))},o5e=function(n,e){return n[1]+e*(2*n[2]+e*3*n[3])};function l5e(n,e,t,r){for(var i=e;r;--r){var a=n(i);if(i-=a,Math.abs(a)<t)break}return i}function u5e(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function c5e(n){var e=ot(n.x-this.long0,this.over),t=Math.abs(n.y),r=Math.floor(t*Yq);r<0?r=0:r>=Yd&&(r=Yd-1),t=xa*(t-s5e*r);var i={x:kb(HE[r],t)*e,y:kb(qg[r],t)};return n.y<0&&(i.y=-i.y),i.x=i.x*this.a*qq+this.x0,i.y=i.y*this.a*Xq+this.y0,i}function h5e(n){var e={x:(n.x-this.x0)/(this.a*qq),y:Math.abs(n.y-this.y0)/(this.a*Xq)};if(e.y>=1)e.x/=HE[Yd][0],e.y=n.y<0?-qe:qe;else{var t=Math.floor(e.y*Yd);for(t<0?t=0:t>=Yd&&(t=Yd-1);;)if(qg[t][0]>e.y)--t;else if(qg[t+1][0]<=e.y)++t;else break;var r=qg[t],i=5*(e.y-r[0])/(qg[t+1][0]-r[0]);i=l5e(function(a){return(kb(r,a)-e.y)/o5e(r,a)},i,it,100),e.x/=kb(HE[t],i),e.y=(5*t+i)*wr,n.y<0&&(e.y=-e.y)}return e.x=ot(e.x+this.long0,this.over),e}var f5e=["Robinson","robin"];const d5e={init:u5e,forward:c5e,inverse:h5e,names:f5e};function p5e(){this.name="geocent"}function v5e(n){var e=Iq(n,this.es,this.a);return e}function g5e(n){var e=Nq(n,this.es,this.a,this.b);return e}var m5e=["Geocentric","geocentric","geocent","Geocent"];const y5e={init:p5e,forward:v5e,inverse:g5e,names:m5e};var Fi={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Mg={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function _5e(){if(Object.keys(Mg).forEach(function(t){if(typeof this[t]=="undefined")this[t]=Mg[t].def;else{if(Mg[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Mg[t].num&&(this[t]=parseFloat(this[t]))}Mg[t].degrees&&(this[t]=this[t]*wr)}.bind(this)),Math.abs(Math.abs(this.lat0)-qe)<it?this.mode=this.lat0<0?Fi.S_POLE:Fi.N_POLE:Math.abs(this.lat0)<it?this.mode=Fi.EQUIT:(this.mode=Fi.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var n=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(n),this.sw=Math.sin(n)}function x5e(n){n.x-=this.long0;var e=Math.sin(n.y),t=Math.cos(n.y),r=Math.cos(n.x),i,a;switch(this.mode){case Fi.OBLIQ:a=this.sinph0*e+this.cosph0*t*r;break;case Fi.EQUIT:a=t*r;break;case Fi.S_POLE:a=-e;break;case Fi.N_POLE:a=e;break}switch(a=this.pn1/(this.p-a),i=a*t*Math.sin(n.x),this.mode){case Fi.OBLIQ:a*=this.cosph0*e-this.sinph0*t*r;break;case Fi.EQUIT:a*=e;break;case Fi.N_POLE:a*=-(t*r);break;case Fi.S_POLE:a*=t*r;break}var s,o;return s=a*this.cg+i*this.sg,o=1/(s*this.sw*this.h1+this.cw),i=(i*this.cg-a*this.sg)*this.cw*o,a=s*o,n.x=i*this.a,n.y=a*this.a,n}function b5e(n){n.x/=this.a,n.y/=this.a;var e={x:n.x,y:n.y},t,r,i;i=1/(this.pn1-n.y*this.sw),t=this.pn1*n.x*i,r=this.pn1*n.y*this.cw*i,n.x=t*this.cg+r*this.sg,n.y=r*this.cg-t*this.sg;var a=ya(n.x,n.y);if(Math.abs(a)<it)e.x=0,e.y=n.y;else{var s,o;switch(o=1-a*a*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/a+a/this.pn1),s=Math.sqrt(1-o*o),this.mode){case Fi.OBLIQ:e.y=Math.asin(s*this.sinph0+n.y*o*this.cosph0/a),n.y=(s-this.sinph0*Math.sin(e.y))*a,n.x*=o*this.cosph0;break;case Fi.EQUIT:e.y=Math.asin(n.y*o/a),n.y=s*a,n.x*=o;break;case Fi.N_POLE:e.y=Math.asin(s),n.y=-n.y;break;case Fi.S_POLE:e.y=-Math.asin(s);break}e.x=Math.atan2(n.x,n.y)}return n.x=e.x+this.long0,n.y=e.y,n}var S5e=["Tilted_Perspective","tpers"];const w5e={init:_5e,forward:x5e,inverse:b5e,names:S5e};function A5e(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var n=1-this.es,e=1/n;this.radius_p=Math.sqrt(n),this.radius_p2=n,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function M5e(n){var e=n.x,t=n.y,r,i,a,s;if(e=e-this.long0,this.shape==="ellipse"){t=Math.atan(this.radius_p2*Math.tan(t));var o=this.radius_p/ya(this.radius_p*Math.cos(t),Math.sin(t));if(i=o*Math.cos(e)*Math.cos(t),a=o*Math.sin(e)*Math.cos(t),s=o*Math.sin(t),(this.radius_g-i)*i-a*a-s*s*this.radius_p_inv2<0)return n.x=Number.NaN,n.y=Number.NaN,n;r=this.radius_g-i,this.flip_axis?(n.x=this.radius_g_1*Math.atan(a/ya(s,r)),n.y=this.radius_g_1*Math.atan(s/r)):(n.x=this.radius_g_1*Math.atan(a/r),n.y=this.radius_g_1*Math.atan(s/ya(a,r)))}else this.shape==="sphere"&&(r=Math.cos(t),i=Math.cos(e)*r,a=Math.sin(e)*r,s=Math.sin(t),r=this.radius_g-i,this.flip_axis?(n.x=this.radius_g_1*Math.atan(a/ya(s,r)),n.y=this.radius_g_1*Math.atan(s/r)):(n.x=this.radius_g_1*Math.atan(a/r),n.y=this.radius_g_1*Math.atan(s/ya(a,r))));return n.x=n.x*this.a,n.y=n.y*this.a,n}function T5e(n){var e=-1,t=0,r=0,i,a,s,o;if(n.x=n.x/this.a,n.y=n.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*ya(1,r)):(t=Math.tan(n.x/this.radius_g_1),r=Math.tan(n.y/this.radius_g_1)*ya(1,t));var l=r/this.radius_p;if(i=t*t+l*l+e*e,a=2*this.radius_g*e,s=a*a-4*i*this.C,s<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-a-Math.sqrt(s))/(2*i),e=this.radius_g+o*e,t*=o,r*=o,n.x=Math.atan2(t,e),n.y=Math.atan(r*Math.cos(n.x)/e),n.y=Math.atan(this.radius_p_inv2*Math.tan(n.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*Math.sqrt(1+r*r)):(t=Math.tan(n.x/this.radius_g_1),r=Math.tan(n.y/this.radius_g_1)*Math.sqrt(1+t*t)),i=t*t+r*r+e*e,a=2*this.radius_g*e,s=a*a-4*i*this.C,s<0)return n.x=Number.NaN,n.y=Number.NaN,n;o=(-a-Math.sqrt(s))/(2*i),e=this.radius_g+o*e,t*=o,r*=o,n.x=Math.atan2(t,e),n.y=Math.atan(r*Math.cos(n.x)/e)}return n.x=n.x+this.long0,n}var C5e=["Geostationary Satellite View","Geostationary_Satellite","geos"];const E5e={init:A5e,forward:M5e,inverse:T5e,names:C5e};var bm=1.340264,Sm=-.081106,wm=893e-6,Am=.003796,Ob=Math.sqrt(3)/2;function P5e(){this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.es!==0&&(this.apa=Hq(this.es),this.qp=qo(this.e,1),this.rqda=Math.sqrt(.5*this.qp))}function L5e(n){var e=ot(n.x-this.long0,this.over),t=n.y,r=Math.sin(t);this.es!==0&&(r=qo(this.e,r)/this.qp);var i=Math.asin(Ob*r),a=i*i,s=a*a*a;return n.x=e*Math.cos(i)/(Ob*(bm+3*Sm*a+s*(7*wm+9*Am*a))),n.y=i*(bm+Sm*a+s*(wm+Am*a)),this.es!==0&&(n.x*=this.rqda,n.y*=this.rqda),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function R5e(n){n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,this.es!==0&&(n.x/=this.rqda,n.y/=this.rqda);var e=1e-9,t=12,r=n.y,i,a,s,o,l,u;for(u=0;u<t&&(i=r*r,a=i*i*i,s=r*(bm+Sm*i+a*(wm+Am*i))-n.y,o=bm+3*Sm*i+a*(7*wm+9*Am*i),r-=l=s/o,!(Math.abs(l)<e));++u);return i=r*r,a=i*i*i,n.x=Ob*n.x*(bm+3*Sm*i+a*(7*wm+9*Am*i))/Math.cos(r),n.y=Math.asin(Math.sin(r)/Ob),this.es!==0&&(n.y=Wq(n.y,this.apa)),n.x=ot(n.x+this.long0,this.over),n}var D5e=["eqearth","Equal Earth","Equal_Earth"];const I5e={init:P5e,forward:L5e,inverse:R5e,names:D5e};var M0=1e-10;function N5e(){var n;if(this.phi1=this.lat1,Math.abs(this.phi1)<M0)throw new Error;this.es?(this.en=c3(this.es),this.m1=gv(this.phi1,this.am1=Math.sin(this.phi1),n=Math.cos(this.phi1),this.en),this.am1=n/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=O5e,this.forward=k5e):(Math.abs(this.phi1)+M0>=qe?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=B5e,this.forward=F5e)}function k5e(n){var e=ot(n.x-(this.long0||0),this.over),t=n.y,r,i,a;return r=this.am1+this.m1-gv(t,i=Math.sin(t),a=Math.cos(t),this.en),i=a*e/(r*Math.sqrt(1-this.es*i*i)),n.x=r*Math.sin(i),n.y=this.am1-r*Math.cos(i),n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function O5e(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var e,t,r,i;if(t=ya(n.x,n.y=this.am1-n.y),i=h3(this.am1+this.m1-t,this.es,this.en),(e=Math.abs(i))<qe)e=Math.sin(i),r=t*Math.atan2(n.x,n.y)*Math.sqrt(1-this.es*e*e)/Math.cos(i);else if(Math.abs(e-qe)<=M0)r=0;else throw new Error;return n.x=ot(r+(this.long0||0),this.over),n.y=Mc(i),n}function F5e(n){var e=ot(n.x-(this.long0||0),this.over),t=n.y,r,i;return i=this.cphi1+this.phi1-t,Math.abs(i)>M0?(n.x=i*Math.sin(r=e*Math.cos(t)/i),n.y=this.cphi1-i*Math.cos(r)):n.x=n.y=0,n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function B5e(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var e,t,r=ya(n.x,n.y=this.cphi1-n.y);if(t=this.cphi1+this.phi1-r,Math.abs(t)>qe)throw new Error;return Math.abs(Math.abs(t)-qe)<=M0?e=0:e=r*Math.atan2(n.x,n.y)/Math.cos(t),n.x=ot(e+(this.long0||0),this.over),n.y=Mc(t),n}var G5e=["bonne","Bonne (Werner lat_1=90)"];const z5e={init:N5e,names:G5e},cG={OBLIQUE:{forward:$5e,inverse:q5e},TRANSVERSE:{forward:j5e,inverse:X5e}},Fb={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function U5e(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=Pq.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const n=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=ks(n);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let t;const r=Object.keys(Fb),i=o=>{if(typeof this[o]=="undefined")return;const l=parseFloat(this[o])*wr;if(isNaN(l))throw new Error("Invalid value for "+o+": "+this[o]);return l};for(let o=0;o<r.length;o++){const l=r[o],u=Fb[l],c=Object.entries(u);if(c.some(([f])=>typeof this[f]!="undefined")){t=u;for(let f=0;f<c.length;f++){const[d,p]=c[f],g=i(d);if(typeof g=="undefined")throw new Error("Missing parameter: "+d+".");this[p]=g}break}}if(!t)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:a,phip:s}=W5e(this,t);this.lamp=a,Math.abs(s)>it?(this.cphip=Math.cos(s),this.sphip=Math.sin(s),this.projectionType=cG.OBLIQUE):this.projectionType=cG.TRANSVERSE}function V5e(n){return this.projectionType.forward(this,n)}function H5e(n){return this.projectionType.inverse(this,n)}function W5e(n,e){let t,r;if(e===Fb.ROTATE){let i=n.oLongC,a=n.oLatC,s=n.oAlpha;if(Math.abs(Math.abs(a)-qe)<=it)throw new Error("Invalid value for o_lat_c: "+n.o_lat_c+" should be < 90°");r=i+Math.atan2(-1*Math.cos(s),-1*Math.sin(s)*Math.sin(a)),t=Math.asin(Math.cos(a)*Math.sin(s))}else if(e===Fb.NEW_POLE)r=n.oLongP,t=n.oLatP;else{let i=n.oLong1,a=n.oLat1,s=n.oLong2,o=n.oLat2,l=Math.abs(a);if(Math.abs(a)>qe-it)throw new Error("Invalid value for o_lat_1: "+n.o_lat_1+" should be < 90°");if(Math.abs(o)>qe-it)throw new Error("Invalid value for o_lat_2: "+n.o_lat_2+" should be < 90°");if(Math.abs(a-o)<it)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(l<it)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");r=Math.atan2(Math.cos(a)*Math.sin(o)*Math.cos(i)-Math.sin(a)*Math.cos(o)*Math.cos(s),Math.sin(a)*Math.cos(o)*Math.sin(s)-Math.cos(a)*Math.sin(o)*Math.sin(i)),t=Math.atan(-1*Math.cos(r-i)/Math.tan(a))}return{lamp:r,phip:t}}function $5e(n,e){let{x:t,y:r}=e;t=ot(t-n.long0,n.over);const i=Math.cos(t),a=Math.sin(r),s=Math.cos(r);e.x=ot(Math.atan2(s*Math.sin(t),n.sphip*s*i+n.cphip*a)+n.lamp),e.y=Math.asin(n.sphip*a-n.cphip*s*i);const o=n.obliqueProjection.forward(e);return n.isIdentity&&(o.x*=xa,o.y*=xa),o}function j5e(n,e){let{x:t,y:r}=e;t=ot(t-n.long0,n.over);const i=Math.cos(r),a=Math.cos(t);e.x=ot(Math.atan2(i*Math.sin(t),Math.sin(r))+n.lamp),e.y=Math.asin(-1*i*a);const s=n.obliqueProjection.forward(e);return n.isIdentity&&(s.x*=xa,s.y*=xa),s}function q5e(n,e){n.isIdentity&&(e.x*=wr,e.y*=wr);const t=n.obliqueProjection.inverse(e);let{x:r,y:i}=t;if(r<Number.MAX_VALUE){r-=n.lamp;const a=Math.cos(r),s=Math.sin(i),o=Math.cos(i);e.x=Math.atan2(o*Math.sin(r),n.sphip*o*a-n.cphip*s),e.y=Math.asin(n.sphip*s+n.cphip*o*a)}return e.x=ot(e.x+n.long0),e}function X5e(n,e){n.isIdentity&&(e.x*=wr,e.y*=wr);const t=n.obliqueProjection.inverse(e);let{x:r,y:i}=t;if(r<Number.MAX_VALUE){const a=Math.cos(i);r-=n.lamp,e.x=Math.atan2(a*Math.sin(r),-1*Math.sin(i)),e.y=Math.asin(a*Math.cos(r))}return e.x=ot(e.x+n.long0),e}var Y5e=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const K5e={init:U5e,forward:V5e,inverse:H5e,names:Y5e};function Z5e(n){n.Proj.projections.add(tx),n.Proj.projections.add(nx),n.Proj.projections.add(FNe),n.Proj.projections.add(qNe),n.Proj.projections.add(QNe),n.Proj.projections.add(r4e),n.Proj.projections.add(u4e),n.Proj.projections.add(p4e),n.Proj.projections.add(_4e),n.Proj.projections.add(A4e),n.Proj.projections.add(k4e),n.Proj.projections.add(U4e),n.Proj.projections.add(j4e),n.Proj.projections.add(Q4e),n.Proj.projections.add(rke),n.Proj.projections.add(lke),n.Proj.projections.add(dke),n.Proj.projections.add(yke),n.Proj.projections.add(Ske),n.Proj.projections.add(Cke),n.Proj.projections.add(Dke),n.Proj.projections.add(Fke),n.Proj.projections.add(Vke),n.Proj.projections.add(Yke),n.Proj.projections.add(e5e),n.Proj.projections.add(a5e),n.Proj.projections.add(d5e),n.Proj.projections.add(y5e),n.Proj.projections.add(w5e),n.Proj.projections.add(E5e),n.Proj.projections.add(I5e),n.Proj.projections.add(z5e),n.Proj.projections.add(K5e)}const ZS=Object.assign(eNe,{defaultDatum:"WGS84",Proj:ks,WGS84:new ks("WGS84"),Point:Vp,toPoint:l3,defs:bi,nadgrid:IIe,transform:JIe,mgrs:tNe,version:"__VERSION__"});Z5e(ZS);try{let n=()=>new DecompressionStream("deflate-raw"),e=t=>new Response(t);n(),Kq=t=>e(e(t).body.pipeThrough(n())).arrayBuffer().then(r=>new Uint8Array(r))}catch(n){}var Kq,hG=new TextDecoder,Q2=n=>{throw Error("but-unzip~"+n)};function*Q5e(n,e=Kq){let t=n.length-21,r=t-65536,i=new DataView(n.buffer,n.byteOffset),a=l=>i.getUint16(l+t,1),s=l=>i.getUint32(l+t,1),o=(l,u)=>n.subarray(t+=l,t+=u);for(;t>r&&(t=n.lastIndexOf(80,t-1))+1&&(n[t+1]-75||n[t+2]-5||n[t+3]-6););for(t<0&&Q2(2),r=a(10),r-a(8)&&Q2(3),t=s(16);r--;){let l=a(10),u=a(28),c=a(30),h=a(32),f=s(20),d=s(42),p=hG.decode(o(46,u)),g=hG.decode(o(c,h)),v=t,m;t=d,m=o(30+a(26)+a(28),f),yield{filename:p,comment:g,read:()=>l-8?l?Q2(1):m:e(m)},t=v}}const J5e=/.+\.(shp|dbf|json|prj|cpg)$/i,eOe=n=>$e(void 0,null,function*(){const e={},t=[];for(const a of Q5e(n))J5e.test(a.filename)&&t.push(Promise.resolve(a.read()).then(s=>e[a.filename]=s));yield Promise.all(t);const r={},i=new TextDecoder;for(const[a,s]of Object.entries(e))a.slice(-3).toLowerCase()==="shp"||a.slice(-3).toLowerCase()==="dbf"?r[a]=new DataView(s.buffer,s.byteOffset,s.byteLength):r[a]=i.decode(s);return r}),tOe=globalThis.URL,nOe=(n,e)=>{if(!e)return n;const t=new tOe(n);return t.pathname=`${t.pathname}.${e}`,t.href};function T0(n,e){return $e(this,null,function*(){const t=nOe(n,e),r=e==="prj"||e==="cpg";try{const i=yield fetch(t);if(i.status>399)throw new Error(i.statusText);if(r)return i.text();const a=yield i.arrayBuffer();return new DataView(a)}catch(i){if(r||e==="dbf")return!1;throw i}})}function rOe(n){let e=0,t=1;const r=n.length;let i,a;const s=[n[0][0],n[0][1],n[0][0],n[0][1]];for(;t<r;)i=a||n[0],a=n[t],e+=(a[0]-i[0])*(a[1]+i[1]),t++,a[0]<s[0]&&(s[0]=a[0]),a[1]<s[1]&&(s[1]=a[1]),a[0]>s[2]&&(s[2]=a[0]),a[1]>s[3]&&(s[3]=a[1]);return{ring:n,clockWise:e>0,bbox:s,children:[]}}function fG(n,e){return!(n.bbox[0]>e.bbox[0]||n.bbox[1]>e.bbox[1]||n.bbox[2]<e.bbox[2]||n.bbox[3]<e.bbox[3])}function Zq(n,e=!1){const t=[],r=[];for(const s of n){const o=rOe(s);o.clockWise!==e?t.push(o):r.push(o)}const i=[];for(const s of r){let o;for(const l of t)fG(l,s)&&(o?fG(o,l)&&(o=l):o=l);o?o.children.push(s.ring):i.push(s)}if(e)return{outers:t,orphens:i};if(i.length&&!e){const s=Zq(n,!0);if(s.orphens.length===0){const o=[];for(const l of s.outers)o.push([l.ring.toReversed()].concat(l.children.map(u=>u.toReversed())));return o}}const a=[];for(const s of t)a.push([s.ring].concat(s.children));return a}Gr.prototype.parsePoint=function(n){return{type:"Point",coordinates:this.parseCoord(n,0)}};Gr.prototype.parseZPoint=function(n){const e=this.parsePoint(n);return e.coordinates.push(n.getFloat64(16,!0)),e};Gr.prototype.parsePointArray=function(n,e,t){const r=[];let i=0;for(;i<t;)r.push(this.parseCoord(n,e)),e+=16,i++;return r};Gr.prototype.parseZPointArray=function(n,e,t,r){let i=0;for(;i<t;)r[i].push(n.getFloat64(e,!0)),i++,e+=8;return r};Gr.prototype.parseArrayGroup=function(n,e,t,r,i){const a=[];let s=0,o,l=0,u;for(;s<r;)s++,t+=4,o=l,s===r?l=i:l=n.getInt32(t,!0),u=l-o,u&&(a.push(this.parsePointArray(n,e,u)),e+=u<<4);return a};Gr.prototype.parseZArrayGroup=function(n,e,t,r){let i=0;for(;i<t;)r[i]=this.parseZPointArray(n,e,r[i].length,r[i]),e+=r[i].length<<3,i++;return r};Gr.prototype.parseMultiPoint=function(n){const e={},t=n.getInt32(32,!0);if(!t)return null;const r=this.parseCoord(n,0),i=this.parseCoord(n,16);e.bbox=[r[0],r[1],i[0],i[1]];const a=36;return t===1?(e.type="Point",e.coordinates=this.parseCoord(n,a)):(e.type="MultiPoint",e.coordinates=this.parsePointArray(n,a,t)),e};Gr.prototype.parseZMultiPoint=function(n){const e=this.parseMultiPoint(n);if(!e)return null;let t;if(e.type==="Point")return e.coordinates.push(n.getFloat64(72,!0)),e;t=e.coordinates.length;const r=52+(t<<4);return e.coordinates=this.parseZPointArray(n,r,t,e.coordinates),e};Gr.prototype.parsePolyline=function(n){const e={},t=n.getInt32(32,!0);if(!t)return null;const r=this.parseCoord(n,0),i=this.parseCoord(n,16);e.bbox=[r[0],r[1],i[0],i[1]];const a=n.getInt32(36,!0);let s,o;return t===1?(e.type="LineString",s=44,e.coordinates=this.parsePointArray(n,s,a)):(e.type="MultiLineString",s=40+(t<<2),o=40,e.coordinates=this.parseArrayGroup(n,s,o,t,a)),e};Gr.prototype.parseZPolyline=function(n){const e=this.parsePolyline(n);if(!e)return null;const t=e.coordinates.length;let r;return e.type==="LineString"?(r=60+(t<<4),e.coordinates=this.parseZPointArray(n,r,t,e.coordinates),e):(r=56+(e.coordinates.reduce(function(a,s){return a+s.length},0)<<4)+(t<<2),e.coordinates=this.parseZArrayGroup(n,r,t,e.coordinates),e)};Gr.prototype.polyFuncs=function(n){return n&&(n.type==="LineString"?(n.type="Polygon",n.coordinates=[n.coordinates],n):(n.coordinates=Zq(n.coordinates),n.coordinates.length===1?(n.type="Polygon",n.coordinates=n.coordinates[0],n):(n.type="MultiPolygon",n)))};Gr.prototype.parsePolygon=function(n){return this.polyFuncs(this.parsePolyline(n))};Gr.prototype.parseZPolygon=function(n){return this.polyFuncs(this.parseZPolyline(n))};const dG={1:"parsePoint",3:"parsePolyline",5:"parsePolygon",8:"parseMultiPoint",11:"parseZPoint",13:"parseZPolyline",15:"parseZPolygon",18:"parseZMultiPoint"};function iOe(n){return n?function(e,t){const r=[e.getFloat64(t,!0),e.getFloat64(t+8,!0)];return n.inverse(r)}:function(e,t){return[e.getFloat64(t,!0),e.getFloat64(t+8,!0)]}}function Gr(n,e){if(!(this instanceof Gr))return new Gr(n,e);this.buffer=n,this.headers=this.parseHeader(),this.shpFuncs(e),this.rows=this.getRows()}Gr.prototype.shpFuncs=function(n){let e=this.headers.shpCode;if(e>20&&(e-=20),!(e in dG))throw new Error(`I don't know shp type "${e}"`);this.parseFunc=this[dG[e]],this.parseCoord=iOe(n)};Gr.prototype.getShpCode=function(){return this.parseHeader().shpCode};Gr.prototype.parseHeader=function(){const n=this.buffer;return{length:n.getInt32(24)<<1,version:n.getInt32(28,!0),shpCode:n.getInt32(32,!0),bbox:[n.getFloat64(36,!0),n.getFloat64(44,!0),n.getFloat64(52,!0),n.getFloat64(60,!0)]}};Gr.prototype.getRows=function(){let n=100;const e=this.buffer.byteLength-8,t=[];let r;for(;n<=e&&(r=this.getRow(n),!!r);)n+=8,n+=r.len,r.type?t.push(this.parseFunc(r.data)):t.push(null);return t};Gr.prototype.getRow=function(n){const e=this.buffer.getInt32(n),t=this.buffer.getInt32(n+4)<<1;if(t===0)return{id:e,len:t,type:0};if(!(n+t+8>this.buffer.byteLength))return{id:e,len:t,data:new DataView(this.buffer.buffer,this.buffer.byteOffset+n+12,t-4),type:this.buffer.getInt32(n+8,!0)}};function m3(n,e){return new Gr(n,e).rows}var aOe=/^(?:ANSI\s)?(\d+)$/m;function Qq(n,e){if(!n)return r;try{new TextDecoder(n.trim())}catch(i){var t=aOe.exec(n);return t&&!e?Qq("windows-"+t[1],!0):(n=void 0,r)}return r;function r(i){var a=new TextDecoder(n||void 0),s=a.decode(i,{stream:!0})+a.decode();return s.replace(/\0/g,"").trim()}}function sOe(n){var e={};return e.lastUpdated=new Date(n.getUint8(1)+1900,n.getUint8(2),n.getUint8(3)),e.records=n.getUint32(4,!0),e.headerLen=n.getUint16(8,!0),e.recLen=n.getUint16(10,!0),e}function oOe(n,e,t){for(var r=[],i=32;i<e&&(r.push({name:t(new Uint8Array(n.buffer.slice(n.byteOffset+i,n.byteOffset+i+11))),dataType:String.fromCharCode(n.getUint8(i+11)),len:n.getUint8(i+16),decimal:n.getUint8(i+17)}),n.getUint8(i+32)!==13);)i+=32;return r}function lOe(n,e,t,r,i){const a=new Uint8Array(n.buffer.slice(n.byteOffset+e,n.byteOffset+e+t));var s=i(a);switch(r){case"N":case"F":case"O":return parseFloat(s,10);case"D":return new Date(s.slice(0,4),parseInt(s.slice(4,6),10)-1,s.slice(6,8));case"L":return s.toLowerCase()==="y"||s.toLowerCase()==="t";default:return s}}function uOe(n,e,t,r){for(var i={},a=0,s=t.length,o,l;a<s;)l=t[a],o=lOe(n,e,l.len,l.dataType,r),e+=l.len,typeof o!="undefined"&&(i[l.name]=o),a++;return i}function y3(n,e){for(var t=Qq(e),r=sOe(n),i=oOe(n,r.headerLen-1,t),a=(i.length+1<<5)+2,s=r.recLen,o=r.records,l=[];o;)l.push(uOe(n,a,i,t)),a+=s,o--;return l}const cOe=globalThis.URL,hOe=n=>{if(!n)throw new Error("forgot to pass buffer");if(Hp(n))return new Uint8Array(n);if(Hp(n.buffer))return n.BYTES_PER_ELEMENT===1?n:new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("invalid buffer like object")},fOe=new TextDecoder,Jq=n=>{if(n){if(typeof n=="string")return n;if(Hp(n)||ArrayBuffer.isView(n)||_3(n))return fOe.decode(n)}},eX=n=>{if(!n)throw new Error("forgot to pass buffer");if(_3(n))return n;if(Hp(n))return new DataView(n);if(Hp(n.buffer))return new DataView(n.buffer,n.byteOffset,n.byteLength);throw new Error("invalid buffer like object")};function Hp(n){return n instanceof globalThis.ArrayBuffer||Object.prototype.toString.call(n)==="[object ArrayBuffer]"}function _3(n){return n instanceof globalThis.DataView||Object.prototype.toString.call(n)==="[object DataView]"}const x3=function([n,e]){const t={};t.type="FeatureCollection",t.features=[];let r=0;const i=n.length;for(e||(e=[]);r<i;)t.features.push({type:"Feature",geometry:n[r],properties:e[r]||{}}),r++;return t},tX=function(n,e){return $e(this,null,function*(){let t;n=hOe(n);const r=yield eOe(n),i=[];e=e||[];for(t in r)t.indexOf("__MACOSX")===-1&&(t.slice(-4).toLowerCase()===".shp"?(i.push(t.slice(0,-4)),r[t.slice(0,-3)+t.slice(-3).toLowerCase()]=r[t]):t.slice(-4).toLowerCase()===".prj"?r[t.slice(0,-3)+t.slice(-3).toLowerCase()]=ZS(r[t]):t.slice(-5).toLowerCase()===".json"||e.indexOf(t.split(".").pop())>-1?i.push(t.slice(0,-3)+t.slice(-3).toLowerCase()):(t.slice(-4).toLowerCase()===".dbf"||t.slice(-4).toLowerCase()===".cpg")&&(r[t.slice(0,-3)+t.slice(-3).toLowerCase()]=r[t]));if(!i.length)throw new Error("no layers founds");const a=i.map(function(s){let o,l;const u=s.lastIndexOf(".");return u>-1&&s.slice(u).indexOf("json")>-1?(o=JSON.parse(r[s]),o.fileName=s.slice(0,u)):e.indexOf(s.slice(u+1))>-1?(o=r[s],o.fileName=s):(r[s+".dbf"]&&(l=y3(r[s+".dbf"],r[s+".cpg"])),o=x3([m3(r[s+".shp"],r[s+".prj"]),l]),o.fileName=s),o});return a.length===1?a[0]:a})};function dOe(n,e){return $e(this,null,function*(){const t=yield T0(n);return tX(t,e)})}const pOe=n=>$e(void 0,null,function*(){const e=yield Promise.all([T0(n,"shp"),T0(n,"prj")]);let t=!1;try{e[1]&&(t=ZS(e[1]))}catch(r){t=!1}return m3(e[0],t)}),vOe=n=>$e(void 0,null,function*(){const[e,t]=yield Promise.all([T0(n,"dbf"),T0(n,"cpg")]);if(e)return y3(e,t)}),pG=(n,e)=>{var r;return new cOe(n,(r=globalThis==null?void 0:globalThis.document)==null?void 0:r.location).pathname.slice(-4).toLowerCase()===e},gOe=({shp:n,dbf:e,cpg:t,prj:r})=>{const i=[yOe(n,r)];return e&&i.push(_Oe(e,t)),x3(i)},mOe=function(n,e){return $e(this,null,function*(){if(typeof n!="string"){if(Hp(n)||ArrayBuffer.isView(n)||_3(n))return tX(n);if(n.shp)return gOe(n);throw new TypeError("must be a string, some sort of Buffer, or an object with at least a .shp property")}if(pG(n,".zip"))return dOe(n,e);pG(n,".shp")&&(n=n.slice(0,-4));const t=yield Promise.all([pOe(n),vOe(n)]);return x3(t)})},yOe=function(n,e){if(n=eX(n),e=Jq(e),typeof e=="string")try{e=ZS(e)}catch(t){e=!1}return m3(n,e)},_Oe=function(n,e){return n=eX(n),e=Jq(e),y3(n,e)};const xOe={class:"engineering-analysis-panel"},bOe={class:"analysis-card analysis-workbench"},SOe={class:"analysis-card-head"},wOe={key:0},AOe=["disabled"],MOe=["disabled"],TOe={key:1,class:"analysis-drawing-stage"},COe={class:"analysis-point-count"},EOe=["disabled"],POe=["disabled"],LOe={key:2,class:"analysis-boundary-bar"},ROe={class:"analysis-card analysis-result"},DOe={class:"analysis-card-head"},IOe={key:0},NOe={key:0,class:"analysis-empty"},kOe={class:"analysis-conclusion-head"},OOe={class:"analysis-conclusion-tags"},FOe={key:0,class:"analysis-empty is-success"},BOe={key:1,class:"analysis-project-list"},GOe=["onPointerup"],zOe={class:"analysis-project-name"},UOe={class:"analysis-project-meta"},VOe={__name:"EngineeringAnalysisPanel",props:{drawingPointCount:{type:Number,default:0}},emits:["drawing-change","finish-drawing","undo-point","clear-boundary","analysis-result","focus-project"],setup(n,{expose:e,emit:t}){const r=n,i=t,a=Be(!1),s=Be(null),o=Be([]),l=Be([]),u=Be(""),c=Be("idle"),h=Be([]);let f=null;const d=he(()=>{var be;const q=l.value.length,le=o.value.length,ue=o.value.reduce((He,nt)=>He+Number(nt.overlapAreaWanMu||0),0);return{boundaryAreaWanMu:we((be=s.value)==null?void 0:be.geometry),featureCount:q,projectCount:le,overlapAreaWanMu:ue}}),p=he(()=>u.value?u.value:c.value==="loading"?"项目库加载中":c.value==="error"?"项目库加载失败":""),g=he(()=>s.value?o.value.length?"已发现建设记录":"未发现建设记录":"未分析"),v=he(()=>a.value&&r.drawingPointCount>=3),m=he(()=>{if(!s.value)return{levelClass:"",verdict:"",summary:"",tags:[],advice:""};if(!o.value.length)return{levelClass:"is-clear",verdict:"未发现建设记录",summary:"该边界范围暂未与项目库中的已建设工程形成空间叠加。",tags:[`分析范围 ${I(d.value.boundaryAreaWanMu)} 万亩`,"项目库未命中"],advice:"可进入新增工程选址论证,仍需结合保护红线、审批台账和现场踏勘复核。"};const q=K(o.value),le=ge(o.value),ue=[...o.value].sort((nt,ke)=>Number(ke.overlapAreaWanMu||0)-Number(nt.overlapAreaWanMu||0))[0],be=G(d.value.overlapAreaWanMu),He=o.value.length>=6||d.value.overlapAreaWanMu>=1?"存在建设叠加":"存在局部叠加";return{levelClass:o.value.length>=6?"is-heavy":"is-hit",verdict:He,summary:`该边界命中 ${o.value.length} 个历史项目,叠加约 ${be} 亩,项目类型以${q.name}为主,年份集中在 ${le}。`,tags:[`主类型 ${q.name}`,`年份 ${le}`,`最大叠加 ${G(ue==null?void 0:ue.overlapAreaWanMu)} 亩`],advice:`重点复核“${Ee(ue==null?void 0:ue.projectName)}”(${(ue==null?void 0:ue.year)||"未知"},${(ue==null?void 0:ue.category)||"未知类型"})与拟建范围的重合边界。`}});Ia(()=>{P().catch(()=>{})});function y(q){return $e(this,null,function*(){var ue;const le=(ue=q.target.files)==null?void 0:ue[0];if(q.target.value="",!!le){u.value="";try{const be=yield _(le);a.value&&(a.value=!1,i("drawing-change",!1)),i("clear-boundary"),yield M(be)}catch(be){u.value="边界文件解析失败"}}})}function _(q){return $e(this,null,function*(){const le=String(q.name||"").toLowerCase();if(le.endsWith(".json")||le.endsWith(".geojson"))return x(JSON.parse(yield q.text()));if(le.endsWith(".zip")){const ue=yield mOe(yield q.arrayBuffer());return x(ue)}throw new Error("unsupported file")})}function x(q){const le=L(q).filter(ue=>X(ue==null?void 0:ue.geometry));if(le.length)return R(le);throw new Error("no polygon")}function b(){a.value||(u.value="",a.value=!0,s.value=null,o.value=[],l.value=[],i("analysis-result",{boundary:null,matches:[],rows:[],summary:d.value}),i("drawing-change",!0))}function S(){a.value&&(a.value=!1,i("clear-boundary"),i("analysis-result",{boundary:null,matches:[],rows:[],summary:d.value}))}function w(){v.value&&i("finish-drawing")}function T(){i("undo-point")}function C(){a.value=!1,s.value=null,o.value=[],l.value=[],u.value="",i("clear-boundary"),i("analysis-result",{boundary:null,matches:[],rows:[],summary:d.value})}function A(q){q!=null&&q.geometry&&(a.value=!1,M(q))}function M(q){return $e(this,null,function*(){s.value=q,l.value=[],o.value=[];let le=[];try{const ue=yield P();le=N(q,ue),l.value=le,o.value=F(le)}catch(ue){u.value="项目库加载失败"}i("analysis-result",{boundary:q,matches:le,rows:o.value,summary:d.value})})}function P(){return $e(this,null,function*(){return h.value.length?h.value:f||(c.value="loading",f=fetch(D("datas/ecological-protection/ecological_restoration_projects.geojson"),{credentials:"include"}).then(le=>{if(!le.ok)throw new Error(`HTTP ${le.status}`);return le.json()}).then(le=>{const ue=L(le).filter(be=>{var He;return(He=be==null?void 0:be.geometry)==null?void 0:He.coordinates}).map((be,He)=>Ve(Le({},be),{properties:Ve(Le({},be.properties||{}),{source_index:He})}));return h.value=ue,c.value="success",ue}).catch(le=>{throw c.value="error",f=null,le}),f)})}function D(q){return q?/^https?:\/\//.test(q)||q.startsWith("/")?q:`./${q}`:""}function L(q){return q?Array.isArray(q)?q.flatMap(le=>L(le)):q.type==="FeatureCollection"?(q.features||[]).filter(Boolean):q.type==="Feature"?q.geometry?[q]:[]:re(q)?[{type:"Feature",properties:{},geometry:q}]:typeof q=="object"?Object.values(q).flatMap(le=>L(le)):[]:[]}function R(q){const le=q.flatMap(ue=>ue.geometry.type==="Polygon"?[ue.geometry.coordinates]:ue.geometry.coordinates);return le.length===1?{type:"Feature",properties:q[0].properties||{},geometry:{type:"Polygon",coordinates:le[0]}}:{type:"Feature",properties:{sourceFeatureCount:q.length},geometry:{type:"MultiPolygon",coordinates:le}}}function N(q,le=h.value){const ue=j(q.geometry);return le.filter(be=>O(be.geometry,q.geometry,ue)).map(be=>({feature:be,properties:be.properties||{},overlapAreaWanMu:Y(be,q.geometry)}))}function F(q){const le=new Map;return q.forEach(ue=>{const be=ue.properties||{},He=be.project_name||be.projectName||"未命名项目",nt=le.get(He)||{key:He,projectName:He,category:be.project_category||"未知类型",year:be.year||"未知",featureCount:0,overlapAreaWanMu:0,features:[],sourceIndex:Number(be.source_index||0)};nt.featureCount+=1,nt.overlapAreaWanMu+=Number(ue.overlapAreaWanMu||0),nt.features.push(ue.feature),le.set(He,nt)}),[...le.values()].map(ue=>Ve(Le({},ue),{overlapAreaWanMu:Number(ue.overlapAreaWanMu.toFixed(4))}))}function O(q,le,ue){if(!xe(j(q),ue))return!1;const be=oe(le);return be.length?X(q)?H(q,be):(q==null?void 0:q.type)==="Point"?_e(q.coordinates,be):(q==null?void 0:q.type)==="MultiPoint"?q.coordinates.some(He=>_e(He,be)):(q==null?void 0:q.type)==="LineString"?U(q.coordinates,be):(q==null?void 0:q.type)==="MultiLineString"?q.coordinates.some(He=>U(He,be)):!1:!1}function H(q,le){const ue=oe(q);return ue.length?ue.some(be=>be.some(He=>_e(He,le)))||le.some(be=>be.some(He=>_e(He,ue)))||ue.some(be=>le.some(He=>Ce(be,He))):!1}function U(q=[],le){return!Array.isArray(q)||!q.length?!1:q.some(ue=>_e(ue,le))?!0:le.some(ue=>$(q,ue))}function $(q,le){for(let ue=1;ue<q.length;ue+=1)for(let be=1;be<le.length;be+=1)if(Ae(q[ue-1],q[ue],le[be-1],le[be]))return!0;return!1}function Y(q,le){const ue=q==null?void 0:q.geometry,be=oe(ue),He=oe(le),nt=pe(q),ke=we(le);if(!be.length||!He.length)return 0;const Tt=be.reduce((lt,Ze)=>lt+Ze.filter(At=>_e(At,He)).length,0),wt=be.reduce((lt,Ze)=>lt+Ze.length,0);return Tt?Number((nt*Math.max(.08,Math.min(1,Tt/Math.max(wt,1)))).toFixed(4)):He.reduce((lt,Ze)=>lt+Ze.filter(At=>_e(At,be)).length,0)?Number(Math.min(nt,ke).toFixed(4)):be.some(lt=>He.some(Ze=>Ce(lt,Ze)))?Number((Math.min(nt,ke)*.12).toFixed(4)):0}function oe(q){var le;return(q==null?void 0:q.type)==="Polygon"?[((le=q.coordinates)==null?void 0:le[0])||[]]:(q==null?void 0:q.type)==="MultiPolygon"?q.coordinates.map(ue=>(ue==null?void 0:ue[0])||[]).filter(ue=>ue.length):[]}function X(q){return(q==null?void 0:q.type)==="Polygon"||(q==null?void 0:q.type)==="MultiPolygon"}function re(q){return["Polygon","MultiPolygon","LineString","MultiLineString","Point","MultiPoint"].includes(q==null?void 0:q.type)}function _e(q,le){return le.some(ue=>Fe(q,ue))}function Fe(q,le){var nt,ke,Tt,wt;let ue=!1;const be=Number(q==null?void 0:q[0]),He=Number(q==null?void 0:q[1]);for(let pt=0,lt=le.length-1;pt<le.length;lt=pt++){const Ze=Number((nt=le[pt])==null?void 0:nt[0]),At=Number((ke=le[pt])==null?void 0:ke[1]),ce=Number((Tt=le[lt])==null?void 0:Tt[0]),We=Number((wt=le[lt])==null?void 0:wt[1]);At>He!=We>He&&be<(ce-Ze)*(He-At)/(We-At)+Ze&&(ue=!ue)}return ue}function Ce(q,le){for(let ue=1;ue<q.length;ue+=1)for(let be=1;be<le.length;be+=1)if(Ae(q[ue-1],q[ue],le[be-1],le[be]))return!0;return!1}function Ae(q,le,ue,be){if(!ze(q,le,ue,be))return!1;const He=(pt,lt,Ze)=>(Number(lt[0])-Number(pt[0]))*(Number(Ze[1])-Number(pt[1]))-(Number(lt[1])-Number(pt[1]))*(Number(Ze[0])-Number(pt[0])),nt=He(q,le,ue),ke=He(q,le,be),Tt=He(ue,be,q),wt=He(ue,be,le);return nt===0&&fe(ue,q,le)||ke===0&&fe(be,q,le)||Tt===0&&fe(q,ue,be)||wt===0&&fe(le,ue,be)?!0:(nt>0&&ke<0||nt<0&&ke>0)&&(Tt>0&&wt<0||Tt<0&&wt>0)}function ze(q,le,ue,be){const He=ae([q,le]),nt=ae([ue,be]);return xe(He,nt)}function fe(q,le,ue){const be=Number(q==null?void 0:q[0]),He=Number(q==null?void 0:q[1]),nt=Number(le==null?void 0:le[0]),ke=Number(le==null?void 0:le[1]),Tt=Number(ue==null?void 0:ue[0]),wt=Number(ue==null?void 0:ue[1]),pt=(be-nt)*(wt-ke)-(He-ke)*(Tt-nt);return Math.abs(pt)>1e-10?!1:be>=Math.min(nt,Tt)-1e-10&&be<=Math.max(nt,Tt)+1e-10&&He>=Math.min(ke,wt)-1e-10&&He<=Math.max(ke,wt)+1e-10}function j(q){const le=[];return ee(q==null?void 0:q.coordinates,le),le.length?le.reduce((ue,be)=>({minLng:Math.min(ue.minLng,Number(be[0])),minLat:Math.min(ue.minLat,Number(be[1])),maxLng:Math.max(ue.maxLng,Number(be[0])),maxLat:Math.max(ue.maxLat,Number(be[1]))}),{minLng:Number.POSITIVE_INFINITY,minLat:Number.POSITIVE_INFINITY,maxLng:Number.NEGATIVE_INFINITY,maxLat:Number.NEGATIVE_INFINITY}):null}function xe(q,le){return!q||!le?!1:!(q.maxLng<le.minLng||q.minLng>le.maxLng||q.maxLat<le.minLat||q.minLat>le.maxLat)}function pe(q){return we(q==null?void 0:q.geometry)}function we(q){return(q==null?void 0:q.type)==="Polygon"?V(q.coordinates):(q==null?void 0:q.type)==="MultiPolygon"?q.coordinates.reduce((le,ue)=>le+V(ue),0):0}function V(q=[]){const le=q[0]||[];if(le.length<3)return 0;const ue=le.reduce((ke,Tt)=>ke+Number(Tt[1]||0),0)/le.length,be=111320*Math.cos(ue*Math.PI/180),He=110540;let nt=0;for(let ke=0;ke<le.length;ke+=1){const Tt=le[ke],wt=le[(ke+1)%le.length],pt=Number(Tt[0]||0)*be,lt=Number(Tt[1]||0)*He,Ze=Number(wt[0]||0)*be,At=Number(wt[1]||0)*He;nt+=pt*At-Ze*lt}return Math.abs(nt)/2/666.6666667/1e4}function ee(q,le){if(Array.isArray(q)){if(typeof q[0]=="number"&&typeof q[1]=="number"){le.push(q);return}q.forEach(ue=>ee(ue,le))}}function ae(q){return q.reduce((le,ue)=>({minLng:Math.min(le.minLng,Number(ue==null?void 0:ue[0])),minLat:Math.min(le.minLat,Number(ue==null?void 0:ue[1])),maxLng:Math.max(le.maxLng,Number(ue==null?void 0:ue[0])),maxLat:Math.max(le.maxLat,Number(ue==null?void 0:ue[1]))}),{minLng:Number.POSITIVE_INFINITY,minLat:Number.POSITIVE_INFINITY,maxLng:Number.NEGATIVE_INFINITY,maxLat:Number.NEGATIVE_INFINITY})}function I(q){const le=Number(q||0);return Number.isFinite(le)?Number(le.toFixed(le>=10?2:4)).toString():"0"}function G(q){const le=Number(q||0)*1e4;return Number.isFinite(le)?le>=1e3?Number(le.toFixed(0)).toLocaleString("zh-CN"):le>=10?Number(le.toFixed(1)).toLocaleString("zh-CN"):Number(le.toFixed(2)).toString():"0"}function K(q=[]){const le=new Map;return q.forEach(ue=>{const be=ue.category||"未知类型",He=le.get(be)||{name:be,count:0,area:0};He.count+=1,He.area+=Number(ue.overlapAreaWanMu||0),le.set(be,He)}),[...le.values()].sort((ue,be)=>be.area-ue.area||be.count-ue.count)[0]||{name:"未知类型",count:0,area:0}}function ge(q=[]){const le=q.map(He=>Number(He.year)).filter(He=>Number.isFinite(He));if(!le.length)return"未知年份";const ue=Math.min(...le),be=Math.max(...le);return ue===be?`${ue} 年`:`${ue}-${be} 年`}function Ee(q,le=18){const ue=String(q||"未命名项目");return ue.length>le?`${ue.slice(0,le)}...`:ue}return e({applyDrawnBoundary:A}),(q,le)=>(Z(),ne("div",xOe,[E("div",bOe,[E("div",SOe,[le[0]||(le[0]=E("span",null,"工程分析",-1)),p.value?(Z(),ne("strong",wOe,ie(p.value),1)):mt("",!0)]),a.value?mt("",!0):(Z(),ne("div",{key:0,class:Ct(["analysis-operation",{"has-boundary":s.value}])},[E("label",{class:Ct(["analysis-entry is-upload",{"is-disabled":a.value}])},[E("input",{type:"file",accept:".zip,.json,.geojson",disabled:a.value,onChange:y},null,40,AOe),E("span",null,ie(s.value?"更换边界":"上传边界"),1),le[1]||(le[1]=E("strong",null,"SHP / GeoJSON",-1))],2),E("button",{type:"button",class:"analysis-entry is-draw",disabled:a.value,onPointerup:da(b,["stop","prevent"])},[E("span",null,ie(s.value?"重新绘制":"在线绘制"),1),le[2]||(le[2]=E("strong",null,"地图圈定",-1))],40,MOe)],2)),a.value?(Z(),ne("div",TOe,[E("div",COe,[le[3]||(le[3]=E("span",null,"已落点",-1)),E("strong",null,ie(n.drawingPointCount),1),le[4]||(le[4]=E("em",null,"点",-1)),le[5]||(le[5]=E("small",null,"至少 3 点",-1))]),E("button",{type:"button",class:"analysis-control is-primary",disabled:!v.value,onPointerup:da(w,["stop","prevent"])}," 完成分析 ",40,EOe),E("button",{type:"button",class:"analysis-control",disabled:!n.drawingPointCount,onPointerup:da(T,["stop","prevent"])},"撤销",40,POe),E("button",{type:"button",class:"analysis-control is-danger",onPointerup:da(S,["stop","prevent"])},"删除图形",32)])):s.value?(Z(),ne("div",LOe,[le[6]||(le[6]=E("span",null,"边界已加载",-1)),E("strong",null,ie(o.value.length?`命中 ${o.value.length} 项`:g.value),1),E("button",{type:"button",onPointerup:da(C,["stop","prevent"])},"删除图形",32)])):mt("",!0)]),E("div",ROe,[E("div",DOe,[le[7]||(le[7]=E("span",null,"建设记录核查",-1)),s.value?(Z(),ne("strong",IOe,ie(g.value),1)):mt("",!0)]),s.value?(Z(),ne(et,{key:1},[E("div",{class:Ct(["analysis-conclusion",m.value.levelClass])},[E("div",kOe,[le[8]||(le[8]=E("span",null,"分析结论",-1)),E("strong",null,ie(m.value.verdict),1)]),E("p",null,ie(m.value.summary),1),E("div",OOe,[(Z(!0),ne(et,null,ut(m.value.tags,ue=>(Z(),ne("span",{key:ue},ie(ue),1))),128))]),E("small",null,ie(m.value.advice),1)],2),o.value.length?(Z(),ne("div",BOe,[(Z(!0),ne(et,null,ut(o.value,ue=>(Z(),ne("button",{key:ue.key,type:"button",class:"analysis-project-row",onPointerup:da(be=>q.$emit("focus-project",ue),["stop","prevent"])},[E("span",zOe,ie(ue.projectName),1),E("div",UOe,[E("strong",null,ie(ue.year),1),E("em",null,ie(ue.category),1),E("small",null,"叠加 "+ie(G(ue.overlapAreaWanMu))+" 亩",1)]),E("b",null,ie(ue.featureCount)+" 个要素",1)],40,GOe))),128))])):(Z(),ne("div",FOe,"该边界范围内暂未匹配到已建设项目"))],64)):(Z(),ne("div",NOe))])]))}},HOe=zb(VOe,[["__scopeId","data-v-04b20a7e"]]),Xu=(n,e)=>n.reduce((t,r)=>t+Number(r[e]||0),0),qr=(n,e=2)=>Number(Number(n||0).toFixed(e)),to={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}]},vG=[{key:"national-park",label:"若尔盖国家公园",bottomLabel:"若尔盖国家公园"},{key:"restoration",label:"生态修复工程",bottomLabel:"生态修复工程"},{key:"engineering-analysis",label:"工程分析",bottomLabel:"工程分析"}],Va=[{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:"色永村"}],ba={name:"若尔盖国家公园红原区域",totalAreaWanMu:161.31,grasslandAreaWanMu:94.25,wetlandAreaWanMu:33.47,woodlandAreaWanMu:null,woodlandDataStatus:"待接入",vegetationCoverage:qr(Xu(Va,"cover")/Va.length,1),townCount:Va.length,villageCount:Va.reduce((n,e)=>n+String(e.villages||"").split("、").filter(Boolean).length,0),householdCount:3023,ecologyJobCount:Xu(Va,"ecologyJobs"),yakCount:Xu(Va,"yakCount"),livestockCount:Xu(Va,"livestockCount")};ba.otherProtectedAreaWanMu=qr(ba.totalAreaWanMu-ba.grasslandAreaWanMu-ba.wetlandAreaWanMu,2);Va.map(n=>({key:n.name,name:n.name,value:qr(n.grasslandAreaWanMu+n.wetlandAreaWanMu,2),unit:"万亩",extra:`草地 ${n.grasslandAreaWanMu} / 湿地 ${n.wetlandAreaWanMu}`}));Va.map(n=>({key:`${n.name}-town`,name:n.name,value:qr(n.grasslandAreaWanMu+n.wetlandAreaWanMu,2),unit:"万亩",extra:n.villages}));const WOe=[{key:"core-protection",name:"核心保护区",value:67.36,unit:"万亩"},{key:"general-control",name:"一般控制区",value:93.95,unit:"万亩"}],$Oe=43.66,jOe=qr($Oe*(192.26/297.29),2),qOe={麦洼乡:[{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}]},XOe=Xu(Va,"livestockCount")||Xu(Va,"yakCount")||1,Bb=Va.map(n=>Ve(Le({},n),{householdCount:Math.round(ba.householdCount*Number(n.livestockCount||n.yakCount||0)/XOe),edibleGrasslandWanTon:qr(Number(n.grasslandAreaWanMu||0)/Math.max(ba.grasslandAreaWanMu,1)*jOe,2)})),gG=ba.householdCount-Xu(Bb,"householdCount");gG&&Bb[0]&&(Bb[0].householdCount+=gG);const b3=(n,e=Xu(n,"value"))=>n.map(t=>Ve(Le({},t),{extra:t.extra||`占比 ${qr(Number(t.value||0)/Math.max(e,1)*100,1)}%`})),YOe=b3([{key:"park-scope-grassland",name:"草地",value:ba.grasslandAreaWanMu,unit:"万亩"},{key:"park-scope-wetland",name:"湿地",value:ba.wetlandAreaWanMu,unit:"万亩"},{key:"park-scope-other",name:"其他保护范围",value:ba.otherProtectedAreaWanMu,unit:"万亩"}]),mv=({sourceKey:n,weightKey:e,unit:t="万亩",decimals:r=2,sortByValue:i=!0})=>{const a=Bb.flatMap(o=>(qOe[o.name]||[]).map(u=>({key:`${o.name}-${u.name}-${n}`,name:u.name,town:o.name,value:qr(Number(o[n]||0)*Number(u[e]||0),r),unit:t}))).filter(o=>Number(o.value)>0),s=i?a.sort((o,l)=>Number(l.value||0)-Number(o.value||0)):a;return b3(s)},KOe=mv({sourceKey:"wetlandAreaWanMu",weightKey:"wetland",sortByValue:!1}),ZOe=mv({sourceKey:"grasslandAreaWanMu",weightKey:"grassland"}),QOe=mv({sourceKey:"householdCount",weightKey:"household",unit:"户",decimals:0}),JOe=mv({sourceKey:"yakCount",weightKey:"yak",unit:"头",decimals:0}),eFe=mv({sourceKey:"edibleGrasslandWanTon",weightKey:"edible",unit:"万吨"}),tFe=mv({sourceKey:"wetlandAreaWanMu",weightKey:"woodland"}),nFe=[{zh:"国家公园面积",value:ba.totalAreaWanMu,unit:"万亩",decimals:2},{zh:"草地面积",value:ba.grasslandAreaWanMu,unit:"万亩",decimals:2},{zh:"湿地面积",value:ba.wetlandAreaWanMu,unit:"万亩",decimals:2},{zh:"牦牛数量",value:ba.yakCount,unit:"头",decimals:0}],rFe=[{zh:"修复项目",value:to.kpi.projectCount,unit:"个",decimals:0},{zh:"治理面积",value:to.kpi.areaWanMu,unit:"万亩",decimals:2},{zh:"工程长度",value:to.kpi.lengthKm,unit:"公里",decimals:2},{zh:"涉及乡镇",value:to.kpi.townshipCount,unit:"个",decimals:0}];function iFe(n){return n==="engineering-analysis"?[]:(n==="restoration"?rFe:nFe).map((t,r)=>Le({icon:r%2===0?"xiaoshoujine":"zongxiaoliang",en:""},t))}const aFe={left:[{key:"park-resource-scope",title:"显示范围资源占比",type:"donut",rows:YOe},{key:"park-wetland-village",title:"湿地分布村级对比",type:"line",rows:KOe.slice(0,8)},{key:"park-woodland-village",title:"林地分布村级排行",type:"heat",rows:tFe.slice(0,8)},{key:"park-grassland-village",title:"草地分布村级排行",type:"peak",rows:ZOe.slice(0,8)}],right:[{key:"park-household-village",title:"牧户分布村级排行",type:"column",variant:"pin",rows:QOe.slice(0,8)},{key:"park-yak-village",title:"牦牛分布村级排行",type:"column",variant:"pin",rows:JOe.slice(0,8)},{key:"park-edible-grass-village",title:"可食草地资源分布",type:"column",variant:"slim",rows:eFe.slice(0,8)},{key:"park-zoning-ledger",title:"核心区和一般区分区面积",type:"structure",rows:b3(WOe)}]},nX=(to.townships||[]).filter(n=>/[乡镇]$/.test(String(n.name||""))).slice(0,8),rX=(to.projects||[]).map((n,e)=>{const t=Number(n.areaWanMu)>0,r=Number(n.lengthKm)>0,i=t?{value:qr(n.areaWanMu,2),unit:"万亩",metric:"治理面积"}:r?{value:qr(n.lengthKm,2),unit:"公里",metric:"工程长度"}:{value:n.subjectFeatureCount||0,unit:"个",metric:"主体要素"},a=(n.measureTypes||[]).join("、"),s=(n.townships||[]).join("、");return{key:n.id||n.projectName,index:e+1,name:n.projectName,projectName:n.projectName,category:n.projectCategory,year:n.year||"未知",areaWanMu:qr(n.areaWanMu,4),lengthKm:qr(n.lengthKm,2),measure:a,townships:s,subjectFeatureCount:n.subjectFeatureCount||0,value:i.value,unit:i.unit,metric:i.metric,extra:[n.year||"未知",a].filter(Boolean).join(" / "),searchText:[n.projectName,n.projectCategory,n.year,a,s].filter(Boolean).join(" ")}});rX.map((n,e)=>{const t=e%6,r=Math.floor(e/6),i=102.42+t*.045,a=32.55+r*.035,s=.018+Math.min(.024,Number(n.areaWanMu||0)/1200);return{type:"Feature",properties:{project_name:n.projectName,project_category:n.category,year:n.year,areaWanMu:n.areaWanMu,lengthKm:n.lengthKm,townships:n.townships,measure:n.measure},geometry:{type:"Polygon",coordinates:[[[i,a],[i+s,a+s*.22],[i+s*.82,a+s],[i-s*.16,a+s*.72],[i,a]]]}}});const sFe={left:[{key:"restoration-year-area",title:"治理面积分布",type:"line",rows:(to.years||[]).map(n=>({key:n.name,name:`${n.name}`,value:qr(n.areaWanMu,2),unit:"万亩",extra:`${n.projectCount||0}个项目`}))},{key:"restoration-town-area",title:"乡镇治理面积分布",type:"line",rows:nX.map(n=>({key:n.name,name:n.name,value:qr(n.areaWanMu,2),unit:"万亩",extra:`${qr(n.lengthKm,2)}公里`}))},{key:"restoration-category",title:"修复类型占比",type:"donut",rows:(to.categories||[]).map(n=>({key:n.name,name:n.name,value:qr(n.areaWanMu||n.lengthKm||n.subjectFeatureCount,2),unit:n.areaWanMu?"万亩":n.lengthKm?"公里":"个",extra:`${n.subjectFeatureCount}个图斑`}))},{key:"restoration-year-length",title:"年度工程长度",type:"column",variant:"slim",rows:(to.years||[]).filter(n=>Number(n.lengthKm)>0).map(n=>({key:n.name,name:`${n.name}`,value:qr(n.lengthKm,2),unit:"公里",extra:`${n.projectCount||0}个项目`}))}],right:[{key:"restoration-measure-area",title:"修复措施统计",type:"structure",rows:(to.measures||[]).slice(0,8).map(n=>({key:n.name,name:n.name,value:qr(n.areaWanMu||n.lengthKm||n.subjectFeatureCount,2),unit:n.areaWanMu?"万亩":n.lengthKm?"公里":"个",extra:`${n.projectCount}个项目`}))},{key:"restoration-year-project",title:"年度项目数量",type:"column",variant:"slim",rows:(to.years||[]).map(n=>({key:n.name,name:`${n.name}`,value:n.projectCount,unit:"个",extra:`${qr(n.areaWanMu,2)}万亩`}))},{key:"restoration-projects",title:"重点项目库",type:"projectTable",span:2,rows:rX}]},oFe={left:[],right:[]};function lFe(n){return n==="restoration"?{status:"success",title:"乡镇治理排行",metricLabel:"治理面积",unit:"万亩",rows:nX.map(e=>({name:e.name,value:qr(e.areaWanMu,2),unit:"万亩"}))}:n==="engineering-analysis"?{status:"success",title:"工程分析",metricLabel:"",unit:"",rows:[]}:{status:"success",title:"国家公园牦牛分布",metricLabel:"牦牛数量",unit:"头",rows:Va.map(e=>({name:e.name,value:e.yakCount,unit:"头"}))}}const uFe={class:"forest-grass-wet ecological-protection"},cFe={class:"forest-grass-wet-ui ecological-protection-ui"},hFe={key:0,class:"fgw-left"},fFe={class:"fgw-side-stack is-left"},dFe={key:1,class:"fgw-right"},pFe={class:"fgw-side-stack is-right"},vFe={class:"fgw-bottom-topic ecological-bottom-topic"},gFe={key:0,class:"loading"},mFe={class:"loading-progress"},yFe={class:"value"},mG=190,_Fe=12,xFe={__name:"index",props:{activeView:{type:String,default:"national-park"},showLoading:{type:Boolean,default:!0}},emits:["module-stats","view-change"],setup(n,{emit:e}){const t=n,r=e,i=Be(null),a=Be(null),s=Be(""),o=Be(""),l=Be(null),u=Be(!1),c=Be(!1),h=Be(null),f=Be(0),d=Be(t.showLoading),p=Be(null),g=Be(0),v=Be({type:"idle",text:"等待生态保护图层加载"});let m=null,y=!1;const _=he(()=>["national-park","restoration","engineering-analysis"].includes(t.activeView)?t.activeView:"national-park"),x=he(()=>_.value==="engineering-analysis"),b=he(()=>fv(_.value,s.value)),S=he(()=>{var V;return(((V=b.value)==null?void 0:V.legends)||[]).find(ee=>ee.key===o.value)||null}),w=he(()=>{const V=b.value;return!V||!S.value?V:Ve(Le({},V),{cqlFilter:S.value.cqlFilter||V.cqlFilter,activeLegend:S.value,name:S.value.name||V.name})}),T=he(()=>_.value==="restoration"?sFe:_.value==="engineering-analysis"?oFe:aFe),C=he(()=>T.value.left||[]),A=he(()=>T.value.right||[]),M=mG*2+_Fe,P=he(()=>!!h.value),D=he(()=>{if(c.value||u.value||!l.value)return 186;const V=Y(l.value);return Math.min(480,Math.max(300,86+Math.min(V,12)*34))}),L=he(()=>{if(!h.value)return{};const V=460,ee=D.value,ae=24,I=O(h.value),G=I.x>1420?-V-28:28,K=Math.min(Math.max(I.x+G,ae),1920-V-ae),ge=Math.min(Math.max(I.y-ee-72,188),1080-ee-132);return{left:`${K}px`,top:`${ge}px`,right:"auto",bottom:"auto"}});Ia(()=>{document.addEventListener("pointerdown",pe,!0),F(),R(_.value)}),ns(()=>{y=!0,document.removeEventListener("pointerdown",pe,!0)}),ei(_,V=>{R(V)}),ei(s,()=>{o.value="",xe()}),ei(o,()=>{xe()});function R(V){var I,G,K,ge,Ee;const ee=Z1.find(q=>q.key===V)||Z1[0],ae=HS(V);o.value="",s.value=ee.defaultLayerKey||((I=ae[0])==null?void 0:I.key)||"",p.value=lFe(V),g.value=0,(K=(G=i.value)==null?void 0:G.setBoundaryDrawing)==null||K.call(G,!1),V!=="engineering-analysis"&&((Ee=(ge=i.value)==null?void 0:ge.clearAnalysisBoundary)==null||Ee.call(ge)),xe(),r("module-stats",{moduleKey:"ecological-protection",viewKey:V,items:iFe(V)})}function N(V){r("view-change",["national-park","restoration","engineering-analysis"].includes(V)?V:"national-park")}function F(){var I;m=new pv;let V=!1;const ee={progress:0};m.instance.on("onProgress",(G,K,ge)=>{const Ee=Math.floor(K/ge*100);Mr.to(ee,{progress:Ee,onUpdate:()=>{f.value=Math.floor(ee.progress)}})});const ae=()=>$e(this,null,function*(){var G,K;y||V||(V=!0,(G=i.value)==null||G.loadMap(m),yield we(),yield Ya(),(K=i.value)==null||K.play())});m.instance.on("onLoad",ae),(I=m.ready)==null||I.then(ae).catch(()=>{y||(v.value={type:"error",text:"地图资源加载失败"})})}function O(V){const ee=document.querySelector(".ecological-protection"),ae=ee==null?void 0:ee.getBoundingClientRect();return!(ae!=null&&ae.width)||!(ae!=null&&ae.height)?V:{x:(V.x-ae.left)/ae.width*1920,y:(V.y-ae.top)/ae.height*1080}}function H(V,ee){return`${_.value}-${ee}-${(V==null?void 0:V.key)||(V==null?void 0:V.title)||"panel"}`}function U(V){return(V==null?void 0:V.span)===2}function $(V){return U(V)?M:mG}function Y(V){const ee=(V==null?void 0:V.properties)||{};return Object.keys(ee).filter(ae=>{const I=ee[ae];return I==null||I===""?!1:!["geom","wkt","geometry","the_geom","raw_properties"].includes(String(ae).toLowerCase())}).length}function oe(V){var ae,I;const ee=(I=(ae=V==null?void 0:V.feature)!=null?ae:V)!=null?I:null;if(!ee){xe();return}l.value=ee,u.value=!1,V!=null&&V.screen&&(h.value=V.screen)}function X(V){v.value=V}function re(V,ee){var I,G;if(_.value!=="restoration"||(V==null?void 0:V.key)!=="restoration-projects")return;const ae=(ee==null?void 0:ee.projectName)||(ee==null?void 0:ee.name);ae&&(xe(),(G=(I=i.value)==null?void 0:I.focusProject)==null||G.call(I,ae))}function _e(V){var ee,ae;xe(),g.value=0,(ae=(ee=i.value)==null?void 0:ee.setBoundaryDrawing)==null||ae.call(ee,V)}function Fe(){var V,ee;(ee=(V=i.value)==null?void 0:V.finishBoundaryDrawing)==null||ee.call(V)}function Ce(){var V,ee;(ee=(V=i.value)==null?void 0:V.undoBoundaryPoint)==null||ee.call(V)}function Ae(){var V,ee;g.value=0,(ee=(V=i.value)==null?void 0:V.clearAnalysisBoundary)==null||ee.call(V)}function ze(V={}){var ee,ae,I;g.value=V.pointCount||((ee=V.points)==null?void 0:ee.length)||0,V.status==="complete"&&V.feature&&(g.value=0,(I=(ae=a.value)==null?void 0:ae.applyDrawnBoundary)==null||I.call(ae,V.feature)),V.status==="clear"&&(g.value=0)}function fe(V={}){var ee,ae;(ae=(ee=i.value)==null?void 0:ee.showAnalysisResult)==null||ae.call(ee,{boundary:V.boundary,matches:V.matches}),_.value}function j(V){var ae,I;const ee=((V==null?void 0:V.features)||[]).filter(Boolean);(I=(ae=i.value)==null?void 0:ae.showAnalysisResult)==null||I.call(ae,{matches:ee})}function xe(){var V,ee;l.value=null,u.value=!1,h.value=null,(ee=(V=i.value)==null?void 0:V.clearSelectedFeature)==null||ee.call(V)}function pe(V){if(!P.value)return;const ee=document.querySelector(".fgw-map-feature-info"),ae=V.target;ee&&ae instanceof Node&&ee.contains(ae)||xe()}function we(){return d.value?new Promise(V=>{Mr.to(".ecological-protection .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{d.value=!1,V()}})}):Promise.resolve()}return(V,ee)=>{var ae;return Z(),ne("div",uFe,[Ue(dv,{ref_key:"mapSceneRef",ref:i,"active-layer":w.value,"map-ranking":p.value,onFeatureLoading:ee[0]||(ee[0]=I=>c.value=I),onFeatureInfo:oe,onLayerStatus:X,onDrawBoundary:ze},null,8,["active-layer","map-ranking"]),E("div",cFe,[x.value?mt("",!0):(Z(),ne("div",hFe,[E("div",fFe,[(Z(!0),ne(et,null,ut(C.value,I=>(Z(),wi(Dt,{key:H(I,"left"),class:Ct(["fgw-side-card left-card",{"is-double":U(I)}]),title:I.title,width:398,height:$(I)},{default:Mt(()=>[Ue(Ir,{panel:I,compact:"",onRowSelect:G=>re(I,G)},null,8,["panel","onRowSelect"])]),_:2},1032,["class","title","height"]))),128))])])),x.value?mt("",!0):(Z(),ne("div",dFe,[E("div",pFe,[(Z(!0),ne(et,null,ut(A.value,I=>(Z(),wi(Dt,{key:H(I,"right"),class:Ct(["fgw-side-card right-card",{"is-double":U(I)}]),title:I.title,width:398,height:$(I)},{default:Mt(()=>[Ue(Ir,{panel:I,compact:"",onRowSelect:G=>re(I,G)},null,8,["panel","onRowSelect"])]),_:2},1032,["class","title","height"]))),128))])])),x.value?(Z(),wi(HOe,{key:2,ref_key:"engineeringAnalysisRef",ref:a,"drawing-point-count":g.value,onDrawingChange:_e,onFinishDrawing:Fe,onUndoPoint:Ce,onClearBoundary:Ae,onAnalysisResult:fe,onFocusProject:j},null,8,["drawing-point-count"])):mt("",!0),E("div",{class:Ct(["fgw-map-layer-tools",{"is-analysis":x.value}])},[Ue(xq,{modelValue:s.value,"onUpdate:modelValue":ee[1]||(ee[1]=I=>s.value=I),"selected-legend-key":o.value,"onUpdate:selectedLegendKey":ee[2]||(ee[2]=I=>o.value=I),"topic-key":_.value,legends:((ae=w.value)==null?void 0:ae.legends)||[],width:248,height:430},null,8,["modelValue","selected-legend-key","topic-key","legends"])],2),P.value?(Z(),ne("div",{key:3,class:"fgw-map-feature-info",style:pn(L.value)},[Ue(bq,{feature:l.value,empty:u.value,loading:c.value,width:460,height:D.value},null,8,["feature","empty","loading","height"])],4)):mt("",!0),E("div",vFe,[Ue(YS,{"model-value":_.value,topics:dn(Z1),"onUpdate:modelValue":N},null,8,["model-value","topics"])])]),d.value?(Z(),ne("div",gFe,[ee[4]||(ee[4]=Fh('<div class="loading-text"><span style="--index:1;">L</span><span style="--index:2;">O</span><span style="--index:3;">A</span><span style="--index:4;">D</span><span style="--index:5;">I</span><span style="--index:6;">N</span><span style="--index:7;">G</span></div>',1)),E("div",mFe,[E("span",yFe,ie(f.value),1),ee[3]||(ee[3]=E("span",{class:"unit"},"%",-1))])])):mt("",!0)])}}},bFe="/jsyApi",SFe="/openApi";function wFe(n,e){return/^https?:\/\//.test(e)?e:`${n}${e.startsWith("/")?e:`/${e}`}`}function AFe(n){if((n==null?void 0:n.success)===!1||(n==null?void 0:n.code)!==void 0&&![0,200,"0","200"].includes(n.code)){const t=new Error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"接口请求失败");throw t.code=n==null?void 0:n.code,t}return Qt(n)}function yG(n,e,t,r={}){return ol(wFe(n,e),{params:t,timeout:r.timeout||16e3}).then(AFe)}function MFe(){return $e(this,arguments,function*({areaCode:n,pasturesId:e}={}){const t={areaCode:n,pasturesId:e},r=[()=>yG(SFe,"/ai/balance/advice",t,{timeout:18e3}),()=>yG(bFe,"/ai/livestockBalance",t,{timeout:18e3})];let i;for(const a of r)try{return yield a()}catch(s){i=s}throw i||new Error("草畜平衡接口不可用")})}const TFe=(n,e=2)=>{const t=eu(10,e);return Math.round((Number(n)||0)*t)/t},WE=n=>TFe((Number(n)||0)/1e4,2),iX=[{key:"pasture-total",name:"牧户数量",value:9110,unit:"户",icon:"town"},{key:"avg-yak-per-household",name:"户均牦牛头数",value:52,unit:"头",icon:"yield"},{key:"avg-grassland-area",name:"户均草地面积",value:1131,unit:"亩",icon:"area"},{key:"joint-household-count",name:"联户数量",value:237,unit:"户",icon:"town"},{key:"poverty-monitor-count",name:"防反贫监测户",value:122,unit:"户",icon:"town"},{key:"average-income",name:"人均收入",value:19679,unit:"元/年",icon:"rate"}],aX=iX,sX=iX.map(n=>Ve(Le({},n),{zh:n.name,decimals:0})),S3=[{areaCode:"513233100",areaName:"邛溪镇",number:1452,year:2024},{areaCode:"513233104",areaName:"刷经寺镇",number:1500,year:2024},{areaCode:"513233101",areaName:"安曲镇",number:76,year:2024},{areaCode:"513233103",areaName:"龙日镇",number:828,year:2024},{areaCode:"513233204",areaName:"江茸乡",number:902,year:2024},{areaCode:"513233205",areaName:"查尔玛乡",number:450,year:2024},{areaCode:"513233102",areaName:"瓦切镇",number:602,year:2024},{areaCode:"513233203",areaName:"阿木乡",number:300,year:2024},{areaCode:"513233202",areaName:"麦洼乡",number:1204,year:2024},{areaCode:"513233105",areaName:"色地乡",number:2638,year:2024}].map(n=>Ve(Le({},n),{key:n.areaCode,name:n.areaName,value:n.number,unit:"户"})),oX=[{areaCode:"513233103",areaName:"龙日镇",uplineRate:4,year:2024},{areaCode:"513233202",areaName:"麦洼乡",uplineRate:52,year:2024},{areaCode:"513233101",areaName:"安曲镇",uplineRate:22,year:2024},{areaCode:"513233100",areaName:"邛溪镇",uplineRate:23,year:2024},{areaCode:"513233105",areaName:"色地乡",uplineRate:8,year:2024},{areaCode:"513233203",areaName:"阿木乡",uplineRate:12,year:2024},{areaCode:"513233204",areaName:"江茸乡",uplineRate:14,year:2024},{areaCode:"513233104",areaName:"刷经寺镇",uplineRate:9,year:2024}].map(n=>Ve(Le({},n),{key:n.areaCode,name:n.areaName,value:n.uplineRate,unit:"%",extra:`${n.uplineRate}%`})),lX=[{areaName:"全县",ageRange:"0-20",sex:"男",number:340,value:340,year:2024},{areaName:"全县",ageRange:"0-20",sex:"女",number:348,value:348,year:2024},{areaName:"全县",ageRange:"21-40",sex:"男",number:1700,value:1700,year:2024},{areaName:"全县",ageRange:"21-40",sex:"女",number:2040,value:2040,year:2024},{areaName:"全县",ageRange:"41-60",sex:"男",number:2040,value:2040,year:2024},{areaName:"全县",ageRange:"41-60",sex:"女",number:2104,value:2104,year:2024},{areaName:"全县",ageRange:"61-80",sex:"男",number:680,value:680,year:2024},{areaName:"全县",ageRange:"61-80",sex:"女",number:580,value:580,year:2024},{areaName:"全县",ageRange:"81-100",sex:"男",number:60,value:60,year:2024},{areaName:"全县",ageRange:"81-100",sex:"女",number:60,value:60,year:2024}],uX=(n,e,t,r)=>Array.from(n.reduce((i,a)=>{const s=a[e]||"未标注",o=i.get(s)||{key:s,name:s,value:0,unit:r};return o.value+=Number(a[t])||0,i.set(s,o),i},new Map).values()),CFe=uX(lX,"ageRange","value","人"),cX=[{key:"male",name:"男",value:4820,unit:"人"},{key:"female",name:"女",value:5132,unit:"人"}],af=[{name:"更洼尔",areaName:"瓦切乡",acreage:4704.87,summerAcreage:2267.26,winterAcreage:2437.61,year:2024},{name:"涉尔丹",areaName:"麦洼乡",acreage:1426.53,summerAcreage:687.82,winterAcreage:738.71,year:2024},{name:"热布丹",areaName:"查尔玛乡",acreage:2176.09,summerAcreage:1049.37,winterAcreage:1126.72,year:2024},{name:"王西卓玛",areaName:"阿木乡",acreage:4126.13,summerAcreage:1989.59,winterAcreage:2136.54,year:2024},{name:"阿尔",areaName:"色地乡",acreage:1249.48,summerAcreage:602.25,winterAcreage:647.23,year:2024},{name:"尕让吉",areaName:"邛溪镇",acreage:3688.72,summerAcreage:1778.56,winterAcreage:1910.16,year:2024},{name:"华尔甲",areaName:"安曲镇",acreage:2956.44,summerAcreage:1425.01,winterAcreage:1531.43,year:2024},{name:"泽让措",areaName:"江茸乡",acreage:3448.36,summerAcreage:1662.61,winterAcreage:1785.75,year:2024},{name:"扎西让布",areaName:"龙日镇",acreage:2689.1,summerAcreage:1296.15,winterAcreage:1392.95,year:2024},{name:"格桑卓玛",areaName:"刷经寺镇",acreage:3187.64,summerAcreage:1536.84,winterAcreage:1650.8,year:2024}].map(n=>Ve(Le({},n),{township:n.areaName,grasslandArea:n.acreage,value:n.acreage,unit:"亩",canLocate:!1,locateText:"--",searchText:`${n.name} ${n.areaName}`})),EFe=uX(af,"township","grasslandArea","亩").map(n=>Ve(Le({},n),{value:WE(n.value),unit:"万亩"})),PFe=Array.from(af.reduce((n,e)=>{const t=e.township||"未填写",r=n.get(t)||{key:`${t}-season`,name:t,values:{summer:0,winter:0}};return r.values.summer+=Number(e.summerAcreage)||0,r.values.winter+=Number(e.winterAcreage)||0,n.set(t,r),n},new Map).values()).map(n=>Ve(Le({},n),{values:{summer:WE(n.values.summer),winter:WE(n.values.winter)},unit:"万亩"})),LFe=S3.map(n=>({name:n.name,value:n.value,unit:"户"})),J2={topStats:sX,coreRows:aX,townRows:S3,ageRows:lX,genderRows:cX,onlineRows:oX,list:af},sf={grasslandCapacityPerMu:.047,yakToSheepUnit:4.8},RFe={key:"county-513233",type:"county",name:"红原县",areaCode:"513233"},b1=[{key:"healthy",label:"草畜平衡",shortLabel:"平衡",range:"≤ 0%",description:"承载力覆盖实际载畜量,当前放牧压力处于合理区间。",actions:["保持当前载畜水平与轮牧节奏","定期复测草地生产力和载畜量","关注极端天气对牧草生长的影响"]},{key:"watch",label:"轻度超载",shortLabel:"关注",range:"0% - 10%",description:"已出现轻度超载迹象,建议提前介入调控。",actions:["适度压减超载畜群规模","延长冬春舍饲补饲周期","增加人工草场补饲供应"]},{key:"warning",label:"中度超载",shortLabel:"预警",range:"10% - 20%",description:"超载较明显,草地退化风险上升,应启动主动调控。",actions:["压减载畜量至理论承载力以内","推行划区轮牧与阶段性休牧","扩大优质人工饲草供给"]},{key:"danger",label:"严重超载",shortLabel:"高压",range:"> 20%",description:"超载压力较高,建议纳入重点管控和生态修复范围。",actions:["强制压减载畜量并实施禁牧休牧","对退化草地实施生态修复","建立重点区域长效监测与考核机制"]}],Ao={areaRange:["areaRange","area_range","acreage","grasslandArea","area"],yakNumber:["yakNumber","yak_number","number","yakCount","livestockCount"],bearingCapacity:["bearingCapacity","bearing_capacity","capacity","theoryCapacity"],livestockCapacity:["livestockCapacity","livestock_capacity","carryingCapacity","actualCapacity"],overloadRate:["overloadRate","overload_rate","rate"],level:["level","conclusion"],advice:["advice","balanceAdvice","balance_advice","balanceAdivce","balance_adivce"],year:["year"],areaName:["areaName","area_name","name"],pasturesName:["pasturesName","pastures_name","pastureName","muhuName","name"]},hX={邛溪镇:"513233100",刷经寺镇:"513233101",安曲镇:"513233103",龙日镇:"513233105",江茸乡:"513233202",查尔玛乡:"513233203",瓦切镇:"513233204",瓦切乡:"513233204",阿木乡:"513233205",麦洼乡:"513233207",色地乡:"513233208",色地镇:"513233208",壤口乡:"513233209"},As=(n,e=2)=>{const t=eu(10,e);return Math.round((Number(n)||0)*t)/t},DFe={色地乡:1.38,麦洼乡:1.26,壤口乡:.92,阿木乡:1.12,瓦切镇:1.2,查尔玛乡:1.04,江茸乡:.88,龙日镇:1.16,安曲镇:1.28,刷经寺镇:.78,邛溪镇:1.08};function $a(n,e=null){if(n==null||n==="")return e;const t=typeof n=="string"?n.replace(/,/g,"").replace(/%/g,"").trim():n,r=Number(t);return Number.isFinite(r)?r:e}function xl(n={},e=[],t=void 0){for(const r of e){const i=n==null?void 0:n[r];if(i!=null&&i!=="")return i}return t}function Lr(n,e={}){var r;const t=$a(n);return t===null?"--":t.toLocaleString("zh-CN",{maximumFractionDigits:(r=e.maximumFractionDigits)!=null?r:Number.isInteger(t)?0:2})}function Tg(n){const e=$a(n);return e===null?"--":`${Lr(e)}%`}function ny(n){const e=$a(n);return e===null||e<=0?b1[0]:e<=10?b1[1]:e<=20?b1[2]:b1[3]}function fX(n){return Math.round((Number(n)||0)*sf.yakToSheepUnit)}function dX(n){return Math.round((Number(n)||0)*sf.grasslandCapacityPerMu)}function pX({key:n,type:e,name:t,areaCode:r,pasturesId:i,areaRange:a,yakNumber:s,location:o,township:l,pressureFactor:u=1}){const c=dX(a),h=Math.round(fX(s)*u),f=c?As((h-c)/c*100,1):0,d=ny(f);return{key:n,type:e,name:t,areaCode:r,pasturesId:i,areaRange:As(a,0),yakNumber:As(s,0),bearingCapacity:c,livestockCapacity:h,overloadRate:f,level:d.label,advice:d.actions.join(";"),year:"2026",location:o,township:l}}const ry=oo.map((n,e)=>pX({key:`town-${n.zoneName}`,type:"town",name:n.zoneName,areaCode:hX[n.zoneName],areaRange:n.grasslandArea,yakNumber:n.yakCount,location:null,pressureFactor:DFe[n.zoneName]||1,index:e})),IFe=ry.reduce((n,e)=>n+e.areaRange,0),NFe=ry.reduce((n,e)=>n+e.yakNumber,0),ix=ry.reduce((n,e)=>n+e.bearingCapacity,0),vX=ry.reduce((n,e)=>n+e.livestockCapacity,0),gX=ix?As((vX-ix)/ix*100,1):0,_G=ny(gX),kFe=Ve(Le({},RFe),{areaRange:IFe,yakNumber:NFe,bearingCapacity:ix,livestockCapacity:vX,overloadRate:gX,level:_G.label,advice:_G.actions.join(";"),year:"2026"}),OFe=af.map(n=>pX({key:n.id||n.key||n.name,type:"pasture",name:n.name,areaCode:hX[n.township],pasturesId:n.id,areaRange:n.grasslandArea,yakNumber:n.yakCount,location:n.location,township:n.township})),FFe=[kFe,...ry,...OFe];function BFe(n={},e={}){var u,c,h,f;const t=$a(xl(n,Ao.areaRange),(u=e.areaRange)!=null?u:0),r=$a(xl(n,Ao.yakNumber),(c=e.yakNumber)!=null?c:0),i=$a(xl(n,Ao.bearingCapacity),(h=e.bearingCapacity)!=null?h:dX(t)),a=$a(xl(n,Ao.livestockCapacity),(f=e.livestockCapacity)!=null?f:fX(r)),s=$a(xl(n,Ao.overloadRate)),o=s!==null?As(s,1):i?As((a-i)/i*100,1):0,l=ny(o);return Ve(Le(Le({},e),n),{key:e.key||n.key||n.id||n.areaCode||n.pasturesId||e.name,type:e.type||n.type||(n.pasturesId?"pasture":"town"),name:xl(n,[...Ao.pasturesName,...Ao.areaName],e.name||"核算对象"),areaCode:n.areaCode||n.area_code||e.areaCode,pasturesId:n.pasturesId||n.pastures_id||e.pasturesId,areaRange:t,yakNumber:r,bearingCapacity:i,livestockCapacity:a,overloadRate:o,level:xl(n,Ao.level,l.label),advice:xl(n,Ao.advice,e.advice||l.actions.join(";")),year:xl(n,Ao.year,e.year||"当前年度")})}function GFe(n={}){const e=$a(n.bearingCapacity,0),t=$a(n.livestockCapacity,0),r=$a(n.areaRange,0),i=$a(n.yakNumber,0),a=$a(n.overloadRate,e?(t-e)/e*100:0),s=t-e,o=e?As(t/e*100,1):0,l=ny(a),u=Math.round(i*sf.yakToSheepUnit),c=u?As(t/u,2):1,h=r?As(e/r,4):sf.grasslandCapacityPerMu;return{bearing:e,livestock:t,areaRange:r,yakNumber:i,yakSheepUnit:u,pressureFactor:c,bearingCoefficient:h,overloadRate:As(a,1),delta:s,usageRate:o,risk:l,bearingPercent:Math.max(4,Math.min(100,As(e/Math.max(e,t,1)*100,1))),livestockPercent:Math.max(4,Math.min(100,As(t/Math.max(e,t,1)*100,1)))}}function zFe(n={},e=ny(n.overloadRate)){const t=String(n.advice||"").trim(),r=t?t.split(/[。;;\n]/).map(s=>s.trim()).filter(Boolean):[],i=["提高放牧畜禽的密度","增加草地的利用率","密度不能过高"],a=r.filter(s=>i.some(o=>s.includes(o))?!1:e.key==="healthy"?!0:!i.some(o=>s.includes(o)));return[...e.actions||[],...a].filter((s,o,l)=>l.indexOf(s)===o).slice(0,4)}const UFe={class:"grass-livestock-balance"},VFe={class:"balance-screen"},HFe={class:"balance-selector"},WFe={class:"balance-scope-tabs"},$Fe=["onClick"],jFe={class:"balance-target-list"},qFe=["title","onClick"],XFe={class:"balance-action-box"},YFe=["disabled"],KFe={key:0,class:"balance-running"},ZFe={class:"balance-running-head"},QFe={class:"balance-core-inner"},JFe={class:"balance-running-title"},e8e={class:"balance-progress-line"},t8e={class:"balance-live-process"},n8e={key:1,class:"balance-waiting"},r8e={class:"balance-wait-core"},i8e={class:"balance-core-ring is-empty"},a8e={class:"balance-core-inner"},s8e={class:"balance-preflight"},o8e={key:2,class:"balance-analysis"},l8e={class:"balance-dashboard"},u8e={class:"balance-object-block"},c8e={class:"balance-core"},h8e={class:"balance-core-inner"},f8e={class:"balance-compare"},d8e={class:"balance-bar-row"},p8e={class:"balance-bar-row is-livestock"},v8e={class:"balance-detail"},g8e={class:"balance-process"},m8e={class:"balance-section-title"},y8e={class:"balance-process-track"},_8e={class:"balance-decision"},x8e={class:"balance-section-title"},b8e={class:"balance-conclusion"},S8e={class:"balance-advice-list"},w8e=326,A8e=720,M8e=1310,T8e=820,C8e={__name:"index",emits:["loading-progress","map-ready"],setup(n,{emit:e}){const t=e,r=Be("county"),i=Be(""),a=Be("idle"),s=Be(0),o=Be(0),l=Be({});let u=!1,c=0,h=null;const f=he(()=>FFe.map(fe=>BFe(l.value[fe.key],fe))),d=he(()=>f.value.filter(fe=>fe.type==="county")),p=he(()=>f.value.filter(fe=>fe.type==="town")),g=he(()=>f.value.filter(fe=>fe.type==="pasture")),v=he(()=>r.value==="town"?p.value:r.value==="pasture"?g.value:d.value),m=he(()=>f.value.find(fe=>fe.key===i.value)||null),y=he(()=>!!m.value),_=he(()=>a.value==="running"),x=he(()=>y.value&&a.value==="done"),b=he(()=>GFe(m.value||{})),S=he(()=>[{key:"county",name:"县域"},{key:"town",name:"乡镇"},{key:"pasture",name:"牧户"}]),w=he(()=>{var fe;return((fe=S.value.find(j=>j.key===r.value))==null?void 0:fe.name)||"县域"}),T=he(()=>m.value?m.value.pasturesId?`牧户编号 ${m.value.pasturesId}`:m.value.areaCode?`行政区划 ${m.value.areaCode}`:m.value.township||"核算对象":"等待选择核算对象"),C=he(()=>y.value?x.value?"分析已完成":_.value?"正在执行核算":"已选择,待开始分析":"请先选择具体对象"),A=he(()=>x.value?"草畜平衡分析舱":"草畜平衡分析"),M=he(()=>y.value?_.value?"分析中":"待开始":"待选择"),P=he(()=>y.value?_.value?`${m.value.name} 正在分析`:`${m.value.name} 待开始分析`:"先选择一个核算对象"),D=he(()=>y.value?_.value?"正在读取核算参数、执行公式计算,并生成结论与调控建议。":"点击左侧开始分析后,再展示结果、分析过程、结论和建议。":"选择县域、乡镇或牧户后,系统才会进入草地承载力核算。"),L=he(()=>{const fe=b.value;return`${fe.delta>0?"超载量":"承载余量"} ${Lr(Math.abs(fe.delta))} 羊单位,承载利用率 ${Tg(fe.usageRate)}。`}),R=he(()=>{const fe=Math.max(0,Math.min(130,Number(b.value.usageRate)||0));return`${Math.round(fe/130*360)}deg`}),N=he(()=>{const fe=m.value||{},j=b.value,xe=(j.areaRange||0)/1e4,pe=Fe(j.delta);return[{key:"bearing",index:"01",name:"理论承载力",formula:"核算草地面积 × 草地承载系数",expression:`${Lr(xe,{maximumFractionDigits:2})}万亩 × 10000 × ${_e(j.bearingCoefficient,4)}`,result:Lr(j.bearing),unit:"羊单位"},{key:"livestock",index:"02",name:"实际载畜量",formula:"牦牛数量 × 折羊单位系数 × 压力修正系数",expression:`${Lr(fe.yakNumber)}头 × ${_e(sf.yakToSheepUnit,1)} × ${_e(j.pressureFactor,2)}`,result:Lr(j.livestock),unit:"羊单位"},{key:"delta",index:"03",name:"承载差额",formula:"实际载畜量 - 理论承载力",expression:`${Lr(j.livestock)} - ${Lr(j.bearing)}`,result:pe,unit:"羊单位"},{key:"rate",index:"04",name:"超载率",formula:"承载差额 ÷ 理论承载力 × 100%",expression:`${pe} ÷ ${Lr(j.bearing)} × 100%`,result:Tg(j.overloadRate),unit:""}]}),F=he(()=>{var we;const fe=m.value||{},j=b.value,xe=(j.areaRange||0)/1e4,pe=Fe(j.delta);return[{key:"target",index:"01",name:"锁定核算对象",desc:"确认行政区划与对象口径",pending:"等待对象确认",expression:`${((we=m.value)==null?void 0:we.name)||"--"} / ${T.value}`,result:"已锁定"},{key:"params",index:"02",name:"读取基础参数",desc:"读取草地面积、牦牛数量与折算系数",pending:"等待参数读取",expression:`草地 ${Lr(xe,{maximumFractionDigits:2})} 万亩,牦牛 ${Lr(fe.yakNumber)} 头,折羊系数 ${_e(sf.yakToSheepUnit,1)}`,result:"已读取"},{key:"bearing",index:"03",name:"计算理论承载力",desc:"代入草地承载系数",pending:"等待承载力计算",expression:`${Lr(xe,{maximumFractionDigits:2})}万亩 × 10000 × ${_e(j.bearingCoefficient,4)} = ${Lr(j.bearing)} 羊单位`,result:Lr(j.bearing)},{key:"livestock",index:"04",name:"折算实际载畜量",desc:"按牦牛数量与压力系数折算",pending:"等待载畜量折算",expression:`${Lr(fe.yakNumber)}头 × ${_e(sf.yakToSheepUnit,1)} × ${_e(j.pressureFactor,2)} = ${Lr(j.livestock)} 羊单位`,result:Lr(j.livestock)},{key:"conclusion",index:"05",name:"生成平衡结论",desc:"比较差额并输出调控建议",pending:"等待结论生成",expression:`${pe} ÷ ${Lr(j.bearing)} × 100% = ${Tg(j.overloadRate)}`,result:j.risk.label}]}),O=he(()=>F.value[Math.min(o.value,F.value.length-1)]||F.value[0]),H=he(()=>[{key:"select",index:"01",name:"对象锁定",desc:y.value?m.value.name:"等待选择",state:y.value?"done":"active"},{key:"params",index:"02",name:"参数读取",desc:x.value?"草地与牦牛参数已确认":"分析后读取",state:_.value?"active":x.value?"done":y.value?"pending":"disabled"},{key:"formula",index:"03",name:"模型推演",desc:x.value?"承载模型已完成":"等待公式计算",state:_.value?"active":x.value?"done":"disabled"},{key:"result",index:"04",name:"结论生成",desc:x.value?b.value.risk.label:"等待建议生成",state:x.value?"done":"disabled"}]),U=he(()=>x.value?zFe(m.value,b.value.risk):[]);Ia(()=>{t("loading-progress",{progress:100}),t("map-ready")}),ns(()=>{u=!0,c+=1,Ce()}),ei(()=>{var fe;return(fe=m.value)==null?void 0:fe.key},()=>{a.value="idle",s.value=0,o.value=0,Ce()});function $(fe){r.value=fe,i.value="",a.value="idle"}function Y(fe){fe&&(r.value=fe.type==="pasture"?"pasture":fe.type==="town"?"town":"county",i.value=fe.key,a.value="idle")}function oe(){!m.value||_.value||(a.value="running",s.value=0,o.value=0,Ce(),X(),h=window.setInterval(()=>{u||(s.value=Math.min(100,s.value+4),o.value=Math.min(F.value.length-1,Math.floor(s.value/22)),s.value>=100&&(Ce(),a.value="done"))},90))}function X(){return $e(this,null,function*(){const fe=m.value;if(!fe||l.value[fe.key])return null;const j=++c;try{const xe=yield MFe({areaCode:fe.type==="pasture"?void 0:fe.areaCode,pasturesId:fe.type==="pasture"?fe.pasturesId:void 0});return u||j!==c||!xe?null:(l.value=Ve(Le({},l.value),{[fe.key]:xe}),xe)}catch(xe){return null}})}function re(fe){return fe.type==="pasture"?fe.township||"牧户":fe.type==="town"?"乡镇对象":"县域对象"}function _e(fe,j=2){const xe=Number(fe);return Number.isFinite(xe)?xe.toFixed(j):"--"}function Fe(fe){const j=Number(fe)||0;return`${j>0?"+":j<0?"-":""}${Lr(Math.abs(j))}`}function Ce(){h&&(window.clearInterval(h),h=null)}function Ae(fe){return x.value||_.value&&fe<=o.value}function ze(fe){return fe<o.value||x.value?"done":fe===o.value&&_.value?"active":"pending"}return(fe,j)=>(Z(),ne("div",UFe,[j[15]||(j[15]=E("div",{class:"balance-backdrop","aria-hidden":"true"},[E("div",{class:"balance-orbit is-left"}),E("div",{class:"balance-orbit is-right"}),E("div",{class:"balance-energy-band"})],-1)),E("div",VFe,[Ue(Dt,{class:"balance-card balance-target-card",title:"核算对象",width:w8e,height:A8e},{default:Mt(()=>{var xe;return[E("div",HFe,[E("div",WFe,[(Z(!0),ne(et,null,ut(S.value,pe=>(Z(),ne("button",{key:pe.key,type:"button",class:Ct({active:r.value===pe.key}),onClick:we=>$(pe.key)},ie(pe.name),11,$Fe))),128))]),E("div",jFe,[(Z(!0),ne(et,null,ut(v.value,pe=>{var we;return Z(),ne("button",{key:pe.key,type:"button",class:Ct({active:pe.key===((we=m.value)==null?void 0:we.key)}),title:pe.name,onClick:V=>Y(pe)},[E("span",null,ie(pe.name),1),E("small",null,ie(re(pe)),1)],10,qFe)}),128))]),E("div",XFe,[j[0]||(j[0]=E("span",null,"当前对象",-1)),E("strong",null,ie(((xe=m.value)==null?void 0:xe.name)||"未选择"),1),E("small",null,ie(C.value),1),E("button",{type:"button",disabled:!y.value||_.value,onClick:oe},ie(_.value?"分析中...":x.value?"重新分析":"开始分析"),9,YFe)])])]}),_:1}),Ue(Dt,{class:"balance-card balance-sheet-card",title:A.value,width:M8e,height:T8e},{default:Mt(()=>[E("div",{class:Ct(["balance-sheet",{"is-ready":x.value,"is-running":_.value}])},[j[14]||(j[14]=E("div",{class:"balance-field-lines","aria-hidden":"true"},[E("i"),E("i"),E("i")],-1)),_.value?(Z(),ne("section",KFe,[E("div",ZFe,[E("div",{class:"balance-core-ring is-running",style:pn({"--usage-angle":`${s.value*3.6}deg`})},[E("div",QFe,[j[1]||(j[1]=E("span",null,"分析进度",-1)),E("strong",null,ie(s.value)+"%",1),E("small",null,ie(O.value.name),1)])],4),E("div",JFe,[E("span",null,ie(m.value.name),1),E("strong",null,ie(O.value.desc),1),E("small",null,ie(O.value.expression),1),E("div",e8e,[E("i",{style:pn({width:`${s.value}%`})},null,4)])])]),E("div",t8e,[(Z(!0),ne(et,null,ut(F.value,(xe,pe)=>(Z(),ne("div",{key:xe.key,class:Ct(["balance-live-step",`is-${ze(pe)}`])},[E("span",null,ie(xe.index),1),E("div",null,[E("strong",null,ie(xe.name),1),E("p",null,ie(Ae(pe)?xe.expression:xe.pending),1)]),E("em",null,ie(Ae(pe)?xe.result:"等待"),1)],2))),128))])])):x.value?(Z(),ne("section",o8e,[E("div",l8e,[E("div",u8e,[E("span",null,ie(w.value)+"核算对象",1),E("strong",null,ie(m.value.name),1),E("small",null,ie(T.value),1)]),E("div",c8e,[E("div",{class:"balance-core-ring",style:pn({"--usage-angle":R.value})},[E("div",h8e,[j[5]||(j[5]=E("span",null,"承载利用率",-1)),E("strong",null,ie(dn(Tg)(b.value.usageRate)),1),E("small",null,"超载率 "+ie(dn(Tg)(b.value.overloadRate)),1)])],4),j[6]||(j[6]=E("div",{class:"balance-core-caption"},"草地承载力模型",-1))]),E("div",{class:Ct(["balance-verdict-card",`is-${b.value.risk.key}`])},[j[7]||(j[7]=E("span",null,"分析结论",-1)),E("strong",null,ie(b.value.risk.label),1),E("small",null,ie(b.value.delta>0?"需调控载畜量":"承载能力可覆盖"),1)],2)]),E("div",f8e,[E("div",d8e,[j[9]||(j[9]=E("span",null,"理论承载力",-1)),E("div",null,[E("i",{style:pn({width:`${b.value.bearingPercent}%`})},null,4)]),E("strong",null,[jn(ie(dn(Lr)(b.value.bearing)),1),j[8]||(j[8]=E("em",null,"羊单位",-1))])]),E("div",p8e,[j[11]||(j[11]=E("span",null,"实际载畜量",-1)),E("div",null,[E("i",{style:pn({width:`${b.value.livestockPercent}%`})},null,4)]),E("strong",null,[jn(ie(dn(Lr)(b.value.livestock)),1),j[10]||(j[10]=E("em",null,"羊单位",-1))])])]),E("div",v8e,[E("div",g8e,[E("div",m8e,[j[12]||(j[12]=E("span",null,"分析过程",-1)),E("small",null,ie(m.value.year||"当前年度"),1)]),E("div",y8e,[(Z(!0),ne(et,null,ut(H.value,xe=>(Z(),ne("span",{key:`track-${xe.key}`,class:Ct(`is-${xe.state}`)},ie(xe.name),3))),128))]),(Z(!0),ne(et,null,ut(N.value,xe=>(Z(),ne("div",{key:xe.key,class:"balance-formula-row"},[E("span",null,ie(xe.index),1),E("div",null,[E("strong",null,ie(xe.name),1),E("p",null,ie(xe.formula),1),E("small",null,ie(xe.expression),1)]),E("em",null,ie(xe.result)+ie(xe.unit?` ${xe.unit}`:""),1)]))),128))]),E("div",_8e,[E("div",x8e,[j[13]||(j[13]=E("span",null,"结论与建议",-1)),E("small",null,ie(b.value.delta>0?"需要调控":"保持监测"),1)]),E("div",b8e,[E("strong",null,ie(b.value.risk.description),1),E("p",null,ie(L.value),1)]),E("div",S8e,[(Z(!0),ne(et,null,ut(U.value,(xe,pe)=>(Z(),ne("div",{key:`${xe}-${pe}`,class:"balance-advice-item"},[E("span",null,ie(pe+1),1),E("p",null,ie(xe),1)]))),128))])])])])):(Z(),ne("section",n8e,[E("div",r8e,[E("div",i8e,[E("div",a8e,[E("span",null,ie(M.value),1),E("strong",null,ie(y.value?m.value.name:"草畜平衡"),1),E("small",null,ie(y.value?"待执行模型分析":"等待核算对象"),1)])]),E("h2",null,ie(P.value),1),E("p",null,ie(D.value),1)]),E("div",s8e,[E("span",{class:Ct({active:y.value})},"对象锁定",2),j[2]||(j[2]=E("i",null,null,-1)),E("span",{class:Ct({active:y.value})},"等待启动分析",2),j[3]||(j[3]=E("i",null,null,-1)),j[4]||(j[4]=E("span",null,"生成过程与结论",-1))])]))],2)]),_:1},8,["title"])])]))}},mX="/jsyApi",Tc="/openApi",E8e=new Date().getFullYear();function P8e(n,e){return/^https?:\/\//.test(e)?e:`${n}${e.startsWith("/")?e:`/${e}`}`}function L8e(n){if((n==null?void 0:n.success)===!1&&(n==null?void 0:n.code)!==void 0&&![0,200,"0","200"].includes(n.code))throw new Error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"接口请求失败");return Qt(n)}function ll(n,e,t,r={}){return ol(P8e(n,e),{params:t,timeout:r.timeout||18e3}).then(L8e)}function R8e(){return ll(mX,"/api/yak/distribution").then(n=>yX(n))}function D8e(){return ll(mX,"/api/yak/forecast").then(n=>yX(n))}function xG(n=E8e){return ll(Tc,"/yak/trade/overview",typeof n=="object"?n:{year:n}).then(t=>t||{})}function I8e(){return ll(Tc,"/yak/trade/options").then(n=>n||{})}function bG(n={}){return ll(Tc,"/yak/trade/records",n).then(e=>e||{})}function N8e(n={}){return ll(Tc,"/yak/epidemic/analysis",n).then(e=>e||{})}function SG(n={}){return ll(Tc,"/yak/epidemic/records",n).then(e=>e||{})}function k8e(n={}){return ll(Tc,"/yak/epidemic/stats",n).then(e=>e||{})}function O8e(n={}){return ll(Tc,"/yak/epidemic/village-stats",n).then(e=>e||{})}function F8e(n){return ll(Tc,"/yak/epidemic/detail",{earTag:n}).then(e=>e||null)}function B8e(){return $e(this,null,function*(){return(yield R8e()).map((e,t)=>({key:fp(e,["areaCode","area_code","code","id"],`yak-town-${t}`),name:fp(e,["areaName","area_name","zoneName","townName","name"],`区域${t+1}`),value:w3(fp(e,["number","yakCount","yak_count","count","value"])),unit:"头"})).filter(e=>e.name&&Number.isFinite(e.value)).sort((e,t)=>t.value-e.value)})}function G8e(){return $e(this,null,function*(){return(yield D8e()).map((e,t)=>{const r=fp(e,["month","date","name","time"],`预测${t+1}`);return{key:`${r}-${t}`,name:z8e(r),value:w3(fp(e,["number","count","yakCount","value"])),unit:"头",extra:U8e("增速",fp(e,["speed","growth","growthRate","rate"]))}}).filter(e=>e.name&&Number.isFinite(e.value))})}function yX(n){return Array.isArray(n)?n:Array.isArray(n==null?void 0:n.rows)?n.rows:Array.isArray(n==null?void 0:n.list)?n.list:Array.isArray(n==null?void 0:n.records)?n.records:Array.isArray(n==null?void 0:n.data)?n.data:[]}function fp(n,e,t=""){for(const r of e){const i=n==null?void 0:n[r];if(i!=null&&i!=="")return i}return t}function z8e(n){const e=String(n||""),t=e.match(/(?:^|\D)(1[0-2]|0?[1-9])(?:月|$|-)/);return t?`${Number(t[1])}月`:e}function U8e(n,e){const t=w3(e);return Number.isFinite(t)?`${n}:${t.toLocaleString("zh-CN",{maximumFractionDigits:2})}`:""}function w3(n){if(n==null||n==="")return NaN;const e=Number(String(n).replace(/,/g,"").replace(/%/g,""));return Number.isFinite(e)?e:NaN}const V8e={class:"yak-management"},H8e={key:0,class:"yak-map-loading"},W8e={class:"yak-management-ui"},$8e={key:0,class:"trade-year-switcher","aria-label":"交易年份切换"},j8e=["onClick"],q8e={key:1,class:"forecast-year-switcher","aria-label":"预测年份切换"},X8e=["onClick"],Y8e={class:"yak-left"},K8e={class:"yak-side-stack is-left"},Z8e={class:"estimate-summary-card"},Q8e={class:"estimate-flow-row"},J8e={class:"estimate-flow-item"},e6e={class:"estimate-flow-item is-adjustment"},t6e={class:"estimate-result-band"},n6e={class:"forecast-summary-card"},r6e={class:"forecast-result-row"},i6e={class:"forecast-result-main"},a6e={class:"forecast-simple-grid"},s6e={class:"epidemic-overview-card"},o6e={class:"epidemic-main-value"},l6e={class:"epidemic-overview-grid"},u6e={class:"epidemic-chain-card"},c6e={class:"epidemic-chain-row"},h6e={class:"epidemic-chain-metrics"},f6e={key:0,class:"epidemic-three-pie-card"},d6e={class:"epidemic-three-pie-visual"},p6e={class:"epidemic-three-pie-center"},v6e={class:"epidemic-three-pie-legend"},g6e={key:1,class:"epidemic-empty"},m6e={class:"trade-overview-card"},y6e={class:"trade-main-metric"},_6e={class:"trade-metric-grid"},x6e={class:"yak-right"},b6e={class:"yak-side-stack is-right"},S6e={class:"forecast-heat-list"},w6e={class:"epidemic-record-table is-double"},A6e={class:"epidemic-record-toolbar"},M6e={class:"epidemic-record-rows"},T6e=["onClick"],C6e={key:0,class:"epidemic-empty"},E6e={class:"trade-cert-card"},P6e={class:"trade-cert-main"},L6e={class:"trade-dest-list"},R6e={key:0,class:"epidemic-empty"},D6e={class:"trade-ledger-table"},I6e={class:"trade-ledger-toolbar"},N6e={class:"trade-ledger-rows"},k6e=["onClick"],O6e={key:0,class:"epidemic-empty"},F6e={class:"trade-ledger-pager"},B6e=["disabled"],G6e=["disabled"],z6e={class:"yak-bottom-topic"},U6e={class:"epidemic-ledger-dialog"},V6e={class:"epidemic-ledger-dialog-head"},H6e={class:"epidemic-ledger-filters"},W6e=["value"],$6e=["value"],j6e={class:"epidemic-ledger-workspace"},q6e={class:"epidemic-ledger-list"},X6e=["onClick"],Y6e={key:0,class:"epidemic-empty"},K6e={class:"epidemic-ledger-detail"},Z6e={class:"epidemic-detail-head"},Q6e={class:"epidemic-detail-grid is-modal"},J6e={class:"is-wide"},eBe={class:"epidemic-modal-photo-strip"},tBe={key:0},nBe=["src"],rBe={class:"epidemic-ledger-pager"},iBe=["disabled"],aBe=["disabled"],sBe={class:"epidemic-ledger-dialog trade-ledger-dialog"},oBe={class:"epidemic-ledger-dialog-head"},lBe={class:"epidemic-ledger-filters trade-ledger-filters"},uBe=["value"],cBe=["value"],hBe=["value"],fBe={class:"epidemic-ledger-workspace trade-ledger-workspace"},dBe={class:"epidemic-ledger-list trade-ledger-modal-list"},pBe=["onClick"],vBe={key:0,class:"epidemic-empty"},gBe={class:"epidemic-ledger-detail trade-ledger-detail"},mBe={class:"epidemic-detail-head"},yBe={class:"epidemic-detail-grid is-modal trade-detail-grid"},_Be={class:"is-wide"},xBe={class:"is-wide"},bBe=["disabled"],SBe={class:"epidemic-ledger-pager"},wBe=["disabled"],ABe=["disabled"],Rn=398,Dn=190,MBe="https://qkl-hy.oss-cn-chengdu.aliyuncs.com/yak-vaccine-images",wG=14,eT=12,AG=14,TBe=5e3,S1=6,CBe=4200,EBe={__name:"index",emits:["module-stats"],setup(n,{emit:e}){const t=e,r=Dn*2+12,i=Dn*2+12,a=["#30dcff","#27f0c0","#ffd76c","#7aa7ff","#ff8f6b","#a6f06d"],s=["#24f6c4","#32dcff","#ffe06b","#7ee269","#ff9a62","#9ea7ff"],o=["#30dcff","#ffd76c","#27f0c0","#7aa7ff","#ff8f6b","#a6f06d","#9ea7ff"],l={name:"红原牦牛交易市场",lng:102.562157,lat:32.820484},u={四川:{lng:104.076452,lat:30.651696,level:"province"},青海:{lng:101.780268,lat:36.620939,level:"province"},甘肃:{lng:103.826308,lat:36.059421,level:"province"},重庆:{lng:107.304962,lat:29.533155,level:"province"},陕西:{lng:108.954239,lat:34.265472,level:"province"},云南:{lng:102.712251,lat:25.040609,level:"province"},西藏:{lng:91.117212,lat:29.646922,level:"province"},新疆:{lng:87.616848,lat:43.825592,level:"province"},北京:{lng:116.407387,lat:39.904179,level:"province"},上海:{lng:121.472644,lat:31.231706,level:"province"},广东:{lng:113.26653,lat:23.132191,level:"province"},海南:{lng:110.33119,lat:20.031971,level:"province"}},c={邛溪:{lng:102.633747,lat:32.825764,level:"town"},红原:{lng:102.544906,lat:32.790891,level:"county"},广汉:{lng:104.282204,lat:30.977264,level:"county"},向阳:{lng:104.300098,lat:31.008356,level:"town"},汉州:{lng:104.281889,lat:30.97715,level:"street"},互助:{lng:101.959167,lat:36.844057,level:"county"},湟中:{lng:101.571683,lat:36.500879,level:"district"},崇州:{lng:103.673025,lat:30.630122,level:"county"},怀远:{lng:103.524469,lat:30.711891,level:"town"},绵阳:{lng:104.679114,lat:31.46745,level:"city"},广元:{lng:105.843357,lat:32.435435,level:"city"},南充:{lng:106.110698,lat:30.837793,level:"city"},雅安:{lng:103.013261,lat:29.980537,level:"city"},民乐:{lng:100.812859,lat:38.430318,level:"county"},湟源:{lng:101.256464,lat:36.682426,level:"county"},德阳:{lng:104.397808,lat:31.127494,level:"city"},成都:{lng:104.066541,lat:30.572269,level:"city"},阿坝:{lng:102.224653,lat:31.899413,level:"prefecture"},张掖:{lng:100.449858,lat:38.924766,level:"city"},西宁:{lng:101.777795,lat:36.616621,level:"city"},海东:{lng:102.401614,lat:36.482072,level:"city"},重庆:{lng:107.304962,lat:29.533155,level:"municipality"},西安:{lng:108.939645,lat:34.343207,level:"city"},昆明:{lng:102.832891,lat:24.880095,level:"city"},拉萨:{lng:91.171961,lat:29.653482,level:"city"},乌鲁木齐:{lng:87.616848,lat:43.825592,level:"city"},北京:{lng:116.407387,lat:39.904179,level:"city"},上海:{lng:121.472644,lat:31.231706,level:"city"},广州:{lng:113.264385,lat:23.129112,level:"city"},海口:{lng:110.198293,lat:20.044001,level:"city"},三亚:{lng:109.511909,lat:18.252847,level:"city"},汉中:{lng:107.02377,lat:33.06761,level:"city"}},h=[{lng:104.076452,lat:30.651696},{lng:101.780268,lat:36.620939},{lng:103.826308,lat:36.059421},{lng:108.954239,lat:34.265472},{lng:106.551556,lat:29.563009},{lng:111.670801,lat:40.818311},{lng:87.616848,lat:43.825592},{lng:116.407387,lat:39.904179}],f=[{key:"structure",name:"畜群结构",color:"#30dcff"},{key:"forecast",name:"畜群预测",color:"#ffd76c"},{key:"epidemic",name:"牦牛防疫",color:"#27f0c0"},{key:"trade",name:"牦牛交易",color:"#ffcf62"}],d=Be("structure"),p=Be("2027"),g=Be(0),v=Be([]),m=Be([]),y=Be({metrics:{}}),_=Be({rows:[],percentage:null,year:null}),x=Be({rows:[]}),b=Be([]),S=Be(0),w=Be(!1),T=Be(""),C=Be(!1),A=Be([]),M=Be(0),P=Be(1),D=Be(!1),L=Be(""),R=Be(null),N=Be(null),F=Be(!1),O=Be({keyword:"",town:"",medicine:"",startDate:"",endDate:""}),H=Be({years:[],latestYear:null}),U=Be({metrics:{},hasData:!1}),$=Be([]),Y=Be(0),oe=Be(null),X=Be(!1),re=Be(""),_e=Be(1),Fe=Be(""),Ce=Be(""),Ae=Be(!1),ze=Be([]),fe=Be(0),j=Be(1),xe=Be(!1),pe=Be(""),we=Be(null),V=Be({keyword:"",startTown:"",usageType:"",certType:""}),ee=Be(null),ae=Be(!1);let I=null,G=!1,K=null,ge=null,Ee=0;const q=he(()=>gq(p.value)),le=he(()=>vq+r3),ue=he(()=>q.value.stock-Du),be=he(()=>{var B;return((B=Pu.find(k=>k.key==="adultCow"))==null?void 0:B.ratio)||0}),He=he(()=>{var B;return((B=Pu.find(k=>k.key==="calf"))==null?void 0:B.ratio)||0}),nt=he(()=>OX(v.value.length?v.value:OE,OE)),ke=he(()=>m.value.length>=6?m.value:j3e),Tt=he(()=>Z3e(q.value)),wt=he(()=>K3e(q.value)),pt=he(()=>{var B;return((B=y.value)==null?void 0:B.metrics)||{}}),lt=he(()=>{var B;return Tv((B=y.value)==null?void 0:B.dateTrend).sort(jX)}),Ze=he(()=>{var B;return Tv((B=y.value)==null?void 0:B.medicineCounts)}),At=he(()=>Ze.value.filter(B=>B.value>0).map((B,k)=>Ve(Le({},B),{key:B.key||`${B.name}-${k}`,unit:"条"}))),ce=he(()=>At.value.map(B=>`${B.name}:${B.value}`).join("|")||"epidemic-medicine-empty"),We=he(()=>{var B;return Tv((B=y.value)==null?void 0:B.ownerRanks).slice(0,8)}),at=he(()=>Math.max(Ze.value.filter(B=>B.name!=="未填写").length,1)),vt=he(()=>Cv(pt.value,["total","vaccine"])),se=he(()=>Cv(pt.value,["withImages","with_images"])),Ye=he(()=>Cv(pt.value,["owners"])),je=he(()=>Cv(pt.value,["villages"]));he(()=>vt.value?se.value/vt.value*100:0);const Q=he(()=>{const B=Number(_t.value);return Number.isFinite(B)?B:me.value?100:0}),me=he(()=>{const B=Math.max(...Ze.value.map(k=>Number(k.value||0)),0);return B>0?B:Math.round(vt.value/at.value)}),Oe=he(()=>{var k;const B=VX((k=_.value)==null?void 0:k.rows);return B.length?B:jt.value.map(W=>({name:W.name,vaccinated:Number(W.recordCount||0),unvaccinated:0,total:Number(W.recordCount||0),ratio:W.ratio,source:"ledger"}))}),_t=he(()=>{var de;const B=is((de=_.value)==null?void 0:de.percentage);if(Number.isFinite(B))return B;const k=Oe.value.reduce((Te,Je)=>Te+Number(Je.total||0),0),W=Oe.value.reduce((Te,Je)=>Te+Number(Je.vaccinated||0),0);return k?W/k*100:null}),zt=he(()=>Oe.value.some(B=>B.source==="stats")),xn=he(()=>{var k;const B=new Set;return I3((k=x.value)==null?void 0:k.rows).filter(W=>Number.isFinite(W.lng)&&Number.isFinite(W.lat)).map((W,de)=>{const Te=`${W.lng.toFixed(4)},${W.lat.toFixed(4)}`,Je=B.has(Te)?(de%3-1)*.012:0;return B.add(Te),Ve(Le({},W),{name:W.village,value:W.earTagCount,unit:"万头",lng:W.lng+Je,lat:W.lat-Je*.65,displayValue:Number((W.earTagCount/1e4).toFixed(2)),displayUnit:"万头",rankLabel:`第${de+1}名`})})}),jt=he(()=>{var k;const B=new Map;return Tv((k=y.value)==null?void 0:k.townCounts).forEach(W=>{const de=Mv(W.name);de&&B.set(de,Number(B.get(de)||0)+Number(W.value||0))}),[...B.entries()].map(([W,de])=>{const Te=Math.round(de/at.value),Je=vt.value?de/vt.value*100:0;return{name:W,recordCount:de,earTagCount:Te,ratio:Je}}).sort((W,de)=>Number(de.recordCount||0)-Number(W.recordCount||0))}),Tn=he(()=>b.value.slice(0,13)),dr=he(()=>Math.max(Math.ceil(M.value/wG),1)),ye=he(()=>N.value||R.value||{}),ht=he(()=>uw(ye.value)),rs=he(()=>{var B;return Tv((B=y.value)==null?void 0:B.townCounts).map(k=>k.name)}),iy=he(()=>Ze.value.map(B=>B.name).filter(B=>B&&B!=="未填写")),Cc=he(()=>{var B;return((B=U.value)==null?void 0:B.metrics)||{}}),yv=he(()=>{var B,k,W,de,Te,Je,Gt,kt;return R3((B=H.value)==null?void 0:B.years,(k=U.value)==null?void 0:k.availableYears,(W=U.value)==null?void 0:W.available_years,(de=U.value)==null?void 0:de.yearSummary,(Te=U.value)==null?void 0:Te.year_summary,(Je=U.value)==null?void 0:Je.latestYear,(Gt=U.value)==null?void 0:Gt.latest_year,(kt=U.value)==null?void 0:kt.year)}),ay=he(()=>{var B,k;return uy(((B=U.value)==null?void 0:B.monthTrend)||((k=U.value)==null?void 0:k.month_trend),"name")});he(()=>{var B,k;return zX(((B=U.value)==null?void 0:B.yearSummary)||((k=U.value)==null?void 0:k.year_summary))});const _v=he(()=>{var B,k;return uy(((B=U.value)==null?void 0:B.startTownCounts)||((k=U.value)==null?void 0:k.start_town_counts),"name")}),sy=he(()=>{var B,k;return uy(((B=U.value)==null?void 0:B.usageCounts)||((k=U.value)==null?void 0:k.usage_counts),"name")}),xv=he(()=>{var W,de;const B=uy(((W=U.value)==null?void 0:W.destRegionRanks)||((de=U.value)==null?void 0:de.dest_region_ranks),"name").slice(0,8),k=Math.max(...B.map(Te=>Te.headCount),1);return B.map(Te=>Ve(Le({},Te),{ratio:Math.max(8,Math.round(Te.headCount/k*100))}))}),J=he(()=>$.value.slice(0,eT)),Se=he(()=>Math.max(Math.ceil(Y.value/eT),1)),Re=he(()=>Math.max(Math.ceil(fe.value/AG),1)),Me=he(()=>we.value||{}),De=he(()=>Me.value.certId||Me.value.factoryCode||""),ft=he(()=>{var k,W;const B=ow(((k=H.value)==null?void 0:k.startTowns)||((W=H.value)==null?void 0:W.start_towns));return B.length?B:lw(_v.value.map(de=>de.name))}),Pt=he(()=>{var k,W;const B=ow(((k=H.value)==null?void 0:k.usageTypes)||((W=H.value)==null?void 0:W.usage_types));return B.length?B:lw(sy.value.map(de=>de.name))}),Bt=he(()=>{var k,W,de,Te;const B=UX(((k=H.value)==null?void 0:k.certTypeOptions)||((W=H.value)==null?void 0:W.cert_type_options));return B.length?B:ow(((de=H.value)==null?void 0:de.certTypes)||((Te=H.value)==null?void 0:Te.cert_types)).map(Je=>({value:Je,label:Je}))}),Wt=he(()=>xv.value.map((B,k)=>{const W=GX(B,k);return{key:B.key||`${B.name}-${k}`,name:B.name,value:B.headCount,headCount:B.headCount,recordCount:B.recordCount,ratio:B.ratio,unit:"头",lng:W.lng,lat:W.lat,labelSide:W.labelSide,province:W.province}})),tn=he(()=>nt.value.map(B=>Ve(Le({},B),{adultCowRatio:be.value,calfRatio:He.value,adultCow:Math.round(B.count*be.value/100),calf:Math.round(B.count*He.value/100)}))),$t=he(()=>{const B=tn.value,k=B.length,W=Math.max(Math.ceil(k/S1),1),de=g.value%W,Te=de*S1,Je=Math.min(Te+S1,k);return{page:de,pageCount:W,start:Te,end:Je,total:k,rows:B.slice(Te,Je)}}),Zt=he(()=>d.value==="forecast"?Tt.value:nt.value),pr=he(()=>d.value==="forecast"?"forecast":"count"),$i=he(()=>oY(Zt.value,pr.value)),Ur=he(()=>({key:"yak-marks-layer",layerName:"ne:daping_yak_marks",name:"牦牛识别标记",opacity:.96,queryBuffer:10,legends:[{key:"yak-marks",name:"牦牛",fillColor:"#FFFF00",strokeColor:"#FFFF00",selectable:!1}]})),Hs=he(()=>{var W;const k=I3((W=x.value)==null?void 0:W.rows).map(de=>$X(de.town,de.village)).filter(Boolean);return{key:"yak-epidemic-village-boundary",sourceType:"wfs",layerName:"ne:t_pastures_map",styles:"牧场样式",name:"防疫村边界",opacity:.86,queryBuffer:8,cqlFilter:k.length?k.join(" OR "):"EXCLUDE",legends:[{key:"yak-epidemic-village-boundary",name:"防疫村边界",fillColor:"#24F6C4",strokeColor:"#FFF06A",selectable:!1}]}}),ir=he(()=>d.value==="epidemic"?Hs.value:d.value==="trade"?null:Ur.value),rn=he(()=>d.value==="trade"?{scope:"trade-flow",title:`${oe.value||""}交易流向`,metricLabel:"流向",unit:"头",source:Ve(Le({},l),{total:ji("headCount")}),rows:Wt.value}:{scope:d.value==="epidemic"?"village":"town",hideTownNames:d.value==="epidemic",title:d.value==="forecast"?`${q.value.shortLabel}预测存栏`:d.value==="epidemic"?"村级防疫信息":"乡镇估算存栏",metricLabel:d.value==="forecast"?"预测":d.value==="epidemic"?"防疫":"存栏",unit:"万头",rows:d.value==="epidemic"?xn.value:$i.value.map(B=>({name:B.name,value:Number((B.value/1e4).toFixed(2)),unit:"万头"}))}),bv=he(()=>({color:a,tooltip:ui(B=>`${B.name}<br/>结构占比:${B.percent}%<br/>估算数量:${Ut(B.value)}头<br/>来源:无人机识别 + 专家共识模型`),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:Pu.map(B=>({name:B.name,value:B.count}))}]})),ur=he(()=>({color:a,tooltip:ui(B=>`${B.name}<br/>占比:${B.percent}%<br/>估算数量:${Ut(B.value)}头`),legend:{orient:"vertical",right:6,top:"middle",itemWidth:8,itemHeight:8,itemGap:6,formatter(B){const k=Pu.find(W=>W.name===B);return k?`${B} ${Jl(k.ratio)} ${cr(k.count)}头`:B},textStyle:{color:"rgba(222, 250, 255, 0.82)",fontSize:10,rich:{}}},graphic:{type:"text",left:"28%",top:"45%",style:{text:cr(Du),fill:"#ffffff",fontFamily:"D-DIN, Arial, sans-serif",fontSize:19,fontWeight:900,textAlign:"center"}},series:[{name:"结构明细",type:"pie",radius:["34%","66%"],center:["31%","54%"],avoidLabelOverlap:!0,label:{color:"#fff",fontSize:10,formatter:"{d}%"},labelLine:{length:8,length2:5,lineStyle:{color:"rgba(223, 250, 255, 0.35)"}},itemStyle:{borderColor:"rgba(3, 18, 31, 0.92)",borderWidth:3,shadowBlur:8,shadowColor:"rgba(0, 0, 0, 0.28)"},data:Pu.map(B=>({name:B.name,value:B.count}))}]})),ul=he(()=>({color:["#ffd76c","#30dcff"],tooltip:Ve(Le({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(B){const k=B.map(W=>`${W.marker}${W.seriesName}:${Ut(Math.abs(W.value))}头`);return`${B[0].name}<br/>${k.join("<br/>")}`}}),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:B=>cr(Math.abs(B))},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"category",data:q2.map(B=>B.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:q2.map(B=>-B.cow),itemStyle:{borderRadius:[7,0,0,7]}},{name:"公牛",type:"bar",stack:"gender",barWidth:12,data:q2.map(B=>B.bull),itemStyle:{borderRadius:[0,7,7,0]}}]})),oy=he(()=>{const B=nt.value,k=B.map(W=>W.count);return{color:a,tooltip:Ve(Le({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(W){const de=W.map(Te=>`${Te.marker}${Te.seriesName}:${Ut(Te.value)}头`);return`${W[0].name}<br/>${de.join("<br/>")}<br/>估算存栏:${Ut(k[W[0].dataIndex])}头<br/>结构依据:专家共识比例`}}),legend:{top:-2,right:0,itemWidth:8,itemHeight:6,itemGap:6,textStyle:{color:"rgba(222, 250, 255, 0.75)",fontSize:9}},grid:{left:54,right:30,top:22,bottom:8},xAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.56)",fontSize:10,formatter:cr},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"category",inverse:!0,data:B.map(W=>W.name),axisLabel:{color:"rgba(223, 250, 255, 0.82)",fontSize:B.length>8?9:10,interval:0},axisLine:{show:!1},axisTick:{show:!1}},series:Pu.map(W=>({name:W.name.replace("(≤1岁)","").replace("(1-2岁)",""),type:"bar",stack:"town",barWidth:B.length>8?6:11,data:B.map(de=>Math.round(de.count*W.ratio/100))}))}}),Ec=he(()=>py(nt.value,"count","头",{style:"ladder",tooltipFormatter(B){const k=nt.value[B.dataIndex];return`${k.name}<br/>估算存栏:${Ut(k.count)}头<br/>来源:无人机识别`}})),Sv=he(()=>{const B=$t.value,k=B.rows,W=Math.max(...k.map(de=>de.adultCow+de.calf),1);return{color:["#30dcff","#ffd76c"],animationDurationUpdate:700,animationEasingUpdate:"cubicOut",tooltip:Ve(Le({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(de){const Te=k[de[0].dataIndex],Je=de.filter(Gt=>["成年母牛","幼畜"].includes(Gt.seriesName)).map(Gt=>`${Gt.marker}${Gt.seriesName}:${Ut(Gt.value)}头`);return`${Te.name}<br/>母幼合计:${Ut(Te.adultCow+Te.calf)}头<br/>${Je.join("<br/>")}<br/>依据:无人机识别 + 专家共识模型`}}),legend:{data:["成年母牛","幼畜"],top:2,left:2,itemWidth:10,itemHeight:7,itemGap:9,textStyle:{color:"rgba(222, 250, 255, 0.78)",fontSize:10}},graphic:B.total>S1?{type:"text",right:4,top:3,silent:!0,style:{text:`${B.start+1}-${B.end} / ${B.total}`,fill:"rgba(222, 250, 255, 0.62)",fontSize:10,fontWeight:600}}:void 0,grid:{left:50,right:48,top:34,bottom:8,containLabel:!0},xAxis:{type:"value",max:Math.ceil(W*1.28),axisLabel:{show:!1},axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.08)",type:"dashed"}}},yAxis:{type:"category",inverse:!0,data:k.map(de=>de.name),axisLabel:{color:"rgba(223, 250, 255, 0.84)",fontSize:11,interval:0,margin:8},axisLine:{show:!1},axisTick:{show:!1}},series:[{name:"基础群规模",type:"bar",barWidth:12,barGap:"-100%",data:k.map(de=>de.adultCow+de.calf),tooltip:{show:!1},itemStyle:{borderRadius:7,color:"rgba(48, 220, 255, 0.07)"},silent:!0},{name:"成年母牛",type:"bar",stack:"foundation",barWidth:12,data:k.map(de=>de.adultCow),itemStyle:{borderRadius:[7,0,0,7],color:new Zr(0,0,1,0,[{offset:0,color:"rgba(48, 220, 255, 0.34)"},{offset:1,color:"#30dcff"}])}},{name:"幼畜",type:"bar",stack:"foundation",barWidth:12,data:k.map(de=>de.calf),itemStyle:{borderRadius:[0,7,7,0],color:new Zr(0,0,1,0,[{offset:0,color:"rgba(255, 215, 108, 0.2)"},{offset:1,color:"#ffd76c"}])},label:{show:!0,position:"right",formatter:({dataIndex:de})=>cr(k[de].adultCow+k[de].calf),color:"#ffffff",fontSize:10,fontWeight:700}}]}}),li=he(()=>{const B=UB.slice().sort((de,Te)=>Te.value-de.value),k=UB.reduce((de,Te)=>de+Te.value,0),W=B.map(de=>de.yoy||0);return{color:B.map(de=>de.color),tooltip:Ve(Le({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(de){const Te=B[de[0].dataIndex];return`${Te.label}<br/>数量:${Ut(Te.value)}头<br/>占比:${Jl(Te.value/k*100)}<br/>同比:${Te.yoy>0?"+":""}${Te.yoy}%`}}),grid:{left:36,right:30,top:20,bottom:34},xAxis:{type:"category",data:B.map(de=>de.label),axisLabel:{color:"rgba(223, 250, 255, 0.76)",fontSize:9,interval:0,margin:10},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.24)"}},axisTick:{show:!1}},yAxis:[{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.52)",fontSize:9,formatter:cr},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.09)",type:"dashed"}}},{type:"value",min:Math.min(-2,Math.floor(Math.min(...W)-1)),max:Math.max(8,Math.ceil(Math.max(...W)+1)),axisLabel:{color:"rgba(255, 215, 108, 0.68)",fontSize:9,formatter:"{value}%"},splitLine:{show:!1},axisLine:{show:!1},axisTick:{show:!1}}],series:[{name:"数量",type:"bar",barWidth:16,data:B.map((de,Te)=>({value:de.value,itemStyle:{borderRadius:[8,8,2,2],color:new Zr(0,0,0,1,[{offset:0,color:de.color},{offset:.72,color:`${de.color}cc`},{offset:1,color:`${de.color}18`}]),shadowBlur:Te===0?12:7,shadowColor:de.color},label:{show:!0,position:"top",color:Te===0?"#ffd76c":"#ffffff",fontSize:9,formatter:({value:Je})=>cr(Je)}}))},{name:"同比",type:"line",yAxisIndex:1,smooth:!0,symbol:"circle",symbolSize:6,data:W,lineStyle:{width:2,color:"#ffd76c"},itemStyle:{color:"#ffd76c",borderColor:"rgba(3, 18, 28, 0.9)",borderWidth:2},label:{show:!0,position:"top",color:"#ffd76c",fontSize:9,formatter:({value:de})=>`${de>0?"+":""}${de}%`}}]}}),cl=he(()=>{const B=mq(q.value);return{color:["#30dcff","#ffd76c","#ff8f6b"],tooltip:Ve(Le({},ui()),{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:B.labels,axisLabel:{color:"rgba(223, 250, 255, 0.62)",fontSize:10,interval:q.value.months>18?4:q.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:cr},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}}},{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.48)",fontSize:10,formatter:cr},splitLine:{show:!1}}],series:[hw("预测存栏",B.stock,"#30dcff",0,!0),hw("繁殖补充",B.births,"#ffd76c",1),hw("出栏扣减",B.outflow,"#ff8f6b",1)]}}),wv=he(()=>({color:["#30dcff","#ffd76c"],tooltip:Ve(Le({},ui()),{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:ke.value.map(B=>B.month||B.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:ke.value.map(B=>B.count||B.value),itemStyle:{borderRadius:[8,8,0,0],color:new Zr(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:ke.value.map(B=>B.speed||B.growthRate||0),lineStyle:{width:2.4,color:"#ffd76c"},itemStyle:{color:"#ffd76c"}}]})),la=he(()=>({tooltip:ui(),radar:{center:["50%","54%"],radius:"68%",splitNumber:4,indicator:Pb.map(B=>({name:B.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:Pb.map(B=>B.value),areaStyle:{color:"rgba(48, 220, 255, 0.22)"},lineStyle:{color:"#30dcff",width:2},itemStyle:{color:"#ffd76c"}}]}]})),Av=he(()=>py(Tt.value,"forecast","头")),iw=he(()=>py(wt.value,"ratio","%",{tooltipFormatter(B){const k=wt.value[B.dataIndex];return`${k.name}<br/>预测占比:${Jl(k.ratio)}<br/>预测数量:${Ut(k.count)}头`}})),ly=he(()=>({color:["#ffd76c","#ff8f6b","#7aa7ff"],tooltip:Ve(Le({},ui()),{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:za.map(B=>B.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:cr},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.1)",type:"dashed"}}},series:[{name:"繁殖补充",type:"bar",barWidth:12,data:za.map(B=>B.births),itemStyle:{borderRadius:[7,7,0,0]}},{name:"出栏流出",type:"bar",barWidth:12,data:za.map(B=>-B.outflow),itemStyle:{borderRadius:[0,0,7,7]}},{name:"稳态校正",type:"line",smooth:!0,symbolSize:6,data:za.map(B=>B.correction),lineStyle:{width:2.4}}]})),MX=he(()=>{const B=Tt.value,k=Math.max(...B.map(W=>Math.abs(W.change)),1);return B.map(W=>Ve(Le({},W),{width:Math.max(8,Math.round(Math.abs(W.change)/k*100))}))}),TX=he(()=>{const B=lt.value,k=B.map(de=>de.value),W=Math.max(...k,1);return{color:["#27f0c0","#ffd76c"],tooltip:Ve(Le({},ui()),{trigger:"axis",axisPointer:{type:"line",lineStyle:{color:"rgba(39, 240, 192, 0.34)"}},formatter(de){const Te=de[0];return`${Te.name}<br/>防疫记录:${Ut(Te.value)}条`}}),grid:{left:42,right:24,top:20,bottom:28},xAxis:{type:"category",data:B.map(de=>de.name),axisLabel:{color:"rgba(223, 250, 255, 0.62)",fontSize:9,interval:Math.max(Math.floor(B.length/7),0)},axisLine:{lineStyle:{color:"rgba(39, 240, 192, 0.22)"}},axisTick:{show:!1}},yAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:10,formatter:cr},splitLine:{lineStyle:{color:"rgba(39, 240, 192, 0.1)",type:"dashed"}}},series:[{name:"防疫记录",type:"bar",barMaxWidth:12,data:k,itemStyle:{borderRadius:[7,7,0,0],color:new Zr(0,0,0,1,[{offset:0,color:"#27f0c0"},{offset:1,color:"rgba(39, 240, 192, 0.08)"}])},label:{show:!0,position:"top",color:"rgba(230, 255, 249, 0.92)",fontSize:9,formatter:({value:de})=>de>=W*.42?cr(de):""}},{name:"作业趋势",type:"line",smooth:!0,showSymbol:!1,data:k,lineStyle:{width:2.4,color:"#ffd76c"}}]}}),CX=he(()=>{const B=Oe.value,k=zt.value,W=k?13:12,de=["#1bdffc","#267dff"],Te=["#fbc60d","#f89507"],Je=B.map(qt=>Number(qt.vaccinated||0)),Gt=B.map(qt=>Number(qt.unvaccinated||0)),kt=B.map((qt,Xn)=>Je[Xn]+Gt[Xn]),bn=Math.max(...kt,1),Pn=kt.map(qt=>qt>0?qt:0);return k?{color:[de[0],Te[0]],title:{text:`防疫总比例:{value|${Jl(_t.value)}}`,right:0,top:0,textStyle:{color:"#fff",fontSize:12,fontWeight:500,rich:{value:{color:"#22f1ff",borderColor:"#14bdf4",borderWidth:1,borderRadius:2,padding:[2,6,3,6],fontSize:12,fontWeight:700}}}},tooltip:Ve(Le({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(qt){const Xn=B[qt[0].dataIndex];return[`${Xn.name}`,`已防疫:${Ut(Xn.vaccinated)}头`,`未防疫:${Ut(Xn.unvaccinated)}头`,`乡镇比例:${Jl(Xn.ratio)}`].join("<br/>")}}),legend:[{data:["已防疫"],top:0,left:0,itemWidth:10,itemHeight:10,icon:"circle",textStyle:{color:"#fff",fontSize:11},selectedMode:!1},{data:["未防疫"],top:0,left:68,itemWidth:10,itemHeight:10,icon:"circle",textStyle:{color:"#fff",fontSize:11},selectedMode:!1}],grid:{left:36,right:8,top:34,bottom:50},xAxis:{type:"category",data:B.map(qt=>qt.name),axisLabel:{color:"#fff",fontSize:10,interval:0,formatter:k3},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1}},yAxis:{type:"value",name:"数量/头",max:Math.ceil(bn*1.16),nameTextStyle:{color:"rgba(223, 250, 255, 0.62)",fontSize:10,align:"left"},axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:9,formatter:cr},axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"rgba(51, 89, 113, 0.16)",type:"dashed"}}},series:[{name:"已防疫",type:"bar",stack:"epidemic",barWidth:W,barMinHeight:2,data:Je,itemStyle:{color:new Zr(0,0,0,1,[{offset:0,color:de[0]},{offset:1,color:de[1]}])}},{name:"未防疫",type:"bar",stack:"epidemic",barWidth:W,barMinHeight:2,data:Gt,itemStyle:{color:new Zr(0,0,0,1,[{offset:0,color:Te[0]},{offset:1,color:Te[1]}])}},{name:"顶部",type:"pictorialBar",symbolSize:[W,6],symbolOffset:[0,-3],symbolPosition:"end",z:8,tooltip:{show:!1},data:Pn,itemStyle:{color:"rgba(251, 198, 13, 0.55)"}},{name:"底部",type:"pictorialBar",symbolSize:[W,6],symbolOffset:[0,3],z:9,tooltip:{show:!1},data:Je,itemStyle:{color:de[1]}},{name:"分界",type:"pictorialBar",symbolSize:[W,6],symbolOffset:[0,-3],symbolPosition:"end",z:10,tooltip:{show:!1},data:Je,itemStyle:{color:Te[0]}}]}:{color:["#27f0c0"],title:{text:"台账记录",right:0,top:0,textStyle:{color:"rgba(231, 251, 255, 0.84)",fontSize:12,fontWeight:500}},tooltip:Ve(Le({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(qt){const Xn=B[qt[0].dataIndex];return`${Xn.name}<br/>防疫记录:${Ut(Xn.vaccinated)}条<br/>记录占比:${Jl(Xn.ratio)}`}}),grid:{left:35,right:16,top:30,bottom:48},xAxis:{type:"category",data:B.map(qt=>qt.name),axisLabel:{color:"#fff",fontSize:10,interval:0,formatter:k3},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"value",name:"记录/条",nameTextStyle:{color:"rgba(223, 250, 255, 0.62)",fontSize:10,align:"left"},axisLabel:{color:"rgba(223, 250, 255, 0.58)",fontSize:9,formatter:cr},splitLine:{lineStyle:{color:"rgba(39, 240, 192, 0.08)",type:"dashed"}}},series:[{name:"防疫记录",type:"bar",barWidth:W,data:Je,itemStyle:{borderRadius:[7,7,0,0],color:new Zr(0,0,0,1,[{offset:0,color:"#27f0c0"},{offset:1,color:"rgba(39, 240, 192, 0.08)"}])}}]}}),EX=he(()=>{const B=We.value;return{tooltip:Ve(Le({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(k){const W=B[k[0].dataIndex];return`${W.name}<br/>防疫记录:${Ut(W.value)}条`}}),grid:{left:74,right:42,top:12,bottom:8},xAxis:{type:"value",axisLabel:{color:"rgba(223, 250, 255, 0.52)",fontSize:9,formatter:cr},axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"rgba(39, 240, 192, 0.08)",type:"dashed"}}},yAxis:{type:"category",inverse:!0,data:B.map(k=>k.name),axisLabel:{color:"rgba(223, 250, 255, 0.82)",fontSize:10,interval:0},axisLine:{show:!1},axisTick:{show:!1}},series:[{name:"记录",type:"bar",barWidth:9,data:B.map((k,W)=>({value:k.value,itemStyle:{borderRadius:[0,8,8,0],color:new Zr(0,0,1,0,[{offset:0,color:"rgba(48, 220, 255, 0.12)"},{offset:.62,color:["#27f0c0","#30dcff","#ffd76c"][W%3]},{offset:1,color:"#ffffff"}])}})),label:{show:!0,position:"right",color:"#eaffff",fontSize:9,formatter:({value:k})=>cr(k)}},{type:"scatter",symbolSize:7,data:B.map(k=>k.value),itemStyle:{color:"#ffd76c",shadowBlur:8,shadowColor:"#ffd76c"}}]}}),PX=he(()=>{const B=ay.value;return{color:["#30dcff","#ffd76c"],tooltip:Ve(Le({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(k){const W=k.find(Te=>Te.seriesName==="流通头数"),de=k.find(Te=>Te.seriesName==="出证记录");return`${(W==null?void 0:W.axisValue)||""}<br/>流通头数:${Ut((W==null?void 0:W.value)||0)}头<br/>出证记录:${Ut((de==null?void 0:de.value)||0)}条`}}),legend:{top:4,right:10,itemWidth:12,itemHeight:8,textStyle:{color:"rgba(255, 255, 255, 0.88)",fontSize:10}},grid:{left:42,right:38,top:34,bottom:28},xAxis:{type:"category",data:B.map(k=>k.name),axisLabel:{color:"rgba(255, 255, 255, 0.8)",fontSize:9,interval:1},axisLine:{lineStyle:{color:"rgba(48, 220, 255, 0.24)"}},axisTick:{show:!1}},yAxis:[{type:"value",axisLabel:{color:"rgba(255, 255, 255, 0.76)",fontSize:9,formatter:cr},splitLine:{lineStyle:{color:"rgba(48, 220, 255, 0.09)",type:"dashed"}}},{type:"value",axisLabel:{color:"rgba(255, 255, 255, 0.74)",fontSize:9,formatter:cr},splitLine:{show:!1}}],series:[{name:"流通头数",type:"bar",barMaxWidth:13,data:B.map(k=>k.headCount),itemStyle:{borderRadius:[7,7,0,0],color:new Zr(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:B.map(k=>k.recordCount),lineStyle:{width:2.2,color:"#ffd76c"},itemStyle:{color:"#ffd76c",borderColor:"rgba(3, 18, 28, 0.9)",borderWidth:2}}]}}),LX=he(()=>py(_v.value.slice(0,10),"headCount","头",{colors:o,style:"ladder",axisTextColor:"rgba(255, 255, 255, 0.88)",dimAxisTextColor:"rgba(255, 255, 255, 0.74)",tooltipFormatter(B){const k=_v.value[B.dataIndex];return`${k.name}<br/>流通头数:${Ut(k.headCount)}头<br/>出证记录:${Ut(k.recordCount)}条`}})),RX=he(()=>{const B=sy.value;return{color:o,tooltip:ui(k=>{const W=B.find(de=>de.name===k.name);return`${k.name}<br/>占比:${k.percent}%<br/>流通头数:${Ut(k.value)}头<br/>出证记录:${Ut((W==null?void 0:W.recordCount)||0)}条`}),legend:{orient:"vertical",right:4,top:"middle",itemWidth:8,itemHeight:8,itemGap:6,textStyle:{color:"rgba(255, 255, 255, 0.88)",fontSize:10},formatter(k){const W=B.find(de=>de.name===k);return W?`${k} ${cr(W.headCount)}头`:k}},series:[{name:"用途结构",type:"pie",radius:["38%","64%"],center:["32%","54%"],startAngle:110,label:{color:"#fff",fontSize:10,formatter:({percent:k})=>k>=3?`${k}%`:""},labelLine:{length:8,length2:5,lineStyle:{color:"rgba(223, 250, 255, 0.36)"}},itemStyle:{borderColor:"rgba(3, 18, 31, 0.92)",borderWidth:3},data:B.map(k=>({name:k.name,value:k.headCount}))}]}}),DX=he(()=>{const B=[{name:"省外A证",value:ji("outProvinceHeads","aCertHeads")},{name:"省内B证",value:ji("inProvinceHeads","bCertHeads")}];return{color:["#ffd76c","#30dcff"],tooltip:ui(k=>`${k.name}<br/>流通头数:${Ut(k.value)}头<br/>占比:${k.percent}%`),series:[{type:"pie",radius:["48%","72%"],center:["50%","52%"],label:{show:!1},labelLine:{show:!1},itemStyle:{borderColor:"rgba(3, 18, 31, 0.92)",borderWidth:3},data:B}]}});Ia(()=>{iY(),QX(),nY(),z3(),aw(),sw()}),ns(()=>{var B,k;G=!0,E3(),P3(),(k=(B=ee.value)==null?void 0:B.destroyMap)==null||k.call(B)}),ei([d,q,nt,me,vt,oe,Cc],()=>{aY()},{immediate:!0}),ei(d,()=>{aw(),sw()}),ei($t,B=>{g.value>=B.pageCount&&(g.value=0),sw()});function IX(B){p.value=B,aw()}function aw(){E3(),!(d.value!=="forecast"||G)&&(K=window.setInterval(NX,TBe))}function NX(){const B=za.findIndex(W=>W.key===p.value),k=B>=0?(B+1)%za.length:0;p.value=za[k].key}function E3(){K&&(window.clearInterval(K),K=null)}function sw(){P3(),!(d.value!=="structure"||G||$t.value.pageCount<=1)&&(ge=window.setInterval(kX,CBe))}function kX(){const B=$t.value.pageCount;B<=1||(g.value=(g.value+1)%B)}function P3(){ge&&(window.clearInterval(ge),ge=null)}function OX(B=[],k=[]){const W=new Map;return k.forEach(de=>{const Te=L3(de.name);Te&&W.set(Te,Ve(Le({},de),{name:Te,count:Number(de.count||0)}))}),B.forEach(de=>{const Te=L3(de.name);if(!Te)return;const Je=W.get(Te)||{};W.set(Te,Ve(Le(Le({},Je),de),{name:Te,count:Number.isFinite(Number(de.count))?Number(de.count):Number(Je.count||0)}))}),[...W.values()].sort((de,Te)=>Number(Te.count||0)-Number(de.count||0))}function L3(B){return kE(B||"").replace("色地镇","色地乡").replace("瓦切镇","瓦切乡").replace("安曲镇","安曲乡").replace("龙日镇","龙日乡")}function Mv(B){return String(B||"").trim().replace("色地乡","色地镇").replace("瓦切乡","瓦切镇").replace("安曲乡","安曲镇").replace("龙日乡","龙日镇")}function Tv(B=[]){return Array.isArray(B)?B.map((k,W)=>{var de,Te,Je;return{key:k.key||k.id||`${k.name||k.label||"item"}-${W}`,name:String(k.name||k.label||k.town||k.village||"未填写"),value:Number((Je=(Te=(de=k.value)!=null?de:k.count)!=null?Te:k.total)!=null?Je:0)}}).filter(k=>k.name&&Number.isFinite(k.value)):[]}function R3(...B){const k=B.flatMap(W=>Array.isArray(W)?W:[W]).map(W=>{var de,Te,Je;return W&&typeof W=="object"?(Je=(Te=(de=W.year)!=null?de:W.value)!=null?Te:W.latestYear)!=null?Je:W.latest_year:W}).map(Number).filter(W=>Number.isFinite(W)&&W>0);return[...new Set(k)].sort((W,de)=>W-de)}function uy(B=[],k="name"){return Array.isArray(B)?B.map((W,de)=>{var Te,Je,Gt,kt,bn,Pn,qt,Xn,qi,Sr,Xi,Ev,Pv,Lv,Rv,Dv,Iv;return{key:W.key||W.id||`${W[k]||W.name||W.label||"trade"}-${de}`,name:String(W[k]||W.name||W.label||W.town||"未填写"),recordCount:Number((Gt=(Je=(Te=W.recordCount)!=null?Te:W.record_count)!=null?Je:W.count)!=null?Gt:0),headCount:Number((qt=(Pn=(bn=(kt=W.headCount)!=null?kt:W.head_count)!=null?bn:W.amount)!=null?Pn:W.value)!=null?qt:0),lng:is((Ev=(Xi=(Sr=(qi=(Xn=W.lng)!=null?Xn:W.longitude)!=null?qi:W.destLng)!=null?Sr:W.dest_lng)!=null?Xi:W.destLongitude)!=null?Ev:W.dest_longitude),lat:is((Iv=(Dv=(Rv=(Lv=(Pv=W.lat)!=null?Pv:W.latitude)!=null?Lv:W.destLat)!=null?Rv:W.dest_lat)!=null?Dv:W.destLatitude)!=null?Iv:W.dest_latitude)}}).filter(W=>W.name&&Number.isFinite(W.headCount)):[]}function cy(B=""){return String(B).replace(/省|市|自治区|壮族|回族|维吾尔|特别行政区/g,"").replace(/\s+/g,"").trim()}function FX(B){const k=cy(B);return Object.keys(c).sort((W,de)=>de.length-W.length).find(W=>k.includes(cy(W)))}function D3(B){const k=cy(B);return Object.keys(u).sort((W,de)=>de.length-W.length).find(W=>k.includes(cy(W)))}function BX(B){return["广汉","向阳","汉州","崇州","怀远","德阳","成都","阿坝","邛溪","红原"].includes(B)?"四川":["互助","湟中","湟源","西宁","海东"].includes(B)?"青海":["民乐","张掖"].includes(B)?"甘肃":["西安"].includes(B)?"陕西":["昆明"].includes(B)?"云南":["拉萨"].includes(B)?"西藏":["乌鲁木齐"].includes(B)?"新疆":["广州"].includes(B)?"广东":u[B]?B:""}function hy(B,k=0){return{新疆:"right",西藏:"right",青海:"top",甘肃:"top",四川:"bottom",重庆:"bottom-right",广东:"top-left",上海:"left",北京:"left"}[B]||["right","top","left","bottom"][k%4]}function GX(B,k=0){const W=is(B==null?void 0:B.lng),de=is(B==null?void 0:B.lat);if(Number.isFinite(W)&&Number.isFinite(de)){const Pn=D3(B==null?void 0:B.name);return{lng:W,lat:de,labelSide:hy(Pn,k),province:Pn||"接口坐标",level:"api"}}const Te=typeof B=="string"?B:B==null?void 0:B.name,Je=String(Te||""),Gt=FX(Je);if(Gt){const Pn=BX(Gt);return Ve(Le({},c[Gt]),{labelSide:hy(Pn||Gt,k),province:Pn||Gt})}const kt=D3(Je);if(kt)return Ve(Le({},u[kt]),{labelSide:hy(kt,k),province:kt});const bn=h[k%h.length];return Ve(Le({},bn),{labelSide:hy("",k),province:"全国流向"})}function zX(B=[]){return Array.isArray(B)?B.map(k=>{var W,de,Te,Je,Gt,kt;return{year:Number(k.year),recordCount:Number((de=(W=k.recordCount)!=null?W:k.record_count)!=null?de:0),headCount:Number((kt=(Gt=(Je=(Te=k.headCount)!=null?Te:k.head_count)!=null?Je:k.amount)!=null?Gt:k.value)!=null?kt:0)}}).filter(k=>Number.isFinite(k.year)&&Number.isFinite(k.headCount)):[]}function ow(B=[]){return Array.isArray(B)?lw(B.map(k=>{var W,de,Te;return k&&typeof k=="object"?(Te=(de=(W=k.value)!=null?W:k.label)!=null?de:k.name)!=null?Te:"":k})):[]}function UX(B=[]){return Array.isArray(B)?B.map(k=>{var W,de,Te,Je,Gt,kt;if(k&&typeof k=="object"){const bn=(Te=(de=(W=k.value)!=null?W:k.name)!=null?de:k.label)!=null?Te:"",Pn=(kt=(Gt=(Je=k.label)!=null?Je:k.name)!=null?Gt:k.value)!=null?kt:bn;return bn?{value:String(bn),label:String(Pn||bn)}:null}return k?{value:String(k),label:String(k)}:null}).filter(Boolean):[]}function lw(B=[]){return[...new Set(B.map(k=>String(k||"").trim()).filter(Boolean))]}function VX(B=[]){if(!Array.isArray(B))return[];const k=new Map;return B.forEach((W,de)=>{var bn,Pn,qt,Xn,qi,Sr;const Te=Mv(W.name||W.areaName||W.area_name||W.town||W.label||"");if(!Te)return;const Je=is((qt=(Pn=(bn=W.value)!=null?bn:W.number)!=null?Pn:W.count)!=null?qt:W.total);if(!Number.isFinite(Je))return;const Gt=WX((Sr=(qi=(Xn=W.type)!=null?Xn:W.status)!=null?qi:W.epidemicType)!=null?Sr:W.epidemic_type),kt=k.get(Te)||{key:W.areaCode||W.area_code||`${Te}-${de}`,name:Te,vaccinated:0,unvaccinated:0,total:0,source:"stats"};Gt==="N"?kt.unvaccinated+=Je:kt.vaccinated+=Je,kt.total=kt.vaccinated+kt.unvaccinated,kt.ratio=kt.total?kt.vaccinated/kt.total*100:0,k.set(Te,kt)}),[...k.values()].sort((W,de)=>Number(de.total||0)-Number(W.total||0))}function HX(B={}){var Te,Je,Gt,kt,bn,Pn,qt,Xn;const k=Array.isArray(B)?{rows:B}:B||{},W=k.result||{};return{rows:k.rows||k.data||k.list||k.records||[],percentage:(Pn=(bn=(kt=(Gt=(Je=(Te=k.percentage)!=null?Te:k.percent)!=null?Je:k.rate)!=null?Gt:W.percentage)!=null?kt:W.percent)!=null?bn:W.rate)!=null?Pn:null,year:(Xn=(qt=k.year)!=null?qt:W.year)!=null?Xn:null}}function I3(B=[]){return Array.isArray(B)?B.map((k,W)=>{var Xn,qi,Sr,Xi,Ev,Pv,Lv,Rv,Dv,Iv,eD,tD;const de=Mv(k.town||k.townName||k.town_name||""),Te=String(k.village||k.villageName||k.village_name||k.name||"").trim(),Je=is((Sr=(qi=(Xn=k.recordCount)!=null?Xn:k.record_count)!=null?qi:k.records)!=null?Sr:k.total),Gt=is((Lv=(Pv=(Ev=(Xi=k.earTagCount)!=null?Xi:k.ear_tag_count)!=null?Ev:k.headCount)!=null?Pv:k.head_count)!=null?Lv:k.value),kt=is((Dv=(Rv=k.imageCount)!=null?Rv:k.image_count)!=null?Dv:k.images),bn=is((Iv=k.imageRate)!=null?Iv:k.image_rate),Pn=is((eD=k.lng)!=null?eD:k.longitude),qt=is((tD=k.lat)!=null?tD:k.latitude);return{key:k.key||k.id||`${de}-${Te}-${W}`,town:de,village:Te,recordCount:Number.isFinite(Je)?Je:0,earTagCount:Number.isFinite(Gt)?Gt:0,imageCount:Number.isFinite(kt)?kt:0,imageRate:Number.isFinite(bn)?bn:0,lng:Pn,lat:qt}}).filter(k=>k.town&&k.village&&Number.isFinite(k.earTagCount)).sort((k,W)=>Number(W.earTagCount||0)-Number(k.earTagCount||0)):[]}function WX(B){if(B===!1||B===0||B==="0")return"N";const k=String(B!=null?B:"").trim().toLowerCase();return["n","no","false","未防疫","未免疫"].includes(k)?"N":"Y"}function is(B){if(B==null||B==="")return NaN;const k=Number(String(B).replace(/,/g,"").replace(/%/g,""));return Number.isFinite(k)?k:NaN}function N3(B){return String(B||"").replace(/'/g,"''").replace(/%/g,"\\%").replace(/_/g,"\\_")}function $X(B,k){const W=Mv(B),de=String(k||"").trim();if(!W||!de)return"";const Te=`${W}${de}`,Je=N3(Te),Gt=N3(de);return`(full_name LIKE '%${Je}%' OR name = '${Je}' OR name = '${Gt}')`}function k3(B){return String(B||"").split("").join(`
`)}function jX(B,k){return O3(B.name)-O3(k.name)}function O3(B){const k=String(B||"").match(/(\d{1,2})\D+(\d{1,2})/);return k?Number(k[1])*100+Number(k[2]):Number.MAX_SAFE_INTEGER}function F3(B=[]){return Array.isArray(B)?B.map(B3).filter(Boolean):[]}function B3(B){return B?{epidemicId:B.epidemicId||B.epidemic_id||B.id||"",earTag:B.earTag||B.ear_tag||"",owner:B.owner||"",idType:B.idType||B.id_type||"",idNo:B.idNo||B.id_no||"",phone:B.phone||"",town:B.town||"",village:B.village||"",location:B.location||"",livestockType:B.livestockType||B.livestock_type||"",age:B.age||"",sex:B.sex||"",weight:B.weight||B.weightKg||B.weight_kg||"",preventionType:B.preventionType||B.prevention_type||"",method:B.method||"",medicine:B.medicine||"",dose:B.dose||"",operator:B.operator||"",operateTime:B.operateTime||B.operate_time||"",imagePaths:B.imagePaths||B.image_paths||""}:null}function G3(B=[]){return Array.isArray(B)?B.map(qX).filter(Boolean):[]}function qX(B){var k,W,de,Te;return B?{certId:B.certId||B.cert_id||B.id||"",certType:B.certType||B.cert_type||"",certScopeName:B.certScopeName||B.cert_scope_name||"",factoryCode:B.factoryCode||B.factory_code||"",ownerName:B.ownerName||B.owner_name||"",ownerPhone:B.ownerPhone||B.owner_phone||"",transportNumber:B.transportNumber||B.transport_number||"",amount:Number((Te=(de=(W=(k=B.amount)!=null?k:B.headCount)!=null?W:B.head_count)!=null?de:B.value)!=null?Te:0),unitName:B.unitName||B.unit_name||"头",animalTypeName:B.animalTypeName||B.animal_type_name||"",usageTypeName:B.usageTypeName||B.usage_type_name||"",startTown:B.startTown||B.start_town||"",startRegionFullName:B.startRegionFullName||B.start_region_full_name||"",destProvince:B.destProvince||B.dest_province||"",destRegionFullName:B.destRegionFullName||B.dest_region_full_name||"",quarantineOfficerName:B.quarantineOfficerName||B.quarantine_officer_name||"",issueTime:B.issueTime||B.issue_time||"",statusName:B.statusName||B.status_name||""}:null}function Cv(B,k){for(const W of k){const de=Number(B==null?void 0:B[W]);if(Number.isFinite(de))return de}return 0}function ji(...B){return Cv(Cc.value,B)}function uw(B={}){return String(B.imagePaths||"").split(";").map(k=>k.trim()).filter(Boolean)}function XX(B){const W=String(B||"").replace(/^images\//,"").split("/").map(encodeURIComponent).join("/");return`${MBe}/${W}`}function vn(B){return B==null||B===""?"-":B}function If(B){return B?String(B).slice(0,10):"-"}function YX(B={}){return[B.town,B.village].filter(Boolean).join("/")||"-"}function KX(B){const k=String(B||"").trim();return k?k.length<7?k:`${k.slice(0,3)}****${k.slice(-4)}`:"-"}function ZX(B={}){return B.certScopeName||B.certType||"-"}function QX(){return $e(this,null,function*(){var W,de;const[B,k]=yield Promise.allSettled([B8e(),G8e()]);B.status==="fulfilled"&&((W=B.value)!=null&&W.length)&&(v.value=J3e(B.value.map(Te=>({name:kE(Te.name),count:Number(Te.value)})).filter(Te=>Te.name&&Number.isFinite(Te.count)))),k.status==="fulfilled"&&((de=k.value)!=null&&de.length)&&(m.value=k.value.map(Te=>({month:Te.name,count:Number(Te.value),speed:uY(Te.extra)})).filter(Te=>Te.month&&Number.isFinite(Te.count)))})}function z3(){return $e(this,arguments,function*(B=oe.value){var k,W,de,Te,Je,Gt;X.value=!0,re.value="";try{(W=(k=H.value)==null?void 0:k.years)!=null&&W.length||(H.value=yield I8e());const kt=R3((de=H.value)==null?void 0:de.years),bn=Number(((Te=H.value)==null?void 0:Te.latestYear)||((Je=H.value)==null?void 0:Je.latest_year)||kt[kt.length-1]),Pn=Number(B||oe.value||bn||kt[kt.length-1]);oe.value=Pn;let qt=yield xG({year:Pn});const Xn=(Gt=qt==null?void 0:qt.hasData)!=null?Gt:qt==null?void 0:qt.has_data,qi=Number((qt==null?void 0:qt.latestYear)||(qt==null?void 0:qt.latest_year)||bn);Xn===!1&&qi&&qi!==Pn&&(oe.value=qi,qt=yield xG({year:qi})),U.value=qt||{metrics:{},hasData:!1},yield cw(1)}catch(kt){re.value="交易数据接口异常",U.value={metrics:{},hasData:!1},$.value=[],Y.value=0}finally{X.value=!1}})}function cw(){return $e(this,arguments,function*(B=_e.value){var W,de;if(!oe.value)return;const k={year:oe.value,page:B,pageSize:eT,keyword:Ce.value};try{const Te=yield bG(k);$.value=G3(Te.rows),Y.value=Number(((W=Te.page)==null?void 0:W.totalCount)||Te.totalCount||$.value.length||0),_e.value=Number(((de=Te.page)==null?void 0:de.page)||B||1)}catch(Te){re.value=re.value||"交易台账接口异常",$.value=[],Y.value=0}})}function JX(B){const k=Number(B);!Number.isFinite(k)||k===Number(oe.value)||(oe.value=k,_e.value=1,Fe.value="",Ce.value="",z3(k))}function U3(){Ce.value=Fe.value.trim(),cw(1)}function V3(B){const k=Math.min(Math.max(Number(B)||1,1),Se.value);cw(k)}function eY(B=null){Ae.value=!0,B&&(we.value=B),fy(1,B)}function H3(){Ae.value=!1}function W3(){fy(1)}function tY(){V.value={keyword:"",startTown:"",usageType:"",certType:""},fy(1)}function $3(B){const k=Math.min(Math.max(Number(B)||1,1),Re.value);fy(k)}function fy(){return $e(this,arguments,function*(B=j.value,k=null){var Te,Je;if(!oe.value)return;xe.value=!0,pe.value="";const W=V.value,de={year:oe.value,page:B,pageSize:AG,keyword:W.keyword.trim(),startTown:W.startTown,usageType:W.usageType,certType:W.certType};try{const Gt=yield bG(de);ze.value=G3(Gt.rows),fe.value=Number(((Te=Gt.page)==null?void 0:Te.totalCount)||Gt.totalCount||ze.value.length||0),j.value=Number(((Je=Gt.page)==null?void 0:Je.page)||B||1);const kt=k?k.certId||k.factoryCode:"",bn=kt?ze.value.find(Pn=>(Pn.certId||Pn.factoryCode)===kt)||k:ze.value[0]||null;j3(bn)}catch(Gt){pe.value="交易台账接口异常",ze.value=[],fe.value=0,we.value=null}finally{xe.value=!1}})}function j3(B){we.value=B||null}function q3(B){var k,W;B!=null&&B.startTown&&(d.value="trade",(W=(k=ee.value)==null?void 0:k.focusTown)==null||W.call(k,Mv(B.startTown),{distanceScale:.78,duration:.8}))}function nY(){return $e(this,null,function*(){var Te;w.value=!0,T.value="";const[B,k,W,de]=yield Promise.allSettled([N8e(),SG({page:1,pageSize:8}),k8e(),O8e()]);if(B.status==="fulfilled"?y.value=B.value||{metrics:{}}:(T.value="防疫统计接口异常",y.value={metrics:{}}),k.status==="fulfilled"){const Je=k.value||{};b.value=F3(Je.rows),S.value=Number(((Te=Je.page)==null?void 0:Te.totalCount)||Je.totalCount||b.value.length||0)}else T.value=T.value||"防疫台账接口异常",b.value=[],S.value=0;W.status==="fulfilled"?_.value=HX(W.value):_.value={rows:[],percentage:null,year:null},de.status==="fulfilled"?x.value=de.value||{rows:[]}:x.value={rows:[]},w.value=!1})}function X3(B=null){C.value=!0,B&&(R.value=B,N.value=null),dy(1,B)}function Y3(){C.value=!1}function K3(){dy(1)}function rY(){O.value={keyword:"",town:"",medicine:"",startDate:"",endDate:""},dy(1)}function Z3(B){dy(B)}function dy(){return $e(this,arguments,function*(B=P.value,k=null){var de,Te;D.value=!0,L.value="";const W=Ve(Le({},O.value),{page:B,pageSize:wG});try{const Je=yield SG(W);A.value=F3(Je.rows),M.value=Number(((de=Je.page)==null?void 0:de.totalCount)||Je.totalCount||A.value.length||0),P.value=Number(((Te=Je.page)==null?void 0:Te.page)||B||1);const Gt=k||A.value[0]||null;Gt?Q3(Gt):(R.value=null,N.value=null)}catch(Je){L.value="台账接口异常",A.value=[],M.value=0}finally{D.value=!1}})}function Q3(B){return $e(this,null,function*(){if(R.value=B,N.value=null,!(B!=null&&B.earTag)&&!(B!=null&&B.epidemicId))return;const k=++Ee;F.value=!0;try{const W=yield F8e(B.earTag||B.epidemicId);k===Ee&&(N.value=B3(W)||B)}catch(W){k===Ee&&(N.value=B)}finally{k===Ee&&(F.value=!1)}})}function iY(){var k;I=new pv({includeChinaMap:!0});const B=(W=0)=>$e(this,null,function*(){var Te,Je;if(G)return;yield Ya();const de=ee.value;if((Te=de==null?void 0:de.loadMap)==null||Te.call(de,I),de!=null&&de.canvasMap){ae.value=!0,(Je=de.play)==null||Je.call(de);return}W<24&&window.setTimeout(()=>B(W+1),120)});(k=I.ready)==null||k.then(B).catch(()=>{ae.value=!0})}function aY(){if(d.value==="epidemic"){t("module-stats",{moduleKey:"yak-management",items:[{zh:"防疫记录",value:vt.value,unit:"条"},{zh:"完成耳标",value:me.value,unit:"头"},{zh:"防疫完成率",value:Number(Q.value.toFixed(1)),unit:"%"},{zh:"涉及村数",value:je.value,unit:"个"}]});return}if(d.value==="forecast"){const B=q.value.stock-Du;t("module-stats",{moduleKey:"yak-management",items:[{zh:"预测期末存栏",value:q.value.stock,unit:"头"},{zh:"繁殖补充",value:q.value.births,unit:"头"},{zh:"出栏流出",value:q.value.outflow,unit:"头"},{zh:"预测净变化",value:B,unit:"头"}]});return}if(d.value==="trade"){t("module-stats",{moduleKey:"yak-management",items:[{zh:"流通总量",value:ji("headCount"),unit:"头"},{zh:"出证记录",value:ji("recordCount"),unit:"条"},{zh:"交易销售",value:ji("saleHeadCount"),unit:"头"},{zh:"运输车辆",value:ji("vehicleCount"),unit:"辆"}]});return}t("module-stats",{moduleKey:"yak-management",items:[{zh:"无人机识别总数",value:b0,unit:"头"},{zh:"专家共识模型修正",value:le.value,unit:"头"},{zh:"当前存栏预估数量",value:Du,unit:"头"}]})}function py(B,k,W,de={}){const Te=de.labelKey||"name",Je=de.colors||a,Gt=Math.max(...B.map(Sr=>Number(Sr[k]||0)),1),kt=B.length>8,bn=de.style==="ladder",Pn=kt?bn?7:6:B.length>6?11:13,qt=["#30dcff","#27f0c0","#ffd76c","#7aa7ff","#ff8f6b","#a6f06d"],Xn=de.axisTextColor||"rgba(223, 250, 255, 0.82)",qi=de.dimAxisTextColor||"rgba(223, 250, 255, 0.56)";return{tooltip:Ve(Le({},ui()),{trigger:"axis",axisPointer:{type:"shadow"},formatter(Sr){if(de.tooltipFormatter)return de.tooltipFormatter(Sr[0]);const Xi=B[Sr[0].dataIndex];return`${Xi[Te]}<br/>数值:${Ut(Xi[k])}${W}`}}),grid:{left:kt?58:74,right:kt?50:54,top:kt?3:14,bottom:kt?5:14},xAxis:{type:"value",axisLabel:{color:qi,fontSize:10,formatter:W==="%"?"{value}%":cr},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1}},yAxis:{type:"category",inverse:!0,data:B.map(Sr=>Sr[Te]),axisLabel:{color:Xn,fontSize:kt?9:11,interval:0},axisLine:{show:!1},axisTick:{show:!1}},series:[{type:"bar",barWidth:Pn,barGap:"-100%",data:B.map((Sr,Xi)=>({value:Sr[k],itemStyle:{borderRadius:bn?[1,10,10,1]:[0,7,7,0],color:sY(bn?qt[Xi%qt.length]:Je[Xi%Je.length],bn),shadowBlur:bn?10:0,shadowColor:bn?Je[Xi%Je.length]:"transparent"}})),showBackground:!0,backgroundStyle:{color:bn?"rgba(48, 220, 255, 0.035)":"rgba(48, 220, 255, 0.055)",borderRadius:bn?[1,10,10,1]:[0,7,7,0]},label:{show:!0,position:"right",color:"#ffffff",fontSize:kt?9:10,formatter:({value:Sr})=>`${W==="%"?Jl(Sr):cr(Sr)}`},markLine:de.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(Gt*.72)}]}},...bn?[{type:"pictorialBar",symbol:"rect",symbolSize:[2,Pn+5],symbolOffset:[0,0],symbolPosition:"end",z:4,data:B.map((Sr,Xi)=>({value:Sr[k],itemStyle:{color:"#ffffff",opacity:Xi<3?.82:.5,shadowBlur:8,shadowColor:qt[Xi%qt.length]}}))}]:[]]}}function sY(B,k=!1){return new Zr(0,0,1,0,[{offset:0,color:k?`${B}22`:"rgba(48, 220, 255, 0.12)"},{offset:.64,color:k?B:`${B}cc`},{offset:1,color:B}])}function hw(B,k,W,de=0,Te=!1){return{name:B,type:"line",yAxisIndex:de,smooth:!0,symbolSize:5,data:k,lineStyle:{width:2.5,color:W},itemStyle:{color:W},areaStyle:Te?{color:new Zr(0,0,0,1,[{offset:0,color:`${W}44`},{offset:1,color:`${W}05`}])}:void 0}}function oY(B,k){const W=new Map;return B.forEach(de=>{const Te=lY(de.name);if(!Te)return;const Je=W.get(Te)||{name:Te,value:0};Je.value+=Number(de[k]||0),W.set(Te,Je)}),[...W.values()].sort((de,Te)=>Te.value-de.value)}function lY(B){return{色地乡:"色地镇",瓦切乡:"瓦切镇",安曲乡:"安曲镇",龙日乡:"龙日镇",色地镇:"色地镇",瓦切镇:"瓦切镇",安曲镇:"安曲镇",龙日镇:"龙日镇",邛溪镇:"邛溪镇",刷经寺镇:"刷经寺镇",阿木乡:"阿木乡",查尔玛乡:"查尔玛乡",江茸乡:"江茸乡",麦洼乡:"麦洼乡",壤口乡:"壤口乡"}[B]||""}function ui(B){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:B}}function uY(B){const k=String(B||"").match(/-?\d+(?:\.\d+)?/);return k?Number(k[0]):0}function Ut(B){const k=Number(B);return Number.isFinite(k)?k.toLocaleString("zh-CN",{maximumFractionDigits:Number.isInteger(k)?0:2}):"--"}function cr(B){const k=Number(B);return Number.isFinite(k)?Math.abs(k)>=1e4?`${(k/1e4).toFixed(Math.abs(k)>=1e5?0:1)}万`:Math.round(k).toLocaleString("zh-CN"):"--"}function J3(B,k=2){const W=Number(B);return Number.isFinite(W)?`${(W/1e4).toFixed(k)}万`:"--"}function Jl(B){const k=Number(B);return Number.isFinite(k)?`${Number.isInteger(k)?k:k.toFixed(1)}%`:"--"}function fw(B){const k=Number(B);return Number.isFinite(k)?`${k>=0?"+":"-"}${Ut(Math.abs(k))}`:"--"}return(B,k)=>(Z(),ne("div",V8e,[Ue(dv,{ref_key:"mapSceneRef",ref:ee,class:"yak-map-scene","active-layer":ir.value,"map-ranking":rn.value},null,8,["active-layer","map-ranking"]),k[87]||(k[87]=E("div",{class:"yak-map-scrim"},null,-1)),ae.value?mt("",!0):(Z(),ne("div",H8e,"3D地图加载中")),E("div",W8e,[d.value==="trade"&&yv.value.length?(Z(),ne("div",$8e,[k[20]||(k[20]=E("span",null,"交易年份",-1)),(Z(!0),ne(et,null,ut(yv.value,W=>(Z(),ne("button",{key:W,type:"button",class:Ct({active:Number(W)===Number(oe.value)}),onClick:de=>JX(W)},ie(W),11,j8e))),128))])):mt("",!0),d.value==="forecast"?(Z(),ne("div",q8e,[k[21]||(k[21]=E("span",null,"预测年份",-1)),(Z(!0),ne(et,null,ut(dn(za),W=>(Z(),ne("button",{key:W.key,type:"button",class:Ct({active:W.key===p.value}),onClick:de=>IX(W.key)},ie(W.shortLabel),11,X8e))),128))])):mt("",!0),E("div",Y8e,[E("div",K8e,[d.value==="structure"?(Z(),ne(et,{key:0},[Ue(Dt,{class:"yak-side-card left-card",title:"存栏估算",width:Rn,height:Dn},{default:Mt(()=>[E("div",Z8e,[E("div",Q8e,[E("span",J8e,[k[23]||(k[23]=E("em",null,"无人机识别总数",-1)),E("strong",null,[jn(ie(Ut(dn(b0))),1),k[22]||(k[22]=E("small",null,"头",-1))])]),E("span",e6e,[k[25]||(k[25]=E("em",null,"专家共识模型修正",-1)),E("strong",{class:Ct({positive:le.value>0,negative:le.value<0})},[jn(ie(fw(le.value)),1),k[24]||(k[24]=E("small",null,"头",-1))],2)])]),E("div",t6e,[k[27]||(k[27]=E("span",null,"当前存栏预估数量",-1)),E("strong",null,[jn(ie(Ut(dn(Du))),1),k[26]||(k[26]=E("em",null,"头",-1))])])])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"畜群结构占比",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:bv.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"母牛/公牛年龄结构",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:ul.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"牦牛乡镇分布",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:oy.value,autoresize:!0},null,8,["option"])]),_:1})],64)):d.value==="forecast"?(Z(),ne(et,{key:1},[Ue(Dt,{class:"yak-side-card left-card",title:"畜群预测",width:Rn,height:Dn},{default:Mt(()=>[E("div",n6e,[E("div",r6e,[E("div",i6e,[E("span",null,ie(q.value.label)+"预测存栏",1),E("strong",null,[jn(ie(Ut(q.value.stock)),1),k[28]||(k[28]=E("em",null,"头",-1))])]),E("div",{class:Ct(["forecast-change-badge",{positive:ue.value>0,negative:ue.value<0}])},[k[30]||(k[30]=E("span",null,"较当前",-1)),E("strong",null,[jn(ie(fw(ue.value)),1),k[29]||(k[29]=E("em",null,"头",-1))])],2)]),E("div",a6e,[E("span",null,[k[31]||(k[31]=E("em",null,"补充",-1)),E("strong",null,ie(J3(q.value.births))+"头",1)]),E("span",null,[k[32]||(k[32]=E("em",null,"流出",-1)),E("strong",null,ie(J3(q.value.outflow))+"头",1)]),E("span",null,[k[33]||(k[33]=E("em",null,"周期",-1)),E("strong",null,ie(q.value.months)+"个月",1)])])])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"未来存栏趋势",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:cl.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"月度数量预测",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:wv.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"预测因子雷达",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:la.value,autoresize:!0},null,8,["option"])]),_:1})],64)):d.value==="epidemic"?(Z(),ne(et,{key:2},[Ue(Dt,{class:"yak-side-card left-card",title:"防疫总览",width:Rn,height:Dn},{default:Mt(()=>[E("div",s6e,[E("div",o6e,[k[35]||(k[35]=E("span",null,"完成耳标",-1)),E("strong",null,[jn(ie(Ut(me.value)),1),k[34]||(k[34]=E("em",null,"头",-1))])]),E("div",{class:"epidemic-progress-ring",style:pn({"--coverage":`${Math.min(Q.value,100)}%`})},[E("strong",null,ie(Jl(Q.value)),1),k[36]||(k[36]=E("span",null,"完成率",-1))],4),E("div",l6e,[E("span",null,[k[37]||(k[37]=E("em",null,"防疫记录",-1)),E("strong",null,ie(Ut(vt.value))+"条",1)]),E("span",null,[k[38]||(k[38]=E("em",null,"养殖户",-1)),E("strong",null,ie(Ut(Ye.value))+"户",1)]),E("span",null,[k[39]||(k[39]=E("em",null,"涉及村数",-1)),E("strong",null,ie(Ut(je.value))+"个",1)]),E("span",null,[k[40]||(k[40]=E("em",null,"疫苗类型",-1)),E("strong",null,ie(at.value)+"类",1)])])])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"防疫数据链路",width:Rn,height:Dn},{default:Mt(()=>[E("div",u6e,[E("div",c6e,[E("span",null,[k[41]||(k[41]=E("em",null,"防疫台账",-1)),E("strong",null,ie(Ut(vt.value)),1)]),k[44]||(k[44]=E("i",null,"→",-1)),E("span",null,[k[42]||(k[42]=E("em",null,"完成耳标",-1)),E("strong",null,ie(Ut(me.value)),1)]),k[45]||(k[45]=E("i",null,"→",-1)),E("span",null,[k[43]||(k[43]=E("em",null,"涉及村数",-1)),E("strong",null,ie(Ut(je.value)),1)])]),k[48]||(k[48]=E("div",{class:"epidemic-chain-note"},[E("span",null,"防疫数据来自台账记录,按耳标、疫苗类型、免疫日期和行政村归集形成可追溯链路。")],-1)),E("div",h6e,[E("span",null,[k[46]||(k[46]=E("em",null,"疫苗类型",-1)),E("strong",null,ie(at.value)+"类",1)]),E("span",null,[k[47]||(k[47]=E("em",null,"台账状态",-1)),E("strong",null,ie(w.value?"读取中":T.value?"异常":"已接入"),1)])])])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"防疫作业趋势",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:TX.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"疫苗类型分布",width:Rn,height:Dn},{default:Mt(()=>[At.value.length?(Z(),ne("div",f6e,[E("div",d6e,[(Z(),wi(nq,{key:ce.value,data:At.value,delay:3e3,colors:s,opacity:.62,class:"epidemic-three-pie"},{default:Mt(({data:W})=>[E("div",p6e,[E("strong",null,ie(cr((W==null?void 0:W.count)||vt.value)),1),E("span",null,ie((W==null?void 0:W.name)||"疫苗类型"),1)])]),_:1},8,["data"]))]),E("div",v6e,[(Z(!0),ne(et,null,ut(At.value,(W,de)=>(Z(),ne("div",{key:W.key||W.name,class:"epidemic-three-pie-row"},[E("i",{style:pn({borderColor:s[de%s.length]})},null,4),E("span",null,ie(W.name),1),E("strong",null,ie(cr(W.value)),1),E("em",null,ie(W.unit),1)]))),128))])])):(Z(),ne("div",g6e,"暂无疫苗类型数据"))]),_:1})],64)):d.value==="trade"?(Z(),ne(et,{key:3},[Ue(Dt,{class:"yak-side-card left-card",title:"交易年度总览",width:Rn,height:Dn},{default:Mt(()=>[E("div",m6e,[E("div",y6e,[E("span",null,ie(oe.value)+"年流通总量",1),E("strong",null,[jn(ie(Ut(ji("headCount"))),1),k[49]||(k[49]=E("em",null,"头",-1))])]),E("div",_6e,[E("span",null,[k[50]||(k[50]=E("em",null,"出证记录",-1)),E("strong",null,ie(Ut(ji("recordCount")))+"条",1)]),E("span",null,[k[51]||(k[51]=E("em",null,"交易销售",-1)),E("strong",null,ie(Ut(ji("saleHeadCount")))+"头",1)]),E("span",null,[k[52]||(k[52]=E("em",null,"运输车辆",-1)),E("strong",null,ie(Ut(ji("vehicleCount")))+"辆",1)])])])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"交易流通趋势",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:PX.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"来源乡镇分布",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:LX.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card left-card",title:"用途结构统计",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:RX.value,autoresize:!0},null,8,["option"])]),_:1})],64)):mt("",!0)])]),E("div",x6e,[E("div",b6e,[d.value==="structure"?(Z(),ne(et,{key:0},[Ue(Dt,{class:"yak-side-card right-card",title:"乡镇存栏排行",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:Ec.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card right-card",title:"母牛与幼畜分布",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:Sv.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card right-card",title:"出栏/交易影响",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:li.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card right-card",title:"结构明细",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:ur.value,autoresize:!0},null,8,["option"])]),_:1})],64)):d.value==="forecast"?(Z(),ne(et,{key:1},[Ue(Dt,{class:"yak-side-card right-card",title:"乡镇预测排行",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:Av.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card right-card",title:"期末结构预测",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:iw.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card right-card",title:"补充/流出对比",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:ly.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card right-card",title:"预测变化热力",width:Rn,height:Dn},{default:Mt(()=>[E("div",S6e,[(Z(!0),ne(et,null,ut(MX.value,W=>(Z(),ne("div",{key:W.name,class:"heat-row",style:pn({"--heat-width":`${W.width}%`})},[E("span",null,ie(W.name),1),E("strong",null,ie(fw(W.change)),1)],4))),128))])]),_:1})],64)):d.value==="epidemic"?(Z(),ne(et,{key:2},[Ue(Dt,{class:"yak-side-card right-card",title:"防疫统计",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:CX.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card right-card",title:"养殖户防疫排行",width:Rn,height:Dn},{default:Mt(()=>[Ue(dn(Pr),{class:"yak-chart",option:EX.value,autoresize:!0},null,8,["option"])]),_:1}),Ue(Dt,{class:"yak-side-card right-card epidemic-ledger-card",title:"防疫记录台账",width:Rn,height:r},{default:Mt(()=>[E("div",w6e,[E("div",A6e,[E("span",null,"共 "+ie(Ut(S.value))+" 条",1),E("button",{type:"button",onClick:k[0]||(k[0]=W=>X3())},"查看更多")]),k[53]||(k[53]=E("div",{class:"epidemic-record-header"},[E("span",null,"电子耳标"),E("span",null,"养殖户"),E("span",null,"镇/乡"),E("span",null,"疫苗"),E("span",null,"时间")],-1)),E("div",M6e,[(Z(!0),ne(et,null,ut(Tn.value,W=>(Z(),ne("button",{key:W.epidemicId||W.earTag,type:"button",onClick:de=>X3(W)},[E("span",null,ie(vn(W.earTag)),1),E("span",null,ie(vn(W.owner)),1),E("span",null,ie(vn(W.town)),1),E("strong",null,ie(vn(W.medicine)),1),E("span",null,ie(If(W.operateTime)),1)],8,T6e))),128)),b.value.length?mt("",!0):(Z(),ne("div",C6e,ie(w.value?"防疫台账读取中":T.value||"暂无防疫记录"),1))])])]),_:1})],64)):d.value==="trade"?(Z(),ne(et,{key:3},[Ue(Dt,{class:"yak-side-card right-card",title:"出证结构统计",width:Rn,height:Dn},{default:Mt(()=>[E("div",E6e,[E("div",P6e,[E("span",null,[k[55]||(k[55]=E("em",null,"省外流通 A证",-1)),E("strong",null,[jn(ie(Ut(ji("outProvinceHeads","aCertHeads"))),1),k[54]||(k[54]=E("b",null,"头",-1))]),E("small",null,ie(Ut(ji("outProvinceCount","aCertCount")))+"条记录",1)]),E("span",null,[k[57]||(k[57]=E("em",null,"省内流通 B证",-1)),E("strong",null,[jn(ie(Ut(ji("inProvinceHeads","bCertHeads"))),1),k[56]||(k[56]=E("b",null,"头",-1))]),E("small",null,ie(Ut(ji("inProvinceCount","bCertCount")))+"条记录",1)])]),Ue(dn(Pr),{class:"trade-cert-chart",option:DX.value,autoresize:!0},null,8,["option"])])]),_:1}),Ue(Dt,{class:"yak-side-card right-card",title:"目的地流向排行",width:Rn,height:Dn},{default:Mt(()=>[E("div",L6e,[(Z(!0),ne(et,null,ut(xv.value,(W,de)=>(Z(),ne("div",{key:W.name,class:"trade-dest-row",style:pn({"--trade-ratio":`${W.ratio}%`})},[E("span",null,ie(de+1),1),E("strong",null,ie(W.name),1),E("em",null,ie(cr(W.headCount))+"头",1)],4))),128)),xv.value.length?mt("",!0):(Z(),ne("div",R6e,ie(X.value?"交易数据读取中":re.value||"暂无目的地流向数据"),1))])]),_:1}),Ue(Dt,{class:"yak-side-card right-card trade-ledger-card",title:"交易出证台账",width:Rn,height:i},{default:Mt(()=>[E("div",D6e,[E("div",I6e,[E("span",null,"共 "+ie(Ut(Y.value))+" 条",1),E("div",null,[Hr(E("input",{"onUpdate:modelValue":k[1]||(k[1]=W=>Fe.value=W),type:"search",placeholder:"货主/车辆/检疫号/地区",onKeyup:Kd(U3,["enter"])},null,544),[[xh,Fe.value]]),E("button",{type:"button",onClick:U3},"搜索"),E("button",{type:"button",class:"is-more",onClick:k[2]||(k[2]=W=>eY())},"查看更多")])]),k[58]||(k[58]=E("div",{class:"trade-ledger-header"},[E("span",null,"货主"),E("span",null,"车牌"),E("span",null,"数量"),E("span",null,"源头"),E("span",null,"用途"),E("span",null,"时间")],-1)),E("div",N6e,[(Z(!0),ne(et,null,ut(J.value,W=>(Z(),ne("button",{key:W.certId,type:"button",onClick:de=>q3(W)},[E("span",null,ie(vn(W.ownerName)),1),E("span",null,ie(vn(W.transportNumber)),1),E("strong",null,ie(Ut(W.amount))+"头",1),E("span",null,ie(vn(W.startTown)),1),E("span",null,ie(vn(W.usageTypeName)),1),E("span",null,ie(If(W.issueTime)),1)],8,k6e))),128)),J.value.length?mt("",!0):(Z(),ne("div",O6e,ie(X.value?"交易台账读取中":re.value||"暂无交易记录"),1))]),E("div",F6e,[E("span",null,"第 "+ie(_e.value)+" / "+ie(Se.value)+" 页",1),E("button",{type:"button",disabled:_e.value<=1,onClick:k[3]||(k[3]=W=>V3(_e.value-1))},"上一页",8,B6e),E("button",{type:"button",disabled:_e.value>=Se.value,onClick:k[4]||(k[4]=W=>V3(_e.value+1))},"下一页",8,G6e)])])]),_:1})],64)):mt("",!0)])]),E("div",z6e,[Ue(YS,{"model-value":d.value,topics:f,"onUpdate:modelValue":k[5]||(k[5]=W=>d.value=W)},null,8,["model-value"])])]),C.value?(Z(),ne("div",{key:1,class:"epidemic-ledger-modal",onClick:da(Y3,["self"])},[E("div",U6e,[E("div",V6e,[E("div",null,[k[59]||(k[59]=E("span",null,"牦牛防疫台账",-1)),E("strong",null,ie(Ut(M.value))+" 条记录",1)]),E("button",{type:"button",onClick:Y3},"关闭")]),E("div",H6e,[Hr(E("input",{"onUpdate:modelValue":k[6]||(k[6]=W=>O.value.keyword=W),type:"search",placeholder:"耳标 / 养殖户 / 药品","aria-label":"耳标 / 养殖户 / 药品",onKeyup:Kd(K3,["enter"])},null,544),[[xh,O.value.keyword]]),Hr(E("select",{"onUpdate:modelValue":k[7]||(k[7]=W=>O.value.town=W)},[k[60]||(k[60]=E("option",{value:""},"全部镇/乡",-1)),(Z(!0),ne(et,null,ut(rs.value,W=>(Z(),ne("option",{key:W,value:W},ie(W),9,W6e))),128))],512),[[Nv,O.value.town]]),Hr(E("select",{"onUpdate:modelValue":k[8]||(k[8]=W=>O.value.medicine=W)},[k[61]||(k[61]=E("option",{value:""},"全部疫苗",-1)),(Z(!0),ne(et,null,ut(iy.value,W=>(Z(),ne("option",{key:W,value:W},ie(W),9,$6e))),128))],512),[[Nv,O.value.medicine]]),Hr(E("input",{"onUpdate:modelValue":k[9]||(k[9]=W=>O.value.startDate=W),type:"date"},null,512),[[xh,O.value.startDate]]),Hr(E("input",{"onUpdate:modelValue":k[10]||(k[10]=W=>O.value.endDate=W),type:"date"},null,512),[[xh,O.value.endDate]]),E("button",{type:"button",onClick:K3},"检索"),E("button",{type:"button",class:"is-ghost",onClick:rY},"重置")]),E("div",j6e,[E("div",q6e,[k[62]||(k[62]=E("div",{class:"epidemic-ledger-table-head"},[E("span",null,"电子耳标"),E("span",null,"养殖户"),E("span",null,"镇/乡"),E("span",null,"村"),E("span",null,"疫苗"),E("span",null,"免疫时间"),E("span",null,"图片")],-1)),(Z(!0),ne(et,null,ut(A.value,W=>{var de,Te;return Z(),ne("button",{key:W.epidemicId||W.earTag,type:"button",class:Ct({active:(((de=R.value)==null?void 0:de.epidemicId)||((Te=R.value)==null?void 0:Te.earTag))===(W.epidemicId||W.earTag)}),onClick:Je=>Q3(W)},[E("span",null,ie(vn(W.earTag)),1),E("span",null,ie(vn(W.owner)),1),E("span",null,ie(vn(W.town)),1),E("span",null,ie(vn(W.village)),1),E("strong",null,ie(vn(W.medicine)),1),E("span",null,ie(If(W.operateTime)),1),E("span",null,ie(uw(W).length?`${uw(W).length}张`:"无"),1)],10,X6e)}),128)),A.value.length?mt("",!0):(Z(),ne("div",Y6e,ie(D.value?"台账读取中":L.value||"暂无匹配记录"),1))]),E("div",K6e,[E("div",Z6e,[E("span",null,ie(vn(ye.value.earTag)),1),E("strong",null,ie(F.value?"加载中":If(ye.value.operateTime)),1)]),E("div",Q6e,[E("span",null,[k[63]||(k[63]=E("em",null,"养殖户",-1)),E("strong",null,ie(vn(ye.value.owner)),1)]),E("span",null,[k[64]||(k[64]=E("em",null,"镇村",-1)),E("strong",null,ie(YX(ye.value)),1)]),E("span",null,[k[65]||(k[65]=E("em",null,"疫苗类型",-1)),E("strong",null,ie(vn(ye.value.medicine)),1)]),E("span",null,[k[66]||(k[66]=E("em",null,"防疫类型",-1)),E("strong",null,ie(vn(ye.value.preventionType)),1)]),E("span",null,[k[67]||(k[67]=E("em",null,"畜龄",-1)),E("strong",null,ie(vn(ye.value.age)),1)]),E("span",null,[k[68]||(k[68]=E("em",null,"操作员",-1)),E("strong",null,ie(vn(ye.value.operator)),1)]),E("span",J6e,[k[69]||(k[69]=E("em",null,"地址",-1)),E("strong",null,ie(vn(ye.value.location)),1)])]),E("div",eBe,[ht.value.length?mt("",!0):(Z(),ne("span",tBe,"无图片")),(Z(!0),ne(et,null,ut(ht.value.slice(0,6),W=>(Z(),ne("img",{key:W,src:XX(W),alt:"防疫照片"},null,8,nBe))),128))])])]),E("div",rBe,[E("span",null,"第 "+ie(P.value)+" / "+ie(dr.value)+" 页",1),E("button",{type:"button",disabled:P.value<=1,onClick:k[11]||(k[11]=W=>Z3(P.value-1))},"上一页",8,iBe),E("button",{type:"button",disabled:P.value>=dr.value,onClick:k[12]||(k[12]=W=>Z3(P.value+1))},"下一页",8,aBe)])])])):mt("",!0),Ae.value?(Z(),ne("div",{key:2,class:"epidemic-ledger-modal trade-ledger-modal",onClick:da(H3,["self"])},[E("div",sBe,[E("div",oBe,[E("div",null,[k[70]||(k[70]=E("span",null,"牦牛交易出证台账",-1)),E("strong",null,ie(oe.value)+"年 "+ie(Ut(fe.value))+" 条记录",1)]),E("button",{type:"button",onClick:H3},"关闭")]),E("div",lBe,[Hr(E("input",{"onUpdate:modelValue":k[13]||(k[13]=W=>V.value.keyword=W),type:"search",placeholder:"货主 / 车辆 / 检疫号 / 地区",onKeyup:Kd(W3,["enter"])},null,544),[[xh,V.value.keyword]]),Hr(E("select",{"onUpdate:modelValue":k[14]||(k[14]=W=>V.value.startTown=W)},[k[71]||(k[71]=E("option",{value:""},"全部源头乡镇",-1)),(Z(!0),ne(et,null,ut(ft.value,W=>(Z(),ne("option",{key:W,value:W},ie(W),9,uBe))),128))],512),[[Nv,V.value.startTown]]),Hr(E("select",{"onUpdate:modelValue":k[15]||(k[15]=W=>V.value.usageType=W)},[k[72]||(k[72]=E("option",{value:""},"全部用途",-1)),(Z(!0),ne(et,null,ut(Pt.value,W=>(Z(),ne("option",{key:W,value:W},ie(W),9,cBe))),128))],512),[[Nv,V.value.usageType]]),Hr(E("select",{"onUpdate:modelValue":k[16]||(k[16]=W=>V.value.certType=W)},[k[73]||(k[73]=E("option",{value:""},"全部证书",-1)),(Z(!0),ne(et,null,ut(Bt.value,W=>(Z(),ne("option",{key:W.value,value:W.value},ie(W.label),9,hBe))),128))],512),[[Nv,V.value.certType]]),E("button",{type:"button",onClick:W3},"检索"),E("button",{type:"button",class:"is-ghost",onClick:tY},"重置")]),E("div",fBe,[E("div",dBe,[k[74]||(k[74]=E("div",{class:"trade-ledger-modal-table-head"},[E("span",null,"货主"),E("span",null,"证书"),E("span",null,"车牌号"),E("span",null,"数量"),E("span",null,"源头"),E("span",null,"用途"),E("span",null,"出证时间"),E("span",null,"状态")],-1)),(Z(!0),ne(et,null,ut(ze.value,W=>(Z(),ne("button",{key:W.certId||W.factoryCode,type:"button",class:Ct({active:De.value===(W.certId||W.factoryCode)}),onClick:de=>j3(W)},[E("span",null,ie(vn(W.ownerName)),1),E("span",null,ie(vn(W.certType||W.certScopeName)),1),E("span",null,ie(vn(W.transportNumber)),1),E("strong",null,ie(Ut(W.amount))+"头",1),E("span",null,ie(vn(W.startTown)),1),E("span",null,ie(vn(W.usageTypeName)),1),E("span",null,ie(If(W.issueTime)),1),E("span",null,ie(vn(W.statusName)),1)],10,pBe))),128)),ze.value.length?mt("",!0):(Z(),ne("div",vBe,ie(xe.value?"交易台账读取中":pe.value||"暂无匹配记录"),1))]),E("div",gBe,[E("div",mBe,[E("span",null,ie(vn(Me.value.factoryCode||Me.value.certId)),1),E("strong",null,ie(If(Me.value.issueTime)),1)]),E("div",yBe,[E("span",null,[k[75]||(k[75]=E("em",null,"货主",-1)),E("strong",null,ie(vn(Me.value.ownerName)),1)]),E("span",null,[k[76]||(k[76]=E("em",null,"联系方式",-1)),E("strong",null,ie(KX(Me.value.ownerPhone)),1)]),E("span",null,[k[77]||(k[77]=E("em",null,"证书类型",-1)),E("strong",null,ie(ZX(Me.value)),1)]),E("span",null,[k[78]||(k[78]=E("em",null,"车牌号",-1)),E("strong",null,ie(vn(Me.value.transportNumber)),1)]),E("span",null,[k[79]||(k[79]=E("em",null,"牦牛数量",-1)),E("strong",null,ie(Ut(Me.value.amount))+"头",1)]),E("span",null,[k[80]||(k[80]=E("em",null,"用途",-1)),E("strong",null,ie(vn(Me.value.usageTypeName)),1)]),E("span",null,[k[81]||(k[81]=E("em",null,"源头乡镇",-1)),E("strong",null,ie(vn(Me.value.startTown)),1)]),E("span",null,[k[82]||(k[82]=E("em",null,"目的省份",-1)),E("strong",null,ie(vn(Me.value.destProvince)),1)]),E("span",null,[k[83]||(k[83]=E("em",null,"检疫员",-1)),E("strong",null,ie(vn(Me.value.quarantineOfficerName)),1)]),E("span",null,[k[84]||(k[84]=E("em",null,"状态",-1)),E("strong",null,ie(vn(Me.value.statusName)),1)]),E("span",_Be,[k[85]||(k[85]=E("em",null,"源头地区",-1)),E("strong",null,ie(vn(Me.value.startRegionFullName)),1)]),E("span",xBe,[k[86]||(k[86]=E("em",null,"目的地",-1)),E("strong",null,ie(vn(Me.value.destRegionFullName)),1)])]),E("button",{type:"button",class:"trade-detail-locate",disabled:!Me.value.startTown,onClick:k[17]||(k[17]=W=>q3(Me.value))}," 定位源头乡镇 ",8,bBe)])]),E("div",SBe,[E("span",null,"第 "+ie(j.value)+" / "+ie(Re.value)+" 页",1),E("button",{type:"button",disabled:j.value<=1,onClick:k[18]||(k[18]=W=>$3(j.value-1))},"上一页",8,wBe),E("button",{type:"button",disabled:j.value>=Re.value,onClick:k[19]||(k[19]=W=>$3(j.value+1))},"下一页",8,ABe)])])])):mt("",!0)]))}},_X="/jsyApi";function xX(n,e){return/^https?:\/\//.test(e)?e:`${n}${e.startsWith("/")?e:`/${e}`}`}function bX(n){if((n==null?void 0:n.success)===!1||(n==null?void 0:n.code)!==void 0&&![0,200,"0","200"].includes(n.code)){const t=new Error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"接口请求失败");throw t.code=n==null?void 0:n.code,t}return Qt(n)}function A3(n,e,t={}){return ol(xX(_X,n),{params:e,timeout:t.timeout||12e3}).then(bX)}function QS(n,e,t={}){return ol(xX(_X,n),{method:"POST",params:e,timeout:t.timeout||12e3}).then(bX)}function PBe(){return QS("/api/dataItem?group=pastures").then(ql)}function LBe(){return QS("/api/muhu/distribution").then(ql)}function RBe(){return QS("/api/muhu/age").then(ql)}function DBe(){return QS("/api/muhu/upline_rate").then(ql)}function ql(n){return Array.isArray(n)?n:Array.isArray(n==null?void 0:n.rows)?n.rows:Array.isArray(n==null?void 0:n.list)?n.list:Array.isArray(n==null?void 0:n.data)?n.data:n!=null&&n.data?ql(n.data):n!=null&&n.result?ql(n.result):[]}function IBe(n="",e=1,t=80){return A3("/api/home/muhu_list",{query:n,page:e,pageSize:t}).then(ql)}function NBe(n){return A3("/api/home/grasslandByPastureId",{id:n}).then(ql)}function kBe(){return A3("/api/pasturesList").then(ql)}function OBe(){return $e(this,null,function*(){const[n,e,t,r,i,a]=yield Promise.allSettled([PBe(),LBe(),RBe(),DBe(),kBe(),IBe("",1,80)]),s=i.status==="fulfilled"?i.value:[],o=a.status==="fulfilled"?a.value:[];return{core:n.status==="fulfilled"?n.value:[],distribution:e.status==="fulfilled"?e.value:[],age:t.status==="fulfilled"?t.value:[],online:r.status==="fulfilled"?r.value:[],list:s.length?s:o}})}const FBe={class:"pasture-management"},BBe={key:0,class:"pasture-map-loading"},GBe={class:"pasture-management-ui"},zBe={class:"pasture-left"},UBe={class:"pasture-side-stack is-left"},VBe={class:"pasture-right"},HBe={class:"pasture-side-stack is-right"},oh=398,lh=190,WBe=12,$Be={__name:"index",emits:["module-stats","loading-progress","map-ready"],setup(n,{emit:e}){const t=e,r=lh*2+WBe,i=Be(null),a=Be(!1),s=Be(J2),o=Be(af),l=fv("grassland","grassland-distribution"),u=["牧户数量","户均牦牛头数","户均草地面积","联户数量"];let c=null,h=!1,f=!1;const d=he(()=>H(s.value.core).length?H(s.value.core):aX),p=he(()=>oe(s.value.distribution).length?oe(s.value.distribution):S3),g=he(()=>X(s.value.online).length?X(s.value.online):oX),v=he(()=>re(s.value.age).length?re(s.value.age):CFe),m=he(()=>_e(s.value.age).length?_e(s.value.age):cX),y=he(()=>Ce(o.value).length?Ce(o.value):EFe),_=he(()=>Ae(o.value).length?Ae(o.value):PFe),x=he(()=>({title:"牧户分布排行",metricLabel:"牧户",unit:"户",rows:(p.value.length?p.value:LFe).slice(0,8).map(V=>({name:V.name,value:Number(V.value)||0,unit:V.unit||"户"}))})),b=he(()=>({key:"pasture-town",type:"bar",variant:"distribution",rows:p.value})),S=he(()=>({key:"pasture-grassland-area",type:"bar",variant:"distribution",rows:y.value})),w=he(()=>({key:"pasture-season",type:"stackColumn",segments:[{key:"summer",name:"夏草场"},{key:"winter",name:"冬草场"}],rows:_.value.slice(0,7)})),T=he(()=>({key:"pasture-online",type:"line",rows:g.value})),C=he(()=>({key:"pasture-age",type:"column",variant:"slim",rows:v.value})),A=he(()=>({key:"pasture-gender",type:"donut",rows:m.value})),M=he(()=>({key:"pasture-herdsman-list",type:"projectTable",searchPlaceholder:"搜索牧户 / 乡镇",emptyText:"无匹配牧户",searchKeys:["name","township","id","grasslandArea"],columns:[{key:"name",label:"牧户名称",field:"name",width:"30%"},{key:"grasslandArea",label:"草场面积",field:"grasslandArea",width:"28%",align:"right",strong:!0,format:"number",unit:"亩"},{key:"township",label:"区域",field:"township",width:"24%"},{key:"locate",label:"定位",field:"locateText",width:"18%",align:"center",fallback:"定位"}],rows:o.value}));Ia(()=>{F(),L(),P()}),ns(()=>{var V,ee;f=!0,(ee=(V=i.value)==null?void 0:V.destroyMap)==null||ee.call(V)});function P(){return $e(this,null,function*(){try{const V=yield OBe();if(f)return;s.value=Le(Le({},J2),V),F();const ee=Fe(V.list);o.value=ee.length?ee:af}catch(V){s.value=J2,o.value=af}})}function D(V){return $e(this,null,function*(){var ge,Ee,q,le,ue,be;if(!pe(V)){(Ee=(ge=i.value)==null?void 0:ge.focusPasture)==null||Ee.call(ge,{name:V==null?void 0:V.name});return}const ee=xe(V);let ae=[];if(ee)try{ae=yield NBe(ee)}catch(He){ae=[]}const I=fe(V),G=ae.filter(j),K=G.length?G:I;if(!K.length){(le=(q=i.value)==null?void 0:q.focusPasture)==null||le.call(q,{name:V==null?void 0:V.name});return}(be=(ue=i.value)==null?void 0:ue.focusPasture)==null||be.call(ue,{name:V==null?void 0:V.name,grasslands:K})})}function L(){var V,ee,ae;c=new pv,h=!1,t("loading-progress",{progress:0}),(ee=(V=c.instance)==null?void 0:V.on)==null||ee.call(V,"onProgress",(I,G,K)=>{t("loading-progress",{progress:Math.floor(G/(K||1)*100),path:I,itemsLoaded:G,itemsTotal:K})}),(ae=c.ready)==null||ae.then(()=>{h=!0,N()}).catch(()=>{a.value=!0,t("map-ready")})}function R(){h&&N()}function N(V=0){return $e(this,null,function*(){var ae,I;if(f||!h||!c)return;yield Ya();const ee=i.value;if((ae=ee==null?void 0:ee.loadMap)==null||ae.call(ee,c),ee!=null&&ee.canvasMap){a.value=!0,t("loading-progress",{progress:100}),t("map-ready"),(I=ee.play)==null||I.call(ee);return}if(V<24){window.setTimeout(()=>N(V+1),120);return}a.value=!0,t("map-ready")})}function F(){t("module-stats",{moduleKey:"pasture-management",items:O().map(V=>({zh:V.name,name:V.name,value:V.value,unit:V.unit,decimals:Number.isInteger(Number(V.value))?0:2}))})}function O(){const V=new Map;return(Array.isArray(d.value)?d.value:[]).forEach(ee=>{!(ee!=null&&ee.name)||Y(ee.name)||V.set(ee.name,ee)}),u.map(ee=>V.get(ee)||sX.find(ae=>ae.name===ee||ae.zh===ee)).filter(Boolean).slice(0,4)}function H(V=[]){return(Array.isArray(V)?V:[]).map((ee,ae)=>{const I=ee.key||ee.id||ee.code||ee.name||ee.zh||`${ae}`,G=ee.name||ee.title||ee.label||ee.zh,K=U(G,I),ge=we(ee,["value","num","count","dataValue"]);if(!K||ge===void 0||ge===null||ge==="")return null;const Ee=$(K,ge,ee.unit||ee.dw||"");return{key:I,name:Ee.name,value:Ee.value,unit:Ee.unit,icon:ee.icon||["town","area","yield","rate"][ae%4]}}).filter(Boolean)}function U(V,ee){const ae=String(V||ee||""),I=String(ee||"").toLowerCase();return/avg.*yak|yak.*avg|yak.*household|yak.*per|hjyak/.test(I)||/户均.*牦牛|牦牛.*户均/.test(ae)?"户均牦牛头数":/avg.*grass|grass.*avg|grass.*household|grass.*per/.test(I)||/户均.*草地|草地.*户均/.test(ae)?"户均草地面积":/income|revenue|人均收入/.test(I)||ae.includes("人均收入")?"人均收入":/poverty|monitor|防反贫|监测户/.test(I)||ae.includes("防反贫")||ae.includes("监测户")?"防反贫监测户":/joint|union|link|联户/.test(I)||ae.includes("联户")?"联户数量":/herdsman|muhu|pasture.*count|牧户数量/.test(I)||ae.includes("牧户数量")?"牧户数量":/yak/.test(I)||ae.includes("牦牛")?null:/grass/.test(I)||ae.includes("草地面积")?"草地面积":/wet/.test(I)||ae.includes("湿地")?"湿地面积":ae.includes("牧户")||ae.includes("牧场")?"牧户数量":/project/.test(I)||ae.includes("工程")||ae.includes("项目")?"工程数量":/base/.test(I)||ae.includes("基地")?"基地数量":ae}function $(V,ee,ae){const I=Number(ee)||0;return V==="户均牦牛头数"?{name:V,value:I,unit:ae||"头"}:V==="户均草地面积"?{name:V,value:I,unit:ae||"亩"}:V==="人均收入"?{name:V,value:I,unit:ae||"元/年"}:V==="联户数量"||V==="防反贫监测户"?{name:V,value:I,unit:ae||"户"}:(V.includes("草地")||V.includes("湿地"))&&!String(ae).includes("万")?{name:V,value:Math.round(I/1e4*100)/100,unit:"万亩"}:V.includes("牧户")?{name:V,value:I,unit:ae||"户"}:V.includes("工程")||V.includes("项目")||V.includes("基地")?{name:V,value:I,unit:ae||"个"}:{name:V,value:I,unit:ae}}function Y(V){return V==="草地面积"||V==="湿地面积"||V==="区域数量"||V==="牦牛数量"}function oe(V=[]){return(Array.isArray(V)?V:[]).map(ee=>{const ae=we(ee,["areaName","area_name","name","townName","zoneName"]),I=we(ee,["number","value","count","num","pastureCount","muhuCount","muhu_count"]);return!ae||I===void 0||I===null||I===""?null:{key:ee.code||ee.areaCode||ee.area_code||ae,name:ae,value:Number(I)||0,unit:"户"}}).filter(Boolean).sort((ee,ae)=>ae.value-ee.value)}function X(V=[]){return(Array.isArray(V)?V:[]).map(ee=>{const ae=we(ee,["areaName","area_name","name","townName","zoneName"]),I=Number(we(ee,["registeredMuhuCount","registered_muhu_count","registeredCount"])),G=Number(we(ee,["muhuCount","muhu_count","onlineCount"])),K=we(ee,["onlinePercent","uplineRate","upline_rate","onlineRate","value","percent","rate"]),ge=K!=null&&K!==""?K:I>0?G/I*100:void 0;return!ae||ge===void 0||ge===null||ge===""?null:{key:ee.code||ee.areaCode||ee.area_code||ae,name:ae,value:Number(String(ge).replace("%",""))||0,unit:"%",extra:Number.isFinite(G)&&Number.isFinite(I)&&I>0?`${G}/${I}户`:ee.extra}}).filter(Boolean).slice(0,7)}function re(V=[]){const ee=new Map;return(Array.isArray(V)?V:[]).forEach(ae=>{const I=we(ae,["ageRange","age_range","age","name","label"]),G=we(ae,["number","value","count","num"]);!I||G===void 0||G===null||G===""||ee.set(I,(ee.get(I)||0)+(Number(G)||0))}),Array.from(ee.entries()).map(([ae,I])=>({key:ae,name:ae,value:I,unit:"人"}))}function _e(V=[]){const ee=new Map;return(Array.isArray(V)?V:[]).forEach(ae=>{const I=we(ae,["sex","gender","name"]),G=we(ae,["number","value","count","num"]);if(!I||G===void 0||G===null||G==="")return;const K=String(I).includes("女")?"女":String(I).includes("男")?"男":I;ee.set(K,(ee.get(K)||0)+(Number(G)||0))}),Array.from(ee.entries()).map(([ae,I])=>({key:ae,name:ae,value:I,unit:"人"}))}function Fe(V=[]){return(Array.isArray(V)?V:[]).map((ee,ae)=>{const I=we(ee,["name","pasturesName","pastures_name","muhuName","muhu_name","pastureName","pasture_name","herdsmanName"]);if(!I)return null;const G=we(ee,["grasslandArea","grassland_area","acreage","area","areaRange","area_range","cdAcreage","cd_acreage","totalAcreage","total_acreage"]),K=we(ee,["township","townName","areaName","area_name","zoneName","address"]),ge=xe(ee),Ee=fe(ee),q=Ve(Le({},ee),{key:ee.key||ee.id||ee.pasturesId||ee.pastures_id||`${I}-${ae}`,id:ge||ee.id||ee.pastureId||ee.pasturesId||ee.pastures_id||ee.muhuId||ee.key,realPastureId:ge,name:I,township:K||"--",grasslandArea:Number(G)||0,acreage:Number(G)||0,grasslands:Ee});return q.canLocate=!!(ge||Ee.some(j)||j(ee)),q.locateText=q.canLocate?"定位":"--",q.value=q.grasslandArea,q.unit="亩",q.searchText=[q.name,q.township,q.id].filter(Boolean).join(" "),q}).filter(Boolean)}function Ce(V=[]){return ze(V,ee=>Number(ee.grasslandArea)||0,"万亩",ee=>Math.round(ee/1e4*100)/100)}function Ae(V=[]){const ee=new Map;return(Array.isArray(V)?V:[]).forEach(ae=>{const I=(ae==null?void 0:ae.township)||(ae==null?void 0:ae.areaName)||(ae==null?void 0:ae.area_name);if(!I||I==="--")return;const G=ee.get(I)||{key:`${I}-season`,name:I,values:{summer:0,winter:0},total:0,unit:"万亩"};G.values.summer+=Number(we(ae,["summerAcreage","summer_acreage","summerArea","summer_area"]))||0,G.values.winter+=Number(we(ae,["winterAcreage","winter_acreage","winterArea","winter_area"]))||0,G.total=G.values.summer+G.values.winter,ee.set(I,G)}),Array.from(ee.values()).filter(ae=>ae.total>0).map(ae=>Ve(Le({},ae),{value:Math.round(ae.total/1e4*100)/100,values:{summer:Math.round(ae.values.summer/1e4*100)/100,winter:Math.round(ae.values.winter/1e4*100)/100}})).sort((ae,I)=>I.value-ae.value)}function ze(V=[],ee,ae,I=G=>G){const G=new Map;return(Array.isArray(V)?V:[]).forEach(K=>{const ge=(K==null?void 0:K.township)||(K==null?void 0:K.areaName)||(K==null?void 0:K.area_name);if(!ge||ge==="--")return;const Ee=G.get(ge)||{key:ge,name:ge,value:0,unit:ae},q=ee(K);Ee.value+=Number(q)||0,G.set(ge,Ee)}),Array.from(G.values()).map(K=>Ve(Le({},K),{value:I(K.value)})).filter(K=>Number.isFinite(K.value)&&K.value>0).sort((K,ge)=>ge.value-K.value)}function fe(V={}){const ee=[];["grasslands","grasslandList","grasslandRows","landList","plots","features"].forEach(G=>{const K=V==null?void 0:V[G];Array.isArray(K)?ee.push(...K):Array.isArray(K==null?void 0:K.rows)?ee.push(...K.rows):Array.isArray(K==null?void 0:K.list)?ee.push(...K.list):Array.isArray(K==null?void 0:K.data)&&ee.push(...K.data)});const I=we(V,["wkt","geo","geom","geometryWkt","shape"]);return(I||V!=null&&V.geometry)&&ee.push(Ve(Le({},V),{id:(V==null?void 0:V.grasslandId)||(V==null?void 0:V.gid)||(V==null?void 0:V.id),pastureId:(V==null?void 0:V.pastureId)||(V==null?void 0:V.pasturesId)||(V==null?void 0:V.pastures_id)||(V==null?void 0:V.muhuId)||(V==null?void 0:V.id),name:(V==null?void 0:V.grasslandName)||(V==null?void 0:V.name),wkt:I,geometry:V==null?void 0:V.geometry})),ee.filter(Boolean)}function j(V={}){var ee,ae;return typeof V=="string"?!!V.trim():(V==null?void 0:V.type)==="Feature"||V!=null&&V.type&&(V!=null&&V.coordinates)||(ee=V==null?void 0:V.geometry)!=null&&ee.type||(ae=V==null?void 0:V.geometry)!=null&&ae.coordinates||typeof(V==null?void 0:V.geometry)=="string"?!0:!!we(V,["wkt","geo","geom","geometryWkt","shape"])}function xe(V={}){const ee=(V==null?void 0:V.realPastureId)||(V==null?void 0:V.pastureId)||(V==null?void 0:V.pasturesId)||(V==null?void 0:V.pastures_id)||(V==null?void 0:V.muhuId);return ee==null||ee===""?null:ee}function pe(V={}){return V!=null&&V.canLocate||xe(V)||j(V)?!0:fe(V).some(j)}function we(V={},ee=[]){for(const ae of ee){const I=V==null?void 0:V[ae];if(I!=null&&I!=="")return I}}return(V,ee)=>(Z(),ne("div",FBe,[Ue(dv,{ref_key:"mapSceneRef",ref:i,class:"pasture-map-scene","active-layer":dn(l),"map-ranking":x.value,onSceneMounted:R},null,8,["active-layer","map-ranking"]),ee[0]||(ee[0]=E("div",{class:"pasture-map-scrim"},null,-1)),a.value?mt("",!0):(Z(),ne("div",BBe,"3D地图加载中")),E("div",GBe,[E("div",zBe,[E("div",UBe,[Ue(Dt,{class:"pasture-side-card left-card",title:"牧户区域统计",width:oh,height:lh},{default:Mt(()=>[Ue(Ir,{panel:b.value,compact:""},null,8,["panel"])]),_:1}),Ue(Dt,{class:"pasture-side-card left-card",title:"草地面积分布",width:oh,height:lh},{default:Mt(()=>[Ue(Ir,{panel:S.value,compact:""},null,8,["panel"])]),_:1}),Ue(Dt,{class:"pasture-side-card left-card",title:"夏冬草场面积",width:oh,height:lh},{default:Mt(()=>[Ue(Ir,{panel:w.value,compact:""},null,8,["panel"])]),_:1}),Ue(Dt,{class:"pasture-side-card left-card",title:"牧户上线率",width:oh,height:lh},{default:Mt(()=>[Ue(Ir,{panel:T.value,compact:""},null,8,["panel"])]),_:1})])]),E("div",VBe,[E("div",HBe,[Ue(Dt,{class:"pasture-side-card right-card",title:"牧户年龄统计",width:oh,height:lh},{default:Mt(()=>[Ue(Ir,{panel:C.value,compact:""},null,8,["panel"])]),_:1}),Ue(Dt,{class:"pasture-side-card right-card",title:"牧户性别统计",width:oh,height:lh},{default:Mt(()=>[Ue(Ir,{panel:A.value,compact:""},null,8,["panel"])]),_:1}),Ue(Dt,{class:"pasture-side-card right-card pasture-list-card",title:"牧户列表",width:oh,height:r},{default:Mt(()=>[Ue(Ir,{panel:M.value,compact:"",onRowSelect:D},null,8,["panel"])]),_:1})])])])]))}},C0=[{key:"infrastructure",name:"基础设施",color:"#32dcff",unit:"项",metricLabel:"项目"},{key:"breeding",name:"种养基地",color:"#24f6c4",unit:"个",metricLabel:"基地"},{key:"support",name:"配套产业",color:"#ffe06b",unit:"个",metricLabel:"点位"},{key:"processing",name:"加工基地",color:"#ff9a62",unit:"家",metricLabel:"企业"},{key:"service",name:"社会化服务",color:"#9ea7ff",unit:"个",metricLabel:"主体"},{key:"equipment",name:"机械设备",color:"#7ee269",unit:"套",metricLabel:"设备"},{key:"vr",name:"产业VR",color:"#30dcff",unit:"项",metricLabel:"场景"}],Df=[{key:"support-disaster-001",name:"嚷口防灾减灾饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"刷经寺镇",address:"壤口村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.489619,latitude:32.20577086},{key:"support-disaster-002",name:"安曲防灾减灾饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"安曲镇",address:"夺龙村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.3283137,latitude:32.63727531},{key:"support-disaster-003",name:"瓦切唐日合作社饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"瓦切镇",address:"唐日村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.6162349,latitude:33.11047864},{key:"support-disaster-004",name:"瓦切牧草交易中心饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"瓦切镇",address:"达俄村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.6014834,latitude:33.09604707},{key:"support-disaster-005",name:"龙日坝龙日坝村 1 饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"龙日镇",address:"龙日坝村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.383916,latitude:32.44992916},{key:"support-disaster-006",name:"龙日坝龙日坝村 2 饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"龙日镇",address:"龙日坝村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.3834086,latitude:32.45041994},{key:"support-disaster-007",name:"江茸乡饲草储备库",stageKey:"support",typeName:"防震减灾",capacity:1500,capacityUnit:"吨",town:"江茸乡",address:"茸日玛村",status:"正常运营",products:"燕麦草、披碱草、老芒麦",longitude:102.256868,latitude:32.46996565}],nl=[{key:"support-processing-001",name:"西部牦牛产业集团有限责任公司",stageKey:"processing",typeName:"乳制品加工",capacity:3e3,capacityUnit:"吨",outputValue:3e4,town:"邛溪镇",address:"瑞庆西路37号",status:"存续(在营)",products:"牦牛奶粉",longitude:102.5292,latitude:32.7917},{key:"support-processing-002",name:"四川红原菊乐牦牛乳业有限公司",stageKey:"processing",typeName:"乳制品加工",capacity:4e3,capacityUnit:"吨",outputValue:7e3,town:"邛溪镇",address:"瑞庆东路76号附6号",status:"存续(在营)",products:"圣舟牦牛奶",longitude:102.5666,latitude:32.8179},{key:"support-processing-003",name:"四川雅克乳业有限公司",stageKey:"processing",typeName:"乳制品加工",capacity:1e3,capacityUnit:"吨",outputValue:3e3,town:"邛溪镇",address:"瑞庆西路",status:"存续(在营)",products:"牦牛酸奶、牦牛奶粉",longitude:102.5315,latitude:32.7921},{key:"support-processing-004",name:"四川红原遛遛牛食品有限责任公司",stageKey:"processing",typeName:"肉制品加工",capacity:4500,capacityUnit:"吨",outputValue:8e3,town:"邛溪镇",address:"瑞庆东路72号",status:"存续(在营)",products:"风干牦牛肉、卤制牦牛肉",longitude:102.5592,latitude:32.8151},{key:"support-processing-005",name:"四川红原黑帐篷牦牛肉食品有限责任公司",stageKey:"processing",typeName:"肉制品加工",capacity:300,capacityUnit:"吨",outputValue:1e3,town:"邛溪镇",address:"瑞庆中路",status:"存续(在营)",products:"风干牦牛肉、牦牛肉礼包",longitude:102.551,latitude:32.7987},{key:"support-processing-006",name:"红原御坊斋牦牛肉制品厂",stageKey:"processing",typeName:"肉制品加工",capacity:200,capacityUnit:"吨",outputValue:600,town:"邛溪镇",address:"阳嘎北街",status:"存续(在营)",products:"牛肉干、牦牛肉粒",longitude:102.5431,latitude:32.7962},{key:"support-processing-007",name:"四川牦牛火了生态农业科技有限公司",stageKey:"processing",typeName:"肉制品加工",capacity:0,capacityUnit:"吨",outputValue:500,town:"邛溪镇",address:"瑞庆中路13号附1号",status:"存续(在营)",products:"包装牦牛肉干",longitude:102.5402,latitude:32.7958}],jBe=[...Df,...nl],qBe=[3,2,2,2,2,1,1,1,1,1,1],JS=2618,M3=220605,$E=vv.reduce((n,e)=>n+Number(e.devices||0),0),ew=Df.reduce((n,e)=>n+Number(e.capacity||0),0),tw=nl.reduce((n,e)=>n+Number(e.capacity||0),0),XBe=nl.reduce((n,e)=>n+Number(e.outputValue||0),0),SX=new Set(oo.map(n=>n.zoneName)).size,wX=aa.projectCount+aa.baseCount+jBe.length+JS+$E,YBe=[{zh:"牦牛存栏估算",name:"牦牛存栏估算",value:i3,unit:"头"},{zh:"全链载体",name:"全链载体",value:wX,unit:"个/套"},{zh:"加工储备能力",name:"加工储备能力",value:ew+tw,unit:"吨"},{zh:"覆盖乡镇",name:"覆盖乡镇",value:SX,unit:"个"}],KBe=[{key:"chain-node",name:"产业节点",value:C0.length,unit:"类",icon:"town"},{key:"chain-carrier",name:"主体点位",value:wX,unit:"个/套",icon:"yield"},{key:"chain-capacity",name:"加工储备",value:ew+tw,unit:"吨",icon:"stack"},{key:"chain-town",name:"镇域覆盖",value:SX,unit:"个",icon:"area"}],ZBe=[{key:"infrastructure",name:"基础设施",value:aa.projectCount,unit:"项",capacity:aa.projectCount,capacityUnit:"项",note:"产业道路、工程与配套项目"},{key:"breeding",name:"种养基地",value:aa.baseCount,unit:"个",capacity:i3,capacityUnit:"头",note:"基地、牧场与存栏承载"},{key:"support",name:"配套产业",value:Df.length,unit:"个",capacity:ew,capacityUnit:"吨",note:"饲草储备与防灾保障"},{key:"processing",name:"加工基地",value:nl.length,unit:"家",capacity:tw,capacityUnit:"吨",note:"乳品、肉品加工转化"},{key:"service",name:"社会化服务",value:JS,unit:"个",capacity:M3,capacityUnit:"头",note:"保险、交易、检疫与流通"},{key:"equipment",name:"机械设备",value:$E,unit:"套",capacity:$E,capacityUnit:"套",note:"识别、监测与生产装备"},{key:"vr",name:"产业VR",value:1,unit:"项",capacity:6,capacityUnit:"类",note:"产业链沉浸式展示"}],AX=[{key:"resource",name:"草地供给",value:84,unit:"%",extra:"资源底座"},{key:"breeding",name:"基地养殖",value:88,unit:"%",extra:"存栏校准"},{key:"health",name:"防疫保障",value:92,unit:"%",extra:"台账接入"},{key:"trade",name:"交易流通",value:78,unit:"%",extra:"检疫出证"},{key:"processing",name:"加工转化",value:81,unit:"%",extra:"乳肉加工"},{key:"market",name:"品牌销售",value:73,unit:"%",extra:"外销拓展"}],QBe={infrastructure:[{key:"project-online",name:"项目入库",value:95,unit:"%",extra:"95%"},{key:"facility-cover",name:"设施覆盖",value:82,unit:"%",extra:"82%"},{key:"fund-track",name:"资金跟踪",value:76,unit:"%",extra:"76%"},{key:"maintenance",name:"运维闭环",value:68,unit:"%",extra:"68%"}],breeding:[{key:"base-online",name:"基地在线",value:92,unit:"%",extra:"92%"},{key:"stock-match",name:"存栏匹配",value:88,unit:"%",extra:"88%"},{key:"pasture-link",name:"草场关联",value:74,unit:"%",extra:"74%"},{key:"source-trace",name:"源头追溯",value:69,unit:"%",extra:"69%"}],support:[{key:"storage-ready",name:"储备达标",value:91,unit:"%",extra:"91%"},{key:"town-cover",name:"镇域覆盖",value:64,unit:"%",extra:"64%"},{key:"dispatch",name:"调拨能力",value:83,unit:"%",extra:"83%"},{key:"risk",name:"防灾韧性",value:79,unit:"%",extra:"79%"}],processing:[{key:"license",name:"许可状态",value:86,unit:"%",extra:"86%"},{key:"capacity",name:"产能利用",value:77,unit:"%",extra:"77%"},{key:"cold-chain",name:"冷链能力",value:72,unit:"%",extra:"72%"},{key:"farmer-drive",name:"带动牧户",value:84,unit:"%",extra:"84%"}],service:[{key:"insurance",name:"保险服务",value:89,unit:"%",extra:"89%"},{key:"quarantine",name:"检疫出证",value:92,unit:"%",extra:"92%"},{key:"trade",name:"交易撮合",value:78,unit:"%",extra:"78%"},{key:"supply-demand",name:"供需明细",value:81,unit:"%",extra:"81%"}],equipment:[{key:"drone",name:"无人机识别",value:86,unit:"%",extra:"86%"},{key:"iot",name:"物联感知",value:79,unit:"%",extra:"79%"},{key:"machine",name:"生产装备",value:68,unit:"%",extra:"68%"},{key:"offline",name:"在线巡检",value:74,unit:"%",extra:"74%"}],vr:[{key:"resource-scene",name:"资源场景",value:88,unit:"%",extra:"88%"},{key:"base-scene",name:"基地场景",value:82,unit:"%",extra:"82%"},{key:"processing-scene",name:"加工场景",value:76,unit:"%",extra:"76%"},{key:"display-scene",name:"展陈联动",value:72,unit:"%",extra:"72%"}]};function JBe(n){return C0.find(e=>e.key===n)||C0[0]}function eGe(n){return n==="support"?jE(Df,"town","capacity","吨"):n==="processing"?nl.map(e=>({key:e.key,name:e.name.replace("四川红原","").replace("有限责任公司",""),value:e.capacity,unit:e.capacityUnit,extra:e.typeName})).sort((e,t)=>t.value-e.value):n==="breeding"?oo.map(e=>({key:e.zoneName,name:e.zoneName,value:e.yakCount,unit:"头",extra:`${C3(e.grasslandArea)}万亩`})).sort((e,t)=>t.value-e.value).slice(0,7):n==="equipment"?vv.map(e=>({key:e.name,name:e.name,value:e.devices,unit:"套",extra:`${e.count}头`})).sort((e,t)=>t.value-e.value).slice(0,7):n==="service"?qS.map(e=>({key:e.label,name:e.label,value:e.value,unit:"头",extra:`${e.yoy>0?"+":""}${e.yoy}%`})):n==="vr"?AX.map(e=>({key:e.key,name:e.name,value:e.value,unit:e.unit,extra:e.extra})):T3().slice(0,7)}function tGe(n){if(n==="support")return jE(Df,"town","capacity","吨");if(n==="processing")return jE(nl,"town","capacity","吨");if(n==="equipment")return vv.map(e=>({key:e.name,name:e.name,value:e.devices,unit:"套"}));if(n==="service"){const e=oo.reduce((t,r)=>t+Number(r.yakCount||0),0)||1;return oo.map(t=>({key:t.zoneName,name:t.zoneName,value:Math.max(12,Math.round(t.yakCount/e*JS)),unit:"个",extra:"服务主体"})).sort((t,r)=>r.value-t.value)}return n==="vr"?[{key:"vr-resource",name:"资源底图",value:6,unit:"类",extra:"三维展示"},{key:"vr-base",name:"种养基地",value:aa.baseCount,unit:"个",extra:"基地漫游"},{key:"vr-processing",name:"加工企业",value:nl.length,unit:"家",extra:"工艺展示"},{key:"vr-service",name:"服务链路",value:4,unit:"类",extra:"业务联动"}]:n==="infrastructure"?T3():oo.map(e=>({key:e.zoneName,name:e.zoneName,value:e.yakCount,unit:"头"})).sort((e,t)=>t.value-e.value)}function nGe(n){return n==="support"?Df.map(MG):n==="processing"?nl.map(MG):n==="breeding"?oo.map((e,t)=>({key:`base-${t+1}`,name:`${e.zoneName}生态种养基地`,stageKey:n,typeName:"种养基地",town:e.zoneName,capacity:e.yakCount,capacityUnit:"头",status:"在线",products:`${C3(e.grasslandArea)}万亩草地`})):n==="equipment"?vv.map((e,t)=>({key:`equipment-${t+1}`,name:`${e.name}识别监测设备`,stageKey:n,typeName:"机械设备",town:e.name,capacity:e.devices,capacityUnit:"套",status:"在线",products:`${e.count}头识别样本`})):n==="service"?[{key:"service-insurance",name:"牦牛保险服务",stageKey:n,typeName:"保险",town:"全县",capacity:JS,capacityUnit:"户",status:"运行中",products:"参保、理赔、风险事项"},{key:"service-quarantine",name:"检疫出证流通服务",stageKey:n,typeName:"检疫",town:"全县",capacity:9140,capacityUnit:"条",status:"运行中",products:"A证/B证流通明细"},{key:"service-trade",name:"活畜交易撮合服务",stageKey:n,typeName:"交易",town:"全县",capacity:M3,capacityUnit:"头",status:"运行中",products:"交易总览、供需明细"},{key:"service-trace",name:"质量追溯与品牌服务",stageKey:n,typeName:"追溯",town:"全县",capacity:6,capacityUnit:"类",status:"建设中",products:"批次、检疫、加工、销售"}]:n==="vr"?[{key:"vr-resource",name:"林草湿资源 VR 场景",stageKey:n,typeName:"产业VR",town:"全县",capacity:6,capacityUnit:"类",status:"可展示",products:"草地、湿地、林地、牧场"},{key:"vr-base",name:"种养基地 VR 场景",stageKey:n,typeName:"产业VR",town:"全县",capacity:aa.baseCount,capacityUnit:"个",status:"可展示",products:"基地、物联感知、虫情监测"},{key:"vr-processing",name:"加工基地 VR 场景",stageKey:n,typeName:"产业VR",town:"邛溪镇",capacity:nl.length,capacityUnit:"家",status:"可展示",products:"乳品加工、肉品加工"},{key:"vr-chain",name:"全链路 VR 展陈",stageKey:n,typeName:"产业VR",town:"全县",capacity:C0.length,capacityUnit:"段",status:"建设中",products:"生产、加工、流通、品牌"}]:T3().map((e,t)=>({key:`infra-${t+1}`,name:`${e.name}产业基础设施项目`,stageKey:n,typeName:"基础设施",town:e.name,capacity:e.value,capacityUnit:e.unit,status:"入库",products:e.extra}))}function MG(n){return Ve(Le({},n),{value:Number(n.capacity||0),unit:n.capacityUnit})}function T3(){return oo.map((n,e)=>({key:n.zoneName,name:n.zoneName,value:qBe[e]||1,unit:"项",extra:`${C3(n.grasslandArea)}万亩`}))}function jE(n,e,t,r){const i=new Map;return n.forEach(a=>{const s=a[e]||"未填写",o=i.get(s)||{key:s,name:s,value:0,count:0,unit:r,extra:""};o.value+=Number(a[t]||0),o.count+=1,o.extra=`${o.count}个`,i.set(s,o)}),[...i.values()].sort((a,s)=>s.value-a.value||s.count-a.count)}function C3(n){const e=Number(n||0)/1e4;return Number(e.toFixed(1))}const rGe=[{key:"support-capacity",name:"饲草储备能力",value:ew,unit:"吨",extra:`${Df.length}个点位`},{key:"processing-capacity",name:"加工转化能力",value:tw,unit:"吨",extra:`${nl.length}家企业`},{key:"processing-output",name:"加工产值",value:XBe,unit:"万元",extra:"乳品/肉品"},{key:"trade-flow",name:"检疫流通头数",value:M3,unit:"头",extra:"供需明细"}];const iGe={class:"yak-industry-chain"},aGe={key:0,class:"industry-map-loading"},sGe={class:"industry-left industry-side-stack"},oGe={class:"industry-right industry-side-stack"},lGe={class:"industry-center"},uGe={class:"industry-chain-title"},cGe={class:"industry-bottom-switcher"},_u=398,xu=190,hGe={__name:"index",emits:["module-stats","loading-progress","map-ready"],setup(n,{emit:e}){const t=e,r=Be("support"),i=Be(null),a=Be(!1),s=fv("grassland","grassland-distribution");let o=null,l=!1;const u=he(()=>JBe(r.value)),c=he(()=>eGe(r.value)),h=he(()=>tGe(r.value)),f=he(()=>nGe(r.value)),d=he(()=>C0.map(A=>({key:A.key,name:A.name,color:A.color}))),p=he(()=>{var A;return{title:`${u.value.name}排行`,metricLabel:u.value.metricLabel,unit:((A=h.value[0])==null?void 0:A.unit)||u.value.unit,rows:h.value.slice(0,8).map(M=>({name:M.name,value:Number(M.value)||0,unit:M.unit||u.value.unit}))}}),g=he(()=>({key:"industry-overview",type:"iconMetric",rows:KBe})),v=he(()=>({key:"industry-stage-structure",type:"bar",variant:"distribution",rows:ZBe.map(A=>Ve(Le({},A),{extra:A.note}))})),m=he(()=>({key:"industry-chain-flow",type:"line",rows:AX})),y=he(()=>({key:`industry-capacity-${r.value}`,type:"bar",variant:"distribution",rows:c.value.slice(0,7)})),_=he(()=>({key:"industry-financial",type:"column",variant:"slim",rows:rGe})),x=he(()=>({key:`industry-town-${r.value}`,type:"bar",variant:"distribution",rows:h.value.slice(0,7)})),b=he(()=>({key:`industry-health-${r.value}`,type:"heat",rows:QBe[r.value]||[]})),S=he(()=>({key:`industry-detail-${r.value}`,type:"projectTable",searchPlaceholder:"搜索主体 / 乡镇",emptyText:"无匹配主体",searchKeys:["name","typeName","town","address","products","status"],columns:[{key:"name",label:"主体名称",field:"name",width:"34%"},{key:"type",label:"类型",field:"typeName",width:"18%"},{key:"town",label:"乡镇",field:"town",width:"16%"},{key:"capacity",label:"能力",field:"capacity",width:"18%",align:"right",strong:!0,format:"number",unitField:"capacityUnit"},{key:"status",label:"状态",field:"status",width:"14%"}],rows:f.value}));Ia(()=>{t("module-stats",{moduleKey:"yak-industry-chain",items:YBe}),T()}),ns(()=>{var A,M;l=!0,(M=(A=i.value)==null?void 0:A.destroyMap)==null||M.call(A)});function w(A){r.value=A}function T(){var M,P,D;o=new pv,t("loading-progress",{progress:0}),(P=(M=o.instance)==null?void 0:M.on)==null||P.call(M,"onProgress",(L,R,N)=>{t("loading-progress",{progress:Math.floor(R/(N||1)*100),path:L,itemsLoaded:R,itemsTotal:N})});const A=(L=0)=>$e(this,null,function*(){var N,F;if(l)return;yield Ya();const R=i.value;if((N=R==null?void 0:R.loadMap)==null||N.call(R,o),R!=null&&R.canvasMap){a.value=!0,t("loading-progress",{progress:100}),t("map-ready"),(F=R.play)==null||F.call(R);return}if(L<24){window.setTimeout(()=>A(L+1),120);return}a.value=!0,t("map-ready")});(D=o.ready)==null||D.then(A).catch(()=>{a.value=!0,t("map-ready")})}function C(A){var L,R,N,F;const M=Number(A==null?void 0:A.longitude),P=Number(A==null?void 0:A.latitude);if(!Number.isFinite(M)||!Number.isFinite(P))return;const D=((R=(L=i.value)==null?void 0:L.canvasMap)==null?void 0:R.value)||((N=i.value)==null?void 0:N.canvasMap);(F=D==null?void 0:D.flyToLngLat)==null||F.call(D,[M,P],{duration:.72,statusText:"已定位产业点位"})}return(A,M)=>(Z(),ne("div",iGe,[Ue(dv,{ref_key:"mapSceneRef",ref:i,class:"industry-map-scene","active-layer":dn(s),"map-ranking":p.value},null,8,["active-layer","map-ranking"]),M[1]||(M[1]=E("div",{class:"industry-map-scrim"},null,-1)),a.value?mt("",!0):(Z(),ne("div",aGe,"3D地图加载中")),E("div",sGe,[Ue(Dt,{class:"industry-card left-card",title:"全链核心指标",width:_u,height:xu},{default:Mt(()=>[Ue(Ir,{panel:g.value,compact:""},null,8,["panel"])]),_:1}),Ue(Dt,{class:"industry-card left-card",title:"产业节点结构",width:_u,height:xu},{default:Mt(()=>[Ue(Ir,{panel:v.value,compact:""},null,8,["panel"])]),_:1}),Ue(Dt,{class:"industry-card left-card",title:"链路协同指数",width:_u,height:xu},{default:Mt(()=>[Ue(Ir,{panel:m.value,compact:""},null,8,["panel"])]),_:1}),Ue(Dt,{class:"industry-card left-card",title:`${u.value.name}能力排行`,width:_u,height:xu},{default:Mt(()=>[Ue(Ir,{panel:y.value,compact:""},null,8,["panel"])]),_:1},8,["title"])]),E("div",oGe,[Ue(Dt,{class:"industry-card right-card",title:"加工储备产能",width:_u,height:xu},{default:Mt(()=>[Ue(Ir,{panel:_.value,compact:""},null,8,["panel"])]),_:1}),Ue(Dt,{class:"industry-card right-card",title:`${u.value.name}镇域覆盖`,width:_u,height:xu},{default:Mt(()=>[Ue(Ir,{panel:x.value,compact:""},null,8,["panel"])]),_:1},8,["title"]),Ue(Dt,{class:"industry-card right-card",title:`${u.value.name}运行画像`,width:_u,height:xu},{default:Mt(()=>[Ue(Ir,{panel:b.value,compact:""},null,8,["panel"])]),_:1},8,["title"]),Ue(Dt,{class:"industry-card right-card industry-list-card",title:`${u.value.name}明细`,width:_u,height:xu},{default:Mt(()=>[Ue(Ir,{panel:S.value,compact:"",onRowSelect:C},null,8,["panel"])]),_:1},8,["title"])]),E("div",lGe,[E("div",uGe,[M[0]||(M[0]=E("span",null,"牦牛全产业链",-1)),E("strong",null,ie(u.value.name),1)])]),E("div",cGe,[Ue(YS,{"model-value":r.value,topics:d.value,"onUpdate:modelValue":w},null,8,["model-value","topics"])])]))}},nw="/openApi";function fGe(n,e){return/^https?:\/\//.test(e)?e:`${n}${e.startsWith("/")?e:`/${e}`}`}function rw(n,e,t,r={}){return ol(fGe(n,e),{params:t,timeout:r.timeout}).then(dGe)}function dGe(n){if((n==null?void 0:n.success)===!1||(n==null?void 0:n.code)!==void 0&&![0,200,"0","200"].includes(n.code)){const t=new Error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"接口请求失败");throw t.code=n==null?void 0:n.code,t}return Qt(n)}function pGe(n,e=window.location.hash||window.location.pathname,t="智慧管理"){return rw(nw,"/ai/stat/question",{question:n,pagePath:e,pageName:t},{timeout:45e3})}function vGe(n){return rw(nw,"/ai/balance/targets",{question:n},{timeout:18e3}).then(e=>Array.isArray(e)?e:(e==null?void 0:e.rows)||(e==null?void 0:e.list)||[])}function gGe({areaCode:n,pasturesId:e}={}){return rw(nw,"/ai/balance/advice",{areaCode:n,pasturesId:e},{timeout:18e3})}function mGe(){return rw(nw,"/ai/balance/welcome",void 0,{timeout:12e3})}const yGe="/openApi";function _Ge(n){return/^https?:\/\//.test(n)?n:`${yGe}${n.startsWith("/")?n:`/${n}`}`}function xGe(n){if((n==null?void 0:n.success)===!1||(n==null?void 0:n.code)!==void 0&&![0,200,"0","200"].includes(n.code)){const t=new Error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"图表接口请求失败");throw t.code=n==null?void 0:n.code,t}return Qt(n)}function bGe(r){return $e(this,arguments,function*(n,e=window.location.hash||window.location.pathname,t="智慧管理"){const i=yield ol(_Ge("/ai/stat/charts"),{params:{question:n,pagePath:e,pageName:t},timeout:3e4}).then(xGe);return(Array.isArray(i==null?void 0:i.charts)?i.charts:[]).map(SGe).filter(s=>s.rows.length)})}function SGe(n,e){const t=Array.isArray(n==null?void 0:n.rows)?n.rows:[];return{id:(n==null?void 0:n.id)||`smart-chart-${e}`,type:wGe(n==null?void 0:n.type),title:(n==null?void 0:n.title)||`统计图表${e+1}`,subtitle:(n==null?void 0:n.subtitle)||AGe(n==null?void 0:n.source),unit:(n==null?void 0:n.unit)||"",source:(n==null?void 0:n.source)||{},rows:t.map((r,i)=>({key:(r==null?void 0:r.key)||`${(r==null?void 0:r.name)||"row"}-${i}`,name:String((r==null?void 0:r.name)||`指标${i+1}`),value:MGe(r==null?void 0:r.value),rawValue:r==null?void 0:r.value,unit:(r==null?void 0:r.unit)||(n==null?void 0:n.unit)||"",extra:(r==null?void 0:r.extra)||""})).filter(r=>r.name&&Number.isFinite(r.value))}}function wGe(n){return["pie","donut"].includes(n)?"pie":["line","trend"].includes(n)?"line":"bar"}function AGe(n={}){const e=n.table?`来源:${n.table}`:"来源:openApi 统计库",t=n.period?`,${n.period}`:"";return`${e}${t}`}function MGe(n){if(n==null||n==="")return NaN;const e=Number(String(n).replace(/,/g,"").replace(/%/g,""));return Number.isFinite(e)?e:NaN}const TGe={class:"wisdom-management"},CGe={class:"wisdom-chat"},EGe={key:0,class:"wisdom-empty-state"},PGe={class:"wisdom-prompt-grid"},LGe=["disabled","onClick"],RGe={key:0,class:"wisdom-message-mark"},DGe={class:"wisdom-bubble"},IGe={key:0,class:"wisdom-steps"},NGe={key:1,class:"wisdom-digesting"},kGe={key:2,class:"wisdom-chart-list"},OGe={key:3,class:"wisdom-insight-list"},FGe=["innerHTML"],BGe={key:5,class:"wisdom-stream-caret"},GGe={key:6,class:"wisdom-suggestion-list"},zGe=["disabled","onClick"],UGe={key:7,class:"wisdom-choice-list"},VGe=["disabled","onClick"],HGe={class:"wisdom-input-shell"},WGe=["disabled"],$Ge=["disabled"],jGe={key:0,class:"wisdom-button-loading"},qGe={__name:"index",setup(n){const e=mY({loader:()=>yY(()=>import("./SmartChartRenderer-bbd6b2e2-1782661552655.js"),["./SmartChartRenderer-bbd6b2e2-1782661552655.js","./index-1782661552655.js","./index-b8a77371-balabala-1782661552655.css","./SmartChartRenderer-8fd37aa6-balabala-1782661552655.css"],import.meta.url),loadingComponent:{template:'<div class="smart-chart-loading">正在绘制统计图表</div>'}}),t=Be(""),r=Be([]),i=Be(!1),a=Be(null),s=Be("可以直接询问牦牛数量、草地面积、牧户情况、饲草产量、林地面积、基地分布、畜群结构和交易流通等统计问题。"),o=[{label:"牦牛分布",question:"牦牛分布"},{label:"畜群结构",question:"牦牛结构占比"},{label:"草地面积",question:"草地面积分布"},{label:"草畜平衡",question:"红原县草畜平衡建议"},{label:"湿地类型",question:"湿地类型结构"},{label:"公益林保护",question:"公益林保护等级统计"}];let l=null;Ia(()=>{mGe().then(F=>{const O=(F==null?void 0:F.value)||(F==null?void 0:F.text)||F;typeof O=="string"&&O.trim()&&(s.value=O)}).catch(()=>{})}),ns(()=>{M()});function u(){return`${Date.now()}-${Math.random().toString(16).slice(2)}`}function c(){return $e(this,arguments,function*(F=t.value){const O=String(F||"").trim();if(!O||i.value)return;const H={id:u(),role:"user",text:O},U={id:u(),role:"assistant",steps:[`正在理解:${O}`],digesting:!0,digestText:"小牧正在匹配业务数据",visibleText:"",fullText:"",streaming:!1,choices:[],charts:[],insights:[],suggestions:[]};if(r.value=[...r.value,H,U],t.value="",i.value=!0,yield R(),g(O)){yield f(O,U.id);return}yield h(O,U.id)})}function h(F,O){return $e(this,null,function*(){w(O,{digestText:"正在理解问题并查询统计库"});const H=pGe(F,window.location.hash||window.location.pathname,"智慧管理"),U=bGe(F,window.location.hash||window.location.pathname,"智慧管理"),[$,Y]=yield Promise.allSettled([H,U]),oe=Y.status==="fulfilled"?Y.value||[]:[],X=Y.status==="rejected"?Y.reason:null;if($.status==="fulfilled"){const re=$.value,_e=(re==null?void 0:re.answer)||"小牧暂时没有查到相关统计数据,可以换一种说法再问一次。",Fe=[`正在理解:${F}`,"已查询统计库","已生成统计回答"];oe.length?Fe.push(`已生成 ${oe.length} 个数据图表`):X&&Fe.push("图表生成暂时不可用"),w(O,{digesting:!1,steps:Fe,insights:oe.length?b(oe):[],suggestions:S(F,oe),allowFollowUp:!0}),A(O,X?`${_e}
**图表状态**
- ${C(X,"图表接口暂时不可用,已先返回文字分析。")}`:_e,oe);return}if(oe.length){w(O,{digesting:!1,steps:[`正在理解:${F}`,"已查询统计库",`已生成 ${oe.length} 个数据图表`,"文字分析暂时不可用"],insights:b(oe),suggestions:S(F,oe),allowFollowUp:!0}),A(O,"文字分析服务暂时没有返回结果,已按统计库真实数据生成可视化图表。",oe);return}T(O,C($.reason,"小牧暂时没有获取到统计结果,请稍后再试。"))})}function f(F,O){return $e(this,null,function*(){w(O,{digestText:"正在检索草畜平衡对象"});try{const H=yield vGe(F),U=v(H);if(!U.length){w(O,{digesting:!1,steps:[`正在理解:${F}`,"未匹配到草畜平衡对象"]}),A(O,"暂时没有匹配到对应的区域或牧户。可以输入更明确的乡镇、村名、牧户或牧场名称,例如“红原县草畜平衡建议”。");return}if(U.length>1){w(O,{digesting:!1,steps:[`正在理解:${F}`,"已匹配多个对象,请选择一个继续"],choices:U.slice(0,8)}),i.value=!1;return}yield p(U[0],O)}catch(H){T(O,C(H,"草畜平衡对象检索失败,请稍后再试。"))}})}function d(F){return $e(this,null,function*(){if(i.value)return;const O=F.name||F.label||"草畜平衡建议",H={id:u(),role:"user",text:O},U={id:u(),role:"assistant",steps:[`已选择:${O}`],digesting:!0,digestText:"正在消化草畜平衡数据",visibleText:"",fullText:"",streaming:!1,choices:[],charts:[],insights:[],suggestions:[]};r.value=[...r.value,H,U],i.value=!0,yield R(),yield p(F,U.id)})}function p(F,O){return $e(this,null,function*(){const H=(F==null?void 0:F.name)||(F==null?void 0:F.label)||"该区域",U=m(F);w(O,{steps:[`已锁定:${H}`,"正在消化草畜平衡数据"],digestText:"正在生成平衡建议"});try{const $=yield gGe(U);w(O,{digesting:!1,steps:[`已锁定:${H}`,"已生成草畜平衡建议"]}),A(O,y(H,$||{}))}catch($){T(O,C($,"小牧刚才没有消化成功,请稍后再问一次。"))}})}function g(F){return/草畜|平衡|承载|载畜|超载|放牧压力|轮牧|休牧|牧场建议|牧户建议/.test(F)}function v(F=[]){return F.map((O,H)=>({key:(O==null?void 0:O.key)||(O==null?void 0:O.type)||"area_code",value:(O==null?void 0:O.value)||(O==null?void 0:O.id)||(O==null?void 0:O.code)||(O==null?void 0:O.areaCode)||(O==null?void 0:O.pasturesId),name:(O==null?void 0:O.name)||(O==null?void 0:O.label)||(O==null?void 0:O.areaName)||(O==null?void 0:O.pasturesName)||`对象${H+1}`,raw:O})).filter(O=>O.value||O.name==="红原县")}function m(F){return(F==null?void 0:F.key)==="pasturesId"||(F==null?void 0:F.key)==="pastures_id"?{pasturesId:F.value}:{areaCode:(F==null?void 0:F.value)||"513233"}}function y(F,O={}){const H=_(O,["areaRange","arearange","area_range","area","acreage"],0),U=_(O,["yakNumber","yaknumber","yak_number","livestock_capacity","livestockCapacity","livestockcapacity"],0),$=_(O,["level","conclusion"],"暂无等级"),Y=_(O,["overloadRate","overloadrate","overload_rate"],0),oe=_(O,["advice","balanceAdvice","balanceadvice","balance_advice"],"暂无建议,请稍后再试。");return`**${F}草畜平衡建议**
- 草地面积:${x(H)} 亩
- 牦牛/载畜量:${x(U)} 头
- 草畜平衡等级:${$}
- 超载率:${x(Y)}%
**建议**
${oe}`}function _(F,O,H=""){for(const U of O){const $=F==null?void 0:F[U];if($!=null&&$!=="")return $}return H}function x(F){const O=Number(String(F).replace(/,/g,""));return Number.isFinite(O)?O.toLocaleString("zh-CN",{maximumFractionDigits:2}):F||"--"}function b(F=[]){const O=[];return F.slice(0,2).forEach(H=>{var Fe;const U=(H.rows||[]).map(Ce=>Ve(Le({},Ce),{value:Number(Ce.value)})).filter(Ce=>Ce.name&&Number.isFinite(Ce.value));if(!U.length)return;const $=H.unit||((Fe=U.find(Ce=>Ce.unit))==null?void 0:Fe.unit)||"",Y=U.slice().sort((Ce,Ae)=>Ae.value-Ce.value),oe=U.reduce((Ce,Ae)=>Ce+Ae.value,0),X=oe/U.length,re=Y[0],_e=Y[Y.length-1];O.push({label:"最高",value:`${re.name} ${x(re.value)}${$}`,note:H.title}),U.length>2&&O.push({label:H.type==="pie"?"占比项":"最低",value:`${_e.name} ${x(_e.value)}${$}`,note:H.type==="pie"?"最小结构项":"低值区域"}),O.push({label:"合计",value:`${x(oe)}${$}`,note:U.length>1?`覆盖 ${U.length} 项`:H.title}),H.type!=="pie"&&U.length>1&&O.push({label:"均值",value:`${x(X)}${$}`,note:"按当前图表项计算"})}),O.slice(0,4)}function S(F,O=[]){const H=String(F||""),U=[],$=(Y,oe)=>{!U.some(X=>X.question===oe)&&oe!==H&&U.push({label:Y,question:oe})};return(/牦牛|畜群|存栏|牛/.test(H)||O.some(Y=>{var oe,X;return(X=(oe=Y.source)==null?void 0:oe.localKey)==null?void 0:X.includes("yak")}))&&($("看畜群结构","牦牛结构占比"),$("看存栏预测","牦牛存栏预测"),$("看交易结构","牦牛交易结构")),/草地|草原|饲草|鲜草/.test(H)&&($("看草地健康","草地健康占比"),$("看生产力","草地生产力分布"),$("看退化统计","草地退化统计")),/湿地/.test(H)&&($("看湿地类型","湿地类型结构"),$("看湿地级别","湿地级别面积统计")),/林地|公益林|森林/.test(H)&&($("看权属结构","林地权属结构"),$("看公益林等级","公益林保护等级统计")),/草畜|平衡|承载|载畜/.test(H)&&($("看牦牛分布","牦牛分布"),$("看草地面积","草地面积分布")),$("换个图表",`${H} 图表`),U.slice(0,3)}function w(F,O,H=!0){r.value=r.value.map(U=>U.id===F?Le(Le({},U),O):U),H&&R()}function T(F,O){w(F,{digesting:!1,steps:["请求已结束"]}),A(F,O)}function C(F,O){const H=String((F==null?void 0:F.message)||"");return(F==null?void 0:F.code)===401||(F==null?void 0:F.code)==="401"||(F==null?void 0:F.code)==="HTTP_401"||/未登录|授权|Unauthorized|HTTP 401/i.test(H)?"接口需要登录授权。当前智慧管理不会使用假数据,请先完成平台登录或使用 openApi 统计库口径继续问数。":(F==null?void 0:F.code)==="REQUEST_TIMEOUT"||/timeout|timed out|超时/i.test(H)?"服务响应时间较长,请稍后再试,或换一个更具体的问题。":(F==null?void 0:F.code)==="REQUEST_ABORTED"||/aborted|abort|signal/i.test(H)?"本次请求被中断了,请重新发送一次。":/Failed to fetch|NetworkError|Load failed|HTTP 50|HTTP 40/i.test(H)||/[a-zA-Z]{4,}/.test(H)?O:H||O}function A(F,O,H=[]){M();const U=String(O||""),$=U.length>1200?36:U.length>700?24:14;let Y=0;const oe=H.length>0;w(F,{fullText:U,visibleText:"",streaming:!0,choices:[],charts:H}),oe&&N();const X=()=>{if(Y=Math.min(Y+$,U.length),w(F,{visibleText:U.slice(0,Y),streaming:Y<U.length},!oe),Y>=U.length){l=null,H.length&&w(F,{charts:H},!1),i.value=!1;return}l=window.setTimeout(X,18)};l=window.setTimeout(X,0)}function M(){l&&(window.clearTimeout(l),l=null)}function P(F){const O=L(F).split(/\r?\n/),H=[];let U=[],$=!1;const Y=()=>{U.length&&(H.push(`<${$?"ol":"ul"}>${U.map(oe=>`<li>${D(oe)}</li>`).join("")}</${$?"ol":"ul"}>`),U=[],$=!1)};return O.forEach(oe=>{const X=oe.trim();if(!X){Y();return}const re=X.match(/^#{1,4}\s+(.+)$/)||X.match(/^\*\*(.+)\*\*$/);if(re){Y(),H.push(`<h3>${D(re[1])}</h3>`);return}const _e=X.match(/^\d+[.)、]\s+(.+)$/),Fe=X.match(/^[-*]\s+(.+)$/);if(_e||Fe){const Ce=!!_e;U.length&&$!==Ce&&Y(),$=Ce,U.push(_e?_e[1]:Fe[1]);return}Y(),H.push(`<p>${D(X)}</p>`)}),Y(),H.join("")}function D(F){return F.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>")}function L(F){return String(F||"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function R(){return $e(this,null,function*(){yield Ya(),window.requestAnimationFrame(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})})}function N(){return $e(this,null,function*(){yield Ya(),window.requestAnimationFrame(()=>{const F=a.value,O=F==null?void 0:F.querySelector(".wisdom-message.is-assistant:last-child .wisdom-chart-list");if(!F||!O)return;const H=F.getBoundingClientRect(),U=O.getBoundingClientRect();F.scrollTop+=U.top-H.top-12})})}return(F,O)=>(Z(),ne("div",TGe,[O[11]||(O[11]=Fh('<div class="wisdom-backdrop" aria-hidden="true"><div class="wisdom-grid"></div><div class="wisdom-orbit wisdom-orbit-a"></div><div class="wisdom-orbit wisdom-orbit-b"></div><div class="wisdom-scan"></div></div>',1)),E("main",CGe,[E("div",{ref_key:"dialogueRef",ref:a,class:Ct(["wisdom-dialogue",{"is-empty":!r.value.length}])},[r.value.length?mt("",!0):(Z(),ne("section",EGe,[O[3]||(O[3]=E("div",{class:"wisdom-empty-mark"},[E("span"),E("strong",null,"AI")],-1)),O[4]||(O[4]=E("h2",null,"智慧管理问答",-1)),E("p",null,ie(s.value),1),E("div",PGe,[(Z(),ne(et,null,ut(o,H=>E("button",{key:H.question,type:"button",disabled:i.value,onClick:U=>c(H.question)},ie(H.label),9,LGe)),64))])])),(Z(!0),ne(et,null,ut(r.value,H=>{var U,$,Y,oe,X;return Z(),ne("article",{key:H.id,class:Ct(["wisdom-message",`is-${H.role}`])},[H.role==="assistant"?(Z(),ne("div",RGe,[...O[5]||(O[5]=[E("span",null,"牧",-1)])])):mt("",!0),E("div",DGe,[H.role==="user"?(Z(),ne(et,{key:0},[jn(ie(H.text),1)],64)):(Z(),ne(et,{key:1},[(U=H.steps)!=null&&U.length?(Z(),ne("div",IGe,[(Z(!0),ne(et,null,ut(H.steps,re=>(Z(),ne("div",{key:re,class:"wisdom-step"},[O[6]||(O[6]=E("span",null,null,-1)),jn(ie(re),1)]))),128))])):mt("",!0),H.digesting?(Z(),ne("div",NGe,[O[7]||(O[7]=E("span",null,null,-1)),O[8]||(O[8]=E("span",null,null,-1)),O[9]||(O[9]=E("span",null,null,-1)),E("em",null,ie(H.digestText||"小牧正在消化中"),1)])):mt("",!0),($=H.charts)!=null&&$.length?(Z(),ne("div",kGe,[(Z(!0),ne(et,null,ut(H.charts,re=>(Z(),wi(dn(e),{key:re.id,chart:re,onReady:R},null,8,["chart"]))),128))])):mt("",!0),(Y=H.insights)!=null&&Y.length?(Z(),ne("div",OGe,[(Z(!0),ne(et,null,ut(H.insights,re=>(Z(),ne("div",{key:`${re.label}-${re.value}`,class:"wisdom-insight-item"},[E("span",null,ie(re.label),1),E("strong",null,ie(re.value),1),E("em",null,ie(re.note),1)]))),128))])):mt("",!0),H.visibleText?(Z(),ne("div",{key:4,class:"wisdom-answer",innerHTML:P(H.visibleText)},null,8,FGe)):mt("",!0),H.streaming?(Z(),ne("span",BGe)):mt("",!0),(oe=H.suggestions)!=null&&oe.length&&(H.allowFollowUp||!H.digesting&&!H.streaming)?(Z(),ne("div",GGe,[(Z(!0),ne(et,null,ut(H.suggestions,re=>(Z(),ne("button",{key:re.question,type:"button",disabled:i.value,onClick:_e=>c(re.question)},ie(re.label),9,zGe))),128))])):mt("",!0),(X=H.choices)!=null&&X.length?(Z(),ne("div",UGe,[(Z(!0),ne(et,null,ut(H.choices,(re,_e)=>(Z(),ne("button",{key:`${re.key||"choice"}-${re.value||_e}`,type:"button",disabled:i.value,onClick:Fe=>d(re)},ie(re.name||re.label||re.value),9,VGe))),128))])):mt("",!0)],64))])],2)}),128))],2),E("form",{class:"wisdom-input-bar",onSubmit:O[2]||(O[2]=da(H=>c(),["prevent"]))},[E("div",HGe,[O[10]||(O[10]=E("span",{class:"wisdom-input-icon"},null,-1)),Hr(E("input",{"onUpdate:modelValue":O[0]||(O[0]=H=>t.value=H),disabled:i.value,autocomplete:"off",placeholder:"输入牧户、区域或草畜平衡问题",onKeydown:O[1]||(O[1]=Kd(da(H=>c(),["prevent"]),["enter"]))},null,40,WGe),[[xh,t.value]]),E("button",{type:"submit",disabled:i.value||!t.value.trim()},[i.value?(Z(),ne("span",jGe)):mt("",!0),E("span",null,ie(i.value?"消化中":"发送"),1)],8,$Ge)])],32)])]))}},Gb=[{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:"ready"},{key:"yak-management",label:"牦牛管理",bottomLabel:"牦牛管理",status:"ready"},{key:"pasture-management",label:"牧场管理",bottomLabel:"牧场管理",status:"ready"},{key:"yak-industry-chain",label:"牦牛产业全链",bottomLabel:"产业全链",status:"ready"},{key:"smart-management",label:"智慧管理",bottomLabel:"智慧管理",status:"ready"}];function XGe(n){return Gb.find(e=>e.key===n)||Gb[1]}const YGe={key:0,class:"platform-module-pane"},KGe={key:1,class:"platform-module-pane"},ZGe={key:2,class:"platform-module-pane"},QGe={key:3,class:"platform-module-pane"},JGe={key:4,class:"platform-module-pane"},eze={key:5,class:"platform-module-pane"},tze={key:6,class:"platform-module-pane"},nze={key:7,class:"platform-module-pane"},rze={class:"large-screen-wrap"},ize={class:"m-header-tools"},aze={class:"m-header-date"},sze={class:"top-menu"},oze={key:0,class:"top-menu-mid-space"},lze={key:1,class:"module-coming"},uze={class:"module-coming-title"},cze={key:2,class:"bottom-tray"},hze={class:"bottom-menu"},fze=["onClick"],dze={key:8,class:"loading platform-loading"},pze={class:"loading-progress"},vze={class:"value"},gze=1200,mze={__name:"index",setup(n){const e=Be("home"),t=Be("national-park"),r=Be({home:!0}),i=Be({}),a=Be(""),s=Be(""),o=Be(!0),l=Be(0);let u=null,c=null,h=!1;const f=Date.now(),d={progress:0},p=["xiaoshoujine","zongxiaoliang","xiaoshoujine","zongxiaoliang"],g=he(()=>XGe(e.value)),v=he(()=>e.value==="ecological-protection"?vG:Gb),m=he(()=>e.value==="ecological-protection"?t.value:e.value),y=he(()=>{const N=i.value[e.value];return Array.isArray(N)||N!=null&&N.length?N:M([{zh:"草地总面积",en:"",value:756.43,unit:"万亩",decimals:2},{zh:"林地总面积",en:"",value:177.92,unit:"万亩",decimals:2},{zh:"湿地面积",en:"",value:291.82,unit:"万亩",decimals:2}])});Ia(()=>{c=Ub.init({dh:1080,dw:1920,el:"#large-screen",resize:!0}),L(),D(),u=window.setInterval(D,1e3)}),ns(()=>{var N;u&&window.clearInterval(u),(N=c==null?void 0:c.off)==null||N.call(c,"#large-screen"),Mr.killTweensOf(d)});function _(N){P(N),e.value=N,Ya(L)}function x(N){if(e.value==="ecological-protection"){b(N.key),Ya(L);return}_(N.key)}function b(N){t.value=vG.some(F=>F.key===N)?N:"national-park",Ya(L)}function S(N){const F=N.moduleKey||(N.topicKey?"forest-grass-wet":e.value);i.value=Ve(Le({},i.value),{[F]:M(N.items||[])})}function w(N={}){const F=typeof N=="number"?N:N.progress;C(F)}function T(){Mr.killTweensOf(d),d.progress=100,l.value=100;const N=Date.now()-f,F=Math.max(180,gze-N);window.setTimeout(A,F)}function C(N){if(!o.value)return;const F=Math.max(0,Math.min(100,Math.floor(Number(N)||0)));F<l.value||Mr.to(d,{progress:F,duration:.35,ease:"power2.out",onUpdate:()=>{l.value=Math.floor(d.progress)}})}function A(){if(!o.value||h)return;h=!0;const N=Mr.timeline({onComplete:()=>{o.value=!1}});N.to(".platform-loading .loading-text span",{y:"200%",opacity:0,ease:"power4.inOut",duration:1.4,stagger:.14}),N.to(".platform-loading .loading-progress",{opacity:0,ease:"power4.inOut",duration:1.2},"<"),N.to(".platform-loading",{opacity:0,ease:"power4.inOut",duration:.8},"-=0.55")}function M(N=[]){return N.slice(0,4).map((F,O)=>{var $;const H=Number(F.value)||0,U={zh:F.zh||F.name||`指标${O+1}`,en:F.en||"",value:H,unit:F.unit||"",decimals:($=F.decimals)!=null?$:Number.isInteger(H)?0:2};return Le({icon:p[O%p.length]},U)})}function P(N){["home","forest-grass-wet","ecological-protection","grass-livestock-balance","yak-management","pasture-management","yak-industry-chain","smart-management"].includes(N)&&(r.value[N]||(r.value=Ve(Le({},r.value),{[N]:!0})))}function D(){const N=new Date,F=O=>`${O}`.padStart(2,"0");a.value=`${N.getFullYear()}-${F(N.getMonth()+1)}-${F(N.getDate())}`,s.value=`${F(N.getHours())}:${F(N.getMinutes())}:${F(N.getSeconds())}`}function L(){window.scrollTo(0,0),document.documentElement.scrollTop=0,document.body.scrollTop=0;const N=document.querySelector("#app");N&&(N.scrollTop=0)}function R(){_Y()}return(N,F)=>(Z(),ne("div",{class:Ct(["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-grass-livestock-balance":g.value.key==="grass-livestock-balance","is-yak-management":g.value.key==="yak-management","is-pasture-management":g.value.key==="pasture-management","is-yak-industry-chain":g.value.key==="yak-industry-chain","is-smart-management":g.value.key==="smart-management"}]),id:"large-screen"},[r.value.home?Hr((Z(),ne("div",YGe,[Ue(hDe,{onLoadingProgress:w,onMapReady:T,onModuleStats:S})],512)),[[tu,g.value.key==="home"]]):mt("",!0),r.value["forest-grass-wet"]?Hr((Z(),ne("div",KGe,[Ue(HDe,{"show-loading":!1,onTopicStats:S})],512)),[[tu,g.value.key==="forest-grass-wet"]]):mt("",!0),r.value["ecological-protection"]?Hr((Z(),ne("div",ZGe,[Ue(xFe,{"active-view":t.value,"show-loading":!1,onModuleStats:S,onViewChange:b},null,8,["active-view"])],512)),[[tu,g.value.key==="ecological-protection"]]):mt("",!0),r.value["grass-livestock-balance"]?Hr((Z(),ne("div",QGe,[Ue(C8e,{onLoadingProgress:w,onMapReady:T,onModuleStats:S})],512)),[[tu,g.value.key==="grass-livestock-balance"]]):mt("",!0),r.value["yak-management"]?Hr((Z(),ne("div",JGe,[Ue(EBe,{onModuleStats:S})],512)),[[tu,g.value.key==="yak-management"]]):mt("",!0),r.value["pasture-management"]?Hr((Z(),ne("div",eze,[Ue($Be,{onLoadingProgress:w,onMapReady:T,onModuleStats:S})],512)),[[tu,g.value.key==="pasture-management"]]):mt("",!0),r.value["yak-industry-chain"]?Hr((Z(),ne("div",tze,[Ue(hGe,{onLoadingProgress:w,onMapReady:T,onModuleStats:S})],512)),[[tu,g.value.key==="yak-industry-chain"]]):mt("",!0),r.value["smart-management"]?Hr((Z(),ne("div",nze,[Ue(qGe)],512)),[[tu,g.value.key==="smart-management"]]):mt("",!0),E("div",rze,[Ue(nZ,{title:"红原县数字畜牧业监管平台","sub-text":"Hongyuan Digital Animal Husbandry Supervision Platform"},{right:Mt(()=>[E("div",ize,[E("div",aze,[E("span",null,ie(a.value),1),E("span",null,ie(s.value),1)]),E("button",{class:"logout-button",title:"退出登录",type:"button",onClick:R}," 退出 ")])]),_:1}),E("div",sze,[Ue(iZ,{"default-active":e.value,onSelect:_},{default:Mt(()=>[(Z(!0),ne(et,null,ut(dn(Gb),(O,H)=>(Z(),ne(et,{key:O.key},[Ue(aZ,{index:O.key},{default:Mt(()=>[jn(ie(O.label),1)]),_:2},1032,["index"]),H===3?(Z(),ne("div",oze)):mt("",!0)],64))),128))]),_:1},8,["default-active"])]),y.value.length&&!["smart-management","grass-livestock-balance"].includes(g.value.key)?(Z(),ne("div",{key:0,class:Ct(["top-count-card",{"is-four":y.value.length>3}])},[(Z(!0),ne(et,null,ut(y.value,O=>(Z(),wi(vZ,{key:O.zh,info:O},null,8,["info"]))),128))],2)):mt("",!0),g.value.status!=="ready"?(Z(),ne("div",lze,[E("div",uze,ie(g.value.label),1),F[0]||(F[0]=E("div",{class:"module-coming-text"},"模块建设中,平台框架已预留入口",-1))])):mt("",!0),["home","forest-grass-wet","ecological-protection","grass-livestock-balance","yak-management","pasture-management","yak-industry-chain","smart-management"].includes(g.value.key)?mt("",!0):(Z(),ne("div",cze,[Ue(px,{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"}),Ue(px,{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"}),F[1]||(F[1]=E("div",{class:"bottom-tray-arrow"},[E("img",{src:ax,alt:""}),E("img",{src:sx,alt:""})],-1)),E("div",hze,[(Z(!0),ne(et,null,ut(v.value,O=>(Z(),ne("div",{key:O.key,class:Ct(["bottom-menu-item",{"is-active":O.key===m.value}]),onClick:H=>x(O)},[E("span",null,ie(O.bottomLabel),1)],10,fze))),128))]),F[2]||(F[2]=E("div",{class:"bottom-tray-arrow is-reverse"},[E("img",{src:ax,alt:""}),E("img",{src:sx,alt:""})],-1))])),F[3]||(F[3]=E("div",{class:"large-screen-left-zsline"},null,-1)),F[4]||(F[4]=E("div",{class:"large-screen-right-zsline"},null,-1))]),o.value?(Z(),ne("div",dze,[F[6]||(F[6]=Fh('<div class="loading-text"><span style="--index:1;">L</span><span style="--index:2;">O</span><span style="--index:3;">A</span><span style="--index:4;">D</span><span style="--index:5;">I</span><span style="--index:6;">N</span><span style="--index:7;">G</span></div>',1)),E("div",pze,[E("span",vze,ie(l.value),1),F[5]||(F[5]=E("span",{class:"unit"},"%",-1))])])):mt("",!0)],2))}},Aze=Object.freeze(Object.defineProperty({__proto__:null,default:mze},Symbol.toStringTag,{value:"Module"}));export{Pr as H,Zr as L,Aze as i};