@ecan-bi/pivot-table 1.0.44 → 1.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @ecan-bi/pivot-table@1.0.
|
|
1
|
+
/*! @ecan-bi/pivot-table@1.0.45 */
|
|
2
2
|
(function(Ke,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("vue"),require("dayjs"),require("lodash-es"),require("axios"),require("ant-design-vue"),require("ant-design-vue/es/input-number/style"),require("ant-design-vue/es/form/style"),require("echarts"),require("vuedraggable")):typeof define=="function"&&define.amd?define(["exports","vue","dayjs","lodash-es","axios","ant-design-vue","ant-design-vue/es/input-number/style","ant-design-vue/es/form/style","echarts","vuedraggable"],b):(Ke=typeof globalThis<"u"?globalThis:Ke||self,b(Ke["@ecan-bi/pivot-table"]={},Ke.Vue,Ke.Dayjs,Ke.LodashEs,Ke.Axios,Ke.AntDesignVue,null,null,Ke.Echarts,Ke.Draggable))})(this,function(Ke,b,To,Ye,rB,Vi,$K,GK,sB,ab){"use strict";function lB(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const aB=lB(sB),hB=i=>(i.install=t=>{t.component(i.name,i)},i);function hb(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(n=Object.getOwnPropertySymbols(i);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(i,n[o])&&(e[n[o]]=i[n[o]])}return e}const dB=()=>{},uB=Object.assign,cB=Array.isArray,rf=i=>typeof i=="function",gB=i=>typeof i=="symbol";let db;const sf=()=>db||(db=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function lf(i){const t=i&&i.__v_raw;return t?lf(t):i}function ub(i){return!(!i||i.__v_isRef!==!0)}function ji(i){return ub(i)?i.value:i}new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(gB));const Fr=[];function af(i,...t){if(process.env.NODE_ENV==="production")return;const e=Fr.length?Fr[Fr.length-1].component:null,n=e&&e.appContext.config.warnHandler,o=function(){let r=Fr[Fr.length-1];if(!r)return[];const s=[];for(;r;){const l=s[0];l&&l.vnode===r?l.recurseCount++:s.push({vnode:r,recurseCount:0});const a=r.component&&r.component.parent;r=a&&a.vnode}return s}();if(n)hf(n,e,11,[i+t.join(""),e&&e.proxy,o.map(({vnode:r})=>`at <${yb(e,r.type)}>`).join(`
|
|
3
3
|
`),o]);else{const r=[`[Vue warn]: ${i}`,...t];o.length&&r.push(`
|
|
4
4
|
`,...function(s){const l=[];return s.forEach((a,h)=>{l.push(...h===0?[]:[`
|
|
5
|
-
`],...function({vnode:d,recurseCount:u}){const c=u>0?`... (${u} recursive calls)`:"",g=!!d.component&&d.component.parent==null,f=` at <${yb(d.component,d.type,g)}`,p=">"+c;return d.props?[f,...fB(d.props),p]:[f+p]}(a))}),l}(o)),console.warn(...r)}}function fB(i){const t=[],e=Object.keys(i);return e.slice(0,3).forEach(n=>{t.push(...cb(n,i[n]))}),e.length>3&&t.push(" ..."),t}function cb(i,t,e){return typeof t=="string"?(t=JSON.stringify(t),e?t:[`${i}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?e?t:[`${i}=${t}`]:ub(t)?(t=cb(i,lf(t.value),!0),e?t:[`${i}=Ref<`,t,">"]):rf(t)?[`${i}=fn${t.name?`<${t.name}>`:""}`]:(t=lf(t),e?t:[`${i}=`,t])}const gb={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"};function hf(i,t,e,n){let o;try{o=n?i(...n):i()}catch(r){(function(s,l,a,h=!0){const d=l?l.vnode:null;if(l){let u=l.parent;const c=l.proxy,g=process.env.NODE_ENV!=="production"?gb[a]:a;for(;u;){const p=u.ec;if(p){for(let m=0;m<p.length;m++)if(p[m](s,c,g)===!1)return}u=u.parent}const f=l.appContext.config.errorHandler;if(f)return void hf(f,null,10,[s,c,g])}(function(u,c,g,f=!0){if(process.env.NODE_ENV!=="production"){const m=gb[c];if(g&&(p=g,Fr.push(p)),af("Unhandled error"+(m?` during execution of ${m}`:"")),g&&Fr.pop(),f)throw u;console.error(u)}else console.error(u);var p})(s,a,d,h)})(r,t,e)}return o}let jh=!1,df=!1;const jn=[];let rr=0;const Bs=[];let lo=null,sr=0;const pB=Promise.resolve();function mB(i){jn.length&&jn.includes(i,jh&&i.allowRecurse?rr+1:rr)||(i.id==null?jn.push(i):jn.splice(function(t){let e=rr+1,n=jn.length;for(;e<n;){const o=e+n>>>1,r=jn[o],s=Vl(r);s<t||s===t&&r.pre?e=o+1:n=o}return e}(i.id),0,i),fb())}function fb(){jh||df||(df=!0,pB.then(pb))}const Vl=i=>i.id==null?1/0:i.id,vB=(i,t)=>{const e=Vl(i)-Vl(t);if(e===0){if(i.pre&&!t.pre)return-1;if(t.pre&&!i.pre)return 1}return e};function pb(i){df=!1,jh=!0,process.env.NODE_ENV!=="production"&&(i=i||new Map),jn.sort(vB);const t=process.env.NODE_ENV!=="production"?e=>mb(i,e):dB;try{for(rr=0;rr<jn.length;rr++){const e=jn[rr];if(e&&e.active!==!1){if(process.env.NODE_ENV!=="production"&&t(e))continue;hf(e,null,14)}}}finally{rr=0,jn.length=0,function(e){if(Bs.length){const n=[...new Set(Bs)];if(Bs.length=0,lo)return void lo.push(...n);for(lo=n,process.env.NODE_ENV!=="production"&&(e=e||new Map),lo.sort((o,r)=>Vl(o)-Vl(r)),sr=0;sr<lo.length;sr++)process.env.NODE_ENV!=="production"&&mb(e,lo[sr])||lo[sr]();lo=null,sr=0}}(i),jh=!1,(jn.length||Bs.length)&&pb(i)}}function mb(i,t){if(i.has(t)){const e=i.get(t);if(e>100){const n=t.ownerInstance,o=n&&Cb(n.type);return af(`Maximum recursive updates exceeded${o?` in component <${o}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`),!0}i.set(t,e+1)}else i.set(t,1)}const jl=new Set;process.env.NODE_ENV!=="production"&&(sf().__VUE_HMR_RUNTIME__={createRecord:uf(function(i,t){return $h.has(i)?!1:($h.set(i,{initialDef:$l(t),instances:new Set}),!0)}),rerender:uf(function(i,t){const e=$h.get(i);e&&(e.initialDef.render=t,[...e.instances].forEach(n=>{t&&(n.render=t,$l(n.type).render=t),n.renderCache=[],n.update()}))}),reload:uf(function(i,t){const e=$h.get(i);if(!e)return;t=$l(t),vb(e.initialDef,t);const n=[...e.instances];for(const r of n){const s=$l(r.type);jl.has(s)||(s!==e.initialDef&&vb(s,t),jl.add(s)),r.appContext.propsCache.delete(r.type),r.appContext.emitsCache.delete(r.type),r.appContext.optionsCache.delete(r.type),r.ceReload?(jl.add(s),r.ceReload(t.styles),jl.delete(s)):r.parent?mB(r.parent.update):r.appContext.reload?r.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}o=()=>{for(const r of n)jl.delete($l(r.type))},cB(o)?Bs.push(...o):lo&&lo.includes(o,o.allowRecurse?sr+1:sr)||Bs.push(o),fb();var o})});const $h=new Map;function $l(i){return rf(t=i)&&"__vccOpts"in t?i.__vccOpts:i;var t}function vb(i,t){uB(i,t);for(const e in i)e==="__file"||e in t||delete i[e]}function uf(i){return(t,e)=>{try{return i(t,e)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let cf;process.env.NODE_ENV;let bb="__VUE_INSTANCE_SETTERS__";(cf=sf()[bb])||(cf=sf()[bb]=[]),cf.push(i=>i);const bB=/(?:^|[-_])(\w)/g,CB=i=>i.replace(bB,t=>t.toUpperCase()).replace(/[-_]/g,"");function Cb(i,t=!0){return rf(i)?i.displayName||i.name:i.name||t&&i.__name}function yb(i,t,e=!1){let n=Cb(t);if(!n&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(n=o[1])}if(!n&&i&&i.parent){const o=r=>{for(const s in r)if(r[s]===t)return s};n=o(i.components||i.parent.type.components)||o(i.appContext.components)}return n?CB(n):e?"App":"Anonymous"}function yB(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var _b,wb={exports:{}};function _B(){return _b||(_b=1,wb.exports=function(){var i=1e3,t=6e4,e=36e5,n="millisecond",o="second",r="minute",s="hour",l="day",a="week",h="month",d="quarter",u="year",c="date",g="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var H=["th","st","nd","rd"],F=B%100;return"["+B+(H[(F-20)%10]||H[F]||H[0])+"]"}},v=function(B,H,F){var P=String(B);return!P||P.length>=H?B:""+Array(H+1-P.length).join(F)+B},C={s:v,z:function(B){var H=-B.utcOffset(),F=Math.abs(H),P=Math.floor(F/60),E=F%60;return(H<=0?"+":"-")+v(P,2,"0")+":"+v(E,2,"0")},m:function B(H,F){if(H.date()<F.date())return-B(F,H);var P=12*(F.year()-H.year())+(F.month()-H.month()),E=H.clone().add(P,h),L=F-E<0,I=H.clone().add(P+(L?-1:1),h);return+(-(P+(F-E)/(L?E-I:I-E))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:h,y:u,w:a,d:l,D:c,h:s,m:r,s:o,ms:n,Q:d}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},w="en",S={};S[w]=m;var y="$isDayjsObject",_=function(B){return B instanceof T||!(!B||!B[y])},R=function B(H,F,P){var E;if(!H)return w;if(typeof H=="string"){var L=H.toLowerCase();S[L]&&(E=L),F&&(S[L]=F,E=L);var I=H.split("-");if(!E&&I.length>1)return B(I[0])}else{var k=H.name;S[k]=H,E=k}return!P&&E&&(w=E),E||!P&&w},A=function(B,H){if(_(B))return B.clone();var F=typeof H=="object"?H:{};return F.date=B,F.args=arguments,new T(F)},x=C;x.l=R,x.i=_,x.w=function(B,H){return A(B,{locale:H.$L,utc:H.$u,x:H.$x,$offset:H.$offset})};var T=function(){function B(F){this.$L=R(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[y]=!0}var H=B.prototype;return H.parse=function(F){this.$d=function(P){var E=P.date,L=P.utc;if(E===null)return new Date(NaN);if(x.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var I=E.match(f);if(I){var k=I[2]-1||0,D=(I[7]||"0").substring(0,3);return L?new Date(Date.UTC(I[1],k,I[3]||1,I[4]||0,I[5]||0,I[6]||0,D)):new Date(I[1],k,I[3]||1,I[4]||0,I[5]||0,I[6]||0,D)}}return new Date(E)}(F),this.init()},H.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},H.$utils=function(){return x},H.isValid=function(){return this.$d.toString()!==g},H.isSame=function(F,P){var E=A(F);return this.startOf(P)<=E&&E<=this.endOf(P)},H.isAfter=function(F,P){return A(F)<this.startOf(P)},H.isBefore=function(F,P){return this.endOf(P)<A(F)},H.$g=function(F,P,E){return x.u(F)?this[P]:this.set(E,F)},H.unix=function(){return Math.floor(this.valueOf()/1e3)},H.valueOf=function(){return this.$d.getTime()},H.startOf=function(F,P){var E=this,L=!!x.u(P)||P,I=x.p(F),k=function(U,$){var Q=x.w(E.$u?Date.UTC(E.$y,$,U):new Date(E.$y,$,U),E);return L?Q:Q.endOf(l)},D=function(U,$){return x.w(E.toDate()[U].apply(E.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice($)),E)},O=this.$W,N=this.$M,W=this.$D,j="set"+(this.$u?"UTC":"");switch(I){case u:return L?k(1,0):k(31,11);case h:return L?k(1,N):k(0,N+1);case a:var G=this.$locale().weekStart||0,Y=(O<G?O+7:O)-G;return k(L?W-Y:W+(6-Y),N);case l:case c:return D(j+"Hours",0);case s:return D(j+"Minutes",1);case r:return D(j+"Seconds",2);case o:return D(j+"Milliseconds",3);default:return this.clone()}},H.endOf=function(F){return this.startOf(F,!1)},H.$set=function(F,P){var E,L=x.p(F),I="set"+(this.$u?"UTC":""),k=(E={},E[l]=I+"Date",E[c]=I+"Date",E[h]=I+"Month",E[u]=I+"FullYear",E[s]=I+"Hours",E[r]=I+"Minutes",E[o]=I+"Seconds",E[n]=I+"Milliseconds",E)[L],D=L===l?this.$D+(P-this.$W):P;if(L===h||L===u){var O=this.clone().set(c,1);O.$d[k](D),O.init(),this.$d=O.set(c,Math.min(this.$D,O.daysInMonth())).$d}else k&&this.$d[k](D);return this.init(),this},H.set=function(F,P){return this.clone().$set(F,P)},H.get=function(F){return this[x.p(F)]()},H.add=function(F,P){var E,L=this;F=Number(F);var I=x.p(P),k=function(N){var W=A(L);return x.w(W.date(W.date()+Math.round(N*F)),L)};if(I===h)return this.set(h,this.$M+F);if(I===u)return this.set(u,this.$y+F);if(I===l)return k(1);if(I===a)return k(7);var D=(E={},E[r]=t,E[s]=e,E[o]=i,E)[I]||1,O=this.$d.getTime()+F*D;return x.w(O,this)},H.subtract=function(F,P){return this.add(-1*F,P)},H.format=function(F){var P=this,E=this.$locale();if(!this.isValid())return E.invalidDate||g;var L=F||"YYYY-MM-DDTHH:mm:ssZ",I=x.z(this),k=this.$H,D=this.$m,O=this.$M,N=E.weekdays,W=E.months,j=E.meridiem,G=function($,Q,gt,vt){return $&&($[Q]||$(P,L))||gt[Q].slice(0,vt)},Y=function($){return x.s(k%12||12,$,"0")},U=j||function($,Q,gt){var vt=$<12?"AM":"PM";return gt?vt.toLowerCase():vt};return L.replace(p,function($,Q){return Q||function(gt){switch(gt){case"YY":return String(P.$y).slice(-2);case"YYYY":return x.s(P.$y,4,"0");case"M":return O+1;case"MM":return x.s(O+1,2,"0");case"MMM":return G(E.monthsShort,O,W,3);case"MMMM":return G(W,O);case"D":return P.$D;case"DD":return x.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return G(E.weekdaysMin,P.$W,N,2);case"ddd":return G(E.weekdaysShort,P.$W,N,3);case"dddd":return N[P.$W];case"H":return String(k);case"HH":return x.s(k,2,"0");case"h":return Y(1);case"hh":return Y(2);case"a":return U(k,D,!0);case"A":return U(k,D,!1);case"m":return String(D);case"mm":return x.s(D,2,"0");case"s":return String(P.$s);case"ss":return x.s(P.$s,2,"0");case"SSS":return x.s(P.$ms,3,"0");case"Z":return I}return null}($)||I.replace(":","")})},H.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},H.diff=function(F,P,E){var L,I=this,k=x.p(P),D=A(F),O=(D.utcOffset()-this.utcOffset())*t,N=this-D,W=function(){return x.m(I,D)};switch(k){case u:L=W()/12;break;case h:L=W();break;case d:L=W()/3;break;case a:L=(N-O)/6048e5;break;case l:L=(N-O)/864e5;break;case s:L=N/e;break;case r:L=N/t;break;case o:L=N/i;break;default:L=N}return E?L:x.a(L)},H.daysInMonth=function(){return this.endOf(h).$D},H.$locale=function(){return S[this.$L]},H.locale=function(F,P){if(!F)return this.$L;var E=this.clone(),L=R(F,P,!0);return L&&(E.$L=L),E},H.clone=function(){return x.w(this.$d,this)},H.toDate=function(){return new Date(this.valueOf())},H.toJSON=function(){return this.isValid()?this.toISOString():null},H.toISOString=function(){return this.$d.toISOString()},H.toString=function(){return this.$d.toUTCString()},B}(),M=T.prototype;return A.prototype=M,[["$ms",n],["$s",o],["$m",r],["$H",s],["$W",l],["$M",h],["$y",u],["$D",c]].forEach(function(B){M[B[1]]=function(H){return this.$g(H,B[0],B[1])}}),A.extend=function(B,H){return B.$i||(B(H,T,A),B.$i=!0),A},A.locale=R,A.isDayjs=_,A.unix=function(B){return A(1e3*B)},A.en=S[w],A.Ls=S,A.p={},A}()),wb.exports}var $n=yB(_B()),Sb=typeof global=="object"&&global&&global.Object===Object&&global,wB=typeof self=="object"&&self&&self.Object===Object&&self,Mo=Sb||wB||Function("return this")(),Ps=Mo.Symbol,xb=Object.prototype,SB=xb.hasOwnProperty,xB=xb.toString,Gl=Ps?Ps.toStringTag:void 0,AB=Object.prototype.toString,Ab=Ps?Ps.toStringTag:void 0;function Ul(i){return i==null?i===void 0?"[object Undefined]":"[object Null]":Ab&&Ab in Object(i)?function(t){var e=SB.call(t,Gl),n=t[Gl];try{t[Gl]=void 0;var o=!0}catch{}var r=xB.call(t);return o&&(e?t[Gl]=n:delete t[Gl]),r}(i):function(t){return AB.call(t)}(i)}function Kl(i){return i!=null&&typeof i=="object"}var gf=Array.isArray;function Gh(i){var t=typeof i;return i!=null&&(t=="object"||t=="function")}function Rb(i){if(!Gh(i))return!1;var t=Ul(i);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"}var Tb,ff=Mo["__core-js_shared__"],Mb=(Tb=/[^.]+$/.exec(ff&&ff.keys&&ff.keys.IE_PROTO||""))?"Symbol(src)_1."+Tb:"",RB=Function.prototype.toString;function Ir(i){if(i!=null){try{return RB.call(i)}catch{}try{return i+""}catch{}}return""}var TB=/^\[object .+?Constructor\]$/,MB=Function.prototype,BB=Object.prototype,PB=MB.toString,HB=BB.hasOwnProperty,EB=RegExp("^"+PB.call(HB).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kB(i){return!(!Gh(i)||(t=i,Mb&&Mb in t))&&(Rb(i)?EB:TB).test(Ir(i));var t}function Dr(i,t){var e=function(n,o){return n==null?void 0:n[o]}(i,t);return kB(e)?e:void 0}var pf=Dr(Mo,"WeakMap"),Bb=Object.create,LB=function(){function i(){}return function(t){if(!Gh(t))return{};if(Bb)return Bb(t);i.prototype=t;var e=new i;return i.prototype=void 0,e}}(),Pb=function(){try{var i=Dr(Object,"defineProperty");return i({},"",{}),i}catch{}}(),FB=/^(?:0|[1-9]\d*)$/;function IB(i,t){var e=typeof i;return!!(t=t??9007199254740991)&&(e=="number"||e!="symbol"&&FB.test(i))&&i>-1&&i%1==0&&i<t}function Hb(i,t){return i===t||i!=i&&t!=t}var DB=Object.prototype.hasOwnProperty;function OB(i,t,e){var n=i[t];DB.call(i,t)&&Hb(n,e)&&(e!==void 0||t in i)||function(o,r,s){r=="__proto__"&&Pb?Pb(o,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):o[r]=s}(i,t,e)}function Eb(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=9007199254740991}var zB=Object.prototype;function kb(i){var t=i&&i.constructor;return i===(typeof t=="function"&&t.prototype||zB)}function Lb(i){return Kl(i)&&Ul(i)=="[object Arguments]"}var Fb=Object.prototype,WB=Fb.hasOwnProperty,NB=Fb.propertyIsEnumerable,VB=Lb(function(){return arguments}())?Lb:function(i){return Kl(i)&&WB.call(i,"callee")&&!NB.call(i,"callee")},Ib=typeof Ke=="object"&&Ke&&!Ke.nodeType&&Ke,Db=Ib&&typeof module=="object"&&module&&!module.nodeType&&module,Ob=Db&&Db.exports===Ib?Mo.Buffer:void 0,zb=(Ob?Ob.isBuffer:void 0)||function(){return!1},ze={};function mf(i){return function(t){return i(t)}}ze["[object Float32Array]"]=ze["[object Float64Array]"]=ze["[object Int8Array]"]=ze["[object Int16Array]"]=ze["[object Int32Array]"]=ze["[object Uint8Array]"]=ze["[object Uint8ClampedArray]"]=ze["[object Uint16Array]"]=ze["[object Uint32Array]"]=!0,ze["[object Arguments]"]=ze["[object Array]"]=ze["[object ArrayBuffer]"]=ze["[object Boolean]"]=ze["[object DataView]"]=ze["[object Date]"]=ze["[object Error]"]=ze["[object Function]"]=ze["[object Map]"]=ze["[object Number]"]=ze["[object Object]"]=ze["[object RegExp]"]=ze["[object Set]"]=ze["[object String]"]=ze["[object WeakMap]"]=!1;var Wb=typeof Ke=="object"&&Ke&&!Ke.nodeType&&Ke,Yl=Wb&&typeof module=="object"&&module&&!module.nodeType&&module,vf=Yl&&Yl.exports===Wb&&Sb.process,Hs=function(){try{var i=Yl&&Yl.require&&Yl.require("util").types;return i||vf&&vf.binding&&vf.binding("util")}catch{}}(),Nb=Hs&&Hs.isTypedArray,jB=Nb?mf(Nb):function(i){return Kl(i)&&Eb(i.length)&&!!ze[Ul(i)]},$B=Object.prototype.hasOwnProperty;function GB(i,t){var e=gf(i),n=!e&&VB(i),o=!e&&!n&&zb(i),r=!e&&!n&&!o&&jB(i),s=e||n||o||r,l=s?function(d,u){for(var c=-1,g=Array(d);++c<d;)g[c]=u(c);return g}(i.length,String):[],a=l.length;for(var h in i)!$B.call(i,h)||s&&(h=="length"||o&&(h=="offset"||h=="parent")||r&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||IB(h,a))||l.push(h);return l}function Vb(i,t){return function(e){return i(t(e))}}var UB=Vb(Object.keys,Object),KB=Object.prototype.hasOwnProperty;function YB(i){return(t=i)!=null&&Eb(t.length)&&!Rb(t)?GB(i):function(e){if(!kb(e))return UB(e);var n=[];for(var o in Object(e))KB.call(e,o)&&o!="constructor"&&n.push(o);return n}(i);var t}var Xl=Dr(Object,"create"),XB=Object.prototype.hasOwnProperty,qB=Object.prototype.hasOwnProperty;function Or(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function Uh(i,t){for(var e=i.length;e--;)if(Hb(i[e][0],t))return e;return-1}Or.prototype.clear=function(){this.__data__=Xl?Xl(null):{},this.size=0},Or.prototype.delete=function(i){var t=this.has(i)&&delete this.__data__[i];return this.size-=t?1:0,t},Or.prototype.get=function(i){var t=this.__data__;if(Xl){var e=t[i];return e==="__lodash_hash_undefined__"?void 0:e}return XB.call(t,i)?t[i]:void 0},Or.prototype.has=function(i){var t=this.__data__;return Xl?t[i]!==void 0:qB.call(t,i)},Or.prototype.set=function(i,t){var e=this.__data__;return this.size+=this.has(i)?0:1,e[i]=Xl&&t===void 0?"__lodash_hash_undefined__":t,this};var ZB=Array.prototype.splice;function Bo(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}Bo.prototype.clear=function(){this.__data__=[],this.size=0},Bo.prototype.delete=function(i){var t=this.__data__,e=Uh(t,i);return!(e<0)&&(e==t.length-1?t.pop():ZB.call(t,e,1),--this.size,!0)},Bo.prototype.get=function(i){var t=this.__data__,e=Uh(t,i);return e<0?void 0:t[e][1]},Bo.prototype.has=function(i){return Uh(this.__data__,i)>-1},Bo.prototype.set=function(i,t){var e=this.__data__,n=Uh(e,i);return n<0?(++this.size,e.push([i,t])):e[n][1]=t,this};var ql=Dr(Mo,"Map");function Kh(i,t){var e,n,o=i.__data__;return((n=typeof(e=t))=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null)?o[typeof t=="string"?"string":"hash"]:o.map}function Es(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}Es.prototype.clear=function(){this.size=0,this.__data__={hash:new Or,map:new(ql||Bo),string:new Or}},Es.prototype.delete=function(i){var t=Kh(this,i).delete(i);return this.size-=t?1:0,t},Es.prototype.get=function(i){return Kh(this,i).get(i)},Es.prototype.has=function(i){return Kh(this,i).has(i)},Es.prototype.set=function(i,t){var e=Kh(this,i),n=e.size;return e.set(i,t),this.size+=e.size==n?0:1,this};var JB=Vb(Object.getPrototypeOf,Object);function ks(i){var t=this.__data__=new Bo(i);this.size=t.size}ks.prototype.clear=function(){this.__data__=new Bo,this.size=0},ks.prototype.delete=function(i){var t=this.__data__,e=t.delete(i);return this.size=t.size,e},ks.prototype.get=function(i){return this.__data__.get(i)},ks.prototype.has=function(i){return this.__data__.has(i)},ks.prototype.set=function(i,t){var e=this.__data__;if(e instanceof Bo){var n=e.__data__;if(!ql||n.length<199)return n.push([i,t]),this.size=++e.size,this;e=this.__data__=new Es(n)}return e.set(i,t),this.size=e.size,this};var QB=Object.prototype.propertyIsEnumerable,jb=Object.getOwnPropertySymbols,tP=jb?function(i){return i==null?[]:(i=Object(i),function(t,e){for(var n=-1,o=t==null?0:t.length,r=0,s=[];++n<o;){var l=t[n];e(l,n,t)&&(s[r++]=l)}return s}(jb(i),function(t){return QB.call(i,t)}))}:function(){return[]};function eP(i){return function(t,e,n){var o=e(t);return gf(t)?o:function(r,s){for(var l=-1,a=s.length,h=r.length;++l<a;)r[h+l]=s[l];return r}(o,n(t))}(i,YB,tP)}var bf=Dr(Mo,"DataView"),Cf=Dr(Mo,"Promise"),yf=Dr(Mo,"Set"),$b="[object Map]",Gb="[object Promise]",Ub="[object Set]",Kb="[object WeakMap]",Yb="[object DataView]",iP=Ir(bf),nP=Ir(ql),oP=Ir(Cf),rP=Ir(yf),sP=Ir(pf),Po=Ul;(bf&&Po(new bf(new ArrayBuffer(1)))!=Yb||ql&&Po(new ql)!=$b||Cf&&Po(Cf.resolve())!=Gb||yf&&Po(new yf)!=Ub||pf&&Po(new pf)!=Kb)&&(Po=function(i){var t=Ul(i),e=t=="[object Object]"?i.constructor:void 0,n=e?Ir(e):"";if(n)switch(n){case iP:return Yb;case nP:return $b;case oP:return Gb;case rP:return Ub;case sP:return Kb}return t});var lP=Object.prototype.hasOwnProperty,Xb=Mo.Uint8Array;function _f(i){var t=new i.constructor(i.byteLength);return new Xb(t).set(new Xb(i)),t}var aP=/\w*$/,qb=Ps?Ps.prototype:void 0,Zb=qb?qb.valueOf:void 0;function hP(i,t,e){var n,o,r,s,l,a=i.constructor;switch(t){case"[object ArrayBuffer]":return _f(i);case"[object Boolean]":case"[object Date]":return new a(+i);case"[object DataView]":return l=_f((s=i).buffer),new s.constructor(l,s.byteOffset,s.byteLength);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 function(h){var d=_f(h.buffer);return new h.constructor(d,h.byteOffset,h.length)}(i);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(i);case"[object RegExp]":return(r=new(o=i).constructor(o.source,aP.exec(o))).lastIndex=o.lastIndex,r;case"[object Symbol]":return n=i,Zb?Object(Zb.call(n)):{}}}var Jb=Hs&&Hs.isMap,dP=Jb?mf(Jb):function(i){return Kl(i)&&Po(i)=="[object Map]"},Qb=Hs&&Hs.isSet,uP=Qb?mf(Qb):function(i){return Kl(i)&&Po(i)=="[object Set]"},tC="[object Arguments]",eC="[object Function]",iC="[object Object]",Oe={};function Yh(i,t,e,n,o,r){var s;if(s!==void 0)return s;if(!Gh(i))return i;var l=gf(i);if(l)s=function(c){var g=c.length,f=new c.constructor(g);return g&&typeof c[0]=="string"&&lP.call(c,"index")&&(f.index=c.index,f.input=c.input),f}(i);else{var a=Po(i),h=a==eC||a=="[object GeneratorFunction]";if(zb(i))return i.slice();if(a==iC||a==tC||h&&!o)s=h?{}:function(c){return typeof c.constructor!="function"||kb(c)?{}:LB(JB(c))}(i);else{if(!Oe[a])return o?i:{};s=hP(i,a)}}r||(r=new ks);var d=r.get(i);if(d)return d;r.set(i,s),uP(i)?i.forEach(function(c){s.add(Yh(c,t,e,c,i,r))}):dP(i)&&i.forEach(function(c,g){s.set(g,Yh(c,t,e,g,i,r))});var u=l?void 0:eP(i);return function(c,g){for(var f=-1,p=c==null?0:c.length;++f<p&&g(c[f],f,c)!==!1;);}(u||i,function(c,g){u&&(c=i[g=c]),OB(s,g,Yh(c,t,e,g,i,r))}),s}Oe[tC]=Oe["[object Array]"]=Oe["[object ArrayBuffer]"]=Oe["[object DataView]"]=Oe["[object Boolean]"]=Oe["[object Date]"]=Oe["[object Float32Array]"]=Oe["[object Float64Array]"]=Oe["[object Int8Array]"]=Oe["[object Int16Array]"]=Oe["[object Int32Array]"]=Oe["[object Map]"]=Oe["[object Number]"]=Oe[iC]=Oe["[object RegExp]"]=Oe["[object Set]"]=Oe["[object String]"]=Oe["[object Symbol]"]=Oe["[object Uint8Array]"]=Oe["[object Uint8ClampedArray]"]=Oe["[object Uint16Array]"]=Oe["[object Uint32Array]"]=!0,Oe["[object Error]"]=Oe[eC]=Oe["[object WeakMap]"]=!1;function Xh(i){return Yh(i,5)}const _i=(i,t)=>{if(typeof i=="string"&&typeof t=="string")return i.toLocaleLowerCase().includes(t.toLocaleLowerCase());if(typeof i=="string"&&Array.isArray(t)){const e=t.length;for(let n=0;n<e;n++){const o=t[n];if(typeof o=="string"&&i.toLocaleLowerCase().includes(o.toLocaleLowerCase()))return!0}}return!1},wn=(i,t)=>Object.prototype.hasOwnProperty.call(i,t),qh=i=>{const t=[];for(const e of i)e.conditions?t.push(...qh(e.conditions)):(e==null?void 0:e.dataType)==="component"&&t.push(e);return t},cP=["table","bar","combograph","line","pie","radar","scatter","list","circulate"];let nC=new Map;const gP=["keyValue","conditionKey","conditionLabel","conditionName","conditionValueType","customValue","id","keyName"],Zh=i=>nC.get(i),oC=(i,t)=>{if(t)wn(i,"indexCode")&&(i.hrpIndexCode=i.indexCode,delete i.indexCode),wn(i,"indexCodeNum")&&(i.hrpIndexCodeNum=i.indexCodeNum,delete i.indexCodeNum),wn(i,"dataType")&&delete i.dataType;else{const{calcWays:e=[],dateCalcTypes:n=[],activeKey:o,componentId:r=""}=i;if(o===5&&(e!=null&&e.length)&&(n!=null&&n.length)&&r){const s=e[0].split("-");(s==null?void 0:s.length)>1&&s[0]==="rangeValue"&&(i.calcWays=((l,a={})=>{const{around:h,unit:d,id:u}=l;let c="";const{pageMode:g="",componentList:f=[]}=(a==null?void 0:a.graphicConfig)||{};let p=null,m=null;if(g==="design"){const v=f==null?void 0:f.find(A=>A.id===u);if(!v)return[];const{interval:C,intervalUnit:w,startTime:S,endTime:y,operate:_,useCurrentTime:R}=v||{};if(R&&(p=$n().subtract(C,w),m=$n()),S&&(p=$n(S)),y&&(m=$n(y)),_){const{type:A,value:x,mode:T}=_;switch(A){case"add":p=p&&p.add(x,T),m=m&&m.add(x,T);break;case"minus":p=p&&p.subtract(x,T),m=m&&m.subtract(x,T)}}}else{const v=Zh(u)||{};ji(v.startTime)&&(p=$n(ji(v.startTime))),ji(v.endTime)&&(m=$n(ji(v.endTime)))}return p&&m&&(c=`${h==="before"?"-":""}${m.diff(p,d.toLowerCase())+1}`),c?[c]:[]})({around:s[1],unit:n[0],id:r})),delete i.radioValue}if(wn(i,"dataType")){if(i.fieldType==="DATE"&&(i.label=i.fieldName),i.dataType==="component")if(i.fieldValue==="PARENT"){let s=i.modelKey;s&&i.prop&&(s+=`-${i.prop}`),i.fieldValue="${"+s+"}"}else i.fieldValue="${"+i.fieldValue+"}";delete i.dataType}wn(i,"activeKey")&&delete i.activeKey,wn(i,"radioValue")&&delete i.radioValue,wn(i,"indexCode")&&(i.hrpIndexCode=i.indexCode,delete i.indexCode),wn(i,"indexCodeNum")&&(i.hrpIndexCodeNum=i.indexCodeNum,delete i.indexCodeNum),i.dataType!=="component"&&i.useCurrentTime&&(i.fieldValue=$n().format(i.dateFormat)),wn(i,"modelKey")&&delete i.modelKey,wn(i,"prop")&&delete i.prop,delete i.useCurrentTime}},zr=(i,t)=>{const e=[];return i!=null&&i.length&&Xh(i).forEach(n=>{if(n.join&&n.conditions){const o=!n.conditions.some(r=>r.join&&r.conditions);n.conditions.forEach((r,s)=>{oC(r,t);const l={};if(s<n.conditions.length-1&&(l.join=n.join),o)e.push(Object.assign(Object.assign({},l),r));else if(r.join&&r.conditions){const a=t?"sqlConditions":"conditions";e.push(Object.assign({[a]:zr([r],t)},l))}else e.push(Object.assign(Object.assign({},l),r))})}else oC(n,t),e.push(n)}),e},wf=(i={},t)=>{if(i!=null&&i.sortCpnts&&t){const S=lC(i);S&&(t.sort=S)}const{label:e,name:n,location:o,show:r,indexCode:s,indexCodeNum:l,calcType:a="COLUMN",builtInFormula:h,builtInValueSource:d,builtInCalcWay:u,formula:c,conditions:g,aggregate:f,distinct:p,dimByCount:m,dataTo:v}=i;let C;if(g&&(C=zr(g)),a==="COMPONENT"){const S={};return Jh(S,d),{label:e.trim(),columnName:n,show:r,calcType:a,componentAlias:u,componentValue:S.fieldValue||null}}const w={label:e.trim(),columnName:n,location:o,show:r,calcType:v==="1"?"VIEW":a,hrpIndexCode:s,hrpIndexCodeNum:l,aggregate:f,builtInFormula:h,builtInValueSource:d,formula:c,conditions:C};if(h!=="DATE_OFFSET")return n==="the_count"&&(w.calcType="AGGREGATE",w.distinct=!!p,w.typeGuid=m),Object.assign(Object.assign({},w),{builtInCalcWay:u});{const S=u.split("-");if((S==null?void 0:S.length)===3){let y=S[0];return S[2]==="before"&&S[0]!=="0"&&(y=`-${S[0]}`),Object.assign(Object.assign({},w),{calcWays:[y],dateCalcTypes:[S[1]]})}}},fP=i=>{if(!i)return[];const t=Xh((i==null?void 0:i.controlList)||[]).filter(p=>p.conditionKey!=="parentCode"),{classificationList:e=[],rowHeaderList:n=[],dimensionList:o=[],seriesList:r=[],leftAxisList:s=[],rightAxisList:l=[],queryColumnList:a=[],indexLibColumns:h=[],indicators:d=[]}=i;sC(t);const u=[...e,...n,...o,...r,...s,...l,...a,...h,...d],c=[];for(const p of u){const m=qh((p==null?void 0:p.conditions)||[]);if(m!=null&&m.length){const v=m.filter(C=>(C==null?void 0:C.dataType)==="component").map(C=>{const w={};return C!=null&&C.dateFormat&&(w.format=C.dateFormat),C.fieldValue==="PARENT"&&(w.id="PARENT",w.keyName=C.modelKey,w.modelKey=C.modelKey,w.prop=C.prop),Object.assign({conditionKey:C.fieldName,conditionLabel:C.fieldName,conditionName:C.fieldName,conditionValueType:C.fieldType,id:C.componentId,keyName:C.fieldValue,rule:C.rule,notGlobal:!0,indexCode:C.indexCode,typeGuid:C.typeGuid,indexCodeNum:C.indexCodeNum},w)});if(v!=null&&v.length)for(const C of v)c.find(w=>w.keyName===C.keyName)||c.push(C)}}const g=c.length,f=t;for(let p=0;p<g;p++){const m=c[p];if((m==null?void 0:m.conditionKey)==="parentCode")continue;const{id:v,keyName:C,prop:w,format:S,modelKey:y,dataType:_="component",customValue:R}=m,A=rC(m);Jh(A,v,{prop:w,dateFormat:S,modelKey:y,keyName:C}),_===""&&(A.fieldValue=R||""),f.push(A)}for(let p=f.length-1;p>=0;p--){const m=f[p];m.globalCondition||qh(f).find(v=>v.alias===m.alias&&v.globalCondition)&&f.splice(p,1)}return f};function rC(i){const{id:t,keyName:e,conditionLabel:n,conditionKey:o,conditionValueType:r,prop:s,rule:l="NONE",notGlobal:a=!1,indexCode:h,typeGuid:d,indexCodeNum:u,dataType:c="component"}=i;let g=e||t;g&&s&&(g+=`-${s}`);let f=l;return f==="NONE"&&(f=["startTime","endTime"].includes(s)?s==="startTime"?"GREATER_EQUAL":"LESS_EQUAL":e!=null&&e.includes("startTime")?s==="GREATER_EQUAL":e!=null&&e.includes("endTime")?s==="LESS_EQUAL":"EQUAL"),t==="PARENT"&&(g=i.modelKey,g&&s&&(g+=`-${s}`),f=l),{rule:f,label:n,fieldName:o,fieldValue:"",valueType:r,alias:g,globalCondition:!a,indexCode:h,typeGuid:d,indexCodeNum:u,dataType:c}}function sC(i){if(i!=null&&i.length)for(const t of i)if(t!=null&&t.conditions)sC(t.conditions);else{const{id:e,keyName:n,prop:o,modelKey:r,format:s,dataType:l="component",customValue:a}=t,h=rC(t);Jh(h,e,{prop:o,dateFormat:s,modelKey:r,keyName:n}),l===""&&(h.fieldValue=a||"");for(const d in h)t[d]=h[d];for(const d of gP)delete t[d]}}function Jh(i,t,e){const{prop:n="",dateFormat:o="",modelKey:r="",keyName:s="",operateValue:l,operateMode:a,operateType:h}=e||{},d=r||s;if(t==="PARENT"&&d&&n){const C=window.config.record;let w=n,S=o;const y=n.match(/\{(.+?)\}/g);if(y!=null&&y.length){const _=y[0].slice(1,-1).trim();w=n.replace(y[0],""),S=_,i.dateFormat=S}if(C&&C[d]){const _=ji(C[d][w]);$n.isDayjs(_)?i.fieldValue=_.format(S||"YYYY-MM-DD"):i.fieldValue=_}return}const u=Zh(t)||{},{value:c,format:g="YYYY-MM-DD",type:f="",useCurrentTime:p,RECORD:m}=u||{},v=o||g;if(_i(f,"date")){let C;if(C=p?c?ji(c):$n():ji(c),typeof C=="string"&&(C=$n(C)),l&&a&&h)switch(h){case"add":C=C.add(l,a);break;case"minus":C=C.subtract(l,a)}i.fieldValue=C==null?void 0:C.format(v),i.dateFormat=v}else if(_i(f,"rangepicker")){let C=n;if(!n){const S=s&&s.split("-");S!=null&&S.length&&(C=S[S.length-1])}if(!C)return;let w=null;if(ji(u[C])&&(w=$n(ji(u[C]))),l&&a&&h){if(l==="rangeValue"){if(u.startTime&&u.endTime){const S=ji(u.endTime).diff(ji(u.startTime),a)+1;switch(h){case"add":w=w&&w.add(S,a);break;case"minus":w=w&&w.subtract(S,a)}}}else if(!isNaN(+l))switch(h){case"add":w=w&&w.add(l,a);break;case"minus":w=w&&w.subtract(l,a)}}if(w&&(i.fieldValue=w==null?void 0:w.format(v)),C==="rangeValue"&&u.startTime&&u.endTime){const S=function(y){const _=y.split("-");let R="";if(_!=null&&_.length)switch(_[_.length-1]){case"YYYY":R="year";break;case"MM":R="month";break;case"DD":R="day"}return R}(v);S&&(i.fieldValue=ji(u.endTime).diff(ji(u.startTime),S)+1)}i.dateFormat=v}else _i(f,cP)?i.fieldValue=r&&m?m[r]:!r&&m?m.value:ji(c):i.fieldValue=ji(c)}const Qh=i=>{var t;if(i){const e=Array.isArray(i)?Xh(i):[Xh(i)];let n="",o=[];const r=[],s=[],l=[];for(const a of e){if(a.defaultCode&&(a.label=a.columnName,delete a.defaultCode),a.type==="CUSTOM"&&(o=a.customOrderColumns),n=a.type,r.push(a.label),(t=a.columnName)===null||t===void 0?void 0:t.includes("_ecanrepeat_")){const h=a.columnName.split("_ecanrepeat_");s.push(h[0])}else s.push(a.columnName);l.push(a.order)}return n!=="CUSTOM"&&(r==null?void 0:r.length)>1&&(n="COMBINATION"),n==="CUSTOM"?{label:r.join(","),columnName:s.join(","),type:n,customOrderColumns:o}:{label:r.join(","),columnName:s.join(","),order:l.join(","),type:n}}return i},lC=i=>{const{sortCpnts:t=[]}=i;let e,n="";for(const o of t){const r=Zh(o)||{},{type:s,RECORD:l}=r;if(_i(s,"image")&&_i(l==null?void 0:l.value,["asc","desc"])){n=l.value.toUpperCase();break}}return n&&(e={label:i.label,columnName:i.name,order:n,type:"NORMAL"}),e},aC=(i,t={})=>{var e,n,o,r,s,l,a,h;const{graphicConfig:d,type:u,globalModel:c,isGroupTable:g=!1}=i;c&&(nC=c);const f=_i(u,"pivottable");let p,{source:m,dataViewId:v,plugin:C="1",layer:w,chartType:S,classificationList:y=[],rowHeaderList:_=[],dimensionList:R=[],seriesList:A=[],leftAxisList:x=[],rightAxisList:T=[],queryColumnList:M=[],indexLibColumns:B=[],indicators:H=[],controlList:F=[],formFields:P={},variableList:E=[],variableConditions:L=[],dataSourceId:I="",idxLibMode:k,preview:D=!1,edvDataSetId:O,compositeIndicator:N}=d||{},W=[];if((d==null?void 0:d.pageMode)==="design"?(W=((e=d.sqlConditions)!==null&&e!==void 0?e:[]).map(lt=>{const ft={};if(wn(lt,"globalCondition")||lt.join||(ft.globalCondition=!0),!lt.join){const dt=lt.rule||"EQUAL";ft.rule=dt==="NONE"?"EQUAL":dt}return Object.assign(Object.assign({},lt),ft)}),L!=null&&L.length&&(W=W.concat(L))):(W=fP(d),E!=null&&E.length&&(W=W.concat(function(lt){const ft=[];if(lt!=null&<.length){for(const dt of lt)if(dt.variableName){const at={variateName:dt.variableName,globalCondition:!1,valueType:dt.variableType,alias:dt.keyName||""};Jh(at,dt.id,{dateFormat:dt.format,prop:dt.dateTypeValue,keyName:dt.keyName,operateType:dt.operateType,operateMode:dt.operateMode,operateValue:dt.operateValue}),dt.dataType===""&&(at.fieldValue=dt.variableValue),dt.format&&(at.dateFormat=dt.format),dt.label&&(at.label=dt.label),ft.push(at)}}return ft}(E)))),W==null?void 0:W.length){const lt=W.filter(dt=>dt.globalCondition),ft=W.filter(dt=>!dt.globalCondition);(lt==null?void 0:lt.length)>1&&(W=[{join:"&&",conditions:lt},...ft])}W!=null&&W.length&&(W=zr(W,"1")),w==null&&(w=_i(u,["table","card"])||_i(u,["list","circulate"])&&(y==null?void 0:y.length)>1?"1":_i(u,["select","checkbox","radio"])?"3":_i(u,["indexPanel"])?"4":"2"),_i(u,["indexPanel"])&&(C="3");const j=[];let G,Y="";if(Array.isArray(y)&&y.length>0&&(!["ecanList","ecanCirculate"].includes(u)||(y==null?void 0:y.length)===1)){const lt=y.length;for(let ft=0;ft<lt;ft++){const dt=y[ft]||{},{label:at="",name:St="",show:X=!1,sort:xt,customGroup:Nt,conditions:mt,dateFormat:Rt,typeGuid:te="",truncations:qt=[]}=dt;if(X||lt===1){Y=te,p={label:at.trim(),columnName:St,show:X,sort:lC(dt)||Qh(xt)||xt,customGroup:Nt,conditions:zr(mt),typeGuid:te},Rt&&(p.dateFormat=Rt),St!=="the_date"||p.dateFormat||(p.dateFormat="YYYY-MM-DD");const st={};if(Array.isArray(qt)&&qt.length>0){const ae=qt.length;for(let we=0;we<ae;we++){const ee=qt[we]||{},{rule:Se="",num:Kt=0,name:_t=""}=ee;Se&&Kt&&(st.num=Kt,st.rule=Se,_t&&(st.otherGroupName=_t))}}if(!((n=Object.keys(st))===null||n===void 0)&&n.length&&(p.truncation=st),!_i(u,["scatter","valueline"]))break;j.push(p)}}}if(Array.isArray(A)&&A.length>0){const lt=A.length;for(let ft=0;ft<lt;ft++){const dt=A[ft]||{},{label:at="",name:St="",show:X=!1,sort:xt,customGroup:Nt,conditions:mt,typeGuid:Rt,dateFormat:te=""}=dt;if(X||lt===1){G={label:at.trim(),columnName:St,show:X,sort:Qh(xt),customGroup:Nt,conditions:zr(mt),typeGuid:Rt},te?G.dateFormat=te:St==="the_date"&&(G.dateFormat="YYYY-MM-DD");break}}}const U=[];x==null||x.forEach(lt=>{lt.location="LEFT",U.push(wf(lt,p))}),T==null||T.forEach(lt=>{lt.location="RIGHT",U.push(wf(lt,p))});let $=H;t!=null&&t.pivotTableCal&&($=((o=t.pivotTableCal)===null||o===void 0?void 0:o.indicators)||[]),$==null||$.forEach(lt=>{lt.location="LEFT",U.push(wf(lt,p))});const Q=[];["ecanList","ecanCirculate"].includes(u)&&(y==null?void 0:y.length)>1&&(M=y),t!=null&&t.pivotTableCal&&(M=((r=t.pivotTableCal)===null||r===void 0?void 0:r.dimensions)||[]),M==null||M.forEach(lt=>{const{label:ft,name:dt,location:at,show:St,indexCode:X,sort:xt,typeGuid:Nt,indexCodeNum:mt,dateFormat:Rt,conditions:te}=lt;let qt=Qh(xt);if(t.sort){const{field:ae,order:we}=t.sort;let ee=U.find(Se=>Se.label===ae);ee||ft!==ae||(ee=lt),ee&&(qt={columnName:ee.columnName,label:t.sort.field,order:we.toUpperCase(),type:"NORMAL"})}const st={label:ft,columnName:dt,location:at,show:St,sort:qt,calcType:"COLUMN",hrpIndexCode:X,hrpIndexCodeNum:mt,conditions:zr(te),typeGuid:Nt};Rt&&(st.dateFormat=Rt),dt!=="the_date"||st.dateFormat||(st.dateFormat="YYYY-MM-DD"),Q.push(st)});const gt=[];["ecanTable"].includes(u)&&d.isIndexSet&&B.forEach(lt=>{const ft={label:lt.label,calcType:lt.calcType,show:lt.show};lt.formula&&(ft.formula=lt.formula),gt.push(ft)});let vt=[],At=[];if(Array.isArray(_)&&_.length>0?At=_:Array.isArray(R)&&R.length>0&&(At=R),At==null?void 0:At.length){const lt=At.length;for(let ft=0;ft<lt;ft++){const dt=At[ft]||{},{label:at="",name:St="",show:X=!1,sort:xt,customGroup:Nt,conditions:mt,truncations:Rt,typeGuid:te="",dateFormat:qt}=dt;let st=Qh(xt);if(t.sort){const{field:ee,order:Se}=t.sort;let Kt=U.find(_t=>_t.label===ee);Kt||dt.label!==ee||(Kt=dt),Kt&&(st={columnName:Kt.columnName,label:t.sort.field,order:Se.toUpperCase(),type:"NORMAL"})}const ae={label:at.trim(),columnName:St,show:X,sort:st,customGroup:Nt,conditions:zr(mt),typeGuid:te};qt&&(ae.dateFormat=qt),St!=="the_date"||ae.dateFormat||(ae.dateFormat="YYYY-MM-DD");const we={};if(Array.isArray(Rt)&&Rt.length>0){const ee=Rt.length;for(let Se=0;Se<ee;Se++){const Kt=Rt[Se]||{},{rule:_t="",num:Bt=0,name:Ft=""}=Kt;_t&&Bt&&(we.num=Bt,we.rule=_t,Ft&&(we.otherGroupName=Ft))}}!((s=Object.keys(we))===null||s===void 0)&&s.length&&(ae.truncation=we),vt.push(ae)}}let J,et=[];const Ct=[];if(t!=null&&t.pivotTableCal){let lt=[];const{calc:ft=[],filter:dt=[],truncations:at=[],sorts:St=[],aggregateMethod:X=[],rowDimensionKeys:xt=[],colDimensionKeys:Nt=[]}=t.pivotTableCal;if(U.push(...ft),dt==null?void 0:dt.length){const mt=function Rt(te){const qt=[];for(const st of te)st.conditions?qt.push(...Rt(st.conditions)):st.conditionKey==="the_date"&&qt.push(st);return qt}(F);for(const Rt of dt){const{type:te}=Rt,qt=hb(Rt,["type"]);te==="indicators"?lt=U:te==="dimension"&&(lt=Q);const st=lt.find(ae=>ae.columnName===Rt.fieldName&&ae.label===Rt.label);if(st){if(te==="indicators")st.filter={rule:qt.rule,fieldValue:qt.fieldValue};else if(te==="dimension"){let ae=!0;qt.fieldName==="the_date"&&(mt==null?void 0:mt.length)===2&&(ae=!1,Ct.push(qt)),ae&&(st.conditions||(st.conditions=[]),st.conditions.push(qt))}}}}if(at!=null&&at.length)for(const mt of at){const Rt=Q.find(te=>te.columnName===mt.key);Rt&&(Rt.truncation={num:mt.num,rule:mt.rule})}if(St!=null&&St.length)for(const mt of St){const{fieldType:Rt,columnData:te}=mt,qt=hb(mt,["fieldType","columnData"]);Rt==="indicators"?(lt=U,J=te):Rt==="dimension"&&(lt=Q);const st=lt.find(ae=>ae.label===qt.label);st&&(st.sort=Object.assign(Object.assign({},qt),{columnName:st.columnName}))}if(!((l=Object.keys(X))===null||l===void 0)&&l.length)for(const mt in X){const Rt=Q.find(te=>te.label===mt);Rt&&(!((a=X[mt])===null||a===void 0)&&a.length)&&(Rt.aggregateMethod=X[mt])}vt=[],et=[];for(const mt of Q)xt.includes(mt.columnName)?vt.push(mt):Nt.includes(mt.columnName)&&et.push(mt)}if(_i(u,["text","proportion","counter"])?S="zb":_i(u,["valueline"])?S="valueline":_i(u,["indexPanel"])&&(S="indexPanel"),g||u==="card"){if(vt.length===0||U.length===0)return;S="grouptable"}else if(w==="1"&&!Q.length&&!gt.length||["2","4"].includes(w)&&U.length===0||!(w!=="3"||(Y||m==="EDV_DATA_SET")&&P.labelField&&P.valueField)||w==="3"&&u==="ecanDataSelect"&&U.length===0)return;let ct;if(R!=null&&R.length&&(w="1",S="grouptable"),!_i(u,["scatter","valueline"])&&((h=Object.keys(P))===null||h===void 0?void 0:h.length)){const lt=qh(F).find(dt=>dt.conditionKey==="parentCode"),ft={};if(lt){const dt=Zh(lt.id)||{};if(!(dt!=null&&dt.itemCodes))return;ft.parentItemCodes=dt.itemCodes}u==="ecanDataSelect"&&(ft.indicatorList=U.filter(dt=>dt.show)),m==="EDV_DATA_SET"&&(ft.edvDataSetId=O),p.sort&&(ft.sort=p.sort),ct=Object.assign({url:"/diagram/formData",source:m,dataViewId:v,plugin:"4",layer:w,chartType:"normalSelect",rangeIndexTypeGuid:Y,type:u==="ecanDataSelect"?"normalSelectData":"normalSelect",labelField:P.labelField,valueField:P.valueField,sqlConditions:W,idxLibMode:"WITH_DATE_DIM_TABLE",dataSourceId:I,keyName:i.keyName},ft)}else{let lt={};lt=_i(u,["scatter","valueline"])?{classifications:j}:{classification:p},gt!=null&>.length&&(lt.indexLibColumns=gt,lt.isIndexSet=!0),_i(u,"table")&&d.isIndexSet&&(lt.compositeIndicator=N);const ft=W.map(dt=>{const{fieldValue:at}=dt,St={};return at&&Array.isArray(at)&&(St.fieldValue=JSON.stringify(at)),Object.assign(Object.assign({},dt),St)});Ct!=null&&Ct.length&&function dt(at){for(const St of at)if(St.sqlConditions)dt(St.sqlConditions);else if(St.fieldName==="the_date"){const X=Ct.find(xt=>xt.prop===St.prop);X&&(St.fieldValue=X.fieldValue)}}(ft),ct=Object.assign({url:"/diagram",source:m,dataViewId:v,plugin:f?"5":C,layer:w,chartType:f?"pivot-table":S,series:G,indicatorList:U,queryColumns:g?[]:Q,pageFlag:!0,edvDataSetId:O||"",sqlConditions:ft,idxLibMode:k,dataSourceId:I,preview:D,rowHeaders:vt,keyName:i.keyName,columnData:J,columnHeaders:et},lt)}return ct};function pP(i,t){if(i==="increase")return t=t||"#f00f00",`<svg t="1718270975854" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1021" width="64" height="64"><path d="M128 438.848h256C384 743.68 322.112 871.68 128 1024c277.312-60.864 512-158.464 512-585.152h256L512 0 128 438.848z" fill="${t}" p-id="1022"></path></svg>`;if(i==="decline")return t=t||"#00FF88",`<svg t="1718271009759" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1172" width="64" height="64"><path d="M849.5 576.29375l-225 0C624.5 308.375 678.89375 195.875 849.5 62.00000001c-243.73125 53.49375-449.99999999 139.275-450 514.29374999l-225 0L512 961.99999999 849.5 576.29375z" fill="${t}" p-id="1173"></path></svg>`}const mP=i=>({DIM:"维度",BUILT_IN_DIM:"维度",IDX:"指标",BUILT_IN_IDX:"指标",FIELD:"数据集"})[i],vP=i=>({0:"文本",1:"数值",2:"日期"})[i],bP=i=>i==="0"?"手工录入":i==="1"?"系统取数":i==="2"?"运算加工":"",CP=i=>{let t="";switch(i){case"1":t="人力系统";break;case"2":t="绩效系统";break;case"3":t="预算系统";break;case"4":t="财务系统";break;case"5":t="成本系统";break;case"6":t="物流系统";break;case"7":t="固定资产系统";break;case"8":t="OA办公系统";break;case"9":t="电子档案系统";break;case"10":t="个人收入系统";break;case"11":t="奖金二次分配系统";break;case"12":t="财务管理系统";break;case"13":t="报销系统";break;case"14":t="科研管理系统";break;case"15":t="审计系统";break;case"16":t="分组器系统";break}return t},yP=i=>i==="0"?"指标库":i==="1"?"视图":i==="2"?"数据集":"其他";function _P(i){i=i.replace(/^#/,"");const t=parseInt(i.substr(0,2),16)/255,e=parseInt(i.substr(2,2),16)/255,n=parseInt(i.substr(4,2),16)/255,o=Math.max(t,e,n),r=Math.min(t,e,n);let s=(o+r)/2,l=s;const a=s;if(o===r)s=l=0;else{const h=o-r;switch(l=a>.5?h/(2-o-r):h/(o+r),o){case t:s=(e-n)/h+(e<n?6:0);break;case e:s=(n-t)/h+2;break;case n:s=(t-e)/h+4;break}s/=6}return[s,l,a]}function hC(i,t){let[e,n,o]=_P(i);return o=Math.min(1,Math.max(0,o+t/100)),wP(e,n,o)}function wP(i,t,e){let n,o,r;if(t===0)n=o=r=e;else{const l=(d,u,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<.16666666666666666?d+(u-d)*6*c:c<.5?u:c<.6666666666666666?d+(u-d)*(.6666666666666666-c)*6:d),a=e<.5?e*(1+t):e+t-e*t,h=2*e-a;n=l(h,a,i+1/3),o=l(h,a,i),r=l(h,a,i-1/3)}const s=l=>Math.round(l*255).toString(16).padStart(2,"0");return`#${s(n)}${s(o)}${s(r)}`}function SP(i){let t="";return["IDX","BUILT_IN_IDX"].includes(i)?t="indicator":["DIM","BUILT_IN_DIM"].includes(i)&&(t="dimension"),t}class ti{static GenAutoIncrementId(){return ti.auto_increment_id++}}ti.auto_increment_id=0;class $t{constructor(t){this.id=ti.GenAutoIncrementId(),this.registry=t}}const td="named",dC="inject",uC="multi_inject",cC="inversify:tagged",gC="inversify:paramtypes";class Sf{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===td?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}const Ls=function(i){var t;return function(e){const n=typeof Symbol=="function",o=n&&Symbol.toPrimitive!==void 0?Symbol.toPrimitive:"@@toPrimitive",r=Object.getPrototypeOf(Function),s=(typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),l=new WeakMap;function a(P,E,L,I){if(!_(L))throw new TypeError;return v(P,E,L,I)}function h(P,E,L){if(!_(E))throw new TypeError;return w(L)||(L=M(L)),g(P,E,L)}function d(P,E,L){if(!_(E))throw new TypeError;return w(L)||(L=M(L)),f(P,E,L)}function u(P,E,L){if(!_(E))throw new TypeError;return w(L)||(L=M(L)),p(P,E,L)}function c(P,E,L){let I=l.get(P);if(w(I)){if(!L)return;I=new s,l.set(P,I)}let k=I.get(E);if(w(k)){if(!L)return;k=new s,I.set(E,k)}return k}function g(P,E,L){if(f(P,E,L))return!0;const I=F(E);return!S(I)&&g(P,I,L)}function f(P,E,L){const I=c(E,L,!1);return!w(I)&&x(I.has(P))}function p(P,E,L){if(f(P,E,L))return m(P,E,L);const I=F(E);return S(I)?void 0:p(P,I,L)}function m(P,E,L){const I=c(E,L,!1);if(!w(I))return I.get(P)}function v(P,E,L,I){c(L,I,!0).set(P,E)}function C(P){if(P===null)return 1;switch(typeof P){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return P===null?1:6;default:return 6}}function w(P){return P===void 0}function S(P){return P===null}function y(P){return typeof P=="symbol"}function _(P){return typeof P=="object"?P!==null:typeof P=="function"}function R(P,E){switch(C(P)){case 0:case 1:case 2:case 3:case 4:case 5:return P}const L=E===3?"string":E===5?"number":"default",I=H(P,o);if(I!==void 0){const k=I.call(P,L);if(_(k))throw new TypeError;return k}return A(P,L==="default"?"number":L)}function A(P,E){if(E==="string"){const L=P.toString;if(B(L)){const k=L.call(P);if(!_(k))return k}const I=P.valueOf;if(B(I)){const k=I.call(P);if(!_(k))return k}}else{const L=P.valueOf;if(B(L)){const k=L.call(P);if(!_(k))return k}const I=P.toString;if(B(I)){const k=I.call(P);if(!_(k))return k}}throw new TypeError}function x(P){return!!P}function T(P){return""+P}function M(P){const E=R(P,3);return y(E)?E:T(E)}function B(P){return typeof P=="function"}function H(P,E){const L=P[E];if(L!=null){if(!B(L))throw new TypeError;return L}}function F(P){const E=Object.getPrototypeOf(P);if(typeof P!="function"||P===r||E!==r)return E;const L=P.prototype,I=L&&Object.getPrototypeOf(L);if(I==null||I===Object.prototype)return E;const k=I.constructor;return typeof k!="function"||k===P?E:k}e("defineMetadata",a),e("hasMetadata",h),e("hasOwnMetadata",d),e("getMetadata",u)}((t=i,function(e,n){typeof t[e]!="function"&&Object.defineProperty(t,e,{configurable:!0,writable:!0,value:n})})),i}({});function xP(i,t,e,n){const o=[n];let r={};Ls.hasOwnMetadata(i,t)&&(r=Ls.getMetadata(i,t));let s=r[e];s===void 0&&(s=[]),s.push(...o),r[e]=s,Ls.defineMetadata(i,r,t)}function AP(i,t,e,n){xP(cC,i,e.toString(),n)}function fC(i){return(t,e,n)=>{AP(t,e,n,i)}}function pC(i){return t=>(e,n,o)=>fC(new Sf(i,t))(e,n,o)}const re=pC(dC),mC=pC(uC);function wt(){return function(i){return Ls.defineMetadata(gC,null,i),i}}function ui(i){return fC(new Sf(td,i))}const Wr={Singleton:"Singleton",Transient:"Transient"},lr={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};class xf{constructor(t,e){this.id=ti.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=lr.Invalid,this.constraint=n=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new xf(this.serviceIdentifier,this.scope);return t.activated=t.scope===Wr.Singleton&&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 RP{getConstructorMetadata(t){return{compilerGeneratedMetadata:Ls.getMetadata(gC,t),userGeneratedMetadata:Ls.getMetadata(cC,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const TP=(i=>t=>{const e=n=>{if(n==null)return!1;if(n.key===i&&n.value===t)return!0;if(n.constructorArgsMetadata==null)return!1;const o=n.constructorArgsMetadata;for(let r=0;r<o.length;r++)if(o[r].key===i&&o[r].value===t)return!0;return!1};return e.metaData=new Sf(i,t),e})(td);class ed{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Wr.Singleton,this}inTransientScope(){return this._binding.scope=Wr.Transient,this}whenTargetNamed(t){return this._binding.constraint=TP(t),this}}class MP{constructor(t){this._binding=t}to(t){return this._binding.type=lr.Instance,this._binding.implementationType=t,new ed(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=lr.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new ed(this._binding)}toConstantValue(t){return this._binding.type=lr.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Wr.Singleton,new ed(this._binding)}toFactory(t){return this._binding.type=lr.Factory,this._binding.factory=t,this._binding.scope=Wr.Singleton,new ed(this._binding)}toService(t){this.toDynamicValue(e=>e.container.get(t))}}let BP=class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Wr.Transient,this.options=e,this.id=ti.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new RP}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 o=this._getNotAllArgs(t,!1,e,n);return this._get(o)}getNamed(t,e){return this.getTagged(t,td,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,n=new xf(t,e),o=this._bindingDictionary.get(t)||[];return o.push(n),this._bindingDictionary.set(t,o),new MP(n)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(s,l)=>{s._binding.moduleId=l},e=s=>l=>{const a=this.bind(l);return t(a,s),a},n=()=>s=>this.unbind(s),o=()=>s=>this.isBound(s),r=s=>l=>{const a=this.rebind(l);return t(a,s),a};return s=>({bindFunction:e(s),isboundFunction:o(),rebindFunction:r(s),unbindFunction:n(),unbindAsyncFunction:l=>null})}_getNotAllArgs(t,e,n,o){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:o}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter(n=>n.constraint(t)).forEach(n=>{e.push(this._resolveFromBinding(n))}),t.isMultiInject||e.length!==1?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:n}=this._metadataReader.getConstructorMetadata(e),o=Object.keys(n),r=[];for(let s=0;s<o.length;s++){const l=n[s],a={};l.forEach(g=>{a[g.key]=g.value});const h={inject:a[dC],multiInject:a[uC]},d=h.inject||h.multiInject,u={serviceIdentifier:d,constructorArgsMetadata:l},c={injectIdentifier:d,metadata:l,bindings:this._bindingDictionary.get(d).filter(g=>g.constraint(u))};r.push(c)}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case lr.ConstantValue:case lr.Function:e=t.cache;break;case lr.Instance: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(e=>e.bindings.length>1?e.bindings.map(n=>this._resolveFromBinding(n)):this._resolveFromBinding(e.bindings[0]))}_saveToScope(t,e){t.scope===Wr.Singleton&&(t.cache=e,t.activated=!0)}};const ei=Symbol("ContributionProvider");class vC{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function Li(i,t){i(ei).toDynamicValue(({container:e})=>new vC(t,e)).inSingletonScope().whenTargetNamed(t)}function PP(i,t){i(ei).toDynamicValue(({container:e})=>new vC(t,e)).whenTargetNamed(t)}class HP{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const n=typeof t=="string"?t.trim():t.name;n&&(this.taps=this.taps.filter(o=>!(o.name===n&&(!e||o.fn===e))))}_parseOptions(t,e,n){let o;if(typeof e=="string")o={name:e.trim()};else if(typeof e!="object"||e===null)throw new Error("Invalid tap options");if(typeof o.name!="string"||o.name==="")throw new Error("Missing name for tap");return o=Object.assign({type:t,fn:n},o),o}_tap(t,e,n){this._insert(this._parseOptions(t,e,n))}_insert(t){let e;typeof t.before=="string"?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;typeof t.stage=="number"&&(n=t.stage);let o=this.taps.length;for(;o>0;){o--;const r=this.taps[o];this.taps[o+1]=r;const s=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(!(s>n)){o++;break}}this.taps[o]=t}}class qi extends HP{call(...t){this.taps.map(e=>e.fn).forEach(e=>e(...t))}}const id=Symbol.for("EnvContribution"),Af=Symbol.for("VGlobal");var EP=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},kP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},bC=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Rf=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(i){this._env||this.setEnv("browser"),this.envContribution.supportEvent=i}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(i){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=i}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(i){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=i}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(i){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=i}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(i){this._env||this.setEnv("browser"),this.envContribution.applyStyles=i}constructor(i){this.contributions=i,this.id=ti.GenAutoIncrementId(),this.hooks={onSetEnv:new qi(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(i){const t=[];if(this.contributions.getContributions().forEach(e=>{const n=e.configure(this,i);n&&n.then&&t.push(n)}),t.length)return Promise.all(t)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(i,t){if(t&&t.force===!0||this._env!==i)return this.deactiveCurrentEnv(),this.activeEnv(i,t)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(i,t){const e=this._env;this._env=i;const n=this.bindContribution(t);if(n&&n.then)return n.then(()=>{this.envParams=t,this.hooks.onSetEnv.call(e,i,this)});this.envParams=t,this.hooks.onSetEnv.call(e,i,this)}setActiveEnvContribution(i){this.envContribution=i}createCanvas(i){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(i)}createOffscreenCanvas(i){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(i)}releaseCanvas(i){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(i)}addEventListener(i,t,e){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(i,t,e)}removeEventListener(i,t,e){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(i,t,e)}dispatchEvent(i){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(i)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(i){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(i):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(i,t){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(i,t):null}loadImage(i){return this._env||this.setEnv("browser"),this.envContribution.loadImage(i)}loadSvg(i){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(i)}loadJson(i){return this._env||this.setEnv("browser"),this.envContribution.loadJson(i)}loadArrayBuffer(i){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(i)}loadBlob(i){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(i)}isChrome(){return this._isChrome!=null||(this._env||this.setEnv("browser"),this._isChrome=this._env==="browser"&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return this._isSafari!=null||(this._env||this.setEnv("browser"),this._isSafari=this._env==="browser"&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(i){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(i)}removeDom(i){return this._env||this.setEnv("browser"),this.envContribution.removeDom(i)}createDom(i){return this._env||this.setEnv("browser"),this.envContribution.createDom(i)}updateDom(i,t){return this._env||this.setEnv("browser"),this.envContribution.updateDom(i,t)}getElementTop(i,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(i,t)}getElementLeft(i,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(i,t)}getElementTopLeft(i,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(i,t)}};Rf=EP([wt(),bC(0,re(ei)),bC(0,ui(id)),kP("design:paramtypes",[Object])],Rf);var LP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Nr={},FP={get exports(){return Nr},set exports(i){Nr=i}};(function(i){var t=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function o(a,h,d){this.fn=a,this.context=h,this.once=d||!1}function r(a,h,d,u,c){if(typeof d!="function")throw new TypeError("The listener must be a function");var g=new o(d,u||a,c),f=e?e+h:h;return a._events[f]?a._events[f].fn?a._events[f]=[a._events[f],g]:a._events[f].push(g):(a._events[f]=g,a._eventsCount++),a}function s(a,h){--a._eventsCount===0?a._events=new n:delete a._events[h]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],d,u;if(this._eventsCount===0)return h;for(u in d=this._events)t.call(d,u)&&h.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(d)):h},l.prototype.listeners=function(h){var d=e?e+h:h,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var c=0,g=u.length,f=new Array(g);c<g;c++)f[c]=u[c].fn;return f},l.prototype.listenerCount=function(h){var d=e?e+h:h,u=this._events[d];return u?u.fn?1:u.length:0},l.prototype.emit=function(h,d,u,c,g,f){var p=e?e+h:h;if(!this._events[p])return!1;var m=this._events[p],v=arguments.length,C,w;if(m.fn){switch(m.once&&this.removeListener(h,m.fn,void 0,!0),v){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,d),!0;case 3:return m.fn.call(m.context,d,u),!0;case 4:return m.fn.call(m.context,d,u,c),!0;case 5:return m.fn.call(m.context,d,u,c,g),!0;case 6:return m.fn.call(m.context,d,u,c,g,f),!0}for(w=1,C=new Array(v-1);w<v;w++)C[w-1]=arguments[w];m.fn.apply(m.context,C)}else{var S=m.length,y;for(w=0;w<S;w++)switch(m[w].once&&this.removeListener(h,m[w].fn,void 0,!0),v){case 1:m[w].fn.call(m[w].context);break;case 2:m[w].fn.call(m[w].context,d);break;case 3:m[w].fn.call(m[w].context,d,u);break;case 4:m[w].fn.call(m[w].context,d,u,c);break;default:if(!C)for(y=1,C=new Array(v-1);y<v;y++)C[y-1]=arguments[y];m[w].fn.apply(m[w].context,C)}}return!0},l.prototype.on=function(h,d,u){return r(this,h,d,u,!1)},l.prototype.once=function(h,d,u){return r(this,h,d,u,!0)},l.prototype.removeListener=function(h,d,u,c){var g=e?e+h:h;if(!this._events[g])return this;if(!d)return s(this,g),this;var f=this._events[g];if(f.fn)f.fn===d&&(!c||f.once)&&(!u||f.context===u)&&s(this,g);else{for(var p=0,m=[],v=f.length;p<v;p++)(f[p].fn!==d||c&&!f[p].once||u&&f[p].context!==u)&&m.push(f[p]);m.length?this._events[g]=m.length===1?m[0]:m:s(this,g)}return this},l.prototype.removeAllListeners=function(h){var d;return h?(d=e?e+h:h,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=e,l.EventEmitter=l,i.exports=l})(FP);const Fs=(i,t)=>Object.prototype.toString.call(i)===`[object ${t}]`,ci=(i,t=!1)=>t?typeof i=="boolean":i===!0||i===!1||Fs(i,"Boolean"),he=i=>typeof i=="function",Pt=i=>i==null,z=i=>i!=null,ue=i=>{const t=typeof i;return i!==null&&t==="object"||t==="function"},IP=i=>typeof i=="object"&&i!==null,Is=function(i){if(!IP(i)||!Fs(i,"Object"))return!1;if(Object.getPrototypeOf(i)===null)return!0;let t=i;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(i)===t},je=i=>i===void 0,de=(i,t=!1)=>{const e=typeof i;return t?e==="string":e==="string"||Fs(i,"String")},ot=i=>Array.isArray?Array.isArray(i):Fs(i,"Array"),Tf=function(i){return i!==null&&typeof i!="function"&&Number.isFinite(i.length)},CC=i=>Fs(i,"Date"),ut=(i,t=!1)=>{const e=typeof i;return t?e==="number":e==="number"||Fs(i,"Number")},Te=i=>ut(i)&&Number.isFinite(i),DP=i=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(i),OP=i=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(i),zP=i=>({}).toString.call(i).replace(/^\[object /,"").replace(/]$/,""),WP=Object.prototype,NP=function(i){const t=i&&i.constructor;return i===(typeof t=="function"&&t.prototype||WP)},VP=Object.prototype.hasOwnProperty;function Xt(i){if(Pt(i))return!0;if(Tf(i))return!i.length;const t=zP(i);if(t==="Map"||t==="Set")return!i.size;if(NP(i))return!Object.keys(i).length;for(const e in i)if(VP.call(i,e))return!1;return!0}const gi=(i,t,e)=>{const n=de(t)?t.split("."):t;for(let o=0;o<n.length;o++)i=i?i[n[o]]:void 0;return i===void 0?e:i},jP=Object.prototype.hasOwnProperty,yC=(i,t)=>i!=null&&jP.call(i,t);function ke(i,t,e){let n;if(!z(i)||typeof i!="object"||t&&t(i))return i;const o=ot(i),r=i.length;n=o?new Array(r):typeof i=="object"?{}:ci(i)||ut(i)||de(i)?i:CC(i)?new Date(+i):void 0;const s=o?void 0:Object.keys(Object(i));let l=-1;if(n)for(;++l<(s||i).length;){const a=s?s[l]:l,h=i[a];e&&e.includes(a.toString())?n[a]=h:n[a]=ke(h,t,e)}return n}function _C(i,t,e=!1,n=!1){if(t){if(i===t)return;if(z(t)&&typeof t=="object"){const o=Object(t),r=[];for(const a in o)r.push(a);let{length:s}=r,l=-1;for(;s--;){const a=r[++l];!z(o[a])||typeof o[a]!="object"||n&&ot(i[a])?wC(i,a,o[a]):$P(i,t,a,e,n)}}}}function $P(i,t,e,n=!1,o=!1){const r=i[e],s=t[e];let l=t[e],a=!0;if(ot(s)){if(n)l=[];else if(ot(r))l=r;else if(Tf(r)){l=new Array(r.length);let h=-1;const d=r.length;for(;++h<d;)l[h]=r[h]}}else Is(s)?(l=r??{},typeof r!="function"&&typeof r=="object"||(l={})):a=!1;a&&_C(l,s,n,o),wC(i,e,l)}function wC(i,t,e){(e!==void 0&&!GP(i[t],e)||e===void 0&&!(t in i))&&(i[t]=e)}function GP(i,t){return i===t||Number.isNaN(i)&&Number.isNaN(t)}function Tt(i,...t){let e=-1;const n=t.length;for(;++e<n;)_C(i,t[e],!0);return i}function UP(i,t){if(!i||!Is(i))return i;const e={};return Object.keys(i).forEach(n=>{const o=i[n];let r=!1;t.forEach(s=>{(de(s)&&s===n||s instanceof RegExp&&n.match(s))&&(r=!0)}),r||(e[n]=o)}),e}function SC(i){return Object.prototype.toString.call(i)}function xC(i){return Object.keys(i)}function Zl(i,t,e){if(i===t)return!0;if(typeof i!=typeof t||i==null||t==null)return!1;if(Number.isNaN(i)&&Number.isNaN(t))return!0;if(SC(i)!==SC(t))return!1;if(he(i))return!!(e!=null&&e.skipFunction);if(typeof i!="object")return!1;if(ot(i)){if(i.length!==t.length)return!1;for(let r=i.length-1;r>=0;r--)if(!Zl(i[r],t[r],e))return!1;return!0}if(!Is(i))return!1;const n=xC(i),o=xC(t);if(n.length!==o.length)return!1;n.sort(),o.sort();for(let r=n.length-1;r>=0;r--)if(n[r]!=o[r])return!1;for(let r=n.length-1;r>=0;r--){const s=n[r];if(!Zl(i[s],t[s],e))return!1}return!0}function KP(i){if(!i)return[];if(Object.keys)return Object.keys(i);const t=[];for(const e in i)i.hasOwnProperty(e)&&t.push(e);return t}function YP(i,t,e){const n=KP(t);for(let o=0;o<n.length;o++){const r=n[o];(e?t[r]!=null:i[r]==null)&&(i[r]=t[r])}return i}function Mf(i,t,e=!0){if(i="prototype"in i?i.prototype:i,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames){const n=Object.getOwnPropertyNames(t);for(let o=0;o<n.length;o++){const r=n[o];r!=="constructor"&&(e?t[r]!=null:i[r]==null)&&(i[r]=t[r])}}else YP(i,t,e)}function Bf(i){return z(i)?ot(i)?i:[i]:[]}function Vr(i){if(Tf(i))return i[i.length-1]}const Pf=(i,t)=>{var e;if(i.length===0)return;let n=i[0];for(let o=1;o<i.length;o++){const r=i[o];((e=t==null?void 0:t(r,n))!==null&&e!==void 0?e:r-n>0)&&(n=r)}return n},nd=(i,t)=>{var e;if(i.length===0)return;let n=i[0];for(let o=1;o<i.length;o++){const r=i[o];((e=t==null?void 0:t(r,n))!==null&&e!==void 0?e:r-n<0)&&(n=r)}return n};function Jl(i,t){if(!ot(i)||!ot(t)||i.length!==t.length)return!1;for(let e=0;e<i.length;e++)if(i[e]!==t[e])return!1;return!0}function Hf(i){if(!ot(i))return[i];const t=[];for(const e of i)t.push(...Hf(e));return t}function XP(i,t,e){z(t)||(t=i,i=0),z(e)||(e=1);let n=-1;const o=0|Math.max(0,Math.ceil((t-i)/e)),r=new Array(o);for(;++n<o;)r[n]=i+n*e;return r}function qP(i,t){return i<t?-1:i>t?1:i>=t?0:NaN}function Ql(i){return Number(i)}const ZP=typeof console<"u";function od(i,t,e){const n=[t].concat([].slice.call(e));ZP&&console[i].apply(console,n)}var Gn;(function(i){i[i.None=0]="None",i[i.Error=1]="Error",i[i.Warn=2]="Warn",i[i.Info=3]="Info",i[i.Debug=4]="Debug"})(Gn||(Gn={}));class Me{static getInstance(t,e){return Me._instance&&ut(t)?Me._instance.level(t):Me._instance||(Me._instance=new Me(t,e)),Me._instance}static setInstance(t){return Me._instance=t}static setInstanceLevel(t){Me._instance?Me._instance.level(t):Me._instance=new Me(t)}static clearInstance(){Me._instance=null}constructor(t=Gn.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(n=>n===t);e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach(e=>e(...t))}canLogInfo(){return this._level>=Gn.Info}canLogDebug(){return this._level>=Gn.Debug}canLogError(){return this._level>=Gn.Error}canLogWarn(){return this._level>=Gn.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=Gn.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):od((e=this._method)!==null&&e!==void 0?e:"error","ERROR",t)),this}warn(...t){return this._level>=Gn.Warn&&od(this._method||"warn","WARN",t),this}info(...t){return this._level>=Gn.Info&&od(this._method||"log","INFO",t),this}debug(...t){return this._level>=Gn.Debug&&od(this._method||"log","DEBUG",t),this}}Me._instance=null;function JP(i,t,e=0,n){for(Pt(n)&&(n=i.length);e<n;){const o=e+n>>>1;qP(i[o],t)>0?n=o:e=o+1}return e}const QP=(i,t,e)=>{let n=i,o=t;for(;n<o;){const r=Math.floor((n+o)/2);e(r)>=0?o=r:n=r+1}return n},t2=1e-10,e2=1e-10;function Un(i,t,e=e2,n=t2){const o=n,r=e*Math.max(i,t);return Math.abs(i-t)<=Math.max(o,r)}function AC(i,t,e,n){return i>t&&!Un(i,t,e,n)}function RC(i,t,e,n){return i<t&&!Un(i,t,e,n)}const ta=i=>{let t=null,e=null;return(...n)=>(t&&n.every((o,r)=>o===t[r])||(t=n,e=i(...n)),e)},ln=function(i,t,e){return i<t?t:i>e?e:i},jr=(i,t,e)=>{let[n,o]=i;o<n&&(n=i[1],o=i[0]);const r=o-n;return r>=e-t?[t,e]:(n=Math.min(Math.max(n,t),e-r),[n,n+r])};function Ef(i,t){let e;return i>t&&(e=i,i=t,t=e),n=>Math.max(i,Math.min(t,n))}let rd=!1;try{rd=typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"}catch{rd=!1}function TC(i,t,e){let n,o,r,s,l,a,h=0,d=!1,u=!1,c=!0;const g=!t&&t!==0&&rd;if(typeof i!="function")throw new TypeError("Expected a function");function f(S){const y=n,_=o;return n=o=void 0,h=S,s=i.apply(_,y),s}function p(S,y){return g?(cancelAnimationFrame(l),requestAnimationFrame(S)):setTimeout(S,y)}function m(S){const y=S-a;return a===void 0||y>=t||y<0||u&&S-h>=r}function v(){const S=Date.now();if(m(S))return C(S);l=p(v,function(y){const _=y-h,R=t-(y-a);return u?Math.min(R,r-_):R}(S))}function C(S){return l=void 0,c&&n?f(S):(n=o=void 0,s)}function w(...S){const y=Date.now(),_=m(y);if(n=S,o=this,a=y,_){if(l===void 0)return function(R){return h=R,l=p(v,t),d?f(R):s}(a);if(u)return l=p(v,t),f(a)}return l===void 0&&(l=p(v,t)),s}return t=+t||0,ue(e)&&(d=!!e.leading,u="maxWait"in e,u&&(r=Math.max(Te(e.maxWait)?e.maxWait:0,t)),c="trailing"in e?!!e.trailing:c),w.cancel=function(){l!==void 0&&function(S){if(g)return cancelAnimationFrame(S);clearTimeout(S)}(l),h=0,n=a=o=l=void 0},w.flush=function(){return l===void 0?s:C(Date.now())},w.pending=function(){return l!==void 0},w}rd=!1;function MC(i,t,e){let n=!0,o=!0;if(typeof i!="function")throw new TypeError("Expected a function");return ue(e)&&(n="leading"in e?!!e.leading:n,o="trailing"in e?!!e.trailing:o),TC(i,t,{leading:n,trailing:o,maxWait:t})}function sd(i,t){return e=>i*(1-e)+t*e}function i2(i,t){return function(e){return Math.round(i*(1-e)+t*e)}}function n2(i,t){const e=i.valueOf(),n=t.valueOf(),o=new Date;return r=>(o.setTime(e*(1-r)+n*r),o)}const Le=1e-12,Be=Math.PI,Sn=Be/2,Ri=2*Be,ce=2*Math.PI,_e=Math.abs,Ce=Math.atan2,ii=Math.cos,ar=Math.max,Fi=Math.min,We=Math.sin,Kn=Math.sqrt,Ds=Math.pow;function o2(i){return i>1?0:i<-1?Be:Math.acos(i)}function BC(i){return i>=1?Sn:i<=-1?-Sn:Math.asin(i)}function PC(i,t,e,n,o){let r=e,s=n;return typeof i=="number"&&typeof e=="number"&&(r=(1-o)*i+o*e),typeof t=="number"&&typeof n=="number"&&(s=(1-o)*t+o*n),{x:r,y:s}}function r2(i,t){return i[0]*t[1]-i[1]*t[0]}class Xe{constructor(t=0,e=0,n,o){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=n,this.y1=o}clone(){return new Xe(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 ut(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return ut(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 Ho{static distancePP(t,e){return Kn(Ds(t.x-e.x,2)+Ds(t.y-e.y,2))}static distanceNN(t,e,n,o){return Kn(Ds(t-n,2)+Ds(e-o,2))}static distancePN(t,e,n){return Kn(Ds(e-t.x,2)+Ds(n-t.y,2))}static pointAtPP(t,e,n){return new Xe((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function xn(i){return i*(Math.PI/180)}function s2(i){return 180*i/Math.PI}const l2=(i=0)=>{if(i<0)for(;i<-Ri;)i+=Ri;else if(i>0)for(;i>Ri;)i-=Ri;return i};function a2(i,t,e){return t?{x:i.x+t*Math.cos(e),y:i.y+t*Math.sin(e)}:{x:i.x,y:i.y}}function HC(i){for(;i<0;)i+=2*Math.PI;for(;i>=2*Math.PI;)i-=2*Math.PI;return i}function EC(i,t,e){if(i===null)return t;if(t===null)return i;const{x11:n,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=kf(i,t,e);return n>=a||o<=l||r>=d||s<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(n,l),y1:Math.max(r,h),x2:Math.min(o,a),y2:Math.min(s,d)}}var Os;(function(i){i[i.NONE=0]="NONE",i[i.BBOX1=1]="BBOX1",i[i.BBOX2=2]="BBOX2"})(Os||(Os={}));const kf=(i,t,e)=>{let n=i.x1,o=i.x2,r=i.y1,s=i.y2,l=t.x1,a=t.x2,h=t.y1,d=t.y2;return e&&(n>o&&([n,o]=[o,n]),r>s&&([r,s]=[s,r]),l>a&&([l,a]=[a,l]),h>d&&([h,d]=[d,h])),{x11:n,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}};function h2(i,t,e){if(!i||!t)return Os.NONE;const{x11:n,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=kf(i,t,e);return n>l&&o<a&&r>h&&s<d?Os.BBOX1:l>n&&a<o&&h>r&&d<s?Os.BBOX2:Os.NONE}function Lf(i,t,e){if(i&&t){if(!e)return!(i.x1>t.x2||i.x2<t.x1||i.y1>t.y2||i.y2<t.y1);const{x11:n,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=kf(i,t,!0);return!(n>a||o<l||r>d||s<h)}return!0}function Ff(i,t){return Math.abs(t[0]*i[0]+t[1]*i[1])}function zs({x:i,y:t},e,n={x:0,y:0}){return{x:(i-n.x)*Math.cos(e)-(t-n.y)*Math.sin(e)+n.x,y:(i-n.x)*Math.sin(e)+(t-n.y)*Math.cos(e)+n.y}}function If(i){return{x:(i.x1+i.x2)/2,y:(i.y1+i.y2)/2}}function kC(i,t){const e=t?xn(i.angle):i.angle,n=If(i);return[zs({x:i.x1,y:i.y1},e,n),zs({x:i.x2,y:i.y1},e,n),zs({x:i.x2,y:i.y2},e,n),zs({x:i.x1,y:i.y2},e,n)]}function LC(i,t,e=!1,n){const o=kC(i,e),r=kC(t,e),s=(w,S)=>[S.x-w.x,S.y-w.y];n&&(n.save(),n.fillStyle="red",n.globalAlpha=.6,o.forEach((w,S)=>{S===0?n.moveTo(w.x,w.y):n.lineTo(w.x,w.y)}),n.fill(),n.restore(),n.save(),n.fillStyle="green",n.globalAlpha=.6,r.forEach((w,S)=>{S===0?n.moveTo(w.x,w.y):n.lineTo(w.x,w.y)}),n.fill(),n.restore());const l=If(i),a=If(t);n&&n.fillRect(l.x,l.y,2,2),n&&n.fillRect(a.x,a.y,2,2);const h=s(l,a),d=s(o[0],o[1]),u=s(o[1],o[2]),c=s(r[0],r[1]),g=s(r[1],r[2]),f=e?xn(i.angle):i.angle;let p=e?xn(90-i.angle):i.angle+Sn;const m=e?xn(t.angle):t.angle;let v=e?xn(90-t.angle):t.angle+Sn;p>ce&&(p-=ce),v>ce&&(v-=ce);const C=(w,S,y,_)=>{const R=[Math.cos(S),Math.sin(S)];return w+(Ff(R,y)+Ff(R,_))/2>Ff(R,h)};return C((i.x2-i.x1)/2,f,c,g)&&C((i.y2-i.y1)/2,p,c,g)&&C((t.x2-t.x1)/2,m,d,u)&&C((t.y2-t.y1)/2,v,d,u)}const FC=i=>{let t=i.charCodeAt(0),e=i.length===2?i.charCodeAt(1):0,n=t;return 55296<=t&&t<=56319&&56320<=e&&e<=57343&&(t&=1023,e&=1023,n=t<<10|e,n+=65536),n===12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n===8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n===172||n===175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n===161||n===164||167<=n&&n<=168||n===170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n===198||n===208||215<=n&&n<=216||222<=n&&n<=225||n===230||232<=n&&n<=234||236<=n&&n<=237||n===240||242<=n&&n<=243||247<=n&&n<=250||n===252||n===254||n===257||n===273||n===275||n===283||294<=n&&n<=295||n===299||305<=n&&n<=307||n===312||319<=n&&n<=322||n===324||328<=n&&n<=331||n===333||338<=n&&n<=339||358<=n&&n<=359||n===363||n===462||n===464||n===466||n===468||n===470||n===472||n===474||n===476||n===593||n===609||n===708||n===711||713<=n&&n<=715||n===717||n===720||728<=n&&n<=731||n===733||n===735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n===1025||1040<=n&&n<=1103||n===1105||n===8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n===8240||8242<=n&&n<=8243||n===8245||n===8251||n===8254||n===8308||n===8319||8321<=n&&n<=8324||n===8364||n===8451||n===8453||n===8457||n===8467||n===8470||8481<=n&&n<=8482||n===8486||n===8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n===8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n===8658||n===8660||n===8679||n===8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n===8715||n===8719||n===8721||n===8725||n===8730||8733<=n&&n<=8736||n===8739||n===8741||8743<=n&&n<=8748||n===8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n===8776||n===8780||n===8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n===8853||n===8857||n===8869||n===8895||n===8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n===9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n===9711||9733<=n&&n<=9734||n===9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n===9756||n===9758||n===9792||n===9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n===9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n===9955||9960<=n&&n<=9983||n===10045||n===10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n===65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function ld(i,t={},e){e||(e=1);const{fontStyle:n=t.fontStyle,fontVariant:o=t.fontVariant,fontWeight:r=t.fontWeight,fontSize:s=t.fontSize,fontFamily:l=t.fontFamily}=i;return(n?n+" ":"")+(o?o+" ":"")+(r?r+" ":"")+s*e+"px "+(l||"sans-serif")}class fi{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet=`-/: .,@%'"~`,this._option=t,this._userSpec=e??{},this.textSpec=this._initSpec(),z(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=z(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(Pt(this._canvas)&&(z(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),Pt(this._canvas)&&typeof window<"u"&&window.document!==void 0&&globalThis&&z(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),Pt(this._context)&&z(this._canvas)){const t=this._canvas.getContext("2d");z(t)&&(t.save(),t.font=ld(this.textSpec),this._contextSaved=!0,this._context=t)}return!Pt(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,n;const{defaultFontParams:o={}}=this._option,{fontStyle:r=o.fontStyle,fontVariant:s=o.fontVariant,fontWeight:l=(t=o.fontWeight)!==null&&t!==void 0?t:"normal",fontSize:a=(e=o.fontSize)!==null&&e!==void 0?e:12,fontFamily:h=(n=o.fontFamily)!==null&&n!==void 0?n:"sans-serif",align:d,textAlign:u=d??"center",baseline:c,textBaseline:g=c??"middle",ellipsis:f,limit:p}=this._userSpec;let{lineHeight:m=a}=this._userSpec;if(de(m)&&m[m.length-1]==="%"){const v=Number.parseFloat(m.substring(0,m.length-1))/100;m=a*v}return{fontStyle:r,fontVariant:s,fontFamily:h,fontSize:a,fontWeight:l,textAlign:u,textBaseline:g,ellipsis:f,limit:p,lineHeight:m}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(Pt(t))return{width:0,height:0};if(Pt(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:n,fontWeight:o,textAlign:r,textBaseline:s,ellipsis:l,limit:a,lineHeight:h}=this.textSpec;let d;try{const u=this._option.getTextBounds({text:t,fontFamily:e,fontSize:n,fontWeight:o,textAlign:r,textBaseline:s,ellipsis:!!l,maxLineWidth:a||1/0,lineHeight:h});d={width:u.width(),height:u.height()}}catch{this._notSupportVRender=!0,d=this.measureWithNaiveCanvas(t)}return d}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const n=this._context.measureText(t),{fontSize:o,lineHeight:r}=this.textSpec;return{width:n.width,height:(e=r)!==null&&e!==void 0?e:o}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let n=0;n<t.length;n++){const o=t[n];let r=this._measureSpecialChar(o);Pt(r)&&fi.NUMBERS_CHAR_SET.includes(o)&&(r=this._measureNumberChar()),Pt(r)&&["F","W"].includes(FC(o))&&(r=this._measureFullSizeChar()),Pt(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const n={width:0,height:0},{fontSize:o,lineHeight:r}=this.textSpec;for(let s=0;s<t.length;s++){const l=t[s],a=["F","W"].includes(FC(l))?1:.53;n.width+=a*o}return n.height=(e=r)!==null&&e!==void 0?e:o,n}_measureReduce(t,e){var n;const{fontSize:o,lineHeight:r}=this.textSpec,s={width:0,height:0};if(Pt(t))return s;if(ot(t)){const l=t.filter(z).map(a=>a.toString());return l.length===0?s:l.length===1?e(l[0]):{width:l.reduce((a,h)=>Math.max(a,e(h).width),0),height:l.length*(((n=r)!==null&&n!==void 0?n:o)+1)+1}}return e(t.toString())}_measureNumberChar(){if(Pt(this._numberCharSize)){const t=this._standardMethod(fi.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/fi.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return Pt(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(fi.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(Pt(this._letterCharSize)){const t=this._standardMethod(fi.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/fi.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return z(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){z(this._canvas)&&(this._canvas=null),z(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}fi.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",fi.NUMBERS_CHAR_SET="0123456789",fi.FULL_SIZE_CHAR="字";function Df(i,t,e){const{x1:n,y1:o,x2:r,y2:s}=t;return e.onlyTranslate()?(i!==t&&i.setValue(t.x1,t.y1,t.x2,t.y2),i.translate(e.e,e.f),t):(i.clear(),i.add(e.a*n+e.c*o+e.e,e.b*n+e.d*o+e.f),i.add(e.a*r+e.c*o+e.e,e.b*r+e.d*o+e.f),i.add(e.a*r+e.c*s+e.e,e.b*r+e.d*s+e.f),i.add(e.a*n+e.c*s+e.e,e.b*n+e.d*s+e.f),t)}class an{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new an(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,o=0){return this.x1=t,this.y1=e,this.x2=n,this.y2=o,this}set(t=0,e=0,n=0,o=0){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),o<e?(this.y2=e,this.y1=o):(this.y1=e,this.y2=o),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 ot(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 o=this.rotatedPoints(t,e,n);return this.clear().add(o[0],o[1]).add(o[2],o[3]).add(o[4],o[5]).add(o[6],o[7])}scale(t=0,e=0,n=0,o=0){const r=this.scalePoints(t,e,n,o);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 Df(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:o,y1:r,x2:s,y2:l}=this,a=Math.cos(t),h=Math.sin(t),d=e-e*a+n*h,u=n-e*h-n*a;return[a*o-h*r+d,h*o+a*r+u,a*o-h*l+d,h*o+a*l+u,a*s-h*r+d,h*s+a*r+u,a*s-h*l+d,h*s+a*l+u]}scalePoints(t,e,n,o){const{x1:r,y1:s,x2:l,y2:a}=this;return[t*r+(1-t)*n,e*s+(1-e)*o,t*l+(1-t)*n,e*a+(1-e)*o]}}class Fe extends an{}class d2 extends an{constructor(t,e=0){super(t),t&&(this.angle=e)}intersects(t){return LC(this,t)}setValue(t=0,e=0,n=0,o=0,r=0){return super.setValue(t,e,n,o),this.angle=r,this}}class ni{constructor(t=1,e=0,n=0,o=1,r=0,s=0){this.a=t,this.b=e,this.c=n,this.d=o,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,o,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==o||this.b!==e||this.c!==n)}setValue(t,e,n,o,r,s){return this.a=t,this.b=e,this.c=n,this.d=o,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,o=this.d,r=this.e,s=this.f,l=new ni,a=t*o-e*n;return l.a=o/a,l.b=-e/a,l.c=-n/a,l.d=t/a,l.e=(n*s-o*r)/a,l.f=-(t*s-e*r)/a,l}rotate(t){const e=Math.cos(t),n=Math.sin(t),o=this.a*e+this.c*n,r=this.b*e+this.d*n,s=this.a*-n+this.c*e,l=this.b*-n+this.d*e;return this.a=o,this.b=r,this.c=s,this.d=l,this}rotateByCenter(t,e,n){const o=Math.cos(t),r=Math.sin(t),s=(1-o)*e+r*n,l=(1-o)*n-r*e,a=o*this.a-r*this.b,h=r*this.a+o*this.b,d=o*this.c-r*this.d,u=r*this.c+o*this.d,c=o*this.e-r*this.f+s,g=r*this.e+o*this.f+l;return this.a=a,this.b=h,this.c=d,this.d=u,this.e=c,this.f=g,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,o,r,s){return this.multiply(t,e,n,o,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:o,e:r,f:s}=this;return this.a=e,this.b=t,this.c=o,this.d=n,this.e=s,this.f=r,this}multiply(t,e,n,o,r,s){const l=this.a,a=this.b,h=this.c,d=this.d,u=l*t+h*e,c=a*t+d*e,g=l*n+h*o,f=a*n+d*o,p=l*r+h*s+this.e,m=a*r+d*s+this.f;return this.a=u,this.b=c,this.c=g,this.d=f,this.e=p,this.f=m,this}interpolate(t,e){const n=new ni;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:o,c:r,d:s,e:l,f:a}=this,h=n*s-o*r,d=s/h,u=-o/h,c=-r/h,g=n/h,f=(r*a-s*l)/h,p=-(n*a-o*l)/h,{x:m,y:v}=t;e.x=m*d+v*c+f,e.y=m*u+v*g+p}onlyTranslate(t=1){return this.a===t&&this.b===0&&this.c===0&&this.d===t}clone(){return new ni(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,n=this.c,o=this.d,r=t*o-e*n,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!==0||e!==0){const l=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/l):-Math.acos(t/l),s.scaleX=l,s.scaleY=r/l,s.skewX=(t*n+e*o)/r,s.skewY=0}else if(n!==0||o!==0){const l=Math.sqrt(n*n+o*o);s.rotateDeg=Math.PI/2-(o>0?Math.acos(-n/l):-Math.acos(n/l)),s.scaleX=r/l,s.scaleY=l,s.skewX=0,s.skewY=(t*n+e*o)/r}return s.rotateDeg=s2(s.rotateDeg),s}}function u2(i,t,e,n,o,r,s,l){const a=t.a,h=t.b,d=t.c,u=t.d,c=t.e,g=t.f,f=ii(s),p=We(s);let m,v;l?(m=l[0],v=l[1]):(m=e,v=n);const C=m-e,w=v-n,S=a*f+d*p,y=h*f+u*p,_=d*f-a*p,R=u*f-h*p;i.a=o*S,i.b=o*y,i.c=r*_,i.d=r*R,i.e=c+a*m+d*v-S*C-_*w,i.f=g+h*m+u*v-y*C-R*w}class c2{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:n=this.CLEAN_THRESHOLD,L_TIME:o=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<n)return 0;let s=0;const l=h=>{s++,t.delete(h)},a=Date.now();return t.forEach((h,d)=>{if(h.timestamp.length<r)return l(d);let u=0;for(;a-h.timestamp[h.timestamp.length-1-u]<o&&(u++,!(u>=r)););if(u<r)return l(d);for(;a-h.timestamp[0]>o;)h.timestamp.shift()}),s}addLimitedTimestamp(t,e,n){const{R_TIMESTAMP_MAX_SIZE:o=this.R_TIMESTAMP_MAX_SIZE}=n;t.timestamp.length>o&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:n=this.L_TIME}=e,o=Date.now();t.forEach(r=>{for(;o-r.timestamp[0]>n;)r.timestamp.shift()})}clearItemTimestamp(t,e){const{L_TIME:n=this.L_TIME}=e,o=Date.now();for(;o-t.timestamp[0]>n;)t.timestamp.shift()}}function Of(i,t,e){t/=100,e/=100;const n=(1-Math.abs(2*e-1))*t,o=n*(1-Math.abs(i/60%2-1)),r=e-n/2;let s=0,l=0,a=0;return 0<=i&&i<60?(s=n,l=o,a=0):60<=i&&i<120?(s=o,l=n,a=0):120<=i&&i<180?(s=0,l=n,a=o):180<=i&&i<240?(s=0,l=o,a=n):240<=i&&i<300?(s=o,l=0,a=n):300<=i&&i<360&&(s=n,l=0,a=o),s=Math.round(255*(s+r)),l=Math.round(255*(l+r)),a=Math.round(255*(a+r)),{r:s,g:l,b:a}}function zf(i,t,e){i/=255,t/=255,e/=255;const n=Math.min(i,t,e),o=Math.max(i,t,e),r=o-n;let s=0,l=0,a=0;return s=r===0?0:o===i?(t-e)/r%6:o===t?(e-i)/r+2:(i-t)/r+4,s=Math.round(60*s),s<0&&(s+=360),a=(o+n)/2,l=r===0?0:r/(1-Math.abs(2*a-1)),l=+(100*l).toFixed(1),a=+(100*a).toFixed(1),{h:s,s:l,l:a}}const g2=/^#([0-9a-f]{3,8})$/,IC={transparent:4294967040},ad={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 hd(i){return((i=Math.max(0,Math.min(255,Math.round(i)||0)))<16?"0":"")+i.toString(16)}function DC(i){return ut(i)?new $i(i>>16,i>>8&255,255&i,1):ot(i)?new $i(i[0],i[1],i[2]):new $i(255,255,255)}function f2(i){return ut(i)?new $i(i>>>24,i>>>16&255,i>>>8&255,255&i):ot(i)?new $i(i[0],i[1],i[2],i[3]):new $i(255,255,255,1)}function Wf(i){return i<.04045?.0773993808*i:Math.pow(.9478672986*i+.0521327014,2.4)}function Nf(i){return i<.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}const OC=(i,t)=>{const e=g2.exec(i);if(t||e){const n=parseInt(e[1],16),o=e[1].length;return o===3?new $i((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):o===6?DC(n):o===8?new $i(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):null}};class hn{static Brighter(t,e=1){return e===1?t:new hn(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return e===1?t:new hn(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const n=t instanceof hn?t:new hn(t);switch(e){case"hsv":default:return n.getHSVBrightness();case"hsl":return n.getHSLBrightness();case"lum":return n.getLuminance();case"lum2":return n.getLuminance2();case"lum3":return n.getLuminance3()}}static parseColorString(t){if(z(IC[t]))return f2(IC[t]);if(z(ad[t]))return DC(ad[t]);const e=`${t}`.trim().toLowerCase(),n=OC(e);if(n!==void 0)return n;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const o=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new $i(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10),parseFloat(o[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const o=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),r=Of(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10));return new $i(r.r,r.g,r.b,parseFloat(o[3]))}}constructor(t){const e=hn.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new $i(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:n,b:o}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(o*t))),this}add(t){const{r:e,g:n,b:o}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,n+t.color.g),this.color.b+=Math.min(255,o+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:n,b:o}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(o*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return .5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,n){const o=this.color.opacity,r=zf(this.color.r,this.color.g,this.color.b),s=Of(Pt(t)?r.h:ln(t,0,360),Pt(e)?r.s:e>=0&&e<=1?100*e:e,Pt(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new $i(s.r,s.g,s.b,o),this}setRGB(t,e,n){return!Pt(t)&&(this.color.r=t),!Pt(e)&&(this.color.g=e),!Pt(n)&&(this.color.b=n),this}setHex(t){const e=`${t}`.trim().toLowerCase(),n=OC(e,!0);return n??this}setColorName(t){const e=ad[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new hn(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,n),this.color.g=Math.pow(t.color.g,n),this.color.b=Math.pow(t.color.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Wf(t.color.r),this.color.g=Wf(t.color.g),this.color.b=Wf(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Nf(t.color.r),this.color.g=Nf(t.color.g),this.color.b=Nf(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class $i{constructor(t,e,n,o){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),z(o)?this.opacity=isNaN(+o)?1:Math.max(0,Math.min(1,+o)):this.opacity=1}formatHex(){return`#${hd(this.r)+hd(this.g)+hd(this.b)+(this.opacity===1?"":hd(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${t===1?"rgb(":"rgba("}${this.r},${this.g},${this.b}${t===1?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:n,l:o}=zf(this.r,this.g,this.b);return`${t===1?"hsl(":"hsla("}${e},${n}%,${o}%${t===1?")":`,${t})`}`}toString(){return this.formatHex()}}function p2(i){let t="",e="",n="";const o=i[0]==="#"?1:0;for(let r=o;r<i.length;r++)i[r]!=="#"&&(r<o+2?t+=i[r]:r<o+4?e+=i[r]:r<o+6&&(n+=i[r]));return[parseInt(t,16),parseInt(e,16),parseInt(n,16)]}function m2(i,t,e){return Number((1<<24)+(i<<16)+(t<<8)+e).toString(16).slice(1)}function v2(i,t){const e=i.r,n=t.r,o=i.g,r=t.g,s=i.b,l=t.b,a=i.opacity,h=t.opacity;return d=>{const u=Math.round(e*(1-d)+n*d),c=Math.round(o*(1-d)+r*d),g=Math.round(s*(1-d)+l*d);return new $i(u,c,g,a*(1-d)+h*d)}}const b2=Object.freeze(Object.defineProperty({__proto__:null,Color:hn,DEFAULT_COLORS:ad,RGB:$i,hexToRgb:p2,hslToRgb:Of,interpolateRgb:v2,rgbToHex:m2,rgbToHsl:zf},Symbol.toStringTag,{value:"Module"}));function ao(i){if(Te(i))return[i,i,i,i];if(ot(i)){const t=i.length;if(t===1){const e=i[0];return[e,e,e,e]}if(t===2){const[e,n]=i;return[e,n,e,n]}if(t===3){const[e,n,o]=i;return[e,n,o,n]}if(t===4)return i}if(ue(i)){const{top:t=0,right:e=0,bottom:n=0,left:o=0}=i;return[t,e,n,o]}return[0,0,0,0]}function C2(i){try{return i instanceof Element}catch{const e=["children","innerHTML","classList","setAttribute","tagName","getBoundingClientRect"],n=Object.keys(i);return e.every(o=>n.includes(o))}}const y2=Ri-1e-8;class Vf{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,o,r,s){if(Math.abs(r-o)>y2)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let l,a,h,d,u=1/0,c=-1/0,g=1/0,f=-1/0;function p(m){h=n*Math.cos(m),d=n*Math.sin(m),h<u&&(u=h),h>c&&(c=h),d<g&&(g=d),d>f&&(f=d)}if(p(o),p(r),r!==o)if((o%=Ri)<0&&(o+=Ri),(r%=Ri)<0&&(r+=Ri),r<o&&(s=!s,l=o,o=r,r=l),s)for(r-=Ri,l=o-o%Sn,a=0;a<4&&l>r;++a,l-=Sn)p(l);else for(l=o-o%Sn+Sn,a=0;a<4&&l<r;++a,l+=Sn)p(l);this.bounds.add(t+u,e+g),this.bounds.add(t+c,e+f)}arcTo(t,e,n,o,r){this.bounds.add(t,e)}bezierCurveTo(t,e,n,o,r,s){this.bounds.add(t,e),this.bounds.add(n,o),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,o){this.bounds.add(t,e),this.bounds.add(n,o)}rect(t,e,n,o){this.bounds.add(t,e),this.bounds.add(t+n,e+o)}clear(){this.bounds.clear()}release(...t){}}class _2{constructor(){this.curves=[],this.bounds=new Fe}getCurveLengths(){return this.curves.map(t=>t.getLength())}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const w2=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,S2={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 jf,zC,dd,WC,$f,ud;function x2(i){if(!i)return[];const t=i.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(t===null)return[];let e,n;const o=[];for(let r=0,s=t.length;r<s;r++)if(jf=t[r],zC=jf.slice(1),dd=jf[0],e=[dd],n=zC.match(w2),n!==null){for(let l=0,a=n.length;l<a;l++)WC=n[l],$f=parseFloat(WC),Number.isNaN($f)||e.push($f);if(ud=S2[dd],e.length-1>ud){let l,a=dd;for(let h=1,d=e.length;h<d;h+=ud){l=[a];for(let u=h,c=h+ud;u<c;u++)l.push(e[u]);o.push(l),a==="m"?a="l":a==="M"&&(a="L")}}else o.push(e)}else o.push(e);return o}var xe;(function(i){i[i.NONE=0]="NONE",i[i.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",i[i.UPDATE_SHAPE=2]="UPDATE_SHAPE",i[i.CLEAR_SHAPE=253]="CLEAR_SHAPE",i[i.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",i[i.INIT=179]="INIT",i[i.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",i[i.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",i[i.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",i[i.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",i[i.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",i[i.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",i[i.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",i[i.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"})(xe||(xe={}));var ea;(function(i){i[i.GLOBAL=1]="GLOBAL",i[i.LOCAL=16]="LOCAL",i[i.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",i[i.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"})(ea||(ea={}));var Zi;(function(i){i[i.INIT=0]="INIT",i[i.DEFAULT=1]="DEFAULT",i[i.STATE=2]="STATE",i[i.ANIMATE_BIND=10]="ANIMATE_BIND",i[i.ANIMATE_PLAY=11]="ANIMATE_PLAY",i[i.ANIMATE_START=12]="ANIMATE_START",i[i.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",i[i.ANIMATE_END=14]="ANIMATE_END",i[i.TRANSLATE=20]="TRANSLATE",i[i.TRANSLATE_TO=21]="TRANSLATE_TO",i[i.SCALE=22]="SCALE",i[i.SCALE_TO=23]="SCALE_TO",i[i.ROTATE=24]="ROTATE",i[i.ROTATE_TO=25]="ROTATE_TO"})(Zi||(Zi={}));var Ii;(function(i){i[i.INITIAL=0]="INITIAL",i[i.RUNNING=1]="RUNNING",i[i.PAUSED=2]="PAUSED",i[i.END=3]="END"})(Ii||(Ii={}));var cd;(function(i){i[i.NORMAL=0]="NORMAL",i[i.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"})(cd||(cd={}));var Ws;(function(i){i.wait="wait",i.from="from",i.to="to",i.customAnimate="customAnimate"})(Ws||(Ws={}));var He;(function(i){i[i.ROW=1]="ROW",i[i.COLUMN=2]="COLUMN"})(He||(He={}));var gd;(function(i){i[i.CubicBezierCurve=0]="CubicBezierCurve",i[i.QuadraticBezierCurve=1]="QuadraticBezierCurve",i[i.ArcCurve=2]="ArcCurve",i[i.LineCurve=3]="LineCurve",i[i.EllipseCurve=4]="EllipseCurve",i[i.MoveCurve=5]="MoveCurve"})(gd||(gd={}));var ge;(function(i){i[i.beforeFillStroke=0]="beforeFillStroke",i[i.afterFillStroke=1]="afterFillStroke"})(ge||(ge={}));function A2(i,t,e,n,o,r,s,l,a){const h=xn(s),d=Math.sin(h),u=Math.cos(h),c=u*(l-i)*.5+d*(a-t)*.5,g=u*(a-t)*.5-d*(l-i)*.5;let f=c*c/((e=Math.abs(e))*e)+g*g/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),e*=f,n*=f);const p=u/e,m=d/e,v=-d/n,C=u/n,w=p*l+m*a,S=v*l+C*a,y=p*i+m*t,_=v*i+C*t;let R=1/((y-w)*(y-w)+(_-S)*(_-S))-.25;R<0&&(R=0);let A=Math.sqrt(R);r===o&&(A=-A);const x=.5*(w+y)-A*(_-S),T=.5*(S+_)+A*(y-w),M=Math.atan2(S-T,w-x);let B=Math.atan2(_-T,y-x)-M;B<0&&r===1?B+=Ri:B>0&&r===0&&(B-=Ri);const H=Math.ceil(Math.abs(B/(Sn+.001))),F=[];for(let P=0;P<H;++P){const E=M+P*B/H,L=M+(P+1)*B/H;F[P]=[x,T,E,L,e,n,d,u]}return F}function R2(i){const t=i[0],e=i[1],n=i[2],o=i[3],r=i[4],s=i[5],l=i[6],a=i[7],h=a*r,d=-l*s,u=l*r,c=a*s,g=Math.cos(n),f=Math.sin(n),p=Math.cos(o),m=Math.sin(o),v=.5*(o-n),C=Math.sin(.5*v),w=8/3*C*C/Math.sin(v),S=t+g-w*f,y=e+f+w*g,_=t+p,R=e+m,A=_+w*m,x=R-w*p;return[h*S+d*y,u*S+c*y,h*A+d*x,u*A+c*x,h*_+d*R,u*_+c*R]}function NC(i,t,e,n){const o=A2(n[5],n[6],n[0],n[1],n[3],n[4],n[2],t,e);for(let r=0;r<o.length;++r){const s=R2(o[r]);i.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const T2=(i,t,e,n,o,r,s)=>{const l=Math.abs(e-t),a=l>.5*Math.PI?Math.ceil(2*l/Math.PI):1,h=(e-t)/a;for(let d=0;d<a;d++){const u=t+h*d,c=t+h*(d+1),g=4*Math.tan(Math.abs(h)/4)/3,f=c<u?-1:1,p=Math.cos(u),m=Math.sin(u),v=Math.cos(c),C=Math.sin(c),w=p*r+n,S=m*s+o,y=v*r+n,_=C*s+o,R=r*g*f,A=s*g*f;i.push(w-R*m,S+A*p,y+R*C,_-A*v,y,_)}},M2=[(i,t,e,n,o,r,s)=>t.arc(i[1]*o+e,i[2]*r+n,i[3]*(o+r)/2,i[4],i[5],i[6],s),(i,t,e,n,o,r,s)=>t.arcTo(i[1]*o+e,i[2]*r+n,i[3]*o+e,i[4]*r+n,i[5]*(o+r)/2,s),(i,t,e,n,o,r,s)=>t.bezierCurveTo(i[1]*o+e,i[2]*r+n,i[3]*o+e,i[4]*r+n,i[5]*o+e,i[6]*r+n,s),(i,t,e,n)=>t.closePath(),(i,t,e,n,o,r)=>t.ellipse(i[1]*o+e,i[2]*r+n,i[3]*o,i[4]*r,i[5],i[6],i[7],i[8]),(i,t,e,n,o,r,s)=>t.lineTo(i[1]*o+e,i[2]*r+n,s),(i,t,e,n,o,r,s)=>t.moveTo(i[1]*o+e,i[2]*r+n,s),(i,t,e,n,o,r,s)=>t.quadraticCurveTo(i[1]*o+e,i[2]*r+n,i[3]*o+e,i[4]*r+n,s),(i,t,e,n,o,r,s)=>t.rect(i[1]*o+e,i[2]*r+n,i[3]*o,i[4]*r,s)];function hr(i,t,e=0,n=0,o=1,r=1,s){for(let l=0;l<i.length;l++){const a=i[l];M2[a[0]](a,t,e,n,o,r,s)}}class VC{getLength(t){return t!=null?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function B2(i,t){let e=0;const n=i.length;for(let o=0;o<n;o++){const r=i[o],s=t[o],l=i[(o+1)%n],a=t[(o+1)%n];e+=Ho.distanceNN(r,s,l,a)}return e/2}function P2(i,t,e,n,o){return B2([i.x,t.x,e.x,n.x],[i.y,t.y,e.y,n.y])}function jC(i,t,e,n,o){const r=1-o;return r*r*r*i+3*t*o*r*r+3*e*o*o*r+n*o*o*o}function $C(i,t,e,n,o){const r=jC(i.x,t.x,e.x,n.x,o),s=jC(i.y,t.y,e.y,n.y,o);return new Xe(r,s)}function Gf(i,t){const{p0:e,p1:n,p2:o,p3:r}=i,s=$C(e,n,o,r,t),l=Ho.pointAtPP(e,n,t),a=Ho.pointAtPP(n,o,t),h=Ho.pointAtPP(o,r,t),d=Ho.pointAtPP(l,a,t),u=Ho.pointAtPP(a,h,t);return[new Uf(e,l,d,s),new Uf(s,u,h,r)]}class Uf extends VC{constructor(t,e,n,o){super(),this.type=gd.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=n,this.p3=o}_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(this.defined!==!1)return $C(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?P2(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===He.ROW?_e(this.p0.x-this.p3.x):t===He.COLUMN?_e(this.p0.y-this.p3.y):0}getAngleAt(t){const e=ar(t-.01,0),n=Fi(t+.01,1),o=this.getPointAt(e),r=this.getPointAt(n);return Ce(r.y-o.y,r.x-o.x)}}function GC(i,t){const{p0:e,p1:n}=i,o=Ho.pointAtPP(e,n,t);return[new Kf(e,o),new Kf(o,n)]}class Kf extends VC{constructor(t,e){super(),this.type=gd.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(this.defined!==!1)return Ho.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return this.angle==null&&(this.angle=Ce(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()?Ho.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===He.ROW?_e(this.p0.x-this.p1.x):t===He.COLUMN?_e(this.p0.y-this.p1.y):0}}class Yf{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,o,r,s,l,a){const h=new Uf(new Xe(this._lastX,this._lastY),new Xe(t,e),new Xe(n,o),new Xe(r,s));h.originP1=this._lastOriginP,h.originP2=a,h.defined=l,this.curves.push(h),this._lastX=r,this._lastY=s,this._lastOriginP=a}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,o){const r=this.addLinearCurve(t,e,n,this._lastOriginP,o);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=o}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,o){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,o,r){const s=new Kf(new Xe(this._lastX,this._lastY),new Xe(t,e));return s.originP1=o,s.originP2=r,s.defined=n,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===He.COLUMN){if(!this.curves.length)return 0;const o=this.curves[0],r=this.curves[this.curves.length-1],s=(e=r.p3)!==null&&e!==void 0?e:r.p1;return _e(o.p0.y-s.y)}if(t===He.ROW){if(!this.curves.length)return 0;const o=this.curves[0],r=this.curves[this.curves.length-1],s=(n=r.p3)!==null&&n!==void 0?n:r.p1;return _e(o.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((o,r)=>o+r.getLength(),0)),this.length}}class H2 extends Yf{bezierCurveTo(t,e,n,o,r,s,l,a){return super.bezierCurveTo(e,t,o,n,s,r,l,a)}lineTo(t,e,n,o){return super.lineTo(e,t,n,o)}moveTo(t,e,n){return super.moveTo(e,t,n)}clear(){return super.clear()}}function $r(i,t,e=1){let n=!1;for(let o=0,r=t.length;o<=r;o++)o>=r===n&&((n=!n)?i.lineStart():i.lineEnd()),n&&i.point(t[o])}function Ns(i,t,e){const n=t??(_e(e[e.length-1].x-e[0].x)>_e(e[e.length-1].y-e[0].y)?He.ROW:He.COLUMN);return i==="monotoneY"?new H2(i,n):new Yf(i,n)}class UC{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||this._line!==0&&this._point===1)&&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,this._lastDefined!==!1&&t.defined!==!1,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,this._lastDefined!==!1&&t.defined!==!1,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function ia(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;const o=Ns("linear",e,i);return E2(new UC(o,n),i),o}function E2(i,t){return $r(i,t,1)}function KC(i,t,e,n,o){i.context.bezierCurveTo((2*i._x0+i._x1)/3,(2*i._y0+i._y1)/3,(i._x0+2*i._x1)/3,(i._y0+2*i._y1)/3,(i._x0+4*i._x1+t)/6,(i._y0+4*i._y1+e)/6,n,i.lastPoint1)}class k2{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(){this._point===2&&KC(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1),(this._line||this._line!==0&&this._point===1)&&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,this._lastDefined1!==!1&&this._lastDefined2!==!1,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:KC(this,e,n,this._lastDefined1!==!1&&this._lastDefined2!==!1)}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 L2(i,t){return $r(i,t,2)}function F2(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;if(i.length<3-+!!n)return ia(i,t);const o=Ns("basis",e,i);return L2(new k2(o,n),i),o}function YC(i){return i<0?-1:1}function XC(i,t,e){const n=i._x1-i._x0,o=t-i._x1,r=(i._y1-i._y0)/(n||Number(o<0&&-0)),s=(e-i._y1)/(o||Number(n<0&&-0)),l=(r*o+s*n)/(n+o);return(YC(r)+YC(s))*Math.min(Math.abs(r),Math.abs(s),.5*Math.abs(l))||0}function qC(i,t){const e=i._x1-i._x0;return e?(3*(i._y1-i._y0)/e-t)/2:t}function Xf(i,t,e,n,o){const r=i._x0,s=i._y0,l=i._x1,a=i._y1,h=(l-r)/3;i.context.bezierCurveTo(r+h,s+h*t,l-h,a-h*e,l,a,n,i.lastPoint1)}class ZC{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,this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1);break;case 3:Xf(this,this._t0,qC(this,this._t0),this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1)}(this._line||this._line!==0&&this._point===1)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const n=t.x,o=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,o,this._lastDefined1!==!1&&this._lastDefined2!==!1,t):this.context.moveTo(n,o,t);break;case 1:this._point=2;break;case 2:this._point=3,Xf(this,qC(this,e=XC(this,n,o)),e,this._lastDefined1!==!1&&this._lastDefined2!==!1);break;default:Xf(this,this._t0,e=XC(this,n,o),this._lastDefined1!==!1&&this._lastDefined2!==!1)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=o,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined!==!1,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class I2 extends ZC{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function D2(i,t){return $r(i,t,2)}function O2(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;if(i.length<3-+!!n)return ia(i,t);const o=Ns("monotoneX",e,i);return D2(new ZC(o,n),i),o}function z2(i,t){return $r(i,t,2)}function W2(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;if(i.length<3-+!!n)return ia(i,t);const o=Ns("monotoneY",e,i);return z2(new I2(o,n),i),o}let N2=class{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&&this._point===2&&this.context.lineTo(this._x,this._y,this._lastDefined!==!1,this.lastPoint),(this._line||this._line!==0&&this._point===1)&&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,this._lastDefined!==!1&&t.defined!==!1,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,this._lastDefined!==!1&&t.defined!==!1,this.lastPoint),this.context.lineTo(e,n,this._lastDefined!==!1&&t.defined!==!1,t);else{const o=this._x*(1-this._t)+e*this._t;this.context.lineTo(o,this._y,this._lastDefined!==!1&&t.defined!==!1,this.lastPoint),this.context.lineTo(o,n,this._lastDefined!==!1&&t.defined!==!1,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function qf(i,t,e={}){const{direction:n,startPoint:o}=e;if(i.length<2-+!!o)return null;const r=new Yf("step",n??(_e(i[i.length-1].x-i[0].x)>_e(i[i.length-1].y-i[0].y)?He.ROW:He.COLUMN));return V2(new N2(r,t,o),i),r}function V2(i,t){return $r(i,t,1)}class j2 extends UC{lineEnd(){this.context.closePath()}}function $2(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;const o=Ns("linear",e,i);return G2(new j2(o,n),i),o}function G2(i,t){return $r(i,t,1)}function JC(i,t,e,n,o){let r=i._x1,s=i._y1,l=i._x2,a=i._y2;if(i._l01_a>Le){const h=2*i._l01_2a+3*i._l01_a*i._l12_a+i._l12_2a,d=3*i._l01_a*(i._l01_a+i._l12_a);r=(r*h-i._x0*i._l12_2a+i._x2*i._l01_2a)/d,s=(s*h-i._y0*i._l12_2a+i._y2*i._l01_2a)/d}if(i._l23_a>Le){const h=2*i._l23_2a+3*i._l23_a*i._l12_a+i._l12_2a,d=3*i._l23_a*(i._l23_a+i._l12_a);l=(l*h+i._x1*i._l23_2a-t*i._l12_2a)/d,a=(a*h+i._y1*i._l23_2a-e*i._l12_2a)/d}i.context.bezierCurveTo(r,s,l,a,i._x2,i._y2,n,i.lastPoint1)}class U2{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,this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||this._line!==0&&this._point===1)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:n}=t;if(this._point){const o=this._x2-e,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(o*o+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,this._lastDefined1!==!1&&this._lastDefined2!==!1):this.context.moveTo(e,n);break;case 1:this._point=2;break;case 2:this._point=3;default:JC(this,e,n,this._lastDefined1!==!1&&this._lastDefined2!==!1)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function QC(i,t){return function(e,n,o={}){const{direction:r,startPoint:s}=o;if(e.length<2-+!!s)return null;if(e.length<3-+!!s)return ia(e,o);const l=Ns(i,r,e),a=new t(l,n,s);return $r(a,e,2),l}}const K2=QC("catmullRom",U2);class Y2{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._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=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 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:n}=t;if(this._point){const o=this._x2-e,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(o*o+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=n;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=n,t);break;case 2:this._point=3,this._x5=e,this._y5=n;break;default:JC(this,e,n,this._lastDefined1!==!1&&this._lastDefined2!==!1)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}const X2=QC("catmullRomClosed",Y2);function Gr(i,t,e){var n,o;switch(t){case"linear":default:return ia(i,e);case"basis":return F2(i,e);case"monotoneX":return O2(i,e);case"monotoneY":return W2(i,e);case"step":return qf(i,.5,e);case"stepBefore":return qf(i,0,e);case"stepAfter":return qf(i,1,e);case"catmullRom":return K2(i,(n=e==null?void 0:e.curveTension)!==null&&n!==void 0?n:.5,e);case"catmullRomClosed":return X2(i,(o=e==null?void 0:e.curveTension)!==null&&o!==void 0?o:.5,e);case"linearClosed":return $2(i,e)}}class wi extends _2{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Vf(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([ye.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([ye.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,o){return this.commandList.push([ye.Q,t,e,n,o]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,o),this}bezierCurveTo(t,e,n,o,r,s){return this.commandList.push([ye.C,t,e,n,o,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,o,r,s),this}arcTo(t,e,n,o,r){return this.commandList.push([ye.AT,t,e,n,o,r]),this._ctx&&this._ctx.arcTo(t,e,n,o,r),this}ellipse(t,e,n,o,r,s,l,a){return this.commandList.push([ye.E,t,e,n,o,r,s,l,a]),this._ctx&&this._ctx.ellipse(t,e,n,o,r,s,l,a),this}rect(t,e,n,o){return this.commandList.push([ye.R,t,e,n,o]),this._ctx&&this._ctx.rect(t,e,n,o),this}arc(t,e,n,o,r,s){return this.commandList.push([ye.A,t,e,n,o,r,s]),this._ctx&&this._ctx.arc(t,e,n,o,r,s),this}closePath(){return this.commandList.push([ye.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const n=[];n[ye.M]=o=>`M${o[1]} ${o[2]}`,n[ye.L]=o=>`L${o[1]} ${o[2]}`,n[ye.Q]=o=>`Q${o[1]} ${o[2]} ${o[3]} ${o[4]}`,n[ye.C]=o=>`C${o[1]} ${o[2]} ${o[3]} ${o[4]} ${o[5]} ${o[6]}`,n[ye.A]=o=>{const r=[];T2(r,o[4],o[5],o[1],o[2],o[3],o[3]);let s="";for(let l=0;l<r.length;l+=6)s+=`C${r[l]} ${r[l+1]} ${r[l+2]} ${r[l+3]} ${r[l+4]} ${r[l+5]}`;return s},n[ye.R]=o=>`M${o[1]} ${o[2]} h${o[3]} v${o[4]} H${o[1]}Z`,n[ye.Z]=o=>"Z",this.toStringCbList=n}const t=this.toStringCbList;let e="";return this.commandList.forEach(n=>{e+=t[n[0]](n)}),e}fromString(t,e,n,o,r){this.clear();const s=x2(t);return this._runCommandStrList(s,e,n,o,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:n,clipRangeByDimension:o}=t.attribute;if(!e)return;const r=Gr(e,n);o==="x"?this.direction=He.ROW:o==="y"?this.direction=He.COLUMN:o==="auto"&&(this.direction=r.direction),this.curves=r.curves}fromCustomPath2D(t,e,n,o,r){return this.clear(),this._runCommandList(t.commandList,e,n,o,r),this._updateBounds(),this}transform(t,e,n,o){const r=this.commandList;if(!this.transformCbList){const s=[];s[ye.M]=this.moveToTransform,s[ye.L]=this.lineToTransform,s[ye.Q]=this.quadraticCurveToTransform,s[ye.C]=this.bezierCurveToTransform,s[ye.AT]=this.arcToTransform,s[ye.E]=this.ellipseTransform,s[ye.R]=this.rectTransform,s[ye.A]=this.arcTransform,s[ye.Z]=this.closePathTransform,this.transformCbList=s}r.forEach(s=>{this.transformCbList[s[0]](s,t,e,n,o)}),this._updateBounds()}moveToTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n}lineToTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n}quadraticCurveToTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*o+e,t[4]=t[4]*r+n}bezierCurveToTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*o+e,t[4]=t[4]*r+n,t[5]=t[5]*o+e,t[6]=t[6]*r+n}arcToTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*o+e,t[4]=t[4]*r+n,t[5]=t[5]*(o+r)/2}ellipseTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*o,t[4]=t[4]*r}rectTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*o,t[4]=t[4]*r}arcTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*(o+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,n=0,o=1,r=1){let s,l,a,h,d,u=null,c=0,g=0,f=0,p=0;for(let m=0,v=t.length;m<v;++m){switch(s=t[m],o===1&&r===1||(s=q2(s,o,r)),s[0]){case"l":c+=s[1],g+=s[2],this.lineTo(c+e,g+n);break;case"L":c=s[1],g=s[2],this.lineTo(c+e,g+n);break;case"h":c+=s[1],this.lineTo(c+e,g+n);break;case"H":c=s[1],this.lineTo(c+e,g+n);break;case"v":g+=s[1],this.lineTo(c+e,g+n);break;case"V":g=s[1],this.lineTo(c+e,g+n);break;case"m":c+=s[1],g+=s[2],this.moveTo(c+e,g+n);break;case"M":c=s[1],g=s[2],this.moveTo(c+e,g+n);break;case"c":l=c+s[5],a=g+s[6],f=c+s[3],p=g+s[4],this.bezierCurveTo(c+s[1]+e,g+s[2]+n,f+e,p+n,l+e,a+n),c=l,g=a;break;case"C":c=s[5],g=s[6],f=s[3],p=s[4],this.bezierCurveTo(s[1]+e,s[2]+n,f+e,p+n,c+e,g+n);break;case"s":l=c+s[3],a=g+s[4],f=2*c-f,p=2*g-p,this.bezierCurveTo(f+e,p+n,c+s[1]+e,g+s[2]+n,l+e,a+n),f=c+s[1],p=g+s[2],c=l,g=a;break;case"S":l=s[3],a=s[4],f=2*c-f,p=2*g-p,this.bezierCurveTo(f+e,p+n,s[1]+e,s[2]+n,l+e,a+n),c=l,g=a,f=s[1],p=s[2];break;case"q":l=c+s[3],a=g+s[4],f=c+s[1],p=g+s[2],this.quadraticCurveTo(f+e,p+n,l+e,a+n),c=l,g=a;break;case"Q":l=s[3],a=s[4],this.quadraticCurveTo(s[1]+e,s[2]+n,l+e,a+n),c=l,g=a,f=s[1],p=s[2];break;case"t":l=c+s[1],a=g+s[2],u[0].match(/[QqTt]/)===null?(f=c,p=g):u[0]==="t"?(f=2*c-h,p=2*g-d):u[0]==="q"&&(f=2*c-f,p=2*g-p),h=f,d=p,this.quadraticCurveTo(f+e,p+n,l+e,a+n),c=l,g=a,f=c+s[1],p=g+s[2];break;case"T":l=s[1],a=s[2],f=2*c-f,p=2*g-p,this.quadraticCurveTo(f+e,p+n,l+e,a+n),c=l,g=a;break;case"a":NC(this,c+e,g+n,[s[1],s[2],s[3],s[4],s[5],s[6]+c+e,s[7]+g+n]),c+=s[6],g+=s[7];break;case"A":NC(this,c+e,g+n,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+n]),c=s[6],g=s[7];break;case"z":case"Z":this.closePath()}u=s}}_runCommandList(t,e=0,n=0,o=1,r=1){if(e!==0||n!==0||o!==1||r!==1)for(let s=0,l=t.length;s<l;++s){const a=t[s].slice();switch(a[0]){case ye.L:this.lineToTransform(a,e,n,o,r);break;case ye.M:this.moveToTransform(a,e,n,o,r);break;case ye.C:this.bezierCurveToTransform(a,e,n,o,r);break;case ye.Q:this.quadraticCurveToTransform(a,e,n,o,r);break;case ye.A:this.arcToTransform(a,e,n,o,r);break;case ye.E:this.ellipseTransform(a,e,n,o,r);break;case ye.R:this.rectTransform(a,e,n,o,r);break;case ye.AT:this.arcToTransform(a,e,n,o,r);break;case ye.Z:this.closePath()}}else this.commandList=t.map(s=>s.slice())}_updateBounds(){this.bounds.clear(),hr(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===He.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return _e(t.p0.y-e.p1.y)}if(this.direction===He.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return _e(t.p0.x-e.p1.x)}return this.curves.reduce((t,e)=>t+e.getLength(),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,n=0;for(let r=0;r<this.curves.length;r++){e=this.curves[r];const s=e.getLength(this.direction);if(n+s>=t)break;n+=s}const o=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(o),angle:e.getAngleAt(o)}}}const An=["l",0,0,0,0,0,0,0];function q2(i,t,e){const n=An[0]=i[0];if(n==="a"||n==="A")An[1]=t*i[1],An[2]=e*i[2],An[3]=i[3],An[4]=i[4],An[5]=i[5],An[6]=t*i[6],An[7]=e*i[7];else if(n==="h"||n==="H")An[1]=t*i[1];else if(n==="v"||n==="V")An[1]=e*i[1];else for(let o=1,r=i.length;o<r;++o)An[o]=(o%2==1?t:e)*i[o];return An}const Z2={alignSelf:"auto"},pi={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new ni},ty={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Zf={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},ey=Object.assign({outerBorder:Object.assign(Object.assign({},Zf),{distance:0}),innerBorder:Object.assign(Object.assign({},Zf),{distance:0})},Zf),Rn={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:`PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,
|
|
5
|
+
`],...function({vnode:d,recurseCount:u}){const c=u>0?`... (${u} recursive calls)`:"",g=!!d.component&&d.component.parent==null,f=` at <${yb(d.component,d.type,g)}`,p=">"+c;return d.props?[f,...fB(d.props),p]:[f+p]}(a))}),l}(o)),console.warn(...r)}}function fB(i){const t=[],e=Object.keys(i);return e.slice(0,3).forEach(n=>{t.push(...cb(n,i[n]))}),e.length>3&&t.push(" ..."),t}function cb(i,t,e){return typeof t=="string"?(t=JSON.stringify(t),e?t:[`${i}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?e?t:[`${i}=${t}`]:ub(t)?(t=cb(i,lf(t.value),!0),e?t:[`${i}=Ref<`,t,">"]):rf(t)?[`${i}=fn${t.name?`<${t.name}>`:""}`]:(t=lf(t),e?t:[`${i}=`,t])}const gb={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"};function hf(i,t,e,n){let o;try{o=n?i(...n):i()}catch(r){(function(s,l,a,h=!0){const d=l?l.vnode:null;if(l){let u=l.parent;const c=l.proxy,g=process.env.NODE_ENV!=="production"?gb[a]:a;for(;u;){const p=u.ec;if(p){for(let m=0;m<p.length;m++)if(p[m](s,c,g)===!1)return}u=u.parent}const f=l.appContext.config.errorHandler;if(f)return void hf(f,null,10,[s,c,g])}(function(u,c,g,f=!0){if(process.env.NODE_ENV!=="production"){const m=gb[c];if(g&&(p=g,Fr.push(p)),af("Unhandled error"+(m?` during execution of ${m}`:"")),g&&Fr.pop(),f)throw u;console.error(u)}else console.error(u);var p})(s,a,d,h)})(r,t,e)}return o}let jh=!1,df=!1;const jn=[];let rr=0;const Bs=[];let lo=null,sr=0;const pB=Promise.resolve();function mB(i){jn.length&&jn.includes(i,jh&&i.allowRecurse?rr+1:rr)||(i.id==null?jn.push(i):jn.splice(function(t){let e=rr+1,n=jn.length;for(;e<n;){const o=e+n>>>1,r=jn[o],s=Vl(r);s<t||s===t&&r.pre?e=o+1:n=o}return e}(i.id),0,i),fb())}function fb(){jh||df||(df=!0,pB.then(pb))}const Vl=i=>i.id==null?1/0:i.id,vB=(i,t)=>{const e=Vl(i)-Vl(t);if(e===0){if(i.pre&&!t.pre)return-1;if(t.pre&&!i.pre)return 1}return e};function pb(i){df=!1,jh=!0,process.env.NODE_ENV!=="production"&&(i=i||new Map),jn.sort(vB);const t=process.env.NODE_ENV!=="production"?e=>mb(i,e):dB;try{for(rr=0;rr<jn.length;rr++){const e=jn[rr];if(e&&e.active!==!1){if(process.env.NODE_ENV!=="production"&&t(e))continue;hf(e,null,14)}}}finally{rr=0,jn.length=0,function(e){if(Bs.length){const n=[...new Set(Bs)];if(Bs.length=0,lo)return void lo.push(...n);for(lo=n,process.env.NODE_ENV!=="production"&&(e=e||new Map),lo.sort((o,r)=>Vl(o)-Vl(r)),sr=0;sr<lo.length;sr++)process.env.NODE_ENV!=="production"&&mb(e,lo[sr])||lo[sr]();lo=null,sr=0}}(i),jh=!1,(jn.length||Bs.length)&&pb(i)}}function mb(i,t){if(i.has(t)){const e=i.get(t);if(e>100){const n=t.ownerInstance,o=n&&Cb(n.type);return af(`Maximum recursive updates exceeded${o?` in component <${o}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`),!0}i.set(t,e+1)}else i.set(t,1)}const jl=new Set;process.env.NODE_ENV!=="production"&&(sf().__VUE_HMR_RUNTIME__={createRecord:uf(function(i,t){return $h.has(i)?!1:($h.set(i,{initialDef:$l(t),instances:new Set}),!0)}),rerender:uf(function(i,t){const e=$h.get(i);e&&(e.initialDef.render=t,[...e.instances].forEach(n=>{t&&(n.render=t,$l(n.type).render=t),n.renderCache=[],n.update()}))}),reload:uf(function(i,t){const e=$h.get(i);if(!e)return;t=$l(t),vb(e.initialDef,t);const n=[...e.instances];for(const r of n){const s=$l(r.type);jl.has(s)||(s!==e.initialDef&&vb(s,t),jl.add(s)),r.appContext.propsCache.delete(r.type),r.appContext.emitsCache.delete(r.type),r.appContext.optionsCache.delete(r.type),r.ceReload?(jl.add(s),r.ceReload(t.styles),jl.delete(s)):r.parent?mB(r.parent.update):r.appContext.reload?r.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}o=()=>{for(const r of n)jl.delete($l(r.type))},cB(o)?Bs.push(...o):lo&&lo.includes(o,o.allowRecurse?sr+1:sr)||Bs.push(o),fb();var o})});const $h=new Map;function $l(i){return rf(t=i)&&"__vccOpts"in t?i.__vccOpts:i;var t}function vb(i,t){uB(i,t);for(const e in i)e==="__file"||e in t||delete i[e]}function uf(i){return(t,e)=>{try{return i(t,e)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let cf;process.env.NODE_ENV;let bb="__VUE_INSTANCE_SETTERS__";(cf=sf()[bb])||(cf=sf()[bb]=[]),cf.push(i=>i);const bB=/(?:^|[-_])(\w)/g,CB=i=>i.replace(bB,t=>t.toUpperCase()).replace(/[-_]/g,"");function Cb(i,t=!0){return rf(i)?i.displayName||i.name:i.name||t&&i.__name}function yb(i,t,e=!1){let n=Cb(t);if(!n&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(n=o[1])}if(!n&&i&&i.parent){const o=r=>{for(const s in r)if(r[s]===t)return s};n=o(i.components||i.parent.type.components)||o(i.appContext.components)}return n?CB(n):e?"App":"Anonymous"}function yB(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var _b,wb={exports:{}};function _B(){return _b||(_b=1,wb.exports=function(){var i=1e3,t=6e4,e=36e5,n="millisecond",o="second",r="minute",s="hour",l="day",a="week",h="month",d="quarter",u="year",c="date",g="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var H=["th","st","nd","rd"],F=B%100;return"["+B+(H[(F-20)%10]||H[F]||H[0])+"]"}},v=function(B,H,F){var P=String(B);return!P||P.length>=H?B:""+Array(H+1-P.length).join(F)+B},C={s:v,z:function(B){var H=-B.utcOffset(),F=Math.abs(H),P=Math.floor(F/60),E=F%60;return(H<=0?"+":"-")+v(P,2,"0")+":"+v(E,2,"0")},m:function B(H,F){if(H.date()<F.date())return-B(F,H);var P=12*(F.year()-H.year())+(F.month()-H.month()),E=H.clone().add(P,h),L=F-E<0,I=H.clone().add(P+(L?-1:1),h);return+(-(P+(F-E)/(L?E-I:I-E))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:h,y:u,w:a,d:l,D:c,h:s,m:r,s:o,ms:n,Q:d}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},w="en",S={};S[w]=m;var y="$isDayjsObject",_=function(B){return B instanceof T||!(!B||!B[y])},R=function B(H,F,P){var E;if(!H)return w;if(typeof H=="string"){var L=H.toLowerCase();S[L]&&(E=L),F&&(S[L]=F,E=L);var I=H.split("-");if(!E&&I.length>1)return B(I[0])}else{var k=H.name;S[k]=H,E=k}return!P&&E&&(w=E),E||!P&&w},A=function(B,H){if(_(B))return B.clone();var F=typeof H=="object"?H:{};return F.date=B,F.args=arguments,new T(F)},x=C;x.l=R,x.i=_,x.w=function(B,H){return A(B,{locale:H.$L,utc:H.$u,x:H.$x,$offset:H.$offset})};var T=function(){function B(F){this.$L=R(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[y]=!0}var H=B.prototype;return H.parse=function(F){this.$d=function(P){var E=P.date,L=P.utc;if(E===null)return new Date(NaN);if(x.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var I=E.match(f);if(I){var k=I[2]-1||0,D=(I[7]||"0").substring(0,3);return L?new Date(Date.UTC(I[1],k,I[3]||1,I[4]||0,I[5]||0,I[6]||0,D)):new Date(I[1],k,I[3]||1,I[4]||0,I[5]||0,I[6]||0,D)}}return new Date(E)}(F),this.init()},H.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},H.$utils=function(){return x},H.isValid=function(){return this.$d.toString()!==g},H.isSame=function(F,P){var E=A(F);return this.startOf(P)<=E&&E<=this.endOf(P)},H.isAfter=function(F,P){return A(F)<this.startOf(P)},H.isBefore=function(F,P){return this.endOf(P)<A(F)},H.$g=function(F,P,E){return x.u(F)?this[P]:this.set(E,F)},H.unix=function(){return Math.floor(this.valueOf()/1e3)},H.valueOf=function(){return this.$d.getTime()},H.startOf=function(F,P){var E=this,L=!!x.u(P)||P,I=x.p(F),k=function(U,$){var Q=x.w(E.$u?Date.UTC(E.$y,$,U):new Date(E.$y,$,U),E);return L?Q:Q.endOf(l)},D=function(U,$){return x.w(E.toDate()[U].apply(E.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice($)),E)},O=this.$W,N=this.$M,W=this.$D,j="set"+(this.$u?"UTC":"");switch(I){case u:return L?k(1,0):k(31,11);case h:return L?k(1,N):k(0,N+1);case a:var G=this.$locale().weekStart||0,Y=(O<G?O+7:O)-G;return k(L?W-Y:W+(6-Y),N);case l:case c:return D(j+"Hours",0);case s:return D(j+"Minutes",1);case r:return D(j+"Seconds",2);case o:return D(j+"Milliseconds",3);default:return this.clone()}},H.endOf=function(F){return this.startOf(F,!1)},H.$set=function(F,P){var E,L=x.p(F),I="set"+(this.$u?"UTC":""),k=(E={},E[l]=I+"Date",E[c]=I+"Date",E[h]=I+"Month",E[u]=I+"FullYear",E[s]=I+"Hours",E[r]=I+"Minutes",E[o]=I+"Seconds",E[n]=I+"Milliseconds",E)[L],D=L===l?this.$D+(P-this.$W):P;if(L===h||L===u){var O=this.clone().set(c,1);O.$d[k](D),O.init(),this.$d=O.set(c,Math.min(this.$D,O.daysInMonth())).$d}else k&&this.$d[k](D);return this.init(),this},H.set=function(F,P){return this.clone().$set(F,P)},H.get=function(F){return this[x.p(F)]()},H.add=function(F,P){var E,L=this;F=Number(F);var I=x.p(P),k=function(N){var W=A(L);return x.w(W.date(W.date()+Math.round(N*F)),L)};if(I===h)return this.set(h,this.$M+F);if(I===u)return this.set(u,this.$y+F);if(I===l)return k(1);if(I===a)return k(7);var D=(E={},E[r]=t,E[s]=e,E[o]=i,E)[I]||1,O=this.$d.getTime()+F*D;return x.w(O,this)},H.subtract=function(F,P){return this.add(-1*F,P)},H.format=function(F){var P=this,E=this.$locale();if(!this.isValid())return E.invalidDate||g;var L=F||"YYYY-MM-DDTHH:mm:ssZ",I=x.z(this),k=this.$H,D=this.$m,O=this.$M,N=E.weekdays,W=E.months,j=E.meridiem,G=function($,Q,gt,vt){return $&&($[Q]||$(P,L))||gt[Q].slice(0,vt)},Y=function($){return x.s(k%12||12,$,"0")},U=j||function($,Q,gt){var vt=$<12?"AM":"PM";return gt?vt.toLowerCase():vt};return L.replace(p,function($,Q){return Q||function(gt){switch(gt){case"YY":return String(P.$y).slice(-2);case"YYYY":return x.s(P.$y,4,"0");case"M":return O+1;case"MM":return x.s(O+1,2,"0");case"MMM":return G(E.monthsShort,O,W,3);case"MMMM":return G(W,O);case"D":return P.$D;case"DD":return x.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return G(E.weekdaysMin,P.$W,N,2);case"ddd":return G(E.weekdaysShort,P.$W,N,3);case"dddd":return N[P.$W];case"H":return String(k);case"HH":return x.s(k,2,"0");case"h":return Y(1);case"hh":return Y(2);case"a":return U(k,D,!0);case"A":return U(k,D,!1);case"m":return String(D);case"mm":return x.s(D,2,"0");case"s":return String(P.$s);case"ss":return x.s(P.$s,2,"0");case"SSS":return x.s(P.$ms,3,"0");case"Z":return I}return null}($)||I.replace(":","")})},H.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},H.diff=function(F,P,E){var L,I=this,k=x.p(P),D=A(F),O=(D.utcOffset()-this.utcOffset())*t,N=this-D,W=function(){return x.m(I,D)};switch(k){case u:L=W()/12;break;case h:L=W();break;case d:L=W()/3;break;case a:L=(N-O)/6048e5;break;case l:L=(N-O)/864e5;break;case s:L=N/e;break;case r:L=N/t;break;case o:L=N/i;break;default:L=N}return E?L:x.a(L)},H.daysInMonth=function(){return this.endOf(h).$D},H.$locale=function(){return S[this.$L]},H.locale=function(F,P){if(!F)return this.$L;var E=this.clone(),L=R(F,P,!0);return L&&(E.$L=L),E},H.clone=function(){return x.w(this.$d,this)},H.toDate=function(){return new Date(this.valueOf())},H.toJSON=function(){return this.isValid()?this.toISOString():null},H.toISOString=function(){return this.$d.toISOString()},H.toString=function(){return this.$d.toUTCString()},B}(),M=T.prototype;return A.prototype=M,[["$ms",n],["$s",o],["$m",r],["$H",s],["$W",l],["$M",h],["$y",u],["$D",c]].forEach(function(B){M[B[1]]=function(H){return this.$g(H,B[0],B[1])}}),A.extend=function(B,H){return B.$i||(B(H,T,A),B.$i=!0),A},A.locale=R,A.isDayjs=_,A.unix=function(B){return A(1e3*B)},A.en=S[w],A.Ls=S,A.p={},A}()),wb.exports}var $n=yB(_B()),Sb=typeof global=="object"&&global&&global.Object===Object&&global,wB=typeof self=="object"&&self&&self.Object===Object&&self,Mo=Sb||wB||Function("return this")(),Ps=Mo.Symbol,xb=Object.prototype,SB=xb.hasOwnProperty,xB=xb.toString,Gl=Ps?Ps.toStringTag:void 0,AB=Object.prototype.toString,Ab=Ps?Ps.toStringTag:void 0;function Ul(i){return i==null?i===void 0?"[object Undefined]":"[object Null]":Ab&&Ab in Object(i)?function(t){var e=SB.call(t,Gl),n=t[Gl];try{t[Gl]=void 0;var o=!0}catch{}var r=xB.call(t);return o&&(e?t[Gl]=n:delete t[Gl]),r}(i):function(t){return AB.call(t)}(i)}function Kl(i){return i!=null&&typeof i=="object"}var gf=Array.isArray;function Gh(i){var t=typeof i;return i!=null&&(t=="object"||t=="function")}function Rb(i){if(!Gh(i))return!1;var t=Ul(i);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"}var Tb,ff=Mo["__core-js_shared__"],Mb=(Tb=/[^.]+$/.exec(ff&&ff.keys&&ff.keys.IE_PROTO||""))?"Symbol(src)_1."+Tb:"",RB=Function.prototype.toString;function Ir(i){if(i!=null){try{return RB.call(i)}catch{}try{return i+""}catch{}}return""}var TB=/^\[object .+?Constructor\]$/,MB=Function.prototype,BB=Object.prototype,PB=MB.toString,HB=BB.hasOwnProperty,EB=RegExp("^"+PB.call(HB).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kB(i){return!(!Gh(i)||(t=i,Mb&&Mb in t))&&(Rb(i)?EB:TB).test(Ir(i));var t}function Dr(i,t){var e=function(n,o){return n==null?void 0:n[o]}(i,t);return kB(e)?e:void 0}var pf=Dr(Mo,"WeakMap"),Bb=Object.create,LB=function(){function i(){}return function(t){if(!Gh(t))return{};if(Bb)return Bb(t);i.prototype=t;var e=new i;return i.prototype=void 0,e}}(),Pb=function(){try{var i=Dr(Object,"defineProperty");return i({},"",{}),i}catch{}}(),FB=/^(?:0|[1-9]\d*)$/;function IB(i,t){var e=typeof i;return!!(t=t??9007199254740991)&&(e=="number"||e!="symbol"&&FB.test(i))&&i>-1&&i%1==0&&i<t}function Hb(i,t){return i===t||i!=i&&t!=t}var DB=Object.prototype.hasOwnProperty;function OB(i,t,e){var n=i[t];DB.call(i,t)&&Hb(n,e)&&(e!==void 0||t in i)||function(o,r,s){r=="__proto__"&&Pb?Pb(o,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):o[r]=s}(i,t,e)}function Eb(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=9007199254740991}var zB=Object.prototype;function kb(i){var t=i&&i.constructor;return i===(typeof t=="function"&&t.prototype||zB)}function Lb(i){return Kl(i)&&Ul(i)=="[object Arguments]"}var Fb=Object.prototype,WB=Fb.hasOwnProperty,NB=Fb.propertyIsEnumerable,VB=Lb(function(){return arguments}())?Lb:function(i){return Kl(i)&&WB.call(i,"callee")&&!NB.call(i,"callee")},Ib=typeof Ke=="object"&&Ke&&!Ke.nodeType&&Ke,Db=Ib&&typeof module=="object"&&module&&!module.nodeType&&module,Ob=Db&&Db.exports===Ib?Mo.Buffer:void 0,zb=(Ob?Ob.isBuffer:void 0)||function(){return!1},ze={};function mf(i){return function(t){return i(t)}}ze["[object Float32Array]"]=ze["[object Float64Array]"]=ze["[object Int8Array]"]=ze["[object Int16Array]"]=ze["[object Int32Array]"]=ze["[object Uint8Array]"]=ze["[object Uint8ClampedArray]"]=ze["[object Uint16Array]"]=ze["[object Uint32Array]"]=!0,ze["[object Arguments]"]=ze["[object Array]"]=ze["[object ArrayBuffer]"]=ze["[object Boolean]"]=ze["[object DataView]"]=ze["[object Date]"]=ze["[object Error]"]=ze["[object Function]"]=ze["[object Map]"]=ze["[object Number]"]=ze["[object Object]"]=ze["[object RegExp]"]=ze["[object Set]"]=ze["[object String]"]=ze["[object WeakMap]"]=!1;var Wb=typeof Ke=="object"&&Ke&&!Ke.nodeType&&Ke,Yl=Wb&&typeof module=="object"&&module&&!module.nodeType&&module,vf=Yl&&Yl.exports===Wb&&Sb.process,Hs=function(){try{var i=Yl&&Yl.require&&Yl.require("util").types;return i||vf&&vf.binding&&vf.binding("util")}catch{}}(),Nb=Hs&&Hs.isTypedArray,jB=Nb?mf(Nb):function(i){return Kl(i)&&Eb(i.length)&&!!ze[Ul(i)]},$B=Object.prototype.hasOwnProperty;function GB(i,t){var e=gf(i),n=!e&&VB(i),o=!e&&!n&&zb(i),r=!e&&!n&&!o&&jB(i),s=e||n||o||r,l=s?function(d,u){for(var c=-1,g=Array(d);++c<d;)g[c]=u(c);return g}(i.length,String):[],a=l.length;for(var h in i)!$B.call(i,h)||s&&(h=="length"||o&&(h=="offset"||h=="parent")||r&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||IB(h,a))||l.push(h);return l}function Vb(i,t){return function(e){return i(t(e))}}var UB=Vb(Object.keys,Object),KB=Object.prototype.hasOwnProperty;function YB(i){return(t=i)!=null&&Eb(t.length)&&!Rb(t)?GB(i):function(e){if(!kb(e))return UB(e);var n=[];for(var o in Object(e))KB.call(e,o)&&o!="constructor"&&n.push(o);return n}(i);var t}var Xl=Dr(Object,"create"),XB=Object.prototype.hasOwnProperty,qB=Object.prototype.hasOwnProperty;function Or(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}function Uh(i,t){for(var e=i.length;e--;)if(Hb(i[e][0],t))return e;return-1}Or.prototype.clear=function(){this.__data__=Xl?Xl(null):{},this.size=0},Or.prototype.delete=function(i){var t=this.has(i)&&delete this.__data__[i];return this.size-=t?1:0,t},Or.prototype.get=function(i){var t=this.__data__;if(Xl){var e=t[i];return e==="__lodash_hash_undefined__"?void 0:e}return XB.call(t,i)?t[i]:void 0},Or.prototype.has=function(i){var t=this.__data__;return Xl?t[i]!==void 0:qB.call(t,i)},Or.prototype.set=function(i,t){var e=this.__data__;return this.size+=this.has(i)?0:1,e[i]=Xl&&t===void 0?"__lodash_hash_undefined__":t,this};var ZB=Array.prototype.splice;function Bo(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}Bo.prototype.clear=function(){this.__data__=[],this.size=0},Bo.prototype.delete=function(i){var t=this.__data__,e=Uh(t,i);return!(e<0)&&(e==t.length-1?t.pop():ZB.call(t,e,1),--this.size,!0)},Bo.prototype.get=function(i){var t=this.__data__,e=Uh(t,i);return e<0?void 0:t[e][1]},Bo.prototype.has=function(i){return Uh(this.__data__,i)>-1},Bo.prototype.set=function(i,t){var e=this.__data__,n=Uh(e,i);return n<0?(++this.size,e.push([i,t])):e[n][1]=t,this};var ql=Dr(Mo,"Map");function Kh(i,t){var e,n,o=i.__data__;return((n=typeof(e=t))=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null)?o[typeof t=="string"?"string":"hash"]:o.map}function Es(i){var t=-1,e=i==null?0:i.length;for(this.clear();++t<e;){var n=i[t];this.set(n[0],n[1])}}Es.prototype.clear=function(){this.size=0,this.__data__={hash:new Or,map:new(ql||Bo),string:new Or}},Es.prototype.delete=function(i){var t=Kh(this,i).delete(i);return this.size-=t?1:0,t},Es.prototype.get=function(i){return Kh(this,i).get(i)},Es.prototype.has=function(i){return Kh(this,i).has(i)},Es.prototype.set=function(i,t){var e=Kh(this,i),n=e.size;return e.set(i,t),this.size+=e.size==n?0:1,this};var JB=Vb(Object.getPrototypeOf,Object);function ks(i){var t=this.__data__=new Bo(i);this.size=t.size}ks.prototype.clear=function(){this.__data__=new Bo,this.size=0},ks.prototype.delete=function(i){var t=this.__data__,e=t.delete(i);return this.size=t.size,e},ks.prototype.get=function(i){return this.__data__.get(i)},ks.prototype.has=function(i){return this.__data__.has(i)},ks.prototype.set=function(i,t){var e=this.__data__;if(e instanceof Bo){var n=e.__data__;if(!ql||n.length<199)return n.push([i,t]),this.size=++e.size,this;e=this.__data__=new Es(n)}return e.set(i,t),this.size=e.size,this};var QB=Object.prototype.propertyIsEnumerable,jb=Object.getOwnPropertySymbols,tP=jb?function(i){return i==null?[]:(i=Object(i),function(t,e){for(var n=-1,o=t==null?0:t.length,r=0,s=[];++n<o;){var l=t[n];e(l,n,t)&&(s[r++]=l)}return s}(jb(i),function(t){return QB.call(i,t)}))}:function(){return[]};function eP(i){return function(t,e,n){var o=e(t);return gf(t)?o:function(r,s){for(var l=-1,a=s.length,h=r.length;++l<a;)r[h+l]=s[l];return r}(o,n(t))}(i,YB,tP)}var bf=Dr(Mo,"DataView"),Cf=Dr(Mo,"Promise"),yf=Dr(Mo,"Set"),$b="[object Map]",Gb="[object Promise]",Ub="[object Set]",Kb="[object WeakMap]",Yb="[object DataView]",iP=Ir(bf),nP=Ir(ql),oP=Ir(Cf),rP=Ir(yf),sP=Ir(pf),Po=Ul;(bf&&Po(new bf(new ArrayBuffer(1)))!=Yb||ql&&Po(new ql)!=$b||Cf&&Po(Cf.resolve())!=Gb||yf&&Po(new yf)!=Ub||pf&&Po(new pf)!=Kb)&&(Po=function(i){var t=Ul(i),e=t=="[object Object]"?i.constructor:void 0,n=e?Ir(e):"";if(n)switch(n){case iP:return Yb;case nP:return $b;case oP:return Gb;case rP:return Ub;case sP:return Kb}return t});var lP=Object.prototype.hasOwnProperty,Xb=Mo.Uint8Array;function _f(i){var t=new i.constructor(i.byteLength);return new Xb(t).set(new Xb(i)),t}var aP=/\w*$/,qb=Ps?Ps.prototype:void 0,Zb=qb?qb.valueOf:void 0;function hP(i,t,e){var n,o,r,s,l,a=i.constructor;switch(t){case"[object ArrayBuffer]":return _f(i);case"[object Boolean]":case"[object Date]":return new a(+i);case"[object DataView]":return l=_f((s=i).buffer),new s.constructor(l,s.byteOffset,s.byteLength);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 function(h){var d=_f(h.buffer);return new h.constructor(d,h.byteOffset,h.length)}(i);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(i);case"[object RegExp]":return(r=new(o=i).constructor(o.source,aP.exec(o))).lastIndex=o.lastIndex,r;case"[object Symbol]":return n=i,Zb?Object(Zb.call(n)):{}}}var Jb=Hs&&Hs.isMap,dP=Jb?mf(Jb):function(i){return Kl(i)&&Po(i)=="[object Map]"},Qb=Hs&&Hs.isSet,uP=Qb?mf(Qb):function(i){return Kl(i)&&Po(i)=="[object Set]"},tC="[object Arguments]",eC="[object Function]",iC="[object Object]",Oe={};function Yh(i,t,e,n,o,r){var s;if(s!==void 0)return s;if(!Gh(i))return i;var l=gf(i);if(l)s=function(c){var g=c.length,f=new c.constructor(g);return g&&typeof c[0]=="string"&&lP.call(c,"index")&&(f.index=c.index,f.input=c.input),f}(i);else{var a=Po(i),h=a==eC||a=="[object GeneratorFunction]";if(zb(i))return i.slice();if(a==iC||a==tC||h&&!o)s=h?{}:function(c){return typeof c.constructor!="function"||kb(c)?{}:LB(JB(c))}(i);else{if(!Oe[a])return o?i:{};s=hP(i,a)}}r||(r=new ks);var d=r.get(i);if(d)return d;r.set(i,s),uP(i)?i.forEach(function(c){s.add(Yh(c,t,e,c,i,r))}):dP(i)&&i.forEach(function(c,g){s.set(g,Yh(c,t,e,g,i,r))});var u=l?void 0:eP(i);return function(c,g){for(var f=-1,p=c==null?0:c.length;++f<p&&g(c[f],f,c)!==!1;);}(u||i,function(c,g){u&&(c=i[g=c]),OB(s,g,Yh(c,t,e,g,i,r))}),s}Oe[tC]=Oe["[object Array]"]=Oe["[object ArrayBuffer]"]=Oe["[object DataView]"]=Oe["[object Boolean]"]=Oe["[object Date]"]=Oe["[object Float32Array]"]=Oe["[object Float64Array]"]=Oe["[object Int8Array]"]=Oe["[object Int16Array]"]=Oe["[object Int32Array]"]=Oe["[object Map]"]=Oe["[object Number]"]=Oe[iC]=Oe["[object RegExp]"]=Oe["[object Set]"]=Oe["[object String]"]=Oe["[object Symbol]"]=Oe["[object Uint8Array]"]=Oe["[object Uint8ClampedArray]"]=Oe["[object Uint16Array]"]=Oe["[object Uint32Array]"]=!0,Oe["[object Error]"]=Oe[eC]=Oe["[object WeakMap]"]=!1;function Xh(i){return Yh(i,5)}const _i=(i,t)=>{if(typeof i=="string"&&typeof t=="string")return i.toLocaleLowerCase().includes(t.toLocaleLowerCase());if(typeof i=="string"&&Array.isArray(t)){const e=t.length;for(let n=0;n<e;n++){const o=t[n];if(typeof o=="string"&&i.toLocaleLowerCase().includes(o.toLocaleLowerCase()))return!0}}return!1},wn=(i,t)=>Object.prototype.hasOwnProperty.call(i,t),qh=i=>{const t=[];for(const e of i)e.conditions?t.push(...qh(e.conditions)):(e==null?void 0:e.dataType)==="component"&&t.push(e);return t},cP=["table","bar","combograph","line","pie","radar","scatter","list","circulate"];let nC=new Map;const gP=["keyValue","conditionKey","conditionLabel","conditionName","conditionValueType","customValue","id","keyName"],Zh=i=>nC.get(i),oC=(i,t)=>{if(t)wn(i,"indexCode")&&(i.hrpIndexCode=i.indexCode,delete i.indexCode),wn(i,"indexCodeNum")&&(i.hrpIndexCodeNum=i.indexCodeNum,delete i.indexCodeNum),wn(i,"dataType")&&delete i.dataType;else{const{calcWays:e=[],dateCalcTypes:n=[],activeKey:o,componentId:r=""}=i;if(o===5&&(e!=null&&e.length)&&(n!=null&&n.length)&&r){const s=e[0].split("-");(s==null?void 0:s.length)>1&&s[0]==="rangeValue"&&(i.calcWays=((l,a={})=>{const{around:h,unit:d,id:u}=l;let c="";const{pageMode:g="",componentList:f=[]}=(a==null?void 0:a.graphicConfig)||{};let p=null,m=null;if(g==="design"){const v=f==null?void 0:f.find(A=>A.id===u);if(!v)return[];const{interval:C,intervalUnit:w,startTime:S,endTime:y,operate:_,useCurrentTime:R}=v||{};if(R&&(p=$n().subtract(C,w),m=$n()),S&&(p=$n(S)),y&&(m=$n(y)),_){const{type:A,value:x,mode:T}=_;switch(A){case"add":p=p&&p.add(x,T),m=m&&m.add(x,T);break;case"minus":p=p&&p.subtract(x,T),m=m&&m.subtract(x,T)}}}else{const v=Zh(u)||{};ji(v.startTime)&&(p=$n(ji(v.startTime))),ji(v.endTime)&&(m=$n(ji(v.endTime)))}return p&&m&&(c=`${h==="before"?"-":""}${m.diff(p,d.toLowerCase())+1}`),c?[c]:[]})({around:s[1],unit:n[0],id:r})),delete i.radioValue}if(wn(i,"dataType")){if(i.fieldType==="DATE"&&(i.label=i.fieldName),i.dataType==="component")if(i.fieldValue==="PARENT"){let s=i.modelKey;s&&i.prop&&(s+=`-${i.prop}`),i.fieldValue="${"+s+"}"}else i.fieldValue="${"+i.fieldValue+"}";delete i.dataType}wn(i,"activeKey")&&delete i.activeKey,wn(i,"radioValue")&&delete i.radioValue,wn(i,"indexCode")&&(i.hrpIndexCode=i.indexCode,delete i.indexCode),wn(i,"indexCodeNum")&&(i.hrpIndexCodeNum=i.indexCodeNum,delete i.indexCodeNum),i.dataType!=="component"&&i.useCurrentTime&&(i.fieldValue=$n().format(i.dateFormat)),wn(i,"modelKey")&&delete i.modelKey,wn(i,"prop")&&delete i.prop,delete i.useCurrentTime}},zr=(i,t)=>{const e=[];return i!=null&&i.length&&Xh(i).forEach(n=>{if(n.join&&n.conditions){const o=!n.conditions.some(r=>r.join&&r.conditions);n.conditions.forEach((r,s)=>{oC(r,t);const l={};if(s<n.conditions.length-1&&(l.join=n.join),o)e.push(Object.assign(Object.assign({},l),r));else if(r.join&&r.conditions){const a=t?"sqlConditions":"conditions";e.push(Object.assign({[a]:zr([r],t)},l))}else e.push(Object.assign(Object.assign({},l),r))})}else oC(n,t),e.push(n)}),e},wf=(i={},t)=>{if(i!=null&&i.sortCpnts&&t){const S=lC(i);S&&(t.sort=S)}const{label:e,name:n,location:o,show:r,indexCode:s,indexCodeNum:l,calcType:a="COLUMN",builtInFormula:h,builtInValueSource:d,builtInCalcWay:u,formula:c,conditions:g,aggregate:f,distinct:p,dimByCount:m,dataTo:v}=i;let C;if(g&&(C=zr(g)),a==="COMPONENT"){const S={};return Jh(S,d),{label:e.trim(),columnName:n,show:r,calcType:a,componentAlias:u,componentValue:S.fieldValue||null}}const w={label:e.trim(),columnName:n,location:o,show:r,calcType:v==="1"?"VIEW":a,hrpIndexCode:s,hrpIndexCodeNum:l,aggregate:f,builtInFormula:h,builtInValueSource:d,formula:c,conditions:C};if(h!=="DATE_OFFSET")return n==="the_count"&&(w.calcType="AGGREGATE",w.distinct=!!p,w.typeGuid=m),Object.assign(Object.assign({},w),{builtInCalcWay:u});{const S=u.split("-");if((S==null?void 0:S.length)===3){let y=S[0];return S[2]==="before"&&S[0]!=="0"&&(y=`-${S[0]}`),Object.assign(Object.assign({},w),{calcWays:[y],dateCalcTypes:[S[1]]})}}},fP=i=>{if(!i)return[];const t=Xh((i==null?void 0:i.controlList)||[]).filter(p=>p.conditionKey!=="parentCode"),{classificationList:e=[],rowHeaderList:n=[],dimensionList:o=[],seriesList:r=[],leftAxisList:s=[],rightAxisList:l=[],queryColumnList:a=[],indexLibColumns:h=[],indicators:d=[]}=i;sC(t);const u=[...e,...n,...o,...r,...s,...l,...a,...h,...d],c=[];for(const p of u){const m=qh((p==null?void 0:p.conditions)||[]);if(m!=null&&m.length){const v=m.filter(C=>(C==null?void 0:C.dataType)==="component").map(C=>{const w={};return C!=null&&C.dateFormat&&(w.format=C.dateFormat),C.fieldValue==="PARENT"&&(w.id="PARENT",w.keyName=C.modelKey,w.modelKey=C.modelKey,w.prop=C.prop),Object.assign({conditionKey:C.fieldName,conditionLabel:C.fieldName,conditionName:C.fieldName,conditionValueType:C.fieldType,id:C.componentId,keyName:C.fieldValue,rule:C.rule,notGlobal:!0,indexCode:C.indexCode,typeGuid:C.typeGuid,indexCodeNum:C.indexCodeNum},w)});if(v!=null&&v.length)for(const C of v)c.find(w=>w.keyName===C.keyName)||c.push(C)}}const g=c.length,f=t;for(let p=0;p<g;p++){const m=c[p];if((m==null?void 0:m.conditionKey)==="parentCode")continue;const{id:v,keyName:C,prop:w,format:S,modelKey:y,dataType:_="component",customValue:R}=m,A=rC(m);Jh(A,v,{prop:w,dateFormat:S,modelKey:y,keyName:C}),_===""&&(A.fieldValue=R||""),f.push(A)}for(let p=f.length-1;p>=0;p--){const m=f[p];m.globalCondition||qh(f).find(v=>v.alias===m.alias&&v.globalCondition)&&f.splice(p,1)}return f};function rC(i){const{id:t,keyName:e,conditionLabel:n,conditionKey:o,conditionValueType:r,prop:s,rule:l="NONE",notGlobal:a=!1,indexCode:h,typeGuid:d,indexCodeNum:u,dataType:c="component"}=i;let g=e||t;g&&s&&(g+=`-${s}`);let f=l;return f==="NONE"&&(f=["startTime","endTime"].includes(s)?s==="startTime"?"GREATER_EQUAL":"LESS_EQUAL":e!=null&&e.includes("startTime")?s==="GREATER_EQUAL":e!=null&&e.includes("endTime")?s==="LESS_EQUAL":"EQUAL"),t==="PARENT"&&(g=i.modelKey,g&&s&&(g+=`-${s}`),f=l),{rule:f,label:n,fieldName:o,fieldValue:"",valueType:r,alias:g,globalCondition:!a,indexCode:h,typeGuid:d,indexCodeNum:u,dataType:c}}function sC(i){if(i!=null&&i.length)for(const t of i)if(t!=null&&t.conditions)sC(t.conditions);else{const{id:e,keyName:n,prop:o,modelKey:r,format:s,dataType:l="component",customValue:a}=t,h=rC(t);Jh(h,e,{prop:o,dateFormat:s,modelKey:r,keyName:n}),l===""&&(h.fieldValue=a||"");for(const d in h)t[d]=h[d];for(const d of gP)delete t[d]}}function Jh(i,t,e){const{prop:n="",dateFormat:o="",modelKey:r="",keyName:s="",operateValue:l,operateMode:a,operateType:h}=e||{},d=r||s;if(t==="PARENT"&&d&&n){const C=window.config.record;let w=n,S=o;const y=n.match(/\{(.+?)\}/g);if(y!=null&&y.length){const _=y[0].slice(1,-1).trim();w=n.replace(y[0],""),S=_,i.dateFormat=S}if(C&&C[d]){const _=ji(C[d][w]);$n.isDayjs(_)?i.fieldValue=_.format(S||"YYYY-MM-DD"):i.fieldValue=_}return}const u=Zh(t)||{},{value:c,format:g="YYYY-MM-DD",type:f="",useCurrentTime:p,RECORD:m}=u||{},v=o||g;if(_i(f,"date")){let C;if(C=p?c?ji(c):$n():ji(c),typeof C=="string"&&(C=$n(C)),l&&a&&h)switch(h){case"add":C=C.add(l,a);break;case"minus":C=C.subtract(l,a)}i.fieldValue=C==null?void 0:C.format(v),i.dateFormat=v}else if(_i(f,"rangepicker")){let C=n;if(!n){const S=s&&s.split("-");S!=null&&S.length&&(C=S[S.length-1])}if(!C)return;let w=null;if(ji(u[C])&&(w=$n(ji(u[C]))),l&&a&&h){if(l==="rangeValue"){if(u.startTime&&u.endTime){const S=ji(u.endTime).diff(ji(u.startTime),a)+1;switch(h){case"add":w=w&&w.add(S,a);break;case"minus":w=w&&w.subtract(S,a)}}}else if(!isNaN(+l))switch(h){case"add":w=w&&w.add(l,a);break;case"minus":w=w&&w.subtract(l,a)}}if(w&&(i.fieldValue=w==null?void 0:w.format(v)),C==="rangeValue"&&u.startTime&&u.endTime){const S=function(y){const _=y.split("-");let R="";if(_!=null&&_.length)switch(_[_.length-1]){case"YYYY":R="year";break;case"MM":R="month";break;case"DD":R="day"}return R}(v);S&&(i.fieldValue=ji(u.endTime).diff(ji(u.startTime),S)+1)}i.dateFormat=v}else _i(f,cP)?i.fieldValue=r&&m?m[r]:!r&&m?m.value:ji(c):i.fieldValue=ji(c)}const Qh=i=>{var t;if(i){const e=Array.isArray(i)?Xh(i):[Xh(i)];let n="",o=[];const r=[],s=[],l=[];for(const a of e){if(a.defaultCode&&(a.label=a.columnName,delete a.defaultCode),a.type==="CUSTOM"&&(o=a.customOrderColumns),n=a.type,r.push(a.label),(t=a.columnName)===null||t===void 0?void 0:t.includes("_ecanrepeat_")){const h=a.columnName.split("_ecanrepeat_");s.push(h[0])}else s.push(a.columnName);l.push(a.order)}return n!=="CUSTOM"&&(r==null?void 0:r.length)>1&&(n="COMBINATION"),n==="CUSTOM"?{label:r.join(","),columnName:s.join(","),type:n,customOrderColumns:o}:{label:r.join(","),columnName:s.join(","),order:l.join(","),type:n}}return i},lC=i=>{const{sortCpnts:t=[]}=i;let e,n="";for(const o of t){const r=Zh(o)||{},{type:s,RECORD:l}=r;if(_i(s,"image")&&_i(l==null?void 0:l.value,["asc","desc"])){n=l.value.toUpperCase();break}}return n&&(e={label:i.label,columnName:i.name,order:n,type:"NORMAL"}),e},aC=(i,t={})=>{var e,n,o,r,s,l,a,h;const{graphicConfig:d,type:u,globalModel:c,isGroupTable:g=!1}=i;c&&(nC=c);const f=_i(u,"pivottable");let p,{source:m,dataViewId:v,plugin:C="1",layer:w,chartType:S,classificationList:y=[],rowHeaderList:_=[],dimensionList:R=[],seriesList:A=[],leftAxisList:x=[],rightAxisList:T=[],queryColumnList:M=[],indexLibColumns:B=[],indicators:H=[],controlList:F=[],formFields:P={},variableList:E=[],variableConditions:L=[],dataSourceId:I="",idxLibMode:k,preview:D=!1,edvDataSetId:O,compositeIndicator:N}=d||{},W=[];if((d==null?void 0:d.pageMode)==="design"?(W=((e=d.sqlConditions)!==null&&e!==void 0?e:[]).map(lt=>{const ft={};if(wn(lt,"globalCondition")||lt.join||(ft.globalCondition=!0),!lt.join){const dt=lt.rule||"EQUAL";ft.rule=dt==="NONE"?"EQUAL":dt}return Object.assign(Object.assign({},lt),ft)}),L!=null&&L.length&&(W=W.concat(L))):(W=fP(d),E!=null&&E.length&&(W=W.concat(function(lt){const ft=[];if(lt!=null&<.length){for(const dt of lt)if(dt.variableName){const at={variateName:dt.variableName,globalCondition:!1,valueType:dt.variableType,alias:dt.keyName||""};Jh(at,dt.id,{dateFormat:dt.format,prop:dt.dateTypeValue,keyName:dt.keyName,operateType:dt.operateType,operateMode:dt.operateMode,operateValue:dt.operateValue}),dt.dataType===""&&(at.fieldValue=dt.variableValue),dt.format&&(at.dateFormat=dt.format),dt.label&&(at.label=dt.label),ft.push(at)}}return ft}(E)))),W==null?void 0:W.length){const lt=W.filter(dt=>dt.globalCondition),ft=W.filter(dt=>!dt.globalCondition);(lt==null?void 0:lt.length)>1&&(W=[{join:"&&",conditions:lt},...ft])}W!=null&&W.length&&(W=zr(W,"1")),w==null&&(w=_i(u,["table","card"])||_i(u,["list","circulate"])&&(y==null?void 0:y.length)>1?"1":_i(u,["select","checkbox","radio"])?"3":_i(u,["indexPanel"])?"4":"2"),_i(u,["indexPanel"])&&(C="3");const j=[];let G,Y="";if(Array.isArray(y)&&y.length>0&&(!["ecanList","ecanCirculate"].includes(u)||(y==null?void 0:y.length)===1)){const lt=y.length;for(let ft=0;ft<lt;ft++){const dt=y[ft]||{},{label:at="",name:St="",show:X=!1,sort:xt,customGroup:Nt,conditions:mt,dateFormat:Rt,typeGuid:te="",truncations:qt=[]}=dt;if(X||lt===1){Y=te,p={label:at.trim(),columnName:St,show:X,sort:lC(dt)||Qh(xt)||xt,customGroup:Nt,conditions:zr(mt),typeGuid:te},Rt&&(p.dateFormat=Rt),St!=="the_date"||p.dateFormat||(p.dateFormat="YYYY-MM-DD");const st={};if(Array.isArray(qt)&&qt.length>0){const ae=qt.length;for(let we=0;we<ae;we++){const ee=qt[we]||{},{rule:Se="",num:Kt=0,name:_t=""}=ee;Se&&Kt&&(st.num=Kt,st.rule=Se,_t&&(st.otherGroupName=_t))}}if(!((n=Object.keys(st))===null||n===void 0)&&n.length&&(p.truncation=st),!_i(u,["scatter","valueline"]))break;j.push(p)}}}if(Array.isArray(A)&&A.length>0){const lt=A.length;for(let ft=0;ft<lt;ft++){const dt=A[ft]||{},{label:at="",name:St="",show:X=!1,sort:xt,customGroup:Nt,conditions:mt,typeGuid:Rt,dateFormat:te=""}=dt;if(X||lt===1){G={label:at.trim(),columnName:St,show:X,sort:Qh(xt),customGroup:Nt,conditions:zr(mt),typeGuid:Rt},te?G.dateFormat=te:St==="the_date"&&(G.dateFormat="YYYY-MM-DD");break}}}const U=[];x==null||x.forEach(lt=>{lt.location="LEFT",U.push(wf(lt,p))}),T==null||T.forEach(lt=>{lt.location="RIGHT",U.push(wf(lt,p))});let $=H;t!=null&&t.pivotTableCal&&($=((o=t.pivotTableCal)===null||o===void 0?void 0:o.indicators)||[]),$==null||$.forEach(lt=>{lt.location="LEFT",U.push(wf(lt,p))});const Q=[];["ecanList","ecanCirculate"].includes(u)&&(y==null?void 0:y.length)>1&&(M=y),t!=null&&t.pivotTableCal&&(M=((r=t.pivotTableCal)===null||r===void 0?void 0:r.dimensions)||[]),M==null||M.forEach(lt=>{const{label:ft,name:dt,location:at,show:St,indexCode:X,sort:xt,typeGuid:Nt,indexCodeNum:mt,dateFormat:Rt,conditions:te}=lt;let qt=Qh(xt);if(t.sort){const{field:ae,order:we}=t.sort;let ee=U.find(Se=>Se.label===ae);ee||ft!==ae||(ee=lt),ee&&(qt={columnName:ee.columnName,label:t.sort.field,order:we.toUpperCase(),type:"NORMAL"})}const st={label:ft,columnName:dt,location:at,show:St,sort:qt,calcType:"COLUMN",hrpIndexCode:X,hrpIndexCodeNum:mt,conditions:zr(te),typeGuid:Nt};Rt&&(st.dateFormat=Rt),dt!=="the_date"||st.dateFormat||(st.dateFormat="YYYY-MM-DD"),Q.push(st)});const gt=[];["ecanTable"].includes(u)&&d.isIndexSet&&B.forEach(lt=>{const ft={label:lt.label,calcType:lt.calcType,show:lt.show};lt.formula&&(ft.formula=lt.formula),gt.push(ft)});let vt=[],At=[];if(Array.isArray(_)&&_.length>0?At=_:Array.isArray(R)&&R.length>0&&(At=R),At==null?void 0:At.length){const lt=At.length;for(let ft=0;ft<lt;ft++){const dt=At[ft]||{},{label:at="",name:St="",show:X=!1,sort:xt,customGroup:Nt,conditions:mt,truncations:Rt,typeGuid:te="",dateFormat:qt}=dt;let st=Qh(xt);if(t.sort){const{field:ee,order:Se}=t.sort;let Kt=U.find(_t=>_t.label===ee);Kt||dt.label!==ee||(Kt=dt),Kt&&(st={columnName:Kt.columnName,label:t.sort.field,order:Se.toUpperCase(),type:"NORMAL"})}const ae={label:at.trim(),columnName:St,show:X,sort:st,customGroup:Nt,conditions:zr(mt),typeGuid:te};qt&&(ae.dateFormat=qt),St!=="the_date"||ae.dateFormat||(ae.dateFormat="YYYY-MM-DD");const we={};if(Array.isArray(Rt)&&Rt.length>0){const ee=Rt.length;for(let Se=0;Se<ee;Se++){const Kt=Rt[Se]||{},{rule:_t="",num:Bt=0,name:Ft=""}=Kt;_t&&Bt&&(we.num=Bt,we.rule=_t,Ft&&(we.otherGroupName=Ft))}}!((s=Object.keys(we))===null||s===void 0)&&s.length&&(ae.truncation=we),vt.push(ae)}}let J,et=[];const Ct=[];if(t!=null&&t.pivotTableCal){let lt=[];const{calc:ft=[],filter:dt=[],truncations:at=[],sorts:St=[],aggregateMethod:X=[],rowDimensionKeys:xt=[],colDimensionKeys:Nt=[]}=t.pivotTableCal;if(U.push(...ft),dt==null?void 0:dt.length){const mt=function Rt(te){const qt=[];for(const st of te)st.conditions?qt.push(...Rt(st.conditions)):st.conditionKey==="the_date"&&qt.push(st);return qt}(F);for(const Rt of dt){const{type:te}=Rt,qt=hb(Rt,["type"]);te==="indicators"?lt=U:te==="dimension"&&(lt=Q);const st=lt.find(ae=>ae.columnName===Rt.fieldName&&ae.label===Rt.label);if(st){if(te==="indicators")st.filter={rule:qt.rule,fieldValue:qt.fieldValue};else if(te==="dimension"){let ae=!0;qt.fieldName==="the_date"&&(mt==null?void 0:mt.length)===2&&(ae=!1,Ct.push(qt)),ae&&(st.conditions||(st.conditions=[]),st.conditions.push(qt))}}}}if(at!=null&&at.length)for(const mt of at){const Rt=Q.find(te=>te.label===mt.key);Rt&&(Rt.truncation={num:mt.num,rule:mt.rule})}if(St!=null&&St.length)for(const mt of St){const{fieldType:Rt,columnData:te}=mt,qt=hb(mt,["fieldType","columnData"]);Rt==="indicators"?(lt=U,J=te):Rt==="dimension"&&(lt=Q);const st=lt.find(ae=>ae.label===qt.label);st&&(st.sort=Object.assign(Object.assign({},qt),{columnName:st.columnName}))}if(!((l=Object.keys(X))===null||l===void 0)&&l.length)for(const mt in X){const Rt=Q.find(te=>te.label===mt);Rt&&(!((a=X[mt])===null||a===void 0)&&a.length)&&(Rt.aggregateMethod=X[mt])}vt=[],et=[];for(const mt of Q)xt.includes(mt.columnName)?vt.push(mt):Nt.includes(mt.columnName)&&et.push(mt)}if(_i(u,["text","proportion","counter"])?S="zb":_i(u,["valueline"])?S="valueline":_i(u,["indexPanel"])&&(S="indexPanel"),g||u==="card"){if(vt.length===0||U.length===0)return;S="grouptable"}else if(w==="1"&&!Q.length&&!gt.length||["2","4"].includes(w)&&U.length===0||!(w!=="3"||(Y||m==="EDV_DATA_SET")&&P.labelField&&P.valueField)||w==="3"&&u==="ecanDataSelect"&&U.length===0)return;let ct;if(R!=null&&R.length&&(w="1",S="grouptable"),!_i(u,["scatter","valueline"])&&((h=Object.keys(P))===null||h===void 0?void 0:h.length)){const lt=qh(F).find(dt=>dt.conditionKey==="parentCode"),ft={};if(lt){const dt=Zh(lt.id)||{};if(!(dt!=null&&dt.itemCodes))return;ft.parentItemCodes=dt.itemCodes}u==="ecanDataSelect"&&(ft.indicatorList=U.filter(dt=>dt.show)),m==="EDV_DATA_SET"&&(ft.edvDataSetId=O),p.sort&&(ft.sort=p.sort),ct=Object.assign({url:"/diagram/formData",source:m,dataViewId:v,plugin:"4",layer:w,chartType:"normalSelect",rangeIndexTypeGuid:Y,type:u==="ecanDataSelect"?"normalSelectData":"normalSelect",labelField:P.labelField,valueField:P.valueField,sqlConditions:W,idxLibMode:"WITH_DATE_DIM_TABLE",dataSourceId:I,keyName:i.keyName},ft)}else{let lt={};lt=_i(u,["scatter","valueline"])?{classifications:j}:{classification:p},gt!=null&>.length&&(lt.indexLibColumns=gt,lt.isIndexSet=!0),_i(u,"table")&&d.isIndexSet&&(lt.compositeIndicator=N);const ft=W.map(dt=>{const{fieldValue:at}=dt,St={};return at&&Array.isArray(at)&&(St.fieldValue=JSON.stringify(at)),Object.assign(Object.assign({},dt),St)});Ct!=null&&Ct.length&&function dt(at){for(const St of at)if(St.sqlConditions)dt(St.sqlConditions);else if(St.fieldName==="the_date"){const X=Ct.find(xt=>xt.prop===St.prop);X&&(St.fieldValue=X.fieldValue)}}(ft),ct=Object.assign({url:"/diagram",source:m,dataViewId:v,plugin:f?"5":C,layer:w,chartType:f?"pivot-table":S,series:G,indicatorList:U,queryColumns:g?[]:Q,pageFlag:!0,edvDataSetId:O||"",sqlConditions:ft,idxLibMode:k,dataSourceId:I,preview:D,rowHeaders:vt,keyName:i.keyName,columnData:J,columnHeaders:et},lt)}return ct};function pP(i,t){if(i==="increase")return t=t||"#f00f00",`<svg t="1718270975854" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1021" width="64" height="64"><path d="M128 438.848h256C384 743.68 322.112 871.68 128 1024c277.312-60.864 512-158.464 512-585.152h256L512 0 128 438.848z" fill="${t}" p-id="1022"></path></svg>`;if(i==="decline")return t=t||"#00FF88",`<svg t="1718271009759" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1172" width="64" height="64"><path d="M849.5 576.29375l-225 0C624.5 308.375 678.89375 195.875 849.5 62.00000001c-243.73125 53.49375-449.99999999 139.275-450 514.29374999l-225 0L512 961.99999999 849.5 576.29375z" fill="${t}" p-id="1173"></path></svg>`}const mP=i=>({DIM:"维度",BUILT_IN_DIM:"维度",IDX:"指标",BUILT_IN_IDX:"指标",FIELD:"数据集"})[i],vP=i=>({0:"文本",1:"数值",2:"日期"})[i],bP=i=>i==="0"?"手工录入":i==="1"?"系统取数":i==="2"?"运算加工":"",CP=i=>{let t="";switch(i){case"1":t="人力系统";break;case"2":t="绩效系统";break;case"3":t="预算系统";break;case"4":t="财务系统";break;case"5":t="成本系统";break;case"6":t="物流系统";break;case"7":t="固定资产系统";break;case"8":t="OA办公系统";break;case"9":t="电子档案系统";break;case"10":t="个人收入系统";break;case"11":t="奖金二次分配系统";break;case"12":t="财务管理系统";break;case"13":t="报销系统";break;case"14":t="科研管理系统";break;case"15":t="审计系统";break;case"16":t="分组器系统";break}return t},yP=i=>i==="0"?"指标库":i==="1"?"视图":i==="2"?"数据集":"其他";function _P(i){i=i.replace(/^#/,"");const t=parseInt(i.substr(0,2),16)/255,e=parseInt(i.substr(2,2),16)/255,n=parseInt(i.substr(4,2),16)/255,o=Math.max(t,e,n),r=Math.min(t,e,n);let s=(o+r)/2,l=s;const a=s;if(o===r)s=l=0;else{const h=o-r;switch(l=a>.5?h/(2-o-r):h/(o+r),o){case t:s=(e-n)/h+(e<n?6:0);break;case e:s=(n-t)/h+2;break;case n:s=(t-e)/h+4;break}s/=6}return[s,l,a]}function hC(i,t){let[e,n,o]=_P(i);return o=Math.min(1,Math.max(0,o+t/100)),wP(e,n,o)}function wP(i,t,e){let n,o,r;if(t===0)n=o=r=e;else{const l=(d,u,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<.16666666666666666?d+(u-d)*6*c:c<.5?u:c<.6666666666666666?d+(u-d)*(.6666666666666666-c)*6:d),a=e<.5?e*(1+t):e+t-e*t,h=2*e-a;n=l(h,a,i+1/3),o=l(h,a,i),r=l(h,a,i-1/3)}const s=l=>Math.round(l*255).toString(16).padStart(2,"0");return`#${s(n)}${s(o)}${s(r)}`}function SP(i){let t="";return["IDX","BUILT_IN_IDX"].includes(i)?t="indicator":["DIM","BUILT_IN_DIM"].includes(i)&&(t="dimension"),t}class ti{static GenAutoIncrementId(){return ti.auto_increment_id++}}ti.auto_increment_id=0;class $t{constructor(t){this.id=ti.GenAutoIncrementId(),this.registry=t}}const td="named",dC="inject",uC="multi_inject",cC="inversify:tagged",gC="inversify:paramtypes";class Sf{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===td?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}const Ls=function(i){var t;return function(e){const n=typeof Symbol=="function",o=n&&Symbol.toPrimitive!==void 0?Symbol.toPrimitive:"@@toPrimitive",r=Object.getPrototypeOf(Function),s=(typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),l=new WeakMap;function a(P,E,L,I){if(!_(L))throw new TypeError;return v(P,E,L,I)}function h(P,E,L){if(!_(E))throw new TypeError;return w(L)||(L=M(L)),g(P,E,L)}function d(P,E,L){if(!_(E))throw new TypeError;return w(L)||(L=M(L)),f(P,E,L)}function u(P,E,L){if(!_(E))throw new TypeError;return w(L)||(L=M(L)),p(P,E,L)}function c(P,E,L){let I=l.get(P);if(w(I)){if(!L)return;I=new s,l.set(P,I)}let k=I.get(E);if(w(k)){if(!L)return;k=new s,I.set(E,k)}return k}function g(P,E,L){if(f(P,E,L))return!0;const I=F(E);return!S(I)&&g(P,I,L)}function f(P,E,L){const I=c(E,L,!1);return!w(I)&&x(I.has(P))}function p(P,E,L){if(f(P,E,L))return m(P,E,L);const I=F(E);return S(I)?void 0:p(P,I,L)}function m(P,E,L){const I=c(E,L,!1);if(!w(I))return I.get(P)}function v(P,E,L,I){c(L,I,!0).set(P,E)}function C(P){if(P===null)return 1;switch(typeof P){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return P===null?1:6;default:return 6}}function w(P){return P===void 0}function S(P){return P===null}function y(P){return typeof P=="symbol"}function _(P){return typeof P=="object"?P!==null:typeof P=="function"}function R(P,E){switch(C(P)){case 0:case 1:case 2:case 3:case 4:case 5:return P}const L=E===3?"string":E===5?"number":"default",I=H(P,o);if(I!==void 0){const k=I.call(P,L);if(_(k))throw new TypeError;return k}return A(P,L==="default"?"number":L)}function A(P,E){if(E==="string"){const L=P.toString;if(B(L)){const k=L.call(P);if(!_(k))return k}const I=P.valueOf;if(B(I)){const k=I.call(P);if(!_(k))return k}}else{const L=P.valueOf;if(B(L)){const k=L.call(P);if(!_(k))return k}const I=P.toString;if(B(I)){const k=I.call(P);if(!_(k))return k}}throw new TypeError}function x(P){return!!P}function T(P){return""+P}function M(P){const E=R(P,3);return y(E)?E:T(E)}function B(P){return typeof P=="function"}function H(P,E){const L=P[E];if(L!=null){if(!B(L))throw new TypeError;return L}}function F(P){const E=Object.getPrototypeOf(P);if(typeof P!="function"||P===r||E!==r)return E;const L=P.prototype,I=L&&Object.getPrototypeOf(L);if(I==null||I===Object.prototype)return E;const k=I.constructor;return typeof k!="function"||k===P?E:k}e("defineMetadata",a),e("hasMetadata",h),e("hasOwnMetadata",d),e("getMetadata",u)}((t=i,function(e,n){typeof t[e]!="function"&&Object.defineProperty(t,e,{configurable:!0,writable:!0,value:n})})),i}({});function xP(i,t,e,n){const o=[n];let r={};Ls.hasOwnMetadata(i,t)&&(r=Ls.getMetadata(i,t));let s=r[e];s===void 0&&(s=[]),s.push(...o),r[e]=s,Ls.defineMetadata(i,r,t)}function AP(i,t,e,n){xP(cC,i,e.toString(),n)}function fC(i){return(t,e,n)=>{AP(t,e,n,i)}}function pC(i){return t=>(e,n,o)=>fC(new Sf(i,t))(e,n,o)}const re=pC(dC),mC=pC(uC);function wt(){return function(i){return Ls.defineMetadata(gC,null,i),i}}function ui(i){return fC(new Sf(td,i))}const Wr={Singleton:"Singleton",Transient:"Transient"},lr={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};class xf{constructor(t,e){this.id=ti.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=lr.Invalid,this.constraint=n=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new xf(this.serviceIdentifier,this.scope);return t.activated=t.scope===Wr.Singleton&&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 RP{getConstructorMetadata(t){return{compilerGeneratedMetadata:Ls.getMetadata(gC,t),userGeneratedMetadata:Ls.getMetadata(cC,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const TP=(i=>t=>{const e=n=>{if(n==null)return!1;if(n.key===i&&n.value===t)return!0;if(n.constructorArgsMetadata==null)return!1;const o=n.constructorArgsMetadata;for(let r=0;r<o.length;r++)if(o[r].key===i&&o[r].value===t)return!0;return!1};return e.metaData=new Sf(i,t),e})(td);class ed{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Wr.Singleton,this}inTransientScope(){return this._binding.scope=Wr.Transient,this}whenTargetNamed(t){return this._binding.constraint=TP(t),this}}class MP{constructor(t){this._binding=t}to(t){return this._binding.type=lr.Instance,this._binding.implementationType=t,new ed(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=lr.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new ed(this._binding)}toConstantValue(t){return this._binding.type=lr.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Wr.Singleton,new ed(this._binding)}toFactory(t){return this._binding.type=lr.Factory,this._binding.factory=t,this._binding.scope=Wr.Singleton,new ed(this._binding)}toService(t){this.toDynamicValue(e=>e.container.get(t))}}let BP=class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Wr.Transient,this.options=e,this.id=ti.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new RP}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 o=this._getNotAllArgs(t,!1,e,n);return this._get(o)}getNamed(t,e){return this.getTagged(t,td,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,n=new xf(t,e),o=this._bindingDictionary.get(t)||[];return o.push(n),this._bindingDictionary.set(t,o),new MP(n)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(s,l)=>{s._binding.moduleId=l},e=s=>l=>{const a=this.bind(l);return t(a,s),a},n=()=>s=>this.unbind(s),o=()=>s=>this.isBound(s),r=s=>l=>{const a=this.rebind(l);return t(a,s),a};return s=>({bindFunction:e(s),isboundFunction:o(),rebindFunction:r(s),unbindFunction:n(),unbindAsyncFunction:l=>null})}_getNotAllArgs(t,e,n,o){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:o}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter(n=>n.constraint(t)).forEach(n=>{e.push(this._resolveFromBinding(n))}),t.isMultiInject||e.length!==1?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:n}=this._metadataReader.getConstructorMetadata(e),o=Object.keys(n),r=[];for(let s=0;s<o.length;s++){const l=n[s],a={};l.forEach(g=>{a[g.key]=g.value});const h={inject:a[dC],multiInject:a[uC]},d=h.inject||h.multiInject,u={serviceIdentifier:d,constructorArgsMetadata:l},c={injectIdentifier:d,metadata:l,bindings:this._bindingDictionary.get(d).filter(g=>g.constraint(u))};r.push(c)}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case lr.ConstantValue:case lr.Function:e=t.cache;break;case lr.Instance: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(e=>e.bindings.length>1?e.bindings.map(n=>this._resolveFromBinding(n)):this._resolveFromBinding(e.bindings[0]))}_saveToScope(t,e){t.scope===Wr.Singleton&&(t.cache=e,t.activated=!0)}};const ei=Symbol("ContributionProvider");class vC{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function Li(i,t){i(ei).toDynamicValue(({container:e})=>new vC(t,e)).inSingletonScope().whenTargetNamed(t)}function PP(i,t){i(ei).toDynamicValue(({container:e})=>new vC(t,e)).whenTargetNamed(t)}class HP{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const n=typeof t=="string"?t.trim():t.name;n&&(this.taps=this.taps.filter(o=>!(o.name===n&&(!e||o.fn===e))))}_parseOptions(t,e,n){let o;if(typeof e=="string")o={name:e.trim()};else if(typeof e!="object"||e===null)throw new Error("Invalid tap options");if(typeof o.name!="string"||o.name==="")throw new Error("Missing name for tap");return o=Object.assign({type:t,fn:n},o),o}_tap(t,e,n){this._insert(this._parseOptions(t,e,n))}_insert(t){let e;typeof t.before=="string"?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;typeof t.stage=="number"&&(n=t.stage);let o=this.taps.length;for(;o>0;){o--;const r=this.taps[o];this.taps[o+1]=r;const s=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(!(s>n)){o++;break}}this.taps[o]=t}}class qi extends HP{call(...t){this.taps.map(e=>e.fn).forEach(e=>e(...t))}}const id=Symbol.for("EnvContribution"),Af=Symbol.for("VGlobal");var EP=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},kP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},bC=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Rf=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(i){this._env||this.setEnv("browser"),this.envContribution.supportEvent=i}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(i){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=i}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(i){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=i}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(i){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=i}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(i){this._env||this.setEnv("browser"),this.envContribution.applyStyles=i}constructor(i){this.contributions=i,this.id=ti.GenAutoIncrementId(),this.hooks={onSetEnv:new qi(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(i){const t=[];if(this.contributions.getContributions().forEach(e=>{const n=e.configure(this,i);n&&n.then&&t.push(n)}),t.length)return Promise.all(t)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(i,t){if(t&&t.force===!0||this._env!==i)return this.deactiveCurrentEnv(),this.activeEnv(i,t)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(i,t){const e=this._env;this._env=i;const n=this.bindContribution(t);if(n&&n.then)return n.then(()=>{this.envParams=t,this.hooks.onSetEnv.call(e,i,this)});this.envParams=t,this.hooks.onSetEnv.call(e,i,this)}setActiveEnvContribution(i){this.envContribution=i}createCanvas(i){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(i)}createOffscreenCanvas(i){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(i)}releaseCanvas(i){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(i)}addEventListener(i,t,e){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(i,t,e)}removeEventListener(i,t,e){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(i,t,e)}dispatchEvent(i){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(i)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(i){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(i):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(i,t){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(i,t):null}loadImage(i){return this._env||this.setEnv("browser"),this.envContribution.loadImage(i)}loadSvg(i){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(i)}loadJson(i){return this._env||this.setEnv("browser"),this.envContribution.loadJson(i)}loadArrayBuffer(i){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(i)}loadBlob(i){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(i)}isChrome(){return this._isChrome!=null||(this._env||this.setEnv("browser"),this._isChrome=this._env==="browser"&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return this._isSafari!=null||(this._env||this.setEnv("browser"),this._isSafari=this._env==="browser"&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(i){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(i)}removeDom(i){return this._env||this.setEnv("browser"),this.envContribution.removeDom(i)}createDom(i){return this._env||this.setEnv("browser"),this.envContribution.createDom(i)}updateDom(i,t){return this._env||this.setEnv("browser"),this.envContribution.updateDom(i,t)}getElementTop(i,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(i,t)}getElementLeft(i,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(i,t)}getElementTopLeft(i,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(i,t)}};Rf=EP([wt(),bC(0,re(ei)),bC(0,ui(id)),kP("design:paramtypes",[Object])],Rf);var LP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Nr={},FP={get exports(){return Nr},set exports(i){Nr=i}};(function(i){var t=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function o(a,h,d){this.fn=a,this.context=h,this.once=d||!1}function r(a,h,d,u,c){if(typeof d!="function")throw new TypeError("The listener must be a function");var g=new o(d,u||a,c),f=e?e+h:h;return a._events[f]?a._events[f].fn?a._events[f]=[a._events[f],g]:a._events[f].push(g):(a._events[f]=g,a._eventsCount++),a}function s(a,h){--a._eventsCount===0?a._events=new n:delete a._events[h]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],d,u;if(this._eventsCount===0)return h;for(u in d=this._events)t.call(d,u)&&h.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(d)):h},l.prototype.listeners=function(h){var d=e?e+h:h,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var c=0,g=u.length,f=new Array(g);c<g;c++)f[c]=u[c].fn;return f},l.prototype.listenerCount=function(h){var d=e?e+h:h,u=this._events[d];return u?u.fn?1:u.length:0},l.prototype.emit=function(h,d,u,c,g,f){var p=e?e+h:h;if(!this._events[p])return!1;var m=this._events[p],v=arguments.length,C,w;if(m.fn){switch(m.once&&this.removeListener(h,m.fn,void 0,!0),v){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,d),!0;case 3:return m.fn.call(m.context,d,u),!0;case 4:return m.fn.call(m.context,d,u,c),!0;case 5:return m.fn.call(m.context,d,u,c,g),!0;case 6:return m.fn.call(m.context,d,u,c,g,f),!0}for(w=1,C=new Array(v-1);w<v;w++)C[w-1]=arguments[w];m.fn.apply(m.context,C)}else{var S=m.length,y;for(w=0;w<S;w++)switch(m[w].once&&this.removeListener(h,m[w].fn,void 0,!0),v){case 1:m[w].fn.call(m[w].context);break;case 2:m[w].fn.call(m[w].context,d);break;case 3:m[w].fn.call(m[w].context,d,u);break;case 4:m[w].fn.call(m[w].context,d,u,c);break;default:if(!C)for(y=1,C=new Array(v-1);y<v;y++)C[y-1]=arguments[y];m[w].fn.apply(m[w].context,C)}}return!0},l.prototype.on=function(h,d,u){return r(this,h,d,u,!1)},l.prototype.once=function(h,d,u){return r(this,h,d,u,!0)},l.prototype.removeListener=function(h,d,u,c){var g=e?e+h:h;if(!this._events[g])return this;if(!d)return s(this,g),this;var f=this._events[g];if(f.fn)f.fn===d&&(!c||f.once)&&(!u||f.context===u)&&s(this,g);else{for(var p=0,m=[],v=f.length;p<v;p++)(f[p].fn!==d||c&&!f[p].once||u&&f[p].context!==u)&&m.push(f[p]);m.length?this._events[g]=m.length===1?m[0]:m:s(this,g)}return this},l.prototype.removeAllListeners=function(h){var d;return h?(d=e?e+h:h,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=e,l.EventEmitter=l,i.exports=l})(FP);const Fs=(i,t)=>Object.prototype.toString.call(i)===`[object ${t}]`,ci=(i,t=!1)=>t?typeof i=="boolean":i===!0||i===!1||Fs(i,"Boolean"),he=i=>typeof i=="function",Pt=i=>i==null,z=i=>i!=null,ue=i=>{const t=typeof i;return i!==null&&t==="object"||t==="function"},IP=i=>typeof i=="object"&&i!==null,Is=function(i){if(!IP(i)||!Fs(i,"Object"))return!1;if(Object.getPrototypeOf(i)===null)return!0;let t=i;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(i)===t},je=i=>i===void 0,de=(i,t=!1)=>{const e=typeof i;return t?e==="string":e==="string"||Fs(i,"String")},ot=i=>Array.isArray?Array.isArray(i):Fs(i,"Array"),Tf=function(i){return i!==null&&typeof i!="function"&&Number.isFinite(i.length)},CC=i=>Fs(i,"Date"),ut=(i,t=!1)=>{const e=typeof i;return t?e==="number":e==="number"||Fs(i,"Number")},Te=i=>ut(i)&&Number.isFinite(i),DP=i=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(i),OP=i=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(i),zP=i=>({}).toString.call(i).replace(/^\[object /,"").replace(/]$/,""),WP=Object.prototype,NP=function(i){const t=i&&i.constructor;return i===(typeof t=="function"&&t.prototype||WP)},VP=Object.prototype.hasOwnProperty;function Xt(i){if(Pt(i))return!0;if(Tf(i))return!i.length;const t=zP(i);if(t==="Map"||t==="Set")return!i.size;if(NP(i))return!Object.keys(i).length;for(const e in i)if(VP.call(i,e))return!1;return!0}const gi=(i,t,e)=>{const n=de(t)?t.split("."):t;for(let o=0;o<n.length;o++)i=i?i[n[o]]:void 0;return i===void 0?e:i},jP=Object.prototype.hasOwnProperty,yC=(i,t)=>i!=null&&jP.call(i,t);function ke(i,t,e){let n;if(!z(i)||typeof i!="object"||t&&t(i))return i;const o=ot(i),r=i.length;n=o?new Array(r):typeof i=="object"?{}:ci(i)||ut(i)||de(i)?i:CC(i)?new Date(+i):void 0;const s=o?void 0:Object.keys(Object(i));let l=-1;if(n)for(;++l<(s||i).length;){const a=s?s[l]:l,h=i[a];e&&e.includes(a.toString())?n[a]=h:n[a]=ke(h,t,e)}return n}function _C(i,t,e=!1,n=!1){if(t){if(i===t)return;if(z(t)&&typeof t=="object"){const o=Object(t),r=[];for(const a in o)r.push(a);let{length:s}=r,l=-1;for(;s--;){const a=r[++l];!z(o[a])||typeof o[a]!="object"||n&&ot(i[a])?wC(i,a,o[a]):$P(i,t,a,e,n)}}}}function $P(i,t,e,n=!1,o=!1){const r=i[e],s=t[e];let l=t[e],a=!0;if(ot(s)){if(n)l=[];else if(ot(r))l=r;else if(Tf(r)){l=new Array(r.length);let h=-1;const d=r.length;for(;++h<d;)l[h]=r[h]}}else Is(s)?(l=r??{},typeof r!="function"&&typeof r=="object"||(l={})):a=!1;a&&_C(l,s,n,o),wC(i,e,l)}function wC(i,t,e){(e!==void 0&&!GP(i[t],e)||e===void 0&&!(t in i))&&(i[t]=e)}function GP(i,t){return i===t||Number.isNaN(i)&&Number.isNaN(t)}function Tt(i,...t){let e=-1;const n=t.length;for(;++e<n;)_C(i,t[e],!0);return i}function UP(i,t){if(!i||!Is(i))return i;const e={};return Object.keys(i).forEach(n=>{const o=i[n];let r=!1;t.forEach(s=>{(de(s)&&s===n||s instanceof RegExp&&n.match(s))&&(r=!0)}),r||(e[n]=o)}),e}function SC(i){return Object.prototype.toString.call(i)}function xC(i){return Object.keys(i)}function Zl(i,t,e){if(i===t)return!0;if(typeof i!=typeof t||i==null||t==null)return!1;if(Number.isNaN(i)&&Number.isNaN(t))return!0;if(SC(i)!==SC(t))return!1;if(he(i))return!!(e!=null&&e.skipFunction);if(typeof i!="object")return!1;if(ot(i)){if(i.length!==t.length)return!1;for(let r=i.length-1;r>=0;r--)if(!Zl(i[r],t[r],e))return!1;return!0}if(!Is(i))return!1;const n=xC(i),o=xC(t);if(n.length!==o.length)return!1;n.sort(),o.sort();for(let r=n.length-1;r>=0;r--)if(n[r]!=o[r])return!1;for(let r=n.length-1;r>=0;r--){const s=n[r];if(!Zl(i[s],t[s],e))return!1}return!0}function KP(i){if(!i)return[];if(Object.keys)return Object.keys(i);const t=[];for(const e in i)i.hasOwnProperty(e)&&t.push(e);return t}function YP(i,t,e){const n=KP(t);for(let o=0;o<n.length;o++){const r=n[o];(e?t[r]!=null:i[r]==null)&&(i[r]=t[r])}return i}function Mf(i,t,e=!0){if(i="prototype"in i?i.prototype:i,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames){const n=Object.getOwnPropertyNames(t);for(let o=0;o<n.length;o++){const r=n[o];r!=="constructor"&&(e?t[r]!=null:i[r]==null)&&(i[r]=t[r])}}else YP(i,t,e)}function Bf(i){return z(i)?ot(i)?i:[i]:[]}function Vr(i){if(Tf(i))return i[i.length-1]}const Pf=(i,t)=>{var e;if(i.length===0)return;let n=i[0];for(let o=1;o<i.length;o++){const r=i[o];((e=t==null?void 0:t(r,n))!==null&&e!==void 0?e:r-n>0)&&(n=r)}return n},nd=(i,t)=>{var e;if(i.length===0)return;let n=i[0];for(let o=1;o<i.length;o++){const r=i[o];((e=t==null?void 0:t(r,n))!==null&&e!==void 0?e:r-n<0)&&(n=r)}return n};function Jl(i,t){if(!ot(i)||!ot(t)||i.length!==t.length)return!1;for(let e=0;e<i.length;e++)if(i[e]!==t[e])return!1;return!0}function Hf(i){if(!ot(i))return[i];const t=[];for(const e of i)t.push(...Hf(e));return t}function XP(i,t,e){z(t)||(t=i,i=0),z(e)||(e=1);let n=-1;const o=0|Math.max(0,Math.ceil((t-i)/e)),r=new Array(o);for(;++n<o;)r[n]=i+n*e;return r}function qP(i,t){return i<t?-1:i>t?1:i>=t?0:NaN}function Ql(i){return Number(i)}const ZP=typeof console<"u";function od(i,t,e){const n=[t].concat([].slice.call(e));ZP&&console[i].apply(console,n)}var Gn;(function(i){i[i.None=0]="None",i[i.Error=1]="Error",i[i.Warn=2]="Warn",i[i.Info=3]="Info",i[i.Debug=4]="Debug"})(Gn||(Gn={}));class Me{static getInstance(t,e){return Me._instance&&ut(t)?Me._instance.level(t):Me._instance||(Me._instance=new Me(t,e)),Me._instance}static setInstance(t){return Me._instance=t}static setInstanceLevel(t){Me._instance?Me._instance.level(t):Me._instance=new Me(t)}static clearInstance(){Me._instance=null}constructor(t=Gn.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(n=>n===t);e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach(e=>e(...t))}canLogInfo(){return this._level>=Gn.Info}canLogDebug(){return this._level>=Gn.Debug}canLogError(){return this._level>=Gn.Error}canLogWarn(){return this._level>=Gn.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=Gn.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):od((e=this._method)!==null&&e!==void 0?e:"error","ERROR",t)),this}warn(...t){return this._level>=Gn.Warn&&od(this._method||"warn","WARN",t),this}info(...t){return this._level>=Gn.Info&&od(this._method||"log","INFO",t),this}debug(...t){return this._level>=Gn.Debug&&od(this._method||"log","DEBUG",t),this}}Me._instance=null;function JP(i,t,e=0,n){for(Pt(n)&&(n=i.length);e<n;){const o=e+n>>>1;qP(i[o],t)>0?n=o:e=o+1}return e}const QP=(i,t,e)=>{let n=i,o=t;for(;n<o;){const r=Math.floor((n+o)/2);e(r)>=0?o=r:n=r+1}return n},t2=1e-10,e2=1e-10;function Un(i,t,e=e2,n=t2){const o=n,r=e*Math.max(i,t);return Math.abs(i-t)<=Math.max(o,r)}function AC(i,t,e,n){return i>t&&!Un(i,t,e,n)}function RC(i,t,e,n){return i<t&&!Un(i,t,e,n)}const ta=i=>{let t=null,e=null;return(...n)=>(t&&n.every((o,r)=>o===t[r])||(t=n,e=i(...n)),e)},ln=function(i,t,e){return i<t?t:i>e?e:i},jr=(i,t,e)=>{let[n,o]=i;o<n&&(n=i[1],o=i[0]);const r=o-n;return r>=e-t?[t,e]:(n=Math.min(Math.max(n,t),e-r),[n,n+r])};function Ef(i,t){let e;return i>t&&(e=i,i=t,t=e),n=>Math.max(i,Math.min(t,n))}let rd=!1;try{rd=typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"}catch{rd=!1}function TC(i,t,e){let n,o,r,s,l,a,h=0,d=!1,u=!1,c=!0;const g=!t&&t!==0&&rd;if(typeof i!="function")throw new TypeError("Expected a function");function f(S){const y=n,_=o;return n=o=void 0,h=S,s=i.apply(_,y),s}function p(S,y){return g?(cancelAnimationFrame(l),requestAnimationFrame(S)):setTimeout(S,y)}function m(S){const y=S-a;return a===void 0||y>=t||y<0||u&&S-h>=r}function v(){const S=Date.now();if(m(S))return C(S);l=p(v,function(y){const _=y-h,R=t-(y-a);return u?Math.min(R,r-_):R}(S))}function C(S){return l=void 0,c&&n?f(S):(n=o=void 0,s)}function w(...S){const y=Date.now(),_=m(y);if(n=S,o=this,a=y,_){if(l===void 0)return function(R){return h=R,l=p(v,t),d?f(R):s}(a);if(u)return l=p(v,t),f(a)}return l===void 0&&(l=p(v,t)),s}return t=+t||0,ue(e)&&(d=!!e.leading,u="maxWait"in e,u&&(r=Math.max(Te(e.maxWait)?e.maxWait:0,t)),c="trailing"in e?!!e.trailing:c),w.cancel=function(){l!==void 0&&function(S){if(g)return cancelAnimationFrame(S);clearTimeout(S)}(l),h=0,n=a=o=l=void 0},w.flush=function(){return l===void 0?s:C(Date.now())},w.pending=function(){return l!==void 0},w}rd=!1;function MC(i,t,e){let n=!0,o=!0;if(typeof i!="function")throw new TypeError("Expected a function");return ue(e)&&(n="leading"in e?!!e.leading:n,o="trailing"in e?!!e.trailing:o),TC(i,t,{leading:n,trailing:o,maxWait:t})}function sd(i,t){return e=>i*(1-e)+t*e}function i2(i,t){return function(e){return Math.round(i*(1-e)+t*e)}}function n2(i,t){const e=i.valueOf(),n=t.valueOf(),o=new Date;return r=>(o.setTime(e*(1-r)+n*r),o)}const Le=1e-12,Be=Math.PI,Sn=Be/2,Ri=2*Be,ce=2*Math.PI,_e=Math.abs,Ce=Math.atan2,ii=Math.cos,ar=Math.max,Fi=Math.min,We=Math.sin,Kn=Math.sqrt,Ds=Math.pow;function o2(i){return i>1?0:i<-1?Be:Math.acos(i)}function BC(i){return i>=1?Sn:i<=-1?-Sn:Math.asin(i)}function PC(i,t,e,n,o){let r=e,s=n;return typeof i=="number"&&typeof e=="number"&&(r=(1-o)*i+o*e),typeof t=="number"&&typeof n=="number"&&(s=(1-o)*t+o*n),{x:r,y:s}}function r2(i,t){return i[0]*t[1]-i[1]*t[0]}class Xe{constructor(t=0,e=0,n,o){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=n,this.y1=o}clone(){return new Xe(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 ut(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return ut(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 Ho{static distancePP(t,e){return Kn(Ds(t.x-e.x,2)+Ds(t.y-e.y,2))}static distanceNN(t,e,n,o){return Kn(Ds(t-n,2)+Ds(e-o,2))}static distancePN(t,e,n){return Kn(Ds(e-t.x,2)+Ds(n-t.y,2))}static pointAtPP(t,e,n){return new Xe((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function xn(i){return i*(Math.PI/180)}function s2(i){return 180*i/Math.PI}const l2=(i=0)=>{if(i<0)for(;i<-Ri;)i+=Ri;else if(i>0)for(;i>Ri;)i-=Ri;return i};function a2(i,t,e){return t?{x:i.x+t*Math.cos(e),y:i.y+t*Math.sin(e)}:{x:i.x,y:i.y}}function HC(i){for(;i<0;)i+=2*Math.PI;for(;i>=2*Math.PI;)i-=2*Math.PI;return i}function EC(i,t,e){if(i===null)return t;if(t===null)return i;const{x11:n,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=kf(i,t,e);return n>=a||o<=l||r>=d||s<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(n,l),y1:Math.max(r,h),x2:Math.min(o,a),y2:Math.min(s,d)}}var Os;(function(i){i[i.NONE=0]="NONE",i[i.BBOX1=1]="BBOX1",i[i.BBOX2=2]="BBOX2"})(Os||(Os={}));const kf=(i,t,e)=>{let n=i.x1,o=i.x2,r=i.y1,s=i.y2,l=t.x1,a=t.x2,h=t.y1,d=t.y2;return e&&(n>o&&([n,o]=[o,n]),r>s&&([r,s]=[s,r]),l>a&&([l,a]=[a,l]),h>d&&([h,d]=[d,h])),{x11:n,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}};function h2(i,t,e){if(!i||!t)return Os.NONE;const{x11:n,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=kf(i,t,e);return n>l&&o<a&&r>h&&s<d?Os.BBOX1:l>n&&a<o&&h>r&&d<s?Os.BBOX2:Os.NONE}function Lf(i,t,e){if(i&&t){if(!e)return!(i.x1>t.x2||i.x2<t.x1||i.y1>t.y2||i.y2<t.y1);const{x11:n,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=kf(i,t,!0);return!(n>a||o<l||r>d||s<h)}return!0}function Ff(i,t){return Math.abs(t[0]*i[0]+t[1]*i[1])}function zs({x:i,y:t},e,n={x:0,y:0}){return{x:(i-n.x)*Math.cos(e)-(t-n.y)*Math.sin(e)+n.x,y:(i-n.x)*Math.sin(e)+(t-n.y)*Math.cos(e)+n.y}}function If(i){return{x:(i.x1+i.x2)/2,y:(i.y1+i.y2)/2}}function kC(i,t){const e=t?xn(i.angle):i.angle,n=If(i);return[zs({x:i.x1,y:i.y1},e,n),zs({x:i.x2,y:i.y1},e,n),zs({x:i.x2,y:i.y2},e,n),zs({x:i.x1,y:i.y2},e,n)]}function LC(i,t,e=!1,n){const o=kC(i,e),r=kC(t,e),s=(w,S)=>[S.x-w.x,S.y-w.y];n&&(n.save(),n.fillStyle="red",n.globalAlpha=.6,o.forEach((w,S)=>{S===0?n.moveTo(w.x,w.y):n.lineTo(w.x,w.y)}),n.fill(),n.restore(),n.save(),n.fillStyle="green",n.globalAlpha=.6,r.forEach((w,S)=>{S===0?n.moveTo(w.x,w.y):n.lineTo(w.x,w.y)}),n.fill(),n.restore());const l=If(i),a=If(t);n&&n.fillRect(l.x,l.y,2,2),n&&n.fillRect(a.x,a.y,2,2);const h=s(l,a),d=s(o[0],o[1]),u=s(o[1],o[2]),c=s(r[0],r[1]),g=s(r[1],r[2]),f=e?xn(i.angle):i.angle;let p=e?xn(90-i.angle):i.angle+Sn;const m=e?xn(t.angle):t.angle;let v=e?xn(90-t.angle):t.angle+Sn;p>ce&&(p-=ce),v>ce&&(v-=ce);const C=(w,S,y,_)=>{const R=[Math.cos(S),Math.sin(S)];return w+(Ff(R,y)+Ff(R,_))/2>Ff(R,h)};return C((i.x2-i.x1)/2,f,c,g)&&C((i.y2-i.y1)/2,p,c,g)&&C((t.x2-t.x1)/2,m,d,u)&&C((t.y2-t.y1)/2,v,d,u)}const FC=i=>{let t=i.charCodeAt(0),e=i.length===2?i.charCodeAt(1):0,n=t;return 55296<=t&&t<=56319&&56320<=e&&e<=57343&&(t&=1023,e&=1023,n=t<<10|e,n+=65536),n===12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n===8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n===172||n===175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n===161||n===164||167<=n&&n<=168||n===170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n===198||n===208||215<=n&&n<=216||222<=n&&n<=225||n===230||232<=n&&n<=234||236<=n&&n<=237||n===240||242<=n&&n<=243||247<=n&&n<=250||n===252||n===254||n===257||n===273||n===275||n===283||294<=n&&n<=295||n===299||305<=n&&n<=307||n===312||319<=n&&n<=322||n===324||328<=n&&n<=331||n===333||338<=n&&n<=339||358<=n&&n<=359||n===363||n===462||n===464||n===466||n===468||n===470||n===472||n===474||n===476||n===593||n===609||n===708||n===711||713<=n&&n<=715||n===717||n===720||728<=n&&n<=731||n===733||n===735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n===1025||1040<=n&&n<=1103||n===1105||n===8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n===8240||8242<=n&&n<=8243||n===8245||n===8251||n===8254||n===8308||n===8319||8321<=n&&n<=8324||n===8364||n===8451||n===8453||n===8457||n===8467||n===8470||8481<=n&&n<=8482||n===8486||n===8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n===8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n===8658||n===8660||n===8679||n===8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n===8715||n===8719||n===8721||n===8725||n===8730||8733<=n&&n<=8736||n===8739||n===8741||8743<=n&&n<=8748||n===8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n===8776||n===8780||n===8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n===8853||n===8857||n===8869||n===8895||n===8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n===9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n===9711||9733<=n&&n<=9734||n===9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n===9756||n===9758||n===9792||n===9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n===9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n===9955||9960<=n&&n<=9983||n===10045||n===10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n===65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function ld(i,t={},e){e||(e=1);const{fontStyle:n=t.fontStyle,fontVariant:o=t.fontVariant,fontWeight:r=t.fontWeight,fontSize:s=t.fontSize,fontFamily:l=t.fontFamily}=i;return(n?n+" ":"")+(o?o+" ":"")+(r?r+" ":"")+s*e+"px "+(l||"sans-serif")}class fi{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet=`-/: .,@%'"~`,this._option=t,this._userSpec=e??{},this.textSpec=this._initSpec(),z(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=z(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(Pt(this._canvas)&&(z(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),Pt(this._canvas)&&typeof window<"u"&&window.document!==void 0&&globalThis&&z(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),Pt(this._context)&&z(this._canvas)){const t=this._canvas.getContext("2d");z(t)&&(t.save(),t.font=ld(this.textSpec),this._contextSaved=!0,this._context=t)}return!Pt(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,n;const{defaultFontParams:o={}}=this._option,{fontStyle:r=o.fontStyle,fontVariant:s=o.fontVariant,fontWeight:l=(t=o.fontWeight)!==null&&t!==void 0?t:"normal",fontSize:a=(e=o.fontSize)!==null&&e!==void 0?e:12,fontFamily:h=(n=o.fontFamily)!==null&&n!==void 0?n:"sans-serif",align:d,textAlign:u=d??"center",baseline:c,textBaseline:g=c??"middle",ellipsis:f,limit:p}=this._userSpec;let{lineHeight:m=a}=this._userSpec;if(de(m)&&m[m.length-1]==="%"){const v=Number.parseFloat(m.substring(0,m.length-1))/100;m=a*v}return{fontStyle:r,fontVariant:s,fontFamily:h,fontSize:a,fontWeight:l,textAlign:u,textBaseline:g,ellipsis:f,limit:p,lineHeight:m}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(Pt(t))return{width:0,height:0};if(Pt(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:n,fontWeight:o,textAlign:r,textBaseline:s,ellipsis:l,limit:a,lineHeight:h}=this.textSpec;let d;try{const u=this._option.getTextBounds({text:t,fontFamily:e,fontSize:n,fontWeight:o,textAlign:r,textBaseline:s,ellipsis:!!l,maxLineWidth:a||1/0,lineHeight:h});d={width:u.width(),height:u.height()}}catch{this._notSupportVRender=!0,d=this.measureWithNaiveCanvas(t)}return d}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const n=this._context.measureText(t),{fontSize:o,lineHeight:r}=this.textSpec;return{width:n.width,height:(e=r)!==null&&e!==void 0?e:o}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let n=0;n<t.length;n++){const o=t[n];let r=this._measureSpecialChar(o);Pt(r)&&fi.NUMBERS_CHAR_SET.includes(o)&&(r=this._measureNumberChar()),Pt(r)&&["F","W"].includes(FC(o))&&(r=this._measureFullSizeChar()),Pt(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const n={width:0,height:0},{fontSize:o,lineHeight:r}=this.textSpec;for(let s=0;s<t.length;s++){const l=t[s],a=["F","W"].includes(FC(l))?1:.53;n.width+=a*o}return n.height=(e=r)!==null&&e!==void 0?e:o,n}_measureReduce(t,e){var n;const{fontSize:o,lineHeight:r}=this.textSpec,s={width:0,height:0};if(Pt(t))return s;if(ot(t)){const l=t.filter(z).map(a=>a.toString());return l.length===0?s:l.length===1?e(l[0]):{width:l.reduce((a,h)=>Math.max(a,e(h).width),0),height:l.length*(((n=r)!==null&&n!==void 0?n:o)+1)+1}}return e(t.toString())}_measureNumberChar(){if(Pt(this._numberCharSize)){const t=this._standardMethod(fi.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/fi.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return Pt(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(fi.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(Pt(this._letterCharSize)){const t=this._standardMethod(fi.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/fi.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return z(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){z(this._canvas)&&(this._canvas=null),z(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}fi.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",fi.NUMBERS_CHAR_SET="0123456789",fi.FULL_SIZE_CHAR="字";function Df(i,t,e){const{x1:n,y1:o,x2:r,y2:s}=t;return e.onlyTranslate()?(i!==t&&i.setValue(t.x1,t.y1,t.x2,t.y2),i.translate(e.e,e.f),t):(i.clear(),i.add(e.a*n+e.c*o+e.e,e.b*n+e.d*o+e.f),i.add(e.a*r+e.c*o+e.e,e.b*r+e.d*o+e.f),i.add(e.a*r+e.c*s+e.e,e.b*r+e.d*s+e.f),i.add(e.a*n+e.c*s+e.e,e.b*n+e.d*s+e.f),t)}class an{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new an(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,o=0){return this.x1=t,this.y1=e,this.x2=n,this.y2=o,this}set(t=0,e=0,n=0,o=0){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),o<e?(this.y2=e,this.y1=o):(this.y1=e,this.y2=o),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 ot(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 o=this.rotatedPoints(t,e,n);return this.clear().add(o[0],o[1]).add(o[2],o[3]).add(o[4],o[5]).add(o[6],o[7])}scale(t=0,e=0,n=0,o=0){const r=this.scalePoints(t,e,n,o);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 Df(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:o,y1:r,x2:s,y2:l}=this,a=Math.cos(t),h=Math.sin(t),d=e-e*a+n*h,u=n-e*h-n*a;return[a*o-h*r+d,h*o+a*r+u,a*o-h*l+d,h*o+a*l+u,a*s-h*r+d,h*s+a*r+u,a*s-h*l+d,h*s+a*l+u]}scalePoints(t,e,n,o){const{x1:r,y1:s,x2:l,y2:a}=this;return[t*r+(1-t)*n,e*s+(1-e)*o,t*l+(1-t)*n,e*a+(1-e)*o]}}class Fe extends an{}class d2 extends an{constructor(t,e=0){super(t),t&&(this.angle=e)}intersects(t){return LC(this,t)}setValue(t=0,e=0,n=0,o=0,r=0){return super.setValue(t,e,n,o),this.angle=r,this}}class ni{constructor(t=1,e=0,n=0,o=1,r=0,s=0){this.a=t,this.b=e,this.c=n,this.d=o,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,o,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==o||this.b!==e||this.c!==n)}setValue(t,e,n,o,r,s){return this.a=t,this.b=e,this.c=n,this.d=o,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,o=this.d,r=this.e,s=this.f,l=new ni,a=t*o-e*n;return l.a=o/a,l.b=-e/a,l.c=-n/a,l.d=t/a,l.e=(n*s-o*r)/a,l.f=-(t*s-e*r)/a,l}rotate(t){const e=Math.cos(t),n=Math.sin(t),o=this.a*e+this.c*n,r=this.b*e+this.d*n,s=this.a*-n+this.c*e,l=this.b*-n+this.d*e;return this.a=o,this.b=r,this.c=s,this.d=l,this}rotateByCenter(t,e,n){const o=Math.cos(t),r=Math.sin(t),s=(1-o)*e+r*n,l=(1-o)*n-r*e,a=o*this.a-r*this.b,h=r*this.a+o*this.b,d=o*this.c-r*this.d,u=r*this.c+o*this.d,c=o*this.e-r*this.f+s,g=r*this.e+o*this.f+l;return this.a=a,this.b=h,this.c=d,this.d=u,this.e=c,this.f=g,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,o,r,s){return this.multiply(t,e,n,o,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:o,e:r,f:s}=this;return this.a=e,this.b=t,this.c=o,this.d=n,this.e=s,this.f=r,this}multiply(t,e,n,o,r,s){const l=this.a,a=this.b,h=this.c,d=this.d,u=l*t+h*e,c=a*t+d*e,g=l*n+h*o,f=a*n+d*o,p=l*r+h*s+this.e,m=a*r+d*s+this.f;return this.a=u,this.b=c,this.c=g,this.d=f,this.e=p,this.f=m,this}interpolate(t,e){const n=new ni;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:o,c:r,d:s,e:l,f:a}=this,h=n*s-o*r,d=s/h,u=-o/h,c=-r/h,g=n/h,f=(r*a-s*l)/h,p=-(n*a-o*l)/h,{x:m,y:v}=t;e.x=m*d+v*c+f,e.y=m*u+v*g+p}onlyTranslate(t=1){return this.a===t&&this.b===0&&this.c===0&&this.d===t}clone(){return new ni(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,n=this.c,o=this.d,r=t*o-e*n,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!==0||e!==0){const l=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/l):-Math.acos(t/l),s.scaleX=l,s.scaleY=r/l,s.skewX=(t*n+e*o)/r,s.skewY=0}else if(n!==0||o!==0){const l=Math.sqrt(n*n+o*o);s.rotateDeg=Math.PI/2-(o>0?Math.acos(-n/l):-Math.acos(n/l)),s.scaleX=r/l,s.scaleY=l,s.skewX=0,s.skewY=(t*n+e*o)/r}return s.rotateDeg=s2(s.rotateDeg),s}}function u2(i,t,e,n,o,r,s,l){const a=t.a,h=t.b,d=t.c,u=t.d,c=t.e,g=t.f,f=ii(s),p=We(s);let m,v;l?(m=l[0],v=l[1]):(m=e,v=n);const C=m-e,w=v-n,S=a*f+d*p,y=h*f+u*p,_=d*f-a*p,R=u*f-h*p;i.a=o*S,i.b=o*y,i.c=r*_,i.d=r*R,i.e=c+a*m+d*v-S*C-_*w,i.f=g+h*m+u*v-y*C-R*w}class c2{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:n=this.CLEAN_THRESHOLD,L_TIME:o=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<n)return 0;let s=0;const l=h=>{s++,t.delete(h)},a=Date.now();return t.forEach((h,d)=>{if(h.timestamp.length<r)return l(d);let u=0;for(;a-h.timestamp[h.timestamp.length-1-u]<o&&(u++,!(u>=r)););if(u<r)return l(d);for(;a-h.timestamp[0]>o;)h.timestamp.shift()}),s}addLimitedTimestamp(t,e,n){const{R_TIMESTAMP_MAX_SIZE:o=this.R_TIMESTAMP_MAX_SIZE}=n;t.timestamp.length>o&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:n=this.L_TIME}=e,o=Date.now();t.forEach(r=>{for(;o-r.timestamp[0]>n;)r.timestamp.shift()})}clearItemTimestamp(t,e){const{L_TIME:n=this.L_TIME}=e,o=Date.now();for(;o-t.timestamp[0]>n;)t.timestamp.shift()}}function Of(i,t,e){t/=100,e/=100;const n=(1-Math.abs(2*e-1))*t,o=n*(1-Math.abs(i/60%2-1)),r=e-n/2;let s=0,l=0,a=0;return 0<=i&&i<60?(s=n,l=o,a=0):60<=i&&i<120?(s=o,l=n,a=0):120<=i&&i<180?(s=0,l=n,a=o):180<=i&&i<240?(s=0,l=o,a=n):240<=i&&i<300?(s=o,l=0,a=n):300<=i&&i<360&&(s=n,l=0,a=o),s=Math.round(255*(s+r)),l=Math.round(255*(l+r)),a=Math.round(255*(a+r)),{r:s,g:l,b:a}}function zf(i,t,e){i/=255,t/=255,e/=255;const n=Math.min(i,t,e),o=Math.max(i,t,e),r=o-n;let s=0,l=0,a=0;return s=r===0?0:o===i?(t-e)/r%6:o===t?(e-i)/r+2:(i-t)/r+4,s=Math.round(60*s),s<0&&(s+=360),a=(o+n)/2,l=r===0?0:r/(1-Math.abs(2*a-1)),l=+(100*l).toFixed(1),a=+(100*a).toFixed(1),{h:s,s:l,l:a}}const g2=/^#([0-9a-f]{3,8})$/,IC={transparent:4294967040},ad={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 hd(i){return((i=Math.max(0,Math.min(255,Math.round(i)||0)))<16?"0":"")+i.toString(16)}function DC(i){return ut(i)?new $i(i>>16,i>>8&255,255&i,1):ot(i)?new $i(i[0],i[1],i[2]):new $i(255,255,255)}function f2(i){return ut(i)?new $i(i>>>24,i>>>16&255,i>>>8&255,255&i):ot(i)?new $i(i[0],i[1],i[2],i[3]):new $i(255,255,255,1)}function Wf(i){return i<.04045?.0773993808*i:Math.pow(.9478672986*i+.0521327014,2.4)}function Nf(i){return i<.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}const OC=(i,t)=>{const e=g2.exec(i);if(t||e){const n=parseInt(e[1],16),o=e[1].length;return o===3?new $i((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):o===6?DC(n):o===8?new $i(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):null}};class hn{static Brighter(t,e=1){return e===1?t:new hn(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return e===1?t:new hn(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const n=t instanceof hn?t:new hn(t);switch(e){case"hsv":default:return n.getHSVBrightness();case"hsl":return n.getHSLBrightness();case"lum":return n.getLuminance();case"lum2":return n.getLuminance2();case"lum3":return n.getLuminance3()}}static parseColorString(t){if(z(IC[t]))return f2(IC[t]);if(z(ad[t]))return DC(ad[t]);const e=`${t}`.trim().toLowerCase(),n=OC(e);if(n!==void 0)return n;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const o=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new $i(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10),parseFloat(o[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const o=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),r=Of(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10));return new $i(r.r,r.g,r.b,parseFloat(o[3]))}}constructor(t){const e=hn.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new $i(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:n,b:o}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(o*t))),this}add(t){const{r:e,g:n,b:o}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,n+t.color.g),this.color.b+=Math.min(255,o+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:n,b:o}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(o*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return .5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,n){const o=this.color.opacity,r=zf(this.color.r,this.color.g,this.color.b),s=Of(Pt(t)?r.h:ln(t,0,360),Pt(e)?r.s:e>=0&&e<=1?100*e:e,Pt(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new $i(s.r,s.g,s.b,o),this}setRGB(t,e,n){return!Pt(t)&&(this.color.r=t),!Pt(e)&&(this.color.g=e),!Pt(n)&&(this.color.b=n),this}setHex(t){const e=`${t}`.trim().toLowerCase(),n=OC(e,!0);return n??this}setColorName(t){const e=ad[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new hn(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,n),this.color.g=Math.pow(t.color.g,n),this.color.b=Math.pow(t.color.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Wf(t.color.r),this.color.g=Wf(t.color.g),this.color.b=Wf(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Nf(t.color.r),this.color.g=Nf(t.color.g),this.color.b=Nf(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class $i{constructor(t,e,n,o){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),z(o)?this.opacity=isNaN(+o)?1:Math.max(0,Math.min(1,+o)):this.opacity=1}formatHex(){return`#${hd(this.r)+hd(this.g)+hd(this.b)+(this.opacity===1?"":hd(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${t===1?"rgb(":"rgba("}${this.r},${this.g},${this.b}${t===1?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:n,l:o}=zf(this.r,this.g,this.b);return`${t===1?"hsl(":"hsla("}${e},${n}%,${o}%${t===1?")":`,${t})`}`}toString(){return this.formatHex()}}function p2(i){let t="",e="",n="";const o=i[0]==="#"?1:0;for(let r=o;r<i.length;r++)i[r]!=="#"&&(r<o+2?t+=i[r]:r<o+4?e+=i[r]:r<o+6&&(n+=i[r]));return[parseInt(t,16),parseInt(e,16),parseInt(n,16)]}function m2(i,t,e){return Number((1<<24)+(i<<16)+(t<<8)+e).toString(16).slice(1)}function v2(i,t){const e=i.r,n=t.r,o=i.g,r=t.g,s=i.b,l=t.b,a=i.opacity,h=t.opacity;return d=>{const u=Math.round(e*(1-d)+n*d),c=Math.round(o*(1-d)+r*d),g=Math.round(s*(1-d)+l*d);return new $i(u,c,g,a*(1-d)+h*d)}}const b2=Object.freeze(Object.defineProperty({__proto__:null,Color:hn,DEFAULT_COLORS:ad,RGB:$i,hexToRgb:p2,hslToRgb:Of,interpolateRgb:v2,rgbToHex:m2,rgbToHsl:zf},Symbol.toStringTag,{value:"Module"}));function ao(i){if(Te(i))return[i,i,i,i];if(ot(i)){const t=i.length;if(t===1){const e=i[0];return[e,e,e,e]}if(t===2){const[e,n]=i;return[e,n,e,n]}if(t===3){const[e,n,o]=i;return[e,n,o,n]}if(t===4)return i}if(ue(i)){const{top:t=0,right:e=0,bottom:n=0,left:o=0}=i;return[t,e,n,o]}return[0,0,0,0]}function C2(i){try{return i instanceof Element}catch{const e=["children","innerHTML","classList","setAttribute","tagName","getBoundingClientRect"],n=Object.keys(i);return e.every(o=>n.includes(o))}}const y2=Ri-1e-8;class Vf{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,o,r,s){if(Math.abs(r-o)>y2)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let l,a,h,d,u=1/0,c=-1/0,g=1/0,f=-1/0;function p(m){h=n*Math.cos(m),d=n*Math.sin(m),h<u&&(u=h),h>c&&(c=h),d<g&&(g=d),d>f&&(f=d)}if(p(o),p(r),r!==o)if((o%=Ri)<0&&(o+=Ri),(r%=Ri)<0&&(r+=Ri),r<o&&(s=!s,l=o,o=r,r=l),s)for(r-=Ri,l=o-o%Sn,a=0;a<4&&l>r;++a,l-=Sn)p(l);else for(l=o-o%Sn+Sn,a=0;a<4&&l<r;++a,l+=Sn)p(l);this.bounds.add(t+u,e+g),this.bounds.add(t+c,e+f)}arcTo(t,e,n,o,r){this.bounds.add(t,e)}bezierCurveTo(t,e,n,o,r,s){this.bounds.add(t,e),this.bounds.add(n,o),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,o){this.bounds.add(t,e),this.bounds.add(n,o)}rect(t,e,n,o){this.bounds.add(t,e),this.bounds.add(t+n,e+o)}clear(){this.bounds.clear()}release(...t){}}class _2{constructor(){this.curves=[],this.bounds=new Fe}getCurveLengths(){return this.curves.map(t=>t.getLength())}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const w2=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,S2={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 jf,zC,dd,WC,$f,ud;function x2(i){if(!i)return[];const t=i.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(t===null)return[];let e,n;const o=[];for(let r=0,s=t.length;r<s;r++)if(jf=t[r],zC=jf.slice(1),dd=jf[0],e=[dd],n=zC.match(w2),n!==null){for(let l=0,a=n.length;l<a;l++)WC=n[l],$f=parseFloat(WC),Number.isNaN($f)||e.push($f);if(ud=S2[dd],e.length-1>ud){let l,a=dd;for(let h=1,d=e.length;h<d;h+=ud){l=[a];for(let u=h,c=h+ud;u<c;u++)l.push(e[u]);o.push(l),a==="m"?a="l":a==="M"&&(a="L")}}else o.push(e)}else o.push(e);return o}var xe;(function(i){i[i.NONE=0]="NONE",i[i.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",i[i.UPDATE_SHAPE=2]="UPDATE_SHAPE",i[i.CLEAR_SHAPE=253]="CLEAR_SHAPE",i[i.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",i[i.INIT=179]="INIT",i[i.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",i[i.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",i[i.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",i[i.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",i[i.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",i[i.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",i[i.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",i[i.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"})(xe||(xe={}));var ea;(function(i){i[i.GLOBAL=1]="GLOBAL",i[i.LOCAL=16]="LOCAL",i[i.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",i[i.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"})(ea||(ea={}));var Zi;(function(i){i[i.INIT=0]="INIT",i[i.DEFAULT=1]="DEFAULT",i[i.STATE=2]="STATE",i[i.ANIMATE_BIND=10]="ANIMATE_BIND",i[i.ANIMATE_PLAY=11]="ANIMATE_PLAY",i[i.ANIMATE_START=12]="ANIMATE_START",i[i.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",i[i.ANIMATE_END=14]="ANIMATE_END",i[i.TRANSLATE=20]="TRANSLATE",i[i.TRANSLATE_TO=21]="TRANSLATE_TO",i[i.SCALE=22]="SCALE",i[i.SCALE_TO=23]="SCALE_TO",i[i.ROTATE=24]="ROTATE",i[i.ROTATE_TO=25]="ROTATE_TO"})(Zi||(Zi={}));var Ii;(function(i){i[i.INITIAL=0]="INITIAL",i[i.RUNNING=1]="RUNNING",i[i.PAUSED=2]="PAUSED",i[i.END=3]="END"})(Ii||(Ii={}));var cd;(function(i){i[i.NORMAL=0]="NORMAL",i[i.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"})(cd||(cd={}));var Ws;(function(i){i.wait="wait",i.from="from",i.to="to",i.customAnimate="customAnimate"})(Ws||(Ws={}));var He;(function(i){i[i.ROW=1]="ROW",i[i.COLUMN=2]="COLUMN"})(He||(He={}));var gd;(function(i){i[i.CubicBezierCurve=0]="CubicBezierCurve",i[i.QuadraticBezierCurve=1]="QuadraticBezierCurve",i[i.ArcCurve=2]="ArcCurve",i[i.LineCurve=3]="LineCurve",i[i.EllipseCurve=4]="EllipseCurve",i[i.MoveCurve=5]="MoveCurve"})(gd||(gd={}));var ge;(function(i){i[i.beforeFillStroke=0]="beforeFillStroke",i[i.afterFillStroke=1]="afterFillStroke"})(ge||(ge={}));function A2(i,t,e,n,o,r,s,l,a){const h=xn(s),d=Math.sin(h),u=Math.cos(h),c=u*(l-i)*.5+d*(a-t)*.5,g=u*(a-t)*.5-d*(l-i)*.5;let f=c*c/((e=Math.abs(e))*e)+g*g/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),e*=f,n*=f);const p=u/e,m=d/e,v=-d/n,C=u/n,w=p*l+m*a,S=v*l+C*a,y=p*i+m*t,_=v*i+C*t;let R=1/((y-w)*(y-w)+(_-S)*(_-S))-.25;R<0&&(R=0);let A=Math.sqrt(R);r===o&&(A=-A);const x=.5*(w+y)-A*(_-S),T=.5*(S+_)+A*(y-w),M=Math.atan2(S-T,w-x);let B=Math.atan2(_-T,y-x)-M;B<0&&r===1?B+=Ri:B>0&&r===0&&(B-=Ri);const H=Math.ceil(Math.abs(B/(Sn+.001))),F=[];for(let P=0;P<H;++P){const E=M+P*B/H,L=M+(P+1)*B/H;F[P]=[x,T,E,L,e,n,d,u]}return F}function R2(i){const t=i[0],e=i[1],n=i[2],o=i[3],r=i[4],s=i[5],l=i[6],a=i[7],h=a*r,d=-l*s,u=l*r,c=a*s,g=Math.cos(n),f=Math.sin(n),p=Math.cos(o),m=Math.sin(o),v=.5*(o-n),C=Math.sin(.5*v),w=8/3*C*C/Math.sin(v),S=t+g-w*f,y=e+f+w*g,_=t+p,R=e+m,A=_+w*m,x=R-w*p;return[h*S+d*y,u*S+c*y,h*A+d*x,u*A+c*x,h*_+d*R,u*_+c*R]}function NC(i,t,e,n){const o=A2(n[5],n[6],n[0],n[1],n[3],n[4],n[2],t,e);for(let r=0;r<o.length;++r){const s=R2(o[r]);i.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const T2=(i,t,e,n,o,r,s)=>{const l=Math.abs(e-t),a=l>.5*Math.PI?Math.ceil(2*l/Math.PI):1,h=(e-t)/a;for(let d=0;d<a;d++){const u=t+h*d,c=t+h*(d+1),g=4*Math.tan(Math.abs(h)/4)/3,f=c<u?-1:1,p=Math.cos(u),m=Math.sin(u),v=Math.cos(c),C=Math.sin(c),w=p*r+n,S=m*s+o,y=v*r+n,_=C*s+o,R=r*g*f,A=s*g*f;i.push(w-R*m,S+A*p,y+R*C,_-A*v,y,_)}},M2=[(i,t,e,n,o,r,s)=>t.arc(i[1]*o+e,i[2]*r+n,i[3]*(o+r)/2,i[4],i[5],i[6],s),(i,t,e,n,o,r,s)=>t.arcTo(i[1]*o+e,i[2]*r+n,i[3]*o+e,i[4]*r+n,i[5]*(o+r)/2,s),(i,t,e,n,o,r,s)=>t.bezierCurveTo(i[1]*o+e,i[2]*r+n,i[3]*o+e,i[4]*r+n,i[5]*o+e,i[6]*r+n,s),(i,t,e,n)=>t.closePath(),(i,t,e,n,o,r)=>t.ellipse(i[1]*o+e,i[2]*r+n,i[3]*o,i[4]*r,i[5],i[6],i[7],i[8]),(i,t,e,n,o,r,s)=>t.lineTo(i[1]*o+e,i[2]*r+n,s),(i,t,e,n,o,r,s)=>t.moveTo(i[1]*o+e,i[2]*r+n,s),(i,t,e,n,o,r,s)=>t.quadraticCurveTo(i[1]*o+e,i[2]*r+n,i[3]*o+e,i[4]*r+n,s),(i,t,e,n,o,r,s)=>t.rect(i[1]*o+e,i[2]*r+n,i[3]*o,i[4]*r,s)];function hr(i,t,e=0,n=0,o=1,r=1,s){for(let l=0;l<i.length;l++){const a=i[l];M2[a[0]](a,t,e,n,o,r,s)}}class VC{getLength(t){return t!=null?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function B2(i,t){let e=0;const n=i.length;for(let o=0;o<n;o++){const r=i[o],s=t[o],l=i[(o+1)%n],a=t[(o+1)%n];e+=Ho.distanceNN(r,s,l,a)}return e/2}function P2(i,t,e,n,o){return B2([i.x,t.x,e.x,n.x],[i.y,t.y,e.y,n.y])}function jC(i,t,e,n,o){const r=1-o;return r*r*r*i+3*t*o*r*r+3*e*o*o*r+n*o*o*o}function $C(i,t,e,n,o){const r=jC(i.x,t.x,e.x,n.x,o),s=jC(i.y,t.y,e.y,n.y,o);return new Xe(r,s)}function Gf(i,t){const{p0:e,p1:n,p2:o,p3:r}=i,s=$C(e,n,o,r,t),l=Ho.pointAtPP(e,n,t),a=Ho.pointAtPP(n,o,t),h=Ho.pointAtPP(o,r,t),d=Ho.pointAtPP(l,a,t),u=Ho.pointAtPP(a,h,t);return[new Uf(e,l,d,s),new Uf(s,u,h,r)]}class Uf extends VC{constructor(t,e,n,o){super(),this.type=gd.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=n,this.p3=o}_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(this.defined!==!1)return $C(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?P2(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===He.ROW?_e(this.p0.x-this.p3.x):t===He.COLUMN?_e(this.p0.y-this.p3.y):0}getAngleAt(t){const e=ar(t-.01,0),n=Fi(t+.01,1),o=this.getPointAt(e),r=this.getPointAt(n);return Ce(r.y-o.y,r.x-o.x)}}function GC(i,t){const{p0:e,p1:n}=i,o=Ho.pointAtPP(e,n,t);return[new Kf(e,o),new Kf(o,n)]}class Kf extends VC{constructor(t,e){super(),this.type=gd.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(this.defined!==!1)return Ho.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return this.angle==null&&(this.angle=Ce(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()?Ho.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===He.ROW?_e(this.p0.x-this.p1.x):t===He.COLUMN?_e(this.p0.y-this.p1.y):0}}class Yf{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,o,r,s,l,a){const h=new Uf(new Xe(this._lastX,this._lastY),new Xe(t,e),new Xe(n,o),new Xe(r,s));h.originP1=this._lastOriginP,h.originP2=a,h.defined=l,this.curves.push(h),this._lastX=r,this._lastY=s,this._lastOriginP=a}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,o){const r=this.addLinearCurve(t,e,n,this._lastOriginP,o);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=o}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,o){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,o,r){const s=new Kf(new Xe(this._lastX,this._lastY),new Xe(t,e));return s.originP1=o,s.originP2=r,s.defined=n,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===He.COLUMN){if(!this.curves.length)return 0;const o=this.curves[0],r=this.curves[this.curves.length-1],s=(e=r.p3)!==null&&e!==void 0?e:r.p1;return _e(o.p0.y-s.y)}if(t===He.ROW){if(!this.curves.length)return 0;const o=this.curves[0],r=this.curves[this.curves.length-1],s=(n=r.p3)!==null&&n!==void 0?n:r.p1;return _e(o.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((o,r)=>o+r.getLength(),0)),this.length}}class H2 extends Yf{bezierCurveTo(t,e,n,o,r,s,l,a){return super.bezierCurveTo(e,t,o,n,s,r,l,a)}lineTo(t,e,n,o){return super.lineTo(e,t,n,o)}moveTo(t,e,n){return super.moveTo(e,t,n)}clear(){return super.clear()}}function $r(i,t,e=1){let n=!1;for(let o=0,r=t.length;o<=r;o++)o>=r===n&&((n=!n)?i.lineStart():i.lineEnd()),n&&i.point(t[o])}function Ns(i,t,e){const n=t??(_e(e[e.length-1].x-e[0].x)>_e(e[e.length-1].y-e[0].y)?He.ROW:He.COLUMN);return i==="monotoneY"?new H2(i,n):new Yf(i,n)}class UC{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||this._line!==0&&this._point===1)&&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,this._lastDefined!==!1&&t.defined!==!1,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,this._lastDefined!==!1&&t.defined!==!1,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function ia(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;const o=Ns("linear",e,i);return E2(new UC(o,n),i),o}function E2(i,t){return $r(i,t,1)}function KC(i,t,e,n,o){i.context.bezierCurveTo((2*i._x0+i._x1)/3,(2*i._y0+i._y1)/3,(i._x0+2*i._x1)/3,(i._y0+2*i._y1)/3,(i._x0+4*i._x1+t)/6,(i._y0+4*i._y1+e)/6,n,i.lastPoint1)}class k2{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(){this._point===2&&KC(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1),(this._line||this._line!==0&&this._point===1)&&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,this._lastDefined1!==!1&&this._lastDefined2!==!1,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:KC(this,e,n,this._lastDefined1!==!1&&this._lastDefined2!==!1)}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 L2(i,t){return $r(i,t,2)}function F2(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;if(i.length<3-+!!n)return ia(i,t);const o=Ns("basis",e,i);return L2(new k2(o,n),i),o}function YC(i){return i<0?-1:1}function XC(i,t,e){const n=i._x1-i._x0,o=t-i._x1,r=(i._y1-i._y0)/(n||Number(o<0&&-0)),s=(e-i._y1)/(o||Number(n<0&&-0)),l=(r*o+s*n)/(n+o);return(YC(r)+YC(s))*Math.min(Math.abs(r),Math.abs(s),.5*Math.abs(l))||0}function qC(i,t){const e=i._x1-i._x0;return e?(3*(i._y1-i._y0)/e-t)/2:t}function Xf(i,t,e,n,o){const r=i._x0,s=i._y0,l=i._x1,a=i._y1,h=(l-r)/3;i.context.bezierCurveTo(r+h,s+h*t,l-h,a-h*e,l,a,n,i.lastPoint1)}class ZC{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,this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1);break;case 3:Xf(this,this._t0,qC(this,this._t0),this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1)}(this._line||this._line!==0&&this._point===1)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const n=t.x,o=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,o,this._lastDefined1!==!1&&this._lastDefined2!==!1,t):this.context.moveTo(n,o,t);break;case 1:this._point=2;break;case 2:this._point=3,Xf(this,qC(this,e=XC(this,n,o)),e,this._lastDefined1!==!1&&this._lastDefined2!==!1);break;default:Xf(this,this._t0,e=XC(this,n,o),this._lastDefined1!==!1&&this._lastDefined2!==!1)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=o,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined!==!1,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class I2 extends ZC{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function D2(i,t){return $r(i,t,2)}function O2(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;if(i.length<3-+!!n)return ia(i,t);const o=Ns("monotoneX",e,i);return D2(new ZC(o,n),i),o}function z2(i,t){return $r(i,t,2)}function W2(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;if(i.length<3-+!!n)return ia(i,t);const o=Ns("monotoneY",e,i);return z2(new I2(o,n),i),o}let N2=class{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&&this._point===2&&this.context.lineTo(this._x,this._y,this._lastDefined!==!1,this.lastPoint),(this._line||this._line!==0&&this._point===1)&&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,this._lastDefined!==!1&&t.defined!==!1,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,this._lastDefined!==!1&&t.defined!==!1,this.lastPoint),this.context.lineTo(e,n,this._lastDefined!==!1&&t.defined!==!1,t);else{const o=this._x*(1-this._t)+e*this._t;this.context.lineTo(o,this._y,this._lastDefined!==!1&&t.defined!==!1,this.lastPoint),this.context.lineTo(o,n,this._lastDefined!==!1&&t.defined!==!1,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function qf(i,t,e={}){const{direction:n,startPoint:o}=e;if(i.length<2-+!!o)return null;const r=new Yf("step",n??(_e(i[i.length-1].x-i[0].x)>_e(i[i.length-1].y-i[0].y)?He.ROW:He.COLUMN));return V2(new N2(r,t,o),i),r}function V2(i,t){return $r(i,t,1)}class j2 extends UC{lineEnd(){this.context.closePath()}}function $2(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;const o=Ns("linear",e,i);return G2(new j2(o,n),i),o}function G2(i,t){return $r(i,t,1)}function JC(i,t,e,n,o){let r=i._x1,s=i._y1,l=i._x2,a=i._y2;if(i._l01_a>Le){const h=2*i._l01_2a+3*i._l01_a*i._l12_a+i._l12_2a,d=3*i._l01_a*(i._l01_a+i._l12_a);r=(r*h-i._x0*i._l12_2a+i._x2*i._l01_2a)/d,s=(s*h-i._y0*i._l12_2a+i._y2*i._l01_2a)/d}if(i._l23_a>Le){const h=2*i._l23_2a+3*i._l23_a*i._l12_a+i._l12_2a,d=3*i._l23_a*(i._l23_a+i._l12_a);l=(l*h+i._x1*i._l23_2a-t*i._l12_2a)/d,a=(a*h+i._y1*i._l23_2a-e*i._l12_2a)/d}i.context.bezierCurveTo(r,s,l,a,i._x2,i._y2,n,i.lastPoint1)}class U2{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,this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||this._line!==0&&this._point===1)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:n}=t;if(this._point){const o=this._x2-e,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(o*o+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,this._lastDefined1!==!1&&this._lastDefined2!==!1):this.context.moveTo(e,n);break;case 1:this._point=2;break;case 2:this._point=3;default:JC(this,e,n,this._lastDefined1!==!1&&this._lastDefined2!==!1)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function QC(i,t){return function(e,n,o={}){const{direction:r,startPoint:s}=o;if(e.length<2-+!!s)return null;if(e.length<3-+!!s)return ia(e,o);const l=Ns(i,r,e),a=new t(l,n,s);return $r(a,e,2),l}}const K2=QC("catmullRom",U2);class Y2{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._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=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 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:n}=t;if(this._point){const o=this._x2-e,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(o*o+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=n;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=n,t);break;case 2:this._point=3,this._x5=e,this._y5=n;break;default:JC(this,e,n,this._lastDefined1!==!1&&this._lastDefined2!==!1)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}const X2=QC("catmullRomClosed",Y2);function Gr(i,t,e){var n,o;switch(t){case"linear":default:return ia(i,e);case"basis":return F2(i,e);case"monotoneX":return O2(i,e);case"monotoneY":return W2(i,e);case"step":return qf(i,.5,e);case"stepBefore":return qf(i,0,e);case"stepAfter":return qf(i,1,e);case"catmullRom":return K2(i,(n=e==null?void 0:e.curveTension)!==null&&n!==void 0?n:.5,e);case"catmullRomClosed":return X2(i,(o=e==null?void 0:e.curveTension)!==null&&o!==void 0?o:.5,e);case"linearClosed":return $2(i,e)}}class wi extends _2{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Vf(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([ye.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([ye.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,o){return this.commandList.push([ye.Q,t,e,n,o]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,o),this}bezierCurveTo(t,e,n,o,r,s){return this.commandList.push([ye.C,t,e,n,o,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,o,r,s),this}arcTo(t,e,n,o,r){return this.commandList.push([ye.AT,t,e,n,o,r]),this._ctx&&this._ctx.arcTo(t,e,n,o,r),this}ellipse(t,e,n,o,r,s,l,a){return this.commandList.push([ye.E,t,e,n,o,r,s,l,a]),this._ctx&&this._ctx.ellipse(t,e,n,o,r,s,l,a),this}rect(t,e,n,o){return this.commandList.push([ye.R,t,e,n,o]),this._ctx&&this._ctx.rect(t,e,n,o),this}arc(t,e,n,o,r,s){return this.commandList.push([ye.A,t,e,n,o,r,s]),this._ctx&&this._ctx.arc(t,e,n,o,r,s),this}closePath(){return this.commandList.push([ye.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const n=[];n[ye.M]=o=>`M${o[1]} ${o[2]}`,n[ye.L]=o=>`L${o[1]} ${o[2]}`,n[ye.Q]=o=>`Q${o[1]} ${o[2]} ${o[3]} ${o[4]}`,n[ye.C]=o=>`C${o[1]} ${o[2]} ${o[3]} ${o[4]} ${o[5]} ${o[6]}`,n[ye.A]=o=>{const r=[];T2(r,o[4],o[5],o[1],o[2],o[3],o[3]);let s="";for(let l=0;l<r.length;l+=6)s+=`C${r[l]} ${r[l+1]} ${r[l+2]} ${r[l+3]} ${r[l+4]} ${r[l+5]}`;return s},n[ye.R]=o=>`M${o[1]} ${o[2]} h${o[3]} v${o[4]} H${o[1]}Z`,n[ye.Z]=o=>"Z",this.toStringCbList=n}const t=this.toStringCbList;let e="";return this.commandList.forEach(n=>{e+=t[n[0]](n)}),e}fromString(t,e,n,o,r){this.clear();const s=x2(t);return this._runCommandStrList(s,e,n,o,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:n,clipRangeByDimension:o}=t.attribute;if(!e)return;const r=Gr(e,n);o==="x"?this.direction=He.ROW:o==="y"?this.direction=He.COLUMN:o==="auto"&&(this.direction=r.direction),this.curves=r.curves}fromCustomPath2D(t,e,n,o,r){return this.clear(),this._runCommandList(t.commandList,e,n,o,r),this._updateBounds(),this}transform(t,e,n,o){const r=this.commandList;if(!this.transformCbList){const s=[];s[ye.M]=this.moveToTransform,s[ye.L]=this.lineToTransform,s[ye.Q]=this.quadraticCurveToTransform,s[ye.C]=this.bezierCurveToTransform,s[ye.AT]=this.arcToTransform,s[ye.E]=this.ellipseTransform,s[ye.R]=this.rectTransform,s[ye.A]=this.arcTransform,s[ye.Z]=this.closePathTransform,this.transformCbList=s}r.forEach(s=>{this.transformCbList[s[0]](s,t,e,n,o)}),this._updateBounds()}moveToTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n}lineToTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n}quadraticCurveToTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*o+e,t[4]=t[4]*r+n}bezierCurveToTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*o+e,t[4]=t[4]*r+n,t[5]=t[5]*o+e,t[6]=t[6]*r+n}arcToTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*o+e,t[4]=t[4]*r+n,t[5]=t[5]*(o+r)/2}ellipseTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*o,t[4]=t[4]*r}rectTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*o,t[4]=t[4]*r}arcTransform(t,e,n,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+n,t[3]=t[3]*(o+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,n=0,o=1,r=1){let s,l,a,h,d,u=null,c=0,g=0,f=0,p=0;for(let m=0,v=t.length;m<v;++m){switch(s=t[m],o===1&&r===1||(s=q2(s,o,r)),s[0]){case"l":c+=s[1],g+=s[2],this.lineTo(c+e,g+n);break;case"L":c=s[1],g=s[2],this.lineTo(c+e,g+n);break;case"h":c+=s[1],this.lineTo(c+e,g+n);break;case"H":c=s[1],this.lineTo(c+e,g+n);break;case"v":g+=s[1],this.lineTo(c+e,g+n);break;case"V":g=s[1],this.lineTo(c+e,g+n);break;case"m":c+=s[1],g+=s[2],this.moveTo(c+e,g+n);break;case"M":c=s[1],g=s[2],this.moveTo(c+e,g+n);break;case"c":l=c+s[5],a=g+s[6],f=c+s[3],p=g+s[4],this.bezierCurveTo(c+s[1]+e,g+s[2]+n,f+e,p+n,l+e,a+n),c=l,g=a;break;case"C":c=s[5],g=s[6],f=s[3],p=s[4],this.bezierCurveTo(s[1]+e,s[2]+n,f+e,p+n,c+e,g+n);break;case"s":l=c+s[3],a=g+s[4],f=2*c-f,p=2*g-p,this.bezierCurveTo(f+e,p+n,c+s[1]+e,g+s[2]+n,l+e,a+n),f=c+s[1],p=g+s[2],c=l,g=a;break;case"S":l=s[3],a=s[4],f=2*c-f,p=2*g-p,this.bezierCurveTo(f+e,p+n,s[1]+e,s[2]+n,l+e,a+n),c=l,g=a,f=s[1],p=s[2];break;case"q":l=c+s[3],a=g+s[4],f=c+s[1],p=g+s[2],this.quadraticCurveTo(f+e,p+n,l+e,a+n),c=l,g=a;break;case"Q":l=s[3],a=s[4],this.quadraticCurveTo(s[1]+e,s[2]+n,l+e,a+n),c=l,g=a,f=s[1],p=s[2];break;case"t":l=c+s[1],a=g+s[2],u[0].match(/[QqTt]/)===null?(f=c,p=g):u[0]==="t"?(f=2*c-h,p=2*g-d):u[0]==="q"&&(f=2*c-f,p=2*g-p),h=f,d=p,this.quadraticCurveTo(f+e,p+n,l+e,a+n),c=l,g=a,f=c+s[1],p=g+s[2];break;case"T":l=s[1],a=s[2],f=2*c-f,p=2*g-p,this.quadraticCurveTo(f+e,p+n,l+e,a+n),c=l,g=a;break;case"a":NC(this,c+e,g+n,[s[1],s[2],s[3],s[4],s[5],s[6]+c+e,s[7]+g+n]),c+=s[6],g+=s[7];break;case"A":NC(this,c+e,g+n,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+n]),c=s[6],g=s[7];break;case"z":case"Z":this.closePath()}u=s}}_runCommandList(t,e=0,n=0,o=1,r=1){if(e!==0||n!==0||o!==1||r!==1)for(let s=0,l=t.length;s<l;++s){const a=t[s].slice();switch(a[0]){case ye.L:this.lineToTransform(a,e,n,o,r);break;case ye.M:this.moveToTransform(a,e,n,o,r);break;case ye.C:this.bezierCurveToTransform(a,e,n,o,r);break;case ye.Q:this.quadraticCurveToTransform(a,e,n,o,r);break;case ye.A:this.arcToTransform(a,e,n,o,r);break;case ye.E:this.ellipseTransform(a,e,n,o,r);break;case ye.R:this.rectTransform(a,e,n,o,r);break;case ye.AT:this.arcToTransform(a,e,n,o,r);break;case ye.Z:this.closePath()}}else this.commandList=t.map(s=>s.slice())}_updateBounds(){this.bounds.clear(),hr(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===He.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return _e(t.p0.y-e.p1.y)}if(this.direction===He.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return _e(t.p0.x-e.p1.x)}return this.curves.reduce((t,e)=>t+e.getLength(),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,n=0;for(let r=0;r<this.curves.length;r++){e=this.curves[r];const s=e.getLength(this.direction);if(n+s>=t)break;n+=s}const o=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(o),angle:e.getAngleAt(o)}}}const An=["l",0,0,0,0,0,0,0];function q2(i,t,e){const n=An[0]=i[0];if(n==="a"||n==="A")An[1]=t*i[1],An[2]=e*i[2],An[3]=i[3],An[4]=i[4],An[5]=i[5],An[6]=t*i[6],An[7]=e*i[7];else if(n==="h"||n==="H")An[1]=t*i[1];else if(n==="v"||n==="V")An[1]=e*i[1];else for(let o=1,r=i.length;o<r;++o)An[o]=(o%2==1?t:e)*i[o];return An}const Z2={alignSelf:"auto"},pi={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new ni},ty={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Zf={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},ey=Object.assign({outerBorder:Object.assign(Object.assign({},Zf),{distance:0}),innerBorder:Object.assign(Object.assign({},Zf),{distance:0})},Zf),Rn={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:`PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,
|
|
6
6
|
Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0},J2={pickStrokeBuffer:0},Q2=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},ty),ey),Z2),J2),iy={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Ue=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic"},{_debug_bounds:!1}),Q2),pi),tH=Object.assign(Object.assign({},Ue),{startAngle:0,endAngle:ce,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),eH=Object.assign(Object.assign(Object.assign({},Ue),iy),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),iH=Object.assign(Object.assign({},Ue),{radius:1,startAngle:0,endAngle:ce}),nH=Object.assign(Object.assign({},Ue),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1}),oH=Object.assign(Object.assign({},Ue),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),rH=Object.assign(Object.assign(Object.assign({},Ue),iy),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),sH=Object.assign(Object.assign({},Ue),{path:new wi,fillStrokeOrder:1,customPath:()=>{Me.getInstance().warn("空函数")}}),lH=Object.assign(Object.assign({},Ue),{points:[],cornerRadius:0,closePath:!0}),aH=Object.assign(Object.assign({},Ue),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},Ue),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const hH=Object.assign(Object.assign({},Ue),{symbolType:"circle",size:10,keepDirIn3d:!0}),ny=Object.assign(Object.assign(Object.assign({},Ue),Rn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Eo=Object.assign(Object.assign(Object.assign({},Ue),Rn),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),na=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Ue),{fill:!0,cornerRadius:0}),dH=Object.assign(Object.assign({},na),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});class uH{}const tt=new uH,Jf={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},oy={fontSize:16,fontFamily:"sans-serif",fill:!0,stroke:!1,fontWeight:"normal",lineHeight:"normal",fontStyle:"normal",textDecoration:"none",textAlign:"left",script:"normal"},fd=/\w|\(|\)|-/,ry=/[.?!,;:/,。?!、;:]/,cH=/\S/,sy=(i,t)=>{let e=t.fontSize||16;switch(t.script){case"super":case"sub":e*=.8}i.setTextStyle({textAlign:"left",textBaseline:t.textBaseline||"alphabetic",fontStyle:t.fontStyle||"",fontWeight:t.fontWeight||"",fontSize:e,fontFamily:t.fontFamily||"sans-serif"})};function gH(i,t){const e=t&&t.fill||oy.fill;if(!e)return void(i.globalAlpha=0);const{fillOpacity:n=1,opacity:o=1}=t;i.globalAlpha=n*o,i.fillStyle=e,sy(i,t)}function fH(i,t){const e=t&&t.stroke||oy.stroke;if(!e)return void(i.globalAlpha=0);const{strokeOpacity:n=1,opacity:o=1}=t;i.globalAlpha=n*o,i.lineWidth=t&&typeof t.lineWidth=="number"?t.lineWidth:1,i.strokeStyle=e,sy(i,t)}function Qf(i,t,e,n,o){if(!t||t<=0)return 0;const r=tt.graphicUtil.textMeasure;let s=n,l=i.slice(0,s),a=Math.floor(r.measureText(l,e).width),h=i.slice(0,s+1),d=Math.floor(r.measureText(h,e).width);for(;a>t||d<=t;){if(a>t?s--:s++,s>i.length){s=i.length;break}if(s<0){s=0;break}l=i.slice(0,s),a=Math.floor(r.measureText(l,e).width),h=i.slice(0,s+1),d=Math.floor(r.measureText(h,e).width)}return o&&(s=pd(i,s)),s}function pd(i,t,e=!1){let n=t;for(;fd.test(i[n-1])&&fd.test(i[n])||ry.test(i[n]);)if(n--,n<=0)return e?pH(i,t):t;return n}function pH(i,t){let e=t;for(;fd.test(i[e-1])&&fd.test(i[e])||ry.test(i[e]);)if(e++,e>=i.length)return e;return e}function Vs(i,t){const e=tt.graphicUtil.textMeasure.measureText(i,t),n={ascent:0,height:0,descent:0,width:0};return typeof e.actualBoundingBoxAscent!="number"||typeof e.actualBoundingBoxDescent!="number"?(n.width=Math.floor(e.width),n.height=t.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(e.width),n.height=Math.floor(e.actualBoundingBoxAscent+e.actualBoundingBoxDescent),n.ascent=Math.floor(e.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}var mH=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let tp=class{configure(i,t){this.canvas=i.canvas,this.context=i.context,i.bindTextMeasure(this)}measureTextWidth(i,t){return this.context?(this.context.setTextStyleWithoutAlignBaseline(t),this.context.measureText(i).width):this.estimate(i,t).width}estimate(i,{fontSize:t=ny.fontSize}){let e=0,n=0;for(let o=0;o<i.length;o++)i.charCodeAt(o)<128?e++:n++;return{width:~~(.8*e*t+n*t),height:t}}measureTextPixelHeight(i,t){var e;if(!this.context)return(e=t.fontSize)!==null&&e!==void 0?e:Rn.fontSize;this.context.setTextStyleWithoutAlignBaseline(t);const n=this.context.measureText(i);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}measureTextBoundHieght(i,t){var e;if(!this.context)return(e=t.fontSize)!==null&&e!==void 0?e:Rn.fontSize;this.context.setTextStyleWithoutAlignBaseline(t);const n=this.context.measureText(i);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}measureText(i,t){return this.context?(this.context.setTextStyleWithoutAlignBaseline(t),this.context.measureText(i)):this.estimate(i,t)}clipTextVertical(i,t,e,n){if(i.length===0)return{verticalList:i,width:0};const{fontSize:o=12}=t;i.forEach(a=>{a.width=a.direction===0?o:this.measureTextWidth(a.text,t)});const r=[];let s=0,l=0;for(;l<i.length&&s+i[l].width<e;l++)s+=i[l].width,r.push(i[l]);if(i[l]&&i[l].text.length>1){const a=this._clipText(i[l].text,t,e-s,0,i[l].text.length-1,"end",!1);if(n&&a.str!==i[l].text){let h="",d=0;for(let g=0;g<l;g++){const f=i[g];h+=f.text,d+=f.text.length}h+=i[l].text;const u=d+a.str.length;let c=pd(h,u);c-=d,c!==a.str.length-1&&(a.str=a.str.substring(0,c),a.width=this.measureTextWidth(a.str,t))}r.push(Object.assign(Object.assign({},i[l]),{text:a.str,width:a.width})),s+=a.width}return{verticalList:r,width:s}}clipText(i,t,e,n,o){if(i.length===0)return{str:"",width:0};let r=this.measureTextWidth(i,t);if(r<=e)return{str:i,width:r};if(r=this.measureTextWidth(i[0],t),r>e)return{str:"",width:0};const s=this._clipText(i,t,e,0,i.length-1,"end",!1);if(n&&s.str!==i){let l=pd(i,s.str.length,o);l!==s.str.length&&(l>s.str.length&&(s.wordBreaked=l,l=s.str.length),s.str=i.substring(0,l),s.width=this.measureTextWidth(s.str,t))}return s}_clipText(i,t,e,n,o,r,s){let l;if(r==="start")l=this._clipTextStart(i,t,e,n,o),s&&(l.result=s+l.str);else if(r==="middle"){const a=this._clipTextMiddle(i,t,e,"","",0,0,1);l={str:"none",width:a.width,result:a.left+s+a.right}}else l=this._clipTextEnd(i,t,e,n,o),s&&(l.result=l.str+s);return l}_clipTextEnd(i,t,e,n,o){if(n===o){Me.getInstance().warn(`【_clipTextEnd】不应该走到这里${i}, ${n}, ${o}`);const h=i.substring(0,o+1);return{str:h,width:this.measureTextWidth(h,t)}}const r=Math.floor((n+o)/2),s=i.substring(0,r+1),l=this.measureTextWidth(s,t);let a;if(l>e){if(s.length<=1)return{str:"",width:0};const h=i.substring(0,r);return a=this.measureTextWidth(h,t),a<=e?{str:h,width:a}:this._clipTextEnd(i,t,e,n,r)}if(l<e){if(r>=i.length-1)return{str:i,width:this.measureTextWidth(i,t)};const h=i.substring(0,r+2);return a=this.measureTextWidth(h,t),a>=e?{str:s,width:l}:this._clipTextEnd(i,t,e,r,o)}return{str:s,width:l}}_clipTextStart(i,t,e,n,o){const r=Math.ceil((n+o)/2),s=i.substring(r-1,i.length),l=this.measureTextWidth(s,t);let a;if(l>e){if(s.length<=1)return{str:"",width:0};const h=i.substring(r,i.length);return a=this.measureTextWidth(h,t),a<=e?{str:h,width:a}:this._clipTextStart(i,t,e,r,i.length)}if(l<e){if(r<=0)return{str:i,width:this.measureTextWidth(i,t)};const h=i.substring(r-2,i.length);return a=this.measureTextWidth(h,t),a>=e?{str:s,width:l}:this._clipTextStart(i,t,e,n,r)}return{str:s,width:l}}_clipTextMiddle(i,t,e,n,o,r,s,l){const a=i.substring(0,l),h=this.measureTextWidth(a,t);if(h+s>e)return{left:n,right:o,width:r+s};const d=i.substring(i.length-l,i.length),u=this.measureTextWidth(d,t);return h+u>e?{left:a,right:o,width:h+s}:this._clipTextMiddle(i,t,e,a,d,h,u,l+1)}clipTextWithSuffixVertical(i,t,e,n,o,r){if(n==="")return this.clipTextVertical(i,t,e,o);if(i.length===0)return{verticalList:i,width:0};const s=this.clipTextVertical(i,t,e,o);if(s.verticalList.length===i.length&&s.verticalList[s.verticalList.length-1].width===i[i.length-1].width)return s;const l=this.measureTextWidth(n,t);if(l>e)return s;let a;if(e-=l,r==="start"){const h=this.revertVerticalList(i);a=this.clipTextVertical(h,t,e,o);const d=this.revertVerticalList(a.verticalList);d.unshift({text:n,direction:1,width:l}),a.verticalList=d}else if(r==="middle"){const h=this.clipTextVertical(i,t,e/2,o),d=this.revertVerticalList(i),u=this.clipTextVertical(d,t,e/2,o);h.verticalList.push({text:n,direction:1,width:l}),this.revertVerticalList(u.verticalList).forEach(c=>h.verticalList.push(c)),a={verticalList:h.verticalList,width:h.width+u.width}}else a=this.clipTextVertical(i,t,e,o),a.verticalList.push({text:n,direction:1,width:l});return a.width+=l,a}revertVerticalList(i){return i.reverse().map(t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})})}clipTextWithSuffix(i,t,e,n,o,r,s=!1){if(n==="")return this.clipText(i,t,e,o);if(i.length===0)return{str:"",width:0};const l=this.measureTextWidth(i,t);if(!s&&l<=e)return{str:i,width:l};const a=this.measureTextWidth(n,t);if(a>e)return{str:"",width:0};if(s&&l+a<=e)return{str:i+n,width:l+a};e-=a;const h=this._clipText(i,t,e,0,i.length-1,r,n);if(o&&h.str!==i){const d=pd(i,h.str.length);d!==h.str.length&&(h.result=i.substring(0,d),h.width=this.measureTextWidth(h.str,t))}else s&&h.str===i&&(h.result=i+n);return h.str=h.result,h.width+=a,h}};tp=mH([wt()],tp);var vH=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};const ko=Symbol.for("TextMeasureContribution");let js=class extends tp{};js=vH([wt()],js);const Wt=new BP,ly=Symbol.for("CanvasFactory"),bH=Symbol.for("Context2dFactory");function ep(i){return Wt.getNamed(ly,tt.global.env)(i)}class CH{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const n=ep(Object.assign({nativeCanvas:tt.global.createCanvas(t)},t));return this.allocatedCanvas.push(n),n}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const n={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},o=ep(Object.assign({nativeCanvas:tt.global.createCanvas(n)},n));return this.allocatedCanvas.push(o),o}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const $s=new CH;var yH=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},_H=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)};const oa=Symbol.for("VWindow"),ip=Symbol.for("WindowHandlerContribution");let np=class{get width(){if(this._handler){const i=this._handler.getWH();return this._width=i.width}return this._width}get height(){if(this._handler){const i=this._handler.getWH();return this._height=i.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new qi(["x","y","width","height"])},this.active=()=>{const i=this.global;!i.env||this.actived||(Wt.getNamed(ip,i.env).configure(this,i),this.actived=!0)},this._uid=ti.GenAutoIncrementId(),this.global=tt.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var i;return(i=this._handler.getStyle())!==null&&i!==void 0?i:{}}set style(i){this._handler.setStyle(i)}create(i){var t,e;this._handler.createWindow(i);const n=this._handler.getWH();this._width=n.width,this._height=n.height,i.viewBox?this.setViewBox(i.viewBox):i.canvasControled!==!1?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:(t=i.width)!==null&&t!==void 0?t:this._width,y2:(e=i.height)!==null&&e!==void 0?e:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(i){this._handler=i}setDpr(i){return this._handler.setDpr(i)}resize(i,t){return this._handler.resizeWindow(i,t)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(i){return this._handler.getImageBuffer?this._handler.getImageBuffer(i):null}addEventListener(i,t,e){return this._handler.addEventListener(i,t,e)}removeEventListener(i,t,e){return this._handler.removeEventListener(i,t,e)}dispatchEvent(i){return this._handler.dispatchEvent(i)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(i){this._handler.clearViewBox(i)}setViewBox(i){this._handler.setViewBox(i)}setViewBoxTransform(i,t,e,n,o,r){this._handler.setViewBoxTransform(i,t,e,n,o,r)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(i,t){const e=this._handler.getViewBox(),n={x:i,y:t};return this._handler.getViewBoxTransform().transformPoint({x:i,y:t},n),n.x-=e.x1,n.y-=e.y1,n}hasSubView(){const i=this._handler.getViewBox();return!(i.x1===0&&i.y1===0&&Un(this.width,i.width())&&Un(this.height,i.height()))}isVisible(i){return this._handler.isVisible(i)}onVisibleChange(i){return this._handler.onVisibleChange(i)}getTopLeft(i){return this._handler.getTopLeft(i)}};np=yH([wt(),_H("design:paramtypes",[])],np);var ay=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},hy=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},dy=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let op=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(i){this.contributions=i,this.configured=!1,this.global=tt.global,this.global.hooks.onSetEnv.tap("graphic-util",(t,e,n)=>{this.configured=!1,this.configure(n,e)})}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(i,t){this.configured||(this.contributions.getContributions().forEach(e=>{e.configure(this,t)}),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const i=$s.shareCanvas();this._canvas=i,this._context=i.getContext("2d")}}bindTextMeasure(i){this._textMeasure=i}measureText(i,t,e="native"){var n;this.configure(this.global,this.global.env);const o=this.global.measureTextMethod;this.global.measureTextMethod=e;const r={width:this._textMeasure.measureTextWidth(i,t),height:(n=t.fontSize)!==null&&n!==void 0?n:Rn.fontSize};return this.global.measureTextMethod=o,r}createTextMeasureInstance(i,t,e){return this.configure(this.global,this.global.env),new fi(Object.assign({defaultFontParams:{fontFamily:Rn.fontFamily,fontSize:Rn.fontSize},getCanvasForMeasure:e||(()=>this.canvas),getTextBounds:void 0,specialCharSet:`-/: .,@%'"~`+fi.ALPHABET_CHAR_SET+fi.ALPHABET_CHAR_SET.toUpperCase()},t??{}),i)}drawGraphicToCanvas(i,t,e){if(!t.defaultLayer)return null;const n=Wt.get(oa),o=i.AABBBounds,r=o.width(),s=o.height(),l=-o.x1,a=-o.y1;n.create({viewBox:{x1:l,y1:a,x2:o.x2,y2:o.y2},width:r,height:s,canvas:e,dpr:t.window.dpr,canvasControled:!0,offscreen:!0,title:""});const h=t.params.optimize.disableCheckGraphicWidthOutRange;t.params.optimize.disableCheckGraphicWidthOutRange=!0,t.defaultLayer.getNativeHandler().drawTo(n,[i],{transMatrix:n.getViewBoxTransform(),viewBox:n.getViewBox(),stage:t,layer:t.defaultLayer,renderService:t.renderService,background:"transparent",clear:!0,updateBounds:!1}),t.params.optimize.disableCheckGraphicWidthOutRange=h;const d=n.getNativeHandler();return d.nativeCanvas?d.nativeCanvas:null}};op=ay([wt(),dy(0,re(ei)),dy(0,ui(ko)),hy("design:paramtypes",[Object])],op);var dr;(function(i){i[i.transform=0]="transform",i[i.matrix=1]="matrix"})(dr||(dr={}));const oi=new ni;let rp=class{constructor(){this.matrix=new ni}init(i){return this.mode=dr.transform,this.originTransform=i,this.matrix.reset(),this}fromMatrix(i,t){return this.mode=dr.matrix,this.outSourceMatrix=i,this.outTargetMatrix=t,this}scaleMatrix(i,t,e){const n=this.outSourceMatrix;if(oi.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),e){const{x:o,y:r}=e;this.outTargetMatrix.translate(o,r),this.outTargetMatrix.scale(i,t),this.outTargetMatrix.translate(-o,-r)}else this.outTargetMatrix.scale(i,t);return this.outTargetMatrix.multiply(oi.a,oi.b,oi.c,oi.d,oi.e,oi.f),this}rotateMatrix(i,t){const e=this.outSourceMatrix;if(oi.setValue(e.a,e.b,e.c,e.d,e.e,e.f),this.outTargetMatrix.reset(),t){const{x:n,y:o}=t;this.outTargetMatrix.translate(n,o),this.outTargetMatrix.rotate(i),this.outTargetMatrix.translate(-n,-o)}else this.outTargetMatrix.rotate(i);return this.outTargetMatrix.multiply(oi.a,oi.b,oi.c,oi.d,oi.e,oi.f),this}scale(i,t,e){return this.mode===dr.matrix?this.scaleMatrix(i,t,e):this}rotate(i,t){return this.mode===dr.matrix?this.rotateMatrix(i,t):this}translateMatrix(i,t){const e=this.outSourceMatrix;return oi.setValue(e.a,e.b,e.c,e.d,e.e,e.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(i,t),this.outTargetMatrix.multiply(oi.a,oi.b,oi.c,oi.d,oi.e,oi.f),this}translate(i,t){return this.mode===dr.matrix?this.translateMatrix(i,t):this}simplify(i){return this.mode===dr.matrix?this.simplifyMatrix(i):this}simplifyMatrix(i){return this}};rp=ay([wt(),hy("design:paramtypes",[])],rp);const Gi={arc:tH,area:eH,circle:iH,line:rH,path:sH,symbol:hH,text:ny,rect:aH,polygon:lH,richtext:Eo,richtextIcon:dH,image:na,group:nH,glyph:oH},sp=Object.keys(Gi);function wH(){return{arc:Object.assign({},Gi.arc),area:Object.assign({},Gi.area),circle:Object.assign({},Gi.circle),line:Object.assign({},Gi.line),path:Object.assign({},Gi.path),symbol:Object.assign({},Gi.symbol),text:Object.assign({},Gi.text),rect:Object.assign({},Gi.rect),polygon:Object.assign({},Gi.polygon),richtext:Object.assign({},Gi.richtext),richtextIcon:Object.assign({},Gi.richtextIcon),image:Object.assign({},Gi.image),group:Object.assign({},Gi.group),glyph:Object.assign({},Gi.glyph)}}function md(i,t){Object.keys(t).forEach(e=>{i[e]=t[e]})}const uy=wH();class ra{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},sp.forEach(t=>{this._defaultTheme[t]=Object.create(uy[t])}),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const n=this.getParentWithTheme(t);return n&&(e=n.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,n=!1){if(this.dirty){const o=this.getParentWithTheme(t);if(o){const r=o.theme;(r.dirty||n)&&r.applyTheme(o,e,!0)}this.userTheme?this.doCombine(o&&o.theme.combinedTheme):(o?this.combinedTheme=o.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,Me.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,n=this.combinedTheme;sp.forEach(o=>{const r=Object.create(uy[o]);t&&t[o]&&md(r,t[o]),n[o]&&md(r,n[o]),e[o]&&md(r,e[o]),this.combinedTheme[o]=r}),e.common&&sp.forEach(o=>{md(this.combinedTheme[o],e.common)}),this.dirty=!1}setTheme(t,e){let n=this.userTheme;n?Object.keys(t).forEach(o=>{n[o]?Object.assign(n[o],t[o]):n[o]=Object.assign({},t[o])}):n=t,this.userTheme=n,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren(e=>{e.isContainer&&(e.theme&&(e.theme.dirty=!0),this.dirtyChildren(e))})}}const cy=new ra;function Ut(i,t){return i.glyphHost?Ut(i.glyphHost):t?(i.isContainer,t):SH(i)||i.attachedThemeGraphic&&Ut(i.attachedThemeGraphic)||cy.getTheme()}function SH(i){let t;if(t=i.isContainer?i:i.parent,t){for(;t&&!t.theme;)t=t.parent;return t?(t.theme||t.createTheme(),t.theme.getTheme(t)):cy.getTheme()}return null}var xH=globalThis&&globalThis.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(h){try{a(n.next(h))}catch(d){r(d)}}function l(h){try{a(n.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((n=n.apply(i,t||[])).next())})};class AH extends Nr{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=ti.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let n=this._lastChild,o=0;for(;n;){if(t(n,o++))return;n=n._prev}}else{let n=this._firstChild,o=0;for(;n;){if(t(n,o++))return;n=n._next}}}forEachChildrenAsync(t,e=!1){return xH(this,void 0,void 0,function*(){if(e){let n=this._lastChild,o=0;for(;n;){let r=t(n,o++);if(r.then&&(r=yield r),r)return;n=n._prev}}else{let n=this._firstChild,o=0;for(;n;){let r=t(n,o++);if(r.then&&(r=yield r),r)return;n=n._next}}})}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&Me.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,e===0)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let n=this._firstChild;for(let o=0;o<e;o++){if(!n)return null;o>0&&(n=n._next)}if(!n)return null;t._next=n._next,t._prev=n,n._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const r=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,r)}let n;this._nodeList[e]=t;for(let r=e-1;r>=0&&(n=this._nodeList[r],!n);r--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;const o=this.insertInto(t,0);return this._ignoreWarn=!1,o}removeChild(t){if(!this._idMap||!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex(n=>n===t);e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const n=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=n}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let n=null;return this.forEachChildren((o,r)=>!(o===this||!t(o,r))&&(n=o,!0)),e&&this.forEachChildren(o=>{if(o.isContainer){const r=o.find(t,!0);if(r)return n=r,!0}return!1}),n}findAll(t,e=!1){let n=[];return this.forEachChildren((o,r)=>{o!==this&&t(o,r)&&n.push(o)}),e&&this.forEachChildren(o=>{if(o.isContainer){const r=o.findAll(t,!0);r.length&&(n=n.concat(r))}}),n}getElementById(t){return this.find(e=>e.id===t,!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll(e=>e.name===t,!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll(e=>e.type===t,!0)}getChildByName(t,e=!1){return this.find(n=>n.name===t,e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let n=0;n<t;n++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;t!=null&&t.parent;)t=t.parent;return t||this}hasChildNodes(){return this._firstChild!==null}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(e!==null);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let n=this._firstChild;for(;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._next}setCount(t){this._count+=t;let e=this.parent;if(e)do e._count+=t,e=e.parent;while(e!==null)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,n){const o=ci(n,!0)&&n||ue(n)&&n.capture,r=ue(n)&&n.once,s=he(e)?void 0:e;return t=o?`${t}capture`:t,e=he(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,n){return this.addEventListener(t,e,n)}removeEventListener(t,e,n){const o=ci(n,!0)&&n||ue(n)&&n.capture,r=he(e)?void 0:e;t=o?`${t}capture`:t,e=he(e)?e:e.handleEvent;const s=ue(n)&&n.once;return super.off(t,e,r,s),this}off(t,e,n){return this.removeEventListener(t,e,n)}once(t,e,n){return ue(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class sa{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=sa.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const n=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(n),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch{this.nativeEvent.preventDefault&&he(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch{this.nativeEvent.stopPropagation&&he(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class vd extends sa{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,n,o,r,s,l,a,h,d,u,c,g,f,p){throw new Error("Method not implemented.")}}class dn extends vd{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,n;const o=new dn(this.manager);o.eventPhase=o.NONE,o.currentTarget=null,o.path=[],o.detailPath=[],o.target=null,o.nativeEvent=this.nativeEvent,o.originalEvent=this.originalEvent,(t=this.manager)===null||t===void 0||t.copyPointerData(this,o),(e=this.manager)===null||e===void 0||e.copyMouseData(this,o),(n=this.manager)===null||n===void 0||n.copyData(this,o),o.target=this.target,o.path=this.composedPath().slice();const r=this.composedDetailPath();return o.detailPath=r&&r.slice(),o.type=this.type,o}}class ur extends vd{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,n;const o=new ur(this.manager);o.eventPhase=o.NONE,o.currentTarget=null,o.path=[],o.detailPath=[],o.target=null,o.nativeEvent=this.nativeEvent,o.originalEvent=this.originalEvent,(t=this.manager)===null||t===void 0||t.copyWheelData(this,o),(e=this.manager)===null||e===void 0||e.copyMouseData(this,o),(n=this.manager)===null||n===void 0||n.copyData(this,o),o.target=this.target,o.path=this.composedPath().slice();const r=this.composedDetailPath();return o.detailPath=r&&r.slice(),o.type=this.type,o}}ur.DOM_DELTA_PIXEL=0,ur.DOM_DELTA_LINE=1,ur.DOM_DELTA_PAGE=2;class lp extends sa{constructor(t,e){super(),this.type=t,this.detail=e}}const gy="*",Ur=typeof performance=="object"&&performance.now?performance:Date;function cr(i){return i==="mouse"||i==="pen"}let RH=class{constructor(t,e){this.dispatch=new Nr,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(n,o)=>{if(!(n instanceof dn))return void Me.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(n,n.type,o);if(this.dispatchEvent(r,"pointerdown"),r.pointerType==="touch")this.dispatchEvent(r,"touchstart");else if(cr(r.pointerType)){const s=r.button===2;this.dispatchEvent(r,s?"rightdown":"mousedown")}this.trackingData(n.pointerId).pressTargetsByButton[n.button]=r.composedPath(),this.freeEvent(r)},this.onPointerMove=(n,o)=>{var r,s;if(!(n instanceof dn))return void Me.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const l=this.createPointerEvent(n,n.type,o),a=cr(l.pointerType),h=this.trackingData(n.pointerId),d=this.findMountedTarget(h.overTargets);if(h.overTargets&&d&&d!==this.rootTarget&&d!==l.target){const u=n.type==="mousemove"?"mouseout":"pointerout",c=this.createPointerEvent(n,u,d||void 0);if(this.dispatchEvent(c,"pointerout"),a&&this.dispatchEvent(c,"mouseout"),!l.composedPath().includes(d)){const g=this.createPointerEvent(n,"pointerleave",d||void 0);for(g.eventPhase=g.AT_TARGET;g.target&&!l.composedPath().includes(g.target);)g.currentTarget=g.target,this.notifyTarget(g),a&&this.notifyTarget(g,"mouseleave"),g.target=g.target.parent;this.freeEvent(g)}this.freeEvent(c)}if(d!==l.target){const u=n.type==="mousemove"?"mouseover":"pointerover",c=this.clonePointerEvent(l,u);this.dispatchEvent(c,"pointerover"),a&&this.dispatchEvent(c,"mouseover");let g=d==null?void 0:d.parent;for(;g&&g!==this.rootTarget.parent&&g!==l.target;)g=g.parent;if(!g||g===this.rootTarget.parent){const f=this.clonePointerEvent(l,"pointerenter");f.eventPhase=f.AT_TARGET;let p=f.target;const m=new Set;let v=d;for(;v&&v!==this.rootTarget;)m.add(v),v=v.parent;for(;p&&p!==d&&p!==this.rootTarget.parent;)m.has(p)||(f.currentTarget=p,this.notifyTarget(f),a&&this.notifyTarget(f,"mouseenter")),p=p.parent;this.freeEvent(f)}this.freeEvent(c)}this.dispatchEvent(l,"pointermove"),l.pointerType==="touch"&&this.dispatchEvent(l,"touchmove"),a&&(this.dispatchEvent(l,"mousemove"),this.cursorTarget=l.target,this.cursor=((s=(r=l.target)===null||r===void 0?void 0:r.attribute)===null||s===void 0?void 0:s.cursor)||this.rootTarget.getCursor()),h.overTargets=l.composedPath(),this.freeEvent(l)},this.onPointerOver=(n,o)=>{var r,s;if(!(n instanceof dn))return void Me.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const l=this.trackingData(n.pointerId),a=this.createPointerEvent(n,n.type,o),h=cr(a.pointerType);this.dispatchEvent(a,"pointerover"),h&&this.dispatchEvent(a,"mouseover"),a.pointerType==="mouse"&&(this.cursorTarget=a.target,this.cursor=((s=(r=a.target)===null||r===void 0?void 0:r.attribute)===null||s===void 0?void 0:s.cursor)||this.rootTarget.getCursor());const d=this.clonePointerEvent(a,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),h&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;l.overTargets=a.composedPath(),this.freeEvent(a),this.freeEvent(d)},this.onPointerOut=(n,o)=>{if(!(n instanceof dn))return void Me.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(n.pointerId);if(r.overTargets){const s=cr(n.pointerType),l=this.findMountedTarget(r.overTargets),a=this.createPointerEvent(n,"pointerout",l||void 0);this.dispatchEvent(a),s&&this.dispatchEvent(a,"mouseout");const h=this.createPointerEvent(n,"pointerleave",l||void 0);for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==this.rootTarget.parent;)h.currentTarget=h.target,this.notifyTarget(h),s&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;r.overTargets=[],this.freeEvent(a),this.freeEvent(h)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(n,o)=>{var r;if(!(n instanceof dn))return void Me.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const s=Ur.now(),l=this.createPointerEvent(n,n.type,o);if(this.dispatchEvent(l,"pointerup"),l.pointerType==="touch")this.dispatchEvent(l,"touchend");else if(cr(l.pointerType)){const u=l.button===2;this.dispatchEvent(l,u?"rightup":"mouseup")}const a=this.trackingData(n.pointerId),h=this.findMountedTarget(a.pressTargetsByButton[n.button]);let d=h;if(h&&!l.composedPath().includes(h)){let u=h;for(;u&&!l.composedPath().includes(u);){if(l.currentTarget=u,this.notifyTarget(l,"pointerupoutside"),l.pointerType==="touch")this.notifyTarget(l,"touchendoutside");else if(cr(l.pointerType)){const c=l.button===2;this.notifyTarget(l,c?"rightupoutside":"mouseupoutside")}u=u.parent}delete a.pressTargetsByButton[n.button],d=u}if(d){const u=this.clonePointerEvent(l,"click");u.target=d,u.path=[],u.detailPath=[],a.clicksByButton[n.button]||(a.clicksByButton[n.button]={clickCount:0,target:u.target,timeStamp:s});const c=a.clicksByButton[n.button];c.target===u.target&&s-c.timeStamp<((r=this._config.clickInterval)!==null&&r!==void 0?r:200)?++c.clickCount:c.clickCount=1,c.target=u.target,c.timeStamp=s,u.detail=c.clickCount,cr(u.pointerType)?(this.dispatchEvent(u,"click"),c.clickCount===2&&this.dispatchEvent(u,"dblclick")):u.pointerType==="touch"&&this._config.supportsTouchEvents&&(this.dispatchEvent(u,"tap"),c.clickCount===2&&this.dispatchEvent(u,"dbltap")),this.dispatchEvent(u,"pointertap"),this.freeEvent(u)}this.freeEvent(l)},this.onPointerUpOutside=(n,o)=>{if(!(n instanceof dn))return void Me.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(n.pointerId),s=this.findMountedTarget(r.pressTargetsByButton[n.button]),l=this.createPointerEvent(n,n.type,o);if(s){let a=s;for(;a;)l.currentTarget=a,this.notifyTarget(l,"pointerupoutside"),l.pointerType==="touch"?this.notifyTarget(l,"touchendoutside"):cr(l.pointerType)&&this.notifyTarget(l,l.button===2?"rightupoutside":"mouseupoutside"),a=a.parent;delete r.pressTargetsByButton[n.button]}this.freeEvent(l)},this.onWheel=(n,o)=>{if(!(n instanceof ur))return void Me.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const r=this.createWheelEvent(n,o);this.dispatchEvent(r),this.freeEvent(r)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((n,o)=>n.priority-o.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,n,o,r,s,l,a;if(!this.rootTarget)return;const h=this.mappingTable[t.type];let d;const u=`${t.canvasX}-${t.canvasY}`;if(!((e=this._prePointTargetCache)===null||e===void 0)&&e[u]&&(!((o=(n=this._prePointTargetCache)===null||n===void 0?void 0:n[u])===null||o===void 0)&&o.stage)&&((s=(r=this._prePointTargetCache)===null||r===void 0?void 0:r[u])===null||s===void 0?void 0:s.stage.renderCount)===((l=this._prePointTargetCache)===null||l===void 0?void 0:l.stageRenderCount)?d=this._prePointTargetCache[u]:(d=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[u]:d,stageRenderCount:(a=d==null?void 0:d.stage.renderCount)!==null&&a!==void 0?a:-1})),h)for(let c=0,g=h.length;c<g;c++)h[c].fn(t,d);else Me.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let o=0,r=n.length-1;o<r;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let o=n.length-2;o>=0;o--)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let n=0;n<2048&&t!==this.rootTarget&&t.parent;n++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=e??t.type;const n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let n=1;n<t.length&&t[n].parent===e;n++)e=t[n];return e}createPointerEvent(t,e,n){var o,r;const s=this.allocateEvent(dn);return this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.nativeEvent=t.nativeEvent,s.originalEvent=t,s.target=n||this.pickTarget((o=s.viewX)!==null&&o!==void 0?o:s.global.x,(r=s.viewY)!==null&&r!==void 0?r:s.global.y,s),typeof e=="string"&&(s.type=e),s}createWheelEvent(t,e){var n,o;const r=this.allocateEvent(ur);return this.copyWheelData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=e||this.pickTarget((n=r.viewX)!==null&&n!==void 0?n:r.global.x,(o=r.viewY)!==null&&o!==void 0?o:r.global.y,r),r}clonePointerEvent(t,e){const n=this.allocateEvent(dn);n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice();const o=t.composedDetailPath();return n.detailPath=o&&o.slice(),n.type=e??n.type,n}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof dn&&e instanceof dn&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof vd&&e instanceof vd&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach(n=>{e[n].x=t[n].x,e[n].y=t[n].y}))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Ur.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const n=((e=this.eventPool.get(t))===null||e===void 0?void 0:e.pop())||new t(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.detailPath=[],n.target=null,n}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const n=t.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),(e=this.eventPool.get(n))===null||e===void 0||e.push(t)}notifyListeners(t,e){const n=t.currentTarget._events[e];if(n)if("fn"in n)n.once&&t.currentTarget.removeEventListener(e,n.fn,{once:!0}),n.fn.call(n.context,t);else for(let o=0,r=n.length;o<r&&!t.propagationImmediatelyStopped;o++)n[o].once&&t.currentTarget.removeEventListener(e,n[o].fn,{once:!0}),n[o].fn.call(n[o].context,t);this.emitDelegation(t,e)}emitDelegation(t,e){const n=t.currentTarget._events[gy];if(n)if("fn"in n)n.fn.call(n.context,t,e);else for(let o=0,r=n.length;o<r&&!t.propagationImmediatelyStopped;o++)n[o].fn.call(n[o].context,t,e)}pickTarget(t,e,n){let o;const r=this.rootTarget.pick(t,e);return o=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,n&&(n.pickParams=r.params),o}release(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}};const TH={dispatchEvent(i){var t;if(!(i instanceof sa))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return i.defaultPrevented=!1,i.path=[],i.detailPath&&(i.detailPath=[]),i.target=this,(t=i==null?void 0:i.manager)===null||t===void 0||t.dispatchEvent(i),!i.defaultPrevented},emit(i,t){return this.dispatchEvent(new lp(i,t))}},MH={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class BH{constructor(t){this.resolution=1,this.onPointerDown=d=>{if(this.supportsTouchEvents&&d.pointerType==="touch")return;const u=this.normalizeToPointerData(d);this.autoPreventDefault&&u[0].isNormalized&&(d.cancelable||!("cancelable"in d))&&d.preventDefault();for(let c=0,g=u.length;c<g;c++){const f=u[c],p=this.bootstrapEvent(this.rootPointerEvent,f);this.manager.mapEvent(p)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerMove=d=>{if(this.supportsTouchEvents&&d.pointerType==="touch"||this.isEventOutsideOfTargetElement(d))return;const u=this.normalizeToPointerData(d);for(let c=0,g=u.length;c<g;c++){const f=this.bootstrapEvent(this.rootPointerEvent,u[c]);this.manager.mapEvent(f)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerUp=d=>{if(this.supportsTouchEvents&&d.pointerType==="touch")return;const u=this.isEventOutsideOfTargetViewPort(d)?"outside":"",c=this.normalizeToPointerData(d);for(let g=0,f=c.length;g<f;g++){const p=this.bootstrapEvent(this.rootPointerEvent,c[g]);p.type+=u,this.manager.mapEvent(p)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerOverOut=d=>{if(this.supportsTouchEvents&&d.pointerType==="touch")return;const u=this.normalizeToPointerData(d);for(let c=0,g=u.length;c<g;c++){const f=this.bootstrapEvent(this.rootPointerEvent,u[c]);this.manager.mapEvent(f)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onWheel=d=>{const u=this.normalizeWheelEvent(d);this.manager.mapEvent(u)};const{targetElement:e,resolution:n,rootNode:o,global:r,autoPreventDefault:s=!1,clickInterval:l,supportsTouchEvents:a=r.supportsTouchEvents,supportsPointerEvents:h=r.supportsPointerEvents}=t;this.manager=new RH(o,{clickInterval:l,supportsTouchEvents:a}),this.globalObj=r,this.supportsPointerEvents=h,this.supportsTouchEvents=a,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=s,this.eventsAdded=!1,this.rootPointerEvent=new dn,this.rootWheelEvent=new ur,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=n,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:n,domElement:o}=this;if(this.currentCursor===t)return;this.currentCursor=t;const r=this.cursorStyles[t];r?typeof r=="string"&&n?o.style.cursor=r:typeof r=="function"?r(t):typeof r=="object"&&n&&Object.assign(o.style,r):n&&de(t)&&!yC(this.cursorStyles,t)&&(o.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,n;const o=(e=this.globalObj)===null||e===void 0?void 0:e.mapToCanvasPoint(t,this.domElement);if(o)return o;let r=0,s=0;if(t.changedTouches){const a=(n=t.changedTouches[0])!==null&&n!==void 0?n:{};r=a.clientX||0,s=a.clientY||0}else r=t.clientX||0,s=t.clientY||0;const l=this.domElement.getBoundingClientRect();return{x:r-l.left,y:s-l.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let n=0,o=t.changedTouches.length;n<o;n++){const r=t.changedTouches[n];je(r.button)&&(r.button=0),je(r.buttons)&&(r.buttons=1),je(r.isPrimary)&&(r.isPrimary=t.touches.length===1&&t.type==="touchstart"),je(r.width)&&(r.width=r.radiusX||1),je(r.height)&&(r.height=r.radiusY||1),je(r.tiltX)&&(r.tiltX=0),je(r.tiltY)&&(r.tiltY=0),je(r.pointerType)&&(r.pointerType="touch"),je(r.pointerId)&&(r.pointerId=r.identifier||0),je(r.pressure)&&(r.pressure=r.force||.5),je(r.twist)&&(r.twist=0),je(r.tangentialPressure)&&(r.tangentialPressure=0),je(r.layerX)&&(r.layerX=r.offsetX=r.clientX),je(r.layerY)&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(this.globalObj.supportsMouseEvents&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof PointerEvent))e.push(t);else{const n=t;je(n.isPrimary)&&(n.isPrimary=!0),je(n.width)&&(n.width=1),je(n.height)&&(n.height=1),je(n.tiltX)&&(n.tiltX=0),je(n.tiltY)&&(n.tiltY=0),je(n.pointerType)&&(n.pointerType="mouse"),je(n.pointerId)&&(n.pointerId=1),je(n.pressure)&&(n.pressure=.5),je(n.twist)&&(n.twist=0),je(n.tangentialPressure)&&(n.tangentialPressure=0),n.isNormalized=!0,e.push(n)}return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:n,y:o}=this.mapToCanvasPoint(t);e.canvas.x=n,e.canvas.y=o,e.global.x=n,e.global.y=o,e.offset.x=n,e.offset.y=o;const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:n,y:o}=this.mapToCanvasPoint(e);t.canvas.x=n,t.canvas.y=o,t.global.x=n,t.global.y=o,t.offset.x=n,t.offset.y=o;const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,t.isTrusted=e.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=MH[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Ur.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetViewPort(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){const e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),n=this.domElement.getViewBox(),o=n.width(),r=n.height();return!(e.x<o&&e.y<r&&e.x>0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}var Tn;(function(i){i[i.INITIAL=0]="INITIAL",i[i.RUNNING=1]="RUNNING",i[i.PAUSE=2]="PAUSE"})(Tn||(Tn={}));class la{static Avaliable(){return!!tt.global.getRequestAnimationFrame()}avaliable(){return la.Avaliable()}tick(t,e){tt.global.getRequestAnimationFrame()(()=>{this.released||e(this)})}release(){this.released=!0}getTime(){return Date.now()}}class bd{static Avaliable(){return!0}avaliable(){return bd.Avaliable()}tick(t,e){this.timerId=setTimeout(()=>{e(this)},t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class fy{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(e,n)=>{const{once:o=!1}=n??{};this.ifCanStop()?this.stop():(this._handlerTick(e),o||e.tick(this.interval,this.handleTick))},this._handlerTick=e=>{const n=this.tickerHandler.getTime();let o=0;this.lastFrameTime>=0&&(o=n-this.lastFrameTime),this.lastFrameTime=n,this.status===Tn.RUNNING&&(this.tickCounts++,this.timelines.forEach(r=>{r.tick(o)}))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=Tn.INITIAL,tt.global.hooks.onSetEnv.tap("default-ticker",()=>{this.initHandler()}),tt.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter(e=>e!==t)}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:la},{mode:"timeout",cons:bd}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new la;break;case"timeout":t=new bd;break;default:Me.getInstance().warn("非法的计时器模式"),t=new la}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,e=>{this.handleTick(e,{once:!0})})}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,e=>{this.handleTick(e,{once:!0})})}pause(){return this.status!==Tn.INITIAL&&(this.status=Tn.PAUSE,!0)}resume(){return this.status!==Tn.INITIAL&&(this.status=Tn.RUNNING,!0)}ifCanStop(){return!!(this.autoStop&&(!this.timelines.length||this.timelines.reduce((t,e)=>t+e.animateCount,0)===0))}start(t=!1){return this.status===Tn.RUNNING||!this.tickerHandler||!t&&(this.status===Tn.PAUSE||!this.timelines.length||this.timelines.reduce((e,n)=>e+n.animateCount,0)===0)?!1:(this.status=Tn.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0)}stop(){this.status=Tn.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class ie{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return t===0?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return t===0?0:Math.pow(2,10*t-10)}static expoOut(t){return t===1?1:1-Math.pow(2,-10*t)}static expoInOut(t){return t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-ie.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*ie.bounceIn(2*t):.5*ie.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(n===0||n===1)return n;const o=e/ce*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-o)*ce/e)}}static getElasticOut(t,e){return function(n){if(n===0||n===1)return n;const o=e/ce*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-o)*ce/e)+1}}static getElasticInOut(t,e){return function(n){const o=e/ce*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-o)*ce/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-o)*ce/e)*.5+1}}}ie.quadIn=ie.getPowIn(2),ie.quadOut=ie.getPowOut(2),ie.quadInOut=ie.getPowInOut(2),ie.cubicIn=ie.getPowIn(3),ie.cubicOut=ie.getPowOut(3),ie.cubicInOut=ie.getPowInOut(3),ie.quartIn=ie.getPowIn(4),ie.quartOut=ie.getPowOut(4),ie.quartInOut=ie.getPowInOut(4),ie.quintIn=ie.getPowIn(5),ie.quintOut=ie.getPowOut(5),ie.quintInOut=ie.getPowInOut(5),ie.backIn=ie.getBackIn(1.7),ie.backOut=ie.getBackOut(1.7),ie.backInOut=ie.getBackInOut(1.7),ie.elasticIn=ie.getElasticIn(1,.3),ie.elasticOut=ie.getElasticOut(1,.3),ie.elasticInOut=ie.getElasticInOut(1,.3*1.5);class ap{constructor(){this.id=ti.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Ii.END?this.removeAnimate(e):e.status===Ii.RUNNING||e.status===Ii.INITIAL?(this.animateCount++,e.advance(t)):e.status===Ii.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t,e=!0){t._onRemove&&t._onRemove.forEach(n=>n()),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const py=new ap;class my{constructor(t,e,n,o,r){this.from=t,this.to=e,this.duration=n,this.easing=o,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},(t=this.step.prev.getLastProps())!==null&&t!==void 0?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,n){if(this.updateCount===0){this.onFirstRun();const o=this.step.getLastProps();Object.keys(o).forEach(r=>{this.subAnimate.animate.validAttr(r)&&(n[r]=o[r])})}this.updateCount+=1,this.onUpdate(t,e,n),t&&this.onEnd()}}class PH extends my{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,n){}onStart(){this.cb()}}class Lo{constructor(t=ti.GenAutoIncrementId(),e=py,n){this.id=t,this.timeline=e,this.status=Ii.INITIAL,this.tailAnimate=new vy(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=n}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce((t,e)=>t+e.totalDuration,0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach(n=>{e=ar(n.getDuration(),e)}),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Lo.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this.subAnimates.length===1&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t,e=Lo.mode){t&&e&cd.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Zi.ANIMATE_PLAY})}runCb(t){const e=new PH(()=>{t(this,e.step.prev)});return this.tailAnimate.play(e),this}customInterpolate(t,e,n,o,r,s){const l=Lo.interpolateMap.get(t)||Lo.interpolateMap.get("");return!!l&&l(t,e,n,o,r,s)}pause(){this.status===Ii.RUNNING&&(this.status=Ii.PAUSED)}resume(){this.status===Ii.PAUSED&&(this.status=Ii.RUNNING)}to(t,e,n,o){if(this.tailAnimate.to(t,e,n,o),this.target){const r=this.target.stage;r&&r.renderNextFrame()}return this}from(t,e,n,o){if(this.tailAnimate.from(t,e,n,o),this.target){const r=this.target.stage;r&&r.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}subAnimate(){const t=new vy(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach(e=>this.preventAttr(e))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.subAnimates.forEach(e=>{e.bind(t)}),this}advance(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Ii.INITIAL&&(this.status=Ii.RUNNING,this._onStart&&this._onStart.forEach(e=>e())),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Ii.RUNNING&&(this.status=Ii.END,this._onEnd&&this._onEnd.forEach(e=>e()))}setPosition(t){let e,n=0;const o=this.rawPosition,r=this.subAnimates.reduce((l,a)=>l+a.totalDuration,0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===o)return s;for(let l=0;l<this.subAnimates.length&&(e=this.subAnimates[l],!(n+e.totalDuration>=t));l++)n+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-n),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=Ii.END}stop(t){t||this.target.onStop(),t==="start"?this.target.onStop(this.getStartProps()):t==="end"?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}Lo.mode=cd.NORMAL,Lo.interpolateMap=new Map;class vy{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new by(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(e==null||e<0)&&(e=0);const n=t.easing,o=typeof n=="string"?ie[n]:n,r=this._addStep(e,null,o);return r.type=Ws.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}to(t,e,n,o){(e==null||e<0)&&(e=0);const r=typeof n=="string"?ie[n]:n,s=this._addStep(e,null,r);return s.type=Ws.to,this._appendProps(t,s,!!o&&o.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),o&&o.noPreventAttrs||this.target.animates.forEach(l=>{l.id!==this.animate.id&&l.preventAttrs(s.propKeys)}),this}from(t,e,n,o){this.to(t,0,n,o);const r={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach(s=>{r[s]=this.getLastPropByName(s,this.stepTail)}),this.to(r,e,n,o),this.stepTail.type=Ws.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return(t=this.stepHead)===null||t===void 0?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){const e=this._addStep(+t,null);e.type=Ws.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,n){const o=new by(this.duration,t,e,n);return this.duration+=t,this.stepTail.append(o),this.stepTail=o,o}_appendProps(t,e,n){e.props=n?t:Object.assign({},t);let o=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach(l=>{e.props[l]===void 0&&(e.props[l]=this.target.getDefaultAttribute(l))});o.prev;)o.props&&(o.propKeys||(o.propKeys=Object.keys(o.props)),o.propKeys.forEach(l=>{r[l]===void 0&&(r[l]=o.props[l])})),e.propKeys=Object.keys(e.props),o=o.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach(l=>{if(s[l]===void 0){const a=this.animate.getStartProps();s[l]=a[l]=this.target.getComputedAttribute(l)}}),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const n=this.duration,o=this.loop,r=this.rawPosition;let s,l,a=!1;const h=(e=this._startAt)!==null&&e!==void 0?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,n<=0&&(a=!0,n<0)||(s=Math.floor(t/n),l=t-s*n,a=t>=o*n+n,a&&(l=n,s=o,t=l*s+n),t===r))return a;const d=!this.reversed!=!(this.bounce&&s%2);return d&&(l=n-l),this._deltaPosition=l-this.position,this.position=l,this.rawPosition=t+h,this.updatePosition(a,d),a}updatePosition(t,e){if(!this.stepHead)return;let n=this.stepHead.next;const o=this.position,r=this.duration;if(this.target&&n){let s=n.next;for(;s&&s.position<=o;)n=s,s=n.next;let l=t?r===0?1:o/r:(o-n.position)/n.duration;n.easing&&(l=n.easing(l)),this.tryCallCustomAnimateLifeCycle(n,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(n,l,t),this._lastStep=n,this.animate._onFrame&&this.animate._onFrame.forEach(a=>a(n,l))}}tryCallCustomAnimateLifeCycle(t,e,n){if(t!==e)if(n){let o=e.prev;for(;o&&o!==t;)o.customAnimate&&(o.customAnimate.onStart&&o.customAnimate.onStart(),o.customAnimate.onEnd&&o.customAnimate.onEnd()),o=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let o=e.next;for(;o&&o!==t;)o.customAnimate&&(o.customAnimate.onStart&&o.customAnimate.onStart(),o.customAnimate.onEnd&&o.customAnimate.onEnd()),o=o.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let n=e.prev;for(;n;){if(n.props&&n.props[t]!==void 0)return n.props[t];if(n.customAnimate){const o=n.customAnimate.getEndProps()[t];if(o!==void 0)return o}n=n.prev}return Me.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,n){t.props==null&&t.customAnimate==null||this.target.onStep(this,this.animate,t,e,n)}}class by{constructor(t,e,n,o){this.duration=e,this.position=t,this.props=n,this.easing=o}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const Cy={duration:200,easing:"cubicOut"};var yy;(function(i){i[i.Top=1]="Top",i[i.Right=2]="Right",i[i.Bottom=4]="Bottom",i[i.Left=8]="Left",i[i.ALL=15]="ALL"})(yy||(yy={}));const Fo=[!1,!1,!1,!1],HH=i=>{var t;let e=!0;if(ci(i,!0)){for(let n=0;n<4;n++)Fo[n]=i,e&&(e=!((t=Fo[n])!==null&&t!==void 0&&!t));e=i}else if(Array.isArray(i))for(let n=0;n<4;n++)Fo[n]=!!i[n],e&&(e=!!Fo[n]);else Fo[0]=!1,Fo[1]=!1,Fo[2]=!1,Fo[3]=!1;return{isFullStroke:e,stroke:Fo}},aa=[0,0,0,0],ha=i=>i?ot(i)?i.length===0?0:i.length===1?i[0]:i.length===2?(aa[0]=i[0],aa[2]=i[0],aa[1]=i[1],aa[3]=i[1],aa):i:i:0,Gs=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Cd=[1,2,3,0,1,2,3,0];function hp(i,t,e,n){for(;i>=ce;)i-=ce;for(;i<0;)i+=ce;for(;i>t;)t+=ce;Gs[0].x=e,Gs[1].y=e,Gs[2].x=-e,Gs[3].y=-e;const o=Math.ceil(i/Sn)%4,r=Math.ceil(t/Sn)%4;if(n.add(ii(i)*e,We(i)*e),n.add(ii(t)*e,We(t)*e),o!==r||t-i>Be){let s=!1;for(let l=0;l<Cd.length;l++)if(s||o!==Cd[l]){if(s&&r===Cd[l])break;if(s){const a=Gs[Cd[l]];n.add(a.x,a.y)}}else{s=!0;const a=Gs[o];n.add(a.x,a.y)}}}function _y(i,t,e){const{x:n,y:o}=PC(i.x,i.y,t.x,t.y,e),{x:r,y:s}=PC(i.x1,i.y1,t.x1,t.y1,e),l=new Xe(n,o,r,s);return l.defined=t.defined,l}function wy(i,t,e){if(!i||!t)return[];Array.isArray(i)||(i=[i]),Array.isArray(t)||(t=[t]);let n=[];if(i.length>t.length){n=t.map(o=>{const r=new Xe(o.x,o.y,o.x1,o.y1);return r.defined=o.defined,r});for(let o=0;o<t.length;o++)n[o]=_y(i[o],t[o],e)}else{n=t.map(o=>{const r=new Xe(o.x,o.y,o.x1,o.y1);return r.defined=o.defined,r});for(let o=0;o<i.length;o++)n[o]=_y(i[o],t[o],e)}return n}function yd(i,t){if(ot(i)){let e;for(let n=0;n<i.length&&e===void 0;n++)e=i[n][t];return e}return i[t]}class _d{constructor(t=_d.TimeOut){this.durations=[],this.timeout=t,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout(()=>{this.appendDuration(Date.now()-this.lastDate),t(0)},this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce((e,n)=>e+n,0)/this.durations.length,1e3/60),1e3/30)}}_d.TimeOut=1e3/60;const Sy=new _d,Io=(i,t)=>de(i)&&i[i.length-1]==="%"?t*(Number.parseFloat(i.substring(0,i.length-1))/100):i,EH=i=>{if(!i)return{x:0,y:0,width:0,height:0};let t=Pt(i.width)?i.x1-i.x:i.width,e=Pt(i.height)?i.y1-i.y:i.height,n=0,o=0;return t<0?(n=t,t=-t):Number.isNaN(t)&&(t=0),e<0?(o=e,e=-e):Number.isNaN(e)&&(e=0),{x:n,y:o,width:t,height:e}};var Do;(function(i){i[i.Color255=0]="Color255",i[i.Color1=1]="Color1"})(Do||(Do={}));class mi{static Get(t,e=Do.Color1,n=[0,0,0,1]){if(e===Do.Color1){const s=mi.store1[t];if(s)return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n;const l=hn.parseColorString(t);if(l){const a=[l.r/255,l.g/255,l.b/255,l.opacity];mi.store1[t]=a,mi.store255[t]=[l.r,l.g,l.b,l.opacity],n[0]=a[0],n[1]=a[1],n[2]=a[2],n[3]=a[3]}return n}const o=mi.store255[t];if(o)return n[0]=o[0],n[1]=o[1],n[2]=o[2],n[3]=o[3],n;const r=hn.parseColorString(t);return r&&(mi.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],mi.store255[t]=[r.r,r.g,r.b,r.opacity],n[0]=r.r,n[1]=r.g,n[2]=r.b,n[3]=r.opacity),n}static Set(t,e,n){if(e===Do.Color1){if(mi.store1[t])return;mi.store1[t]=n,mi.store255[t]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(mi.store255[t])return;mi.store255[t]=n,mi.store1[t]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}mi.store255={},mi.store1={};function wd(i,t=!1){return Array.isArray(i)&&ut(i[0])?t?`rgb(${Math.round(i[0])},${Math.round(i[1])},${Math.round(i[2])},${i[3].toFixed(2)})`:`rgb(${Math.round(i[0])},${Math.round(i[1])},${Math.round(i[2])})`:i}function Us(i,t,e,n,o){return Array.isArray(i)&&!ut(i[0])||Array.isArray(t)&&!ut(t[0])?new Array(4).fill(0).map((r,s)=>xy(ot(i)?i[s]:i,ot(t)?t[s]:t,e,n)):xy(i,t,e,n,o)}function xy(i,t,e,n,o){if(!i||!t)return i&&wd(i)||t&&wd(t)||!1;let r,s,l=!1,a=!1;if(Array.isArray(i)?r=i:typeof i=="string"?r=mi.Get(i,Do.Color255):l=!0,Array.isArray(t)?s=t:typeof t=="string"?s=mi.Get(t,Do.Color255):a=!0,l!==a){const h=l?i:t,d=l?t:i,u=Object.assign(Object.assign({},h),{stops:h.stops.map(c=>Object.assign(Object.assign({},c),{color:wd(d)}))});return l?Us(h,u,e,n,o):Us(u,h,e,n,o)}if(l){if(i.gradient===t.gradient){const h=i,d=t,u=h.stops,c=d.stops;if(u.length!==c.length)return!1;if(h.gradient==="linear")return kH(h,d,e);if(h.gradient==="radial")return LH(h,d,e);if(h.gradient==="conical")return FH(h,d,e)}return!1}return o&&o(r,s),wd(IH(r,s,e),n)}function kH(i,t,e){const n=i.stops,o=t.stops;return{gradient:"linear",x0:i.x0+(t.x0-i.x0)*e,x1:i.x1+(t.x1-i.x1)*e,y0:i.y0+(t.y0-i.y0)*e,y1:i.y1+(t.y1-i.y1)*e,stops:new Array(n.length).fill(0).map((r,s)=>({color:dp(n[s].color,o[s].color,e),offset:n[s].offset+(o[s].offset-n[s].offset)*e}))}}function LH(i,t,e){const n=i.stops,o=t.stops;return{gradient:"radial",x0:i.x0+(t.x0-i.x0)*e,x1:i.x1+(t.x1-i.x1)*e,y0:i.y0+(t.y0-i.y0)*e,y1:i.y1+(t.y1-i.y1)*e,r0:i.r0+(t.r0-i.r0)*e,r1:i.r1+(t.r1-i.r1)*e,stops:new Array(n.length).fill(0).map((r,s)=>({color:dp(n[s].color,o[s].color,e),offset:n[s].offset+(o[s].offset-n[s].offset)*e}))}}function FH(i,t,e){const n=i.stops,o=t.stops;return{gradient:"conical",startAngle:i.startAngle+(t.startAngle-i.startAngle)*e,endAngle:i.endAngle+(t.endAngle-i.endAngle)*e,x:i.x+(t.x-i.x)*e,y:i.y+(t.y-i.y)*e,stops:new Array(n.length).fill(0).map((r,s)=>({color:dp(n[s].color,o[s].color,e),offset:n[s].offset+(o[s].offset-n[s].offset)*e}))}}function IH(i,t,e){return[i[0]+(t[0]-i[0])*e,i[1]+(t[1]-i[1])*e,i[2]+(t[2]-i[2])*e,i[3]+(t[3]-i[3])*e]}const Oo=[0,0,0,0],da=[0,0,0,0];function dp(i,t,e){return mi.Get(i,Do.Color255,Oo),mi.Get(t,Do.Color255,da),`rgba(${Math.round(Oo[0]+(da[0]-Oo[0])*e)},${Math.round(Oo[1]+(da[1]-Oo[1])*e)},${Math.round(Oo[2]+(da[2]-Oo[2])*e)},${Oo[3]+(da[3]-Oo[3])*e})`}class Ae{static GetImage(t,e){var n;const o=Ae.cache.get(t);o?o.loadState==="fail"?tt.global.getRequestAnimationFrame()(()=>{e.imageLoadFail(t)}):o.loadState==="init"||o.loadState==="loading"?(n=o.waitingMark)===null||n===void 0||n.push(e):e&&e.imageLoadSuccess(t,o.data):Ae.loadImage(t,e)}static GetSvg(t,e){var n;let o=Ae.cache.get(t);o?o.loadState==="fail"?tt.global.getRequestAnimationFrame()(()=>{e.imageLoadFail(t)}):o.loadState==="init"||o.loadState==="loading"?(n=o.waitingMark)===null||n===void 0||n.push(e):e&&e.imageLoadSuccess(t,o.data):(o={type:"image",loadState:"init"},Ae.cache.set(t,o),o.dataPromise=tt.global.loadSvg(t),o.dataPromise?(o.waitingMark=[e],o.dataPromise.then(r=>{var s;o.loadState=r!=null&&r.data?"success":"fail",o.data=r==null?void 0:r.data,(s=o.waitingMark)===null||s===void 0||s.map((l,a)=>{r!=null&&r.data?(o.loadState="success",o.data=r.data,l.imageLoadSuccess(t,r.data)):(o.loadState="fail",l.imageLoadFail(t))}),o.waitingMark&&(o.waitingMark=[])})):(o.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let n=Ae.cache.get(t);return n?n.loadState==="fail"?Promise.reject():n.loadState==="init"||n.loadState==="loading"?n.dataPromise.then(o=>o.data):Promise.resolve(n.data):(n={type:e,loadState:"init"},Ae.cache.set(t,n),e==="arrayBuffer"?n.dataPromise=tt.global.loadArrayBuffer(t):e==="blob"?n.dataPromise=tt.global.loadBlob(t):e==="json"&&(n.dataPromise=tt.global.loadJson(t)),n.dataPromise.then(o=>o.data))}static loading(){setTimeout(()=>{if(!Ae.isLoading&&Ae.toLoadAueue.length){Ae.isLoading=!0;const t=Ae.toLoadAueue.splice(0,10),e=[];t.forEach(n=>{const{url:o,marks:r}=n,s={type:"image",loadState:"init"};if(Ae.cache.set(o,s),s.dataPromise=tt.global.loadImage(o),s.dataPromise){s.waitingMark=r;const l=s.dataPromise.then(a=>{var h;s.loadState=a!=null&&a.data?"success":"fail",s.data=a==null?void 0:a.data,(h=s.waitingMark)===null||h===void 0||h.map((d,u)=>{a!=null&&a.data?(s.loadState="success",s.data=a.data,d.imageLoadSuccess(o,a.data)):(s.loadState="fail",d.imageLoadFail(o))}),s.waitingMark&&(s.waitingMark=[])});e.push(l)}else s.loadState="fail",r.forEach(l=>l.imageLoadFail(o))}),Promise.all(e).then(()=>{Ae.isLoading=!1,this.onLoadSuccessCb.forEach(n=>n()),Ae.loading()}).catch(n=>{console.error(n),Ae.isLoading=!1,this.onLoadSuccessCb.forEach(o=>o()),Ae.loading()})}},0)}static loadImage(t,e){const n=Ay(t,Ae.toLoadAueue);if(n!==-1)return Ae.toLoadAueue[n].marks.push(e),void Ae.loading();Ae.toLoadAueue.push({url:t,marks:[e]}),Ae.loading()}static improveImageLoading(t){const e=Ay(t,Ae.toLoadAueue);if(e!==-1){const n=Ae.toLoadAueue.splice(e,1);Ae.toLoadAueue.unshift(n[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Ay(i,t){for(let e=0;e<t.length;e++)if(t[e].url===i)return e;return-1}Ae.cache=new Map,Ae.isLoading=!1,Ae.toLoadAueue=[],Ae.onLoadSuccessCb=[];const DH=new ni,Ry=new Fe,Mn=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Ty=["x","y"],My=["scaleX","scaleY"],By=["angle"],ua=new Xe,Yn={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class Ji extends AH{static mixin(t){const e=Object.keys(t);for(let n=0;n<e.length;++n){const o=e[n];Object.defineProperty(Ji.prototype,o,Object.getOwnPropertyDescriptor(t,o))}}get AABBBounds(){return this.tryUpdateAABBBounds(this.attribute.boundsMode==="imprecise")}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(t={}){var e;super(),this._AABBBounds=new Fe,this._updateTag=xe.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage((e=t.background.background)!==null&&e!==void 0?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}setMode(t){t==="3d"?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var n,o;const{dx:r=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){const l=this.parent.attribute;ua.x=r+((n=l.scrollX)!==null&&n!==void 0?n:0),ua.y=s+((o=l.scrollY)!==null&&o!==void 0?o:0)}else ua.x=r,ua.y=s;return ua}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;tt.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return tt.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new d2),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const n=this.attribute,o=this.updateAABBBounds(n,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=n,s=ha(r);return s&&o.expand(s),this.clearUpdateBoundTag(),o}updatePathProxyAABBBounds(t){const e=typeof this.pathProxy=="function"?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const n=new Vf(t);return hr(e.commandList,n,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new ni),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&xe.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&tt.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&xe.UPDATE_BOUNDS)&&tt.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&xe.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&xe.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&xe.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const n=this.attribute;return Number.isFinite(((t=n.x)!==null&&t!==void 0?t:0)+((e=n.y)!==null&&e!==void 0?e:0))}_validNumber(t){return t==null||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&xe.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=xe.CLEAR_SHAPE}containsPoint(t,e,n,o){if(!o)return!1;if(n===ea.GLOBAL){const r=new Xe(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(r,r),t=r.x,e=r.y}return o.containsPoint(this,{x:t,y:e})}setAttributes(t,e=!1,n){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,n)}_setAttributes(t,e=!1,n){const o=Object.keys(t);for(let r=0;r<o.length;r++){const s=o[r];this.attribute[s]=t[s]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(o)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)}setAttribute(t,e,n,o){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,o);s?this._setAttributes(s,n,o):Pt((r=this.normalAttrs)===null||r===void 0?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o)):this.normalAttrs[t]=e,t==="background"?this.loadImage(e,!0):t==="shadowGraphic"&&this.setShadowGraphic(e)}needUpdateTags(t,e=Mn){for(let n=0;n<e.length;n++){const o=e[n];if(t.indexOf(o)!==-1)return!0}return!1}needUpdateTag(t,e=Mn){for(let n=0;n<e.length;n++)if(t===e[n])return!0;return!1}initAttributes(t){const e={type:Zi.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=xe.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var n,o;if(t===0&&e===0)return this;const r={type:Zi.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Ty,r);s&&(t=s.x,e=s.y,delete s.x,delete s.y,this._setAttributes(s));const l=this.attribute,a=l.postMatrix;return a?tt.transformUtil.fromMatrix(a,a).translate(t,e):(l.x=((n=l.x)!==null&&n!==void 0?n:pi.x)+t,l.y=((o=l.y)!==null&&o!==void 0?o:pi.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}translateTo(t,e){const n=this.attribute;if(n.x===t&&n.y===e)return this;const o={type:Zi.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Ty,o);return r?(this._setAttributes(r,!1,o),this):(n.x=t,n.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this)}scale(t,e,n){var o,r;if(t===1&&e===1)return this;const s={type:Zi.SCALE},l=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,My,s);l&&(t=l.scaleX,e=l.scaleY,delete l.scaleX,delete l.scaleY,this._setAttributes(l));const a=this.attribute;if(n){let{postMatrix:h}=this.attribute;h||(h=new ni,a.postMatrix=h),tt.transformUtil.fromMatrix(h,h).scale(t,e,n)}else a.scaleX=((o=a.scaleX)!==null&&o!==void 0?o:pi.scaleX)*t,a.scaleY=((r=a.scaleY)!==null&&r!==void 0?r:pi.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}scaleTo(t,e){const n=this.attribute;if(n.scaleX===t&&n.scaleY===e)return this;const o={type:Zi.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,My,o);return r?(this._setAttributes(r,!1,o),this):(n.scaleX=t,n.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this)}rotate(t,e){var n;if(t===0)return this;const o={type:Zi.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,By,o);r&&(delete r.angle,this._setAttributes(r,!1,o));const s=this.attribute;if(e){let{postMatrix:l}=this.attribute;l||(l=new ni,s.postMatrix=l),tt.transformUtil.fromMatrix(l,l).rotate(t,e)}else s.angle=((n=s.angle)!==null&&n!==void 0?n:pi.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const n={type:Zi.ROTATE_TO},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,By,n);return o?(this._setAttributes(o,!1,n),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new Lo(t==null?void 0:t.id,this.stage&&this.stage.getTimeline(),t==null?void 0:t.slience);if(e.bind(this),t){const{onStart:n,onFrame:o,onEnd:r,onRemove:s}=t;n!=null&&e.onStart(n),o!=null&&e.onFrame(o),r!=null&&e.onEnd(r),s!=null&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove(()=>{this.animates.delete(e.id)}),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(tt.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(this.attribute.boundsMode==="imprecise"),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(this.attribute.boundsMode==="imprecise"),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!Pt(t)||this.currentStates.includes(t))}getState(t){var e;return(e=this.states)===null||e===void 0?void 0:e[t]}applyStateAttrs(t,e,n,o){var r,s,l,a;if(n){const h=Object.keys(t),d=this.getNoWorkAnimateAttr(),u={};let c;h.forEach(f=>{d[f]?(c||(c={}),c[f]=t[f]):u[f]=o&&t[f]===void 0?this.getDefaultAttribute(f):t[f]});const g=this.animate({slience:!0});g.stateNames=e,g.to(u,(s=(r=this.stateAnimateConfig)===null||r===void 0?void 0:r.duration)!==null&&s!==void 0?s:Cy.duration,(a=(l=this.stateAnimateConfig)===null||l===void 0?void 0:l.easing)!==null&&a!==void 0?a:Cy.easing),c&&this.setAttributes(c,!1,{type:Zi.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Zi.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach(n=>{n in this.normalAttrs?(e[n]=this.normalAttrs[n],delete this.normalAttrs[n]):e[n]=this.getNormalAttribute(n)}),Object.keys(this.normalAttrs).forEach(n=>{t[n]=this.normalAttrs[n]})):Object.keys(t).forEach(n=>{e[n]=this.getNormalAttribute(n)}),this.normalAttrs=e}stopStateAnimates(t="end"){this.animates&&this.animates.forEach(e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))})}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach(n=>{if(n.stateNames){const o=n.getEndProps();yC(o,t)&&(e=o[t])}}),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const n=this.currentStates.filter(o=>o!==t);this.useStates(n,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}addState(t,e,n){var o;if(this.currentStates&&this.currentStates.includes(t)&&(e||this.currentStates.length===1))return;const r=e&&(!((o=this.currentStates)===null||o===void 0)&&o.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}useStates(t,e){var n;if(!t.length)return void this.clearStates(e);if(!(((n=this.currentStates)===null||n===void 0?void 0:n.length)!==t.length||t.some((r,s)=>this.currentStates[s]!==r)))return;const o={};t.forEach(r=>{var s;const l=this.stateProxy?this.stateProxy(r,t):(s=this.states)===null||s===void 0?void 0:s[r];l&&Object.assign(o,l)}),this.updateNormalAttrs(o),this.currentStates=t,this.applyStateAttrs(o,t,e)}addUpdateBoundTag(){this._updateTag|=xe.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=xe.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=xe.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&xe.UPDATE_SHAPE_AND_BOUNDS)===xe.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=xe.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=xe.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=xe.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=xe.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=xe.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=xe.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=xe.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&xe.UPDATE_LAYOUT)}getAnchor(t,e){const n=[0,0],o=()=>{if(e.b)return e.b;const{scaleX:r,scaleY:s,angle:l}=this.attribute;return Ry.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(Ry),this.setAttributes({scaleX:r,scaleY:s,angle:l}),e.b};if(typeof t[0]=="string"){const r=parseFloat(t[0])/100,s=o();n[0]=s.x1+(s.x2-s.x1)*r}else n[0]=t[0];if(typeof t[1]=="string"){const r=parseFloat(t[1])/100,s=o();n[1]=s.y1+(s.y2-s.y1)*r}else n[1]=t[1];return n}doUpdateLocalMatrix(){const{x:t=pi.x,y:e=pi.y,scaleX:n=pi.scaleX,scaleY:o=pi.scaleY,angle:r=pi.angle,scaleCenter:s,anchor:l,postMatrix:a}=this.attribute;let h=[0,0];const d={};if(l&&(h=this.getAnchor(l,d)),!s||n===1&&o===1)u2(this._transMatrix,this._transMatrix.reset(),t,e,n,o,r,l&&h);else{const c=this._transMatrix;c.reset(),c.translate(h[0],h[1]),c.rotate(r),c.translate(-h[0],-h[1]),c.translate(t,e),h=this.getAnchor(s,d),tt.transformUtil.fromMatrix(c,c).scale(n,o,{x:h[0],y:h[1]})}const u=this.getOffsetXY(pi);if(this._transMatrix.e+=u.x,this._transMatrix.f+=u.y,a){const c=DH.setValue(a.a,a.b,a.c,a.d,a.e,a.f),g=this._transMatrix;c.multiply(g.a,g.b,g.c,g.d,g.e,g.f),g.setValue(c.a,c.b,c.c,c.d,c.e,c.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const n=t.getTimeline();this.animates.forEach(o=>{o.setTimeline(n)})}this._onSetStage&&this._onSetStage(this,t,e),tt.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Zi.ANIMATE_END})}onStep(t,e,n,o,r){const s={};if(n.customAnimate)n.customAnimate.update(r,o,s);else{const l=n.props,a=n.parsedProps,h=n.propKeys;this.stepInterpolate(t,e,s,n,o,r,l,void 0,a,h)}this.setAttributes(s,!1,{type:Zi.ANIMATE_UPDATE,animationState:{ratio:o,end:r,step:n,isFirstFrameOfStep:t.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,n,o,r,s,l,a,h,d){d||(d=Object.keys(l),o.propKeys=d),s?o.propKeys.forEach(u=>{e.validAttr(u)&&(n[u]=l[u])}):d.forEach(u=>{var c;if(!e.validAttr(u))return;const g=l[u],f=(c=a&&a[u])!==null&&c!==void 0?c:t.getLastPropByName(u,o);if(g==null||f==null||g===f)return void(n[u]=g);let p;p=e.interpolateFunc&&e.interpolateFunc(u,r,f,g,n),p||(p=e.customInterpolate(u,r,f,g,this,n),p||this.defaultInterpolate(g,f,u,n,h,r)||this._interpolate(u,r,f,g,n))}),o.parsedProps=h}defaultInterpolate(t,e,n,o,r,s){if(Number.isFinite(t))return o[n]=e+(t-e)*s,!0;if(n==="fill"){r||(r={});const l=r.fillColorArray,a=Us(e,l??t,s,!1,(h,d)=>{r.fillColorArray=d});return a&&(o[n]=a),!0}if(n==="stroke"){r||(r={});const l=r.strokeColorArray,a=Us(e,l??t,s,!1,(h,d)=>{r.strokeColorArray=d});return a&&(o[n]=a),!0}if(n==="shadowColor"){r||(r={});const l=r.shadowColorArray,a=Us(e,l??t,s,!0,(h,d)=>{r.shadowColorArray=d});return a&&(o[n]=a),!0}return!1}_interpolate(t,e,n,o,r){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return(e=this.attribute[t])!==null&&e!==void 0?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=t??tt.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map(t=>t.toJson())}}createPathProxy(t){return de(t,!0)?this.pathProxy=new wi().fromString(t):this.pathProxy=new wi,this.pathProxy}loadImage(t,e=!1){if(!t||e&&OH(t))return;const n=t;this.resources||(this.resources=new Map);const o={data:"init",state:null};this.resources.set(n,o),typeof t=="string"?(o.state="loading",t.startsWith("<svg")?(Ae.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(DP(t)||t.includes("/")||OP(t))&&(Ae.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):ue(t)?(o.state="success",o.data=t,this.backgroundImg=this.backgroundImg||e):o.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,n){if(!this.resources)return;const o=this.resources.get(t);o&&(o.state="success",o.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach(e=>{e.stop()})}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren(e=>{e.stopAnimates(t)})}release(){this.releaseStatus="released",tt.graphicService.onRelease(this)}_emitCustomEvent(t,e){var n,o;if(this._events&&t in this._events){const r=new lp(t,e);r.bubbles=!1,r.manager=(o=(n=this.stage)===null||n===void 0?void 0:n.eventSystem)===null||o===void 0?void 0:o.manager,this.dispatchEvent(r)}}}function OH(i){return!(!i.fill&&!i.stroke)}Ji.mixin(TH);function zH(i,t){const e=[];let n=t.exec(i);for(;n;){const o=[];o.startIndex=t.lastIndex-n[0].length;const r=n.length;for(let s=0;s<r;s++)o.push(n[s]);e.push(o),n=t.exec(i)}return e}class up{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function Py(i,t,e,n){const o=i.indexOf(t,e);if(o===-1)throw new Error(n);return o+t.length-1}function WH(i,t,e=">"){let n,o="";for(let r=t;r<i.length;r++){let s=i[r];if(n)s===n&&(n="");else if(s==='"'||s==="'")n=s;else if(s===e[0]){if(!e[1])return{data:o,index:r};if(i[r+1]===e[1])return{data:o,index:r}}else s===" "&&(s=" ");o+=s}}function Hy(i,t,e,n=">"){const o=WH(i,t+1,n);if(!o)return;let r=o.data;const s=o.index,l=r.search(/\s/);let a=r,h=!0;l!==-1&&(a=r.substr(0,l).replace(/\s\s*$/,""),r=r.substr(l+1));const d=a;if(e){const u=a.indexOf(":");u!==-1&&(a=a.substr(u+1),h=a!==o.data.substr(u+1))}return{tagName:a,tagExp:r,closeIndex:s,attrExpPresent:h,rawTagName:d}}const NH=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");class VH{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,n){const o=e.tagname;typeof o=="string"&&(e.tagname=o),t.addChild(e)}buildAttributesMap(t,e,n){const o={};if(!t)return;const r=zH(t,NH),s=r.length;for(let l=0;l<s;l++){const a=r[l][1],h=r[l][4],d=a;a&&(o[d]=h===void 0||(isNaN(h)?h:Number(h)))}return o}parseXml(t){t=t.replace(/\r\n?/g,`
|
|
7
7
|
`);const e=new up("!xml");let n=e,o="",r="";for(let s=0;s<t.length;s++)if(t[s]==="<")if(t[s+1]==="/"){const l=Py(t,">",s,"Closing Tag is not closed."),a=r.lastIndexOf(".");r=r.substring(0,a),n=this.tagsNodeStack.pop(),n&&n.child&&o&&n.child[n.child.length-1][":@"]&&(n.child[n.child.length-1][":@"].text=o),o="",s=l}else if(t[s+1]==="?")s=Hy(t,s,!1,"?>").closeIndex+1;else if(t.substr(s+1,3)==="!--")s=Py(t,"-->",s+4,"Comment is not closed.");else{const l=Hy(t,s,!1);let a=l.tagName,h=l.tagExp;const d=l.attrExpPresent,u=l.closeIndex;if(a!==e.tagname&&(r+=r?"."+a:a),h.length>0&&h.lastIndexOf("/")===h.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),h=a):h=h.substr(0,h.length-1);const c=new up(a);a!==h&&d&&(c[":@"]=this.buildAttributesMap(h,r,a)),this.addChild(n,c,r),r=r.substr(0,r.lastIndexOf("."))}else{const c=new up(a);this.tagsNodeStack.push(n),a!==h&&d&&(c[":@"]=this.buildAttributesMap(h,r,a)),this.addChild(n,c,r),n=c}o="",s=u}else o+=t[s];return e.child}}function jH(i,t){return Ey(i)}function Ey(i,t){const e={};for(let n=0;n<i.length;n++){const o=i[n],r=$H(o);if(r!==void 0&&o[r]){const s=Ey(o[r]);UH(s),o[":@"]&&GH(s,o[":@"]),e[r]!==void 0&&e.hasOwnProperty(r)?(Array.isArray(e[r])||(e[r]=[e[r]]),e[r].push(s)):e[r]=s}}return e}function $H(i){const t=Object.keys(i);for(let e=0;e<t.length;e++){const n=t[e];if(n!==":@")return n}}function GH(i,t,e){if(t){const n=Object.keys(t),o=n.length;for(let r=0;r<o;r++){const s=n[r];i[s]=t[s]}}}function UH(i){return Object.keys(i).length===0}class Sd{constructor(t){this.options=Object.assign({},Sd.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;const e=new VH(this.options).parseXml(t);return jH(e,this.options)}}Sd.defaultOptions={};function KH(i){return i.startsWith("<svg")||i.startsWith("<?xml")}globalThis&&globalThis.__awaiter;function xd(i,t,e,n=0){return i.expand(t+(n/2+(e?YH(e,t):0))),i}function YH(i,t){return i?t:0}let XH=0;function Ti(){return XH++}var Kr;(function(i){i[i.HORIZONTAL=0]="HORIZONTAL",i[i.VERTICAL=1]="VERTICAL"})(Kr||(Kr={}));function ky(i){const t=[];let e=0,n="";for(let o=0;o<i.length;o++)JH(i[o])?e?n+=i[o]:(e=1,n=i[o]):(e&&(t.push({text:n,direction:Kr.VERTICAL}),n="",e=0),t.push({text:i[o],direction:Kr.HORIZONTAL}));return n&&t.push({text:n,direction:Kr.VERTICAL}),t}const qH=["…","(",")","—","【","】","「","」","《","》"],Ly=new Map;qH.forEach(i=>Ly.set(i,!0));const ZH=[""],Fy=new Map;function JH(i){if(Ly.has(i))return!0;if(Fy.has(i))return!1;let t=!1;return i.codePointAt(0)<256&&(t=!0),t}ZH.forEach(i=>Fy.set(i,!0));const Ad=Ti(),QH=Ti(),Iy=Ti(),Rd=Ti();Ti();const cp=Ti(),Td=Ti(),ca=Ti(),Md=Ti(),Bd=Ti();Ti();const gp=Ti();Ti();const fp=Ti(),Pd=Ti(),Hd=Ti(),Dy=Symbol.for("GraphicService"),Oy=Symbol.for("GraphicCreator"),zy={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},tE=Object.keys(zy);var Wy;(function(i){i[i.LESS_GROUP=0]="LESS_GROUP",i[i.MORE_GROUP=1]="MORE_GROUP"})(Wy||(Wy={}));let un=class qv extends Ji{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=cp,this._childUpdateTag=xe.UPDATE_BOUNDS}setMode(t){t==="3d"?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new ra),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new ra)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren(e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)})}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,n){if(n===ea.GLOBAL){const o=new Xe(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(o,o),this.AABBBounds.contains(o.x,o.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&xe.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;tt.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),tt.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=pi.x,y:e=pi.y,dx:n=pi.dx,dy:o=pi.dy,scaleX:r=pi.scaleX,scaleY:s=pi.scaleY,angle:l=pi.angle,postMatrix:a}=this.attribute;if(t!==0||e!==0||n!==0||o!==0||r!==1||s!==1||l!==0||a)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Ut(this).group}updateAABBBounds(t,e,n){const o=n;n=n.clone();const{width:r,height:s,path:l,clip:a=e.clip,display:h}=t;return l&&l.length?l.forEach(d=>{n.union(d.AABBBounds)}):r!=null&&s!=null&&n.set(0,0,Math.max(0,r),Math.max(0,s)),a||this.forEachChildren(d=>{n.union(d.AABBBounds)}),tt.graphicService.updateTempAABBBounds(n),tt.graphicService.transformAABBBounds(t,n,e,!1,this),o.copy(n),o}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=xe.CLEAR_BOUNDS,this._childUpdateTag&=xe.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=xe.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&xe.UPDATE_BOUNDS||(this._childUpdateTag|=xe.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),tt.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),tt.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const n=super.appendChild(t);return e&&this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,tt.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren(e=>{tt.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)}),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),tt.graphicService.onSetStage(this,t),this.forEachChildren(n=>{n.setStage(t,this.layer)}))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren(t=>{t.isContainer&&t.addUpdateGlobalPositionTag()})}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren(t=>{t.isContainer&&t.addUpdateGlobalPositionTag()})}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&xe.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find(n=>n.name===t,e)}createOrUpdateChild(t,e,n){let o=this._getChildByName(t);return o?o.setAttributes(e):(o=tt.graphicService.creator[n](e),o.name=t,this.add(o)),o}clone(){return new qv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return qv.NOWORK_ANIMATE_ATTR}};un.NOWORK_ANIMATE_ATTR=Yn;function Ed(i){return new un(i)}class eE extends un{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,n,o){var r;super({}),this.stage=t,this.global=e,this.window=n,this.main=o.main,this.layerHandler=o.layerHandler,this.layerHandler.init(this,n,{main:o.main,canvasId:o.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:(r=o.zIndex)!==null&&r!==void 0?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new ra,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort((n,o)=>n.zIndex-o.zIndex);this.layerHandler.merge(e.map(n=>(n.layer.subLayers.size&&n.layer.combineSubLayer(t),n.layer.getNativeHandler()))),t&&e.forEach(n=>{n.group&&(n.group.incremental=0)}),e.forEach(n=>{tt.layerService.releaseLayer(this.stage,n.layer)}),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach(n=>{n.layer.renderCount=this.renderCount,n.layer.render(t,e)})}render(t,e){var n;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:(n=t.background)!==null&&n!==void 0?n:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach(o=>o(this)),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach(t=>{tt.layerService.releaseLayer(this.stage,t.layer)})}drawTo(t,e){var n;this.layerHandler.drawTo(t,[this],Object.assign({background:(n=e.background)!==null&&n!==void 0?n:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach(o=>o(this))}}const Ny=Symbol.for("TransformUtil"),Vy=Symbol.for("GraphicUtil"),pp=Symbol.for("LayerService"),jy=Symbol.for("StaticLayerHandlerContribution"),iE=Symbol.for("DynamicLayerHandlerContribution"),nE=Symbol.for("VirtualLayerHandlerContribution");var ga,oE=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},rE=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)};let fa=ga=class{static GenerateLayerId(){return`${ga.idprefix}_${ga.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=tt.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(i){return this.layerMap.get(i)}getRecommendedLayerType(i){return i||(this.staticLayerCountInEnv!==0?"static":this.dynamicLayerCountInEnv!==0?"dynamic":"virtual")}getLayerHandler(i){let t;return t=i==="static"?Wt.get(jy):i==="dynamic"?Wt.get(iE):Wt.get(nE),t}createLayer(i,t={main:!1}){var e;this.tryInit();let n=this.getRecommendedLayerType(t.layerMode);n=t.main||t.canvasId?"static":n;const o=this.getLayerHandler(n),r=new eE(i,this.global,i.window,Object.assign(Object.assign({main:!1},t),{layerMode:n,canvasId:(e=t.canvasId)!==null&&e!==void 0?e:ga.GenerateLayerId(),layerHandler:o})),s=this.layerMap.get(i)||[];return s.push(r),this.layerMap.set(i,s),this.staticLayerCountInEnv--,r}prepareStageLayer(i){let t;i.forEachChildren(e=>{const n=e.getNativeHandler();n.type==="virtual"?(n.mainHandler=t,t.secondaryHandlers.push(n)):(t=n,t.secondaryHandlers=[])})}releaseLayer(i,t){t.release();const e=this.layerMap.get(i)||[];this.layerMap.set(i,e.filter(n=>n!==t))}layerCount(i){return(this.layerMap.get(i)||[]).length}restLayerCount(i){return this.global.env==="browser"?10:0}releaseStage(i){this.layerMap.delete(i)}};fa.idprefix="visactor_layer",fa.prefix_count=0,fa=ga=oE([wt(),rE("design:paramtypes",[])],fa);const sE=new $t(i=>{i(Af).to(Rf).inSingletonScope(),i(oa).to(np),i(Vy).to(op).inSingletonScope(),i(Ny).to(rp).inSingletonScope(),i(pp).to(fa).inSingletonScope()});function Ks(i,t){return!(!i&&!t)}function pa(i,t){let e;return e=ot(i)?i.some(n=>n||n===void 0):!!i,e&&t>0}function Yr(i,t,e){return e&&i*t>0}function $y(i,t,e,n,o){return o&&i*t>0&&e!==0&&n!==0}function mp(i,t){return i*t>0}function Gy(i,t,e,n){return i*t>0&&e!==0&&n!==0}function lE(i,t,e,n,o,r,s,l){if(!i.pathProxy)return!1;const a=Ut(i,r==null?void 0:r.theme)[i.type.replace("3d","")],{fill:h=a.fill,stroke:d=a.stroke,opacity:u=a.opacity,fillOpacity:c=a.fillOpacity,lineWidth:g=a.lineWidth,strokeOpacity:f=a.strokeOpacity,visible:p=a.visible,x:m=a.x,y:v=a.y}=i.attribute,C=Yr(u,c,h),w=mp(u,f),S=Ks(h),y=pa(d,g);if(!p||!S&&!y||!(C||w||s||l))return!0;t.beginPath();const _=typeof i.pathProxy=="function"?i.pathProxy(i.attribute):i.pathProxy;return hr(_.commandList,t,e,n),t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,a),y&&(l?l(t,i.attribute,a):w&&(t.setStrokeStyle(i,i.attribute,e-m,n-v,a),t.stroke())),S&&(s?s(t,i.attribute,a):C&&(t.setCommonStyle(i,i.attribute,e-m,n-v,a),t.fill())),!0}function aE(i,t,e,n,o,r,s,l){const a=e-i,h=n-t,d=s-o,u=l-r;let c=u*a-d*h;return c*c<Le?[]:(c=(d*(t-r)-u*(i-o))/c,[i+c*a,t+c*h])}function gr(i,t,e,n,o,r,s){const l=i-e,a=t-n,h=(s?r:-r)/Math.sqrt(l*l+a*a),d=h*a,u=-h*l,c=i+d,g=t+u,f=e+d,p=n+u,m=(c+f)/2,v=(g+p)/2,C=f-c,w=p-g,S=C*C+w*w,y=o-r,_=c*p-f*g,R=(w<0?-1:1)*Math.sqrt(Math.max(0,y*y*S-_*_));let A=(_*w-C*R)/S,x=(-_*C-w*R)/S;const T=(_*w+C*R)/S,M=(-_*C+w*R)/S,B=A-m,H=x-v,F=T-m,P=M-v;return B*B+H*H>F*F+P*P&&(A=T,x=M),{cx:A,cy:x,x01:-d,y01:-u,x11:A*(o/y-1),y11:x*(o/y-1)}}function Uy(i,t,e,n,o){const r=_e(e-t),s=i.getParsedCornerRadius(),l=ot(s),{outerDeltaAngle:a,innerDeltaAngle:h,outerStartAngle:d,outerEndAngle:u,innerEndAngle:c,innerStartAngle:g}=i.getParsePadAngle(t,e),f=l?s[0]:s,p=l?s[1]:s,m=l?s[2]:s,v=l?s[3]:s,C=Math.max(p,f),w=Math.max(m,v);let S=C,y=w;const _=o*ii(d),R=o*We(d),A=n*ii(c),x=n*We(c);let T,M,B,H;if((w>Le||C>Le)&&(T=o*ii(u),M=o*We(u),B=n*ii(g),H=n*We(g),r<Be)){const F=aE(_,R,B,H,T,M,A,x);if(F){const P=_-F[0],E=R-F[1],L=T-F[0],I=M-F[1],k=1/We(o2((P*L+E*I)/(Kn(P*P+E*E)*Kn(L*L+I*I)))/2),D=Kn(F[0]*F[0]+F[1]*F[1]);y=Fi(w,(n-D)/(k-1)),S=Fi(C,(o-D)/(k+1))}}return{outerDeltaAngle:a,xors:_,yors:R,xirs:B,yirs:H,xore:T,yore:M,xire:A,yire:x,limitedOcr:S,limitedIcr:y,outerCornerRadiusStart:f,outerCornerRadiusEnd:p,maxOuterCornerRadius:C,maxInnerCornerRadius:w,outerStartAngle:d,outerEndAngle:u,innerDeltaAngle:h,innerEndAngle:c,innerStartAngle:g,innerCornerRadiusStart:v,innerCornerRadiusEnd:m}}function vp(i,t,e,n,o,r,s){const{startAngle:l,endAngle:a}=i.getParsedAngle(),h=_e(a-l),d=a>l;let u=!1;if(o<r){const c=o;o=r,r=c}if(o<=Le)t.moveTo(e,n);else if(h>=ce-Le)t.moveTo(e+o*ii(l),n+o*We(l)),t.arc(e,n,o,l,a,!d),r>Le&&(t.moveTo(e+r*ii(a),n+r*We(a)),t.arc(e,n,r,a,l,d));else{const{outerDeltaAngle:c,xors:g,yors:f,xirs:p,yirs:m,limitedOcr:v,outerCornerRadiusStart:C,outerCornerRadiusEnd:w,maxOuterCornerRadius:S,xore:y,yore:_,xire:R,yire:A,outerStartAngle:x,outerEndAngle:T,limitedIcr:M,innerDeltaAngle:B,innerEndAngle:H,innerStartAngle:F,innerCornerRadiusStart:P,innerCornerRadiusEnd:E,maxInnerCornerRadius:L}=Uy(i,l,a,r,o);if(c<.001)s&&(s[3]||s[1])&&t.moveTo(e+g,n+f),u=!0;else if(v>Le){const I=Fi(C,v),k=Fi(w,v),D=gr(p,m,g,f,o,I,Number(d)),O=gr(y,_,R,A,o,k,Number(d));v<S&&I===k?!s||s[0]?(t.moveTo(e+D.cx+D.x01,n+D.cy+D.y01),t.arc(e+D.cx,n+D.cy,v,Ce(D.y01,D.x01),Ce(O.y01,O.x01),!d)):t.moveTo(e+D.cx+v*ii(Ce(O.y01,O.x01)),n+D.cy+v*We(Ce(O.y01,O.x01))):!s||s[0]?(t.moveTo(e+D.cx+D.x01,n+D.cy+D.y01),I>0&&t.arc(e+D.cx,n+D.cy,I,Ce(D.y01,D.x01),Ce(D.y11,D.x11),!d),t.arc(e,n,o,Ce(D.cy+D.y11,D.cx+D.x11),Ce(O.cy+O.y11,O.cx+O.x11),!d),k>0&&t.arc(e+O.cx,n+O.cy,k,Ce(O.y11,O.x11),Ce(O.y01,O.x01),!d)):k>0?t.moveTo(e+O.cx+k*ii(Ce(O.y01,O.x01)),n+O.cy+k*We(Ce(O.y01,O.x01))):t.moveTo(e+y,n+o*We(T))}else!s||s[0]?(t.moveTo(e+g,n+f),t.arc(e,n,o,x,T,!d)):t.moveTo(e+o*ii(T),n+o*We(T));if(!(r>Le)||B<.001)!s||s[1]?t.lineTo(e+R,n+A):t.moveTo(e+R,n+A),u=!0;else if(M>Le){const I=Fi(P,M),k=Fi(E,M),D=gr(R,A,y,_,r,-k,Number(d)),O=gr(g,f,p,m,r,-I,Number(d));if(!s||s[1]?t.lineTo(e+D.cx+D.x01,n+D.cy+D.y01):t.moveTo(e+D.cx+D.x01,n+D.cy+D.y01),M<L&&I===k){const N=Ce(O.y01,O.x01);!s||s[2]?t.arc(e+D.cx,n+D.cy,M,Ce(D.y01,D.x01),N,!d):t.moveTo(e+D.cx+ii(N),n+D.cy+We(N))}else!s||s[2]?(k>0&&t.arc(e+D.cx,n+D.cy,k,Ce(D.y01,D.x01),Ce(D.y11,D.x11),!d),t.arc(e,n,r,Ce(D.cy+D.y11,D.cx+D.x11),Ce(O.cy+O.y11,O.cx+O.x11),d),I>0&&t.arc(e+O.cx,n+O.cy,I,Ce(O.y11,O.x11),Ce(O.y01,O.x01),!d)):I>0?t.moveTo(e+O.cx+I*ii(Ce(O.y01,O.x01)),n+O.cy+I*We(Ce(O.y01,O.x01))):t.moveTo(e+p,n+m)}else!s||s[1]?t.lineTo(e+R,n+A):t.moveTo(e+R,n+A),!s||s[2]?t.arc(e,n,r,H,F,d):t.moveTo(e+r*ii(F),n+r*We(F))}return s?s[3]&&t.lineTo(e+o*ii(l),n+o*We(l)):t.closePath(),u}class Bn{static GetCanvas(){try{return Bn.canvas||(Bn.canvas=tt.global.createCanvas({})),Bn.canvas}catch{return null}}static GetCtx(){if(!Bn.ctx){const t=Bn.GetCanvas();Bn.ctx=t.getContext("2d")}return Bn.ctx}}class Xr extends c2{static getInstance(){return Xr._instance||(Xr._instance=new Xr),Xr._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const n=Bn.GetCanvas(),o=Bn.GetCtx();if(n.width=e,n.height=1,!o)return;if(o.translate(0,0),!o)throw new Error("获取ctx发生错误");const r=o.createLinearGradient(0,0,e,0);t.forEach(s=>{r.addColorStop(s[0],s[1])}),o.fillStyle=r,o.fillRect(0,0,e,1),this.rgbaSet=o.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,n,o,r=[],s=100){let l=`${t}${e}${n}${o}`;r.forEach(h=>l+=h.join()),l+=s;let a=this.dataMap.get(l);return a||(a={data:new Xr(r,s),timestamp:[]},this.addLimitedTimestamp(a,Date.now(),{}),this.dataMap.set(l,a)),this.clearCache(this.dataMap,this.cacheParams),a.data}}class Di{static GetSize(t){for(let e=0;e<Di.ImageSize.length;e++)if(Di.ImageSize[e]>=t)return Di.ImageSize[e];return t}static Get(t,e,n,o,r,s,l){const a=Di.GenKey(t,e,n,o,r),h=Di.cache[a];if(!h||h.length===0)return null;for(let d=0;d<h.length;d++)if(h[d].width>=s&&h[d].height>=l)return h[d].pattern;return null}static Set(t,e,n,o,r,s,l,a){const h=Di.GenKey(t,e,n,o,r);Di.cache[h]?Di.cache[h].push({width:l,height:a,pattern:s}):Di.cache[h]=[{width:l,height:a,pattern:s}]}static GenKey(t,e,n,o,r){return`${e},${n},${o},${r},${t.join()}`}}Di.cache={},Di.ImageSize=[20,40,80,160,320,640,1280,2560];function hE(i,t,e,n){const{stops:o,startAngle:r,endAngle:s}=n;for(;e<0;)e+=ce;for(;e>ce;)e-=ce;if(e<r||e>s)return o[0].color;let l,a,h=(e-r)/(s-r);for(let d=0;d<o.length;d++)if(o[d].offset>=h){l=o[d-1],a=o[d];break}return h=(h-l.offset)/(a.offset-l.offset),Us(l.color,a.color,h,!1)}function dE(i,t,e,n,o,r,s,l,a){const h=Math.floor(180*o/Math.PI),d=Bn.GetCanvas(),u=Bn.GetCtx();if(!u)return null;const c=Di.GetSize(l),g=Di.GetSize(a);let f=Di.Get(t,e,n,r,s,c,g);if(f)return f;const p=Math.sqrt(Math.max(Math.max(Math.pow(e,2)+Math.pow(n,2),Math.pow(c-e,2)+Math.pow(n,2)),Math.max(Math.pow(c-e,2)+Math.pow(g-n,2),Math.pow(e,2)+Math.pow(g-n,2)))),m=h+1,v=o/Math.max(1,m-1),C=Xr.getInstance().GetOrCreate(e,n,c,g,t,m),w=2*Math.PI*p/360;d.width=c,d.height=g,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,c,g),u.translate(e,n),u.rotate(r);for(let y=0,_=m-1;y<_&&!(r+y*v>s);y++){const R=C.getColor(y);u.beginPath(),u.rotate(v),u.moveTo(0,0),u.lineTo(p,-2*w),u.lineTo(p,0),u.fillStyle=R,u.closePath(),u.fill()}const S=u.getImageData(0,0,c,g);return d.width=S.width,d.height=S.height,u.putImageData(S,0,0),f=i.createPattern(d,"no-repeat"),f&&Di.Set(t,e,n,r,s,f,c,g),f}const bp=Symbol.for("ArcRenderContribution"),uE=Symbol.for("AreaRenderContribution"),Cp=Symbol.for("CircleRenderContribution"),Xn=Symbol.for("GroupRenderContribution"),qr=Symbol.for("ImageRenderContribution"),yp=Symbol.for("PathRenderContribution"),_p=Symbol.for("PolygonRenderContribution"),Zr=Symbol.for("RectRenderContribution"),wp=Symbol.for("SymbolRenderContribution"),kd=Symbol.for("TextRenderContribution"),Sp=Symbol.for("InteractiveSubRenderContribution");function cE(i,t){return i==="top"?Math.ceil(.79*t):i==="middle"?Math.round(.3*t):i==="bottom"?Math.round(-.21*t):0}function ho(i,t){return i==="end"||i==="right"?-t:i==="center"?-t/2:0}function uo(i,t,e,n=0){return i==="middle"?-t/2:i==="top"?0:i==="bottom"?n-t:i&&i!=="alphabetic"?0:(e||(e=t),-(t-e)/2-.79*e)}function Ky(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function gE(i,t,e){const n=Math.sin(e),o=Math.cos(e),r=t[4],s=t[5],l=t[6],a=t[7],h=t[8],d=t[9],u=t[10],c=t[11];return t!==i&&(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]),i[4]=r*o+h*n,i[5]=s*o+d*n,i[6]=l*o+u*n,i[7]=a*o+c*n,i[8]=h*o-r*n,i[9]=d*o-s*n,i[10]=u*o-l*n,i[11]=c*o-a*n,i}function fE(i,t,e){const n=Math.sin(e),o=Math.cos(e),r=t[0],s=t[1],l=t[2],a=t[3],h=t[8],d=t[9],u=t[10],c=t[11];return t!==i&&(i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]),i[0]=r*o-h*n,i[1]=s*o-d*n,i[2]=l*o-u*n,i[3]=a*o-c*n,i[8]=r*n+h*o,i[9]=s*n+d*o,i[10]=l*n+u*o,i[11]=a*n+c*o,i}function pE(i,t,e){const n=Math.sin(e),o=Math.cos(e),r=t[0],s=t[1],l=t[2],a=t[3],h=t[4],d=t[5],u=t[6],c=t[7];return t!==i&&(i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]),i[0]=r*o+h*n,i[1]=s*o+d*n,i[2]=l*o+u*n,i[3]=a*o+c*n,i[4]=h*o-r*n,i[5]=d*o-s*n,i[6]=u*o-l*n,i[7]=c*o-a*n,i}function ma(i,t,e){const n=e[0],o=e[1],r=e[2];let s,l,a,h,d,u,c,g,f,p,m,v;return t===i?(i[12]=t[0]*n+t[4]*o+t[8]*r+t[12],i[13]=t[1]*n+t[5]*o+t[9]*r+t[13],i[14]=t[2]*n+t[6]*o+t[10]*r+t[14],i[15]=t[3]*n+t[7]*o+t[11]*r+t[15]):(s=t[0],l=t[1],a=t[2],h=t[3],d=t[4],u=t[5],c=t[6],g=t[7],f=t[8],p=t[9],m=t[10],v=t[11],i[0]=s,i[1]=l,i[2]=a,i[3]=h,i[4]=d,i[5]=u,i[6]=c,i[7]=g,i[8]=f,i[9]=p,i[10]=m,i[11]=v,i[12]=s*n+d*o+f*r+t[12],i[13]=l*n+u*o+p*r+t[13],i[14]=a*n+c*o+m*r+t[14],i[15]=h*n+g*o+v*r+t[15]),i}function xp(i,t){i[0]=t.a,i[1]=t.b,i[2]=0,i[3]=0,i[4]=t.c,i[5]=t.d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=t.e,i[13]=t.f,i[14]=0,i[15]=1}function mE(i,t,e){const n=e[0],o=e[1],r=e[2];return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*o,i[5]=t[5]*o,i[6]=t[6]*o,i[7]=t[7]*o,i[8]=t[8]*r,i[9]=t[9]*r,i[10]=t[10]*r,i[11]=t[11]*r,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}function va(i,t,e){const n=t[0],o=t[1],r=t[2],s=t[3],l=t[4],a=t[5],h=t[6],d=t[7],u=t[8],c=t[9],g=t[10],f=t[11],p=t[12],m=t[13],v=t[14],C=t[15];let w=e[0],S=e[1],y=e[2],_=e[3];return i[0]=w*n+S*l+y*u+_*p,i[1]=w*o+S*a+y*c+_*m,i[2]=w*r+S*h+y*g+_*v,i[3]=w*s+S*d+y*f+_*C,w=e[4],S=e[5],y=e[6],_=e[7],i[4]=w*n+S*l+y*u+_*p,i[5]=w*o+S*a+y*c+_*m,i[6]=w*r+S*h+y*g+_*v,i[7]=w*s+S*d+y*f+_*C,w=e[8],S=e[9],y=e[10],_=e[11],i[8]=w*n+S*l+y*u+_*p,i[9]=w*o+S*a+y*c+_*m,i[10]=w*r+S*h+y*g+_*v,i[11]=w*s+S*d+y*f+_*C,w=e[12],S=e[13],y=e[14],_=e[15],i[12]=w*n+S*l+y*u+_*p,i[13]=w*o+S*a+y*c+_*m,i[14]=w*r+S*h+y*g+_*v,i[15]=w*s+S*d+y*f+_*C,i}function qn(i,t,e){const n=t[0],o=t[1],r=t[2];let s=e[3]*n+e[7]*o+e[11]*r+e[15];return s=s||1,i[0]=(e[0]*n+e[4]*o+e[8]*r+e[12])/s,i[1]=(e[1]*n+e[5]*o+e[9]*r+e[13])/s,i[2]=(e[2]*n+e[6]*o+e[10]*r+e[14])/s,i}function Yy(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class vE{constructor(){this.pools=[]}allocate(t,e,n,o,r,s){if(!this.pools.length)return new ni(t,e,n,o,r,s);const l=this.pools.pop();return l.a=t,l.b=e,l.c=n,l.d=o,l.e=r,l.f=s,l}allocateByObj(t){if(!this.pools.length)return new ni(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}class Ap{constructor(){this.pools=[]}static identity(t){return Ky(t)}allocate(){if(!this.pools.length)return Yy();const t=this.pools.pop();return Ap.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():Yy();for(let n=0;n<e.length;n++)e[n]=t[n];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const cn=new vE,ri=new Ap;var bE=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},CE=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},yE=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};function Xy(i,t,e){var n;const{x:o=e.x,y:r=e.y,z:s=e.z,dx:l=e.dx,dy:a=e.dy,dz:h=e.dz,scaleX:d=e.scaleX,scaleY:u=e.scaleY,scaleZ:c=e.scaleZ,alpha:g=e.alpha,beta:f=e.beta,angle:p=e.angle,anchor3d:m=t.attribute.anchor,anchor:v}=t.attribute,C=[0,0,0];if(m){if(typeof m[0]=="string"){const w=parseFloat(m[0])/100,S=t.AABBBounds;C[0]=S.x1+(S.x2-S.x1)*w}else C[0]=m[0];if(typeof m[1]=="string"){const w=parseFloat(m[1])/100,S=t.AABBBounds;C[1]=S.x1+(S.x2-S.x1)*w}else C[1]=m[1];C[2]=(n=m[2])!==null&&n!==void 0?n:0}if(Ky(i),ma(i,i,[o+l,r+a,s+h]),ma(i,i,[C[0],C[1],C[2]]),gE(i,i,f),fE(i,i,g),ma(i,i,[-C[0],-C[1],C[2]]),mE(i,i,[d,u,c]),p){const w=ri.allocate(),S=[0,0];if(v){if(typeof m[0]=="string"){const y=parseFloat(m[0])/100,_=t.AABBBounds;S[0]=_.x1+(_.x2-_.x1)*y}else S[0]=m[0];if(typeof m[1]=="string"){const y=parseFloat(m[1])/100,_=t.AABBBounds;S[1]=_.x1+(_.x2-_.x1)*y}else S[1]=m[1]}ma(w,w,[S[0],S[1],0]),pE(w,w,p),ma(w,w,[-S[0],-S[1],0]),va(i,i,w)}}function _E(i){const{alpha:t,beta:e}=i.attribute;return t||e}let Rp=class{constructor(i){this.creator=i,this.hooks={onAttributeUpdate:new qi(["graphic"]),onSetStage:new qi(["graphic","stage"]),onRemove:new qi(["graphic"]),onRelease:new qi(["graphic"]),onAddIncremental:new qi(["graphic","group","stage"]),onClearIncremental:new qi(["graphic","group","stage"]),beforeUpdateAABBBounds:new qi(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new qi(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new qi(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new Fe,this.tempAABBBounds2=new Fe}onAttributeUpdate(i){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(i)}onSetStage(i,t){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(i,t)}onRemove(i){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(i)}onRelease(i){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(i)}onAddIncremental(i,t,e){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(i,t,e)}onClearIncremental(i,t){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(i,t)}beforeUpdateAABBBounds(i,t,e,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(i,t,e,n)}afterUpdateAABBBounds(i,t,e,n,o){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(i,t,e,n,o)}clearAABBBounds(i,t,e){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(i,t,e)}updatePathProxyAABBBounds(i,t){const e=typeof t.pathProxy=="function"?t.pathProxy(t.attribute):t.pathProxy;if(!e)return!1;const n=new Vf(i);return hr(e.commandList,n,0,0),!0}updateHTMLTextAABBBounds(i,t,e,n){const{textAlign:o,textBaseline:r}=i;if(i.forceBoundsHeight!=null){const s=ut(i.forceBoundsHeight)?i.forceBoundsHeight:i.forceBoundsHeight(),l=uo(r,s,s);e.set(e.x1,l,e.x2,l+s)}if(i.forceBoundsWidth!=null){const s=ut(i.forceBoundsWidth)?i.forceBoundsWidth:i.forceBoundsWidth(),l=ho(o,s);e.set(l,e.y1,l+s,e.y2)}}combindShadowAABBBounds(i,t){if(t&&t.shadowRoot){const e=t.shadowRoot.AABBBounds;i.union(e)}}transformAABBBounds(i,t,e,n,o){if(!t.empty()){const{scaleX:l=e.scaleX,scaleY:a=e.scaleY,stroke:h=e.stroke,shadowBlur:d=e.shadowBlur,lineWidth:u=e.lineWidth,pickStrokeBuffer:c=e.pickStrokeBuffer,strokeBoundsBuffer:g=e.strokeBoundsBuffer}=i,f=this.tempAABBBounds1,p=this.tempAABBBounds2;if(h&&u){const m=(u+c)/Math.abs(l+a);xd(f,m,n,g),t.union(f),f.setValue(p.x1,p.y1,p.x2,p.y2)}if(d){const{shadowOffsetX:m=e.shadowOffsetX,shadowOffsetY:v=e.shadowOffsetY}=i,C=d/Math.abs(l+a)*2;xd(f,C,!1,g+1),f.translate(m,v),t.union(f)}}if(this.combindShadowAABBBounds(t,o),t.empty())return;let r=!0;const s=o.transMatrix;o&&o.isContainer&&(r=!(s.a===1&&s.b===0&&s.c===0&&s.d===1&&s.e===0&&s.f===0)),r&&Df(t,t,s)}validCheck(i,t,e,n){if(!n||i.forceBoundsHeight!=null||i.forceBoundsWidth!=null||n.shadowRoot||n.isContainer)return!0;const{visible:o=t.visible}=i;return!(!n.valid||!o)||(e.empty()||(n.parent&&e.transformWithMatrix(n.parent.globalTransMatrix),tt.graphicService.clearAABBBounds(n,n.stage,e),e.clear()),!1)}updateTempAABBBounds(i){const t=this.tempAABBBounds1,e=this.tempAABBBounds2;return t.setValue(i.x1,i.y1,i.x2,i.y2),e.setValue(i.x1,i.y1,i.x2,i.y2),{tb1:t,tb2:e}}};Rp=bE([wt(),yE(0,re(Oy)),CE("design:paramtypes",[Object])],Rp);const qe={x:0,y:0,z:0,lastModelMatrix:null};class Qi{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach(e=>this._renderContribitions.push(e)),this._renderContribitions.length&&(this._renderContribitions.sort((e,n)=>n.order-e.order),this._beforeRenderContribitions=this._renderContribitions.filter(e=>e.time===ge.beforeFillStroke),this._afterRenderContribitions=this._renderContribitions.filter(e=>e.time===ge.afterFillStroke))}beforeRenderStep(t,e,n,o,r,s,l,a,h,d,u,c,g){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach(f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,o,r,s,l,a,h,d,u,c,g)})}afterRenderStep(t,e,n,o,r,s,l,a,h,d,u,c,g){this._afterRenderContribitions&&this._afterRenderContribitions.forEach(f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,o,r,s,l,a,h,d,u,c,g)})}valid(t,e,n,o){const{fill:r=e.fill,background:s,stroke:l=e.stroke,opacity:a=e.opacity,fillOpacity:h=e.fillOpacity,lineWidth:d=e.lineWidth,strokeOpacity:u=e.strokeOpacity,visible:c=e.visible}=t.attribute,g=Yr(a,h,r),f=mp(a,u),p=Ks(r,s),m=pa(l,d);return!(!t.valid||!c)&&!(!p&&!m)&&!!(g||f||n||o||s)&&{fVisible:g,sVisible:f,doFill:p,doStroke:m}}transform(t,e,n,o=!1){const{x:r=e.x,y:s=e.y,z:l=e.z,scaleX:a=e.scaleX,scaleY:h=e.scaleY,angle:d=e.angle,postMatrix:u}=t.attribute,c=n.modelMatrix,g=n.camera;qe.x=r,qe.y=s,qe.z=l,qe.lastModelMatrix=c;const f=g&&(o||_E(t)),p=f?t.transMatrix.onlyTranslate()&&!u:a===1&&h===1&&d===0&&!u;if(f){const m=ri.allocate(),v=ri.allocate();Xy(v,t,e),va(m,c||m,v),qe.x=0,qe.y=0,qe.z=0,n.modelMatrix=m,n.setTransform(1,0,0,1,0,0,!0),ri.free(v)}if(p&&!c){const m=t.getOffsetXY(e);qe.x+=m.x,qe.y+=m.y,qe.z=l,n.setTransformForCurrent()}else if(f)qe.x=0,qe.y=0,qe.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(g&&n.project){const m=t.getOffsetXY(e);qe.x+=m.x,qe.y+=m.y,this.transformWithoutTranslate(n,qe.x,qe.y,qe.z,a,h,d)}else n.transformFromMatrix(t.transMatrix,!0),qe.x=0,qe.y=0,qe.z=0;return qe}transformUseContext2d(t,e,n,o){const r=o.camera;if(this.camera=r,r){const s=t.AABBBounds,l=s.x2-s.x1,a=s.y2-s.y1,h=o.project(0,0,n),d=o.project(l,0,n),u=o.project(l,a,n),c={x:0,y:0},g={x:l,y:0},f={x:l,y:a};o.camera=null;const p=1/(c.x*(f.y-g.y)-g.x*f.y+f.x*g.y+(g.x-f.x)*c.y),m=-(c.y*(u.x-d.x)-g.y*u.x+f.y*d.x+(g.y-f.y)*h.x)*p,v=(g.y*u.y+c.y*(d.y-u.y)-f.y*d.y+(f.y-g.y)*h.y)*p,C=(c.x*(u.x-d.x)-g.x*u.x+f.x*d.x+(g.x-f.x)*h.x)*p,w=-(g.x*u.y+c.x*(d.y-u.y)-f.x*d.y+(f.x-g.x)*h.y)*p,S=(c.x*(f.y*d.x-g.y*u.x)+c.y*(g.x*u.x-f.x*d.x)+(f.x*g.y-g.x*f.y)*h.x)*p,y=(c.x*(f.y*d.y-g.y*u.y)+c.y*(g.x*u.y-f.x*d.y)+(f.x*g.y-g.x*f.y)*h.y)*p;o.setTransform(m,v,C,w,S,y,!0)}}restoreTransformUseContext2d(t,e,n,o){this.camera&&(o.camera=this.camera)}transformWithoutTranslate(t,e,n,o,r,s,l){const a=t.project(e,n,o);t.translate(a.x,a.y,!1),t.scale(r,s,!1),t.rotate(l,!1),t.translate(-a.x,-a.y,!1),t.setTransformForCurrent()}_draw(t,e,n,o,r){const{context:s}=o;if(!s)return;const{renderable:l}=t.attribute;if(l===!1)return;s.highPerformanceSave();const a=this.transform(t,e,s,n),{x:h,y:d,z:u,lastModelMatrix:c}=a;this.z=u,lE(t,s,h,d,o,r)||(this.drawShape(t,s,h,d,o,r),this.z=0,s.modelMatrix!==c&&ri.free(s.modelMatrix),s.modelMatrix=c),s.highPerformanceRestore()}}const wE=function(){const i={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let t="";function e(S){const y=new Error(t+": "+S);throw y.source=t,y}function n(){const S=g(o);return t.length>0&&e("Invalid input not EOF"),S}function o(){return r("linear",i.linearGradient,s)||r("radial",i.radialGradient,a)||r("conic",i.conicGradient,l)}function r(S,y,_){return function(R,A){const x=C(R);if(x){C(i.startCall)||e("Missing (");const T=A(x);return C(i.endCall)||e("Missing )"),T}}(y,function(R){const A=_();return A&&(C(i.comma)||e("Missing comma before color stops")),{type:S,orientation:A,colorStops:g(f)}})}function s(){return v("directional",i.sideOrCorner,1)||v("angular",i.angleValue,1)}function l(){return v("angular",i.fromAngleValue,1)}function a(){let S,y,_=h();return _&&(S=[],S.push(_),y=t,C(i.comma)&&(_=h(),_?S.push(_):t=y)),S}function h(){let S=function(){const y=v("shape",/^(circle)/i,0);return y&&(y.style=m()||d()),y}()||function(){const y=v("shape",/^(ellipse)/i,0);return y&&(y.style=p()||d()),y}();if(S)S.at=u();else{const y=d();if(y){S=y;const _=u();_&&(S.at=_)}else{const _=c();_&&(S={type:"default-radial",at:_})}}return S}function d(){return v("extent-keyword",i.extentKeywords,1)}function u(){if(v("position",/^at/,0)){const S=c();return S||e("Missing positioning value"),S}}function c(){const S={x:p(),y:p()};if(S.x||S.y)return{type:"position",value:S}}function g(S){let y=S();const _=[];if(y)for(_.push(y);C(i.comma);)y=S(),y?_.push(y):e("One extra comma");return _}function f(){const S=v("hex",i.hexColor,1)||v("rgba",i.rgbaColor,1)||v("rgb",i.rgbColor,1)||v("literal",i.literalColor,0);return S||e("Expected color definition"),S.length=p(),S}function p(){return v("%",i.percentageValue,1)||v("position-keyword",i.positionKeywords,1)||m()}function m(){return v("px",i.pixelValue,1)||v("em",i.emValue,1)}function v(S,y,_){const R=C(y);if(R)return{type:S,value:R[_]}}function C(S){const y=/^[\n\r\t\s]+/.exec(t);y&&w(y[0].length);const _=S.exec(t);return _&&w(_[0].length),_}function w(S){t=t.substr(S)}return function(S){return t=S.toString(),n()}}();class Ys{static IsGradient(t){return!(typeof t=="string"&&!t.includes("gradient"))}static IsGradientStr(t){return typeof t=="string"&&t.includes("gradient")}static Parse(t){if(Ys.IsGradientStr(t))try{const e=wE(t)[0];if(e){if(e.type==="linear")return Ys.ParseLinear(e);if(e.type==="radial")return Ys.ParseRadial(e);if(e.type==="conic")return Ys.ParseConic(e)}}catch{return t}return t}static ParseConic(t){const{orientation:e,colorStops:n=[]}=t,o=Be/2,r=parseFloat(e.value)/180*Be-o;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+ce,stops:n.map(s=>({color:s.value,offset:parseFloat(s.length.value)/100}))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map(n=>({color:n.value,offset:parseFloat(n.length.value)/100}))}}static ParseLinear(t){const{orientation:e,colorStops:n=[]}=t,o=Be/2;let r=e.type==="angular"?parseFloat(e.value)/180*Be:0;for(;r<0;)r+=ce;for(;r>ce;)r-=ce;let s=0,l=0,a=0,h=0;return r<o?(s=0,l=1,a=Math.sin(r),h=Math.cos(r)):r<Be?(s=0,l=0,a=Math.cos(r-o),h=Math.sin(r-o)):r<Be+o?(s=1,l=0,a=s-Math.sin(r-Be),h=Math.cos(r-Be)):(s=1,a=s-Math.cos(r-o-Be),h-=Math.sin(r-o-Be)),{gradient:"linear",x0:s,y0:l,x1:a,y1:h,stops:n.map(d=>({color:d.value,offset:parseFloat(d.length.value)/100}))}}}function zo(i,t,e){let n=t;const{a:o,b:r,c:s,d:l}=i.currentMatrix,a=Math.sign(o)*Math.sqrt(o*o+r*r),h=Math.sign(l)*Math.sqrt(s*s+l*l);return a+h===0?0:(n=n/Math.abs(a+h)*2*e,n)}function Tp(i,t,e,n=0,o=0){if(!t||t===!0)return"black";let r,s;if(ot(t))for(let l=0;l<t.length&&(s=t[l],!s);l++);else s=t;if(s=Ys.Parse(s),typeof s=="string")return s;if(e.AABBBounds&&(!e.attribute||e.attribute.scaleX!==0||e.attribute.scaleY!==0)){const l=e.AABBBounds;let a=l.x2-l.x1,h=l.y2-l.y1,d=l.x1-n,u=l.y1-o;if(e.attribute){const{scaleX:c=1,scaleY:g=1}=e.attribute;a/=c,h/=g,d/=c,u/=g}s.gradient==="linear"?r=SE(i,s,d,u,a,h):s.gradient==="conical"?r=AE(i,s,d,u,a,h):s.gradient==="radial"&&(r=xE(i,s,d,u,a,h))}return r||"orange"}function SE(i,t,e,n,o,r){var s,l,a,h;const d=i.createLinearGradient(e+((s=t.x0)!==null&&s!==void 0?s:0)*o,n+((l=t.y0)!==null&&l!==void 0?l:0)*r,e+((a=t.x1)!==null&&a!==void 0?a:1)*o,n+((h=t.y1)!==null&&h!==void 0?h:0)*r);return t.stops.forEach(u=>{d.addColorStop(u.offset,u.color)}),d}function xE(i,t,e,n,o,r){var s,l,a,h,d,u;const c=i.createRadialGradient(e+((s=t.x0)!==null&&s!==void 0?s:.5)*o,n+((l=t.y0)!==null&&l!==void 0?l:.5)*r,Math.max(o,r)*((a=t.r0)!==null&&a!==void 0?a:0),e+((h=t.x1)!==null&&h!==void 0?h:.5)*o,n+((d=t.y1)!==null&&d!==void 0?d:.5)*r,Math.max(o,r)*((u=t.r1)!==null&&u!==void 0?u:.5));return t.stops.forEach(g=>{c.addColorStop(g.offset,g.color)}),c}function AE(i,t,e,n,o,r){var s,l;const a=i.createConicGradient(e+((s=t.x)!==null&&s!==void 0?s:0)*o,n+((l=t.y)!==null&&l!==void 0?l:0)*r,t.startAngle,t.endAngle);return t.stops.forEach(h=>{a.addColorStop(h.offset,h.color)}),a.GetPattern(o+e,r+n,void 0)}var RE=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},TE=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},qy=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};class ba{constructor(){this.time=ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,o,r,s,l,a,h,d,u,c,g){var f;const{background:p,backgroundOpacity:m=(f=t.attribute.fillOpacity)!==null&&f!==void 0?f:h.backgroundOpacity,opacity:v=h.opacity,backgroundMode:C=h.backgroundMode,backgroundFit:w=h.backgroundFit}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const S=t.resources.get(p);if(S.state!=="success"||!S.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const _=Ut(t.parent).group,{scrollX:R=_.scrollX,scrollY:A=_.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(R,A)}e.clip();const y=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,o,h),e.globalAlpha=m*v,this.doDrawImage(e,S.data,y,C,w),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,o,h),e.globalAlpha=m*v,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,n,o,r){if(o==="no-repeat")t.drawImage(e,n.x1,n.y1,n.width(),n.height());else{const s=n.width(),l=n.height();let a=s,h=l;if(r&&o!=="repeat"&&(e.width||e.height)){const c=e.width,g=e.height;o==="repeat-x"?(a=c*(l/g),h=l):o==="repeat-y"&&(h=g*(s/c),a=s);const f=t.dpr,p=$s.allocate({width:a,height:h,dpr:f}),m=p.getContext("2d");m&&(m.inuse=!0,m.clearMatrix(),m.setTransformForCurrent(!0),m.clearRect(0,0,a,h),m.drawImage(e,0,0,a,h),e=p.nativeCanvas),$s.free(p)}const d=t.dpr,u=t.createPattern(e,o);u.setTransform&&u.setTransform(new DOMMatrix([1/d,0,0,1/d,0,0])),t.fillStyle=u,t.translate(n.x1,n.y1),t.fillRect(0,0,s,l),t.translate(-n.x1,-n.y1)}}}const Jr=new ba;let Zn=class{constructor(i){this.subRenderContribitions=i,this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach(g=>{g.render(i,t,e,n,o,r,s,l,a,h,d,u,c)})}};Zn=RE([wt(),qy(0,re(ei)),qy(0,ui(Sp)),TE("design:paramtypes",[Object])],Zn);class Mp{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,n,o,r){const s=(t-2*e)/2,l=o.dpr,a=$s.allocate({width:t,height:t,dpr:l}),h=a.getContext("2d");if(!h)return null;h.inuse=!0,h.clearMatrix(),h.setTransformForCurrent(!0),h.clearRect(0,0,t,t),r(s,h);const d=o.createPattern(a.nativeCanvas,"repeat");return d.setTransform&&d.setTransform(new DOMMatrix([1/l,0,0,1/l,0,0])),$s.free(a),d}createCirclePattern(t,e,n,o){return this.createCommonPattern(t,e,n,o,(r,s)=>{s.fillStyle=n,s.arc(r,r,r,0,ce),s.fill()})}createDiamondPattern(t,e,n,o){return this.createCommonPattern(t,e,n,o,(r,s)=>{const l=t/2,a=l;s.fillStyle=n,s.moveTo(l,a-r),s.lineTo(r+l,a),s.lineTo(l,a+r),s.lineTo(l-r,a),s.closePath(),s.fill()})}createRectPattern(t,e,n,o){return this.createCommonPattern(t,e,n,o,(r,s)=>{const l=e,a=l;s.fillStyle=n,s.fillRect(l,a,2*r,2*r)})}createVerticalLinePattern(t,e,n,o){return this.createCommonPattern(t,e,n,o,(r,s)=>{const l=e;s.fillStyle=n,s.fillRect(l,0,2*r,t)})}createHorizontalLinePattern(t,e,n,o){return this.createCommonPattern(t,e,n,o,(r,s)=>{const l=e;s.fillStyle=n,s.fillRect(0,l,t,2*r)})}createBiasLRLinePattern(t,e,n,o){return this.createCommonPattern(t,e,n,o,(r,s)=>{s.strokeStyle=n,s.lineWidth=r,s.moveTo(0,0),s.lineTo(t,t);const l=t/2,a=-l;s.moveTo(l,a),s.lineTo(l+t,a+t),s.moveTo(-l,-a),s.lineTo(-l+t,-a+t),s.stroke()})}createBiasRLLinePattern(t,e,n,o){return this.createCommonPattern(t,e,n,o,(r,s)=>{s.strokeStyle=n,s.lineWidth=r,s.moveTo(t,0),s.lineTo(0,t);const l=t/2,a=l;s.moveTo(t+l,a),s.lineTo(l,a+t),s.moveTo(t-l,-a),s.lineTo(-l,-a+t),s.stroke()})}createGridPattern(t,e,n,o){return this.createCommonPattern(t,e,n,o,(r,s)=>{const l=e,a=l;s.fillStyle=n,s.fillRect(l,a,r,r),s.fillRect(l+r,a+r,r,r)})}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,n,o,r,s,l,a,h,d,u,c,g){this.textureMap||this.initTextureMap(e,t.stage);const{texture:f=h.texture,textureColor:p=h.textureColor,textureSize:m=h.textureSize,texturePadding:v=h.texturePadding}=t.attribute;f&&this.drawTexture(f,t,e,n,o,h,p,m,v)}drawTexture(t,e,n,o,r,s,l,a,h){let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(a,h,l,n);break;case"diamond":d=this.createDiamondPattern(a,h,l,n);break;case"rect":d=this.createRectPattern(a,h,l,n);break;case"vertical-line":d=this.createVerticalLinePattern(a,h,l,n);break;case"horizontal-line":d=this.createHorizontalLinePattern(a,h,l,n);break;case"bias-lr":d=this.createBiasLRLinePattern(a,h,l,n);break;case"bias-rl":d=this.createBiasRLLinePattern(a,h,l,n);break;case"grid":d=this.createGridPattern(a,h,l,n)}d&&(n.highPerformanceSave(),n.setCommonStyle(e,e.attribute,o,r,s),n.fillStyle=d,n.fill(),n.highPerformanceRestore())}}const Xs=new Mp;class ME{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,o,r,s,l,a,h,d,u,c){const{outerBorder:g,innerBorder:f}=t.attribute,p=g&&g.visible!==!1,m=f&&f.visible!==!1;if(!p&&!m)return;const{innerPadding:v=h.innerPadding,outerPadding:C=h.outerPadding,startAngle:w=h.startAngle,endAngle:S=h.endAngle,opacity:y=h.opacity,x:_=h.x,y:R=h.y,scaleX:A=h.scaleX,scaleY:x=h.scaleY}=t.attribute;let{innerRadius:T=h.innerRadius,outerRadius:M=h.outerRadius}=t.attribute;M+=C,T-=v;const B=(H,F)=>{const P=!(!H||!H.stroke),{distance:E=h[F].distance}=H,L=zo(e,E,e.dpr),I=E/M,k=F==="outerBorder"?1:-1;if(t.setAttributes({outerRadius:M+k*L,innerRadius:T-k*L,startAngle:w-k*I,endAngle:S+k*I}),e.beginPath(),vp(t,e,n,o,M+k*L,T-k*L),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,H,h[F]);else if(P){const D=h[F].opacity;h[F].opacity=y,e.setStrokeStyle(t,H,(_-n)/A,(R-o)/x,h[F]),h[F].opacity=D,e.stroke()}};p&&B(g,"outerBorder"),m&&B(f,"innerBorder"),t.setAttributes({outerRadius:M,innerRadius:T,startAngle:w,endAngle:S})}}const BE=new ME,PE=Xs,HE=Jr;class EE{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,o,r,s,l,a,h,d,u,c){const{outerBorder:g,innerBorder:f}=t.attribute,p=g&&g.visible!==!1,m=f&&f.visible!==!1;if(!p&&!m)return;const{radius:v=h.radius,startAngle:C=h.startAngle,endAngle:w=h.endAngle,opacity:S=h.opacity,x:y=h.x,y:_=h.y,scaleX:R=h.scaleX,scaleY:A=h.scaleY}=t.attribute,x=(T,M)=>{const B=!(!T||!T.stroke),{distance:H=h[M].distance}=T,F=zo(e,H,e.dpr),P=M==="outerBorder"?1:-1;if(e.beginPath(),e.arc(n,o,v+P*F,C,w),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,T,h[M]);else if(B){const E=h[M].opacity;h[M].opacity=S,e.setStrokeStyle(t,T,(y-n)/R,(_-o)/A,h[M]),h[M].opacity=E,e.stroke()}};p&&x(g,"outerBorder"),m&&x(f,"innerBorder")}}const kE=new EE,LE=Xs,FE=Jr;class IE extends ba{constructor(){super(...arguments),this.time=ge.beforeFillStroke}drawShape(t,e,n,o,r,s,l,a,h,d,u,c){const{background:g,backgroundMode:f=h.backgroundMode,backgroundFit:p=h.backgroundFit}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const m=t.resources.get(g);if(m.state!=="success"||!m.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const v=t.AABBBounds;this.doDrawImage(e,m.data,v,f,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=g,e.fill(),e.highPerformanceRestore()}}const DE=new IE,Ld=Be/2;function Jn(i,t,e,n,o,r,s){let l;if(n<0&&(t+=n,n=-n),o<0&&(e+=o,o=-o),ut(r,!0))l=[r=_e(r),r,r,r];else if(Array.isArray(r)){const _=r;let R,A;switch(_.length){case 0:l=[0,0,0,0];break;case 1:R=_e(_[0]),l=[R,R,R,R];break;case 2:case 3:R=_e(_[0]),A=_e(_[1]),l=[R,A,R,A];break;default:l=_,l[0]=_e(l[0]),l[1]=_e(l[1]),l[2]=_e(l[2]),l[3]=_e(l[3])}}else l=[0,0,0,0];if(n<0||l[0]+l[1]+l[2]+l[3]<1e-12)return i.rect(t,e,n,o);const[a,h,d,u]=[[t,e],[t+n,e],[t+n,e+o],[t,e+o]],c=Math.min(n/2,o/2),g=[Math.min(c,l[0]),Math.min(c,l[1]),Math.min(c,l[2]),Math.min(c,l[3])],f=[a[0]+g[0],a[1]],p=[a[0],a[1]+g[0]],m=[h[0]-g[1],h[1]],v=[h[0],h[1]+g[1]],C=[d[0]-g[2],d[1]],w=[d[0],d[1]-g[2]],S=[u[0]+g[3],u[1]],y=[u[0],u[1]-g[3]];if(i.moveTo(f[0],f[1]),s&&s[0]?s[0](f[0],f[1],m[0],m[1]):i.lineTo(m[0],m[1]),!Jl(m,v)){s&&s[0]&&i.moveTo(m[0],m[1]);const _=m[0],R=m[1]+g[1];i.arc(_,R,g[1],-Ld,0,!1)}if(s&&s[1]?s[1](v[0],v[1],w[0],w[1]):i.lineTo(w[0],w[1]),!Jl(C,w)){const _=w[0]-g[2],R=w[1];s&&s[1]&&i.moveTo(w[0],w[1]),i.arc(_,R,g[2],0,Ld,!1)}if(s&&s[2]?s[2](C[0],C[1],S[0],S[1]):i.lineTo(S[0],S[1]),!Jl(S,y)){const _=S[0],R=S[1]-g[3];s&&s[2]&&i.moveTo(S[0],S[1]),i.arc(_,R,g[3],Ld,Be,!1)}if(s&&s[3]?s[3](y[0],y[1],p[0],p[1]):i.lineTo(p[0],p[1]),!Jl(f,p)){const _=f[0],R=f[1]+g[0];s&&s[3]&&i.moveTo(p[0],p[1]),i.arc(_,R,g[0],Be,Be+Ld,!1)}return!s&&i.closePath(),i}var Zy=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};class Jy{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,o,r,s,l,a,h,d,u,c){const{outerBorder:g,innerBorder:f}=t.attribute,p=g&&g.visible!==!1,m=f&&f.visible!==!1;if(!p&&!m)return;const{cornerRadius:v=h.cornerRadius,opacity:C=h.opacity,x:w=h.x,y:S=h.y,scaleX:y=h.scaleX,scaleY:_=h.scaleY,x1:R,y1:A}=t.attribute;let{width:x,height:T}=t.attribute;x=(x??R-n)||0,T=(T??A-o)||0;const M=(B,H)=>{const F=!(!B||!B.stroke),P=H==="outerBorder"?-1:1,{distance:E=h[H].distance}=B,L=zo(e,E,e.dpr),I=n+P*L,k=o+P*L,D=2*L;if(v===0||ot(v)&&v.every(O=>O===0)?(e.beginPath(),e.rect(I,k,x-P*D,T-P*D)):(e.beginPath(),Jn(e,I,k,x-P*D,T-P*D,v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,B,h[H]);else if(F){const O=h[H].opacity;h[H].opacity=C,e.setStrokeStyle(t,B,(w-n)/y,(S-o)/_,h[H]),h[H].opacity=O,e.stroke()}};p&&M(g,"outerBorder"),m&&M(f,"innerBorder")}}let qs=class{constructor(){this.time=ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,o,r,s,l,a,h,d,u,c,g){const{stroke:f=h.stroke}=t.attribute;Array.isArray(f)&&f.some(p=>p===!1)&&(g.doStroke=!1)}};qs=Zy([wt()],qs);let Zs=class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,o,r,s,l,a,h,d,u,c){const{x1:g,y1:f,x:p=h.x,y:m=h.y,stroke:v=h.stroke,cornerRadius:C=h.cornerRadius}=t.attribute;let{width:w,height:S}=t.attribute;if(w=(w??g-p)||0,S=(S??f-m)||0,Array.isArray(v)&&v.some(y=>y===!1)){if(e.setStrokeStyle(t,t.attribute,n,o,h),!(C===0||ot(C)&&C.every(y=>y===0))){let y,_=0;return Jn(e,n,o,w,S,C,new Array(4).fill(0).map((R,A)=>(x,T,M,B)=>{v[A]&&(_===A-1&&v[A]===y||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:v[A]}),n,o,h),e.beginPath(),e.moveTo(x,T),y=v[A]),_=A,e.lineTo(M,B),e.stroke(),A===3&&e.beginPath())})),void e.stroke()}if(e.beginPath(),e.moveTo(n,o),v[0]?e.lineTo(n+w,o):e.moveTo(n+w,o),v[1]?e.lineTo(n+w,o+S):e.moveTo(n+w,o+S),v[2]?e.lineTo(n,o+S):e.moveTo(n,o+S),v[3]){const y=v[0]?o-e.lineWidth/2:o;e.lineTo(n,y)}else e.moveTo(n,o);e.stroke()}}};Zs=Zy([wt()],Zs);const OE=new Jy,zE=Xs,WE=Jr;class NE extends ba{constructor(){super(...arguments),this.time=ge.beforeFillStroke}drawShape(t,e,n,o,r,s,l,a,h,d,u,c){const{background:g,backgroundMode:f=h.backgroundMode,backgroundFit:p=h.backgroundFit}=t.attribute;if(g)if(t.backgroundImg){const m=t.resources.get(g);if(m.state!=="success"||!m.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const C=Ut(t.parent).group,{scrollX:w=C.scrollX,scrollY:S=C.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(w,S)}const v=t.AABBBounds;this.doDrawImage(e,m.data,v,f,p),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(ue(g)){const{stroke:m,fill:v,lineWidth:C=1,cornerRadius:w=0,expandX:S=0,expandY:y=0}=g;if(!m&&!v)return;e.beginPath();const{x:_,y:R,width:A,height:x}=VE(t);w?Jn(e,_-S,R-y,A+2*S,x+2*y,w):e.rect(_-S,R-y,A+2*S,x+2*y),e.globalAlpha=1,v&&(e.fillStyle=v,e.fill()),m&&C>0&&(e.lineWidth=C,e.strokeStyle=m,e.stroke())}else{e.beginPath();const m=t.AABBBounds;e.rect(n,o,m.width(),m.height()),e.fillStyle=g,e.globalAlpha=1,e.fill()}}}function VE(i){const t=ha(i.attribute.boundsPadding),e=i.AABBBounds;let n=e.x1,o=e.y1,r=e.width(),s=e.height();return ut(t)?(n+=t,o+=t,r-=2*t,s-=2*t):(n+=t[3],o+=t[0],r-=t[1]+t[3],s-=t[0]+t[2]),{x:n,y:o,width:r,height:s}}class jE extends Jy{constructor(){super(...arguments),this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,o,r,s,l,a,h,d,u,c){if(!(t.isGifImage&&t.renderFrame&&t.playing))return super.drawShape(t,e,n,o,r,s,l,a,h,d,u,c);t.renderFrame(e,n,o)}}const $E=new jE,GE=new NE;class UE{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,o,r,s,l,a,h,d,u,c){const g=t.getParsedPath();if(!g)return;const{outerBorder:f,innerBorder:p}=t.attribute,m=f&&f.visible!==!1,v=p&&p.visible!==!1;if(!m&&!v)return;const{size:C=h.size,opacity:w=h.opacity,x:S=h.x,y=h.y,scaleX:_=h.scaleX,scaleY:R=h.scaleY}=t.attribute,A=(x,T)=>{const M=!(!x||!x.stroke),{distance:B=h[T].distance}=x,H=zo(e,B,e.dpr),F=T==="outerBorder"?1:-1;if(e.beginPath(),g.drawOffset(e,C,n,o,F*H)===!1&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,x,h[T]);else if(M){const P=h[T].opacity;h[T].opacity=w,e.setStrokeStyle(t,x,(S-n)/_,(y-o)/R,h[T]),h[T].opacity=P,e.stroke()}};m&&A(f,"outerBorder"),v&&A(p,"innerBorder")}}const KE=new UE,YE=Xs,XE=Jr;class qE extends Mp{constructor(){super(...arguments),this.time=ge.afterFillStroke}drawShape(t,e,n,o,r,s,l,a,h,d,u,c,g){var f,p,m,v;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:C=t.attribute}=g||{},{texture:w=(f=t.attribute.texture)!==null&&f!==void 0?f:yd(h,"texture"),textureColor:S=(p=t.attribute.textureColor)!==null&&p!==void 0?p:yd(h,"textureColor"),textureSize:y=(m=t.attribute.textureSize)!==null&&m!==void 0?m:yd(h,"textureSize"),texturePadding:_=(v=t.attribute.texturePadding)!==null&&v!==void 0?v:yd(h,"texturePadding")}=C;w&&this.drawTexture(w,t,e,n,o,h,S,y,_)}}var ZE=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},JE=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},Qy=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Fd=class extends Qi{constructor(i){super(),this.arcRenderContribitions=i,this.numberType=Ad,this.builtinContributions=[BE,HE,PE],this.init(i)}drawArcTailCapPath(i,t,e,n,o,r,s,l){const a=l-s,h=i.getParsedAngle(),d=h.startAngle;let u=h.endAngle;u=l;const c=u>d;let g=!1;if(o<r){const L=o;o=r,r=L}const{outerDeltaAngle:f,xors:p,yors:m,xirs:v,yirs:C,limitedOcr:w,outerCornerRadiusStart:S,outerCornerRadiusEnd:y,maxOuterCornerRadius:_,xore:R,yore:A,xire:x,yire:T,limitedIcr:M,innerDeltaAngle:B,innerStartAngle:H,innerCornerRadiusStart:F,innerCornerRadiusEnd:P,maxInnerCornerRadius:E}=Uy(i,d,u,r,o);if(w>Le){const L=Fi(S,w),I=Fi(y,w),k=gr(v,C,p,m,o,L,Number(c)),D=gr(R,A,x,T,o,I,Number(c));if(w<_&&L===I)t.moveTo(e+k.cx+k.x01,n+k.cy+k.y01),t.arc(e+k.cx,n+k.cy,w,Ce(k.y01,k.x01),Ce(D.y01,D.x01),!c);else{const O=u-a-.03,N=Ce(D.y11,D.x11);t.arc(e,n,o,O,N,!c),I>0&&t.arc(e+D.cx,n+D.cy,I,Ce(D.y11,D.x11),Ce(D.y01,D.x01),!c)}}else t.moveTo(e+p,n+m);if(!(r>Le)||B<.001)t.lineTo(e+x,n+T),g=!0;else if(M>Le){const L=Fi(F,M),I=Fi(P,M),k=gr(x,T,R,A,r,-I,Number(c)),D=gr(p,m,v,C,r,-L,Number(c));if(t.lineTo(e+k.cx+k.x01,n+k.cy+k.y01),M<E&&L===I){const O=Ce(D.y01,D.x01);t.arc(e+k.cx,n+k.cy,M,Ce(k.y01,k.x01),O,!c)}else{I>0&&t.arc(e+k.cx,n+k.cy,I,Ce(k.y01,k.x01),Ce(k.y11,k.x11),!c);const O=Ce(k.cy+k.y11,k.cx+k.x11),N=u-a-.03;t.arc(e,n,r,O,N,c)}}else t.lineTo(e+r*ii(H),n+r*We(H));return g}drawShape(i,t,e,n,o,r,s,l){const a=Ut(i,r==null?void 0:r.theme).arc,{fill:h=a.fill,stroke:d=a.stroke,x:u=a.x,y:c=a.y,fillStrokeOrder:g=a.fillStrokeOrder}=i.attribute,f=this.valid(i,a,s,l);if(!f)return;const{fVisible:p,sVisible:m,doFill:v,doStroke:C}=f,{outerPadding:w=a.outerPadding,innerPadding:S=a.innerPadding,cap:y=a.cap,forceShowCap:_=a.forceShowCap}=i.attribute;let{outerRadius:R=a.outerRadius,innerRadius:A=a.innerRadius}=i.attribute;R+=w,A-=S;let x=0;const T=(ci(y)&&y||y[0])&&h.gradient==="conical";if(T){const{sc:F,startAngle:P,endAngle:E}=i.getParsedAngle();_e(E-P)<ce-Le&&(x=F||0,h.startAngle-=x,h.endAngle-=x)}let M=!1;const{isFullStroke:B,stroke:H}=HH(d);if(v||B){t.beginPath(),vp(i,t,e,n,R,A),M=!0,t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,a),this.beforeRenderStep(i,t,e,n,v,C,p,m,a,o,s,l);const F=()=>{v&&(s?s(t,i.attribute,a):p&&(t.setCommonStyle(i,i.attribute,u-e,c-n,a),t.fill()))},P=()=>{C&&B&&(l?l(t,i.attribute,a):m&&(t.setStrokeStyle(i,i.attribute,u-e,c-n,a),t.stroke()))};g?(P(),F()):(F(),P())}if(!B&&C&&(t.beginPath(),vp(i,t,e,n,R,A,H),M||this.beforeRenderStep(i,t,e,n,v,C,p,m,a,o,s,l),l?l(t,i.attribute,a):m&&(t.setStrokeStyle(i,i.attribute,e,n,a),t.stroke())),(ci(y)&&y||y[1])&&_){const{startAngle:F,endAngle:P}=i.getParsedAngle();if(_e(P-F)>=ce-Le){t.beginPath();const E=Math.abs(R-A)/2/R,{endAngle:L=a.endAngle,fill:I=a.fill}=i.attribute,k=L;this.drawArcTailCapPath(i,t,e,n,R,A,k,k+E),M||this.beforeRenderStep(i,t,e,n,v,C,p,m,a,o,s,l);const D=()=>{if(v){const N=I;if(N.gradient==="conical"){const W=hE(0,0,L,N);s||Yr&&(t.setCommonStyle(i,i.attribute,e,n,a),t.fillStyle=W,t.fill())}}},O=()=>{C&&(l||m&&(t.setStrokeStyle(i,i.attribute,e,n,a),t.stroke()))};D(),O()}}this.afterRenderStep(i,t,e,n,v,C,p,m,a,o,s,l),T&&(h.startAngle+=x,h.endAngle+=x)}draw(i,t,e,n){const o=Ut(i,n==null?void 0:n.theme).arc;this._draw(i,o,!1,e,n)}};Fd=ZE([wt(),Qy(0,re(ei)),Qy(0,ui(bp)),JE("design:paramtypes",[Object])],Fd);var QE=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},tk=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},t_=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Id=class extends Qi{constructor(i){super(),this.circleRenderContribitions=i,this.numberType=Rd,this.builtinContributions=[kE,FE,LE],this.init(i)}drawShape(i,t,e,n,o,r,s,l){const a=Ut(i,r==null?void 0:r.theme).circle,{radius:h=a.radius,startAngle:d=a.startAngle,endAngle:u=a.endAngle,x:c=a.x,y:g=a.y,fillStrokeOrder:f=a.fillStrokeOrder}=i.attribute,p=this.valid(i,a,s,l);if(!p)return;const{fVisible:m,sVisible:v,doFill:C,doStroke:w}=p;t.beginPath(),t.arc(e,n,h,d,u),t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,a),this.beforeRenderStep(i,t,e,n,C,w,m,v,a,o,s,l);const S=()=>{C&&(s?s(t,i.attribute,a):m&&(t.setCommonStyle(i,i.attribute,c-e,g-n,a),t.fill()))},y=()=>{w&&(l?l(t,i.attribute,a):v&&(t.setStrokeStyle(i,i.attribute,c-e,g-n,a),t.stroke()))};f?(y(),S()):(S(),y()),this.afterRenderStep(i,t,e,n,C,w,m,v,a,o,s,l)}draw(i,t,e,n){const o=Ut(i,n==null?void 0:n.theme).circle;this._draw(i,o,!1,e,n)}};Id=QE([wt(),t_(0,re(ei)),t_(0,ui(Cp)),tk("design:paramtypes",[Object])],Id);function Dd(i,t,e,n){if(!t.p1)return;const{offsetX:o=0,offsetY:r=0,offsetZ:s=0}=n||{};if(e===1)t.p2&&t.p3?i.bezierCurveTo(o+t.p1.x,r+t.p1.y,o+t.p2.x,r+t.p2.y,o+t.p3.x,r+t.p3.y,s):i.lineTo(o+t.p1.x,r+t.p1.y,s);else if(t.p2&&t.p3){const[l]=Gf(t,e);i.bezierCurveTo(o+l.p1.x,r+l.p1.y,o+l.p2.x,r+l.p2.y,o+l.p3.x,r+l.p3.y,s)}else{const l=t.getPointAt(e);i.lineTo(o+l.x,r+l.y,s)}}function e_(i,t,e,n,o,r,s){var l;let a=t.p0,h=n;if(e&&e.originP1===e.originP2&&(a=e.p0),t.defined)n||(i.lineTo(a.x+o,a.y+r,s),h=!n);else{const{originP1:d,originP2:u}=t;let c;if(d&&d.defined!==!1?c=a:d&&u.defined!==!1&&(c=(l=t.p3)!==null&&l!==void 0?l:t.p1),n){h=!n;const g=c?c.x:t.p0.x,f=c?c.y:t.p0.y;i.moveTo(g+o,f+r,s)}else c&&(h=!n,i.lineTo(c.x+o,c.y+r,s))}return h}function Bp(i,t,e,n,o){const{offsetX:r=0,offsetY:s=0,offsetZ:l=0,mode:a="none",drawConnect:h=!1}=o||{};if(h&&a==="none"||!t)return;let d=!0;const{curves:u}=t;if(e>=1){if(h){let v,C=!0;u.forEach((w,S)=>{w.originP1!==w.originP2&&(C=e_(i,w,v,C,r,s,l)),v=w})}else u.forEach(v=>{v.defined?(d&&i.moveTo(v.p0.x+r,v.p0.y+s,l),Dd(i,v,1,o),d=!1):d=!0});return}if(e<=0)return;let c;n==="x"?c=He.ROW:n==="y"?c=He.COLUMN:n==="auto"&&(c=t.direction);const g=e*t.tryUpdateLength(c);let f=0,p=!0,m=null;for(let v=0,C=u.length;v<C;v++){const w=u[v],S=w.getLength(c),y=(g-f)/S;if(f+=S,y<0)break;if(h){if(w.originP1===w.originP2){m=w;continue}p=e_(i,w,m,p,r,s,l),m=w}else{if(!w.defined){d=!0;continue}d&&i.moveTo(w.p0.x+r,w.p0.y+s,l),Dd(i,w,Fi(y,1),o),d=!1}}}function ek(i,t,e,n){const{offsetX:o=0,offsetY:r=0}=n||{},s=t?t.points[t.points.length-1]:e.points[0];i.moveTo(s.x+o,s.y+r),e.points.forEach(l=>{l.defined!==!1?i.lineTo(l.x+o,l.y+r):i.moveTo(l.x+o,l.y+r)})}function ik(i,t,e,n){const{offsetX:o=0,offsetY:r=0}=n||{},{points:s}=e,l=[];for(let a=0;a<s.length;a++)s[a].defined;l.push(s),l.forEach((a,h)=>{var d,u,c,g;const f=t&&h===0?t.points[t.points.length-1]:a[0];i.moveTo(f.x+o,f.y+r),a.forEach(p=>{p.defined!==!1?i.lineTo(p.x+o,p.y+r):i.moveTo(p.x+o,p.y+r)});for(let p=a.length-1;p>=0;p--){const m=a[p];i.lineTo((d=m.x1)!==null&&d!==void 0?d:m.x,(u=m.y1)!==null&&u!==void 0?u:m.y)}i.lineTo((c=f.x1)!==null&&c!==void 0?c:f.x,(g=f.y1)!==null&&g!==void 0?g:f.y),i.closePath()})}var nk=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let Ca=class extends Qi{constructor(){super(...arguments),this.numberType=ca}draw(i,t,e,n){const o=Ut(i,n==null?void 0:n.theme).line;this._draw(i,o,!1,e,n)}drawSegmentItem(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){var p,m,v,C,w;if(!t)return;i.beginPath();const S=(p=this.z)!==null&&p!==void 0?p:0;Bp(i.camera?i:i.nativeContext,t,a,h,{offsetX:d,offsetY:u,offsetZ:S}),c.cache&&!ot(c.cache)&&c.cache.curves.every(M=>M.defined)&&c.attribute.curveType&&c.attribute.curveType.includes("Closed")&&i.closePath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(c,s,l);const{x:y=0,x:_=0}=s;e!==!1&&(g?g(i,s,l):o&&(i.setCommonStyle(c,s,y-d,_-u,l),i.fill())),n!==!1&&(f?f(i,s,l):r&&(i.setStrokeStyle(c,s,y-d,_-u,l),i.stroke()));let{connectedType:R,connectedX:A,connectedY:x,connectedStyle:T}=s;if(ot(l)?(R=(m=R??l[0].connectedType)!==null&&m!==void 0?m:l[1].connectedType,A=(v=A??l[0].connectedX)!==null&&v!==void 0?v:l[1].connectedX,x=(C=x??l[0].connectedY)!==null&&C!==void 0?C:l[1].connectedY,T=(w=T??l[0].connectedStyle)!==null&&w!==void 0?w:l[1].connectedStyle):(R=R??l.connectedType,A=A??l.connectedX,x=x??l.connectedY,T=T??l.connectedStyle),R!=="connect"&&R!=="zero"&&(R="none"),R!=="none"){i.beginPath(),Bp(i.camera?i:i.nativeContext,t,a,h,{offsetX:d,offsetY:u,offsetZ:S,drawConnect:!0,mode:R,zeroX:A,zeroY:x});const M=[];ot(l)?l.forEach(B=>M.push(B)):M.push(l),M.push(s),e!==!1&&(g?g(i,s,l):o&&(i.setCommonStyle(c,T,y-d,_-u,M),i.fill())),n!==!1&&(f?f(i,s,l):r&&(i.setStrokeStyle(c,T,y-d,_-u,M),i.stroke()))}return!1}drawLinearLineHighPerformance(i,t,e,n,o,r,s,l,a,h,d,u,c){var g;t.beginPath();const f=(g=this.z)!==null&&g!==void 0?g:0,{points:p}=i.attribute,m=p[0];t.moveTo(m.x+s,m.y+l,f);for(let w=1;w<p.length;w++){const S=p[w];t.lineTo(S.x+s,S.y+l,f)}t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,a);const{x:v=0,x:C=0}=i.attribute;e!==!1&&(u?u(t,i.attribute,a):o&&(t.setCommonStyle(i,i.attribute,v-s,C-l,a),t.fill())),n!==!1&&(c?c(t,i.attribute,a):r&&(t.setStrokeStyle(i,i.attribute,v-s,C-l,a),t.stroke()))}drawShape(i,t,e,n,o,r,s,l){const a=Ut(i,r==null?void 0:r.theme).line,{fill:h=a.fill,stroke:d=a.stroke,fillOpacity:u=a.fillOpacity,strokeOpacity:c=a.strokeOpacity,segments:g,points:f,closePath:p,curveTension:m=a.curveTension}=i.attribute;if(!this.valid(i,a,s,l))return;let{curveType:v=a.curveType}=i.attribute;p&&v==="linear"&&(v="linearClosed");const{clipRange:C=a.clipRange,clipRangeByDimension:w=a.clipRangeByDimension}=i.attribute;if(C===1&&!g&&!f.some(S=>S.defined===!1)&&v==="linear")return this.drawLinearLineHighPerformance(i,t,!!h,!!d,u,c,e,n,a,o,r,s,l);if(i.shouldUpdateShape()){const{points:S,segments:y}=i.attribute,_=S;if(y&&y.length){let R,A;if(i.cache=y.map((x,T)=>{if(x.points.length<=1&&T===0)return x.points[0]&&(A={endX:x.points[0].x,endY:x.points[0].y,curves:[{defined:x.points[0].defined!==!1}]}),null;T===1?R={x:A.endX,y:A.endY,defined:A.curves[A.curves.length-1].defined}:T>1&&(R.x=A.endX,R.y=A.endY,R.defined=A.curves[A.curves.length-1].defined);const M=Gr(x.points,v,{startPoint:R,curveTension:m});return A=M,M}).filter(x=>!!x),v==="linearClosed"){let x;for(let T=0;T<i.cache.length;T++){const M=i.cache[T];for(let B=0;B<M.curves.length;B++)if(M.curves[B].defined){x=M.curves[B].p0;break}if(x)break}i.cache[i.cache.length-1]&&i.cache[i.cache.length-1].lineTo(x.x,x.y,!0)}}else{if(!S||!S.length)return i.cache=null,void i.clearUpdateShapeTag();i.cache=Gr(_,v,{curveTension:m})}i.clearUpdateShapeTag()}if(Array.isArray(i.cache)){const S=i.attribute.segments.filter(y=>y.points.length);if(S[0].points.length===1&&S.shift(),C===1){let y=!1;i.cache.forEach((_,R)=>{y||(y=this.drawSegmentItem(t,_,!!h,!!d,u,c,S[R],[a,i.attribute],C,w,e,n,i,s,l))})}else{const y=i.cache.reduce((x,T)=>x+T.getLength(),0),_=C*y;let R=0,A=!1;i.cache.forEach((x,T)=>{if(A)return;const M=x.getLength(),B=(_-R)/M;R+=M,B>0&&(A=this.drawSegmentItem(t,x,!!h,!!d,u,c,S[T],[a,i.attribute],Fi(B,1),w,e,n,i,s,l))})}}else this.drawSegmentItem(t,i.cache,!!h,!!d,u,c,i.attribute,a,C,w,e,n,i,s,l)}};Ca=nk([wt()],Ca);function ok(i,t,e,n){var o;const{drawConnect:r=!1,mode:s="none"}=n||{};if(r&&s==="none")return;const{top:l,bottom:a}=t;if(l.curves.length!==a.curves.length)return;if(e>=1){const _=[],R=[];let A=!0;if(r){let x,T,M=!0;const B=l.curves.length;l.curves.forEach((H,F)=>{const P=a.curves[B-F-1];let E=H,L=P;if(H.originP1===H.originP2)return x=H,void(T=P);if(x&&x.originP1===x.originP2&&(E=x,L=T),H.defined)M||(_.push(E),R.push(L),Js(i,_,R,n),_.length=0,R.length=0,M=!M);else{const{originP1:I,originP2:k}=H;let D,O;I&&I.defined!==!1?(D=E,O=L):I&&k.defined!==!1&&(D=H,O=P),M?(M=!M,_.push(D||H),R.push(O||P)):D&&(M=!M,_.push(D||H),R.push(O||P),Js(i,_,R,n),_.length=0,R.length=0)}x=H}),Js(i,_,R,n)}else{for(let x=0,T=l.curves.length;x<T;x++){const M=l.curves[x];A!==M.defined?(A?(Od(i,_,R,n),_.length=0,R.length=0):(_.push(M),R.push(a.curves[T-x-1])),A=!A):A&&(_.push(M),R.push(a.curves[T-x-1]))}Od(i,_,R,n)}return}if(e<=0)return;let{direction:h}=n||{};const{curves:d}=l,u=(o=d[d.length-1].p3)!==null&&o!==void 0?o:d[d.length-1].p1,c=_e(u.x-d[0].p0.x),g=_e(u.y-d[0].p0.y);h=h??(c>g?He.ROW:He.COLUMN),Number.isFinite(c)||(h=He.COLUMN),Number.isFinite(g)||(h=He.ROW);const f=e*(h===He.ROW?c:g);let p=0,m=!0;const v=[],C=[];let w,S,y=!0;for(let _=0,R=l.curves.length;_<R;_++){const A=l.curves[_],x=A.getLength(h),T=(f-p)/x;if(T<0)break;if(p+=x,r){const M=a.curves[R-_-1];let B=A,H=M;if(A.originP1===A.originP2){w=A,S=M;continue}if(w&&w.originP1===w.originP2&&(B=w,H=S),A.defined)y||(v.push(B),C.push(H),Js(i,v,C,n),v.length=0,C.length=0,y=!y);else{const{originP1:F,originP2:P}=A;let E,L;F&&F.defined!==!1?(E=B,L=H):F&&P.defined!==!1&&(E=A,L=M),y?(y=!y,v.push(E||A),C.push(L||M)):E&&(y=!y,v.push(E||A),C.push(L||M),Js(i,v,C,n),v.length=0,C.length=0)}w=A}else{let M=null,B=null;m!==A.defined?(m?(Od(i,v,C,n),v.length=0,C.length=0):(M=A,B=a.curves[R-_-1]),m=!m):m&&(M=A,B=a.curves[R-_-1]),M&&B&&(T<1&&(M=M.p2&&M.p3?Gf(M,T)[0]:GC(M,T)[0],B=B.p2&&B.p3?Gf(B,1-T)[1]:GC(B,1-T)[1]),M.defined=m,B.defined=m,v.push(M),C.push(B)),M=null,B=null}}r?Js(i,v,C,n):Od(i,v,C,n)}function Js(i,t,e,n){if(t.length<2)return;const{offsetX:o=0,offsetY:r=0,offsetZ:s=0,mode:l}=n||{};let a=t[0];i.moveTo(a.p0.x+o,a.p0.y+r,s),a=t[t.length-1];let h=a.p3||a.p1;i.lineTo(h.x+o,h.y+r,s),a=e[e.length-1],i.lineTo(a.p0.x+o,a.p0.y+r,s),a=e[0],h=a.p3||a.p1,i.lineTo(h.x+o,h.y+r,s),i.closePath()}function Od(i,t,e,n){const{offsetX:o=0,offsetY:r=0,offsetZ:s=0}=n||{};let l=!0;t.forEach(a=>{a.defined?(l&&i.moveTo(a.p0.x+o,a.p0.y+r,s),Dd(i,a,1,n),l=!1):l=!0}),l=!0;for(let a=e.length-1;a>=0;a--){const h=e[a];h.defined?(l&&i.lineTo(h.p0.x+o,h.p0.y+r,s),Dd(i,h,1,n),l=!1):l=!0}i.closePath()}const rk=new qE,sk=Jr;var lk=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},ak=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},i_=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Pp=class extends Qi{constructor(i){super(),this.areaRenderContribitions=i,this.numberType=Iy,this.builtinContributions=[rk,sk],this.init(i)}drawLinearAreaHighPerformance(i,t,e,n,o,r,s,l,a,h,d,u,c){var g,f,p;const{points:m}=i.attribute;if(m.length<2)return;t.beginPath();const v=(g=this.z)!==null&&g!==void 0?g:0,C=m[0];t.moveTo(C.x+s,C.y+l,v);for(let y=1;y<m.length;y++){const _=m[y];t.lineTo(_.x+s,_.y+l,v)}for(let y=m.length-1;y>=0;y--){const _=m[y];t.lineTo(((f=_.x1)!==null&&f!==void 0?f:_.x)+s,((p=_.y1)!==null&&p!==void 0?p:_.y)+l,v)}t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,a),this.beforeRenderStep(i,t,s,l,!!o,!1,e,!1,a,h,u,null,{attribute:i.attribute});const{x:w=0,x:S=0}=i.attribute;e!==!1&&(u?u(t,i.attribute,a):o&&(t.setCommonStyle(i,i.attribute,w-s,S-l,a),t.fill())),this.afterRenderStep(i,t,s,l,!!o,!1,e,!1,a,h,u,null,{attribute:i.attribute}),(()=>{var y,_;if(n){const{stroke:R=a&&a.stroke}=i.attribute;if(ot(R)&&(R[0]||R[2])&&R[1]===!1){if(t.beginPath(),R[0]){t.moveTo(C.x+s,C.y+l,v);for(let A=1;A<m.length;A++){const x=m[A];t.lineTo(x.x+s,x.y+l,v)}}else if(R[2]){const A=m[m.length-1];t.moveTo(A.x+s,A.y+l,v);for(let x=m.length-2;x>=0;x--){const T=m[x];t.lineTo(((y=T.x1)!==null&&y!==void 0?y:T.x)+s,((_=T.y1)!==null&&_!==void 0?_:T.y)+l,v)}}}c?c(t,i.attribute,a):(t.setStrokeStyle(i,i.attribute,w-s,S-l,a),t.stroke())}})()}drawShape(i,t,e,n,o,r,s,l){var a,h,d,u,c,g;const f=Ut(i,r==null?void 0:r.theme).area,{fill:p=f.fill,stroke:m=f.stroke,fillOpacity:v=f.fillOpacity,z:C=f.z,strokeOpacity:w=f.strokeOpacity,curveTension:S=f.curveTension}=i.attribute,y=this.valid(i,f,s,l);if(!y)return;const{doFill:_}=y,R=y.doStroke&&y.sVisible,{clipRange:A=f.clipRange,closePath:x,points:T,segments:M}=i.attribute;let{curveType:B=f.curveType}=i.attribute;if(x&&B==="linear"&&(B="linearClosed"),A===1&&!M&&!T.some(H=>H.defined===!1)&&B==="linear")return this.drawLinearAreaHighPerformance(i,t,!!p,R,v,w,e,n,f,o,r,s,l);if(i.shouldUpdateShape()){if(M&&M.length){let H,F;const P=M.map((I,k)=>{if(I.points.length<=1&&k===0)return I.points[0]&&(F={endX:I.points[0].x,endY:I.points[0].y}),null;k===1?H={x:F.endX,y:F.endY}:k>1&&(H.x=F.endX,H.y=F.endY);const D=Gr(I.points,B,{startPoint:H,curveTension:S});return F=D,D}).filter(I=>!!I);let E;const L=[];for(let I=M.length-1;I>=0;I--){const k=M[I].points,D=[];for(let O=k.length-1;O>=0;O--)D.push({x:(a=k[O].x1)!==null&&a!==void 0?a:k[O].x,y:(h=k[O].y1)!==null&&h!==void 0?h:k[O].y});if(I!==0){const O=M[I-1].points,N=O[O.length-1];N&&D.push({x:(d=N.x1)!==null&&d!==void 0?d:N.x,y:(u=N.y1)!==null&&u!==void 0?u:N.y})}D.length>1&&(E=Gr(D,B==="stepBefore"?"stepAfter":B==="stepAfter"?"stepBefore":B,{curveTension:S}),L.unshift(E))}i.cacheArea=L.map((I,k)=>({top:P[k],bottom:I}))}else{if(!T||!T.length)return i.cacheArea=null,void i.clearUpdateShapeTag();{const H=T,F=[];for(let L=T.length-1;L>=0;L--)F.push({x:(c=T[L].x1)!==null&&c!==void 0?c:T[L].x,y:(g=T[L].y1)!==null&&g!==void 0?g:T[L].y});const P=Gr(H,B,{curveTension:S}),E=Gr(F,B==="stepBefore"?"stepAfter":B==="stepAfter"?"stepBefore":B,{curveTension:S});i.cacheArea={top:P,bottom:E}}}i.clearUpdateShapeTag()}if(Array.isArray(i.cacheArea)){const H=i.attribute.segments.filter(F=>F.points.length);if(H[0].points.length===1&&H.shift(),A===1){let F=!1;i.cacheArea.forEach((P,E)=>{F||(F=this.drawSegmentItem(t,P,_,v,R,w,H[E],[f,i.attribute],A,e,n,C,i,o,s,l))})}else{const F=i.cacheArea.reduce((I,k)=>I+k.top.getLength(),0),P=A*F;let E=0,L=!1;i.cacheArea.forEach((I,k)=>{if(L)return;const D=I.top.getLength(),O=(P-E)/D;E+=D,O>0&&(L=this.drawSegmentItem(t,I,_,v,R,w,H[k],[f,i.attribute],Fi(O,1),e,n,C,i,o,s,l))})}}else this.drawSegmentItem(t,i.cacheArea,_,v,R,w,i.attribute,f,A,e,n,C,i,o,s,l)}draw(i,t,e,n){const o=Ut(i,n==null?void 0:n.theme).area;this._draw(i,o,!1,e,n)}drawSegmentItem(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p){let m=!1;return m=m||this._drawSegmentItem(i,t,e,n,o,r,s,l,a,h,d,u,c,g,!1,f,p),m=m||this._drawSegmentItem(i,t,e,n,o,r,s,l,a,h,d,u,c,g,!0,f,p),m}_drawSegmentItem(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m){var v,C,w,S;if(!(t&&t.top&&t.bottom&&t.top.curves&&t.top.curves.length&&t.bottom.curves&&t.bottom.curves.length))return;let{connectedType:y,connectedX:_,connectedY:R,connectedStyle:A}=s;const x=[];if(f&&(ot(l)?(y=(v=y??l[0].connectedType)!==null&&v!==void 0?v:l[1].connectedType,_=(C=_??l[0].connectedX)!==null&&C!==void 0?C:l[1].connectedX,R=(w=R??l[0].connectedY)!==null&&w!==void 0?w:l[1].connectedY,A=(S=A??l[0].connectedStyle)!==null&&S!==void 0?S:l[1].connectedStyle):(y=y??l.connectedType,_=_??l.connectedX,R=R??l.connectedY,A=A??l.connectedStyle),y!=="connect"&&y!=="zero"&&(y="none"),ot(l)?l.forEach(k=>x.push(k)):x.push(l),x.push(s)),f&&y==="none")return!1;i.beginPath();const{points:T,segments:M}=c.attribute;let B,H,F=He.ROW;if(M){const k=M[M.length-1];H=M[0].points[0],B=k.points[k.points.length-1]}else H=T[0],B=T[T.length-1];const P=_e(B.x-H.x),E=_e(B.y-H.y);F=B.x1==null?He.ROW:B.y1==null?He.COLUMN:Number.isFinite(P+E)?P>E?He.ROW:He.COLUMN:He.ROW,ok(i.camera?i:i.nativeContext,t,a,{offsetX:h,offsetY:d,offsetZ:u,direction:F,drawConnect:f,mode:y,zeroX:_,zeroY:R}),this.beforeRenderStep(c,i,h,d,!!n,!1,e,!1,l,g,p,null,{attribute:s}),i.setShadowBlendStyle&&i.setShadowBlendStyle(c,s,l);const{x:L=0,x:I=0}=s;return e!==!1&&(p?p(i,s,l):n&&(i.setCommonStyle(c,f?A:s,L-h,I-d,f?x:l),i.fill())),this.afterRenderStep(c,i,h,d,!!n,!1,e,!1,l,g,p,null,{attribute:s}),(()=>{if(o!==!1)if(m)m(i,s,l);else{const{stroke:k=l&&l[1]&&l[1].stroke}=s;ot(k)&&(k[0]||k[2])&&k[1]===!1&&(i.beginPath(),Bp(i.camera?i:i.nativeContext,k[0]?t.top:t.bottom,a,F===He.ROW?"x":"y",{offsetX:h,offsetY:d,offsetZ:u,drawConnect:f,mode:y,zeroX:_,zeroY:R})),i.setStrokeStyle(c,f?A:s,L-h,I-d,f?x:l),i.stroke()}})(),!1}};Pp=lk([wt(),i_(0,re(ei)),i_(0,ui(uE)),ak("design:paramtypes",[Object])],Pp);const hk=Xs,dk=Jr;var uk=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},ck=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},n_=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let zd=class extends Qi{constructor(i){super(),this.pathRenderContribitions=i,this.numberType=Md,this.builtinContributions=[dk,hk],this.init(i)}drawShape(i,t,e,n,o,r,s,l){var a,h,d;const u=(a=this.tempTheme)!==null&&a!==void 0?a:Ut(i,r==null?void 0:r.theme).path,{x:c=u.x,y:g=u.y,fillStrokeOrder:f=u.fillStrokeOrder}=i.attribute,p=(h=this.z)!==null&&h!==void 0?h:0,m=this.valid(i,u,s,l);if(!m)return;const{fVisible:v,sVisible:C,doFill:w,doStroke:S}=m;if(t.beginPath(),i.pathShape)hr(i.pathShape.commandList,t,e,n,1,1,p);else{const R=(d=i.attribute.path)!==null&&d!==void 0?d:u.path;hr(R.commandList,t,e,n,1,1,p)}t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,u),this.beforeRenderStep(i,t,e,n,w,S,v,C,u,o,s,l);const y=()=>{S&&(l?l(t,i.attribute,u):C&&(t.setStrokeStyle(i,i.attribute,c-e,g-n,u),t.stroke()))},_=()=>{w&&(s?s(t,i.attribute,u):v&&(t.setCommonStyle(i,i.attribute,c-e,g-n,u),t.fill()))};f?(y(),_()):(_(),y()),this.afterRenderStep(i,t,e,n,w,S,v,C,u,o,s,l)}draw(i,t,e,n){const o=Ut(i,n==null?void 0:n.theme).path;this.tempTheme=o,this._draw(i,o,!1,e,n),this.tempTheme=null}};zd=uk([wt(),n_(0,re(ei)),n_(0,ui(yp)),ck("design:paramtypes",[Object])],zd);var gk=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},fk=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},o_=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Wd=class extends Qi{constructor(i){super(),this.rectRenderContribitions=i,this.type="rect",this.numberType=gp,this.builtinContributions=[OE,WE,zE],this.init(i)}drawShape(i,t,e,n,o,r,s,l){var a;const h=(a=this.tempTheme)!==null&&a!==void 0?a:Ut(i,r==null?void 0:r.theme).rect,{fill:d=h.fill,background:u,stroke:c=h.stroke,cornerRadius:g=h.cornerRadius,opacity:f=h.opacity,fillOpacity:p=h.fillOpacity,lineWidth:m=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:C=h.visible,x1:w,y1:S,x:y=h.x,y:_=h.y,fillStrokeOrder:R=h.fillStrokeOrder}=i.attribute;let{width:A,height:x}=i.attribute;A=(A??w-y)||0,x=(x??S-_)||0;const T=$y(f,p,A,x,d),M=Gy(f,v,A,x),B=Ks(d,u),H=pa(c,m);if(!i.valid||!C||!B&&!H||!(T||M||s||l||u))return;g===0||ot(g)&&g.every(L=>L===0)?(t.beginPath(),t.rect(e,n,A,x)):(t.beginPath(),Jn(t,e,n,A,x,g));const F={doFill:B,doStroke:H};t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,h),this.beforeRenderStep(i,t,e,n,B,H,T,M,h,o,s,l,F);const P=()=>{F.doFill&&(s?s(t,i.attribute,h):T&&(t.setCommonStyle(i,i.attribute,y-e,_-n,h),t.fill()))},E=()=>{F.doStroke&&(l?l(t,i.attribute,h):M&&(t.setStrokeStyle(i,i.attribute,y-e,_-n,h),t.stroke()))};R?(E(),P()):(P(),E()),this.afterRenderStep(i,t,e,n,B,H,T,M,h,o,s,l)}draw(i,t,e,n){const o=Ut(i,n==null?void 0:n.theme).rect;this.tempTheme=o,this._draw(i,o,!1,e,n),this.tempTheme=null}};Wd=gk([wt(),o_(0,re(ei)),o_(0,ui(Zr)),fk("design:paramtypes",[Object])],Wd);var pk=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},mk=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},r_=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Nd=class extends Qi{constructor(i){super(),this.symbolRenderContribitions=i,this.numberType=Pd,this.builtinContributions=[KE,XE,YE],this.init(i)}drawShape(i,t,e,n,o,r,s,l){var a;const h=Ut(i,r==null?void 0:r.theme).symbol,{size:d=h.size,x:u=h.x,y:c=h.y,scaleX:g=h.scaleX,scaleY:f=h.scaleY,fillStrokeOrder:p=h.fillStrokeOrder}=i.attribute,m=this.valid(i,h,s,l);if(!m)return;const{fVisible:v,sVisible:C,doFill:w,doStroke:S}=m,y=i.getParsedPath();if(!y)return;const{keepDirIn3d:_=h.keepDirIn3d}=i.attribute,R=(a=this.z)!==null&&a!==void 0?a:0;t.beginPath();const A=(M,B)=>{var H,F,P;if(i._parsedPath.svgCache){const I=Object.assign({},B);I.fill=(H=B.fill)!==null&&H!==void 0?H:i.attribute.fill,I.opacity=(F=B.opacity)!==null&&F!==void 0?F:i.attribute.opacity,I.fillOpacity=i.attribute.fillOpacity,I.stroke=(P=B.stroke)!==null&&P!==void 0?P:i.attribute.stroke,B=I}const E=()=>{B.fill&&(s?s(t,i.attribute,h):(t.setCommonStyle(i,B,u-e,c-n,h),t.fill()))},L=()=>{B.stroke&&(l?l(t,i.attribute,h):(t.setStrokeStyle(i,B,(u-e)/g,(c-n)/f,h),t.stroke()))};p?(L(),E()):(E(),L())};if(_&&t.camera&&t.project){const M=t.project(e,n,R),B=t.camera;t.camera=null,y.draw(t,ot(d)?[d[0]*g,d[1]*f]:d*g,M.x,M.y,void 0,A)===!1&&t.closePath(),t.camera=B}else y.draw(t,d,e,n,R,A)===!1&&t.closePath();t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,h),this.beforeRenderStep(i,t,e,n,w,S,v,C,h,o,s,l);const x=()=>{w&&!y.isSvg&&(s?s(t,i.attribute,h):v&&(t.setCommonStyle(i,i.attribute,u-e,c-n,h),t.fill()))},T=()=>{S&&!y.isSvg&&(l?l(t,i.attribute,h):C&&(t.setStrokeStyle(i,i.attribute,(u-e)/g,(c-n)/f,h),t.stroke()))};p?(T(),x()):(x(),T()),this.afterRenderStep(i,t,e,n,w,S,v,C,h,o,s,l)}draw(i,t,e,n){const o=Ut(i,n==null?void 0:n.theme).symbol;this._draw(i,o,!1,e,n)}};Nd=pk([wt(),r_(0,re(ei)),r_(0,ui(wp)),mk("design:paramtypes",[Object])],Nd);class vk{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Fe)}allocate(t,e,n,o){if(!this.pools.length)return new Fe().setValue(t,e,n,o);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=n,r.y2=o,r}allocateByObj(t){if(!this.pools.length)return new Fe(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const Vd=new vk;class bk{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const n=this.store.get(t);return n?n(e):null}}const Mt=new bk;let jd;function $d(i){return jd||(jd=Mt.CreateGraphic("text",{})),jd.initAttributes(i),jd.AABBBounds}class Ck extends ba{constructor(){super(...arguments),this.time=ge.beforeFillStroke}drawShape(t,e,n,o,r,s,l,a,h,d,u,c){var g,f,p,m,v,C,w,S,y,_;const{backgroundMode:R=h.backgroundMode,backgroundFit:A=h.backgroundFit}=t.attribute;let x,{background:T}=t.attribute;if(!T)return;const M=()=>{t.type==="richtext"&&(e.restore(),e.save(),x&&e.setTransformFromMatrix(x,!0,1))};let B;t.type==="richtext"&&(x=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const H=ue(T)&&T.background,F=t.transMatrix.onlyTranslate();if(H){const P=t.AABBBounds,E=((g=T.x)!==null&&g!==void 0?g:P.x1)+((f=T.dx)!==null&&f!==void 0?f:0),L=((p=T.y)!==null&&p!==void 0?p:P.y1)+((m=T.dy)!==null&&m!==void 0?m:0),I=(v=T.width)!==null&&v!==void 0?v:P.width(),k=(C=T.height)!==null&&C!==void 0?C:P.height();if(B=Vd.allocate(E,L,E+I,L+k),T=T.background,!F){const D=B.width(),O=B.height();B.set(((w=T.x)!==null&&w!==void 0?w:0)+((S=T.dx)!==null&&S!==void 0?S:0),((y=T.y)!==null&&y!==void 0?y:0)+((_=T.dy)!==null&&_!==void 0?_:0),D,O)}}else B=t.AABBBounds,F||(B=$d(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const P=t.resources.get(T);if(P.state!=="success"||!P.data)return void M();e.highPerformanceSave(),F&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,n,o,h),this.doDrawImage(e,P.data,B,R,A),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:P}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,o,h),e.fillStyle=T,P?(Jn(e,B.x1,B.y1,B.width(),B.height(),P),e.fill()):e.fillRect(B.x1,B.y1,B.width(),B.height()),e.highPerformanceRestore()}H&&Vd.free(B),M()}}const s_=new Ck;var yk=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},_k=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},l_=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Hp=class extends Qi{constructor(i){super(),this.textRenderContribitions=i,this.numberType=Hd,this.builtinContributions=[s_],this.init(i)}drawShape(i,t,e,n,o,r,s,l){var a,h,d;const u=Ut(i,r==null?void 0:r.theme).text,{text:c,underline:g=u.underline,lineThrough:f=u.lineThrough,keepDirIn3d:p=u.keepDirIn3d,direction:m=u.direction,fontSize:v=u.fontSize,verticalMode:C=u.verticalMode,x:w=u.x,y:S=u.y}=i.attribute;let{textAlign:y=u.textAlign,textBaseline:_=u.textBaseline}=i.attribute;if(!C&&m==="vertical"){const E=y;y=(a=i.getBaselineMapAlign()[_])!==null&&a!==void 0?a:"left",_=(h=i.getAlignMapBaseline()[E])!==null&&h!==void 0?h:"top"}const R=(d=Io(i.attribute.lineHeight,v))!==null&&d!==void 0?d:v,A=this.valid(i,u,s,l);if(!A)return;const{fVisible:x,sVisible:T,doFill:M,doStroke:B}=A,H=!p,F=this.z||0;t.beginPath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,u),this.beforeRenderStep(i,t,e,n,M,B,x,T,u,o,s,l),H&&this.transformUseContext2d(i,u,F,t);const P=(E,L,I,k)=>{let D=e+L;const O=n+I;if(k){t.highPerformanceSave(),D+=v;const N=cn.allocate(1,0,0,1,0,0);N.rotateByCenter(Math.PI/2,D,O),t.transformFromMatrix(N,!0),cn.free(N)}B&&(l?l(t,i.attribute,u):T&&(t.setStrokeStyle(i,i.attribute,w-e,S-n,u),t.strokeText(E,D,O,F))),M&&(s?s(t,i.attribute,u):x&&(t.setCommonStyle(i,i.attribute,w-e,S-n,u),t.fillText(E,D,O,F),this.drawUnderLine(g,f,i,D,O,F,u,t))),k&&(t.highPerformanceRestore(),t.setTransformForCurrent())};if(i.isMultiLine)if(t.setTextStyleWithoutAlignBaseline(i.attribute,u,F),m==="horizontal"){const{multilineLayout:E}=i;if(!E)return void t.highPerformanceRestore();const{xOffset:L,yOffset:I}=E.bbox;B&&(l?l(t,i.attribute,u):T&&(t.setStrokeStyle(i,i.attribute,w-e,S-n,u),E.lines.forEach(k=>{t.strokeText(k.str,(k.leftOffset||0)+L+e,(k.topOffset||0)+I+n,F)}))),M&&(s?s(t,i.attribute,u):x&&(t.setCommonStyle(i,i.attribute,w-e,S-n,u),E.lines.forEach(k=>{t.fillText(k.str,(k.leftOffset||0)+L+e,(k.topOffset||0)+I+n,F),this.drawUnderLine(g,f,i,(k.leftOffset||0)+L+e,(k.topOffset||0)+I+n-cE("bottom",v)-.05*v,F,u,t,{width:k.width})})))}else{i.tryUpdateAABBBounds();const E=i.cache,{verticalList:L}=E;t.textAlign="left",t.textBaseline="top";const I=R*L.length;let k=0;L.forEach(N=>{const W=N.reduce((j,G)=>j+(G.width||0),0);k=ar(W,k)});let D=0,O=0;_==="bottom"?O=-I:_==="middle"&&(O=-I/2),y==="center"?D-=k/2:y==="right"&&(D-=k),L.forEach((N,W)=>{const j=N.reduce((U,$)=>U+($.width||0),0),G=k-j;let Y=D;y==="center"?Y+=G/2:y==="right"&&(Y+=G),N.forEach(U=>{const{text:$,width:Q,direction:gt}=U;P($,I-(W+1)*R+O,Y,gt),Y+=Q})})}else if(m==="horizontal"){t.setTextStyle(i.attribute,u,F);const E=i.clipedText;let L=0;R!==v&&(_==="top"?L=(R-v)/2:_==="middle"||_==="bottom"&&(L=-(R-v)/2)),P(E,0,L,0)}else{i.tryUpdateAABBBounds();const E=i.cache;if(E){t.setTextStyleWithoutAlignBaseline(i.attribute,u,F);const{verticalList:L}=E;let I=0;const k=L[0].reduce((O,N)=>O+(N.width||0),0);let D=0;_==="bottom"?D=-R:_==="middle"&&(D=-R/2),y==="center"?I-=k/2:y==="right"&&(I-=k),t.textAlign="left",t.textBaseline="top",L[0].forEach(O=>{const{text:N,width:W,direction:j}=O;P(N,D,I,j),I+=W})}}H&&this.restoreTransformUseContext2d(i,u,F,t),this.afterRenderStep(i,t,e,n,M,B,x,T,u,o,s,l)}draw(i,t,e,n){const o=Ut(i,n==null?void 0:n.theme).text,{keepDirIn3d:r=o.keepDirIn3d}=i.attribute,s=!r;this._draw(i,o,s,e,n)}drawUnderLine(i,t,e,n,o,r,s,l,a){if(t+i<=0)return;const{textAlign:h=s.textAlign,textBaseline:d=s.textBaseline,fontSize:u=s.fontSize,fill:c=s.fill,opacity:g=s.opacity,underlineOffset:f=s.underlineOffset,underlineDash:p=s.underlineDash,fillOpacity:m=s.fillOpacity}=e.attribute,v=!Pt(a),C=v?a.width:e.clipedWidth,w=v?0:ho(h,C),S=uo(v?"alphabetic":d,u,u),y={lineWidth:0,stroke:c,opacity:g,strokeOpacity:m};let _=v?-3:0;if(i){y.lineWidth=i,l.setStrokeStyle(e,y,n,o,s),p&&l.setLineDash(p),l.beginPath();const R=o+S+u+f+_;l.moveTo(n+w,R,r),l.lineTo(n+w+C,R,r),l.stroke()}if(v&&(_=-1),t){y.lineWidth=t,l.setStrokeStyle(e,y,n,o,s),l.beginPath();const R=o+S+u/2+_;l.moveTo(n+w,R,r),l.lineTo(n+w+C,R,r),l.stroke()}}};Hp=yk([wt(),l_(0,re(ei)),l_(0,ui(kd)),_k("design:paramtypes",[Object])],Hp);function a_(i,t,e,n){i.moveTo(t[0].x+e,t[0].y+n);for(let o=1;o<t.length;o++)i.lineTo(t[o].x+e,t[o].y+n)}function wk(i,t,e,n,o,r=!0){var s;if(t.length<3)return void a_(i,t,e,n);let l=0,a=t.length-1;r||(l+=1,a-=1,i.moveTo(t[0].x+e,t[0].y+n));for(let h=l;h<=a;h++){const d=t[h===0?a:(h-1)%t.length],u=t[h%t.length],c=t[(h+1)%t.length],g=u.x-d.x,f=u.y-d.y,p=u.x-c.x,m=u.y-c.y,v=(Math.atan2(f,g)-Math.atan2(m,p))/2,C=Math.abs(Math.tan(v));let w=Array.isArray(o)?(s=o[h%t.length])!==null&&s!==void 0?s:0:o,S=w/C;const y=Gd(g,f),_=Gd(p,m),R=Math.min(y,_);S>R&&(S=R,w=R*C);const A=Ep(u,S,y,g,f),x=Ep(u,S,_,p,m),T=2*u.x-A.x-x.x,M=2*u.y-A.y-x.y,B=Gd(T,M),H=Ep(u,Gd(S,w),B,T,M);let F=Math.atan2(A.y-H.y,A.x-H.x);const P=Math.atan2(x.y-H.y,x.x-H.x);let E=P-F;E<0&&(F=P,E=-E),E>Math.PI&&(E-=Math.PI),h===0?i.moveTo(A.x+e,A.y+n):i.lineTo(A.x+e,A.y+n),E&&i.arcTo(u.x+e,u.y+n,x.x+e,x.y+n,w),i.lineTo(x.x+e,x.y+n)}r||i.lineTo(t[a+1].x+e,t[a+1].y+n)}function Gd(i,t){return Math.sqrt(i*i+t*t)}function Ep(i,t,e,n,o){const r=t/e;return{x:i.x-n*r,y:i.y-o*r}}const Sk=Xs,xk=Jr;var Ak=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},Rk=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},h_=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let kp=class extends Qi{constructor(i){super(),this.polygonRenderContribitions=i,this.numberType=Bd,this.builtinContributions=[xk,Sk],this.init(i)}drawShape(i,t,e,n,o,r,s,l){const a=Ut(i,r==null?void 0:r.theme).polygon,{points:h=a.points,cornerRadius:d=a.cornerRadius,x:u=a.x,y:c=a.y,closePath:g=a.closePath,fillStrokeOrder:f=a.fillStrokeOrder}=i.attribute,p=this.valid(i,a,s,l);if(!p)return;const{fVisible:m,sVisible:v,doFill:C,doStroke:w}=p;t.beginPath(),d<=0||ot(d)&&d.every(_=>_===0)?a_(t.camera?t:t.nativeContext,h,e,n):wk(t.camera?t:t.nativeContext,h,e,n,d,g),g&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,a),this.beforeRenderStep(i,t,e,n,C,w,m,v,a,o,s,l);const S=()=>{C&&(s?s(t,i.attribute,a):m&&(t.setCommonStyle(i,i.attribute,u-e,c-n,a),t.fill()))},y=()=>{w&&(l?l(t,i.attribute,a):v&&(t.setStrokeStyle(i,i.attribute,u-e,c-n,a),t.stroke()))};f?(y(),S()):(S(),y()),this.afterRenderStep(i,t,e,n,C,w,m,v,a,o,s,l)}draw(i,t,e,n){const o=Ut(i,n==null?void 0:n.theme).polygon;this._draw(i,o,!1,e,n)}};kp=Ak([wt(),h_(0,re(ei)),h_(0,ui(_p)),Rk("design:paramtypes",[Object])],kp);var Tk=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},Mk=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},d_=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Lp=class{constructor(i){this.groupRenderContribitions=i,this.numberType=cp}drawShape(i,t,e,n,o,r,s,l){const a=Ut(i,r==null?void 0:r.theme).group,{fill:h=a.fill,background:d,stroke:u=a.stroke,opacity:c=a.opacity,width:g=a.width,height:f=a.height,clip:p=a.clip,fillOpacity:m=a.fillOpacity,strokeOpacity:v=a.strokeOpacity,cornerRadius:C=a.cornerRadius,path:w=a.path,lineWidth:S=a.lineWidth,visible:y=a.visible,fillStrokeOrder:_=a.fillStrokeOrder,x:R=a.x,y:A=a.y}=i.attribute,x=$y(c,m,g,f,h),T=Gy(c,v,g,f),M=Ks(h,d),B=pa(u,S);if(!i.valid||!y||!p&&(!M&&!B||!(x||T||s||l||d)))return;if(w&&w.length&&o.drawContribution){const E=t.disableFill,L=t.disableStroke,I=t.disableBeginPath;t.disableFill=!0,t.disableStroke=!0,t.disableBeginPath=!0,w.forEach(k=>{o.drawContribution.getRenderContribution(k).draw(k,o.renderService,o,r)}),t.disableFill=E,t.disableStroke=L,t.disableBeginPath=I}else C===0||ot(C)&&C.every(E=>E===0)?(t.beginPath(),t.rect(e,n,g,f)):(t.beginPath(),Jn(t,e,n,g,f,C));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(DE));const H={doFill:M,doStroke:B};this._groupRenderContribitions.forEach(E=>{E.time===ge.beforeFillStroke&&E.drawShape(i,t,e,n,M,B,x,T,a,o,s,l,H)}),p&&t.clip(),t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,a);const F=()=>{H.doFill&&(s?s(t,i.attribute,a):x&&(t.setCommonStyle(i,i.attribute,R-e,A-n,a),t.fill()))},P=()=>{H.doStroke&&(l?l(t,i.attribute,a):T&&(t.setStrokeStyle(i,i.attribute,R-e,A-n,a),t.stroke()))};_?(P(),F()):(F(),P()),this._groupRenderContribitions.forEach(E=>{E.time===ge.afterFillStroke&&E.drawShape(i,t,e,n,M,B,x,T,a,o,s,l)})}draw(i,t,e,n){const{context:o}=e;if(!o)return;const{clip:r,baseOpacity:s=1}=i.attribute;r?o.save():o.highPerformanceSave();const l=o.baseGlobalAlpha;o.baseGlobalAlpha*=s;const a=Ut(i,n==null?void 0:n.theme).group,h=o.modelMatrix;if(o.camera){const g=ri.allocate(),f=ri.allocate();Xy(f,i,a),va(g,h||g,f),o.modelMatrix=g,ri.free(f),o.setTransform(1,0,0,1,0,0,!0)}else o.transformFromMatrix(i.transMatrix,!0);o.beginPath(),n.skipDraw?this.drawShape(i,o,0,0,e,n,()=>!1,()=>!1):this.drawShape(i,o,0,0,e);const{scrollX:d=a.scrollX,scrollY:u=a.scrollY}=i.attribute;let c;(d||u)&&o.translate(d,u),n&&n.drawingCb&&(c=n.drawingCb()),o.modelMatrix!==h&&ri.free(o.modelMatrix),o.modelMatrix=h,o.baseGlobalAlpha=l,c&&c.then?c.then(()=>{r?o.restore():o.highPerformanceRestore()}):r?o.restore():o.highPerformanceRestore()}};Lp=Tk([wt(),d_(0,re(ei)),d_(0,ui(Xn)),Mk("design:paramtypes",[Object])],Lp);var Bk=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},Pk=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},u_=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};const Hk=["","repeat-x","repeat-y","repeat"];let Fp=class extends Qi{constructor(i){super(),this.imageRenderContribitions=i,this.numberType=Td,this.builtinContributions=[$E,GE],this.init(i)}drawShape(i,t,e,n,o,r,s,l){const a=Ut(i).image,{width:h=a.width,height:d=a.height,repeatX:u=a.repeatX,repeatY:c=a.repeatY,x:g=a.x,y:f=a.y,cornerRadius:p=a.cornerRadius,fillStrokeOrder:m=a.fillStrokeOrder,image:v}=i.attribute,C=this.valid(i,a,s);if(!C)return;const{fVisible:w,sVisible:S,doFill:y,doStroke:_}=C;t.setShadowBlendStyle&&t.setShadowBlendStyle(i,a),this.beforeRenderStep(i,t,e,n,y,!1,w,!1,a,o,s);const R=()=>{if(y){if(s)s(t,i.attribute,a);else if(w){if(!v||!i.resources)return;const x=i.resources.get(v);if(x.state!=="success")return;let T=!1;p===0||ot(p)&&p.every(B=>B===0)||(t.beginPath(),Jn(t,e,n,h,d,p),t.save(),t.clip(),T=!0),t.setCommonStyle(i,i.attribute,e,n,a);let M=0;if(u==="repeat"&&(M|=1),c==="repeat"&&(M|=2),M){const B=t.createPattern(x.data,Hk[M]);t.fillStyle=B,t.translate(e,n,!0),t.fillRect(0,0,h,d),t.translate(-e,-n,!0)}else t.drawImage(x.data,e,n,h,d);T&&t.restore()}}},A=()=>{_&&(l?l(t,i.attribute,a):S&&(t.setStrokeStyle(i,i.attribute,g-e,f-n,a),t.stroke()))};m?(A(),R()):(R(),A()),this.afterRenderStep(i,t,e,n,y,!1,w,!1,a,o,s)}draw(i,t,e){const{image:n}=i.attribute;if(!i.isGifImage){if(!n||!i.resources)return;const s=i.resources.get(n);if(s.state==="loading"&&de(n))return void Ae.improveImageLoading(n);if(s.state!=="success")return}const{context:o}=t.drawParams;if(!o)return;const r=Ut(i).image;this._draw(i,r,!1,e)}};Fp=Bk([wt(),u_(0,re(ei)),u_(0,ui(qr)),Pk("design:paramtypes",[Object])],Fp);const c_=Symbol.for("IncrementalDrawContribution"),Ud=Symbol.for("ArcRender"),Kd=Symbol.for("CircleRender"),Ui=Symbol.for("GraphicRender"),g_=Symbol.for("GroupRender"),Yd=Symbol.for("LineRender"),Xd=Symbol.for("PathRender"),qd=Symbol.for("PolygonRender"),Zd=Symbol.for("RectRender"),Jd=Symbol.for("SymbolRender"),Ip=Symbol.for("TextRender"),Dp=Symbol.for("RichTextRender"),f_=Symbol.for("ImageRender"),Op=Symbol.for("DrawContribution"),p_=(i,t,e,n)=>{let o,r=!1,s=!1;if(t.forEachChildren(l=>(r=l.numberType===QH,!r)),t.forEachChildren(l=>(s=!!l.findFace,!s)),r){const l=t.getChildren(),a=[...l];a.sort((h,d)=>{var u,c,g,f;let p=((c=(u=h.attribute.startAngle)!==null&&u!==void 0?u:0+h.attribute.endAngle)!==null&&c!==void 0?c:0)/2,m=((f=(g=d.attribute.startAngle)!==null&&g!==void 0?g:0+d.attribute.endAngle)!==null&&f!==void 0?f:0)/2;for(;p<0;)p+=ce;for(;m<0;)m+=ce;return m-p}),a.forEach(h=>{h._next=null,h._prev=null}),t.removeAllChild(),t.update(),a.forEach(h=>{t.appendChild(h)}),n.hack_pieFace="outside",o=e(r,s),o&&o.graphic||(n.hack_pieFace="inside",o=e(r,s)),o&&o.graphic||(n.hack_pieFace="top",o=e(r,s)),t.removeAllChild(),l.forEach(h=>{h._next=null,h._prev=null}),l.forEach(h=>{t.appendChild(h)})}else if(s){const l=t.getChildren(),a=l.map(h=>({ave_z:h.findFace().vertices.map(d=>{var u;return i.view(d[0],d[1],(u=d[2]+h.attribute.z)!==null&&u!==void 0?u:0)[2]}).reduce((d,u)=>d+u,0),g:h}));a.sort((h,d)=>d.ave_z-h.ave_z),t.removeAllChild(),a.forEach(h=>{h.g._next=null,h.g._prev=null}),t.update(),a.forEach(h=>{t.add(h.g)}),o=e(r,s),t.removeAllChild(),l.forEach(h=>{h._next=null,h._prev=null}),t.update(),l.forEach(h=>{t.add(h)})}else o=e(r,s);return o};var Ek=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},kk=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)};const ya=Symbol.for("DrawItemInterceptor"),m_=new Fe,v_=new Fe;class Lk{constructor(){this.order=1}afterDrawItem(t,e,n,o,r){return t.attribute.shadowRootIdx==null&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,n,o,r),!1}beforeDrawItem(t,e,n,o,r){return t.attribute.shadowRootIdx==null&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,n,o,r),!1}drawItem(t,e,n,o,r){if(!t.shadowRoot)return!1;const{context:s}=n;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),o.dirtyBounds&&o.backupDirtyBounds){m_.copy(o.dirtyBounds),v_.copy(o.backupDirtyBounds);const l=t.globalTransMatrix.getInverse();o.dirtyBounds.copy(o.backupDirtyBounds).transformWithMatrix(l),o.backupDirtyBounds.copy(o.dirtyBounds)}return o.renderGroup(t.shadowRoot,n,cn.allocate(1,0,0,1,0,0)),s.highPerformanceRestore(),o.dirtyBounds&&o.backupDirtyBounds&&(o.dirtyBounds.copy(m_),o.backupDirtyBounds.copy(v_)),!0}}class Fk{constructor(){this.order=1}afterDrawItem(t,e,n,o,r){return t.attribute._debug_bounds&&this.drawItem(t,e,n,o,r),!1}drawItem(t,e,n,o,r){if(!t.attribute._debug_bounds)return!1;const{context:s}=n;s.highPerformanceSave(),t.parent&&s.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&s.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const l=t.AABBBounds;return t.attribute._debug_bounds!==!0&&t.attribute._debug_bounds(s,t),s.strokeRect(l.x1,l.y1,l.width(),l.height()),s.highPerformanceRestore(),!0}}let Qd=class{constructor(){this.order=1,this.interceptors=[new Lk,new Dk,new Ik,new Fk]}afterDrawItem(i,t,e,n,o){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(i,t,e,n,o))return!0;return!1}beforeDrawItem(i,t,e,n,o){if((!i.in3dMode||e.in3dInterceptor)&&!i.shadowRoot&&!(i.baseGraphic||i.attribute.globalZIndex||i.interactiveGraphic))return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].beforeDrawItem&&this.interceptors[r].beforeDrawItem(i,t,e,n,o))return!0;return!1}};Qd=Ek([wt(),kk("design:paramtypes",[])],Qd);class Ik{constructor(){this.order=1}beforeDrawItem(t,e,n,o,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,n,o,r):this.beforeSetInteractive(t,e,n,o,r))}beforeSetInteractive(t,e,n,o,r){let s=t.interactiveGraphic;if(t.attribute.globalZIndex){s||(s=t.clone(),t.interactiveGraphic=s,s.baseGraphic=t),s.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),n.stage.tryInitInteractiveLayer();const l=n.stage.getLayer("_builtin_interactive");return l&&this.getShadowRoot(l).add(s),!0}if(s){n.stage.tryInitInteractiveLayer();const l=n.stage.getLayer("_builtin_interactive");l&&this.getShadowRoot(l).removeChild(s),t.interactiveGraphic=null,s.baseGraphic=null}return!1}beforeDrawInteractive(t,e,n,o,r){const s=t.baseGraphic;let l=!!s.stage,a=s.parent;for(;l&&a&&a.stage!==a;)l=!!a.stage,a=a.parent;if(!l){const h=n.stage.getLayer("_builtin_interactive");return h&&this.getShadowRoot(h).removeChild(t),!0}if(s){this.processing=!0;const{context:h}=n;return h.highPerformanceSave(),h.setTransformFromMatrix(s.parent.globalTransMatrix,!0),s.isContainer?o.renderGroup(s,n,s.parent.globalTransMatrix):o.renderItem(s,n),h.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let n=t.getElementById("_interactive_group");return n||(n=Mt.CreateGraphic("group",{}),n.id="_interactive_group",t.add(n)),(e=n.shadowRoot)!==null&&e!==void 0?e:n.attachShadow()}}class Dk{constructor(){this.order=1}beforeDrawItem(t,e,n,o,r){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;const{context:s,stage:l}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=l.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const h=ri.allocate();xp(h,a);const d=s.modelMatrix;if(d){if(h){const u=ri.allocate();s.modelMatrix=va(u,d,h)}}else s.modelMatrix=h;return s.setTransform(1,0,0,1,0,0,!0),t.isContainer?p_(s,t,(u,c)=>o.renderGroup(t,n,t.parent.globalTransMatrix,!u&&c),n):o.renderItem(t,n),s.camera=null,s.restore(),s.modelMatrix!==d&&ri.free(s.modelMatrix),s.modelMatrix=d,n.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var Ok=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},zk=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},Wk=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};const b_=Symbol.for("RenderService");let zp=class{constructor(i){this.drawContribution=i}prepare(i){i&&this.renderTreeRoots.forEach(t=>{this._prepare(t,i)})}_prepare(i,t){i.forEachChildren(e=>{this._prepare(e,t)}),i.update({bounds:t,trans:!0})}prepareRenderList(){}beforeDraw(i){}draw(i){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(i){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(i,t){this.renderTreeRoots=i,this.drawParams=t;const e=t.updateBounds;this.prepare(e),this.prepareRenderList(),this.beforeDraw(t),this.draw(t),this.afterDraw(t),this.drawParams=null}};zp=Ok([wt(),Wk(0,re(Op)),zk("design:paramtypes",[Object])],zp);const Nk=new $t(i=>{i(b_).to(zp)}),Qs=Symbol.for("PickerService"),C_=Symbol.for("GlobalPickerService"),_a=(i,t,e)=>{const{outerBorder:n,shadowBlur:o=t.shadowBlur}=i;if(n){const r=t.outerBorder,{distance:s=r.distance,lineWidth:l=r.lineWidth}=n;e.expand(s+(o+l)/2)}return e},y_=["radius","startAngle","endAngle",...Mn];let Wp=class Zv extends Ji{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=Rd}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(n)}getGraphicTheme(){return Ut(this).circle}updateAABBBounds(t,e,n,o){this.updatePathProxyAABBBounds(n)||(o?this.updateCircleAABBBoundsImprecise(t,e,n):this.updateCircleAABBBoundsAccurate(t,e,n));const{tb1:r,tb2:s}=tt.graphicService.updateTempAABBBounds(n);return _a(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),tt.graphicService.transformAABBBounds(t,n,e,!1,this),n}updateCircleAABBBoundsImprecise(t,e,n){const{radius:o=e.radius}=t;return n.set(-o,-o,o,o),n}updateCircleAABBBoundsAccurate(t,e,n){const{startAngle:o=e.startAngle,endAngle:r=e.endAngle,radius:s=e.radius}=t;return r-o>ce-Le?n.set(-s,-s,s,s):hp(o,r,s,n),n}needUpdateTags(t){return super.needUpdateTags(t,y_)}needUpdateTag(t){return super.needUpdateTag(t,y_)}toCustomPath(){var t,e,n;const o=this.attribute,r=(t=o.radius)!==null&&t!==void 0?t:this.getDefaultAttribute("radius"),s=(e=o.startAngle)!==null&&e!==void 0?e:this.getDefaultAttribute("startAngle"),l=(n=o.endAngle)!==null&&n!==void 0?n:this.getDefaultAttribute("endAngle"),a=new wi;return a.arc(0,0,r,s,l),a}clone(){return new Zv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Zv.NOWORK_ANIMATE_ATTR}};Wp.NOWORK_ANIMATE_ATTR=Yn;function __(i){return new Wp(i)}class Np{constructor(t,e,n){this.fontFamily=t,this.textOptions=e,this.textMeasure=n}LayoutBBox(t,e,n){if(e==="left"||e==="start")t.xOffset=0;else if(e==="center")t.xOffset=t.width/-2;else{if(e!=="right"&&e!=="end")throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset=n==="top"?0:n==="middle"?t.height/-2:n==="alphabetic"?-.79*t.height:-t.height,t}GetLayout(t,e,n,o,r,s,l,a,h){const d=[],u=[e,n],c=[0,0];for(;t.length>0;){const{str:f}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,l,a,h);d.push({str:f,width:this.textMeasure.measureTextWidth(f,this.textOptions)}),t=t.substring(f.length)}o==="left"||o==="start"||(o==="center"?c[0]=u[0]/-2:o!=="right"&&o!=="end"||(c[0]=-u[0])),r==="top"||(r==="middle"?c[1]=u[1]/-2:r==="bottom"&&(c[1]=-u[1]));const g={xOffset:c[0],yOffset:c[1],width:u[0],height:u[1]};return this.layoutWithBBox(g,d,o,r,s)}GetLayoutByLines(t,e,n,o,r="",s,l,a="end"){t=t.map(c=>c.toString());const h=[],d=[0,0];if(typeof l=="number"&&l!==1/0){let c;for(let g=0,f=t.length;g<f;g++)c=Math.min(this.textMeasure.measureTextWidth(t[g],this.textOptions),l),h.push({str:this.textMeasure.clipTextWithSuffix(t[g],this.textOptions,c,r,s,a).str,width:c});d[0]=l}else{let c,g;l=0;for(let f=0,p=t.length;f<p;f++)g=t[f],c=this.textMeasure.measureTextWidth(g,this.textOptions),l=Math.max(l,c),h.push({str:g,width:c});d[0]=l}d[1]=h.length*o,d[0]=h.reduce((c,g)=>Math.max(c,g.width),0);const u={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(u,e,n),this.layoutWithBBox(u,h,e,n,o)}layoutWithBBox(t,e,n,o,r){const s=[0,0],l=e.length*r;o==="top"||(o==="middle"?s[1]=(t.height-l)/2:o==="bottom"&&(s[1]=t.height-l));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],n,o,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:o}}lineOffset(t,e,n,o,r,s){return n==="left"||n==="start"?e.leftOffset=0:n==="center"?e.leftOffset=(t.width-e.width)/2:n!=="right"&&n!=="end"||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const w_=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...Mn];let Mi=class Ro extends Ji{get font(){const t=this.getGraphicTheme();return this._font||(this._font=ld(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,n=this.getGraphicTheme();if(!this.isSimplify())return;const{maxLineWidth:o=n.maxLineWidth}=e;return Number.isFinite(o)?(this.tryUpdateAABBBounds(),this.cache.clipedText):((t=e.text)!==null&&t!==void 0?t:n.text).toString()}get clipedWidth(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const n=this.getGraphicTheme(),o=this.attribute,{maxLineWidth:r=n.maxLineWidth,text:s,whiteSpace:l=n.whiteSpace}=o;if(!Number.isFinite(r))return!1;if(this.tryUpdateAABBBounds(),(e=(t=this.cache)===null||t===void 0?void 0:t.layoutData)===null||e===void 0?void 0:e.lines){let a="";return this.cache.layoutData.lines.forEach(h=>{a+=h.str}),(Array.isArray(s)?s.join(""):s)!==a}return o.direction==="vertical"&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map(a=>a.text).join("")!==o.text.toString():this.clipedText!=null&&this.clipedText!==o.text.toString()}get multilineLayout(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&this.attribute.direction!=="vertical"}get isMultiLine(){return Array.isArray(this.attribute.text)||this.attribute.whiteSpace==="normal"}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=Hd,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return ot(t)?!t.every(e=>e==null||e===""):t!=null&&t!==""}getGraphicTheme(){return Ut(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:n=t.angle}=e;if(!n){const h=this.AABBBounds;return this._OBBBounds.setValue(h.x1,h.y1,h.x2,h.y2),this._OBBBounds}this.obbText||(this.obbText=new Ro({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const o=this.obbText.AABBBounds,{x:r,y:s}=e,l={x:(o.x1+o.x2)/2,y:(o.y1+o.y2)/2},a=zs(l,n,{x:r,y:s});return this._OBBBounds.copy(o),this._OBBBounds.translate(a.x-l.x,a.y-l.y),this._OBBBounds.angle=n,this._OBBBounds}updateAABBBounds(t,e,n){const{text:o=e.text}=this.attribute;Array.isArray(o)?this.updateMultilineAABBBounds(o):this.updateSingallineAABBBounds(o);const{tb1:r}=tt.graphicService.updateTempAABBBounds(n),{scaleX:s=e.scaleX,scaleY:l=e.scaleY,shadowBlur:a=e.shadowBlur,strokeBoundsBuffer:h=e.strokeBoundsBuffer}=t;if(a){const d=a/Math.abs(s+l);xd(r,d,!0,h),n.union(r)}return tt.graphicService.combindShadowAABBBounds(n,this),t.forceBoundsHeight==null&&t.forceBoundsWidth==null||tt.graphicService.updateHTMLTextAABBBounds(t,e,n),Df(n,n,this.transMatrix),n}updateWrapAABBBounds(t){var e,n,o,r;const s=this.getGraphicTheme(),{fontFamily:l=s.fontFamily,textAlign:a=s.textAlign,textBaseline:h=s.textBaseline,fontSize:d=s.fontSize,ellipsis:u=s.ellipsis,maxLineWidth:c,stroke:g=s.stroke,lineWidth:f=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:m=s.fontWeight,ignoreBuf:v=s.ignoreBuf,suffixPosition:C=s.suffixPosition,heightLimit:w=0,lineClamp:S}=this.attribute,y=(e=Io(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))!==null&&e!==void 0?e:this.attribute.fontSize||s.fontSize,_=v?0:2;if(!this.shouldUpdateShape()&&(!((n=this.cache)===null||n===void 0)&&n.layoutData)){const P=this.cache.layoutData.bbox;return this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),g&&this._AABBBounds.expand(f/2),this._AABBBounds}const R=tt.graphicUtil.textMeasure,A=new Np(l,{fontSize:d,fontWeight:m,fontFamily:l},R),x=ot(t)?t.map(P=>P.toString()):[t.toString()],T=[],M=[0,0];let B=1/0;if(w>0&&(B=Math.max(Math.floor(w/y),1)),S&&(B=Math.min(B,S)),typeof c=="number"&&c!==1/0){if(c>0)for(let E=0;E<x.length;E++){const L=x[E];let I=!0;if(E===B-1){const O=A.textMeasure.clipTextWithSuffix(L,A.textOptions,c,u,!1,C,E!==x.length-1);T.push({str:O.str,width:O.width});break}const k=A.textMeasure.clipText(L,A.textOptions,c,p!=="break-all",p==="keep-all");if(L!==""&&k.str===""||k.wordBreaked){if(u){const O=A.textMeasure.clipTextWithSuffix(L,A.textOptions,c,u,!1,C);k.str=(o=O.str)!==null&&o!==void 0?o:"",k.width=(r=O.width)!==null&&r!==void 0?r:0}else k.str="",k.width=0;I=!1}T.push({str:k.str,width:k.width});let D=k.str.length;if(!k.wordBreaked||L!==""&&k.str===""||(I=!0,D=k.wordBreaked),k.str.length!==L.length){if(I){let O=L.substring(D);p==="keep-all"&&(O=O.replace(/^\s+/g,"")),x.splice(E+1,0,O)}}}let P=0;T.forEach(E=>{P=Math.max(P,E.width)}),M[0]=P}else{let P,E,L=0;for(let I=0,k=x.length;I<k;I++){if(I===B-1){const D=A.textMeasure.clipTextWithSuffix(x[I],A.textOptions,c,u,!1,C);T.push({str:D.str,width:D.width}),L=Math.max(L,D.width);break}E=x[I],P=A.textMeasure.measureTextWidth(E,A.textOptions,p==="break-word"),L=Math.max(L,P),T.push({str:E,width:P})}M[0]=L}M[1]=T.length*(y+_);const H={xOffset:0,yOffset:0,width:M[0],height:M[1]};A.LayoutBBox(H,a,h);const F=A.layoutWithBBox(H,T,a,h,y);return this.cache.layoutData=F,this.clearUpdateShapeTag(),this._AABBBounds.set(H.xOffset,H.yOffset,H.xOffset+H.width,H.yOffset+H.height),g&&this._AABBBounds.expand(f/2),this._AABBBounds}updateSingallineAABBBounds(t){const e=this.getGraphicTheme(),{direction:n=e.direction,underlineOffset:o=e.underlineOffset}=this.attribute,r=n==="horizontal"?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return n==="horizontal"&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),r}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:n=e.direction,underlineOffset:o=e.underlineOffset}=this.attribute,r=n==="horizontal"?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return n==="horizontal"&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),r}updateHorizontalSinglelineAABBBounds(t){var e,n;const o=this.getGraphicTheme(),{wrap:r=o.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds([t]);const s=tt.graphicUtil.textMeasure;let l,a;const h=this.attribute,{maxLineWidth:d=o.maxLineWidth,ellipsis:u=o.ellipsis,textAlign:c=o.textAlign,textBaseline:g=o.textBaseline,fontFamily:f=o.fontFamily,fontSize:p=o.fontSize,fontWeight:m=o.fontWeight,stroke:v=o.stroke,lineWidth:C=o.lineWidth,ignoreBuf:w=o.ignoreBuf,whiteSpace:S=o.whiteSpace,suffixPosition:y=o.suffixPosition}=h;if(S==="normal")return this.updateWrapAABBBounds(t);const _=w?0:Math.max(2,.075*p),R=h.fontSize||o.fontSize,A=(e=Io(h.lineHeight,R))!==null&&e!==void 0?e:R+_;if(!this.shouldUpdateShape()&&this.cache){l=(n=this.cache.clipedWidth)!==null&&n!==void 0?n:0;const B=ho(c,l),H=uo(g,A,p);return this._AABBBounds.set(B,H,B+l,H+A),v&&this._AABBBounds.expand(C/2),this._AABBBounds}if(Number.isFinite(d)){if(u){const B=u===!0?o.ellipsis:u,H=s.clipTextWithSuffix(t.toString(),{fontSize:p,fontWeight:m,fontFamily:f},d,B,!1,y);a=H.str,l=H.width}else{const B=s.clipText(t.toString(),{fontSize:p,fontWeight:m,fontFamily:f},d,!1);a=B.str,l=B.width}this.cache.clipedText=a,this.cache.clipedWidth=l}else l=s.measureTextWidth(t.toString(),{fontSize:p,fontWeight:m,fontFamily:f}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=l;this.clearUpdateShapeTag();const x=ho(c,l);let T=A;tt.global&&tt.global.isSafari()&&(T+=.2*p);const M=uo(g,T,p,_);return this._AABBBounds.set(x,M,x+l,M+T),v&&this._AABBBounds.expand(C/2),this._AABBBounds}getBaselineMapAlign(){return Ro.baselineMapAlign}getAlignMapBaseline(){return Ro.alignMapBaseline}updateVerticalSinglelineAABBBounds(t){var e,n,o;const r=this.getGraphicTheme(),s=tt.graphicUtil.textMeasure;let l;const a=this.attribute,{ignoreBuf:h=r.ignoreBuf}=a,d=h?0:2,{maxLineWidth:u=r.maxLineWidth,ellipsis:c=r.ellipsis,fontSize:g=r.fontSize,fontWeight:f=r.fontWeight,fontFamily:p=r.fontFamily,stroke:m=r.stroke,lineWidth:v=r.lineWidth,verticalMode:C=r.verticalMode,suffixPosition:w=r.suffixPosition}=a,S=(e=Io(a.lineHeight,a.fontSize||r.fontSize))!==null&&e!==void 0?e:(a.fontSize||r.fontSize)+d;let{textAlign:y=r.textAlign,textBaseline:_=r.textBaseline}=a;if(!C){const T=y;y=(n=Ro.baselineMapAlign[_])!==null&&n!==void 0?n:"left",_=(o=Ro.alignMapBaseline[T])!==null&&o!==void 0?o:"top"}if(!this.shouldUpdateShape()&&this.cache){l=this.cache.clipedWidth;const T=ho(y,l),M=uo(_,S,g);return this._AABBBounds.set(M,T,M+S,T+l),m&&this._AABBBounds.expand(v/2),this._AABBBounds}let R=[ky(t.toString())];if(Number.isFinite(u)){if(c){const T=c===!0?r.ellipsis:c,M=s.clipTextWithSuffixVertical(R[0],{fontSize:g,fontWeight:f,fontFamily:p},u,T,!1,w);R=[M.verticalList],l=M.width}else{const T=s.clipTextVertical(R[0],{fontSize:g,fontWeight:f,fontFamily:p},u,!1);R=[T.verticalList],l=T.width}this.cache.verticalList=R,this.cache.clipedWidth=l}else l=0,R[0].forEach(T=>{const M=T.direction===Kr.HORIZONTAL?g:s.measureTextWidth(T.text,{fontSize:g,fontWeight:f,fontFamily:p});l+=M,T.width=M}),this.cache.verticalList=R,this.cache.clipedWidth=l;this.clearUpdateShapeTag();const A=ho(y,l),x=uo(_,S,g);return this._AABBBounds.set(x,A,x+S,A+l),m&&this._AABBBounds.expand(v/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,n;const o=this.getGraphicTheme(),{wrap:r=o.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds(t);const s=this.attribute,{fontFamily:l=o.fontFamily,textAlign:a=o.textAlign,textBaseline:h=o.textBaseline,fontSize:d=o.fontSize,fontWeight:u=o.fontWeight,ellipsis:c=o.ellipsis,maxLineWidth:g,stroke:f=o.stroke,lineWidth:p=o.lineWidth,whiteSpace:m=o.whiteSpace,suffixPosition:v=o.suffixPosition}=s,C=(e=Io(s.lineHeight,s.fontSize||o.fontSize))!==null&&e!==void 0?e:s.fontSize||o.fontSize;if(m==="normal")return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(!((n=this.cache)===null||n===void 0)&&n.layoutData)){const _=this.cache.layoutData.bbox;return this._AABBBounds.set(_.xOffset,_.yOffset,_.xOffset+_.width,_.yOffset+_.height),f&&this._AABBBounds.expand(p/2),this._AABBBounds}const w=tt.graphicUtil.textMeasure,S=new Np(l,{fontSize:d,fontWeight:u,fontFamily:l},w).GetLayoutByLines(t,a,h,C,c===!0?o.ellipsis:c||void 0,!1,g,v),{bbox:y}=S;return this.cache.layoutData=S,this.clearUpdateShapeTag(),this._AABBBounds.set(y.xOffset,y.yOffset,y.xOffset+y.width,y.yOffset+y.height),f&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,n,o;const r=this.getGraphicTheme(),s=tt.graphicUtil.textMeasure;let l;const a=this.attribute,{ignoreBuf:h=r.ignoreBuf}=a,d=h?0:2,{maxLineWidth:u=r.maxLineWidth,ellipsis:c=r.ellipsis,fontFamily:g=r.fontFamily,fontSize:f=r.fontSize,fontWeight:p=r.fontWeight,stroke:m=r.stroke,lineWidth:v=r.lineWidth,verticalMode:C=r.verticalMode,suffixPosition:w=r.suffixPosition}=a,S=(e=Io(a.lineHeight,a.fontSize||r.fontSize))!==null&&e!==void 0?e:(a.fontSize||r.fontSize)+d;let{textAlign:y=r.textAlign,textBaseline:_=r.textBaseline}=a;if(!C){const M=y;y=(n=Ro.baselineMapAlign[_])!==null&&n!==void 0?n:"left",_=(o=Ro.alignMapBaseline[M])!==null&&o!==void 0?o:"top"}if(l=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach(F=>{const P=F.reduce((E,L)=>E+L.width,0);l=ar(P,l)});const M=ho(y,l),B=this.cache.verticalList.length*S,H=uo(_,B,f);return this._AABBBounds.set(H,M,H+B,M+l),m&&this._AABBBounds.expand(v/2),this._AABBBounds}const R=t.map(M=>ky(M.toString()));R.forEach((M,B)=>{if(Number.isFinite(u))if(c){const H=c===!0?r.ellipsis:c,F=s.clipTextWithSuffixVertical(M,{fontSize:f,fontWeight:p,fontFamily:g},u,H,!1,w);R[B]=F.verticalList,l=F.width}else{const H=s.clipTextVertical(M,{fontSize:f,fontWeight:p,fontFamily:g},u,!1);R[B]=H.verticalList,l=H.width}else l=0,M.forEach(H=>{const F=H.direction===Kr.HORIZONTAL?f:s.measureTextWidth(H.text,{fontSize:f,fontWeight:p,fontFamily:g});l+=F,H.width=F})}),this.cache.verticalList=R,this.clearUpdateShapeTag(),this.cache.verticalList.forEach(M=>{const B=M.reduce((H,F)=>H+F.width,0);l=ar(B,l)});const A=ho(y,l),x=this.cache.verticalList.length*S,T=uo(_,x,f);return this._AABBBounds.set(T,A,T+x,A+l),m&&this._AABBBounds.expand(v/2),this._AABBBounds}needUpdateTags(t,e=w_){return super.needUpdateTags(t,e)}needUpdateTag(t,e=w_){return super.needUpdateTag(t,e)}clone(){return new Ro(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ro.NOWORK_ANIMATE_ATTR}};Mi.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Yn),Mi.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Mi.alignMapBaseline={left:"top",right:"bottom",center:"middle"};function Vp(i){return new Mi(i)}const tu=["heightLimit","lineClamp"];class eu extends Mi{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return ot(t)?!t.every(e=>e==null||e===""):t!=null&&t!==""}updateMultilineAABBBounds(t){var e,n,o,r;const s=this.getGraphicTheme(),{fontFamily:l=s.fontFamily,textAlign:a=s.textAlign,textBaseline:h=s.textBaseline,fontSize:d=s.fontSize,ellipsis:u=s.ellipsis,maxLineWidth:c,stroke:g=s.stroke,lineWidth:f=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:m=s.fontWeight,ignoreBuf:v=s.ignoreBuf,heightLimit:C=0,suffixPosition:w=s.suffixPosition,lineClamp:S}=this.attribute,y=(e=Io(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))!==null&&e!==void 0?e:this.attribute.fontSize||s.fontSize,_=v?0:2;if(!this.shouldUpdateShape()&&(!((n=this.cache)===null||n===void 0)&&n.layoutData)){const P=this.cache.layoutData.bbox;return this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),g&&this._AABBBounds.expand(f/2),this._AABBBounds}const R=tt.graphicUtil.textMeasure,A=new Np(l,{fontSize:d,fontWeight:m,fontFamily:l},R),x=t.map(P=>P.toString()),T=[],M=[0,0];let B=1/0;if(C>0&&(B=Math.max(Math.floor(C/y),1)),S&&(B=Math.min(B,S)),typeof c=="number"&&c!==1/0){if(c>0)for(let E=0;E<x.length;E++){const L=x[E];let I=!0;if(E===B-1){const D=A.textMeasure.clipTextWithSuffix(L,A.textOptions,c,u,!1,w);T.push({str:D.str,width:D.width});break}const k=A.textMeasure.clipText(L,A.textOptions,c,p==="break-word");if(L!==""&&k.str===""){if(u){const D=A.textMeasure.clipTextWithSuffix(L,A.textOptions,c,u,!1,w);k.str=(o=D.str)!==null&&o!==void 0?o:"",k.width=(r=D.width)!==null&&r!==void 0?r:0}else k.str="",k.width=0;I=!1}if(T.push({str:k.str,width:k.width}),k.str.length!==L.length){if(I){const D=L.substring(k.str.length);x.splice(E+1,0,D)}}}let P=0;T.forEach(E=>{P=Math.max(P,E.width)}),M[0]=P}else{let P,E,L=0;for(let I=0,k=x.length;I<k;I++){if(I===B-1){const D=A.textMeasure.clipTextWithSuffix(x[I],A.textOptions,c,u,!1,w);T.push({str:D.str,width:D.width}),L=Math.max(L,D.width);break}E=x[I],P=A.textMeasure.measureTextWidth(E,A.textOptions,p==="break-word"),L=Math.max(L,P),T.push({str:E,width:P})}M[0]=L}M[1]=T.length*(y+_);const H={xOffset:0,yOffset:0,width:M[0],height:M[1]};A.LayoutBBox(H,a,h);const F=A.layoutWithBBox(H,T,a,h,y);return this.cache.layoutData=F,this.clearUpdateShapeTag(),this._AABBBounds.set(H.xOffset,H.yOffset,H.xOffset+H.width,H.yOffset+H.height),g&&this._AABBBounds.expand(f/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<tu.length;e++){const n=tu[e];if(t.indexOf(n)!==-1)return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<tu.length;e++)if(t===tu[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return eu.NOWORK_ANIMATE_ATTR}}function Vk(i){return new eu(i)}class Ze{bounds(t,e){if(ut(t)){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}function S_(i,t,e,n,o){return o?i.arc(e,n,t,0,Ri,!1,o):i.arc(e,n,t,0,Ri),!1}class jk extends Ze{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,n,o,r){return S_(t,e/2,n,o,r)}drawOffset(t,e,n,o,r,s){return S_(t,e/2+r,n,o,s)}drawToSvgPath(t,e,n,o){const r=t/2;return`M ${e-r}, ${n} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}}const $k=new jk;function Gk(i,t,e,n,o){return i.moveTo(-3*t+e,-t+n,o),i.lineTo(-t+e,-t+n,o),i.lineTo(-t+e,-3*t+n,o),i.lineTo(t+e,-3*t+n,o),i.lineTo(t+e,-t+n,o),i.lineTo(3*t+e,-t+n,o),i.lineTo(3*t+e,t+n,o),i.lineTo(t+e,t+n,o),i.lineTo(t+e,3*t+n,o),i.lineTo(-t+e,3*t+n,o),i.lineTo(-t+e,t+n,o),i.lineTo(-3*t+e,t+n,o),i.closePath(),!0}function Uk(i,t,e,n,o,r){return i.moveTo(-3*t+e-o,-t+n-o,r),i.lineTo(-t+e-o,-t+n-o,r),i.lineTo(-t+e-o,-3*t+n-o,r),i.lineTo(t+e+o,-3*t+n-o,r),i.lineTo(t+e+o,-t+n-o,r),i.lineTo(3*t+e+o,-t+n-o,r),i.lineTo(3*t+e+o,t+n+o,r),i.lineTo(t+e+o,t+n+o,r),i.lineTo(t+e+o,3*t+n+o,r),i.lineTo(-t+e-o,3*t+n+o,r),i.lineTo(-t+e-o,t+n+o,r),i.lineTo(-3*t+e-o,t+n+o,r),i.closePath(),!0}class Kk extends Ze{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,n,o,r){return Gk(t,e/6,n,o,r)}drawOffset(t,e,n,o,r,s){return Uk(t,e/6,n,o,r,s)}}const Yk=new Kk;function jp(i,t,e,n,o){return i.moveTo(e,n-t,o),i.lineTo(t+e,n,o),i.lineTo(e,n+t,o),i.lineTo(e-t,n,o),i.closePath(),!0}class Xk extends Ze{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,n,o,r){return jp(t,e/2,n,o,r)}drawFitDir(t,e,n,o,r){return jp(t,e/2,n,o,r)}drawOffset(t,e,n,o,r,s){return jp(t,e/2+r,n,o,s)}}const qk=new Xk;function x_(i,t,e,n){const o=2*t;return i.rect(e-t,n-t,o,o),!1}class Zk extends Ze{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,o){return x_(t,e/2,n,o)}drawOffset(t,e,n,o,r){return x_(t,e/2+r,n,o)}}const Jk=new Zk;function A_(i,t,e,n,o=0){return i.moveTo(e+t+2*o,t+n+o),i.lineTo(e-t-2*o,t+n+o),i.lineTo(e,n-t-2*o),i.closePath(),!0}class R_ extends Ze{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,n,o){return A_(t,e/2,n,o)}drawOffset(t,e,n,o,r){return A_(t,e/2,n,o,r)}}const Qk=new R_;class tL extends R_{constructor(){super(...arguments),this.type="triangle"}}const eL=new tL,T_=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),iL=Math.sin(Ri/10)*T_,nL=-Math.cos(Ri/10)*T_;function M_(i,t,e,n){const o=iL*t,r=nL*t;i.moveTo(e,-t+n),i.lineTo(o+e,r+n);for(let s=1;s<5;++s){const l=Ri*s/5,a=Math.cos(l),h=Math.sin(l);i.lineTo(h*t+e,-a*t+n),i.lineTo(a*o-h*r+e,h*o+a*r+n)}return i.closePath(),!0}class oL extends Ze{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,n,o){return M_(t,e/2,n,o)}drawOffset(t,e,n,o,r){return M_(t,e/2+r,n,o)}}const rL=new oL,sL=Kn(3);function B_(i,t,e,n){const o=t,r=o/sL,s=r/5,l=t;return i.moveTo(0+e,-o+n),i.lineTo(r/2+e,n),i.lineTo(s/2+e,n),i.lineTo(s/2+e,l+n),i.lineTo(-s/2+e,l+n),i.lineTo(-s/2+e,n),i.lineTo(-r/2+e,n),i.closePath(),!0}class lL extends Ze{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,n,o){return B_(t,e/2,n,o)}drawOffset(t,e,n,o,r){return B_(t,e/2+r,n,o)}}const aL=new lL;function P_(i,t,e,n){const o=2*t;return i.moveTo(e,-t+n),i.lineTo(o/3/2+e,t+n),i.lineTo(-o/3/2+e,t+n),i.closePath(),!0}class hL extends Ze{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,n,o){return P_(t,e/2,n,o)}drawOffset(t,e,n,o,r){return P_(t,e/2+r,n,o)}}const dL=new hL;function H_(i,t,e,n){return i.moveTo(-t+e,n),i.lineTo(e,t+n),!1}class uL extends Ze{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,n,o){return H_(t,e/2,n,o)}drawOffset(t,e,n,o,r){return H_(t,e/2+r,n,o)}}const cL=new uL,Pn=-.5,Hn=Kn(3)/2,E_=1/Kn(12);function k_(i,t,e,n){const o=t/2,r=t*E_,s=o,l=t*E_+t,a=-s,h=l;return i.moveTo(o+e,r+n),i.lineTo(s+e,l+n),i.lineTo(a+e,h+n),i.lineTo(Pn*o-Hn*r+e,Hn*o+Pn*r+n),i.lineTo(Pn*s-Hn*l+e,Hn*s+Pn*l+n),i.lineTo(Pn*a-Hn*h+e,Hn*a+Pn*h+n),i.lineTo(Pn*o+Hn*r+e,Pn*r-Hn*o+n),i.lineTo(Pn*s+Hn*l+e,Pn*l-Hn*s+n),i.lineTo(Pn*a+Hn*h+e,Pn*h-Hn*a+n),i.closePath(),!1}class gL extends Ze{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,n,o){return k_(t,e/2,n,o)}drawOffset(t,e,n,o,r){return k_(t,e/2+r,n,o)}}const fL=new gL;function L_(i,t,e,n,o){return i.moveTo(-t+e-2*o,n),i.lineTo(t+e+o,t+n+2*o),i.lineTo(t+e+o,n-t-2*o),i.closePath(),!0}class pL extends Ze{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,n,o){return L_(t,e/2,n,o,0)}drawOffset(t,e,n,o,r){return L_(t,e/2,n,o,r)}}const mL=new pL;function F_(i,t,e,n,o=0){return i.moveTo(e-t-o,t+n+2*o),i.lineTo(t+e+2*o,n),i.lineTo(e-t-o,n-t-2*o),i.closePath(),!0}class vL extends Ze{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,n,o){return F_(t,e/2,n,o)}drawOffset(t,e,n,o,r){return F_(t,e/2,n,o,r)}}const bL=new vL;function I_(i,t,e,n,o=0){return i.moveTo(e-t-2*o,n-t-o),i.lineTo(e+t+2*o,n-t-o),i.lineTo(e,n+t+2*o),i.closePath(),!0}class CL extends Ze{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,n,o){return I_(t,e/2,n,o)}drawOffset(t,e,n,o,r){return I_(t,e/2,n,o,r)}}const yL=new CL,$p=Kn(3);function D_(i,t,e,n){const o=t*$p;return i.moveTo(e,n+-o/3*2),i.lineTo(t+e,n+o),i.lineTo(e-t,n+o),i.closePath(),!0}class _L extends Ze{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,n,o){return D_(t,e/2/$p,n,o)}drawOffset(t,e,n,o,r){return D_(t,e/2/$p+r,n,o)}}const wL=new _L;function O_(i,t,e,n){const o=2*t;return i.moveTo(t+e,n-o),i.lineTo(e-t,n),i.lineTo(t+e,o+n),!0}class SL extends Ze{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,n,o){return O_(t,e/4,n,o)}drawOffset(t,e,n,o,r){return O_(t,e/4+r,n,o)}}const xL=new SL;function z_(i,t,e,n){const o=2*t;return i.moveTo(e-t,n-o),i.lineTo(e+t,n),i.lineTo(e-t,o+n),!0}class AL extends Ze{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,n,o){return z_(t,e/4,n,o)}drawOffset(t,e,n,o,r){return z_(t,e/4+r,n,o)}}const RL=new AL;function W_(i,t,e,n){const o=2*t;return i.moveTo(e-o,n+t),i.lineTo(e,n-t),i.lineTo(e+o,n+t),!0}class TL extends Ze{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,n,o){return W_(t,e/4,n,o)}drawOffset(t,e,n,o,r){return W_(t,e/4+r,n,o)}}const ML=new TL;function N_(i,t,e,n){const o=2*t;return i.moveTo(e-o,n-t),i.lineTo(e,n+t),i.lineTo(e+o,n-t),!0}class BL extends Ze{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,n,o){return N_(t,e/4,n,o)}drawOffset(t,e,n,o,r){return N_(t,e/4+r,n,o)}}const PL=new BL;function V_(i,t,e,n,o){return i.moveTo(e,n-t),i.lineTo(e,n+t),!0}class HL extends Ze{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,n,o,r){return V_(t,e/2,n,o)}drawOffset(t,e,n,o,r,s){return V_(t,e/2+r,n,o)}drawToSvgPath(t,e,n,o){const r=t/2;return`M ${e}, ${n-r} L ${e},${n+r}`}}const EL=new HL;function j_(i,t,e,n,o){return i.moveTo(e-t,n),i.lineTo(e+t,n),!0}class kL extends Ze{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,n,o,r){return j_(t,e/2,n,o)}drawOffset(t,e,n,o,r,s){return j_(t,e/2+r,n,o)}drawToSvgPath(t,e,n,o){const r=t/2;return`M ${e-r}, ${n} L ${e+r},${n}`}}const LL=new kL;function $_(i,t,e,n,o){return i.moveTo(e-t,n-t),i.lineTo(e+t,n+t),i.moveTo(e+t,n-t),i.lineTo(e-t,n+t),!0}class FL extends Ze{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,n,o,r){return $_(t,e/2,n,o)}drawOffset(t,e,n,o,r,s){return $_(t,e/2+r,n,o)}drawToSvgPath(t,e,n,o){const r=t/2;return`M ${e-r}, ${n-r} L ${e+r},${n+r} M ${e+r}, ${n-r} L ${e-r},${n+r}`}}const IL=new FL;function G_(i,t,e,n){return i.rect(e-t[0]/2,n-t[1]/2,t[0],t[1]),!1}function U_(i,t,e,n){const o=t,r=t/2;return i.rect(e-o/2,n-r/2,o,r),!1}class DL extends Ze{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,n,o){return ut(e)?U_(t,e,n,o):G_(t,e,n,o)}drawOffset(t,e,n,o,r){return ut(e)?U_(t,e+2*r,n,o):G_(t,[e[0]+2*r,e[1]+2*r],n,o)}}const OL=new DL,wa=new Fe;class K_{constructor(t,e,n=!1){this.pathStr="",this.type=t,ot(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,n,o,r,s,l){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach(a=>{t.beginPath(),hr(a.path.commandList,t,n,o,e,e),l&&l(a.path,a.attribute)}),!1):(hr(this.path.commandList,t,n,o,e+r,e+r),!1)}draw(t,e,n,o,r,s){return this.drawOffset(t,e,n,o,0,r,s)}bounds(t,e){if(this.isSvg)return this.svgCache?(e.clear(),void this.svgCache.forEach(({path:n})=>{wa.x1=n.bounds.x1*t,wa.y1=n.bounds.y1*t,wa.x2=n.bounds.x2*t,wa.y2=n.bounds.y2*t,e.union(wa)})):void 0;this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const zL=[$k,Yk,qk,Jk,wL,eL,rL,aL,dL,cL,fL,mL,bL,Qk,yL,xL,RL,ML,PL,OL,EL,LL,IL],Y_={};zL.forEach(i=>{Y_[i.type]=i});const WL={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},NL=(i,t,e)=>{const{outerBorder:n,shadowBlur:o=t.shadowBlur,strokeBoundsBuffer:r=t.strokeBoundsBuffer}=i;if(n){const s=t.outerBorder,{distance:l=s.distance,lineWidth:a=s.lineWidth}=n;xd(e,l+(o+a)/2,!0,r)}return e},iu=new Fe,X_=["symbolType","size",...Mn];let Gp=class Nl extends Ji{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=Pd}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return ot(t)?t.length===2&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const t=this.getGraphicTheme();let{symbolType:e=t.symbolType}=this.attribute,n=Y_[e];if(n)return this._parsedPath=n,n;if(n=Nl.userSymbolMap[e],n)return this._parsedPath=n,n;if(e=WL[e]||e,KH(e)===!0){const a=new Sd,{svg:h}=a.parse(e);if(!h)return null;const d=ot(h.path)?h.path:[h.path];iu.clear();const u=[];d.forEach(p=>{const m=new wi().fromString(p.d),v={};tE.forEach(C=>{p[C]&&(v[zy[C]]=p[C])}),u.push({path:m,attribute:v}),iu.union(m.bounds)});const c=iu.width(),g=iu.height(),f=1/ar(c,g);return u.forEach(p=>p.path.transform(0,0,f,f)),this._parsedPath=new K_(e,u,!0),Nl.userSymbolMap[e]=this._parsedPath,this._parsedPath}const o=new wi().fromString(e),r=o.bounds.width(),s=o.bounds.height(),l=1/ar(r,s);return o.transform(0,0,l,l),this._parsedPath=new K_(e,o),Nl.userSymbolMap[e]=this._parsedPath,this._parsedPath}getGraphicTheme(){return Ut(this).symbol}updateAABBBounds(t,e,n,o){this.updatePathProxyAABBBounds(n)||(o?this.updateSymbolAABBBoundsImprecise(t,e,n):this.updateSymbolAABBBoundsAccurate(t,e,n));const{tb1:r,tb2:s}=tt.graphicService.updateTempAABBBounds(n);NL(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:l=e.lineJoin}=t;return tt.graphicService.transformAABBBounds(t,n,e,l==="miter",this),n}updateSymbolAABBBoundsImprecise(t,e,n){const{size:o=e.size}=t;if(ot(o))n.set(-o[0]/2,-o[1]/2,o[0]/2,o[1]/2);else{const r=o/2;n.set(-r,-r,r,r)}return n}updateSymbolAABBBoundsAccurate(t,e,n){const{size:o=e.size}=t;return this.getParsedPath().bounds(o,n),n}needUpdateTags(t){return super.needUpdateTags(t,X_)}needUpdateTag(t){return super.needUpdateTag(t,X_)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=ot(e)?e:[e,e];return t.path?new wi().fromCustomPath2D(t.path,0,0,n[0],n[1]):new wi().fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new Nl(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Nl.NOWORK_ANIMATE_ATTR}};Gp.userSymbolMap={},Gp.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Yn);function Sa(i){return new Gp(i)}const q_=["segments","points","curveType","curveTension",...Mn];let Up=class Jv extends Ji{constructor(t={}){super(t),this.type="line",this.numberType=ca}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?e.length!==0:!!t&&!(t.length<=1)}_interpolate(t,e,n,o,r){t==="points"&&(r.points=wy(n,o,e))}getGraphicTheme(){return Ut(this).line}updateAABBBounds(t,e,n){this.updatePathProxyAABBBounds(n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,n):this.updateLineAABBBoundsByPoints(t,e,n)),tt.graphicService.updateTempAABBBounds(n);const{lineJoin:o=e.lineJoin}=t;return tt.graphicService.transformAABBBounds(t,n,e,o==="miter",this),n}updateLineAABBBoundsByPoints(t,e,n,o){const{points:r=e.points,connectedType:s}=t,l=n;return r.forEach(a=>{a.defined===!1&&s!=="zero"&&s!=="connect"||l.add(a.x,a.y)}),l}updateLineAABBBoundsBySegments(t,e,n,o){const{segments:r=e.segments,connectedType:s}=t,l=n;return r.forEach(a=>{a.points.forEach(h=>{h.defined===!1&&s!=="zero"&&s!=="connect"||l.add(h.x,h.y)})}),l}needUpdateTags(t){return super.needUpdateTags(t,q_)}needUpdateTag(t){return super.needUpdateTag(t,q_)}toCustomPath(){const t=this.attribute,e=new wi,n=t.segments,o=r=>{if(r&&r.length){let s=!0;r.forEach(l=>{l.defined!==!1&&(s?e.moveTo(l.x,l.y):e.lineTo(l.x,l.y),s=!1)})}};return n&&n.length?n.forEach(r=>{o(r.points)}):t.points&&o(t.points),e}clone(){return new Jv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Jv.NOWORK_ANIMATE_ATTR}};Up.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Yn);function gn(i){return new Up(i)}const Z_=["width","x1","y1","height","cornerRadius",...Mn];let nu=class Qv extends Ji{constructor(t){super(t),this.type="rect",this.numberType=gp}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Ut(this).rect}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){let{width:s,height:l}=t;const{x1:a,y1:h,x:d,y:u}=t;s=s??a-d,l=l??h-u,(isFinite(s)||isFinite(l)||isFinite(d)||isFinite(u))&&n.set(0,0,s||0,l||0)}const{tb1:o,tb2:r}=tt.graphicService.updateTempAABBBounds(n);return _a(t,e,o),n.union(o),o.setValue(r.x1,r.y1,r.x2,r.y2),tt.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,Z_)}needUpdateTag(t){return super.needUpdateTag(t,Z_)}toCustomPath(){const t=this.attribute,{x:e,y:n,width:o,height:r}=EH(t),s=new wi;return s.moveTo(e,n),s.rect(e,n,o,r),s}clone(){return new Qv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Qv.NOWORK_ANIMATE_ATTR}};nu.NOWORK_ANIMATE_ATTR=Yn;function Ie(i){return new nu(i)}class VL{constructor(t,e,n,o,r,s,l,a,h,d,u,c,g,f){this.left=t,this.top=e,this.width=n,this.height=o,this.actualHeight=0,this.bottom=e+o,this.right=t+n,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=l,this.lines=[],this.globalAlign=a,this.globalBaseline=h,this.layoutDirection=d,this.directionKey=Jf[this.layoutDirection],this.isWidthMax=u,this.isHeightMax=c,this.singleLine=g,f?(f.clear(),this.icons=f):this.icons=new Map}draw(t,e){const{width:n,height:o}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,n):this.width||n||0;let s=this.isHeightMax?Math.min(this.height,o):this.height||o||0;s=Math.min(s,o);let l=0;switch(this.globalBaseline){case"top":l=0;break;case"middle":l=-s/2;break;case"bottom":l=-s}let a=0;this.globalAlign==="right"||this.globalAlign==="end"?a=-r:this.globalAlign==="center"&&(a=-r/2);let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let d=!1;if(this.verticalDirection==="middle")if(this.actualHeight>=h&&h!==0)for(let u=0;u<this.lines.length;u++){const{top:c,height:g}=this.lines[u];if(c+g<this[this.directionKey.top]||c+g>this[this.directionKey.top]+h)return d;let f=!1;this.ellipsis&&this.lines[u+1]&&this.lines[u+1].top+this.lines[u+1].height>this[this.directionKey.top]+h&&(f=!0,d=!0),this.lines[u].draw(t,f,this.lines[u][this.directionKey.left]+a,this.lines[u][this.directionKey.top]+l,this.ellipsis,e)}else{const u=Math.floor((h-this.actualHeight)/2);this.layoutDirection==="vertical"?a+=u:l+=u;for(let c=0;c<this.lines.length;c++)this.lines[c].draw(t,!1,this.lines[c][this.directionKey.left]+a,this.lines[c][this.directionKey.top]+l,this.ellipsis,e)}else if(this.verticalDirection==="bottom"&&this.layoutDirection!=="vertical")for(let u=0;u<this.lines.length;u++){const{top:c,height:g}=this.lines[u],f=h-this.lines[u].top-this.lines[u].height;if(h===0)this.lines[u].draw(t,!1,a,f+l,this.ellipsis,e);else{if(f+g>this[this.directionKey.top]+h||f<this[this.directionKey.top])return d;{let p=!1;this.ellipsis&&this.lines[u+1]&&f-this.lines[u+1].height<this[this.directionKey.top]&&(p=!0,d=!0),this.lines[u].draw(t,p,a,f+l,this.ellipsis,e)}}}else{this.verticalDirection==="bottom"&&this.layoutDirection==="vertical"&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let u=0;u<this.lines.length;u++){this.verticalDirection==="bottom"&&this.layoutDirection==="vertical"&&(a-=this.lines[u].height+this.lines[u].top);const{top:c,height:g}=this.lines[u];if(h===0)this.lines[u].draw(t,!1,this.lines[u][this.directionKey.left]+a,this.lines[u][this.directionKey.top]+l,this.ellipsis,e);else{if(c+g<this[this.directionKey.top]||c+g>this[this.directionKey.top]+h)return d;{let f=!1;this.ellipsis&&this.lines[u+1]&&this.lines[u+1].top+this.lines[u+1].height>this[this.directionKey.top]+h&&(f=!0,d=!0),this.lines[u].draw(t,f,this.lines[u][this.directionKey.left]+a,this.lines[u][this.directionKey.top]+l,this.ellipsis,e)}}}}return d}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let n=0;n<this.lines.length;n++){const o=this.lines[n];o.actualWidth>t&&(t=o.actualWidth),e+=o.height}return{width:this.layoutDirection==="vertical"?e:t,height:this.layoutDirection==="vertical"?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:n,height:o}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),this.verticalDirection==="middle")if(this.actualHeight>=r&&r!==0)for(let s=0;s<this.lines.length;s++){const{top:l,height:a}=this.lines[s];if(!(l+a<this[this.directionKey.top]||l+a>this[this.directionKey.top]+r))if(this.ellipsis&&this.lines[s+1]&&this.lines[s+1].top+this.lines[s+1].height>this[this.directionKey.top]+r){const h=this.ellipsis===!0?"...":this.ellipsis||"",d=this.lines[s].getWidthWithEllips(h);d>t&&(t=d),e+=this.lines[s].height}else this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height}else{Math.floor((r-this.actualHeight)/2);for(let s=0;s<this.lines.length;s++)this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height}else if(this.verticalDirection==="bottom")for(let s=0;s<this.lines.length;s++){const{top:l,height:a}=this.lines[s],h=r-this.lines[s].top-this.lines[s].height;if(r===0)this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height;else if(!(h+a>this[this.directionKey.top]+r||h<this[this.directionKey.top]))if(this.ellipsis&&this.lines[s+1]&&h-this.lines[s+1].height<this[this.directionKey.top]){const d=this.ellipsis===!0?"...":this.ellipsis||"",u=this.lines[s].getWidthWithEllips(d);u>t&&(t=u),e+=this.lines[s].height}else this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height}else for(let s=0;s<this.lines.length;s++){const{top:l,height:a}=this.lines[s];if(r===0)this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height;else if(!(l+a<this[this.directionKey.top]||l+a>this[this.directionKey.top]+r))if(this.ellipsis&&this.lines[s+1]&&this.lines[s+1].top+this.lines[s+1].height>this[this.directionKey.top]+r){const h=this.ellipsis===!0?"...":this.ellipsis||"",d=this.lines[s].getWidthWithEllips(h);d>t&&(t=d),e+=this.lines[s].height}else this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height}return{width:this.layoutDirection==="vertical"?e:t,height:this.layoutDirection==="vertical"?t:e}}}class xa{constructor(t,e,n){this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic";const o=Io(n.lineHeight,this.fontSize);this.lineHeight=typeof o=="number"?o>this.fontSize?o:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:r,height:s,descent:l,width:a}=Vs(t,n);let h=0,d=0,u=0;this.height>s&&(h=(this.height-s)/2,d=Math.ceil(h),u=Math.floor(h)),this.textBaseline==="top"?(this.ascent=h,this.descent=s-h):this.textBaseline==="bottom"?(this.ascent=s-h,this.descent=h):this.textBaseline==="middle"?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=r+d,this.descent=l+u),this.length=t.length,this.width=a||0,this.text=t||"",this.newLine=e||!1,this.character=n,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,n.direction==="vertical"&&(this.direction=n.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=Vs(this.text,this.character);this.width=t,this.direction==="vertical"&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,n,o,r){let s=this.text,l=this.left+n;e+=this.top;let a=this.direction;if(this.verticalEllipsis)s=this.ellipsisStr,a="vertical",e-=this.ellipsisWidth/2;else{if(this.ellipsis==="hide")return;if(this.ellipsis==="add")s+=this.ellipsisStr,r!=="right"&&r!=="end"||(l-=this.ellipsisWidth);else if(this.ellipsis==="replace"){const h=Qf(s,(a==="vertical"?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,h),s+=this.ellipsisStr,r==="right"||r==="end"){const{width:d}=Vs(this.text.slice(h),this.character);a==="vertical"||(l-=this.ellipsisWidth-d)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}a==="vertical"&&(t.save(),t.rotateAbout(Math.PI/2,l,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(l,e),l=0,e=0),this.character.stroke&&(fH(t,this.character),t.strokeText(s,l,e)),gH(t,this.character),this.character.fill&&t.fillText(s,l,e),this.character.fill&&(typeof this.character.lineThrough=="boolean"||typeof this.character.underline=="boolean"?(this.character.underline&&t.fillRect(l,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(l,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):this.character.textDecoration==="underline"?t.fillRect(l,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):this.character.textDecoration==="line-through"&&t.fillRect(l,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),a==="vertical"&&t.restore()}getWidthWithEllips(t){let e=this.text;const n=t==="vertical"?this.height:this.width;if(this.ellipsis==="hide")return n;if(this.ellipsis==="add")return n+this.ellipsisWidth;if(this.ellipsis==="replace"){const o=Qf(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,o),e+=this.ellipsisStr;const{width:r}=Vs(this.text.slice(o),this.character);return n+this.ellipsisWidth-r}return n}}function jL(i,t){const e=i.text.slice(0,t),n=i.text.slice(t);return[new xa(e,i.newLine,i.character),new xa(n,!0,i.character)]}const J_=["width","height","image",...Mn];let Wo=class tb extends Ji{constructor(t){super(t),this.type="image",this.numberType=Td,this.loadImage(this.attribute.image)}get width(){var t;return(t=this.attribute.width)!==null&&t!==void 0?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return(t=this.attribute.height)!==null&&t!==void 0?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return(t=this.attribute.repeatX)!==null&&t!==void 0?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return(t=this.attribute.repeatY)!==null&&t!==void 0?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,n){super.imageLoadSuccess(t,e,()=>{this.successCallback&&this.successCallback()})}imageLoadFail(t,e){super.imageLoadFail(t,()=>{this.failCallback&&this.failCallback()})}setAttributes(t,e,n){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,n)}setAttribute(t,e,n,o){return t==="image"&&this.loadImage(e),super.setAttribute(t,e,n,o)}getGraphicTheme(){return Ut(this).image}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){const{width:s=e.width,height:l=e.height}=t;n.set(0,0,s,l)}const{tb1:o,tb2:r}=tt.graphicService.updateTempAABBBounds(n);return _a(t,e,o),n.union(o),o.setValue(r.x1,r.y1,r.x2,r.y2),tt.graphicService.transformAABBBounds(t,n,e,!1,this),n}getDefaultAttribute(t){return na[t]}needUpdateTags(t){return super.needUpdateTags(t,J_)}needUpdateTag(t){return super.needUpdateTag(t,J_)}clone(){return new tb(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return tb.NOWORK_ANIMATE_ATTR}};Wo.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Yn);function ou(i){return new Wo(i)}class No extends Wo{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],t.backgroundShowMode==="always"&&(this._hovered=!0),t.margin){const e=ha(t.margin);this._marginArray=typeof e=="number"?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(e,n,o)=>{if(ot(o)&&o.indexOf("margin")!==-1||o==="margin")if(n.margin){const r=ha(n.margin);this._marginArray=typeof r=="number"?[r,r,r,r]:r}else this._marginArray=[0,0,0,0]}}get width(){var t;return((t=this.attribute.width)!==null&&t!==void 0?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return((t=this.attribute.height)!==null&&t!==void 0?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=na.width,height:e=na.height}=this.attribute,{backgroundWidth:n=t,backgroundHeight:o=e}=this.attribute,r=(n-t)/2,s=(o-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){this.attribute.backgroundShowMode==="hover"&&this._hovered!==t&&(this._hovered=t)}}class $L{constructor(t,e,n,o,r,s,l,a){this.left=t,this.width=e,this.baseline=n,this.ascent=o,this.descent=r,this.top=n-o,this.paragraphs=s.map(d=>d),this.textAlign=(this.paragraphs[0]instanceof No?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=l,this.directionKey=Jf[this.direction],this.actualWidth=0;let h=0;this.paragraphs.forEach((d,u)=>{if(u===0&&d instanceof xa){const c=cH.exec(d.text);(c==null?void 0:c.index)!==0&&(d.text=d.text.slice(c==null?void 0:c.index),d.updateWidth())}this.actualWidth+=d[this.directionKey.width],h=Math.max(d[this.directionKey.height],h)}),this.height=h,this.blankWidth=a?0:this.width-this.actualWidth,this.calcOffset(e,a)}calcOffset(t,e){const n=this.directionKey,o=this.height;let r=this.left,s=0;this.actualWidth<t&&!e&&(this.textAlign==="right"||this.textAlign==="end"?r=t-this.actualWidth:this.textAlign==="center"?r=(t-this.actualWidth)/2:this.textAlign==="justify"&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map(function(l){l instanceof No?(l["_"+n.x]=r,r+=l[n.width]+s,l["_"+n.y]=l.attribute.textBaseline==="top"?0:l.attribute.textBaseline==="bottom"?o-l.height:(o-l.height)/2):(l[n.left]=r,r+=l[n.width]+s)})}draw(t,e,n,o,r,s){if(r&&(e||this.paragraphs.some(l=>l.overflow))){let l=!0,a=!1;for(let d=this.paragraphs.length-1;d>=0;d--){const u=this.paragraphs[d];if(u.overflow)l=l&&u.text==="";else if(l){a=!0;break}}let h=0;if(!a)for(let d=this.paragraphs.length-1;d>=0;d--){const u=this.paragraphs[d];if(u.overflow){if(u.text==="")break;continue}if(u instanceof No)break;if(this.direction==="vertical"&&u.direction!=="vertical"){u.verticalEllipsis=!0;break}const c=r===!0?"...":r||"";u.ellipsisStr=c;const{width:g}=Vs(c,u.character),f=g||0;if(f<=this.blankWidth+h){e&&(u.ellipsis="add");break}if(f<=this.blankWidth+h+u.width){u.ellipsis="replace",u.ellipsisWidth=f,u.ellipsisOtherParagraphWidth=this.blankWidth+h;break}u.ellipsis="hide",h+=u.width}}this.paragraphs.map((l,a)=>{if(l instanceof No)return l.setAttributes({x:n+l._x,y:o+l._y}),void s(l,t,n+l._x,o+l._y,this.ascent);l.draw(t,o+this.ascent,n,a===0,this.textAlign)})}getWidthWithEllips(t){let e=0;for(let o=this.paragraphs.length-1;o>=0;o--){const r=this.paragraphs[o];if(r instanceof No)break;const{width:s}=Vs(t,r.character),l=s||0;if(l<=this.blankWidth+e){r.ellipsis="add",r.ellipsisWidth=l;break}if(l<=this.blankWidth+e+r.width){r.ellipsis="replace",r.ellipsisWidth=l,r.ellipsisOtherParagraphWidth=this.blankWidth+e;break}r.ellipsis="hide",e+=r.width}let n=0;return this.paragraphs.map((o,r)=>{n+=o instanceof No?o.width:o.getWidthWithEllips(this.direction)}),n}}class GL{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=Jf[this.direction]}store(t){if(t instanceof No){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,n=0;t.attribute.textBaseline==="top"?(e=0,n=t.height):t.attribute.textBaseline==="bottom"?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}else this.lineBuffer.push(t),t.text.length!==0?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(this.lineBuffer.length===0)return;const t=this.maxAscent===0?this.maxAscentForBlank:this.maxAscent,e=this.maxDescent===0?this.maxDescentForBlank:this.maxDescent,n=new $L(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,this.direction==="horizontal"?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(n),this.frame.actualHeight+=n.height,this.y+=n.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t,e=!1){t instanceof No?this.direction==="horizontal"&&this.width===0||this.direction==="vertical"&&this.height===0||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineBuffer.length===0?(this.store(t),this.send()):(this.send(),this.deal(t)):typeof this.width!="number"||this.width<0||(t.newLine&&this.send(),t.text.length!==0&&(this.direction==="horizontal"&&this.width===0||this.direction==="vertical"&&this.height===0||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const n=this[this.directionKey.width]-this.lineWidth||0,o=Math.ceil(n/t[this.directionKey.width]*t.length)||0,r=Qf(t.text,n,t.character,o,this.frame.wordBreak==="break-word");if(r!==0){const[s,l]=jL(t,r);this.store(s),e?this.send():this.deal(l)}else this.lineBuffer.length!==0&&(this.send(),this.deal(t))}}const Q_=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize",...Mn];class Qn extends Ji{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=fp,this.onBeforeAttributeUpdate=(e,n,o)=>{for(const r in e)if(r==="hoverIconId"){if(e[r]===n[r])continue;const s=this._frameCache.icons.get(e[r]);this.updateHoverIconState(s)}}}get width(){var t;return(t=this.attribute.width)!==null&&t!==void 0?t:Eo.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return(t=this.attribute.height)!==null&&t!==void 0?t:Eo.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return(t=this.attribute.ellipsis)!==null&&t!==void 0?t:Eo.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return(t=this.attribute.wordBreak)!==null&&t!==void 0?t:Eo.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return(t=this.attribute.verticalDirection)!==null&&t!==void 0?t:Eo.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return(t=this.attribute.textAlign)!==null&&t!==void 0?t:Eo.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return(t=this.attribute.textBaseline)!==null&&t!==void 0?t:Eo.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return(t=this.attribute.textConfig)!==null&&t!==void 0?t:Eo.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Ut(this).richtext}updateAABBBounds(t,e,n){const{width:o=e.width,height:r=e.height,maxWidth:s=e.maxWidth,maxHeight:l=e.maxHeight,textAlign:a=e.textAlign,textBaseline:h=e.textBaseline}=t;if(o>0&&r>0)n.set(0,0,o,r);else{const c=this.getFrameCache(),{width:g,height:f}=c.getActualSize();let p=o||g||0,m=r||f||0;m=typeof l=="number"&&m>l?l:m||0,p=typeof s=="number"&&p>s?s:p||0,n.set(0,0,p,m)}let d=0;switch(h){case"top":d=0;break;case"middle":d=-n.height()/2;break;case"bottom":d=-n.height()}let u=0;switch(a){case"left":u=0;break;case"center":u=-n.width()/2;break;case"right":u=-n.width()}return n.translate(u,d),tt.graphicService.updateTempAABBBounds(n),t.forceBoundsHeight==null&&t.forceBoundsWidth==null||tt.graphicService.updateHTMLTextAABBBounds(t,e,n),tt.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,Q_)}needUpdateTag(t){return super.needUpdateTag(t,Q_)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let n=0;n<t.lines.length;n++){const o=t.lines[n];for(let r=0;r<o.paragraphs.length;r++){const s=o.paragraphs[r];if(s.overflow&&s.text!=="")return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:n,fontSize:o,fontFamily:r,fontStyle:s,fontWeight:l,lineWidth:a,opacity:h,fillOpacity:d,strokeOpacity:u}=this.attribute;return Object.assign({fill:e,stroke:n,fontSize:o,fontFamily:r,fontStyle:s,fontWeight:l,lineWidth:a,opacity:h,fillOpacity:d,strokeOpacity:u},t)}doUpdateFrameCache(t){var e;const{textConfig:n=[],maxWidth:o,maxHeight:r,width:s,height:l,ellipsis:a,wordBreak:h,verticalDirection:d,textAlign:u,textBaseline:c,layoutDirection:g,singleLine:f,disableAutoWrapLine:p}=this.attribute,m=[],v=t??n;for(let A=0;A<v.length;A++)if("image"in v[A]){const x=this.combinedStyleToCharacter(v[A]);x.lineWidth=void 0;const T=x.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(x.id);if(T)m.push(T);else{const M=new No(x);M.successCallback=()=>{var B;this.addUpdateBoundTag(),(B=this.stage)===null||B===void 0||B.renderNextFrame()},M.richtextId=x.id,m.push(M)}}else{const x=this.combinedStyleToCharacter(v[A]);if(ut(x.text)&&(x.text=`${x.text}`),x.text&&x.text.includes(`
|
|
8
8
|
`)){const T=x.text.split(`
|