UNPKG

@visactor/react-vtable

Version:
1 lines 412 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vtable"),require("react")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ReactVTable={},t.VTable,t.React)}(this,(function(t,e,n){"use strict";const i=n.createContext(null);function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}i.displayName="TableContext";var s={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,i,s,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,s||t,a),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,a=new Array(s);r<s;r++)a[r]=i[r].fn;return a},o.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},o.prototype.emit=function(t,e,i,r,s,a){var o=n?n+t:t;if(!this._events[o])return!1;var l,c,u=this._events[o],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,r),!0;case 5:return u.fn.call(u.context,e,i,r,s),!0;case 6:return u.fn.call(u.context,e,i,r,s,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(t,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,e);break;case 3:u[c].fn.call(u[c].context,e,i);break;case 4:u[c].fn.call(u[c].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},o.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},o.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},o.prototype.removeListener=function(t,e,i,r){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||i&&o.context!==i||a(this,s);else{for(var l=0,c=[],u=o.length;l<u;l++)(o[l].fn!==e||r&&!o[l].once||i&&o[l].context!==i)&&c.push(o[l]);c.length?this._events[s]=1===c.length?c[0]:c:a(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o}(s);var a=r(s.exports);var o=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var l=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||o(t,"Boolean");var c=t=>"function"==typeof t;var u=t=>null==t;var h=t=>null!=t;var d=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var f=t=>"object"==typeof t&&null!==t;var p=function(t){if(!f(t)||!o(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var g=(t,e=!1)=>{const n=typeof t;return e?"string"===n:"string"===n||o(t,"String")};var m=t=>Array.isArray?Array.isArray(t):o(t,"Array");var b=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var y=(t,e=!1)=>{const n=typeof t;return e?"number"===n:"number"===n||o(t,"Number")};var v=t=>y(t)&&Number.isFinite(t);var x=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var _=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);var S=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const A=Object.prototype;var w=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||A)};const T=Object.prototype.hasOwnProperty;function C(t){if(u(t))return!0;if(b(t))return!t.length;const e=S(t);if("Map"===e||"Set"===e)return!t.size;if(w(t))return!Object.keys(t).length;for(const e in t)if(T.call(t,e))return!1;return!0}function B(t,e,n=!1,i=!1){if(e){if(t===e)return;if(h(e)&&"object"==typeof e){const r=Object(e),s=[];for(const t in r)s.push(t);let{length:a}=s,o=-1;for(;a--;){const a=s[++o];!h(r[a])||"object"!=typeof r[a]||i&&m(t[a])?M(t,a,r[a]):k(t,e,a,n,i)}}}}function k(t,e,n,i=!1,r=!1){const s=t[n],a=e[n];let o=e[n],l=!0;if(m(a)){if(i)o=[];else if(m(s))o=s;else if(b(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else p(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&B(o,a,i,r),M(t,n,o)}function M(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function P(t,...e){let n=-1;const i=e.length;for(;++n<i;)B(t,e[n],!0);return t}function E(t,e){if(!t||!p(t))return t;const n={};return Object.keys(t).forEach((i=>{const r=t[i];let s=!1;e.forEach((t=>{(g(t)&&t===i||t instanceof RegExp&&i.match(t))&&(s=!0)})),s||(n[i]=r)})),n}function O(t){return Object.prototype.toString.call(t)}function L(t){return Object.keys(t)}function R(t,e,n){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(O(t)!==O(e))return!1;if(c(t))return!!(null==n?void 0:n.skipFunction);if("object"!=typeof t)return!1;if(m(t)){if(t.length!==e.length)return!1;for(let i=t.length-1;i>=0;i--)if(!R(t[i],e[i],n))return!1;return!0}if(!p(t))return!1;const i=L(t),r=L(e);if(i.length!==r.length)return!1;i.sort(),r.sort();for(let t=i.length-1;t>=0;t--)if(i[t]!=r[t])return!1;for(let r=i.length-1;r>=0;r--){const s=i[r];if(!R(t[s],e[s],n))return!1}return!0}function I(t,e){if(!m(t)||!m(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const N="undefined"!=typeof console;function U(t,e,n){const i=[e].concat([].slice.call(n));N&&console[t].apply(console,i)}var D;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(D||(D={}));class z{static getInstance(t,e){return z._instance&&y(t)?z._instance.level(t):z._instance||(z._instance=new z(t,e)),z._instance}static setInstance(t){return z._instance=t}static setInstanceLevel(t){z._instance?z._instance.level(t):z._instance=new z(t)}static clearInstance(){z._instance=null}constructor(t=D.None,e){this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach((e=>e(...t)))}canLogInfo(){return this._level>=D.Info}canLogDebug(){return this._level>=D.Debug}canLogError(){return this._level>=D.Error}canLogWarn(){return this._level>=D.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=D.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):U(null!==(e=this._method)&&void 0!==e?e:"error","ERROR",t)),this}warn(...t){return this._level>=D.Warn&&U(this._method||"warn","WARN",t),this}info(...t){return this._level>=D.Info&&U(this._method||"log","INFO",t),this}debug(...t){return this._level>=D.Debug&&U(this._method||"log","DEBUG",t),this}}z._instance=null;const W=1e-12,F=Math.PI,j=F/2,H=2*F,G=2*Math.PI,V=Math.abs,$=Math.atan2,X=Math.cos,Y=Math.max,K=Math.min,q=Math.sin,Q=Math.sqrt,Z=Math.pow;function J(t){return t>=1?j:t<=-1?-j:Math.asin(t)}class tt{constructor(t=0,e=0,n,i){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=n,this.y1=i}clone(){return new tt(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return y(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return y(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class et{static distancePP(t,e){return Q(Z(t.x-e.x,2)+Z(t.y-e.y,2))}static distanceNN(t,e,n,i){return Q(Z(t-n,2)+Z(e-i,2))}static distancePN(t,e,n){return Q(Z(e-t.x,2)+Z(n-t.y,2))}static pointAtPP(t,e,n){return new tt((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function nt(t){return t*(Math.PI/180)}const it=(t=0)=>{if(t<0)for(;t<-H;)t+=H;else if(t>0)for(;t>H;)t-=H;return t};var rt;function st(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function at({x:t,y:e},n,i={x:0,y:0}){return{x:(t-i.x)*Math.cos(n)-(e-i.y)*Math.sin(n)+i.x,y:(t-i.x)*Math.sin(n)+(e-i.y)*Math.cos(n)+i.y}}function ot(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function lt(t,e){const n=e?nt(t.angle):t.angle,i=ot(t);return[at({x:t.x1,y:t.y1},n,i),at({x:t.x2,y:t.y1},n,i),at({x:t.x2,y:t.y2},n,i),at({x:t.x1,y:t.y2},n,i)]}function ct(t,e,n,i,r,s){if(s>e&&s>i||s<e&&s<i)return 0;if(i===e)return 0;const a=(s-e)/(i-e);let o=i<e?1:-1;1!==a&&0!==a||(o=i<e?.5:-.5);const l=a*(n-t)+t;return l===r?1/0:l>r?o:0}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(rt||(rt={}));const ut=(t,e)=>{const{x1:n,x2:i,y1:r,y2:s}=t,a=Math.abs(i-n),o=Math.abs(s-r);let l=(n+i)/2,c=(r+s)/2,u=0,h=0;switch(e){case"top":case"inside-top":h=-.5;break;case"bottom":case"inside-bottom":h=.5;break;case"left":case"inside-left":u=-.5;break;case"right":case"inside-right":u=.5;break;case"top-right":u=.5,h=-.5;break;case"top-left":u=-.5,h=-.5;break;case"bottom-right":u=.5,h=.5;break;case"bottom-left":u=-.5,h=.5}return l+=u*a,c+=h*o,{x:l,y:c}};function ht(t,e,n){const{x1:i,y1:r,x2:s,y2:a}=e;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*s+n.c*r+n.e,n.b*s+n.d*r+n.f),t.add(n.a*s+n.c*a+n.e,n.b*s+n.d*a+n.f),t.add(n.a*i+n.c*a+n.e,n.b*i+n.d*a+n.f),e)}class dt{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new dt(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(t=0,e=0,n=0,i=0){return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}set(t=0,e=0,n=0,i=0){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}add(t=0,e=0){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(t=0){return m(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,n=0){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}scale(t=0,e=0,n=0,i=0){const r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(t=0,e=0){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return ht(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,n){const{x1:i,y1:r,x2:s,y2:a}=this,o=Math.cos(t),l=Math.sin(t),c=e-e*o+n*l,u=n-e*l-n*o;return[o*i-l*r+c,l*i+o*r+u,o*i-l*a+c,l*i+o*a+u,o*s-l*r+c,l*s+o*r+u,o*s-l*a+c,l*s+o*a+u]}scalePoints(t,e,n,i){const{x1:r,y1:s,x2:a,y2:o}=this;return[t*r+(1-t)*n,e*s+(1-e)*i,t*a+(1-t)*n,e*o+(1-e)*i]}}class ft extends dt{}class pt extends dt{constructor(t,e=0){var n;super(t),t&&(this.angle=null!==(n=t.angle)&&void 0!==n?n:e)}intersects(t){return function(t,e,n=!1){const i=lt(t,n),r=lt(e,n),s=(t,e)=>[e.x-t.x,e.y-t.y],a=s(ot(t),ot(e)),o=s(i[0],i[1]),l=s(i[1],i[2]),c=s(r[0],r[1]),u=s(r[1],r[2]),h=n?nt(t.angle):t.angle;let d=n?nt(90-t.angle):t.angle+j;const f=n?nt(e.angle):e.angle;let p=n?nt(90-e.angle):e.angle+j;d>G&&(d-=G),p>G&&(p-=G);const g=(t,e,n,i)=>{const r=[Math.cos(e),Math.sin(e)];return t+(st(r,n)+st(r,i))/2>st(r,a)};return g((t.x2-t.x1)/2,h,c,u)&&g((t.y2-t.y1)/2,d,c,u)&&g((e.x2-e.x1)/2,f,o,l)&&g((e.y2-e.y1)/2,p,o,l)}(this,t)}setValue(t=0,e=0,n=0,i=0,r=0){return super.setValue(t,e,n,i),this.angle=r,this}clone(){return new pt(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[at({x:this.x1,y:this.y1},this.angle,t),at({x:this.x2,y:this.y1},this.angle,t),at({x:this.x1,y:this.y2},this.angle,t),at({x:this.x2,y:this.y2},this.angle,t)]}}class gt{constructor(t=1,e=0,n=0,i=1,r=0,s=0){this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,n,i,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}setValue(t,e,n,i,r,s){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,a=new gt,o=t*i-e*n;return a.a=i/o,a.b=-e/o,a.c=-n/o,a.d=t/o,a.e=(n*s-i*r)/o,a.f=-(t*s-e*r)/o,a}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,s=this.a*-n+this.c*e,a=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=s,this.d=a,this}rotateByCenter(t,e,n){const i=Math.cos(t),r=Math.sin(t),s=(1-i)*e+r*n,a=(1-i)*n-r*e,o=i*this.a-r*this.b,l=r*this.a+i*this.b,c=i*this.c-r*this.d,u=r*this.c+i*this.d,h=i*this.e-r*this.f+s,d=r*this.e+i*this.f+a;return this.a=o,this.b=l,this.c=c,this.d=u,this.e=h,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,n,i,r,s){return this.multiply(t,e,n,i,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:n,d:i,e:r,f:s}=this;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=s,this.f=r,this}multiply(t,e,n,i,r,s){const a=this.a,o=this.b,l=this.c,c=this.d,u=a*t+l*e,h=o*t+c*e,d=a*n+l*i,f=o*n+c*i,p=a*r+l*s+this.e,g=o*r+c*s+this.f;return this.a=u,this.b=h,this.c=d,this.d=f,this.e=p,this.f=g,this}interpolate(t,e){const n=new gt;return n.a=this.a+(t.a-this.a)*e,n.b=this.b+(t.b-this.b)*e,n.c=this.c+(t.c-this.c)*e,n.d=this.d+(t.d-this.d)*e,n.e=this.e+(t.e-this.e)*e,n.f=this.f+(t.f-this.f)*e,n}transformPoint(t,e){const{a:n,b:i,c:r,d:s,e:a,f:o}=this,l=n*s-i*r,c=s/l,u=-i/l,h=-r/l,d=n/l,f=(r*o-s*a)/l,p=-(n*o-i*a)/l,{x:g,y:m}=t;e.x=g*c+m*h+f,e.y=g*u+m*d+p}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new gt(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),s.scaleX=a,s.scaleY=r/a,s.skewX=(t*n+e*i)/r,s.skewY=0}else if(0!==n||0!==i){const a=Math.sqrt(n*n+i*i);s.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/a):-Math.acos(n/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*n+e*i)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}const mt=(t="")=>{const e={};return t.split(";").forEach((t=>{if(t){const n=t.split(":");if(2===n.length){const t=n[0].trim(),i=n[1].trim();t&&i&&(e[t]=i)}}})),e},bt=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase();var yt,vt={exports:{}},xt={};vt.exports=function(){if(yt)return xt;yt=1;var t,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen");function g(t){if("object"==typeof t&&null!==t){var p=t.$$typeof;switch(p){case e:switch(t=t.type){case i:case s:case r:case u:case h:return t;default:switch(t=t&&t.$$typeof){case l:case o:case c:case f:case d:case a:return t;default:return p}}case n:return p}}}return t=Symbol.for("react.module.reference"),xt.ContextConsumer=o,xt.ContextProvider=a,xt.Element=e,xt.ForwardRef=c,xt.Fragment=i,xt.Lazy=f,xt.Memo=d,xt.Portal=n,xt.Profiler=s,xt.StrictMode=r,xt.Suspense=u,xt.SuspenseList=h,xt.isAsyncMode=function(){return!1},xt.isConcurrentMode=function(){return!1},xt.isContextConsumer=function(t){return g(t)===o},xt.isContextProvider=function(t){return g(t)===a},xt.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},xt.isForwardRef=function(t){return g(t)===c},xt.isFragment=function(t){return g(t)===i},xt.isLazy=function(t){return g(t)===f},xt.isMemo=function(t){return g(t)===d},xt.isPortal=function(t){return g(t)===n},xt.isProfiler=function(t){return g(t)===s},xt.isStrictMode=function(t){return g(t)===r},xt.isSuspense=function(t){return g(t)===u},xt.isSuspenseList=function(t){return g(t)===h},xt.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===r||e===u||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===a||e.$$typeof===o||e.$$typeof===c||e.$$typeof===t||void 0!==e.getModuleId)},xt.typeOf=g,xt}();var _t=vt.exports;const St=t=>{let e=[];return n.Children.forEach(t,(t=>{u(t)||(_t.isFragment(t)?e=e.concat(St(t.props.children)):e.push(t))})),e},At={...e.TABLE_EVENT_TYPE,...e.PIVOT_TABLE_EVENT_TYPE,...e.PIVOT_CHART_EVENT_TYPE},wt={onClickCell:At.CLICK_CELL,onDblClickCell:At.DBLCLICK_CELL,onMouseDownCell:At.MOUSEDOWN_CELL,onMouseUpCell:At.MOUSEUP_CELL,onSelectedCell:At.SELECTED_CELL,onSelectedClear:At.SELECTED_CLEAR,onKeyDown:At.KEYDOWN,onMouseEnterTable:At.MOUSEENTER_TABLE,onMouseLeaveTable:At.MOUSELEAVE_TABLE,onMouseDownTable:At.MOUSEDOWN_TABLE,onMouseMoveCell:At.MOUSEMOVE_CELL,onMouseMoveTable:At.MOUSEMOVE_TABLE,onMouseEnterCell:At.MOUSEENTER_CELL,onMouseLeaveCell:At.MOUSELEAVE_CELL,onContextMenuCell:At.CONTEXTMENU_CELL,onContextMenuCanvas:At.CONTEXTMENU_CANVAS,onResizeColumn:At.RESIZE_COLUMN,onResizeColumnEnd:At.RESIZE_COLUMN_END,onResizeRow:At.RESIZE_ROW,onResizeRowEnd:At.RESIZE_ROW_END,onChangeHeaderPositionStart:At.CHANGE_HEADER_POSITION_START,onChangeHeaderPosition:At.CHANGE_HEADER_POSITION,onChangeHeaderPositionFail:At.CHANGE_HEADER_POSITION_FAIL,onSortClick:At.SORT_CLICK,onAfterSort:At.AFTER_SORT,onFreezeClick:At.FREEZE_CLICK,onScroll:At.SCROLL,onScrollHorizontalEnd:At.SCROLL_HORIZONTAL_END,onScrollVerticalEnd:At.SCROLL_VERTICAL_END,onDropdownMenuClick:At.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:At.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:At.DRAG_SELECT_END,onCopyData:At.COPY_DATA,onDropdownIconClick:At.DROPDOWN_ICON_CLICK,onDropdownMenuClear:At.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:At.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:At.SHOW_MENU,onHideMenu:At.HIDE_MENU,onIconClick:At.ICON_CLICK,onLegendItemClick:At.LEGEND_ITEM_CLICK,onLegendItemHover:At.LEGEND_ITEM_HOVER,onLegendItemUnHover:At.LEGEND_ITEM_UNHOVER,onLegendChange:At.LEGEND_CHANGE,onMouseEnterAxis:At.MOUSEENTER_AXIS,onMouseLeaveAxis:At.MOUSELEAVE_AXIS,onCheckboxStateChange:At.CHECKBOX_STATE_CHANGE,onRadioStateChange:At.RADIO_STATE_CHANGE,onSwitchStateChange:At.SWITCH_STATE_CHANGE,onAfterRender:At.AFTER_RENDER,onInitialized:At.INITIALIZED,onChangeCellValue:At.CHANGE_CELL_VALUE,onDragFillHandleEnd:At.DRAG_FILL_HANDLE_END,onMousedownFillHandle:At.MOUSEDOWN_FILL_HANDLE,onDblclickFillHandle:At.DBLCLICK_FILL_HANDLE,onPivotSortClick:At.PIVOT_SORT_CLICK,onDrillMenuClick:At.DRILLMENU_CLICK,onVChartEventType:At.VCHART_EVENT_TYPE,onChangCellValue:At.CHANGE_CELL_VALUE,onEmptyTipClick:At.EMPTY_TIP_CLICK,onEmptyTipDblClick:At.EMPTY_TIP_DBLCLICK,onButtonClick:At.BUTTON_CLICK,onBeforeCacheChartImage:At.BEFORE_CACHE_CHART_IMAGE,onPastedData:At.PASTED_DATA},Tt=Object.keys(wt),Ct=(t,e=wt)=>{const n={};return Object.keys(t).forEach((i=>{e[i]&&t[i]&&(n[i]=t[i])})),n},Bt=(t,e,n,i=wt)=>{if(!e&&!n||!t)return!1;const r=n?Ct(n,i):null,s=e?Ct(e,i):null;return r&&Object.keys(r).forEach((e=>{s&&s[e]&&s[e]===r[e]||t.off(i[e],n[e])})),s&&Object.keys(s).forEach((e=>{r&&r[e]&&r[e]===s[e]||t.on(i[e],s[e])})),!0};class kt{static GenAutoIncrementId(){return kt.auto_increment_id++}}kt.auto_increment_id=0;class Mt{constructor(t){this.id=kt.GenAutoIncrementId(),this.registry=t}}const Pt="named",Et="inject",Ot="inversify:tagged",Lt="inversify:paramtypes";class Rt{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===Pt?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var It=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",n=Object.getPrototypeOf(Function),i=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=new WeakMap;function s(t,e,n){let s=r.get(t);if(c(s)){if(!n)return;s=new i,r.set(t,s)}let a=s.get(e);if(c(a)){if(!n)return;a=new i,s.set(e,a)}return a}function a(t,e,n){if(o(t,e,n))return!0;const i=g(e);return!u(i)&&a(t,i,n)}function o(t,e,n){const i=s(e,n,!1);return!c(i)&&!!i.has(t)}function l(t,e,n){if(o(t,e,n))return function(t,e,n){const i=s(e,n,!1);if(!c(i))return i.get(t)}(t,e,n);const i=g(e);return u(i)?void 0:l(t,i,n)}function c(t){return void 0===t}function u(t){return null===t}function h(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,n){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const i=3===n?"string":5===n?"number":"default",r=function(t,e){const n=t[e];if(null!=n){if(!p(n))throw new TypeError;return n}}(t,e);if(void 0!==r){const e=r.call(t,i);if(h(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(p(e)){const n=e.call(t);if(!h(n))return n}const n=t.valueOf;if(p(n)){const e=n.call(t);if(!h(e))return e}}else{const e=t.valueOf;if(p(e)){const n=e.call(t);if(!h(n))return n}const n=t.toString;if(p(n)){const e=n.call(t);if(!h(e))return e}}throw new TypeError}(t,"default"===i?"number":i)}function f(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function p(t){return"function"==typeof t}function g(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===n)return e;if(e!==n)return e;const i=t.prototype,r=i&&Object.getPrototypeOf(i);if(null==r||r===Object.prototype)return e;const s=r.constructor;return"function"!=typeof s||s===t?e:s}t("defineMetadata",(function(t,e,n,i){if(!h(n))throw new TypeError;return r=t,a=e,void s(n,i,!0).set(r,a);var r,a})),t("hasMetadata",(function(t,e,n){if(!h(e))throw new TypeError;return c(n)||(n=f(n)),a(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!h(e))throw new TypeError;return c(n)||(n=f(n)),o(t,e,n)})),t("getMetadata",(function(t,e,n){if(!h(e))throw new TypeError;return c(n)||(n=f(n)),l(t,e,n)}))}((e=t,function(t,n){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n})})),t}({});function Nt(t,e,n,i){!function(t,e,n,i){const r=[i];let s={};It.hasOwnMetadata(t,e)&&(s=It.getMetadata(t,e));let a=s[n];void 0===a&&(a=[]),a.push(...r),s[n]=a,It.defineMetadata(t,s,e)}(Ot,t,n.toString(),i)}function Ut(t){return(e,n,i)=>{Nt(e,0,i,t)}}const Dt=(zt=Et,t=>(e,n,i)=>Ut(new Rt(zt,t))(e,n,i));var zt;function Wt(){return function(t){return It.defineMetadata(Lt,null,t),t}}function Ft(t){return Ut(new Rt(Pt,t))}const jt="Singleton",Ht="Transient",Gt="ConstantValue",Vt="DynamicValue",$t="Factory",Xt="Function",Yt="Instance",Kt="Invalid";class qt{constructor(t,e){this.id=kt.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=Kt,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new qt(this.serviceIdentifier,this.scope);return t.activated=t.scope===jt&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class Qt{getConstructorMetadata(t){return{compilerGeneratedMetadata:It.getMetadata(Lt,t),userGeneratedMetadata:It.getMetadata(Ot,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const Zt=(Jt=Pt,t=>{const e=e=>{if(null==e)return!1;if(e.key===Jt&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const n=e.constructorArgsMetadata;for(let e=0;e<n.length;e++)if(n[e].key===Jt&&n[e].value===t)return!0;return!1};return e.metaData=new Rt(Jt,t),e});var Jt;class te{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=jt,this}inTransientScope(){return this._binding.scope=Ht,this}whenTargetNamed(t){return this._binding.constraint=Zt(t),this}}class ee{constructor(t){this._binding=t}to(t){return this._binding.type=Yt,this._binding.implementationType=t,new te(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=Vt,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new te(this._binding)}toConstantValue(t){return this._binding.type=Gt,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=jt,new te(this._binding)}toFactory(t){return this._binding.type=$t,this._binding.factory=t,this._binding.scope=jt,new te(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const ne=Symbol("ContributionProvider");class ie{constructor(t,e){this.serviceIdentifier=t,this.container=e,se.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function re(t,e){t(ne).toDynamicValue((({container:t})=>new ie(e,t))).inSingletonScope().whenTargetNamed(e)}class se{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach((t=>{t.refresh()}))}}se.store=new Map;class ae{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((t=>!(t.name===n&&(!e||t.fn===e)))))}_parseOptions(t,e,n){let i;if("string"==typeof e)i={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i),i}_tap(t,e,n){this._insert(this._parseOptions(t,e,n))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;"number"==typeof t.stage&&(n=t.stage);let i=this.taps.length;for(;i>0;){i--;const t=this.taps[i];this.taps[i+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>n)){i++;break}}this.taps[i]=t}}class oe extends ae{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const le=Symbol.for("EnvContribution"),ce=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Ht,this.options=e,this.id=kt.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new Qt}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,n){const i=this._getNotAllArgs(t,!1,e,n);return this._get(i)}getNamed(t,e){return this.getTagged(t,Pt,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,n=new qt(t,e),i=this._bindingDictionary.get(t)||[];return i.push(n),this._bindingDictionary.set(t,i),new ee(n)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>n=>{const i=this.bind(n);return t(i,e),i},n=()=>t=>this.unbind(t),i=()=>t=>this.isBound(t),r=e=>n=>{const i=this.rebind(n);return t(i,e),i};return t=>({bindFunction:e(t),isboundFunction:i(),rebindFunction:r(t),unbindFunction:n(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:n}=this._metadataReader.getConstructorMetadata(e),i=Object.keys(n),r=[];for(let t=0;t<i.length;t++){const e=n[t],i={};e.forEach((t=>{i[t.key]=t.value}));const s={inject:i[Et],multiInject:i.multi_inject},a=s.inject||s.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};r.push(t)}}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case Gt:case Xt:e=t.cache;break;case Yt:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const n=this._getChildRequest(t);return this._createInstance(e,n)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===jt&&(t.cache=e,t.activated=!0)}},ue=Symbol.for("RenderService");const he=new class{get renderService(){return this._renderService||(this._renderService=ce.get(ue)),this._renderService}};var de;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(de||(de={}));const fe=H-1e-8;class pe{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,i,r,s){if(Math.abs(r-i)>fe)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let a,o,l,c,u=1/0,h=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),c=n*Math.sin(t),l<u&&(u=l),l>h&&(h=l),c<d&&(d=c),c>f&&(f=c)}if(p(i),p(r),r!==i)if((i%=H)<0&&(i+=H),(r%=H)<0&&(r+=H),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=H,a=i-i%j,o=0;o<4&&a>r;++o,a-=j)p(a);else for(a=i-i%j+j,o=0;o<4&&a<r;++o,a+=j)p(a);this.bounds.add(t+u,e+d),this.bounds.add(t+h,e+f)}arcTo(t,e,n,i,r){this.bounds.add(t,e)}bezierCurveTo(t,e,n,i,r,s){this.bounds.add(t,e),this.bounds.add(n,i),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}rect(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}clear(){this.bounds.clear()}release(...t){}}class ge{constructor(){this._curves=[],this.bounds=new ft}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const me=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,be={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},ye={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let ve,xe,_e,Se,Ae,we;var Te,Ce,Be,ke,Me,Pe;function Ee(t){const e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=l*s,u=-o*a,h=o*s,d=l*a,f=Math.cos(i),p=Math.sin(i),g=Math.cos(r),m=Math.sin(r),b=.5*(r-i),y=Math.sin(.5*b),v=8/3*y*y/Math.sin(b),x=e+f-v*p,_=n+p+v*f,S=e+g,A=n+m,w=S+v*m,T=A-v*g;return[c*x+u*_,h*x+d*_,c*w+u*T,h*w+d*T,c*S+u*A,h*S+d*A]}function Oe(t,e,n,i){const r=function(t,e,n,i,r,s,a,o,l){const c=nt(a),u=Math.sin(c),h=Math.cos(c),d=h*(o-t)*.5+u*(l-e)*.5,f=h*(l-e)*.5-u*(o-t)*.5;let p=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const g=h/n,m=u/n,b=-u/i,y=h/i,v=g*o+m*l,x=b*o+y*l,_=g*t+m*e,S=b*t+y*e;let A=1/((_-v)*(_-v)+(S-x)*(S-x))-.25;A<0&&(A=0);let w=Math.sqrt(A);s===r&&(w=-w);const T=.5*(v+_)-w*(S-x),C=.5*(x+S)+w*(_-v),B=Math.atan2(x-C,v-T);let k=Math.atan2(S-C,_-T)-B;k<0&&1===s?k+=H:k>0&&0===s&&(k-=H);const M=Math.ceil(Math.abs(k/(j+.001))),P=[];for(let t=0;t<M;++t){const e=B+t*k/M,r=B+(t+1)*k/M;P[t]=[T,C,e,r,n,i,u,h]}return P}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n);for(let e=0;e<r.length;++e){const n=Ee(r[e]);t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(Te||(Te={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(Ce||(Ce={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(Be||(Be={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(ke||(ke={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Me||(Me={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Pe||(Pe={}));const Le=[(t,e,n,i,r,s,a)=>e.arc(t[1]*r+n,t[2]*s+i,t[3]*(r+s)/2,t[4],t[5],t[6],a),(t,e,n,i,r,s,a)=>e.arcTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*(r+s)/2,a),(t,e,n,i,r,s,a)=>e.bezierCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*r+n,t[6]*s+i,a),(t,e,n,i)=>e.closePath(),(t,e,n,i,r,s)=>e.ellipse(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,n,i,r,s,a)=>e.lineTo(t[1]*r+n,t[2]*s+i,a),(t,e,n,i,r,s,a)=>e.moveTo(t[1]*r+n,t[2]*s+i,a),(t,e,n,i,r,s,a)=>e.quadraticCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,a),(t,e,n,i,r,s,a)=>e.rect(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,a)];function Re(t,e,n=0,i=0,r=1,s=1,a){for(let o=0;o<t.length;o++){const l=t[o];Le[l[0]](l,e,n,i,r,s,a)}}class Ie{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Ne(t,e){let n=0;const i=t.length;for(let r=0;r<i;r++){const s=t[r],a=e[r],o=t[(r+1)%i],l=e[(r+1)%i];n+=et.distanceNN(s,a,o,l)}return n/2}function Ue(t,e,n,i,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*n*r*r*s+i*r*r*r}function De(t,e,n,i,r){const s=Ue(t.x,e.x,n.x,i.x,r),a=Ue(t.y,e.y,n.y,i.y,r);return new tt(s,a)}function ze(t,e,n,i){const r=1-i;return r*r*t+2*r*i*e+i*i*n}function We(t,e,n,i){const r=ze(t.x,e.x,n.x,i),s=ze(t.y,e.y,n.y,i);return new tt(r,s)}class Fe extends Ie{constructor(t,e,n,i){super(),this.type=Me.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=n,this.p3=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return De(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,n=this.p2,i=this.p3,Ne([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])):60;var t,e,n,i}calcProjLength(t){return t===ke.ROW?V(this.p0.x-this.p3.x):t===ke.COLUMN?V(this.p0.y-this.p3.y):0}getAngleAt(t){const e=Y(t-.01,0),n=K(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return $(r.y-i.y,r.x-i.x)}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.bezierCurveTo(this.p1.x*i+e,this.p1.y*r+n,this.p2.x*i+e,this.p2.y*r+n,this.p3.x*i+e,this.p3.y*r+n);else if(s>0){const[a]=function(t,e){const{p0:n,p1:i,p2:r,p3:s}=t,a=De(n,i,r,s,e),o=et.pointAtPP(n,i,e),l=et.pointAtPP(i,r,e),c=et.pointAtPP(r,s,e),u=et.pointAtPP(o,l,e),h=et.pointAtPP(l,c,e);return[new Fe(n,o,u,a),new Fe(a,h,c,s)]}(this,s);t.bezierCurveTo(a.p1.x*i+e,a.p1.y*r+n,a.p2.x*i+e,a.p2.y*r+n,a.p3.x*i+e,a.p3.y*r+n)}}includeX(t){const e=K(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=Y(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=n}getYAt(t){const e=K(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=(t-e)/(Y(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(n).y}}class je extends Ie{constructor(t,e){super(),this.type=Me.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return et.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=$(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?et.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===ke.ROW?V(this.p0.x-this.p1.x):t===ke.COLUMN?V(this.p0.y-this.p1.y):0}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.lineTo(this.p1.x*i+e,this.p1.y*r+n);else if(s>0){const a=this.getPointAt(s);t.lineTo(a.x*i+e,a.y*r+n)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,n=this.p1;this.p0.x>this.p1.x&&(e=this.p1,n=this.p0);const i=(t-e.x)/(n.x-e.x);return e.y+i*(n.y-e.y)}return 1/0}}class He{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,n,i,r,s,a,o){const l=new Fe(new tt(this._lastX,this._lastY),new tt(t,e),new tt(n,i),new tt(r,s));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=r,this._lastY=s,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,n,i){const r=this.addLinearCurve(t,e,n,this._lastOriginP,i);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=i}moveTo(t,e,n){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=n,this._startOriginP=n,this}quadraticCurveTo(t,e,n,i){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,i,r){const s=new je(new tt(this._lastX,this._lastY),new tt(t,e));return s.originP1=i,s.originP2=r,s.defined=n,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===ke.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],n=this.curves[this.curves.length-1],i=null!==(e=n.p3)&&void 0!==e?e:n.p1;return V(t.p0.y-i.y)}if(t===ke.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return V(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Ge extends He{bezierCurveTo(t,e,n,i,r,s,a,o){return super.bezierCurveTo(e,t,i,n,s,r,a,o)}lineTo(t,e,n,i){return super.lineTo(e,t,n,i)}moveTo(t,e,n){return super.moveTo(e,t,n)}clear(){return super.clear()}}function Ve(t,e,n=1){let i=!1;for(let n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function $e(t,e,n){const i=null!=e?e:V(n[n.length-1].x-n[0].x)>V(n[n.length-1].y-n[0].y)?ke.ROW:ke.COLUMN;return"monotoneY"===t?new Ge(t,i):new He(t,i)}class Xe{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Ye(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=$e("linear",n,t);return function(t,e){Ve(t,e,1)}(new Xe(r,i),t),r}function Ke(t,e,n,i,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6,i,t.lastPoint1)}class qe{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&Ke(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:Ke(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Qe(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return Ye(t,e);const r=$e("basis",n,t);return function(t,e){Ve(t,e,2)}(new qe(r,i),t),r}function Ze(t){return t<0?-1:1}function Je(t,e,n){const i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||Number(r<0&&-0)),a=(n-t._y1)/(r||Number(i<0&&-0)),o=(s*r+a*i)/(i+r);return(Ze(s)+Ze(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function tn(t,e){const n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function en(t,e,n,i,r){const s=t._x0,a=t._y0,o=t._x1,l=t._y1,c=(o-s)/3;t.context.bezierCurveTo(s+c,a+c*e,o-c,l-c*n,o,l,i,t.lastPoint1)}class nn{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:en(this,this._t0,tn(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const n=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(n,i,t);break;case 1:this._point=2;break;case 2:this._point=3,en(this,tn(this,e=Je(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:en(this,this._t0,e=Je(this,n,i),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class rn extends nn{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function sn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return Ye(t,e);const r=$e("monotoneX",n,t);return function(t,e){Ve(t,e,2)}(new nn(r,i),t),r}function an(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return Ye(t,e);const r=$e("monotoneY",n,t);return function(t,e){Ve(t,e,2)}(new rn(r,i),t),r}class on{constructor(t,e=.5,n){this.context=t,this._t=e,this.startPoint=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t);else{const i=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(i,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class ln extends on{lineEnd(){this.context.closePath()}}function cn(t,e,n={}){const{direction:i,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const s=new He("step",null!=i?i:V(t[t.length-1].x-t[0].x)>V(t[t.length-1].y-t[0].y)?ke.ROW:ke.COLUMN);return un(new on(s,e,r),t),s}function un(t,e){return Ve(t,e,1)}class hn extends Xe{lineEnd(){this.context.closePath()}}function dn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=$e("linear",n,t);return function(t,e){Ve(t,e,1)}(new hn(r,i),t),r}function fn(t,e,n,i,r){let s=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>W){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,n=3*t._l01_a*(t._l01_a+t._l12_a);s=(s*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/n,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/n}if(t._l23_a>W){const i=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,r=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*i+t._x1*t._l23_2a-e*t._l12_2a)/r,l=(l*i+t._y1*t._l23_2a-n*t._l12_2a)/r}t.context.bezierCurveTo(s,a,o,l,t._x2,t._y2,i,t.lastPoint1)}function pn(t,e){return function(n,i,r={}){const{direction:s,startPoint:a}=r;if(n.length<2-Number(!!a))return null;if(n.length<3-Number(!!a))return Ye(n,r);const o=$e(t,s,n);return Ve(new e(o,i,a),n,2),o}}const gn=pn("catmullRom",class{constructor(t,e=.5,n){this.context=t,this.startPoint=n,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:n}=t;if(this._point){const t=this._x2-e,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_