1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).S2={})}(this,(function(t){"use strict";var e=Object.freeze({__proto__:null,get Base(){return Ei},get Circle(){return bi},get Ellipse(){return Ii},get Image(){return Ai},get Line(){return Ni},get Marker(){return ki},get Path(){return Xi},get Polygon(){return Zi},get Polyline(){return Qi},get Rect(){return to},get Text(){return no}}),n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};
| /*! *****************************************************************************
| 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.
| ***************************************************************************** */function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},i.apply(this,arguments)};var o=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},a={}.toString,s=function(t,e){return a.call(t)==="[object "+e+"]"},l=function(t){return s(t,"Function")},u=function(t){return null==t},c=function(t){return Array.isArray?Array.isArray(t):s(t,"Array")},h=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function d(t,e){if(t)if(c(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(h(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var f=function(t){return"object"==typeof t&&null!==t},p=function(t){if(c(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},v=function(t){if(c(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},g=function(t){return s(t,"String")},y=function(t){return s(t,"Number")};var m=function(t,e){return(t%e+e)%e},C=Math.PI/180,w=function(t){return C*t},x=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return d(t,(function(n,r){l(t)&&"prototype"===r||e.push(n)})),e},S=function(t){var e=function(t){return u(t)?"":t.toString()}(t);return e.charAt(0).toUpperCase()+e.substring(1)};function E(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function _(t,e,n,r){return e&&E(t,e),n&&E(t,n),r&&E(t,r),t}var b,T=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(g(t)||g(e))return!1;if(o(t)||o(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=T(t[r],e[r]));r++);return n}if(f(t)||f(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=T(t[i[r]],e[i[r]]));r++);return n}return!1},L={},I=function(t){return L[t=t||"g"]?L[t]+=1:L[t]=1,t+L[t]},O=function(){};!function(t,e){if(!l(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};n.cache=new Map}((function(t,e){void 0===e&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return b||(b=document.createElement("canvas").getContext("2d")),b.font=[o,a,i,n+"px",r].join(" "),b.measureText(g(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),
| /*! *****************************************************************************
| 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.
| ***************************************************************************** */
| function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}([t],x(e)).join("")}));var R="\t\n\v\f\r \u2028\u2029",A=new RegExp("([a-z])["+R+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+R+"]*,?["+R+"]*)+)","ig"),M=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+R+"]*,?["+R+"]*","ig"),B=function(t){if(!t)return null;if(c(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(A,(function(r,i,o){var a=[],s=i.toLowerCase();if(o.replace(M,(function(t,e){e&&a.push(+e)})),"m"===s&&a.length>2&&(n.push([i].concat(a.splice(0,2))),s="l",i="m"===i?"l":"L"),"o"===s&&1===a.length&&n.push([i,a[0]]),"r"===s)n.push([i].concat(a));else for(;a.length>=e[s]&&(n.push([i].concat(a.splice(0,e[s]))),e[s]););return t})),n},N=function(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?o[3]={x:+t[0],y:+t[1]}:i-2===r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n},D=function(t,e,n,r,i){var o=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var a=Math.PI/180,s=t+n*Math.cos(-r*a),l=t+n*Math.cos(-i*a);o=[["M",s,e+n*Math.sin(-r*a)],["A",n,n,0,+(i-r>180),0,l,e+n*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return o},P=function(t){if(!(t=B(t))||!t.length)return[["M",0,0]];var e,n,r=[],i=0,o=0,a=0,s=0,l=0;"M"===t[0][0]&&(a=i=+t[0][1],s=o=+t[0][2],l++,r[0]=["M",i,o]);for(var u=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),c=void 0,h=void 0,d=l,f=t.length;d<f;d++){if(r.push(c=[]),(e=(h=t[d])[0])!==e.toUpperCase())switch(c[0]=e.toUpperCase(),c[0]){case"A":c[1]=h[1],c[2]=h[2],c[3]=h[3],c[4]=h[4],c[5]=h[5],c[6]=+h[6]+i,c[7]=+h[7]+o;break;case"V":c[1]=+h[1]+o;break;case"H":c[1]=+h[1]+i;break;case"R":for(var p=2,v=(n=[i,o].concat(h.slice(1))).length;p<v;p++)n[p]=+n[p]+i,n[++p]=+n[p]+o;r.pop(),r=r.concat(N(n,u));break;case"O":r.pop(),(n=D(i,o,h[1],h[2])).push(n[0]),r=r.concat(n);break;case"U":r.pop(),r=r.concat(D(i,o,h[1],h[2],h[3])),c=["U"].concat(r[r.length-1].slice(-2));break;case"M":a=+h[1]+i,s=+h[2]+o;break;default:for(p=1,v=h.length;p<v;p++)c[p]=+h[p]+(p%2?i:o)}else if("R"===e)n=[i,o].concat(h.slice(1)),r.pop(),r=r.concat(N(n,u)),c=["R"].concat(h.slice(-2));else if("O"===e)r.pop(),(n=D(i,o,h[1],h[2])).push(n[0]),r=r.concat(n);else if("U"===e)r.pop(),r=r.concat(D(i,o,h[1],h[2],h[3])),c=["U"].concat(r[r.length-1].slice(-2));else for(var g=0,y=h.length;g<y;g++)c[g]=h[g];if("O"!==(e=e.toUpperCase()))switch(c[0]){case"Z":i=+a,o=+s;break;case"H":i=c[1];break;case"V":o=c[1];break;case"M":a=c[c.length-2],s=c[c.length-1];break;default:i=c[c.length-2],o=c[c.length-1]}}return r},k=function(t,e,n,r){return[t,e,n,r,n,r]},z=function(t,e,n,r,i,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]},F=function(t,e,n,r,i,o,a,s,l,u){n===r&&(n+=1);var c,h,d,f,p,v=120*Math.PI/180,g=Math.PI/180*(+i||0),y=[],m=function(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}};if(u)h=u[0],d=u[1],f=u[2],p=u[3];else{t=(c=m(t,e,-g)).x,e=c.y,s=(c=m(s,l,-g)).x,l=c.y,t===s&&e===l&&(s+=1,l+=1);var C=(t-s)/2,w=(e-l)/2,x=C*C/(n*n)+w*w/(r*r);x>1&&(n*=x=Math.sqrt(x),r*=x);var S=n*n,E=r*r,_=(o===a?-1:1)*Math.sqrt(Math.abs((S*E-S*w*w-E*C*C)/(S*w*w+E*C*C)));f=_*n*w/r+(t+s)/2,p=_*-r*C/n+(e+l)/2,h=Math.asin(((e-p)/r).toFixed(9)),d=Math.asin(((l-p)/r).toFixed(9)),h=t<f?Math.PI-h:h,d=s<f?Math.PI-d:d,h<0&&(h=2*Math.PI+h),d<0&&(d=2*Math.PI+d),a&&h>d&&(h-=2*Math.PI),!a&&d>h&&(d-=2*Math.PI)}var b=d-h;if(Math.abs(b)>v){var T=d,L=s,I=l;d=h+v*(a&&d>h?1:-1),s=f+n*Math.cos(d),l=p+r*Math.sin(d),y=F(s,l,n,r,i,0,a,L,I,[d,T,f,p])}b=d-h;var O=Math.cos(h),R=Math.sin(h),A=Math.cos(d),M=Math.sin(d),B=Math.tan(b/4),N=4/3*n*B,D=4/3*r*B,P=[t,e],k=[t+N*R,e-D*O],z=[s+N*M,l-D*A],H=[s,l];if(k[0]=2*P[0]-k[0],k[1]=2*P[1]-k[1],u)return[k,z,H].concat(y);for(var W=[],G=0,U=(y=[k,z,H].concat(y).join().split(",")).length;G<U;G++)W[G]=G%2?m(y[G-1],y[G],g).y:m(y[G],y[G+1],g).x;return W},H=function(t,e){var n,r=P(t),i=e&&P(e),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=[],l=[],u="",c="",h=function(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(F.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"===n||"S"===n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),t=["C",r,i].concat(t.slice(1));break;case"T":"Q"===n||"T"===n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(z(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(z(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(k(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(k(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(k(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(k(e.x,e.y,e.X,e.Y))}return t},d=function(t,e){if(t[e].length>7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(l[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),n=Math.max(r.length,i&&i.length||0)}},f=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],n=Math.max(r.length,i&&i.length||0))};n=Math.max(r.length,i&&i.length||0);for(var p=0;p<n;p++){r[p]&&(u=r[p][0]),"C"!==u&&(s[p]=u,p&&(c=s[p-1])),r[p]=h(r[p],o,c),"A"!==s[p]&&"C"===u&&(s[p]="C"),d(r,p),i&&(i[p]&&(u=i[p][0]),"C"!==u&&(l[p]=u,p&&(c=l[p-1])),i[p]=h(i[p],a,c),"A"!==l[p]&&"C"===u&&(l[p]="C"),d(i,p)),f(r,i,o,a,p),f(i,r,a,o,p);var v=r[p],g=i&&i[p],y=v.length,m=i&&g.length;o.x=v[y-2],o.y=v[y-1],o.bx=parseFloat(v[y-4])||o.x,o.by=parseFloat(v[y-3])||o.y,a.bx=i&&(parseFloat(g[m-4])||a.x),a.by=i&&(parseFloat(g[m-3])||a.y),a.x=i&&g[m-2],a.y=i&&g[m-1]}return i?[r,i]:r},W=/,?([a-z]),?/gi,G=function(t){return t.join(",").replace(W,"$1")},U=function(t,e,n,r,i){return t*(t*(-3*e+9*n-9*r+3*i)+6*e-12*n+6*r)-3*e+3*n},Y=function(t,e,n,r,i,o,a,s,l){null===l&&(l=1);for(var u=(l=l>1?1:l<0?0:l)/2,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,f=0;f<12;f++){var p=u*c[f]+u,v=U(p,t,n,i,a),g=U(p,e,r,o,s),y=v*v+g*g;d+=h[f]*Math.sqrt(y)}return u*d},j=function(t,e,n,r,i,o,a,s){for(var l,u,c,h,d=[],f=[[],[]],p=0;p<2;++p)if(0===p?(u=6*t-12*n+6*i,l=-3*t+9*n-9*i+3*a,c=3*n-3*t):(u=6*e-12*r+6*o,l=-3*e+9*r-9*o+3*s,c=3*r-3*e),Math.abs(l)<1e-12){if(Math.abs(u)<1e-12)continue;(h=-c/u)>0&&h<1&&d.push(h)}else{var v=u*u-4*c*l,g=Math.sqrt(v);if(!(v<0)){var y=(-u+g)/(2*l);y>0&&y<1&&d.push(y);var m=(-u-g)/(2*l);m>0&&m<1&&d.push(m)}}for(var C,w=d.length,x=w;w--;)C=1-(h=d[w]),f[0][w]=C*C*C*t+3*C*C*h*n+3*C*h*h*i+h*h*h*a,f[1][w]=C*C*C*e+3*C*C*h*r+3*C*h*h*o+h*h*h*s;return f[0][x]=t,f[1][x]=e,f[0][x+1]=a,f[1][x+1]=s,f[0].length=f[1].length=x+2,{min:{x:Math.min.apply(0,f[0]),y:Math.min.apply(0,f[1])},max:{x:Math.max.apply(0,f[0]),y:Math.max.apply(0,f[1])}}},V=function(t,e,n,r,i,o,a,s){if(!(Math.max(t,n)<Math.min(i,a)||Math.min(t,n)>Math.max(i,a)||Math.max(e,r)<Math.min(o,s)||Math.min(e,r)>Math.max(o,s))){var l=(t-n)*(o-s)-(e-r)*(i-a);if(l){var u=((t*r-e*n)*(i-a)-(t-n)*(i*s-o*a))/l,c=((t*r-e*n)*(o-s)-(e-r)*(i*s-o*a))/l,h=+u.toFixed(2),d=+c.toFixed(2);if(!(h<+Math.min(t,n).toFixed(2)||h>+Math.max(t,n).toFixed(2)||h<+Math.min(i,a).toFixed(2)||h>+Math.max(i,a).toFixed(2)||d<+Math.min(e,r).toFixed(2)||d>+Math.max(e,r).toFixed(2)||d<+Math.min(o,s).toFixed(2)||d>+Math.max(o,s).toFixed(2)))return{x:u,y:c}}}},X=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},K=function(t,e,n,r,i){if(i)return[["M",+t+ +i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]];return o.parsePathArray=G,o},q=function(t,e,n,r){return null===t&&(t=e=n=r=0),null===e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:Math.min(n,r)/2,r2:Math.max(n,r)/2,r0:Math.sqrt(n*n+r*r)/2,path:K(t,e,n,r),vb:[t,e,n,r].join(" ")}},Z=function(t,e,n,r,i,o,a,s){c(t)||(t=[t,e,n,r,i,o,a,s]);var l=j.apply(null,t);return q(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},$=function(t,e,n,r,i,o,a,s,l){var u=1-l,c=Math.pow(u,3),h=Math.pow(u,2),d=l*l,f=d*l,p=t+2*l*(n-t)+d*(i-2*n+t),v=e+2*l*(r-e)+d*(o-2*r+e),g=n+2*l*(i-n)+d*(a-2*i+n),y=r+2*l*(o-r)+d*(s-2*o+r);return{x:c*t+3*h*l*n+3*u*l*l*i+f*a,y:c*e+3*h*l*r+3*u*l*l*o+f*s,m:{x:p,y:v},n:{x:g,y:y},start:{x:u*t+l*n,y:u*e+l*r},end:{x:u*i+l*a,y:u*o+l*s},alpha:90-180*Math.atan2(p-g,v-y)/Math.PI}},Q=function(t,e,n){if(!function(t,e){return t=q(t),e=q(e),X(e,t.x,t.y)||X(e,t.x2,t.y)||X(e,t.x,t.y2)||X(e,t.x2,t.y2)||X(t,e.x,e.y)||X(t,e.x2,e.y)||X(t,e.x,e.y2)||X(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)}(Z(t),Z(e)))return n?0:[];for(var r=~~(Y.apply(0,t)/8),i=~~(Y.apply(0,e)/8),o=[],a=[],s={},l=n?0:[],u=0;u<r+1;u++){var c=$.apply(0,t.concat(u/r));o.push({x:c.x,y:c.y,t:u/r})}for(u=0;u<i+1;u++){c=$.apply(0,e.concat(u/i));a.push({x:c.x,y:c.y,t:u/i})}for(u=0;u<r;u++)for(var h=0;h<i;h++){var d=o[u],f=o[u+1],p=a[h],v=a[h+1],g=Math.abs(f.x-d.x)<.001?"y":"x",y=Math.abs(v.x-p.x)<.001?"y":"x",m=V(d.x,d.y,f.x,f.y,p.x,p.y,v.x,v.y);if(m){if(s[m.x.toFixed(4)]===m.y.toFixed(4))continue;s[m.x.toFixed(4)]=m.y.toFixed(4);var C=d.t+Math.abs((m[g]-d[g])/(f[g]-d[g]))*(f.t-d.t),w=p.t+Math.abs((m[y]-p[y])/(v[y]-p[y]))*(v.t-p.t);C>=0&&C<=1&&w>=0&&w<=1&&(n?l+=1:l.push({x:m.x,y:m.y,t1:C,t2:w}))}}return l};function J(t,e){var n=[],r=[];return t.length&&function t(e,i){if(1===e.length)n.push(e[0]),r.push(e[0]);else{for(var o=[],a=0;a<e.length-1;a++)0===a&&n.push(e[0]),a===e.length-2&&r.push(e[a+1]),o[a]=[(1-i)*e[a][0]+i*e[a+1][0],(1-i)*e[a][1]+i*e[a+1][1]];t(o,i)}}(t,e),{left:n,right:r.reverse()}}var tt=function(t,e,n){if(1===n)return[[].concat(t)];var r=[];if("L"===e[0]||"C"===e[0]||"Q"===e[0])r=r.concat(function(t,e,n){var r=[[t[1],t[2]]];n=n||2;var i=[];"A"===e[0]?(r.push(e[6]),r.push(e[7])):"C"===e[0]?(r.push([e[1],e[2]]),r.push([e[3],e[4]]),r.push([e[5],e[6]])):"S"===e[0]||"Q"===e[0]?(r.push([e[1],e[2]]),r.push([e[3],e[4]])):r.push([e[1],e[2]]);for(var o=r,a=1/n,s=0;s<n-1;s++){var l=J(o,a/(1-a*s));i.push(l.left),o=l.right}return i.push(o),i.map((function(t){var e=[];return 4===t.length&&(e.push("C"),e=e.concat(t[2])),t.length>=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e.concat(t[t.length-1])}))}(t,e,n));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=n-1;o++)r.push(i)}return r},et=function(t,e){if(t.length!==e.length)return!1;var n=!0;return d(t,(function(t,r){if(t!==e[r])return n=!1,!1})),n};function nt(t,e,n){var r=null,i=n;return e<i&&(i=e,r="add"),t<i&&(i=t,r="del"),{type:r,min:i}}var rt=function(t,e){var n=function(t,e){var n,r,i=t.length,o=e.length,a=0;if(0===i||0===o)return null;for(var s=[],l=0;l<=i;l++)s[l]=[],s[l][0]={min:l};for(var u=0;u<=o;u++)s[0][u]={min:u};for(l=1;l<=i;l++)for(n=t[l-1],u=1;u<=o;u++){r=e[u-1],a=et(n,r)?0:1;var c=s[l-1][u].min+1,h=s[l][u-1].min+1,d=s[l-1][u-1].min+a;s[l][u]=nt(c,h,d)}return s}(t,e),r=t.length,i=e.length,o=[],a=1,s=1;if(n[r][i].min!==r){for(var l=1;l<=r;l++){var u=n[l][l].min;s=l;for(var c=a;c<=i;c++)n[l][c].min<u&&(u=n[l][c].min,s=c);a=s,n[l][a].type&&o.push({index:l-1,type:n[l][a].type})}for(l=o.length-1;l>=0;l--)a=o[l].index,"add"===o[l].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var h=i-(r=t.length);if(r<i)for(l=0;l<h;l++)"z"===t[r-1][0]||"Z"===t[r-1][0]?t.splice(r-2,0,t[r-2]):t.push(t[r-1]),r+=1;return t};function it(t,e,n){for(var r,i=[].concat(t),o=1/(n+1),a=ot(e)[0],s=1;s<=n;s++)o*=s,0===(r=Math.floor(t.length*o))?i.unshift([a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]):i.splice(r,0,[a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]);return i}function ot(t){var e=[];switch(t[0]){case"M":case"L":case"T":e.push([t[1],t[2]]);break;case"A":e.push([t[6],t[7]]);break;case"Q":case"S":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"C":e.push([t[5],t[6]]),e.push([t[1],t[2]]),e.push([t[3],t[4]]);break;case"H":case"V":e.push([t[1],t[1]])}return e}var at=function(t,e){if(t.length<=1)return t;for(var n,r=0;r<e.length;r++)if(t[r][0]!==e[r][0])switch(n=ot(t[r]),e[r][0]){case"M":t[r]=["M"].concat(n[0]);break;case"L":t[r]=["L"].concat(n[0]);break;case"A":t[r]=[].concat(e[r]),t[r][6]=n[0][0],t[r][7]=n[0][1];break;case"Q":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=it(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=it(n,t[r-1],2)}t[r]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=it(n,t[r-1],1)}t[r]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[r]=e[r]}return t},st=Object.freeze({__proto__:null,catmullRomToBezier:N,fillPath:function(t,e){if(1===t.length)return t;var n=t.length-1,r=e.length-1,i=n/r,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a<r-n;a++)t.push(t[0]);return t}for(a=0;a<r;a++){var s=Math.floor(i*a);o[s]=(o[s]||0)+1}var l=o.reduce((function(e,r,i){return i===n?e.concat(t[n]):e.concat(tt(t[i],t[i+1],r))}),[]);return l.unshift(t[0]),"Z"!==e[r]&&"z"!==e[r]||l.push("Z"),l},fillPathByDiff:rt,formatPath:at,intersection:function(t,e){return function(t,e,n){var r,i,o,a,s,l,u,c,h,d;t=H(t),e=H(e);for(var f=n?0:[],p=0,v=t.length;p<v;p++){var g=t[p];if("M"===g[0])r=s=g[1],i=l=g[2];else{"C"===g[0]?(h=[r,i].concat(g.slice(1)),r=h[6],i=h[7]):(h=[r,i,r,i,s,l,s,l],r=s,i=l);for(var y=0,m=e.length;y<m;y++){var C=e[y];if("M"===C[0])o=u=C[1],a=c=C[2];else{"C"===C[0]?(d=[o,a].concat(C.slice(1)),o=d[6],a=d[7]):(d=[o,a,o,a,u,c,u,c],o=u,a=c);var w=Q(h,d,n);if(n)f+=w;else{for(var x=0,S=w.length;x<S;x++)w[x].segment1=p,w[x].segment2=y,w[x].bez1=h,w[x].bez2=d;f=f.concat(w)}}}}}return f}(t,e)},parsePathArray:G,parsePathString:B,pathToAbsolute:P,pathToCurve:H,rectPath:K}),lt=function(){function t(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return t.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.toString=function(){return"[Event (type="+this.type+")]"},t.prototype.save=function(){},t.prototype.restore=function(){},t}(),ut=function(t,e){return ut=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},ut(t,e)};function ct(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ut(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var ht=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}();function dt(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}var ft="undefined"!=typeof window&&void 0!==window.document;function pt(t,e){if(t.isCanvas())return!0;for(var n=e.getParent(),r=!1;n;){if(n===t){r=!0;break}n=n.getParent()}return r}function vt(t){return t.cfg.visible&&t.cfg.capture}var gt=function(t){function e(e){var n=t.call(this)||this;n.destroyed=!1;var r=n.getDefaultCfg();return n.cfg=_(r,e),n}return ct(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,e){this.cfg[t]=e},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(ht),yt=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},mt=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},Ct=function(t){this.version=t,this.type="node",this.name="node",this.os=process.platform},wt=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},xt=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},St=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},Et=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,_t=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],bt=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Tt(t){var e=function(t){return""!==t&&_t.reduce((function(e,n){var r=n[0],i=n[1];if(e)return e;var o=i.exec(t);return!!o&&[r,o]}),!1)}(t);if(!e)return null;var n=e[0],r=e[1];if("searchbot"===n)return new xt;var i=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);i?i.length<3&&(i=yt(yt([],i,!0),function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-i.length),!0)):i=[];var o=i.join("."),a=function(t){for(var e=0,n=bt.length;e<n;e++){var r=bt[e],i=r[0];if(r[1].exec(t))return i}return null}(t),s=Et.exec(t);return s&&s[1]?new wt(n,o,a,s[1]):new mt(n,o,a)}var Lt,It="undefined"!=typeof Float32Array?Float32Array:Array;function Ot(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=n[0],f=n[1],p=n[2],v=n[3],g=n[4],y=n[5],m=n[6],C=n[7],w=n[8];return t[0]=d*r+f*a+p*u,t[1]=d*i+f*s+p*c,t[2]=d*o+f*l+p*h,t[3]=v*r+g*a+y*u,t[4]=v*i+g*s+y*c,t[5]=v*o+g*l+y*h,t[6]=m*r+C*a+w*u,t[7]=m*i+C*s+w*c,t[8]=m*o+C*l+w*h,t}function Rt(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function At(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return function(t,e){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1}(r,n),Ot(t,r,e)}function Mt(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1}(r,n),Ot(t,r,e)}function Bt(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return function(t,e){t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1}(r,n),Ot(t,r,e)}function Nt(t,e,n){return Ot(t,n,e)}function Dt(t,e){for(var n=t?[].concat(t):[1,0,0,0,1,0,0,0,1],r=0,i=e.length;r<i;r++){var o=e[r];switch(o[0]){case"t":At(n,n,[o[1],o[2]]);break;case"s":Bt(n,n,[o[1],o[2]]);break;case"r":Mt(n,n,o[1]);break;case"m":Nt(n,n,o[1])}}return n}function Pt(t,e){var n=[],r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=e[0],f=e[1],p=e[2],v=e[3],g=e[4],y=e[5],m=e[6],C=e[7],w=e[8];return n[0]=d*r+f*a+p*u,n[1]=d*i+f*s+p*c,n[2]=d*o+f*l+p*h,n[3]=v*r+g*a+y*u,n[4]=v*i+g*s+y*c,n[5]=v*o+g*l+y*h,n[6]=m*r+C*a+w*u,n[7]=m*i+C*s+w*c,n[8]=m*o+C*l+w*h,n}function kt(t,e){var n=[],r=e[0],i=e[1];return n[0]=t[0]*r+t[3]*i+t[6],n[1]=t[1]*r+t[4]*i+t[7],n}function zt(t){var e=[],n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=c*a-s*u,d=-c*o+s*l,f=u*o-a*l,p=n*h+r*d+i*f;return p?(p=1/p,e[0]=h*p,e[1]=(-c*r+i*u)*p,e[2]=(s*r-i*a)*p,e[3]=d*p,e[4]=(c*n-i*l)*p,e[5]=(-s*n+i*o)*p,e[6]=f*p,e[7]=(-u*n+r*l)*p,e[8]=(a*n-r*o)*p,e):null}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),Lt=new It(3),It!=Float32Array&&(Lt[0]=0,Lt[1]=0,Lt[2]=0),function(){var t=function(){var t=new It(2);return It!=Float32Array&&(t[0]=0,t[1]=0),t}()}();var Ft=Dt,Ht="matrix",Wt=["zIndex","capture","visible","type"],Gt=["repeat"];function Ut(t,e){var n={},r=e.attrs;for(var i in t)n[i]=r[i];return n}function Yt(t,e){var n={},r=e.attr();return d(t,(function(t,e){-1!==Gt.indexOf(e)||T(r[e],t)||(n[e]=t)})),n}function jt(t,e){if(e.onFrame)return t;var n=e.startTime,r=e.delay,i=e.duration,o=Object.prototype.hasOwnProperty;return d(t,(function(t){n+r<t.startTime+t.delay+t.duration&&i>t.delay&&d(e.toAttrs,(function(e,n){o.call(t.toAttrs,n)&&(delete t.toAttrs[n],delete t.fromAttrs[n])}))})),t}var Vt=function(t){function e(e){var n=t.call(this,e)||this;n.attrs={};var r=n.getDefaultAttrs();return _(r,e.attrs),n.attrs=r,n.initAttrs(r),n.initAnimate(),n}return ct(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],i=e[1];if(!r)return this.attrs;if(h(r)){for(var o in r)this.setAttr(o,r[o]);return this.afterAttrsChange(r),this}return 2===e.length?(this.setAttr(r,i),this.afterAttrsChange(((t={})[r]=i,t)),this):this.attrs[r]},e.prototype.isClipped=function(t,e){var n=this.getClip();return n&&!n.isHit(t,e)},e.prototype.setAttr=function(t,e){var n=this.attrs[t];n!==e&&(this.attrs[t]=e,this.onAttrChange(t,e,n))},e.prototype.onAttrChange=function(t,e,n){"matrix"===t&&this.set("totalMatrix",null)},e.prototype.afterAttrsChange=function(t){if(this.cfg.isClipShape){var e=this.cfg.applyTo;e&&e.onCanvasChange("clip")}else this.onCanvasChange("attr")},e.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},e.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},e.prototype.setZIndex=function(t){this.set("zIndex",t);var e=this.getParent();return e&&e.sort(),this},e.prototype.toFront=function(){var t=this.getParent();if(t){var e=t.getChildren();this.get("el");var n=e.indexOf(this);e.splice(n,1),e.push(this),this.onCanvasChange("zIndex")}},e.prototype.toBack=function(){var t=this.getParent();if(t){var e=t.getChildren();this.get("el");var n=e.indexOf(this);e.splice(n,1),e.unshift(this),this.onCanvasChange("zIndex")}},e.prototype.remove=function(t){void 0===t&&(t=!0);var e=this.getParent();e?(dt(e.getChildren(),this),e.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},e.prototype.resetMatrix=function(){this.attr(Ht,this.getDefaultMatrix()),this.onCanvasChange("matrix")},e.prototype.getMatrix=function(){return this.attr(Ht)},e.prototype.setMatrix=function(t){this.attr(Ht,t),this.onCanvasChange("matrix")},e.prototype.getTotalMatrix=function(){var t=this.cfg.totalMatrix;if(!t){var e=this.attr("matrix"),n=this.cfg.parentMatrix;t=n&&e?Pt(n,e):e||n,this.set("totalMatrix",t)}return t},e.prototype.applyMatrix=function(t){var e=this.attr("matrix"),n=null;n=t&&e?Pt(t,e):e||t,this.set("totalMatrix",n),this.set("parentMatrix",t)},e.prototype.getDefaultMatrix=function(){return null},e.prototype.applyToMatrix=function(t){var e=this.attr("matrix");return e?kt(e,t):t},e.prototype.invertFromMatrix=function(t){var e=this.attr("matrix");if(e){var n=zt(e);if(n)return kt(n,t)}return t},e.prototype.setClip=function(t){var e=this.getCanvas(),n=null;if(t){var r=this.getShapeBase()[S(t.type)];r&&(n=new r({type:t.type,isClipShape:!0,applyTo:this,attrs:t.attrs,canvas:e}))}return this.set("clipShape",n),this.onCanvasChange("clip"),n},e.prototype.getClip=function(){var t=this.cfg.clipShape;return t||null},e.prototype.clone=function(){var t=this,e=this.attrs,n={};d(e,(function(t,r){c(e[r])?n[r]=function(t){for(var e=[],n=0;n<t.length;n++)c(t[n])?e.push([].concat(t[n])):e.push(t[n]);return e}(e[r]):n[r]=e[r]}));var r=new(0,this.constructor)({attrs:n});return d(Wt,(function(e){r.set(e,t.get(e))})),r},e.prototype.destroy=function(){this.destroyed||(this.attrs={},t.prototype.destroy.call(this))},e.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},e.prototype.animate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(this.get("timeline")||this.get("canvas")){this.set("animating",!0);var n=this.get("timeline");n||(n=this.get("canvas").get("timeline"),this.set("timeline",n));var r=this.get("animations")||[];n.timer||n.initTimer();var i,o,a,s,u,c=t[0],d=t[1],f=t[2],p=void 0===f?"easeLinear":f,v=t[3],g=void 0===v?O:v,m=t[4],C=void 0===m?0:m;l(c)?(i=c,c={}):h(c)&&c.onFrame&&(i=c.onFrame,o=c.repeat),h(d)?(d=(u=d).duration,p=u.easing||"easeLinear",C=u.delay||0,o=u.repeat||o||!1,g=u.callback||O,a=u.pauseCallback||O,s=u.resumeCallback||O):(y(g)&&(C=g,g=null),l(p)?(g=p,p="easeLinear"):p=p||"easeLinear");var w=Yt(c,this),x={fromAttrs:Ut(w,this),toAttrs:w,duration:d,easing:p,repeat:o,callback:g,pauseCallback:a,resumeCallback:s,delay:C,startTime:n.getTime(),id:I(),onFrame:i,pathFormatted:!1};r.length>0?r=jt(r,x):n.addAnimator(this),r.push(x),this.set("animations",r),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0),d(this.get("animations"),(function(n){t&&(n.onFrame?e.attr(n.onFrame(1)):e.attr(n.toAttrs)),n.callback&&n.callback()})),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return d(e,(function(t){t._paused=!0,t._pauseTime=n,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),n=this.get("_pause").pauseTime;return d(e,(function(e){e.startTime=e.startTime+(t-n),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var n,r=this,i=e.propagationPath;this.getEvents(),"mouseenter"===t?n=e.fromShape:"mouseleave"===t&&(n=e.toShape);for(var o=function(t){var o=i[t],s=o.get("name");if(s){if((o.isGroup()||o.isCanvas&&o.isCanvas())&&n&&pt(o,n))return"break";c(s)?d(s,(function(t){r.emitDelegateEvent(o,t,e)})):a.emitDelegateEvent(o,s,e)}},a=this,s=0;s<i.length;s++){if("break"===o(s))break}},e.prototype.emitDelegateEvent=function(t,e,n){var r=this.getEvents(),i=e+":"+n.type;(r[i]||r["*"])&&(n.name=i,n.currentTarget=t,n.delegateTarget=this,n.delegateObject=t.get("delegateObject"),this.emit(i,n))},e.prototype.translate=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var n=this.getMatrix(),r=Ft(n,[["t",t,e]]);return this.setMatrix(r),this},e.prototype.move=function(t,e){var n=this.attr("x")||0,r=this.attr("y")||0;return this.translate(t-n,e-r),this},e.prototype.moveTo=function(t,e){return this.move(t,e)},e.prototype.scale=function(t,e){var n=this.getMatrix(),r=Ft(n,[["s",t,e||t]]);return this.setMatrix(r),this},e.prototype.rotate=function(t){var e=this.getMatrix(),n=Ft(e,[["r",t]]);return this.setMatrix(n),this},e.prototype.rotateAtStart=function(t){var e=this.attr(),n=e.x,r=e.y,i=this.getMatrix(),o=Ft(i,[["t",-n,-r],["r",t],["t",n,r]]);return this.setMatrix(o),this},e.prototype.rotateAtPoint=function(t,e,n){var r=this.getMatrix(),i=Ft(r,[["t",-t,-e],["r",n],["t",t,e]]);return this.setMatrix(i),this},e}(gt),Xt={};function Kt(t,e){if(t.set("canvas",e),t.isGroup()){var n=t.get("children");n.length&&n.forEach((function(t){Kt(t,e)}))}}function qt(t,e){if(t.set("timeline",e),t.isGroup()){var n=t.get("children");n.length&&n.forEach((function(t){qt(t,e)}))}}var Zt,$t,Qt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ct(e,t),e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,i=[],o=[],a=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return a.length>0?(d(a,(function(t){var e=t.getBBox();i.push(e.minX,e.maxX),o.push(e.minY,e.maxY)})),t=v(i),e=p(i),n=v(o),r=p(o)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,i=[],o=[],a=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return a.length>0?(d(a,(function(t){var e=t.getCanvasBBox();i.push(e.minX,e.maxX),o.push(e.minY,e.maxY)})),t=v(i),e=p(i),n=v(o),r=p(o)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,n,r){if(t.prototype.onAttrChange.call(this,e,n,r),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var r=this.getTotalMatrix();r!==n&&this._applyChildrenMarix(r)},e.prototype._applyChildrenMarix=function(t){d(this.getChildren(),(function(e){e.applyMatrix(t)}))},e.prototype.addShape=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],r=t[1];h(n)?r=n:r.type=n;var i=Xt[r.type];i||(i=S(r.type),Xt[r.type]=i);var o=this.getShapeBase(),a=new o[i](r);return this.add(a),a},e.prototype.addGroup=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=t[0],i=t[1];if(l(r))n=new r(i||{parent:this});else{var o=r||{},a=this.getGroupBase();n=new a(o)}return this.add(n),n},e.prototype.getCanvas=function(){return this.isCanvas()?this:this.get("canvas")},e.prototype.getShape=function(t,e,n){if(!vt(this))return null;var r,i=this.getChildren();if(this.isCanvas())r=this._findShape(i,t,e,n);else{var o=[t,e,1];o=this.invertFromMatrix(o),this.isClipped(o[0],o[1])||(r=this._findShape(i,o[0],o[1],n))}return r},e.prototype._findShape=function(t,e,n,r){for(var i=null,o=t.length-1;o>=0;o--){var a=t[o];if(vt(a)&&(a.isGroup()?i=a.getShape(e,n,r):a.isHit(e,n)&&(i=a)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),r=this.get("timeline"),i=t.getParent();i&&function(t,e,n){void 0===n&&(n=!0),n?e.destroy():(e.set("parent",null),e.set("canvas",null)),dt(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&Kt(t,e),r&&qt(t,r),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t,e=this.getChildren();d(e,(function(t,e){return t._INDEX=e,t})),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,n){var r=t(e,n);return 0===r?e._INDEX-n._INDEX:r})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[];return d(this.getChildren(),(function(n){t(n)&&e.push(n),n.isGroup()&&(e=e.concat(n.findAll(t)))})),e},e.prototype.find=function(t){var e=null;return d(this.getChildren(),(function(n){if(t(n)?e=n:n.isGroup()&&(e=n.find(t)),e)return!1})),e},e.prototype.findById=function(t){return this.find((function(e){return e.get("id")===t}))},e.prototype.findByClassName=function(t){return this.find((function(e){return e.get("className")===t}))},e.prototype.findAllByName=function(t){return this.findAll((function(e){return e.get("name")===t}))},e}(Vt),Jt=0,te=0,ee=0,ne=0,re=0,ie=0,oe="object"==typeof performance&&performance.now?performance:Date,ae="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function se(){return re||(ae(le),re=oe.now()+ie)}function le(){re=0}function ue(){this._call=this._time=this._next=null}function ce(t,e,n){var r=new ue;return r.restart(t,e,n),r}function he(){re=(ne=oe.now())+ie,Jt=te=0;try{!function(){se(),++Jt;for(var t,e=Zt;e;)(t=re-e._time)>=0&&e._call.call(null,t),e=e._next;--Jt}()}finally{Jt=0,function(){var t,e,n=Zt,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Zt=e);$t=t,fe(r)}(),re=0}}function de(){var t=oe.now(),e=t-ne;e>1e3&&(ie-=e,ne=t)}function fe(t){Jt||(te&&(te=clearTimeout(te)),t-re>24?(t<1/0&&(te=setTimeout(he,t-oe.now()-ie)),ee&&(ee=clearInterval(ee))):(ee||(ne=oe.now(),ee=setInterval(de,1e3)),Jt=1,ae(he)))}function pe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ve(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ge(){}ue.prototype=ce.prototype={constructor:ue,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?se():+n)+(null==e?0:+e),this._next||$t===this||($t?$t._next=this:Zt=this,$t=this),this._call=t,this._time=n,fe()},stop:function(){this._call&&(this._call=null,this._time=1/0,fe())}};var ye=.7,me=1/ye,Ce="\\s*([+-]?\\d+)\\s*",we="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",xe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Se=/^#([0-9a-f]{3,8})$/,Ee=new RegExp("^rgb\\("+[Ce,Ce,Ce]+"\\)$"),_e=new RegExp("^rgb\\("+[xe,xe,xe]+"\\)$"),be=new RegExp("^rgba\\("+[Ce,Ce,Ce,we]+"\\)$"),Te=new RegExp("^rgba\\("+[xe,xe,xe,we]+"\\)$"),Le=new RegExp("^hsl\\("+[we,xe,xe]+"\\)$"),Ie=new RegExp("^hsla\\("+[we,xe,xe,we]+"\\)$"),Oe={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};function Re(){return this.rgb().formatHex()}function Ae(){return this.rgb().formatRgb()}function Me(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Se.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Be(e):3===n?new ke(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ne(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ne(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Ee.exec(t))?new ke(e[1],e[2],e[3],1):(e=_e.exec(t))?new ke(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=be.exec(t))?Ne(e[1],e[2],e[3],e[4]):(e=Te.exec(t))?Ne(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Le.exec(t))?We(e[1],e[2]/100,e[3]/100,1):(e=Ie.exec(t))?We(e[1],e[2]/100,e[3]/100,e[4]):Oe.hasOwnProperty(t)?Be(Oe[t]):"transparent"===t?new ke(NaN,NaN,NaN,0):null}function Be(t){return new ke(t>>16&255,t>>8&255,255&t,1)}function Ne(t,e,n,r){return r<=0&&(t=e=n=NaN),new ke(t,e,n,r)}function De(t){return t instanceof ge||(t=Me(t)),t?new ke((t=t.rgb()).r,t.g,t.b,t.opacity):new ke}function Pe(t,e,n,r){return 1===arguments.length?De(t):new ke(t,e,n,null==r?1:r)}function ke(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ze(){return"#"+He(this.r)+He(this.g)+He(this.b)}function Fe(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function He(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function We(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ue(t,e,n,r)}function Ge(t){if(t instanceof Ue)return new Ue(t.h,t.s,t.l,t.opacity);if(t instanceof ge||(t=Me(t)),!t)return new Ue;if(t instanceof Ue)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ue(a,s,l,t.opacity)}function Ue(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ye(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function je(t){return function(){return t}}function Ve(t){return 1==(t=+t)?Xe:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):je(isNaN(e)?n:e)}}function Xe(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):je(isNaN(t)?e:t)}pe(ge,Me,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Re,formatHex:Re,formatHsl:function(){return Ge(this).formatHsl()},formatRgb:Ae,toString:Ae}),pe(ke,Pe,ve(ge,{brighter:function(t){return t=null==t?me:Math.pow(me,t),new ke(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?ye:Math.pow(ye,t),new ke(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ze,formatHex:ze,formatRgb:Fe,toString:Fe})),pe(Ue,(function(t,e,n,r){return 1===arguments.length?Ge(t):new Ue(t,e,n,null==r?1:r)}),ve(ge,{brighter:function(t){return t=null==t?me:Math.pow(me,t),new Ue(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?ye:Math.pow(ye,t),new Ue(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ke(Ye(t>=240?t-240:t+120,i,r),Ye(t,i,r),Ye(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Ke=function t(e){var n=Ve(e);function r(t,e){var r=n((t=Pe(t)).r,(e=Pe(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Xe(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function qe(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}}function Ze(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function $e(t,e){return(Ze(e)?qe:Qe)(t,e)}function Qe(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=an(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}function Je(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function tn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function en(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=an(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var nn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,rn=new RegExp(nn.source,"g");function on(t,e){var n,r,i,o=nn.lastIndex=rn.lastIndex=0,a=-1,s=[],l=[];for(t+="",e+="";(n=nn.exec(t))&&(r=rn.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:tn(n,r)})),o=rn.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,r=0;r<e;++r)s[(n=l[r]).i]=n.x(t);return s.join("")})}function an(t,e){var n,r=typeof e;return null==e||"boolean"===r?je(e):("number"===r?tn:"string"===r?(n=Me(e))?(e=n,Ke):on:e instanceof Me?Ke:e instanceof Date?Je:Ze(e)?qe:Array.isArray(e)?Qe:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?en:tn)(t,e)}function sn(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function ln(t){return t*t*t}function un(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var cn=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),hn=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),dn=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),fn=Math.PI,pn=fn/2;function vn(t){return(1-Math.cos(fn*t))/2}function gn(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function yn(t){return((t*=2)<=1?gn(1-t):2-gn(t-1))/2}function mn(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Cn=4/11,wn=7.5625;function xn(t){return(t=+t)<Cn?wn*t*t:t<.7272727272727273?wn*(t-=.5454545454545454)*t+.75:t<.9090909090909091?wn*(t-=.8181818181818182)*t+.9375:wn*(t-=.9545454545454546)*t+.984375}var Sn=1.70158,En=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(Sn),_n=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(Sn),bn=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(Sn),Tn=2*Math.PI,Ln=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Tn);function i(t){return e*gn(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*Tn)},i.period=function(n){return t(e,n)},i}(1,.3),In=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Tn);function i(t){return 1-e*gn(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*Tn)},i.period=function(n){return t(e,n)},i}(1,.3),On=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Tn);function i(t){return((t=2*t-1)<0?e*gn(-t)*Math.sin((r-t)/n):2-e*gn(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*Tn)},i.period=function(n){return t(e,n)},i}(1,.3),Rn=Object.freeze({__proto__:null,easeLinear:function(t){return+t},easeQuad:sn,easeQuadIn:function(t){return t*t},easeQuadOut:function(t){return t*(2-t)},easeQuadInOut:sn,easeCubic:un,easeCubicIn:ln,easeCubicOut:function(t){return--t*t*t+1},easeCubicInOut:un,easePoly:dn,easePolyIn:cn,easePolyOut:hn,easePolyInOut:dn,easeSin:vn,easeSinIn:function(t){return 1==+t?1:1-Math.cos(t*pn)},easeSinOut:function(t){return Math.sin(t*pn)},easeSinInOut:vn,easeExp:yn,easeExpIn:function(t){return gn(1-+t)},easeExpOut:function(t){return 1-gn(t)},easeExpInOut:yn,easeCircle:mn,easeCircleIn:function(t){return 1-Math.sqrt(1-t*t)},easeCircleOut:function(t){return Math.sqrt(1- --t*t)},easeCircleInOut:mn,easeBounce:xn,easeBounceIn:function(t){return 1-xn(1-t)},easeBounceOut:xn,easeBounceInOut:function(t){return((t*=2)<=1?1-xn(1-t):xn(t-1)+1)/2},easeBack:bn,easeBackIn:En,easeBackOut:_n,easeBackInOut:bn,easeElastic:In,easeElasticIn:Ln,easeElasticOut:In,easeElasticInOut:On}),An={};var Mn=[1,0,0,0,1,0,0,0,1];function Bn(t,e,n){var r,i=e.startTime;if(n<i+e.delay||e._paused)return!1;var o,a=e.duration,s=e.easing,u=An[(o=s).toLowerCase()]||Rn[o];if(n=n-i-e.delay,e.repeat)r=u(r=n%a/a);else{if(!((r=n/a)<1))return e.onFrame?t.attr(e.onFrame(1)):t.attr(e.toAttrs),!0;r=u(r)}if(e.onFrame){var c=e.onFrame(r);t.attr(c)}else!function(t,e,n){var r={},i=e.fromAttrs,o=e.toAttrs;if(!t.destroyed){var a,s;for(var u in o)if(!T(i[u],o[u]))if("path"===u){var c=o[u],h=i[u];c.length>h.length?(c=B(o[u]),h=B(i[u]),h=rt(h,c),h=at(h,c),e.fromAttrs.path=h,e.toAttrs.path=c):e.pathFormatted||(c=B(o[u]),h=B(i[u]),h=at(h,c),e.fromAttrs.path=h,e.toAttrs.path=c,e.pathFormatted=!0),r[u]=[];for(var d=0;d<c.length;d++){for(var f=c[d],p=h[d],v=[],g=0;g<f.length;g++)y(f[g])&&p&&y(p[g])?(a=an(p[g],f[g]),v.push(a(n))):v.push(f[g]);r[u].push(v)}}else if("matrix"===u){var m=$e(i[u]||Mn,o[u]||Mn)(n);r[u]=m}else["fill","stroke","fillStyle","strokeStyle"].includes(u)&&(s=o[u],/^[r,R,L,l]{1}[\s]*\(/.test(s))?r[u]=o[u]:l(o[u])||(a=an(i[u],o[u]),r[u]=a(n));t.attr(r)}}(t,e,r);return!1}var Nn=function(){function t(t){this.animators=[],this.current=0,this.timer=null,this.canvas=t}return t.prototype.initTimer=function(){var t,e,n,r=this;this.timer=ce((function(i){if(r.current=i,r.animators.length>0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],Bn(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),Dn=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function Pn(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function kn(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&pt(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var zn,Fn=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");d(Dn,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");d(Dn,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new lt(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=r.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,l=n.timeStamp-this.mousedownTimeStamp,u=a.clientX-t.clientX,c=a.clientY-t.clientY;l>120||u*u+c*c>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,Pn(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||kn(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{Pn(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),Hn=zn?Tt(zn):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new St:"undefined"!=typeof navigator?Tt(navigator.userAgent):"undefined"!=typeof process&&process.version?new Ct(process.version.slice(1)):null,Wn=Hn&&"firefox"===Hn.name,Gn=function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return ct(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");g(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new Fn({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new Nn(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");ft&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");ft&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(Wn&&!u(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!u(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(Qt),Un=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ct(e,t),e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=this.getChildren(),r=0;r<n.length;r++){var i=n[r];e.add(i.clone())}return e},e}(Qt),Yn=function(t){function e(e){return t.call(this,e)||this}return ct(e,t),e.prototype._isInBBox=function(t,e){var n=this.getBBox();return n.minX<=t&&n.maxX>=t&&n.minY<=e&&n.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,r=t.minY,i=t.maxX,o=t.maxY;if(e){var a=kt(e,[t.minX,t.minY]),s=kt(e,[t.maxX,t.minY]),l=kt(e,[t.minX,t.maxY]),u=kt(e,[t.maxX,t.maxY]);n=Math.min(a[0],s[0],l[0],u[0]),i=Math.max(a[0],s[0],l[0],u[0]),r=Math.min(a[1],s[1],l[1],u[1]),o=Math.max(a[1],s[1],l[1],u[1])}var c=this.attrs;if(c.shadowColor){var h=c.shadowBlur,d=void 0===h?0:h,f=c.shadowOffsetX,p=void 0===f?0:f,v=c.shadowOffsetY,g=void 0===v?0:v,y=n-d+p,m=i+d+p,C=r-d+g,w=o+d+g;n=Math.min(n,y),i=Math.max(i,m),r=Math.min(r,C),o=Math.max(o,w)}return{x:n,y:r,minX:n,minY:r,maxX:i,maxY:o,width:i-n,height:o-r}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),r=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(n&&n.isHit(o,a))return!0;if(r&&r.isHit(o,a))return!0}return!1},e}(Vt),jn=new Map;function Vn(t,e){jn.set(t,e)}function Xn(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}}function Kn(t){var e=t.attr(),n=e.x,r=e.y,i=e.r;return{x:n-i,y:r-i,width:2*i,height:2*i}}function qn(t){return Math.min.apply(null,t)}function Zn(t){return Math.max.apply(null,t)}function $n(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Qn(t,e){return Math.abs(t-e)<.001}function Jn(t,e){var n=qn(t),r=qn(e);return{x:n,y:r,width:Zn(t)-n,height:Zn(e)-r}}function tr(t){return(t+2*Math.PI)%(2*Math.PI)}var er={box:function(t,e,n,r){return Jn([t,n],[e,r])},length:function(t,e,n,r){return $n(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var a=(n-t)*(i-t)+(r-e)*(o-e);return a<0?$n(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?$n(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var l=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(l,s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function nr(t,e,n,r,i,o){var a,s=1/0,l=[n,r],u=20;o&&o>200&&(u=o/10);for(var c=1/u,h=c/10,d=0;d<=u;d++){var f=d*c,p=[i.apply(null,t.concat([f])),i.apply(null,e.concat([f]))];(m=$n(l[0],l[1],p[0],p[1]))<s&&(a=f,s=m)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(d=0;d<32&&!(h<1e-4);d++){var g=a-h,y=a+h,m=(p=[i.apply(null,t.concat([g])),i.apply(null,e.concat([g]))],$n(l[0],l[1],p[0],p[1]));if(g>=0&&m<s)a=g,s=m;else{var C=[i.apply(null,t.concat([y])),i.apply(null,e.concat([y]))],w=$n(l[0],l[1],C[0],C[1]);y<=1&&w<s?(a=y,s=w):h*=.5}}return{x:i.apply(null,t.concat([a])),y:i.apply(null,e.concat([a]))}}function rr(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function ir(t,e,n){var r=t+n-2*e;if(Qn(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function or(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function ar(t,e,n,r,i,o,a){var s=rr(t,n,i,a),l=rr(e,r,o,a),u=er.pointAt(t,e,n,r,a),c=er.pointAt(n,r,i,o,a);return[[t,e,u.x,u.y,s,l],[s,l,c.x,c.y,i,o]]}function sr(t,e,n,r,i,o,a){if(0===a)return($n(t,e,n,r)+$n(n,r,i,o)+$n(t,e,i,o))/2;var s=ar(t,e,n,r,i,o,.5),l=s[0],u=s[1];return l.push(a-1),u.push(a-1),sr.apply(null,l)+sr.apply(null,u)}var lr={box:function(t,e,n,r,i,o){var a=ir(t,n,i)[0],s=ir(e,r,o)[0],l=[t,i],u=[e,o];return void 0!==a&&l.push(rr(t,n,i,a)),void 0!==s&&u.push(rr(e,r,o,s)),Jn(l,u)},length:function(t,e,n,r,i,o){return sr(t,e,n,r,i,o,3)},nearestPoint:function(t,e,n,r,i,o,a,s){return nr([t,n,i],[e,r,o],a,s,rr)},pointDistance:function(t,e,n,r,i,o,a,s){var l=this.nearestPoint(t,e,n,r,i,o,a,s);return $n(l.x,l.y,a,s)},interpolationAt:rr,pointAt:function(t,e,n,r,i,o,a){return{x:rr(t,n,i,a),y:rr(e,r,o,a)}},divide:function(t,e,n,r,i,o,a){return ar(t,e,n,r,i,o,a)},tangentAngle:function(t,e,n,r,i,o,a){var s=or(t,n,i,a),l=or(e,r,o,a);return tr(Math.atan2(l,s))}};function ur(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function cr(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function hr(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,l=6*t-12*e+6*n,u=3*e-3*t,c=[];if(Qn(s,0))Qn(l,0)||(i=-u/l)>=0&&i<=1&&c.push(i);else{var h=l*l-4*s*u;Qn(h,0)?c.push(-l/(2*s)):h>0&&(o=(-l-(a=Math.sqrt(h)))/(2*s),(i=(-l+a)/(2*s))>=0&&i<=1&&c.push(i),o>=0&&o<=1&&c.push(o))}return c}function dr(t,e,n,r,i,o,a,s,l){var u=ur(t,n,i,a,l),c=ur(e,r,o,s,l),h=er.pointAt(t,e,n,r,l),d=er.pointAt(n,r,i,o,l),f=er.pointAt(i,o,a,s,l),p=er.pointAt(h.x,h.y,d.x,d.y,l),v=er.pointAt(d.x,d.y,f.x,f.y,l);return[[t,e,h.x,h.y,p.x,p.y,u,c],[u,c,v.x,v.y,f.x,f.y,a,s]]}function fr(t,e,n,r,i,o,a,s,l){if(0===l)return function(t,e){for(var n=0,r=t.length,i=0;i<r;i++)n+=$n(t[i],e[i],t[(i+1)%r],e[(i+1)%r]);return n/2}([t,n,i,a],[e,r,o,s]);var u=dr(t,e,n,r,i,o,a,s,.5),c=u[0],h=u[1];return c.push(l-1),h.push(l-1),fr.apply(null,c)+fr.apply(null,h)}var pr={extrema:hr,box:function(t,e,n,r,i,o,a,s){for(var l=[t,a],u=[e,s],c=hr(t,n,i,a),h=hr(e,r,o,s),d=0;d<c.length;d++)l.push(ur(t,n,i,a,c[d]));for(d=0;d<h.length;d++)u.push(ur(e,r,o,s,h[d]));return Jn(l,u)},length:function(t,e,n,r,i,o,a,s){return fr(t,e,n,r,i,o,a,s,3)},nearestPoint:function(t,e,n,r,i,o,a,s,l,u,c){return nr([t,n,i,a],[e,r,o,s],l,u,ur,c)},pointDistance:function(t,e,n,r,i,o,a,s,l,u,c){var h=this.nearestPoint(t,e,n,r,i,o,a,s,l,u,c);return $n(h.x,h.y,l,u)},interpolationAt:ur,pointAt:function(t,e,n,r,i,o,a,s,l){return{x:ur(t,n,i,a,l),y:ur(e,r,o,s,l)}},divide:function(t,e,n,r,i,o,a,s,l){return dr(t,e,n,r,i,o,a,s,l)},tangentAngle:function(t,e,n,r,i,o,a,s,l){var u=cr(t,n,i,a,l),c=cr(e,r,o,s,l);return tr(Math.atan2(c,u))}};function vr(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function gr(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}var yr=function(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),l=1/0,u=-1/0,c=[o,a],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var d=s+h;o<a?o<d&&d<a&&c.push(d):a<d&&d<o&&c.push(d)}for(h=0;h<c.length;h++){var f=vr(t,0,n,r,i,c[h]);f<l&&(l=f),f>u&&(u=f)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),v=1/0,g=-1/0,y=[o,a];for(h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var m=p+h;o<a?o<m&&m<a&&y.push(m):a<m&&m<o&&y.push(m)}for(h=0;h<y.length;h++){var C=gr(0,e,n,r,i,y[h]);C<v&&(v=C),C>g&&(g=C)}return{x:l,y:v,width:u-l,height:g-v}};var mr=function(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=$n(r[0],r[1],i[0],i[1])}return e}(t)};function Cr(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}function wr(t,e){var n=t.get("startArrowShape"),r=t.get("endArrowShape");return n&&(e=Cr(e,n.getCanvasBBox())),r&&(e=Cr(e,r.getCanvasBBox())),e}var xr=null;function Sr(){if(!xr){var t=document.createElement("canvas");t.width=1,t.height=1,xr=t.getContext("2d")}return xr}function Er(t,e,n){var r=1;if(g(t)&&(r=t.split("\n").length),r>1){var i=function(t,e){return e?e-t:.14*t}(e,n);return e*r+i*(r-1)}return e}function _r(t){var e=t.fontSize,n=t.fontFamily,r=t.fontWeight;return[t.fontStyle,t.fontVariant,r,e+"px",n].join(" ").trim()}var br=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,Tr=/[^\s\,]+/gi;var Lr="\t\n\v\f\r \u2028\u2029",Ir=new RegExp("([a-z])["+Lr+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Lr+"]*,?["+Lr+"]*)+)","ig"),Or=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+Lr+"]*,?["+Lr+"]*","ig");var Rr=/[a-z]/;function Ar(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function Mr(t){var e=function(t){if(!t)return null;if(c(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(Ir,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(Or,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,r=0;r<e.length;r++){var i=e[r][0];if(Rr.test(i)||["V","H","T","S"].indexOf(i)>=0){n=!0;break}}if(!n)return e;var o=[],a=0,s=0,l=0,u=0,h=0,d=e[0];"M"!==d[0]&&"m"!==d[0]||(l=a=+d[1],u=s=+d[2],h++,o[0]=["M",a,s]);r=h;for(var f=e.length;r<f;r++){var p=e[r],v=o[r-1],g=[],y=(i=p[0]).toUpperCase();if(i!==y)switch(g[0]=y,y){case"A":g[1]=p[1],g[2]=p[2],g[3]=p[3],g[4]=p[4],g[5]=p[5],g[6]=+p[6]+a,g[7]=+p[7]+s;break;case"V":g[1]=+p[1]+s;break;case"H":g[1]=+p[1]+a;break;case"M":l=+p[1]+a,u=+p[2]+s,g[1]=l,g[2]=u;break;default:for(var m=1,C=p.length;m<C;m++)g[m]=+p[m]+(m%2?a:s)}else g=e[r];switch(y){case"Z":a=+l,s=+u;break;case"H":g=["L",a=g[1],s];break;case"V":g=["L",a,s=g[1]];break;case"T":a=g[1],s=g[2];var w=Ar([v[1],v[2]],[v[3],v[4]]);g=["Q",w[0],w[1],a,s];break;case"S":a=g[g.length-2],s=g[g.length-1];var x=v.length,S=Ar([v[x-4],v[x-3]],[v[x-2],v[x-1]]);g=["C",S[0],S[1],g[1],g[2],a,s];break;case"M":l=g[g.length-2],u=g[g.length-1];break;default:a=g[g.length-2],s=g[g.length-1]}o.push(g)}return o}function Br(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Nr(t,e){return Br(t)*Br(e)?(t[0]*e[0]+t[1]*e[1])/(Br(t)*Br(e)):1}function Dr(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Nr(t,e))}function Pr(t,e){return t[0]===e[0]&&t[1]===e[1]}function kr(t,e){var n=e[1],r=e[2],i=m(w(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],l=t[1],u=e[6],c=e[7],h=Math.cos(i)*(s-u)/2+Math.sin(i)*(l-c)/2,d=-1*Math.sin(i)*(s-u)/2+Math.cos(i)*(l-c)/2,f=h*h/(n*n)+d*d/(r*r);f>1&&(n*=Math.sqrt(f),r*=Math.sqrt(f));var p=n*n*(d*d)+r*r*(h*h),v=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(v*=-1),isNaN(v)&&(v=0);var g=r?v*n*d/r:0,y=n?v*-r*h/n:0,C=(s+u)/2+Math.cos(i)*g-Math.sin(i)*y,x=(l+c)/2+Math.sin(i)*g+Math.cos(i)*y,S=[(h-g)/n,(d-y)/r],E=[(-1*h-g)/n,(-1*d-y)/r],_=Dr([1,0],S),b=Dr(S,E);return Nr(S,E)<=-1&&(b=Math.PI),Nr(S,E)>=1&&(b=0),0===a&&b>0&&(b-=2*Math.PI),1===a&&b<0&&(b+=2*Math.PI),{cx:C,cy:x,rx:Pr(t,[u,c])?0:n,ry:Pr(t,[u,c])?0:r,startAngle:_,endAngle:_+b,xRotation:i,arcFlag:o,sweepFlag:a}}function zr(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function Fr(t){t=function(t){var e=t||[];return c(e)?e:g(e)?(d(e=e.match(br),(function(t,n){if((t=t.match(Tr))[0].length>1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}d(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0}(t);for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;s<a;s++){var l=t[s];r=t[s+1];var u=l[0],h={command:u,prePoint:n,params:l,startTangent:null,endTangent:null};switch(u){case"M":i=[l[1],l[2]],o=s;break;case"A":var f=kr(n,l);h.arcParams=f}if("Z"===u)n=i,r=t[o+1];else{var p=l.length;n=[l[p-2],l[p-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),h.currentPoint=n,e[o]&&Pr(n,e[o].currentPoint)&&(e[o].prePoint=h.prePoint);var v=r?[r[r.length-2],r[r.length-1]]:null;h.nextPoint=v;var y=h.prePoint;if(["L","H","V"].includes(u))h.startTangent=[y[0]-n[0],y[1]-n[1]],h.endTangent=[n[0]-y[0],n[1]-y[1]];else if("Q"===u){var m=[l[1],l[2]];h.startTangent=[y[0]-m[0],y[1]-m[1]],h.endTangent=[n[0]-m[0],n[1]-m[1]]}else if("T"===u){m=zr((x=e[s-1]).currentPoint,y);"Q"===x.command?(h.command="Q",h.startTangent=[y[0]-m[0],y[1]-m[1]],h.endTangent=[n[0]-m[0],n[1]-m[1]]):(h.command="TL",h.startTangent=[y[0]-n[0],y[1]-n[1]],h.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("C"===u){var C=[l[1],l[2]],w=[l[3],l[4]];h.startTangent=[y[0]-C[0],y[1]-C[1]],h.endTangent=[n[0]-w[0],n[1]-w[1]],0===h.startTangent[0]&&0===h.startTangent[1]&&(h.startTangent=[C[0]-w[0],C[1]-w[1]]),0===h.endTangent[0]&&0===h.endTangent[1]&&(h.endTangent=[w[0]-C[0],w[1]-C[1]])}else if("S"===u){var x;C=zr((x=e[s-1]).currentPoint,y),w=[l[1],l[2]];"C"===x.command?(h.command="C",h.startTangent=[y[0]-C[0],y[1]-C[1]],h.endTangent=[n[0]-w[0],n[1]-w[1]]):(h.command="SQ",h.startTangent=[y[0]-w[0],y[1]-w[1]],h.endTangent=[n[0]-w[0],n[1]-w[1]])}else if("A"===u){var S=.001,E=h.arcParams||{},_=E.cx,b=void 0===_?0:_,T=E.cy,L=void 0===T?0:T,I=E.rx,O=void 0===I?0:I,R=E.ry,A=void 0===R?0:R,M=E.sweepFlag,B=void 0===M?0:M,N=E.startAngle,D=void 0===N?0:N,P=E.endAngle,k=void 0===P?0:P;0===B&&(S*=-1);var z=O*Math.cos(D-S)+b,F=A*Math.sin(D-S)+L;h.startTangent=[z-i[0],F-i[1]];var H=O*Math.cos(D+k+S)+b,W=A*Math.sin(D+k-S)+L;h.endTangent=[y[0]-H,y[1]-W]}e.push(h)}return e}function Hr(t,e){var n,r,i,o=t.prePoint,a=t.currentPoint,s=t.nextPoint,l=Math.pow(a[0]-o[0],2)+Math.pow(a[1]-o[1],2),u=Math.pow(a[0]-s[0],2)+Math.pow(a[1]-s[1],2),c=Math.pow(o[0]-s[0],2)+Math.pow(o[1]-s[1],2),h=Math.acos((l+u-c)/(2*Math.sqrt(l)*Math.sqrt(u)));if(!h||0===Math.sin(h)||(n=h,r=0,void 0===i&&(i=1e-5),Math.abs(n-r)<i))return{xExtra:0,yExtra:0};var d=Math.abs(Math.atan2(s[1]-a[1],s[0]-a[0])),f=Math.abs(Math.atan2(s[0]-a[0],s[1]-a[1]));return d=d>Math.PI/2?Math.PI-d:d,f=f>Math.PI/2?Math.PI-f:f,{xExtra:Math.cos(h/2-d)*(e/2*(1/Math.sin(h/2)))-e/2||0,yExtra:Math.cos(f-h/2)*(e/2*(1/Math.sin(h/2)))-e/2||0}}function Wr(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Gr(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function Ur(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)}function Yr(t,e){return t[0]===e[0]&&t[1]===e[1]}Vn("rect",Xn),Vn("image",Xn),Vn("circle",Kn),Vn("marker",Kn),Vn("polyline",(function(t){for(var e=t.attr().points,n=[],r=[],i=0;i<e.length;i++){var o=e[i];n.push(o[0]),r.push(o[1])}var a=Jn(n,r),s=a.x,l=a.y,u={minX:s,minY:l,maxX:s+a.width,maxY:l+a.height};return{x:(u=wr(t,u)).minX,y:u.minY,width:u.maxX-u.minX,height:u.maxY-u.minY}})),Vn("polygon",(function(t){for(var e=t.attr().points,n=[],r=[],i=0;i<e.length;i++){var o=e[i];n.push(o[0]),r.push(o[1])}return Jn(n,r)})),Vn("text",(function(t){var e=t.attr(),n=e.x,r=e.y,i=e.text,o=e.fontSize,a=e.lineHeight,s=e.font;s||(s=_r(e));var l,c=function(t,e){var n=Sr(),r=0;return u(t)||""===t||(n.save(),n.font=e,g(t)&&t.includes("\n")?d(t.split("\n"),(function(t){var e=n.measureText(t).width;r<e&&(r=e)})):r=n.measureText(t).width,n.restore()),r}(i,s);if(c){var h=e.textAlign,f=e.textBaseline,p=Er(i,o,a),v={x:n,y:r-p};h&&("end"===h||"right"===h?v.x-=c:"center"===h&&(v.x-=c/2)),f&&("top"===f?v.y+=p:"middle"===f&&(v.y+=p/2)),l={x:v.x,y:v.y,width:c,height:p}}else l={x:n,y:r,width:0,height:0};return l})),Vn("path",(function(t){var e=t.attr(),n=e.path,r=e.stroke?e.lineWidth:0,i=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=(y=t[o]).currentPoint,s=y.params,l=y.prePoint,u=void 0;switch(y.command){case"Q":u=lr.box(l[0],l[1],s[1],s[2],s[3],s[4]);break;case"C":u=pr.box(l[0],l[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var c=y.arcParams;u=yr(c.cx,c.cy,c.rx,c.ry,c.xRotation,c.startAngle,c.endAngle);break;default:n.push(a[0]),r.push(a[1])}u&&(y.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&("L"===y.command||"M"===y.command)&&y.prePoint&&y.nextPoint&&i.push(y)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var h=v(n),d=v(r),f=p(n),g=p(r);if(0===i.length)return{x:h,y:d,width:f-h,height:g-d};for(o=0;o<i.length;o++){var y;(a=(y=i[o]).currentPoint)[0]===h?h-=Hr(y,e).xExtra:a[0]===f&&(f+=Hr(y,e).xExtra),a[1]===d?d-=Hr(y,e).yExtra:a[1]===g&&(g+=Hr(y,e).yExtra)}return{x:h,y:d,width:f-h,height:g-d}}(t.get("segments")||Fr(n),r),o=i.x,a=i.y,s={minX:o,minY:a,maxX:o+i.width,maxY:a+i.height};return{x:(s=wr(t,s)).minX,y:s.minY,width:s.maxX-s.minX,height:s.maxY-s.minY}})),Vn("line",(function(t){var e=t.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2,a={minX:Math.min(n,i),maxX:Math.max(n,i),minY:Math.min(r,o),maxY:Math.max(r,o)};return{x:(a=wr(t,a)).minX,y:a.minY,width:a.maxX-a.minX,height:a.maxY-a.minY}})),Vn("ellipse",(function(t){var e=t.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;return{x:n-i,y:r-o,width:2*i,height:2*o}}));var jr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Vr=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Xr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Kr=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function qr(t,e){d(t.match(Kr),(function(t){var n=t.split(":");e.addColorStop(n[0],n[1])}))}function Zr(t,e,n){var r=e.getBBox();if(isNaN(r.x)||isNaN(r.y)||isNaN(r.width)||isNaN(r.height))return n;if(g(n)){if("("===n[1]||"("===n[2]){if("l"===n[0])return function(t,e,n){var r,i,o=jr.exec(n),a=parseFloat(o[1])%360*(Math.PI/180),s=o[2],l=e.getBBox();a>=0&&a<.5*Math.PI?(r={x:l.minX,y:l.minY},i={x:l.maxX,y:l.maxY}):.5*Math.PI<=a&&a<Math.PI?(r={x:l.maxX,y:l.minY},i={x:l.minX,y:l.maxY}):Math.PI<=a&&a<1.5*Math.PI?(r={x:l.maxX,y:l.maxY},i={x:l.minX,y:l.minY}):(r={x:l.minX,y:l.maxY},i={x:l.maxX,y:l.minY});var u=Math.tan(a),c=u*u,h=(i.x-r.x+u*(i.y-r.y))/(c+1)+r.x,d=u*(i.x-r.x+u*(i.y-r.y))/(c+1)+r.y,f=t.createLinearGradient(r.x,r.y,h,d);return qr(s,f),f}(t,e,n);if("r"===n[0])return function(t,e,n){var r=Vr.exec(n),i=parseFloat(r[1]),o=parseFloat(r[2]),a=parseFloat(r[3]),s=r[4];if(0===a){var l=s.match(Kr);return l[l.length-1].split(":")[1]}var u=e.getBBox(),c=u.maxX-u.minX,h=u.maxY-u.minY,d=Math.sqrt(c*c+h*h)/2,f=t.createRadialGradient(u.minX+c*i,u.minY+h*o,0,u.minX+c/2,u.minY+h/2,a*d);return qr(s,f),f}(t,e,n);if("p"===n[0])return function(t,e,n){if(e.get("patternSource")&&e.get("patternSource")===n)return e.get("pattern");var r,i,o=Xr.exec(n),a=o[1],s=o[2];function l(){r=t.createPattern(i,a),e.set("pattern",r),e.set("patternSource",n)}switch(a){case"a":a="repeat";break;case"x":a="repeat-x";break;case"y":a="repeat-y";break;default:a="no-repeat"}return i=new Image,s.match(/^data:/i)||(i.crossOrigin="Anonymous"),i.src=s,i.complete?l():(i.onload=l,i.src=i.src),r}(t,e,n)}return n}return n instanceof CanvasPattern?n:void 0}function $r(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Qr(t,e){return $r(t)*$r(e)?(t[0]*e[0]+t[1]*e[1])/($r(t)*$r(e)):1}function Jr(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Qr(t,e))}function ti(t,e){var n=e[1],r=e[2],i=m(w(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],l=t[1],u=e[6],c=e[7],h=Math.cos(i)*(s-u)/2+Math.sin(i)*(l-c)/2,d=-1*Math.sin(i)*(s-u)/2+Math.cos(i)*(l-c)/2,f=h*h/(n*n)+d*d/(r*r);f>1&&(n*=Math.sqrt(f),r*=Math.sqrt(f));var p=n*n*(d*d)+r*r*(h*h),v=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(v*=-1),isNaN(v)&&(v=0);var g=r?v*n*d/r:0,y=n?v*-r*h/n:0,C=(s+u)/2+Math.cos(i)*g-Math.sin(i)*y,x=(l+c)/2+Math.sin(i)*g+Math.cos(i)*y,S=[(h-g)/n,(d-y)/r],E=[(-1*h-g)/n,(-1*d-y)/r],_=Jr([1,0],S),b=Jr(S,E);return Qr(S,E)<=-1&&(b=Math.PI),Qr(S,E)>=1&&(b=0),0===a&&b>0&&(b-=2*Math.PI),1===a&&b<0&&(b+=2*Math.PI),{cx:C,cy:x,rx:Yr(t,[u,c])?0:n,ry:Yr(t,[u,c])?0:r,startAngle:_,endAngle:_+b,xRotation:i,arcFlag:o,sweepFlag:a}}var ei=Math.sin,ni=Math.cos,ri=Math.atan2,ii=Math.PI;function oi(t,e,n,r,i,o,a){var s=e.stroke,l=e.lineWidth,u=ri(r-o,n-i),c=new Xi({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*ni(ii/6)+","+10*ei(ii/6)+" L0,0 L"+10*ni(ii/6)+",-"+10*ei(ii/6),stroke:s,lineWidth:l}});c.translate(i,o),c.rotateAtPoint(i,o,u),t.set(a?"startArrowShape":"endArrowShape",c)}function ai(t,e,n,r,o,a,s){var l=e.startArrow,u=e.endArrow,c=e.stroke,h=e.lineWidth,d=s?l:u,f=d.d,p=d.fill,v=d.stroke,g=d.lineWidth,y=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(d,["d","fill","stroke","lineWidth"]),m=ri(r-a,n-o);f&&(o-=ni(m)*f,a-=ei(m)*f);var C=new Xi({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:i(i({},y),{stroke:v||c,lineWidth:g||h,fill:p})});C.translate(o,a),C.rotateAtPoint(o,a,m),t.set(s?"startArrowShape":"endArrowShape",C)}function si(t,e,n,r,i){var o=ri(r-e,n-t);return{dx:ni(o)*i,dy:ei(o)*i}}function li(t,e,n,r,i,o){"object"==typeof e.startArrow?ai(t,e,n,r,i,o,!0):e.startArrow?oi(t,e,n,r,i,o,!0):t.set("startArrowShape",null)}function ui(t,e,n,r,i,o){"object"==typeof e.endArrow?ai(t,e,n,r,i,o,!1):e.endArrow?oi(t,e,n,r,i,o,!1):t.set("startArrowShape",null)}var ci={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function hi(t,e){var n=e.attr();for(var r in n){var i=n[r],o=ci[r]?ci[r]:r;"matrix"===o&&i?t.transform(i[0],i[1],i[3],i[4],i[6],i[7]):"lineDash"===o&&t.setLineDash?c(i)&&t.setLineDash(i):("strokeStyle"===o||"fillStyle"===o?i=Zr(t,e,i):"globalAlpha"===o&&(i*=t.globalAlpha),t[o]=i)}}function di(t,e,n){for(var r=0;r<e.length;r++){var i=e[r];i.cfg.visible?i.draw(t,n):i.skipDraw()}}function fi(t,e,n){var r=t.get("refreshElements");d(r,(function(e){if(e!==t)for(var n=e.cfg.parent;n&&n!==t&&!n.cfg.refresh;)n.cfg.refresh=!0,n=n.cfg.parent})),r[0]===t?gi(e):pi(e,n)}function pi(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.cfg.visible)if(r.cfg.hasChanged)r.cfg.refresh=!0,r.isGroup()&&gi(r.cfg.children);else if(r.cfg.refresh)r.isGroup()&&pi(r.cfg.children,e);else{var i=yi(r,e);r.cfg.refresh=i,i&&r.isGroup()&&pi(r.cfg.children,e)}}}function vi(t){for(var e=0;e<t.length;e++){var n=t[e];n.cfg.hasChanged=!1,n.isGroup()&&!n.destroyed&&vi(n.cfg.children)}}function gi(t,e){for(var n=0;n<t.length;n++){var r=t[n];r.cfg.refresh=!0,r.isGroup()&&gi(r.get("children"))}}function yi(t,e){var n=t.cfg.cacheCanvasBBox;return t.cfg.isInView&&n&&Ur(n,e)}function mi(t,e,n,r){var i=n.path,o=n.startArrow,a=n.endArrow;if(i){var s=[0,0],l=[0,0],u={dx:0,dy:0};e.beginPath();for(var c=0;c<i.length;c++){var h=i[c],d=h[0];if(0===c&&o&&o.d)u=si((f=t.getStartTangent())[0][0],f[0][1],f[1][0],f[1][1],o.d);else if(c===i.length-2&&"Z"===i[c+1][0]&&a&&a.d){if("Z"===i[c+1][0])u=si((f=t.getEndTangent())[0][0],f[0][1],f[1][0],f[1][1],a.d)}else if(c===i.length-1&&a&&a.d){var f;if("Z"!==i[0])u=si((f=t.getEndTangent())[0][0],f[0][1],f[1][0],f[1][1],a.d)}var p=u.dx,v=u.dy;switch(d){case"M":e.moveTo(h[1]-p,h[2]-v),l=[h[1],h[2]];break;case"L":e.lineTo(h[1]-p,h[2]-v);break;case"Q":e.quadraticCurveTo(h[1],h[2],h[3]-p,h[4]-v);break;case"C":e.bezierCurveTo(h[1],h[2],h[3],h[4],h[5]-p,h[6]-v);break;case"A":var g=void 0;r?(g=r[c])||(g=ti(s,h),r[c]=g):g=ti(s,h);var y=g.cx,m=g.cy,C=g.rx,w=g.ry,x=g.startAngle,S=g.endAngle,E=g.xRotation,_=g.sweepFlag;if(e.ellipse)e.ellipse(y,m,C,w,E,x,S,1-_);else{var b=C>w?C:w,T=C>w?1:C/w,L=C>w?w/C:1;e.translate(y,m),e.rotate(E),e.scale(T,L),e.arc(0,0,b,x,S,1-_),e.scale(1/T,1/L),e.rotate(-E),e.translate(-y,-m)}break;case"Z":e.closePath()}if("Z"===d)s=l;else{var I=h.length;s=[h[I-2],h[I-1]]}}}}function Ci(t,e){var n=t.get("canvas");n&&("remove"===e&&(t._cacheCanvasBBox=t.get("cacheCanvasBBox")),t.get("hasChanged")||(t.set("hasChanged",!0),t.cfg.parent&&t.cfg.parent.get("hasChanged")||(n.refreshElement(t,e,n),n.get("autoDraw")&&n.draw())))}function wi(t){var e,n,r;if(t.destroyed)e=t._cacheCanvasBBox;else{var i=t.get("cacheCanvasBBox"),o=i&&!(!i.width||!i.height),a=t.getCanvasBBox(),s=a&&!(!a.width||!a.height);o&&s?(r=a,e=(n=i)&&r?{minX:Math.min(n.minX,r.minX),minY:Math.min(n.minY,r.minY),maxX:Math.max(n.maxX,r.maxX),maxY:Math.max(n.maxY,r.maxY)}:n||r):o?e=i:s&&(e=a)}return e}var xi=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.onCanvasChange=function(t){Ci(this,t)},n.prototype.getShapeBase=function(){return e},n.prototype.getGroupBase=function(){return n},n.prototype._applyClip=function(t,e){e&&(t.save(),hi(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},n.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],n=[];d(t,(function(t){var r=t.cfg.cacheCanvasBBox;r&&t.cfg.isInView&&(e.push(r.minX,r.maxX),n.push(r.minY,r.maxY))}));var r=null;if(e.length){var i=v(e),o=p(e),a=v(n),s=p(n);r={minX:i,minY:a,x:i,y:a,maxX:o,maxY:s,width:o-i,height:s-a};var l=this.cfg.canvas;if(l){var u=l.getViewRange();this.set("isInView",Ur(r,u))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",r)},n.prototype.draw=function(t,e){var n=this.cfg.children,r=!e||this.cfg.refresh;n.length&&r&&(t.save(),hi(t,this),this._applyClip(t,this.getClip()),di(t,n,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},n.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},n}(Un),Si=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return i(i({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},n.prototype.getShapeBase=function(){return e},n.prototype.getGroupBase=function(){return xi},n.prototype.onCanvasChange=function(t){Ci(this,t)},n.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),n=function(t){return jn.get(t)}(t),r=n(this),i=e/2,o=r.x-i,a=r.y-i,s=r.x+r.width+i,l=r.y+r.height+i;return{x:o,minX:o,y:a,minY:a,width:r.width+e,height:r.height+e,maxX:s,maxY:l}},n.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},n.prototype.isStroke=function(){return!!this.attrs.stroke},n.prototype._applyClip=function(t,e){e&&(t.save(),hi(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},n.prototype.draw=function(t,e){var n=this.cfg.clipShape;if(e){if(!1===this.cfg.refresh)return void this.set("hasChanged",!1);if(!Ur(e,this.getCanvasBBox()))return this.set("hasChanged",!1),void(this.cfg.isInView&&this._afterDraw())}t.save(),hi(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},n.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},n.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),n=Ur(e,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},n.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},n.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},n.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},n.prototype.fill=function(t){t.fill()},n.prototype.stroke=function(t){t.stroke()},n.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isFill()&&(u(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.isStroke()&&n>0&&(u(i)||1===i||(t.globalAlpha=i),this.stroke(t)),this.afterDrawPath(t)},n.prototype.createPath=function(t){},n.prototype.afterDrawPath=function(t){},n.prototype.isInShape=function(t,e){var n=this.isStroke(),r=this.isFill(),i=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,n,r,i)},n.prototype.isInStrokeOrPath=function(t,e,n,r,i){return!1},n.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},n}(Yn),Ei=Si,_i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return i(i({},e),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=o.x,s=o.y,l=o.r,u=i/2,c=Wr(a,s,t,e);return r&&n?c<=l+u:r?c<=l:!!n&&(c>=l-u&&c<=l+u)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.r;t.beginPath(),t.arc(n,r,i,0,2*Math.PI,!1),t.closePath()},e}(Ei),bi=_i;function Ti(t,e,n,r){return t/(n*n)+e/(r*r)}var Li=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return i(i({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=i/2,s=o.x,l=o.y,u=o.rx,c=o.ry,h=(t-s)*(t-s),d=(e-l)*(e-l);return r&&n?Ti(h,d,u+a,c+a)<=1:r?Ti(h,d,u,c)<=1:!!n&&(Ti(h,d,u-a,c-a)>=1&&Ti(h,d,u+a,c+a)<=1)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,r,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,s=i>o?1:i/o,l=i>o?o/i:1;t.save(),t.translate(n,r),t.scale(s,l),t.arc(0,0,a,0,2*Math.PI),t.restore(),t.closePath()}},e}(Ei),Ii=Li;function Oi(t){return t instanceof HTMLElement&&g(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var Ri=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return i(i({},e),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var e=this,n=this.attrs;if(g(t)){var r=new Image;r.onload=function(){if(e.destroyed)return!1;e.attr("img",r),e.set("loading",!1),e._afterLoading();var t=e.get("callback");t&&t.call(e)},r.crossOrigin="Anonymous",r.src=t,this.set("loading",!0)}else t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):Oi(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),"img"===e&&this._setImage(n)},e.prototype.createPath=function(t){if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,a=e.sx,s=e.sy,l=e.swidth,c=e.sheight,h=e.img;(h instanceof Image||Oi(h))&&(u(a)||u(s)||u(l)||u(c)?t.drawImage(h,n,r,i,o):t.drawImage(h,a,s,l,c,n,r,i,o))},e}(Ei),Ai=Ri;function Mi(t,e,n,r,i,o,a){var s=Math.min(t,n),l=Math.max(t,n),u=Math.min(e,r),c=Math.max(e,r),h=i/2;return o>=s-h&&o<=l+h&&a>=u-h&&a<=c+h&&er.pointToLine(t,e,n,r,o,a)<=i/2}var Bi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return i(i({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=t.startArrow,a=t.endArrow;o&&li(this,t,r,i,e,n),a&&ui(this,t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){if(!n||!i)return!1;var o=this.attr();return Mi(o.x1,o.y1,o.x2,o.y2,i,t,e)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.startArrow,s=e.endArrow,l={dx:0,dy:0},u={dx:0,dy:0};a&&a.d&&(l=si(n,r,i,o,e.startArrow.d)),s&&s.d&&(u=si(n,r,i,o,e.endArrow.d)),t.beginPath(),t.moveTo(n+l.dx,r+l.dy),t.lineTo(i-u.dx,o-u.dy)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2;return er.length(e,n,r,i)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2;return er.pointAt(n,r,i,o,t)},e}(Ei),Ni=Bi,Di={circle:function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]},"triangle-down":function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},Pi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),-1!==["symbol","x","y","r","radius"].indexOf(e)&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return u(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t,n,r=this.attr(),i=r.x,o=r.y,a=r.symbol||"circle",s=this._getR(r);if(l(a))n=Mr(n=(t=a)(i,o,s));else{if(!(t=e.Symbols[a]))return console.warn(a+" marker is not supported."),null;n=t(i,o,s)}return n},e.prototype.createPath=function(t){mi(this,t,{path:this._getPath()},this.get("paramsCache"))},e.Symbols=Di,e}(Ei),ki=Pi;function zi(t,e,n){var r=Sr();return t.createPath(r),r.isPointInPath(e,n)}function Fi(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function Hi(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function Wi(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(Hi(a,s,[e,n]))return!0;Fi(a[1]-n)>0!=Fi(s[1]-n)>0&&Fi(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function Gi(t,e,n,r,i,o,a,s){var l=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI);if(l<r||l>i)return!1;var u={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return Wr(u.x,u.y,a,s)<=o/2}var Ui=Dt;var Yi=i({hasArc:function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e},extractPolygons:function(t){for(var e=t.length,n=[],r=[],i=[],o=0;o<e;o++){var a=t[o],s=a[0];"M"===s?(i.length&&(r.push(i),i=[]),i.push([a[1],a[2]])):"Z"===s?i.length&&(n.push(i),i=[]):i.push([a[1],a[2]])}return i.length>0&&r.push(i),{polygons:n,polylines:r}},isPointInStroke:function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var l=t[s],u=l.currentPoint,c=l.params,h=l.prePoint,d=l.box;if(!d||Gr(d.x-a,d.y-a,d.width+e,d.height+e,n,r)){switch(l.command){case"L":case"Z":o=Mi(h[0],h[1],u[0],u[1],e,n,r);break;case"Q":o=lr.pointDistance(h[0],h[1],c[1],c[2],c[3],c[4],n,r)<=e/2;break;case"C":o=pr.pointDistance(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],n,r,i)<=e/2;break;case"A":var f=l.arcParams,p=f.cx,v=f.cy,g=f.rx,y=f.ry,m=f.startAngle,C=f.endAngle,w=f.xRotation,x=[n,r,1],S=g>y?g:y;Rt(x,x,Ui(null,[["t",-p,-v],["r",-w],["s",1/(g>y?1:g/y),1/(g>y?y/g:1)]])),o=Gi(0,0,S,m,C,e,x[0],x[1])}if(o)break}}return o}},st);function ji(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=Wi(t[i],e,n))break}return r}var Vi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return i(i({},e),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this._setPathArr(t.path),this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),"path"===e&&this._setPathArr(n),this.setArrow()},e.prototype._setPathArr=function(t){this.attrs.path=Mr(t);var e=Yi.hasArc(t);this.set("hasArc",e),this.set("paramsCache",{}),this.set("segments",null),this.set("curve",null),this.set("tCache",null),this.set("totalLength",null)},e.prototype.getSegments=function(){var t=this.get("segements");return t||(t=Fr(this.attr("path")),this.set("segments",t)),t},e.prototype.setArrow=function(){var t,e=this.attr(),n=e.startArrow,r=e.endArrow;n&&li(this,e,(t=this.getStartTangent())[0][0],t[0][1],t[1][0],t[1][1]);r&&ui(this,e,(t=this.getEndTangent())[0][0],t[0][1],t[1][0],t[1][1])},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.getSegments(),a=this.get("hasArc"),s=!1;if(n){var l=this.getTotalLength();s=Yi.isPointInStroke(o,i,t,e,l)}if(!s&&r)if(a)s=zi(this,t,e);else{var u=this.attr("path"),c=Yi.extractPolygons(u);s=ji(c.polygons,t,e)||ji(c.polylines,t,e)}return s},e.prototype.createPath=function(t){mi(this,t,this.attr(),this.get("paramsCache"))},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.get("totalLength");return u(t)?(this._calculateCurve(),this._setTcache(),this.get("totalLength")):t},e.prototype.getPoint=function(t){var e,n,r=this.get("tCache");r||(this._calculateCurve(),this._setTcache(),r=this.get("tCache"));var i=this.get("curve");if(!r||0===r.length)return i?{x:i[0][1],y:i[0][2]}:null;d(r,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)}));var o=i[n];if(u(o)||u(n))return null;var a=o.length,s=i[n+1];return pr.pointAt(o[a-2],o[a-1],s[1],s[2],s[3],s[4],s[5],s[6],e)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",Yi.pathToCurve(t))},e.prototype._setTcache=function(){var t,e,n,r,i=0,o=0,a=[],s=this.get("curve");s&&(d(s,(function(t,e){n=s[e+1],r=t.length,n&&(i+=pr.length(t[r-2],t[r-1],n[1],n[2],n[3],n[4],n[5],n[6])||0)})),this.set("totalLength",i),0!==i?(d(s,(function(l,u){n=s[u+1],r=l.length,n&&((t=[])[0]=o/i,e=pr.length(l[r-2],l[r-1],n[1],n[2],n[3],n[4],n[5],n[6]),o+=e||0,t[1]=o/i,a.push(t))})),this.set("tCache",a)):this.set("tCache",[]))},e.prototype.getStartTangent=function(){var t,e=this.getSegments();if(e.length>1){var n=e[0].currentPoint,r=e[1].currentPoint,i=e[1].startTangent;t=[],i?(t.push([n[0]-i[0],n[1]-i[1]]),t.push([n[0],n[1]])):(t.push([r[0],r[1]]),t.push([n[0],n[1]]))}return t},e.prototype.getEndTangent=function(){var t,e=this.getSegments(),n=e.length;if(n>1){var r=e[n-2].currentPoint,i=e[n-1].currentPoint,o=e[n-1].endTangent;t=[],o?(t.push([i[0]-o[0],i[1]-o[1]]),t.push([i[0],i[1]])):(t.push([r[0],r[1]]),t.push([i[0],i[1]]))}return t},e}(Ei),Xi=Vi;function Ki(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(Mi(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],l=t[o-1];if(Mi(s[0],s[1],l[0],l[1],e,n,r))return!0}return!1}var qi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr().points,a=!1;return n&&(a=Ki(o,i,t,e,!0)),!a&&r&&(a=Wi(o,t,e)),a},e.prototype.createPath=function(t){var e=this.attr().points;if(!(e.length<2)){t.beginPath();for(var n=0;n<e.length;n++){var r=e[n];0===n?t.moveTo(r[0],r[1]):t.lineTo(r[0],r[1])}t.closePath()}},e}(Ei),Zi=qi,$i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return i(i({},e),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),this.setArrow(),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.setArrow=function(){var t=this.attr(),e=this.attrs,n=e.points,r=e.startArrow,i=e.endArrow,o=n.length,a=n[0][0],s=n[0][1],l=n[o-1][0],u=n[o-1][1];r&&li(this,t,n[1][0],n[1][1],a,s),i&&ui(this,t,n[o-2][0],n[o-2][1],l,u)},e.prototype.isFill=function(){return!1},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){return!(!n||!i)&&Ki(this.attr().points,i,t,e,!1)},e.prototype.isStroke=function(){return!0},e.prototype.createPath=function(t){var e=this.attr(),n=e.points,r=e.startArrow,i=e.endArrow,o=n.length;if(!(n.length<2)){var a,s=n[0][0],l=n[0][1],u=n[o-1][0],c=n[o-1][1];if(r&&r.d)s+=(a=si(s,l,n[1][0],n[1][1],r.d)).dx,l+=a.dy;if(i&&i.d)u-=(a=si(n[o-2][0],n[o-2][1],u,c,i.d)).dx,c-=a.dy;t.beginPath(),t.moveTo(s,l);for(var h=0;h<o-1;h++){var d=n[h];t.lineTo(d[0],d[1])}t.lineTo(u,c)}},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return u(e)?(this.set("totalLength",mr(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,n,r=this.attr().points,i=this.get("tCache");return i||(this._setTcache(),i=this.get("tCache")),d(i,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),er.pointAt(r[n][0],r[n][1],r[n+1][0],r[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,r,i=0,o=[];d(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=er.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=r,n[1]=i/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(Ei),Qi=$i;var Ji=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return i(i({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=o.x,s=o.y,l=o.width,u=o.height,c=o.radius;if(c){var h=!1;return n&&(h=function(t,e,n,r,i,o,a,s){return Mi(t+i,e,t+n-i,e,o,a,s)||Mi(t+n,e+i,t+n,e+r-i,o,a,s)||Mi(t+n-i,e+r,t+i,e+r,o,a,s)||Mi(t,e+r-i,t,e+i,o,a,s)||Gi(t+n-i,e+i,i,1.5*Math.PI,2*Math.PI,o,a,s)||Gi(t+n-i,e+r-i,i,0,.5*Math.PI,o,a,s)||Gi(t+i,e+r-i,i,.5*Math.PI,Math.PI,o,a,s)||Gi(t+i,e+i,i,Math.PI,1.5*Math.PI,o,a,s)}(a,s,l,u,c,i,t,e)),!h&&r&&(h=zi(this,t,e)),h}var d=i/2;return r&&n?Gr(a-d,s-d,l+d,u+d,t,e):r?Gr(a,s,l,u,t,e):n?function(t,e,n,r,i,o,a){var s=i/2;return Gr(t-s,e-s,n,i,o,a)||Gr(t+n-s,e-s,i,r,o,a)||Gr(t+s,e+r-s,n,i,o,a)||Gr(t-s,e+s,i,r,o,a)}(a,s,l,u,i,t,e):void 0},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,a=e.radius;if(t.beginPath(),0===a)t.rect(n,r,i,o);else{var s=function(t){var e=0,n=0,r=0,i=0;return c(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,[e,n,r,i]}(a),l=s[0],u=s[1],h=s[2],d=s[3];t.moveTo(n+l,r),t.lineTo(n+i-u,r),0!==u&&t.arc(n+i-u,r+u,u,-Math.PI/2,0),t.lineTo(n+i,r+o-h),0!==h&&t.arc(n+i-h,r+o-h,h,0,Math.PI/2),t.lineTo(n+d,r+o),0!==d&&t.arc(n+d,r+o-d,d,Math.PI/2,Math.PI),t.lineTo(n,r+l),0!==l&&t.arc(n+l,r+l,l,Math.PI,1.5*Math.PI),t.closePath()}},e}(Ei),to=Ji,eo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return i(i({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=_r(t)},e.prototype._setText=function(t){var e=null;g(t)&&-1!==t.indexOf("\n")&&(e=t.split("\n")),this.set("textArr",e)},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),e.startsWith("font")&&this._assembleFont(),"text"===e&&this._setText(n)},e.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n},e.prototype._drawTextArr=function(t,e,n){var r,i=this.attrs,o=i.textBaseline,a=i.x,s=i.y,l=1*i.fontSize,c=this._getSpaceingY(),h=Er(i.text,i.fontSize,i.lineHeight);d(e,(function(e,i){r=s+i*(c+l)-h+l,"middle"===o&&(r+=h-l-(h-l)/2),"top"===o&&(r+=h-l),u(e)||(n?t.fillText(e,a,r):t.strokeText(e,a,r))}))},e.prototype._drawText=function(t,e){var n=this.attr(),r=n.x,i=n.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,e);else{var a=n.text;u(a)||(e?t.fillText(a,r,i):t.strokeText(a,r,i))}},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isStroke()&&n>0&&(u(i)||1===i||(t.globalAlpha=r),this.stroke(t)),this.isFill()&&(u(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(Ei),no=eo;function ro(t,e,n){var r,i,o=t.getTotalMatrix();if(o){var a=(r=[e,n,1],(i=o)?kt(zt(i),r):r);return[a[0],a[1]]}return[e,n]}function io(t,e,n){if(t.isCanvas&&t.isCanvas())return!0;if(!vt(t)||!1===t.cfg.isInView)return!1;if(t.cfg.clipShape){var r=ro(t,e,n),i=r[0],o=r[1];if(t.isClipped(i,o))return!1}var a=t.cfg.cacheCanvasBBox||t.getCanvasBBox();return e>=a.minX&&e<=a.maxX&&n>=a.minY&&n<=a.maxY}function oo(t,e,n){if(!io(t,e,n))return null;for(var r=null,i=t.getChildren(),o=i.length-1;o>=0;o--){var a=i[o];if(a.isGroup())r=oo(a,e,n);else if(io(a,e,n)){var s=a,l=ro(a,e,n),u=l[0],c=l[1];s.isInShape(u,c)&&(r=a)}if(r)break}return r}var ao,so,lo,uo=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e},n.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},n.prototype.getShapeBase=function(){return e},n.prototype.getGroupBase=function(){return xi},n.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||(window?window.devicePixelRatio:1);return t>=1?Math.ceil(t):1},n.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},n.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},n.prototype.setDOMSize=function(e,n){t.prototype.setDOMSize.call(this,e,n);var r=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*n,o>1&&r.scale(o,o)},n.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var e=this.get("context"),n=this.get("el");e.clearRect(0,0,n.width,n.height)},n.prototype.getShape=function(e,n){return this.get("quickHit")?oo(this,e,n):t.prototype.getShape.call(this,e,n,null)},n.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),n=this.getViewRange();e.length&&e[0]===this?t=n:(t=function(t){if(!t.length)return null;var e=[],n=[],r=[],i=[];return d(t,(function(t){var o=wi(t);o&&(e.push(o.minX),n.push(o.minY),r.push(o.maxX),i.push(o.maxY))})),{minX:v(e),minY:v(n),maxX:p(r),maxY:p(i)}}(e),t&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=function(t,e){return t&&e&&Ur(t,e)?{minX:Math.max(t.minX,e.minX),minY:Math.max(t.minY,e.minY),maxX:Math.min(t.maxX,e.maxX),maxY:Math.min(t.maxY,e.maxY)}:null}(t,n))));return t},n.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},n.prototype._clearFrame=function(){var t,e=this.get("drawFrame");e&&(t=e,(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},n.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},n.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),n=this.getChildren();t.clearRect(0,0,e.width,e.height),hi(t,this),di(t,n),this.set("refreshElements",[])},n.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),r=this._getRefreshRegion();r?(t.clearRect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.save(),t.beginPath(),t.rect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.clip(),hi(t,this),fi(this,n,r),di(t,n,r),t.restore()):e.length&&vi(e),d(e,(function(t){t.get("hasChanged")&&t.set("hasChanged",!1)})),this.set("refreshElements",[])},n.prototype._startDraw=function(){var t,e=this,n=this.get("drawFrame");n||(t=function(){e.get("localRefresh")?e._drawRegion():e._drawAll(),e.set("drawFrame",null)},n=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)})(t),this.set("drawFrame",n))},n.prototype.skipDraw=function(){},n.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},n}(Gn);t.InteractionEvent=void 0,(ao=t.InteractionEvent||(t.InteractionEvent={})).DATA_CELL_CLICK_EVENT="interaction:data-cell-click",ao.MERGED_CELLS_CLICK_EVENT="interaction:merged-cells-click",ao.CORNER_TEXT_CLICK_EVENT="interaction:corner-cell-text-click",ao.ROW_COLUMN_CLICK_EVENT="interaction:row-column-click",ao.ROW_TEXT_CLICK_EVENT="interaction:row-text-click",ao.HOVER_EVENT="interaction:hover",ao.TREND_ICON_CLICK="interaction:trend-icon-click",t.OriginEventType=void 0,(so=t.OriginEventType||(t.OriginEventType={})).MOUSE_DOWN="mousedown",so.MOUSE_MOVE="mousemove",so.MOUSE_OUT="mouseout",so.MOUSE_LEAVE="mouseleave",so.MOUSE_UP="mouseup",so.KEY_DOWN="keydown",so.KEY_UP="keyup",so.CLICK="click",so.HOVER="hover",so.DOUBLE_CLICK="dblclick",so.CONTEXT_MENU="contextmenu",t.S2Event=void 0,(lo=t.S2Event||(t.S2Event={})).ROW_CELL_HOVER="row-cell:hover",lo.ROW_CELL_CLICK="row-cell:click",lo.ROW_CELL_DOUBLE_CLICK="row-cell:double-click",lo.ROW_CELL_CONTEXT_MENU="row-cell:context-menu",lo.ROW_CELL_MOUSE_DOWN="row-cell:mouse-down",lo.ROW_CELL_MOUSE_UP="row-cell:mouse-up",lo.ROW_CELL_MOUSE_MOVE="row-cell:mouse-move",lo.ROW_CELL_COLLAPSE_TREE_ROWS="row-cell:collapsed-tree-rows",lo.ROW_CELL_SCROLL="row-cell:scroll",lo.ROW_CELL_BRUSH_SELECTION="row-cell:brush-selection",lo.COL_CELL_HOVER="col-cell:hover",lo.COL_CELL_CLICK="col-cell:click",lo.COL_CELL_DOUBLE_CLICK="col-cell:double-click",lo.COL_CELL_CONTEXT_MENU="col-cell:context-menu",lo.COL_CELL_MOUSE_DOWN="col-cell:mouse-down",lo.COL_CELL_MOUSE_UP="col-cell:mouse-up",lo.COL_CELL_MOUSE_MOVE="col-cell:mouse-move",lo.COL_CELL_BRUSH_SELECTION="col-cell:brush-selection",lo.DATA_CELL_HOVER="data-cell:hover",lo.DATA_CELL_CLICK="data-cell:click",lo.DATA_CELL_DOUBLE_CLICK="data-cell:double-click",lo.DATA_CELL_CONTEXT_MENU="data-cell:context-menu",lo.DATA_CELL_MOUSE_UP="data-cell:mouse-up",lo.DATA_CELL_MOUSE_DOWN="data-cell:mouse-down",lo.DATA_CELL_MOUSE_MOVE="data-cell:mouse-move",lo.DATA_CELL_TREND_ICON_CLICK="data-cell:trend-icon-click",lo.DATA_CELL_BRUSH_SELECTION="data-cell:brush-selection",lo.DATA_CELL_SELECT_MOVE="data-cell:select-move",lo.CORNER_CELL_HOVER="corner-cell:hover",lo.CORNER_CELL_CLICK="corner-cell:click",lo.CORNER_CELL_DOUBLE_CLICK="corner-cell:double-click",lo.CORNER_CELL_CONTEXT_MENU="corner-cell:context-menu",lo.CORNER_CELL_MOUSE_DOWN="corner-cell:mouse-down",lo.CORNER_CELL_MOUSE_UP="corner-cell:mouse-up",lo.CORNER_CELL_MOUSE_MOVE="corner-cell:mouse-move",lo.MERGED_CELLS_HOVER="merged-cells:hover",lo.MERGED_CELLS_CLICK="merged-cells:click",lo.MERGED_CELLS_DOUBLE_CLICK="merged-cells:double-click",lo.MERGED_CELLS_CONTEXT_MENU="merged-cell:context-menu",lo.MERGED_CELLS_MOUSE_DOWN="merged-cells:mouse-down",lo.MERGED_CELLS_MOUSE_UP="merged-cells:mouse-up",lo.MERGED_CELLS_MOUSE_MOVE="merged-cells:mouse-move",lo.RANGE_SORT="sort:range-sort",lo.RANGE_SORTED="sort:range-sorted",lo.RANGE_FILTER="filter:range-filter",lo.RANGE_FILTERED="filter:range-filtered",lo.LAYOUT_AFTER_HEADER_LAYOUT="layout:after-header-layout",lo.LAYOUT_CELL_SCROLL="layout:cell-scroll",lo.LAYOUT_PAGINATION="layout:pagination",lo.LAYOUT_COLLAPSE_ROWS="layout:collapsed-rows",lo.LAYOUT_AFTER_COLLAPSE_ROWS="layout:after-collapsed-rows",lo.LAYOUT_TREE_ROWS_COLLAPSE_ALL="layout:toggle-collapse-all",lo.LAYOUT_COLS_EXPANDED="layout:table-col-expanded",lo.LAYOUT_COLS_HIDDEN="layout:table-col-hidden",lo.LAYOUT_AFTER_RENDER="layout:after-render",lo.LAYOUT_BEFORE_RENDER="layout:before-render",lo.LAYOUT_DESTROY="layout:destroy",lo.LAYOUT_RESIZE="layout:resize",lo.LAYOUT_RESIZE_SERIES_WIDTH="layout:resize-series-width",lo.LAYOUT_RESIZE_ROW_WIDTH="layout:resize-row-width",lo.LAYOUT_RESIZE_ROW_HEIGHT="layout:resize-row-height",lo.LAYOUT_RESIZE_COL_WIDTH="layout:resize-column-width",lo.LAYOUT_RESIZE_COL_HEIGHT="layout:resize-column-height",lo.LAYOUT_RESIZE_TREE_WIDTH="layout:resize-tree-width",lo.LAYOUT_RESIZE_MOUSE_DOWN="layout:resize:mouse-down",lo.LAYOUT_RESIZE_MOUSE_MOVE="layout:resize:mouse-move",lo.LAYOUT_RESIZE_MOUSE_UP="layout:resize-mouse-up",lo.GLOBAL_KEYBOARD_DOWN="global:keyboard-down",lo.GLOBAL_KEYBOARD_UP="global:keyboard-up",lo.GLOBAL_COPIED="global:copied",lo.GLOBAL_MOUSE_UP="global:mouse-up",lo.GLOBAL_MOUSE_MOVE="global:mouse-move",lo.GLOBAL_ACTION_ICON_CLICK="global:action-icon-click",lo.GLOBAL_ACTION_ICON_HOVER="global:action-icon-hover",lo.GLOBAL_ACTION_ICON_HOVER_OFF="global:action-icon-hover-off",lo.GLOBAL_CONTEXT_MENU="global:context-menu",lo.GLOBAL_CLICK="global:click",lo.GLOBAL_DOUBLE_CLICK="global:double-click",lo.GLOBAL_SELECTED="global:selected",lo.GLOBAL_HOVER="global:hover",lo.GLOBAL_RESET="global:reset",lo.GLOBAL_LINK_FIELD_JUMP="global:link-field-jump",lo.GLOBAL_SCROLL="global:scroll";var co,ho="$$value$$",fo="$$extra$$",po="$$extra_column$$",vo="$$total$$",go="$$series_number$$",yo="backGroundGroup",mo="foreGroundGroup",Co="panelGroup",wo="panelScrollGroup",xo="mergedCellsGroup",So="frozenRowGroup",Eo="frozenColGroup",_o="frozenTrailingRowGroup",bo="frozenTrailingColGroup",To="frozenTopGroup",Lo="frozenBottomGroup",Io="rowResizeAreaGroup",Oo="rowFrozenResizeAreaGroup",Ro="frozenSplitLine",Ao="rowIndexResizeAreaGroup",Mo="cornerResizeAreaGroup",Bo="colResizeAreaGroup",No="colFrozenResizeAreaGroup",Do="colScrollGroup",Po="colFrozenGroup",ko="colFrozenTrailingGroup",zo="gridGroup",Fo="series-number-node",Ho="horizontal-resize-area-",Wo="root",Go="[&]",Uo="-",Yo=/^root\[&\]*/;t.MiniChartTypes=void 0,(co=t.MiniChartTypes||(t.MiniChartTypes={})).Line="line",co.Bar="bar",co.Bullet="bullet";var jo,Vo,Xo="square",Ko="antv-s2",qo="valueRanges",Zo={},$o={data:[],totalData:[],fields:{rows:[],columns:[],values:[],customTreeItems:[],valueInCols:!0},meta:[],sortParams:[],filterParams:[]};t.FrozenCellType=void 0,(Vo=t.FrozenCellType||(t.FrozenCellType={})).ROW="row",Vo.COL="col",Vo.TRAILING_ROW="trailingRow",Vo.TRAILING_COL="trailingCol",Vo.SCROLL="scroll",Vo.TOP="top",Vo.BOTTOM="bottom",t.FrozenGroup=void 0,function(t){t.FROZEN_COL="frozenCol",t.FROZEN_ROW="frozenRow",t.FROZEN_TRAILING_COL="frozenTrailingCol",t.FROZEN_TRAILING_ROW="frozenTrailingRow"}(t.FrozenGroup||(t.FrozenGroup={}));var Qo=((jo={})[t.FrozenCellType.ROW]="frozenRowGroup",jo[t.FrozenCellType.COL]="frozenColGroup",jo[t.FrozenCellType.TRAILING_COL]="frozenTrailingColGroup",jo[t.FrozenCellType.TRAILING_ROW]="frozenTrailingRowGroup",jo[t.FrozenCellType.SCROLL]="panelScrollGroup",jo[t.FrozenCellType.TOP]="frozenTopGroup",jo[t.FrozenCellType.BOTTOM]="frozenBottomGroup",jo),Jo="object"==typeof global&&global&&global.Object===Object&&global,ta="object"==typeof self&&self&&self.Object===Object&&self,ea=Jo||ta||Function("return this")(),na=ea.Symbol,ra=Object.prototype,ia=ra.hasOwnProperty,oa=ra.toString,aa=na?na.toStringTag:void 0;var sa=Object.prototype.toString;var la=na?na.toStringTag:void 0;function ua(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":la&&la in Object(t)?function(t){var e=ia.call(t,aa),n=t[aa];try{t[aa]=void 0;var r=!0}catch(t){}var i=oa.call(t);return r&&(e?t[aa]=n:delete t[aa]),i}(t):function(t){return sa.call(t)}(t)}function ca(t){return null!=t&&"object"==typeof t}function ha(t){return"symbol"==typeof t||ca(t)&&"[object Symbol]"==ua(t)}function da(t){return"number"==typeof t?t:ha(t)?NaN:+t}function fa(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var pa=Array.isArray,va=na?na.prototype:void 0,ga=va?va.toString:void 0;function ya(t){if("string"==typeof t)return t;if(pa(t))return fa(t,ya)+"";if(ha(t))return ga?ga.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function ma(t,e){return function(n,r){var i;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=ya(n),r=ya(r)):(n=da(n),r=da(r)),i=t(n,r)}return i}}var Ca=ma((function(t,e){return t+e}),0),wa=/\s/;function xa(t){for(var e=t.length;e--&&wa.test(t.charAt(e)););return e}var Sa=/^\s+/;function Ea(t){return t?t.slice(0,xa(t)+1).replace(Sa,""):t}function _a(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var ba=/^[-+]0x[0-9a-f]+$/i,Ta=/^0b[01]+$/i,La=/^0o[0-7]+$/i,Ia=parseInt;function Oa(t){if("number"==typeof t)return t;if(ha(t))return NaN;if(_a(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=_a(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ea(t);var n=Ta.test(t);return n||La.test(t)?Ia(t.slice(2),n?2:8):ba.test(t)?NaN:+t}var Ra=1/0;function Aa(t){return t?(t=Oa(t))===Ra||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function Ma(t){var e=Aa(t),n=e%1;return e==e?n?e-n:e:0}function Ba(t){return t}function Na(t){if(!_a(t))return!1;var e=ua(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var Da,Pa=ea["__core-js_shared__"],ka=(Da=/[^.]+$/.exec(Pa&&Pa.keys&&Pa.keys.IE_PROTO||""))?"Symbol(src)_1."+Da:"";var za=Function.prototype.toString;function Fa(t){if(null!=t){try{return za.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Ha=/^\[object .+?Constructor\]$/,Wa=Function.prototype,Ga=Object.prototype,Ua=Wa.toString,Ya=Ga.hasOwnProperty,ja=RegExp("^"+Ua.call(Ya).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Va(t){return!(!_a(t)||function(t){return!!ka&&ka in t}(t))&&(Na(t)?ja:Ha).test(Fa(t))}function Xa(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Va(n)?n:void 0}var Ka=Xa(ea,"WeakMap"),qa=Ka&&new Ka,Za=qa?function(t,e){return qa.set(t,e),t}:Ba,$a=Za,Qa=Object.create,Ja=function(){function t(){}return function(e){if(!_a(e))return{};if(Qa)return Qa(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),ts=Ja;function es(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=ts(t.prototype),r=t.apply(n,e);return _a(r)?r:n}}function ns(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var rs=Math.max;function is(t,e,n,r){for(var i=-1,o=t.length,a=n.length,s=-1,l=e.length,u=rs(o-a,0),c=Array(l+u),h=!r;++s<l;)c[s]=e[s];for(;++i<a;)(h||i<o)&&(c[n[i]]=t[i]);for(;u--;)c[s++]=t[i++];return c}var os=Math.max;function as(t,e,n,r){for(var i=-1,o=t.length,a=-1,s=n.length,l=-1,u=e.length,c=os(o-s,0),h=Array(c+u),d=!r;++i<c;)h[i]=t[i];for(var f=i;++l<u;)h[f+l]=e[l];for(;++a<s;)(d||i<o)&&(h[f+n[a]]=t[i++]);return h}function ss(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}function ls(){}function us(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function cs(){}us.prototype=ts(ls.prototype),us.prototype.constructor=us;var hs=qa?function(t){return qa.get(t)}:cs,ds=hs,fs={},ps=Object.prototype.hasOwnProperty;function vs(t){for(var e=t.name+"",n=fs[e],r=ps.call(fs,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function gs(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function ys(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function ms(t){if(t instanceof us)return t.clone();var e=new gs(t.__wrapped__,t.__chain__);return e.__actions__=ys(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}gs.prototype=ts(ls.prototype),gs.prototype.constructor=gs;var Cs=Object.prototype.hasOwnProperty;function ws(t){if(ca(t)&&!pa(t)&&!(t instanceof us)){if(t instanceof gs)return t;if(Cs.call(t,"__wrapped__"))return ms(t)}return new gs(t)}function xs(t){var e=vs(t),n=ws[e];if("function"!=typeof n||!(e in us.prototype))return!1;if(t===n)return!0;var r=ds(n);return!!r&&t===r[0]}ws.prototype=ls.prototype,ws.prototype.constructor=ws;var Ss=Date.now;function Es(t){var e=0,n=0;return function(){var r=Ss(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var _s=Es($a),bs=/\{\n\/\* \[wrapped with (.+)\] \*/,Ts=/,? & /;var Ls=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Is(t){return function(){return t}}var Os=function(){try{var t=Xa(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Rs=Os,As=Rs?function(t,e){return Rs(t,"toString",{configurable:!0,enumerable:!1,value:Is(e),writable:!0})}:Ba,Ms=Es(As);function Bs(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ns(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Ds(t){return t!=t}function Ps(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Ns(t,Ds,n)}function ks(t,e){return!!(null==t?0:t.length)&&Ps(t,e,0)>-1}var zs=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function Fs(t,e,n){var r=e+"";return Ms(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Ls,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Bs(zs,(function(n){var r="_."+n[0];e&n[1]&&!ks(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(bs);return e?e[1].split(Ts):[]}(r),n)))}function Hs(t,e,n,r,i,o,a,s,l,u){var c=8&e;e|=c?32:64,4&(e&=~(c?64:32))||(e&=-4);var h=[t,e,i,c?o:void 0,c?a:void 0,c?void 0:o,c?void 0:a,s,l,u],d=n.apply(void 0,h);return xs(t)&&_s(d,h),d.placeholder=r,Fs(d,t,e)}function Ws(t){return t.placeholder}var Gs=/^(?:0|[1-9]\d*)$/;function Us(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Gs.test(t))&&t>-1&&t%1==0&&t<e}var Ys=Math.min;function js(t,e){for(var n=t.length,r=Ys(e.length,n),i=ys(t);r--;){var o=e[r];t[r]=Us(o,n)?i[o]:void 0}return t}var Vs="__lodash_placeholder__";function Xs(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==Vs||(t[n]=Vs,o[i++]=n)}return o}function Ks(t,e,n,r,i,o,a,s,l,u){var c=128&e,h=1&e,d=2&e,f=24&e,p=512&e,v=d?void 0:es(t);return function g(){for(var y=arguments.length,m=Array(y),C=y;C--;)m[C]=arguments[C];if(f)var w=Ws(g),x=ss(m,w);if(r&&(m=is(m,r,i,f)),o&&(m=as(m,o,a,f)),y-=x,f&&y<u){var S=Xs(m,w);return Hs(t,e,Ks,g.placeholder,n,m,S,s,l,u-y)}var E=h?n:this,_=d?E[t]:t;return y=m.length,s?m=js(m,s):p&&y>1&&m.reverse(),c&&l<y&&(m.length=l),this&&this!==ea&&this instanceof g&&(_=v||es(_)),_.apply(E,m)}}var qs="__lodash_placeholder__",Zs=128,$s=Math.min;var Qs=Math.max;function Js(t,e,n,r,i,o,a,s){var l=2&e;if(!l&&"function"!=typeof t)throw new TypeError("Expected a function");var u=r?r.length:0;if(u||(e&=-97,r=i=void 0),a=void 0===a?a:Qs(Ma(a),0),s=void 0===s?s:Ma(s),u-=i?i.length:0,64&e){var c=r,h=i;r=i=void 0}var d=l?void 0:ds(t),f=[t,e,n,r,i,c,h,o,a,s];if(d&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,a=r==Zs&&8==n||r==Zs&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var s=e[3];if(s){var l=t[3];t[3]=l?is(l,s,e[4]):s,t[4]=l?Xs(t[3],qs):e[4]}(s=e[5])&&(l=t[5],t[5]=l?as(l,s,e[6]):s,t[6]=l?Xs(t[5],qs):e[6]),(s=e[7])&&(t[7]=s),r&Zs&&(t[8]=null==t[8]?e[8]:$s(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(f,d),t=f[0],e=f[1],n=f[2],r=f[3],i=f[4],!(s=f[9]=void 0===f[9]?l?0:t.length:Qs(f[9]-u,0))&&24&e&&(e&=-25),e&&1!=e)p=8==e||16==e?function(t,e,n){var r=es(t);return function i(){for(var o=arguments.length,a=Array(o),s=o,l=Ws(i);s--;)a[s]=arguments[s];var u=o<3&&a[0]!==l&&a[o-1]!==l?[]:Xs(a,l);return(o-=u.length)<n?Hs(t,e,Ks,i.placeholder,void 0,a,u,void 0,void 0,n-o):ns(this&&this!==ea&&this instanceof i?r:t,this,a)}}(t,e,s):32!=e&&33!=e||i.length?Ks.apply(void 0,f):function(t,e,n,r){var i=1&e,o=es(t);return function e(){for(var a=-1,s=arguments.length,l=-1,u=r.length,c=Array(u+s),h=this&&this!==ea&&this instanceof e?o:t;++l<u;)c[l]=r[l];for(;s--;)c[l++]=arguments[++a];return ns(h,i?n:this,c)}}(t,e,n,r);else var p=function(t,e,n){var r=1&e,i=es(t);return function e(){return(this&&this!==ea&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Fs((d?$a:_s)(p,f),t,e)}function tl(t,e,n){return e=n?void 0:e,Js(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function el(t,e,n){"__proto__"==e&&Rs?Rs(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function nl(t,e){return t===e||t!=t&&e!=e}var rl=Object.prototype.hasOwnProperty;function il(t,e,n){var r=t[e];rl.call(t,e)&&nl(r,n)&&(void 0!==n||e in t)||el(t,e,n)}function ol(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=r?r(n[s],t[s],s,n,t):void 0;void 0===l&&(l=t[s]),i?el(n,s,l):il(n,s,l)}return n}var al=Math.max;function sl(t,e,n){return e=al(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=al(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=n(a),ns(t,this,s)}}function ll(t,e){return Ms(sl(t,e,Ba),t+"")}function ul(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function cl(t){return null!=t&&ul(t.length)&&!Na(t)}function hl(t,e,n){if(!_a(n))return!1;var r=typeof e;return!!("number"==r?cl(n)&&Us(e,n.length):"string"==r&&e in n)&&nl(n[e],t)}function dl(t){return ll((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&hl(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=n[r];s&&t(e,s,r,o)}return e}))}var fl=Object.prototype;function pl(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||fl)}function vl(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function gl(t){return ca(t)&&"[object Arguments]"==ua(t)}var yl=Object.prototype,ml=yl.hasOwnProperty,Cl=yl.propertyIsEnumerable,wl=gl(function(){return arguments}())?gl:function(t){return ca(t)&&ml.call(t,"callee")&&!Cl.call(t,"callee")},xl=wl;function Sl(){return!1}var El="object"==typeof t&&t&&!t.nodeType&&t,_l=El&&"object"==typeof module&&module&&!module.nodeType&&module,bl=_l&&_l.exports===El?ea.Buffer:void 0,Tl=(bl?bl.isBuffer:void 0)||Sl,Ll={};function Il(t){return function(e){return t(e)}}Ll["[object Float32Array]"]=Ll["[object Float64Array]"]=Ll["[object Int8Array]"]=Ll["[object Int16Array]"]=Ll["[object Int32Array]"]=Ll["[object Uint8Array]"]=Ll["[object Uint8ClampedArray]"]=Ll["[object Uint16Array]"]=Ll["[object Uint32Array]"]=!0,Ll["[object Arguments]"]=Ll["[object Array]"]=Ll["[object ArrayBuffer]"]=Ll["[object Boolean]"]=Ll["[object DataView]"]=Ll["[object Date]"]=Ll["[object Error]"]=Ll["[object Function]"]=Ll["[object Map]"]=Ll["[object Number]"]=Ll["[object Object]"]=Ll["[object RegExp]"]=Ll["[object Set]"]=Ll["[object String]"]=Ll["[object WeakMap]"]=!1;var Ol="object"==typeof t&&t&&!t.nodeType&&t,Rl=Ol&&"object"==typeof module&&module&&!module.nodeType&&module,Al=Rl&&Rl.exports===Ol&&Jo.process,Ml=function(){try{var t=Rl&&Rl.require&&Rl.require("util").types;return t||Al&&Al.binding&&Al.binding("util")}catch(t){}}(),Bl=Ml&&Ml.isTypedArray,Nl=Bl?Il(Bl):function(t){return ca(t)&&ul(t.length)&&!!Ll[ua(t)]},Dl=Object.prototype.hasOwnProperty;function Pl(t,e){var n=pa(t),r=!n&&xl(t),i=!n&&!r&&Tl(t),o=!n&&!r&&!i&&Nl(t),a=n||r||i||o,s=a?vl(t.length,String):[],l=s.length;for(var u in t)!e&&!Dl.call(t,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Us(u,l))||s.push(u);return s}function kl(t,e){return function(n){return t(e(n))}}var zl=kl(Object.keys,Object),Fl=Object.prototype.hasOwnProperty;function Hl(t){if(!pl(t))return zl(t);var e=[];for(var n in Object(t))Fl.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Wl(t){return cl(t)?Pl(t):Hl(t)}var Gl=Object.prototype.hasOwnProperty,Ul=dl((function(t,e){if(pl(e)||cl(e))ol(e,Wl(e),t);else for(var n in e)Gl.call(e,n)&&il(t,n,e[n])})),Yl=Ul;var jl=Object.prototype.hasOwnProperty;function Vl(t){if(!_a(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=pl(t),n=[];for(var r in t)("constructor"!=r||!e&&jl.call(t,r))&&n.push(r);return n}function Xl(t){return cl(t)?Pl(t,!0):Vl(t)}var Kl=dl((function(t,e){ol(e,Xl(e),t)})),ql=Kl,Zl=dl((function(t,e,n,r){ol(e,Xl(e),t,r)})),$l=Zl,Ql=dl((function(t,e,n,r){ol(e,Wl(e),t,r)})),Jl=Ql,tu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eu=/^\w*$/;function nu(t,e){if(pa(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ha(t))||(eu.test(t)||!tu.test(t)||null!=e&&t in Object(e))}var ru=Xa(Object,"create");var iu=Object.prototype.hasOwnProperty;var ou=Object.prototype.hasOwnProperty;function au(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function su(t,e){for(var n=t.length;n--;)if(nl(t[n][0],e))return n;return-1}au.prototype.clear=function(){this.__data__=ru?ru(null):{},this.size=0},au.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},au.prototype.get=function(t){var e=this.__data__;if(ru){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return iu.call(e,t)?e[t]:void 0},au.prototype.has=function(t){var e=this.__data__;return ru?void 0!==e[t]:ou.call(e,t)},au.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ru&&void 0===e?"__lodash_hash_undefined__":e,this};var lu=Array.prototype.splice;function uu(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}uu.prototype.clear=function(){this.__data__=[],this.size=0},uu.prototype.delete=function(t){var e=this.__data__,n=su(e,t);return!(n<0)&&(n==e.length-1?e.pop():lu.call(e,n,1),--this.size,!0)},uu.prototype.get=function(t){var e=this.__data__,n=su(e,t);return n<0?void 0:e[n][1]},uu.prototype.has=function(t){return su(this.__data__,t)>-1},uu.prototype.set=function(t,e){var n=this.__data__,r=su(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var cu=Xa(ea,"Map");function hu(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function du(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}du.prototype.clear=function(){this.size=0,this.__data__={hash:new au,map:new(cu||uu),string:new au}},du.prototype.delete=function(t){var e=hu(this,t).delete(t);return this.size-=e?1:0,e},du.prototype.get=function(t){return hu(this,t).get(t)},du.prototype.has=function(t){return hu(this,t).has(t)},du.prototype.set=function(t,e){var n=hu(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function fu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(fu.Cache||du),n}fu.Cache=du;var pu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vu=/\\(\\)?/g,gu=function(t){var e=fu(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(pu,(function(t,n,r,i){e.push(r?i.replace(vu,"$1"):n||t)})),e})),yu=gu;function mu(t){return null==t?"":ya(t)}function Cu(t,e){return pa(t)?t:nu(t,e)?[t]:yu(mu(t))}function wu(t){if("string"==typeof t||ha(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function xu(t,e){for(var n=0,r=(e=Cu(e,t)).length;null!=t&&n<r;)t=t[wu(e[n++])];return n&&n==r?t:void 0}function Su(t,e,n){var r=null==t?void 0:xu(t,e);return void 0===r?n:r}function Eu(t,e){for(var n=-1,r=e.length,i=Array(r),o=null==t;++n<r;)i[n]=o?void 0:Su(t,e[n]);return i}function _u(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var bu=na?na.isConcatSpreadable:void 0;function Tu(t){return pa(t)||xl(t)||!!(bu&&t&&t[bu])}function Lu(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=Tu),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?Lu(s,e-1,n,r,i):_u(i,s):r||(i[i.length]=s)}return i}function Iu(t){return(null==t?0:t.length)?Lu(t,1):[]}function Ou(t){return Ms(sl(t,void 0,Iu),t+"")}var Ru=Ou(Eu),Au=kl(Object.getPrototypeOf,Object),Mu=Function.prototype,Bu=Object.prototype,Nu=Mu.toString,Du=Bu.hasOwnProperty,Pu=Nu.call(Object);function ku(t){if(!ca(t)||"[object Object]"!=ua(t))return!1;var e=Au(t);if(null===e)return!0;var n=Du.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Nu.call(n)==Pu}function zu(t){if(!ca(t))return!1;var e=ua(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ku(t)}var Fu=ll((function(t,e){try{return ns(t,void 0,e)}catch(t){return zu(t)?t:new Error(t)}})),Hu=Fu;function Wu(t,e){var n;if("function"!=typeof e)throw new TypeError("Expected a function");return t=Ma(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var Gu=ll((function(t,e,n){var r=1;if(n.length){var i=Xs(n,Ws(Gu));r|=32}return Js(t,r,e,n,i)}));Gu.placeholder={};var Uu=Gu,Yu=Ou((function(t,e){return Bs(e,(function(e){e=wu(e),el(t,e,Uu(t[e],t))})),t})),ju=Yu,Vu=ll((function(t,e,n){var r=3;if(n.length){var i=Xs(n,Ws(Vu));r|=32}return Js(e,r,t,n,i)}));Vu.placeholder={};var Xu=Vu;function Ku(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}function qu(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:Ku(t,e,n)}var Zu=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function $u(t){return Zu.test(t)}var Qu="[\\ud800-\\udfff]",Ju="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",tc="\\ud83c[\\udffb-\\udfff]",ec="[^\\ud800-\\udfff]",nc="(?:\\ud83c[\\udde6-\\uddff]){2}",rc="[\\ud800-\\udbff][\\udc00-\\udfff]",ic="(?:"+Ju+"|"+tc+")"+"?",oc="[\\ufe0e\\ufe0f]?",ac=oc+ic+("(?:\\u200d(?:"+[ec,nc,rc].join("|")+")"+oc+ic+")*"),sc="(?:"+[ec+Ju+"?",Ju,nc,rc,Qu].join("|")+")",lc=RegExp(tc+"(?="+tc+")|"+sc+ac,"g");function uc(t){return $u(t)?function(t){return t.match(lc)||[]}(t):function(t){return t.split("")}(t)}function cc(t){return function(e){var n=$u(e=mu(e))?uc(e):void 0,r=n?n[0]:e.charAt(0),i=n?qu(n,1).join(""):e.slice(1);return r[t]()+i}}var hc=cc("toUpperCase");function dc(t){return hc(mu(t).toLowerCase())}function fc(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function pc(t){return function(e){return null==t?void 0:t[e]}}var vc=pc({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),gc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yc=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function mc(t){return(t=mu(t))&&t.replace(gc,vc).replace(yc,"")}var Cc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var wc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var xc="\\u2700-\\u27bf",Sc="a-z\\xdf-\\xf6\\xf8-\\xff",Ec="A-Z\\xc0-\\xd6\\xd8-\\xde",_c="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bc="["+_c+"]",Tc="\\d+",Lc="[\\u2700-\\u27bf]",Ic="["+Sc+"]",Oc="[^\\ud800-\\udfff"+_c+Tc+xc+Sc+Ec+"]",Rc="(?:\\ud83c[\\udde6-\\uddff]){2}",Ac="[\\ud800-\\udbff][\\udc00-\\udfff]",Mc="["+Ec+"]",Bc="(?:"+Ic+"|"+Oc+")",Nc="(?:"+Mc+"|"+Oc+")",Dc="(?:['’](?:d|ll|m|re|s|t|ve))?",Pc="(?:['’](?:D|LL|M|RE|S|T|VE))?",kc="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",zc="[\\ufe0e\\ufe0f]?",Fc=zc+kc+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",Rc,Ac].join("|")+")"+zc+kc+")*"),Hc="(?:"+[Lc,Rc,Ac].join("|")+")"+Fc,Wc=RegExp([Mc+"?"+Ic+"+"+Dc+"(?="+[bc,Mc,"$"].join("|")+")",Nc+"+"+Pc+"(?="+[bc,Mc+Bc,"$"].join("|")+")",Mc+"?"+Bc+"+"+Dc,Mc+"+"+Pc,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tc,Hc].join("|"),"g");function Gc(t,e,n){return t=mu(t),void 0===(e=n?void 0:e)?function(t){return wc.test(t)}(t)?function(t){return t.match(Wc)||[]}(t):function(t){return t.match(Cc)||[]}(t):t.match(e)||[]}var Uc=RegExp("['’]","g");function Yc(t){return function(e){return fc(Gc(mc(e).replace(Uc,"")),t,"")}}var jc=Yc((function(t,e,n){return e=e.toLowerCase(),t+(n?dc(e):e)})),Vc=jc;var Xc=ea.isFinite,Kc=Math.min;function qc(t){var e=Math[t];return function(t,n){if(t=Oa(t),(n=null==n?0:Kc(Ma(n),292))&&Xc(t)){var r=(mu(t)+"e").split("e");return+((r=(mu(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Zc=qc("ceil");function $c(t){var e=ws(t);return e.__chain__=!0,e}var Qc=Math.ceil,Jc=Math.max;function th(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function eh(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=Oa(n))==n?n:0),void 0!==e&&(e=(e=Oa(e))==e?e:0),th(Oa(t),e,n)}function nh(t){var e=this.__data__=new uu(t);this.size=e.size}function rh(t,e){return t&&ol(e,Wl(e),t)}nh.prototype.clear=function(){this.__data__=new uu,this.size=0},nh.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},nh.prototype.get=function(t){return this.__data__.get(t)},nh.prototype.has=function(t){return this.__data__.has(t)},nh.prototype.set=function(t,e){var n=this.__data__;if(n instanceof uu){var r=n.__data__;if(!cu||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new du(r)}return n.set(t,e),this.size=n.size,this};var ih="object"==typeof t&&t&&!t.nodeType&&t,oh=ih&&"object"==typeof module&&module&&!module.nodeType&&module,ah=oh&&oh.exports===ih?ea.Buffer:void 0,sh=ah?ah.allocUnsafe:void 0;function lh(t,e){if(e)return t.slice();var n=t.length,r=sh?sh(n):new t.constructor(n);return t.copy(r),r}function uh(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function ch(){return[]}var hh=Object.prototype.propertyIsEnumerable,dh=Object.getOwnPropertySymbols,fh=dh?function(t){return null==t?[]:(t=Object(t),uh(dh(t),(function(e){return hh.call(t,e)})))}:ch,ph=fh;var vh=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)_u(e,ph(t)),t=Au(t);return e}:ch,gh=vh;function yh(t,e,n){var r=e(t);return pa(t)?r:_u(r,n(t))}function mh(t){return yh(t,Wl,ph)}function Ch(t){return yh(t,Xl,gh)}var wh=Xa(ea,"DataView"),xh=Xa(ea,"Promise"),Sh=Xa(ea,"Set"),Eh="[object Map]",_h="[object Promise]",bh="[object Set]",Th="[object WeakMap]",Lh="[object DataView]",Ih=Fa(wh),Oh=Fa(cu),Rh=Fa(xh),Ah=Fa(Sh),Mh=Fa(Ka),Bh=ua;(wh&&Bh(new wh(new ArrayBuffer(1)))!=Lh||cu&&Bh(new cu)!=Eh||xh&&Bh(xh.resolve())!=_h||Sh&&Bh(new Sh)!=bh||Ka&&Bh(new Ka)!=Th)&&(Bh=function(t){var e=ua(t),n="[object Object]"==e?t.constructor:void 0,r=n?Fa(n):"";if(r)switch(r){case Ih:return Lh;case Oh:return Eh;case Rh:return _h;case Ah:return bh;case Mh:return Th}return e});var Nh=Bh,Dh=Object.prototype.hasOwnProperty;var Ph=ea.Uint8Array;function kh(t){var e=new t.constructor(t.byteLength);return new Ph(e).set(new Ph(t)),e}var zh=/\w*$/;var Fh=na?na.prototype:void 0,Hh=Fh?Fh.valueOf:void 0;function Wh(t,e){var n=e?kh(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Gh(t,e,n){var r,i=t.constructor;switch(e){case"[object ArrayBuffer]":return kh(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return function(t,e){var n=e?kh(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Wh(t,n);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,zh.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return r=t,Hh?Object(Hh.call(r)):{}}}function Uh(t){return"function"!=typeof t.constructor||pl(t)?{}:ts(Au(t))}var Yh=Ml&&Ml.isMap,jh=Yh?Il(Yh):function(t){return ca(t)&&"[object Map]"==Nh(t)};var Vh=Ml&&Ml.isSet,Xh=Vh?Il(Vh):function(t){return ca(t)&&"[object Set]"==Nh(t)},Kh="[object Arguments]",qh="[object Function]",Zh="[object Object]",$h={};function Qh(t,e,n,r,i,o){var a,s=1&e,l=2&e,u=4&e;if(n&&(a=i?n(t,r,i,o):n(t)),void 0!==a)return a;if(!_a(t))return t;var c=pa(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Dh.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return ys(t,a)}else{var h=Nh(t),d=h==qh||"[object GeneratorFunction]"==h;if(Tl(t))return lh(t,s);if(h==Zh||h==Kh||d&&!i){if(a=l||d?{}:Uh(t),!s)return l?function(t,e){return ol(t,gh(t),e)}(t,function(t,e){return t&&ol(e,Xl(e),t)}(a,t)):function(t,e){return ol(t,ph(t),e)}(t,rh(a,t))}else{if(!$h[h])return i?t:{};a=Gh(t,h,s)}}o||(o=new nh);var f=o.get(t);if(f)return f;o.set(t,a),Xh(t)?t.forEach((function(r){a.add(Qh(r,e,n,r,t,o))})):jh(t)&&t.forEach((function(r,i){a.set(i,Qh(r,e,n,i,t,o))}));var p=c?void 0:(u?l?Ch:mh:l?Xl:Wl)(t);return Bs(p||t,(function(r,i){p&&(r=t[i=r]),il(a,i,Qh(r,e,n,i,t,o))})),a}$h[Kh]=$h["[object Array]"]=$h["[object ArrayBuffer]"]=$h["[object DataView]"]=$h["[object Boolean]"]=$h["[object Date]"]=$h["[object Float32Array]"]=$h["[object Float64Array]"]=$h["[object Int8Array]"]=$h["[object Int16Array]"]=$h["[object Int32Array]"]=$h["[object Map]"]=$h["[object Number]"]=$h[Zh]=$h["[object RegExp]"]=$h["[object Set]"]=$h["[object String]"]=$h["[object Symbol]"]=$h["[object Uint8Array]"]=$h["[object Uint8ClampedArray]"]=$h["[object Uint16Array]"]=$h["[object Uint32Array]"]=!0,$h["[object Error]"]=$h[qh]=$h["[object WeakMap]"]=!1;function Jh(t){return Qh(t,4)}function td(t){return Qh(t,5)}function ed(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i}function nd(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return _u(pa(n)?ys(n):[n],Lu(e,1))}function rd(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new du;++e<n;)this.add(t[e])}function id(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function od(t,e){return t.has(e)}rd.prototype.add=rd.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},rd.prototype.has=function(t){return this.__data__.has(t)};function ad(t,e,n,r,i,o){var a=1&n,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var h=-1,d=!0,f=2&n?new rd:void 0;for(o.set(t,e),o.set(e,t);++h<s;){var p=t[h],v=e[h];if(r)var g=a?r(v,p,h,e,t,o):r(p,v,h,t,e,o);if(void 0!==g){if(g)continue;d=!1;break}if(f){if(!id(e,(function(t,e){if(!od(f,e)&&(p===t||i(p,t,n,r,o)))return f.push(e)}))){d=!1;break}}else if(p!==v&&!i(p,v,n,r,o)){d=!1;break}}return o.delete(t),o.delete(e),d}function sd(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function ld(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var ud=na?na.prototype:void 0,cd=ud?ud.valueOf:void 0;var hd=Object.prototype.hasOwnProperty;var dd="[object Arguments]",fd="[object Array]",pd="[object Object]",vd=Object.prototype.hasOwnProperty;function gd(t,e,n,r,i,o){var a=pa(t),s=pa(e),l=a?fd:Nh(t),u=s?fd:Nh(e),c=(l=l==dd?pd:l)==pd,h=(u=u==dd?pd:u)==pd,d=l==u;if(d&&Tl(t)){if(!Tl(e))return!1;a=!0,c=!1}if(d&&!c)return o||(o=new nh),a||Nl(t)?ad(t,e,n,r,i,o):function(t,e,n,r,i,o,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Ph(t),new Ph(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return nl(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=sd;case"[object Set]":var l=1&r;if(s||(s=ld),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;r|=2,a.set(t,e);var c=ad(s(t),s(e),r,i,o,a);return a.delete(t),c;case"[object Symbol]":if(cd)return cd.call(t)==cd.call(e)}return!1}(t,e,l,n,r,i,o);if(!(1&n)){var f=c&&vd.call(t,"__wrapped__"),p=h&&vd.call(e,"__wrapped__");if(f||p){var v=f?t.value():t,g=p?e.value():e;return o||(o=new nh),i(v,g,n,r,o)}}return!!d&&(o||(o=new nh),function(t,e,n,r,i,o){var a=1&n,s=mh(t),l=s.length;if(l!=mh(e).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in e:hd.call(e,c)))return!1}var h=o.get(t),d=o.get(e);if(h&&d)return h==e&&d==t;var f=!0;o.set(t,e),o.set(e,t);for(var p=a;++u<l;){var v=t[c=s[u]],g=e[c];if(r)var y=a?r(g,v,c,e,t,o):r(v,g,c,t,e,o);if(!(void 0===y?v===g||i(v,g,n,r,o):y)){f=!1;break}p||(p="constructor"==c)}if(f&&!p){var m=t.constructor,C=e.constructor;m==C||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof C&&C instanceof C||(f=!1)}return o.delete(t),o.delete(e),f}(t,e,n,r,i,o))}function yd(t,e,n,r,i){return t===e||(null==t||null==e||!ca(t)&&!ca(e)?t!=t&&e!=e:gd(t,e,n,r,yd,i))}function md(t,e,n,r){var i=n.length,o=i,a=!r;if(null==t)return!o;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){var l=(s=n[i])[0],u=t[l],c=s[1];if(a&&s[2]){if(void 0===u&&!(l in t))return!1}else{var h=new nh;if(r)var d=r(u,c,l,t,e,h);if(!(void 0===d?yd(c,u,3,r,h):d))return!1}}return!0}function Cd(t){return t==t&&!_a(t)}function wd(t){for(var e=Wl(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Cd(i)]}return e}function xd(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function Sd(t){var e=wd(t);return 1==e.length&&e[0][2]?xd(e[0][0],e[0][1]):function(n){return n===t||md(n,t,e)}}function Ed(t,e){return null!=t&&e in Object(t)}function _d(t,e,n){for(var r=-1,i=(e=Cu(e,t)).length,o=!1;++r<i;){var a=wu(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&ul(i)&&Us(a,i)&&(pa(t)||xl(t))}function bd(t,e){return null!=t&&_d(t,e,Ed)}function Td(t,e){return nu(t)&&Cd(e)?xd(wu(t),e):function(n){var r=Su(n,t);return void 0===r&&r===e?bd(n,t):yd(e,r,3)}}function Ld(t){return function(e){return null==e?void 0:e[t]}}function Id(t){return nu(t)?Ld(wu(t)):function(t){return function(e){return xu(e,t)}}(t)}function Od(t){return"function"==typeof t?t:null==t?Ba:"object"==typeof t?pa(t)?Td(t[0],t[1]):Sd(t):Id(t)}function Rd(t){var e=null==t?0:t.length,n=Od;return t=e?fa(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],ll((function(n){for(var r=-1;++r<e;){var i=t[r];if(ns(i[0],this,n))return ns(i[1],this,n)}}))}function Ad(t,e,n){var r=n.length;if(null==t)return!r;for(t=Object(t);r--;){var i=n[r],o=e[i],a=t[i];if(void 0===a&&!(i in t)||!o(a))return!1}return!0}function Md(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Bd(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(!1===n(o[l],l,o))break}return e}}var Nd=Bd();function Dd(t,e){return t&&Nd(t,e,Wl)}function Pd(t,e){return function(n,r){if(null==n)return n;if(!cl(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}var kd=Pd(Dd);function zd(t,e,n,r){return kd(t,(function(t,i,o){e(r,t,n(t),o)})),r}function Fd(t,e){return function(n,r){var i=pa(n)?Md:zd,o=e?e():{};return i(n,t,Od(r),o)}}var Hd=Object.prototype.hasOwnProperty,Wd=Fd((function(t,e,n){Hd.call(t,n)?++t[n]:el(t,n,1)})),Gd=Wd;function Ud(t,e,n){var r=Js(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=Ud.placeholder,r}Ud.placeholder={};function Yd(t,e,n){var r=Js(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=Yd.placeholder,r}Yd.placeholder={};var jd=function(){return ea.Date.now()},Vd=Math.max,Xd=Math.min;function Kd(t,e,n){var r,i,o,a,s,l,u=0,c=!1,h=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var n=r,o=i;return r=i=void 0,u=e,a=t.apply(o,n)}function p(t){return u=t,s=setTimeout(g,e),c?f(t):a}function v(t){var n=t-l;return void 0===l||n>=e||n<0||h&&t-u>=o}function g(){var t=jd();if(v(t))return y(t);s=setTimeout(g,function(t){var n=e-(t-l);return h?Xd(n,o-(t-u)):n}(t))}function y(t){return s=void 0,d&&r?f(t):(r=i=void 0,a)}function m(){var t=jd(),n=v(t);if(r=arguments,i=this,l=t,n){if(void 0===s)return p(l);if(h)return clearTimeout(s),s=setTimeout(g,e),f(l)}return void 0===s&&(s=setTimeout(g,e)),a}return e=Oa(e)||0,_a(n)&&(c=!!n.leading,o=(h="maxWait"in n)?Vd(Oa(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d),m.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},m.flush=function(){return void 0===s?a:y(jd())},m}var qd=Object.prototype,Zd=qd.hasOwnProperty,$d=ll((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&hl(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],a=Xl(o),s=-1,l=a.length;++s<l;){var u=a[s],c=t[u];(void 0===c||nl(c,qd[u])&&!Zd.call(t,u))&&(t[u]=o[u])}return t})),Qd=$d;function Jd(t,e,n){(void 0!==n&&!nl(t[e],n)||void 0===n&&!(e in t))&&el(t,e,n)}function tf(t){return ca(t)&&cl(t)}function ef(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function nf(t){return ol(t,Xl(t))}function rf(t,e,n,r,i){t!==e&&Nd(e,(function(o,a){if(i||(i=new nh),_a(o))!function(t,e,n,r,i,o,a){var s=ef(t,n),l=ef(e,n),u=a.get(l);if(u)Jd(t,n,u);else{var c=o?o(s,l,n+"",t,e,a):void 0,h=void 0===c;if(h){var d=pa(l),f=!d&&Tl(l),p=!d&&!f&&Nl(l);c=l,d||f||p?pa(s)?c=s:tf(s)?c=ys(s):f?(h=!1,c=lh(l,!0)):p?(h=!1,c=Wh(l,!0)):c=[]:ku(l)||xl(l)?(c=s,xl(s)?c=nf(s):_a(s)&&!Na(s)||(c=Uh(l))):h=!1}h&&(a.set(l,c),i(c,l,r,o,a),a.delete(l)),Jd(t,n,c)}}(t,e,a,n,rf,r,i);else{var s=r?r(ef(t,a),o,a+"",t,e,i):void 0;void 0===s&&(s=o),Jd(t,a,s)}}),Xl)}function of(t,e,n,r,i,o){return _a(t)&&_a(e)&&(o.set(e,t),rf(t,e,void 0,of,o),o.delete(e)),t}var af=dl((function(t,e,n,r){rf(t,e,n,r)})),sf=af,lf=ll((function(t){return t.push(void 0,of),ns(sf,void 0,t)}));function uf(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var cf=ll((function(t,e){return uf(t,1,e)})),hf=cf,df=ll((function(t,e,n){return uf(t,Oa(e)||0,n)})),ff=df;function pf(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function vf(t,e,n,r){var i=-1,o=ks,a=!0,s=t.length,l=[],u=e.length;if(!s)return l;n&&(e=fa(e,Il(n))),r?(o=pf,a=!1):e.length>=200&&(o=od,a=!1,e=new rd(e));t:for(;++i<s;){var c=t[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,a&&h==h){for(var d=u;d--;)if(e[d]===h)continue t;l.push(c)}else o(e,h,r)||l.push(c)}return l}var gf=ll((function(t,e){return tf(t)?vf(t,Lu(e,1,tf,!0)):[]})),yf=gf;function mf(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Cf=ll((function(t,e){var n=mf(e);return tf(n)&&(n=void 0),tf(t)?vf(t,Lu(e,1,tf,!0),Od(n)):[]})),wf=Cf,xf=ll((function(t,e){var n=mf(e);return tf(n)&&(n=void 0),tf(t)?vf(t,Lu(e,1,tf,!0),void 0,n):[]})),Sf=xf,Ef=ma((function(t,e){return t/e}),1);function _f(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?Ku(t,r?0:o,r?o+1:i):Ku(t,r?o+1:0,r?i:o)}function bf(t){return"function"==typeof t?t:Ba}function Tf(t,e){return(pa(t)?Bs:kd)(t,bf(e))}function Lf(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var If=Bd(!0);function Of(t,e){return t&&If(t,e,Wl)}var Rf=Pd(Of,!0);function Af(t,e){return(pa(t)?Lf:Rf)(t,bf(e))}function Mf(t,e,n){t=mu(t),e=ya(e);var r=t.length,i=n=void 0===n?r:th(Ma(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e}function Bf(t){return function(e){var n=Nh(e);return"[object Map]"==n?sd(e):"[object Set]"==n?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return fa(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var Nf=Bf(Wl),Df=Bf(Xl),Pf=pc({"&":"&","<":"<",">":">",'"':""","'":"'"}),kf=/[&<>"']/g,zf=RegExp(kf.source);function Ff(t){return(t=mu(t))&&zf.test(t)?t.replace(kf,Pf):t}var Hf=/[\\^$.*+?()[\]{}|]/g,Wf=RegExp(Hf.source);function Gf(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Uf(t,e){var n=!0;return kd(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function Yf(t,e,n){var r=pa(t)?Gf:Uf;return n&&hl(t,e,n)&&(e=void 0),r(t,Od(e))}function jf(t){return t?th(Ma(t),0,4294967295):0}function Vf(t,e){var n=[];return kd(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function Xf(t,e){return(pa(t)?uh:Vf)(t,Od(e))}function Kf(t){return function(e,n,r){var i=Object(e);if(!cl(e)){var o=Od(n);e=Wl(e),n=function(t){return o(i[t],t,i)}}var a=t(e,n,r);return a>-1?i[o?e[a]:a]:void 0}}var qf=Math.max;function Zf(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Ma(n);return i<0&&(i=qf(r+i,0)),Ns(t,Od(e),i)}var $f=Kf(Zf);function Qf(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}var Jf=Math.max,tp=Math.min;function ep(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=Ma(n),i=n<0?Jf(r+i,0):tp(i,r-1)),Ns(t,Od(e),i,!0)}var np=Kf(ep);function rp(t){return t&&t.length?t[0]:void 0}function ip(t,e){var n=-1,r=cl(t)?Array(t.length):[];return kd(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}function op(t,e){return(pa(t)?fa:ip)(t,Od(e))}var ap=qc("floor");function sp(t){return Ou((function(e){var n=e.length,r=n,i=gs.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new TypeError("Expected a function");if(i&&!a&&"wrapper"==vs(o))var a=new gs([],!0)}for(r=a?r:n;++r<n;){var s=vs(o=e[r]),l="wrapper"==s?ds(o):void 0;a=l&&xs(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[vs(l[0])].apply(a,l[3]):1==o.length&&xs(o)?a[s]():a.thru(o)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&pa(r))return a.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}var lp=sp(),up=sp(!0);function cp(t,e){return null==t?t:Nd(t,bf(e),Xl)}function hp(t,e){return uh(e,(function(e){return Na(t[e])}))}var dp=Object.prototype.hasOwnProperty,fp=Fd((function(t,e,n){dp.call(t,n)?t[n].push(e):el(t,n,[e])})),pp=fp;function vp(t,e){return t>e}function gp(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=Oa(e),n=Oa(n)),t(e,n)}}var yp=gp(vp),mp=gp((function(t,e){return t>=e})),Cp=Object.prototype.hasOwnProperty;function wp(t,e){return null!=t&&Cp.call(t,e)}function xp(t,e){return null!=t&&_d(t,e,wp)}var Sp=Math.max,Ep=Math.min;function _p(t,e,n){return e=Aa(e),void 0===n?(n=e,e=0):n=Aa(n),function(t,e,n){return t>=Ep(e,n)&&t<Sp(e,n)}(t=Oa(t),e,n)}function bp(t){return"string"==typeof t||!pa(t)&&ca(t)&&"[object String]"==ua(t)}function Tp(t,e){return fa(e,(function(e){return t[e]}))}function Lp(t){return null==t?[]:Tp(t,Wl(t))}var Ip=Math.max;function Op(t,e,n,r){t=cl(t)?t:Lp(t),n=n&&!r?Ma(n):0;var i=t.length;return n<0&&(n=Ip(i+n,0)),bp(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Ps(t,e,n)>-1}var Rp=Math.max;function Ap(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Ma(n);return i<0&&(i=Rp(r+i,0)),Ps(t,e,i)}var Mp=Math.min;function Bp(t,e,n){for(var r=n?pf:ks,i=t[0].length,o=t.length,a=o,s=Array(o),l=1/0,u=[];a--;){var c=t[a];a&&e&&(c=fa(c,Il(e))),l=Mp(c.length,l),s[a]=!n&&(e||i>=120&&c.length>=120)?new rd(a&&c):void 0}c=t[0];var h=-1,d=s[0];t:for(;++h<i&&u.length<l;){var f=c[h],p=e?e(f):f;if(f=n||0!==f?f:0,!(d?od(d,p):r(u,p,n))){for(a=o;--a;){var v=s[a];if(!(v?od(v,p):r(t[a],p,n)))continue t}d&&d.push(p),u.push(f)}}return u}function Np(t){return tf(t)?t:[]}var Dp=ll((function(t){var e=fa(t,Np);return e.length&&e[0]===t[0]?Bp(e):[]})),Pp=ll((function(t){var e=mf(t),n=fa(t,Np);return e===mf(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?Bp(n,Od(e)):[]})),kp=Pp,zp=ll((function(t){var e=mf(t),n=fa(t,Np);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?Bp(n,void 0,e):[]}));function Fp(t,e){return function(n,r){return function(t,e,n,r){return Dd(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}var Hp=Object.prototype.toString,Wp=Fp((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Hp.call(e)),t[e]=n}),Is(Ba)),Gp=Wp,Up=Object.prototype,Yp=Up.hasOwnProperty,jp=Up.toString,Vp=Fp((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=jp.call(e)),Yp.call(t,e)?t[e].push(n):t[e]=[n]}),Od),Xp=Vp;function Kp(t,e){return e.length<2?t:xu(t,Ku(e,0,-1))}function qp(t,e,n){var r=null==(t=Kp(t,e=Cu(e,t)))?t:t[wu(mf(e))];return null==r?void 0:ns(r,t,n)}var Zp=ll(qp),$p=ll((function(t,e,n){var r=-1,i="function"==typeof e,o=cl(t)?Array(t.length):[];return kd(t,(function(t){o[++r]=i?ns(e,t,n):qp(t,e,n)})),o})),Qp=$p;var Jp=Ml&&Ml.isArrayBuffer,tv=Jp?Il(Jp):function(t){return ca(t)&&"[object ArrayBuffer]"==ua(t)};function ev(t){return!0===t||!1===t||ca(t)&&"[object Boolean]"==ua(t)}var nv=Ml&&Ml.isDate,rv=nv?Il(nv):function(t){return ca(t)&&"[object Date]"==ua(t)};var iv=Object.prototype.hasOwnProperty;function ov(t){if(null==t)return!0;if(cl(t)&&(pa(t)||"string"==typeof t||"function"==typeof t.splice||Tl(t)||Nl(t)||xl(t)))return!t.length;var e=Nh(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(pl(t))return!Hl(t).length;for(var n in t)if(iv.call(t,n))return!1;return!0}function av(t,e){return yd(t,e)}var sv=ea.isFinite;function lv(t){return"number"==typeof t&&t==Ma(t)}function uv(t){return"number"==typeof t||ca(t)&&"[object Number]"==ua(t)}function cv(t){return uv(t)&&t!=+t}var hv=Pa?Na:Sl;function dv(t){return null==t}var fv=Ml&&Ml.isRegExp,pv=fv?Il(fv):function(t){return ca(t)&&"[object RegExp]"==ua(t)},vv=9007199254740991;function gv(t){return void 0===t}var yv=Array.prototype.join;var mv=Yc((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Cv=mv,wv=Fd((function(t,e,n){el(t,n,e)})),xv=wv;var Sv=Math.max,Ev=Math.min;var _v=Yc((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),bv=_v,Tv=cc("toLowerCase");function Lv(t,e){return t<e}var Iv=gp(Lv),Ov=gp((function(t,e){return t<=e}));function Rv(t,e){var n={};return e=Od(e),Dd(t,(function(t,r,i){el(n,e(t,r,i),t)})),n}function Av(t){return Sd(Qh(t,1))}function Mv(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=e(o);if(null!=a&&(void 0===s?a==a&&!ha(a):n(a,s)))var s=a,l=o}return l}function Bv(t){return t&&t.length?Mv(t,Ba,vp):void 0}function Nv(t,e){return t&&t.length?Mv(t,Od(e),vp):void 0}function Dv(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Pv(t,e){var n=null==t?0:t.length;return n?Dv(t,e)/n:NaN}var kv=dl((function(t,e,n){rf(t,e,n)})),zv=kv,Fv=ll((function(t,e){return function(n){return qp(n,t,e)}})),Hv=Fv,Wv=ll((function(t,e){return function(n){return qp(t,n,e)}})),Gv=Wv;function Uv(t){return t&&t.length?Mv(t,Ba,Lv):void 0}function Yv(t,e,n){var r=Wl(e),i=hp(e,r),o=!(_a(n)&&"chain"in n&&!n.chain),a=Na(t);return Bs(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=ys(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,_u([this.value()],arguments))})})),t}var jv=ma((function(t,e){return t*e}),1);function Vv(t){if("function"!=typeof t)throw new TypeError("Expected a function");return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var Xv=na?na.iterator:void 0;function Kv(t){if(!t)return[];if(cl(t))return bp(t)?uc(t):ys(t);if(Xv&&t[Xv])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Xv]());var e=Nh(t);return("[object Map]"==e?sd:"[object Set]"==e?ld:Lp)(t)}function qv(t,e){var n=t.length;if(n)return Us(e+=e<0?n:0,n)?t[e]:void 0}function Zv(t,e){return null==(t=Kp(t,e=Cu(e,t)))||delete t[wu(mf(e))]}function $v(t){return ku(t)?void 0:t}var Qv=Ou((function(t,e){var n={};if(null==t)return n;var r=!1;e=fa(e,(function(e){return e=Cu(e,t),r||(r=e.length>1),e})),ol(t,Ch(t),n),r&&(n=Qh(n,7,$v));for(var i=e.length;i--;)Zv(n,e[i]);return n})),Jv=Qv;function tg(t,e,n,r){if(!_a(t))return t;for(var i=-1,o=(e=Cu(e,t)).length,a=o-1,s=t;null!=s&&++i<o;){var l=wu(e[i]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=a){var c=s[l];void 0===(u=r?r(c,l,s):void 0)&&(u=_a(c)?c:Us(e[i+1])?[]:{})}il(s,l,u),s=s[l]}return t}function eg(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=xu(t,a);n(s,a)&&tg(o,Cu(a,t),s)}return o}function ng(t,e){if(null==t)return{};var n=fa(Ch(t),(function(t){return[t]}));return e=Od(e),eg(t,n,(function(t,n){return e(t,n[0])}))}function rg(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=ha(t),a=void 0!==e,s=null===e,l=e==e,u=ha(e);if(!s&&!u&&!o&&t>e||o&&a&&l&&!s&&!u||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!u&&t<e||u&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!l)return-1}return 0}function ig(t,e,n){e=e.length?fa(e,(function(t){return pa(t)?function(e){return xu(e,1===t.length?t[0]:t)}:t})):[Ba];var r=-1;e=fa(e,Il(Od));var i=ip(t,(function(t,n,i){var o=fa(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var l=rg(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function og(t,e,n,r){return null==t?[]:(pa(e)||(e=null==e?[]:[e]),pa(n=r?void 0:n)||(n=null==n?[]:[n]),ig(t,e,n))}function ag(t){return Ou((function(e){return e=fa(e,Il(Od)),ll((function(n){var r=this;return t(e,(function(t){return ns(t,r,n)}))}))}))}var sg=ag(fa),lg=ll,ug=Math.min,cg=lg((function(t,e){var n=(e=1==e.length&&pa(e[0])?fa(e[0],Il(Od)):fa(Lu(e,1),Il(Od))).length;return ll((function(r){for(var i=-1,o=ug(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return ns(t,this,r)}))})),hg=cg,dg=ag(Gf),fg=ag(id),pg=Math.floor;function vg(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=pg(e/2))&&(t+=t)}while(e);return n}var gg=Ld("length"),yg="[\\ud800-\\udfff]",mg="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Cg="\\ud83c[\\udffb-\\udfff]",wg="[^\\ud800-\\udfff]",xg="(?:\\ud83c[\\udde6-\\uddff]){2}",Sg="[\\ud800-\\udbff][\\udc00-\\udfff]",Eg="(?:"+mg+"|"+Cg+")"+"?",_g="[\\ufe0e\\ufe0f]?",bg=_g+Eg+("(?:\\u200d(?:"+[wg,xg,Sg].join("|")+")"+_g+Eg+")*"),Tg="(?:"+[wg+mg+"?",mg,xg,Sg,yg].join("|")+")",Lg=RegExp(Cg+"(?="+Cg+")|"+Tg+bg,"g");function Ig(t){return $u(t)?function(t){for(var e=Lg.lastIndex=0;Lg.test(t);)++e;return e}(t):gg(t)}var Og=Math.ceil;function Rg(t,e){var n=(e=void 0===e?" ":ya(e)).length;if(n<2)return n?vg(e,t):e;var r=vg(e,Og(t/Ig(e)));return $u(e)?qu(uc(r),0,t).join(""):r.slice(0,t)}var Ag=Math.ceil,Mg=Math.floor;var Bg=/^\s+/,Ng=ea.parseInt;var Dg=ll((function(t,e){return Js(t,32,void 0,e,Xs(e,Ws(Dg)))}));Dg.placeholder={};var Pg=Dg,kg=ll((function(t,e){return Js(t,64,void 0,e,Xs(e,Ws(kg)))}));kg.placeholder={};var zg=kg,Fg=Fd((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Hg=Fg;var Wg=Ou((function(t,e){return null==t?{}:function(t,e){return eg(t,e,(function(e,n){return bd(t,n)}))}(t,e)})),Gg=Wg;function Ug(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}var Yg=Array.prototype.splice;function jg(t,e,n,r){var i=r?Ug:Ps,o=-1,a=e.length,s=t;for(t===e&&(e=ys(e)),n&&(s=fa(t,Il(n)));++o<a;)for(var l=0,u=e[o],c=n?n(u):u;(l=i(s,c,l,r))>-1;)s!==t&&Yg.call(s,l,1),Yg.call(t,l,1);return t}function Vg(t,e){return t&&t.length&&e&&e.length?jg(t,e):t}var Xg=ll(Vg);var Kg=Array.prototype.splice;function qg(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Us(i)?Kg.call(t,i,1):Zv(t,i)}}return t}var Zg=Ou((function(t,e){var n=null==t?0:t.length,r=Eu(t,e);return qg(t,fa(e,(function(t){return Us(t,n)?+t:t})).sort(rg)),r})),$g=Zg,Qg=Math.floor,Jg=Math.random;function ty(t,e){return t+Qg(Jg()*(e-t+1))}var ey=parseFloat,ny=Math.min,ry=Math.random;var iy=Math.ceil,oy=Math.max;function ay(t){return function(e,n,r){return r&&"number"!=typeof r&&hl(e,n,r)&&(n=r=void 0),e=Aa(e),void 0===n?(n=e,e=0):n=Aa(n),function(t,e,n,r){for(var i=-1,o=oy(iy((e-t)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=t,t+=n;return a}(e,n,r=void 0===r?e<n?1:-1:Aa(r),t)}}var sy=ay(),ly=ay(!0),uy=Ou((function(t,e){return Js(t,256,void 0,void 0,void 0,e)})),cy=uy;function hy(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function dy(t,e,n){var r=pa(t)?fc:hy,i=arguments.length<3;return r(t,Od(e),n,i,kd)}function fy(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function py(t,e,n){return e=(n?hl(t,e,n):void 0===e)?1:Ma(e),vg(mu(t),e)}var vy=Array.prototype.reverse;function gy(t){return null==t?t:vy.call(t)}var yy=qc("round");function my(t){var e=t.length;return e?t[ty(0,e-1)]:void 0}function Cy(t){return my(Lp(t))}function wy(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n<e;){var o=ty(n,i),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t}function xy(t,e){return wy(ys(t),th(e,0,t.length))}function Sy(t,e){var n=Lp(t);return wy(n,th(e,0,n.length))}function Ey(t,e,n){return null==t?t:tg(t,e,n)}function _y(t){return wy(ys(t))}function by(t){return wy(Lp(t))}function Ty(t){if(null==t)return 0;if(cl(t))return bp(t)?Ig(t):t.length;var e=Nh(t);return"[object Map]"==e||"[object Set]"==e?t.size:Hl(t).length}var Ly=Yc((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Iy=Ly;function Oy(t,e){var n;return kd(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}var Ry=ll((function(t,e){if(null==t)return[];var n=e.length;return n>1&&hl(t,e[0],e[1])?e=[]:n>2&&hl(e[0],e[1],e[2])&&(e=[e[0]]),ig(t,Lu(e,1),[])})),Ay=Ry,My=Math.floor,By=Math.min;function Ny(t,e,n,r){var i=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(e=n(e))!=e,s=null===e,l=ha(e),u=void 0===e;i<o;){var c=My((i+o)/2),h=n(t[c]),d=void 0!==h,f=null===h,p=h==h,v=ha(h);if(a)var g=r||p;else g=u?p&&(r||d):s?p&&d&&(r||!f):l?p&&d&&!f&&(r||!v):!f&&!v&&(r?h<=e:h<e);g?i=c+1:o=c}return By(o,4294967294)}function Dy(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!ha(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return Ny(t,e,Ba,n)}function Py(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!nl(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function ky(t,e,n){return n&&"number"!=typeof n&&hl(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=mu(t))&&("string"==typeof e||null!=e&&!pv(e))&&!(e=ya(e))&&$u(t)?qu(uc(t),0,n):t.split(e,n):[]}var zy=Math.max;var Fy=Yc((function(t,e,n){return t+(n?" ":"")+hc(e)})),Hy=Fy;function Wy(){return!0}var Gy=ma((function(t,e){return t-e}),0);var Uy=Object.prototype,Yy=Uy.hasOwnProperty;function jy(t,e,n,r){return void 0===t||nl(t,Uy[n])&&!Yy.call(r,n)?e:t}var Vy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Xy(t){return"\\"+Vy[t]}var Ky=/<%=([\s\S]+?)%>/g,qy={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Ky,variable:"",imports:{_:{escape:Ff}}},Zy=/\b__p \+= '';/g,$y=/\b(__p \+=) '' \+/g,Qy=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Jy=/[()=,{}\[\]\/\s]/,tm=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,em=/($^)/,nm=/['\n\r\u2028\u2029\\]/g,rm=Object.prototype.hasOwnProperty;function im(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return _a(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Kd(t,e,{leading:r,maxWait:e,trailing:i})}function om(t,e){return e(t)}var am=4294967295,sm=Math.min;function lm(t,e){var n=t;return n instanceof us&&(n=n.value()),fc(e,(function(t,e){return e.func.apply(e.thisArg,_u([t],e.args))}),n)}function um(){return lm(this.__wrapped__,this.__actions__)}var cm=9007199254740991;function hm(t){return mu(t).toUpperCase()}function dm(t,e){for(var n=t.length;n--&&Ps(e,t[n],0)>-1;);return n}function fm(t,e){for(var n=-1,r=t.length;++n<r&&Ps(e,t[n],0)>-1;);return n}function pm(t,e,n){if((t=mu(t))&&(n||void 0===e))return Ea(t);if(!t||!(e=ya(e)))return t;var r=uc(t),i=uc(e);return qu(r,fm(r,i),dm(r,i)+1).join("")}var vm=/^\s+/;var gm=/\w*$/;var ym=pc({"&":"&","<":"<",">":">",""":'"',"'":"'"}),mm=/&(?:amp|lt|gt|quot|#39);/g,Cm=RegExp(mm.source);var wm=Sh&&1/ld(new Sh([,-0]))[1]==1/0?function(t){return new Sh(t)}:cs,xm=wm;function Sm(t,e,n){var r=-1,i=ks,o=t.length,a=!0,s=[],l=s;if(n)a=!1,i=pf;else if(o>=200){var u=e?null:xm(t);if(u)return ld(u);a=!1,i=od,l=new rd}else l=e?[]:s;t:for(;++r<o;){var c=t[r],h=e?e(c):c;if(c=n||0!==c?c:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue t;e&&l.push(h),s.push(c)}else i(l,h,n)||(l!==s&&l.push(h),s.push(c))}return s}var Em=ll((function(t){return Sm(Lu(t,1,tf,!0))})),_m=ll((function(t){var e=mf(t);return tf(e)&&(e=void 0),Sm(Lu(t,1,tf,!0),Od(e))})),bm=_m,Tm=ll((function(t){var e=mf(t);return e="function"==typeof e?e:void 0,Sm(Lu(t,1,tf,!0),void 0,e)}));function Lm(t){return t&&t.length?Sm(t):[]}var Im=0;function Om(t,e){return null==t||Zv(t,e)}var Rm=Math.max;function Am(t){if(!t||!t.length)return[];var e=0;return t=uh(t,(function(t){if(tf(t))return e=Rm(t.length,e),!0})),vl(e,(function(e){return fa(t,Ld(e))}))}function Mm(t,e){if(!t||!t.length)return[];var n=Am(t);return null==e?n:fa(n,(function(t){return ns(e,void 0,t)}))}function Bm(t,e,n,r){return tg(t,e,n(xu(t,e)),r)}var Nm=Yc((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Dm=Nm;var Pm=ll((function(t,e){return tf(t)?vf(t,e):[]})),km=Pm;var zm=Ou((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Eu(e,t)};return!(e>1||this.__actions__.length)&&r instanceof us&&Us(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:om,args:[i],thisArg:void 0}),new gs(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)})),Fm=zm;function Hm(t,e,n){var r=t.length;if(r<2)return r?Sm(t[0]):[];for(var i=-1,o=Array(r);++i<r;)for(var a=t[i],s=-1;++s<r;)s!=i&&(o[i]=vf(o[i]||a,t[s],e,n));return Sm(Lu(o,1),e,n)}var Wm=ll((function(t){return Hm(uh(t,tf))})),Gm=ll((function(t){var e=mf(t);return tf(e)&&(e=void 0),Hm(uh(t,tf),Od(e))})),Um=Gm,Ym=ll((function(t){var e=mf(t);return e="function"==typeof e?e:void 0,Hm(uh(t,tf),void 0,e)})),jm=ll(Am);function Vm(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:void 0;n(a,t[r],s)}return a}var Xm=ll((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Mm(t,n)})),Km={chunk:function(t,e,n){e=(n?hl(t,e,n):void 0===e)?1:Jc(Ma(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var i=0,o=0,a=Array(Qc(r/e));i<r;)a[o++]=Ku(t,i,i+=e);return a},compact:ed,concat:nd,difference:yf,differenceBy:wf,differenceWith:Sf,drop:function(t,e,n){var r=null==t?0:t.length;return r?Ku(t,(e=n||void 0===e?1:Ma(e))<0?0:e,r):[]},dropRight:function(t,e,n){var r=null==t?0:t.length;return r?Ku(t,0,(e=r-(e=n||void 0===e?1:Ma(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?_f(t,Od(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?_f(t,Od(e),!0):[]},fill:function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&hl(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=Ma(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:Ma(r))<0&&(r+=i),r=n>r?0:jf(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},findIndex:Zf,findLastIndex:ep,first:rp,flatten:Iu,flattenDeep:function(t){return(null==t?0:t.length)?Lu(t,Infinity):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?Lu(t,e=void 0===e?1:Ma(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},head:rp,indexOf:Ap,initial:function(t){return(null==t?0:t.length)?Ku(t,0,-1):[]},intersection:Dp,intersectionBy:kp,intersectionWith:zp,join:function(t,e){return null==t?"":yv.call(t,e)},last:mf,lastIndexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=Ma(n))<0?Sv(r+i,0):Ev(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):Ns(t,Ds,i,!0)},nth:function(t,e){return t&&t.length?qv(t,Ma(e)):void 0},pull:Xg,pullAll:Vg,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?jg(t,e,Od(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?jg(t,e,void 0,n):t},pullAt:$g,remove:function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=Od(e);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return qg(t,i),n},reverse:gy,slice:function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&hl(t,e,n)?(e=0,n=r):(e=null==e?0:Ma(e),n=void 0===n?r:Ma(n)),Ku(t,e,n)):[]},sortedIndex:function(t,e){return Dy(t,e)},sortedIndexBy:function(t,e,n){return Ny(t,e,Od(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var r=Dy(t,e);if(r<n&&nl(t[r],e))return r}return-1},sortedLastIndex:function(t,e){return Dy(t,e,!0)},sortedLastIndexBy:function(t,e,n){return Ny(t,e,Od(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=Dy(t,e,!0)-1;if(nl(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?Py(t):[]},sortedUniqBy:function(t,e){return t&&t.length?Py(t,Od(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?Ku(t,1,e):[]},take:function(t,e,n){return t&&t.length?Ku(t,0,(e=n||void 0===e?1:Ma(e))<0?0:e):[]},takeRight:function(t,e,n){var r=null==t?0:t.length;return r?Ku(t,(e=r-(e=n||void 0===e?1:Ma(e)))<0?0:e,r):[]},takeRightWhile:function(t,e){return t&&t.length?_f(t,Od(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?_f(t,Od(e)):[]},union:Em,unionBy:bm,unionWith:Tm,uniq:Lm,uniqBy:function(t,e){return t&&t.length?Sm(t,Od(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Sm(t,void 0,e):[]},unzip:Am,unzipWith:Mm,without:km,xor:Wm,xorBy:Um,xorWith:Ym,zip:jm,zipObject:function(t,e){return Vm(t||[],e||[],il)},zipObjectDeep:function(t,e){return Vm(t||[],e||[],tg)},zipWith:Xm},qm={countBy:Gd,each:Tf,eachRight:Af,every:Yf,filter:Xf,find:$f,findLast:np,flatMap:function(t,e){return Lu(op(t,e),1)},flatMapDeep:function(t,e){return Lu(op(t,e),Infinity)},flatMapDepth:function(t,e,n){return n=void 0===n?1:Ma(n),Lu(op(t,e),n)},forEach:Tf,forEachRight:Af,groupBy:pp,includes:Op,invokeMap:Qp,keyBy:xv,map:op,orderBy:og,partition:Hg,reduce:dy,reduceRight:function(t,e,n){var r=pa(t)?fy:hy,i=arguments.length<3;return r(t,Od(e),n,i,Rf)},reject:function(t,e){return(pa(t)?uh:Vf)(t,Vv(Od(e)))},sample:function(t){return(pa(t)?my:Cy)(t)},sampleSize:function(t,e,n){return e=(n?hl(t,e,n):void 0===e)?1:Ma(e),(pa(t)?xy:Sy)(t,e)},shuffle:function(t){return(pa(t)?_y:by)(t)},size:Ty,some:function(t,e,n){var r=pa(t)?id:Oy;return n&&hl(t,e,n)&&(e=void 0),r(t,Od(e))},sortBy:Ay},Zm={now:jd},$m={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=Ma(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:tl,before:Wu,bind:Uu,bindKey:Xu,curry:Ud,curryRight:Yd,debounce:Kd,defer:hf,delay:ff,flip:function(t){return Js(t,512)},memoize:fu,negate:Vv,once:function(t){return Wu(2,t)},overArgs:hg,partial:Pg,partialRight:zg,rearg:cy,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return ll(t,e=void 0===e?e:Ma(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:zy(Ma(e),0),ll((function(n){var r=n[e],i=qu(n,0,e);return r&&_u(i,r),ns(t,this,i)}))},throttle:im,unary:function(t){return tl(t,1)},wrap:function(t,e){return Pg(bf(e),t)}},Qm={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return pa(t)?t:[t]},clone:Jh,cloneDeep:td,cloneDeepWith:function(t,e){return Qh(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return Qh(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||Ad(t,e,Wl(e))},eq:nl,gt:yp,gte:mp,isArguments:xl,isArray:pa,isArrayBuffer:tv,isArrayLike:cl,isArrayLikeObject:tf,isBoolean:ev,isBuffer:Tl,isDate:rv,isElement:function(t){return ca(t)&&1===t.nodeType&&!ku(t)},isEmpty:ov,isEqual:av,isEqualWith:function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?yd(t,e,void 0,n):!!r},isError:zu,isFinite:function(t){return"number"==typeof t&&sv(t)},isFunction:Na,isInteger:lv,isLength:ul,isMap:jh,isMatch:function(t,e){return t===e||md(t,e,wd(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,md(t,e,wd(e),n)},isNaN:cv,isNative:function(t){if(hv(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Va(t)},isNil:dv,isNull:function(t){return null===t},isNumber:uv,isObject:_a,isObjectLike:ca,isPlainObject:ku,isRegExp:pv,isSafeInteger:function(t){return lv(t)&&t>=-9007199254740991&&t<=vv},isSet:Xh,isString:bp,isSymbol:ha,isTypedArray:Nl,isUndefined:gv,isWeakMap:function(t){return ca(t)&&"[object WeakMap]"==Nh(t)},isWeakSet:function(t){return ca(t)&&"[object WeakSet]"==ua(t)},lt:Iv,lte:Ov,toArray:Kv,toFinite:Aa,toInteger:Ma,toLength:jf,toNumber:Oa,toPlainObject:nf,toSafeInteger:function(t){return t?th(Ma(t),-9007199254740991,cm):0===t?t:0},toString:mu},Jm={add:Ca,ceil:Zc,divide:Ef,floor:ap,max:Bv,maxBy:Nv,mean:function(t){return Pv(t,Ba)},meanBy:function(t,e){return Pv(t,Od(e))},min:Uv,minBy:function(t,e){return t&&t.length?Mv(t,Od(e),Lv):void 0},multiply:jv,round:yy,subtract:Gy,sum:function(t){return t&&t.length?Dv(t,Ba):0},sumBy:function(t,e){return t&&t.length?Dv(t,Od(e)):0}},tC=eh,eC=_p,nC=function(t,e,n){if(n&&"boolean"!=typeof n&&hl(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=Aa(t),void 0===e?(e=t,t=0):e=Aa(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=ry();return ny(t+i*(e-t+ey("1e-"+((i+"").length-1))),e)}return ty(t,e)},rC={assign:Yl,assignIn:ql,assignInWith:$l,assignWith:Jl,at:Ru,create:function(t,e){var n=ts(t);return null==e?n:rh(n,e)},defaults:Qd,defaultsDeep:lf,entries:Nf,entriesIn:Df,extend:ql,extendWith:$l,findKey:function(t,e){return Qf(t,Od(e),Dd)},findLastKey:function(t,e){return Qf(t,Od(e),Of)},forIn:cp,forInRight:function(t,e){return null==t?t:If(t,bf(e),Xl)},forOwn:function(t,e){return t&&Dd(t,bf(e))},forOwnRight:function(t,e){return t&&Of(t,bf(e))},functions:function(t){return null==t?[]:hp(t,Wl(t))},functionsIn:function(t){return null==t?[]:hp(t,Xl(t))},get:Su,has:xp,hasIn:bd,invert:Gp,invertBy:Xp,invoke:Zp,keys:Wl,keysIn:Xl,mapKeys:Rv,mapValues:function(t,e){var n={};return e=Od(e),Dd(t,(function(t,r,i){el(n,r,e(t,r,i))})),n},merge:zv,mergeWith:sf,omit:Jv,omitBy:function(t,e){return ng(t,Vv(Od(e)))},pick:Gg,pickBy:ng,result:function(t,e,n){var r=-1,i=(e=Cu(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var o=null==t?void 0:t[wu(e[r])];void 0===o&&(r=i,o=n),t=Na(o)?o.call(t):o}return t},set:Ey,setWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:tg(t,e,n,r)},toPairs:Nf,toPairsIn:Df,transform:function(t,e,n){var r=pa(t),i=r||Tl(t)||Nl(t);if(e=Od(e),null==n){var o=t&&t.constructor;n=i?r?new o:[]:_a(t)&&Na(o)?ts(Au(t)):{}}return(i?Bs:Dd)(t,(function(t,r,i){return e(n,t,r,i)})),n},unset:Om,update:function(t,e,n){return null==t?t:Bm(t,e,bf(n))},updateWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:Bm(t,e,bf(n),r)},values:Lp,valuesIn:function(t){return null==t?[]:Tp(t,Xl(t))}},iC={at:Fm,chain:$c,commit:function(){return new gs(this.value(),this.__chain__)},lodash:ws,next:function(){void 0===this.__values__&&(this.__values__=Kv(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},plant:function(t){for(var e,n=this;n instanceof ls;){var r=ms(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof us){var e=t;return this.__actions__.length&&(e=new us(this)),(e=e.reverse()).__actions__.push({func:om,args:[gy],thisArg:void 0}),new gs(e,this.__chain__)}return this.thru(gy)},tap:function(t,e){return e(t),t},thru:om,toIterator:function(){return this},toJSON:um,value:um,valueOf:um,wrapperChain:function(){return $c(this)}},oC={camelCase:Vc,capitalize:dc,deburr:mc,endsWith:Mf,escape:Ff,escapeRegExp:function(t){return(t=mu(t))&&Wf.test(t)?t.replace(Hf,"\\$&"):t},kebabCase:Cv,lowerCase:bv,lowerFirst:Tv,pad:function(t,e,n){t=mu(t);var r=(e=Ma(e))?Ig(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Rg(Mg(i),n)+t+Rg(Ag(i),n)},padEnd:function(t,e,n){t=mu(t);var r=(e=Ma(e))?Ig(t):0;return e&&r<e?t+Rg(e-r,n):t},padStart:function(t,e,n){t=mu(t);var r=(e=Ma(e))?Ig(t):0;return e&&r<e?Rg(e-r,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),Ng(mu(t).replace(Bg,""),e||0)},repeat:py,replace:function(){var t=arguments,e=mu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},snakeCase:Iy,split:ky,startCase:Hy,startsWith:function(t,e,n){return t=mu(t),n=null==n?0:th(Ma(n),0,t.length),e=ya(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var r=qy.imports._.templateSettings||qy;n&&hl(t,e,n)&&(e=void 0),t=mu(t),e=$l({},e,r,jy);var i,o,a=$l({},e.imports,r.imports,jy),s=Wl(a),l=Tp(a,s),u=0,c=e.interpolate||em,h="__p += '",d=RegExp((e.escape||em).source+"|"+c.source+"|"+(c===Ky?tm:em).source+"|"+(e.evaluate||em).source+"|$","g"),f=rm.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(d,(function(e,n,r,a,s,l){return r||(r=a),h+=t.slice(u,l).replace(nm,Xy),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),s&&(o=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+e.length,e})),h+="';\n";var p=rm.call(e,"variable")&&e.variable;if(p){if(Jy.test(p))throw new Error("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(Zy,""):h).replace($y,"$1").replace(Qy,"$1;"),h="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var v=Hu((function(){return Function(s,f+"return "+h).apply(void 0,l)}));if(v.source=h,zu(v))throw v;return v},templateSettings:qy,toLower:function(t){return mu(t).toLowerCase()},toUpper:hm,trim:pm,trimEnd:function(t,e,n){if((t=mu(t))&&(n||void 0===e))return t.slice(0,xa(t)+1);if(!t||!(e=ya(e)))return t;var r=uc(t);return qu(r,0,dm(r,uc(e))+1).join("")},trimStart:function(t,e,n){if((t=mu(t))&&(n||void 0===e))return t.replace(vm,"");if(!t||!(e=ya(e)))return t;var r=uc(t);return qu(r,fm(r,uc(e))).join("")},truncate:function(t,e){var n=30,r="...";if(_a(e)){var i="separator"in e?e.separator:i;n="length"in e?Ma(e.length):n,r="omission"in e?ya(e.omission):r}var o=(t=mu(t)).length;if($u(t)){var a=uc(t);o=a.length}if(n>=o)return t;var s=n-Ig(r);if(s<1)return r;var l=a?qu(a,0,s).join(""):t.slice(0,s);if(void 0===i)return l+r;if(a&&(s+=l.length-s),pv(i)){if(t.slice(s).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,mu(gm.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var h=u.index;l=l.slice(0,void 0===h?s:h)}}else if(t.indexOf(ya(i),s)!=s){var d=l.lastIndexOf(i);d>-1&&(l=l.slice(0,d))}return l+r},unescape:function(t){return(t=mu(t))&&Cm.test(t)?t.replace(mm,ym):t},upperCase:Dm,upperFirst:hc,words:Gc},aC={attempt:Hu,bindAll:ju,cond:Rd,conforms:function(t){return function(t){var e=Wl(t);return function(n){return Ad(n,t,e)}}(Qh(t,1))},constant:Is,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:lp,flowRight:up,identity:Ba,iteratee:function(t){return Od("function"==typeof t?t:Qh(t,1))},matches:Av,matchesProperty:function(t,e){return Td(t,Qh(e,1))},method:Hv,methodOf:Gv,mixin:Yv,noop:cs,nthArg:function(t){return t=Ma(t),ll((function(e){return qv(e,t)}))},over:sg,overEvery:dg,overSome:fg,property:Id,propertyOf:function(t){return function(e){return null==t?void 0:xu(t,e)}},range:sy,rangeRight:ly,stubArray:ch,stubFalse:Sl,stubObject:function(){return{}},stubString:function(){return""},stubTrue:Wy,times:function(t,e){if((t=Ma(t))<1||t>9007199254740991)return[];var n=am,r=sm(t,am);e=bf(e),t-=am;for(var i=vl(r,e);++n<t;)e(n);return i},toPath:function(t){return pa(t)?fa(t,wu):ha(t)?[t]:ys(yu(mu(t)))},uniqueId:function(t){var e=++Im;return mu(t)+e}};var sC=Math.max,lC=Math.min;var uC=Math.min;
| /**
| * @license
| * Lodash (Custom Build) <https://lodash.com/>
| * Build: `lodash modularize exports="es" -o ./`
| * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
| * Released under MIT license <https://lodash.com/license>
| * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
| * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
| */
| var cC,hC,dC,fC,pC=4294967295,vC=Array.prototype,gC=Object.prototype.hasOwnProperty,yC=na?na.iterator:void 0,mC=Math.max,CC=Math.min,wC=function(t){return function(e,n,r){if(null==r){var i=_a(n),o=i&&Wl(n),a=o&&o.length&&hp(n,o);(a?a.length:i)||(r=n,n=e,e=this)}return t(e,n,r)}}(Yv);ws.after=$m.after,ws.ary=$m.ary,ws.assign=rC.assign,ws.assignIn=rC.assignIn,ws.assignInWith=rC.assignInWith,ws.assignWith=rC.assignWith,ws.at=rC.at,ws.before=$m.before,ws.bind=$m.bind,ws.bindAll=aC.bindAll,ws.bindKey=$m.bindKey,ws.castArray=Qm.castArray,ws.chain=iC.chain,ws.chunk=Km.chunk,ws.compact=Km.compact,ws.concat=Km.concat,ws.cond=aC.cond,ws.conforms=aC.conforms,ws.constant=aC.constant,ws.countBy=qm.countBy,ws.create=rC.create,ws.curry=$m.curry,ws.curryRight=$m.curryRight,ws.debounce=$m.debounce,ws.defaults=rC.defaults,ws.defaultsDeep=rC.defaultsDeep,ws.defer=$m.defer,ws.delay=$m.delay,ws.difference=Km.difference,ws.differenceBy=Km.differenceBy,ws.differenceWith=Km.differenceWith,ws.drop=Km.drop,ws.dropRight=Km.dropRight,ws.dropRightWhile=Km.dropRightWhile,ws.dropWhile=Km.dropWhile,ws.fill=Km.fill,ws.filter=qm.filter,ws.flatMap=qm.flatMap,ws.flatMapDeep=qm.flatMapDeep,ws.flatMapDepth=qm.flatMapDepth,ws.flatten=Km.flatten,ws.flattenDeep=Km.flattenDeep,ws.flattenDepth=Km.flattenDepth,ws.flip=$m.flip,ws.flow=aC.flow,ws.flowRight=aC.flowRight,ws.fromPairs=Km.fromPairs,ws.functions=rC.functions,ws.functionsIn=rC.functionsIn,ws.groupBy=qm.groupBy,ws.initial=Km.initial,ws.intersection=Km.intersection,ws.intersectionBy=Km.intersectionBy,ws.intersectionWith=Km.intersectionWith,ws.invert=rC.invert,ws.invertBy=rC.invertBy,ws.invokeMap=qm.invokeMap,ws.iteratee=aC.iteratee,ws.keyBy=qm.keyBy,ws.keys=Wl,ws.keysIn=rC.keysIn,ws.map=qm.map,ws.mapKeys=rC.mapKeys,ws.mapValues=rC.mapValues,ws.matches=aC.matches,ws.matchesProperty=aC.matchesProperty,ws.memoize=$m.memoize,ws.merge=rC.merge,ws.mergeWith=rC.mergeWith,ws.method=aC.method,ws.methodOf=aC.methodOf,ws.mixin=wC,ws.negate=Vv,ws.nthArg=aC.nthArg,ws.omit=rC.omit,ws.omitBy=rC.omitBy,ws.once=$m.once,ws.orderBy=qm.orderBy,ws.over=aC.over,ws.overArgs=$m.overArgs,ws.overEvery=aC.overEvery,ws.overSome=aC.overSome,ws.partial=$m.partial,ws.partialRight=$m.partialRight,ws.partition=qm.partition,ws.pick=rC.pick,ws.pickBy=rC.pickBy,ws.property=aC.property,ws.propertyOf=aC.propertyOf,ws.pull=Km.pull,ws.pullAll=Km.pullAll,ws.pullAllBy=Km.pullAllBy,ws.pullAllWith=Km.pullAllWith,ws.pullAt=Km.pullAt,ws.range=aC.range,ws.rangeRight=aC.rangeRight,ws.rearg=$m.rearg,ws.reject=qm.reject,ws.remove=Km.remove,ws.rest=$m.rest,ws.reverse=Km.reverse,ws.sampleSize=qm.sampleSize,ws.set=rC.set,ws.setWith=rC.setWith,ws.shuffle=qm.shuffle,ws.slice=Km.slice,ws.sortBy=qm.sortBy,ws.sortedUniq=Km.sortedUniq,ws.sortedUniqBy=Km.sortedUniqBy,ws.split=oC.split,ws.spread=$m.spread,ws.tail=Km.tail,ws.take=Km.take,ws.takeRight=Km.takeRight,ws.takeRightWhile=Km.takeRightWhile,ws.takeWhile=Km.takeWhile,ws.tap=iC.tap,ws.throttle=$m.throttle,ws.thru=om,ws.toArray=Qm.toArray,ws.toPairs=rC.toPairs,ws.toPairsIn=rC.toPairsIn,ws.toPath=aC.toPath,ws.toPlainObject=Qm.toPlainObject,ws.transform=rC.transform,ws.unary=$m.unary,ws.union=Km.union,ws.unionBy=Km.unionBy,ws.unionWith=Km.unionWith,ws.uniq=Km.uniq,ws.uniqBy=Km.uniqBy,ws.uniqWith=Km.uniqWith,ws.unset=rC.unset,ws.unzip=Km.unzip,ws.unzipWith=Km.unzipWith,ws.update=rC.update,ws.updateWith=rC.updateWith,ws.values=rC.values,ws.valuesIn=rC.valuesIn,ws.without=Km.without,ws.words=oC.words,ws.wrap=$m.wrap,ws.xor=Km.xor,ws.xorBy=Km.xorBy,ws.xorWith=Km.xorWith,ws.zip=Km.zip,ws.zipObject=Km.zipObject,ws.zipObjectDeep=Km.zipObjectDeep,ws.zipWith=Km.zipWith,ws.entries=rC.toPairs,ws.entriesIn=rC.toPairsIn,ws.extend=rC.assignIn,ws.extendWith=rC.assignInWith,wC(ws,ws),ws.add=Jm.add,ws.attempt=aC.attempt,ws.camelCase=oC.camelCase,ws.capitalize=oC.capitalize,ws.ceil=Jm.ceil,ws.clamp=tC,ws.clone=Qm.clone,ws.cloneDeep=Qm.cloneDeep,ws.cloneDeepWith=Qm.cloneDeepWith,ws.cloneWith=Qm.cloneWith,ws.conformsTo=Qm.conformsTo,ws.deburr=oC.deburr,ws.defaultTo=aC.defaultTo,ws.divide=Jm.divide,ws.endsWith=oC.endsWith,ws.eq=Qm.eq,ws.escape=oC.escape,ws.escapeRegExp=oC.escapeRegExp,ws.every=qm.every,ws.find=qm.find,ws.findIndex=Km.findIndex,ws.findKey=rC.findKey,ws.findLast=qm.findLast,ws.findLastIndex=Km.findLastIndex,ws.findLastKey=rC.findLastKey,ws.floor=Jm.floor,ws.forEach=qm.forEach,ws.forEachRight=qm.forEachRight,ws.forIn=rC.forIn,ws.forInRight=rC.forInRight,ws.forOwn=rC.forOwn,ws.forOwnRight=rC.forOwnRight,ws.get=rC.get,ws.gt=Qm.gt,ws.gte=Qm.gte,ws.has=rC.has,ws.hasIn=rC.hasIn,ws.head=Km.head,ws.identity=Ba,ws.includes=qm.includes,ws.indexOf=Km.indexOf,ws.inRange=eC,ws.invoke=rC.invoke,ws.isArguments=Qm.isArguments,ws.isArray=pa,ws.isArrayBuffer=Qm.isArrayBuffer,ws.isArrayLike=Qm.isArrayLike,ws.isArrayLikeObject=Qm.isArrayLikeObject,ws.isBoolean=Qm.isBoolean,ws.isBuffer=Qm.isBuffer,ws.isDate=Qm.isDate,ws.isElement=Qm.isElement,ws.isEmpty=Qm.isEmpty,ws.isEqual=Qm.isEqual,ws.isEqualWith=Qm.isEqualWith,ws.isError=Qm.isError,ws.isFinite=Qm.isFinite,ws.isFunction=Qm.isFunction,ws.isInteger=Qm.isInteger,ws.isLength=Qm.isLength,ws.isMap=Qm.isMap,ws.isMatch=Qm.isMatch,ws.isMatchWith=Qm.isMatchWith,ws.isNaN=Qm.isNaN,ws.isNative=Qm.isNative,ws.isNil=Qm.isNil,ws.isNull=Qm.isNull,ws.isNumber=Qm.isNumber,ws.isObject=_a,ws.isObjectLike=Qm.isObjectLike,ws.isPlainObject=Qm.isPlainObject,ws.isRegExp=Qm.isRegExp,ws.isSafeInteger=Qm.isSafeInteger,ws.isSet=Qm.isSet,ws.isString=Qm.isString,ws.isSymbol=Qm.isSymbol,ws.isTypedArray=Qm.isTypedArray,ws.isUndefined=Qm.isUndefined,ws.isWeakMap=Qm.isWeakMap,ws.isWeakSet=Qm.isWeakSet,ws.join=Km.join,ws.kebabCase=oC.kebabCase,ws.last=mf,ws.lastIndexOf=Km.lastIndexOf,ws.lowerCase=oC.lowerCase,ws.lowerFirst=oC.lowerFirst,ws.lt=Qm.lt,ws.lte=Qm.lte,ws.max=Jm.max,ws.maxBy=Jm.maxBy,ws.mean=Jm.mean,ws.meanBy=Jm.meanBy,ws.min=Jm.min,ws.minBy=Jm.minBy,ws.stubArray=aC.stubArray,ws.stubFalse=aC.stubFalse,ws.stubObject=aC.stubObject,ws.stubString=aC.stubString,ws.stubTrue=aC.stubTrue,ws.multiply=Jm.multiply,ws.nth=Km.nth,ws.noop=aC.noop,ws.now=Zm.now,ws.pad=oC.pad,ws.padEnd=oC.padEnd,ws.padStart=oC.padStart,ws.parseInt=oC.parseInt,ws.random=nC,ws.reduce=qm.reduce,ws.reduceRight=qm.reduceRight,ws.repeat=oC.repeat,ws.replace=oC.replace,ws.result=rC.result,ws.round=Jm.round,ws.sample=qm.sample,ws.size=qm.size,ws.snakeCase=oC.snakeCase,ws.some=qm.some,ws.sortedIndex=Km.sortedIndex,ws.sortedIndexBy=Km.sortedIndexBy,ws.sortedIndexOf=Km.sortedIndexOf,ws.sortedLastIndex=Km.sortedLastIndex,ws.sortedLastIndexBy=Km.sortedLastIndexBy,ws.sortedLastIndexOf=Km.sortedLastIndexOf,ws.startCase=oC.startCase,ws.startsWith=oC.startsWith,ws.subtract=Jm.subtract,ws.sum=Jm.sum,ws.sumBy=Jm.sumBy,ws.template=oC.template,ws.times=aC.times,ws.toFinite=Qm.toFinite,ws.toInteger=Ma,ws.toLength=Qm.toLength,ws.toLower=oC.toLower,ws.toNumber=Qm.toNumber,ws.toSafeInteger=Qm.toSafeInteger,ws.toString=Qm.toString,ws.toUpper=oC.toUpper,ws.trim=oC.trim,ws.trimEnd=oC.trimEnd,ws.trimStart=oC.trimStart,ws.truncate=oC.truncate,ws.unescape=oC.unescape,ws.uniqueId=aC.uniqueId,ws.upperCase=oC.upperCase,ws.upperFirst=oC.upperFirst,ws.each=qm.forEach,ws.eachRight=qm.forEachRight,ws.first=Km.head,wC(ws,(cC={},Dd(ws,(function(t,e){gC.call(ws.prototype,e)||(cC[e]=t)})),cC),{chain:!1}),ws.VERSION="4.17.21",(ws.templateSettings=oC.templateSettings).imports._=ws,Bs(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){ws[t].placeholder=ws})),Bs(["drop","take"],(function(t,e){us.prototype[t]=function(n){n=void 0===n?1:mC(Ma(n),0);var r=this.__filtered__&&!e?new us(this):this.clone();return r.__filtered__?r.__takeCount__=CC(n,r.__takeCount__):r.__views__.push({size:CC(n,pC),type:t+(r.__dir__<0?"Right":"")}),r},us.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Bs(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;us.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Od(t),type:n}),e.__filtered__=e.__filtered__||r,e}})),Bs(["head","last"],(function(t,e){var n="take"+(e?"Right":"");us.prototype[t]=function(){return this[n](1).value()[0]}})),Bs(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");us.prototype[t]=function(){return this.__filtered__?new us(this):this[n](1)}})),us.prototype.compact=function(){return this.filter(Ba)},us.prototype.find=function(t){return this.filter(t).head()},us.prototype.findLast=function(t){return this.reverse().find(t)},us.prototype.invokeMap=ll((function(t,e){return"function"==typeof t?new us(this):this.map((function(n){return qp(n,t,e)}))})),us.prototype.reject=function(t){return this.filter(Vv(Od(t)))},us.prototype.slice=function(t,e){t=Ma(t);var n=this;return n.__filtered__&&(t>0||e<0)?new us(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=Ma(e))<0?n.dropRight(-e):n.take(e-t)),n)},us.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},us.prototype.toArray=function(){return this.take(pC)},Dd(us.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=ws[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&(ws.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,s=e instanceof us,l=a[0],u=s||pa(e),c=function(t){var e=i.apply(ws,_u([t],a));return r&&h?e[0]:e};u&&n&&"function"==typeof l&&1!=l.length&&(s=u=!1);var h=this.__chain__,d=!!this.__actions__.length,f=o&&!h,p=s&&!d;if(!o&&u){e=p?e:new us(this);var v=t.apply(e,a);return v.__actions__.push({func:om,args:[c],thisArg:void 0}),new gs(v,h)}return f&&p?t.apply(this,a):(v=this.thru(c),f?r?v.value()[0]:v.value():v)})})),Bs(["pop","push","shift","sort","splice","unshift"],(function(t){var e=vC[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);ws.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(pa(i)?i:[],t)}return this[n]((function(n){return e.apply(pa(n)?n:[],t)}))}})),Dd(us.prototype,(function(t,e){var n=ws[e];if(n){var r=n.name+"";gC.call(fs,r)||(fs[r]=[]),fs[r].push({name:e,func:n})}})),fs[Ks(void 0,2).name]=[{name:"wrapper",func:void 0}],us.prototype.clone=function(){var t=new us(this.__wrapped__);return t.__actions__=ys(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ys(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ys(this.__views__),t},us.prototype.reverse=function(){if(this.__filtered__){var t=new us(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},us.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=pa(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=lC(e,t+a);break;case"takeRight":t=sC(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,u=r?s:a-1,c=this.__iteratees__,h=c.length,d=0,f=uC(l,this.__takeCount__);if(!n||!r&&i==l&&f==l)return lm(t,this.__actions__);var p=[];t:for(;l--&&d<f;){for(var v=-1,g=t[u+=e];++v<h;){var y=c[v],m=y.iteratee,C=y.type,w=m(g);if(2==C)g=w;else if(!w){if(1==C)continue t;break t}}p[d++]=g}return p},ws.prototype.at=iC.at,ws.prototype.chain=iC.wrapperChain,ws.prototype.commit=iC.commit,ws.prototype.next=iC.next,ws.prototype.plant=iC.plant,ws.prototype.reverse=iC.reverse,ws.prototype.toJSON=ws.prototype.valueOf=ws.prototype.value=iC.value,ws.prototype.first=ws.prototype.head,yC&&(ws.prototype[yC]=iC.toIterator),t.InteractionName=void 0,(hC=t.InteractionName||(t.InteractionName={})).CORNER_CELL_CLICK="cornerCellClick",hC.DATA_CELL_CLICK="dataCellClick",hC.MERGED_CELLS_CLICK="mergedCellsClick",hC.ROW_COLUMN_CLICK="rowColumnClick",hC.ROW_TEXT_CLICK="rowTextClick",hC.HOVER="hover",hC.BRUSH_SELECTION="brushSelection",hC.ROW_BRUSH_SELECTION="rowBrushSelection",hC.COL_BRUSH_SELECTION="colBrushSelection",hC.COL_ROW_RESIZE="rowColResize",hC.DATA_CELL_MULTI_SELECTION="dataCellMultiSelection",hC.RANGE_SELECTION="rangeSelection",hC.SELECTED_CELL_MOVE="selectedCellMove",t.InteractionStateName=void 0,(dC=t.InteractionStateName||(t.InteractionStateName={})).ALL_SELECTED="allSelected",dC.SELECTED="selected",dC.UNSELECTED="unselected",dC.HOVER="hover",dC.HOVER_FOCUS="hoverFocus",dC.HIGHLIGHT="highlight",dC.SEARCH_RESULT="searchResult",dC.PREPARE_SELECT="prepareSelect",t.CellTypes=void 0,(fC=t.CellTypes||(t.CellTypes={})).DATA_CELL="dataCell",fC.HEADER_CELL="headerCell",fC.ROW_CELL="rowCell",fC.COL_CELL="colCell",fC.CORNER_CELL="cornerCell",fC.MERGED_CELL="mergedCell";var xC,SC,EC,_C,bC=800,TC={textOpacity:"fillOpacity",backgroundOpacity:"fillOpacity",backgroundColor:"fill",borderOpacity:"strokeOpacity",borderColor:"stroke",borderWidth:"lineWidth",opacity:"opacity"},LC={textShape:["textOpacity"],linkFieldShape:["opacity"],interactiveBgShape:["backgroundColor","backgroundOpacity"],interactiveBorderShape:["borderColor","borderOpacity","borderWidth"]},IC="interactionStateInfo";t.InteractionBrushSelectionStage=void 0,(xC=t.InteractionBrushSelectionStage||(t.InteractionBrushSelectionStage={})).CLICK="click",xC.UN_DRAGGED="unDragged",xC.DRAGGED="dragged",t.InteractionKeyboardKey=void 0,(SC=t.InteractionKeyboardKey||(t.InteractionKeyboardKey={})).SHIFT="Shift",SC.COPY="c",SC.ESC="Escape",SC.META="Meta",SC.CONTROL="Control",SC.ARROW_UP="ArrowUp",SC.ARROW_DOWN="ArrowDown",SC.ARROW_LEFT="ArrowLeft",SC.ARROW_RIGHT="ArrowRight",t.SortMethodType=void 0,(EC=t.SortMethodType||(t.SortMethodType={})).ASC="ASC",EC.DESC="DESC",t.InterceptType=void 0,(_C=t.InterceptType||(t.InterceptType={})).HOVER="hover",_C.CLICK="click",_C.BRUSH_SELECTION="brushSelection",_C.ROW_BRUSH_SELECTION="rowBrushSelection",_C.COL_BRUSH_SELECTION="colBrushSelection",_C.MULTI_SELECTION="multiSelection",_C.RESIZE="resize";var OC,RC,AC={x:{value:0,scroll:!1},y:{value:0,scroll:!1}};t.ScrollbarPositionType=void 0,(OC=t.ScrollbarPositionType||(t.ScrollbarPositionType={})).CONTENT="content",OC.CANVAS="canvas",t.ScrollDirection=void 0,(RC=t.ScrollDirection||(t.ScrollDirection={})).LEADING="leading",RC.TRAILING="trailing";var MC,BC,NC,DC="RESIZE_START_GUIDE_LINE",PC="RESIZE_END_GUIDE_LINE",kC="RESIZE_MASK";t.ResizeDirectionType=void 0,(MC=t.ResizeDirectionType||(t.ResizeDirectionType={})).Horizontal="col",MC.Vertical="row",t.ResizeAreaEffect=void 0,(BC=t.ResizeAreaEffect||(t.ResizeAreaEffect={})).Field="field",BC.Cell="cell",BC.Tree="tree",BC.Series="series",t.ResizeType=void 0,(NC=t.ResizeType||(t.ResizeType={})).ALL="all",NC.CURRENT="current";var zC;t.LayoutWidthTypes=void 0,(zC=t.LayoutWidthTypes||(t.LayoutWidthTypes={})).Adaptive="adaptive",zC.ColAdaptive="colAdaptive",zC.Compact="compact";var FC={layoutWidthType:t.LayoutWidthTypes.Adaptive,showTreeLeafNodeAlignDot:!1,collapsedRows:{},collapsedCols:{},cellCfg:{width:96,height:30},rowCfg:{width:null,widthByField:{},heightByField:{}},colCfg:{height:30,widthByFieldValue:{},heightByField:{}},device:"pc"},HC={width:600,height:480,debug:!1,hierarchyType:"grid",conditions:{},totals:{},tooltip:{showTooltip:!1,autoAdjustBoundary:"body",operation:{hiddenColumns:!1,trend:!1,sort:!1,menus:[]}},interaction:{linkFields:[],hiddenColumnFields:[],selectedCellsSpotlight:!1,hoverHighlight:!0,hoverFocus:{duration:bC},scrollSpeedRatio:{horizontal:1,vertical:1},autoResetSheetStyle:!0,brushSelection:{data:!0,row:!1,col:!1},multiSelection:!0,rangeSelection:!0,scrollbarPosition:t.ScrollbarPositionType.CONTENT,resize:{rowCellVertical:!0,cornerCellHorizontal:!0,colCellHorizontal:!0,colCellVertical:!0,rowResizeType:t.ResizeType.ALL},eventListenerOptions:!1,selectedCellHighlight:!1,overscrollBehavior:"auto"},showSeriesNumber:!1,customSVGIcons:[],showDefaultHeaderActionIcon:!1,headerActionIcons:[],style:FC,frozenRowHeader:!0,frozenRowCount:0,frozenColCount:0,frozenTrailingRowCount:0,frozenTrailingColCount:0,hdAdapter:!0,cornerText:"",cornerExtraFieldText:"",placeholder:Uo,supportCSSTransform:!1,devicePixelRatio:window.devicePixelRatio},WC=function(t,e){return WC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},WC(t,e)};function GC(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}WC(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var UC=function(){return UC=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},UC.apply(this,arguments)};function YC(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function jC(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function VC(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function XC(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}var KC={exports:{}};!function(t){!function(e){var n=/^\s+/,r=/\s+$/,i=0,o=e.round,a=e.min,s=e.max,l=e.random;function u(t,l){if(l=l||{},(t=t||"")instanceof u)return t;if(!(this instanceof u))return new u(t,l);var c=function(t){var i={r:0,g:0,b:0},o=1,l=null,u=null,c=null,h=!1,d=!1;"string"==typeof t&&(t=function(t){t=t.replace(n,"").replace(r,"").toLowerCase();var e,i=!1;if(L[t])t=L[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=H.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=H.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=H.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=H.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=H.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=H.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=H.hex8.exec(t))return{r:M(e[1]),g:M(e[2]),b:M(e[3]),a:P(e[4]),format:i?"name":"hex8"};if(e=H.hex6.exec(t))return{r:M(e[1]),g:M(e[2]),b:M(e[3]),format:i?"name":"hex"};if(e=H.hex4.exec(t))return{r:M(e[1]+""+e[1]),g:M(e[2]+""+e[2]),b:M(e[3]+""+e[3]),a:P(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=H.hex3.exec(t))return{r:M(e[1]+""+e[1]),g:M(e[2]+""+e[2]),b:M(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(t));"object"==typeof t&&(W(t.r)&&W(t.g)&&W(t.b)?(f=t.r,p=t.g,v=t.b,i={r:255*R(f,255),g:255*R(p,255),b:255*R(v,255)},h=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):W(t.h)&&W(t.s)&&W(t.v)?(l=N(t.s),u=N(t.v),i=function(t,n,r){t=6*R(t,360),n=R(n,100),r=R(r,100);var i=e.floor(t),o=t-i,a=r*(1-n),s=r*(1-o*n),l=r*(1-(1-o)*n),u=i%6;return{r:255*[r,s,a,a,l,r][u],g:255*[l,r,r,s,a,a][u],b:255*[a,a,l,r,r,s][u]}}(t.h,l,u),h=!0,d="hsv"):W(t.h)&&W(t.s)&&W(t.l)&&(l=N(t.s),c=N(t.l),i=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=R(t,360),e=R(e,100),n=R(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=a(l,s,t+1/3),i=a(l,s,t),o=a(l,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,l,c),h=!0,d="hsl"),t.hasOwnProperty("a")&&(o=t.a));var f,p,v;return o=O(o),{ok:h,format:t.format||d,r:a(255,s(i.r,0)),g:a(255,s(i.g,0)),b:a(255,s(i.b,0)),a:o}}(t);this._originalInput=t,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=o(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=o(this._r)),this._g<1&&(this._g=o(this._g)),this._b<1&&(this._b=o(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,e,n){t=R(t,255),e=R(e,255),n=R(n,255);var r,i,o=s(t,e,n),l=a(t,e,n),u=(o+l)/2;if(o==l)r=i=0;else{var c=o-l;switch(i=u>.5?c/(2-o-l):c/(o+l),o){case t:r=(e-n)/c+(e<n?6:0);break;case e:r=(n-t)/c+2;break;case n:r=(t-e)/c+4}r/=6}return{h:r,s:i,l:u}}function h(t,e,n){t=R(t,255),e=R(e,255),n=R(n,255);var r,i,o=s(t,e,n),l=a(t,e,n),u=o,c=o-l;if(i=0===o?0:c/o,o==l)r=0;else{switch(o){case t:r=(e-n)/c+(e<n?6:0);break;case e:r=(n-t)/c+2;break;case n:r=(t-e)/c+4}r/=6}return{h:r,s:i,v:u}}function d(t,e,n,r){var i=[B(o(t).toString(16)),B(o(e).toString(16)),B(o(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function f(t,e,n,r){return[B(D(r)),B(o(t).toString(16)),B(o(e).toString(16)),B(o(n).toString(16))].join("")}function p(t,e){e=0===e?0:e||10;var n=u(t).toHsl();return n.s-=e/100,n.s=A(n.s),u(n)}function v(t,e){e=0===e?0:e||10;var n=u(t).toHsl();return n.s+=e/100,n.s=A(n.s),u(n)}function g(t){return u(t).desaturate(100)}function y(t,e){e=0===e?0:e||10;var n=u(t).toHsl();return n.l+=e/100,n.l=A(n.l),u(n)}function m(t,e){e=0===e?0:e||10;var n=u(t).toRgb();return n.r=s(0,a(255,n.r-o(-e/100*255))),n.g=s(0,a(255,n.g-o(-e/100*255))),n.b=s(0,a(255,n.b-o(-e/100*255))),u(n)}function C(t,e){e=0===e?0:e||10;var n=u(t).toHsl();return n.l-=e/100,n.l=A(n.l),u(n)}function w(t,e){var n=u(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,u(n)}function x(t){var e=u(t).toHsl();return e.h=(e.h+180)%360,u(e)}function S(t){var e=u(t).toHsl(),n=e.h;return[u(t),u({h:(n+120)%360,s:e.s,l:e.l}),u({h:(n+240)%360,s:e.s,l:e.l})]}function E(t){var e=u(t).toHsl(),n=e.h;return[u(t),u({h:(n+90)%360,s:e.s,l:e.l}),u({h:(n+180)%360,s:e.s,l:e.l}),u({h:(n+270)%360,s:e.s,l:e.l})]}function _(t){var e=u(t).toHsl(),n=e.h;return[u(t),u({h:(n+72)%360,s:e.s,l:e.l}),u({h:(n+216)%360,s:e.s,l:e.l})]}function b(t,e,n){e=e||6,n=n||30;var r=u(t).toHsl(),i=360/n,o=[u(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(u(r));return o}function T(t,e){e=e||6;for(var n=u(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(u({h:r,s:i,v:o})),o=(o+s)%1;return a}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,n,r,i=this.toRgb();return t=i.r/255,n=i.g/255,r=i.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=O(t),this._roundA=o(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=o(360*t.h),n=o(100*t.s),r=o(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=o(360*t.h),n=o(100*t.s),r=o(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return d(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var a=[B(o(t).toString(16)),B(o(e).toString(16)),B(o(n).toString(16)),B(D(r))];if(i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:o(this._r),g:o(this._g),b:o(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+o(this._r)+", "+o(this._g)+", "+o(this._b)+")":"rgba("+o(this._r)+", "+o(this._g)+", "+o(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:o(100*R(this._r,255))+"%",g:o(100*R(this._g,255))+"%",b:o(100*R(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+o(100*R(this._r,255))+"%, "+o(100*R(this._g,255))+"%, "+o(100*R(this._b,255))+"%)":"rgba("+o(100*R(this._r,255))+"%, "+o(100*R(this._g,255))+"%, "+o(100*R(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(I[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(t);n="#"+f(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(C,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(w,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(b,arguments)},complement:function(){return this._applyCombination(x,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(S,arguments)},tetrad:function(){return this._applyCombination(E,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:N(t[r]));t=n}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,n){n=0===n?0:n||50;var r=u(t).toRgb(),i=u(e).toRgb(),o=n/100;return u({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},u.readability=function(t,n){var r=u(t),i=u(n);return(e.max(r.getLuminance(),i.getLuminance())+.05)/(e.min(r.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,n){var r,i,o=u.readability(t,e);switch(i=!1,r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n),r.level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},u.mostReadable=function(t,e,n){var r,i,o,a,s=null,l=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var c=0;c<e.length;c++)(r=u.readability(t,e[c]))>l&&(l=r,s=u(e[c]));return u.isReadable(t,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],n))};var L=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},I=u.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(L);function O(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function R(t,n){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=a(n,s(0,parseFloat(t))),r&&(t=parseInt(t*n,10)/100),e.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function A(t){return a(1,s(0,t))}function M(t){return parseInt(t,16)}function B(t){return 1==t.length?"0"+t:""+t}function N(t){return t<=1&&(t=100*t+"%"),t}function D(t){return e.round(255*parseFloat(t)).toString(16)}function P(t){return M(t)/255}var k,z,F,H=(z="[\\s|\\(]+("+(k="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+k+")[,|\\s]+("+k+")\\s*\\)?",F="[\\s|\\(]+("+k+")[,|\\s]+("+k+")[,|\\s]+("+k+")[,|\\s]+("+k+")\\s*\\)?",{CSS_UNIT:new RegExp(k),rgb:new RegExp("rgb"+z),rgba:new RegExp("rgba"+F),hsl:new RegExp("hsl"+z),hsla:new RegExp("hsla"+F),hsv:new RegExp("hsv"+z),hsva:new RegExp("hsva"+F),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function W(t){return!!H.CSS_UNIT.exec(t)}t.exports?t.exports=u:window.tinycolor=u}(Math)}(KC);var qC,ZC=KC.exports,$C=[95,85,75,30,15,0,15,30,45,60,80],QC=[{fontColorIndex:0,bgColorIndex:3},{fontColorIndex:13,bgColorIndex:8},{fontColorIndex:14,bgColorIndex:1}],JC=function(t){for(var e=[],n=0;n<11;n++){var r=$C[n];e.push(0===r?t.toUpperCase():ZC.mix(t,n<5?"#FFFFFF":"#000000",r).toHexString().toUpperCase())}return e},tw=function(t){var e=Array.from(Array(15)).fill("#FFFFFF"),n=t.basicColorRelations,r=JC(t.brandColor);return n.forEach((function(t){e[t.basicColorIndex]=r[t.standardColorIndex]})),QC.forEach((function(t){var n=t.fontColorIndex,r=t.bgColorIndex;e[n]=ZC(e[r]).getBrightness()>220?"#000000":"#FFFFFF"})),UC(UC({},t),{basicColors:e})},ew=tw({brandColor:"#3471F9",semanticColors:{red:"#FF4D4F",green:"#29A294",yellow:"#FAAD14"},others:{highlight:"#87B5FF",results:"#F0F7FF"},basicColorRelations:[{basicColorIndex:1,standardColorIndex:0},{basicColorIndex:2,standardColorIndex:1},{basicColorIndex:3,standardColorIndex:5},{basicColorIndex:4,standardColorIndex:6},{basicColorIndex:5,standardColorIndex:6},{basicColorIndex:6,standardColorIndex:6},{basicColorIndex:7,standardColorIndex:5},{basicColorIndex:9,standardColorIndex:1},{basicColorIndex:10,standardColorIndex:4},{basicColorIndex:11,standardColorIndex:4},{basicColorIndex:12,standardColorIndex:5}]}),nw={default:tw({brandColor:"#326EF4",semanticColors:{red:"#FF4D4F",green:"#29A294",yellow:"#FAAD14"},others:{highlight:"#87B5FF",results:"#F0F7FF"},basicColorRelations:[{basicColorIndex:1,standardColorIndex:0},{basicColorIndex:2,standardColorIndex:1},{basicColorIndex:3,standardColorIndex:1},{basicColorIndex:4,standardColorIndex:2},{basicColorIndex:5,standardColorIndex:7},{basicColorIndex:6,standardColorIndex:5},{basicColorIndex:7,standardColorIndex:5},{basicColorIndex:9,standardColorIndex:1},{basicColorIndex:10,standardColorIndex:2},{basicColorIndex:11,standardColorIndex:5},{basicColorIndex:12,standardColorIndex:5}]}),colorful:ew,gray:tw({brandColor:"#9DA7B6",semanticColors:{red:"#FF4D4F",green:"#29A294",yellow:"#FAAD14"},others:{highlight:"#87B5FF",results:"#F0F7FF"},basicColorRelations:[{basicColorIndex:1,standardColorIndex:0},{basicColorIndex:2,standardColorIndex:1},{basicColorIndex:3,standardColorIndex:1},{basicColorIndex:4,standardColorIndex:2},{basicColorIndex:5,standardColorIndex:7},{basicColorIndex:6,standardColorIndex:8},{basicColorIndex:7,standardColorIndex:5},{basicColorIndex:9,standardColorIndex:1},{basicColorIndex:10,standardColorIndex:2},{basicColorIndex:11,standardColorIndex:3},{basicColorIndex:12,standardColorIndex:3}]})},rw="Roboto, PingFangSC, BlinkMacSystemFont, Microsoft YaHei, Arial, sans-serif",iw="zh_CN",ow=iw,aw={zh_CN:{"小计":"小计","总计":"总计","总和":"总和","项":"项","已选择":"已选择","序号":"序号","度量":"度量","数值":"数值","共计":"共计","条":"条","趋势":"趋势","隐藏":"隐藏","组内升序":"组内升序","升序":"升序","降序":"降序","组内降序":"组内降序","不排序":"不排序"},en_US:{"小计":"Total","总计":"Total","总和":"SUM","项":"items","已选择":"selected","序号":"Index","度量":"Measure","数值":"Measure","共计":"Total","条":"","隐藏":"Hide","趋势":"Trend","组内升序":"Group ASC","组内降序":"Group DESC","升序":"ASC","降序":"DESC","不排序":"No order"}},sw=function(){return ow},lw=function(t,e){return void 0===e&&(e=t),Su(aw,[ow,t],e)},uw="".concat(Ko,"-tooltip"),cw="".concat(uw,"-container"),hw="".concat(cw,"-show"),dw="".concat(cw,"-hide"),fw="".concat(uw,"-operation"),pw={x:15,y:10},vw=function(){return{key:"hiddenColumns",text:lw("隐藏"),icon:"EyeOutlined"}},gw=function(){return{key:"trend",text:lw("趋势"),icon:"Trend"}},yw=function(){return[{key:"asc",icon:"groupAsc",text:lw("组内升序")},{key:"desc",icon:"groupDesc",text:lw("组内降序")},{key:"none",text:lw("不排序")}]},mw=function(){return[{key:"asc",icon:"groupAsc",text:lw("升序")},{key:"desc",icon:"groupDesc",text:lw("降序")},{key:"none",text:lw("不排序")}]};t.CopyType=void 0,(qC=t.CopyType||(t.CopyType={}))[qC.ALL=0]="ALL",qC[qC.COL=1]="COL",qC[qC.ROW=2]="ROW";function Cw(t){return"mobile"===t||/(iPhone|iPad|SymbianOS|Windows Phone|iPod|iOS|Android)/i.test(navigator.userAgent)}function ww(){return/iPhone/gi.test(navigator.userAgent)&&812===window.screen.height&&375===window.screen.width}function xw(){return/windows/i.test(navigator.userAgent)}var Sw=function(t){return nw[(t||"default").toLowerCase()]},Ew=function(t){var e,n,r,i,o,a,s,l=(null==t?void 0:t.palette)||Sw(null==t?void 0:t.name),u=l.basicColors,c=l.semanticColors,h=l.others,d=null===(e=null==t?void 0:t.spreadsheet)||void 0===e?void 0:e.isTableMode();return{cornerCell:{bolderText:{fontFamily:rw,fontSize:12,fontWeight:xw()?"bold":500,fill:u[0],opacity:1,textAlign:d?"center":"left",textBaseline:"middle"},text:{fontFamily:rw,fontSize:12,fontWeight:xw()?"bold":500,fill:u[0],opacity:1,textAlign:"right",textBaseline:"middle"},cell:{backgroundColor:u[3],backgroundColorOpacity:1,horizontalBorderColor:u[10],horizontalBorderColorOpacity:1,verticalBorderColor:u[10],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,padding:{top:0,right:8,bottom:0,left:8}},icon:{fill:u[0],size:10,margin:{right:4,left:4}}},rowCell:{seriesText:{fontFamily:rw,fontSize:12,fontWeight:"normal",fill:u[14],linkTextFill:u[6],opacity:1,textBaseline:"middle",textAlign:"center"},measureText:{fontFamily:rw,fontSize:12,fontWeight:"normal",fill:u[14],linkTextFill:u[6],opacity:1,textAlign:d?"center":"left",textBaseline:"top"},bolderText:{fontFamily:rw,fontSize:12,fontWeight:xw()?"bold":500,fill:u[14],linkTextFill:u[6],opacity:1,textAlign:d?"center":"left",textBaseline:"top"},text:{fontFamily:rw,fontSize:12,fontWeight:"normal",fill:u[14],linkTextFill:u[6],opacity:1,textBaseline:"top",textAlign:d?"center":"left"},cell:{backgroundColor:u[1],backgroundColorOpacity:1,horizontalBorderColor:u[9],horizontalBorderColorOpacity:1,verticalBorderColor:u[9],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,padding:{top:0,right:8,bottom:0,left:8},interactionState:{hover:{backgroundColor:u[2],backgroundOpacity:.6},selected:{backgroundColor:u[2],backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:u[14],borderOpacity:1,borderWidth:1},searchResult:{backgroundColor:null!==(n=null==h?void 0:h.results)&&void 0!==n?n:u[2],backgroundOpacity:1},highlight:{backgroundColor:null!==(r=null==h?void 0:h.highlight)&&void 0!==r?r:u[6],backgroundOpacity:1}}},icon:{fill:u[14],size:10,margin:{right:4,left:4}},seriesNumberWidth:80},colCell:{measureText:{fontFamily:rw,fontSize:12,fontWeight:"normal",fill:u[0],opacity:1,textAlign:"right",textBaseline:"middle"},bolderText:{fontFamily:rw,fontSize:12,fontWeight:xw()?"bold":500,fill:u[0],opacity:1,textAlign:"center",textBaseline:"middle"},text:{fontFamily:rw,fontSize:12,fontWeight:"normal",fill:u[0],opacity:1,textAlign:"center",textBaseline:"middle"},cell:{backgroundColor:u[3],backgroundColorOpacity:1,horizontalBorderColor:u[10],horizontalBorderColorOpacity:1,verticalBorderColor:u[10],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,padding:{top:0,right:8,bottom:0,left:8},interactionState:{hover:{backgroundColor:u[4],backgroundOpacity:.6},selected:{backgroundColor:u[4],backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:u[14],borderOpacity:1,borderWidth:1},searchResult:{backgroundColor:null!==(i=null==h?void 0:h.results)&&void 0!==i?i:u[2],backgroundOpacity:1},highlight:{backgroundColor:null!==(o=null==h?void 0:h.highlight)&&void 0!==o?o:u[6],backgroundOpacity:1}}},icon:{fill:u[0],size:10,margin:{top:6,right:4,bottom:6,left:4}}},dataCell:{bolderText:{fontFamily:rw,fontSize:12,fontWeight:xw()?"bold":500,fill:u[13],opacity:1,textAlign:"right",textBaseline:"middle"},text:{fontFamily:rw,fontSize:12,fontWeight:"normal",fill:u[13],opacity:1,textAlign:"right",textBaseline:"middle"},cell:{crossBackgroundColor:u[1],backgroundColor:u[8],backgroundColorOpacity:1,horizontalBorderColor:u[9],horizontalBorderColorOpacity:1,verticalBorderColor:u[9],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,padding:{top:8,right:8,bottom:8,left:8},interactionState:{hover:{backgroundColor:u[2],backgroundOpacity:.6},hoverFocus:{backgroundColor:u[2],backgroundOpacity:.6,borderColor:u[14],borderWidth:1,borderOpacity:1},selected:{backgroundColor:u[2],backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},searchResult:{backgroundColor:null!==(a=null==h?void 0:h.results)&&void 0!==a?a:u[2],backgroundOpacity:1},highlight:{backgroundColor:null!==(s=null==h?void 0:h.highlight)&&void 0!==s?s:u[6],backgroundOpacity:1},prepareSelect:{borderColor:u[14],borderOpacity:1,borderWidth:1}}},miniChart:{line:{point:{size:2.2,fill:u[6],opacity:1},linkLine:{size:1.5,fill:u[6],opacity:.6}},bar:{intervalPadding:4,fill:u[6],opacity:1},bullet:{progressBar:{widthPercent:.6,height:10,innerHeight:6},comparativeMeasure:{width:1,height:12,fill:u[13],opacity:.25},rangeColors:{good:null==c?void 0:c.green,satisfactory:c.yellow,bad:c.red},backgroundColor:"#E9E9E9"},interval:{height:12,fill:u[7]}},icon:{fill:u[13],downIconColor:c.red,upIconColor:c.green,size:10,margin:{right:4,left:4}}},resizeArea:{size:3,background:u[7],backgroundOpacity:0,guideLineColor:u[7],guideLineDisableColor:"rgba(0,0,0,0.25)",guideLineDash:[3,3],interactionState:{hover:{backgroundColor:u[7],backgroundOpacity:1}}},scrollBar:{trackColor:"rgba(0,0,0,0.01)",thumbHoverColor:"rgba(0,0,0,0.25)",thumbColor:"rgba(0,0,0,0.15)",size:Cw()?3:6,hoverSize:Cw()?4:8,lineCap:"round"},splitLine:{horizontalBorderColor:u[12],horizontalBorderColorOpacity:.2,horizontalBorderWidth:2,verticalBorderColor:u[11],verticalBorderColorOpacity:.25,verticalBorderWidth:2,showShadow:!0,shadowWidth:8,shadowColors:{left:"rgba(0,0,0,0.1)",right:"rgba(0,0,0,0)"}},prepareSelectMask:{backgroundColor:u[5],backgroundOpacity:.3},background:{color:u[8],opacity:1}}},_w=function(){function t(t){this.x=0,this.y=0,this.width=0,this.height=0,this.colIndex=-1,this.level=0,this.isLeaf=!1,this.children=[],this.padding=0;var e=t.id,n=t.key,r=t.value,i=t.label,o=t.parent,a=t.level,s=t.rowIndex,l=t.isTotals,u=t.isGrandTotals,c=t.isSubTotals,h=t.isCollapsed,d=t.hierarchy,f=t.isPivotMode,p=t.seriesNumberWidth,v=t.field,g=t.spreadsheet,y=t.query,m=t.belongsCell,C=t.inCollapseNode,w=t.isTotalMeasure,x=t.isLeaf,S=t.extra;this.id=e,this.key=n,this.value=r,this.label=i||r,this.parent=o,this.level=a,this.rowIndex=s,this.isTotals=l,this.isCollapsed=h,this.hierarchy=d,this.isPivotMode=f,this.seriesNumberWidth=p,this.field=v,this.spreadsheet=g,this.query=y,this.belongsCell=m,this.inCollapseNode=C,this.isTotalMeasure=w,this.isLeaf=x,this.isGrandTotals=u,this.isSubTotals=c,this.config={x:0,y:0,width:0,height:0,colIndex:-1,children:[],padding:0,id:"",key:"",value:"",label:""},this.extra=S}return t.getFieldPath=function(t,e){if(t&&!t.isTotals||t&&e){for(var n=t.parent,r=[t.field];n&&n.id!==Wo;)r.push(n.field),n=n.parent;return r.reverse()}return[]},t.getAllLeaveNodes=function(t){var e=[];if(t.isLeaf)return[t];for(var n=XC([],VC(t.children),!1),r=n.shift();r;)r.isLeaf?e.push(r):n.unshift.apply(n,XC([],VC(r.children),!1)),r=n.shift();return e},t.getAllChildrenNodes=function(t){var e=[];if(t.isLeaf)return[t];for(var n=XC([],VC(t.children||[]),!1),r=n.shift();r;)e.push(r),n.unshift.apply(n,XC([],VC(r.children),!1)),r=n.shift();return e},t.getAllBranch=function(t){for(var e=[],n=this.getAllLeaveNodes(t),r=n.shift(),i=[];r;){i.unshift(r);for(var o=r.parent;o&&!av(o,t);)i.unshift(o),o=o.parent;e.push(i),r=n.shift(),i=[]}return e},t.blankNode=function(){return new t({id:"",key:"",value:""})},t.rootNode=function(){return new t({id:"root",key:"",value:""})},t.prototype.toJSON=function(){return Jv(this,["config","hierarchy","parent","spreadsheet"])},t}(),bw=function(){function t(){this.width=0,this.height=0,this.maxLevel=-1,this.sampleNodesForAllLevels=[],this.sampleNodeForLastLevel=null,this.allNodesWithoutRoot=[],this.indexNode=[]}return t.prototype.getLeaves=function(){return this.allNodesWithoutRoot.filter((function(t){return t.isLeaf}))},t.prototype.getNodes=function(t){return void 0!==t?this.allNodesWithoutRoot.filter((function(e){return e.level===t})):this.allNodesWithoutRoot},t.prototype.getNodesLessThanLevel=function(t){return this.allNodesWithoutRoot.filter((function(e){return e.level<=t}))},t.prototype.pushNode=function(t,e){void 0===e&&(e=-1),-1===e?this.allNodesWithoutRoot.push(t):this.allNodesWithoutRoot.splice(e,0,t)},t.prototype.pushIndexNode=function(t){this.indexNode.push(t)},t.prototype.getIndexNodes=function(){return this.indexNode},t}(),Tw=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1),this.label=t,this.isSubTotals=e,this.isGrandTotals=n};function Lw(t,e){for(var n={},r=t;r&&r.key;)r.isTotals&&!e||(n[r.key]=r.value),r=r.parent;return n}var Iw=function(t,e,n,r){return e.layoutArrange?e.layoutArrange(e.spreadsheet,n,r,t):t},Ow=function(t,e,n,r){var i=!0,o=function(t,n,i){void 0===n&&(n=-1),void 0===i&&(i=-1),-1===n?(e.children.push(t),r.pushNode(t)):(e.children.splice(n,0,t),r.pushNode(t,i))};if(t.layoutHierarchy){var a=t.layoutHierarchy(t.spreadsheet,n);if(a){var s=!!ev(null==a?void 0:a.delete)&&(null==a?void 0:a.delete);i=!s;var l=a.push,u=a.unshift,c=e.children.length,h=r.getNodes().length;ov(u)||(Tf(u,(function(t){o(t)})),c=e.children.length,h=r.getNodes().length),ov(l)||Tf(l,(function(t){o(t)})),s||o(n,c,h)}else o(n)}else o(n);return i},Rw=function(t,e,n){(null==t?void 0:t.layoutCoordinate)&&((null==e?void 0:e.isLeaf)||(null==n?void 0:n.isLeaf))&&(null==t||t.layoutCoordinate(t.spreadsheet,e,n))},Aw=function(t){this.label=t},Mw=function(t){var e,n=t.addTotalMeasureInTotal,r=t.addMeasureInTotalQuery,i=t.parentNode,o=t.currentField,a=t.fields,s=t.facetCfg,l=t.hierarchy,u=a.indexOf(o),c=s.dataSet,h=s.values,d=s.spreadsheet,f=[],p={};if(i.isTotals)n&&(p=Lw(i.parent,!0),f.push.apply(f,XC([],VC(h.map((function(t){return new Aw(t)}))),!1)));else{p=Lw(i,!0);var v=c.getDimensionValues(o,p),g=Iw(v,s,i,o);f.push.apply(f,XC([],VC(g||[]),!1));var y=c.getFieldName(o);ov(f)&&(o===fo?f.push.apply(f,XC([],VC(null===(e=c.fields)||void 0===e?void 0:e.values),!1)):f.push(y)),function(t,e,n){var r,i,o,a,s=null!==(a=null===(o=n.colCfg)||void 0===o?void 0:o.hideMeasureColumn)&&void 0!==a&&a,l=n.dataSet.fields.valueInCols;try{for(var u=jC(t),c=u.next();!c.done;c=u.next()){var h=c.value;s&&l&&e===fo&&t.splice(t.indexOf(h),1)}}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}(f,o,s),function(t){var e,n,r,i=t.isFirstField,o=t.currentField,a=t.fieldValues,s=t.spreadsheet,l=t.lastField,u=s.getTotalsConfig(i?o:l);i?(null==u?void 0:u.showGrandTotals)&&(n=u.reverseLayout?"unshift":"push",r=new Tw(u.label,!1,!0)):(null==u?void 0:u.showSubTotals)&&(ws.size(a)>1||!1!==ws.get(u,"showSubTotals.always"))&&o!==fo&&(n=u.reverseSubLayout?"unshift":"push",r=new Tw(u.subLabel,!0)),null===(e=a[n])||void 0===e||e.call(a,r)}({currentField:o,lastField:a[u-1],isFirstField:0===u,fieldValues:f,spreadsheet:d})}var m=d.store.get("hiddenColumnsDetail"),C=function(t){for(var e=t.getColumnLeafNodes(),n=new Set,r=0;r<e.length;r++)if(n.add(e[r].value),n.size>1)return!1;return 1===n.size}(d),w=f.filter((function(t){return!gv(t)&&(!!ov(m)||m.every((function(e){return e.hideColumnNodes.every((function(e){var n=e.field===fo,r=e.field===po;return n||r||C?e.parent.id!==i.id&&e.parent.value!==t:e.value!==t}))})))}));Nw({currentField:o,fields:a,fieldValues:w,facetCfg:s,hierarchy:l,parentNode:i,level:u,query:p,addMeasureInTotalQuery:r,addTotalMeasureInTotal:n})},Bw=function(t,e){return"".concat(t).concat(Go).concat(e)},Nw=function(t){var e,n,r,i,o,a,s,l,u,c=t.currentField,h=t.fields,d=t.fieldValues,f=t.facetCfg,p=t.hierarchy,v=t.parentNode,g=t.level,y=t.query,m=t.addMeasureInTotalQuery,C=t.addTotalMeasureInTotal,w=f.spreadsheet,x=f.collapsedCols,S=f.colCfg;try{for(var E=jC(d.entries()),_=E.next();!_.done;_=E.next()){var b=VC(_.value,2),T=b[0],L=b[1],I=L instanceof Tw,O=L instanceof Aw,R=void 0,A=void 0,M=!1,B=!1,N=!1,D=c;if(I){var P=L;B=P.isGrandTotals,N=P.isSubTotals,R=lw(L.label),m?(A=UC(UC({},y),((r={})[fo]=null===(s=null==w?void 0:w.dataSet)||void 0===s?void 0:s.fields.values[0],r)),M=!0):(A=y,C||(M=!0))}else if(O)R=lw(L.label),A=UC(UC({},y),((i={})[fo]=R,i)),D=fo,M=!0;else if(w.isTableMode())R=L,D=h[T],A=UC(UC({},y),((o={})[D]=R,o)),M=!0;else{R=L,A=UC(UC({},y),((a={})[c]=R,a));var k=null===(u=null===(l=w.dataCfg.fields)||void 0===l?void 0:l.valueInCols)||void 0===u||u,z=(null==S?void 0:S.hideMeasureColumn)&&k&&Op(h,fo)?2:1;M=g===h.length-z}var F=Bw(v.id,R);if(!F)return;var H=!!ev(null==x?void 0:x[F])&&(null==x?void 0:x[F]),W=new _w({id:F,key:D,value:R,level:g,field:D,parent:v,isTotals:I,isGrandTotals:B,isSubTotals:N,isTotalMeasure:O,isCollapsed:H,hierarchy:p,query:A,spreadsheet:w,isLeaf:M||H}),G=Ow(f,v,W,p);!(g>p.maxLevel)||B||v.isGrandTotals||v.isSubTotals||W.isSubTotals||(p.sampleNodesForAllLevels.push(W),p.sampleNodeForLastLevel=W,p.maxLevel=g),M||H||!G?(W.isLeaf=!0,p.pushIndexNode(W),W.rowIndex=p.getIndexNodes().length-1):Mw({addTotalMeasureInTotal:C,addMeasureInTotalQuery:m,parentNode:W,currentField:h[g+1],fields:h,facetCfg:f,hierarchy:p})}}catch(t){e={error:t}}finally{try{_&&!_.done&&(n=E.return)&&n.call(E)}finally{if(e)throw e.error}}},Dw=function(t){var e=t.facetCfg,n=t.hierarchy,r=t.parentNode,i=e.columns,o=e.spreadsheet,a=e.dataSet,s=o.store.get("hiddenColumnsDetail"),l=null==e?void 0:e.showSeriesNumber,u=i.filter((function(t){return!s||s.every((function(e){return e.hideColumnNodes.every((function(e){return e.field!==t}))}))})),c=XC([],VC(u),!1),h=op(u,(function(t){return a.getFieldName(t)}));l&&(c.unshift(go),h.unshift(lw("序号"))),Nw({currentField:c[0],fields:c,fieldValues:h,facetCfg:e,hierarchy:n,parentNode:r,level:0,query:{},addMeasureInTotalQuery:!1,addTotalMeasureInTotal:!1})},Pw="Transform Data",kw="Header Layout",zw="Data Cell Render",Fw=function(){function t(){var t=this;this.debug=!1,this.debugCallback=function(e,n){if(t.debug){var r=performance.now();n();var i=performance.now();console.log(e,"".concat(i-r," ms"))}else n()},this.logger=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];t.debug&&console.log.apply(console,XC([e],VC(n),!1))}}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.setDebug=function(t){this.debug=t},t}(),Hw=Object.freeze({__proto__:null,ArrowDown:'\n<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" font-family="Roboto, PingFangSC, BlinkMacSystemFont, Microsoft YaHei, Arial, sans-serif" font-size="12" font-weight="bold">\n <text id="↓" fill="#29A294">\n <tspan x="-0.225097656" y="8.5">↓</tspan>\n </text>\n</g>\n</svg>',ArrowUp:'<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" font-family="Roboto, PingFangSC, BlinkMacSystemFont, Microsoft YaHei, Arial, sans-serif" font-size="12" font-weight="bold">\n <text id="↑" fill="#FF4D4F">\n <tspan x="-0.225097656" y="8.5">↑</tspan>\n </text>\n</g>\n</svg>\n',CellDown:'<?xml version="1.0" encoding="UTF-8"?>\n<svg width="7px" height="9px" viewBox="0 0 7 9" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 58 (84663) - https://sketch.com --\x3e\n <title>down</title>\n <desc>Created with Sketch.</desc>\n <g id="一期开发" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <polygon id="down" fill="#58AE57" transform="translate(3.500000, 4.500000) scale(1, -1) translate(-3.500000, -4.500000) " points="3.5 0 7 9 0 9"></polygon>\n </g>\n</svg>',CellUp:'<?xml version="1.0" encoding="UTF-8"?>\n<svg width="7px" height="9px" viewBox="0 0 7 9" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 58 (84663) - https://sketch.com --\x3e\n <title>up</title>\n <desc>Created with Sketch.</desc>\n <g id="一期开发" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <polygon id="up" fill="#F46649" points="3.5 0 7 9 0 9"></polygon>\n </g>\n</svg> ',GlobalAsc:'<svg t="1557124621626" class="icon" style="" viewBox="0 0 1024 1024" version="1.1"\nxmlns="http://www.w3.org/2000/svg" p-id="17452"\nxmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n<defs>\n <style type="text/css"></style>\n</defs>\n<path d="M182.272 167.04a8 8 0 0 0-12.544 0L57.728 309.056A8 8 0 0 0 64 321.984h76.032v530.048c0 4.352 3.584 7.936 7.936 7.936h56.064a8 8 0 0 0 7.936-7.936V321.92H288a8 8 0 0 0 6.272-12.992l-112-141.888z m209.728 626.944h176c4.416 0 8 3.584 8 8v56a8 8 0 0 1-8 8h-176A8 8 0 0 1 384 857.984v-56c0-4.416 3.584-8 8-8z m0-424h368c4.416 0 8 3.648 8 8v56a8 8 0 0 1-8 8h-368A8 8 0 0 1 384 433.984v-56c0-4.352 3.584-8 8-8z m528-139.968h-528A8 8 0 0 1 384 222.016v-56c0-4.416 3.584-8 8-8h528c4.416 0 8 3.584 8 8v56a8 8 0 0 1-8 8z m-256 424h-272A8 8 0 0 1 384 646.016v-56c0-4.416 3.584-8 8-8h272c4.416 0 8 3.584 8 8v56a8 8 0 0 1-8 8z" p-id="17453"></path>\n</svg>',GlobalDesc:'<svg t="1557124685600" class="icon" style="" viewBox="0 0 1024 1024" version="1.1"\n xmlns="http://www.w3.org/2000/svg" p-id="17561"\n xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path d="M182.272 856.96a8 8 0 0 1-12.544 0l-112-141.952A8 8 0 0 1 64 702.08h76.032V172.032c0-4.416 3.584-8 7.936-8h56.064c4.352 0 7.936 3.584 7.936 8v529.984H288c6.72 0 10.496 7.808 6.272 12.992l-112 141.888z m209.728-626.944h176A8 8 0 0 0 576 222.016v-56a8 8 0 0 0-8-8h-176A8 8 0 0 0 384 166.016v56c0 4.416 3.584 8 8 8z m0 424h368a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8h-368A8 8 0 0 0 384 590.016v56c0 4.416 3.584 8 8 8z m528 139.968h-528a8 8 0 0 0-8 8v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z m-256-424h-272A8 8 0 0 0 384 377.984v56c0 4.416 3.584 8 8 8h272a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z" p-id="17562"></path>\n</svg>',GroupAsc:'<svg t="1557124695786" class="icon" style="" viewBox="0 0 1024 1024" version="1.1"\n xmlns="http://www.w3.org/2000/svg" p-id="17670"\n xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path d="M182.272 167.04a8 8 0 0 0-12.544 0L57.728 309.056A8 8 0 0 0 64 321.984h76.032v530.048c0 4.352 3.584 7.936 7.936 7.936h56.064a8 8 0 0 0 7.936-7.936V321.92H288a8 8 0 0 0 6.272-12.992l-112-141.888z m209.728 62.976h304A8 8 0 0 0 704 222.016v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 166.016v56c0 4.416 3.584 8 8 8z m0 424h304a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 590.016v56c0 4.416 3.584 8 8 8z m528 139.968h-528a8 8 0 0 0-8 8v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z m0-424h-528A8 8 0 0 0 384 377.984v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z" p-id="17671"></path>\n</svg>',GroupDesc:'<svg t="1557124710652" class="icon" style="" viewBox="0 0 1024 1024" version="1.1"\n xmlns="http://www.w3.org/2000/svg" p-id="17779"\n xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path d="M182.272 856.96a8 8 0 0 1-12.544 0l-112-141.952A8 8 0 0 1 64 702.08h76.032V172.032c0-4.416 3.584-8 7.936-8h56.064c4.352 0 7.936 3.584 7.936 8v529.984H288c6.72 0 10.496 7.808 6.272 12.992l-112 141.888z m209.728-626.944h304A8 8 0 0 0 704 222.016v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 166.016v56c0 4.416 3.584 8 8 8z m0 424h304a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 590.016v56c0 4.416 3.584 8 8 8z m528 139.968h-528a8 8 0 0 0-8 8v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z m0-424h-528A8 8 0 0 0 384 377.984v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z" p-id="17780"></path>\n</svg>',GroupNone:'<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<g id="设计输出" stroke="none" stroke-width="1" fill-opacity="0.25" fill-rule="evenodd">\n <g id="设计输出-移动端指标详情页-阅读端" transform="translate(-3275.000000, -724.000000)" fill-rule="nonzero">\n <g id="编组-39" transform="translate(3064.500000, 667.000000)">\n <g id="编组-36" transform="translate(80.500000, 44.000000)">\n <g id="不排序" transform="translate(130.000000, 13.000000)">\n <path d="M12.0009375,12.40625 C12.0696875,12.40625 12.1259375,12.4625 12.1259375,12.53125 L12.1259375,12.53125 L12.1259375,13.40625 C12.1259375,13.475 12.0696875,13.53125 12.0009375,13.53125 L12.0009375,13.53125 L6.25093747,13.53125 C6.18218747,13.53125 6.12593747,13.475 6.12593747,13.40625 L6.12593747,13.40625 L6.12593747,12.53125 C6.12593747,12.4625 6.18218747,12.40625 6.25093747,12.40625 L6.25093747,12.40625 Z M2.93949997,2.5801875 L2.97437497,2.6109375 L4.72437497,4.828125 C4.78062497,4.89776786 4.74503823,4.99725765 4.66779698,5.02426203 L4.62593747,5.03125 L3.438,5.03089062 L3.43843747,10.9691406 L4.62593747,10.9691406 C4.73062497,10.9691406 4.78999997,11.0910156 4.72437497,11.1722656 L2.97437497,13.3894531 C2.92437497,13.4535156 2.82749997,13.4535156 2.77749997,13.3894531 L1.02749997,11.1722656 C0.961874969,11.0894531 1.02124997,10.9691406 1.12593747,10.9691406 L2.31343747,10.9691406 L2.313,5.03089062 L1.12593747,5.03125 C1.03620533,5.03125 0.979764,4.94285714 1.00679571,4.8654519 L1.02749997,4.828125 L2.77749997,2.6109375 C2.81749997,2.5596875 2.88749997,2.5494375 2.93949997,2.5801875 Z M10.5009375,9.09375 C10.5696875,9.09375 10.6259375,9.15 10.6259375,9.21875 L10.6259375,9.21875 L10.6259375,10.09375 C10.6259375,10.1625 10.5696875,10.21875 10.5009375,10.21875 L10.5009375,10.21875 L6.25093747,10.21875 C6.18218747,10.21875 6.12593747,10.1625 6.12593747,10.09375 L6.12593747,10.09375 L6.12593747,9.21875 C6.12593747,9.15 6.18218747,9.09375 6.25093747,9.09375 L6.25093747,9.09375 Z M14.5009375,5.78125 C14.5696875,5.78125 14.6259375,5.8375 14.6259375,5.90625 L14.6259375,5.90625 L14.6259375,6.78125 C14.6259375,6.85 14.5696875,6.90625 14.5009375,6.90625 L14.5009375,6.90625 L6.25093747,6.90625 C6.18218747,6.90625 6.12593747,6.85 6.12593747,6.78125 L6.12593747,6.78125 L6.12593747,5.90625 C6.12593747,5.8375 6.18218747,5.78125 6.25093747,5.78125 L6.25093747,5.78125 Z M9.00093747,2.46875 C9.06968747,2.46875 9.12593747,2.525 9.12593747,2.59375 L9.12593747,2.59375 L9.12593747,3.46875 C9.12593747,3.5375 9.06968747,3.59375 9.00093747,3.59375 L9.00093747,3.59375 L6.25093747,3.59375 C6.18218747,3.59375 6.12593747,3.5375 6.12593747,3.46875 L6.12593747,3.46875 L6.12593747,2.59375 C6.12593747,2.525 6.18218747,2.46875 6.25093747,2.46875 L6.25093747,2.46875 Z" id="形状结合"></path>\n </g>\n </g>\n </g>\n </g>q\n</g>\n</svg>',Minus:'<svg t="1557140120188" class="icon" style="" viewBox="0 0 1024 1024" version="1.1"\nxmlns="http://www.w3.org/2000/svg" p-id="16909" xmlns:xlink="http://www.w3.org/1999/xlink"\nwidth="200" height="200">\n\t<defs>\n\t\t<style type="text/css">\n\t\t</style>\n\t</defs>\n\t<path d="M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"\n\tp-id="16910">\n\t</path>\n\t<path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z"\n\tp-id="16911">\n\t</path>\n</svg>',Plus:'<svg t="1557140186692" class="icon" style="" viewBox="0 0 1024 1024" version="1.1"\nxmlns="http://www.w3.org/2000/svg" p-id="17025" xmlns:xlink="http://www.w3.org/1999/xlink"\nwidth="200" height="200">\n\t<defs>\n\t\t<style type="text/css">\n\t\t</style>\n\t</defs>\n\t<path d="M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"\n\tp-id="17026">\n\t</path>\n\t<path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z"\n\tp-id="17027">\n\t</path>\n</svg>',SortDown:'<svg t="1565940955886" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"\n p-id="17472" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path\n fill-opacity="0.45"\n d="M948 392.992l-403.008 488.99200001Q532 896 512.992 896t-32-14.016L76 392.992q-18.016-20.992-7.008-46.016T108 321.98400001L916 321.98400001q28 0 39.008 24.99199999T948 392.992z"\n p-id="17473" data-spm-anchor-id="a313x.7781069.0.i2" class="selected"></path>\n</svg>\n',SortUp:'<svg t="1565940979768" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"\n p-id="17620" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path\n fill-opacity="0.45"\n d="M76 631.008l403.008-488.99200001Q492 128 511.008 128t32 14.016L948 631.008q18.016 20.992 7.008 46.016T916 702.01599999L108 702.01599999q-28 0-39.008-24.99199999T76 631.008z"\n p-id="17621"></path>\n</svg>\n',SortDownSelected:'<svg t="1565940955886" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"\n p-id="17472" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path\n d="M948 392.992l-403.008 488.99200001Q532 896 512.992 896t-32-14.016L76 392.992q-18.016-20.992-7.008-46.016T108 321.98400001L916 321.98400001q28 0 39.008 24.99199999T948 392.992z"\n p-id="17473" data-spm-anchor-id="a313x.7781069.0.i2" class="selected"></path>\n</svg>\n',SortUpSelected:'<svg t="1565940979768" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"\np-id="17620" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n<defs>\n<style type="text/css"></style>\n</defs>\n<path\nd="M76 631.008l403.008-488.99200001Q492 128 511.008 128t32 14.016L948 631.008q18.016 20.992 7.008 46.016T916 702.01599999L108 702.01599999q-28 0-39.008-24.99199999T76 631.008z"\np-id="17621"></path>\n</svg>\n',InfoCircle:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590389330617" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19656" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M512 64c-247.4 0-448 200.6-448 448s200.6 448 448 448 448-200.6 448-448-200.6-448-448-448z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" fill="" p-id="19657"></path><path d="M464 336c0 26.5 21.5 48 48 48s48-21.5 48-48-21.5-48-48-48-48 21.5-48 48zM536 448h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-272c0-4.4-3.6-8-8-8z" fill="" p-id="19658"></path></svg>',ExpandColIcon:'<?xml version="1.0" encoding="UTF-8"?>\n<svg width="23px" height="12px" viewBox="0 0 23 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>编组 8备份 3</title>\n <g id="----隐藏列标注!" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="隐藏列标注" transform="translate(-275.000000, -824.000000)">\n <rect fill="#FFFFFF" x="0" y="0" width="1333" height="1167"></rect>\n <g id="编组-8备份-3" transform="translate(275.000000, 824.000000)">\n <rect id="矩形" stroke-opacity="0.25" stroke="#000000" fill="#F7F7F7" x="0.5" y="0.5" width="11" height="11"></rect>\n <rect id="矩形备份-9" stroke-opacity="0.25" stroke="#000000" fill="#F7F7F7" x="11.5" y="0.5" width="11" height="11"></rect>\n <g id="7.Icon/arrow/15.down/fill" transform="translate(6.000000, 6.000000) rotate(90.000000) translate(-6.000000, -6.000000) " fill="#000000" fill-rule="nonzero" opacity="0.65">\n <path d="M7.25020811,6.37218077 L4.91348936,8.20968077 C4.82677061,8.27764952 4.69903624,8.21671202 4.69903624,8.10655577 L4.69903624,4.43272764 C4.69903624,4.32257139 4.82677061,4.26046202 4.91348936,4.32960264 L7.25020811,6.16593077 C7.31700499,6.21866514 7.31700499,6.31944639 7.25020811,6.37218077 Z" id="fill" transform="translate(5.999671, 6.269385) rotate(90.000000) translate(-5.999671, -6.269385) "></path>\n </g>\n <g id="7.Icon/arrow/15.down/fill" transform="translate(17.000000, 6.000000) rotate(270.000000) translate(-17.000000, -6.000000) translate(11.000000, 0.000000)" fill="#000000" fill-rule="nonzero" opacity="0.65">\n <path d="M7.25020811,6.37218077 L4.91348936,8.20968077 C4.82677061,8.27764952 4.69903624,8.21671202 4.69903624,8.10655577 L4.69903624,4.43272764 C4.69903624,4.32257139 4.82677061,4.26046202 4.91348936,4.32960264 L7.25020811,6.16593077 C7.31700499,6.21866514 7.31700499,6.31944639 7.25020811,6.37218077 Z" id="fill" transform="translate(5.999671, 6.269385) rotate(90.000000) translate(-5.999671, -6.269385) "></path>\n </g>\n </g>\n <line x1="286.5" y1="813" x2="286.5" y2="864.5" id="路径-2备份-3" stroke="#000000" opacity="0.25"></line>\n </g>\n </g>\n</svg>',Trend:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1596433821690" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20229" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6c-3.1-3.1-8.2-3.1-11.3 0l-230 229.9L461.4 404c-3.1-3.1-8.2-3.1-11.3 0L266.3 586.7c-3.1 3.1-3.1 8.2 0 11.3l39.5 39.7z" p-id="20230"></path></svg>',DrillDownIcon:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1608030723688" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21482" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><style type="text/css"></style></defs><path d="M547.648 696a32 32 0 0 1 31.488 26.24l0.512 5.76v151.68l145.216-144.512a32 32 0 0 1 40.832-3.648l4.416 3.712a32 32 0 0 1 3.584 40.832l-3.712 4.48-203.072 202.24a32 32 0 0 1-40.768 3.648l-4.416-3.712-202.24-202.24a32 32 0 0 1 40.832-48.96l4.416 3.712 150.912 150.912v-158.144a32 32 0 0 1 32-32z m194.56-529.28l4.928 3.072 233.792 180.224a32 32 0 0 1 1.728 49.28l-4.864 3.52-409.792 245.568a32 32 0 0 1-27.328 2.624l-5.184-2.432-422.4-245.568a32 32 0 0 1-7.552-49.28l4.544-4.032 242.816-180.288a32 32 0 0 1 42.432 47.552l-4.288 3.84-203.84 151.296 364.16 211.648 353.28-211.712-196.608-151.552a32 32 0 0 1-8.896-40l3.136-4.864a32 32 0 0 1 40-8.96zM547.712 28.672a32 32 0 0 1 31.488 26.24l0.512 5.76v396.992a32 32 0 0 1-63.488 5.76l-0.512-5.76V60.736a32 32 0 0 1 32-32z" p-id="21483" fill="currentColor"></path></svg>\n',EyeOutlined:'<svg viewBox="64 64 896 896" focusable="false" data-icon="eye" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"></path></svg>'}),Ww={},Gw=function(t,e){Ww[bv(t)]=e},Uw=function(t){return Ww[bv(t)]};Wl(Hw).forEach((function(t){Gw(t,Hw[t])}));var Yw,jw,Vw,Xw="<svg",Kw={},qw=function(t){function e(e){var n=t.call(this,e)||this;return n.hasSupportSuffix=function(t){return[".png",".jpg",".gif",".svg"].some((function(e){return null==t?void 0:t.endsWith(e)}))},n.render(),n}return GC(e,t),e.prototype.getImage=function(t,e,n){var r=this;return new Promise((function(i,o){var a=new Image;a.onload=function(){Kw[e]=a,i(a)},a.onerror=function(t){o(t)};var s=Uw(t);s&&(s.includes("data:image/svg+xml")||r.hasSupportSuffix(s))?a.src=s:s&&(n&&(s=(s=s.replace(/fill=[\'\"]#?\w+[\'\"]/g,"")).replace(/fill>/g,">")),s=s.replace(Xw,"".concat(Xw,' fill="').concat(n,'"')),a.src="data:image/svg+xml;utf-8,".concat(encodeURIComponent(s)))}))},e.prototype.render=function(){var t=this,n=this.cfg,r=n.name,i=n.fill,o=Jh(this.cfg),a=UC(UC({},Jv(o,"fill")),{type:e.type}),s=new Ai({attrs:a}),l="".concat(r,"-").concat(i),u=Kw[l];u?(s.attr("img",u),this.addShape("image",s)):this.getImage(r,l,i).then((function(e){s.attr("img",e),t.addShape("image",s)})).catch((function(t){console.warn("GuiIcon ".concat(r," load error"),t)})),this.iconImageShape=s},e.type="__GUI_ICON__",e}(xi);t.CellBorderPosition=void 0,(Yw=t.CellBorderPosition||(t.CellBorderPosition={})).TOP="TOP",Yw.BOTTOM="BOTTOM",Yw.LEFT="LEFT",Yw.RIGHT="RIGHT",t.Aggregation=void 0,(jw=t.Aggregation||(t.Aggregation={})).SUM="SUM",jw.MIN="MIN",jw.MAX="MAX",jw.AVG="AVG",t.CornerNodeType=void 0,(Vw=t.CornerNodeType||(t.CornerNodeType={})).Row="row",Vw.Col="col",Vw.Series="series";var Zw=function(){function t(){this.store=new Map}return t.prototype.set=function(t,e){return this.store.set(t,e)},t.prototype.get=function(t,e){var n;return null!==(n=this.store.get(t))&&void 0!==n?n:e},t.prototype.clear=function(){this.store.clear()},t.prototype.size=function(){return this.store.size},t}(),$w=function(t,e,n){return t.sort((function(t,r){n&&(t=n(t),r=n(r));var i=e.indexOf(t),o=e.indexOf(r);return-1===i&&-1===o?0:-1===i?1:-1===o?-1:i-o}))},Qw=function(t){return Xf(t,(function(t){return!gv(t)&&"undefined"!==t}))},Jw=function(t){var e;return null===(e=Wl(t))||void 0===e?void 0:e.reduce((function(e,n){var r=Su(t,n);return Array.isArray(r)?e=e.concat(Jw(r)):null==e||e.push(r),e}),[])},tx=function(t){var e=[];if(Array.isArray(t))for(var n=("undefined"in t),r=t.length+(n?1:0),i=0,o=function(){var n=i===t.length?t[void 0]:t[i];i++,n&&"undefined"in n?Wl(n).forEach((function(t){e.push(n[t])})):Array.isArray(n)?e.push.apply(e,XC([],VC(n),!1)):e.push(n)};i<r;)o();else e.push(t);return e},ex=function(t,e){var n=[];return null==t||t.forEach((function(t,r){void 0===t&&e[r]&&n.push(e[r])})),n},nx=function(t,e){return!Yf(t,(function(t){return e[t]}))};function rx(t,e){var n=e.rows,r=e.columns;return dy(t,(function(t,e){return nx([].concat(n).concat(r),e)&&t.push(e),t}),[])}var ix={en_US:["KMBTP".split(""),[1e3,1e3,1e3,1e3,1e3]],zh_CN:[["万","亿"],[1e4,1e4]]},ox=function(t){return Number.parseFloat((Oa(t)||0).toPrecision(16))},ax=function(t,e,n){if(void 0===n&&(n=0),!Object.values(t).find((function(t){return t>0})))return t;var r=UC({},t);r.frozenColCount>=e&&(r.frozenColCount=e);var i=e-r.frozenColCount;r.frozenTrailingColCount>i&&(r.frozenTrailingColCount=i),r.frozenRowCount>=n&&(r.frozenRowCount=n);var o=n-r.frozenRowCount;return r.frozenTrailingRowCount>o&&(r.frozenTrailingRowCount=o),r};function sx(t,e,n){var r;return null===(r=null==t?void 0:t.addShape)||void 0===r?void 0:r.call(t,"rect",UC({zIndex:1,attrs:e},n||{}))}function lx(t,e){var n;return null===(n=null==t?void 0:t.addShape)||void 0===n?void 0:n.call(t,"polygon",{attrs:e})}function ux(t,e){var n;return null===(n=null==t?void 0:t.addShape)||void 0===n?void 0:n.call(t,"polyline",{attrs:e})}function cx(t,e){var n;return null===(n=null==t?void 0:t.addShape)||void 0===n?void 0:n.call(t,"circle",{attrs:e})}function hx(t,e,n,r,i,o,a){var s;return!ov(e)&&t&&Tf(e,(function(e){t.contain(e)&&t.removeChild(e,!0)})),null===(s=null==t?void 0:t.addShape)||void 0===s?void 0:s.call(t,"text",{attrs:UC(UC({x:n,y:r,text:i},o),a)})}function dx(t,e,n){var r;return null===(r=null==t?void 0:t.addShape)||void 0===r?void 0:r.call(t,"line",{zIndex:100,attrs:UC(UC({},e),n)})}function fx(t,e,n){t&&Ey(t,"attrs.".concat(e),n)}function px(t,e){var n=new qw(e);return null==t||t.add(n),n}function vx(t,e,n,r,i){var o=new qw(UC(UC({name:r?"Plus":"Minus"},e),{fill:n}));return Na(i)&&o.on("click",i),null==t||t.add(o),o}var gx="s2-offscreen-canvas",yx=function(t){var e;return null!==(e=null==t?void 0:t.position)&&void 0!==e?e:"right"},mx=function(e,n){var r,i,o,a=e.data,s=e.encode,l=e.type,u=n.getMeta(),c=u.x,h=u.y,d=u.height,f=u.width,p=n.getStyle(t.CellTypes.DATA_CELL),v=p.cell,g=p.miniChart,y=[],m=op(a,(function(t){return y.push(null==t?void 0:t[s.y]),{x:t[s.x],y:t[s.y]}})),C=Bv(y),w=Uv(y),x=C-w,S=c+v.padding.left,E=c+f-v.padding.right,_=h+v.padding.top,b=h+d-v.padding.bottom,T=b-_,L=l===t.MiniChartTypes.Bar?(E-S-(y.length-1)*(null===(r=null==g?void 0:g.bar)||void 0===r?void 0:r.intervalPadding))/y.length+(null===(i=null==g?void 0:g.bar)||void 0===i?void 0:i.intervalPadding):null!==(o=(E-S)/(y.length-1))&&void 0!==o?o:0,I=[],O=op(m,(function(e,n){var r,i,o=S+n*L;if(i=0!==x?b-((null==e?void 0:e.y)-w)/x*T:w>0?_:b,l===t.MiniChartTypes.Bar){var a=void 0,s=void 0;w<0&&C>0&&0!==x?(a=b-(0-w)/x*T,s=Math.abs(i-a),(null==e?void 0:e.y)<0&&(i=a)):(a=w<0?_:b,s=0===(x=Bv([Math.abs(C),Math.abs(w)]))?T:Math.abs((null==e?void 0:e.y)-0)/x*T,i=a);var u=L-(null===(r=null==g?void 0:g.bar)||void 0===r?void 0:r.intervalPadding);I.push([u,s])}return[o,i]}));return{points:O,box:I}},Cx=function(e,n){if(!ov(null==e?void 0:e.data)&&!ov(n)){var r=n.getStyle(t.CellTypes.DATA_CELL).miniChart.line,i=r.point,o=r.linkLine,a=mx(e,n).points;ux(n,{points:a,stroke:o.fill,lineWidth:o.size,opacity:o.opacity});for(var s=0;s<a.length;s++)cx(n,{x:a[s][0],y:a[s][1],r:i.size,fill:i.fill,fillOpacity:i.opacity})}},wx=function(e,n){if(!ov(null==e?void 0:e.data)&&!ov(n))for(var r=n.getStyle(t.CellTypes.DATA_CELL).miniChart.bar,i=mx(e,n),o=i.points,a=i.box,s=0;s<o.length;s++)sx(n,{x:o[s][0],y:o[s][1],width:a[s][0],height:a[s][1],fill:r.fill,fillOpacity:r.opacity})},xx=function(t,e,n){var r=Number(e)-Number(t);return Number.isNaN(r)||Number(t)<0?n.bad:r<=.1?n.good:r>.1&&r<=.2?n.satisfactory:n.bad},Sx=function(t,e){var n,r;void 0===e&&(e={min:0,max:0});var i=Number(t);if(Number.isNaN(i))return t;var o=null!==(n=null==e?void 0:e.min)&&void 0!==n?n:e,a=null!==(r=null==e?void 0:e.max)&&void 0!==r?r:e;return new Intl.NumberFormat("en-US",{minimumFractionDigits:o,maximumFractionDigits:a,useGrouping:!1,style:"percent"}).format(i)},Ex=function(t){var e,n,r,i,o,a;if(!ov(t)){var s=t.getCellArea(),l=s.x,u=s.y,c=s.height,h=s.width,d=t.findFieldCondition(null===(e=t.cellConditions)||void 0===e?void 0:e.interval);if(d&&d.mapping){var f=t.mappingValue(d);if(!f)return;var p=f.isCompare?f:t.valueRangeByField,v=ox(p.minValue),g=ox(p.maxValue),y=ox(t.getMeta().fieldValue);if(y<v||y>g)return;var m=null!==(r=null===(n=t.getStyle().miniChart.interval)||void 0===n?void 0:n.height)&&void 0!==r?r:t.getStyle().cell.miniBarChartHeight,C=null!==(o=null===(i=t.getStyle().miniChart.interval)||void 0===i?void 0:i.fill)&&void 0!==o?o:t.getStyle().cell.miniBarChartFillColor,w=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),t=ox(t),e=ox(e);var n=t>=0,r=e>=0&&t<=0,i=r?0:n?t:e,o=e-t;return function(e){var a=n?0:1;return{zeroScale:r?eh(Math.abs(0-t)/o,0,1):a,scale:eh((e-i)/o,-1,1)}}}(v,g),x=w(y);return sx(t,{x:l+h*x.zeroScale,y:u+c/2-m/2,width:h*x.scale,height:m,fill:null!==(a=f.fill)&&void 0!==a?a:C})}}},_x=function(e,n){var r;if(!ov(e)){var i=n.getStyle(t.CellTypes.DATA_CELL),o=i.miniChart.bullet,a=n.getMeta(),s=a.x,l=a.y,u=a.height,c=a.width,h=a.spreadsheet,d=o.progressBar,f=o.comparativeMeasure,p=o.rangeColors,v=o.backgroundColor,g=e.measure,y=e.target,m=Math.max(Number(g),0),C=Math.max(Number(y),0),w=Sx(g,2),x=(null==d?void 0:d.widthPercent)>1?(null==d?void 0:d.widthPercent)/100:null==d?void 0:d.widthPercent,S=i.cell.padding,E=c-S.left-S.right,_=x*E,b=E-_,T=s+c-S.right-_,L=l+u/2-d.height/2;sx(n,{x:T,y:L,width:_,height:d.height,fill:v,textBaseline:i.text.textBaseline});var I=Su(n.getMeta(),"spreadsheet.options.bullet.getRangeColor"),O=Math.max(Math.min(_*m,_),0);sx(n,{x:T,y:L+(d.height-d.innerHeight)/2,width:O,height:d.innerHeight,fill:null!==(r=null==I?void 0:I(m,C))&&void 0!==r?r:xx(m,C,p)});var R=T+_*C;dx(n,{x1:R,y1:l+(u-f.height)/2,x2:R,y2:l+(u-f.height)/2+f.height},{stroke:(null==f?void 0:f.fill)||(null==f?void 0:f.color),lineWidth:f.width,opacity:null==f?void 0:f.opacity}),hx(n,[],T-S.right,l+u/2,zx({measureTextWidth:h.measureTextWidth,text:w,maxWidth:b-S.right,fontParam:i.text}),i.text)}},bx=function(e,n){switch(null==n?void 0:n.type){case t.MiniChartTypes.Line:Cx(n,e);break;case t.MiniChartTypes.Bar:wx(n,e);break;default:_x(n,e)}},Tx=function(t,e){var n=t.x,r=t.y,i=t.width,o=t.height,a=i-(null==e?void 0:e.left)-(null==e?void 0:e.right),s=o-(null==e?void 0:e.top)-(null==e?void 0:e.bottom);return{x:n+(null==e?void 0:e.left),y:r+(null==e?void 0:e.top),width:a,height:s}},Lx=function(t){return zv({size:0,position:"right",margin:{left:0,right:0}},t)},Ix=function(t,e){return t-(e=Lx(e)).size-e.margin.right-e.margin.left},Ox=function(t,e,n){var r=t.y,i=t.height;void 0===n&&(n=0);var o=0;switch(e){case"top":o=r;break;case"middle":o=r+i/2-n/2;break;default:o=r+i-n}return o},Rx=function(t,e,n,r,i){void 0===n&&(n=0),void 0===i&&(i=1);var o,a,s=t.x,l=t.width,u=e.textAlign,c=e.textBaseline,h=Lx(r),d=h.size,f=h.margin,p=h.position,v=i*(d+f.left)+(i?f.right:0);switch(u){case"left":o=s+("left"===p?v:0),a=s+("left"===p?f.left:n+f.left);break;case"center":var g=s+l/2-(v-("left"===p?f.left:f.right)+n)/2;o=g+n/2+("left"===p?v-f.left:0),a=g+("left"===p?0:n+f.left);break;default:o=s+l-("right"===p?v:0),a=s+l-("right"===p?v-f.left:n+v-f.left)}return{text:{x:o,y:Ox(t,c,0)},icon:{x:a,y:Ox(t,c,d)}}},Ax=function(t,e){return Rx(t,e).text},Mx=function(t,e,n){var r,i,o=e.start+e.width,a=t.start+t.width;if(e.start<=t.start&&o>=a)r=t.start+t.width/2,i=t.width;else if(e.start<=t.start){r=(s=e.width-(t.start-e.start))<n?o-n/2:o-s/2,i=s}else if(o>=a){var s;r=(s=e.width-(o-a))<n?e.start+n/2:e.start+s/2,i=s}else r=e.start+e.width/2,i=e.width;return{start:r,width:i}},Bx=function(e,n,r){var i,o,a,s,l,u=n.x,c=n.y,h=n.width,d=n.height,f=r.horizontalBorderWidth,p=r.horizontalBorderColorOpacity,v=r.horizontalBorderColor,g=r.verticalBorderWidth,y=r.verticalBorderColor,m=r.verticalBorderColorOpacity;if(e===t.CellBorderPosition.TOP||e===t.CellBorderPosition.BOTTOM){var C=c;o=C=e===t.CellBorderPosition.TOP?c+g/2:c+d-g/2,s=C,i=u,a=u+h,l={lineWidth:f,stroke:v,strokeOpacity:p}}if(e===t.CellBorderPosition.LEFT||e===t.CellBorderPosition.RIGHT){var w=u;i=w=e===t.CellBorderPosition.LEFT?u+f/2:u+h-f/2,a=w,o=c,s=c+d,l={lineWidth:g,stroke:y,strokeOpacity:m}}return{position:{x1:i,x2:a,y1:o,y2:s},style:l}},Nx=function(t,e,n){void 0===n&&(n={left:0,right:0});var r=UC({},t);return"left"===e?(r.start+=n.left,r.width-=n.left):"right"===e&&(r.width-=n.right),r},Dx=function(t,e,n,r){var i=e+n,o=t.start;if("center"===r)return o-n/2;var a=t.width-i>0?t.width/2:i/2;return"left"===r?o-a:o+a-n},Px=fu((function(t,e){if(void 0===t&&(t=""),!e)return 0;var n,r=(n=document.getElementById(gx),n||((n=document.createElement("canvas")).id=gx,n.style.display="none",document.body.appendChild(n),n)).getContext("2d"),i=e,o=i.fontSize,a=i.fontFamily,s=i.fontWeight,l=i.fontStyle,u=i.fontVariant;return r.font=[l,u,s,"".concat(o,"px"),a].join(" ").trim(),r.measureText("".concat(t)).width}),(function(t,e){return XC([t],VC(Lp(e)),!1).join("")})),kx=function(t,e,n,r){var i,o=t("...",r);i=bp(e)?e:mu(e);var a,s,l=n,u=[];if(t(e,r)<=n)return e;for(var c=!0;c;){if((s=t(a=i.substr(0,16),r))+o>l&&s>l){c=!1;break}if(u.push(a),l-=s,!(i=i.substr(16)))return u.join("")}for(var h=!0;h;){if((s=t(a=i.substr(0,1),r))+o>l){h=!1;break}if(u.push(a),l-=s,!(i=i.substr(1)))return u.join("")}return"".concat(u.join(""),"...")},zx=function(t){var e=t.measureTextWidth,n=t.text,r=t.maxWidth,i=t.fontParam,o=t.priorityParam,a=t.placeholder,s={},l=null!=a?a:Uo,u=dv(n)||""===n?l:"".concat(n),c=o;if(i&&pa(i)?c=i:s=i||{},!c||!c.length)return kx(e,u,r,s);var h=[],d=[u];c.forEach((function(t){d.forEach((function(e,n){var r=-1,i=e.match(new RegExp(t));if(i){var o=i[0];r=i.index,h.push(o);var a=r+o.length,s=[e.slice(0,r),e.slice(a)].filter((function(t){return!!t}));d.splice.apply(d,XC([n,1],VC(s),!1))}}))})),d=h.concat(d);var f=u,p=e("...",s),v=r;return d.forEach((function(t){if(v<=0){var n=f.indexOf(t),r=f.slice(n-3,n);if(r&&"..."!==r){var i=e(t,s);f=f.replace(t,i>p?"...":t)}else f=f.replace(t,"");v-=p}else{i=e(t,s);if(v<i&&i>p){var o=kx(e,t,v,s);f=f.replace(t,o),v=0}else v-=i}})),f},Fx=function(t,e,n,r){void 0===r&&(r="left");var i=e.right,o=e.left,a=n||0;return"left"===r?t+i/2+a:"right"===r?t-i/2-a:t+o/2+a},Hx=function(t){var e=t.rowIndex,n=t.colIndex,r=t.meta,i=t.data,o=t.textStyle,a=t.textCondition,s=o.fill;return(null==a?void 0:a.mapping)&&(s=null==a?void 0:a.mapping(i,{rowIndex:e,colIndex:n,meta:r}).fill),UC(UC({},o),{fill:s})},Wx=function(t,e){return Na(e)?e(t):e},Gx=function(t,e,n){for(var r,i,o,a=t.x,s=t.y,l=t.width,u=t.height/Ty(e),c=[],h=0,d=op(n,(function(t){return t>1?t/100:t})),f=0;f<Ty(e);f++){i=s+u*f;var p=[];r=a,h=0;for(var v=0;v<Ty(e[f]);v++)o=ov(d)?l/Ty(e[0]):l*d[v],r=Fx(a,{left:0,right:0},h,"left"),h+=o,p.push({x:r,y:i,width:o,height:u});c.push(p)}return c},Ux=function(e,n,r){var i,o,a,s;void 0===r&&(r=!0);var l=e.getContentArea(),u=l.x,c=l.y,h=l.height,d=l.width,f=n||e.getMeta().fieldValue,p=f.values,v=e.getMeta().spreadsheet,g=v.options,y=v.measureTextWidth,m=g.style.cellCfg.valuesCfg,C=null===(o=null===(i=null==g?void 0:g.conditions)||void 0===i?void 0:i.text)||void 0===o?void 0:o[0],w=null===(s=null===(a=null==g?void 0:g.conditions)||void 0===a?void 0:a.icon)||void 0===s?void 0:s[0];if(pa(p)){var x=null==m?void 0:m.widthPercent,S=0;if(null==f?void 0:f.label){var E=e.getStyle(t.CellTypes.DATA_CELL).bolderText;hx(e,[],u,c+(S=h/(p.length+1))/2,zx({measureTextWidth:y,text:f.label,maxWidth:d,fontParam:E}),E)}for(var _,b=function(e){var n,r,i=e.getMeta().isTotals,o=null===(r=(n=e).isMeasureField)||void 0===r?void 0:r.call(n),a=e.getStyle(o?t.CellTypes.COL_CELL:t.CellTypes.DATA_CELL);return{cellStyle:a,textStyle:o?a.measureText:i?a.bolderText:a.text}}(e),T=b.cellStyle,L=b.textStyle,I=null==T?void 0:T.icon,O=w&&w.mapping&&{size:null==I?void 0:I.size,margin:null==I?void 0:I.margin,position:null==w?void 0:w.position},R=Gx({x:u,y:c+S,height:h-S,width:d},p,x),A=0;A<p.length;A++)for(var M=Jh(p[A]),B=0;B<M.length;B++){_=M[B];var N=r?Hx({rowIndex:A,colIndex:B,meta:null==e?void 0:e.getMeta(),data:_,textStyle:L,textCondition:C}):L,D=(null==e?void 0:e.getMeta().spreadsheet.options).placeholder,P=Wx(null==e?void 0:e.getMeta(),D),k=Ix(R[A][B].width,I),z=zx({measureTextWidth:y,text:_,maxWidth:k,fontParam:N,placeholder:P}),F=y(z,L),H=Rx(R[A][B],L,F,O,w?1:0);if(hx(e,[],H.text.x,H.text.y,z,N),w&&r){var W=null==w?void 0:w.mapping(_,{rowIndex:A,colIndex:B,meta:null==e?void 0:e.getMeta()});W&&px(e,UC(UC({},H.icon),{name:W.icon,width:null==I?void 0:I.size,height:null==I?void 0:I.size,fill:W.fill}))}}}else bx(e,p)},Yx=function(t,e){return void 0===e&&(e=1),t.width*e},jx=function(t){try{return JSON.parse(t)}catch(t){return null}};function Vx(t,e){return!(!t||!e)&&String(t).toLowerCase()===String(e).toLowerCase()}var Xx,Kx=function(t,e){var n=t.getColumnNodes().find((function(t){return t.id===e}));return t.isPivotMode()?null==n?void 0:n.value:null==n?void 0:n.field},qx=function(t,e){var n=e.getColumnNodes().find((function(e){return e.colIndex===t})),r=Kx(e,n.id);return e.options.interaction.copyWithFormat?e.dataSet.getFieldFormatter(r):function(t){return t}},Zx=function(t,e,n){var r;if(n.isPivotMode()){var i=VC(function(t,e){var n=t.rowIndex,r=t.colIndex;return[e.getRowNodes().find((function(t){return t.rowIndex===n})),e.getColumnNodes().find((function(t){return t.colIndex===r}))]}(t,n),2),o=i[0],a=i[1];return n.dataSet.getCellData({query:UC(UC({},o.query),a.query),rowNode:o,isTotals:o.isTotals||o.isTotalMeasure||a.isTotals||a.isTotalMeasure}).$$value$$}var s=function(t,e){var n=e.getColumnNodes().find((function(e){return e.colIndex===t}));return Kx(e,n.id)}(t.colIndex,n);return null===(r=e[t.rowIndex])||void 0===r?void 0:r[s]},$x=function(t,e,n){return qx(t.colIndex,n)(Zx(t,e,n))},Qx=function(t){return/\n/.test(t)?'"'+t.replace(/\r\n?/g,"\n").replace(/"/g,"'")+'"':t},Jx=function(t,e){var n=t.split(Go);return e?n.slice(n.length-e):(n.shift(),n)};function tS(e,n){return void 0===n&&(n=t.CopyMIMEType.PLAIN),Array.isArray(n)?[].concat(e).filter((function(t){return n.includes(t.type)})).map((function(t){return t.content})):[].concat(e).filter((function(t){return(null==t?void 0:t.type)===n})).map((function(t){return t.content}))[0]||""}t.CopyMIMEType=void 0,(Xx=t.CopyMIMEType||(t.CopyMIMEType={})).PLAIN="text/plain",Xx.HTML="text/html";var eS=function(e){return{type:t.CopyMIMEType.PLAIN,content:op(e,(function(t){return t.join("\t")})).join("\r\n")}},nS=function(e){return{type:t.CopyMIMEType.HTML,content:'<meta charset="utf-8"><table><tbody>'.concat((n=e,r="tr",n.map((function(t){return"<".concat(r,">").concat(function(t,e){return t.map((function(t){return"<".concat(e,">").concat(Ff(t),"</").concat(e,">")})).join("")}(t,"td"),"</").concat(r,">")})).join("")),"</tbody></table>")};var n,r},rS=function(t,e,n){var r,i,o,a,s,l,u=null!==(i=null===(r=t[0])||void 0===r?void 0:r.length)&&void 0!==i?i:0,c=null!==(o=null==e?void 0:e.length)&&void 0!==o?o:0,h=null!==(s=null===(a=n[0])||void 0===a?void 0:a.length)&&void 0!==s?s:0,d=null!==(l=n.length)&&void 0!==l?l:0,f=u+h,p=c+d,v=Array.from(Array(p),(function(){return new Array(f)}));return v=op(v,(function(r,i){return op(r,(function(r,o){return o>=0&&o<u&&i>=0&&i<c?"":o>=u&&o<=f&&i>=0&&i<c?e[i][o-u]:o>=0&&o<u&&i>=c&&i<p?t[i-c][o]:o>=u&&o<=f&&i>=c&&i<p?n[i-c][o-u]:void 0}))})),[eS(v),nS(v)]},iS=function(t,e,n){var r=e.map((function(e){return e.map((function(e){return Qx($x(e,t,n))}))}));return[eS(r),nS(r)]},oS=function(t){if(!(null==t?void 0:t.length))return[];var e=VC([{row:1/0,col:1/0},{row:0,col:0}],2),n=e[0],r=e[1];t.forEach((function(t){var e=t.rowIndex,i=t.colIndex;n.col=Math.min(i,n.col),n.row=Math.min(e,n.row),r.col=Math.max(i,r.col),r.row=Math.max(e,r.row)}));var i=VC([r.row-n.row+1,r.col-n.col+1],2),o=i[0],a=i[1],s=new Array(o).fill("").map((function(){return new Array(a).fill("")}));return t.forEach((function(t){var e=t.rowIndex,r=t.colIndex,i=VC([e-n.row,r-n.col],2),o=i[0],a=i[1];s[o][a]=t})),s},aS=function(t,e,n){return op(t,(function(t){return e.map((function(e){var r=n.dataSet.getCellData({query:UC(UC({},t.query),e.query),rowNode:t,isTotals:t.isTotals||t.isTotalMeasure||e.isTotals||e.isTotalMeasure});return qx(e.colIndex,n)(r.$$value$$)}))}))};function sS(t,e,n){return t.options.interaction.copyWithHeader?function(t,e,n){var r=op(e,(function(t){return Jx(t.id)})),i=jm.apply(void 0,XC([],VC(op(n,(function(t){return Jx(t.id)}))),!1)),o=aS(e,n,t);return rS(r,i,o)}(t,e,n):function(t,e,n){var r=aS(e,n,t);return[eS(r),nS(r)]}(t,e,n)}var lS=function(t,e,n){return e.isPivotMode()?function(t,e){var n=t.getRowNodes().filter((function(t){return t.isLeaf})),r=t.getColumnNodes().filter((function(t){return t.isLeaf}));return sS(t,n,e.length?e.reduce((function(t,e){return t.push.apply(t,XC([],VC(r.filter((function(t){return t.id.startsWith(e.id)}))),!1)),t}),[]):r)}(e,n):function(t,e){var n=t.dataSet.getDisplayDataSet(),r=e.length?e.map((function(e){return{field:Kx(t,e.id),formatter:qx(e.colIndex,t)}})):t.dataCfg.fields.columns.map((function(e){return t.getColumnNodes().find((function(t){return t.field===e}))})).map((function(e){return{field:Kx(t,e.id),formatter:qx(e.colIndex,t)}})),i=n.map((function(t){return r.map((function(e){var n=e.field,r=e.formatter;return Qx(r(t[n]))}))}));return[eS(i),nS(i)]}(e,n)},uS=function(t,e,n){return e.isPivotMode()?function(t,e){var n=t.getRowNodes().filter((function(t){return t.isLeaf})),r=t.getColumnNodes().filter((function(t){return t.isLeaf}));return sS(t,e.reduce((function(t,e){return t.push.apply(t,XC([],VC(n.filter((function(t){return t.id.startsWith(e.id)}))),!1)),t}),[]),r)}(e,n):function(t,e){var n=t.dataSet.getDisplayDataSet().filter((function(t,n){return e.map((function(t){return t.rowIndex})).includes(n)})).map((function(e){return Object.keys(e).map((function(e){return t.getColumnNodes().find((function(t){return t.field===e}))})).map((function(n){return Qx(qx(n.colIndex,t)(e[n.field]))}))}));return[eS(n),nS(n)]}(e,n)};function cS(e){var n,r=function(t){var e=new Set;return Tf(t,(function(t){var n=t.getMeta().level;e.has(n)||e.add(n)})),e}(e),i=null!==(n=Bv(Array.from(r)))&&void 0!==n?n:0,o=function(t,e){return Xf(t,(function(t){var n=t.getMeta(),r=n.level===e,i=n.isTotals&&ov(n.children);return r||i}))}(e,i),a=e[0].cellType===t.CellTypes.COL_CELL,s=function(t,e,n){return op(t,(function(t){var r=t.getMeta(),i=r.id,o=r.label,a=r.isTotals,s=r.level,l=i;return a&&s!==e&&(l=i+Go+py(o,e-s)),Jx(l,n.size)}))}(o,i,r);return a&&(s=jm.apply(void 0,XC([],VC(s),!1))),[eS(s),nS(s)]}function hS(e,n){var r,i,o=n.filter((function(e){return e.type===t.CellTypes.COL_CELL})),a=n.filter((function(e){return e.type===t.CellTypes.ROW_CELL})),s=e.dataSet.getDisplayDataSet();if(!e.isPivotMode()||!e.isHierarchyTreeType()){if(e.interaction.getCurrentStateName()===t.InteractionStateName.ALL_SELECTED)i=lS(0,e,[]);else if(o.length)i=lS(0,e,o);else if(a.length)i=uS(0,e,a);else{if(!n.length)return;var l=oS(n);i=(null===(r=e.options.interaction)||void 0===r?void 0:r.copyWithHeader)?function(t,e,n){var r=jm.apply(void 0,XC([],VC(op(t[0],(function(t){var e,n,r=null!==(n=null===(e=t.id.split(Uo))||void 0===e?void 0:e[1])&&void 0!==n?n:"";return Jx(r)}))),!1)),i=op(t,(function(t){var e,n,r=null!==(n=null===(e=t[0].id.split(Uo))||void 0===e?void 0:e[0])&&void 0!==n?n:"";return Jx(r)})),o=op(t,(function(t){return op(t,(function(t){return $x(t,e,n)}))}));return rS(i,r,o)}(l,s,e):iS(s,l,e)}return i}}var dS=function(e){var n,r,i=e.interaction,o=i.getState().cells||[],a=null!==(n=i.getInteractedCells())&&void 0!==n?n:[];return(r=!ov(a)&&Yf(a,(function(e){return e.cellType===t.CellTypes.ROW_CELL||e.cellType===t.CellTypes.COL_CELL}))?cS(a):hS(e,o))&&gS(r),tS(r,t.CopyMIMEType.PLAIN)};function fS(t){return t?'"'.concat("string"==typeof t?t.replace(/"/g,'""'):t,'"'):t}var pS=function(e){return new Promise((function(n,r){var i;i=Array.isArray(e)?Su(e.filter((function(e){return e.type===t.CopyMIMEType.PLAIN})),"[0].content",""):e.content||"";var o=document.createElement("textarea");o.value=i,document.body.appendChild(o),o.focus({preventScroll:!0}),o.select();var a=document.execCommand("copy");document.body.removeChild(o),a?n():r()}))},vS=function(t){return navigator.clipboard.write([new ClipboardItem([].concat(t).reduce((function(t,e){var n,r=e.type,i=e.content;return UC(UC({},t),((n={})[r]=new Blob([i],{type:r}),n))}),{}))]).catch((function(){return pS(t)}))},gS=function(e,n){var r;return void 0===n&&(n=!1),r="string"==typeof e?{content:e,type:t.CopyMIMEType.PLAIN}:e,navigator.clipboard&&window.ClipboardItem&&!n?vS(r):pS(r)},yS=function(t,e,n){if(!t)return"";var r=t.fieldValue,i=t.valueField,o=t.data;return _a(r)?function(t){var e=(null==t?void 0:t.label)?[null==t?void 0:t.label]:[],n=null==t?void 0:t.values;return ov(n)||Tf(n,(function(t){e.push(t.join(" "))})),e.join("$")}(r):n?e.dataSet.getFieldFormatter(i)(r,o):"".concat(r)},mS=function(t,e,n,r){var i=[];if(t){var o=t.fieldValue,a=t.valueField,s=t.data;if(_a(o))return i=function(t,e){var n,r,i,o;return e?null===(o=null==t?void 0:t.values)||void 0===o?void 0:o[0]:null!==(r=null===(n=null==t?void 0:t.originalValues)||void 0===n?void 0:n[0])&&void 0!==r?r:null===(i=null==t?void 0:t.values)||void 0===i?void 0:i[0]}(o,r),i;if(dv(o)&&n.length>1)return i.push.apply(i,XC([],VC(n),!1)),i;if(r){var l=e.dataSet.getFieldFormatter(a);i.push(l(o,s))}else i.push(o)}else i.push.apply(i,XC([],VC(n),!1));return i.join(" ")},CS=function(t){var e=jx(t);return pa(e)?e:t},wS=function(t,e,n){var r=CS(e.label),i=pa(r)?r.length:1,o=n.options.placeholder,a=Na(o)?o(t):o;return Array(i).fill(a)},xS=function(t){var e,n,r,i,o=null===(r=null===(n=null===(e=t.spreadsheet)||void 0===e?void 0:e.dataSet)||void 0===n?void 0:n.getFieldFormatter)||void 0===r?void 0:r.call(n,t.field);return null!==(i=null==o?void 0:o(t.label))&&void 0!==i?i:t.label},SS=function(t){var e=[],n=function(t){if(t.id!==Wo){var r=xS(t);return e.unshift(r),(null==t?void 0:t.parent)?n(t.parent):void 0}};return n(t),e},ES=function(t,e,n){var r,i=t.split(Go);if(n)r=[t];else{r=[Bw(i[0],i[1])];for(var o=2;o<i.length;o+=1)r.push(Bw(r[o-2],i[o]))}var a=Xf(e,(function(t){var e;return r.includes(null===(e=t.getMeta())||void 0===e?void 0:e.id)}));return a},_S=function(t,e,n){t&&Tf(ES(t,e),(function(t){t.updateByState(n)}))},bS=function(t){function e(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=t.call(this,{})||this;return o.actualTextWidth=0,o.stateShapes=new Map,o.meta=e,o.spreadsheet=n,o.theme=n.theme,o.handleRestOptions.apply(o,XC([],VC(r),!1)),o.initCell(),o}return GC(e,t),e.prototype.getMeta=function(){return this.meta},e.prototype.setMeta=function(t){this.meta=t},e.prototype.getIconStyle=function(){return this.theme[this.cellType].icon},e.prototype.getTextAndIconPosition=function(t){void 0===t&&(t=1);var e=this.getTextStyle(),n=this.getIconStyle();return Rx(this.getContentArea(),e,this.actualTextWidth,n,t)},e.prototype.getActualText=function(){return this.actualText},e.prototype.getFieldValue=function(){return this.getFormattedFieldValue().formattedValue},e.prototype.handleRestOptions=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.getStyle=function(t){return this.theme[t||this.cellType]},e.prototype.getResizeAreaStyle=function(){return this.getStyle("resizeArea")},e.prototype.shouldDrawResizeAreaByType=function(t,e){var n=this.spreadsheet.options.interaction.resize;return ev(n)?n:Na(n.visible)?n.visible(e):n[t]},e.prototype.getCellArea=function(){var t=this.meta;return{x:t.x,y:t.y,height:t.height,width:t.width}},e.prototype.getContentArea=function(){var t=this.getStyle()||this.theme.dataCell,e=(null==t?void 0:t.cell).padding;return Tx(this.getCellArea(),e)},e.prototype.getIconPosition=function(t){return void 0===t&&(t=1),this.getTextAndIconPosition(t).icon},e.prototype.drawTextShape=function(){var t=this.getFormattedFieldValue().formattedValue,e=this.getMaxTextWidth(),n=this.getTextStyle(),r=this.spreadsheet,i=r.options.placeholder,o=r.measureTextWidth,a=Wx(this,i),s=zx({measureTextWidth:o,text:t,maxWidth:e,fontParam:n,placeholder:a});this.actualText=s,this.actualTextWidth=o(s,n);var l=this.getTextPosition();this.textShape=hx(this,[this.textShape],l.x,l.y,s,n)},e.prototype.drawLinkFieldShape=function(t,e){if(t){if(!Cw(this.spreadsheet.options.style.device)){var n=this.getTextStyle(),r=this.getTextPosition().x;"center"===n.textAlign?r-=this.actualTextWidth/2:"right"===n.textAlign&&(r-=this.actualTextWidth);var i=this.textShape.getBBox().maxY;this.linkFieldShape=dx(this,{x1:r,y1:i+1,x2:r+this.actualTextWidth,y2:i+1},{stroke:e,lineWidth:1})}this.textShape.attr({fill:e,cursor:"pointer",appendInfo:{isLinkFieldText:!0,cellData:this.meta}})}},e.prototype.updateByState=function(t,e){var n=this;this.spreadsheet.interaction.setInteractedCells(e),Tf(Su(this.theme,"".concat(this.cellType,".cell.interactionState.").concat(t)),(function(t,e){Wl(ng(LC,(function(t){return Op(t,e)}))).forEach((function(r){var i=n.stateShapes.has(r),o=i?n.stateShapes.get(r):n[r];(i&&!o.get("visible")&&o.set("visible",!0),"interactiveBorderShape"===r&&"borderWidth"===e)&&(uv(t)&&Tf(n.getInteractiveBorderShapeStyle(t),(function(t,e){fx(o,e,t)})));fx(o,TC[e],t)}))}))},e.prototype.getInteractiveBorderShapeStyle=function(t){var e=this.getCellArea(),n=e.x,r=e.y,i=e.height,o=e.width,a=this.theme.dataCell.cell,s=a.horizontalBorderWidth,l=a.verticalBorderWidth;return{x:n+l/2+t/2,y:r+s/2+t/2,width:o-l-t,height:i-s-t}},e.prototype.hideInteractionShape=function(){this.stateShapes.forEach((function(t){fx(t,TC.backgroundOpacity,0),fx(t,TC.backgroundColor,"transparent"),fx(t,TC.borderOpacity,0),fx(t,TC.borderWidth,1),fx(t,TC.borderColor,"transparent")}))},e.prototype.clearUnselectedState=function(){fx(this.backgroundShape,TC.backgroundOpacity,1),fx(this.textShape,TC.textOpacity,1),fx(this.linkFieldShape,TC.opacity,1)},e.prototype.getTextShape=function(){return this.textShape},e}(xi),TS=function(t,e){return e?e(t[fo],t.$$value$$):t.$$value$$},LS=function(t,e){var n=e.getMeta().id;return t.some((function(t){return av(t.id,n)}))},IS=function(t,e){return"".concat(t,"-").concat(e)},OS=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),Object.defineProperty(n.prototype,"cellConditions",{get:function(){return this.conditions},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cellType",{get:function(){return t.CellTypes.DATA_CELL},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"valueRangeByField",{get:function(){return this.spreadsheet.dataSet.getValueRangeByField(this.meta.valueField)},enumerable:!1,configurable:!0}),n.prototype.handleByStateName=function(t,e){LS(t,this)&&this.updateByState(e)},n.prototype.handleSearchResult=function(e){LS(e,this)&&($f(e,(function(t){return null==t?void 0:t.isTarget})).id===this.getMeta().id?this.updateByState(t.InteractionStateName.HIGHLIGHT):this.updateByState(t.InteractionStateName.SEARCH_RESULT))},n.prototype.handleSelect=function(e){var n;switch(null===(n=null==e?void 0:e[0])||void 0===n?void 0:n.type){case t.CellTypes.COL_CELL:this.changeRowColSelectState("colIndex");break;case t.CellTypes.ROW_CELL:this.changeRowColSelectState("rowIndex");break;case t.CellTypes.DATA_CELL:LS(e,this)?this.updateByState(t.InteractionStateName.SELECTED):this.spreadsheet.options.interaction.selectedCellsSpotlight&&this.updateByState(t.InteractionStateName.UNSELECTED)}},n.prototype.handleHover=function(e){var n=rp(e);if(n.type===t.CellTypes.DATA_CELL){if(this.spreadsheet.options.interaction.hoverHighlight){var r=this.meta.colIndex,i=this.meta.rowIndex;r===(null==n?void 0:n.colIndex)||i===(null==n?void 0:n.rowIndex)?this.updateByState(t.InteractionStateName.HOVER):this.hideInteractionShape()}av(n.id,this.getMeta().id)&&this.updateByState(t.InteractionStateName.HOVER_FOCUS)}else this.hideInteractionShape()},n.prototype.update=function(){var e=this.spreadsheet.interaction.getCurrentStateName(),n=this.spreadsheet.interaction.getCells();if(e!==t.InteractionStateName.ALL_SELECTED){if(!ov(n)&&e)switch(e){case t.InteractionStateName.SELECTED:this.handleSelect(n);break;case t.InteractionStateName.HOVER_FOCUS:case t.InteractionStateName.HOVER:this.handleHover(n);break;case t.InteractionStateName.SEARCH_RESULT:this.handleSearchResult(n);break;default:this.handleByStateName(n,e)}}else this.updateByState(t.InteractionStateName.SELECTED)},n.prototype.setMeta=function(t){e.prototype.setMeta.call(this,t),this.initCell()},n.prototype.initCell=function(){this.conditions=this.spreadsheet.options.conditions,this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.shouldHideRowSubtotalData()||(this.drawConditionIntervalShape(),this.drawTextShape(),this.drawConditionIconShapes()),this.drawInteractiveBorderShape(),this.meta.isFrozenCorner&&this.drawBorderShape(),this.update()},n.prototype.getTextStyle=function(){var t,e,n=this.meta.isTotals?this.theme.dataCell.bolderText:this.theme.dataCell.text,r=n.fill,i=this.findFieldCondition(null===(t=this.conditions)||void 0===t?void 0:t.text);return(null==i?void 0:i.mapping)&&(r=(null===(e=this.mappingValue(i))||void 0===e?void 0:e.fill)||n.fill),UC(UC({},n),{fill:r})},n.prototype.getIconStyle=function(){var t,e=this.theme.dataCell.icon,n=e.size,r=e.margin,i=this.findFieldCondition(null===(t=this.conditions)||void 0===t?void 0:t.icon);return i&&i.mapping&&{size:n,margin:r,position:yx(i)}},n.prototype.shouldHideRowSubtotalData=function(){var t,e=(null!==(t=this.spreadsheet.options.totals)&&void 0!==t?t:{}).row,n=void 0===e?{}:e,r=this.meta.rowIndex,i=this.spreadsheet.facet.layoutResult.rowLeafNodes[r],o=!(null==i?void 0:i.isGrandTotals)&&(null==i?void 0:i.isTotals);return"tree"===this.spreadsheet.options.hierarchyType&&!n.showSubTotals&&o},n.prototype.getFormattedFieldValue=function(){var t=this.meta,e=t.rowId,n=t.valueField,r=t.fieldValue,i=t.data,o=this.spreadsheet.dataSet.getFieldMeta(e)?e:n;return{value:r,formattedValue:this.spreadsheet.dataSet.getFieldFormatter(o)(r,i,this.meta)}},n.prototype.getMaxTextWidth=function(){var t=this.getContentArea().width;return Ix(t,this.getIconStyle())},n.prototype.getTextPosition=function(){return this.getTextAndIconPosition().text},n.prototype.drawConditionIconShapes=function(){var t,e=this.findFieldCondition(null===(t=this.conditions)||void 0===t?void 0:t.icon);if(e&&e.mapping){var n=this.mappingValue(e),r=this.getIconPosition(),i=this.theme.dataCell.icon.size;ov(null==n?void 0:n.icon)||(this.conditionIconShape=px(this,UC(UC({},r),{name:n.icon,width:i,height:i,fill:n.fill})))}},n.prototype.drawConditionIntervalShape=function(){this.conditionIntervalShape=Ex(this)},n.prototype.getBackgroundColor=function(){var t,e=this.getStyle().cell,n=e.crossBackgroundColor,r=e.backgroundColorOpacity,i=this.getStyle().cell.backgroundColor;if(n&&this.meta.rowIndex%2==0&&(i=n),this.shouldHideRowSubtotalData())return{backgroundColor:i,backgroundColorOpacity:r};var o=this.findFieldCondition(null===(t=this.conditions)||void 0===t?void 0:t.background);if(o&&o.mapping){var a=this.mappingValue(o);a&&(i=a.fill)}return{backgroundColor:i,backgroundColorOpacity:r}},n.prototype.drawBackgroundShape=function(){var t=this.getBackgroundColor(),e=t.backgroundColor,n=t.backgroundColorOpacity;this.backgroundShape=sx(this,UC(UC({},this.getCellArea()),{fill:e,fillOpacity:n}))},n.prototype.drawInteractiveBorderShape=function(){var t=this.getCellArea(),e=t.x,n=t.y,r=t.height,i=t.width;this.stateShapes.set("interactiveBorderShape",sx(this,{x:e+1,y:n+1,width:i-2,height:r-2},{visible:!1}))},n.prototype.drawInteractiveBgShape=function(){this.stateShapes.set("interactiveBgShape",sx(this,UC({},this.getCellArea()),{visible:!1}))},n.prototype.changeRowColSelectState=function(e){var n=this.spreadsheet.interaction,r=Su(this.meta,e),i=n.getState(),o=i.nodes,a=void 0===o?[]:o,s=i.cells,l=void 0===s?[]:s;XC(XC([],VC(a),!1),VC(l),!1).find((function(t){return Su(t,e)===r}))?this.updateByState(t.InteractionStateName.SELECTED):this.spreadsheet.options.interaction.selectedCellsSpotlight?this.updateByState(t.InteractionStateName.UNSELECTED):this.hideInteractionShape()},n.prototype.drawBorderShape=function(){var e=this;[t.CellBorderPosition.BOTTOM,t.CellBorderPosition.RIGHT].forEach((function(t){var n=Bx(t,e.getCellArea(),e.getStyle().cell),r=n.position,i=n.style;dx(e,r,i)}))},n.prototype.findFieldCondition=function(t){var e=this;return np(t,(function(t){return t.field instanceof RegExp?t.field.test(e.meta.valueField):t.field===e.meta.valueField}))},n.prototype.mappingValue=function(t){var e=this.meta.fieldValue;return null==t?void 0:t.mapping(e,this.meta.data)},n.prototype.updateByState=function(n){if(e.prototype.updateByState.call(this,n,this),n===t.InteractionStateName.UNSELECTED){var r=Su(this.theme,"".concat(this.cellType,".cell.interactionState.").concat(n));r&&(fx(this.conditionIntervalShape,TC.backgroundOpacity,r.backgroundOpacity),fx(this.conditionIconShape,TC.opacity,r.opacity))}},n.prototype.clearUnselectedState=function(){e.prototype.clearUnselectedState.call(this),fx(this.conditionIntervalShape,TC.backgroundOpacity,1),fx(this.conditionIconShape,TC.opacity,1)},n.prototype.drawLeftBorder=function(){var e=Bx(t.CellBorderPosition.LEFT,this.getCellArea(),this.getStyle().cell);dx(this,e.position,e.style)},n}(bS),RS=function(e){function n(t,n,r){return e.call(this,r,t,n)||this}return GC(n,e),n.prototype.handleRestOptions=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=VC(t,1),r=n[0];this.cells=r},Object.defineProperty(n.prototype,"cellType",{get:function(){return t.CellTypes.MERGED_CELL},enumerable:!1,configurable:!0}),n.prototype.update=function(){},n.prototype.initCell=function(){this.conditions=this.spreadsheet.options.conditions,this.drawBackgroundShape(),this.drawTextShape()},n.prototype.drawBackgroundShape=function(){var t=NS(this.cells),e=this.theme.dataCell.cell;this.backgroundShape=lx(this,{points:t,stroke:e.horizontalBorderColor,fill:e.backgroundColor,lineHeight:e.horizontalBorderWidth})},n.prototype.drawTextShape=function(){ov(this.meta)||(_a(this.meta.fieldValue)?Ux(this):e.prototype.drawTextShape.call(this))},n}(OS),AS=function(t,e,n,r){var i=[t,e],o=[t+n,e],a=[t+n,e+r],s=[t,e+r];return[[i,o],[o,a],[a,s],[s,i]]},MS=function(t){var e=[];return Tf(t,(function(n){var r=[n[1],n[0]];JSON.stringify(t).includes(JSON.stringify(r))||e.push(n)})),e},BS=function(t,e){return $f(e,(function(e){return av(e[0],t[1])}))},NS=function(t){var e=[];t.forEach((function(t){var n=t.getMeta(),r=n.x,i=n.y,o=n.width,a=n.height;e=e.concat(AS(r,i,o,a))}));for(var n=[],r=(e=MS(e))[0],i=r,o=[];!av(r,o);)n=n.concat(i),i=o=BS(i,e);return n},DS=function(t,e){var n,r=[];return Tf(t,(function(t){var i,o,a,s=null===(o=null===(i=null==e?void 0:e.facet)||void 0===i?void 0:i.layoutResult)||void 0===o?void 0:o.getCellMeta(t.rowIndex,t.colIndex);if(s){var l=null===(a=null==e?void 0:e.facet)||void 0===a?void 0:a.cfg.dataCell(s);n=(null==t?void 0:t.showText)?s:n,r.push(l)}})),{cells:r,cellsMeta:n}},PS=function(t,e){var n,r=[],i=[];return Tf(t,(function(t){var o=$f(e,(function(e){var n,r=null===(n=null==e?void 0:e.getMeta)||void 0===n?void 0:n.call(e);if((null==r?void 0:r.colIndex)===(null==t?void 0:t.colIndex)&&(null==r?void 0:r.rowIndex)===(null==t?void 0:t.rowIndex))return e}));o?(r.push(o),n=(null==t?void 0:t.showText)?null==o?void 0:o.getMeta():n):i.push(t)})),{cells:r,invisibleCellInfo:i,cellsMeta:n}},kS=function(t,e,n){var r;void 0===n&&(n=[]);var i=PS(n,t),o=i.cellsMeta,a=i.cells,s=i.invisibleCellInfo,l=o,u=a;if((null==s?void 0:s.length)>0&&s.length<n.length){var c=DS(s,e),h=c.cells,d=c.cellsMeta;l=l||d,u=a.concat(h)}return ov(a)||l||(l=null===(r=u[0])||void 0===r?void 0:r.getMeta()),{cells:u,viewMeta:l}},zS=function(t){var e=t.interaction.getActiveCells(),n=[];return Tf(e,(function(t,e){var r=t.getMeta(),i=0===e?{showText:!0}:{};n.push(UC(UC({},i),{colIndex:null==r?void 0:r.colIndex,rowIndex:null==r?void 0:r.rowIndex}))})),n},FS=function(t,e,n){var r,i=e||zS(t);if((null==i?void 0:i.length)<=1)console.error("then merged cells must be more than one");else{var o=t.interaction.getPanelGroupAllDataCells(),a=kS(o,t,i),s=a.cells,l=a.viewMeta;if(!ov(s)){var u=(null===(r=t.options)||void 0===r?void 0:r.mergedCellsInfo)||[];u.push(i),t.setOptions({mergedCellsInfo:u});var c=n?void 0:l;t.panelScrollGroup.addMergeCell(new RS(t,s,c))}}},HS=function(t,e){var n=op(t.cells,(function(t){return{colIndex:t.getMeta().colIndex,rowIndex:t.getMeta().rowIndex}}));return Xf(e,(function(t){return!av(t.map((function(t){return t.showText?{colIndex:t.colIndex,rowIndex:t.rowIndex}:t})),n)}))},WS=function(e,n){var r,i,o;if(n&&n.cellType===t.CellTypes.MERGED_CELL){var a=HS(n,null===(r=e.options)||void 0===r?void 0:r.mergedCellsInfo);(null==a?void 0:a.length)!==(null===(o=null===(i=e.options)||void 0===i?void 0:i.mergedCellsInfo)||void 0===o?void 0:o.length)&&(e.setOptions({mergedCellsInfo:a}),n.remove(!0))}else console.error("unmergeCell: the ".concat(n," is not a MergedCell"))},GS=function(t){return op(t,(function(t){return{cells:t.cells,viewMeta:t.getMeta()}}))},US=function(t,e){return Sf(t,e,(function(t,e){return av(t.viewMeta.id,e.viewMeta.id)}))},YS=function(t,e){var n,r=null===(n=t.options)||void 0===n?void 0:n.mergedCellsInfo;if(!ov(r)){var i=t.interaction.getPanelGroupAllDataCells();if(!ov(i)){var o=[];r.forEach((function(e){var n=kS(i,t,e);n.cells.length>0&&o.push(n)}));var a=e.getChildren(),s=GS(a),l=US(s,o),u=US(o,s);Tf(l,(function(t){var e=$f(a,(function(e){return av(e.getMeta().id,t.viewMeta.id)}));null==e||e.remove(!0)})),Tf(u,(function(n){var r=n.cells,i=n.viewMeta;e.add(new RS(t,r,i))}))}}},jS=function(t){return t.includes(Go)?"id":"field"},VS=function(t,e){void 0===e&&(e=[]);var n=t.getInitColumnLeafNodes();return ed(e.map((function(t){var e=jS(t);return n.find((function(n){return n[e]===t}))})))},XS=function(e,n,r){void 0===n&&(n=[]),void 0===r&&(r=!1);var i=function(t,n){void 0===t&&(t=[]),void 0===n&&(n=[]),e.setOptions({interaction:{hiddenColumnFields:t}}),e.interaction.reset(),e.store.set("hiddenColumnsDetail",n),e.render(!1,{reBuildHiddenColumnsDetail:!1})};if(ov(n)&&r)i();else{var o=e.store.get("hiddenColumnsDetail",[]),a=e.options.interaction.hiddenColumnFields;if(!av(n,a)||r){var s=Lm(XC(XC([],VC(n),!1),VC(a),!1)),l=function(t,e){if(void 0===e&&(e=[]),ov(e))return{prev:null,next:null};var n=t.getInitColumnLeafNodes(),r=VS(t,e).map((function(t){return null==t?void 0:t.colIndex})),i=Math.max.apply(Math,XC([],VC(r),!1)),o=Math.min.apply(Math,XC([],VC(r),!1)),a=n.find((function(t){return t.colIndex===i+1}));return{prev:n.find((function(t){return t.colIndex===o-1}))||null,next:a||null}}(e,n),u={hideColumnNodes:VS(e,n),displaySiblingNode:l},c=XC(XC([],VC(o),!1),[u],!1);e.emit(t.S2Event.LAYOUT_COLS_HIDDEN,u,c),i(s,c)}}},KS=function(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=!1),ov(e)&&n&&XS(t,e,!0);var r=function(t){var e=t.dataCfg.fields.columns,n=void 0===e?[]:e;return t.isTableMode()?n:t.getInitColumnLeafNodes().map((function(t){return t.id}))}(t),i=function(t,e){if(ov(e))return[];var n=Number.NEGATIVE_INFINITY;return t.reduce((function(t,r,i){if(!e.includes(r))return t;if(i===n+1)mf(t).push(r);else{var o=[r];t.push(o)}return n=i,t}),[])}(r,e);i.forEach((function(e){XS(t,e,n)}))},qS=function(t,e){return function(t){var e=function(t){return(null==t?void 0:t.next)||(null==t?void 0:t.prev)}(t);return null==e?void 0:e.id}(t)===e},ZS=function(e){var n=e.type,r=e.id,i=e.theme,o=e.width,a=e.height,s=YC(e,["type","id","theme","width","height"]),l=n===t.ResizeDirectionType.Horizontal?i.size:null,u=n===t.ResizeDirectionType.Vertical?i.size:null;return{fill:i.background,fillOpacity:i.backgroundOpacity,cursor:"".concat(n,"-resize"),width:l,height:u,appendInfo:UC(UC({},s),{isResizeArea:!0,type:n,id:r,width:o,height:a,size:i.size})}},$S=function(t,e){if(t.foregroundGroup)return t.foregroundGroup.findById(e)||t.foregroundGroup.addGroup({id:e,zIndex:5})},QS=function(t,e,n){var r=null!=n?n:{},i=r.scrollX,o=void 0===i?0:i,a=r.scrollY,s=void 0===a?0:a,l=!(t.x-o>e.x+e.width||t.x+t.width-o<e.x),u=!(t.y-s>e.y+e.height||t.y+t.height-s<e.y);return l&&u},JS=function(t,e,n){var r=$f(t,(function(t){return function(t,e,n){if(!t)return!1;var r=t.iconNames,i=t.displayCondition,o=t.belongsCell;return!ov(r)&&o===n&&(!i||r.some((function(t){return i(e,t)})))}(t,e,n)}));if(r){var i=r.iconNames;return r.displayCondition&&(i=i.filter((function(t){return r.displayCondition(e,t)}))),UC(UC({},r),{iconNames:i})}},tE=function(t,e){var n=t.label;return av(t.field,fo)?{formattedValue:e||n,value:n}:{formattedValue:n,value:n}};function eE(t,e){return e.map((function(e){var n=t[e];return void 0===n?n:"".concat(n)}))}function nE(t){return t.map((function(t){var e=null==t?void 0:t.split(Go);return e[(null==e?void 0:e.length)-1]||t}))}function rE(t){var e=t.rowDimensionValues,n=t.colDimensionValues,r=t.careUndefined,i=t.isFirstCreate,o=t.onFirstCreate,a=t.rowFields,s=t.colFields,l=t.rowPivotMeta,u=t.colPivotMeta,c=function(t,e,n,l){void 0===e&&(e=!0);for(var u=e?n:l,c=e?a:s,h=[],d=0;d<t.length;d++){var f=t[d];if(!u.has(f))if(i)u.set(f,{level:u.size,children:new Map}),null==o||o({isRow:e,dimension:null==c?void 0:c[d],dimensionPath:t.slice(0,d+1)});else{var p=u.get(f);if(p&&h.push(p.level),!r)break}var v=u.get(f);gv(f)&&r?h.push(f):h.push(null==v?void 0:v.level),v&&(i&&(v.childField=null==c?void 0:c[d+1]),u=null==v?void 0:v.children)}return h},h=c(e,!0,l,u),d=c(n,!1,l,u);return h.concat.apply(h,XC([],VC(d),!1))}function iE(t,e){return dy(t,(function(t,n){return t.push(e[n]),t}),[])}function oE(t){var e=t.rows,n=t.columns,r=t.originData,i=void 0===r?[]:r,o=t.indexesData,a=void 0===o?[]:o,s=t.totalData,l=void 0===s?[]:s,u=t.sortedDimensionValues,c=t.rowPivotMeta,h=t.colPivotMeta,d=[],f=new Set(Dp(e,n)),p=function(t){var e=t.isRow,n=t.dimension,r=t.dimensionPath;!e&&f.has(n)||(u[n]||(u[n]=[])).push(r.map((function(t){return"".concat(t)})).join(Go))};return i.concat(l).forEach((function(t){var r=rE({rowDimensionValues:eE(t,e),colDimensionValues:eE(t,n),rowPivotMeta:c,colPivotMeta:h,isFirstCreate:!0,onFirstCreate:p,careUndefined:(null==l?void 0:l.length)>0,rowFields:e,colFields:n});d.push(r),Ey(a,r,t)})),{paths:d,indexesData:a,rowPivotMeta:c,colPivotMeta:h,sortedDimensionValues:u}}function aE(t,e){if(t&&e){var n=e.split(Go),r=mf(n),i=t;Tf(n,(function(t,e){var n=i.get(t);return n?(t===r?(n.children=new Map,n.childField=void 0):i=n.children,!0):0===e&&t===Wo}))}}var sE=function(t){return"ASC"===hm(t)},lE=function(t){return"DESC"===hm(t)},uE=function(t){return!cv(Number(t))},cE=function(t,e,n){var r=sE(e)?1:-1,i=["-",void 0];return null==t?void 0:t.sort((function(t,e){var o=t,a=e;if(n){if(o=t[n],a=e[n],uE(o)&&uE(a))return(Number(o)-Number(a))*r;if(o&&(null==i?void 0:i.includes(null==o?void 0:o.toString())))return-r;if(Number(o)&&(null==i?void 0:i.includes(null==a?void 0:a.toString())))return r}return dv(o)||dv(a)?o?r:-r:o.toString().localeCompare(a.toString(),"zh")*r}))},hE=function(t,e,n){return n?function(t,e){var n;return null===(n=null==t?void 0:t.filter((function(t){return!(null==e?void 0:e.includes(t))})))||void 0===n?void 0:n.concat(e)}(e,Lm(t)):XC([],VC(new Set(XC(XC([],VC(t),!1),VC(e),!1))),!1)},dE=function(t){var e=t.sortByValues,n=t.originValues,r=n.filter((function(t){return e.find((function(e){return Mf(t,e)}))})).map((function(t){var e=t.split(Go);return e.length>1?[e.slice(0,e.length-1).join(Go),e[e.length-1]]:e})),i=Array.from(new Set(r.map((function(t){return t[0]}))));r.sort((function(t,n){var r=t.slice(0,t.length-1),o=n.slice(0,n.length-1);return r.join()!==o.join()?i.indexOf(r[0])-i.indexOf(o[0]):e.indexOf(t[t.length-1])-e.indexOf(n[n.length-1])}));var o=r.map((function(t){return t.join(Go)}));return $w(n,o)},fE=function(t){var e=t.originValues,n=t.measureValues,r=t.sortParam,i=t.dataSet,o=r.sortFunc,a=r.sortFieldId,s=r.sortMethod,l=o(UC({data:n},r));return(null==l?void 0:l.length)?(i.fields.rows.indexOf(a)>0||i.fields.columns.indexOf(a)>0)&&!Op(l[0],Go)?dE({sortByValues:l,originValues:e}):hE(l,e,sE(s)):e},pE=function(t){var e,n=t.sortParam,r=t.measureValues,i=t.originValues,o=t.dataSet,a=n.sortByMeasure,s=n.query,l=n.sortFieldId,u=n.sortMethod,c=o.fields,h=c.rows,d=c.columns,f=h.includes(l);a?e=function(t,e,n){var r,i=e.slice(0,e.indexOf(t)+1);return null===(r=n.map((function(t){return i.map((function(e){return t[e]})).join("".concat(Go))})))||void 0===r?void 0:r.filter((function(t){return t}))}(l,f?h:d,cE(r,u,a===vo?s[fo]:a)):e=op(cE(r,u));return hE(e,i,sE(u))},vE=function(t){var e=t.sortParam,n=t.originValues,r=t.measureValues,i=t.dataSet,o=e.sortFunc,a=e.sortMethod,s=e.sortBy,l=n,u={originValues:n,measureValues:r,sortParam:e,dataSet:i};return o?l=fE(u):s?l=dE({sortByValues:s,originValues:n}):(sE(a)||lE(a))&&(l=pE(u)),l},gE=function(t){return t.filter((function(t){return t!==fo}))},yE=function(t){var e=t.dataSet,n=t.sortParam,r=t.originValues,i=e.fields,o=n.sortByMeasure,a=n.query,s=n.sortFieldId,l=e.getMultiData(a);if(o!==vo){var u=nd(i.rows,i.columns);return l.filter((function(t){var e=new Set(Wl(t));return u.every((function(t){return e.has(t)}))}))}var c=Op(i.rows,s),h=gE(c?i.rows:i.columns),d=gE(c?i.columns:i.rows),f=h[h.indexOf(s)+1],p=Wl(a),v=d.filter((function(t){return!p.includes(t)})),g=l.filter((function(t){var e=new Set(Wl(t));return!!e.has(s)&&(!e.has(f)&&v.every((function(t){return!e.has(t)})))}));return ov(g)?ed(op(r,(function(t){var n=function(t,e,n){var r,i={};if(Op(t,Go))for(var o=ky(t,Go),a=(null===(r=null==e?void 0:e.rows)||void 0===r?void 0:r.includes(n))?e.rows:e.columns,s=0;s<=Ap(a,n);s++)i[a[s]]=o[s];else i[n]=t;return i}(t,i,s);return e.getTotalValue(UC(UC({},a),n))}))):g},mE=function(t){var e,n=t.dataSet,r=t.sortParam,i=t.originValues;return e=t.isSortByMeasure?yE(t):i,vE({sortParam:r,originValues:i,measureValues:e,dataSet:n})},CE=function(t,e){if(null==t?void 0:t.sortMethod){if(sE(null==t?void 0:t.sortMethod))return"groupAsc";if(lE(null==t?void 0:t.sortMethod))return"groupDesc"}if(e)return"SortDown"},wE=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),n.prototype.handleRestOptions=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=VC(t,1),r=n[0];this.headerConfig=UC({},r);var i=this.meta,o=i.value,a=i.query,s=this.spreadsheet.dataCfg.sortParams,l=this.isSortCell(),u=$f(XC([],VC(s),!1).reverse(),(function(t){return l&&(null==t?void 0:t.sortByMeasure)===o&&av(Su(t,"query"),a)})),c=CE(u,l);this.headerConfig.sortParam=UC(UC(UC({},this.headerConfig.sortParam),u||{query:a}),{type:c})},n.prototype.initCell=function(){this.actionIcons=[],this.hasDefaultHiddenIcon=!1},n.prototype.getInteractiveBorderShapeStyle=function(t){var e=this.getCellArea(),n=e.x,r=e.y,i=e.height;return{x:n+t,y:r+t,width:e.width-2*t,height:i-2*t}},n.prototype.getFormattedFieldValue=function(){var t=this.meta.label,e=this.spreadsheet.dataSet.getFieldFormatter(this.meta.field),n=this.spreadsheet.isTableMode();return{formattedValue:e&&!n?e(t,void 0,this.meta):t,value:t}},n.prototype.getActionIconCfg=function(){return JS(this.spreadsheet.options.headerActionIcons,this.meta,this.cellType)},n.prototype.showSortIcon=function(){var t=this.spreadsheet,e=t.options,n=ov(t.dataCfg.fields.values);if(e.showDefaultHeaderActionIcon&&!n){var r=this.headerConfig.sortParam,i=this.meta.query;return i&&av(null==r?void 0:r.query,i)&&(null==r?void 0:r.type)&&"none"!==(null==r?void 0:r.type)}return!1},n.prototype.getActionIconsCount=function(){if(this.showSortIcon())return 1;var t=this.getActionIconCfg();return t?t.iconNames.length:0},n.prototype.getActionIconsWidth=function(){var t=this.getStyle().icon;return(t.size+t.margin.left)*this.getActionIconsCount()},n.prototype.drawSortIcons=function(){var e=this;if(this.showSortIcon()){var n=this.getStyle(),r=n.icon,i=n.text,o=this.headerConfig.sortParam,a=this.getIconPosition(),s=new qw(UC(UC({name:Su(o,"type","none")},a),{width:r.size,height:r.size,fill:i.fill}));s.on("click",(function(n){e.spreadsheet.emit(t.S2Event.GLOBAL_ACTION_ICON_CLICK,n),e.spreadsheet.handleGroupSort(n,e.meta)})),this.add(s),this.actionIcons.push(s)}},n.prototype.hasDefaultHideActionIcon=function(){return this.hasDefaultHiddenIcon},n.prototype.addActionIcon=function(e){var n=this,r=e.x,i=e.y,o=e.iconName,a=e.defaultHide,s=e.action,l=e.onClick,u=e.onHover,c=this.getStyle(),h=c.icon,d=c.text,f=(null==h?void 0:h.fill)||(null==d?void 0:d.fill),p=new qw({name:o,x:r,y:i,width:null==h?void 0:h.size,height:null==h?void 0:h.size,fill:f});p.set("visible",!a),p.on("mouseover",(function(e){n.spreadsheet.emit(t.S2Event.GLOBAL_ACTION_ICON_HOVER,e),null==u||u({hovering:!0,iconName:o,meta:n.meta,event:e})})),p.on("mouseleave",(function(e){n.spreadsheet.emit(t.S2Event.GLOBAL_ACTION_ICON_HOVER_OFF,e),null==u||u({hovering:!1,iconName:o,meta:n.meta,event:e})})),p.on("click",(function(e){var r;n.spreadsheet.emit(t.S2Event.GLOBAL_ACTION_ICON_CLICK,e),null===(r=l||s)||void 0===r||r({iconName:o,meta:n.meta,event:e})})),this.actionIcons.push(p),this.add(p)},n.prototype.drawActionIcons=function(){var t=this;if(this.showSortIcon())this.drawSortIcons();else{var e=this.getActionIconCfg();if(e){var n=e.iconNames,r=e.action,i=e.onClick,o=e.onHover,a=e.defaultHide,s=this.getIconPosition(n.length),l=this.getStyle().icon,u=l.size,c=l.margin;Tf(n,(function(e,n){var l=s.x+n*u+n*c.left,h=s.y,d="function"==typeof a?a(t.meta,e):a;d&&(t.hasDefaultHiddenIcon=!0),t.addActionIcon({iconName:e,x:l,y:h,defaultHide:d,action:r,onClick:i,onHover:o})}))}}},n.prototype.isSortCell=function(){var e,n,r,i=null===(n=null===(e=this.meta.spreadsheet)||void 0===e?void 0:e.isValueInCols)||void 0===n?void 0:n.call(e),o=this.meta.level===(null===(r=this.meta.hierarchy)||void 0===r?void 0:r.maxLevel);return i?o&&this.cellType===t.CellTypes.COL_CELL:o&&this.cellType===t.CellTypes.ROW_CELL},n.prototype.handleByStateName=function(t,e){LS(t,this)&&this.updateByState(e)},n.prototype.handleSearchResult=function(e){LS(e,this)&&($f(e,(function(t){return null==t?void 0:t.isTarget})).id===this.getMeta().id?this.updateByState(t.InteractionStateName.HIGHLIGHT):this.updateByState(t.InteractionStateName.SEARCH_RESULT))},n.prototype.handleHover=function(e){var n;LS(e,this)&&(this.updateByState(t.InteractionStateName.HOVER),this.hasDefaultHideActionIcon()&&this.toggleActionIcon(null===(n=null==e?void 0:e[0])||void 0===n?void 0:n.id))},n.prototype.handleSelect=function(e,n){LS(e,this)&&this.updateByState(t.InteractionStateName.SELECTED),Op(op(n,"id"),this.meta.id)&&this.updateByState(t.InteractionStateName.SELECTED)},n.prototype.toggleActionIcon=function(t){if(this.getMeta().id===t){var e=[];Tf(this.actionIcons,(function(t){t.get("visible")||(t.set("visible",!0),e.push(t))})),this.spreadsheet.store.set("visibleActionIcons",e)}},n.prototype.update=function(){var e=this.spreadsheet.interaction,n=null==e?void 0:e.getState(),r=null==e?void 0:e.getCells();if(rp(r))switch(null==n?void 0:n.stateName){case t.InteractionStateName.SELECTED:this.handleSelect(r,null==n?void 0:n.nodes);break;case t.InteractionStateName.HOVER_FOCUS:case t.InteractionStateName.HOVER:this.handleHover(r);break;case t.InteractionStateName.SEARCH_RESULT:this.handleSearchResult(r);break;default:this.handleByStateName(r,null==n?void 0:n.stateName)}},n.prototype.updateByState=function(t){e.prototype.updateByState.call(this,t,this)},n.prototype.hideInteractionShape=function(){e.prototype.hideInteractionShape.call(this)},n.prototype.isMeasureField=function(){return[fo,po].includes(this.meta.field)},n}(bS),xE=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),Object.defineProperty(n.prototype,"cellType",{get:function(){return t.CellTypes.COL_CELL},enumerable:!1,configurable:!0}),n.prototype.initCell=function(){e.prototype.initCell.call(this),this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.drawInteractiveBorderShape(),this.drawTextShape(),this.drawActionIcons(),this.drawBorders(),this.drawResizeArea(),this.addExpandColumnIconShapes(),this.update()},n.prototype.drawBackgroundShape=function(){var t=this.getStyle().cell,e=t.backgroundColor,n=t.backgroundColorOpacity;this.backgroundShape=sx(this,UC(UC({},this.getCellArea()),{fill:e,fillOpacity:n}))},n.prototype.drawInteractiveBgShape=function(){this.stateShapes.set("interactiveBgShape",sx(this,UC({},this.getCellArea()),{visible:!1}))},n.prototype.drawInteractiveBorderShape=function(){this.stateShapes.set("interactiveBorderShape",sx(this,this.getInteractiveBorderShapeStyle(2),{visible:!1}))},n.prototype.getTextStyle=function(){var t=this.meta,e=t.isLeaf,n=t.isTotals,r=this.getStyle(),i=r.text,o=r.bolderText,a=r.measureText;return this.isMeasureField()?a||i:n||!e?o:i},n.prototype.getMaxTextWidth=function(){return this.getContentArea().width-this.getActionIconsWidth()},n.prototype.getIconPosition=function(){if(this.meta.isLeaf)return e.prototype.getIconPosition.call(this,this.getActionIconsCount());var t=this.getIconStyle(),n=t.margin.left,r=this.getTextStyle(),i=this.textPosition,o=i.x,a=i.y-t.size/2;return"left"===r.textAlign?{x:o+this.actualTextWidth+n,y:a}:"right"===r.textAlign?{x:o+n,y:a}:{x:o+this.actualTextWidth/2+n,y:a}},n.prototype.getTextPosition=function(){var t,e=this.meta.isLeaf,n=this.headerConfig,r=n.width,i=n.scrollContainsRowHeader,o=n.cornerWidth,a=n.scrollX,s=this.getTextStyle(),l=this.getContentArea(),u=this.getIconStyle();if(e)return Rx(l,s,this.actualTextWidth,u,this.getActionIconsCount()).text;var c={start:a-(i?o:0),width:r+(i?o:0)},h=this.getTextStyle().textAlign,d=Nx(c,h,null===(t=this.getStyle().cell)||void 0===t?void 0:t.padding),f=this.getActionIconsWidth(),p=this.actualTextWidth+f,v=Mx(d,{start:l.x,width:l.width},p),g=Dx(v,this.actualTextWidth,f,h),y=l.y+l.height/2;return this.textPosition={x:g,y:y},this.textPosition},n.prototype.getActionIconsWidth=function(){var t=this.getStyle().icon,e=t.size,n=t.margin,r=this.getActionIconsCount();return(e+n.left)*r+(r>0?n.right:0)},n.prototype.getColResizeAreaKey=function(){return this.meta.key},n.prototype.getColResizeArea=function(){return $S(this.spreadsheet,Bo)},n.prototype.getHorizontalResizeAreaName=function(){return"".concat(Ho).concat(this.meta.key)},n.prototype.drawHorizontalResizeArea=function(){var e,n;if(!(0===(null===(n=null===(e=this.spreadsheet.options.style)||void 0===e?void 0:e.colCfg)||void 0===n?void 0:n.height))&&this.shouldDrawResizeAreaByType("colCellVertical",this)){var r=this.headerConfig,i=r.cornerWidth,o=r.viewportWidth,a=this.meta,s=a.y,l=a.height,u=this.getResizeAreaStyle(),c=this.getColResizeArea(),h=this.getHorizontalResizeAreaName();if(!c.find((function(t){return t.attrs.name===h}))){var d=i+o;c.addShape("rect",{attrs:UC(UC({},ZS({theme:u,type:t.ResizeDirectionType.Vertical,id:this.getColResizeAreaKey(),effect:t.ResizeAreaEffect.Field,offsetX:0,offsetY:s,width:d,height:l,meta:this.meta})),{name:h,x:0,y:s+l-u.size/2,width:d})})}}},n.prototype.shouldAddVerticalResizeArea=function(){var t=this.meta,e=t.x,n=t.y,r=t.width,i=t.height,o=this.headerConfig,a=o.scrollX,s=o.scrollY,l=o.scrollContainsRowHeader,u=o.cornerWidth,c=o.height,h=o.width,d=this.getResizeAreaStyle(),f={x:e+r-d.size/2,y:n,width:d.size,height:i};return QS(f,{x:l?-u:0,y:0,width:l?u+h:h,height:c},{scrollX:a,scrollY:s})},n.prototype.getVerticalResizeAreaOffset=function(){var t=this.meta,e=t.x,n=t.y,r=this.headerConfig,i=r.scrollX,o=r.position;return{x:o.x+e-i,y:o.y+n}},n.prototype.drawVerticalResizeArea=function(){if(this.meta.isLeaf&&this.shouldDrawResizeAreaByType("colCellHorizontal",this)){var e=this.meta,n=e.label,r=e.width,i=e.height,o=this.getResizeAreaStyle(),a=this.getColResizeArea();if(this.shouldAddVerticalResizeArea()){var s=this.getVerticalResizeAreaOffset(),l=s.x,u=s.y;a.addShape("rect",{attrs:UC(UC({},ZS({theme:o,type:t.ResizeDirectionType.Horizontal,effect:t.ResizeAreaEffect.Cell,id:n,offsetX:l,offsetY:u,width:r,height:i,meta:this.meta})),{x:l+r-o.size/2,y:u,height:i})})}}},n.prototype.drawResizeArea=function(){this.drawHorizontalResizeArea(),this.drawVerticalResizeArea()},n.prototype.drawHorizontalBorder=function(){var e=Bx(t.CellBorderPosition.TOP,this.meta,this.theme.colCell.cell);dx(this,e.position,e.style)},n.prototype.drawVerticalBorder=function(t){var e=Bx(t,this.meta,this.theme.colCell.cell);dx(this,e.position,e.style)},n.prototype.drawBorders=function(){var e=this.spreadsheet,n=e.options,r=e.isTableMode;0===this.meta.colIndex&&r()&&!n.showSeriesNumber&&this.drawVerticalBorder(t.CellBorderPosition.LEFT),this.drawHorizontalBorder(),this.drawVerticalBorder(t.CellBorderPosition.RIGHT)},n.prototype.hasHiddenColumnCell=function(){var t=this,e=this.spreadsheet.options,n=e.interaction.hiddenColumnFields,r=void 0===n?[]:n,i=e.tooltip.operation,o=this.spreadsheet.store.get("hiddenColumnsDetail",[]);return!(ov(o)||ov(r)||!i.hiddenColumns)&&!!o.find((function(e){return qS(null==e?void 0:e.displaySiblingNode,t.meta.id)}))},n.prototype.getExpandIconTheme=function(){return this.getStyle().icon},n.prototype.addExpandColumnSplitLine=function(){var t=this.meta,e=t.x,n=t.y,r=t.width,i=t.height,o=this.theme.splitLine,a=o.horizontalBorderColor,s=o.horizontalBorderWidth,l=o.horizontalBorderColorOpacity,u=this.isLastColumn()?e+r-s:e;dx(this,{x1:u,y1:n,x2:u,y2:n+i},{stroke:a,lineWidth:s,strokeOpacity:l})},n.prototype.addExpandColumnIconShapes=function(){this.hasHiddenColumnCell()&&(this.addExpandColumnSplitLine(),this.addExpandColumnIcon())},n.prototype.addExpandColumnIcon=function(){var e=this,n=this.getExpandColumnIconConfig();px(this,UC(UC({},n),{name:"ExpandColIcon",cursor:"pointer"})).on("click",(function(){e.spreadsheet.emit(t.S2Event.LAYOUT_COLS_EXPANDED,e.meta)}))},n.prototype.getExpandColumnIconConfig=function(){var t=this.getExpandIconTheme().size,e=this.getCellArea(),n=e.x,r=e.y,i=e.width,o=e.height,a=n-t;return{x:this.isLastColumn()?a+i:a,y:r+o/2-t/2,width:2*t,height:t}},n.prototype.isLastColumn=function(){return t=this.spreadsheet,e=this.meta.id,n=t.getColumnNodes(),r=t.getInitColumnLeafNodes(),i=jS(e),Su(mf(n),i)===e&&Su(mf(r),i)!==e;var t,e,n,r,i},n}(wE),SE=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.textShapes=[],t}return GC(n,e),Object.defineProperty(n.prototype,"cellType",{get:function(){return t.CellTypes.CORNER_CELL},enumerable:!1,configurable:!0}),n.prototype.update=function(){},n.prototype.initCell=function(){e.prototype.initCell.call(this),this.textShapes=[],this.drawBackgroundShape(),this.drawTreeIcon(),this.drawCellText(),this.drawActionIcons(),this.drawBorderShape(),this.drawResizeArea()},n.prototype.drawCellText=function(){var t=this.getContentArea().x,e=this.getCellArea(),n=e.y,r=e.height,i=this.getTextStyle(),o=this.getCornerText(),a=this.getMaxTextWidth(),s=Wx(this.meta,this.spreadsheet.options.placeholder),l=this.spreadsheet.measureTextWidth,u=zx({measureTextWidth:l,text:o,maxWidth:a,fontParam:i,placeholder:s});this.actualText=u;var c=u.indexOf("..."),h=u,d="";if(-1!==c&&this.spreadsheet.isHierarchyTreeType()){var f=c+(ww()?1:0);h=o.substr(0,f),d=o.slice(f),d=zx({measureTextWidth:l,text:d,maxWidth:a,fontParam:i})}var p=Ax({x:t+this.getTreeIconWidth(),y:n,width:a,height:r},i).x,v=n+(ov(d)?r/2:r/4);this.textShapes.push(hx(this,[this.textShapes[0]],p,v,h,i)),ov(d)||this.textShapes.push(hx(this,[this.textShapes[1]],p,n+.75*r,d,i)),this.actualTextWidth=Bv([l(h,i),l(d,i)])},n.prototype.drawTreeIcon=function(){var e=this;if(this.showTreeIcon()&&this.meta.cornerType!==t.CornerNodeType.Col){var n=this.headerConfig.hierarchyCollapse,r=this.getStyle().icon.size,i=this.getTextStyle(),o=i.textBaseline,a=i.fill,s=this.getContentArea();this.treeIcon=vx(this,{x:s.x,y:Ox(s,o,r),width:r,height:r},a,n,(function(){e.headerConfig.spreadsheet.store.set("scrollY",0),e.headerConfig.spreadsheet.emit(t.S2Event.LAYOUT_TREE_ROWS_COLLAPSE_ALL,n)}))}},n.prototype.drawBackgroundShape=function(){var t=this.getStyle().cell,e=t.backgroundColor,n=t.backgroundColorOpacity,r=UC(UC({},this.getCellArea()),{fill:e,fillOpacity:n});this.backgroundShape=sx(this,r)},n.prototype.drawBorderShape=function(){var e=this;[t.CellBorderPosition.TOP,t.CellBorderPosition.LEFT].forEach((function(t){var n=Bx(t,e.getCellArea(),e.getStyle().cell),r=n.position,i=n.style;dx(e,r,i)}))},n.prototype.isLastRowCornerCell=function(){var e=this.meta,n=e.cornerType,r=e.field,i=this.headerConfig.rows;return n===t.CornerNodeType.Row&&(this.spreadsheet.isHierarchyTreeType()||mf(i)===r)},n.prototype.getResizeAreaEffect=function(){return this.meta.cornerType===t.CornerNodeType.Series?t.ResizeAreaEffect.Series:this.isLastRowCornerCell()&&this.spreadsheet.isHierarchyTreeType()?t.ResizeAreaEffect.Tree:t.ResizeAreaEffect.Field},n.prototype.drawResizeArea=function(){if(this.shouldDrawResizeAreaByType("cornerCellHorizontal",this)){var e=this.getResizeAreaStyle(),n=$S(this.spreadsheet,Mo),r=this.headerConfig,i=r.position,o=r.scrollX,a=r.scrollY,s=r.width,l=r.height,u=this.meta,c=u.x,h=u.y,d=u.width,f=u.height,p=u.field,v=u.cornerType,g={x:c+d-e.size/2,y:h,width:e.size,height:f},y={x:0,y:0,width:s,height:l};if(v!==t.CornerNodeType.Col&&QS(g,y,{scrollX:o,scrollY:a})){var m=i.x+c-o,C=i.y+(this.isLastRowCornerCell()?0:h);n.addShape("rect",{attrs:UC(UC({},ZS({theme:e,id:p,type:t.ResizeDirectionType.Horizontal,effect:this.getResizeAreaEffect(),offsetX:m,offsetY:C,width:d,height:f,meta:this.meta})),{x:m+d-e.size/2,y:C,height:this.isLastRowCornerCell()?l:f})})}}},n.prototype.showTreeIcon=function(){var t;return this.headerConfig.spreadsheet.isHierarchyTreeType()&&0===(null===(t=this.meta)||void 0===t?void 0:t.x)},n.prototype.getIconPosition=function(){var t,e,n=null===(e=null===(t=this.textShapes)||void 0===t?void 0:t[0])||void 0===e?void 0:e.cfg.attrs,r=this.getTextStyle(),i=r.textBaseline,o=r.textAlign,a=this.getStyle().icon,s=a.size,l=a.margin;return{x:(null==n?void 0:n.x)+Rd([[Av("center"),Is(this.actualTextWidth/2)],[Av("right"),Is(0)],[Wy,Is(this.actualTextWidth)]])(o)+l.left,y:Ox(this.getContentArea(),i,s)}},n.prototype.getTreeIconWidth=function(){var t=this.getStyle().icon,e=t.size,n=t.margin;return this.showTreeIcon()?e+n.right:0},n.prototype.getTextStyle=function(){var e=this.meta.cornerType,n=this.getStyle(),r=n.text,i=n.bolderText,o=e===t.CornerNodeType.Col?r:i;return UC(UC({},o),{textBaseline:"middle"})},n.prototype.getMaxTextWidth=function(){return this.getContentArea().width-this.getTreeIconWidth()-this.getActionIconsWidth()},n.prototype.getTextPosition=function(){return{x:0,y:0}},n.prototype.getFormattedFieldValue=function(){return tE(this.meta,this.spreadsheet.dataSet.getFieldName(this.meta.label))},n.prototype.getCornerText=function(){var t;return av(this.meta.label,fo)?(null===(t=this.spreadsheet.options)||void 0===t?void 0:t.cornerText)||lw("指标"):this.getFormattedFieldValue().formattedValue},n}(wE),EE=function(){function t(t){this.EVENT="gesture",this.gm=t}return t.prototype.do=function(t){switch(t.type){case"touchstart":this.onTouchStart(t);break;case"touchmove":this.onTouchMove(t);break;case"touchend":this.onTouchEnd(t);break;case"touchcancel":this.onTouchCancel(t);break;default:return}},t.prototype.emit=function(t){this.gm.emit(this.EVENT,t)},t}(),_E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.EVENT="pan",e}return GC(e,t),e.prototype.onTouchCancel=function(t){},e.prototype.onTouchEnd=function(t){},e.prototype.onTouchMove=function(t){var e=t.x,n=t.y,r=e-this.preX,i=n-this.preY;this.preX=e,this.preY=n,this.emit({x:e,y:n,deltaX:r,deltaY:i,event:t})},e.prototype.onTouchStart=function(t){var e=t.x,n=t.y;this.preX=e,this.preY=n},e}(EE),bE="object"==typeof performance&&performance.now?performance:Date,TE=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.EVENT="press",e}return GC(e,t),e.prototype.onTouchCancel=function(t){this.clearTimeout()},e.prototype.onTouchEnd=function(t){this.clearTimeout()},e.prototype.onTouchMove=function(t){var e=t.x,n=t.y;(e-this.touchStartX>10||n-this.touchStartY>10)&&this.clearTimeout()},e.prototype.onTouchStart=function(t){var e=this;this.clearTimeout();var n=t.x,r=t.y;this.touchStartTime=bE.now(),this.touchStartX=n,this.touchStartY=r,this.pressTimeout=window.setTimeout((function(){e.emit({x:n,y:r,event:t})}),300)},e.prototype.clearTimeout=function(){window.clearTimeout(this.pressTimeout)},e}(EE),LE=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.EVENT="swipe",e.latestMoveTime=0,e.ms=0,e.speedX=0,e.speedY=0,e.preX=0,e.preY=0,e}return GC(e,t),e.prototype.onTouchCancel=function(t){},e.prototype.onTouchEnd=function(t){var e=this.speedX,n=this.speedY;if(bE.now()-this.latestMoveTime<100){var r=t.x,i=t.y;this.emit({x:r,y:i,speedX:e,speedY:n,event:t})}},e.prototype.onTouchMove=function(t){var e=t.x,n=t.y,r=bE.now(),i=e-this.preX,o=n-this.preY,a=r-this.ms;this.speedX=i/a,this.speedY=o/a,this.latestMoveTime=r},e.prototype.onTouchStart=function(t){var e=t.x,n=t.y;this.speedX=this.speedY=0,this.preX=e,this.preY=n,this.ms=bE.now()},e}(EE),IE=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.EVENT="tap",e}return GC(e,t),e.prototype.onTouchCancel=function(t){},e.prototype.onTouchEnd=function(t){var e=t.x,n=t.y;e-this.touchStartX<2&&n-this.touchStartY<2&&bE.now()-this.touchStartTime<300&&this.emit({x:e,y:n,event:t})},e.prototype.onTouchMove=function(t){},e.prototype.onTouchStart=function(t){var e=t.x,n=t.y;this.touchStartTime=bE.now(),this.touchStartX=e,this.touchStartY=n},e}(EE),OE={Pan:_E,Press:TE,Swipe:LE,Tap:IE},RE=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this)||this;return r.onTouchStart=function(t){r.preventEvent(t),r.element.on("touchmove",r.onTouchMove),r.element.on("touchend",r.onTouchEnd),r.element.on("touchcancel",r.onTouchCancel),r.emit("touchdown",t),r.doGestures(t)},r.onTouchMove=function(t){r.preventEvent(t),r.emit("touchmove",t),r.doGestures(t)},r.onTouchEnd=function(t){r.preventEvent(t),r.emit("touchend",t),r.element.off("touchmove",r.onTouchMove),r.element.off("touchend",r.onTouchEnd),r.element.off("touchcancel",r.onTouchCancel),r.doGestures(t)},r.onTouchCancel=function(t){r.preventEvent(t),r.emit("touchcancel",t),r.element.off("touchmove",r.onTouchMove),r.element.off("touchend",r.onTouchEnd),r.element.off("touchcancel",r.onTouchCancel),r.doGestures(t)},r.element=e,r.options=n,r.initialGestures(),r.bindTouchStart(),r}return GC(e,t),e.prototype.destroy=function(){this.element.off("touchstart",this.onTouchStart),this.off()},e.prototype.initialGestures=function(){var t=this,e=this.options.gestures||["Pan","Press","Swipe","Tap"];this.gestures=e.map((function(e){return new(0,OE[e])(t)}))},e.prototype.bindTouchStart=function(){this.element.on("touchstart",this.onTouchStart)},e.prototype.preventEvent=function(t){var e=t.type;(this.options.prevents||[]).includes(e)&&t.preventDefault()},e.prototype.doGestures=function(t){this.gestures.forEach((function(e){e.do(t)}))},e}(ht),AE=ln,ME="wheel",BE=function(t){function e(e){var n=t.call(this)||this;return n.rafMs=0,n.onPan=function(t){n.raf&&cancelAnimationFrame(n.raf);var e=t.deltaX,r=t.deltaY,i=n.getWrapperEvent(t,e,r);n.emit(ME,i)},n.onSwipe=function(t){var e=t.speedX,r=t.speedY;n.rafMs=bE.now(),n.ms=n.rafMs,0===e&&0===r||n.rafInertia(t)},n.element=e,n.gm=new RE(e,{gestures:["Pan","Swipe"]}),n.gm.on("swipe",n.onSwipe),n.gm.on("pan",n.onPan),n}return GC(e,t),e.prototype.destroy=function(){window.cancelAnimationFrame(this.raf),this.gm.destroy(),this.off()},e.prototype.rafInertia=function(t){var e=this,n=t.speedX,r=t.speedY;this.raf=window.requestAnimationFrame((function(){var i=bE.now(),o=(i-e.ms)/800;if(o<1){o=AE(1-o);var a=i-e.rafMs,s=n*o*a,l=r*o*a,u=e.getWrapperEvent(t,s,l);e.emit(ME,u),e.rafMs=i,e.rafInertia(t)}}))},e.prototype.getWrapperEvent=function(t,e,n){return UC(UC({},t),{deltaX:-e,deltaY:-n})},e}(ht),NE=function(t,e,n,r,i){var o=n+r;return t+i>=o?t:o<t+(e+i)/2?n+r-i:n>t+(e-i)/2?t+e-n>i?n:t+e-i:t+(e-i)/2},DE=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),Object.defineProperty(n.prototype,"cellType",{get:function(){return t.CellTypes.ROW_CELL},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){var t;e.prototype.destroy.call(this),null===(t=this.gm)||void 0===t||t.destroy()},n.prototype.initCell=function(){e.prototype.initCell.call(this),this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.drawInteractiveBorderShape(),this.drawTextShape(),this.drawTreeIcon(),this.drawTreeLeafNodeAlignDot(),this.drawRectBorder(),this.drawResizeAreaInLeaf(),this.drawActionIcons(),this.update()},n.prototype.drawBackgroundShape=function(){var t=this.getStyle().cell,e=t.backgroundColor,n=t.backgroundColorOpacity;this.backgroundShape=sx(this,UC(UC({},this.getCellArea()),{fill:e,fillOpacity:n}))},n.prototype.drawInteractiveBorderShape=function(){this.stateShapes.set("interactiveBorderShape",sx(this,this.getInteractiveBorderShapeStyle(2),{visible:!1}))},n.prototype.drawInteractiveBgShape=function(){this.stateShapes.set("interactiveBgShape",sx(this,UC({},this.getCellArea()),{visible:!1}))},n.prototype.showTreeIcon=function(){return this.spreadsheet.isHierarchyTreeType()&&!this.meta.isLeaf},n.prototype.showTreeLeafNodeAlignDot=function(){var t;return(null===(t=this.spreadsheet.options.style)||void 0===t?void 0:t.showTreeLeafNodeAlignDot)&&this.spreadsheet.isHierarchyTreeType()},n.prototype.getParentTreeIconCfg=function(){if(this.showTreeLeafNodeAlignDot()&&this.spreadsheet.isHierarchyTreeType()&&this.meta.isLeaf)return Su(this.meta,"parent.belongsCell.treeIcon.cfg")},n.prototype.drawTreeIcon=function(){var e=this;if(this.showTreeIcon()){var n=this.meta,r=n.isCollapsed,i=n.id,o=n.hierarchy,a=this.getContentArea().x,s=this.getTextStyle().fill,l=this.getStyle().icon.size,u=a+this.getContentIndent(),c=this.getIconYPosition();this.treeIcon=vx(this,{x:u,y:c,width:l,height:l},s,r,(function(){if(!Cw()){if(!r){var n=e.spreadsheet.store.get("scrollY"),a=e.spreadsheet.facet.panelBBox.viewportHeight||0,s=(c=e.meta,h=0,null==(d=c.children)||d.forEach((function(t){h+=t.height||0})),h),l=o.height-s;if(n>0&&n+a>l){var u=l-a;e.spreadsheet.store.set("scrollY",u>0?u:0)}}var c,h,d;e.spreadsheet.emit(t.S2Event.ROW_CELL_COLLAPSE_TREE_ROWS,{id:i,isCollapsed:!r,node:e.meta})}})),Cw()&&(this.gm=new RE(this,{gestures:["Tap"]}),this.gm.on("tap",(function(){e.spreadsheet.emit(t.S2Event.ROW_CELL_COLLAPSE_TREE_ROWS,{id:i,isCollapsed:!r,node:e.meta})})))}},n.prototype.drawTreeLeafNodeAlignDot=function(){var t=this.getParentTreeIconCfg();if(t){var e=this.getStyle().icon,n=e.size,r=e.margin,i=t.x+n+r.right,o=this.getTextPosition().y,a=this.getTextStyle(),s=a.fill,l=a.fontSize,u=n/5;this.treeLeafNodeAlignDot=cx(this,{x:i+n/2,y:o+(l-u)/2,r:u,fill:s,fillOpacity:.3})}},n.prototype.drawTextShape=function(){e.prototype.drawTextShape.call(this),this.drawLinkFieldShape()},n.prototype.drawLinkFieldShape=function(){var t=this.headerConfig.linkFields,n=void 0===t?[]:t,r=this.getTextStyle().linkTextFill;e.prototype.drawLinkFieldShape.call(this,n.includes(this.meta.key),r)},n.prototype.drawRectBorder=function(){var e=this,n=this.getCellArea().x,r=this.getContentIndent(),i=this.spreadsheet.isHierarchyTreeType()?n:n+r;[t.CellBorderPosition.BOTTOM,t.CellBorderPosition.LEFT].forEach((function(t){var n=Bx(t,UC(UC({},e.getCellArea()),{x:i}),e.getStyle().cell),r=n.position,o=n.style;dx(e,r,o)}))},n.prototype.drawResizeAreaInLeaf=function(){if(this.meta.isLeaf&&this.shouldDrawResizeAreaByType("rowCellVertical",this)){var e=this.getCellArea(),n=e.x,r=e.y,i=e.width,o=e.height,a=this.getResizeAreaStyle(),s=$S(this.spreadsheet,Io),l=this.headerConfig,u=l.position,c=l.seriesNumberWidth,h=l.width,d=l.viewportHeight,f=l.scrollX,p=l.scrollY,v={x:n,y:r+o-a.size/2,width:i,height:a.size};if(QS(v,{x:0,y:0,width:h,height:d},{scrollX:f,scrollY:p})){var g=u.x+n-f+c,y=u.y+r-p,m=this.spreadsheet.isFrozenRowHeader()?h-c-(n-f):i;s.addShape("rect",{attrs:UC(UC({},ZS({id:this.meta.id,theme:a,type:t.ResizeDirectionType.Vertical,effect:t.ResizeAreaEffect.Cell,offsetX:g,offsetY:y,width:i,height:o,meta:this.meta})),{x:g,y:y+o-a.size/2,width:m})})}}},n.prototype.getContentIndent=function(){if(!this.spreadsheet.isHierarchyTreeType())return 0;for(var t=this.getStyle(),e=t.icon,n=t.cell,r=e.size+e.margin.right,i=this.meta.parent,o=0;i;)0!==i.height&&(o+=r),i=i.parent;return this.showTreeLeafNodeAlignDot()&&(o+=this.isTreeLevel()?0:n.padding.right+e.margin.right),o},n.prototype.getTextIndent=function(){var t=this.getStyle().icon,e=t.size,n=t.margin;return this.getContentIndent()+(this.showTreeIcon()||this.isTreeLevel()&&this.showTreeLeafNodeAlignDot()?e+n.right:0)},n.prototype.isTreeLevel=function(){return $f(Su(this.meta,"parent.children"),(function(t){return!t.isLeaf}))},n.prototype.isBolderText=function(){var t=this.meta,e=t.isLeaf,n=t.isTotals,r=t.level;return!e&&0===r||n},n.prototype.getTextStyle=function(){var t,e=this.getStyle(),n=e.text,r=e.bolderText,i=e.measureText;return t=this.isMeasureField()?i||n:this.isBolderText()?r:n,UC(UC({},t),{textBaseline:"top"})},n.prototype.getIconPosition=function(){var t=this.textShape.cfg.attrs,e=t.x,n=t.y,r=t.textAlign,i=this.getStyle().icon.margin.left;return"left"===r?{x:e+this.actualTextWidth+i,y:n}:"right"===r?{x:e+i,y:n}:{x:e+this.actualTextWidth/2+i,y:n}},n.prototype.getMaxTextWidth=function(){return this.getContentArea().width-this.getTextIndent()-this.getActionIconsWidth()},n.prototype.getTextArea=function(){var t=this.getContentArea(),e=this.getTextIndent();return UC(UC({},t),{x:t.x+e,width:t.width-e})},n.prototype.getTextPosition=function(){var t=this.getTextArea(),e=this.headerConfig,n=e.scrollY,r=e.viewportHeight,i=this.getTextStyle().fontSize,o=NE(t.y,t.height,n,r,i);return{x:Rx(t,this.getTextStyle(),0,this.getIconStyle(),this.getActionIconsCount()).text.x,y:o}},n.prototype.getIconYPosition=function(){var t=this.getTextPosition().y,e=this.getStyle().icon.size;return t+(this.getTextStyle().fontSize-e)/2},n}(wE),PE=function(t,e){return e>0&&t<e},kE=function(t,e,n){return e>0&&t>=n-e},zE=function(t,e,n){return n>0&&t<e+n},FE=function(t,e,n){return n>0&&t>=e+1-n},HE=function(t,e,n,r,i,o){var a=Zf(n,(function(e,r){var a=t-(dv(o)?0:o)+i.x;return a>=e&&a<n[r+1]}),0);a=Math.max(a,0);var s=Zf(n,(function(e,r){var o=i.width+t+i.x;return o>=e&&o<n[r+1]}),a);s=Math.min(-1===s?1/0:s,n.length-2);var l=r.getIndexRange(e+i.y,i.height+e+i.y);return[a,s,l.start,l.end]},WE=function(t,e,n){var r,i,o=null==t?void 0:t.getMatrix(),a=null!==(r=null==o?void 0:o[6])&&void 0!==r?r:0,s=null!==(i=null==o?void 0:o[7])&&void 0!==i?i:0;null==t||t.translate(e-a,n-s)},GE=function(t,e){var n,r=null==t?void 0:t.getMatrix(),i=null!==(n=null==r?void 0:r[6])&&void 0!==n?n:0;null==t||t.translate(e-i,0)},UE=function(t,e,n){var r,i,o=(null===(r=n.icon.margin)||void 0===r?void 0:r.left)||0,a=(null===(i=n.icon.margin)||void 0===i?void 0:i.right)||0,s=t.store.get("hiddenColumnsDetail",[]),l=!1,u=!1;s.forEach((function(t){var n,r,i,o;(null===(r=null===(n=null==t?void 0:t.displaySiblingNode)||void 0===n?void 0:n.prev)||void 0===r?void 0:r.field)===e&&(l=!0),(null===(o=null===(i=null==t?void 0:t.displaySiblingNode)||void 0===i?void 0:i.next)||void 0===o?void 0:o.field)===e&&(u=!0)}));var c=Su(n,"icon.size");return{left:u?c+a:0,right:l?c+o:0}},YE=function(e,n,r){var i=Su(r,"cell.padding"),o=UE(e,n.field,r);return i.left+i.right+function(t,e,n,r){var i,o,a=Su(r,"size"),s=Su(r,"margin"),l=0;return(l=t.options.showDefaultHeaderActionIcon?1:null!==(o=null===(i=JS(t.options.headerActionIcons,e,n))||void 0===i?void 0:i.iconNames.length)&&void 0!==o?o:0)*(a+s.left)+(l>0?s.right:0)}(e,n,t.CellTypes.COL_CELL,Su(r,"icon"))+o.left+o.right},jE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return GC(e,t),e.prototype.handleRestOptions=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=VC(t,1),r=n[0];this.headerConfig=UC({},r);var i=this.meta.field,o=this.spreadsheet.dataCfg.sortParams,a=$f(o,(function(t){return(null==t?void 0:t.sortFieldId)===i})),s=CE(a,!0);this.headerConfig.sortParam=UC(UC(UC({},this.headerConfig.sortParam),a||{}),{type:s})},e.prototype.isFrozenCell=function(){var t=this.spreadsheet.options,e=t.frozenColCount,n=t.frozenTrailingColCount,r=this.meta.colIndex,i=this.spreadsheet.facet.layoutResult.colLeafNodes;return PE(r,e)||kE(r,n,i.length)},e.prototype.getFormattedFieldValue=function(){return tE(this.meta,this.spreadsheet.dataSet.getFieldName(this.meta.label))},e.prototype.shouldAddVerticalResizeArea=function(){return!!this.isFrozenCell()||t.prototype.shouldAddVerticalResizeArea.call(this)},e.prototype.getVerticalResizeAreaOffset=function(){var t=this.meta,e=t.x,n=t.y,r=this.headerConfig,i=r.scrollX,o=r.position;return this.isFrozenCell()?{x:e,y:n}:{x:o.x+e-i,y:o.y+n}},e.prototype.getColResizeArea=function(){return this.isFrozenCell()?$S(this.spreadsheet,No):t.prototype.getColResizeArea.call(this)},e.prototype.isSortCell=function(){return!0},e.prototype.showSortIcon=function(){return this.spreadsheet.options.showDefaultHeaderActionIcon},e.prototype.getTextStyle=function(){var t=this.getStyle();return null==t?void 0:t.bolderText},e.prototype.getContentArea=function(){var t,e=((null===(t=this.getStyle())||void 0===t?void 0:t.cell)||this.theme.dataCell.cell).padding,n=UC({},e),r=UE(this.spreadsheet,this.meta.field,this.getStyle());return r.left&&(n.left=(n.left||0)+r.left),r.right&&(n.right=(n.right||0)+r.right),Tx(this.getCellArea(),n)},e.prototype.getHorizontalResizeAreaName=function(){return"".concat(Ho).concat("table-col-cell")},e.prototype.drawBackgroundShape=function(){var t=this.getStyle().cell.backgroundColor;this.backgroundShape=sx(this,UC(UC({},this.getCellArea()),{fill:t}))},e}(xE),VE=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),n.prototype.getStyle=function(t){return t?this.theme[t]:Su(this,"theme.cornerCell")},n.prototype.showSortIcon=function(){return!1},n.prototype.drawLeftBorder=function(){var e=Bx(t.CellBorderPosition.LEFT,this.getCellArea(),this.getStyle().cell);dx(this,e.position,e.style)},n.prototype.drawBorders=function(){e.prototype.drawBorders.call(this),0===this.meta.colIndex&&this.drawLeftBorder()},n}(jE),XE=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),n.prototype.drawTextShape=function(){e.prototype.drawTextShape.call(this),this.drawLinkFieldShape()},n.prototype.drawLinkFieldShape=function(){var t=this.spreadsheet.options.interaction.linkFields,n=void 0===t?[]:t,r=this.theme.rowCell.text.linkTextFill;e.prototype.drawLinkFieldShape.call(this,n.includes(this.meta.valueField),r)},n.prototype.drawBorderShape=function(){e.prototype.drawBorderShape.call(this),0===this.meta.colIndex&&this.drawLeftBorder()},n.prototype.shouldDrawResizeArea=function(){return 0===this.meta.colIndex},n.prototype.drawResizeArea=function(){if(this.shouldDrawResizeArea()){var e=this.getCellArea(),n=e.x,r=e.y,i=e.width,o=e.height,a=this.meta.rowIndex,s=this.getResizeAreaStyle(),l=this.spreadsheet.options,u=l.frozenRowCount,c=l.frozenTrailingRowCount,h=this.spreadsheet.facet.getCellRange(),d=zE(a,h.start,u),f=FE(a,h.end,c),p=d||f?Oo:Io,v=$S(this.spreadsheet,p),g=this.spreadsheet.facet.layoutResult.colsHierarchy.height,y=this.spreadsheet.facet.getScrollOffset().scrollY,m=this.spreadsheet.facet.getPaginationScrollY(),C=r+(f?0:g);f||(C-=d?m:y+m),v.addShape("rect",{attrs:UC(UC({},ZS({id:String(this.meta.rowIndex),theme:s,type:t.ResizeDirectionType.Vertical,effect:t.ResizeAreaEffect.Cell,offsetX:n,offsetY:C,width:i,height:o,meta:this.meta})),{x:n,y:C+o-s.size/2,width:i})})}},n}(OS),KE=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),Object.defineProperty(n.prototype,"cellType",{get:function(){return t.CellTypes.ROW_CELL},enumerable:!1,configurable:!0}),n.prototype.getTextStyle=function(){return this.theme.rowCell.seriesText},n}(XE),qE=function(e){return[t.InteractionKeyboardKey.META,t.InteractionKeyboardKey.CONTROL].includes(e.key)},ZE=function(t){var e=t.getMeta();return{id:e.id,colIndex:e.colIndex,rowIndex:e.rowIndex,type:t.cellType}},$E=function(e,n){var r=e.interaction;r.changeState({stateName:t.InteractionStateName.SELECTED,cells:n}),e.emit(t.S2Event.GLOBAL_SELECTED,r.getActiveCells())};function QE(t,e){var n=Math.min(t.rowIndex,e.rowIndex),r=Math.max(t.rowIndex,e.rowIndex);return{start:{rowIndex:n,colIndex:Math.min(t.colIndex,e.colIndex)},end:{rowIndex:r,colIndex:Math.max(t.colIndex,e.colIndex)}}}function JE(t,e){var n=e.interaction,r=e.facet,i=e.options;if(e.isTableMode()){if(!i.showSeriesNumber)return[];var o=r.layoutResult.colLeafNodes[0].id,a=IS(String(t.rowIndex),o),s=[],l=n.getAllCells().find((function(t){return t.getMeta().id===a}));return l&&l instanceof KE&&s.push(l),s}return ES(t.rowId,n.getAllRowHeaderCells(),e.isHierarchyTreeType())}function t_(e){var n=e.rowId,r=e.colId,i=e.spreadsheet,o=i.interaction;(_S(r,o.getAllColHeaderCells(),t.InteractionStateName.SELECTED),n)&&Tf(JE(e,i),(function(e){e.updateByState(t.InteractionStateName.SELECTED)}))}var e_,n_,r_=function(t){var e=t.store.get("visibleActionIcons"),n=t.interaction.getInteractedCells(),r=t.interaction.getState().cells;if(ov(n)&&ov(r)&&ov(e))return!1;(Tf(e,(function(t){t.set("visible",!1)})),t.store.set("visibleActionIcons",[]),Tf(n,(function(t){t.hideInteractionShape()})),t.interaction.resetState(),t.options.interaction.selectedCellsSpotlight)&&Tf(t.interaction.getPanelGroupAllUnSelectedDataCells()||[],(function(t){t.clearUnselectedState()}));return!0},i_=function(t,e){var n=null==e?void 0:e.stateName;t.interaction.isEqualStateName(n)||(r_(t),t.hideTooltip(),t.store.set(IC,e))},o_=function(e,n,r){var i,o,a=r.facet,s=a.panelBBox.width,l=null==a?void 0:a.frozenGroupInfo,u=null!==(i=null==l?void 0:l.frozenCol.width)&&void 0!==i?i:0,c=null!==(o=null==l?void 0:l.frozenTrailingCol.width)&&void 0!==o?o:0,h=a.layoutResult.colLeafNodes[e];return n===t.ScrollDirection.LEADING?h.x-u:h.x+h.width-(s-c)},a_=function(e,n,r){var i,o,a=r.facet,s=a.viewCellHeights.getCellOffsetY,l=s(e+1),u=a.panelBBox.height,c=null==a?void 0:a.frozenGroupInfo,h=null!==(i=null==c?void 0:c.frozenRow.height)&&void 0!==i?i:0,d=null!==(o=null==c?void 0:c.frozenTrailingRow.height)&&void 0!==o?o:0;return n===t.ScrollDirection.LEADING?s(e)-h:l-(u-d)},s_=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=function(t,e){if(pa(t)&&pa(e))return e},r=XC(XC([],VC(t),!1),[n],!1);return sf.apply(void 0,XC([{}],VC(r),!1))},l_=function(t){var e=["rows","columns","values"].reduce((function(e,n){var r=t[n],i=Lm(r);return av(i,r)||console.warn("fields.".concat(n,":[").concat(r,"] should be unique")),e[n]=i,e}),{});return UC(UC({},t),e)},u_=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=s_.apply(void 0,XC([$o],VC(t),!1));return n.fields=l_(n.fields),ov(n.fields.customTreeItems)&&!ov(n.fields.values)||(n.fields.valueInCols=!1),n},c_=function(t){return s_(HC,t)},h_=9e15,d_=1e9,f_="0123456789abcdef",p_="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",v_="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",g_={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-h_,maxE:h_,crypto:!1},y_=!0,m_="[DecimalError] ",C_=m_+"Invalid argument: ",w_=m_+"Precision limit exceeded",x_=m_+"crypto unavailable",S_="[object Decimal]",E_=Math.floor,__=Math.pow,b_=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,T_=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,L_=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,I_=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,O_=1e7,R_=p_.length-1,A_=v_.length-1,M_={toStringTag:S_};function B_(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;e<i;e++)(n=7-(r=t[e]+"").length)&&(o+=Y_(n)),o+=r;(n=7-(r=(a=t[e])+"").length)&&(o+=Y_(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function N_(t,e,n){if(t!==~~t||t<e||t>n)throw Error(C_+t)}function D_(t,e,n,r){var i,o,a,s;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),o=__(10,7-e),s=t[i]%o|0,null==r?e<3?(0==e?s=s/100|0:1==e&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(t[i+1]/o/100|0)==__(10,e-2)-1||(s==o/2||0==s)&&0==(t[i+1]/o/100|0):e<4?(0==e?s=s/1e3|0:1==e?s=s/100|0:2==e&&(s=s/10|0),a=(r||n<4)&&9999==s||!r&&n>3&&4999==s):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(t[i+1]/o/1e3|0)==__(10,e-3)-1,a}function P_(t,e,n){for(var r,i,o=[0],a=0,s=t.length;a<s;){for(i=o.length;i--;)o[i]*=e;for(o[0]+=f_.indexOf(t.charAt(a++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}M_.absoluteValue=M_.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),z_(t)},M_.ceil=function(){return z_(new this.constructor(this),this.e+1,2)},M_.clampedTo=M_.clamp=function(t,e){var n=this,r=n.constructor;if(t=new r(t),e=new r(e),!t.s||!e.s)return new r(NaN);if(t.gt(e))throw Error(C_+e);return n.cmp(t)<0?t:n.cmp(e)>0?e:new r(n)},M_.comparedTo=M_.cmp=function(t){var e,n,r,i,o=this,a=o.d,s=(t=new o.constructor(t)).d,l=o.s,u=t.s;if(!a||!s)return l&&u?l!==u?l:a===s?0:!a^l<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?l:s[0]?-u:0;if(l!==u)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(e=0,n=(r=a.length)<(i=s.length)?r:i;e<n;++e)if(a[e]!==s[e])return a[e]>s[e]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1},M_.cosine=M_.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r,i;if(e.isZero())return e;(r=e.d.length)<32?i=(1/tb(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10");t.precision+=n,e=J_(t,1,e.times(i),new t(1));for(var o=n;o--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=n,e}(r,eb(r,n)),r.precision=t,r.rounding=e,z_(2==n_||3==n_?n.neg():n,t,e,!0)):new r(1):new r(NaN)},M_.cubeRoot=M_.cbrt=function(){var t,e,n,r,i,o,a,s,l,u,c=this,h=c.constructor;if(!c.isFinite()||c.isZero())return new h(c);for(y_=!1,(o=c.s*__(c.s*c,1/3))&&Math.abs(o)!=1/0?r=new h(o.toString()):(n=B_(c.d),(o=((t=c.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=__(n,1/3),t=E_((t+1)/3)-(t%3==(t<0?-1:2)),(r=new h(n=o==1/0?"5e"+t:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+t)).s=c.s),a=(t=h.precision)+3;;)if(u=(l=(s=r).times(s).times(s)).plus(c),r=k_(u.plus(c).times(s),u.plus(l),a+2,1),B_(s.d).slice(0,a)===(n=B_(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(z_(r,t+1,1),e=!r.times(r).times(r).eq(c));break}if(!i&&(z_(s,t+1,0),s.times(s).times(s).eq(c))){r=s;break}a+=4,i=1}return y_=!0,z_(r,t,h.rounding,e)},M_.decimalPlaces=M_.dp=function(){var t,e=this.d,n=NaN;if(e){if(n=7*((t=e.length-1)-E_(this.e/7)),t=e[t])for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n},M_.dividedBy=M_.div=function(t){return k_(this,new this.constructor(t))},M_.dividedToIntegerBy=M_.divToInt=function(t){var e=this.constructor;return z_(k_(this,new e(t),0,1,1),e.precision,e.rounding)},M_.equals=M_.eq=function(t){return 0===this.cmp(t)},M_.floor=function(){return z_(new this.constructor(this),this.e+1,3)},M_.greaterThan=M_.gt=function(t){return this.cmp(t)>0},M_.greaterThanOrEqualTo=M_.gte=function(t){var e=this.cmp(t);return 1==e||0===e},M_.hyperbolicCosine=M_.cosh=function(){var t,e,n,r,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?e=(1/tb(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=J_(a,1,o.times(e),new a(1),!0);for(var l,u=t,c=new a(8);u--;)l=o.times(o),o=s.minus(l.times(c.minus(l.times(c))));return z_(o,a.precision=n,a.rounding=r,!0)},M_.hyperbolicSine=M_.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=J_(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=J_(o,2,i=i.times(1/tb(5,t)),i,!0);for(var a,s=new o(5),l=new o(16),u=new o(20);t--;)a=i.times(i),i=i.times(s.plus(a.times(l.times(a).plus(u))))}return o.precision=e,o.rounding=n,z_(i,e,n,!0)},M_.hyperbolicTangent=M_.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,k_(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)},M_.inverseCosine=M_.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?e.isNeg()?G_(n,i,o):new n(0):new n(NaN):e.isZero()?G_(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=G_(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))},M_.inverseHyperbolicCosine=M_.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,y_=!1,n=n.times(n).minus(1).sqrt().plus(n),y_=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)},M_.inverseHyperbolicSine=M_.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,y_=!1,n=n.times(n).plus(1).sqrt().plus(n),y_=!0,r.precision=t,r.rounding=e,n.ln())},M_.inverseHyperbolicTangent=M_.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?z_(new o(i),t,e,!0):(o.precision=n=r-i.e,i=k_(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},M_.inverseSine=M_.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==e?0===e?((t=G_(o,n+4,r).times(.5)).s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},M_.inverseTangent=M_.atan=function(){var t,e,n,r,i,o,a,s,l,u=this,c=u.constructor,h=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&h+4<=A_)return(a=G_(c,h+4,d).times(.25)).s=u.s,a}else{if(!u.s)return new c(NaN);if(h+4<=A_)return(a=G_(c,h+4,d).times(.5)).s=u.s,a}for(c.precision=s=h+10,c.rounding=1,t=n=Math.min(28,s/7+2|0);t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(y_=!1,e=Math.ceil(s/7),r=1,l=u.times(u),a=new c(u),i=u;-1!==t;)if(i=i.times(l),o=a.minus(i.div(r+=2)),i=i.times(l),void 0!==(a=o.plus(i.div(r+=2))).d[e])for(t=e;a.d[t]===o.d[t]&&t--;);return n&&(a=a.times(2<<n-1)),y_=!0,z_(a,c.precision=h,c.rounding=d,!0)},M_.isFinite=function(){return!!this.d},M_.isInteger=M_.isInt=function(){return!!this.d&&E_(this.e/7)>this.d.length-2},M_.isNaN=function(){return!this.s},M_.isNegative=M_.isNeg=function(){return this.s<0},M_.isPositive=M_.isPos=function(){return this.s>0},M_.isZero=function(){return!!this.d&&0===this.d[0]},M_.lessThan=M_.lt=function(t){return this.cmp(t)<0},M_.lessThanOrEqualTo=M_.lte=function(t){return this.cmp(t)<1},M_.logarithm=M_.log=function(t){var e,n,r,i,o,a,s,l,u=this,c=u.constructor,h=c.precision,d=c.rounding;if(null==t)t=new c(10),e=!0;else{if(n=(t=new c(t)).d,t.s<0||!n||!n[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(n=u.d,u.s<0||!n||!n[0]||u.eq(1))return new c(n&&!n[0]?-1/0:1!=u.s?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(y_=!1,a=q_(u,s=h+5),r=e?W_(c,s+10):q_(t,s),D_((l=k_(a,r,s,1)).d,i=h,d))do{if(a=q_(u,s+=10),r=e?W_(c,s+10):q_(t,s),l=k_(a,r,s,1),!o){+B_(l.d).slice(i+1,i+15)+1==1e14&&(l=z_(l,h+1,0));break}}while(D_(l.d,i+=10,d));return y_=!0,z_(l,h,d)},M_.minus=M_.sub=function(t){var e,n,r,i,o,a,s,l,u,c,h,d,f=this,p=f.constructor;if(t=new p(t),!f.d||!t.d)return f.s&&t.s?f.d?t.s=-t.s:t=new p(t.d||f.s!==t.s?f:NaN):t=new p(NaN),t;if(f.s!=t.s)return t.s=-t.s,f.plus(t);if(u=f.d,d=t.d,s=p.precision,l=p.rounding,!u[0]||!d[0]){if(d[0])t.s=-t.s;else{if(!u[0])return new p(3===l?-0:0);t=new p(f)}return y_?z_(t,s,l):t}if(n=E_(t.e/7),c=E_(f.e/7),u=u.slice(),o=c-n){for((h=o<0)?(e=u,o=-o,a=d.length):(e=d,n=c,a=u.length),o>(r=Math.max(Math.ceil(s/7),a)+2)&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for((h=(r=u.length)<(a=d.length))&&(a=r),r=0;r<a;r++)if(u[r]!=d[r]){h=u[r]<d[r];break}o=0}for(h&&(e=u,u=d,d=e,t.s=-t.s),a=u.length,r=d.length-a;r>0;--r)u[a++]=0;for(r=d.length;r>o;){if(u[--r]<d[r]){for(i=r;i&&0===u[--i];)u[i]=O_-1;--u[i],u[r]+=O_}u[r]-=d[r]}for(;0===u[--a];)u.pop();for(;0===u[0];u.shift())--n;return u[0]?(t.d=u,t.e=H_(u,n),y_?z_(t,s,l):t):new p(3===l?-0:0)},M_.modulo=M_.mod=function(t){var e,n=this,r=n.constructor;return t=new r(t),!n.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||n.d&&!n.d[0]?z_(new r(n),r.precision,r.rounding):(y_=!1,9==r.modulo?(e=k_(n,t.abs(),0,3,1)).s*=t.s:e=k_(n,t,0,r.modulo,1),e=e.times(t),y_=!0,n.minus(e))},M_.naturalExponential=M_.exp=function(){return K_(this)},M_.naturalLogarithm=M_.ln=function(){return q_(this)},M_.negated=M_.neg=function(){var t=new this.constructor(this);return t.s=-t.s,z_(t)},M_.plus=M_.add=function(t){var e,n,r,i,o,a,s,l,u,c,h=this,d=h.constructor;if(t=new d(t),!h.d||!t.d)return h.s&&t.s?h.d||(t=new d(t.d||h.s===t.s?h:NaN)):t=new d(NaN),t;if(h.s!=t.s)return t.s=-t.s,h.minus(t);if(u=h.d,c=t.d,s=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(t=new d(h)),y_?z_(t,s,l):t;if(o=E_(h.e/7),r=E_(t.e/7),u=u.slice(),i=o-r){for(i<0?(n=u,i=-i,a=c.length):(n=c,r=o,a=u.length),i>(a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=u.length)-(i=c.length)<0&&(i=a,n=c,c=u,u=n),e=0;i;)e=(u[--i]=u[i]+c[i]+e)/O_|0,u[i]%=O_;for(e&&(u.unshift(e),++r),a=u.length;0==u[--a];)u.pop();return t.d=u,t.e=H_(u,r),y_?z_(t,s,l):t},M_.precision=M_.sd=function(t){var e,n=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(C_+t);return n.d?(e=U_(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e},M_.round=function(){var t=this,e=t.constructor;return z_(new e(t),t.e+1,e.rounding)},M_.sine=M_.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r=e.d.length;if(r<3)return e.isZero()?e:J_(t,2,e,e);n=(n=1.4*Math.sqrt(r))>16?16:0|n,e=e.times(1/tb(5,n)),e=J_(t,2,e,e);for(var i,o=new t(5),a=new t(16),s=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(a.times(i).minus(s))));return e}(r,eb(r,n)),r.precision=t,r.rounding=e,z_(n_>2?n.neg():n,t,e,!0)):new r(NaN)},M_.squareRoot=M_.sqrt=function(){var t,e,n,r,i,o,a=this,s=a.d,l=a.e,u=a.s,c=a.constructor;if(1!==u||!s||!s[0])return new c(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);for(y_=!1,0==(u=Math.sqrt(+a))||u==1/0?(((e=B_(s)).length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=E_((l+1)/2)-(l<0||l%2),r=new c(e=u==1/0?"5e"+l:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+l)):r=new c(u.toString()),n=(l=c.precision)+3;;)if(r=(o=r).plus(k_(a,o,n+2,1)).times(.5),B_(o.d).slice(0,n)===(e=B_(r.d)).slice(0,n)){if("9999"!=(e=e.slice(n-3,n+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(z_(r,l+1,1),t=!r.times(r).eq(a));break}if(!i&&(z_(o,l+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}return y_=!0,z_(r,l,c.rounding,t)},M_.tangent=M_.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,(n=n.sin()).s=1,n=k_(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,z_(2==n_||4==n_?n.neg():n,t,e,!0)):new r(NaN)},M_.times=M_.mul=function(t){var e,n,r,i,o,a,s,l,u,c=this,h=c.constructor,d=c.d,f=(t=new h(t)).d;if(t.s*=c.s,!(d&&d[0]&&f&&f[0]))return new h(!t.s||d&&!d[0]&&!f||f&&!f[0]&&!d?NaN:d&&f?0*t.s:t.s/0);for(n=E_(c.e/7)+E_(t.e/7),(l=d.length)<(u=f.length)&&(o=d,d=f,f=o,a=l,l=u,u=a),o=[],r=a=l+u;r--;)o.push(0);for(r=u;--r>=0;){for(e=0,i=l+r;i>r;)s=o[i]+f[r]*d[i-r-1]+e,o[i--]=s%O_|0,e=s/O_|0;o[i]=(o[i]+e)%O_|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=H_(o,n),y_?z_(t,h.precision,h.rounding):t},M_.toBinary=function(t,e){return nb(this,2,t,e)},M_.toDecimalPlaces=M_.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),void 0===t?n:(N_(t,0,d_),void 0===e?e=r.rounding:N_(e,0,8),z_(n,t+n.e+1,e))},M_.toExponential=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=F_(r,!0):(N_(t,0,d_),void 0===e?e=i.rounding:N_(e,0,8),n=F_(r=z_(new i(r),t+1,e),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n},M_.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?n=F_(i):(N_(t,0,d_),void 0===e?e=o.rounding:N_(e,0,8),n=F_(r=z_(new o(i),t+i.e+1,e),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},M_.toFraction=function(t){var e,n,r,i,o,a,s,l,u,c,h,d,f=this,p=f.d,v=f.constructor;if(!p)return new v(f);if(u=n=new v(1),r=l=new v(0),a=(o=(e=new v(r)).e=U_(p)-f.e-1)%7,e.d[0]=__(10,a<0?7+a:a),null==t)t=o>0?e:u;else{if(!(s=new v(t)).isInt()||s.lt(u))throw Error(C_+s);t=s.gt(e)?o>0?e:u:s}for(y_=!1,s=new v(B_(p)),c=v.precision,v.precision=o=7*p.length*2;h=k_(s,e,0,1,1),1!=(i=n.plus(h.times(r))).cmp(t);)n=r,r=i,i=u,u=l.plus(h.times(i)),l=i,i=e,e=s.minus(h.times(i)),s=i;return i=k_(t.minus(n),r,0,1,1),l=l.plus(i.times(u)),n=n.plus(i.times(r)),l.s=u.s=f.s,d=k_(u,r,o,1).minus(f).abs().cmp(k_(l,n,o,1).minus(f).abs())<1?[u,r]:[l,n],v.precision=c,y_=!0,d},M_.toHexadecimal=M_.toHex=function(t,e){return nb(this,16,t,e)},M_.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),null==t){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),void 0===e?e=r.rounding:N_(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(y_=!1,n=k_(n,t,0,e,1).times(t),y_=!0,z_(n)):(t.s=n.s,n=t),n},M_.toNumber=function(){return+this},M_.toOctal=function(t,e){return nb(this,8,t,e)},M_.toPower=M_.pow=function(t){var e,n,r,i,o,a,s=this,l=s.constructor,u=+(t=new l(t));if(!(s.d&&t.d&&s.d[0]&&t.d[0]))return new l(__(+s,u));if((s=new l(s)).eq(1))return s;if(r=l.precision,o=l.rounding,t.eq(1))return z_(s,r,o);if((e=E_(t.e/7))>=t.d.length-1&&(n=u<0?-u:u)<=9007199254740991)return i=j_(l,s,n,r),t.s<0?new l(1).div(i):z_(i,r,o);if((a=s.s)<0){if(e<t.d.length-1)return new l(NaN);if(0==(1&t.d[e])&&(a=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=a,s}return(e=0!=(n=__(+s,u))&&isFinite(n)?new l(n+"").e:E_(u*(Math.log("0."+B_(s.d))/Math.LN10+s.e+1)))>l.maxE+1||e<l.minE-1?new l(e>0?a/0:0):(y_=!1,l.rounding=s.s=1,n=Math.min(12,(e+"").length),(i=K_(t.times(q_(s,r+n)),r)).d&&D_((i=z_(i,r+5,1)).d,r,o)&&(e=r+10,+B_((i=z_(K_(t.times(q_(s,e+n)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=z_(i,r+1,0))),i.s=a,y_=!0,l.rounding=o,z_(i,r,o))},M_.toPrecision=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=F_(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(N_(t,1,d_),void 0===e?e=i.rounding:N_(e,0,8),n=F_(r=z_(new i(r),t,e),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n},M_.toSignificantDigits=M_.toSD=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(N_(t,1,d_),void 0===e?e=n.rounding:N_(e,0,8)),z_(new n(this),t,e)},M_.toString=function(){var t=this,e=t.constructor,n=F_(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n},M_.truncated=M_.trunc=function(){return z_(new this.constructor(this),this.e+1,1)},M_.valueOf=M_.toJSON=function(){var t=this,e=t.constructor,n=F_(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};var k_=function(){function t(t,e,n){var r,i=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+i,t[o]=r%n|0,i=r/n|0;return i&&t.unshift(i),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;)t.shift()}return function(r,i,o,a,s,l){var u,c,h,d,f,p,v,g,y,m,C,w,x,S,E,_,b,T,L,I,O=r.constructor,R=r.s==i.s?1:-1,A=r.d,M=i.d;if(!(A&&A[0]&&M&&M[0]))return new O(r.s&&i.s&&(A?!M||A[0]!=M[0]:M)?A&&0==A[0]||!M?0*R:R/0:NaN);for(l?(f=1,c=r.e-i.e):(l=O_,f=7,c=E_(r.e/f)-E_(i.e/f)),L=M.length,b=A.length,m=(y=new O(R)).d=[],h=0;M[h]==(A[h]||0);h++);if(M[h]>(A[h]||0)&&c--,null==o?(S=o=O.precision,a=O.rounding):S=s?o+(r.e-i.e)+1:o,S<0)m.push(1),p=!0;else{if(S=S/f+2|0,h=0,1==L){for(d=0,M=M[0],S++;(h<b||d)&&S--;h++)E=d*l+(A[h]||0),m[h]=E/M|0,d=E%M|0;p=d||h<b}else{for((d=l/(M[0]+1)|0)>1&&(M=t(M,d,l),A=t(A,d,l),L=M.length,b=A.length),_=L,w=(C=A.slice(0,L)).length;w<L;)C[w++]=0;(I=M.slice()).unshift(0),T=M[0],M[1]>=l/2&&++T;do{d=0,(u=e(M,C,L,w))<0?(x=C[0],L!=w&&(x=x*l+(C[1]||0)),(d=x/T|0)>1?(d>=l&&(d=l-1),1==(u=e(v=t(M,d,l),C,g=v.length,w=C.length))&&(d--,n(v,L<g?I:M,g,l))):(0==d&&(u=d=1),v=M.slice()),(g=v.length)<w&&v.unshift(0),n(C,v,w,l),-1==u&&(u=e(M,C,L,w=C.length))<1&&(d++,n(C,L<w?I:M,w,l)),w=C.length):0===u&&(d++,C=[0]),m[h++]=d,u&&C[0]?C[w++]=A[_]||0:(C=[A[_]],w=1)}while((_++<b||void 0!==C[0])&&S--);p=void 0!==C[0]}m[0]||m.shift()}if(1==f)y.e=c,e_=p;else{for(h=1,d=m[0];d>=10;d/=10)h++;y.e=h+c*f-1,z_(y,s?o+y.e+1:o,a,p)}return y}}();function z_(t,e,n,r){var i,o,a,s,l,u,c,h,d,f=t.constructor;t:if(null!=e){if(!(h=t.d))return t;for(i=1,s=h[0];s>=10;s/=10)i++;if((o=e-i)<0)o+=7,a=e,l=(c=h[d=0])/__(10,i-a-1)%10|0;else if((d=Math.ceil((o+1)/7))>=(s=h.length)){if(!r)break t;for(;s++<=d;)h.push(0);c=l=0,i=1,a=(o%=7)-7+1}else{for(c=s=h[d],i=1;s>=10;s/=10)i++;l=(a=(o%=7)-7+i)<0?0:c/__(10,i-a-1)%10|0}if(r=r||e<0||void 0!==h[d+1]||(a<0?c:c%__(10,i-a-1)),u=n<4?(l||r)&&(0==n||n==(t.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?a>0?c/__(10,i-a):0:h[d-1])%10&1||n==(t.s<0?8:7)),e<1||!h[0])return h.length=0,u?(e-=t.e+1,h[0]=__(10,(7-e%7)%7),t.e=-e||0):h[0]=t.e=0,t;if(0==o?(h.length=d,s=1,d--):(h.length=d+1,s=__(10,7-o),h[d]=a>0?(c/__(10,i-a)%__(10,a)|0)*s:0),u)for(;;){if(0==d){for(o=1,a=h[0];a>=10;a/=10)o++;for(a=h[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(t.e++,h[0]==O_&&(h[0]=1));break}if(h[d]+=s,h[d]!=O_)break;h[d--]=0,s=1}for(o=h.length;0===h[--o];)h.pop()}return y_&&(t.e>f.maxE?(t.d=null,t.e=NaN):t.e<f.minE&&(t.e=0,t.d=[0])),t}function F_(t,e,n){if(!t.isFinite())return Z_(t);var r,i=t.e,o=B_(t.d),a=o.length;return e?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+Y_(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+Y_(-i-1)+o,n&&(r=n-a)>0&&(o+=Y_(r))):i>=a?(o+=Y_(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Y_(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=Y_(r))),o}function H_(t,e){var n=t[0];for(e*=7;n>=10;n/=10)e++;return e}function W_(t,e,n){if(e>R_)throw y_=!0,n&&(t.precision=n),Error(w_);return z_(new t(p_),e,1,!0)}function G_(t,e,n){if(e>A_)throw Error(w_);return z_(new t(v_),e,n,!0)}function U_(t){var e=t.length-1,n=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function Y_(t){for(var e="";t--;)e+="0";return e}function j_(t,e,n,r){var i,o=new t(1),a=Math.ceil(r/7+4);for(y_=!1;;){if(n%2&&rb((o=o.times(e)).d,a)&&(i=!0),0===(n=E_(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}rb((e=e.times(e)).d,a)}return y_=!0,o}function V_(t){return 1&t.d[t.d.length-1]}function X_(t,e,n){for(var r,i=new t(e[0]),o=0;++o<e.length;){if(!(r=new t(e[o])).s){i=r;break}i[n](r)&&(i=r)}return i}function K_(t,e){var n,r,i,o,a,s,l,u=0,c=0,h=0,d=t.constructor,f=d.rounding,p=d.precision;if(!t.d||!t.d[0]||t.e>17)return new d(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(y_=!1,l=p):l=e,s=new d(.03125);t.e>-2;)t=t.times(s),h+=5;for(l+=r=Math.log(__(2,h))/Math.LN10*2+5|0,n=o=a=new d(1),d.precision=l;;){if(o=z_(o.times(t),l,1),n=n.times(++c),B_((s=a.plus(k_(o,n,l,1))).d).slice(0,l)===B_(a.d).slice(0,l)){for(i=h;i--;)a=z_(a.times(a),l,1);if(null!=e)return d.precision=p,a;if(!(u<3&&D_(a.d,l-r,f,u)))return z_(a,d.precision=p,f,y_=!0);d.precision=l+=10,n=o=s=new d(1),c=0,u++}a=s}}function q_(t,e){var n,r,i,o,a,s,l,u,c,h,d,f=1,p=t,v=p.d,g=p.constructor,y=g.rounding,m=g.precision;if(p.s<0||!v||!v[0]||!p.e&&1==v[0]&&1==v.length)return new g(v&&!v[0]?-1/0:1!=p.s?NaN:v?0:p);if(null==e?(y_=!1,c=m):c=e,g.precision=c+=10,r=(n=B_(v)).charAt(0),!(Math.abs(o=p.e)<15e14))return u=W_(g,c+2,m).times(o+""),p=q_(new g(r+"."+n.slice(1)),c-10).plus(u),g.precision=m,null==e?z_(p,m,y,y_=!0):p;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=B_((p=p.times(t)).d)).charAt(0),f++;for(o=p.e,r>1?(p=new g("0."+n),o++):p=new g(r+"."+n.slice(1)),h=p,l=a=p=k_(p.minus(1),p.plus(1),c,1),d=z_(p.times(p),c,1),i=3;;){if(a=z_(a.times(d),c,1),B_((u=l.plus(k_(a,new g(i),c,1))).d).slice(0,c)===B_(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(W_(g,c+2,m).times(o+""))),l=k_(l,new g(f),c,1),null!=e)return g.precision=m,l;if(!D_(l.d,c-10,y,s))return z_(l,g.precision=m,y,y_=!0);g.precision=c+=10,u=a=p=k_(h.minus(1),h.plus(1),c,1),d=z_(p.times(p),c,1),i=s=1}l=u,i+=2}}function Z_(t){return String(t.s*t.s/0)}function $_(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);r++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(r,i)){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&t.d.push(+e.slice(0,r)),i-=7;r<i;)t.d.push(+e.slice(r,r+=7));r=7-(e=e.slice(r)).length}else r-=i;for(;r--;)e+="0";t.d.push(+e),y_&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function Q_(t,e){var n,r,i,o,a,s,l,u,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),I_.test(e))return $_(t,e)}else if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(T_.test(e))n=16,e=e.toLowerCase();else if(b_.test(e))n=2;else{if(!L_.test(e))throw Error(C_+e);n=8}for((o=e.search(/p/i))>0?(l=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),a=(o=e.indexOf("."))>=0,r=t.constructor,a&&(o=(s=(e=e.replace(".","")).length)-o,i=j_(r,new r(n),o,2*o)),o=c=(u=P_(e,n,O_)).length-1;0===u[o];--o)u.pop();return o<0?new r(0*t.s):(t.e=H_(u,c),t.d=u,y_=!1,a&&(t=k_(t,i,4*s)),l&&(t=t.times(Math.abs(l)<54?__(2,l):jb.pow(2,l))),y_=!0,t)}function J_(t,e,n,r,i){var o,a,s,l,u=t.precision,c=Math.ceil(u/7);for(y_=!1,l=n.times(n),s=new t(r);;){if(a=k_(s.times(l),new t(e++*e++),u,1),s=i?r.plus(a):r.minus(a),r=k_(a.times(l),new t(e++*e++),u,1),void 0!==(a=s.plus(r)).d[c]){for(o=c;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=r,r=a,a=o}return y_=!0,a.d.length=c+1,a}function tb(t,e){for(var n=t;--e;)n*=t;return n}function eb(t,e){var n,r=e.s<0,i=G_(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return n_=r?4:1,e;if((n=e.divToInt(i)).isZero())n_=r?3:2;else{if((e=e.minus(n.times(i))).lte(o))return n_=V_(n)?r?2:3:r?4:1,e;n_=V_(n)?r?1:4:r?3:2}return e.minus(i).abs()}function nb(t,e,n,r){var i,o,a,s,l,u,c,h,d,f=t.constructor,p=void 0!==n;if(p?(N_(n,1,d_),void 0===r?r=f.rounding:N_(r,0,8)):(n=f.precision,r=f.rounding),t.isFinite()){for(p?(i=2,16==e?n=4*n-3:8==e&&(n=3*n-2)):i=e,(a=(c=F_(t)).indexOf("."))>=0&&(c=c.replace(".",""),(d=new f(1)).e=c.length-a,d.d=P_(F_(d),10,i),d.e=d.d.length),o=l=(h=P_(c,10,i)).length;0==h[--l];)h.pop();if(h[0]){if(a<0?o--:((t=new f(t)).d=h,t.e=o,h=(t=k_(t,d,n,r,0,i)).d,o=t.e,u=e_),a=h[n],s=i/2,u=u||void 0!==h[n+1],u=r<4?(void 0!==a||u)&&(0===r||r===(t.s<0?3:2)):a>s||a===s&&(4===r||u||6===r&&1&h[n-1]||r===(t.s<0?8:7)),h.length=n,u)for(;++h[--n]>i-1;)h[n]=0,n||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(a=0,c="";a<l;a++)c+=f_.charAt(h[a]);if(p){if(l>1)if(16==e||8==e){for(a=16==e?4:3,--l;l%a;l++)c+="0";for(l=(h=P_(c,i,e)).length;!h[l-1];--l);for(a=1,c="1.";a<l;a++)c+=f_.charAt(h[a])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}else c=p?"0p+0":"0";c=(16==e?"0x":2==e?"0b":8==e?"0o":"")+c}else c=Z_(t);return t.s<0?"-"+c:c}function rb(t,e){if(t.length>e)return t.length=e,!0}function ib(t){return new this(t).abs()}function ob(t){return new this(t).acos()}function ab(t){return new this(t).acosh()}function sb(t,e){return new this(t).plus(e)}function lb(t){return new this(t).asin()}function ub(t){return new this(t).asinh()}function cb(t){return new this(t).atan()}function hb(t){return new this(t).atanh()}function db(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(n=e.s<0?G_(this,r,i):new this(0)).s=t.s:!t.d||e.isZero()?(n=G_(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,n=this.atan(k_(t,e,o,1)),e=G_(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(k_(t,e,o,1)):(n=G_(this,o,1).times(e.s>0?.25:.75)).s=t.s:n=new this(NaN),n}function fb(t){return new this(t).cbrt()}function pb(t){return z_(t=new this(t),t.e+1,2)}function vb(t,e,n){return new this(t).clamp(e,n)}function gb(t){if(!t||"object"!=typeof t)throw Error(m_+"Object expected");var e,n,r,i=!0===t.defaults,o=["precision",1,d_,"rounding",0,8,"toExpNeg",-h_,0,"toExpPos",0,h_,"maxE",0,h_,"minE",-h_,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(n=o[e],i&&(this[n]=g_[n]),void 0!==(r=t[n])){if(!(E_(r)===r&&r>=o[e+1]&&r<=o[e+2]))throw Error(C_+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=g_[n]),void 0!==(r=t[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(C_+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(x_);this[n]=!0}else this[n]=!1}return this}function yb(t){return new this(t).cos()}function mb(t){return new this(t).cosh()}function Cb(t,e){return new this(t).div(e)}function wb(t){return new this(t).exp()}function xb(t){return z_(t=new this(t),t.e+1,3)}function Sb(){var t,e,n=new this(0);for(y_=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)n.d&&(n=n.plus(e.times(e)));else{if(e.s)return y_=!0,new this(1/0);n=e}return y_=!0,n.sqrt()}function Eb(t){return t instanceof jb||t&&t.toStringTag===S_||!1}function _b(t){return new this(t).ln()}function bb(t,e){return new this(t).log(e)}function Tb(t){return new this(t).log(2)}function Lb(t){return new this(t).log(10)}function Ib(){return X_(this,arguments,"lt")}function Ob(){return X_(this,arguments,"gt")}function Rb(t,e){return new this(t).mod(e)}function Ab(t,e){return new this(t).mul(e)}function Mb(t,e){return new this(t).pow(e)}function Bb(t){var e,n,r,i,o=0,a=new this(1),s=[];if(void 0===t?t=this.precision:N_(t,1,d_),r=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=e[o])>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(x_);for(e=crypto.randomBytes(r*=4);o<r;)(i=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,o):(s.push(i%1e7),o+=4);o=r/4}else for(;o<r;)s[o++]=1e7*Math.random()|0;for(t%=7,(r=s[--o])&&t&&(i=__(10,7-t),s[o]=(r/i|0)*i);0===s[o];o--)s.pop();if(o<0)n=0,s=[0];else{for(n=-1;0===s[0];n-=7)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<7&&(n-=7-r)}return a.e=n,a.d=s,a}function Nb(t){return z_(t=new this(t),t.e+1,this.rounding)}function Db(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Pb(t){return new this(t).sin()}function kb(t){return new this(t).sinh()}function zb(t){return new this(t).sqrt()}function Fb(t,e){return new this(t).sub(e)}function Hb(){var t=0,e=arguments,n=new this(e[t]);for(y_=!1;n.s&&++t<e.length;)n=n.plus(e[t]);return y_=!0,z_(n,this.precision,this.rounding)}function Wb(t){return new this(t).tan()}function Gb(t){return new this(t).tanh()}function Ub(t){return z_(t=new this(t),t.e+1,1)}M_[Symbol.for("nodejs.util.inspect.custom")]=M_.toString,M_[Symbol.toStringTag]="Decimal";var Yb,jb=M_.constructor=function t(e){var n,r,i;function o(t){var e,n,r,i=this;if(!(i instanceof o))return new o(t);if(i.constructor=o,Eb(t))return i.s=t.s,void(y_?!t.d||t.e>o.maxE?(i.e=NaN,i.d=null):t.e<o.minE?(i.e=0,i.d=[0]):(i.e=t.e,i.d=t.d.slice()):(i.e=t.e,i.d=t.d?t.d.slice():t.d));if("number"===(r=typeof t)){if(0===t)return i.s=1/t<0?-1:1,i.e=0,void(i.d=[0]);if(t<0?(t=-t,i.s=-1):i.s=1,t===~~t&&t<1e7){for(e=0,n=t;n>=10;n/=10)e++;return void(y_?e>o.maxE?(i.e=NaN,i.d=null):e<o.minE?(i.e=0,i.d=[0]):(i.e=e,i.d=[t]):(i.e=e,i.d=[t]))}return 0*t!=0?(t||(i.s=NaN),i.e=NaN,void(i.d=null)):$_(i,t.toString())}if("string"!==r)throw Error(C_+t);return 45===(n=t.charCodeAt(0))?(t=t.slice(1),i.s=-1):(43===n&&(t=t.slice(1)),i.s=1),I_.test(t)?$_(i,t):Q_(i,t)}if(o.prototype=M_,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=gb,o.clone=t,o.isDecimal=Eb,o.abs=ib,o.acos=ob,o.acosh=ab,o.add=sb,o.asin=lb,o.asinh=ub,o.atan=cb,o.atanh=hb,o.atan2=db,o.cbrt=fb,o.ceil=pb,o.clamp=vb,o.cos=yb,o.cosh=mb,o.div=Cb,o.exp=wb,o.floor=xb,o.hypot=Sb,o.ln=_b,o.log=bb,o.log10=Lb,o.log2=Tb,o.max=Ib,o.min=Ob,o.mod=Rb,o.mul=Ab,o.pow=Mb,o.random=Bb,o.round=Nb,o.sign=Db,o.sin=Pb,o.sinh=kb,o.sqrt=zb,o.sub=Fb,o.sum=Hb,o.tan=Wb,o.tanh=Gb,o.trunc=Ub,void 0===e&&(e={}),e&&!0!==e.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<i.length;)e.hasOwnProperty(r=i[n++])||(e[r]=this[r]);return o.config(e),o}(g_);p_=new jb(p_),v_=new jb(v_);var Vb,Xb=function(t){return"number"==typeof t?Number.isNaN(t):"string"!=typeof t||Number.isNaN(Number.parseFloat(t))},Kb=function(t,e,n){return void 0===n&&(n=!1),(null==t?void 0:t.length)?t.reduce((function(t,r){var i=Su(r,e),o=Xb(i);if(n&&o)return t;var a=o?0:i;return t.push(new jb(a)),t}),[]):[]},qb=function(t,e){var n=Kb(t,e);return n.length?jb.sum.apply(jb,XC([],VC(n),!1)).toNumber():0},Zb=function(t,e,n){var r=Kb(e,n,!0);if(null==r?void 0:r.length)return jb[t].apply(jb,XC([],VC(r),!1)).toNumber()},$b=((Yb={})[t.Aggregation.SUM]=qb,Yb[t.Aggregation.MIN]=function(t,e){return Zb("min",t,e)},Yb[t.Aggregation.MAX]=function(t,e){return Zb("max",t,e)},Yb[t.Aggregation.AVG]=function(t,e){var n=Kb(t,e);return(null==n?void 0:n.length)?jb.sum.apply(jb,XC([],VC(n),!1)).dividedBy(n.length).toNumber():0},Yb),Qb=function(t){var e=t.spreadsheet,n=t.position,r=t.tooltipContainer,i=t.autoAdjustBoundary,o=e.getCanvasElement(),a=n.x+pw.x,s=n.y+pw.y;if(!i||!o)return{x:a,y:s};var l="body"===i,u=e.facet.panelBBox,c=u.maxX,h=u.maxY,d=e.options,f=d.width,p=d.height,v=o.getBoundingClientRect(),g=v.top,y=v.left,m=r.getBoundingClientRect(),C=m.width,w=m.height,x=document.body.getBoundingClientRect(),S=x.width,E=x.height,_=l?S:Math.min(f,c)+y,b=l?E:Math.min(p,h)+g;return a+C>=_&&(a=_-C),s+w>=b&&(s=b-w),{x:a,y:s}},Jb=function(t){return UC({operator:{onClick:cs,menus:[]},enterable:!0,enableFormat:!0},t)},tT=function(t){return UC(UC({},null==t?void 0:t.colQuery),null==t?void 0:t.rowQuery)},eT=function(t,e){var n;if(t){var r=e.style,i=e.className,o=void 0===i?[]:i,a=e.visible;if(r&&Object.assign(t.style,r),o.length){var s=o.filter(Boolean);(n=t.classList).add.apply(n,XC([],VC(s),!1))}t.classList.toggle(hw,a),t.classList.toggle(dw,!a)}},nT=function(t){var e=uv(t)&&Number.isNaN(t),n=""===t;return dv(t)||e||n?"-":t},rT=function(t,e){var n,r=null===(n=null==t?void 0:t.dataSet)||void 0===n?void 0:n.getFieldFormatter(e);return function(t,e){return nT(r(t,e))}},iT=function(t,e){var n,r=e.data,i=e.field,o=e.valueField,a=e.useCompleteDataForFormatter,s=void 0===a||a,l=null===(n=null==t?void 0:t.dataSet)||void 0===n?void 0:n.getFieldName(i),u=rT(t,i),c=_a(r[i])?JSON.stringify(r[i]):r[i];return{name:l,value:u(o||c,s?r:void 0)}},oT=function(t,e,n){return op(Xf(nd([],e),(function(t){return t!==fo&&n[t]})),(function(e){return iT(t,{data:n,field:e,useCompleteDataForFormatter:!1})}))},aT=function(t,e,n){var r,i,o,a,s=(n||{}).isTotals,l=[],u=[];if(e){var c=null===(i=null===(r=null==t?void 0:t.dataSet)||void 0===r?void 0:r.fields)||void 0===i?void 0:i.columns,h=null===(a=null===(o=null==t?void 0:t.dataSet)||void 0===o?void 0:o.fields)||void 0===a?void 0:a.rows;l=oT(t,c,e),u=oT(t,h,e)}return ov(l)&&ov(u)&&s&&(l=[{value:lw("总计")}]),{cols:l,rows:u}},sT=function(t,e,n){if(e){var r=n.isTotals,i=e[fo],o=e[i],a=[];if(r)a.push(iT(t,{data:e,field:i,valueField:Su(e,ho)}));else if(function(t){return _a(t)&&"values"in t}(o)&&t.getTooltipDataItemMappingCallback()){var s=TS(e,t.getTooltipDataItemMappingCallback());Tf(s,(function(e,n){a.push(iT(t,{data:s,field:n}))}))}else a.push(iT(t,{data:e,field:i}));return a}},lT=function(t,e,n){var r;if(n)return lw("总计");var i=null===(r=null==t?void 0:t.dataSet)||void 0===r?void 0:r.getFieldName(e);return i&&"undefined"!==i?i:""},uT=function(t,e,n){void 0===n&&(n=!0);var r=[];return Tf(e,(function(e,i){Tf(t,(function(t){n||-1===t.colIndex?n&&-1!==t.rowIndex&&r.push([t.rowIndex,i]):r.push([i,t.colIndex])}))})),r},cT=function(e,n){var r,i=n.rowLeafNodes,o=n.colLeafNodes,a=e.interaction.getState(),s=a.nodes,l=void 0===s?[]:s,u=a.cells,c=void 0===u?[]:u,h=null===(r=null==c?void 0:c[0])||void 0===r?void 0:r.type;return h===t.CellTypes.COL_CELL?uT(l,i,!1):h===t.CellTypes.ROW_CELL?uT(l,o):[]},hT=function(e,n,r){var i,o=null===(i=e.facet)||void 0===i?void 0:i.layoutResult,a=function(e){var r=null==n?void 0:n.getMeta(),i=null==r?void 0:r.isTotals,a=(null==n?void 0:n.cellType)===t.CellTypes.COL_CELL,s=(null==n?void 0:n.cellType)===t.CellTypes.ROW_CELL;if(!a&&!s)return!1;var l=o.colNodes.find((function(t){return t.colIndex===e.colIndex})),u=o.rowNodes.find((function(t){return t.rowIndex===e.rowIndex})),c=a?null==u?void 0:u.isTotals:null==l?void 0:l.isTotals;return!i&&(null==e?void 0:e.isTotals)||i&&c};return r?ed(op(cT(e,o),(function(t){var e=VC(t,2),n=e[0],r=e[1],i=o.getCellMeta(n,r);if(!a(i))return(null==i?void 0:i.data)||tT(i)}))):e.interaction.getActiveCells().filter((function(t){var e=null==t?void 0:t.getMeta();return!a(e)})).map((function(t){var e=null==t?void 0:t.getMeta();return(null==e?void 0:e.data)||tT(e)}))},dT=function(t){var e=t.spreadsheet,n=t.getShowValue,r=t.targetCell,i=t.options,o=void 0===i?{}:i,a=[],s={},l=e.isTableMode();return l&&(null==o?void 0:o.showSingleTips)?[{selectedData:e.dataSet.getMultiData({}),name:"",value:""}]:(Tf(hT(e,r,o.showSingleTips),(function(t){var e;s[null==t?void 0:t[fo]]?null===(e=s[null==t?void 0:t[fo]])||void 0===e||e.push(t):s[null==t?void 0:t[fo]]=[t]})),Rv(s,(function(t,r){var i,u=lT(e,r,null==o?void 0:o.isTotals),c=null==n?void 0:n(t,ho);if(l)c="";else if(Yf(t,(function(t){return Xb(Su(t,ho))}))){var h=e.options.placeholder;c=Wx(s,h)}else{var d=rT(e,r),f=qb(t,ho);c=null!==(i=null==d?void 0:d(f,t))&&void 0!==i?i:parseFloat(f.toPrecision(16))}a.push({selectedData:t,name:u,value:c})})),a)},fT=function(t){if(t){var e=t.getMeta();if(!e.isTotals){var n=$f(e.spreadsheet.dataCfg.meta,{field:e.field||e.value||e.valueField}),r=null==n?void 0:n.field;return e.spreadsheet.dataSet.getFieldDescription(r)}}},pT=function(t){var e=t.spreadsheet,n=t.cellInfos,r=void 0===n?[]:n,i=t.options,o=void 0===i?{}:i,a=t.getShowValue,s=t.targetCell,l=null,u=null,c=null,h=fT(s),d=r[0]||{};if(null==o?void 0:o.hideSummary)if(o.showSingleTips){var f=function(t){var n,r;return null===(r=$f(null===(n=e.dataCfg)||void 0===n?void 0:n.meta,(function(e){return(null==e?void 0:e.field)===t})))||void 0===r?void 0:r.name},p=rT(e,d.valueField)(d.value),v=o.enableFormat?f(d.value)||p:f(d.valueField);d.name=v||""}else u=aT(e,d,o),c=sT(e,d,o);else l=dT({spreadsheet:e,options:o,targetCell:s,getShowValue:a});var g=d||{};return{summaries:l,interpretation:g.interpretation,infos:g.infos,tips:g.tips,name:g.name,headInfo:u,details:c,description:h}},vT=function(t){return op(t,(function(t){var e=t.getMeta();return Yl({},e.query||{},Gg(e,["colIndex","rowIndex"]))}))},gT=function(t){var e=[];return t.interaction.isSelectedState()?(t.interaction.getActiveCells().forEach((function(n){var r=t.dataCfg.fields.valueInCols,i=n.getMeta(),o=tT(i);if(!ov(i)&&!ov(o)){var a=UC(UC({},o),{colIndex:r?i.colIndex:null,rowIndex:r?null:i.rowIndex});e.find((function(t){return av(a,t)}))||e.push(a)}})),e):[]},yT=function(e,n){void 0===e&&(e={});var r=function(t){return s_(e,t)},i=e.col,o=e.row,a=e.data,s=e.corner;return n===t.CellTypes.COL_CELL?r(i):n===t.CellTypes.ROW_CELL?r(o):n===t.CellTypes.DATA_CELL?r(a):n===t.CellTypes.CORNER_CELL?r(s):UC({},e)},mT=function(t,e){var n;if(e&&t){var r=null===(n=t.getCellType)||void 0===n?void 0:n.call(t,null==e?void 0:e.target);return yT(t.options.tooltip,r)}},CT=function(t,e){var n=e.defaultMenus,r=void 0===n?[]:n,i=e.cell,o=function(t){return void 0===t&&(t=[]),t.filter((function(t){var e;return Na(t.visible)?t.visible(i):null===(e=t.visible)||void 0===e||e})).map((function(t){return t.children&&(t.children=o(t.children)),t}))},a=o(t.menus);return{onClick:t.onClick,menus:ed(XC(XC([],VC(r),!1),VC(a),!1))}},wT=function(t,e){for(var n=!1,r=e;r&&r!==document.body;){if(t===r){n=!0;break}r=r.parentElement}return n},xT=function(){function t(t){var e=this;this.getFieldMeta=fu((function(t,n){return $f(e.meta||n,(function(e){return e.field===t}))})),this.spreadsheet=t}return t.prototype.getFieldName=function(t){return Su(this.getFieldMeta(t,this.meta),"name",t)},t.prototype.getFieldFormatter=function(t){return Su(this.getFieldMeta(t,this.meta),"formatter",Ba)},t.prototype.getFieldDescription=function(t){return Su(this.getFieldMeta(t,this.meta),"description")},t.prototype.setDataCfg=function(t){this.getFieldMeta.cache.clear();var e=this.processDataCfg(t),n=e.fields,r=e.meta,i=e.data,o=e.totalData,a=e.sortParams,s=e.filterParams;this.fields=n,this.meta=r,this.originData=i,this.totalData=o,this.sortParams=a,this.filterParams=s,this.displayData=this.originData,this.indexesData=[]},t.prototype.getDisplayDataSet=function(){return this.displayData},t.prototype.getValueRangeByField=function(t){var e,n,r,i=(n=this.spreadsheet,r=t,n.store.get(qo,Zo)[r]);if(i)return i;var o=ed(op(this.originData,(function(e){var n=e[t];return dv(n)?null:Number.parseFloat(n)}))),a={maxValue:Bv(o),minValue:Uv(o)};return function(t,e){var n=t.store.get(qo,Zo);t.store.set(qo,UC(UC({},n),e))}(this.spreadsheet,((e={})[t]=a,e)),a},t.prototype.moreThanOneValue=function(){var t,e;return(null===(e=null===(t=this.fields)||void 0===t?void 0:t.values)||void 0===e?void 0:e.length)>1},t}(),ST=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handleDimensionValuesSort=function(){Tf(e.sortParams,(function(t){var n=t.sortFieldId,r=t.sortByMeasure;if(n){var i=XC([],VC(e.sortedDimensionValues[n]||[]),!1),o=mE({dataSet:e,sortParam:t,originValues:i,isSortByMeasure:!ov(r)});e.sortedDimensionValues[n]=o}}))},e.getCustomData=function(t){for(var n,r=!1,i=e.indexesData,o=function(e){var o=t[e];r?i=gv(o)?tx(i):null===(n=Lp(i))||void 0===n?void 0:n.map((function(t){return t&&Su(t,o)})):gv(o)?r=!0:i=null==i?void 0:i[o]},a=0;a<t.length;a++)o(a);return i},e.getTotalStatus=function(t){var n=e.fields,r=n.columns,i=n.rows,o=function(e,n){if(n){var r=$f(e,(function(e){return!xp(t,e)}));return r&&r!==rp(e)}return Yf(e,(function(e){return!xp(t,e)}))},a=function(t,e){return e?t.filter((function(t){return t!==fo})):t};return{isRowTotal:o(a(i,!e.spreadsheet.isValueInCols())),isRowSubTotal:o(i,!0),isColTotal:o(a(r,e.spreadsheet.isValueInCols())),isColSubTotal:o(r,!0)}},e}return GC(e,t),e.prototype.setDataCfg=function(e){var n=this;t.prototype.setDataCfg.call(this,e),this.sortedDimensionValues={},this.rowPivotMeta=new Map,this.colPivotMeta=new Map,this.totalData=[].concat(rx(e.data,e.fields)).concat(this.totalData),Fw.getInstance().debugCallback(Pw,(function(){var t=n.fields,e=oE({rows:t.rows,columns:t.columns,originData:n.originData,totalData:n.totalData,indexesData:n.indexesData,sortedDimensionValues:n.sortedDimensionValues,rowPivotMeta:n.rowPivotMeta,colPivotMeta:n.colPivotMeta}).indexesData;n.indexesData=e})),this.handleDimensionValuesSort()},e.prototype.transformDrillDownData=function(t,e,n){var r,i=this,o=this.fields,a=o.columns,s=o.values,l=XC(XC([],VC(_w.getFieldPath(n,!0)),!1),[t],!1),u=this.spreadsheet.store,c=this.standardTransform(e,s),h=rx(c,{columns:this.fields.columns,rows:l}),d=yf(c,h),f=null==n?void 0:n.id,p=null!==(r=u.get("drillDownIdPathMap"))&&void 0!==r?r:new Map;p.has(f)&&(Tf(p.get(f),(function(t){Om(i.indexesData,t)})),aE(this.rowPivotMeta,f));var v=oE({rows:l,columns:a,originData:d,totalData:h,indexesData:this.indexesData,sortedDimensionValues:this.sortedDimensionValues,rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta}),g=v.paths,y=v.indexesData,m=v.rowPivotMeta,C=v.colPivotMeta,w=v.sortedDimensionValues;this.indexesData=y,this.rowPivotMeta=m,this.colPivotMeta=C,this.sortedDimensionValues=w,p.set(f,g),u.set("drillDownIdPathMap",p)},e.prototype.clearDrillDownData=function(t){var e=this,n=this.spreadsheet.store,r=n.get("drillDownIdPathMap");if(r){var i=n.get("drillDownDataCache",[]);if(t){var o=r.get(t);o&&Tf(o,(function(t){Om(e.indexesData,t)})),aE(this.rowPivotMeta,t),r.delete(t);var a=Xf(i,(function(t){return r.has(null==t?void 0:t.rowId)}));n.set("drillDownDataCache",a);var s=a.map((function(t){return null==t?void 0:t.drillLevel})),l=n.get("drillDownFieldInLevel",[]).filter((function(t){return Op(s,null==t?void 0:t.drillLevel)}));n.set("drillDownFieldInLevel",l)}else{r.clear();var u=this.spreadsheet.store.get("originalDataCfg");ov(u)||this.spreadsheet.setDataCfg(u),this.spreadsheet.store.set("drillItemsNum",-1),this.spreadsheet.store.set("drillDownDataCache",[]),this.spreadsheet.store.set("drillDownFieldInLevel",[])}n.set("drillDownIdPathMap",r)}},e.prototype.standardTransform=function(t,e){if(ov(e))return t;var n=[];return Tf(e,(function(e){Tf(t,(function(t){var r;xp(t,e)&&n.push(UC(UC({},t),((r={})[fo]=e,r.$$value$$=t[e],r)))}))})),n},e.prototype.processDataCfg=function(t){var e,n,r=t.data,i=t.meta,o=void 0===i?[]:i,a=t.fields,s=t.sortParams,l=void 0===s?[]:s,u=t.totalData,c=a.columns,h=a.rows,d=a.values,f=a.valueInCols,p=a.customValueOrder,v=c,g=h;f?v=this.isCustomMeasuresPosition(p)?this.handleCustomMeasuresOrder(p,v):Lm(XC(XC([],VC(c),!1),[fo],!1)):g=this.isCustomMeasuresPosition(p)?this.handleCustomMeasuresOrder(p,g):Lm(XC(XC([],VC(h),!1),[fo],!1));var y=(null===(n=null===(e=this.spreadsheet)||void 0===e?void 0:e.options)||void 0===n?void 0:n.cornerExtraFieldText)||lw("数值"),m={field:fo,name:y,formatter:function(t){return function(t){var e=$f(o,(function(e){return e.field===t}));return Su(e,"name",t)}(t)}},C=XC(XC([],VC(o),!1),[m],!1),w=this.standardTransform(r,d),x=this.standardTransform(u,d);return{data:w,meta:C,fields:UC(UC({},a),{rows:g,columns:v,values:d}),totalData:x,sortParams:l}},e.prototype.getDimensionValues=function(t,e){var n,r,i,o,a=this.fields||{},s=a.rows,l=void 0===s?[]:s,u=a.columns,c=void 0===u?[]:u,h=new Map,d=[];if(Op(l,t)?(h=this.rowPivotMeta,d=l):Op(c,t)&&(h=this.colPivotMeta,d=c),!ov(e)){var f=[],p=[],v=function(t){var n=Su(e,t);p.push("".concat(n));var r=p.join("".concat(Go));if(h.has(n)&&!gv(n)){var a=null===(i=h.get(n))||void 0===i?void 0:i.childField;if(h=h.get(n).children,$f(g.sortParams,(function(t){return t.sortFieldId===a}))&&g.sortedDimensionValues[a]){var s=null===(o=g.sortedDimensionValues[a])||void 0===o?void 0:o.filter((function(t){return null==t?void 0:t.includes(r)}));f=nE(XC([],VC(s),!1))}else f=XC([],VC(h.keys()),!1)}},g=this;try{for(var y=jC(d),m=y.next();!m.done;m=y.next()){v(m.value)}}catch(t){n={error:t}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}return ov(f)?[]:Qw($w(XC([],VC(h.keys()),!1),f))}return this.sortedDimensionValues[t]?Qw(nE(XC([],VC(this.sortedDimensionValues[t]),!1))):Qw(XC([],VC(h.keys()),!1))},e.prototype.getTotalValue=function(t){var e,n,r=function(t,e){var n=t.isRowTotal,r=t.isRowSubTotal,i=t.isColTotal,o=t.isColSubTotal,a=e||{},s=a.row,l=a.col,u=s||{},c=u.calcTotals,h=void 0===c?{}:c,d=u.calcSubTotals,f=void 0===d?{}:d,p=l||{},v=p.calcTotals,g=void 0===v?{}:v,y=p.calcSubTotals,m=void 0===y?{}:y,C=function(t,e){if((t.aggregation||t.calcFunc)&&e)return{aggregation:t.aggregation,calcFunc:t.calcFunc}};return C(g,i)||C(m,o)||C(h,n)||C(f,r)}(this.getTotalStatus(t),null===(n=this.spreadsheet.options)||void 0===n?void 0:n.totals)||{},i=r.aggregation,o=r.calcFunc,a=$b[i];if(a||o){var s=this.getMultiData(t),l=void 0;return o?l=o(t,s):a&&(l=a(s,ho)),UC(UC({},t),((e={}).$$value$$=l,e[t[fo]]=l,e))}},e.prototype.getCellData=function(t){var e,n,r,i=t||{},o=i.query,a=i.rowNode,s=i.isTotals,l=void 0!==s&&s,u=this.fields,c=u.columns,h=u.rows,d=h,f=null===(e=this.spreadsheet)||void 0===e?void 0:e.store.get("drillDownIdPathMap"),p=Array.from(null!==(n=null==f?void 0:f.keys())&&void 0!==n?n:[]).some((function(t){return a.id.startsWith(t)}));l&&!p||(d=null!==(r=_w.getFieldPath(a,p))&&void 0!==r?r:h);var v=rE({rowDimensionValues:iE(d,o),colDimensionValues:iE(c,o),careUndefined:l||nx([].concat(h).concat(c),o),rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta}),g=Su(this.indexesData,v);return g||(l?this.getTotalValue(o):g)},e.prototype.getMultiData=function(t,e,n,r){var i;if(ov(t))return ed(Jw(this.indexesData));var o=this.fields,a=o.rows,s=o.columns,l=o.values,u=iE(ov(r)?a:a.concat(r),t),c=iE(s,t),h=rE({rowDimensionValues:u,colDimensionValues:c,careUndefined:!0,isFirstCreate:!0,rowFields:a,colFields:s,rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta}),d=this.getCustomData(h),f=ed(tx(d));if(e){var p=[],v=ex(u,a),g=ex(c,s);if(n)p=v;else if(1===(null===(i=Wl(t))||void 0===i?void 0:i.length)&&xp(t,fo))p=g;else{var y=function(t){return null==(e=null==t?void 0:t.filter((function(t){return!(null==l?void 0:l.includes(t))})))?void 0:e.every((function(t){return gv(t)}));var e},m=y(c),C=y(u);p=m?v:C?g:XC(XC([],VC(v),!1),VC(g),!1)}f=f.filter((function(t){return!(null==p?void 0:p.find((function(e){var n;return e!==fo&&(null===(n=Wl(t))||void 0===n?void 0:n.includes(e))})))}))}return f||[]},e.prototype.getFieldFormatter=function(e,n){return e===vo?this.getFieldFormatterForTotalValue(n):t.prototype.getFieldFormatter.call(this,e)},e.prototype.getFieldFormatterForTotalValue=function(e){var n;return!this.spreadsheet.isValueInCols()&&e&&(n=Su(e.rowQuery,fo)),n=null!=n?n:Su(this.fields.values,0),t.prototype.getFieldFormatter.call(this,n)},e.prototype.handleCustomMeasuresOrder=function(t,e){var n=Lm(XC([],VC(e),!1));return e.length>=t?(n.splice(t,0,fo),n):XC(XC([],VC(n),!1),[fo],!1)},e.prototype.isCustomMeasuresPosition=function(t){return uv(t)},e}(xT),ET=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handleDimensionValueFilter=function(){Tf(e.filterParams,(function(t){var n=t.filterKey,r=t.filteredValues,i=t.customFilter,o=function(t){return t[n]&&!Op(r,t[n])};e.displayData=XC(XC(XC([],VC(e.getStartRows()),!1),VC(Xf(e.getMovableRows(),(function(t){return i?i(t)&&o(t):o(t)}))),!1),VC(e.getEndRows()),!1)}))},e.handleDimensionValuesSort=function(){Tf(e.sortParams,(function(t){var n=t.sortFieldId,r=t.sortBy,i=t.sortFunc,o=t.sortMethod,a=t.query;if(n){var s=e.getMovableRows(),l=[];if(a){var u=[];s.forEach((function(t){for(var e=Object.keys(a),n=!0,r=0;r<e.length;r++){var i=e[r];if(t[i]!==a[i]){n=!1,l.push(t);break}}n&&u.push(t)})),s=u}var c=s;if(i)c=i(UC(UC({},t),{data:s}));else if(r&&!Na(r)){var h=XC([],VC(r),!1).reverse();c=s.sort((function(t,e){var r=h.indexOf(t[n]);return h.indexOf(e[n])-r}))}else if(sE(o)||lE(o)){c=og(s,[(Na(r)?r:null)||n],[o.toLocaleLowerCase()])}l.length&&(c=XC(XC([],VC(c),!1),VC(l),!1)),e.displayData=XC(XC(XC([],VC(e.getStartRows()),!1),VC(c),!1),VC(e.getEndRows()),!1)}}))},e}return GC(e,t),e.prototype.processDataCfg=function(t){return t},e.prototype.setDataCfg=function(e){t.prototype.setDataCfg.call(this,e),this.handleDimensionValueFilter(),this.handleDimensionValuesSort()},e.prototype.getStartRows=function(){var t=(this.spreadsheet.options||{}).frozenRowCount;return t?this.displayData.slice(0,t):[]},e.prototype.getEndRows=function(){var t=(this.spreadsheet.options||{}).frozenTrailingRowCount;return t?this.displayData.slice(-t):[]},e.prototype.getMovableRows=function(){var t=this.displayData,e=this.spreadsheet.options||{},n=e.frozenTrailingRowCount,r=e.frozenRowCount;return t.slice(r||0,-n||void 0)},e.prototype.getDimensionValues=function(t,e){return[]},e.prototype.getCellData=function(t){var e=t.query;if(0!==this.displayData.length||0!==e.rowIndex){var n=this.displayData[e.rowIndex];return"col"in e?n[e.col]:n}},e.prototype.getMultiData=function(t,e){return this.displayData},e}(xT),_T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return GC(e,t),e.prototype.getCellData=function(t){var e=t.query,n=this.fields,r=n.columns,i=n.rows,o=rE({rowDimensionValues:iE(i,e),colDimensionValues:iE(r,e),rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta,isFirstCreate:!0,careUndefined:!0,rowFields:i,colFields:r});return Su(this.indexesData,o)},e.prototype.setDataCfg=function(e){t.prototype.setDataCfg.call(this,e),this.sortedDimensionValues={},this.rowPivotMeta=new Map,this.colPivotMeta=new Map;var n=this.fields,r=oE({rows:n.rows,columns:n.columns,originData:this.originData,totalData:[],indexesData:this.indexesData,sortedDimensionValues:this.sortedDimensionValues,rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta}).indexesData;this.indexesData=r,this.handleDimensionValuesSort()},e.prototype.processDataCfg=function(t){t.fields.rows=[fo],t.fields.valueInCols=!1;var e=t.data,n=YC(t,["data"]),r=t.fields.values,i=[];return Tf(e,(function(t){ov(Dp(Wl(t),r))?i.push(t):Tf(r,(function(e){var n;xp(t,e)&&i.push(UC(UC({},t),((n={})[fo]=e,n.$$value$$=t[e],n)))}))})),UC({data:Lm(i)},n)},e}(ST);!function(t){t.ScrollChange="scroll-change",t.ScrollEnd="scroll-end"}(Vb||(Vb={}));var bT=function(t){function e(e){var n=t.call(this,e)||this;n.isMobile=!1,n.eventHandlers=[],n.scrollFrameId=null,n.getCoordinatesName=function(){return{from:n.isHorizontal?"x1":"y1",to:n.isHorizontal?"x2":"y2"}},n.getCoordinatesWithBBoxExtraPadding=function(){var t=n.theme.size,e=n.isHorizontal?0:t/2,r=n.isHorizontal?t:t/2;return{start:n.thumbOffset+e,end:n.thumbOffset+n.thumbLen-r}},n.current=function(){var t=n.thumbLen/n.trackLen;return n.thumbOffset/n.trackLen/(1-t)},n.updateThumbLen=function(t){if(n.thumbLen!==t){n.thumbLen=t;var e=n.getCoordinatesName();n.thumbShape.attr(e.to,n.thumbOffset+t),n.emitScrollChange(n.thumbOffset/(n.trackLen-n.thumbLen)*n.scrollTargetMaxOffset,!1)}},n.updateThumbOffset=function(t,e){var r;void 0===e&&(e=!0);var i=n.validateRange(t);if(!(n.thumbOffset===i&&0!==i)){n.thumbOffset=i;var o=n.getCoordinatesName(),a=o.from,s=o.to,l=n.getCoordinatesWithBBoxExtraPadding(),u=l.start,c=l.end;n.thumbShape.attr(((r={})[a]=u,r[s]=c,r)),e&&n.emitScrollChange(i/(n.trackLen-n.thumbLen)*n.scrollTargetMaxOffset,!1)}},n.onlyUpdateThumbOffset=function(t){var e;n.updateThumbOffset(t,!1),null===(e=n.get("canvas"))||void 0===e||e.draw()},n.emitScrollChange=function(t,e){void 0===e&&(e=!0),cancelAnimationFrame(n.scrollFrameId),n.scrollFrameId=requestAnimationFrame((function(){n.emit(Vb.ScrollChange,{offset:t,updateThumbOffset:e})}))},n.addEventListener=function(t,e,n){return null==t||t.addEventListener(e,n,!1),{remove:function(){null==t||t.removeEventListener(e,n,!1)}}},n.addEvent=function(t,e,r){t.on(e,r),n.eventHandlers.push({target:t,type:e,handler:r})},n.initScrollBar=function(){n.scrollBarGroup=n.createScrollBarGroup(),n.scrollBarGroup.move(n.position.x,n.position.y),n.bindEvents()},n.createScrollBarGroup=function(){var t=n.addGroup({className:n.isHorizontal?"horizontalBar":"verticalBar"});return n.trackShape=n.createTrackShape(t),n.thumbShape=n.createThumbShape(t),t},n.createTrackShape=function(t){var e=n.theme,r=e.lineCap,i=void 0===r?"round":r,o=e.trackColor,a=e.size,s={lineWidth:a,stroke:o,lineCap:i};return n.isHorizontal?t.addShape("line",{attrs:UC(UC({},s),{x1:0,y1:a/2,x2:n.trackLen,y2:a/2})}):t.addShape("line",{attrs:UC(UC({},s),{x1:a/2,y1:0,x2:a/2,y2:n.trackLen})})},n.createThumbShape=function(t){var e=n.theme,r=e.size,i=e.lineCap,o=void 0===i?"round":i,a={lineWidth:r,stroke:e.thumbColor,lineCap:o,cursor:"default"},s=n.getCoordinatesWithBBoxExtraPadding(),l=s.start,u=s.end;return n.isHorizontal?t.addShape("line",{attrs:UC(UC({},a),{x1:l,y1:r/2,x2:u,y2:r/2})}):t.addShape("line",{attrs:UC(UC({},a),{x1:r/2,y1:l,x2:r/2,y2:u})})},n.bindEvents=function(){n.on("mousedown",n.onStartEvent(!1)),n.on("mouseup",n.onMouseUp),n.on("touchstart",n.onStartEvent(!0)),n.on("touchend",n.onMouseUp),n.trackShape.on("click",n.onTrackClick),n.thumbShape.on("mouseover",n.onTrackMouseOver),n.thumbShape.on("mouseout",n.onTrackMouseOut)},n.onStartEvent=function(t){return function(e){e.preventDefault(),n.isMobile=t;var r=n.isMobile?Su(e,"touches.0",e):e,i=r.clientX,o=r.clientY;n.startPos=n.isHorizontal?i:o,n.bindLaterEvent()}},n.bindLaterEvent=function(){var t=n.get("canvas"),e=document.body,r=[];n.isMobile?(r=[n.addEventListener(e,"touchmove",n.onMouseMove),n.addEventListener(e,"touchend",n.onMouseUp),n.addEventListener(e,"touchcancel",n.onMouseUp)],n.addEvent(t,"touchend",n.onMouseUp),n.addEvent(t,"touchcancel",n.onMouseUp)):(r=[n.addEventListener(e,"mousemove",n.onMouseMove),n.addEventListener(e,"mouseup",n.onMouseUp),n.addEventListener(e,"mouseleave",n.onMouseUp)],n.addEvent(t,"mouseup",n.onMouseUp)),n.clearEvents=function(){r.forEach((function(t){null==t||t.remove()})),Tf(n.eventHandlers,(function(t){var e;null===(e=t.target)||void 0===e||e.off(t.type,t.handler)})),n.eventHandlers.length=0}},n.onTrackClick=function(t){var e=n.isHorizontal?t.x-n.position.x-n.thumbLen/2:t.y-n.position.y-n.thumbLen/2,r=n.validateRange(e);n.updateThumbOffset(r)},n.onMouseMove=function(t){t.preventDefault();var e=n.isMobile?Su(t,"touches.0",t):t,r=e.clientX,i=e.clientY,o=n.isHorizontal?r:i,a=o-n.startPos;n.startPos=o,n.updateThumbOffset(n.thumbOffset+a)},n.onMouseUp=function(t){var e;n.emit(Vb.ScrollEnd,{}),t.preventDefault(),null===(e=n.clearEvents)||void 0===e||e.call(n)},n.onTrackMouseOver=function(){var t=n.theme,e=t.thumbHoverColor,r=t.hoverSize;n.thumbShape.attr("stroke",e),n.thumbShape.attr("lineWidth",r)},n.onTrackMouseOut=function(){var t=n.theme,e=t.thumbColor,r=t.size;n.thumbShape.attr("stroke",e),n.thumbShape.attr("lineWidth",r)},n.validateRange=function(t){var e=t;return t+n.thumbLen>n.trackLen?e=n.trackLen-n.thumbLen:t+n.thumbLen<n.thumbLen&&(e=0),e};var r=e.isHorizontal,i=void 0!==r&&r,o=e.trackLen,a=e.thumbLen,s=e.position,l=e.minThumbLen,u=void 0===l?32:l,c=e.thumbOffset,h=void 0===c?0:c,d=e.theme,f=e.scrollTargetMaxOffset;return n.isHorizontal=i,n.thumbOffset=h,n.trackLen=o,n.thumbLen=a,n.position=s,n.minThumbLen=u,n.theme=d,n.scrollTargetMaxOffset=f,n.initScrollBar(),n}return GC(e,t),e}(xi),TT=function(t,e,n){return t.filter((function(t){return t.level>=e})).map((function(t){return t[n]})).reduce((function(t,e){return t+e}),0)},LT=function(t,e,n){if(n<=0)return{start:0,end:0};var r=Zf(t,(function(n,r){return e>=n&&e<t[r+1]}),0);r=Math.max(r,0);var i=n===e?r:Zf(t,(function(e,r){return n>e&&n<=t[r+1]}),r);return{start:r,end:i=Math.min(-1===i?1/0:i,t.length-2)}},IT=function(t,e){var n=e.width,r=e.originalWidth,i=Math.min(r-n,t);return i<0?0:i},OT=function(t,e,n){var r=Math.min(e-n,t);return r<0?0:r},RT=function(t,e){if(void 0===t&&(t=[]),ov(t))return[];var n=[];return t.forEach((function(t){(t instanceof e&&n.push(t),t instanceof xi)&&t.getChildren().forEach((function(t){t instanceof e&&n.push(t)}))})),n},AT=function(t,e,n){return n.slice(t,e+1).map((function(t){return t.x+t.width}))},MT=function(t,e,n){for(var r=[],i=t;i<e+1;i++)r.push(n.getCellOffsetY(i+1));return r},BT=function(t,e,n){var r=VC(n,4),i=r[0],o=r[1],a=r[2],s=r[3];return t>=i&&t<=o&&e>=a&&e<=s},NT=function(t){for(var e=VC(t,4),n=e[0],r=e[1],i=e[2],o=e[3],a=[],s=n;s<=r;s+=1)for(var l=i;l<=o;l+=1)a.push([s,l]);return a},DT=function(t,e){var n=[],r=[];return Object.keys(e).forEach((function(i){var o=function(t,e){var n=[],r=[];if(ov(t))return ov(e)?{add:n,remove:r}:{add:NT(e),remove:r};if(ov(e))return{add:n,remove:NT(t)};for(var i=VC(t,4),o=i[0],a=i[1],s=i[2],l=i[3],u=VC(e,4),c=u[0],h=u[1],d=u[2],f=u[3],p=o;p<=a;p++)for(var v=s;v<=l;v++)BT(p,v,e)||r.push([p,v]);for(p=c;p<=h;p+=1)for(v=d;v<=f;v+=1)BT(p,v,t)||n.push([p,v]);return{add:n,remove:r}}((null==t?void 0:t[i])||[],e[i]),a=o.add,s=o.remove;n.push.apply(n,XC([],VC(a),!1)),r.push.apply(r,XC([],VC(s),!1))})),{add:n,remove:r}},PT=function(t,e){void 0===e&&(e=!1),this.x=0,this.y=0,this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.width=0,this.height=0,this.originalWidth=0,this.originalHeight=0,this.viewportHeight=0,this.viewportWidth=0,this.facet=t,this.spreadsheet=t.spreadsheet,this.layoutResult=t.layoutResult,e&&this.calculateBBox()},kT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return GC(e,t),e.prototype.calculateBBox=function(){var t=this.getCornerBBoxWidth(),e=this.getCornerBBoxHeight();this.width=t,this.height=e,this.maxX=t,this.maxY=e},e.prototype.getCornerBBoxHeight=function(){var t=this.layoutResult.colsHierarchy;return this.originalHeight=Math.floor(t.height),this.originalHeight},e.prototype.getCornerBBoxWidth=function(){var t=this.layoutResult.rowsHierarchy;return this.originalWidth=Math.floor(t.width+this.facet.getSeriesNumberWidth()),this.spreadsheet.isScrollContainsRowHeader()?this.originalWidth:this.adjustCornerBBoxWidth()},e.prototype.adjustCornerBBoxWidth=function(){var t=this.layoutResult.colsHierarchy,e=this.spreadsheet.options.width,n=.5*e,r=null==t?void 0:t.width,i=e-this.originalWidth;if(this.originalWidth<=n||r<=i)return this.originalWidth;var o=0;return o=r<=e-n?this.originalWidth-(r-i):n,Math.floor(o)},e}(PT),zT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return GC(e,t),e.prototype.calculateBBox=function(){this.originalWidth=this.facet.getRealWidth(),this.originalHeight=this.facet.getRealHeight();var t=this.facet.cornerBBox,e={x:Math.floor(t.maxX),y:Math.floor(t.maxY)},n=this.spreadsheet.theme.scrollBar.size,r=this.spreadsheet.options,i=r.width,o=r.height,a=Math.max(0,i-e.x),s=Math.max(0,o-e.y-n);this.x=e.x,this.y=e.y,this.width=a,this.height=s,this.viewportHeight=Math.abs(Math.floor(Math.min(s,this.originalHeight))),this.viewportWidth=Math.abs(Math.floor(Math.min(a,this.originalWidth))),this.maxX=e.x+this.viewportWidth,this.maxY=e.y+this.viewportHeight,this.minX=e.x,this.minY=e.y;var l=this.spreadsheet.options,u=l.frozenTrailingColCount,c=l.frozenTrailingRowCount;u>0&&(this.viewportWidth=this.width,this.maxX=e.x+this.width),c>0&&(this.viewportHeight=this.height,this.maxY=e.y+this.height)},e}(PT),FT=function(t){function e(e){var n=t.call(this,e)||this;return n.isHeaderCellInViewport=function(t,e,n,r){return t+e>=n&&n+r>=t},n.headerConfig=e,n}return GC(e,t),e.prototype.clearResizeAreaGroup=function(t){var e=this.get("parent"),n=null==e?void 0:e.findById(t);null==n||n.clear()},e.prototype.render=function(t){this.clearResizeAreaGroup(t),this.clear(),this.layout(),this.offset(),this.clip()},e.prototype.onScrollXY=function(t,e,n){this.headerConfig.scrollX=t,this.headerConfig.scrollY=e,this.render(n)},e.prototype.onRowScrollX=function(t,e){this.headerConfig.scrollX=t,this.render(e)},e.prototype.clear=function(){t.prototype.clear.call(this)},e}(xi),HT=function(t){function e(e){var n=t.call(this,e)||this;return n.scrollGroup=n.addGroup({name:Do,zIndex:3}),n}return GC(e,t),e.prototype.onColScroll=function(t,e){this.headerConfig.scrollX!==t&&(this.headerConfig.scrollX=t,this.render(e))},e.prototype.clip=function(){var t=this.headerConfig,e=t.width,n=t.height,r=t.scrollX,i=t.spreadsheet.isFrozenRowHeader();this.scrollGroup.setClip({type:"rect",attrs:{x:i?r:0,y:0,width:i?e:e+r,height:n}})},e.prototype.clear=function(){var t,e;null===(t=this.scrollGroup)||void 0===t||t.clear(),null===(e=this.background)||void 0===e||e.remove(!0)},e.prototype.getCellInstance=function(t,e,n){return new xE(t,e,n)},e.prototype.getCellGroup=function(t){return this.scrollGroup},e.prototype.isColCellInRect=function(t){var e=this.headerConfig,n=e.spreadsheet,r=e.cornerWidth,i=e.width,o=e.scrollX;return i+o>t.x&&o-(n.isFrozenRowHeader()?0:r)<t.x+t.width},e.prototype.layout=function(){var t=this,e=this.headerConfig,n=e.data,r=e.spreadsheet,i=r.options.colCell;Tf(n,(function(e){var n=e;if(t.isColCellInRect(n)){var o=(null==i?void 0:i(n,r,t.headerConfig))||t.getCellInstance(n,r,t.headerConfig);n.belongsCell=o,t.getCellGroup(n).add(o)}}))},e.prototype.offset=function(){var t=this.headerConfig,e=t.position,n=t.scrollX;GE(this.scrollGroup,e.x-n)},e}(FT),WT=function(e){function n(t){return e.call(this,t)||this}return GC(n,e),n.getCornerHeader=function(t,e,r,i,o,a){var s=t.width,l=t.height,u=e.originalWidth,c=e.originalHeight,h=e.width,d=e.height;return new n({data:this.getCornerNodes({x:e.x,y:e.y},u,c,i.rows,i.columns,o.rowsHierarchy,o.colsHierarchy,i.dataSet,r,a),position:{x:e.x,y:e.y},width:h,height:d,originalHeight:c,originalWidth:u,viewportWidth:s,viewportHeight:l,hierarchyType:i.hierarchyType,hierarchyCollapse:i.hierarchyCollapse,rows:i.rows,columns:i.columns,seriesNumberWidth:r,spreadsheet:a})},n.getCornerNodes=function(e,n,r,i,o,a,s,l,u,c){var h,d,f,p,v=[];if(u&&(null==s?void 0:s.sampleNodeForLastLevel)){var g=new _w({id:"",key:Fo,value:lw("序号")});g.x=null==e?void 0:e.x,g.y=null===(h=null==s?void 0:s.sampleNodeForLastLevel)||void 0===h?void 0:h.y,g.width=u,g.height=null===(d=null==s?void 0:s.sampleNodeForLastLevel)||void 0===d?void 0:d.height,g.isPivotMode=!0,g.cornerType=t.CornerNodeType.Series,v.push(g)}if(null==s?void 0:s.sampleNodeForLastLevel)if(c.isHierarchyTreeType()){var y=c.store.get("drillDownFieldInLevel",[]).map((function(t){return t.drillField})),m=new _w({key:"",id:"",value:i.filter((function(t){return!Op(y,t)})).map((function(t){return l.getFieldName(t)})).join("/")});m.x=e.x+u,m.y=null===(f=null==s?void 0:s.sampleNodeForLastLevel)||void 0===f?void 0:f.y,m.width=n-u,m.height=null===(p=null==s?void 0:s.sampleNodeForLastLevel)||void 0===p?void 0:p.height,m.seriesNumberWidth=u,m.isPivotMode=!0,m.spreadsheet=c,m.cornerType=t.CornerNodeType.Row,v.push(m)}else a.sampleNodesForAllLevels.forEach((function(e){var n=i[e.level],r=new _w({key:n,id:"",value:l.getFieldName(n)});r.x=e.x+u,r.y=s.sampleNodeForLastLevel.y,r.width=e.width,r.height=s.sampleNodeForLastLevel.height,r.field=n,r.isPivotMode=!0,r.cornerType=t.CornerNodeType.Row,r.spreadsheet=c,v.push(r)}));return s.sampleNodesForAllLevels.forEach((function(r){if(r.level<s.maxLevel){var i=o[r.level],a=new _w({key:i,id:"",value:l.getFieldName(i)});a.x=e.x,a.y=r.y,a.width=n,a.height=r.height,a.field=i,a.isPivotMode=!0,a.cornerType=t.CornerNodeType.Col,a.spreadsheet=c,v.push(a)}})),v},n.prototype.onCorScroll=function(t,e){this.headerConfig.scrollX=t,this.render(e)},n.prototype.destroy=function(){e.prototype.destroy.call(this)},n.prototype.layout=function(){this.renderCells()},n.prototype.renderCells=function(){var t,e,n,r,i=this,o=this.headerConfig,a=o.data,s=o.spreadsheet,l=null===(e=null===(t=null==s?void 0:s.facet)||void 0===t?void 0:t.cfg)||void 0===e?void 0:e.cornerHeader,u=null===(r=null===(n=null==s?void 0:s.facet)||void 0===n?void 0:n.cfg)||void 0===r?void 0:r.cornerCell;l?l(this,s,this.headerConfig):a.forEach((function(t){var e;u&&(e=u(t,i.headerConfig.spreadsheet,i.headerConfig)),ov(e)&&(e=new SE(t,i.headerConfig.spreadsheet,i.headerConfig)),i.add(e)}))},n.prototype.offset=function(){var t=this.headerConfig.scrollX;GE(this,-t)},n.prototype.clip=function(){var t=this.headerConfig,e=t.width,n=t.height,r=t.scrollX;this.setClip({type:"rect",attrs:{x:r,y:0,width:e,height:n}})},n}(FT),GT=function(t){function e(e){var n=t.call(this,e)||this;return n.render(),n}return GC(e,t),e.prototype.layout=function(){this.addCornerBottomBorder(),this.addCornerRightBorder(),this.addSplitLineShadow()},e.prototype.render=function(){this.clear(),this.layout()},e.prototype.onBorderScroll=function(t){this.cfg.scrollX=t;var e=this.cfg.position;WE(this,e.x-t,0),this.render()},e.prototype.onChangeShadowVisibility=function(t,e){this.cfg.showViewportLeftShadow=t>0,this.cfg.showViewportRightShadow=Math.floor(t)<Math.floor(e),this.render()},e.prototype.addCornerRightBorder=function(){var t,e=this.cfg;if(e.isPivotMode){var n=e.width,r=e.height,i=e.viewportHeight,o=e.position,a=null===(t=e.spreadsheet.theme)||void 0===t?void 0:t.splitLine,s=o.x+n,l=o.y,u=o.y+r+i;this.addShape("line",{attrs:{x1:s,y1:l,x2:s,y2:u,stroke:a.verticalBorderColor,lineWidth:a.verticalBorderWidth,opacity:a.verticalBorderColorOpacity}})}},e.prototype.addCornerBottomBorder=function(){var t,e=this.cfg,n=e.width,r=e.height,i=e.viewportWidth,o=e.position,a=e.scrollX,s=e.scrollContainsRowHeader,l=null===(t=e.spreadsheet.theme)||void 0===t?void 0:t.splitLine,u=o.x,c=u+n+i+(s?a:0),h=o.y+r-1;this.addShape("line",{attrs:{x1:u,y1:h,x2:c,y2:h,stroke:l.horizontalBorderColor,lineWidth:l.horizontalBorderWidth,opacity:l.horizontalBorderColorOpacity}})},e.prototype.addSplitLineShadow=function(){var t,e=this.cfg,n=e.isPivotMode,r=e.spreadsheet,i=null===(t=r.theme)||void 0===t?void 0:t.splitLine;n&&i.showShadow&&r.isFrozenRowHeader()&&(this.addSplitLineLeftShadow(),this.addSplitLineRightShadow())},e.prototype.addSplitLineLeftShadow=function(){var t,e,n;if(this.cfg.showViewportLeftShadow){var r=this.cfg,i=r.width,o=r.height,a=r.viewportHeight,s=r.position,l=null===(t=r.spreadsheet.theme)||void 0===t?void 0:t.splitLine,u=s.x+i,c=s.y;this.addShape("rect",{attrs:{x:u,y:c,width:l.shadowWidth,height:a+o,fill:"l (0) 0:".concat(null===(e=l.shadowColors)||void 0===e?void 0:e.left," 1:").concat(null===(n=l.shadowColors)||void 0===n?void 0:n.right)}})}},e.prototype.addSplitLineRightShadow=function(){var t,e,n;if(this.cfg.showViewportRightShadow){var r=this.cfg,i=r.width,o=r.height,a=r.viewportHeight,s=r.viewportWidth,l=r.position,u=null===(t=r.spreadsheet.theme)||void 0===t?void 0:t.splitLine,c=l.x+i+s-u.shadowWidth,h=l.y;this.addShape("rect",{attrs:{x:c,y:h,width:u.shadowWidth,height:a+o,fill:"l (0) 0:".concat(null===(e=u.shadowColors)||void 0===e?void 0:e.right," 1:").concat(null===(n=u.shadowColors)||void 0===n?void 0:n.left)}})}},e}(xi),UT=function(t){function e(e){return t.call(this,e)||this}return GC(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.gm&&this.gm.destroy()},e.prototype.layout=function(){var t,e,n=this,r=this.headerConfig,i=r.data,o=r.spreadsheet,a=r.width,s=r.viewportHeight,l=r.seriesNumberWidth,u=r.scrollY,c=r.scrollX,h=null===(e=null===(t=null==o?void 0:o.facet)||void 0===t?void 0:t.cfg)||void 0===e?void 0:e.rowCell;Tf(i,(function(t){if(function(t){return s+u>t.y&&u<t.y+t.height&&a-l+c>t.x&&c-l<t.x+t.width}(t)&&0!==t.height){var e=void 0;h&&(e=h(t,o,n.headerConfig)),ov(e)&&o.isPivotMode()&&(e=new DE(t,o,n.headerConfig)),t.belongsCell=e,n.add(e)}}))},e.prototype.offset=function(){var t=this.headerConfig,e=t.scrollX,n=t.scrollY,r=t.position,i=t.seriesNumberWidth;WE(this,r.x-e+i,r.y-n)},e.prototype.clip=function(){var t=this.headerConfig,e=t.width,n=t.viewportHeight,r=t.scrollX,i=t.scrollY,o=t.seriesNumberWidth;this.setClip({type:"rect",attrs:{x:r-o,y:i,width:e,height:n}})},e}(FT),YT=function(e){function n(t){return e.call(this,t)||this}return GC(n,e),n.getSeriesNumberHeader=function(t,e,r,i,o){var a=t.height,s=t.viewportHeight,l=[],u=i.isHierarchyTreeType();return r.forEach((function(t){if(!t.isTotals||u){var n=new _w({id:"",key:"",value:"".concat(l.length+1)});n.x=t.x,n.y=t.y,n.height=t.height,n.width=e,l.push(n)}})),new n({width:o,height:a,viewportWidth:o,viewportHeight:s,position:{x:0,y:t.y},data:l,spreadsheet:i})},n.prototype.clip=function(){var t=this.headerConfig,e=t.width,n=t.viewportHeight,r=t.scrollY;this.setClip({type:"rect",attrs:{x:0,y:r,width:e,height:n}})},n.prototype.layout=function(){var t=this,e=this.headerConfig,n=e.data,r=e.scrollY,i=e.viewportHeight;e.spreadsheet.isPivotMode&&this.addBackGround();var o=this.addGroup();Tf(n,(function(e){var n=e.y,a=e.height,s=e.isLeaf;if(t.isHeaderCellInViewport(n,a,r,i)){var l=t.addGroup();t.addText(l,e),t.add(l),s||t.addBorder(o,e)}}))},n.prototype.offset=function(){var t=this.headerConfig,e=t.scrollY,n=t.scrollX,r=t.position;WE(this,r.x-n,r.y-e),this.backgroundShape&&this.backgroundShape.translate(r.x,r.y+e),this.leftBorderShape&&this.leftBorderShape.translate(r.x,r.y+e)},n.prototype.addBackGround=function(){var e=this.getStyle().cell,n=this.headerConfig,r=n.position,i=n.width,o=n.viewportHeight;this.backgroundShape=sx(this,{x:r.x,y:-r.y,width:i,height:o,fill:e.backgroundColor,stroke:"transparent",opacity:e.backgroundColorOpacity});var a=Bx(t.CellBorderPosition.LEFT,{x:r.x,y:-r.y,width:i,height:o},e),s=a.position,l=a.style;this.leftBorderShape=dx(this,s,l)},n.prototype.addBorder=function(e,n){var r=this.getStyle().cell,i=Bx(t.CellBorderPosition.BOTTOM,n,r);dx(e,i.position,i.style)},n.prototype.getStyle=function(){return this.headerConfig.spreadsheet.theme.rowCell},n.prototype.addText=function(t,e){var n=this.headerConfig,r=n.scrollY,i=n.viewportHeight,o=UC(UC({},this.getStyle().seriesText),{textBaseline:"top"}),a=e.label,s=e.x,l=e.y,u=e.width,c=e.height,h=this.getTextPadding(a,u),d=NE(l+h.top,c-h.top-h.bottom,r,i,o.fontSize);t.addShape("text",{attrs:UC(UC({x:s+h.left,y:d,text:a},o),{cursor:"pointer"})})},n.prototype.getTextPadding=function(t,e){var n=this.getStyle(),r=this.headerConfig.spreadsheet.measureTextWidth(t,n.seriesText),i=Math.max(Math.abs((e-r)/2),4);return UC(UC({},n.cell.padding),{left:i,right:i})},n}(FT),jT=function(){function e(e){var n=this;this.scrollFrameId=null,this.hideScrollBar=function(){var t,e,r;null===(t=n.hRowScrollBar)||void 0===t||t.hide(),null===(e=n.hScrollBar)||void 0===e||e.hide(),null===(r=n.vScrollBar)||void 0===r||r.hide()},this.delayHideScrollBar=Kd(this.hideScrollBar,1e3),this.delayHideScrollbarOnMobile=function(){Cw()&&n.delayHideScrollBar()},this.showVerticalScrollBar=function(){var t;null===(t=n.vScrollBar)||void 0===t||t.show()},this.showHorizontalScrollBar=function(){var t,e;null===(t=n.hRowScrollBar)||void 0===t||t.show(),null===(e=n.hScrollBar)||void 0===e||e.show()},this.onContainerWheel=function(){n.onContainerWheelForPc(),n.onContainerWheelForMobile()},this.onContainerWheelForPc=function(){var t=n.spreadsheet.getCanvasElement();null==t||t.addEventListener("wheel",n.onWheel)},this.onContainerWheelForMobile=function(){n.mobileWheel=new BE(n.spreadsheet.container),n.mobileWheel.on("wheel",(function(t){n.spreadsheet.hideTooltip();var e=t.event,r=t.deltaX,i=t.deltaY,o=t.x,a=t.y;n.onWheel(UC(UC({},e),{deltaX:r,deltaY:i,offsetX:o,offsetY:a}))}))},this.bindEvents=function(){n.onContainerWheel(),n.emitPaginationEvent()},this.setScrollOffset=function(t){Object.keys(t).forEach((function(e){var r=t[e];gv(r)||n.spreadsheet.store.set(e,Math.floor(r))}))},this.getScrollOffset=function(){var t=n.spreadsheet.store;return{scrollX:t.get("scrollX",0),scrollY:t.get("scrollY",0),hRowScrollX:t.get("hRowScrollX",0)}},this.emitPaginationEvent=function(){var e=n.cfg.pagination;if(e){var r=e.current,i=void 0===r?1:r,o=e.pageSize,a=n.viewCellHeights.getTotalLength(),s=Math.floor((a-1)/o)+1;n.cfg.spreadsheet.emit(t.S2Event.LAYOUT_PAGINATION,{pageSize:o,pageCount:s,total:a,current:i})}},this.unbindEvents=function(){var t=n.spreadsheet.getCanvasElement();null==t||t.removeEventListener("wheel",n.onWheel),n.mobileWheel.destroy()},this.clipPanelGroup=function(){var t;n.foregroundGroup=n.spreadsheet.foregroundGroup,n.backgroundGroup=n.spreadsheet.backgroundGroup,n.panelGroup=n.spreadsheet.panelGroup;var e=n.panelBBox,r=e.width,i=e.height;null===(t=n.spreadsheet.panelScrollGroup)||void 0===t||t.setClip({type:"rect",attrs:{x:0,y:n.cornerBBox.height,width:r,height:i}})},this.calculateCellWidthHeight=function(){var t=dy(n.layoutResult.colLeafNodes,(function(t,e){return t.push(mf(t)+e.width),t}),[0]);n.viewCellWidths=t,n.viewCellHeights=n.getViewCellHeights(n.layoutResult)},this.getRealScrollX=function(t,e){return void 0===e&&(e=0),n.cfg.spreadsheet.isScrollContainsRowHeader()?t:e},this.calculatePanelBBox=function(){n.panelBBox=new zT(n,!0)},this.getRealWidth=function(){return mf(n.viewCellWidths)},this.getRealHeight=function(){var t=n.cfg.pagination,e=n.viewCellHeights;if(t){var r=n.getCellRange(),i=r.start,o=r.end;return e.getCellOffsetY(o+1)-e.getCellOffsetY(i)}return e.getTotalHeight()},this.clearAllGroup=function(){for(var t=n.panelGroup.getChildren()||[],e=t.length-1;e>=0;e--){var r=t[e];r instanceof xi?r.set("children",[]):t[e].remove()}n.foregroundGroup.set("children",[]),n.backgroundGroup.set("children",[])},this.scrollWithAnimation=function(t,e,r){var i,o;void 0===t&&(t={}),void 0===e&&(e=200);var a=n.getAdjustedScrollOffset({scrollX:(null===(i=t.offsetX)||void 0===i?void 0:i.value)||0,scrollY:(null===(o=t.offsetY)||void 0===o?void 0:o.value)||0}),s=a.scrollX,l=a.scrollY;n.timer&&n.timer.stop();var u=Object.values(n.getScrollOffset()),c=$e(u,[void 0===s?u[0]:s,void 0===l?u[1]:l]);n.timer=ce((function(t){var i=Math.min(t/e,1),o=VC(c(i),2),a=o[0],s=o[1];n.setScrollOffset({scrollX:a,scrollY:s}),n.startScroll(),t>e&&(n.timer.stop(),null==r||r())}))},this.scrollImmediately=function(t){var e,r;void 0===t&&(t={});var i=n.getAdjustedScrollOffset({scrollX:(null===(e=t.offsetX)||void 0===e?void 0:e.value)||0,scrollY:(null===(r=t.offsetY)||void 0===r?void 0:r.value)||0}),o=i.scrollX,a=i.scrollY;n.setScrollOffset({scrollX:o,scrollY:a}),n.startScroll()},this.startScroll=function(t){var e,r;void 0===t&&(t=!1);var i=n.getScrollOffset(),o=i.scrollX,a=i.scrollY;null===(e=n.hScrollBar)||void 0===e||e.onlyUpdateThumbOffset(n.getScrollBarOffset(o,n.hScrollBar)),null===(r=n.vScrollBar)||void 0===r||r.onlyUpdateThumbOffset(n.getScrollBarOffset(a,n.vScrollBar)),n.dynamicRenderCell(t)},this.getRendererHeight=function(){var t=n.getCellRange(),e=t.start,r=t.end;return n.viewCellHeights.getCellOffsetY(r+1)-n.viewCellHeights.getCellOffsetY(e)},this.getAdjustedScrollOffset=function(t){var e=t.scrollX,r=t.scrollY,i=t.hRowScrollX;return{scrollX:OT(e,n.layoutResult.colsHierarchy.width,n.panelBBox.width),scrollY:OT(r,n.getRendererHeight(),n.panelBBox.height),hRowScrollX:IT(i,n.cornerBBox)}},this.renderRowScrollBar=function(e){if(!n.cfg.spreadsheet.isScrollContainsRowHeader()&&n.cornerBBox.width<n.cornerBBox.originalWidth){var r=n.cornerBBox.originalWidth-n.cornerBBox.width,i=n.getScrollbarPosition().maxY,o=n.spreadsheet.theme.splitLine.verticalBorderWidth,a=n.cornerBBox.width*n.cornerBBox.width/n.cornerBBox.originalWidth,s=a-o;n.hRowScrollBar=new bT({isHorizontal:!0,trackLen:n.cornerBBox.width,thumbLen:s,position:{x:n.cornerBBox.minX+n.scrollBarSize/2,y:i},thumbOffset:e*(n.cornerBBox.width-a)/r,theme:n.scrollBarTheme,scrollTargetMaxOffset:r}),n.hRowScrollBar.on(Vb.ScrollChange,(function(e){var i,o,a=e.offset,s=n.getValidScrollBarOffset(a,r),l=Math.floor(s);n.setScrollOffset({hRowScrollX:l}),null===(i=n.rowHeader)||void 0===i||i.onRowScrollX(l,Io),null===(o=n.rowIndexHeader)||void 0===o||o.onRowScrollX(l,Ao),n.cornerHeader.onRowScrollX(l,Mo);var u=n.getScrollBarOffset(l,n.hRowScrollBar),c={scrollX:u,scrollY:0};n.hRowScrollBar.updateThumbOffset(u,!1),n.spreadsheet.emit(t.S2Event.ROW_CELL_SCROLL,c),n.spreadsheet.emit(t.S2Event.GLOBAL_SCROLL,c)})),n.foregroundGroup.add(n.hRowScrollBar)}},this.getValidScrollBarOffset=function(t,e){return eh(t,0,e)},this.renderHScrollBar=function(t,e,r){if(Math.floor(t)<Math.floor(e)){var i=n.scrollBarSize/2,o=n.getScrollbarPosition().maxY,a=t+(n.cfg.spreadsheet.isScrollContainsRowHeader()?n.cornerBBox.width:0),s={x:n.panelBBox.minX+(n.cfg.spreadsheet.isScrollContainsRowHeader()?-n.cornerBBox.width+i:i),y:o},l=e+(n.cfg.spreadsheet.isScrollContainsRowHeader()?n.cornerBBox.width:0),u=l-a,c=a/l*a;n.hScrollBar=new bT({isHorizontal:!0,trackLen:a,thumbLen:c,position:s,thumbOffset:r*(a-c)/u,theme:n.scrollBarTheme,scrollTargetMaxOffset:u}),n.hScrollBar.on(Vb.ScrollChange,(function(t){var e=t.offset,r=t.updateThumbOffset,i=n.getValidScrollBarOffset(e,u);r&&n.hScrollBar.updateThumbOffset(n.getScrollBarOffset(i,n.hScrollBar),!1),n.setScrollOffset({scrollX:i}),n.dynamicRenderCell()})),n.foregroundGroup.add(n.hScrollBar)}},this.getScrollbarPosition=function(){var e=n.panelBBox,r=e.maxX,i=e.maxY,o=n.getCanvasHW(),a=o.width,s=o.height,l=n.spreadsheet.options.interaction.scrollbarPosition===t.ScrollbarPositionType.CONTENT;return{maxX:(l?r:a)-n.scrollBarSize,maxY:l?i:s-n.scrollBarSize}},this.renderVScrollBar=function(t,e,r){if(t<e){var i=Math.max(t/e*t,32),o=e-t,a=n.getScrollbarPosition().maxX;n.vScrollBar=new bT({isHorizontal:!1,trackLen:t,thumbLen:i,thumbOffset:r*(t-i)/o,position:{x:a,y:n.panelBBox.minY},theme:n.scrollBarTheme,scrollTargetMaxOffset:o}),n.vScrollBar.on(Vb.ScrollChange,(function(t){var e=t.offset,r=t.updateThumbOffset,i=n.getValidScrollBarOffset(e,o);r&&n.vScrollBar.updateThumbOffset(n.getScrollBarOffset(i,n.vScrollBar),!1),n.setScrollOffset({scrollY:i}),n.dynamicRenderCell()})),n.foregroundGroup.add(n.vScrollBar)}},this.getScrollBarOffset=function(t,e){return t*(e.trackLen-e.thumbLen)/e.scrollTargetMaxOffset},this.isScrollOverThePanelArea=function(t){var e=t.offsetX,r=t.offsetY;return e>n.panelBBox.minX&&e<n.panelBBox.maxX&&r>n.panelBBox.minY&&r<n.panelBBox.maxY},this.isScrollOverTheCornerArea=function(t){var e=t.offsetX,r=t.offsetY;return e>n.cornerBBox.minX&&e<n.cornerBBox.maxX&&r>n.cornerBBox.minY&&r<n.cornerBBox.maxY+n.panelBBox.height},this.updateHorizontalRowScrollOffset=function(t){var e,r=t.offset,i=t.offsetX,o=t.offsetY;n.isScrollOverTheCornerArea({offsetX:i,offsetY:o})&&(null===(e=n.hRowScrollBar)||void 0===e||e.emitScrollChange(r))},this.updateHorizontalScrollOffset=function(t){var e,r=t.offset,i=t.offsetX,o=t.offsetY;n.hRowScrollBar&&!n.isScrollOverThePanelArea({offsetX:i,offsetY:o})||null===(e=n.hScrollBar)||void 0===e||e.emitScrollChange(r)},this.isScrollToLeft=function(t){var e=t.deltaX,r=t.offsetX,i=t.offsetY;if(!n.hScrollBar&&!n.hRowScrollBar)return!0;var o=!n.hRowScrollBar||n.isScrollOverThePanelArea({offsetY:i,offsetX:r})||n.hRowScrollBar.thumbOffset<=0,a=!n.hScrollBar||n.hScrollBar.thumbOffset<=0;return e<=0&&a&&o},this.isScrollToRight=function(t){var e,r,i,o,a,s,l=t.deltaX,u=t.offsetX,c=t.offsetY;if(!n.hScrollBar&&!n.hRowScrollBar)return!0;var h=n.spreadsheet.isFrozenRowHeader()?null===(e=n.panelBBox)||void 0===e?void 0:e.width:null===(r=n.panelBBox)||void 0===r?void 0:r.maxX,d=!n.hRowScrollBar||n.isScrollOverThePanelArea({offsetY:c,offsetX:u})||(null===(i=n.hRowScrollBar)||void 0===i?void 0:i.thumbOffset)+(null===(o=n.hRowScrollBar)||void 0===o?void 0:o.thumbLen)>=n.cornerBBox.width,f=n.hRowScrollBar&&n.isScrollOverTheCornerArea({offsetX:u,offsetY:c})||(null===(a=n.hScrollBar)||void 0===a?void 0:a.thumbOffset)+(null===(s=n.hScrollBar)||void 0===s?void 0:s.thumbLen)>=h;return l>=0&&f&&d},this.isScrollToTop=function(t){var e;return!n.vScrollBar||t<=0&&(null===(e=n.vScrollBar)||void 0===e?void 0:e.thumbOffset)<=0},this.isScrollToBottom=function(t){var e,r,i;return!n.vScrollBar||t>=0&&(null===(e=n.vScrollBar)||void 0===e?void 0:e.thumbOffset)+(null===(r=n.vScrollBar)||void 0===r?void 0:r.thumbLen)>=(null===(i=n.panelBBox)||void 0===i?void 0:i.height)},this.isVerticalScrollOverTheViewport=function(t){return!n.isScrollToTop(t)&&!n.isScrollToBottom(t)},this.isHorizontalScrollOverTheViewport=function(t){return!n.isScrollToLeft(t)&&!n.isScrollToRight(t)},this.isScrollOverTheViewport=function(t){var e=t.deltaY,r=t.deltaX;return!(t.offsetY<=n.cornerBBox.maxY)&&(0!==e?n.isVerticalScrollOverTheViewport(e):0!==r&&n.isHorizontalScrollOverTheViewport(t))},this.cancelScrollFrame=function(){return(!Cw()||!n.scrollFrameId)&&(cancelAnimationFrame(n.scrollFrameId),!0)},this.clearScrollFrameIdOnMobile=function(){Cw()&&(n.scrollFrameId=null)},this.stopScrollChainingIfNeeded=function(t){"auto"!==n.spreadsheet.options.interaction.overscrollBehavior&&n.stopScrollChaining(t)},this.stopScrollChaining=function(t){var e,n,r;null===(e=null==t?void 0:t.preventDefault)||void 0===e||e.call(t),null===(r=null===(n=null==t?void 0:t.originalEvent)||void 0===n?void 0:n.preventDefault)||void 0===r||r.call(n)},this.onWheel=function(e){var r=n.spreadsheet.options.interaction,i=e.deltaX,o=e.deltaY,a=e.offsetX,s=e.offsetY,l=VC(function(t,e,n){var r=Math.abs(t/e),i=r>2?0:e;return[(r<=.5?0:t)*n.horizontal,i*n.vertical]}(i,o,r.scrollSpeedRatio),2),u=l[0],c=l[1];n.spreadsheet.hideTooltip(),n.spreadsheet.interaction.clearHoverTimer(),n.isScrollOverTheViewport({deltaX:u,deltaY:c,offsetX:a,offsetY:s})?(n.stopScrollChaining(e),n.spreadsheet.interaction.addIntercepts([t.InterceptType.HOVER]),n.cancelScrollFrame()&&(n.scrollFrameId=requestAnimationFrame((function(){var t,e=n.getScrollOffset(),r=e.scrollX,i=e.scrollY,o=e.hRowScrollX;0!==u&&(n.showHorizontalScrollBar(),n.updateHorizontalRowScrollOffset({offsetX:a,offsetY:s,offset:u+o}),n.updateHorizontalScrollOffset({offsetX:a,offsetY:s,offset:u+r})),0!==c&&(n.showVerticalScrollBar(),null===(t=n.vScrollBar)||void 0===t||t.emitScrollChange(c+i)),n.delayHideScrollbarOnMobile(),n.clearScrollFrameIdOnMobile()})))):n.stopScrollChainingIfNeeded(e)},this.addCell=function(t){var e=n.spreadsheet.panelScrollGroup;null==e||e.add(t)},this.realCellRender=function(t,e){var r=n.calculateXYIndexes(t,e);Fw.getInstance().logger("renderIndex:",n.preCellIndexes,r);var i=DT(n.preCellIndexes,r),o=i.add,a=i.remove;Fw.getInstance().debugCallback(zw,(function(){Tf(o,(function(t){var e=VC(t,2),r=e[0],i=e[1],o=n.layoutResult.getCellMeta(i,r);if(o){var a=n.cfg.dataCell(o);a.set("name","".concat(r,"-").concat(i)),n.addCell(a)}}));var t=RT(n.panelGroup.getChildren(),OS);Tf(a,(function(e){var n=VC(e,2),r=n[0],i=n[1],o=$f(t,(function(t){return t.get("name")==="".concat(r,"-").concat(i)}));null==o||o.remove(!0)})),Fw.getInstance().logger("Render Cell Panel: ".concat(null==t?void 0:t.length,", Add: ").concat(null==o?void 0:o.length,", Remove: ").concat(null==a?void 0:a.length))})),n.preCellIndexes=r},this.getGridInfo=function(){var t=VC(n.preCellIndexes.center,4),e=t[0],r=t[1],i=t[2],o=t[3];return{cols:AT(e,r,n.layoutResult.colLeafNodes),rows:MT(i,o,n.viewCellHeights)}},this.onAfterScroll=Kd((function(){n.spreadsheet.interaction.isSelectedState()||n.spreadsheet.interaction.removeIntercepts([t.InterceptType.HOVER])}),300),this.cfg=e,this.spreadsheet=e.spreadsheet,this.init()}return Object.defineProperty(e.prototype,"scrollBarTheme",{get:function(){return this.spreadsheet.theme.scrollBar},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollBarSize",{get:function(){return this.scrollBarTheme.size},enumerable:!1,configurable:!0}),e.prototype.getCellCustomWidth=function(t,e){return Na(e)?null==e?void 0:e(t):e},e.prototype.getCellDraggedWidth=function(t){var e=this.cfg.colCfg;return Su(null==e?void 0:e.widthByFieldValue,"".concat(t.value),t.width)},e.prototype.render=function(){this.adjustScrollOffset(),this.renderHeaders(),this.renderScrollBars(),this.renderBackground(),this.dynamicRenderCell()},e.prototype.adjustScrollOffset=function(){var t=this.getAdjustedScrollOffset(this.getScrollOffset()),e=t.scrollX,n=t.scrollY,r=t.hRowScrollX;this.setScrollOffset({scrollX:e,scrollY:n,hRowScrollX:r})},e.prototype.getSeriesNumberWidth=function(){return this.cfg.showSeriesNumber?this.spreadsheet.theme.rowCell.seriesNumberWidth:0},e.prototype.getCanvasHW=function(){return{width:this.cfg.width,height:this.cfg.height}},e.prototype.getContentHeight=function(){var t=this.layoutResult,e=t.rowsHierarchy,n=t.colsHierarchy;return e.height+n.height},e.prototype.updateScrollOffset=function(t){var e,n,r,i;void 0===(null===(e=t.offsetX)||void 0===e?void 0:e.value)?void 0!==(null===(r=t.offsetY)||void 0===r?void 0:r.value)&&((null===(i=t.offsetY)||void 0===i?void 0:i.animate)?this.scrollWithAnimation(t):this.scrollImmediately(t)):(null===(n=t.offsetX)||void 0===n?void 0:n.animate)?this.scrollWithAnimation(t):this.scrollImmediately(t)},e.prototype.getPaginationScrollY=function(){var t=this.cfg.pagination;if(t){var e=t.current,n=void 0===e?1:e,r=t.pageSize,i=this.viewCellHeights,o=Math.max((n-1)*r,0);return i.getCellOffsetY(o)}return 0},e.prototype.destroy=function(){this.unbindEvents(),this.clearAllGroup(),this.preCellIndexes=null,cancelAnimationFrame(this.scrollFrameId)},e.prototype.calculateXYIndexes=function(t,e){var n=this.panelBBox,r=n.viewportHeight,i=n.viewportWidth;return{center:HE(t,e,this.viewCellWidths,this.viewCellHeights,{width:i,height:r,x:0,y:0},this.getRealScrollX(this.cornerBBox.width))}},e.prototype.calculateCornerBBox=function(){this.cornerBBox=new kT(this,!0)},e.prototype.getCellRange=function(){var t=this.cfg.pagination;return function(t,e){var n=t,r=0,i=n.getTotalLength()-1;if(e){var o=e.current,a=void 0===o?1:o,s=e.pageSize;r=Math.max((a-1)*s,0),i=Math.min(a*s-1,n.getTotalLength()-1)}return{start:r,end:i}}(this.viewCellHeights,t)},e.prototype.clip=function(t,e){var n,r=this.spreadsheet.isFrozenRowHeader();null===(n=this.spreadsheet.panelScrollGroup)||void 0===n||n.setClip({type:"rect",attrs:{x:r?t:0,y:e,width:this.panelBBox.width+(r?0:t),height:this.panelBBox.height}})},e.prototype.translateRelatedGroups=function(t,e,n){var r,i;WE(this.spreadsheet.panelScrollGroup,this.cornerBBox.width-t,this.cornerBBox.height-e),null===(r=this.rowHeader)||void 0===r||r.onScrollXY(this.getRealScrollX(t,n),e,Io),null===(i=this.rowIndexHeader)||void 0===i||i.onScrollXY(this.getRealScrollX(t,n),e,Ao),this.cornerHeader.onCorScroll(this.getRealScrollX(t,n),Mo),this.centerFrame.onChangeShadowVisibility(t,this.getRealWidth()-this.panelBBox.width),this.centerFrame.onBorderScroll(this.getRealScrollX(t)),this.columnHeader.onColScroll(t,Bo)},e.prototype.init=function(){var e=this;Fw.getInstance().debugCallback(kw,(function(){e.layoutResult=e.doLayout(),e.saveInitColumnLeafNodes(e.layoutResult.colLeafNodes),e.spreadsheet.emit(t.S2Event.LAYOUT_AFTER_HEADER_LAYOUT,e.layoutResult)})),this.calculateCellWidthHeight(),this.calculateCornerBBox(),this.calculatePanelBBox(),this.clipPanelGroup(),this.bindEvents()},e.prototype.renderBackground=function(){var t=this.getCanvasHW(),e=t.width,n=t.height,r=this.spreadsheet.theme.background,i=r.color,o=r.opacity;this.backgroundGroup.addShape("rect",{attrs:{fill:i,opacity:o,x:0,y:0,width:e,height:n}})},e.prototype.renderScrollBars=function(){var t=this.getScrollOffset(),e=t.scrollX,n=t.scrollY,r=t.hRowScrollX,i=this.panelBBox,o=i.width,a=i.height,s=this.layoutResult.colsHierarchy.width,l=this.getRealHeight();this.renderRowScrollBar(r),this.renderHScrollBar(o,s,e),this.renderVScrollBar(a,l,n)},e.prototype.renderHeaders=function(){var t=this.getSeriesNumberWidth();this.rowHeader=this.getRowHeader(),this.columnHeader=this.getColHeader(),t>0&&!this.rowIndexHeader&&(this.rowIndexHeader=this.getSeriesNumberHeader()),this.cornerHeader=this.getCornerHeader(),this.centerFrame=this.getCenterFrame(),this.rowIndexHeader&&this.foregroundGroup.add(this.rowIndexHeader),this.rowHeader&&this.foregroundGroup.add(this.rowHeader),this.foregroundGroup.add(this.columnHeader),this.foregroundGroup.add(this.cornerHeader),this.foregroundGroup.add(this.centerFrame)},e.prototype.getRowHeader=function(){var t,e,n;if(!this.rowHeader){var r=this.panelBBox,i=r.y,o=r.viewportHeight,a=r.viewportWidth,s=r.height,l=this.getSeriesNumberWidth();return new UT({width:this.cornerBBox.width,height:s,viewportWidth:a,viewportHeight:o,position:{x:0,y:i},data:this.layoutResult.rowNodes,hierarchyType:this.cfg.hierarchyType,linkFields:null!==(n=null===(e=null===(t=this.cfg.spreadsheet.options)||void 0===t?void 0:t.interaction)||void 0===e?void 0:e.linkFields)&&void 0!==n?n:[],seriesNumberWidth:l,spreadsheet:this.spreadsheet})}return this.rowHeader},e.prototype.getColHeader=function(){if(!this.columnHeader){var t=this.panelBBox,e=t.x,n=t.width,r=t.viewportHeight,i=t.viewportWidth;return new HT({width:n,cornerWidth:this.cornerBBox.width,height:this.cornerBBox.height,viewportWidth:i,viewportHeight:r,position:{x:e,y:0},data:this.layoutResult.colNodes,scrollContainsRowHeader:this.cfg.spreadsheet.isScrollContainsRowHeader(),sortParam:this.cfg.spreadsheet.store.get("sortParam"),spreadsheet:this.spreadsheet})}return this.columnHeader},e.prototype.getCornerHeader=function(){return this.cornerHeader?this.cornerHeader:WT.getCornerHeader(this.panelBBox,this.cornerBBox,this.getSeriesNumberWidth(),this.cfg,this.layoutResult,this.spreadsheet)},e.prototype.getSeriesNumberHeader=function(){return YT.getSeriesNumberHeader(this.panelBBox,this.getSeriesNumberWidth(),this.layoutResult.rowsHierarchy.getNodes(0),this.spreadsheet,this.cornerBBox.width)},e.prototype.getCenterFrame=function(){var t;if(!this.centerFrame){var e=this.panelBBox,n=e.viewportWidth,r=e.viewportHeight,i=this.cornerBBox.width,o=this.cornerBBox.height,a=null===(t=this.cfg)||void 0===t?void 0:t.frame,s={position:{x:this.cornerBBox.x,y:this.cornerBBox.y},width:i,height:o,viewportWidth:n,viewportHeight:r,showViewportLeftShadow:!1,showViewportRightShadow:!1,scrollContainsRowHeader:this.cfg.spreadsheet.isScrollContainsRowHeader(),isPivotMode:this.cfg.spreadsheet.isPivotMode(),spreadsheet:this.cfg.spreadsheet};return a?a(s):new GT(s)}return this.centerFrame},e.prototype.updatePanelScrollGroup=function(){this.gridInfo=this.getGridInfo(),this.spreadsheet.panelScrollGroup.update(this.gridInfo)},e.prototype.dynamicRenderCell=function(t){var e=this.getScrollOffset(),n=e.scrollX,r=e.scrollY,i=e.hRowScrollX,o=r+this.getPaginationScrollY(),a=OT(o,this.viewCellHeights.getTotalHeight(),this.panelBBox.viewportHeight);this.spreadsheet.hideTooltip(),this.spreadsheet.interaction.clearHoverTimer(),this.realCellRender(n,a),this.updatePanelScrollGroup(),this.translateRelatedGroups(n,a,i),this.clip(n,a),t||this.emitScrollEvent({scrollX:n,scrollY:a}),this.onAfterScroll()},e.prototype.emitScrollEvent=function(e){this.spreadsheet.emit(t.S2Event.LAYOUT_CELL_SCROLL,e),this.spreadsheet.emit(t.S2Event.GLOBAL_SCROLL,e)},e.prototype.saveInitColumnLeafNodes=function(t){void 0===t&&(t=[]);var e=this.spreadsheet,n=e.store,r=e.options.interaction.hiddenColumnFields;t.length+r.length!==n.get("initColumnLeafNodes",[]).length&&n.set("initColumnLeafNodes",t)},e}(),VT=function(t){var e,n,r,i=t.facetCfg,o=t.customTreeItems,a=void 0===o?[]:o,s=t.level,l=t.parentNode,u=t.hierarchy,c=i.spreadsheet,h=i.collapsedRows,d=i.hierarchyCollapse;try{for(var f=jC(a),p=f.next();!p.done;p=f.next()){var v=p.value,g=v.key,y=v.title,m=v.collapsed,C=v.children,w=YC(v,["key","title","collapsed","children"]),x=((r={})[fo]=g,r),S=Bw(l.id,y),E=null!=m&&m,_=Su(h,S),b=null!=_?_:d||E,T=new _w({id:S,key:g,label:y,value:y,level:s,parent:l,field:g,isTotals:!1,isCollapsed:b,hierarchy:u,query:x,spreadsheet:c,extra:w});s>u.maxLevel&&(u.maxLevel=s),ov(C)&&(T.isLeaf=!0);var L=Ow(i,l,T,u);ov(C)||b||!L||VT({facetCfg:i,parentNode:T,level:s+1,hierarchy:u,customTreeItems:C})}}catch(t){e={error:t}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}},XT="root[&]".length,KT=function(t){var e,n,r,i,o,a,s,l=t.parentNode,u=t.currentField,c=t.level,h=t.facetCfg,d=t.hierarchy,f=t.pivotMeta,p=h.spreadsheet,v=h.dataSet,g=h.collapsedRows,y=h.hierarchyCollapse,m=h.rowExpandDepth,C=l.query,w=l.id,x=(null===(i=p.dataCfg.fields.rows)||void 0===i?void 0:i.length)<=c,S=(null===(o=null==v?void 0:v.sortedDimensionValues)||void 0===o?void 0:o[u])||[],E=Qw(Array.from(f.keys())),_=$w(E,S,(function(t){return Wo===w?t:Bw(w,t).slice(XT)})),b=Iw(_,h,l,u),T=p.store.get("drillItemsNum");x&&T>0&&(b=b.slice(0,T)),0===c&&function(t,e,n){var r=t.getTotalsConfig(e);r.showGrandTotals&&n[r.reverseLayout?"unshift":"push"](new Tw(r.label,!1,!0))}(p,u,b);try{for(var L=jC(b),I=L.next();!I.done;I=L.next()){var O=I.value,R=O instanceof Tw,A=R?null:f.get(O),M=void 0,B=C,N=!1,D=!1;if(R){var P=O;N=P.isGrandTotals,D=P.isSubTotals,M=lw(O.label),B=C}else M=O,B=UC(UC({},C),((r={})[u]=M,r));var k=Bw(w,M),z=null==g?void 0:g[k],F=uv(m)?c>m:null,H=null!==(a=null!=z?z:F)&&void 0!==a?a:y,W=new _w({id:k,key:u,label:M,value:M,level:c,parent:l,field:u,isTotals:R,isGrandTotals:N,isSubTotals:D,isCollapsed:H,hierarchy:d,query:B,spreadsheet:p});c>d.maxLevel&&(d.maxLevel=c);var G=!(null===(s=null==A?void 0:A.children)||void 0===s?void 0:s.size);(G||R)&&(W.isLeaf=!0),G||(W.isTotals=!0);var U=Ow(h,l,W,d);G||H||R||!U||KT({level:c+1,currentField:A.childField,pivotMeta:A.children,facetCfg:h,parentNode:W,hierarchy:d})}}catch(t){e={error:t}}finally{try{I&&!I.done&&(n=L.return)&&n.call(L)}finally{if(e)throw e.error}}},qT=function(t){var e,n,r=t.isValueInCols,i=t.moreThanOneValue,o=t.rootNode,a=t.facetCfg,s=t.hierarchy,l=t.fields;t.isRowHeader?(e=!r&&i,n=!r&&!i):(e=r&&i,n=r&&!i),Mw({addTotalMeasureInTotal:e,addMeasureInTotalQuery:n,parentNode:o,currentField:l[0],fields:l,facetCfg:a,hierarchy:s})},ZT=function(t){var e=t.facetCfg,n=t.rootNode,r=t.hierarchy,i=e.hierarchyType,o=e.rows,a=e.dataSet;"tree"===i?KT({level:0,currentField:o[0],pivotMeta:a.rowPivotMeta,facetCfg:e,parentNode:n,hierarchy:r}):function(t){var e=t.facetCfg,n=t.rootNode,r=t.hierarchy,i=e.dataSet.fields.customTreeItems;VT({customTreeItems:i,facetCfg:e,level:0,parentNode:n,hierarchy:r})}(t)},$T=function(t){var e=t.isRowHeader,n=t.facetCfg,r=n.spreadsheet,i=n.rows,o=void 0===i?[]:i,a=n.columns,s=void 0===a?[]:a,l=r.dataCfg.fields.valueInCols,u=r.isPivotMode(),c=n.dataSet.moreThanOneValue(),h=_w.rootNode(),d=new bw,f={isValueInCols:l,isPivotMode:u,moreThanOneValue:c,rootNode:h,hierarchy:d,spreadsheet:r,facetCfg:n,fields:e?o:s,isRowHeader:e};e?function(t){t.spreadsheet.isHierarchyTreeType()?ZT(t):qT(t)}(f):function(t){var e=t.isPivotMode,n=t.hierarchy,r=t.rootNode,i=t.facetCfg;e?qT(t):Dw({parentNode:r,hierarchy:n,facetCfg:i})}(f);return{hierarchy:d,leafNodes:e&&r.isHierarchyTreeType()?d.getNodes():d.getLeaves()}},QT=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),Object.defineProperty(n.prototype,"rowCellTheme",{get:function(){return this.spreadsheet.theme.rowCell.cell},enumerable:!1,configurable:!0}),n.prototype.doLayout=function(){var t=$T({isRowHeader:!0,facetCfg:this.cfg}),e=t.leafNodes,n=t.hierarchy,r=$T({isRowHeader:!1,facetCfg:this.cfg}),i=r.leafNodes,o=r.hierarchy;this.calculateNodesCoordinate(e,n,i,o);var a=this.cfg,s=a.dataSet,l=a.spreadsheet,u={colNodes:o.getNodes(),colsHierarchy:o,rowNodes:n.getNodes(),rowsHierarchy:n,rowLeafNodes:e,colLeafNodes:i,getCellMeta:function(t,n){var r,o,a,u=t||0,c=n||0,h=e[u],d=i[c];if(!h||!d)return null;var f,p=h.query,v=d.query,g=h.isTotals||h.isTotalMeasure||d.isTotals||d.isTotalMeasure,y=l.options.hierarchyType,m=null!==(o=Su(l,"facet.cfg.colCfg.hideMeasureColumn"))&&void 0!==o&&o&&"customTree"!==y?((r={})[fo]=null===(a=s.fields.values)||void 0===a?void 0:a[0],r):{},C=zv({},p,v,m),w=s.getCellData({query:C,rowNode:h,isTotals:g}),x=null;return ov(w)?f=Su(C,[fo],""):(f=Su(w,[fo],""),x=Su(w,[ho],null),g&&(f=Su(C,[fo],""),x=Su(w,f,null))),{spreadsheet:l,x:d.x,y:h.y,width:d.width,height:h.height,data:w,rowIndex:u,colIndex:c,isTotals:g,valueField:f,fieldValue:x,rowQuery:p,colQuery:v,rowId:h.id,colId:d.id,id:IS(h.id,d.id)}},spreadsheet:l};return function(t,e){var n=null==t?void 0:t.layoutDataPosition;if(n){var r=e.getCellMeta,i=n(t.spreadsheet,r);return UC(UC({},e),{getCellMeta:i})}return e}(this.cfg,u)},n.prototype.calculateNodesCoordinate=function(t,e,n,r){this.calculateRowNodesCoordinate(t,e,n),this.calculateColNodesCoordinate(n,r,t,e.width)},n.prototype.calculateColNodesCoordinate=function(t,e,n,r){var i,o,a,s,l=this.cfg.spreadsheet,u=_w.blankNode(),c=e.getNodes();try{for(var h=jC(e.sampleNodesForAllLevels),d=h.next();!d.done;d=h.next()){var f=d.value;f.height=this.getColNodeHeight(f),e.height+=f.height}}catch(t){i={error:t}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}for(var p=0,v=function(i){var o=c[i];if(o.isLeaf&&(o.colIndex=p,p+=1,o.x=u.x+u.width,o.width=g.calculateColLeafNodesWidth(o,t,n,r),e.width+=o.width,u=o),0===o.level)o.y=0;else{var s=e.sampleNodesForAllLevels.find((function(t){return t.level===o.level-1}));o.y=null!==(a=(null==s?void 0:s.y)+(null==s?void 0:s.height))&&void 0!==a?a:0}o.height=g.getColNodeHeight(o),Rw(g.cfg,null,o)},g=this,y=0;y<c.length;y++)v(y);this.autoCalculateColNodeWidthAndX(t),ov(null===(s=l.options.totals)||void 0===s?void 0:s.col)||(this.adjustTotalNodesCoordinate(e),this.adjustSubTotalNodesCoordinate(e))},n.prototype.autoCalculateColNodeWidthAndX=function(t){for(var e=null,n=t.slice(0);n.length;){var r=n.shift().parent;e!==r&&r&&(n.push(r),r.x=r.children[0].x,r.width=r.children.map((function(t){return t.width})).reduce((function(t,e){return t+e}),0),e=r)}},n.prototype.calculateColLeafNodesWidth=function(e,n,r,i){var o,a,s,l=this.cfg,u=l.colCfg,c=l.dataSet,h=l.filterDisplayDataItem,d=this.getCellDraggedWidth(e);if(d)return d;var f=this.getCellCustomWidth(e,null==u?void 0:u.width);if(!dv(f))return f;if(this.spreadsheet.getLayoutWidthType()===t.LayoutWidthTypes.Compact){for(var p=this.spreadsheet.theme.colCell,v=p.bolderText,g=p.cell,y=p.icon,m=this.spreadsheet.dataSet.getFieldFormatter(e.field),C=null!==(o=null==m?void 0:m(e.value))&&void 0!==o?o:e.label,w=this.getExpectedCellIconWidth(t.CellTypes.COL_CELL,this.spreadsheet.isValueInCols()&&this.spreadsheet.options.showDefaultHeaderActionIcon,y),x=this.spreadsheet.measureTextWidthRoughly(C)+w,S=void 0,E=0,_=0;_<50;_++){var b=r[_];if(b){var T=c.getCellData({query:UC(UC({},e.query),b.query),rowNode:b,isTotals:e.isTotals||e.isTotalMeasure||b.isTotals||b.isTotalMeasure});if(T){var L="".concat(TS(T,h)),I=this.spreadsheet.measureTextWidthRoughly(L);I>E&&(S=L,E=I)}}}var O=x>E,R=O?C:S,A=O?w:0;return Fw.getInstance().logger("Max Label In Col:",e.field,R),this.spreadsheet.measureTextWidth(R,v)+(null===(a=g.padding)||void 0===a?void 0:a.left)+(null===(s=g.padding)||void 0===s?void 0:s.right)+A}return this.spreadsheet.isHierarchyTreeType()?this.getAdaptTreeColWidth(e,n,r):this.getAdaptGridColWidth(n,i)},n.prototype.getColNodeHeight=function(t){var e=this.cfg.colCfg;return Su(e,"heightByField.".concat(t.key))||e.height},n.prototype.getExpectedCellIconWidth=function(t,e,n){var r,i=0;if(e)i=1;else{var o=JS(op(this.spreadsheet.options.headerActionIcons,(function(t){return UC(UC({},t),{displayCondition:function(){return!0}})})),null,t);i=null!==(r=null==o?void 0:o.iconNames.length)&&void 0!==r?r:0}return i?i*(n.size+n.margin.left)+n.margin.right:0},n.prototype.calculateRowNodesCoordinate=function(t,e,n){var r,i,o,a,s,l,u,c,h,d,f=this.cfg,p=f.cellCfg,v=f.spreadsheet,g=v.isHierarchyTreeType(),y=Su(v,"options.style.rowCfg.heightByField",{}),m=null!==(o=e.sampleNodesForAllLevels)&&void 0!==o?o:[];if(g)e.width=this.getTreeRowHeaderWidth();else try{for(var C=jC(e.sampleNodesForAllLevels),w=C.next();!w.done;w=C.next()){var x=w.value;x.width=this.calculateGridRowNodesWidth(x,n),e.width+=x.width;var S=null!==(a=m[x.level-1])&&void 0!==a?a:{x:0,width:0};x.x=(null==S?void 0:S.x)+(null==S?void 0:S.width)}}catch(t){r={error:t}}finally{try{w&&!w.done&&(i=C.return)&&i.call(C)}finally{if(r)throw r.error}}for(var E=_w.blankNode(),_=e.getNodes(),b=0;b<_.length;b++){var T=_[b];if((g||!g&&T.isLeaf)&&(null!==(s=T.rowIndex)&&void 0!==s||(T.rowIndex=b),null!==(l=T.colIndex)&&void 0!==l||(T.colIndex=b),T.y=E.y+E.height,T.height=(null!==(u=y[T.id])&&void 0!==u?u:p.height)+(null===(c=this.rowCellTheme.padding)||void 0===c?void 0:c.top)+(null===(h=this.rowCellTheme.padding)||void 0===h?void 0:h.bottom),E=T,e.height+=T.height),g||0===T.level)T.x=0;else{S=m[T.level-1];T.x=(null==S?void 0:S.x)+(null==S?void 0:S.width)}if(g)T.width=this.getTreeRowHeaderWidth();else{var L=m[T.level];T.width=null==L?void 0:L.width}Rw(this.cfg,T,null)}g||(this.autoCalculateRowNodeHeightAndY(t),ov(null===(d=v.options.totals)||void 0===d?void 0:d.row)||(this.adjustTotalNodesCoordinate(e,!0),this.adjustSubTotalNodesCoordinate(e,!0)))},n.prototype.autoCalculateRowNodeHeightAndY=function(t){for(var e=null,n=t.slice(0);n.length;){var r=n.shift().parent;e!==r&&r&&(n.push(r),r.y=r.children[0].y,r.height=r.children.map((function(t){return t.height})).reduce((function(t,e){return t+e}),0),e=r)}},n.prototype.adjustTotalNodesCoordinate=function(t,e){var n,r,i,o=this.cfg.dataSet.moreThanOneValue(),a=t.maxLevel,s=$f(t.getNodes(0),(function(t){return t.isGrandTotals}));if(s instanceof _w){var l=s.children;if(e)s.width=t.width,Tf(l,(function(e){e.x=t.getNodes(a)[0].x}));else if(a>1||a<=1&&!o){var u=null!==(r=null===(n=null==l?void 0:l[0])||void 0===n?void 0:n.height)&&void 0!==r?r:0;s.height=t.height-u;var c=null===(i=$f(t.getNodes(a),(function(t){return!t.isTotalMeasure})))||void 0===i?void 0:i.y;Tf(l,(function(t){t.y=c}))}}},n.prototype.adjustSubTotalNodesCoordinate=function(t,e){var n=t.getNodes().filter((function(t){return t.isSubTotals}));if(!ov(n)){var r=t.maxLevel;Tf(n,(function(n){var i,o,a,s=n.children;if(e)n.width=TT(t.sampleNodesForAllLevels,n.level,"width"),Tf(s,(function(e){e.x=t.getNodes(r)[0].x}));else{var l=TT(t.sampleNodesForAllLevels,n.level,"height"),u=null!==(o=null===(i=null==s?void 0:s[0])||void 0===i?void 0:i.height)&&void 0!==o?o:0;n.height=l-u,Tf(s,(function(e){e.y=t.getNodes(r)[0].y}));var c=null===(a=$f(t.getNodes(r),(function(t){return!t.isTotalMeasure})))||void 0===a?void 0:a.y;Tf(s,(function(t){t.y=c}))}}))}},n.prototype.calculateGridRowNodesWidth=function(e,n){var r=this.cfg,i=r.rowCfg,o=r.spreadsheet,a=Su(i,"widthByField.".concat(e.key));if(a)return a;var s=this.getCellCustomWidth(e,null==i?void 0:i.width);return dv(s)?o.getLayoutWidthType()!==t.LayoutWidthTypes.Adaptive?this.getCompactGridRowWidth(e):this.getAdaptGridColWidth(n):s},n.prototype.getAdaptTreeColWidth=function(t,e,n){var r=this.getCanvasHW().width,i=Math.min(r/2,this.getTreeRowHeaderWidth()),o=Math.max(1,e.length),a=this.cfg.cellCfg;return Math.max(Yx(a,this.getColLabelLength(t,n)),(r-i)/o)},n.prototype.getColLabelLength=function(t,e){var n,r=jx(null==t?void 0:t.value);if(pa(r))return r.length;for(var i=1,o=0;o<50;o++){var a=e[o];if(!a)return i;for(var s=this.cfg.dataSet.getCellData({query:UC(UC({},t.query),a.query),rowNode:a,isTotals:t.isTotals||t.isTotalMeasure||a.isTotals||a.isTotalMeasure}),l=Wl(s),u=0;u<l.length;u++){var c=s[l[u]],h=Ty(null===(n=null==c?void 0:c.values)||void 0===n?void 0:n[0]);h>i&&(i=h)}}return i},n.prototype.getAdaptGridColWidth=function(t,e){var n=this.cfg,r=n.rows,i=n.cellCfg,o=r.length,a=t.length,s=this.getCanvasHW().width,l=Math.max(1,o+a);return e?Math.max(Yx(i),(s-e)/a):Math.max(Yx(i),s/l)},n.prototype.getTreeRowHeaderWidth=function(){var t,e,n,r,i=this.cfg,o=i.rows,a=i.dataSet,s=i.rowCfg,l=i.treeRowsWidth,u=null!=l?l:null==s?void 0:s.treeRowsWidth;if(u)return u;var c=this.getCellCustomWidth(null,null==s?void 0:s.width);if(c)return c;var h=o.map((function(t){return a.getFieldName(t)})).join("/"),d=this.spreadsheet.theme.cornerCell,f=d.bolderText,p=d.icon,v=this.spreadsheet.measureTextWidth(h,f)+2*p.size+(null===(t=p.margin)||void 0===t?void 0:t.left)+(null===(e=p.margin)||void 0===e?void 0:e.right)+(null===(n=this.rowCellTheme.padding)||void 0===n?void 0:n.left)+(null===(r=this.rowCellTheme.padding)||void 0===r?void 0:r.right);return Math.max(null!=u?u:120,v)},n.prototype.getCompactGridRowWidth=function(e){var n,r=this,i=this.cfg,o=i.dataSet,a=i.spreadsheet,s=a.theme.rowCell,l=s.bolderText,u=s.icon,c=s.cell,h=a.theme.cornerCell,d=h.bolderText,f=h.icon,p=h.cell,v=e.field,g=e.isLeaf,y=this.getExpectedCellIconWidth(t.CellTypes.ROW_CELL,!a.isValueInCols()&&g&&a.options.showDefaultHeaderActionIcon,u),m=null===(n=o.getDimensionValues(v))||void 0===n?void 0:n.slice(0,50).map((function(t){var e,n;return null!==(n=null===(e=r.spreadsheet.dataSet.getFieldFormatter(v))||void 0===e?void 0:e(t))&&void 0!==n?n:t})),C=Nv(m,(function(t){return"".concat(t).length})),w=a.measureTextWidth(C,l)+y+c.padding.left+c.padding.right,x=o.getFieldName(v),S=this.getExpectedCellIconWidth(t.CellTypes.CORNER_CELL,!1,f),E=a.measureTextWidth(x,d)+S+p.padding.left+p.padding.right;return Fw.getInstance().logger("Max Label In Row:",v,w>E?C:x),Math.max(w,E)},n.prototype.getViewCellHeights=function(t){var e=dy(t.rowLeafNodes,(function(t,e){return t.push(mf(t)+e.height),t}),[0]);return{getTotalHeight:function(){return mf(e)},getCellOffsetY:function(t){return e[t]},getTotalLength:function(){return e.length-1},getIndexRange:function(t,n){return LT(e,t,n)}}},n}(jT),JT=function(t){function e(e){var n,r=this;(r=t.call(this,e)||this).getScrollGroupClipBBox=function(){var t,e=r.headerConfig,n=e.width,i=e.height,o=e.scrollX,a=e.spreadsheet,s=a.options;if(!s.frozenColCount&&!s.frozenTrailingColCount)return{x:o,y:0,width:n,height:i};for(var l=null===(t=a.facet)||void 0===t?void 0:t.layoutResult.colLeafNodes,u=ax(a.options,l.length),c=u.frozenColCount,h=u.frozenTrailingColCount,d=0,f=0,p=0;p<c;p++)d+=l[p].width;for(p=0;p<h;p++)f+=l[l.length-1-p].width;return{x:o+d,y:0,width:n-d-f,height:i}};var i=null===(n=r.headerConfig.spreadsheet)||void 0===n?void 0:n.options,o=i.frozenColCount,a=i.frozenTrailingColCount;return o&&(r.frozenColGroup=r.addGroup({name:Po,zIndex:4})),a&&(r.frozenTrailingColGroup=r.addGroup({name:ko,zIndex:4})),r}return GC(e,t),e.prototype.isFrozenCell=function(t){var e=this.headerConfig.spreadsheet,n=null==e?void 0:e.options,r=n.frozenColCount,i=n.frozenTrailingColCount,o=t.colIndex,a=null==e?void 0:e.facet.layoutResult.colLeafNodes;return PE(o,r)||kE(o,i,a.length)},e.prototype.clear=function(){var e,n,r=this.headerConfig.spreadsheet;t.prototype.clear.call(this),null===(e=this.frozenTrailingColGroup)||void 0===e||e.clear(),null===(n=this.frozenColGroup)||void 0===n||n.clear();var i=null==r?void 0:r.foregroundGroup.findById(No);null==i||i.clear()},e.prototype.getCellInstance=function(t,e,n){return t.field===go?new VE(t,e,n):new jE(t,e,n)},e.prototype.getCellGroup=function(t){var e,n=this.headerConfig.spreadsheet,r=null==n?void 0:n.options,i=r.frozenColCount,o=r.frozenTrailingColCount,a=null===(e=null==n?void 0:n.facet)||void 0===e?void 0:e.layoutResult.colLeafNodes.length;return PE(t.colIndex,i)?this.frozenColGroup:kE(t.colIndex,o,a)?this.frozenTrailingColGroup:this.scrollGroup},e.prototype.isColCellInRect=function(e){var n,r=this.headerConfig.spreadsheet,i=null==r?void 0:r.options,o=i.frozenColCount,a=i.frozenTrailingColCount,s=null===(n=null==r?void 0:r.facet)||void 0===n?void 0:n.layoutResult.colLeafNodes.length;return!(!PE(e.colIndex,o)&&!kE(e.colIndex,a,s))||t.prototype.isColCellInRect.call(this,e)},e.prototype.clip=function(){this.scrollGroup.setClip({type:"rect",attrs:this.getScrollGroupClipBBox()})},e}(HT),tL=function(e){function n(n){var r,i=e.call(this,n)||this;i.frozenGroupInfo=((r={})[t.FrozenGroup.FROZEN_COL]={width:0},r[t.FrozenGroup.FROZEN_ROW]={height:0},r[t.FrozenGroup.FROZEN_TRAILING_ROW]={height:0},r[t.FrozenGroup.FROZEN_TRAILING_COL]={width:0},r),i.panelScrollGroupIndexes=[],i.onSortHandler=function(e){var n=i.spreadsheet,r=e;Array.isArray(e)||(r=[e]);var o=n.dataCfg.sortParams||[];r=r.map((function(t){var e,n,r=UC(UC({},t),{sortFieldId:null!==(e=t.sortKey)&&void 0!==e?e:t.sortFieldId}),i=null!==(n=o.find((function(t){return t.sortFieldId===r.sortFieldId})))&&void 0!==n?n:{};return UC(UC({},i),r)}));var a=o.filter((function(t){return!r.find((function(e){return e.sortFieldId===t.sortFieldId}))}));Ey(n.dataCfg,"sortParams",XC(XC([],VC(a),!1),VC(r),!1)),n.setDataCfg(n.dataCfg),n.render(!0),n.emit(t.S2Event.RANGE_SORTED,n.dataSet.getDisplayDataSet())},i.onFilterHandler=function(e){var n=i.spreadsheet,r=!e.filteredValues||0===e.filteredValues.length,o=n.dataCfg.filterParams||[],a=o.findIndex((function(t){return t.filterKey===e.filterKey}));-1!==a?r?o.splice(a):o[a]=e:o.push(e),Ey(n.dataCfg,"filterParams",o),n.render(!0),n.emit(t.S2Event.RANGE_FILTERED,n.dataSet.getDisplayDataSet())},i.initFrozenGroupPosition=function(){var t=i.getScrollOffset(),e=t.scrollY,n=t.scrollX,r=i.getPaginationScrollY();WE(i.spreadsheet.frozenRowGroup,i.cornerBBox.width-n,i.cornerBBox.height-r),WE(i.spreadsheet.frozenColGroup,i.cornerBBox.width,i.cornerBBox.height-e-r),WE(i.spreadsheet.frozenTrailingColGroup,i.cornerBBox.width,i.cornerBBox.height-e-r),WE(i.spreadsheet.frozenTopGroup,i.cornerBBox.width,i.cornerBBox.height-r)},i.getTotalHeightForRange=function(t,e){if(t<0||e<0)return 0;if(i.rowOffsets)return i.rowOffsets[e+1]-i.rowOffsets[t];for(var n=0,r=t;r<e+1;r++){n+=i.getDefaultCellHeight()}return n},i.getShadowFill=function(t){var e,n,r=Su(i.cfg,"spreadsheet.theme.splitLine");return"l (".concat(t,") 0:").concat(null===(e=r.shadowColors)||void 0===e?void 0:e.left," 1:").concat(null===(n=r.shadowColors)||void 0===n?void 0:n.right)},i.renderFrozenGroupSplitLine=function(t,e){var n,r=i.panelBBox,o=r.width,a=r.height,s=r.viewportWidth,l=r.viewportHeight,u=i.cornerBBox.height,c=i.layoutResult.colLeafNodes,h=i.getCellRange(),d=h.end-h.start,f=ax(i.spreadsheet.options,c.length,d),p=f.frozenRowCount,v=f.frozenColCount,g=f.frozenTrailingColCount,y=f.frozenTrailingRowCount,m=Math.floor(e-i.getPaginationScrollY()),C=Math.max(0,mf(i.viewCellWidths)-s),w=Math.max(0,i.viewCellHeights.getCellOffsetY(h.end+1)-i.viewCellHeights.getCellOffsetY(h.start)-l);null===(n=i.foregroundGroup.findById(Ro))||void 0===n||n.remove();var x,S,E=Su(i.cfg,"spreadsheet.theme.splitLine"),_=i.foregroundGroup.addGroup({id:Ro,zIndex:4}),b={lineWidth:null==E?void 0:E.verticalBorderWidth,stroke:null==E?void 0:E.verticalBorderColor,opacity:null==E?void 0:E.verticalBorderColorOpacity},T={lineWidth:null==E?void 0:E.horizontalBorderWidth,stroke:null==E?void 0:E.horizontalBorderColor,opacity:null==E?void 0:E.horizontalBorderColorOpacity};v>0&&(dx(_,{x1:x=c.reduce((function(t,e,n){return n<v?t+e.width:t}),0),x2:x,y1:u,y2:u+(S=y>0?a:l)},UC({},b)),E.showShadow&&t>0&&_.addShape("rect",{attrs:{x:x,y:u,width:E.shadowWidth,height:S,fill:i.getShadowFill(0)}}));if(p>0){var L=u+i.getTotalHeightForRange(h.start,h.start+p-1);dx(_,{x1:0,x2:I=g>0?o:s,y1:L,y2:L},UC({},T)),E.showShadow&&m>0&&_.addShape("rect",{attrs:{x:0,y:L,width:I,height:E.shadowWidth,fill:i.getShadowFill(90)}})}g>0&&(dx(_,{x1:x=o-(I=c.reduceRight((function(t,e,n){return n>=c.length-g?t+e.width:t}),0)),x2:x,y1:u,y2:u+(S=y?a:l)},UC({},b)),E.showShadow&&Math.floor(t)<Math.floor(C)&&_.addShape("rect",{attrs:{x:x-E.shadowWidth,y:u,width:E.shadowWidth,height:S,fill:i.getShadowFill(180)}}));if(y>0){var I;L=i.panelBBox.maxY-i.getTotalHeightForRange(h.end-y+1,h.end);dx(_,{x1:0,x2:I=g>0?o:s,y1:L,y2:L},UC({},T)),E.showShadow&&m<Math.floor(w)&&_.addShape("rect",{attrs:{x:0,y:L-E.shadowWidth,width:I,height:E.shadowWidth,fill:i.getShadowFill(270)}})}i.foregroundGroup.sort()},i.renderFrozenPanelCornerGroup=function(){var e=i.layoutResult.colLeafNodes.length,n=i.getCellRange(),r=ax(i.spreadsheet.options,e,n.end-n.start+1),o=function(e,n,r){for(var i,o=e.frozenColCount,a=e.frozenRowCount,s=e.frozenTrailingColCount,l=e.frozenTrailingRowCount,u=((i={})[t.FrozenCellType.TOP]=[],i[t.FrozenCellType.BOTTOM]=[],i),c=0;c<o;c++){for(var h=r.start;h<r.start+a;h++)u[t.FrozenCellType.TOP].push({x:c,y:h});if(l>0)for(h=0;h<l;h++){var d=r.end-h;u[t.FrozenCellType.BOTTOM].push({x:c,y:d})}}for(c=0;c<s;c++){var f=n-1-c;for(h=r.start;h<r.start+a;h++)u[t.FrozenCellType.TOP].push({x:f,y:h});if(l>0)for(h=0;h<l;h++)d=r.end-h,u[t.FrozenCellType.BOTTOM].push({x:f,y:d})}return u}({frozenRowCount:r.frozenRowCount,frozenColCount:r.frozenColCount,frozenTrailingRowCount:r.frozenTrailingRowCount,frozenTrailingColCount:r.frozenTrailingColCount},e,n);Object.keys(o).forEach((function(t){var e=o[t],n=i.spreadsheet[Qo[t]];n&&e.forEach((function(t){i.addFrozenCell(t.x,t.y,n)}))}))},i.addFrozenCell=function(t,e,n){var r=i.layoutResult.getCellMeta(e,t);if(r.isFrozenCorner=!0,r){var o=i.cfg.dataCell(r);n.add(o)}},i.addCell=function(e){var n=i.spreadsheet.options,r=n.frozenRowCount,o=n.frozenColCount,a=n.frozenTrailingRowCount,s=n.frozenTrailingColCount,l=i.layoutResult.colsHierarchy.getLeaves().length,u=i.getCellRange(),c=function(e,n,r,i){var o=n.frozenColCount,a=n.frozenRowCount,s=n.frozenTrailingColCount,l=n.frozenTrailingRowCount,u=e.colIndex,c=e.rowIndex;return zE(c,i.start,a)?t.FrozenCellType.ROW:FE(c,i.end,l)?t.FrozenCellType.TRAILING_ROW:PE(u,o)?t.FrozenCellType.COL:kE(u,s,r)?t.FrozenCellType.TRAILING_COL:t.FrozenCellType.SCROLL}(e.getMeta(),{frozenRowCount:r,frozenColCount:o,frozenTrailingRowCount:a,frozenTrailingColCount:s},l,u),h=Qo[c];h&&i.spreadsheet[h].add(e)},i.getFrozenOptions=function(){var t=i.layoutResult.colLeafNodes.length,e=i.getCellRange();return ax(i.cfg,t,e.end-e.start+1)};var o=i.spreadsheet;return o.on(t.S2Event.RANGE_SORT,i.onSortHandler),o.on(t.S2Event.RANGE_FILTER,i.onFilterHandler),i}return GC(n,e),Object.defineProperty(n.prototype,"dataCellTheme",{get:function(){return this.spreadsheet.theme.dataCell.cell},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){var n=this.spreadsheet;n.off(t.S2Event.RANGE_SORT,this.onSortHandler),n.off(t.S2Event.RANGE_FILTER,this.onFilterHandler),e.prototype.destroy.call(this)},n.prototype.calculateCornerBBox=function(){var t=this.layoutResult.colsHierarchy,e=Math.floor(t.height);this.cornerBBox=new kT(this),this.cornerBBox.height=e,this.cornerBBox.maxY=e},n.prototype.doLayout=function(){var t=this,e=this.cfg,n=e.dataSet,r=e.spreadsheet,i=new bw,o=$T({isRowHeader:!1,facetCfg:this.cfg}),a=o.leafNodes,s=o.hierarchy;this.calculateColNodesCoordinate(a,s);var l={colNodes:s.getNodes(),colsHierarchy:s,rowNodes:i.getNodes(),rowsHierarchy:i,rowLeafNodes:i.getLeaves(),colLeafNodes:a,getCellMeta:function(e,i){var o,s,l=t.cfg.showSeriesNumber,u=a[i],c=t.getCellHeight(e),h=t.getCellRange(),d=ax(t.cfg,a.length,h.end-h.start+1).frozenTrailingRowCount,f=u.x,p=t.viewCellHeights.getCellOffsetY(e);return FE(e,h.end,d)&&(p=t.panelBBox.maxY-t.getTotalHeightForRange(e,h.end)),s=l&&u.field===go?e+1:n.getCellData({query:{col:u.field,rowIndex:e}}),{spreadsheet:r,x:f,y:p,width:u.width,height:c,data:(o={},o[u.field]=s,o),rowIndex:e,colIndex:i,isTotals:!1,colId:u.id,rowId:String(e),valueField:u.field,fieldValue:s,id:IS(String(e),u.id)}},spreadsheet:r};return l},n.prototype.getAdaptiveColWidth=function(e){var n=this.cfg.cellCfg,r=this.cfg.showSeriesNumber;if(this.spreadsheet.getLayoutWidthType()!==t.LayoutWidthTypes.Compact){var i=this.getSeriesNumberWidth(),o=e.length-(r?1:0),a=this.getCanvasHW().width-i;return Math.max(null==n?void 0:n.width,a/Math.max(1,o))}return null==n?void 0:n.width},n.prototype.getColNodeHeight=function(){var t=this.cfg.colCfg;return Lp(null==t?void 0:t.heightByField)[0]||(null==t?void 0:t.height)},n.prototype.calculateColNodesCoordinate=function(t,e){var n,r,i,o=_w.blankNode(),a=e.getNodes();try{for(var s=jC(e.sampleNodesForAllLevels),l=s.next();!l.done;l=s.next()){var u=l.value;u.height=this.getColNodeHeight(),e.height+=u.height}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}for(var c=ax(null===(i=this.spreadsheet)||void 0===i?void 0:i.options,a.length).frozenTrailingColCount,h=this.getAdaptiveColWidth(t),d=0;d<a.length;d++){(p=a[d]).colIndex=d,p.x=o.x+o.width,p.width=this.calculateColLeafNodesWidth(p,h),o=p,p.y=0,p.height=this.getColNodeHeight(),Rw(this.cfg,null,p),e.width+=p.width}o=_w.blankNode();var f=this.getCanvasHW().width;if(c>0)for(d=1;d<=a.length;d++){var p;(p=a[a.length-d]).colIndex>=t.length-c&&(p.colIndex===a.length-1?p.x=f-p.width:p.x=o.x-p.width,o=p)}},n.prototype.calculateColLeafNodesWidth=function(e,n){var r,i=this.cfg,o=i.colCfg,a=i.dataSet,s=i.spreadsheet,l=this.spreadsheet.getLayoutWidthType(),u=this.getCellDraggedWidth(e);if(u)return u;var c,h=this.getCellCustomWidth(e,null==o?void 0:o.width);if(!dv(h))return h;if(l===t.LayoutWidthTypes.Compact){var d=a.getDisplayDataSet(),f=e.label,p=(null===(r=null==d?void 0:d.map((function(t){return"".concat(t[e.key])})))||void 0===r?void 0:r.slice(0,50))||[];p.push(f);var v=Nv(p,(function(t){return s.measureTextWidthRoughly(t)})),g=s.theme.colCell.bolderText,y=s.theme.dataCell,m=y.text,C=y.cell;if(Fw.getInstance().logger("Max Label In Col:",e.field,v),f===v)c=s.measureTextWidth(v,g)+YE(this.spreadsheet,e,s.theme.colCell);else{c=s.measureTextWidth(v,m)+C.padding.left+C.padding.right+1}}else c=n;return e.field===go&&(c=this.getSeriesNumberWidth()),c},n.prototype.getDefaultCellHeight=function(){var t=this.cfg.cellCfg;return null==t?void 0:t.height},n.prototype.getCellHeight=function(t){if(this.rowOffsets){var e=Su(this.spreadsheet,"options.style.rowCfg.heightByField",{})[String(t)];if(e)return e}return this.getDefaultCellHeight()},n.prototype.initRowOffsets=function(){var t=this,e=this.cfg.dataSet,n=Su(this.spreadsheet,"options.style.rowCfg.heightByField",{});if(Object.keys(n).length){var r=e.getDisplayDataSet();this.rowOffsets=[0];var i=0;r.forEach((function(e,r){var o,a=null!==(o=n[String(r)])&&void 0!==o?o:t.getDefaultCellHeight(),s=i+a;t.rowOffsets.push(s),i=s}))}},n.prototype.getViewCellHeights=function(){var t=this,e=this.cfg.dataSet;this.initRowOffsets();var n=this.getDefaultCellHeight();return{getTotalHeight:function(){return t.rowOffsets?mf(t.rowOffsets):n*e.getDisplayDataSet().length},getCellOffsetY:function(e){if(e<=0)return 0;if(t.rowOffsets)return t.rowOffsets[e];for(var r=0,i=0;i<e;i++)r+=n;return r},getTotalLength:function(){return e.getDisplayDataSet().length},getIndexRange:function(e,r){if(t.rowOffsets)return LT(t.rowOffsets,e,r);var i=Math.floor(e/n),o=r%n==0?r/n-1:Math.floor(r/n);return{start:Math.max(0,i),end:Math.max(0,o)}}}},n.prototype.init=function(){e.prototype.init.call(this);var t=this.panelBBox,n=t.width,r=t.height;this.spreadsheet.panelGroup.setClip({type:"rect",attrs:{x:0,y:this.cornerBBox.height,width:n,height:r}})},n.prototype.getColHeader=function(){if(!this.columnHeader){var t=this.panelBBox,e=t.x,n=t.width,r=t.viewportHeight,i=t.viewportWidth;return new JT({width:n,height:this.cornerBBox.height,viewportWidth:i,viewportHeight:r,cornerWidth:this.cornerBBox.width,position:{x:e,y:0},data:this.layoutResult.colNodes,scrollContainsRowHeader:this.cfg.spreadsheet.isScrollContainsRowHeader(),sortParam:this.cfg.spreadsheet.store.get("sortParam"),spreadsheet:this.spreadsheet})}return this.columnHeader},n.prototype.updateRowResizeArea=function(){var t=this.spreadsheet,e=t.foregroundGroup,n=Su(t.options,"interaction.resize");if(ev(n)?n:null==n?void 0:n.rowCellVertical){var r=e.findById(Io),i=e.findById(Oo);r&&r.set("children",[]),i&&i.set("children",[]),RT(this.panelGroup.getChildren(),XE).filter((function(t){return t.shouldDrawResizeArea()})).forEach((function(t){t.drawResizeArea()}))}},n.prototype.render=function(){this.calculateFrozenGroupInfo(),this.renderFrozenPanelCornerGroup(),e.prototype.render.call(this),this.initFrozenGroupPosition()},n.prototype.calculateFrozenGroupInfo=function(){var t=this.getFrozenOptions(),e=t.frozenColCount,n=t.frozenRowCount,r=t.frozenTrailingColCount,i=t.frozenTrailingRowCount,o=this.layoutResult.colLeafNodes,a=this.viewCellHeights,s=this.getCellRange(),l=this.frozenGroupInfo,u=l.frozenCol,c=l.frozenTrailingCol,h=l.frozenRow,d=l.frozenTrailingRow;e>0&&(u.width=o[e-1].x+o[e-1].width-0,u.range=[0,e-1]),n>0&&(h.height=a.getCellOffsetY(s.start+n)-a.getCellOffsetY(s.start),h.range=[s.start,s.start+n-1]),r>0&&(c.width=o[o.length-1].x-o[o.length-r].x+o[o.length-1].width,c.range=[o.length-r,o.length-1]),i>0&&(d.height=a.getCellOffsetY(s.end+1)-a.getCellOffsetY(s.end+1-i),d.range=[s.end-i+1,s.end])},n.prototype.getRowHeader=function(){return null},n.prototype.getSeriesNumberHeader=function(){return null},n.prototype.translateRelatedGroups=function(t,n,r){var i=this,o=this.spreadsheet,a=o.frozenColGroup,s=o.frozenTrailingColGroup;[o.frozenRowGroup,o.frozenTrailingRowGroup].forEach((function(e){GE(e,i.cornerBBox.width-t)})),[a,s].forEach((function(t){!function(t,e){var n,r=null==t?void 0:t.getMatrix(),i=null!==(n=null==r?void 0:r[7])&&void 0!==n?n:0;null==t||t.translate(0,e-i)}(t,i.cornerBBox.height-n)})),e.prototype.translateRelatedGroups.call(this,t,n,r),this.updateRowResizeArea(),this.renderFrozenGroupSplitLine(t,n)},n.prototype.calculateXYIndexes=function(t,e){var n=this.layoutResult.colLeafNodes.length,r=this.getCellRange(),i=this.panelBBox,o=i.viewportHeight,a=i.viewportWidth,s=this.getFrozenOptions(),l=s.frozenColCount,u=s.frozenRowCount,c=s.frozenTrailingColCount,h=s.frozenTrailingRowCount,d={width:a,height:o,x:0,y:0};if(c>0||l>0){var f=this.frozenGroupInfo,p=f.frozenTrailingCol,v=f.frozenCol;d.width-=p.width+v.width,d.x+=v.width}if(h>0||u>0){var g=this.frozenGroupInfo,y=g.frozenRow,m=g.frozenTrailingRow;d.height<y.height+m.height?(d.height=0,d.y=0):(d.height-=y.height+m.height,d.y+=y.height)}var C=HE(t,e,this.viewCellWidths,this.viewCellHeights,d,this.getRealScrollX(this.cornerBBox.width));return this.panelScrollGroupIndexes=C,function(t,e,n,r){var i=e.frozenColCount,o=e.frozenRowCount,a=e.frozenTrailingColCount,s=e.frozenTrailingRowCount,l=XC([],VC(t),!1);PE(l[0],i)&&(l[0]=i),kE(l[1],a,n)&&(l[1]=n-a-1),zE(l[2],r.start,o)&&(l[2]=r.start+o),FE(l[3],r.end,s)&&(l[3]=r.end-s);var u=XC([],VC(l),!1);u[2]=r.start,u[3]=r.start+o-1;var c=XC([],VC(l),!1);c[0]=0,c[1]=i-1;var h=XC([],VC(l),!1);h[2]=r.end+1-s,h[3]=r.end;var d=XC([],VC(l),!1);return d[0]=n-a,d[1]=n-1,{center:l,frozenRow:u,frozenCol:c,frozenTrailingCol:d,frozenTrailingRow:h}}(C,{frozenColCount:l,frozenRowCount:u,frozenTrailingColCount:c,frozenTrailingRowCount:h},n,r)},n.prototype.clip=function(t,e){var n,r,i=this.layoutResult.colLeafNodes,o=this.getPaginationScrollY(),a=this.spreadsheet,s=a.frozenRowGroup,l=a.frozenColGroup,u=a.frozenTrailingColGroup,c=a.frozenTrailingRowGroup,h=a.panelScrollGroup,d=l.getBBox().width,f=s.getBBox().height,p=u.getBBox(),v=c.getBBox().height,g=this.panelBBox.width-d-u.getBBox().width,y=this.panelBBox.height-f-v;h.setClip({type:"rect",attrs:{x:t+d,y:e+f,width:g,height:y}}),s.setClip({type:"rect",attrs:{x:t+d,y:o,width:g,height:f}}),c.setClip({type:"rect",attrs:{x:t+d,y:c.getBBox().minY,width:g,height:v}});var m={y:e+f,height:y};l.setClip({type:"rect",attrs:UC(UC({},m),{x:0,width:d})}),u.setClip({type:"rect",attrs:UC(UC({},m),{x:p.minX,width:p.width})});var C=this.spreadsheet.foregroundGroup.findById(Io);C&&C.setClip({type:"rect",attrs:{x:0,y:f+this.cornerBBox.height,width:null!==(r=null===(n=null==i?void 0:i[0])||void 0===n?void 0:n.width)&&void 0!==r?r:0,height:y}})},n.prototype.updatePanelScrollGroup=function(){var n=this;e.prototype.updatePanelScrollGroup.call(this),[t.FrozenGroup.FROZEN_COL,t.FrozenGroup.FROZEN_ROW,t.FrozenGroup.FROZEN_TRAILING_COL,t.FrozenGroup.FROZEN_TRAILING_ROW].forEach((function(e){if(n.frozenGroupInfo[e].range){var r=[],i=[];if(e.toLowerCase().includes("row")){var o=VC(n.frozenGroupInfo[e].range,2),a=o[0],s=o[1];if(r=n.gridInfo.cols,i=MT(a,s,n.viewCellHeights),e===t.FrozenGroup.FROZEN_TRAILING_ROW){var l=n.spreadsheet.frozenTrailingRowGroup.getBBox().minY;i=function(t,e,n,r){var i=MT(t,e,r),o=r.getCellOffsetY(t);return i.map((function(t){return t-o+n}))}(a,s,Math.ceil(l),n.viewCellHeights)}}else{var u=VC(n.frozenGroupInfo[e].range,2),c=u[0],h=u[1];r=AT(c,h,n.layoutResult.colLeafNodes),i=n.gridInfo.rows}n.spreadsheet["".concat(e,"Group")].updateGrid({cols:r,rows:i},"".concat(e,"Group"))}}))},n}(jT),eL=function(t){function e(e){var n=t.call(this,e)||this;return n.gridInfo={cols:[],rows:[]},n.updateGrid=function(t,e){void 0===e&&(e=zo);var r=n.getBBox(),i=n.s2,o=i.theme,a=i.isTableMode,s=o.dataCell.cell,l=a()&&(e===zo||e===Eo);n.gridGroup&&n.findById(e)||(n.gridGroup=n.addGroup({id:e})),n.gridGroup.clear(),n.gridInfo=t,l&&n.gridInfo.cols.unshift(0);var u=s.verticalBorderWidth,c=s.verticalBorderWidth/2;n.gridInfo.cols.forEach((function(t){dx(n.gridGroup,{x1:t,x2:t,y1:Math.ceil(r.minY+c),y2:Math.floor(r.maxY-c)},{stroke:s.verticalBorderColor,strokeOpacity:s.verticalBorderColorOpacity,lineWidth:u,lineCap:Xo})}));var h=s.horizontalBorderWidth,d=s.horizontalBorderWidth/2;n.gridInfo.rows.forEach((function(t){dx(n.gridGroup,{x1:Math.ceil(r.minX+d),x2:Math.floor(r.maxX-d),y1:t,y2:t},{stroke:s.horizontalBorderColor,strokeOpacity:s.horizontalBorderColorOpacity,lineWidth:h,lineCap:Xo})})),n.gridGroup.toFront()},n.s2=e.s2,n}return GC(e,t),e}(xi),nL=function(t){function e(e){var n=t.call(this,e)||this;return n.initMergedCellsGroup(),n}return GC(e,t),e.prototype.initMergedCellsGroup=function(){this.mergedCellsGroup&&this.findById(xo)||(this.mergedCellsGroup=this.addGroup({id:xo}))},e.prototype.updateMergedCells=function(){this.initMergedCellsGroup(),YS(this.s2,this.mergedCellsGroup),this.mergedCellsGroup.toFront()},e.prototype.addMergeCell=function(t){var e;null===(e=this.mergedCellsGroup)||void 0===e||e.add(t)},e.prototype.update=function(t){this.updateGrid(t),this.updateMergedCells()},e}(eL),rL=function(){function t(t){var e=this;this.isLinkFieldText=function(t){var n=e.getCellAppendInfo(t);return null==n?void 0:n.isLinkFieldText},this.spreadsheet=t,this.bindEvents()}return t.prototype.getCellAppendInfo=function(t){var e,n;return(null===(e=null==t?void 0:t.attr)||void 0===e?void 0:e.call(t,"appendInfo"))||(null===(n=null==t?void 0:t.attrs)||void 0===n?void 0:n.appendInfo)||{}},t.prototype.reset=function(){},t}(),iL=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),n.prototype.bindEvents=function(){this.bindDataCellClick()},n.prototype.bindDataCellClick=function(){var e=this;this.spreadsheet.on(t.S2Event.DATA_CELL_CLICK,(function(n){var r;n.stopPropagation();var i=e.spreadsheet,o=i.interaction,a=i.options;if(o.clearHoverTimer(),!o.hasIntercepts([t.InterceptType.CLICK]))if(e.isLinkFieldText(n.target))e.emitLinkFieldClickEvent(n);else{var s=e.spreadsheet.getCell(n.target),l=s.getMeta();l&&(o.addIntercepts([t.InterceptType.HOVER]),o.isSelectedCell(s)?1===(null===(r=n.originalEvent)||void 0===r?void 0:r.detail)&&o.reset():(o.changeState({cells:[ZE(s)],stateName:t.InteractionStateName.SELECTED}),e.spreadsheet.emit(t.S2Event.GLOBAL_SELECTED,[s]),e.showTooltip(n,l),a.interaction.selectedCellHighlight&&t_(l)))}}))},n.prototype.getTooltipOperator=function(e,n){var r=this,i=gw(),o=this.spreadsheet.getCell(e.target),a=mT(this.spreadsheet,e).operation,s=a.trend&&UC(UC({},i),{onClick:function(){r.spreadsheet.emit(t.S2Event.DATA_CELL_TREND_ICON_CLICK,UC(UC({},n),{record:r.spreadsheet.isTableMode()?r.spreadsheet.dataSet.getCellData({query:{rowIndex:n.rowIndex}}):void 0})),r.spreadsheet.hideTooltip()}});return CT(a,{defaultMenus:[s],cell:o})},n.prototype.showTooltip=function(t,e){var n=e.data,r=e.isTotals,i=void 0!==r&&r,o=e.value,a=e.fieldValue,s=e.field,l=e.valueField,u=n,c=this.spreadsheet.isTableMode(),h=[(c?UC(UC({},u),{value:o||a,valueField:s||l}):u)||UC(UC({},e.rowQuery),e.colQuery)],d=this.getTooltipOperator(t,e);this.spreadsheet.showTooltipWithInfo(t,h,{isTotals:i,operator:d,enterable:!0,hideSummary:!0,showSingleTips:c})},n.prototype.emitLinkFieldClickEvent=function(e){var n=this.getCellAppendInfo(e.target).cellData,r=n.valueField,i=n.data;this.spreadsheet.emit(t.S2Event.GLOBAL_LINK_FIELD_JUMP,{key:r,record:Object.assign({rowIndex:n.rowIndex},i)})},n}(rL),oL=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),n.prototype.bindEvents=function(){this.bindDataCellClick()},n.prototype.bindDataCellClick=function(){var e=this;this.spreadsheet.on(t.S2Event.MERGED_CELLS_CLICK,(function(n){n.stopPropagation();var r=e.spreadsheet.interaction;r.hasIntercepts([t.InterceptType.CLICK])||r.addIntercepts([t.InterceptType.HOVER])}))},n}(rL),aL=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.isMultiSelection=!1,t.handleRowColClick=function(e){if(e.stopPropagation(),!t.isLinkFieldText(e.target)){var n=t.spreadsheet,r=n.interaction,i=n.options,o=t.spreadsheet.getCell(e.target),a=!(!i.interaction.multiSelection||!t.isMultiSelection);r.selectHeaderCell({cell:o,isMultiSelection:a})&&t.showTooltip(e)}},t.getHideColumnField=function(e){return t.spreadsheet.isTableMode()?e.field:e.id},t}return GC(n,e),n.prototype.bindEvents=function(){this.bindKeyboardDown(),this.bindKeyboardUp(),this.bindColCellClick(),this.bindRowCellClick(),this.bindTableColExpand()},n.prototype.bindKeyboardDown=function(){var e=this;this.spreadsheet.on(t.S2Event.GLOBAL_KEYBOARD_DOWN,(function(t){qE(t)&&(e.isMultiSelection=!0)}))},n.prototype.bindKeyboardUp=function(){var e=this;this.spreadsheet.on(t.S2Event.GLOBAL_KEYBOARD_UP,(function(n){qE(n)&&(e.isMultiSelection=!1,e.spreadsheet.interaction.removeIntercepts([t.InterceptType.CLICK]))}))},n.prototype.bindRowCellClick=function(){var e=this;this.spreadsheet.on(t.S2Event.ROW_CELL_CLICK,(function(t){e.handleRowColClick(t)}))},n.prototype.bindColCellClick=function(){var e=this;this.spreadsheet.on(t.S2Event.COL_CELL_CLICK,(function(t){e.handleRowColClick(t)}))},n.prototype.showTooltip=function(t){var e=mT(this.spreadsheet,t),n=e.operation;if(e.showTooltip){var r=this.spreadsheet.interaction,i=r.isSelectedState()?vT(r.getActiveCells()):[],o=this.getTooltipOperator(t,n);this.spreadsheet.showTooltipWithInfo(t,i,{showSingleTips:!0,operator:o})}},n.prototype.getTooltipOperator=function(e,n){var r=this,i=this.spreadsheet.getCell(e.target),o=i.getMeta(),a=i.cellType===t.CellTypes.COL_CELL,s=1===this.spreadsheet.getColumnLeafNodes().length,l=vw(),u=a&&!s&&o.isLeaf&&n.hiddenColumns&&UC(UC({},l),{onClick:function(){r.hideSelectedColumns()}});return CT(n,{defaultMenus:[u],cell:i})},n.prototype.bindTableColExpand=function(){var e=this;this.spreadsheet.on(t.S2Event.LAYOUT_COLS_EXPANDED,(function(t){e.handleExpandIconClick(t)}))},n.prototype.hideSelectedColumns=function(){var t=this.spreadsheet.interaction.getActiveCells().map((function(t){return t.getMeta()})).map(this.getHideColumnField);KS(this.spreadsheet,t,!0)},n.prototype.handleExpandIconClick=function(t){var e=this.spreadsheet.store.get("hiddenColumnsDetail",[]),n=(e.find((function(e){var n=e.displaySiblingNode;return qS(n,t.id)}))||{}).hideColumnNodes,r=void 0===n?[]:n,i=this.spreadsheet.options.interaction.hiddenColumnFields,o=r.map(this.getHideColumnField),a=yf(i,o),s=e.filter((function(e){var n=e.displaySiblingNode;return!qS(n,t.id)}));this.spreadsheet.setOptions({interaction:{hiddenColumnFields:a}}),this.spreadsheet.store.set("hiddenColumnsDetail",s),this.spreadsheet.interaction.reset(),this.spreadsheet.render(!1)},n}(rL),sL=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.getRowData=function(e){for(var n=e,r={};n.parent;)r[n.key]=n.value,n=n.parent;var i=t.getRowIndex(e),o=t.getOriginalRowData(e,i);return UC(UC(UC({},o),r),{rowIndex:i})},t.getOriginalRowData=function(e,n){var r,i=t.spreadsheet.options,o=(null===(r=null==i?void 0:i.totals)||void 0===r?void 0:r.row)||{},a=o.showGrandTotals,s=o.showSubTotals,l=o.reverseLayout,u=o.reverseSubLayout,c=a&&l?1:0,h=s&&u?1:0,d=Math.max(0,n-c-h);return $f(t.spreadsheet.dataCfg.data,(function(t,n){return t[e.key]===e.value&&n===d}))},t.getRowIndex=function(e){var n,r;if("tree"===t.spreadsheet.options.hierarchyType){for(var i=e;!ov(i.children);)i=rp(i.children);return null!==(n=e.rowIndex)&&void 0!==n?n:i.rowIndex}var o=Math.floor(e.y/e.height);return null!==(r=e.rowIndex)&&void 0!==r?r:o},t}return GC(n,e),n.prototype.bindEvents=function(){this.bindRowCellClick()},n.prototype.bindRowCellClick=function(){var e=this;this.spreadsheet.on(t.S2Event.ROW_CELL_CLICK,(function(n){if(!e.spreadsheet.interaction.hasIntercepts([t.InterceptType.CLICK])&&e.isLinkFieldText(n.target)){var r=e.getCellAppendInfo(n.target).cellData,i=r.key,o=e.getRowData(r);e.spreadsheet.emit(t.S2Event.GLOBAL_LINK_FIELD_JUMP,{key:i,record:o})}}))},n}(rL),lL=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),n.prototype.bindEvents=function(){this.bindCornerCellClick()},n.prototype.bindCornerCellClick=function(){var e=this;this.spreadsheet.on(t.S2Event.CORNER_CELL_CLICK,(function(){var n=e.spreadsheet,r=n.interaction,i=n.tooltip;r.reset(),r.addIntercepts([t.InterceptType.HOVER]),setTimeout((function(){i.visible||r.removeIntercepts([t.InterceptType.HOVER])}))}))},n}(rL),uL=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),n.prototype.bindEvents=function(){this.bindDataCellHover(),this.bindRowCellHover(),this.bindColCellHover()},n.prototype.updateRowColCells=function(e){var n=e.rowId,r=e.colId,i=this.spreadsheet.interaction;(_S(r,i.getAllColHeaderCells(),t.InteractionStateName.HOVER),n)&&Tf(ES(n,i.getAllRowHeaderCells(),this.spreadsheet.isHierarchyTreeType()),(function(e){e.updateByState(t.InteractionStateName.HOVER)}))},n.prototype.changeStateToHoverFocus=function(e,n,r){var i,o=this,a=this.spreadsheet.interaction,s=this.spreadsheet.options.interaction,l=s.hoverFocus;a.clearHoverTimer();var u=function(){if(!a.hasIntercepts([t.InterceptType.HOVER])){a.changeState({cells:[ZE(e)],stateName:t.InteractionStateName.HOVER_FOCUS});var i=o.spreadsheet.isTableMode(),l={isTotals:r.isTotals,enterable:!0,hideSummary:!0,showSingleTips:i};s.hoverHighlight&&o.updateRowColCells(r);var u=o.getCellData(r,i);o.spreadsheet.showTooltipWithInfo(n,u,l)}},c=bC;if(ev(l)||(c=null!==(i=null==l?void 0:l.duration)&&void 0!==i?i:bC),0===c)u();else{var h=window.setTimeout((function(){return u()}),c);a.setHoverTimer(h)}},n.prototype.handleHeaderHover=function(e){var n=this.spreadsheet.getCell(e.target);if(!ov(n)){var r=this.spreadsheet.interaction;r.clearHoverTimer();var i=n.getMeta();if(!r.isActiveCell(n)&&(r.changeState({cells:[ZE(n)],stateName:t.InteractionStateName.HOVER}),n.update(),n.getActualText()!==n.getFieldValue())){var o={isTotals:i.isTotals,enterable:!0,hideSummary:!0,showSingleTips:true,enableFormat:this.spreadsheet.isPivotMode()},a=this.getCellData(i,true);this.spreadsheet.showTooltipWithInfo(e,a,o)}}},n.prototype.getCellData=function(t,e){void 0===t&&(t={});var n=t.data,r=t.query,i=t.value,o=t.field,a=t.fieldValue,s=t.valueField,l=t.rowQuery,u=t.colQuery,c=n;return e?[UC(UC({},r),{value:i||a,valueField:o||s})]:[c||UC(UC({},l),u)]},n.prototype.bindDataCellHover=function(){var e=this;this.spreadsheet.on(t.S2Event.DATA_CELL_HOVER,(function(n){var r=e.spreadsheet.getCell(n.target);if(!ov(r)){var i=e.spreadsheet,o=i.interaction,a=i.options.interaction,s=null==r?void 0:r.getMeta();o.isActiveCell(r)||(o.changeState({cells:[ZE(r)],stateName:t.InteractionStateName.HOVER}),a.hoverHighlight&&e.updateRowColCells(s),a.hoverFocus&&e.changeStateToHoverFocus(r,n,s))}}))},n.prototype.bindRowCellHover=function(){var e=this;this.spreadsheet.on(t.S2Event.ROW_CELL_HOVER,(function(t){e.handleHeaderHover(t)}))},n.prototype.bindColCellHover=function(){var e=this;this.spreadsheet.on(t.S2Event.COL_CELL_HOVER,(function(t){e.handleHeaderHover(t)}))},n}(rL),cL=function(){function e(e){var n=this;this.canvasEventHandlers=[],this.s2EventHandlers=[],this.domEventListeners=[],this.isCanvasEffect=!1,this.isGuiIconShape=function(t){return t instanceof Ai&&t.attrs.type===qw.type},this.onCanvasMousedown=function(e){if(n.target=e.target,n.spreadsheet.interaction.clearHoverTimer(),n.isResizeArea(e)){n.spreadsheet.emit(t.S2Event.LAYOUT_RESIZE_MOUSE_DOWN,e);var r=function(r){if(!n.spreadsheet.getCanvasElement())return!1;n.spreadsheet.getCanvasElement()!==r.target&&(e.clientX=r.clientX,e.clientY=r.clientY,e.originalEvent=r,n.spreadsheet.emit(t.S2Event.LAYOUT_RESIZE_MOUSE_MOVE,e))};return window.addEventListener("mousemove",r),void window.addEventListener("mouseup",(function(){window.removeEventListener("mousemove",r)}),{once:!0})}switch(n.spreadsheet.getCellType(e.target)){case t.CellTypes.DATA_CELL:n.spreadsheet.emit(t.S2Event.DATA_CELL_MOUSE_DOWN,e);break;case t.CellTypes.ROW_CELL:n.spreadsheet.emit(t.S2Event.ROW_CELL_MOUSE_DOWN,e);break;case t.CellTypes.COL_CELL:n.spreadsheet.emit(t.S2Event.COL_CELL_MOUSE_DOWN,e);break;case t.CellTypes.CORNER_CELL:n.spreadsheet.emit(t.S2Event.CORNER_CELL_MOUSE_DOWN,e);break;case t.CellTypes.MERGED_CELL:n.spreadsheet.emit(t.S2Event.MERGED_CELLS_MOUSE_DOWN,e)}},this.onCanvasMousemove=function(e){if(n.isResizeArea(e))return n.activeResizeArea(e),void n.spreadsheet.emit(t.S2Event.LAYOUT_RESIZE_MOUSE_MOVE,e);n.resetResizeArea();var r=n.spreadsheet.getCell(e.target);if(r){var i=r.cellType;switch(i){case t.CellTypes.DATA_CELL:n.spreadsheet.emit(t.S2Event.DATA_CELL_MOUSE_MOVE,e);break;case t.CellTypes.ROW_CELL:n.spreadsheet.emit(t.S2Event.ROW_CELL_MOUSE_MOVE,e);break;case t.CellTypes.COL_CELL:n.spreadsheet.emit(t.S2Event.COL_CELL_MOUSE_MOVE,e);break;case t.CellTypes.CORNER_CELL:n.spreadsheet.emit(t.S2Event.CORNER_CELL_MOUSE_MOVE,e);break;case t.CellTypes.MERGED_CELL:n.spreadsheet.emit(t.S2Event.MERGED_CELLS_MOUSE_MOVE,e)}if(!n.hasBrushSelectionIntercepts())switch(n.spreadsheet.emit(t.S2Event.GLOBAL_HOVER,e),i){case t.CellTypes.DATA_CELL:n.spreadsheet.emit(t.S2Event.DATA_CELL_HOVER,e);break;case t.CellTypes.ROW_CELL:n.spreadsheet.emit(t.S2Event.ROW_CELL_HOVER,e);break;case t.CellTypes.COL_CELL:n.spreadsheet.emit(t.S2Event.COL_CELL_HOVER,e);break;case t.CellTypes.CORNER_CELL:n.spreadsheet.emit(t.S2Event.CORNER_CELL_HOVER,e);break;case t.CellTypes.MERGED_CELL:n.spreadsheet.emit(t.S2Event.MERGED_CELLS_HOVER,e)}}},this.onCanvasMouseup=function(e){if(n.isResizeArea(e))n.spreadsheet.emit(t.S2Event.LAYOUT_RESIZE_MOUSE_UP,e);else{var r=n.spreadsheet.getCell(e.target);if(r){var i=r.cellType;if(n.target===e.target){var o=n.isGuiIconShape(e.target);switch(i){case t.CellTypes.DATA_CELL:n.spreadsheet.emit(t.S2Event.DATA_CELL_CLICK,e);break;case t.CellTypes.ROW_CELL:if(o)break;n.spreadsheet.emit(t.S2Event.ROW_CELL_CLICK,e);break;case t.CellTypes.COL_CELL:if(o)break;n.spreadsheet.emit(t.S2Event.COL_CELL_CLICK,e);break;case t.CellTypes.CORNER_CELL:if(o)break;n.spreadsheet.emit(t.S2Event.CORNER_CELL_CLICK,e);break;case t.CellTypes.MERGED_CELL:n.spreadsheet.emit(t.S2Event.MERGED_CELLS_CLICK,e)}}switch(i){case t.CellTypes.DATA_CELL:n.spreadsheet.emit(t.S2Event.DATA_CELL_MOUSE_UP,e);break;case t.CellTypes.ROW_CELL:n.spreadsheet.emit(t.S2Event.ROW_CELL_MOUSE_UP,e);break;case t.CellTypes.COL_CELL:n.spreadsheet.emit(t.S2Event.COL_CELL_MOUSE_UP,e);break;case t.CellTypes.CORNER_CELL:n.spreadsheet.emit(t.S2Event.CORNER_CELL_MOUSE_UP,e);break;case t.CellTypes.MERGED_CELL:n.spreadsheet.emit(t.S2Event.MERGED_CELLS_MOUSE_UP,e)}}}},this.onCanvasClick=function(e){n.spreadsheet.emit(t.S2Event.GLOBAL_CLICK,e)},this.onCanvasDoubleClick=function(e){var r=n.spreadsheet;if(n.isResizeArea(e))r.emit(t.S2Event.LAYOUT_RESIZE_MOUSE_UP,e);else{r.emit(t.S2Event.GLOBAL_DOUBLE_CLICK,e);var i=r.getCell(e.target);if(i){var o=i.cellType;if(n.target===e.target)switch(o){case t.CellTypes.DATA_CELL:r.emit(t.S2Event.DATA_CELL_DOUBLE_CLICK,e);break;case t.CellTypes.ROW_CELL:r.emit(t.S2Event.ROW_CELL_DOUBLE_CLICK,e);break;case t.CellTypes.COL_CELL:r.emit(t.S2Event.COL_CELL_DOUBLE_CLICK,e);break;case t.CellTypes.CORNER_CELL:r.emit(t.S2Event.CORNER_CELL_DOUBLE_CLICK,e);break;case t.CellTypes.MERGED_CELL:r.emit(t.S2Event.MERGED_CELLS_DOUBLE_CLICK,e)}}}},this.onCanvasMouseout=function(t){if(n.isAutoResetSheetStyle&&!(null==t?void 0:t.shape)){var e=n.spreadsheet.interaction;e.isSelectedState()||e.intercepts.size>0||e.reset()}},this.onCanvasContextMenu=function(e){var r=n.spreadsheet;if(n.isResizeArea(e))r.emit(t.S2Event.LAYOUT_RESIZE_MOUSE_UP,e);else switch(r.emit(t.S2Event.GLOBAL_CONTEXT_MENU,e),n.spreadsheet.getCellType(e.target)){case t.CellTypes.DATA_CELL:n.spreadsheet.emit(t.S2Event.DATA_CELL_CONTEXT_MENU,e);break;case t.CellTypes.ROW_CELL:n.spreadsheet.emit(t.S2Event.ROW_CELL_CONTEXT_MENU,e);break;case t.CellTypes.COL_CELL:n.spreadsheet.emit(t.S2Event.COL_CELL_CONTEXT_MENU,e);break;case t.CellTypes.CORNER_CELL:n.spreadsheet.emit(t.S2Event.CORNER_CELL_CONTEXT_MENU,e);break;case t.CellTypes.MERGED_CELL:n.spreadsheet.emit(t.S2Event.MERGED_CELLS_CONTEXT_MENU,e)}},this.spreadsheet=e,this.bindEvents()}return Object.defineProperty(e.prototype,"canvasContainer",{get:function(){return this.spreadsheet.container},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAutoResetSheetStyle",{get:function(){return this.spreadsheet.options.interaction.autoResetSheetStyle},enumerable:!1,configurable:!0}),e.prototype.bindEvents=function(){var e=this;this.clearAllEvents(),this.addCanvasEvent(t.OriginEventType.CLICK,this.onCanvasClick),this.addCanvasEvent(t.OriginEventType.MOUSE_DOWN,this.onCanvasMousedown),this.addCanvasEvent(t.OriginEventType.MOUSE_MOVE,this.onCanvasMousemove),this.addCanvasEvent(t.OriginEventType.MOUSE_OUT,this.onCanvasMouseout),this.addCanvasEvent(t.OriginEventType.MOUSE_UP,this.onCanvasMouseup),this.addCanvasEvent(t.OriginEventType.DOUBLE_CLICK,this.onCanvasDoubleClick),this.addCanvasEvent(t.OriginEventType.CONTEXT_MENU,this.onCanvasContextMenu),this.addS2Event(t.S2Event.GLOBAL_ACTION_ICON_CLICK,(function(){e.spreadsheet.interaction.addIntercepts([t.InterceptType.HOVER]),e.spreadsheet.interaction.clearState()})),this.addDomEventListener(window,t.OriginEventType.CLICK,(function(t){e.resetSheetStyle(t),e.isCanvasEffect=e.isMouseOnTheCanvasContainer(t)})),this.addDomEventListener(window,t.OriginEventType.KEY_DOWN,(function(n){e.onKeyboardCopy(n),e.onKeyboardEsc(n),e.spreadsheet.emit(t.S2Event.GLOBAL_KEYBOARD_DOWN,n)})),this.addDomEventListener(window,t.OriginEventType.KEY_UP,(function(n){e.spreadsheet.emit(t.S2Event.GLOBAL_KEYBOARD_UP,n)})),this.addDomEventListener(window,t.OriginEventType.MOUSE_UP,(function(n){e.spreadsheet.emit(t.S2Event.GLOBAL_MOUSE_UP,n)})),this.addDomEventListener(window,t.OriginEventType.MOUSE_MOVE,(function(n){e.spreadsheet.emit(t.S2Event.GLOBAL_MOUSE_MOVE,n)}))},e.prototype.onKeyboardCopy=function(e){if(this.isCanvasEffect&&this.spreadsheet.options.interaction.enableCopy&&Vx(e.key,t.InteractionKeyboardKey.COPY)&&(e.metaKey||e.ctrlKey)){var n=dS(this.spreadsheet);dv(n)||this.spreadsheet.emit(t.S2Event.GLOBAL_COPIED,n)}},e.prototype.onKeyboardEsc=function(e){this.isCanvasEffect&&Vx(e.key,t.InteractionKeyboardKey.ESC)&&this.resetSheetStyle(e)},e.prototype.resetSheetStyle=function(e){if(this.isAutoResetSheetStyle&&this.spreadsheet){var n=this.spreadsheet.interaction;n.hasIntercepts([t.InterceptType.BRUSH_SELECTION,t.InterceptType.COL_BRUSH_SELECTION,t.InterceptType.ROW_BRUSH_SELECTION])?n.removeIntercepts([t.InterceptType.BRUSH_SELECTION,t.InterceptType.ROW_BRUSH_SELECTION,t.InterceptType.COL_BRUSH_SELECTION]):this.isMouseOnTheTooltip(e)||this.isMouseOnTheCanvasContainer(e)||(this.spreadsheet.emit(t.S2Event.GLOBAL_RESET,e),n.reset())}},e.prototype.isMouseOnTheCanvasContainer=function(t){if(t instanceof MouseEvent){var e=this.spreadsheet.getCanvasElement();if(!e)return!1;var n=e.getBoundingClientRect()||{},r=n.x,i=n.y,o=this.getContainerRect(),a=o.width,s=o.height;return e.contains(t.target)&&t.clientX<=r+a&&t.clientY<=i+s}return!1},e.prototype.getContainerRect=function(){var t,e=(null===(t=this.spreadsheet.facet)||void 0===t?void 0:t.panelBBox)||{},n=e.maxX,r=e.maxY,i=this.spreadsheet.options,o=i.width,a=i.height;return{width:Math.min(o,n),height:Math.min(a,r)}},e.prototype.isMouseOnTheTooltip=function(t){var e,n,r,i;if(!mT(this.spreadsheet,t).showTooltip)return!1;var o=(null===(r=null===(n=null===(e=this.spreadsheet.tooltip)||void 0===e?void 0:e.container)||void 0===n?void 0:n.getBoundingClientRect)||void 0===r?void 0:r.call(n))||{},a=o.x,s=o.y,l=o.width,u=o.height;return t.target instanceof Node&&this.spreadsheet.tooltip.visible?wT(null===(i=this.spreadsheet.tooltip)||void 0===i?void 0:i.container,t.target):t instanceof MouseEvent&&(t.clientX>=a&&t.clientX<=a+l&&t.clientY>=s&&t.clientY<=s+u)},e.prototype.isResizeArea=function(t){var e=Su(t.target,"attrs.appendInfo");return null==e?void 0:e.isResizeArea},e.prototype.activeResizeArea=function(t){this.resetResizeArea();var e=t.target;this.spreadsheet.store.set("activeResizeArea",e),e.attr(TC.backgroundOpacity,this.spreadsheet.theme.resizeArea.interactionState.hover.backgroundOpacity)},e.prototype.resetResizeArea=function(){var t=this.spreadsheet.store.get("activeResizeArea");ov(t)||t.attr(TC.backgroundOpacity,this.spreadsheet.theme.resizeArea.backgroundOpacity),this.spreadsheet.store.set("activeResizeArea",t)},e.prototype.hasBrushSelectionIntercepts=function(){return this.spreadsheet.interaction.hasIntercepts([t.InterceptType.HOVER,t.InterceptType.BRUSH_SELECTION,t.InterceptType.ROW_BRUSH_SELECTION,t.InterceptType.COL_BRUSH_SELECTION])},e.prototype.clear=function(){this.unbindEvents()},e.prototype.unbindEvents=function(){this.clearAllEvents()},e.prototype.addCanvasEvent=function(t,e){var n;null===(n=this.canvasContainer)||void 0===n||n.on(t,e),this.canvasEventHandlers.push({type:t,handler:e})},e.prototype.addS2Event=function(t,e){this.spreadsheet.on(t,e),this.s2EventHandlers.push({type:t,handler:e})},e.prototype.addDomEventListener=function(t,e,n){if(t.addEventListener){var r=this.spreadsheet.options.interaction.eventListenerOptions;t.addEventListener(e,n,r),this.domEventListeners.push({target:t,type:e,handler:n,options:r})}else console.error("Please make sure ".concat(t," has addEventListener function"))},e.prototype.clearAllEvents=function(){var t=this;Tf(this.canvasEventHandlers,(function(e){var n,r=e.type,i=e.handler;null===(n=t.canvasContainer)||void 0===n||n.off(r,i)})),Tf(this.s2EventHandlers,(function(e){var n=e.type,r=e.handler;t.spreadsheet.off(n,r)})),Tf(this.domEventListeners,(function(t){t.target.removeEventListener(t.type,t.handler,t.options)})),this.canvasEventHandlers=[],this.s2EventHandlers=[],this.domEventListeners=[]},e}(),hL=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.isRangeSelection=!1,n.handleColClick=function(e){e.stopPropagation();var r=n.spreadsheet.interaction,i=n.spreadsheet.getCell(e.target),o=null==i?void 0:i.getMeta();if(!dv(null==o?void 0:o.x)){r.addIntercepts([t.InterceptType.HOVER]);var a=[ZE(i)],s=n.spreadsheet.store.get("lastClickedCell");if(n.isRangeSelection&&s&&s.cellType===i.cellType&&s.getMeta().level===i.getMeta().level){var l=VC([n.spreadsheet.facet.layoutResult.rowsHierarchy.maxLevel,n.spreadsheet.facet.layoutResult.colsHierarchy.maxLevel],2),u=l[0],c=l[1],h=QE(s.getMeta(),i.getMeta()),d=h.start,f=h.end;i instanceof OS?a=n.handleSeriesNumberRowSelected(d.rowIndex,f.rowIndex,i):i.cellType===t.CellTypes.ROW_CELL&&i.getMeta().level===u?a=n.handleRowSelected(d.rowIndex,f.rowIndex,i):i.cellType===t.CellTypes.COL_CELL&&i.getMeta().level===c&&(a=n.handleColSelected(d.colIndex,f.colIndex,i)),r.changeState({cells:a,stateName:t.InteractionStateName.SELECTED})}else n.spreadsheet.store.set("lastClickedCell",i);var p=a.map((function(t){return t.id}));r.updateCells(r.getRowColActiveCells(p)),n.spreadsheet.emit(t.S2Event.GLOBAL_SELECTED,r.getActiveCells())}},n}return GC(n,e),n.prototype.bindEvents=function(){this.bindKeyboardDown(),this.bindDataCellClick(),this.bindColCellClick(),this.bindKeyboardUp()},n.prototype.reset=function(){this.isRangeSelection=!1,this.spreadsheet.interaction.removeIntercepts([t.InterceptType.CLICK])},n.prototype.bindKeyboardDown=function(){var e=this;this.spreadsheet.on(t.S2Event.GLOBAL_KEYBOARD_DOWN,(function(n){n.key===t.InteractionKeyboardKey.SHIFT&&(e.isRangeSelection=!0,e.spreadsheet.interaction.addIntercepts([t.InterceptType.CLICK]))}))},n.prototype.bindKeyboardUp=function(){var e=this;this.spreadsheet.on(t.S2Event.GLOBAL_KEYBOARD_UP,(function(n){n.key===t.InteractionKeyboardKey.SHIFT&&e.reset()}))},n.prototype.bindColCellClick=function(){var e=this;this.spreadsheet.isTableMode()&&this.spreadsheet.on(t.S2Event.ROW_CELL_CLICK,(function(t){e.handleColClick(t)})),this.spreadsheet.on(t.S2Event.COL_CELL_CLICK,(function(t){e.handleColClick(t)}))},n.prototype.bindDataCellClick=function(){var e=this;this.spreadsheet.on(t.S2Event.DATA_CELL_CLICK,(function(n){n.stopPropagation();var r=e.spreadsheet.getCell(n.target),i=r.getMeta(),o=e.spreadsheet.interaction;if(i){var a=e.spreadsheet.store.get("lastClickedCell");if(e.isRangeSelection&&(null==a?void 0:a.cellType)===r.cellType){var s=QE(a.getMeta(),r.getMeta()),l=s.start,u=s.end,c=sy(l.colIndex,u.colIndex+1).flatMap((function(t){var n=e.spreadsheet.facet.layoutResult.colLeafNodes[t].id;return sy(l.rowIndex,u.rowIndex+1).map((function(i){return{id:(e.spreadsheet.facet.getSeriesNumberWidth()||e.spreadsheet.isTableMode()?String(i):e.spreadsheet.facet.layoutResult.rowLeafNodes[i].id)+"-"+n,colIndex:t,rowIndex:i,type:r.cellType}}))}));o.addIntercepts([t.InterceptType.CLICK,t.InterceptType.HOVER]),o.changeState({cells:c,stateName:t.InteractionStateName.SELECTED}),e.spreadsheet.showTooltipWithInfo(n,gT(e.spreadsheet)),e.spreadsheet.emit(t.S2Event.GLOBAL_SELECTED,o.getActiveCells())}else e.spreadsheet.store.set("lastClickedCell",r)}}))},n.prototype.handleSeriesNumberRowSelected=function(t,e,n){var r=this.spreadsheet.facet.layoutResult.colLeafNodes[0].id;return sy(t,e+1).map((function(t){return{id:String(t)+"-"+r,colIndex:0,rowIndex:t,type:n.cellType}}))},n.prototype.handleRowSelected=function(t,e,n){return this.spreadsheet.facet.layoutResult.rowNodes.filter((function(n){return _p(n.rowIndex,t,e+1)})).map((function(t){return{id:t.id,colIndex:t.colIndex,rowIndex:t.rowIndex,type:n.cellType}}))},n.prototype.handleColSelected=function(t,e,n){return this.spreadsheet.facet.layoutResult.colLeafNodes.filter((function(n){return _p(n.colIndex,t,e+1)})).map((function(t){return{id:t.id,colIndex:t.colIndex,rowIndex:t.rowIndex,type:n.cellType}}))},n}(rL),dL=[t.InteractionKeyboardKey.ARROW_LEFT,t.InteractionKeyboardKey.ARROW_RIGHT,t.InteractionKeyboardKey.ARROW_UP,t.InteractionKeyboardKey.ARROW_DOWN],fL=function(e){function n(t){return e.call(this,t)||this}return GC(n,e),n.prototype.isCanvasEffect=function(){return this.spreadsheet.interaction.eventController.isCanvasEffect},n.prototype.bindEvents=function(){var e=this;this.spreadsheet.on(t.S2Event.GLOBAL_KEYBOARD_DOWN,(function(t){if(e.isCanvasEffect()){var n=t.shiftKey,r=t.metaKey,i=!1,o=!1,a=!1;dL.includes(t.key)&&(r&&n?(i=!1,o=!0,a=!1):r?(i=!0,o=!0,a=!0):n?(i=!1,o=!1,a=!1):(i=!0,o=!1,a=!0),e.handleMove({event:t,changeStartCell:i,isJumpMode:o,isSingleSelection:a}))}})),this.spreadsheet.on(t.S2Event.DATA_CELL_CLICK,(function(t){var n=e.spreadsheet.getCell(t.target).getMeta();n&&(e.startCell=e.getCellMetaFromViewMeta(n),e.endCell=e.startCell)}))},n.prototype.getCellMetaFromViewMeta=function(e){return{rowIndex:e.rowIndex,colIndex:e.colIndex,id:e.id,type:t.CellTypes.DATA_CELL}},n.prototype.handleMove=function(e){var n=e.event,r=e.changeStartCell,i=e.isJumpMode,o=e.isSingleSelection,a=this,s=a.spreadsheet,l=a.startCell,u=a.endCell,c=r?l:u,h=this.getMoveInfo(n.key,c,i);if(h){var d=VC([h.row,h.col],2),f=d[0],p=d[1];this.scrollToActiveCell(s,f,p);var v=this.generateCellMeta(s,f,p),g=o?[v]:this.getRangeCells(s,l,v);$E(s,g),r&&(this.startCell=v),this.endCell=v,this.spreadsheet.emit(t.S2Event.DATA_CELL_SELECT_MOVE,g)}},n.prototype.generateCellMeta=function(e,n,r){var i=e.isTableMode,o=e.facet.layoutResult,a=o.colLeafNodes,s=o.rowLeafNodes,l=i()?String(n):s[n].id,u=a[r].id;return{rowIndex:n,colIndex:r,id:IS(l,u),type:t.CellTypes.DATA_CELL}},n.prototype.getRangeCells=function(t,e,n){for(var r=QE(e,n),i=r.start,o=i.rowIndex,a=i.colIndex,s=r.end,l=s.rowIndex,u=s.colIndex,c=[],h=o;h<=l;h++)for(var d=a;d<=u;d++)c.push(this.generateCellMeta(t,h,d));return c},n.prototype.getMoveInfo=function(e,n,r){var i=this.spreadsheet,o=i.options,a=o.frozenColCount,s=void 0===a?0:a,l=o.frozenRowCount,u=void 0===l?0:l,c=o.frozenTrailingColCount,h=void 0===c?0:c,d=o.frozenTrailingRowCount,f=void 0===d?0:d,p=i.facet.layoutResult,v=p.rowLeafNodes,g=VC([0+s,p.colLeafNodes.length-h-1],2),y=g[0],m=g[1],C=VC([0+u,(i.isTableMode()?i.dataSet.getDisplayDataSet().length:v.length)-f-1],2),w=C[0],x=C[1];if(n)switch(e){case t.InteractionKeyboardKey.ARROW_RIGHT:if(n.colIndex+1>m)return;return{row:n.rowIndex,col:r?m:n.colIndex+1};case t.InteractionKeyboardKey.ARROW_LEFT:if(n.colIndex-1<y)return;return{row:n.rowIndex,col:r?y:n.colIndex-1};case t.InteractionKeyboardKey.ARROW_UP:if(n.rowIndex-1<w)return;return{row:r?w:n.rowIndex-1,col:n.colIndex};case t.InteractionKeyboardKey.ARROW_DOWN:if(n.rowIndex+1>x)return;return{row:r?x:n.rowIndex+1,col:n.colIndex}}},n.prototype.calculateOffset=function(t,e,n){var r=t.options,i=r.frozenRowCount,o=void 0===i?0:i,a=r.frozenTrailingRowCount,s=void 0===a?0:a,l=t.facet,u=t.frozenColGroup,c=t.frozenTrailingColGroup,h=t.frozenRowGroup,d=t.frozenTrailingRowGroup,f=l.layoutResult.colLeafNodes,p=l.getScrollOffset(),v=p.scrollX,g=p.scrollY,y=l.panelBBox,m=y.viewportHeight,C=y.viewportWidth,w=Su(t,"theme.splitLine"),x=u?Math.floor(u.getBBox().width-w.verticalBorderWidth/2):0,S=c?Math.floor(c.getBBox().width):0,E=h?Math.floor(h.getBBox().height-w.horizontalBorderWidth/2):0,_=d?Math.floor(d.getBBox().height):0,b=HE(v,g,l.viewCellWidths,l.viewCellHeights,{width:C-x-S,height:m-E-_,x:x,y:E},l.getRealScrollX(l.cornerBBox.width)),T=-1,L=-1,I=f.find((function(t){return t.colIndex===n}));if(n<=b[0]?T=I.x-x:n>=b[1]&&n<f.length-s&&(T=I.x+I.width-C+S),e<=b[2])L=l.viewCellHeights.getCellOffsetY(e-o);else if(e>=b[3]){L=l.viewCellHeights.getCellOffsetY(e+1)+_-m}return{offsetX:T,offsetY:L}},n.prototype.scrollToActiveCell=function(t,e,n){var r=this.calculateOffset(t,e,n),i=r.offsetX,o=r.offsetY,a=t.facet,s=t.facet.getScrollOffset(),l=s.scrollX,u=s.scrollY;a.scrollWithAnimation({offsetX:{value:i>-1?i:l},offsetY:{value:o>-1?o:u}})},n}(rL),pL=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.displayedCells=[],n.brushRangeCells=[],n.brushSelectionStage=t.InteractionBrushSelectionStage.UN_DRAGGED,n.brushSelectionMinimumMoveDistance=5,n.scrollAnimationComplete=!0,n.mouseMoveDistanceFromCanvas=0,n.setMoveDistanceFromCanvas=function(t,e,r){var i=0;if(e&&(i=t.x),r){var o=t.y;i=e?Math.max(o,i):o}n.mouseMoveDistanceFromCanvas=i},n.formatBrushPointForScroll=function(t){var e,r,i,o,a=t.x,s=t.y,l=n.spreadsheet.facet,u=l.panelBBox,c=u.minX,h=u.minY,d=u.maxX,f=u.maxY,p=(null===(e=n.endBrushPoint)||void 0===e?void 0:e.x)+a,v=(null===(r=n.endBrushPoint)||void 0===r?void 0:r.y)+s,g=!0,y=!0,m=null===(o=null===(i=l.vScrollBar)||void 0===i?void 0:i.getBBox())||void 0===o?void 0:o.width;return p>d?p=d-m-2:p<c?p=c+2:g=!1,v>f?v=f-2:v<=h?v=h+2:y=!1,{x:{value:p,needScroll:g},y:{value:v,needScroll:y}}},n.autoScrollIntervalId=null,n.autoScrollConfig=td(AC),n.validateYIndex=function(t){var e,r,i=n.spreadsheet.facet,o=i.frozenGroupInfo,a=0,s=null===(e=null==o?void 0:o.frozenRow)||void 0===e?void 0:e.range;if(s&&(a=s[1]+1),t<a)return null;var l=i.getCellRange().end,u=null===(r=null==o?void 0:o.frozenTrailingRow)||void 0===r?void 0:r.range;return u&&(l=u[0]-1),t>l?null:t},n.validateXIndex=function(t){var e,r,i=n.spreadsheet.facet,o=i.frozenGroupInfo,a=0,s=null===(e=null==o?void 0:o.frozenCol)||void 0===e?void 0:e.range;if(s&&(a=s[1]+1),t<a)return null;var l=i.layoutResult.colLeafNodes.length-1,u=null===(r=null==o?void 0:o.frozenTrailingCol)||void 0===r?void 0:r.range;return u&&(l=u[0]-1),t>l?null:t},n.adjustNextColIndexWithFrozen=function(e,r){var i=n.spreadsheet,o=i.facet,a=i.dataSet,s=i.options,l=a.getDisplayDataSet().length,u=o.layoutResult.colLeafNodes.length,c=ax(s,u,l),h=c.frozenTrailingColCount,d=c.frozenColCount,f=o.panelScrollGroupIndexes;return h>0&&r===t.ScrollDirection.TRAILING&&kE(e,h,u)?f[1]:d>0&&r===t.ScrollDirection.LEADING&&PE(e,d)?f[0]:e},n.adjustNextRowIndexWithFrozen=function(e,r){var i=n.spreadsheet,o=i.facet,a=i.dataSet,s=i.options,l=a.getDisplayDataSet().length,u=o.layoutResult.colLeafNodes.length,c=o.getCellRange(),h=ax(s,u,l),d=h.frozenTrailingRowCount,f=h.frozenRowCount,p=o.panelScrollGroupIndexes;return d>0&&r===t.ScrollDirection.TRAILING&&FE(e,c.end,d)?p[3]:f>0&&r===t.ScrollDirection.LEADING&&zE(e,c.start,f)?p[2]:e},n.getNextScrollDelta=function(e){var r=n.spreadsheet.facet.getScrollOffset(),i=r.scrollX,o=r.scrollY,a=0,s=0;if(e.y.scroll){var l=e.y.value>0?t.ScrollDirection.TRAILING:t.ScrollDirection.LEADING,u=n.adjustNextRowIndexWithFrozen(n.endBrushPoint.rowIndex,l);s=dv(c=n.validateYIndex(u+(e.y.value>0?1:-1)))?0:a_(c,l,n.spreadsheet)-o}if(e.x.scroll){l=e.x.value>0?t.ScrollDirection.TRAILING:t.ScrollDirection.LEADING;var c,h=n.adjustNextColIndexWithFrozen(n.endBrushPoint.colIndex,l);a=dv(c=n.validateXIndex(h+(e.x.value>0?1:-1)))?0:o_(c,l,n.spreadsheet)-i}return{x:a,y:s}},n.onScrollAnimationComplete=function(){n.scrollAnimationComplete=!0,n.brushSelectionStage!==t.InteractionBrushSelectionStage.UN_DRAGGED&&n.renderPrepareSelected(n.endBrushPoint)},n.autoScroll=function(){if(n.brushSelectionStage!==t.InteractionBrushSelectionStage.UN_DRAGGED&&n.scrollAnimationComplete){var e=n.autoScrollConfig,r=n.spreadsheet.facet.getScrollOffset(),i={offsetX:{value:r.scrollX,animate:!0},offsetY:{value:r.scrollY,animate:!0}},o=n.getNextScrollDelta(e),a=o.x,s=o.y;if(0!==s||0!==a){e.y.scroll&&(i.offsetY.value+=s),e.x.scroll&&(i.offsetX.value+=a,i.offsetX.value<0&&(i.offsetX.value=0)),n.scrollAnimationComplete=!1;var l=3;e.x.scroll&&(l=1),n.spreadsheet.facet.scrollWithAnimation(i,Math.max(16,300-n.mouseMoveDistanceFromCanvas*l),n.onScrollAnimationComplete)}else n.clearAutoScroll()}},n.handleScroll=im((function(e,r){if(n.brushSelectionStage!==t.InteractionBrushSelectionStage.UN_DRAGGED){var i=n.formatBrushPointForScroll({x:e,y:r}),o=i.x,a=o.value,s=o.needScroll,l=i.y,u=l.value,c=l.needScroll,h=n.autoScrollConfig;c&&(h.y.value=r,h.y.scroll=!0),s&&(h.x.value=e,h.x.scroll=!0),n.setMoveDistanceFromCanvas({x:e,y:r},s,c),n.renderPrepareSelected({x:a,y:u}),(c||s)&&(n.clearAutoScroll(),n.autoScroll(),n.autoScrollIntervalId=setInterval(n.autoScroll,16))}}),30),n.clearAutoScroll=function(){n.autoScrollIntervalId&&(clearInterval(n.autoScrollIntervalId),n.autoScrollIntervalId=null,n.resetScrollDelta())},n.onUpdateCells=function(t,e){return e()},n.showPrepareSelectedCells=function(){n.brushRangeCells=n.getBrushRangeCells(),n.spreadsheet.interaction.changeState({cells:op(n.brushRangeCells,(function(t){return ZE(t)})),stateName:t.InteractionStateName.PREPARE_SELECT,force:!0,onUpdateCells:n.onUpdateCells})},n.renderPrepareSelected=function(e){var r=e.x,i=e.y,o=n.spreadsheet.container.getShape(r,i),a=n.spreadsheet.getCell(o);if(a&&(a instanceof OS||a instanceof DE||a instanceof xE)){var s=a.getMeta(),l=s.rowIndex,u=s.colIndex,c=s.x,h=s.y;n.endBrushPoint={x:r,y:i,rowIndex:l,colIndex:u,headerY:h,headerX:c};var d=n.spreadsheet.interaction;d.addIntercepts([t.InterceptType.HOVER]),d.clearStyleIndependent(),n.isValidBrushSelection()&&(n.showPrepareSelectedCells(),n.updatePrepareSelectMask())}},n.getSelectedCellMetas=function(t){},n}return GC(n,e),n.prototype.bindEvents=function(){this.bindMouseDown(),this.bindMouseMove(),this.bindMouseUp()},n.prototype.getPrepareSelectMaskTheme=function(){var t;return null===(t=this.spreadsheet.theme)||void 0===t?void 0:t.prepareSelectMask},n.prototype.initPrepareSelectMaskShape=function(){var t=this.spreadsheet.foregroundGroup;if(t){t.removeChild(this.prepareSelectMaskShape);var e=this.getPrepareSelectMaskTheme();this.prepareSelectMaskShape=t.addShape("rect",{visible:!1,attrs:{width:0,height:0,x:0,y:0,fill:null==e?void 0:e.backgroundColor,fillOpacity:null==e?void 0:e.backgroundOpacity,zIndex:5},capture:!1})}},n.prototype.setBrushSelectionStage=function(t){this.brushSelectionStage=t},n.prototype.isPointInCanvas=function(t){var e=this.spreadsheet.facet.getCanvasHW(),n=e.height,r=e.width,i=this.spreadsheet.facet.panelBBox,o=i.minX,a=i.minY;return t.x>o&&t.x<r&&t.y>a&&t.y<n},n.prototype.resetDrag=function(){this.hidePrepareSelectMaskShape(),this.setBrushSelectionStage(t.InteractionBrushSelectionStage.UN_DRAGGED)},n.prototype.isValidBrushSelection=function(){var t=this.getBrushRange(),e=t.start,n=t.end;return n.x-e.x>this.brushSelectionMinimumMoveDistance||n.y-e.y>this.brushSelectionMinimumMoveDistance},n.prototype.setDisplayedCells=function(){this.displayedCells=this.spreadsheet.interaction.getPanelGroupAllDataCells()},n.prototype.updatePrepareSelectMask=function(){var t=this.getBrushRange();this.prepareSelectMaskShape.attr({x:t.start.x,y:t.start.y,width:t.width,height:t.height}),this.prepareSelectMaskShape.show()},n.prototype.hidePrepareSelectMaskShape=function(){var t;null===(t=this.prepareSelectMaskShape)||void 0===t||t.hide()},n.prototype.resetScrollDelta=function(){this.autoScrollConfig=td(AC)},n.prototype.getBrushPoint=function(t){var e=this.spreadsheet.facet.getScrollOffset(),n=e.scrollY,r=e.scrollX,i={x:null==t?void 0:t.x,y:null==t?void 0:t.y},o=this.spreadsheet.getCell(t.target).getMeta(),a=o.colIndex,s=o.rowIndex;return UC(UC({},i),{rowIndex:s,colIndex:a,scrollY:n,scrollX:r})},n.prototype.getBrushRange=function(){var t,e,n,r,i,o,a,s,l,u,c,h,d,f,p,v,g=this.spreadsheet.facet.getScrollOffset(),y=g.scrollX,m=g.scrollY,C=Math.min(this.startBrushPoint.rowIndex,null===(t=this.endBrushPoint)||void 0===t?void 0:t.rowIndex),w=Math.max(this.startBrushPoint.rowIndex,null===(e=this.endBrushPoint)||void 0===e?void 0:e.rowIndex),x=Math.min(this.startBrushPoint.colIndex,null===(n=this.endBrushPoint)||void 0===n?void 0:n.colIndex),S=Math.max(this.startBrushPoint.colIndex,null===(r=this.endBrushPoint)||void 0===r?void 0:r.colIndex),E=this.startBrushPoint.x+this.startBrushPoint.scrollX-y,_=this.startBrushPoint.y+this.startBrushPoint.scrollY-m,b=Math.min(E,null===(i=this.endBrushPoint)||void 0===i?void 0:i.x),T=Math.max(E,null===(o=this.endBrushPoint)||void 0===o?void 0:o.x),L=Math.min(_,null===(a=this.endBrushPoint)||void 0===a?void 0:a.y),I=Math.max(_,null===(s=this.endBrushPoint)||void 0===s?void 0:s.y),O=Math.min(null===(l=this.startBrushPoint)||void 0===l?void 0:l.headerX,null===(u=this.endBrushPoint)||void 0===u?void 0:u.headerX),R=Math.max(null===(c=this.startBrushPoint)||void 0===c?void 0:c.headerX,null===(h=this.endBrushPoint)||void 0===h?void 0:h.headerX);return{start:{rowIndex:C,colIndex:x,x:b,y:L,headerX:O,headerY:Math.min(null===(d=this.startBrushPoint)||void 0===d?void 0:d.headerY,null===(f=this.endBrushPoint)||void 0===f?void 0:f.headerY)},end:{rowIndex:w,colIndex:S,x:T,y:I,headerX:R,headerY:Math.max(null===(p=this.startBrushPoint)||void 0===p?void 0:p.headerY,null===(v=this.endBrushPoint)||void 0===v?void 0:v.headerY)},width:T-b,height:I-L}},n.prototype.getBrushRangeCells=function(){var t=this;return this.setDisplayedCells(),this.displayedCells.filter((function(e){var n=e.getMeta();return t.isInBrushRange(n)}))},n.prototype.mouseDown=function(e){var n;null===(n=null==e?void 0:e.preventDefault)||void 0===n||n.call(e),this.spreadsheet.interaction.hasIntercepts([t.InterceptType.CLICK])||(this.setBrushSelectionStage(t.InteractionBrushSelectionStage.CLICK),this.initPrepareSelectMaskShape(),this.setDisplayedCells(),this.startBrushPoint=this.getBrushPoint(e))},n.prototype.addBrushIntercepts=function(){this.spreadsheet.interaction.addIntercepts([t.InterceptType.BRUSH_SELECTION])},n.prototype.bindMouseUp=function(e){var n=this;void 0===e&&(e=!1),this.spreadsheet.on(t.S2Event.GLOBAL_MOUSE_UP,(function(r){n.brushSelectionStage===t.InteractionBrushSelectionStage.DRAGGED?(e&&n.clearAutoScroll(),n.isValidBrushSelection()&&(n.addBrushIntercepts(),n.updateSelectedCells(),n.spreadsheet.showTooltipWithInfo(r,gT(n.spreadsheet))),n.spreadsheet.interaction.getCurrentStateName()===t.InteractionStateName.PREPARE_SELECT&&n.spreadsheet.interaction.reset(),n.resetDrag()):n.resetDrag()})),this.spreadsheet.on(t.S2Event.GLOBAL_CONTEXT_MENU,(function(){n.brushSelectionStage!==t.InteractionBrushSelectionStage.UN_DRAGGED&&(n.spreadsheet.interaction.removeIntercepts([t.InterceptType.HOVER]),n.resetDrag())}))},n.prototype.isInBrushRange=function(t){return!1},n.prototype.bindMouseDown=function(){},n.prototype.bindMouseMove=function(){},n.prototype.updateSelectedCells=function(){},n}(rL),vL=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayedCells=[],t.brushRangeCells=[],t.getSelectedCellMetas=function(e){for(var n,r=[],i=t.spreadsheet.facet.layoutResult.colLeafNodes,o=null!==(n=t.spreadsheet.facet.layoutResult.rowLeafNodes)&&void 0!==n?n:[],a=e.start.rowIndex;a<e.end.rowIndex+1;a++)for(var s=e.start.colIndex;s<e.end.colIndex+1;s++){var l=String(i[s].id),u=String(a);o.length&&(u=String(o[a].id)),r.push({colIndex:s,rowIndex:a,id:"".concat(u,"-").concat(l),type:"dataCell",rowId:u,colId:l,spreadsheet:t.spreadsheet})}return r},t}return GC(n,e),n.prototype.bindMouseDown=function(){var n=this;this.spreadsheet.on(t.S2Event.DATA_CELL_MOUSE_DOWN,(function(t){e.prototype.mouseDown.call(n,t),n.resetScrollDelta()}))},n.prototype.bindMouseMove=function(){var e=this;this.spreadsheet.on(t.S2Event.GLOBAL_MOUSE_MOVE,(function(n){if(e.brushSelectionStage!==t.InteractionBrushSelectionStage.UN_DRAGGED){e.setBrushSelectionStage(t.InteractionBrushSelectionStage.DRAGGED);var r=e.spreadsheet.container.getPointByEvent(n);if(e.clearAutoScroll(),e.isPointInCanvas(r))e.renderPrepareSelected(r);else{var i=r.x-e.endBrushPoint.x,o=r.y-e.endBrushPoint.y;e.handleScroll(i,o)}}}))},n.prototype.isInBrushRange=function(t){var e=this.getBrushRange(),n=e.start,r=e.end,i=t.rowIndex,o=t.colIndex;return i>=n.rowIndex&&i<=r.rowIndex&&o>=n.colIndex&&o<=r.colIndex},n.prototype.updateSelectedCells=function(){var e=this.spreadsheet,n=e.interaction,r=e.options,i=this.getBrushRange(),o=this.getSelectedCellMetas(i);n.changeState({cells:o,stateName:t.InteractionStateName.SELECTED}),r.interaction.selectedCellHighlight&&o.forEach((function(t){t_(t)})),this.spreadsheet.emit(t.S2Event.DATA_CELL_BRUSH_SELECTION,this.brushRangeCells),this.spreadsheet.emit(t.S2Event.GLOBAL_SELECTED,this.brushRangeCells),ov(this.brushRangeCells)&&n.removeIntercepts([t.InterceptType.HOVER])},n.prototype.bindMouseUp=function(){e.prototype.bindMouseUp.call(this,!0)},n}(pL),gL=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayedCells=[],t.brushRangeCells=[],t.isInBrushRange=function(e){var n=t.getBrushRange(),r=n.start,i=n.end,o=e.x,a=void 0===o?0:o,s=e.y,l=void 0===s?0:s;return a>=r.headerX&&a<=i.headerX&&l>=r.headerY&&l<=i.headerY},t.onUpdateCells=function(t){return t.updateCells(t.getAllColHeaderCells())},t}return GC(n,e),n.prototype.bindEvents=function(){this.bindMouseDown(),this.bindMouseMove(),this.bindMouseUp()},n.prototype.bindMouseDown=function(){var n=this;[t.S2Event.COL_CELL_MOUSE_DOWN].forEach((function(t){n.spreadsheet.on(t,(function(t){e.prototype.mouseDown.call(n,t)}))}))},n.prototype.isPointInCanvas=function(t){var e=this.spreadsheet.facet.getCanvasHW().width,n=this.spreadsheet.facet.cornerBBox,r=n.width,i=n.minY,o=n.maxY;return t.x>=r&&t.x<=e&&t.y>=i&&t.y<=o},n.prototype.bindMouseMove=function(){var e=this;this.spreadsheet.on(t.S2Event.COL_CELL_MOUSE_MOVE,(function(n){if(e.brushSelectionStage!==t.InteractionBrushSelectionStage.UN_DRAGGED){e.setBrushSelectionStage(t.InteractionBrushSelectionStage.DRAGGED);var r=e.spreadsheet.container.getPointByEvent(n.originalEvent);e.isPointInCanvas(r)&&e.renderPrepareSelected(r)}}))},n.prototype.setDisplayedCells=function(){this.displayedCells=this.spreadsheet.interaction.getAllColHeaderCells()},n.prototype.getBrushPoint=function(t){var n=this.spreadsheet.getCell(t.target).getMeta(),r=n.x,i=n.y;return UC(UC({},e.prototype.getBrushPoint.call(this,t)),{headerX:r,headerY:i})},n.prototype.updateSelectedCells=function(){var e=this.spreadsheet.interaction;e.changeState({cells:op(this.brushRangeCells,ZE),stateName:t.InteractionStateName.SELECTED,onUpdateCells:function(t){t.updateCells(t.getAllColHeaderCells())}}),this.spreadsheet.emit(t.S2Event.COL_CELL_BRUSH_SELECTION,this.brushRangeCells),this.spreadsheet.emit(t.S2Event.GLOBAL_SELECTED,this.brushRangeCells),ov(this.brushRangeCells)&&e.removeIntercepts([t.InterceptType.HOVER])},n.prototype.addBrushIntercepts=function(){this.spreadsheet.interaction.addIntercepts([t.InterceptType.COL_BRUSH_SELECTION])},n}(pL),yL=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayedCells=[],t.brushRangeCells=[],t.isInBrushRange=function(e){var n=t.getBrushRange(),r=n.start,i=n.end,o=e.x,a=void 0===o?0:o,s=e.y,l=void 0===s?0:s;return a>=r.headerX&&a<=i.headerX&&l>=r.headerY&&l<=i.headerY},t.onUpdateCells=function(t){return t.updateCells(t.getAllRowHeaderCells())},t}return GC(n,e),n.prototype.bindMouseDown=function(){var n=this;[t.S2Event.ROW_CELL_MOUSE_DOWN].forEach((function(t){n.spreadsheet.on(t,(function(t){e.prototype.mouseDown.call(n,t)}))}))},n.prototype.isPointInCanvas=function(t){var e=this.spreadsheet.facet.getCanvasHW().height,n=this.spreadsheet.facet.cornerBBox,r=n.minX,i=n.height,o=n.maxX;return t.x>=r&&t.x<=o&&t.y>=i&&t.y<=e},n.prototype.bindMouseMove=function(){var e=this;this.spreadsheet.on(t.S2Event.ROW_CELL_MOUSE_MOVE,(function(n){if(e.brushSelectionStage!==t.InteractionBrushSelectionStage.UN_DRAGGED){e.setBrushSelectionStage(t.InteractionBrushSelectionStage.DRAGGED);var r=e.spreadsheet.container.getPointByEvent(n.originalEvent);e.isPointInCanvas(r)&&e.renderPrepareSelected(r)}}))},n.prototype.setDisplayedCells=function(){this.displayedCells=this.spreadsheet.interaction.getAllRowHeaderCells()},n.prototype.getBrushPoint=function(t){var n=this.spreadsheet.getCell(t.target).getMeta(),r=n.x,i=n.y;return UC(UC({},e.prototype.getBrushPoint.call(this,t)),{headerX:r,headerY:i})},n.prototype.updateSelectedCells=function(){var e=this.spreadsheet.interaction;e.changeState({cells:op(this.brushRangeCells,ZE),stateName:t.InteractionStateName.SELECTED,onUpdateCells:function(t){t.updateCells(t.getAllRowHeaderCells())}}),this.spreadsheet.emit(t.S2Event.ROW_CELL_BRUSH_SELECTION,this.brushRangeCells),this.spreadsheet.emit(t.S2Event.GLOBAL_SELECTED,this.brushRangeCells),ov(this.brushRangeCells)&&e.removeIntercepts([t.InterceptType.HOVER])},n.prototype.addBrushIntercepts=function(){this.spreadsheet.interaction.addIntercepts([t.InterceptType.ROW_BRUSH_SELECTION])},n}(pL),mL=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.isMultiSelection=!1,t}return GC(n,e),n.prototype.bindEvents=function(){this.bindKeyboardDown(),this.bindDataCellClick(),this.bindKeyboardUp()},n.prototype.reset=function(){this.isMultiSelection=!1,this.spreadsheet.interaction.removeIntercepts([t.InterceptType.CLICK])},n.prototype.bindKeyboardDown=function(){var e=this;this.spreadsheet.on(t.S2Event.GLOBAL_KEYBOARD_DOWN,(function(n){qE(n)&&(e.isMultiSelection=!0,e.spreadsheet.interaction.addIntercepts([t.InterceptType.CLICK]))}))},n.prototype.bindKeyboardUp=function(){var e=this;this.spreadsheet.on(t.S2Event.GLOBAL_KEYBOARD_UP,(function(t){qE(t)&&e.reset()}))},n.prototype.getSelectedCells=function(e){var n=e.getMeta().id,r=this.spreadsheet.interaction,i=r.getCells();return r.getCurrentStateName()!==t.InteractionStateName.SELECTED&&(i=[]),i.find((function(t){return t.id===n}))?i.filter((function(t){return t.id!==n})):XC(XC([],VC(i),!1),[ZE(e)],!1)},n.prototype.bindDataCellClick=function(){var e=this;this.spreadsheet.on(t.S2Event.DATA_CELL_CLICK,(function(n){n.stopPropagation();var r=e.spreadsheet.getCell(n.target),i=r.getMeta(),o=e.spreadsheet.interaction;if(e.isMultiSelection&&i){var a=e.getSelectedCells(r);if(ov(a))return o.clearState(),void e.spreadsheet.hideTooltip();o.addIntercepts([t.InterceptType.CLICK,t.InterceptType.HOVER]),e.spreadsheet.hideTooltip(),o.changeState({cells:a,stateName:t.InteractionStateName.SELECTED}),e.spreadsheet.emit(t.S2Event.GLOBAL_SELECTED,o.getActiveCells()),e.spreadsheet.showTooltipWithInfo(n,gT(e.spreadsheet))}}))},n}(rL),CL=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.resizeStartPosition={},n.resizeMouseMove=function(e){var r,i;if(null===(r=n.resizeReferenceGroup)||void 0===r?void 0:r.get("visible")){null===(i=null==e?void 0:e.preventDefault)||void 0===i||i.call(e);var o=e.originalEvent,a=n.getResizeInfo(),s=n.resizeReferenceGroup.getChildren()||[];if(!ov(s)){var l=VC(s,2)[1],u=VC(Jh(l.attr("path")),2),c=u[0],h=u[1];a.type===t.ResizeDirectionType.Horizontal?n.updateHorizontalResizingEndGuideLinePosition(o,a,c,h):n.updateVerticalResizingEndGuideLinePosition(o,a,c,h),n.updateResizeGuideLineTheme(l),l.attr("path",[c,h])}}},n}return GC(n,e),n.prototype.bindEvents=function(){this.bindMouseDown(),this.bindMouseMove(),this.bindMouseUp()},n.prototype.initResizeGroup=function(){if(!this.resizeReferenceGroup){this.resizeReferenceGroup=this.spreadsheet.foregroundGroup.addGroup();var t=this.spreadsheet.options,e=t.width,n=t.height,r=this.getResizeAreaTheme(),i=r.guideLineColor,o={path:"",lineDash:r.guideLineDash,stroke:i,lineWidth:r.size};this.resizeReferenceGroup.addShape("path",{id:DC,attrs:o}),this.resizeReferenceGroup.addShape("path",{id:PC,attrs:o}),this.resizeReferenceGroup.addShape("rect",{id:kC,attrs:{appendInfo:{isResizeArea:!0},x:0,y:0,width:e,height:n,fill:"transparent"}})}},n.prototype.getResizeAreaTheme=function(){return this.spreadsheet.theme.resizeArea},n.prototype.setResizeTarget=function(t){this.resizeTarget=t},n.prototype.getGuideLineWidthAndHeight=function(){var t=this.spreadsheet.options,e=t.width,n=t.height,r=this.spreadsheet.facet.panelBBox,i=r.maxY,o=r.maxX;return{width:Math.min(o,e),height:Math.min(i,n)}},n.prototype.getResizeShapes=function(){var t;return(null===(t=this.resizeReferenceGroup)||void 0===t?void 0:t.get("children"))||[]},n.prototype.setResizeMaskCursor=function(t){var e=VC(this.getResizeShapes(),3)[2];null==e||e.attr("cursor",t)},n.prototype.updateResizeGuideLinePosition=function(e,n){var r=this.getResizeShapes();if(!ov(r)){var i=VC(r,2),o=i[0],a=i[1],s=n.type,l=n.offsetX,u=n.offsetY,c=n.width,h=n.height,d=this.getGuideLineWidthAndHeight(),f=d.width,p=d.height;if(this.setResizeMaskCursor("".concat(s,"-resize")),s===t.ResizeDirectionType.Horizontal)return o.attr("path",[["M",l,u],["L",l,p]]),a.attr("path",[["M",l+c,u],["L",l+c,p]]),void(this.resizeStartPosition.offsetX=e.offsetX);o.attr("path",[["M",l,u],["L",f,u]]),a.attr("path",[["M",l,u+h],["L",f,u+h]]),this.resizeStartPosition.offsetY=e.offsetY}},n.prototype.bindMouseDown=function(){var e=this;this.spreadsheet.on(t.S2Event.LAYOUT_RESIZE_MOUSE_DOWN,(function(n){var r=n.target,i=n.originalEvent,o=e.getCellAppendInfo(n.target);e.spreadsheet.store.set("resized",!1),(null==o?void 0:o.isResizeArea)&&(e.spreadsheet.interaction.reset(),e.spreadsheet.interaction.addIntercepts([t.InterceptType.RESIZE]),e.setResizeTarget(r),e.showResizeGroup(),e.updateResizeGuideLinePosition(i,o))}))},n.prototype.bindMouseMove=function(){var e=this;this.spreadsheet.on(t.S2Event.LAYOUT_RESIZE_MOUSE_MOVE,(function(t){im(e.resizeMouseMove,33)(t)}))},n.prototype.getResizeGuideLinePosition=function(){var t=VC(this.resizeReferenceGroup.getChildren()||[],2),e=t[0],n=t[1],r=(null==e?void 0:e.attr("path"))||[],i=(null==n?void 0:n.attr("path"))||[],o=VC(r[0]||[],3),a=o[1],s=void 0===a?0:a,l=o[2],u=void 0===l?0:l,c=VC(i[0]||[],3),h=c[1],d=void 0===h?0:h,f=c[2];return{start:{x:s,y:u},end:{x:d,y:void 0===f?0:f}}},n.prototype.getDisAllowResizeInfo=function(){var t,e=this.getResizeInfo(),n=this.spreadsheet.options.interaction.resize,r=e.width,i=e.height,o=e.resizedWidth,a=e.resizedHeight,s=null===(t=null==n?void 0:n.disable)||void 0===t?void 0:t.call(n,e);return{displayWidth:s?r:o,displayHeight:s?i:a,isDisabled:s}},n.prototype.getResizeWidthDetail=function(){var e,n,r=this.getResizeInfo(),i=this.getDisAllowResizeInfo().displayWidth;switch(r.effect){case t.ResizeAreaEffect.Field:return{eventType:t.S2Event.LAYOUT_RESIZE_ROW_WIDTH,style:{rowCfg:{widthByField:(e={},e[r.id]=i,e)}}};case t.ResizeAreaEffect.Tree:return{eventType:t.S2Event.LAYOUT_RESIZE_TREE_WIDTH,style:{treeRowsWidth:i,rowCfg:{treeRowsWidth:i}}};case t.ResizeAreaEffect.Cell:return{eventType:t.S2Event.LAYOUT_RESIZE_COL_WIDTH,style:{colCfg:{widthByFieldValue:(n={},n[r.id]=i,n)}}};case t.ResizeAreaEffect.Series:return{eventType:t.S2Event.LAYOUT_RESIZE_SERIES_WIDTH,seriesNumberWidth:i};default:return null}},n.prototype.getResizeHeightDetail=function(){var e,n,r,i=this.spreadsheet.options,o=i.interaction.resize,a=i.style.rowCfg.heightByField,s=this.spreadsheet.theme.rowCell.cell.padding,l=this.getResizeInfo(),u=this.getDisAllowResizeInfo().displayHeight,c=u-s.top-s.bottom;switch(l.effect){case t.ResizeAreaEffect.Field:return{eventType:t.S2Event.LAYOUT_RESIZE_COL_HEIGHT,style:{colCfg:{heightByField:(e={},e[l.id]=u,e)}}};case t.ResizeAreaEffect.Cell:return r=a[String(l.id)]||(null==o?void 0:o.rowResizeType)===t.ResizeType.CURRENT?{rowCfg:{heightByField:(n={},n[l.id]=c,n)}}:{cellCfg:{height:c}},{eventType:t.S2Event.LAYOUT_RESIZE_ROW_HEIGHT,style:r};default:return null}},n.prototype.getResizeDetail=function(){return this.getResizeInfo().type===t.ResizeDirectionType.Horizontal?this.getResizeWidthDetail():this.getResizeHeightDetail()},n.prototype.showResizeGroup=function(){this.initResizeGroup(),this.resizeReferenceGroup.set("visible",!0)},n.prototype.hideResizeGroup=function(){this.resizeReferenceGroup.set("visible",!1)},n.prototype.bindMouseUp=function(){var e=this;this.spreadsheet.on(t.S2Event.GLOBAL_MOUSE_UP,(function(){var t;e.setResizeMaskCursor("default"),e.resizeReferenceGroup&&!ov(null===(t=e.resizeReferenceGroup)||void 0===t?void 0:t.getChildren())&&(e.hideResizeGroup(),e.renderResizedResult())}))},n.prototype.updateResizeGuideLineTheme=function(t){var e=this.getResizeAreaTheme(),n=e.guideLineColor,r=e.guideLineDisableColor,i=this.getDisAllowResizeInfo().isDisabled;t.attr("stroke",i?r:n),this.setResizeMaskCursor(i?"no-drop":"default")},n.prototype.updateHorizontalResizingEndGuideLinePosition=function(t,e,n,r){var i=t.offsetX-this.resizeStartPosition.offsetX;e.width+i<28&&(i=-(e.width-28));var o=e.offsetX+e.width+i;n[1]=o,r[1]=o,this.resizeTarget.attr({x:o-e.size/2})},n.prototype.updateVerticalResizingEndGuideLinePosition=function(t,e,n,r){var i=t.offsetY-this.resizeStartPosition.offsetY;e.height+i<16&&(i=-(e.height-16));var o=e.offsetY+e.height+i;n[2]=o,r[2]=o,this.resizeTarget.attr({y:o-e.size/2})},n.prototype.renderResizedResult=function(){var e=this.getResizeInfo(),n=this.getResizeDetail()||{},r=n.style,i=n.seriesNumberWidth,o=n.eventType,a={info:e,style:r};this.spreadsheet.emit(t.S2Event.LAYOUT_RESIZE,a),this.spreadsheet.emit(o,a),r&&this.spreadsheet.setOptions({style:r}),i&&this.spreadsheet.setTheme({rowCell:{seriesNumberWidth:i}}),this.spreadsheet.store.set("resized",!0),this.render()},n.prototype.getResizeInfo=function(){var t=this.getCellAppendInfo(this.resizeTarget),e=this.getResizeGuideLinePosition(),n=e.start,r=e.end,i=Math.floor(r.x-n.x),o=Math.floor(r.y-n.y);return UC(UC({},t),{resizedWidth:i,resizedHeight:o})},n.prototype.render=function(){this.resizeStartPosition={},this.resizeTarget=null,this.resizeReferenceGroup=null,this.spreadsheet.render(!1)},n}(rL),wL=function(){function e(e){var n=this;this.interactions=new Map,this.intercepts=new Set,this.hoverTimer=null,this.defaultState={cells:[],force:!1},this.onTriggerInteractionsResetEffect=function(){n.interactions.forEach((function(t){t.reset()}))},this.selectAll=function(){n.changeState({stateName:t.InteractionStateName.ALL_SELECTED})},this.getCellChildrenNodes=function(e){var r,i=null===(r=null==e?void 0:e.getMeta)||void 0===r?void 0:r.call(e),o=(null==e?void 0:e.cellType)===t.CellTypes.ROW_CELL;return n.spreadsheet.isHierarchyTreeType()&&o?_w.getAllLeaveNodes(i).filter((function(t){return t.rowIndex===i.rowIndex})):_w.getAllChildrenNodes(i)},this.selectHeaderCell=function(e){var r;void 0===e&&(e={});var i=e.cell;if(!ov(i)){var o=null===(r=null==i?void 0:i.getMeta)||void 0===r?void 0:r.call(i);if(o&&!dv(null==o?void 0:o.x)){n.addIntercepts([t.InterceptType.HOVER]);var a=n.spreadsheet.isHierarchyTreeType(),s=(null==i?void 0:i.cellType)===t.CellTypes.COL_CELL,l=n.getState(),u=n.isSelectedCell(i),c=(null==e?void 0:e.isMultiSelection)&&n.isSelectedState(),h=u?[]:n.getCellChildrenNodes(i),d=u?[]:[ZE(i)];if(c&&(d=nd(null==l?void 0:l.cells,d),h=nd(null==l?void 0:l.nodes,h),u&&(d=d.filter((function(t){return t.id!==o.id})),h=h.filter((function(t){return!(null==t?void 0:t.id.includes(o.id))})))),ov(d))return n.reset(),void n.spreadsheet.emit(t.S2Event.GLOBAL_SELECTED,n.getActiveCells());var f=h.filter((function(t){return null==t?void 0:t.isLeaf}));n.changeState({cells:d,nodes:f,stateName:t.InteractionStateName.SELECTED});var p=d.map((function(t){return t.id}));return n.updateCells(n.getRowColActiveCells(p)),a&&!s||n.highlightNodes(h),n.spreadsheet.emit(t.S2Event.GLOBAL_SELECTED,n.getActiveCells()),!0}}},this.highlightNodes=function(e){void 0===e&&(e=[]),e.forEach((function(e){var n;null===(n=null==e?void 0:e.belongsCell)||void 0===n||n.updateByState(t.InteractionStateName.SELECTED,e.belongsCell)}))},this.mergeCells=function(t,e){FS(n.spreadsheet,t,e)},this.unmergeCell=function(t){WS(n.spreadsheet,t)},this.spreadsheet=e,this.registerEventController(),this.registerInteractions(),window.addEventListener("visibilitychange",this.onTriggerInteractionsResetEffect)}return e.prototype.destroy=function(){this.interactions.clear(),this.intercepts.clear(),this.eventController.clear(),this.clearHoverTimer(),this.resetState(),window.removeEventListener("visibilitychange",this.onTriggerInteractionsResetEffect)},e.prototype.reset=function(){this.clearState(),this.clearHoverTimer(),this.intercepts.clear(),this.spreadsheet.hideTooltip()},e.prototype.setState=function(t){i_(this.spreadsheet,t)},e.prototype.getState=function(){return this.spreadsheet.store.get(IC)||this.defaultState},e.prototype.setInteractedCells=function(t){var e=this.getInteractedCells().concat([t]),n=this.getState();n.interactedCells=e,this.setState(n)},e.prototype.getInteractedCells=function(){var t=this.getState();return(null==t?void 0:t.interactedCells)||[]},e.prototype.resetState=function(){this.spreadsheet.store.set(IC,this.defaultState)},e.prototype.getCurrentStateName=function(){return this.getState().stateName},e.prototype.isEqualStateName=function(t){return this.getCurrentStateName()===t},e.prototype.isStateOf=function(t){var e=this.getState();return(null==e?void 0:e.stateName)===t},e.prototype.isSelectedState=function(){return this.isStateOf(t.InteractionStateName.SELECTED)},e.prototype.isAllSelectedState=function(){return this.isStateOf(t.InteractionStateName.ALL_SELECTED)},e.prototype.isHoverFocusState=function(){return this.isStateOf(t.InteractionStateName.HOVER_FOCUS)},e.prototype.isHoverState=function(){return this.isStateOf(t.InteractionStateName.HOVER)},e.prototype.isActiveCell=function(t){return!!this.getCells().find((function(e){return t.getMeta().id===e.id}))},e.prototype.isSelectedCell=function(t){return this.isSelectedState()&&this.isActiveCell(t)},e.prototype.getCells=function(){var t=this.getState();return(null==t?void 0:t.cells)||[]},e.prototype.getActiveCells=function(){var t=this.getCells().map((function(t){return t.id})),e=this.getAllCells();return op(t,(function(t){return $f(e,(function(e){var n;return(null===(n=null==e?void 0:e.getMeta())||void 0===n?void 0:n.id)===t}))})).filter((function(t){return t}))},e.prototype.clearStyleIndependent=function(){(this.isSelectedState()||this.isHoverState()||this.isAllSelectedState())&&this.getPanelGroupAllDataCells().forEach((function(t){t.hideInteractionShape()}))},e.prototype.getPanelGroupAllUnSelectedDataCells=function(){var t=this;return this.getPanelGroupAllDataCells().filter((function(e){return!t.isActiveCell(e)}))},e.prototype.getPanelGroupAllDataCells=function(){var t;return RT(null===(t=this.spreadsheet.panelGroup)||void 0===t?void 0:t.getChildren(),OS)},e.prototype.getAllRowHeaderCells=function(){var e,n,r=((null===(e=this.spreadsheet.foregroundGroup)||void 0===e?void 0:e.getChildren())||[]).find((function(t){return t instanceof UT})),i=(null===(n=null==r?void 0:r.cfg)||void 0===n?void 0:n.children)||[];return RT(i,DE).filter((function(e){return e.cellType===t.CellTypes.ROW_CELL}))},e.prototype.getAllColHeaderCells=function(){var e,n,r=((null===(e=this.spreadsheet.foregroundGroup)||void 0===e?void 0:e.getChildren())||[]).find((function(t){return t instanceof HT})),i=(null===(n=null==r?void 0:r.cfg)||void 0===n?void 0:n.children)||[];return RT(i,xE).filter((function(e){return e.cellType===t.CellTypes.COL_CELL}))},e.prototype.getRowColActiveCells=function(t){return nd(this.getAllRowHeaderCells(),this.getAllColHeaderCells()).filter((function(e){return t.includes(e.getMeta().id)}))},e.prototype.getAllCells=function(){return nd(this.getPanelGroupAllDataCells(),this.getAllRowHeaderCells(),this.getAllColHeaderCells())},e.prototype.hideColumns=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!0),KS(this.spreadsheet,t,e)},e.prototype.getBrushSelectionInfo=function(t){var e,n,r;return ev(t)?{dataBrushSelection:t,rowBrushSelection:t,colBrushSelection:t}:{dataBrushSelection:null!==(e=null==t?void 0:t.data)&&void 0!==e&&e,rowBrushSelection:null!==(n=null==t?void 0:t.row)&&void 0!==n&&n,colBrushSelection:null!==(r=null==t?void 0:t.col)&&void 0!==r&&r}},e.prototype.getDefaultInteractions=function(){var e=this.spreadsheet.options.interaction,n=e.resize,r=e.brushSelection,i=e.multiSelection,o=e.rangeSelection,a=e.selectedCellMove,s=this.getBrushSelectionInfo(r),l=s.dataBrushSelection,u=s.rowBrushSelection,c=s.colBrushSelection;return[{key:t.InteractionName.CORNER_CELL_CLICK,interaction:lL},{key:t.InteractionName.DATA_CELL_CLICK,interaction:iL},{key:t.InteractionName.ROW_COLUMN_CLICK,interaction:aL},{key:t.InteractionName.ROW_TEXT_CLICK,interaction:sL},{key:t.InteractionName.MERGED_CELLS_CLICK,interaction:oL},{key:t.InteractionName.HOVER,interaction:uL,enable:!Cw()},{key:t.InteractionName.BRUSH_SELECTION,interaction:vL,enable:!Cw()&&l},{key:t.InteractionName.ROW_BRUSH_SELECTION,interaction:yL,enable:!Cw()&&u},{key:t.InteractionName.COL_BRUSH_SELECTION,interaction:gL,enable:!Cw()&&c},{key:t.InteractionName.COL_ROW_RESIZE,interaction:CL,enable:!Cw()&&n},{key:t.InteractionName.DATA_CELL_MULTI_SELECTION,interaction:mL,enable:!Cw()&&i},{key:t.InteractionName.RANGE_SELECTION,interaction:hL,enable:!Cw()&&o},{key:t.InteractionName.SELECTED_CELL_MOVE,interaction:fL,enable:!Cw()&&a}]},e.prototype.registerInteractions=function(){var t=this,e=this.spreadsheet.options.interaction.customInteractions;this.interactions.clear(),this.getDefaultInteractions().forEach((function(e){var n=e.key,r=e.interaction;!1!==e.enable&&t.interactions.set(n,new r(t.spreadsheet))})),ov(e)||Tf(e,(function(e){var n=e.interaction;t.interactions.set(e.key,new n(t.spreadsheet))}))},e.prototype.registerEventController=function(){this.eventController=new cL(this.spreadsheet)},e.prototype.draw=function(){this.spreadsheet.container.draw()},e.prototype.clearState=function(){r_(this.spreadsheet)&&this.draw()},e.prototype.changeState=function(e){var n=this,r=this.spreadsheet.interaction,i=e.cells,o=void 0===i?[]:i,a=e.force,s=e.stateName,l=e.onUpdateCells;ov(o)&&s===t.InteractionStateName.SELECTED?a&&r.changeState({cells:[],stateName:t.InteractionStateName.UNSELECTED}):(this.getCurrentStateName()===t.InteractionStateName.ALL_SELECTED&&this.clearStyleIndependent(),this.clearState(),this.setState(e),l?l(this,(function(){return n.updatePanelGroupAllDataCells()})):this.updatePanelGroupAllDataCells(),this.draw())},e.prototype.updatePanelGroupAllDataCells=function(){this.updateCells(this.getPanelGroupAllDataCells())},e.prototype.updateCells=function(t){void 0===t&&(t=[]),t.forEach((function(t){t.update()}))},e.prototype.addIntercepts=function(t){var e=this;void 0===t&&(t=[]),t.forEach((function(t){e.intercepts.add(t)}))},e.prototype.hasIntercepts=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.intercepts.has(t)}))},e.prototype.removeIntercepts=function(t){var e=this;void 0===t&&(t=[]),t.forEach((function(t){e.intercepts.delete(t)}))},e.prototype.clearHoverTimer=function(){clearTimeout(this.hoverTimer)},e.prototype.setHoverTimer=function(t){this.hoverTimer=t},e.prototype.getHoverTimer=function(){return this.hoverTimer},e}(),xL=function(){function t(t){var e=this;this.viewport=window,this.init=function(){e.initDevicePixelRatioListener(),e.initDeviceZoomListener()},this.destroy=function(){e.removeDevicePixelRatioListener(),e.removeDeviceZoomListener()},this.removeDevicePixelRatioListener=function(){var t;(null===(t=e.devicePixelRatioMedia)||void 0===t?void 0:t.removeEventListener)?e.devicePixelRatioMedia.removeEventListener("change",e.renderByDevicePixelRatioChanged):e.devicePixelRatioMedia.removeListener(e.renderByDevicePixelRatioChanged)},this.initDeviceZoomListener=function(){var t,n;Cw()||null===(n=null===(t=e.viewport)||void 0===t?void 0:t.visualViewport)||void 0===n||n.addEventListener("resize",e.renderByZoomScale)},this.removeDeviceZoomListener=function(){var t,n;Cw()||null===(n=null===(t=e.viewport)||void 0===t?void 0:t.visualViewport)||void 0===n||n.removeEventListener("resize",e.renderByZoomScale)},this.renderByDevicePixelRatioChanged=function(){e.renderByDevicePixelRatio()},this.renderByDevicePixelRatio=function(t){void 0===t&&(t=window.devicePixelRatio);var n=e.spreadsheet,r=n.container,i=n.options,o=i.width,a=i.height,s=i.devicePixelRatio,l=e.spreadsheet.getCanvasElement();if(r.get("pixelRatio")!==t&&l){var u=Math.max(t,s,1);r.set("pixelRatio",u),r.changeSize(o,a),e.spreadsheet.render(!1)}},this.renderByZoomScale=Kd((function(t){var n=Math.ceil(t.target.scale);n>=1&&e.renderByDevicePixelRatio(n)}),350),this.spreadsheet=t}return t.prototype.initDevicePixelRatioListener=function(){var t;this.devicePixelRatioMedia=window.matchMedia("(resolution: ".concat(window.devicePixelRatio,"dppx)")),(null===(t=this.devicePixelRatioMedia)||void 0===t?void 0:t.addEventListener)?this.devicePixelRatioMedia.addEventListener("change",this.renderByDevicePixelRatioChanged):this.devicePixelRatioMedia.addListener(this.renderByDevicePixelRatioChanged)},t}(),SL=function(){function t(t){this.visible=!1,this.position={x:0,y:0},this.spreadsheet=t}return t.prototype.show=function(t){var e,n,r,i=t.position,o=t.options,a=t.content,s=t.event,l=Jb(o).enterable,u=this.spreadsheet.options.tooltip||{},c=u.autoAdjustBoundary,h=u.adjustPosition;this.visible=!0,this.options=t;var d=this.getContainer();this.renderContent(a);var f=Qb({spreadsheet:this.spreadsheet,position:i,tooltipContainer:d,autoAdjustBoundary:c}),p=f.x,v=f.y;this.position=null!==(e=null==h?void 0:h({position:{x:p,y:v},event:s}))&&void 0!==e?e:{x:p,y:v},eT(d,{style:{left:"".concat(null===(n=this.position)||void 0===n?void 0:n.x,"px"),top:"".concat(null===(r=this.position)||void 0===r?void 0:r.y,"px"),pointerEvents:l?"all":"none"},visible:!0})},t.prototype.hide=function(){this.visible=!1,this.container&&(eT(this.container,{style:{pointerEvents:"none"},visible:!1}),this.resetPosition())},t.prototype.destroy=function(){var t,e;this.visible=!1,this.container&&(this.resetPosition(),null===(e=(t=this.container).remove)||void 0===e||e.call(t),this.container=null)},t.prototype.renderContent=function(t){if(this.container){this.clearContent();var e=(this.spreadsheet.options.tooltip||{}).content,n=null!=t?t:e;dv(n)||("string"!=typeof n?n instanceof Element&&this.container.appendChild(n):this.container.innerHTML=n)}},t.prototype.clearContent=function(){this.container&&(this.container.innerHTML="")},t.prototype.disablePointerEvent=function(){this.container&&"none"!==this.container.style.pointerEvents&&eT(this.container,{style:{pointerEvents:"none"}})},t.prototype.resetPosition=function(){this.position={x:0,y:0}},t.prototype.getContainer=function(){var t;if(!this.container){var e=this.spreadsheet.options.tooltip,n=(null===(t=e.getContainer)||void 0===t?void 0:t.call(e))||document.body,r=document.createElement("div");return eT(r,{style:e.style,className:[cw].concat(e.className)}),n.appendChild(r),this.container=r,this.container}return this.container},t}(),EL=function(e){function n(t,n,r){var i=e.call(this)||this;return i.store=new Zw,i.untypedOn=i.on,i.untypedEmit=i.emit,i.on=function(t,e){return i.untypedOn(t,e)},i.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i.untypedEmit.apply(i,XC([t],VC(e),!1))},i.initHiddenColumnsDetail=function(){var t=i.options.interaction.hiddenColumnFields,e=i.store.get("hiddenColumnsDetail");ov(t)&&ov(e)||KS(i,t,!0)},i.measureTextWidth=fu((function(t,e){var n;if(void 0===t&&(t=""),!e)return 0;var r=null===(n=i.getCanvasElement())||void 0===n?void 0:n.getContext("2d"),o=e,a=o.fontSize,s=o.fontFamily,l=o.fontWeight,u=o.fontStyle,c=o.fontVariant;return r.font=[u,c,l,"".concat(a,"px"),s].join(" ").trim(),r.measureText(String(t)).width}),(function(t,e){return XC([t],VC(Lp(e)),!1).join("")})),i.measureTextWidthRoughly=function(t,e){var n,r;void 0===e&&(e={});var o=i.measureTextWidth("a",e),a=i.measureTextWidth("蚂",e),s=0;if(!t)return s;try{for(var l=jC(t),u=l.next();!u.done;u=l.next()){var c=u.value.charCodeAt(0);s+=c>=0&&c<=255?o:a}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return s},i.dataCfg=u_(n),i.options=c_(r),i.dataSet=i.getDataSet(i.options),i.setDebug(),i.initTooltip(),i.initGroups(t),i.bindEvents(),i.initInteraction(),i.initTheme(),i.initHdAdapter(),i.registerIcons(),i.setOverscrollBehavior(),i}return GC(n,e),n.prototype.setOverscrollBehavior=function(){var t=this.options.interaction.overscrollBehavior,e=window.getComputedStyle(document.body).getPropertyValue("overscroll-behavior");e&&"auto"!==e?this.store.set("initOverscrollBehavior",e):t&&(document.body.style.overscrollBehavior=t)},n.prototype.restoreOverscrollBehavior=function(){document.body.style.overscrollBehavior=this.store.get("initOverscrollBehavior")||""},n.prototype.setDebug=function(){Fw.getInstance().setDebug(this.options.debug)},n.prototype.initTheme=function(){this.setThemeCfg({name:"default"})},n.prototype.getMountContainer=function(t){var e=bp(t)?document.querySelector(t):t;if(!e)throw new Error("Target mount container is not a DOM element");return e},n.prototype.initHdAdapter=function(){this.options.hdAdapter&&(this.hdAdapter=new xL(this),this.hdAdapter.init())},n.prototype.initInteraction=function(){this.interaction=new wL(this)},n.prototype.initTooltip=function(){var t,e;this.tooltip=this.renderTooltip(),this.tooltip instanceof SL||console.warn("[Custom Tooltip]: ".concat(null===(e=null===(t=this.tooltip)||void 0===t?void 0:t.constructor)||void 0===e?void 0:e.toString()," should be extends from BaseTooltip"))},n.prototype.renderTooltip=function(){var t,e;return(null===(e=null===(t=this.options.tooltip)||void 0===t?void 0:t.renderTooltip)||void 0===e?void 0:e.call(t,this))||new SL(this)},n.prototype.showTooltip=function(t){var e,n,r=t.content,i=t.event,o=this.getCell(null==i?void 0:i.target),a=Na(r)?r(o,t):r;null===(n=(e=this.tooltip).show)||void 0===n||n.call(e,UC(UC({},t),{content:a}))},n.prototype.showTooltipWithInfo=function(t,e,n){var r=mT(this,t),i=r.showTooltip,o=r.content;if(i){var a=this.getCell(null==t?void 0:t.target),s=pT({spreadsheet:this,cellInfos:e,targetCell:a,options:UC({enableFormat:!0},n)});this.showTooltip({data:s,position:{x:t.clientX,y:t.clientY},options:UC({enterable:!0},n),event:t,content:o})}},n.prototype.hideTooltip=function(){var t,e;null===(e=(t=this.tooltip).hide)||void 0===e||e.call(t)},n.prototype.destroyTooltip=function(){var t,e;null===(e=(t=this.tooltip).destroy)||void 0===e||e.call(t)},n.prototype.registerIcons=function(){var t=this.options.customSVGIcons;ov(t)||Tf(t,(function(t){Gw(t.name,t.svg)}))},n.prototype.setDataCfg=function(t){this.store.set("originalDataCfg",t),this.dataCfg=u_(this.dataCfg,t),this.store.set(qo,Zo)},n.prototype.setOptions=function(t){this.hideTooltip(),this.options=s_(this.options,t),this.registerIcons()},n.prototype.render=function(e,n){if(void 0===e&&(e=!0),void 0===n&&(n={}),this.getCanvasElement()){var r=n.reBuildDataSet,i=void 0!==r&&r,o=n.reBuildHiddenColumnsDetail,a=void 0===o||o;this.emit(t.S2Event.LAYOUT_BEFORE_RENDER),i&&(this.dataSet=this.getDataSet(this.options)),e&&(this.clearDrillDownData("",!0),this.dataSet.setDataCfg(this.dataCfg)),this.buildFacet(),a&&this.initHiddenColumnsDetail(),this.emit(t.S2Event.LAYOUT_AFTER_RENDER)}},n.prototype.destroy=function(){var e,n,r,i,o;this.restoreOverscrollBehavior(),this.emit(t.S2Event.LAYOUT_DESTROY),null===(e=this.facet)||void 0===e||e.destroy(),null===(n=this.hdAdapter)||void 0===n||n.destroy(),null===(r=this.interaction)||void 0===r||r.destroy(),null===(i=this.store)||void 0===i||i.clear(),this.destroyTooltip(),this.clearCanvasEvent(),null===(o=this.container)||void 0===o||o.destroy(),function(){var t;null===(t=document.getElementById(gx))||void 0===t||t.remove()}()},n.prototype.setThemeCfg=function(t){void 0===t&&(t={});var e=(null==t?void 0:t.theme)||{},n=Ew(UC(UC({},t),{spreadsheet:this}));this.theme=s_(n,e)},n.prototype.setTheme=function(t){this.theme=s_(this.theme,t)},n.prototype.updatePagination=function(t){this.options=s_(this.options,{pagination:t}),this.store.set("scrollX",0),this.store.set("scrollY",0)},n.prototype.getContentHeight=function(){return this.facet.getContentHeight()},n.prototype.changeSize=function(t,e){void 0===t&&(t=this.options.width),void 0===e&&(e=this.options.height),this.changeSheetSize(t,e)},n.prototype.changeSheetSize=function(t,e){void 0===t&&(t=this.options.width),void 0===e&&(e=this.options.height);var n=this.getCanvasElement(),r=this.container.get("width"),i=this.container.get("height");(t!==r||e!==i)&&n&&(this.options=s_(this.options,{width:t,height:e}),this.container.changeSize(t,e))},n.prototype.getCanvasElement=function(){return this.container.get("el")},n.prototype.getLayoutWidthType=function(){return this.options.style.layoutWidthType},n.prototype.getRowNodes=function(t){return void 0===t&&(t=-1),-1===t?this.facet.layoutResult.rowNodes:this.facet.layoutResult.rowNodes.filter((function(e){return e.level===t}))},n.prototype.getRowLeafNodes=function(){var t;return(null===(t=this.facet)||void 0===t?void 0:t.layoutResult.rowLeafNodes)||[]},n.prototype.getColumnNodes=function(t){var e;void 0===t&&(t=-1);var n=(null===(e=this.facet)||void 0===e?void 0:e.layoutResult.colNodes)||[];return-1===t?n:n.filter((function(e){return e.level===t}))},n.prototype.getColumnLeafNodes=function(){var t;return(null===(t=this.facet)||void 0===t?void 0:t.layoutResult.colLeafNodes)||[]},n.prototype.updateScrollOffset=function(t){this.facet.updateScrollOffset(s_({offsetX:{value:void 0,animate:!1},offsetY:{value:void 0,animate:!1}},t))},n.prototype.getTooltipDataItemMappingCallback=function(){var t;return null===(t=this.options)||void 0===t?void 0:t.mappingDisplayDataItem},n.prototype.getCell=function(t){for(var e,n=t;n&&!(n instanceof uo);){if(n instanceof bS)return n;n=null===(e=n.get)||void 0===e?void 0:e.call(n,"parent")}return null},n.prototype.getCellType=function(t){var e=this.getCell(t);return null==e?void 0:e.cellType},n.prototype.getTotalsConfig=function(t){var e=Su(this.options.totals,Op(this.dataSet.fields.rows,t)?"row":"col",{});return{showSubTotals:!(!e.showSubTotals||!Op(e.subTotalsDimensions,t))&&e.showSubTotals,showGrandTotals:e.showGrandTotals,reverseLayout:e.reverseLayout,reverseSubLayout:e.reverseSubLayout,label:e.label||lw("总计"),subLabel:e.subLabel||lw("小计")}},n.prototype.initGroups=function(t){var e=this.options,n=e.width,r=e.height,i=e.supportCSSTransform,o=e.devicePixelRatio;this.container=new uo({container:this.getMountContainer(t),width:n,height:r,localRefresh:!1,supportCSSTransform:i,pixelRatio:Math.max(o,1)}),this.backgroundGroup=this.container.addGroup({name:yo,zIndex:0}),this.panelGroup=this.container.addGroup({name:Co,zIndex:1}),this.foregroundGroup=this.container.addGroup({name:mo,zIndex:3}),this.initPanelGroupChildren(),this.updateContainerStyle()},n.prototype.updateContainerStyle=function(){var t=this.getCanvasElement();t&&(t.style.display="block")},n.prototype.initPanelGroupChildren=function(){this.panelScrollGroup=new nL({name:wo,zIndex:1,s2:this}),this.panelGroup.add(this.panelScrollGroup)},n.prototype.getInitColumnLeafNodes=function(){return this.store.get("initColumnLeafNodes",[])},n.prototype.clearColumnLeafNodes=function(){this.store.set("initColumnLeafNodes",void 0)},n.prototype.clearCanvasEvent=function(){var t=this;cp(this.getEvents(),(function(e,n){t.off(n)}))},n.prototype.updateSortMethodMap=function(t,e,n){var r;void 0===n&&(n=!1);var i=n?null:this.store.get("sortMethodMap");this.store.set("sortMethodMap",UC(UC({},i),((r={})[t]=e,r)))},n.prototype.getMenuDefaultSelectedKeys=function(t){var e=Su(this.store.get("sortMethodMap"),t);return e?[e]:[]},n}(ht),_L=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return GC(n,e),n.prototype.getDataSet=function(t){var e=t.dataSet,n=t.hierarchyType;return e?e(this):"customTree"===n?new _T(this):new ST(this)},n.prototype.isPivotMode=function(){return!0},n.prototype.isTableMode=function(){return!1},n.prototype.isHierarchyTreeType=function(){var t=this.options.hierarchyType;return"tree"===t||"customTree"===t},n.prototype.isScrollContainsRowHeader=function(){return!this.isFrozenRowHeader()},n.prototype.isFrozenRowHeader=function(){var t;return null===(t=this.options)||void 0===t?void 0:t.frozenRowHeader},n.prototype.isValueInCols=function(){return this.dataSet.fields.valueInCols},n.prototype.clearDrillDownData=function(t,e){this.dataSet instanceof ST&&(this.dataSet.clearDrillDownData(t),e||(this.interaction.reset(),this.render(!1)))},n.prototype.getFacetCfgFromDataSetAndOptions=function(){var t=this,e=this.dataSet,n=e.fields,r=e.meta,i=this.options,o=i.style,a=i.dataCell;return UC(UC(UC(UC({},this.options),n),o),{meta:r,spreadsheet:this,dataSet:this.dataSet,dataCell:null!=a?a:function(e){return new OS(e,t)}})},n.prototype.buildFacet=function(){var t,e=this.getFacetCfgFromDataSetAndOptions();null===(t=this.facet)||void 0===t||t.destroy(),this.facet=new QT(e),this.facet.render()},n.prototype.bindEvents=function(){this.off(t.S2Event.ROW_CELL_COLLAPSE_TREE_ROWS),this.off(t.S2Event.LAYOUT_TREE_ROWS_COLLAPSE_ALL),this.on(t.S2Event.ROW_CELL_COLLAPSE_TREE_ROWS,this.handleRowCellCollapseTreeRows),this.on(t.S2Event.LAYOUT_TREE_ROWS_COLLAPSE_ALL,this.handleTreeRowsCollapseAll)},n.prototype.handleRowCellCollapseTreeRows=function(e){var n,r=e.id,i=e.isCollapsed,o={style:{collapsedRows:(n={},n[r]=i,n)}};this.emit(t.S2Event.LAYOUT_COLLAPSE_ROWS,{collapsedRows:o.style.collapsedRows,meta:null==e?void 0:e.node}),this.setOptions(o),this.render(!1),this.emit(t.S2Event.LAYOUT_AFTER_COLLAPSE_ROWS,{collapsedRows:o.style.collapsedRows,meta:null==e?void 0:e.node})},n.prototype.handleTreeRowsCollapseAll=function(t){var e={style:{hierarchyCollapse:!t,collapsedRows:null,rowExpandDepth:null}};this.setOptions(e),this.render(!1)},n.prototype.groupSortByMethod=function(e,n){var r=this.dataCfg.fields,i=r.rows,o=r.columns,a=this.options.style.colCfg.hideMeasureColumn,s=this.isValueInCols()?mf(i):mf(o),l=n.query,u=n.value,c=Jh(l),h=u;a&&this.isValueInCols()&&(h=this.dataSet.fields.values[0],c[fo]=h);var d={sortFieldId:s,sortMethod:e,sortByMeasure:h,query:c},f=this.dataCfg.sortParams.filter((function(t){return(null==t?void 0:t.sortFieldId)!==s}));this.updateSortMethodMap(n.id,e,!0);var p=XC(XC([],VC(f),!1),[d],!1);this.emit(t.S2Event.RANGE_SORT,p),this.setDataCfg(UC(UC({},this.dataCfg),{sortParams:p})),this.render()},n.prototype.handleGroupSort=function(e,n){var r=this;e.stopPropagation(),this.interaction.addIntercepts([t.InterceptType.HOVER]);var i=this.getMenuDefaultSelectedKeys(null==n?void 0:n.id),o={onClick:function(i){var o=i.key;r.groupSortByMethod(o,n),r.emit(t.S2Event.RANGE_SORTED,e)},menus:yw(),defaultSelectedKeys:i};this.showTooltipWithInfo(e,[],{operator:o,onlyMenu:!0})},n}(EL),bL=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return GC(e,t),e}(eL),TL=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.onSortTooltipClick=function(e,r){var i=e.key,o={sortFieldId:r.field,sortMethod:i};n.updateSortMethodMap(r.id,i),n.emit(t.S2Event.RANGE_SORT,[o])},n}return GC(n,e),n.prototype.getDataSet=function(t){var e=t.dataSet;return e?e(this):new ET(this)},n.prototype.isPivotMode=function(){return!1},n.prototype.isTableMode=function(){return!0},n.prototype.isHierarchyTreeType=function(){return!1},n.prototype.isScrollContainsRowHeader=function(){return!1},n.prototype.isFrozenRowHeader=function(){return!1},n.prototype.clearDrillDownData=function(){},n.prototype.isValueInCols=function(){return!1},n.prototype.bindEvents=function(){},n.prototype.initPanelGroupChildren=function(){var t,n=this;e.prototype.initPanelGroupChildren.call(this);var r={zIndex:2,s2:this};t=VC([So,Eo,_o,bo,To,Lo].map((function(t){var e=new bL(UC({name:t},r));return n.panelGroup.add(e),e})),6),this.frozenRowGroup=t[0],this.frozenColGroup=t[1],this.frozenTrailingRowGroup=t[2],this.frozenTrailingColGroup=t[3],this.frozenTopGroup=t[4],this.frozenBottomGroup=t[5]},n.prototype.getFacetCfgFromDataSetAndOptions=function(){var t=this,e=this.dataSet,n=e.fields,r=e.meta,i=this.options,o=i.style,a=i.dataCell;return UC(UC(UC(UC({},this.options),n),o),{meta:r,spreadsheet:this,dataSet:this.dataSet,dataCell:null!=a?a:function(e){return t.options.showSeriesNumber&&0===e.colIndex?new KE(e,t):new XE(e,t)}})},n.prototype.buildFacet=function(){var t,e=this.getFacetCfgFromDataSetAndOptions();null===(t=this.facet)||void 0===t||t.destroy(),this.facet=new tL(e),this.facet.render()},n.prototype.clearFrozenGroups=function(){this.frozenRowGroup.set("children",[]),this.frozenColGroup.set("children",[]),this.frozenTrailingRowGroup.set("children",[]),this.frozenTrailingColGroup.set("children",[]),this.frozenTopGroup.set("children",[]),this.frozenBottomGroup.set("children",[])},n.prototype.destroy=function(){e.prototype.destroy.call(this),this.clearFrozenGroups(),this.off(t.S2Event.RANGE_SORT),this.off(t.S2Event.RANGE_FILTER)},n.prototype.handleGroupSort=function(e,n){var r=this;e.stopPropagation(),this.interaction.addIntercepts([t.InterceptType.HOVER]);var i=this.getMenuDefaultSelectedKeys(null==n?void 0:n.id),o={onClick:function(t){var e=t.key;r.onSortTooltipClick({key:e},n)},menus:mw(),defaultSelectedKeys:i};this.showTooltipWithInfo(e,[],{operator:o,onlyMenu:!0})},n}(EL);t.BACK_GROUND_GROUP_CONTAINER_Z_INDEX=0,t.BRUSH_AUTO_SCROLL_INITIAL_CONFIG=AC,t.BaseBrushSelection=pL,t.BaseCell=bS,t.BaseDataSet=xT,t.BaseEvent=rL,t.BaseTooltip=SL,t.CORNER_MAX_WIDTH_RATIO=.5,t.ColBrushSelection=gL,t.ColCell=xE,t.ColHeader=HT,t.CornerCell=SE,t.CornerCellClick=lL,t.CornerHeader=WT,t.CustomTreePivotDataSet=_T,t.DEBUG_HEADER_LAYOUT=kw,t.DEBUG_TRANSFORM_DATA=Pw,t.DEBUG_VIEW_RENDER=zw,t.DEFAULT_DATA_CONFIG=$o,t.DEFAULT_OPTIONS=HC,t.DEFAULT_PAGE_INDEX=1,t.DEFAULT_STYLE=FC,t.DEFAULT_TREE_ROW_WIDTH=120,t.DEFAULT_VALUE_RANGES=Zo,t.DataCell=OS,t.DataCellBrushSelection=vL,t.DataCellClick=iL,t.DataCellMultiSelection=mL,t.DebuggerUtil=Fw,t.EMPTY_PLACEHOLDER=Uo,t.EXTRA_COLUMN_FIELD=po,t.EXTRA_FIELD=fo,t.EventController=cL,t.FONT_FAMILY=rw,t.FRONT_GROUND_GROUP_BRUSH_SELECTION_Z_INDEX=5,t.FRONT_GROUND_GROUP_COL_FROZEN_Z_INDEX=4,t.FRONT_GROUND_GROUP_COL_SCROLL_Z_INDEX=3,t.FRONT_GROUND_GROUP_CONTAINER_Z_INDEX=3,t.FRONT_GROUND_GROUP_RESIZE_AREA_Z_INDEX=5,t.Frame=GT,t.FrozenCellGroupMap=Qo,t.GEvent=lt,t.GuiIcon=qw,t.HORIZONTAL_RESIZE_AREA_KEY_PRE=Ho,t.HOVER_FOCUS_DURATION=bC,t.Hierarchy=bw,t.HoverEvent=uL,t.ID_SEPARATOR=Go,t.IMAGE="image",t.INTERACTION_STATE_INFO_KEY=IC,t.INTERVAL_BAR_HEIGHT=12,t.KEY_COL_REAL_WIDTH_INFO="col-real-width-info",t.KEY_GROUP_BACK_GROUND=yo,t.KEY_GROUP_COL_FROZEN=Po,t.KEY_GROUP_COL_FROZEN_TRAILING=ko,t.KEY_GROUP_COL_HORIZONTAL_RESIZE_AREA="colHorizontalResizeAreaGroup",t.KEY_GROUP_COL_RESIZE_AREA=Bo,t.KEY_GROUP_COL_SCROLL=Do,t.KEY_GROUP_CORNER_RESIZE_AREA=Mo,t.KEY_GROUP_FORE_GROUND=mo,t.KEY_GROUP_FROZEN_COL_RESIZE_AREA=No,t.KEY_GROUP_FROZEN_ROW_RESIZE_AREA=Oo,t.KEY_GROUP_FROZEN_SPLIT_LINE=Ro,t.KEY_GROUP_GRID_GROUP=zo,t.KEY_GROUP_MERGED_CELLS=xo,t.KEY_GROUP_PANEL_FROZEN_BOTTOM=Lo,t.KEY_GROUP_PANEL_FROZEN_COL=Eo,t.KEY_GROUP_PANEL_FROZEN_ROW=So,t.KEY_GROUP_PANEL_FROZEN_TOP=To,t.KEY_GROUP_PANEL_FROZEN_TRAILING_COL=bo,t.KEY_GROUP_PANEL_FROZEN_TRAILING_ROW=_o,t.KEY_GROUP_PANEL_GROUND=Co,t.KEY_GROUP_PANEL_SCROLL=wo,t.KEY_GROUP_ROW_INDEX_RESIZE_AREA=Ao,t.KEY_GROUP_ROW_RESIZE_AREA=Io,t.KEY_SERIES_NUMBER_NODE=Fo,t.LAYOUT_SAMPLE_COUNT=50,t.MIN_CELL_HEIGHT=16,t.MIN_CELL_WIDTH=28,t.MIN_DEVICE_PIXEL_RATIO=1,t.MIN_SCROLL_BAR_HEIGHT=32,t.MergedCell=RS,t.MergedCellClick=oL,t.MergedCellConvertTempMergedCells=GS,t.Node=_w,t.PADDING_DOWN=2,t.PADDING_LEFT=3,t.PADDING_RIGHT=1,t.PADDING_TOP=0,t.PALETTE_MAP=nw,t.PANEL_GROUP_FROZEN_GROUP_Z_INDEX=2,t.PANEL_GROUP_GROUP_CONTAINER_Z_INDEX=1,t.PANEL_GROUP_HOVER_BOX_GROUP_Z_INDEX=1,t.PANEL_GROUP_SCROLL_GROUP_Z_INDEX=1,t.PRECISION=16,t.PivotDataSet=ST,t.PivotSheet=_L,t.RESIZE_END_GUIDE_LINE_ID=PC,t.RESIZE_MASK_ID=kC,t.RESIZE_START_GUIDE_LINE_ID=DC,t.ROOT_BEGINNING_REGEX=Yo,t.ROOT_ID=Wo,t.RangeSelection=hL,t.RootInteraction=wL,t.RowBrushSelection=yL,t.RowCell=DE,t.RowColumnClick=aL,t.RowColumnResize=CL,t.RowHeader=UT,t.RowTextClick=sL,t.S2_PREFIX_CLS=Ko,t.SERIES_NUMBER_FIELD=go,t.SHAPE_ATTRS_MAP=LC,t.SHAPE_STYLE_MAP=TC,t.SQUARE_LINE_CAP=Xo,t.SelectedCellMove=fL,t.SeriesNumberHeader=YT,t.SpreadSheet=EL,t.Store=Zw,t.TABLE_COL_HORIZONTAL_RESIZE_AREA_KEY="table-col-horizontal-resize-area",t.TOOLTIP_CONTAINER_CLS=cw,t.TOOLTIP_CONTAINER_HIDE_CLS=dw,t.TOOLTIP_CONTAINER_SHOW_CLS=hw,t.TOOLTIP_OPERATION_PREFIX_CLS=fw,t.TOOLTIP_POSITION_OFFSET=pw,t.TOOLTIP_PREFIX_CLS=uw,t.TOTAL_VALUE=vo,t.TableColCell=jE,t.TableCornerCell=VE,t.TableDataCell=XE,t.TableDataSet=ET,t.TableSeriesCell=KE,t.TableSheet=TL,t.VALUE_FIELD=ho,t.VALUE_RANGES_KEY=qo,t.adjustColHeaderScrollingTextPosition=Dx,t.adjustColHeaderScrollingViewport=Nx,t.auto=function(t,e,n){if(void 0===e&&(e=2),void 0===n&&(n=ix[sw()]||ix.zh_CN),"number"!=typeof t||cv(t))return"";for(var r,i=t,o=VC(n,2),a=o[0],s=o[1],l=0,u=!0;u;)i>=(r=s[l])&&l<a.length?i/=r:u=!1,l+=1;var c=(i=parseFloat(i.toFixed(e)))>=1e3?i.toLocaleString("en"):"".concat(i);return 0===l?c:"".concat(c," ").concat(a[l-1])},t.buildTableHierarchy=Dw,t.clearState=r_,t.convertString=Qx,t.copyData=function(e,n,r){var i,o,a,s,l,u=function(t){var e,n;return"object"==typeof t?{isFormatHeader:null!==(e=t.isFormatHeader)&&void 0!==e&&e,isFormatData:null!==(n=t.isFormatData)&&void 0!==n&&n}:{isFormatHeader:null!=t&&t,isFormatData:null!=t&&t}}(r),c=u.isFormatHeader,h=u.isFormatData,d=null===(l=null==e?void 0:e.facet)||void 0===l?void 0:l.layoutResult,f=d.rowsHierarchy,p=d.rowLeafNodes,v=d.colLeafNodes,g=d.getCellMeta,y=f.maxLevel,m=e.dataCfg.fields.valueInCols,C=f.sampleNodesForAllLevels.map((function(t){return e.dataSet.getFieldName(t.key)})),w=p.reduce((function(t,e){var n,r=(null!==(n=e.level)&&void 0!==n?n:0)+1;return r>t?r:t}),0),x=[],S=0;if(e.isPivotMode()){var E=p.filter((function(t){return 0!==t.height}));try{for(var _=jC(E),b=_.next();!b.done;b=_.next()){var T=b.value,L=[];if(c)L=SS(T);else T.label=pm(null==T?void 0:T.label),L=T.id.replace(Yo,"").split(Go);var I=y+1-L.length;I>0&&L.push.apply(L,XC([],VC(new Array(I)),!1));var O=e.dataSet.getFieldName(mf(L));L[L.length-1]=O;try{for(var R=(a=void 0,jC(v)),A=R.next();!A.done;A=R.next()){var M=A.value;if(m){var B=g(T.rowIndex,M.colIndex);L.push(yS(B,e,h))}else{B=g(T.rowIndex,M.colIndex);var N=wS(B,M,e),D=mS(B,e,N,h);pa(D)?L=L.concat.apply(L,XC([],VC(D),!1)):L.push(D)}}}catch(t){a={error:t}}finally{try{A&&!A.done&&(s=R.return)&&s.call(R)}finally{if(a)throw a.error}}S=Bv([L.length,S]);var P=L.map((function(t){return fS(t)})).join(n);x.push(P)}}catch(t){i={error:t}}finally{try{b&&!b.done&&(o=_.return)&&o.call(_)}finally{if(i)throw i.error}}}else x=function(t,e,n){var r,i,o,a=t.dataSet.getDisplayDataSet(),s=(null===(o=t.dataCfg)||void 0===o?void 0:o.fields).columns,l=[],u=function(r,i){var o=[];o=n?s.map((function(e){return fS(t.dataSet.getFieldFormatter(e)(i[e],i))})):s.map((function(t){return fS(i[t])})),t.options.showSeriesNumber&&(o=[fS(r+1)].concat(o)),l.push(o.join(e))};try{for(var c=jC(a.entries()),h=c.next();!h.done;h=c.next()){var d=VC(h.value,2);u(d[0],d[1])}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return l}(e,n,h);var k=[];if(ov(v)&&!e.isPivotMode())k=[C];else{var z=0,F=Jh(v).map((function(t){for(var n=t,r=[];void 0!==n.level;){var i=CS(n.label);pa(i)?z=Bv([z,Ty(i)]):i=c&&e.isPivotMode()?xS(n):i,r.push(i),n=n.parent}return r}));z>1&&(F=function(t){return t.map((function(t){return t.map((function(e){return pa(e)?e:XC([e],VC(new Array(t[0].length-1)),!1)}))}))}(F));for(var H=Bv(F.map((function(t){return t.length}))),W=[],G=function(t){var n=F.map((function(t){return t.length<H?XC(XC([],VC(new Array(H-t.length)),!1),VC(t),!1):t})).map((function(e){return e[t]})).map((function(t){return e.dataSet.getFieldName(t)}));W.push(Iu(n))},U=H-1;U>=0;U-=1)G(U);k=W.map((function(n,r){var i,o;if(e.isPivotMode()){var a=e.facet.cornerHeader.cfg,s=a.columns,l=a.rows,u=a.data.filter((function(e){return e.cornerType===t.CornerNodeType.Col}));if(r<W.length-1)return XC(XC(XC([],VC(Array(y).fill("")),!1),[(null===(o=u.find((function(t){return t.field===s[r]})))||void 0===o?void 0:o.label)||""],!1),VC(n),!1);var c=l.slice(0,w);return c.length<w&&c.unshift.apply(c,XC([],VC(Array(w-c.length).fill("")),!1)),XC(XC([],VC(c.map((function(t){return e.dataSet.getFieldName(t)||""}))),!1),VC(n),!1)}return r<W.length?(i=Array(w).fill("")).concat.apply(i,XC([],VC(n),!1)):C.concat.apply(C,XC([],VC(n),!1))}))}var Y=k.map((function(t){var e=S-t.length;return e>0&&t.unshift.apply(t,XC([],VC(new Array(e)),!1)),t.map((function(t){return fS(t)})).join(n)})).join("\r\n");return[Y].concat(x).join("\r\n")},t.copyToClipboard=gS,t.copyToClipboardByClipboard=vS,t.copyToClipboardByExecCommand=pS,t.customMerge=s_,t.differenceTempMergedCells=US,t.download=function(t,e){try{var n=document.createElement("a");n.download="".concat(e,".csv");var r=new Blob(["\ufeff".concat(t)],{type:"text/csv;charset=utf-8"});n.href=URL.createObjectURL(r),n.click(),URL.revokeObjectURL(n.href)}catch(t){console.error(t)}},t.drawBar=wx,t.drawBullet=_x,t.drawInterval=Ex,t.drawLine=Cx,t.drawObjectText=Ux,t.extendLocale=function(t){aw=zv({},aw,t)},t.generateId=Bw,t.generatePalette=tw,t.generateStandardColors=JC,t.getActiveCellsInfo=zS,t.getActiveCellsTooltipData=gT,t.getActiveHoverRowColCells=ES,t.getAutoAdjustPosition=Qb,t.getBaseCellData=function(t){var e,n,r,i,o,a,s=null===(r=null===(n=null===(e=t.target)||void 0===e?void 0:e.attrs)||void 0===n?void 0:n.appendInfo)||void 0===r?void 0:r.cellData,l=null===(o=(i=t.target).get)||void 0===o?void 0:o.call(i,"parent");return{target:l,viewMeta:(null===(a=null==l?void 0:l.getMeta)||void 0===a?void 0:a.call(l))||s,event:t}},t.getBorderPositionAndStyle=Bx,t.getBulletRangeColor=xx,t.getCellMeta=ZE,t.getCellWidth=Yx,t.getClassNameWithPrefix=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"".concat(Ko,"-").concat(t.join("-"))},t.getContentArea=Tx,t.getContentAreaForMultiData=Gx,t.getCopyData=function(e,n,r){void 0===r&&(r=t.CopyMIMEType.PLAIN),e.dataSet.getDisplayDataSet();var i=e.interaction.getState().cells||[];if(n===t.CopyType.ALL)return tS(lS(0,e,[]),r);if(n===t.CopyType.COL){var o=i.reduce((function(t,e){return t.find((function(t){return t===e.colIndex}))||t.push(e.colIndex),t}),[]),a=e.facet.layoutResult.colLeafNodes.filter((function(t){return o.includes(t.colIndex)})).map((function(e){return{id:e.id,colIndex:e.colIndex,rowIndex:e.rowIndex,type:t.CellTypes.COL_CELL}}));return tS(lS(0,e,a),r)}if(n===t.CopyType.ROW){var s=i.reduce((function(t,e){return t.find((function(t){return t===e.rowIndex}))||t.push(e.rowIndex),t}),[]).map((function(n){return{id:n+"-"+e.facet.layoutResult.colLeafNodes[0].id,colIndex:0,rowIndex:n,type:t.CellTypes.ROW_CELL}}));return tS(uS(0,e,s),r)}},t.getDataCellId=IS,t.getDescription=fT,t.getDetailList=sT,t.getEllipsisText=zx,t.getEllipsisTextInner=kx,t.getEmptyPlaceholder=Wx,t.getFieldFormatter=rT,t.getFieldList=oT,t.getFriendlyVal=nT,t.getHeadInfo=aT,t.getIcon=Uw,t.getInvisibleInfo=DS,t.getLang=sw,t.getListItem=iT,t.getLocale=function(){return aw},t.getMaxTextWidth=Ix,t.getMergedQuery=tT,t.getNextEdge=BS,t.getPalette=Sw,t.getPolygonPoints=NS,t.getRangeIndex=QE,t.getRectangleEdges=AS,t.getRowCellForSelectedCell=JE,t.getSafetyDataConfig=u_,t.getSafetyOptions=c_,t.getScrollOffsetForCol=o_,t.getScrollOffsetForRow=a_,t.getSelectedCellIndexes=cT,t.getSelectedCellsData=hT,t.getSelectedCellsMeta=oS,t.getSelectedData=dS,t.getSortByMeasureValues=yE,t.getSortTypeIcon=CE,t.getSummaries=dT,t.getSummaryName=lT,t.getTempMergedCell=kS,t.getTextAndFollowingIconPosition=Rx,t.getTextAreaRange=Mx,t.getTextPosition=Ax,t.getTheme=Ew,t.getTooltipData=pT,t.getTooltipDefaultOptions=Jb,t.getTooltipOperatorHiddenColumnsMenu=vw,t.getTooltipOperatorSortMenus=yw,t.getTooltipOperatorTableSortMenus=mw,t.getTooltipOperatorTrendMenu=gw,t.getTooltipOptions=mT,t.getTooltipOptionsByCellType=yT,t.getTooltipVisibleOperator=CT,t.getValidFrozenOptions=ax,t.getVerticalPosition=Ox,t.getVisibleInfo=PS,t.handleDataItem=TS,t.handleSortAction=mE,t.i18n=lw,t.includeCell=LS,t.isAscSort=sE,t.isDescSort=lE,t.isIPhoneX=ww,t.isMobile=Cw,t.isMultiSelectionKey=qE,t.isUpDataValue=function(t){return uv(t)?t>=0:!!t&&!pm(t).startsWith("-")},t.isWindows=xw,t.keyEqualTo=Vx,t.measureTextWidth=Px,t.measureTextWidthRoughly=function(t,e){var n,r;void 0===e&&(e={});var i=Px("a",e),o=Px("蚂",e),a=0;if(!t)return a;try{for(var s=jC(t),l=s.next();!l.done;l=s.next()){var u=l.value.charCodeAt(0);a+=u>=0&&u<=255?i:o}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a},t.mergeCell=FS,t.mergeCellInfo=vT,t.mergeTempMergedCell=function(t,e){var n={};return XC(XC([],VC(t),!1),VC(e),!1).forEach((function(t){n[t.viewMeta.id]=t})),Object.values(n)},t.processCopyData=iS,t.processSort=vE,t.registerIcon=Gw,t.removeUnmergedCellsInfo=HS,t.renderCircle=cx,t.renderIcon=px,t.renderLine=dx,t.renderMiniChart=bx,t.renderPolygon=lx,t.renderPolyline=ux,t.renderRect=sx,t.renderText=hx,t.renderTreeIcon=vx,t.safeJsonParse=jx,t.scale=mx,t.selectCells=$E,t.setLang=function(t){ow=t||iw},t.setState=i_,t.setTooltipContainerStyle=eT,t.sortAction=cE,t.sortByCustom=dE,t.sortByFunc=fE,t.sortByMethod=pE,t.splitTotal=rx,t.transformRatioToPercent=Sx,t.unique=MS,t.unmergeCell=WS,t.updateAllColHeaderCellState=_S,t.updateFillOpacity=function(t,e){fx(t,"fillOpacity",e)},t.updateMergedCells=YS,t.updateRowColCells=t_,t.updateShapeAttr=fx,t.updateStrokeOpacity=function(t,e){fx(t,"strokeOpacity",e)},t.verifyTheElementInTooltip=wT,Object.defineProperty(t,"__esModule",{value:!0})}));
| //# sourceMappingURL=index.min.js.map
|
|