@ecan-bi/pivot-table 1.0.15 → 1.0.16
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.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @ecan-bi/pivot-table@1.0.
|
|
1
|
+
/*! @ecan-bi/pivot-table@1.0.16 */
|
|
2
2
|
(function(Ei,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("vue"),require("dayjs"),require("lodash-es"),require("ant-design-vue/es/input-number/style"),require("ant-design-vue/es/form/style"),require("ant-design-vue"),require("echarts"),require("vuedraggable"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","dayjs","lodash-es","ant-design-vue/es/input-number/style","ant-design-vue/es/form/style","ant-design-vue","echarts","vuedraggable","axios"],S):(Ei=typeof globalThis<"u"?globalThis:Ei||self,S(Ei["@ecan-bi/pivot-table"]={},Ei.Vue,Ei.Dayjs,Ei.LodashEs,null,null,Ei.AntDesignVue,Ei.Echarts,Ei.Draggable,Ei.Axios))})(this,function(Ei,S,M7,co,P7,H7,Kn,hA,Lm,dA){var sA;"use strict";function uA(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 cA=uA(hA),gA=i=>(i.install=t=>{t.component(i.name,i)},i),fA=(i,t)=>Object.prototype.hasOwnProperty.call(i,t);function pA(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 mA=i=>({DIM:"维度",BUILT_IN_DIM:"维度",IDX:"指标",BUILT_IN_IDX:"指标",FIELD:"数据集"})[i],vA=i=>({0:"文本",1:"数值",2:"日期"})[i],bA=i=>i==="0"?"手工录入":i==="1"?"系统取数":i==="2"?"运算加工":"",CA=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},yA=i=>i==="0"?"指标库":i==="1"?"视图":i==="2"?"数据集":"其他";class De{static GenAutoIncrementId(){return De.auto_increment_id++}}De.auto_increment_id=0;class Ft{constructor(t){this.id=De.GenAutoIncrementId(),this.registry=t}}const Ya="named",km="inject",Fm="multi_inject",Im="inversify:tagged",zm="inversify:paramtypes";class qc{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===Ya?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}const Jr=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,L,k,I){if(!_(k))throw new TypeError;return v(P,L,k,I)}function h(P,L,k){if(!_(L))throw new TypeError;return w(k)||(k=B(k)),g(P,L,k)}function d(P,L,k){if(!_(L))throw new TypeError;return w(k)||(k=B(k)),f(P,L,k)}function u(P,L,k){if(!_(L))throw new TypeError;return w(k)||(k=B(k)),p(P,L,k)}function c(P,L,k){let I=l.get(P);if(w(I)){if(!k)return;I=new s,l.set(P,I)}let E=I.get(L);if(w(E)){if(!k)return;E=new s,I.set(L,E)}return E}function g(P,L,k){if(f(P,L,k))return!0;const I=F(L);return!y(I)&&g(P,I,k)}function f(P,L,k){const I=c(L,k,!1);return!w(I)&&x(I.has(P))}function p(P,L,k){if(f(P,L,k))return m(P,L,k);const I=F(L);return y(I)?void 0:p(P,I,k)}function m(P,L,k){const I=c(L,k,!1);if(!w(I))return I.get(P)}function v(P,L,k,I){c(k,I,!0).set(P,L)}function b(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 y(P){return P===null}function C(P){return typeof P=="symbol"}function _(P){return typeof P=="object"?P!==null:typeof P=="function"}function A(P,L){switch(b(P)){case 0:case 1:case 2:case 3:case 4:case 5:return P}const k=L===3?"string":L===5?"number":"default",I=H(P,o);if(I!==void 0){const E=I.call(P,k);if(_(E))throw new TypeError;return E}return R(P,k==="default"?"number":k)}function R(P,L){if(L==="string"){const k=P.toString;if(M(k)){const E=k.call(P);if(!_(E))return E}const I=P.valueOf;if(M(I)){const E=I.call(P);if(!_(E))return E}}else{const k=P.valueOf;if(M(k)){const E=k.call(P);if(!_(E))return E}const I=P.toString;if(M(I)){const E=I.call(P);if(!_(E))return E}}throw new TypeError}function x(P){return!!P}function T(P){return""+P}function B(P){const L=A(P,3);return C(L)?L:T(L)}function M(P){return typeof P=="function"}function H(P,L){const k=P[L];if(k!=null){if(!M(k))throw new TypeError;return k}}function F(P){const L=Object.getPrototypeOf(P);if(typeof P!="function"||P===r||L!==r)return L;const k=P.prototype,I=k&&Object.getPrototypeOf(k);if(I==null||I===Object.prototype)return L;const E=I.constructor;return typeof E!="function"||E===P?L:E}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 _A(i,t,e,n){const o=[n];let r={};Jr.hasOwnMetadata(i,t)&&(r=Jr.getMetadata(i,t));let s=r[e];s===void 0&&(s=[]),s.push(...o),r[e]=s,Jr.defineMetadata(i,r,t)}function wA(i,t,e,n){_A(Im,i,e.toString(),n)}function Om(i){return(t,e,n)=>{wA(t,e,n,i)}}function Dm(i){return t=>(e,n,o)=>Om(new qc(i,t))(e,n,o)}const Xt=Dm(km),Wm=Dm(Fm);function at(){return function(i){return Jr.defineMetadata(zm,null,i),i}}function Ye(i){return Om(new qc(Ya,i))}const gr={Singleton:"Singleton",Transient:"Transient"},Wo={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};class Zc{constructor(t,e){this.id=De.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=Wo.Invalid,this.constraint=n=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Zc(this.serviceIdentifier,this.scope);return t.activated=t.scope===gr.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 SA{getConstructorMetadata(t){return{compilerGeneratedMetadata:Jr.getMetadata(zm,t),userGeneratedMetadata:Jr.getMetadata(Im,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const xA=(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 qc(i,t),e})(Ya);class Xa{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=gr.Singleton,this}inTransientScope(){return this._binding.scope=gr.Transient,this}whenTargetNamed(t){return this._binding.constraint=xA(t),this}}class RA{constructor(t){this._binding=t}to(t){return this._binding.type=Wo.Instance,this._binding.implementationType=t,new Xa(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=Wo.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Xa(this._binding)}toConstantValue(t){return this._binding.type=Wo.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=gr.Singleton,new Xa(this._binding)}toFactory(t){return this._binding.type=Wo.Factory,this._binding.factory=t,this._binding.scope=gr.Singleton,new Xa(this._binding)}toService(t){this.toDynamicValue(e=>e.container.get(t))}}let AA=class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||gr.Transient,this.options=e,this.id=De.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new SA}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,Ya,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,n=new Zc(t,e),o=this._bindingDictionary.get(t)||[];return o.push(n),this._bindingDictionary.set(t,o),new RA(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[km],multiInject:a[Fm]},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 Wo.ConstantValue:case Wo.Function:e=t.cache;break;case Wo.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===gr.Singleton&&(t.cache=e,t.activated=!0)}};const We=Symbol("ContributionProvider");class Nm{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 fi(i,t){i(We).toDynamicValue(({container:e})=>new Nm(t,e)).inSingletonScope().whenTargetNamed(t)}function TA(i,t){i(We).toDynamicValue(({container:e})=>new Nm(t,e)).whenTargetNamed(t)}class BA{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 Li extends BA{call(...t){this.taps.map(e=>e.fn).forEach(e=>e(...t))}}const qa=Symbol.for("EnvContribution"),Jc=Symbol.for("VGlobal");var MA=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},PA=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},Vm=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Qc=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=De.GenAutoIncrementId(),this.hooks={onSetEnv:new Li(["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)}};Qc=MA([at(),Vm(0,Xt(We)),Vm(0,Ye(qa)),PA("design:paramtypes",[Object])],Qc);var fr={},HA={get exports(){return fr},set exports(i){fr=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,b,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,b=new Array(v-1);w<v;w++)b[w-1]=arguments[w];m.fn.apply(m.context,b)}else{var y=m.length,C;for(w=0;w<y;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(!b)for(C=1,b=new Array(v-1);C<v;C++)b[C-1]=arguments[C];m[w].fn.apply(m[w].context,b)}}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})(HA);const Qr=(i,t)=>Object.prototype.toString.call(i)===`[object ${t}]`,Xe=(i,t=!1)=>t?typeof i=="boolean":i===!0||i===!1||Qr(i,"Boolean"),te=i=>typeof i=="function",mt=i=>i==null,D=i=>i!=null,ie=i=>{const t=typeof i;return i!==null&&t==="object"||t==="function"},EA=i=>typeof i=="object"&&i!==null,ts=function(i){if(!EA(i)||!Qr(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},He=i=>i===void 0,ee=(i,t=!1)=>{const e=typeof i;return t?e==="string":e==="string"||Qr(i,"String")},Z=i=>Array.isArray?Array.isArray(i):Qr(i,"Array"),tg=function(i){return i!==null&&typeof i!="function"&&Number.isFinite(i.length)},jm=i=>Qr(i,"Date"),et=(i,t=!1)=>{const e=typeof i;return t?e==="number":e==="number"||Qr(i,"Number")},pe=i=>et(i)&&Number.isFinite(i),LA=i=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(i),kA=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),FA=i=>({}).toString.call(i).replace(/^\[object /,"").replace(/]$/,""),IA=Object.prototype,zA=function(i){const t=i&&i.constructor;return i===(typeof t=="function"&&t.prototype||IA)},OA=Object.prototype.hasOwnProperty;function Dt(i){if(mt(i))return!0;if(tg(i))return!i.length;const t=FA(i);if(t==="Map"||t==="Set")return!i.size;if(zA(i))return!Object.keys(i).length;for(const e in i)if(OA.call(i,e))return!1;return!0}const qe=(i,t,e)=>{const n=ee(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},DA=Object.prototype.hasOwnProperty,Gm=(i,t)=>i!=null&&DA.call(i,t);function we(i,t,e){let n;if(!D(i)||typeof i!="object"||t&&t(i))return i;const o=Z(i),r=i.length;n=o?new Array(r):typeof i=="object"?{}:Xe(i)||et(i)||ee(i)?i:jm(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]=we(h,t,e)}return n}function Um(i,t,e=!1,n=!1){if(t){if(i===t)return;if(D(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];!D(o[a])||typeof o[a]!="object"||n&&Z(i[a])?$m(i,a,o[a]):WA(i,t,a,e,n)}}}}function WA(i,t,e,n=!1,o=!1){const r=i[e],s=t[e];let l=t[e],a=!0;if(Z(s)){if(n)l=[];else if(Z(r))l=r;else if(tg(r)){l=new Array(r.length);let h=-1;const d=r.length;for(;++h<d;)l[h]=r[h]}}else ts(s)?(l=r??{},typeof r!="function"&&typeof r=="object"||(l={})):a=!1;a&&Um(l,s,n,o),$m(i,e,l)}function $m(i,t,e){(e!==void 0&&!NA(i[t],e)||e===void 0&&!(t in i))&&(i[t]=e)}function NA(i,t){return i===t||Number.isNaN(i)&&Number.isNaN(t)}function ct(i,...t){let e=-1;const n=t.length;for(;++e<n;)Um(i,t[e],!0);return i}function VA(i,t){if(!i||!ts(i))return i;const e={};return Object.keys(i).forEach(n=>{const o=i[n];let r=!1;t.forEach(s=>{(ee(s)&&s===n||s instanceof RegExp&&n.match(s))&&(r=!0)}),r||(e[n]=o)}),e}function Km(i){return Object.prototype.toString.call(i)}function Ym(i){return Object.keys(i)}function rl(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(Km(i)!==Km(t))return!1;if(te(i))return!!(e!=null&&e.skipFunction);if(typeof i!="object")return!1;if(Z(i)){if(i.length!==t.length)return!1;for(let r=i.length-1;r>=0;r--)if(!rl(i[r],t[r],e))return!1;return!0}if(!ts(i))return!1;const n=Ym(i),o=Ym(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(!rl(i[s],t[s],e))return!1}return!0}function jA(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 GA(i,t,e){const n=jA(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 eg(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 GA(i,t,e)}function ig(i){return D(i)?Z(i)?i:[i]:[]}function pr(i){if(tg(i))return i[i.length-1]}const ng=(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},Za=(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 sl(i,t){if(!Z(i)||!Z(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 og(i){if(!Z(i))return[i];const t=[];for(const e of i)t.push(...og(e));return t}function UA(i,t,e){D(t)||(t=i,i=0),D(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 $A(i,t){return i<t?-1:i>t?1:i>=t?0:NaN}function ll(i){return Number(i)}const KA=typeof console<"u";function Ja(i,t,e){const n=[t].concat([].slice.call(e));KA&&console[i].apply(console,n)}var Hn;(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"})(Hn||(Hn={}));class me{static getInstance(t,e){return me._instance&&et(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=Hn.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>=Hn.Info}canLogDebug(){return this._level>=Hn.Debug}canLogError(){return this._level>=Hn.Error}canLogWarn(){return this._level>=Hn.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=Hn.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):Ja((e=this._method)!==null&&e!==void 0?e:"error","ERROR",t)),this}warn(...t){return this._level>=Hn.Warn&&Ja(this._method||"warn","WARN",t),this}info(...t){return this._level>=Hn.Info&&Ja(this._method||"log","INFO",t),this}debug(...t){return this._level>=Hn.Debug&&Ja(this._method||"log","DEBUG",t),this}}me._instance=null;function YA(i,t,e=0,n){for(mt(n)&&(n=i.length);e<n;){const o=e+n>>>1;$A(i[o],t)>0?n=o:e=o+1}return e}const XA=(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},qA=1e-10,ZA=1e-10;function En(i,t,e=ZA,n=qA){const o=n,r=e*Math.max(i,t);return Math.abs(i-t)<=Math.max(o,r)}function Xm(i,t,e,n){return i>t&&!En(i,t,e,n)}function qm(i,t,e,n){return i<t&&!En(i,t,e,n)}const al=i=>{let t=null,e=null;return(...n)=>(t&&n.every((o,r)=>o===t[r])||(t=n,e=i(...n)),e)},Yi=function(i,t,e){return i<t?t:i>e?e:i},mr=(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 rg(i,t){let e;return i>t&&(e=i,i=t,t=e),n=>Math.max(i,Math.min(t,n))}let Qa=!1;try{Qa=typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"}catch{Qa=!1}function Zm(i,t,e){let n,o,r,s,l,a,h=0,d=!1,u=!1,c=!0;const g=!t&&t!==0&&Qa;if(typeof i!="function")throw new TypeError("Expected a function");function f(y){const C=n,_=o;return n=o=void 0,h=y,s=i.apply(_,C),s}function p(y,C){return g?(cancelAnimationFrame(l),requestAnimationFrame(y)):setTimeout(y,C)}function m(y){const C=y-a;return a===void 0||C>=t||C<0||u&&y-h>=r}function v(){const y=Date.now();if(m(y))return b(y);l=p(v,function(C){const _=C-h,A=t-(C-a);return u?Math.min(A,r-_):A}(y))}function b(y){return l=void 0,c&&n?f(y):(n=o=void 0,s)}function w(...y){const C=Date.now(),_=m(C);if(n=y,o=this,a=C,_){if(l===void 0)return function(A){return h=A,l=p(v,t),d?f(A):s}(a);if(u)return l=p(v,t),f(a)}return l===void 0&&(l=p(v,t)),s}return t=+t||0,ie(e)&&(d=!!e.leading,u="maxWait"in e,u&&(r=Math.max(pe(e.maxWait)?e.maxWait:0,t)),c="trailing"in e?!!e.trailing:c),w.cancel=function(){l!==void 0&&function(y){if(g)return cancelAnimationFrame(y);clearTimeout(y)}(l),h=0,n=a=o=l=void 0},w.flush=function(){return l===void 0?s:b(Date.now())},w.pending=function(){return l!==void 0},w}Qa=!1;function Jm(i,t,e){let n=!0,o=!0;if(typeof i!="function")throw new TypeError("Expected a function");return ie(e)&&(n="leading"in e?!!e.leading:n,o="trailing"in e?!!e.trailing:o),Zm(i,t,{leading:n,trailing:o,maxWait:t})}function th(i,t){return e=>i*(1-e)+t*e}function JA(i,t){return function(e){return Math.round(i*(1-e)+t*e)}}function QA(i,t){const e=i.valueOf(),n=t.valueOf(),o=new Date;return r=>(o.setTime(e*(1-r)+n*r),o)}const Se=1e-12,ve=Math.PI,un=ve/2,li=2*ve,ne=2*Math.PI,he=Math.abs,le=Math.atan2,Ne=Math.cos,No=Math.max,pi=Math.min,Me=Math.sin,Ln=Math.sqrt,es=Math.pow;function tT(i){return i>1?0:i<-1?ve:Math.acos(i)}function Qm(i){return i>=1?un:i<=-1?-un:Math.asin(i)}function tv(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 eT(i,t){return i[0]*t[1]-i[1]*t[0]}class ke{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 ke(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 et(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return et(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 go{static distancePP(t,e){return Ln(es(t.x-e.x,2)+es(t.y-e.y,2))}static distanceNN(t,e,n,o){return Ln(es(t-n,2)+es(e-o,2))}static distancePN(t,e,n){return Ln(es(e-t.x,2)+es(n-t.y,2))}static pointAtPP(t,e,n){return new ke((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function cn(i){return i*(Math.PI/180)}function iT(i){return 180*i/Math.PI}const nT=(i=0)=>{if(i<0)for(;i<-li;)i+=li;else if(i>0)for(;i>li;)i-=li;return i};function oT(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 ev(i){for(;i<0;)i+=2*Math.PI;for(;i>=2*Math.PI;)i-=2*Math.PI;return i}function iv(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}=sg(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 is;(function(i){i[i.NONE=0]="NONE",i[i.BBOX1=1]="BBOX1",i[i.BBOX2=2]="BBOX2"})(is||(is={}));const sg=(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 rT(i,t,e){if(!i||!t)return is.NONE;const{x11:n,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=sg(i,t,e);return n>l&&o<a&&r>h&&s<d?is.BBOX1:l>n&&a<o&&h>r&&d<s?is.BBOX2:is.NONE}function lg(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}=sg(i,t,!0);return!(n>a||o<l||r>d||s<h)}return!0}function ag(i,t){return Math.abs(t[0]*i[0]+t[1]*i[1])}function ns({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 hg(i){return{x:(i.x1+i.x2)/2,y:(i.y1+i.y2)/2}}function nv(i,t){const e=t?cn(i.angle):i.angle,n=hg(i);return[ns({x:i.x1,y:i.y1},e,n),ns({x:i.x2,y:i.y1},e,n),ns({x:i.x2,y:i.y2},e,n),ns({x:i.x1,y:i.y2},e,n)]}function ov(i,t,e=!1,n){const o=nv(i,e),r=nv(t,e),s=(w,y)=>[y.x-w.x,y.y-w.y];n&&(n.save(),n.fillStyle="red",n.globalAlpha=.6,o.forEach((w,y)=>{y===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,y)=>{y===0?n.moveTo(w.x,w.y):n.lineTo(w.x,w.y)}),n.fill(),n.restore());const l=hg(i),a=hg(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?cn(i.angle):i.angle;let p=e?cn(90-i.angle):i.angle+un;const m=e?cn(t.angle):t.angle;let v=e?cn(90-t.angle):t.angle+un;p>ne&&(p-=ne),v>ne&&(v-=ne);const b=(w,y,C,_)=>{const A=[Math.cos(y),Math.sin(y)];return w+(ag(A,C)+ag(A,_))/2>ag(A,h)};return b((i.x2-i.x1)/2,f,c,g)&&b((i.y2-i.y1)/2,p,c,g)&&b((t.x2-t.x1)/2,m,d,u)&&b((t.y2-t.y1)/2,v,d,u)}const rv=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 eh(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 Ze{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(),D(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=D(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(mt(this._canvas)&&(D(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),mt(this._canvas)&&typeof window<"u"&&window.document!==void 0&&globalThis&&D(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),mt(this._context)&&D(this._canvas)){const t=this._canvas.getContext("2d");D(t)&&(t.save(),t.font=eh(this.textSpec),this._contextSaved=!0,this._context=t)}return!mt(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(ee(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(mt(t))return{width:0,height:0};if(mt(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);mt(r)&&Ze.NUMBERS_CHAR_SET.includes(o)&&(r=this._measureNumberChar()),mt(r)&&["F","W"].includes(rv(o))&&(r=this._measureFullSizeChar()),mt(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(rv(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(mt(t))return s;if(Z(t)){const l=t.filter(D).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(mt(this._numberCharSize)){const t=this._standardMethod(Ze.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Ze.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return mt(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Ze.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(mt(this._letterCharSize)){const t=this._standardMethod(Ze.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/Ze.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return D(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){D(this._canvas)&&(this._canvas=null),D(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}Ze.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Ze.NUMBERS_CHAR_SET="0123456789",Ze.FULL_SIZE_CHAR="字";function dg(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 Xi{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Xi(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 Z(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 dg(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 xe extends Xi{}class sT extends Xi{constructor(t,e=0){super(t),t&&(this.angle=e)}intersects(t){return ov(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 Ve{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 Ve,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 Ve;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 Ve(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=iT(s.rotateDeg),s}}function lT(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=Ne(s),p=Me(s);let m,v;l?(m=l[0],v=l[1]):(m=e,v=n);const b=m-e,w=v-n,y=a*f+d*p,C=h*f+u*p,_=d*f-a*p,A=u*f-h*p;i.a=o*y,i.b=o*C,i.c=r*_,i.d=r*A,i.e=c+a*m+d*v-y*b-_*w,i.f=g+h*m+u*v-C*b-A*w}class aT{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 ug(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 cg(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 hT=/^#([0-9a-f]{3,8})$/,sv={transparent:4294967040},ih={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 nh(i){return((i=Math.max(0,Math.min(255,Math.round(i)||0)))<16?"0":"")+i.toString(16)}function lv(i){return et(i)?new Si(i>>16,i>>8&255,255&i,1):Z(i)?new Si(i[0],i[1],i[2]):new Si(255,255,255)}function dT(i){return et(i)?new Si(i>>>24,i>>>16&255,i>>>8&255,255&i):Z(i)?new Si(i[0],i[1],i[2],i[3]):new Si(255,255,255,1)}function gg(i){return i<.04045?.0773993808*i:Math.pow(.9478672986*i+.0521327014,2.4)}function fg(i){return i<.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}const av=(i,t)=>{const e=hT.exec(i);if(t||e){const n=parseInt(e[1],16),o=e[1].length;return o===3?new Si((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):o===6?lv(n):o===8?new Si(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):null}};class qi{static Brighter(t,e=1){return e===1?t:new qi(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return e===1?t:new qi(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const n=t instanceof qi?t:new qi(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(D(sv[t]))return dT(sv[t]);if(D(ih[t]))return lv(ih[t]);const e=`${t}`.trim().toLowerCase(),n=av(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 Si(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=ug(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10));return new Si(r.r,r.g,r.b,parseFloat(o[3]))}}constructor(t){const e=qi.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Si(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=cg(this.color.r,this.color.g,this.color.b),s=ug(mt(t)?r.h:Yi(t,0,360),mt(e)?r.s:e>=0&&e<=1?100*e:e,mt(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new Si(s.r,s.g,s.b,o),this}setRGB(t,e,n){return!mt(t)&&(this.color.r=t),!mt(e)&&(this.color.g=e),!mt(n)&&(this.color.b=n),this}setHex(t){const e=`${t}`.trim().toLowerCase(),n=av(e,!0);return n??this}setColorName(t){const e=ih[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 qi(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=gg(t.color.r),this.color.g=gg(t.color.g),this.color.b=gg(t.color.b),this}copyLinearToSRGB(t){return this.color.r=fg(t.color.r),this.color.g=fg(t.color.g),this.color.b=fg(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Si{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)),D(o)?this.opacity=isNaN(+o)?1:Math.max(0,Math.min(1,+o)):this.opacity=1}formatHex(){return`#${nh(this.r)+nh(this.g)+nh(this.b)+(this.opacity===1?"":nh(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}=cg(this.r,this.g,this.b);return`${t===1?"hsl(":"hsla("}${e},${n}%,${o}%${t===1?")":`,${t})`}`}toString(){return this.formatHex()}}function uT(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 cT(i,t,e){return Number((1<<24)+(i<<16)+(t<<8)+e).toString(16).slice(1)}function gT(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 Si(u,c,g,a*(1-d)+h*d)}}const fT=Object.freeze(Object.defineProperty({__proto__:null,Color:qi,DEFAULT_COLORS:ih,RGB:Si,hexToRgb:uT,hslToRgb:ug,interpolateRgb:gT,rgbToHex:cT,rgbToHsl:cg},Symbol.toStringTag,{value:"Module"}));function Yn(i){if(pe(i))return[i,i,i,i];if(Z(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(ie(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 pT(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 mT=li-1e-8;class pg{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,o,r,s){if(Math.abs(r-o)>mT)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%=li)<0&&(o+=li),(r%=li)<0&&(r+=li),r<o&&(s=!s,l=o,o=r,r=l),s)for(r-=li,l=o-o%un,a=0;a<4&&l>r;++a,l-=un)p(l);else for(l=o-o%un+un,a=0;a<4&&l<r;++a,l+=un)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 vT{constructor(){this.curves=[],this.bounds=new xe}getCurveLengths(){return this.curves.map(t=>t.getLength())}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const bT=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,CT={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},ae={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let mg,hv,oh,dv,vg,rh;function yT(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(mg=t[r],hv=mg.slice(1),oh=mg[0],e=[oh],n=hv.match(bT),n!==null){for(let l=0,a=n.length;l<a;l++)dv=n[l],vg=parseFloat(dv),Number.isNaN(vg)||e.push(vg);if(rh=CT[oh],e.length-1>rh){let l,a=oh;for(let h=1,d=e.length;h<d;h+=rh){l=[a];for(let u=h,c=h+rh;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 ue;(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"})(ue||(ue={}));var hl;(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"})(hl||(hl={}));var ki;(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"})(ki||(ki={}));var mi;(function(i){i[i.INITIAL=0]="INITIAL",i[i.RUNNING=1]="RUNNING",i[i.PAUSED=2]="PAUSED",i[i.END=3]="END"})(mi||(mi={}));var sh;(function(i){i[i.NORMAL=0]="NORMAL",i[i.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"})(sh||(sh={}));var os;(function(i){i.wait="wait",i.from="from",i.to="to",i.customAnimate="customAnimate"})(os||(os={}));var ye;(function(i){i[i.ROW=1]="ROW",i[i.COLUMN=2]="COLUMN"})(ye||(ye={}));var lh;(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"})(lh||(lh={}));var oe;(function(i){i[i.beforeFillStroke=0]="beforeFillStroke",i[i.afterFillStroke=1]="afterFillStroke"})(oe||(oe={}));function _T(i,t,e,n,o,r,s,l,a){const h=cn(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,b=u/n,w=p*l+m*a,y=v*l+b*a,C=p*i+m*t,_=v*i+b*t;let A=1/((C-w)*(C-w)+(_-y)*(_-y))-.25;A<0&&(A=0);let R=Math.sqrt(A);r===o&&(R=-R);const x=.5*(w+C)-R*(_-y),T=.5*(y+_)+R*(C-w),B=Math.atan2(y-T,w-x);let M=Math.atan2(_-T,C-x)-B;M<0&&r===1?M+=li:M>0&&r===0&&(M-=li);const H=Math.ceil(Math.abs(M/(un+.001))),F=[];for(let P=0;P<H;++P){const L=B+P*M/H,k=B+(P+1)*M/H;F[P]=[x,T,L,k,e,n,d,u]}return F}function wT(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),b=Math.sin(.5*v),w=8/3*b*b/Math.sin(v),y=t+g-w*f,C=e+f+w*g,_=t+p,A=e+m,R=_+w*m,x=A-w*p;return[h*y+d*C,u*y+c*C,h*R+d*x,u*R+c*x,h*_+d*A,u*_+c*A]}function uv(i,t,e,n){const o=_T(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=wT(o[r]);i.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const ST=(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),b=Math.sin(c),w=p*r+n,y=m*s+o,C=v*r+n,_=b*s+o,A=r*g*f,R=s*g*f;i.push(w-A*m,y+R*p,C+A*b,_-R*v,C,_)}},xT=[(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 Vo(i,t,e=0,n=0,o=1,r=1,s){for(let l=0;l<i.length;l++){const a=i[l];xT[a[0]](a,t,e,n,o,r,s)}}class cv{getLength(t){return t!=null?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function RT(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+=go.distanceNN(r,s,l,a)}return e/2}function AT(i,t,e,n,o){return RT([i.x,t.x,e.x,n.x],[i.y,t.y,e.y,n.y])}function gv(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 fv(i,t,e,n,o){const r=gv(i.x,t.x,e.x,n.x,o),s=gv(i.y,t.y,e.y,n.y,o);return new ke(r,s)}function bg(i,t){const{p0:e,p1:n,p2:o,p3:r}=i,s=fv(e,n,o,r,t),l=go.pointAtPP(e,n,t),a=go.pointAtPP(n,o,t),h=go.pointAtPP(o,r,t),d=go.pointAtPP(l,a,t),u=go.pointAtPP(a,h,t);return[new Cg(e,l,d,s),new Cg(s,u,h,r)]}class Cg extends cv{constructor(t,e,n,o){super(),this.type=lh.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 fv(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?AT(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===ye.ROW?he(this.p0.x-this.p3.x):t===ye.COLUMN?he(this.p0.y-this.p3.y):0}getAngleAt(t){const e=No(t-.01,0),n=pi(t+.01,1),o=this.getPointAt(e),r=this.getPointAt(n);return le(r.y-o.y,r.x-o.x)}}function pv(i,t){const{p0:e,p1:n}=i,o=go.pointAtPP(e,n,t);return[new yg(e,o),new yg(o,n)]}class yg extends cv{constructor(t,e){super(),this.type=lh.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(this.defined!==!1)return go.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return this.angle==null&&(this.angle=le(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()?go.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===ye.ROW?he(this.p0.x-this.p1.x):t===ye.COLUMN?he(this.p0.y-this.p1.y):0}}class _g{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 Cg(new ke(this._lastX,this._lastY),new ke(t,e),new ke(n,o),new ke(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 yg(new ke(this._lastX,this._lastY),new ke(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===ye.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 he(o.p0.y-s.y)}if(t===ye.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 he(o.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((o,r)=>o+r.getLength(),0)),this.length}}class TT extends _g{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 vr(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 rs(i,t,e){const n=t??(he(e[e.length-1].x-e[0].x)>he(e[e.length-1].y-e[0].y)?ye.ROW:ye.COLUMN);return i==="monotoneY"?new TT(i,n):new _g(i,n)}class mv{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 dl(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;const o=rs("linear",e,i);return BT(new mv(o,n),i),o}function BT(i,t){return vr(i,t,1)}function vv(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 MT{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&&vv(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:vv(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 PT(i,t){return vr(i,t,2)}function HT(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;if(i.length<3-+!!n)return dl(i,t);const o=rs("basis",e,i);return PT(new MT(o,n),i),o}function bv(i){return i<0?-1:1}function Cv(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(bv(r)+bv(s))*Math.min(Math.abs(r),Math.abs(s),.5*Math.abs(l))||0}function yv(i,t){const e=i._x1-i._x0;return e?(3*(i._y1-i._y0)/e-t)/2:t}function wg(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 _v{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:wg(this,this._t0,yv(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,wg(this,yv(this,e=Cv(this,n,o)),e,this._lastDefined1!==!1&&this._lastDefined2!==!1);break;default:wg(this,this._t0,e=Cv(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 ET extends _v{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function LT(i,t){return vr(i,t,2)}function kT(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;if(i.length<3-+!!n)return dl(i,t);const o=rs("monotoneX",e,i);return LT(new _v(o,n),i),o}function FT(i,t){return vr(i,t,2)}function IT(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;if(i.length<3-+!!n)return dl(i,t);const o=rs("monotoneY",e,i);return FT(new ET(o,n),i),o}let zT=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 Sg(i,t,e={}){const{direction:n,startPoint:o}=e;if(i.length<2-+!!o)return null;const r=new _g("step",n??(he(i[i.length-1].x-i[0].x)>he(i[i.length-1].y-i[0].y)?ye.ROW:ye.COLUMN));return OT(new zT(r,t,o),i),r}function OT(i,t){return vr(i,t,1)}class DT extends mv{lineEnd(){this.context.closePath()}}function WT(i,t={}){const{direction:e,startPoint:n}=t;if(i.length<2-+!!n)return null;const o=rs("linear",e,i);return NT(new DT(o,n),i),o}function NT(i,t){return vr(i,t,1)}function wv(i,t,e,n,o){let r=i._x1,s=i._y1,l=i._x2,a=i._y2;if(i._l01_a>Se){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>Se){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 VT{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:wv(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 Sv(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 dl(e,o);const l=rs(i,r,e),a=new t(l,n,s);return vr(a,e,2),l}}const jT=Sv("catmullRom",VT);class GT{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:wv(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 UT=Sv("catmullRomClosed",GT);function br(i,t,e){var n,o;switch(t){case"linear":default:return dl(i,e);case"basis":return HT(i,e);case"monotoneX":return kT(i,e);case"monotoneY":return IT(i,e);case"step":return Sg(i,.5,e);case"stepBefore":return Sg(i,0,e);case"stepAfter":return Sg(i,1,e);case"catmullRom":return jT(i,(n=e==null?void 0:e.curveTension)!==null&&n!==void 0?n:.5,e);case"catmullRomClosed":return UT(i,(o=e==null?void 0:e.curveTension)!==null&&o!==void 0?o:.5,e);case"linearClosed":return WT(i,e)}}class ni extends vT{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new pg(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([ae.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([ae.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,o){return this.commandList.push([ae.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([ae.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([ae.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([ae.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([ae.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([ae.A,t,e,n,o,r,s]),this._ctx&&this._ctx.arc(t,e,n,o,r,s),this}closePath(){return this.commandList.push([ae.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[ae.M]=o=>`M${o[1]} ${o[2]}`,n[ae.L]=o=>`L${o[1]} ${o[2]}`,n[ae.Q]=o=>`Q${o[1]} ${o[2]} ${o[3]} ${o[4]}`,n[ae.C]=o=>`C${o[1]} ${o[2]} ${o[3]} ${o[4]} ${o[5]} ${o[6]}`,n[ae.A]=o=>{const r=[];ST(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[ae.R]=o=>`M${o[1]} ${o[2]} h${o[3]} v${o[4]} H${o[1]}Z`,n[ae.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=yT(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=br(e,n);o==="x"?this.direction=ye.ROW:o==="y"?this.direction=ye.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[ae.M]=this.moveToTransform,s[ae.L]=this.lineToTransform,s[ae.Q]=this.quadraticCurveToTransform,s[ae.C]=this.bezierCurveToTransform,s[ae.AT]=this.arcToTransform,s[ae.E]=this.ellipseTransform,s[ae.R]=this.rectTransform,s[ae.A]=this.arcTransform,s[ae.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=$T(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":uv(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":uv(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 ae.L:this.lineToTransform(a,e,n,o,r);break;case ae.M:this.moveToTransform(a,e,n,o,r);break;case ae.C:this.bezierCurveToTransform(a,e,n,o,r);break;case ae.Q:this.quadraticCurveToTransform(a,e,n,o,r);break;case ae.A:this.arcToTransform(a,e,n,o,r);break;case ae.E:this.ellipseTransform(a,e,n,o,r);break;case ae.R:this.rectTransform(a,e,n,o,r);break;case ae.AT:this.arcToTransform(a,e,n,o,r);break;case ae.Z:this.closePath()}}else this.commandList=t.map(s=>s.slice())}_updateBounds(){this.bounds.clear(),Vo(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===ye.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return he(t.p0.y-e.p1.y)}if(this.direction===ye.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return he(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 gn=["l",0,0,0,0,0,0,0];function $T(i,t,e){const n=gn[0]=i[0];if(n==="a"||n==="A")gn[1]=t*i[1],gn[2]=e*i[2],gn[3]=i[3],gn[4]=i[4],gn[5]=i[5],gn[6]=t*i[6],gn[7]=e*i[7];else if(n==="h"||n==="H")gn[1]=t*i[1];else if(n==="v"||n==="V")gn[1]=e*i[1];else for(let o=1,r=i.length;o<r;++o)gn[o]=(o%2==1?t:e)*i[o];return gn}const KT={alignSelf:"auto"},Je={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 Ve},xv={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},xg={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Rv=Object.assign({outerBorder:Object.assign(Object.assign({},xg),{distance:0}),innerBorder:Object.assign(Object.assign({},xg),{distance:0})},xg),fn={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:`PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,
|
|
3
3
|
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},YT={pickStrokeBuffer:0},XT=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},xv),Rv),KT),YT),Av={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Le=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}),XT),Je),qT=Object.assign(Object.assign({},Le),{startAngle:0,endAngle:ne,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),ZT=Object.assign(Object.assign(Object.assign({},Le),Av),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),JT=Object.assign(Object.assign({},Le),{radius:1,startAngle:0,endAngle:ne}),QT=Object.assign(Object.assign({},Le),{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}),tB=Object.assign(Object.assign({},Le),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),eB=Object.assign(Object.assign(Object.assign({},Le),Av),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),iB=Object.assign(Object.assign({},Le),{path:new ni,fillStrokeOrder:1,customPath:()=>{me.getInstance().warn("空函数")}}),nB=Object.assign(Object.assign({},Le),{points:[],cornerRadius:0,closePath:!0}),oB=Object.assign(Object.assign({},Le),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},Le),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const rB=Object.assign(Object.assign({},Le),{symbolType:"circle",size:10,keepDirIn3d:!0}),Tv=Object.assign(Object.assign(Object.assign({},Le),fn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),fo=Object.assign(Object.assign(Object.assign({},Le),fn),{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}),ul=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Le),{fill:!0,cornerRadius:0}),sB=Object.assign(Object.assign({},ul),{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 lB{}const X=new lB,Rg={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"}},Bv={fontSize:16,fontFamily:"sans-serif",fill:!0,stroke:!1,fontWeight:"normal",lineHeight:"normal",fontStyle:"normal",textDecoration:"none",textAlign:"left",script:"normal"},ah=/\w|\(|\)|-/,Mv=/[.?!,;:/,。?!、;:]/,aB=/\S/,Pv=(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 hB(i,t){const e=t&&t.fill||Bv.fill;if(!e)return void(i.globalAlpha=0);const{fillOpacity:n=1,opacity:o=1}=t;i.globalAlpha=n*o,i.fillStyle=e,Pv(i,t)}function dB(i,t){const e=t&&t.stroke||Bv.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,Pv(i,t)}function Ag(i,t,e,n,o){if(!t||t<=0)return 0;const r=X.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=hh(i,s)),s}function hh(i,t,e=!1){let n=t;for(;ah.test(i[n-1])&&ah.test(i[n])||Mv.test(i[n]);)if(n--,n<=0)return e?uB(i,t):t;return n}function uB(i,t){let e=t;for(;ah.test(i[e-1])&&ah.test(i[e])||Mv.test(i[e]);)if(e++,e>=i.length)return e;return e}function ss(i,t){const e=X.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 cB=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 Tg=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=Tv.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:fn.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:fn.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=hh(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=hh(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=hh(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}};Tg=cB([at()],Tg);var gB=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 po=Symbol.for("TextMeasureContribution");let ls=class extends Tg{};ls=gB([at()],ls);const kt=new AA,Hv=Symbol.for("CanvasFactory"),fB=Symbol.for("Context2dFactory");function Bg(i){return kt.getNamed(Hv,X.global.env)(i)}class pB{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=Bg(Object.assign({nativeCanvas:X.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=Bg(Object.assign({nativeCanvas:X.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 as=new pB;var mB=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},vB=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)};const cl=Symbol.for("VWindow"),Mg=Symbol.for("WindowHandlerContribution");let Pg=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 Li(["x","y","width","height"])},this.active=()=>{const i=this.global;!i.env||this.actived||(kt.getNamed(Mg,i.env).configure(this,i),this.actived=!0)},this._uid=De.GenAutoIncrementId(),this.global=X.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&&En(this.width,i.width())&&En(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)}};Pg=mB([at(),vB("design:paramtypes",[])],Pg);var Ev=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},Lv=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},kv=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Hg=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=X.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=as.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:fn.fontSize};return this.global.measureTextMethod=o,r}createTextMeasureInstance(i,t,e){return this.configure(this.global,this.global.env),new Ze(Object.assign({defaultFontParams:{fontFamily:fn.fontFamily,fontSize:fn.fontSize},getCanvasForMeasure:e||(()=>this.canvas),getTextBounds:void 0,specialCharSet:`-/: .,@%'"~`+Ze.ALPHABET_CHAR_SET+Ze.ALPHABET_CHAR_SET.toUpperCase()},t??{}),i)}drawGraphicToCanvas(i,t,e){if(!t.defaultLayer)return null;const n=kt.get(cl),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}};Hg=Ev([at(),kv(0,Xt(We)),kv(0,Ye(po)),Lv("design:paramtypes",[Object])],Hg);var jo;(function(i){i[i.transform=0]="transform",i[i.matrix=1]="matrix"})(jo||(jo={}));const je=new Ve;let Eg=class{constructor(){this.matrix=new Ve}init(i){return this.mode=jo.transform,this.originTransform=i,this.matrix.reset(),this}fromMatrix(i,t){return this.mode=jo.matrix,this.outSourceMatrix=i,this.outTargetMatrix=t,this}scaleMatrix(i,t,e){const n=this.outSourceMatrix;if(je.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(je.a,je.b,je.c,je.d,je.e,je.f),this}rotateMatrix(i,t){const e=this.outSourceMatrix;if(je.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(je.a,je.b,je.c,je.d,je.e,je.f),this}scale(i,t,e){return this.mode===jo.matrix?this.scaleMatrix(i,t,e):this}rotate(i,t){return this.mode===jo.matrix?this.rotateMatrix(i,t):this}translateMatrix(i,t){const e=this.outSourceMatrix;return je.setValue(e.a,e.b,e.c,e.d,e.e,e.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(i,t),this.outTargetMatrix.multiply(je.a,je.b,je.c,je.d,je.e,je.f),this}translate(i,t){return this.mode===jo.matrix?this.translateMatrix(i,t):this}simplify(i){return this.mode===jo.matrix?this.simplifyMatrix(i):this}simplifyMatrix(i){return this}};Eg=Ev([at(),Lv("design:paramtypes",[])],Eg);const xi={arc:qT,area:ZT,circle:JT,line:eB,path:iB,symbol:rB,text:Tv,rect:oB,polygon:nB,richtext:fo,richtextIcon:sB,image:ul,group:QT,glyph:tB},Lg=Object.keys(xi);function bB(){return{arc:Object.assign({},xi.arc),area:Object.assign({},xi.area),circle:Object.assign({},xi.circle),line:Object.assign({},xi.line),path:Object.assign({},xi.path),symbol:Object.assign({},xi.symbol),text:Object.assign({},xi.text),rect:Object.assign({},xi.rect),polygon:Object.assign({},xi.polygon),richtext:Object.assign({},xi.richtext),richtextIcon:Object.assign({},xi.richtextIcon),image:Object.assign({},xi.image),group:Object.assign({},xi.group),glyph:Object.assign({},xi.glyph)}}function dh(i,t){Object.keys(t).forEach(e=>{i[e]=t[e]})}const Fv=bB();class gl{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Lg.forEach(t=>{this._defaultTheme[t]=Object.create(Fv[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;Lg.forEach(o=>{const r=Object.create(Fv[o]);t&&t[o]&&dh(r,t[o]),n[o]&&dh(r,n[o]),e[o]&&dh(r,e[o]),this.combinedTheme[o]=r}),e.common&&Lg.forEach(o=>{dh(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 Iv=new gl;function zt(i,t){return i.glyphHost?zt(i.glyphHost):t?(i.isContainer,t):CB(i)||i.attachedThemeGraphic&&zt(i.attachedThemeGraphic)||Iv.getTheme()}function CB(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)):Iv.getTheme()}return null}var yB=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 _B extends fr{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=De.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 yB(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=Xe(n,!0)&&n||ie(n)&&n.capture,r=ie(n)&&n.once,s=te(e)?void 0:e;return t=o?`${t}capture`:t,e=te(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=Xe(n,!0)&&n||ie(n)&&n.capture,r=te(e)?void 0:e;t=o?`${t}capture`:t,e=te(e)?e:e.handleEvent;const s=ie(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 ie(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 fl{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=fl.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&&te(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&&te(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class uh extends fl{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 Zi extends uh{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 Zi(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 Go extends uh{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 Go(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}}Go.DOM_DELTA_PIXEL=0,Go.DOM_DELTA_LINE=1,Go.DOM_DELTA_PAGE=2;class kg extends fl{constructor(t,e){super(),this.type=t,this.detail=e}}const zv="*",Cr=typeof performance=="object"&&performance.now?performance:Date;function Uo(i){return i==="mouse"||i==="pen"}let wB=class{constructor(t,e){this.dispatch=new fr,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(n,o)=>{if(!(n instanceof Zi))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(Uo(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 Zi))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=Uo(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 Zi))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=Uo(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 Zi))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=Uo(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 Zi))return void me.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const s=Cr.now(),l=this.createPointerEvent(n,n.type,o);if(this.dispatchEvent(l,"pointerup"),l.pointerType==="touch")this.dispatchEvent(l,"touchend");else if(Uo(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(Uo(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,Uo(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 Zi))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"):Uo(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 Go))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(Zi);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(Go);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(Zi);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 Zi&&e instanceof Zi&&(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 uh&&e instanceof uh&&(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=Cr.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[zv];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 SB={dispatchEvent(i){var t;if(!(i instanceof fl))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 kg(i,t))}},xB={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class RB{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 wB(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 Zi,this.rootWheelEvent=new Go,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&&ee(t)&&!Gm(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];He(r.button)&&(r.button=0),He(r.buttons)&&(r.buttons=1),He(r.isPrimary)&&(r.isPrimary=t.touches.length===1&&t.type==="touchstart"),He(r.width)&&(r.width=r.radiusX||1),He(r.height)&&(r.height=r.radiusY||1),He(r.tiltX)&&(r.tiltX=0),He(r.tiltY)&&(r.tiltY=0),He(r.pointerType)&&(r.pointerType="touch"),He(r.pointerId)&&(r.pointerId=r.identifier||0),He(r.pressure)&&(r.pressure=r.force||.5),He(r.twist)&&(r.twist=0),He(r.tangentialPressure)&&(r.tangentialPressure=0),He(r.layerX)&&(r.layerX=r.offsetX=r.clientX),He(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;He(n.isPrimary)&&(n.isPrimary=!0),He(n.width)&&(n.width=1),He(n.height)&&(n.height=1),He(n.tiltX)&&(n.tiltX=0),He(n.tiltY)&&(n.tiltY=0),He(n.pointerType)&&(n.pointerType="mouse"),He(n.pointerId)&&(n.pointerId=1),He(n.pressure)&&(n.pressure=.5),He(n.twist)&&(n.twist=0),He(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=xB[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Cr.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 pn;(function(i){i[i.INITIAL=0]="INITIAL",i[i.RUNNING=1]="RUNNING",i[i.PAUSE=2]="PAUSE"})(pn||(pn={}));class pl{static Avaliable(){return!!X.global.getRequestAnimationFrame()}avaliable(){return pl.Avaliable()}tick(t,e){X.global.getRequestAnimationFrame()(()=>{this.released||e(this)})}release(){this.released=!0}getTime(){return Date.now()}}class ch{static Avaliable(){return!0}avaliable(){return ch.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 Ov{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===pn.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=pn.INITIAL,X.global.hooks.onSetEnv.tap("default-ticker",()=>{this.initHandler()}),X.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:pl},{mode:"timeout",cons:ch}];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 pl;break;case"timeout":t=new ch;break;default:me.getInstance().warn("非法的计时器模式"),t=new pl}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!==pn.INITIAL&&(this.status=pn.PAUSE,!0)}resume(){return this.status!==pn.INITIAL&&(this.status=pn.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===pn.RUNNING||!this.tickerHandler||!t&&(this.status===pn.PAUSE||!this.timelines.length||this.timelines.reduce((e,n)=>e+n.animateCount,0)===0)?!1:(this.status=pn.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0)}stop(){this.status=pn.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Kt{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-Kt.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Kt.bounceIn(2*t):.5*Kt.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(n===0||n===1)return n;const o=e/ne*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-o)*ne/e)}}static getElasticOut(t,e){return function(n){if(n===0||n===1)return n;const o=e/ne*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-o)*ne/e)+1}}static getElasticInOut(t,e){return function(n){const o=e/ne*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-o)*ne/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-o)*ne/e)*.5+1}}}Kt.quadIn=Kt.getPowIn(2),Kt.quadOut=Kt.getPowOut(2),Kt.quadInOut=Kt.getPowInOut(2),Kt.cubicIn=Kt.getPowIn(3),Kt.cubicOut=Kt.getPowOut(3),Kt.cubicInOut=Kt.getPowInOut(3),Kt.quartIn=Kt.getPowIn(4),Kt.quartOut=Kt.getPowOut(4),Kt.quartInOut=Kt.getPowInOut(4),Kt.quintIn=Kt.getPowIn(5),Kt.quintOut=Kt.getPowOut(5),Kt.quintInOut=Kt.getPowInOut(5),Kt.backIn=Kt.getBackIn(1.7),Kt.backOut=Kt.getBackOut(1.7),Kt.backInOut=Kt.getBackInOut(1.7),Kt.elasticIn=Kt.getElasticIn(1,.3),Kt.elasticOut=Kt.getElasticOut(1,.3),Kt.elasticInOut=Kt.getElasticInOut(1,.3*1.5);class Fg{constructor(){this.id=De.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===mi.END?this.removeAnimate(e):e.status===mi.RUNNING||e.status===mi.INITIAL?(this.animateCount++,e.advance(t)):e.status===mi.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 Dv=new Fg;class Wv{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 AB extends Wv{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,n){}onStart(){this.cb()}}class mo{constructor(t=De.GenAutoIncrementId(),e=Dv,n){this.id=t,this.timeline=e,this.status=mi.INITIAL,this.tailAnimate=new Nv(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=No(n.getDuration(),e)}),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){mo.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=mo.mode){t&&e&sh.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:ki.ANIMATE_PLAY})}runCb(t){const e=new AB(()=>{t(this,e.step.prev)});return this.tailAnimate.play(e),this}customInterpolate(t,e,n,o,r,s){const l=mo.interpolateMap.get(t)||mo.interpolateMap.get("");return!!l&&l(t,e,n,o,r,s)}pause(){this.status===mi.RUNNING&&(this.status=mi.PAUSED)}resume(){this.status===mi.PAUSED&&(this.status=mi.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 Nv(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===mi.INITIAL&&(this.status=mi.RUNNING,this._onStart&&this._onStart.forEach(e=>e())),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===mi.RUNNING&&(this.status=mi.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=mi.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()}}mo.mode=sh.NORMAL,mo.interpolateMap=new Map;class Nv{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 Vv(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"?Kt[n]:n,r=this._addStep(e,null,o);return r.type=os.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"?Kt[n]:n,s=this._addStep(e,null,r);return s.type=os.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=os.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=os.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 Vv(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 Vv{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 jv={duration:200,easing:"cubicOut"};var Gv;(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"})(Gv||(Gv={}));const vo=[!1,!1,!1,!1],TB=i=>{var t;let e=!0;if(Xe(i,!0)){for(let n=0;n<4;n++)vo[n]=i,e&&(e=!((t=vo[n])!==null&&t!==void 0&&!t));e=i}else if(Array.isArray(i))for(let n=0;n<4;n++)vo[n]=!!i[n],e&&(e=!!vo[n]);else vo[0]=!1,vo[1]=!1,vo[2]=!1,vo[3]=!1;return{isFullStroke:e,stroke:vo}},ml=[0,0,0,0],vl=i=>i?Z(i)?i.length===0?0:i.length===1?i[0]:i.length===2?(ml[0]=i[0],ml[2]=i[0],ml[1]=i[1],ml[3]=i[1],ml):i:i:0,hs=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],gh=[1,2,3,0,1,2,3,0];function Ig(i,t,e,n){for(;i>=ne;)i-=ne;for(;i<0;)i+=ne;for(;i>t;)t+=ne;hs[0].x=e,hs[1].y=e,hs[2].x=-e,hs[3].y=-e;const o=Math.ceil(i/un)%4,r=Math.ceil(t/un)%4;if(n.add(Ne(i)*e,Me(i)*e),n.add(Ne(t)*e,Me(t)*e),o!==r||t-i>ve){let s=!1;for(let l=0;l<gh.length;l++)if(s||o!==gh[l]){if(s&&r===gh[l])break;if(s){const a=hs[gh[l]];n.add(a.x,a.y)}}else{s=!0;const a=hs[o];n.add(a.x,a.y)}}}function Uv(i,t,e){const{x:n,y:o}=tv(i.x,i.y,t.x,t.y,e),{x:r,y:s}=tv(i.x1,i.y1,t.x1,t.y1,e),l=new ke(n,o,r,s);return l.defined=t.defined,l}function $v(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 ke(o.x,o.y,o.x1,o.y1);return r.defined=o.defined,r});for(let o=0;o<t.length;o++)n[o]=Uv(i[o],t[o],e)}else{n=t.map(o=>{const r=new ke(o.x,o.y,o.x1,o.y1);return r.defined=o.defined,r});for(let o=0;o<i.length;o++)n[o]=Uv(i[o],t[o],e)}return n}function fh(i,t){if(Z(i)){let e;for(let n=0;n<i.length&&e===void 0;n++)e=i[n][t];return e}return i[t]}class ph{constructor(t=ph.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)}}ph.TimeOut=1e3/60;const Kv=new ph,bo=(i,t)=>ee(i)&&i[i.length-1]==="%"?t*(Number.parseFloat(i.substring(0,i.length-1))/100):i,BB=i=>{if(!i)return{x:0,y:0,width:0,height:0};let t=mt(i.width)?i.x1-i.x:i.width,e=mt(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 Co;(function(i){i[i.Color255=0]="Color255",i[i.Color1=1]="Color1"})(Co||(Co={}));class Qe{static Get(t,e=Co.Color1,n=[0,0,0,1]){if(e===Co.Color1){const s=Qe.store1[t];if(s)return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n;const l=qi.parseColorString(t);if(l){const a=[l.r/255,l.g/255,l.b/255,l.opacity];Qe.store1[t]=a,Qe.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=Qe.store255[t];if(o)return n[0]=o[0],n[1]=o[1],n[2]=o[2],n[3]=o[3],n;const r=qi.parseColorString(t);return r&&(Qe.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],Qe.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===Co.Color1){if(Qe.store1[t])return;Qe.store1[t]=n,Qe.store255[t]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(Qe.store255[t])return;Qe.store255[t]=n,Qe.store1[t]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}Qe.store255={},Qe.store1={};function mh(i,t=!1){return Array.isArray(i)&&et(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 ds(i,t,e,n,o){return Array.isArray(i)&&!et(i[0])||Array.isArray(t)&&!et(t[0])?new Array(4).fill(0).map((r,s)=>Yv(Z(i)?i[s]:i,Z(t)?t[s]:t,e,n)):Yv(i,t,e,n,o)}function Yv(i,t,e,n,o){if(!i||!t)return i&&mh(i)||t&&mh(t)||!1;let r,s,l=!1,a=!1;if(Array.isArray(i)?r=i:typeof i=="string"?r=Qe.Get(i,Co.Color255):l=!0,Array.isArray(t)?s=t:typeof t=="string"?s=Qe.Get(t,Co.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:mh(d)}))});return l?ds(h,u,e,n,o):ds(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 MB(h,d,e);if(h.gradient==="radial")return PB(h,d,e);if(h.gradient==="conical")return HB(h,d,e)}return!1}return o&&o(r,s),mh(EB(r,s,e),n)}function MB(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:zg(n[s].color,o[s].color,e),offset:n[s].offset+(o[s].offset-n[s].offset)*e}))}}function PB(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:zg(n[s].color,o[s].color,e),offset:n[s].offset+(o[s].offset-n[s].offset)*e}))}}function HB(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:zg(n[s].color,o[s].color,e),offset:n[s].offset+(o[s].offset-n[s].offset)*e}))}}function EB(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 yo=[0,0,0,0],bl=[0,0,0,0];function zg(i,t,e){return Qe.Get(i,Co.Color255,yo),Qe.Get(t,Co.Color255,bl),`rgba(${Math.round(yo[0]+(bl[0]-yo[0])*e)},${Math.round(yo[1]+(bl[1]-yo[1])*e)},${Math.round(yo[2]+(bl[2]-yo[2])*e)},${yo[3]+(bl[3]-yo[3])*e})`}class ce{static GetImage(t,e){var n;const o=ce.cache.get(t);o?o.loadState==="fail"?X.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):ce.loadImage(t,e)}static GetSvg(t,e){var n;let o=ce.cache.get(t);o?o.loadState==="fail"?X.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"},ce.cache.set(t,o),o.dataPromise=X.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=ce.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"},ce.cache.set(t,n),e==="arrayBuffer"?n.dataPromise=X.global.loadArrayBuffer(t):e==="blob"?n.dataPromise=X.global.loadBlob(t):e==="json"&&(n.dataPromise=X.global.loadJson(t)),n.dataPromise.then(o=>o.data))}static loading(){setTimeout(()=>{if(!ce.isLoading&&ce.toLoadAueue.length){ce.isLoading=!0;const t=ce.toLoadAueue.splice(0,10),e=[];t.forEach(n=>{const{url:o,marks:r}=n,s={type:"image",loadState:"init"};if(ce.cache.set(o,s),s.dataPromise=X.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(()=>{ce.isLoading=!1,this.onLoadSuccessCb.forEach(n=>n()),ce.loading()}).catch(n=>{console.error(n),ce.isLoading=!1,this.onLoadSuccessCb.forEach(o=>o()),ce.loading()})}},0)}static loadImage(t,e){const n=Xv(t,ce.toLoadAueue);if(n!==-1)return ce.toLoadAueue[n].marks.push(e),void ce.loading();ce.toLoadAueue.push({url:t,marks:[e]}),ce.loading()}static improveImageLoading(t){const e=Xv(t,ce.toLoadAueue);if(e!==-1){const n=ce.toLoadAueue.splice(e,1);ce.toLoadAueue.unshift(n[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Xv(i,t){for(let e=0;e<t.length;e++)if(t[e].url===i)return e;return-1}ce.cache=new Map,ce.isLoading=!1,ce.toLoadAueue=[],ce.onLoadSuccessCb=[];const LB=new Ve,qv=new xe,mn=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Zv=["x","y"],Jv=["scaleX","scaleY"],Qv=["angle"],Cl=new ke,kn={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 Fi extends _B{static mixin(t){const e=Object.keys(t);for(let n=0;n<e.length;++n){const o=e[n];Object.defineProperty(Fi.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 xe,this._updateTag=ue.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;Cl.x=r+((n=l.scrollX)!==null&&n!==void 0?n:0),Cl.y=s+((o=l.scrollY)!==null&&o!==void 0?o:0)}else Cl.x=r,Cl.y=s;return Cl}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;X.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return X.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new sT),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=vl(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 pg(t);return Vo(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 Ve),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&ue.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&X.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&ue.UPDATE_BOUNDS)&&X.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&ue.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&ue.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&ue.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&ue.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=ue.CLEAR_SHAPE}containsPoint(t,e,n,o){if(!o)return!1;if(n===hl.GLOBAL){const r=new ke(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):mt((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:ki.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=ue.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var n,o;if(t===0&&e===0)return this;const r={type:ki.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Zv,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?X.transformUtil.fromMatrix(a,a).translate(t,e):(l.x=((n=l.x)!==null&&n!==void 0?n:Je.x)+t,l.y=((o=l.y)!==null&&o!==void 0?o:Je.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:ki.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Zv,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:ki.SCALE},l=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,Jv,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 Ve,a.postMatrix=h),X.transformUtil.fromMatrix(h,h).scale(t,e,n)}else a.scaleX=((o=a.scaleX)!==null&&o!==void 0?o:Je.scaleX)*t,a.scaleY=((r=a.scaleY)!==null&&r!==void 0?r:Je.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:ki.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Jv,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:ki.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Qv,o);r&&(delete r.angle,this._setAttributes(r,!1,o));const s=this.attribute;if(e){let{postMatrix:l}=this.attribute;l||(l=new Ve,s.postMatrix=l),X.transformUtil.fromMatrix(l,l).rotate(t,e)}else s.angle=((n=s.angle)!==null&&n!==void 0?n:Je.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:ki.ROTATE_TO},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Qv,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 mo(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||(X.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)&&(!!mt(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:jv.duration,(a=(l=this.stateAnimateConfig)===null||l===void 0?void 0:l.easing)!==null&&a!==void 0?a:jv.easing),c&&this.setAttributes(c,!1,{type:ki.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:ki.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();Gm(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|=ue.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=ue.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=ue.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&ue.UPDATE_SHAPE_AND_BOUNDS)===ue.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=ue.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=ue.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=ue.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=ue.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=ue.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=ue.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=ue.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&ue.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 qv.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(qv),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=Je.x,y:e=Je.y,scaleX:n=Je.scaleX,scaleY:o=Je.scaleY,angle:r=Je.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)lT(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),X.transformUtil.fromMatrix(c,c).scale(n,o,{x:h[0],y:h[1]})}const u=this.getOffsetXY(Je);if(this._transMatrix.e+=u.x,this._transMatrix.f+=u.y,a){const c=LB.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),X.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:ki.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:ki.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=ds(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=ds(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=ds(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??X.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 ee(t,!0)?this.pathProxy=new ni().fromString(t):this.pathProxy=new ni,this.pathProxy}loadImage(t,e=!1){if(!t||e&&kB(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")?(ce.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(LA(t)||t.includes("/")||kA(t))&&(ce.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):ie(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",X.graphicService.onRelease(this)}_emitCustomEvent(t,e){var n,o;if(this._events&&t in this._events){const r=new kg(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 kB(i){return!(!i.fill&&!i.stroke)}Fi.mixin(SB);function FB(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 Og{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 tb(i,t,e,n){const o=i.indexOf(t,e);if(o===-1)throw new Error(n);return o+t.length-1}function IB(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 eb(i,t,e,n=">"){const o=IB(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 zB=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");class OB{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=FB(t,zB),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,`
|
|
4
4
|
`);const e=new Og("!xml");let n=e,o="",r="";for(let s=0;s<t.length;s++)if(t[s]==="<")if(t[s+1]==="/"){const l=tb(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=eb(t,s,!1,"?>").closeIndex+1;else if(t.substr(s+1,3)==="!--")s=tb(t,"-->",s+4,"Comment is not closed.");else{const l=eb(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 Og(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 Og(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 DB(i,t){return ib(i)}function ib(i,t){const e={};for(let n=0;n<i.length;n++){const o=i[n],r=WB(o);if(r!==void 0&&o[r]){const s=ib(o[r]);VB(s),o[":@"]&&NB(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 WB(i){const t=Object.keys(i);for(let e=0;e<t.length;e++){const n=t[e];if(n!==":@")return n}}function NB(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 VB(i){return Object.keys(i).length===0}class vh{constructor(t){this.options=Object.assign({},vh.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;const e=new OB(this.options).parseXml(t);return DB(e,this.options)}}vh.defaultOptions={};function jB(i){return i.startsWith("<svg")||i.startsWith("<?xml")}globalThis&&globalThis.__awaiter;function bh(i,t,e,n=0){return i.expand(t+(n/2+(e?GB(e,t):0))),i}function GB(i,t){return i?t:0}let UB=0;function ai(){return UB++}var yr;(function(i){i[i.HORIZONTAL=0]="HORIZONTAL",i[i.VERTICAL=1]="VERTICAL"})(yr||(yr={}));function nb(i){const t=[];let e=0,n="";for(let o=0;o<i.length;o++)YB(i[o])?e?n+=i[o]:(e=1,n=i[o]):(e&&(t.push({text:n,direction:yr.VERTICAL}),n="",e=0),t.push({text:i[o],direction:yr.HORIZONTAL}));return n&&t.push({text:n,direction:yr.VERTICAL}),t}const $B=["…","(",")","—","【","】","「","」","《","》"],ob=new Map;$B.forEach(i=>ob.set(i,!0));const KB=[""],rb=new Map;function YB(i){if(ob.has(i))return!0;if(rb.has(i))return!1;let t=!1;return i.codePointAt(0)<256&&(t=!0),t}KB.forEach(i=>rb.set(i,!0));const Ch=ai(),XB=ai(),sb=ai(),yh=ai();ai();const Dg=ai(),_h=ai(),yl=ai(),wh=ai(),Sh=ai();ai();const Wg=ai();ai();const Ng=ai(),xh=ai(),Rh=ai(),lb=Symbol.for("GraphicService"),ab=Symbol.for("GraphicCreator"),hb={"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"},qB=Object.keys(hb);var db;(function(i){i[i.LESS_GROUP=0]="LESS_GROUP",i[i.MORE_GROUP=1]="MORE_GROUP"})(db||(db={}));let Ji=class _m extends Fi{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Dg,this._childUpdateTag=ue.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 gl),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new gl)}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===hl.GLOBAL){const o=new ke(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&ue.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;X.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),X.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=Je.x,y:e=Je.y,dx:n=Je.dx,dy:o=Je.dy,scaleX:r=Je.scaleX,scaleY:s=Je.scaleY,angle:l=Je.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 zt(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)}),X.graphicService.updateTempAABBBounds(n),X.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&=ue.CLEAR_BOUNDS,this._childUpdateTag&=ue.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=ue.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&ue.UPDATE_BOUNDS||(this._childUpdateTag|=ue.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(),X.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),X.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,X.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren(e=>{X.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),X.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&ue.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=X.graphicService.creator[n](e),o.name=t,this.add(o)),o}clone(){return new _m(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return _m.NOWORK_ANIMATE_ATTR}};Ji.NOWORK_ANIMATE_ATTR=kn;function Ah(i){return new Ji(i)}class ZB extends Ji{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 gl,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=>{X.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=>{X.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 ub=Symbol.for("TransformUtil"),cb=Symbol.for("GraphicUtil"),Vg=Symbol.for("LayerService"),gb=Symbol.for("StaticLayerHandlerContribution"),JB=Symbol.for("DynamicLayerHandlerContribution"),QB=Symbol.for("VirtualLayerHandlerContribution");var _l,tM=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},eM=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)};let wl=_l=class{static GenerateLayerId(){return`${_l.idprefix}_${_l.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=X.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"?kt.get(gb):i==="dynamic"?kt.get(JB):kt.get(QB),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 ZB(i,this.global,i.window,Object.assign(Object.assign({main:!1},t),{layerMode:n,canvasId:(e=t.canvasId)!==null&&e!==void 0?e:_l.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)}};wl.idprefix="visactor_layer",wl.prefix_count=0,wl=_l=tM([at(),eM("design:paramtypes",[])],wl);const iM=new Ft(i=>{i(Jc).to(Qc).inSingletonScope(),i(cl).to(Pg),i(cb).to(Hg).inSingletonScope(),i(ub).to(Eg).inSingletonScope(),i(Vg).to(wl).inSingletonScope()});function us(i,t){return!(!i&&!t)}function Sl(i,t){let e;return e=Z(i)?i.some(n=>n||n===void 0):!!i,e&&t>0}function _r(i,t,e){return e&&i*t>0}function fb(i,t,e,n,o){return o&&i*t>0&&e!==0&&n!==0}function jg(i,t){return i*t>0}function pb(i,t,e,n){return i*t>0&&e!==0&&n!==0}function nM(i,t,e,n,o,r,s,l){if(!i.pathProxy)return!1;const a=zt(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,b=_r(u,c,h),w=jg(u,f),y=us(h),C=Sl(d,g);if(!p||!y&&!C||!(b||w||s||l))return!0;t.beginPath();const _=typeof i.pathProxy=="function"?i.pathProxy(i.attribute):i.pathProxy;return Vo(_.commandList,t,e,n),t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,a),C&&(l?l(t,i.attribute,a):w&&(t.setStrokeStyle(i,i.attribute,e-m,n-v,a),t.stroke())),y&&(s?s(t,i.attribute,a):b&&(t.setCommonStyle(i,i.attribute,e-m,n-v,a),t.fill())),!0}function oM(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<Se?[]:(c=(d*(t-r)-u*(i-o))/c,[i+c*a,t+c*h])}function $o(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,b=f-c,w=p-g,y=b*b+w*w,C=o-r,_=c*p-f*g,A=(w<0?-1:1)*Math.sqrt(Math.max(0,C*C*y-_*_));let R=(_*w-b*A)/y,x=(-_*b-w*A)/y;const T=(_*w+b*A)/y,B=(-_*b+w*A)/y,M=R-m,H=x-v,F=T-m,P=B-v;return M*M+H*H>F*F+P*P&&(R=T,x=B),{cx:R,cy:x,x01:-d,y01:-u,x11:R*(o/C-1),y11:x*(o/C-1)}}function mb(i,t,e,n,o){const r=he(e-t),s=i.getParsedCornerRadius(),l=Z(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,b=Math.max(p,f),w=Math.max(m,v);let y=b,C=w;const _=o*Ne(d),A=o*Me(d),R=n*Ne(c),x=n*Me(c);let T,B,M,H;if((w>Se||b>Se)&&(T=o*Ne(u),B=o*Me(u),M=n*Ne(g),H=n*Me(g),r<ve)){const F=oM(_,A,M,H,T,B,R,x);if(F){const P=_-F[0],L=A-F[1],k=T-F[0],I=B-F[1],E=1/Me(tT((P*k+L*I)/(Ln(P*P+L*L)*Ln(k*k+I*I)))/2),z=Ln(F[0]*F[0]+F[1]*F[1]);C=pi(w,(n-z)/(E-1)),y=pi(b,(o-z)/(E+1))}}return{outerDeltaAngle:a,xors:_,yors:A,xirs:M,yirs:H,xore:T,yore:B,xire:R,yire:x,limitedOcr:y,limitedIcr:C,outerCornerRadiusStart:f,outerCornerRadiusEnd:p,maxOuterCornerRadius:b,maxInnerCornerRadius:w,outerStartAngle:d,outerEndAngle:u,innerDeltaAngle:h,innerEndAngle:c,innerStartAngle:g,innerCornerRadiusStart:v,innerCornerRadiusEnd:m}}function Gg(i,t,e,n,o,r,s){const{startAngle:l,endAngle:a}=i.getParsedAngle(),h=he(a-l),d=a>l;let u=!1;if(o<r){const c=o;o=r,r=c}if(o<=Se)t.moveTo(e,n);else if(h>=ne-Se)t.moveTo(e+o*Ne(l),n+o*Me(l)),t.arc(e,n,o,l,a,!d),r>Se&&(t.moveTo(e+r*Ne(a),n+r*Me(a)),t.arc(e,n,r,a,l,d));else{const{outerDeltaAngle:c,xors:g,yors:f,xirs:p,yirs:m,limitedOcr:v,outerCornerRadiusStart:b,outerCornerRadiusEnd:w,maxOuterCornerRadius:y,xore:C,yore:_,xire:A,yire:R,outerStartAngle:x,outerEndAngle:T,limitedIcr:B,innerDeltaAngle:M,innerEndAngle:H,innerStartAngle:F,innerCornerRadiusStart:P,innerCornerRadiusEnd:L,maxInnerCornerRadius:k}=mb(i,l,a,r,o);if(c<.001)s&&(s[3]||s[1])&&t.moveTo(e+g,n+f),u=!0;else if(v>Se){const I=pi(b,v),E=pi(w,v),z=$o(p,m,g,f,o,I,Number(d)),O=$o(C,_,A,R,o,E,Number(d));v<y&&I===E?!s||s[0]?(t.moveTo(e+z.cx+z.x01,n+z.cy+z.y01),t.arc(e+z.cx,n+z.cy,v,le(z.y01,z.x01),le(O.y01,O.x01),!d)):t.moveTo(e+z.cx+v*Ne(le(O.y01,O.x01)),n+z.cy+v*Me(le(O.y01,O.x01))):!s||s[0]?(t.moveTo(e+z.cx+z.x01,n+z.cy+z.y01),I>0&&t.arc(e+z.cx,n+z.cy,I,le(z.y01,z.x01),le(z.y11,z.x11),!d),t.arc(e,n,o,le(z.cy+z.y11,z.cx+z.x11),le(O.cy+O.y11,O.cx+O.x11),!d),E>0&&t.arc(e+O.cx,n+O.cy,E,le(O.y11,O.x11),le(O.y01,O.x01),!d)):E>0?t.moveTo(e+O.cx+E*Ne(le(O.y01,O.x01)),n+O.cy+E*Me(le(O.y01,O.x01))):t.moveTo(e+C,n+o*Me(T))}else!s||s[0]?(t.moveTo(e+g,n+f),t.arc(e,n,o,x,T,!d)):t.moveTo(e+o*Ne(T),n+o*Me(T));if(!(r>Se)||M<.001)!s||s[1]?t.lineTo(e+A,n+R):t.moveTo(e+A,n+R),u=!0;else if(B>Se){const I=pi(P,B),E=pi(L,B),z=$o(A,R,C,_,r,-E,Number(d)),O=$o(g,f,p,m,r,-I,Number(d));if(!s||s[1]?t.lineTo(e+z.cx+z.x01,n+z.cy+z.y01):t.moveTo(e+z.cx+z.x01,n+z.cy+z.y01),B<k&&I===E){const N=le(O.y01,O.x01);!s||s[2]?t.arc(e+z.cx,n+z.cy,B,le(z.y01,z.x01),N,!d):t.moveTo(e+z.cx+Ne(N),n+z.cy+Me(N))}else!s||s[2]?(E>0&&t.arc(e+z.cx,n+z.cy,E,le(z.y01,z.x01),le(z.y11,z.x11),!d),t.arc(e,n,r,le(z.cy+z.y11,z.cx+z.x11),le(O.cy+O.y11,O.cx+O.x11),d),I>0&&t.arc(e+O.cx,n+O.cy,I,le(O.y11,O.x11),le(O.y01,O.x01),!d)):I>0?t.moveTo(e+O.cx+I*Ne(le(O.y01,O.x01)),n+O.cy+I*Me(le(O.y01,O.x01))):t.moveTo(e+p,n+m)}else!s||s[1]?t.lineTo(e+A,n+R):t.moveTo(e+A,n+R),!s||s[2]?t.arc(e,n,r,H,F,d):t.moveTo(e+r*Ne(F),n+r*Me(F))}return s?s[3]&&t.lineTo(e+o*Ne(l),n+o*Me(l)):t.closePath(),u}class vn{static GetCanvas(){try{return vn.canvas||(vn.canvas=X.global.createCanvas({})),vn.canvas}catch{return null}}static GetCtx(){if(!vn.ctx){const t=vn.GetCanvas();vn.ctx=t.getContext("2d")}return vn.ctx}}class wr extends aT{static getInstance(){return wr._instance||(wr._instance=new wr),wr._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const n=vn.GetCanvas(),o=vn.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 wr(r,s),timestamp:[]},this.addLimitedTimestamp(a,Date.now(),{}),this.dataMap.set(l,a)),this.clearCache(this.dataMap,this.cacheParams),a.data}}class vi{static GetSize(t){for(let e=0;e<vi.ImageSize.length;e++)if(vi.ImageSize[e]>=t)return vi.ImageSize[e];return t}static Get(t,e,n,o,r,s,l){const a=vi.GenKey(t,e,n,o,r),h=vi.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=vi.GenKey(t,e,n,o,r);vi.cache[h]?vi.cache[h].push({width:l,height:a,pattern:s}):vi.cache[h]=[{width:l,height:a,pattern:s}]}static GenKey(t,e,n,o,r){return`${e},${n},${o},${r},${t.join()}`}}vi.cache={},vi.ImageSize=[20,40,80,160,320,640,1280,2560];function rM(i,t,e,n){const{stops:o,startAngle:r,endAngle:s}=n;for(;e<0;)e+=ne;for(;e>ne;)e-=ne;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),ds(l.color,a.color,h,!1)}function sM(i,t,e,n,o,r,s,l,a){const h=Math.floor(180*o/Math.PI),d=vn.GetCanvas(),u=vn.GetCtx();if(!u)return null;const c=vi.GetSize(l),g=vi.GetSize(a);let f=vi.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),b=wr.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 C=0,_=m-1;C<_&&!(r+C*v>s);C++){const A=b.getColor(C);u.beginPath(),u.rotate(v),u.moveTo(0,0),u.lineTo(p,-2*w),u.lineTo(p,0),u.fillStyle=A,u.closePath(),u.fill()}const y=u.getImageData(0,0,c,g);return d.width=y.width,d.height=y.height,u.putImageData(y,0,0),f=i.createPattern(d,"no-repeat"),f&&vi.Set(t,e,n,r,s,f,c,g),f}const Ug=Symbol.for("ArcRenderContribution"),lM=Symbol.for("AreaRenderContribution"),$g=Symbol.for("CircleRenderContribution"),Fn=Symbol.for("GroupRenderContribution"),Sr=Symbol.for("ImageRenderContribution"),Kg=Symbol.for("PathRenderContribution"),Yg=Symbol.for("PolygonRenderContribution"),xr=Symbol.for("RectRenderContribution"),Xg=Symbol.for("SymbolRenderContribution"),Th=Symbol.for("TextRenderContribution"),qg=Symbol.for("InteractiveSubRenderContribution");function aM(i,t){return i==="top"?Math.ceil(.79*t):i==="middle"?Math.round(.3*t):i==="bottom"?Math.round(-.21*t):0}function Xn(i,t){return i==="end"||i==="right"?-t:i==="center"?-t/2:0}function qn(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 vb(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 hM(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 dM(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 uM(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 xl(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 Zg(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 cM(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 Rl(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],b=t[15];let w=e[0],y=e[1],C=e[2],_=e[3];return i[0]=w*n+y*l+C*u+_*p,i[1]=w*o+y*a+C*c+_*m,i[2]=w*r+y*h+C*g+_*v,i[3]=w*s+y*d+C*f+_*b,w=e[4],y=e[5],C=e[6],_=e[7],i[4]=w*n+y*l+C*u+_*p,i[5]=w*o+y*a+C*c+_*m,i[6]=w*r+y*h+C*g+_*v,i[7]=w*s+y*d+C*f+_*b,w=e[8],y=e[9],C=e[10],_=e[11],i[8]=w*n+y*l+C*u+_*p,i[9]=w*o+y*a+C*c+_*m,i[10]=w*r+y*h+C*g+_*v,i[11]=w*s+y*d+C*f+_*b,w=e[12],y=e[13],C=e[14],_=e[15],i[12]=w*n+y*l+C*u+_*p,i[13]=w*o+y*a+C*c+_*m,i[14]=w*r+y*h+C*g+_*v,i[15]=w*s+y*d+C*f+_*b,i}function In(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 bb(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class gM{constructor(){this.pools=[]}allocate(t,e,n,o,r,s){if(!this.pools.length)return new Ve(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 Ve(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 Jg{constructor(){this.pools=[]}static identity(t){return vb(t)}allocate(){if(!this.pools.length)return bb();const t=this.pools.pop();return Jg.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():bb();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 Qi=new gM,Ge=new Jg;var fM=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},pM=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},mM=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};function Cb(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,b=[0,0,0];if(m){if(typeof m[0]=="string"){const w=parseFloat(m[0])/100,y=t.AABBBounds;b[0]=y.x1+(y.x2-y.x1)*w}else b[0]=m[0];if(typeof m[1]=="string"){const w=parseFloat(m[1])/100,y=t.AABBBounds;b[1]=y.x1+(y.x2-y.x1)*w}else b[1]=m[1];b[2]=(n=m[2])!==null&&n!==void 0?n:0}if(vb(i),xl(i,i,[o+l,r+a,s+h]),xl(i,i,[b[0],b[1],b[2]]),hM(i,i,f),dM(i,i,g),xl(i,i,[-b[0],-b[1],b[2]]),cM(i,i,[d,u,c]),p){const w=Ge.allocate(),y=[0,0];if(v){if(typeof m[0]=="string"){const C=parseFloat(m[0])/100,_=t.AABBBounds;y[0]=_.x1+(_.x2-_.x1)*C}else y[0]=m[0];if(typeof m[1]=="string"){const C=parseFloat(m[1])/100,_=t.AABBBounds;y[1]=_.x1+(_.x2-_.x1)*C}else y[1]=m[1]}xl(w,w,[y[0],y[1],0]),uM(w,w,p),xl(w,w,[-y[0],-y[1],0]),Rl(i,i,w)}}function vM(i){const{alpha:t,beta:e}=i.attribute;return t||e}let Qg=class{constructor(i){this.creator=i,this.hooks={onAttributeUpdate:new Li(["graphic"]),onSetStage:new Li(["graphic","stage"]),onRemove:new Li(["graphic"]),onRelease:new Li(["graphic"]),onAddIncremental:new Li(["graphic","group","stage"]),onClearIncremental:new Li(["graphic","group","stage"]),beforeUpdateAABBBounds:new Li(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new Li(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new Li(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new xe,this.tempAABBBounds2=new xe}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 pg(i);return Vo(e.commandList,n,0,0),!0}updateHTMLTextAABBBounds(i,t,e,n){const{textAlign:o,textBaseline:r}=i;if(i.forceBoundsHeight!=null){const s=et(i.forceBoundsHeight)?i.forceBoundsHeight:i.forceBoundsHeight(),l=qn(r,s,s);e.set(e.x1,l,e.x2,l+s)}if(i.forceBoundsWidth!=null){const s=et(i.forceBoundsWidth)?i.forceBoundsWidth:i.forceBoundsWidth(),l=Xn(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);bh(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,b=d/Math.abs(l+a)*2;bh(f,b,!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&&dg(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),X.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}}};Qg=fM([at(),mM(0,Xt(ab)),pM("design:paramtypes",[Object])],Qg);const Fe={x:0,y:0,z:0,lastModelMatrix:null};class Ii{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===oe.beforeFillStroke),this._afterRenderContribitions=this._renderContribitions.filter(e=>e.time===oe.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=_r(a,h,r),f=jg(a,u),p=us(r,s),m=Sl(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;Fe.x=r,Fe.y=s,Fe.z=l,Fe.lastModelMatrix=c;const f=g&&(o||vM(t)),p=f?t.transMatrix.onlyTranslate()&&!u:a===1&&h===1&&d===0&&!u;if(f){const m=Ge.allocate(),v=Ge.allocate();Cb(v,t,e),Rl(m,c||m,v),Fe.x=0,Fe.y=0,Fe.z=0,n.modelMatrix=m,n.setTransform(1,0,0,1,0,0,!0),Ge.free(v)}if(p&&!c){const m=t.getOffsetXY(e);Fe.x+=m.x,Fe.y+=m.y,Fe.z=l,n.setTransformForCurrent()}else if(f)Fe.x=0,Fe.y=0,Fe.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(g&&n.project){const m=t.getOffsetXY(e);Fe.x+=m.x,Fe.y+=m.y,this.transformWithoutTranslate(n,Fe.x,Fe.y,Fe.z,a,h,d)}else n.transformFromMatrix(t.transMatrix,!0),Fe.x=0,Fe.y=0,Fe.z=0;return Fe}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,b=(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,y=(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,C=(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,b,w,y,C,!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,nM(t,s,h,d,o,r)||(this.drawShape(t,s,h,d,o,r),this.z=0,s.modelMatrix!==c&&Ge.free(s.modelMatrix),s.modelMatrix=c),s.highPerformanceRestore()}}const bM=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(y){const C=new Error(t+": "+y);throw C.source=t,C}function n(){const y=g(o);return t.length>0&&e("Invalid input not EOF"),y}function o(){return r("linear",i.linearGradient,s)||r("radial",i.radialGradient,a)||r("conic",i.conicGradient,l)}function r(y,C,_){return function(A,R){const x=b(A);if(x){b(i.startCall)||e("Missing (");const T=R(x);return b(i.endCall)||e("Missing )"),T}}(C,function(A){const R=_();return R&&(b(i.comma)||e("Missing comma before color stops")),{type:y,orientation:R,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 y,C,_=h();return _&&(y=[],y.push(_),C=t,b(i.comma)&&(_=h(),_?y.push(_):t=C)),y}function h(){let y=function(){const C=v("shape",/^(circle)/i,0);return C&&(C.style=m()||d()),C}()||function(){const C=v("shape",/^(ellipse)/i,0);return C&&(C.style=p()||d()),C}();if(y)y.at=u();else{const C=d();if(C){y=C;const _=u();_&&(y.at=_)}else{const _=c();_&&(y={type:"default-radial",at:_})}}return y}function d(){return v("extent-keyword",i.extentKeywords,1)}function u(){if(v("position",/^at/,0)){const y=c();return y||e("Missing positioning value"),y}}function c(){const y={x:p(),y:p()};if(y.x||y.y)return{type:"position",value:y}}function g(y){let C=y();const _=[];if(C)for(_.push(C);b(i.comma);)C=y(),C?_.push(C):e("One extra comma");return _}function f(){const y=v("hex",i.hexColor,1)||v("rgba",i.rgbaColor,1)||v("rgb",i.rgbColor,1)||v("literal",i.literalColor,0);return y||e("Expected color definition"),y.length=p(),y}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(y,C,_){const A=b(C);if(A)return{type:y,value:A[_]}}function b(y){const C=/^[\n\r\t\s]+/.exec(t);C&&w(C[0].length);const _=y.exec(t);return _&&w(_[0].length),_}function w(y){t=t.substr(y)}return function(y){return t=y.toString(),n()}}();class cs{static IsGradient(t){return!(typeof t=="string"&&!t.includes("gradient"))}static IsGradientStr(t){return typeof t=="string"&&t.includes("gradient")}static Parse(t){if(cs.IsGradientStr(t))try{const e=bM(t)[0];if(e){if(e.type==="linear")return cs.ParseLinear(e);if(e.type==="radial")return cs.ParseRadial(e);if(e.type==="conic")return cs.ParseConic(e)}}catch{return t}return t}static ParseConic(t){const{orientation:e,colorStops:n=[]}=t,o=ve/2,r=parseFloat(e.value)/180*ve-o;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+ne,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=ve/2;let r=e.type==="angular"?parseFloat(e.value)/180*ve:0;for(;r<0;)r+=ne;for(;r>ne;)r-=ne;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<ve?(s=0,l=0,a=Math.cos(r-o),h=Math.sin(r-o)):r<ve+o?(s=1,l=0,a=s-Math.sin(r-ve),h=Math.cos(r-ve)):(s=1,a=s-Math.cos(r-o-ve),h-=Math.sin(r-o-ve)),{gradient:"linear",x0:s,y0:l,x1:a,y1:h,stops:n.map(d=>({color:d.value,offset:parseFloat(d.length.value)/100}))}}}function _o(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 tf(i,t,e,n=0,o=0){if(!t||t===!0)return"black";let r,s;if(Z(t))for(let l=0;l<t.length&&(s=t[l],!s);l++);else s=t;if(s=cs.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=CM(i,s,d,u,a,h):s.gradient==="conical"?r=_M(i,s,d,u,a,h):s.gradient==="radial"&&(r=yM(i,s,d,u,a,h))}return r||"orange"}function CM(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 yM(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 _M(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 wM=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},SM=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},yb=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};class Al{constructor(){this.time=oe.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:b=h.backgroundMode,backgroundFit:w=h.backgroundFit}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const y=t.resources.get(p);if(y.state!=="success"||!y.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const _=zt(t.parent).group,{scrollX:A=_.scrollX,scrollY:R=_.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(A,R)}e.clip();const C=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,o,h),e.globalAlpha=m*v,this.doDrawImage(e,y.data,C,b,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=as.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),as.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 Rr=new Al;let zn=class{constructor(i){this.subRenderContribitions=i,this.time=oe.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=wM([at(),yb(0,Xt(We)),yb(0,Ye(qg)),SM("design:paramtypes",[Object])],zn);class ef{constructor(){this.time=oe.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,n,o,r){const s=(t-2*e)/2,l=o.dpr,a=as.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])),as.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,ne),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 gs=new ef;class xM{constructor(){this.time=oe.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:b=h.outerPadding,startAngle:w=h.startAngle,endAngle:y=h.endAngle,opacity:C=h.opacity,x:_=h.x,y:A=h.y,scaleX:R=h.scaleX,scaleY:x=h.scaleY}=t.attribute;let{innerRadius:T=h.innerRadius,outerRadius:B=h.outerRadius}=t.attribute;B+=b,T-=v;const M=(H,F)=>{const P=!(!H||!H.stroke),{distance:L=h[F].distance}=H,k=_o(e,L,e.dpr),I=L/B,E=F==="outerBorder"?1:-1;if(t.setAttributes({outerRadius:B+E*k,innerRadius:T-E*k,startAngle:w-E*I,endAngle:y+E*I}),e.beginPath(),Gg(t,e,n,o,B+E*k,T-E*k),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,H,h[F]);else if(P){const z=h[F].opacity;h[F].opacity=C,e.setStrokeStyle(t,H,(_-n)/R,(A-o)/x,h[F]),h[F].opacity=z,e.stroke()}};p&&M(g,"outerBorder"),m&&M(f,"innerBorder"),t.setAttributes({outerRadius:B,innerRadius:T,startAngle:w,endAngle:y})}}const RM=new xM,AM=gs,TM=Rr;class BM{constructor(){this.time=oe.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:b=h.startAngle,endAngle:w=h.endAngle,opacity:y=h.opacity,x:C=h.x,y:_=h.y,scaleX:A=h.scaleX,scaleY:R=h.scaleY}=t.attribute,x=(T,B)=>{const M=!(!T||!T.stroke),{distance:H=h[B].distance}=T,F=_o(e,H,e.dpr),P=B==="outerBorder"?1:-1;if(e.beginPath(),e.arc(n,o,v+P*F,b,w),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,T,h[B]);else if(M){const L=h[B].opacity;h[B].opacity=y,e.setStrokeStyle(t,T,(C-n)/A,(_-o)/R,h[B]),h[B].opacity=L,e.stroke()}};p&&x(g,"outerBorder"),m&&x(f,"innerBorder")}}const MM=new BM,PM=gs,HM=Rr;class EM extends Al{constructor(){super(...arguments),this.time=oe.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 LM=new EM,Bh=ve/2;function On(i,t,e,n,o,r,s){let l;if(n<0&&(t+=n,n=-n),o<0&&(e+=o,o=-o),et(r,!0))l=[r=he(r),r,r,r];else if(Array.isArray(r)){const _=r;let A,R;switch(_.length){case 0:l=[0,0,0,0];break;case 1:A=he(_[0]),l=[A,A,A,A];break;case 2:case 3:A=he(_[0]),R=he(_[1]),l=[A,R,A,R];break;default:l=_,l[0]=he(l[0]),l[1]=he(l[1]),l[2]=he(l[2]),l[3]=he(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]],b=[d[0]-g[2],d[1]],w=[d[0],d[1]-g[2]],y=[u[0]+g[3],u[1]],C=[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]),!sl(m,v)){s&&s[0]&&i.moveTo(m[0],m[1]);const _=m[0],A=m[1]+g[1];i.arc(_,A,g[1],-Bh,0,!1)}if(s&&s[1]?s[1](v[0],v[1],w[0],w[1]):i.lineTo(w[0],w[1]),!sl(b,w)){const _=w[0]-g[2],A=w[1];s&&s[1]&&i.moveTo(w[0],w[1]),i.arc(_,A,g[2],0,Bh,!1)}if(s&&s[2]?s[2](b[0],b[1],y[0],y[1]):i.lineTo(y[0],y[1]),!sl(y,C)){const _=y[0],A=y[1]-g[3];s&&s[2]&&i.moveTo(y[0],y[1]),i.arc(_,A,g[3],Bh,ve,!1)}if(s&&s[3]?s[3](C[0],C[1],p[0],p[1]):i.lineTo(p[0],p[1]),!sl(f,p)){const _=f[0],A=f[1]+g[0];s&&s[3]&&i.moveTo(p[0],p[1]),i.arc(_,A,g[0],ve,ve+Bh,!1)}return!s&&i.closePath(),i}var _b=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 wb{constructor(){this.time=oe.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:b=h.opacity,x:w=h.x,y=h.y,scaleX:C=h.scaleX,scaleY:_=h.scaleY,x1:A,y1:R}=t.attribute;let{width:x,height:T}=t.attribute;x=(x??A-n)||0,T=(T??R-o)||0;const B=(M,H)=>{const F=!(!M||!M.stroke),P=H==="outerBorder"?-1:1,{distance:L=h[H].distance}=M,k=_o(e,L,e.dpr),I=n+P*k,E=o+P*k,z=2*k;if(v===0||Z(v)&&v.every(O=>O===0)?(e.beginPath(),e.rect(I,E,x-P*z,T-P*z)):(e.beginPath(),On(e,I,E,x-P*z,T-P*z,v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,M,h[H]);else if(F){const O=h[H].opacity;h[H].opacity=b,e.setStrokeStyle(t,M,(w-n)/C,(y-o)/_,h[H]),h[H].opacity=O,e.stroke()}};p&&B(g,"outerBorder"),m&&B(f,"innerBorder")}}let fs=class{constructor(){this.time=oe.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)}};fs=_b([at()],fs);let ps=class{constructor(){this.time=oe.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:b=h.cornerRadius}=t.attribute;let{width:w,height:y}=t.attribute;if(w=(w??g-p)||0,y=(y??f-m)||0,Array.isArray(v)&&v.some(C=>C===!1)){if(e.setStrokeStyle(t,t.attribute,n,o,h),!(b===0||Z(b)&&b.every(C=>C===0))){let C,_=0;return On(e,n,o,w,y,b,new Array(4).fill(0).map((A,R)=>(x,T,B,M)=>{v[R]&&(_===R-1&&v[R]===C||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:v[R]}),n,o,h),e.beginPath(),e.moveTo(x,T),C=v[R]),_=R,e.lineTo(B,M),e.stroke(),R===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+y):e.moveTo(n+w,o+y),v[2]?e.lineTo(n,o+y):e.moveTo(n,o+y),v[3]){const C=v[0]?o-e.lineWidth/2:o;e.lineTo(n,C)}else e.moveTo(n,o);e.stroke()}}};ps=_b([at()],ps);const kM=new wb,FM=gs,IM=Rr;class zM extends Al{constructor(){super(...arguments),this.time=oe.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 b=zt(t.parent).group,{scrollX:w=b.scrollX,scrollY:y=b.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(w,y)}const v=t.AABBBounds;this.doDrawImage(e,m.data,v,f,p),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(ie(g)){const{stroke:m,fill:v,lineWidth:b=1,cornerRadius:w=0,expandX:y=0,expandY:C=0}=g;if(!m&&!v)return;e.beginPath();const{x:_,y:A,width:R,height:x}=OM(t);w?On(e,_-y,A-C,R+2*y,x+2*C,w):e.rect(_-y,A-C,R+2*y,x+2*C),e.globalAlpha=1,v&&(e.fillStyle=v,e.fill()),m&&b>0&&(e.lineWidth=b,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 OM(i){const t=vl(i.attribute.boundsPadding),e=i.AABBBounds;let n=e.x1,o=e.y1,r=e.width(),s=e.height();return et(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 DM extends wb{constructor(){super(...arguments),this.time=oe.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 WM=new DM,NM=new zM;class VM{constructor(){this.time=oe.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:b=h.size,opacity:w=h.opacity,x:y=h.x,y:C=h.y,scaleX:_=h.scaleX,scaleY:A=h.scaleY}=t.attribute,R=(x,T)=>{const B=!(!x||!x.stroke),{distance:M=h[T].distance}=x,H=_o(e,M,e.dpr),F=T==="outerBorder"?1:-1;if(e.beginPath(),g.drawOffset(e,b,n,o,F*H)===!1&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,x,h[T]);else if(B){const P=h[T].opacity;h[T].opacity=w,e.setStrokeStyle(t,x,(y-n)/_,(C-o)/A,h[T]),h[T].opacity=P,e.stroke()}};m&&R(f,"outerBorder"),v&&R(p,"innerBorder")}}const jM=new VM,GM=gs,UM=Rr;class $M extends ef{constructor(){super(...arguments),this.time=oe.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:b=t.attribute}=g||{},{texture:w=(f=t.attribute.texture)!==null&&f!==void 0?f:fh(h,"texture"),textureColor:y=(p=t.attribute.textureColor)!==null&&p!==void 0?p:fh(h,"textureColor"),textureSize:C=(m=t.attribute.textureSize)!==null&&m!==void 0?m:fh(h,"textureSize"),texturePadding:_=(v=t.attribute.texturePadding)!==null&&v!==void 0?v:fh(h,"texturePadding")}=b;w&&this.drawTexture(w,t,e,n,o,h,y,C,_)}}var KM=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},YM=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},Sb=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Mh=class extends Ii{constructor(i){super(),this.arcRenderContribitions=i,this.numberType=Ch,this.builtinContributions=[RM,TM,AM],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 k=o;o=r,r=k}const{outerDeltaAngle:f,xors:p,yors:m,xirs:v,yirs:b,limitedOcr:w,outerCornerRadiusStart:y,outerCornerRadiusEnd:C,maxOuterCornerRadius:_,xore:A,yore:R,xire:x,yire:T,limitedIcr:B,innerDeltaAngle:M,innerStartAngle:H,innerCornerRadiusStart:F,innerCornerRadiusEnd:P,maxInnerCornerRadius:L}=mb(i,d,u,r,o);if(w>Se){const k=pi(y,w),I=pi(C,w),E=$o(v,b,p,m,o,k,Number(c)),z=$o(A,R,x,T,o,I,Number(c));if(w<_&&k===I)t.moveTo(e+E.cx+E.x01,n+E.cy+E.y01),t.arc(e+E.cx,n+E.cy,w,le(E.y01,E.x01),le(z.y01,z.x01),!c);else{const O=u-a-.03,N=le(z.y11,z.x11);t.arc(e,n,o,O,N,!c),I>0&&t.arc(e+z.cx,n+z.cy,I,le(z.y11,z.x11),le(z.y01,z.x01),!c)}}else t.moveTo(e+p,n+m);if(!(r>Se)||M<.001)t.lineTo(e+x,n+T),g=!0;else if(B>Se){const k=pi(F,B),I=pi(P,B),E=$o(x,T,A,R,r,-I,Number(c)),z=$o(p,m,v,b,r,-k,Number(c));if(t.lineTo(e+E.cx+E.x01,n+E.cy+E.y01),B<L&&k===I){const O=le(z.y01,z.x01);t.arc(e+E.cx,n+E.cy,B,le(E.y01,E.x01),O,!c)}else{I>0&&t.arc(e+E.cx,n+E.cy,I,le(E.y01,E.x01),le(E.y11,E.x11),!c);const O=le(E.cy+E.y11,E.cx+E.x11),N=u-a-.03;t.arc(e,n,r,O,N,c)}}else t.lineTo(e+r*Ne(H),n+r*Me(H));return g}drawShape(i,t,e,n,o,r,s,l){const a=zt(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:b}=f,{outerPadding:w=a.outerPadding,innerPadding:y=a.innerPadding,cap:C=a.cap,forceShowCap:_=a.forceShowCap}=i.attribute;let{outerRadius:A=a.outerRadius,innerRadius:R=a.innerRadius}=i.attribute;A+=w,R-=y;let x=0;const T=(Xe(C)&&C||C[0])&&h.gradient==="conical";if(T){const{sc:F,startAngle:P,endAngle:L}=i.getParsedAngle();he(L-P)<ne-Se&&(x=F||0,h.startAngle-=x,h.endAngle-=x)}let B=!1;const{isFullStroke:M,stroke:H}=TB(d);if(v||M){t.beginPath(),Gg(i,t,e,n,A,R),B=!0,t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,a),this.beforeRenderStep(i,t,e,n,v,b,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=()=>{b&&M&&(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(!M&&b&&(t.beginPath(),Gg(i,t,e,n,A,R,H),B||this.beforeRenderStep(i,t,e,n,v,b,p,m,a,o,s,l),l?l(t,i.attribute,a):m&&(t.setStrokeStyle(i,i.attribute,e,n,a),t.stroke())),(Xe(C)&&C||C[1])&&_){const{startAngle:F,endAngle:P}=i.getParsedAngle();if(he(P-F)>=ne-Se){t.beginPath();const L=Math.abs(A-R)/2/A,{endAngle:k=a.endAngle,fill:I=a.fill}=i.attribute,E=k;this.drawArcTailCapPath(i,t,e,n,A,R,E,E+L),B||this.beforeRenderStep(i,t,e,n,v,b,p,m,a,o,s,l);const z=()=>{if(v){const N=I;if(N.gradient==="conical"){const W=rM(0,0,k,N);s||_r&&(t.setCommonStyle(i,i.attribute,e,n,a),t.fillStyle=W,t.fill())}}},O=()=>{b&&(l||m&&(t.setStrokeStyle(i,i.attribute,e,n,a),t.stroke()))};z(),O()}}this.afterRenderStep(i,t,e,n,v,b,p,m,a,o,s,l),T&&(h.startAngle+=x,h.endAngle+=x)}draw(i,t,e,n){const o=zt(i,n==null?void 0:n.theme).arc;this._draw(i,o,!1,e,n)}};Mh=KM([at(),Sb(0,Xt(We)),Sb(0,Ye(Ug)),YM("design:paramtypes",[Object])],Mh);var XM=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},qM=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},xb=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Ph=class extends Ii{constructor(i){super(),this.circleRenderContribitions=i,this.numberType=yh,this.builtinContributions=[MM,HM,PM],this.init(i)}drawShape(i,t,e,n,o,r,s,l){const a=zt(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:b,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,b,w,m,v,a,o,s,l);const y=()=>{b&&(s?s(t,i.attribute,a):m&&(t.setCommonStyle(i,i.attribute,c-e,g-n,a),t.fill()))},C=()=>{w&&(l?l(t,i.attribute,a):v&&(t.setStrokeStyle(i,i.attribute,c-e,g-n,a),t.stroke()))};f?(C(),y()):(y(),C()),this.afterRenderStep(i,t,e,n,b,w,m,v,a,o,s,l)}draw(i,t,e,n){const o=zt(i,n==null?void 0:n.theme).circle;this._draw(i,o,!1,e,n)}};Ph=XM([at(),xb(0,Xt(We)),xb(0,Ye($g)),qM("design:paramtypes",[Object])],Ph);function Hh(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]=bg(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 Rb(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 nf(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,b=!0;u.forEach((w,y)=>{w.originP1!==w.originP2&&(b=Rb(i,w,v,b,r,s,l)),v=w})}else u.forEach(v=>{v.defined?(d&&i.moveTo(v.p0.x+r,v.p0.y+s,l),Hh(i,v,1,o),d=!1):d=!0});return}if(e<=0)return;let c;n==="x"?c=ye.ROW:n==="y"?c=ye.COLUMN:n==="auto"&&(c=t.direction);const g=e*t.tryUpdateLength(c);let f=0,p=!0,m=null;for(let v=0,b=u.length;v<b;v++){const w=u[v],y=w.getLength(c),C=(g-f)/y;if(f+=y,C<0)break;if(h){if(w.originP1===w.originP2){m=w;continue}p=Rb(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),Hh(i,w,pi(C,1),o),d=!1}}}function ZM(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 JM(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 QM=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 Tl=class extends Ii{constructor(){super(...arguments),this.numberType=yl}draw(i,t,e,n){const o=zt(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,b,w;if(!t)return;i.beginPath();const y=(p=this.z)!==null&&p!==void 0?p:0;nf(i.camera?i:i.nativeContext,t,a,h,{offsetX:d,offsetY:u,offsetZ:y}),c.cache&&!Z(c.cache)&&c.cache.curves.every(B=>B.defined)&&c.attribute.curveType&&c.attribute.curveType.includes("Closed")&&i.closePath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(c,s,l);const{x:C=0,x:_=0}=s;e!==!1&&(g?g(i,s,l):o&&(i.setCommonStyle(c,s,C-d,_-u,l),i.fill())),n!==!1&&(f?f(i,s,l):r&&(i.setStrokeStyle(c,s,C-d,_-u,l),i.stroke()));let{connectedType:A,connectedX:R,connectedY:x,connectedStyle:T}=s;if(Z(l)?(A=(m=A??l[0].connectedType)!==null&&m!==void 0?m:l[1].connectedType,R=(v=R??l[0].connectedX)!==null&&v!==void 0?v:l[1].connectedX,x=(b=x??l[0].connectedY)!==null&&b!==void 0?b:l[1].connectedY,T=(w=T??l[0].connectedStyle)!==null&&w!==void 0?w:l[1].connectedStyle):(A=A??l.connectedType,R=R??l.connectedX,x=x??l.connectedY,T=T??l.connectedStyle),A!=="connect"&&A!=="zero"&&(A="none"),A!=="none"){i.beginPath(),nf(i.camera?i:i.nativeContext,t,a,h,{offsetX:d,offsetY:u,offsetZ:y,drawConnect:!0,mode:A,zeroX:R,zeroY:x});const B=[];Z(l)?l.forEach(M=>B.push(M)):B.push(l),B.push(s),e!==!1&&(g?g(i,s,l):o&&(i.setCommonStyle(c,T,C-d,_-u,B),i.fill())),n!==!1&&(f?f(i,s,l):r&&(i.setStrokeStyle(c,T,C-d,_-u,B),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 y=p[w];t.lineTo(y.x+s,y.y+l,f)}t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,a);const{x:v=0,x:b=0}=i.attribute;e!==!1&&(u?u(t,i.attribute,a):o&&(t.setCommonStyle(i,i.attribute,v-s,b-l,a),t.fill())),n!==!1&&(c?c(t,i.attribute,a):r&&(t.setStrokeStyle(i,i.attribute,v-s,b-l,a),t.stroke()))}drawShape(i,t,e,n,o,r,s,l){const a=zt(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:b=a.clipRange,clipRangeByDimension:w=a.clipRangeByDimension}=i.attribute;if(b===1&&!g&&!f.some(y=>y.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:y,segments:C}=i.attribute,_=y;if(C&&C.length){let A,R;if(i.cache=C.map((x,T)=>{if(x.points.length<=1&&T===0)return x.points[0]&&(R={endX:x.points[0].x,endY:x.points[0].y,curves:[{defined:x.points[0].defined!==!1}]}),null;T===1?A={x:R.endX,y:R.endY,defined:R.curves[R.curves.length-1].defined}:T>1&&(A.x=R.endX,A.y=R.endY,A.defined=R.curves[R.curves.length-1].defined);const B=br(x.points,v,{startPoint:A,curveTension:m});return R=B,B}).filter(x=>!!x),v==="linearClosed"){let x;for(let T=0;T<i.cache.length;T++){const B=i.cache[T];for(let M=0;M<B.curves.length;M++)if(B.curves[M].defined){x=B.curves[M].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(!y||!y.length)return i.cache=null,void i.clearUpdateShapeTag();i.cache=br(_,v,{curveTension:m})}i.clearUpdateShapeTag()}if(Array.isArray(i.cache)){const y=i.attribute.segments.filter(C=>C.points.length);if(y[0].points.length===1&&y.shift(),b===1){let C=!1;i.cache.forEach((_,A)=>{C||(C=this.drawSegmentItem(t,_,!!h,!!d,u,c,y[A],[a,i.attribute],b,w,e,n,i,s,l))})}else{const C=i.cache.reduce((x,T)=>x+T.getLength(),0),_=b*C;let A=0,R=!1;i.cache.forEach((x,T)=>{if(R)return;const B=x.getLength(),M=(_-A)/B;A+=B,M>0&&(R=this.drawSegmentItem(t,x,!!h,!!d,u,c,y[T],[a,i.attribute],pi(M,1),w,e,n,i,s,l))})}}else this.drawSegmentItem(t,i.cache,!!h,!!d,u,c,i.attribute,a,b,w,e,n,i,s,l)}};Tl=QM([at()],Tl);function tP(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 _=[],A=[];let R=!0;if(r){let x,T,B=!0;const M=l.curves.length;l.curves.forEach((H,F)=>{const P=a.curves[M-F-1];let L=H,k=P;if(H.originP1===H.originP2)return x=H,void(T=P);if(x&&x.originP1===x.originP2&&(L=x,k=T),H.defined)B||(_.push(L),A.push(k),ms(i,_,A,n),_.length=0,A.length=0,B=!B);else{const{originP1:I,originP2:E}=H;let z,O;I&&I.defined!==!1?(z=L,O=k):I&&E.defined!==!1&&(z=H,O=P),B?(B=!B,_.push(z||H),A.push(O||P)):z&&(B=!B,_.push(z||H),A.push(O||P),ms(i,_,A,n),_.length=0,A.length=0)}x=H}),ms(i,_,A,n)}else{for(let x=0,T=l.curves.length;x<T;x++){const B=l.curves[x];R!==B.defined?(R?(Eh(i,_,A,n),_.length=0,A.length=0):(_.push(B),A.push(a.curves[T-x-1])),R=!R):R&&(_.push(B),A.push(a.curves[T-x-1]))}Eh(i,_,A,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=he(u.x-d[0].p0.x),g=he(u.y-d[0].p0.y);h=h??(c>g?ye.ROW:ye.COLUMN),Number.isFinite(c)||(h=ye.COLUMN),Number.isFinite(g)||(h=ye.ROW);const f=e*(h===ye.ROW?c:g);let p=0,m=!0;const v=[],b=[];let w,y,C=!0;for(let _=0,A=l.curves.length;_<A;_++){const R=l.curves[_],x=R.getLength(h),T=(f-p)/x;if(T<0)break;if(p+=x,r){const B=a.curves[A-_-1];let M=R,H=B;if(R.originP1===R.originP2){w=R,y=B;continue}if(w&&w.originP1===w.originP2&&(M=w,H=y),R.defined)C||(v.push(M),b.push(H),ms(i,v,b,n),v.length=0,b.length=0,C=!C);else{const{originP1:F,originP2:P}=R;let L,k;F&&F.defined!==!1?(L=M,k=H):F&&P.defined!==!1&&(L=R,k=B),C?(C=!C,v.push(L||R),b.push(k||B)):L&&(C=!C,v.push(L||R),b.push(k||B),ms(i,v,b,n),v.length=0,b.length=0)}w=R}else{let B=null,M=null;m!==R.defined?(m?(Eh(i,v,b,n),v.length=0,b.length=0):(B=R,M=a.curves[A-_-1]),m=!m):m&&(B=R,M=a.curves[A-_-1]),B&&M&&(T<1&&(B=B.p2&&B.p3?bg(B,T)[0]:pv(B,T)[0],M=M.p2&&M.p3?bg(M,1-T)[1]:pv(M,1-T)[1]),B.defined=m,M.defined=m,v.push(B),b.push(M)),B=null,M=null}}r?ms(i,v,b,n):Eh(i,v,b,n)}function ms(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 Eh(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),Hh(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),Hh(i,h,1,n),l=!1):l=!0}i.closePath()}const eP=new $M,iP=Rr;var nP=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},oP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},Ab=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let of=class extends Ii{constructor(i){super(),this.areaRenderContribitions=i,this.numberType=sb,this.builtinContributions=[eP,iP],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,b=m[0];t.moveTo(b.x+s,b.y+l,v);for(let C=1;C<m.length;C++){const _=m[C];t.lineTo(_.x+s,_.y+l,v)}for(let C=m.length-1;C>=0;C--){const _=m[C];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:y=0}=i.attribute;e!==!1&&(u?u(t,i.attribute,a):o&&(t.setCommonStyle(i,i.attribute,w-s,y-l,a),t.fill())),this.afterRenderStep(i,t,s,l,!!o,!1,e,!1,a,h,u,null,{attribute:i.attribute}),(()=>{var C,_;if(n){const{stroke:A=a&&a.stroke}=i.attribute;if(Z(A)&&(A[0]||A[2])&&A[1]===!1){if(t.beginPath(),A[0]){t.moveTo(b.x+s,b.y+l,v);for(let R=1;R<m.length;R++){const x=m[R];t.lineTo(x.x+s,x.y+l,v)}}else if(A[2]){const R=m[m.length-1];t.moveTo(R.x+s,R.y+l,v);for(let x=m.length-2;x>=0;x--){const T=m[x];t.lineTo(((C=T.x1)!==null&&C!==void 0?C: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,y-l,a),t.stroke())}})()}drawShape(i,t,e,n,o,r,s,l){var a,h,d,u,c,g;const f=zt(i,r==null?void 0:r.theme).area,{fill:p=f.fill,stroke:m=f.stroke,fillOpacity:v=f.fillOpacity,z:b=f.z,strokeOpacity:w=f.strokeOpacity,curveTension:y=f.curveTension}=i.attribute,C=this.valid(i,f,s,l);if(!C)return;const{doFill:_}=C,A=C.doStroke&&C.sVisible,{clipRange:R=f.clipRange,closePath:x,points:T,segments:B}=i.attribute;let{curveType:M=f.curveType}=i.attribute;if(x&&M==="linear"&&(M="linearClosed"),R===1&&!B&&!T.some(H=>H.defined===!1)&&M==="linear")return this.drawLinearAreaHighPerformance(i,t,!!p,A,v,w,e,n,f,o,r,s,l);if(i.shouldUpdateShape()){if(B&&B.length){let H,F;const P=B.map((I,E)=>{if(I.points.length<=1&&E===0)return I.points[0]&&(F={endX:I.points[0].x,endY:I.points[0].y}),null;E===1?H={x:F.endX,y:F.endY}:E>1&&(H.x=F.endX,H.y=F.endY);const z=br(I.points,M,{startPoint:H,curveTension:y});return F=z,z}).filter(I=>!!I);let L;const k=[];for(let I=B.length-1;I>=0;I--){const E=B[I].points,z=[];for(let O=E.length-1;O>=0;O--)z.push({x:(a=E[O].x1)!==null&&a!==void 0?a:E[O].x,y:(h=E[O].y1)!==null&&h!==void 0?h:E[O].y});if(I!==0){const O=B[I-1].points,N=O[O.length-1];N&&z.push({x:(d=N.x1)!==null&&d!==void 0?d:N.x,y:(u=N.y1)!==null&&u!==void 0?u:N.y})}z.length>1&&(L=br(z,M==="stepBefore"?"stepAfter":M==="stepAfter"?"stepBefore":M,{curveTension:y}),k.unshift(L))}i.cacheArea=k.map((I,E)=>({top:P[E],bottom:I}))}else{if(!T||!T.length)return i.cacheArea=null,void i.clearUpdateShapeTag();{const H=T,F=[];for(let k=T.length-1;k>=0;k--)F.push({x:(c=T[k].x1)!==null&&c!==void 0?c:T[k].x,y:(g=T[k].y1)!==null&&g!==void 0?g:T[k].y});const P=br(H,M,{curveTension:y}),L=br(F,M==="stepBefore"?"stepAfter":M==="stepAfter"?"stepBefore":M,{curveTension:y});i.cacheArea={top:P,bottom:L}}}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(),R===1){let F=!1;i.cacheArea.forEach((P,L)=>{F||(F=this.drawSegmentItem(t,P,_,v,A,w,H[L],[f,i.attribute],R,e,n,b,i,o,s,l))})}else{const F=i.cacheArea.reduce((I,E)=>I+E.top.getLength(),0),P=R*F;let L=0,k=!1;i.cacheArea.forEach((I,E)=>{if(k)return;const z=I.top.getLength(),O=(P-L)/z;L+=z,O>0&&(k=this.drawSegmentItem(t,I,_,v,A,w,H[E],[f,i.attribute],pi(O,1),e,n,b,i,o,s,l))})}}else this.drawSegmentItem(t,i.cacheArea,_,v,A,w,i.attribute,f,R,e,n,b,i,o,s,l)}draw(i,t,e,n){const o=zt(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,b,w,y;if(!(t&&t.top&&t.bottom&&t.top.curves&&t.top.curves.length&&t.bottom.curves&&t.bottom.curves.length))return;let{connectedType:C,connectedX:_,connectedY:A,connectedStyle:R}=s;const x=[];if(f&&(Z(l)?(C=(v=C??l[0].connectedType)!==null&&v!==void 0?v:l[1].connectedType,_=(b=_??l[0].connectedX)!==null&&b!==void 0?b:l[1].connectedX,A=(w=A??l[0].connectedY)!==null&&w!==void 0?w:l[1].connectedY,R=(y=R??l[0].connectedStyle)!==null&&y!==void 0?y:l[1].connectedStyle):(C=C??l.connectedType,_=_??l.connectedX,A=A??l.connectedY,R=R??l.connectedStyle),C!=="connect"&&C!=="zero"&&(C="none"),Z(l)?l.forEach(E=>x.push(E)):x.push(l),x.push(s)),f&&C==="none")return!1;i.beginPath();const{points:T,segments:B}=c.attribute;let M,H,F=ye.ROW;if(B){const E=B[B.length-1];H=B[0].points[0],M=E.points[E.points.length-1]}else H=T[0],M=T[T.length-1];const P=he(M.x-H.x),L=he(M.y-H.y);F=M.x1==null?ye.ROW:M.y1==null?ye.COLUMN:Number.isFinite(P+L)?P>L?ye.ROW:ye.COLUMN:ye.ROW,tP(i.camera?i:i.nativeContext,t,a,{offsetX:h,offsetY:d,offsetZ:u,direction:F,drawConnect:f,mode:C,zeroX:_,zeroY:A}),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:k=0,x:I=0}=s;return e!==!1&&(p?p(i,s,l):n&&(i.setCommonStyle(c,f?R:s,k-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:E=l&&l[1]&&l[1].stroke}=s;Z(E)&&(E[0]||E[2])&&E[1]===!1&&(i.beginPath(),nf(i.camera?i:i.nativeContext,E[0]?t.top:t.bottom,a,F===ye.ROW?"x":"y",{offsetX:h,offsetY:d,offsetZ:u,drawConnect:f,mode:C,zeroX:_,zeroY:A})),i.setStrokeStyle(c,f?R:s,k-h,I-d,f?x:l),i.stroke()}})(),!1}};of=nP([at(),Ab(0,Xt(We)),Ab(0,Ye(lM)),oP("design:paramtypes",[Object])],of);const rP=gs,sP=Rr;var lP=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},aP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},Tb=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Lh=class extends Ii{constructor(i){super(),this.pathRenderContribitions=i,this.numberType=wh,this.builtinContributions=[sP,rP],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:zt(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:b,doFill:w,doStroke:y}=m;if(t.beginPath(),i.pathShape)Vo(i.pathShape.commandList,t,e,n,1,1,p);else{const A=(d=i.attribute.path)!==null&&d!==void 0?d:u.path;Vo(A.commandList,t,e,n,1,1,p)}t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,u),this.beforeRenderStep(i,t,e,n,w,y,v,b,u,o,s,l);const C=()=>{y&&(l?l(t,i.attribute,u):b&&(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?(C(),_()):(_(),C()),this.afterRenderStep(i,t,e,n,w,y,v,b,u,o,s,l)}draw(i,t,e,n){const o=zt(i,n==null?void 0:n.theme).path;this.tempTheme=o,this._draw(i,o,!1,e,n),this.tempTheme=null}};Lh=lP([at(),Tb(0,Xt(We)),Tb(0,Ye(Kg)),aP("design:paramtypes",[Object])],Lh);var hP=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},dP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},Bb=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let kh=class extends Ii{constructor(i){super(),this.rectRenderContribitions=i,this.type="rect",this.numberType=Wg,this.builtinContributions=[kM,IM,FM],this.init(i)}drawShape(i,t,e,n,o,r,s,l){var a;const h=(a=this.tempTheme)!==null&&a!==void 0?a:zt(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:b=h.visible,x1:w,y1:y,x:C=h.x,y:_=h.y,fillStrokeOrder:A=h.fillStrokeOrder}=i.attribute;let{width:R,height:x}=i.attribute;R=(R??w-C)||0,x=(x??y-_)||0;const T=fb(f,p,R,x,d),B=pb(f,v,R,x),M=us(d,u),H=Sl(c,m);if(!i.valid||!b||!M&&!H||!(T||B||s||l||u))return;g===0||Z(g)&&g.every(k=>k===0)?(t.beginPath(),t.rect(e,n,R,x)):(t.beginPath(),On(t,e,n,R,x,g));const F={doFill:M,doStroke:H};t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,h),this.beforeRenderStep(i,t,e,n,M,H,T,B,h,o,s,l,F);const P=()=>{F.doFill&&(s?s(t,i.attribute,h):T&&(t.setCommonStyle(i,i.attribute,C-e,_-n,h),t.fill()))},L=()=>{F.doStroke&&(l?l(t,i.attribute,h):B&&(t.setStrokeStyle(i,i.attribute,C-e,_-n,h),t.stroke()))};A?(L(),P()):(P(),L()),this.afterRenderStep(i,t,e,n,M,H,T,B,h,o,s,l)}draw(i,t,e,n){const o=zt(i,n==null?void 0:n.theme).rect;this.tempTheme=o,this._draw(i,o,!1,e,n),this.tempTheme=null}};kh=hP([at(),Bb(0,Xt(We)),Bb(0,Ye(xr)),dP("design:paramtypes",[Object])],kh);var uP=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},cP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},Mb=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let Fh=class extends Ii{constructor(i){super(),this.symbolRenderContribitions=i,this.numberType=xh,this.builtinContributions=[jM,UM,GM],this.init(i)}drawShape(i,t,e,n,o,r,s,l){var a;const h=zt(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:b,doFill:w,doStroke:y}=m,C=i.getParsedPath();if(!C)return;const{keepDirIn3d:_=h.keepDirIn3d}=i.attribute,A=(a=this.z)!==null&&a!==void 0?a:0;t.beginPath();const R=(B,M)=>{var H,F,P;if(i._parsedPath.svgCache){const I=Object.assign({},M);I.fill=(H=M.fill)!==null&&H!==void 0?H:i.attribute.fill,I.opacity=(F=M.opacity)!==null&&F!==void 0?F:i.attribute.opacity,I.fillOpacity=i.attribute.fillOpacity,I.stroke=(P=M.stroke)!==null&&P!==void 0?P:i.attribute.stroke,M=I}const L=()=>{M.fill&&(s?s(t,i.attribute,h):(t.setCommonStyle(i,M,u-e,c-n,h),t.fill()))},k=()=>{M.stroke&&(l?l(t,i.attribute,h):(t.setStrokeStyle(i,M,(u-e)/g,(c-n)/f,h),t.stroke()))};p?(k(),L()):(L(),k())};if(_&&t.camera&&t.project){const B=t.project(e,n,A),M=t.camera;t.camera=null,C.draw(t,Z(d)?[d[0]*g,d[1]*f]:d*g,B.x,B.y,void 0,R)===!1&&t.closePath(),t.camera=M}else C.draw(t,d,e,n,A,R)===!1&&t.closePath();t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,h),this.beforeRenderStep(i,t,e,n,w,y,v,b,h,o,s,l);const x=()=>{w&&!C.isSvg&&(s?s(t,i.attribute,h):v&&(t.setCommonStyle(i,i.attribute,u-e,c-n,h),t.fill()))},T=()=>{y&&!C.isSvg&&(l?l(t,i.attribute,h):b&&(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,y,v,b,h,o,s,l)}draw(i,t,e,n){const o=zt(i,n==null?void 0:n.theme).symbol;this._draw(i,o,!1,e,n)}};Fh=uP([at(),Mb(0,Xt(We)),Mb(0,Ye(Xg)),cP("design:paramtypes",[Object])],Fh);class gP{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new xe)}allocate(t,e,n,o){if(!this.pools.length)return new xe().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 xe(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 Ih=new gP;class fP{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 ft=new fP;let zh;function Oh(i){return zh||(zh=ft.CreateGraphic("text",{})),zh.initAttributes(i),zh.AABBBounds}class pP extends Al{constructor(){super(...arguments),this.time=oe.beforeFillStroke}drawShape(t,e,n,o,r,s,l,a,h,d,u,c){var g,f,p,m,v,b,w,y,C,_;const{backgroundMode:A=h.backgroundMode,backgroundFit:R=h.backgroundFit}=t.attribute;let x,{background:T}=t.attribute;if(!T)return;const B=()=>{t.type==="richtext"&&(e.restore(),e.save(),x&&e.setTransformFromMatrix(x,!0,1))};let M;t.type==="richtext"&&(x=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const H=ie(T)&&T.background,F=t.transMatrix.onlyTranslate();if(H){const P=t.AABBBounds,L=((g=T.x)!==null&&g!==void 0?g:P.x1)+((f=T.dx)!==null&&f!==void 0?f:0),k=((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(),E=(b=T.height)!==null&&b!==void 0?b:P.height();if(M=Ih.allocate(L,k,L+I,k+E),T=T.background,!F){const z=M.width(),O=M.height();M.set(((w=T.x)!==null&&w!==void 0?w:0)+((y=T.dx)!==null&&y!==void 0?y:0),((C=T.y)!==null&&C!==void 0?C:0)+((_=T.dy)!==null&&_!==void 0?_:0),z,O)}}else M=t.AABBBounds,F||(M=Oh(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 B();e.highPerformanceSave(),F&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,n,o,h),this.doDrawImage(e,P.data,M,A,R),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:P}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,o,h),e.fillStyle=T,P?(On(e,M.x1,M.y1,M.width(),M.height(),P),e.fill()):e.fillRect(M.x1,M.y1,M.width(),M.height()),e.highPerformanceRestore()}H&&Ih.free(M),B()}}const Pb=new pP;var mP=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},vP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},Hb=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let rf=class extends Ii{constructor(i){super(),this.textRenderContribitions=i,this.numberType=Rh,this.builtinContributions=[Pb],this.init(i)}drawShape(i,t,e,n,o,r,s,l){var a,h,d;const u=zt(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:b=u.verticalMode,x:w=u.x,y=u.y}=i.attribute;let{textAlign:C=u.textAlign,textBaseline:_=u.textBaseline}=i.attribute;if(!b&&m==="vertical"){const L=C;C=(a=i.getBaselineMapAlign()[_])!==null&&a!==void 0?a:"left",_=(h=i.getAlignMapBaseline()[L])!==null&&h!==void 0?h:"top"}const A=(d=bo(i.attribute.lineHeight,v))!==null&&d!==void 0?d:v,R=this.valid(i,u,s,l);if(!R)return;const{fVisible:x,sVisible:T,doFill:B,doStroke:M}=R,H=!p,F=this.z||0;t.beginPath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(i,i.attribute,u),this.beforeRenderStep(i,t,e,n,B,M,x,T,u,o,s,l),H&&this.transformUseContext2d(i,u,F,t);const P=(L,k,I,E)=>{let z=e+k;const O=n+I;if(E){t.highPerformanceSave(),z+=v;const N=Qi.allocate(1,0,0,1,0,0);N.rotateByCenter(Math.PI/2,z,O),t.transformFromMatrix(N,!0),Qi.free(N)}M&&(l?l(t,i.attribute,u):T&&(t.setStrokeStyle(i,i.attribute,w-e,y-n,u),t.strokeText(L,z,O,F))),B&&(s?s(t,i.attribute,u):x&&(t.setCommonStyle(i,i.attribute,w-e,y-n,u),t.fillText(L,z,O,F),this.drawUnderLine(g,f,i,z,O,F,u,t))),E&&(t.highPerformanceRestore(),t.setTransformForCurrent())};if(i.isMultiLine)if(t.setTextStyleWithoutAlignBaseline(i.attribute,u,F),m==="horizontal"){const{multilineLayout:L}=i;if(!L)return void t.highPerformanceRestore();const{xOffset:k,yOffset:I}=L.bbox;M&&(l?l(t,i.attribute,u):T&&(t.setStrokeStyle(i,i.attribute,w-e,y-n,u),L.lines.forEach(E=>{t.strokeText(E.str,(E.leftOffset||0)+k+e,(E.topOffset||0)+I+n,F)}))),B&&(s?s(t,i.attribute,u):x&&(t.setCommonStyle(i,i.attribute,w-e,y-n,u),L.lines.forEach(E=>{t.fillText(E.str,(E.leftOffset||0)+k+e,(E.topOffset||0)+I+n,F),this.drawUnderLine(g,f,i,(E.leftOffset||0)+k+e,(E.topOffset||0)+I+n-aM("bottom",v)-.05*v,F,u,t,{width:E.width})})))}else{i.tryUpdateAABBBounds();const L=i.cache,{verticalList:k}=L;t.textAlign="left",t.textBaseline="top";const I=A*k.length;let E=0;k.forEach(N=>{const W=N.reduce((j,G)=>j+(G.width||0),0);E=No(W,E)});let z=0,O=0;_==="bottom"?O=-I:_==="middle"&&(O=-I/2),C==="center"?z-=E/2:C==="right"&&(z-=E),k.forEach((N,W)=>{const j=N.reduce(($,U)=>$+(U.width||0),0),G=E-j;let V=z;C==="center"?V+=G/2:C==="right"&&(V+=G),N.forEach($=>{const{text:U,width:tt,direction:ot}=$;P(U,I-(W+1)*A+O,V,ot),V+=tt})})}else if(m==="horizontal"){t.setTextStyle(i.attribute,u,F);const L=i.clipedText;let k=0;A!==v&&(_==="top"?k=(A-v)/2:_==="middle"||_==="bottom"&&(k=-(A-v)/2)),P(L,0,k,0)}else{i.tryUpdateAABBBounds();const L=i.cache;if(L){t.setTextStyleWithoutAlignBaseline(i.attribute,u,F);const{verticalList:k}=L;let I=0;const E=k[0].reduce((O,N)=>O+(N.width||0),0);let z=0;_==="bottom"?z=-A:_==="middle"&&(z=-A/2),C==="center"?I-=E/2:C==="right"&&(I-=E),t.textAlign="left",t.textBaseline="top",k[0].forEach(O=>{const{text:N,width:W,direction:j}=O;P(N,z,I,j),I+=W})}}H&&this.restoreTransformUseContext2d(i,u,F,t),this.afterRenderStep(i,t,e,n,B,M,x,T,u,o,s,l)}draw(i,t,e,n){const o=zt(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=!mt(a),b=v?a.width:e.clipedWidth,w=v?0:Xn(h,b),y=qn(v?"alphabetic":d,u,u),C={lineWidth:0,stroke:c,opacity:g,strokeOpacity:m};let _=v?-3:0;if(i){C.lineWidth=i,l.setStrokeStyle(e,C,n,o,s),p&&l.setLineDash(p),l.beginPath();const A=o+y+u+f+_;l.moveTo(n+w,A,r),l.lineTo(n+w+b,A,r),l.stroke()}if(v&&(_=-1),t){C.lineWidth=t,l.setStrokeStyle(e,C,n,o,s),l.beginPath();const A=o+y+u/2+_;l.moveTo(n+w,A,r),l.lineTo(n+w+b,A,r),l.stroke()}}};rf=mP([at(),Hb(0,Xt(We)),Hb(0,Ye(Th)),vP("design:paramtypes",[Object])],rf);function Eb(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 bP(i,t,e,n,o,r=!0){var s;if(t.length<3)return void Eb(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,b=Math.abs(Math.tan(v));let w=Array.isArray(o)?(s=o[h%t.length])!==null&&s!==void 0?s:0:o,y=w/b;const C=Dh(g,f),_=Dh(p,m),A=Math.min(C,_);y>A&&(y=A,w=A*b);const R=sf(u,y,C,g,f),x=sf(u,y,_,p,m),T=2*u.x-R.x-x.x,B=2*u.y-R.y-x.y,M=Dh(T,B),H=sf(u,Dh(y,w),M,T,B);let F=Math.atan2(R.y-H.y,R.x-H.x);const P=Math.atan2(x.y-H.y,x.x-H.x);let L=P-F;L<0&&(F=P,L=-L),L>Math.PI&&(L-=Math.PI),h===0?i.moveTo(R.x+e,R.y+n):i.lineTo(R.x+e,R.y+n),L&&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 Dh(i,t){return Math.sqrt(i*i+t*t)}function sf(i,t,e,n,o){const r=t/e;return{x:i.x-n*r,y:i.y-o*r}}const CP=gs,yP=Rr;var _P=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},wP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},Lb=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let lf=class extends Ii{constructor(i){super(),this.polygonRenderContribitions=i,this.numberType=Sh,this.builtinContributions=[yP,CP],this.init(i)}drawShape(i,t,e,n,o,r,s,l){const a=zt(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:b,doStroke:w}=p;t.beginPath(),d<=0||Z(d)&&d.every(_=>_===0)?Eb(t.camera?t:t.nativeContext,h,e,n):bP(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,b,w,m,v,a,o,s,l);const y=()=>{b&&(s?s(t,i.attribute,a):m&&(t.setCommonStyle(i,i.attribute,u-e,c-n,a),t.fill()))},C=()=>{w&&(l?l(t,i.attribute,a):v&&(t.setStrokeStyle(i,i.attribute,u-e,c-n,a),t.stroke()))};f?(C(),y()):(y(),C()),this.afterRenderStep(i,t,e,n,b,w,m,v,a,o,s,l)}draw(i,t,e,n){const o=zt(i,n==null?void 0:n.theme).polygon;this._draw(i,o,!1,e,n)}};lf=_P([at(),Lb(0,Xt(We)),Lb(0,Ye(Yg)),wP("design:paramtypes",[Object])],lf);var SP=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},xP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},kb=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};let af=class{constructor(i){this.groupRenderContribitions=i,this.numberType=Dg}drawShape(i,t,e,n,o,r,s,l){const a=zt(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:b=a.cornerRadius,path:w=a.path,lineWidth:y=a.lineWidth,visible:C=a.visible,fillStrokeOrder:_=a.fillStrokeOrder,x:A=a.x,y:R=a.y}=i.attribute,x=fb(c,m,g,f,h),T=pb(c,v,g,f),B=us(h,d),M=Sl(u,y);if(!i.valid||!C||!p&&(!B&&!M||!(x||T||s||l||d)))return;if(w&&w.length&&o.drawContribution){const L=t.disableFill,k=t.disableStroke,I=t.disableBeginPath;t.disableFill=!0,t.disableStroke=!0,t.disableBeginPath=!0,w.forEach(E=>{o.drawContribution.getRenderContribution(E).draw(E,o.renderService,o,r)}),t.disableFill=L,t.disableStroke=k,t.disableBeginPath=I}else b===0||Z(b)&&b.every(L=>L===0)?(t.beginPath(),t.rect(e,n,g,f)):(t.beginPath(),On(t,e,n,g,f,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(LM));const H={doFill:B,doStroke:M};this._groupRenderContribitions.forEach(L=>{L.time===oe.beforeFillStroke&&L.drawShape(i,t,e,n,B,M,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,A-e,R-n,a),t.fill()))},P=()=>{H.doStroke&&(l?l(t,i.attribute,a):T&&(t.setStrokeStyle(i,i.attribute,A-e,R-n,a),t.stroke()))};_?(P(),F()):(F(),P()),this._groupRenderContribitions.forEach(L=>{L.time===oe.afterFillStroke&&L.drawShape(i,t,e,n,B,M,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=zt(i,n==null?void 0:n.theme).group,h=o.modelMatrix;if(o.camera){const g=Ge.allocate(),f=Ge.allocate();Cb(f,i,a),Rl(g,h||g,f),o.modelMatrix=g,Ge.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&&Ge.free(o.modelMatrix),o.modelMatrix=h,o.baseGlobalAlpha=l,c&&c.then?c.then(()=>{r?o.restore():o.highPerformanceRestore()}):r?o.restore():o.highPerformanceRestore()}};af=SP([at(),kb(0,Xt(We)),kb(0,Ye(Fn)),xP("design:paramtypes",[Object])],af);var RP=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},AP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},Fb=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};const TP=["","repeat-x","repeat-y","repeat"];let hf=class extends Ii{constructor(i){super(),this.imageRenderContribitions=i,this.numberType=_h,this.builtinContributions=[WM,NM],this.init(i)}drawShape(i,t,e,n,o,r,s,l){const a=zt(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,b=this.valid(i,a,s);if(!b)return;const{fVisible:w,sVisible:y,doFill:C,doStroke:_}=b;t.setShadowBlendStyle&&t.setShadowBlendStyle(i,a),this.beforeRenderStep(i,t,e,n,C,!1,w,!1,a,o,s);const A=()=>{if(C){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||Z(p)&&p.every(M=>M===0)||(t.beginPath(),On(t,e,n,h,d,p),t.save(),t.clip(),T=!0),t.setCommonStyle(i,i.attribute,e,n,a);let B=0;if(u==="repeat"&&(B|=1),c==="repeat"&&(B|=2),B){const M=t.createPattern(x.data,TP[B]);t.fillStyle=M,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()}}},R=()=>{_&&(l?l(t,i.attribute,a):y&&(t.setStrokeStyle(i,i.attribute,g-e,f-n,a),t.stroke()))};m?(R(),A()):(A(),R()),this.afterRenderStep(i,t,e,n,C,!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"&&ee(n))return void ce.improveImageLoading(n);if(s.state!=="success")return}const{context:o}=t.drawParams;if(!o)return;const r=zt(i).image;this._draw(i,r,!1,e)}};hf=RP([at(),Fb(0,Xt(We)),Fb(0,Ye(Sr)),AP("design:paramtypes",[Object])],hf);const Ib=Symbol.for("IncrementalDrawContribution"),Wh=Symbol.for("ArcRender"),Nh=Symbol.for("CircleRender"),Ri=Symbol.for("GraphicRender"),zb=Symbol.for("GroupRender"),Vh=Symbol.for("LineRender"),jh=Symbol.for("PathRender"),Gh=Symbol.for("PolygonRender"),Uh=Symbol.for("RectRender"),$h=Symbol.for("SymbolRender"),df=Symbol.for("TextRender"),uf=Symbol.for("RichTextRender"),Ob=Symbol.for("ImageRender"),cf=Symbol.for("DrawContribution"),Db=(i,t,e,n)=>{let o,r=!1,s=!1;if(t.forEachChildren(l=>(r=l.numberType===XB,!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+=ne;for(;m<0;)m+=ne;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 BP=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},MP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)};const Bl=Symbol.for("DrawItemInterceptor"),Wb=new xe,Nb=new xe;class PP{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){Wb.copy(o.dirtyBounds),Nb.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,Qi.allocate(1,0,0,1,0,0)),s.highPerformanceRestore(),o.dirtyBounds&&o.backupDirtyBounds&&(o.dirtyBounds.copy(Wb),o.backupDirtyBounds.copy(Nb)),!0}}class HP{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 Kh=class{constructor(){this.order=1,this.interceptors=[new PP,new LP,new EP,new HP]}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}};Kh=BP([at(),MP("design:paramtypes",[])],Kh);class EP{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=ft.CreateGraphic("group",{}),n.id="_interactive_group",t.add(n)),(e=n.shadowRoot)!==null&&e!==void 0?e:n.attachShadow()}}class LP{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=Ge.allocate();Zg(h,a);const d=s.modelMatrix;if(d){if(h){const u=Ge.allocate();s.modelMatrix=Rl(u,d,h)}}else s.modelMatrix=h;return s.setTransform(1,0,0,1,0,0,!0),t.isContainer?Db(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&&Ge.free(s.modelMatrix),s.modelMatrix=d,n.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var kP=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},FP=globalThis&&globalThis.__metadata||function(i,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,t)},IP=globalThis&&globalThis.__param||function(i,t){return function(e,n){t(e,n,i)}};const Vb=Symbol.for("RenderService");let gf=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}};gf=kP([at(),IP(0,Xt(cf)),FP("design:paramtypes",[Object])],gf);const zP=new Ft(i=>{i(Vb).to(gf)}),vs=Symbol.for("PickerService"),jb=Symbol.for("GlobalPickerService"),Ml=(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},Gb=["radius","startAngle","endAngle",...mn];let ff=class wm extends Fi{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=yh}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 zt(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}=X.graphicService.updateTempAABBBounds(n);return Ml(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),X.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>ne-Se?n.set(-s,-s,s,s):Ig(o,r,s,n),n}needUpdateTags(t){return super.needUpdateTags(t,Gb)}needUpdateTag(t){return super.needUpdateTag(t,Gb)}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 ni;return a.arc(0,0,r,s,l),a}clone(){return new wm(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return wm.NOWORK_ANIMATE_ATTR}};ff.NOWORK_ANIMATE_ATTR=kn;function Ub(i){return new ff(i)}class pf{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 $b=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...mn];let hi=class uo extends Fi{get font(){const t=this.getGraphicTheme();return this._font||(this._font=eh(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=Rh,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return Z(t)?!t.every(e=>e==null||e===""):t!=null&&t!==""}getGraphicTheme(){return zt(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 uo({})),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=ns(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}=X.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);bh(r,d,!0,h),n.union(r)}return X.graphicService.combindShadowAABBBounds(n,this),t.forceBoundsHeight==null&&t.forceBoundsWidth==null||X.graphicService.updateHTMLTextAABBBounds(t,e,n),dg(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:b=s.suffixPosition,heightLimit:w=0,lineClamp:y}=this.attribute,C=(e=bo(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 A=X.graphicUtil.textMeasure,R=new pf(l,{fontSize:d,fontWeight:m,fontFamily:l},A),x=Z(t)?t.map(P=>P.toString()):[t.toString()],T=[],B=[0,0];let M=1/0;if(w>0&&(M=Math.max(Math.floor(w/C),1)),y&&(M=Math.min(M,y)),typeof c=="number"&&c!==1/0){if(c>0)for(let L=0;L<x.length;L++){const k=x[L];let I=!0;if(L===M-1){const O=R.textMeasure.clipTextWithSuffix(k,R.textOptions,c,u,!1,b,L!==x.length-1);T.push({str:O.str,width:O.width});break}const E=R.textMeasure.clipText(k,R.textOptions,c,p!=="break-all",p==="keep-all");if(k!==""&&E.str===""||E.wordBreaked){if(u){const O=R.textMeasure.clipTextWithSuffix(k,R.textOptions,c,u,!1,b);E.str=(o=O.str)!==null&&o!==void 0?o:"",E.width=(r=O.width)!==null&&r!==void 0?r:0}else E.str="",E.width=0;I=!1}T.push({str:E.str,width:E.width});let z=E.str.length;if(!E.wordBreaked||k!==""&&E.str===""||(I=!0,z=E.wordBreaked),E.str.length!==k.length){if(I){let O=k.substring(z);p==="keep-all"&&(O=O.replace(/^\s+/g,"")),x.splice(L+1,0,O)}}}let P=0;T.forEach(L=>{P=Math.max(P,L.width)}),B[0]=P}else{let P,L,k=0;for(let I=0,E=x.length;I<E;I++){if(I===M-1){const z=R.textMeasure.clipTextWithSuffix(x[I],R.textOptions,c,u,!1,b);T.push({str:z.str,width:z.width}),k=Math.max(k,z.width);break}L=x[I],P=R.textMeasure.measureTextWidth(L,R.textOptions,p==="break-word"),k=Math.max(k,P),T.push({str:L,width:P})}B[0]=k}B[1]=T.length*(C+_);const H={xOffset:0,yOffset:0,width:B[0],height:B[1]};R.LayoutBBox(H,a,h);const F=R.layoutWithBBox(H,T,a,h,C);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=X.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:b=o.lineWidth,ignoreBuf:w=o.ignoreBuf,whiteSpace:y=o.whiteSpace,suffixPosition:C=o.suffixPosition}=h;if(y==="normal")return this.updateWrapAABBBounds(t);const _=w?0:Math.max(2,.075*p),A=h.fontSize||o.fontSize,R=(e=bo(h.lineHeight,A))!==null&&e!==void 0?e:A+_;if(!this.shouldUpdateShape()&&this.cache){l=(n=this.cache.clipedWidth)!==null&&n!==void 0?n:0;const M=Xn(c,l),H=qn(g,R,p);return this._AABBBounds.set(M,H,M+l,H+R),v&&this._AABBBounds.expand(b/2),this._AABBBounds}if(Number.isFinite(d)){if(u){const M=u===!0?o.ellipsis:u,H=s.clipTextWithSuffix(t.toString(),{fontSize:p,fontWeight:m,fontFamily:f},d,M,!1,C);a=H.str,l=H.width}else{const M=s.clipText(t.toString(),{fontSize:p,fontWeight:m,fontFamily:f},d,!1);a=M.str,l=M.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=Xn(c,l);let T=R;X.global&&X.global.isSafari()&&(T+=.2*p);const B=qn(g,T,p,_);return this._AABBBounds.set(x,B,x+l,B+T),v&&this._AABBBounds.expand(b/2),this._AABBBounds}getBaselineMapAlign(){return uo.baselineMapAlign}getAlignMapBaseline(){return uo.alignMapBaseline}updateVerticalSinglelineAABBBounds(t){var e,n,o;const r=this.getGraphicTheme(),s=X.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:b=r.verticalMode,suffixPosition:w=r.suffixPosition}=a,y=(e=bo(a.lineHeight,a.fontSize||r.fontSize))!==null&&e!==void 0?e:(a.fontSize||r.fontSize)+d;let{textAlign:C=r.textAlign,textBaseline:_=r.textBaseline}=a;if(!b){const T=C;C=(n=uo.baselineMapAlign[_])!==null&&n!==void 0?n:"left",_=(o=uo.alignMapBaseline[T])!==null&&o!==void 0?o:"top"}if(!this.shouldUpdateShape()&&this.cache){l=this.cache.clipedWidth;const T=Xn(C,l),B=qn(_,y,g);return this._AABBBounds.set(B,T,B+y,T+l),m&&this._AABBBounds.expand(v/2),this._AABBBounds}let A=[nb(t.toString())];if(Number.isFinite(u)){if(c){const T=c===!0?r.ellipsis:c,B=s.clipTextWithSuffixVertical(A[0],{fontSize:g,fontWeight:f,fontFamily:p},u,T,!1,w);A=[B.verticalList],l=B.width}else{const T=s.clipTextVertical(A[0],{fontSize:g,fontWeight:f,fontFamily:p},u,!1);A=[T.verticalList],l=T.width}this.cache.verticalList=A,this.cache.clipedWidth=l}else l=0,A[0].forEach(T=>{const B=T.direction===yr.HORIZONTAL?g:s.measureTextWidth(T.text,{fontSize:g,fontWeight:f,fontFamily:p});l+=B,T.width=B}),this.cache.verticalList=A,this.cache.clipedWidth=l;this.clearUpdateShapeTag();const R=Xn(C,l),x=qn(_,y,g);return this._AABBBounds.set(x,R,x+y,R+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,b=(e=bo(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=X.graphicUtil.textMeasure,y=new pf(l,{fontSize:d,fontWeight:u,fontFamily:l},w).GetLayoutByLines(t,a,h,b,c===!0?o.ellipsis:c||void 0,!1,g,v),{bbox:C}=y;return this.cache.layoutData=y,this.clearUpdateShapeTag(),this._AABBBounds.set(C.xOffset,C.yOffset,C.xOffset+C.width,C.yOffset+C.height),f&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,n,o;const r=this.getGraphicTheme(),s=X.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:b=r.verticalMode,suffixPosition:w=r.suffixPosition}=a,y=(e=bo(a.lineHeight,a.fontSize||r.fontSize))!==null&&e!==void 0?e:(a.fontSize||r.fontSize)+d;let{textAlign:C=r.textAlign,textBaseline:_=r.textBaseline}=a;if(!b){const B=C;C=(n=uo.baselineMapAlign[_])!==null&&n!==void 0?n:"left",_=(o=uo.alignMapBaseline[B])!==null&&o!==void 0?o:"top"}if(l=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach(F=>{const P=F.reduce((L,k)=>L+k.width,0);l=No(P,l)});const B=Xn(C,l),M=this.cache.verticalList.length*y,H=qn(_,M,f);return this._AABBBounds.set(H,B,H+M,B+l),m&&this._AABBBounds.expand(v/2),this._AABBBounds}const A=t.map(B=>nb(B.toString()));A.forEach((B,M)=>{if(Number.isFinite(u))if(c){const H=c===!0?r.ellipsis:c,F=s.clipTextWithSuffixVertical(B,{fontSize:f,fontWeight:p,fontFamily:g},u,H,!1,w);A[M]=F.verticalList,l=F.width}else{const H=s.clipTextVertical(B,{fontSize:f,fontWeight:p,fontFamily:g},u,!1);A[M]=H.verticalList,l=H.width}else l=0,B.forEach(H=>{const F=H.direction===yr.HORIZONTAL?f:s.measureTextWidth(H.text,{fontSize:f,fontWeight:p,fontFamily:g});l+=F,H.width=F})}),this.cache.verticalList=A,this.clearUpdateShapeTag(),this.cache.verticalList.forEach(B=>{const M=B.reduce((H,F)=>H+F.width,0);l=No(M,l)});const R=Xn(C,l),x=this.cache.verticalList.length*y,T=qn(_,x,f);return this._AABBBounds.set(T,R,T+x,R+l),m&&this._AABBBounds.expand(v/2),this._AABBBounds}needUpdateTags(t,e=$b){return super.needUpdateTags(t,e)}needUpdateTag(t,e=$b){return super.needUpdateTag(t,e)}clone(){return new uo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return uo.NOWORK_ANIMATE_ATTR}};hi.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},kn),hi.baselineMapAlign={top:"left",bottom:"right",middle:"center"},hi.alignMapBaseline={left:"top",right:"bottom",center:"middle"};function mf(i){return new hi(i)}const Yh=["heightLimit","lineClamp"];class Xh extends hi{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return Z(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:b=0,suffixPosition:w=s.suffixPosition,lineClamp:y}=this.attribute,C=(e=bo(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 A=X.graphicUtil.textMeasure,R=new pf(l,{fontSize:d,fontWeight:m,fontFamily:l},A),x=t.map(P=>P.toString()),T=[],B=[0,0];let M=1/0;if(b>0&&(M=Math.max(Math.floor(b/C),1)),y&&(M=Math.min(M,y)),typeof c=="number"&&c!==1/0){if(c>0)for(let L=0;L<x.length;L++){const k=x[L];let I=!0;if(L===M-1){const z=R.textMeasure.clipTextWithSuffix(k,R.textOptions,c,u,!1,w);T.push({str:z.str,width:z.width});break}const E=R.textMeasure.clipText(k,R.textOptions,c,p==="break-word");if(k!==""&&E.str===""){if(u){const z=R.textMeasure.clipTextWithSuffix(k,R.textOptions,c,u,!1,w);E.str=(o=z.str)!==null&&o!==void 0?o:"",E.width=(r=z.width)!==null&&r!==void 0?r:0}else E.str="",E.width=0;I=!1}if(T.push({str:E.str,width:E.width}),E.str.length!==k.length){if(I){const z=k.substring(E.str.length);x.splice(L+1,0,z)}}}let P=0;T.forEach(L=>{P=Math.max(P,L.width)}),B[0]=P}else{let P,L,k=0;for(let I=0,E=x.length;I<E;I++){if(I===M-1){const z=R.textMeasure.clipTextWithSuffix(x[I],R.textOptions,c,u,!1,w);T.push({str:z.str,width:z.width}),k=Math.max(k,z.width);break}L=x[I],P=R.textMeasure.measureTextWidth(L,R.textOptions,p==="break-word"),k=Math.max(k,P),T.push({str:L,width:P})}B[0]=k}B[1]=T.length*(C+_);const H={xOffset:0,yOffset:0,width:B[0],height:B[1]};R.LayoutBBox(H,a,h);const F=R.layoutWithBBox(H,T,a,h,C);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<Yh.length;e++){const n=Yh[e];if(t.indexOf(n)!==-1)return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<Yh.length;e++)if(t===Yh[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return Xh.NOWORK_ANIMATE_ATTR}}function OP(i){return new Xh(i)}class Ie{bounds(t,e){if(et(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 Kb(i,t,e,n,o){return o?i.arc(e,n,t,0,li,!1,o):i.arc(e,n,t,0,li),!1}class DP extends Ie{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 Kb(t,e/2,n,o,r)}drawOffset(t,e,n,o,r,s){return Kb(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 WP=new DP;function NP(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 VP(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 jP extends Ie{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 NP(t,e/6,n,o,r)}drawOffset(t,e,n,o,r,s){return VP(t,e/6,n,o,r,s)}}const GP=new jP;function vf(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 UP extends Ie{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 vf(t,e/2,n,o,r)}drawFitDir(t,e,n,o,r){return vf(t,e/2,n,o,r)}drawOffset(t,e,n,o,r,s){return vf(t,e/2+r,n,o,s)}}const $P=new UP;function Yb(i,t,e,n){const o=2*t;return i.rect(e-t,n-t,o,o),!1}class KP extends Ie{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,o){return Yb(t,e/2,n,o)}drawOffset(t,e,n,o,r){return Yb(t,e/2+r,n,o)}}const YP=new KP;function Xb(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 qb extends Ie{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 Xb(t,e/2,n,o)}drawOffset(t,e,n,o,r){return Xb(t,e/2,n,o,r)}}const XP=new qb;class qP extends qb{constructor(){super(...arguments),this.type="triangle"}}const ZP=new qP,Zb=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),JP=Math.sin(li/10)*Zb,QP=-Math.cos(li/10)*Zb;function Jb(i,t,e,n){const o=JP*t,r=QP*t;i.moveTo(e,-t+n),i.lineTo(o+e,r+n);for(let s=1;s<5;++s){const l=li*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 t2 extends Ie{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 Jb(t,e/2,n,o)}drawOffset(t,e,n,o,r){return Jb(t,e/2+r,n,o)}}const e2=new t2,i2=Ln(3);function Qb(i,t,e,n){const o=t,r=o/i2,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 n2 extends Ie{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 Qb(t,e/2,n,o)}drawOffset(t,e,n,o,r){return Qb(t,e/2+r,n,o)}}const o2=new n2;function tC(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 r2 extends Ie{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,n,o){return tC(t,e/2,n,o)}drawOffset(t,e,n,o,r){return tC(t,e/2+r,n,o)}}const s2=new r2;function eC(i,t,e,n){return i.moveTo(-t+e,n),i.lineTo(e,t+n),!1}class l2 extends Ie{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,n,o){return eC(t,e/2,n,o)}drawOffset(t,e,n,o,r){return eC(t,e/2+r,n,o)}}const a2=new l2,bn=-.5,Cn=Ln(3)/2,iC=1/Ln(12);function nC(i,t,e,n){const o=t/2,r=t*iC,s=o,l=t*iC+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(bn*o-Cn*r+e,Cn*o+bn*r+n),i.lineTo(bn*s-Cn*l+e,Cn*s+bn*l+n),i.lineTo(bn*a-Cn*h+e,Cn*a+bn*h+n),i.lineTo(bn*o+Cn*r+e,bn*r-Cn*o+n),i.lineTo(bn*s+Cn*l+e,bn*l-Cn*s+n),i.lineTo(bn*a+Cn*h+e,bn*h-Cn*a+n),i.closePath(),!1}class h2 extends Ie{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 nC(t,e/2,n,o)}drawOffset(t,e,n,o,r){return nC(t,e/2+r,n,o)}}const d2=new h2;function oC(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 u2 extends Ie{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 oC(t,e/2,n,o,0)}drawOffset(t,e,n,o,r){return oC(t,e/2,n,o,r)}}const c2=new u2;function rC(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 g2 extends Ie{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 rC(t,e/2,n,o)}drawOffset(t,e,n,o,r){return rC(t,e/2,n,o,r)}}const f2=new g2;function sC(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 p2 extends Ie{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 sC(t,e/2,n,o)}drawOffset(t,e,n,o,r){return sC(t,e/2,n,o,r)}}const m2=new p2,bf=Ln(3);function lC(i,t,e,n){const o=t*bf;return i.moveTo(e,n+-o/3*2),i.lineTo(t+e,n+o),i.lineTo(e-t,n+o),i.closePath(),!0}class v2 extends Ie{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,n,o){return lC(t,e/2/bf,n,o)}drawOffset(t,e,n,o,r){return lC(t,e/2/bf+r,n,o)}}const b2=new v2;function aC(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 C2 extends Ie{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 aC(t,e/4,n,o)}drawOffset(t,e,n,o,r){return aC(t,e/4+r,n,o)}}const y2=new C2;function hC(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 _2 extends Ie{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 hC(t,e/4,n,o)}drawOffset(t,e,n,o,r){return hC(t,e/4+r,n,o)}}const w2=new _2;function dC(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 S2 extends Ie{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 dC(t,e/4,n,o)}drawOffset(t,e,n,o,r){return dC(t,e/4+r,n,o)}}const x2=new S2;function uC(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 R2 extends Ie{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 uC(t,e/4,n,o)}drawOffset(t,e,n,o,r){return uC(t,e/4+r,n,o)}}const A2=new R2;function cC(i,t,e,n,o){return i.moveTo(e,n-t),i.lineTo(e,n+t),!0}class T2 extends Ie{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,n,o,r){return cC(t,e/2,n,o)}drawOffset(t,e,n,o,r,s){return cC(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 B2=new T2;function gC(i,t,e,n,o){return i.moveTo(e-t,n),i.lineTo(e+t,n),!0}class M2 extends Ie{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,n,o,r){return gC(t,e/2,n,o)}drawOffset(t,e,n,o,r,s){return gC(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 P2=new M2;function fC(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 H2 extends Ie{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 fC(t,e/2,n,o)}drawOffset(t,e,n,o,r,s){return fC(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 E2=new H2;function pC(i,t,e,n){return i.rect(e-t[0]/2,n-t[1]/2,t[0],t[1]),!1}function mC(i,t,e,n){const o=t,r=t/2;return i.rect(e-o/2,n-r/2,o,r),!1}class L2 extends Ie{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 et(e)?mC(t,e,n,o):pC(t,e,n,o)}drawOffset(t,e,n,o,r){return et(e)?mC(t,e+2*r,n,o):pC(t,[e[0]+2*r,e[1]+2*r],n,o)}}const k2=new L2,Pl=new xe;class vC{constructor(t,e,n=!1){this.pathStr="",this.type=t,Z(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(),Vo(a.path.commandList,t,n,o,e,e),l&&l(a.path,a.attribute)}),!1):(Vo(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})=>{Pl.x1=n.bounds.x1*t,Pl.y1=n.bounds.y1*t,Pl.x2=n.bounds.x2*t,Pl.y2=n.bounds.y2*t,e.union(Pl)})):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 F2=[WP,GP,$P,YP,b2,ZP,e2,o2,s2,a2,d2,c2,f2,XP,m2,y2,w2,x2,A2,k2,B2,P2,E2],bC={};F2.forEach(i=>{bC[i.type]=i});const I2={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"},z2=(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;bh(e,l+(o+a)/2,!0,r)}return e},qh=new xe,CC=["symbolType","size",...mn];let Cf=class ol extends Fi{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=xh}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return Z(t)?t.length===2&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const t=this.getGraphicTheme();let{symbolType:e=t.symbolType}=this.attribute,n=bC[e];if(n)return this._parsedPath=n,n;if(n=ol.userSymbolMap[e],n)return this._parsedPath=n,n;if(e=I2[e]||e,jB(e)===!0){const a=new vh,{svg:h}=a.parse(e);if(!h)return null;const d=Z(h.path)?h.path:[h.path];qh.clear();const u=[];d.forEach(p=>{const m=new ni().fromString(p.d),v={};qB.forEach(b=>{p[b]&&(v[hb[b]]=p[b])}),u.push({path:m,attribute:v}),qh.union(m.bounds)});const c=qh.width(),g=qh.height(),f=1/No(c,g);return u.forEach(p=>p.path.transform(0,0,f,f)),this._parsedPath=new vC(e,u,!0),ol.userSymbolMap[e]=this._parsedPath,this._parsedPath}const o=new ni().fromString(e),r=o.bounds.width(),s=o.bounds.height(),l=1/No(r,s);return o.transform(0,0,l,l),this._parsedPath=new vC(e,o),ol.userSymbolMap[e]=this._parsedPath,this._parsedPath}getGraphicTheme(){return zt(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}=X.graphicService.updateTempAABBBounds(n);z2(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:l=e.lineJoin}=t;return X.graphicService.transformAABBBounds(t,n,e,l==="miter",this),n}updateSymbolAABBBoundsImprecise(t,e,n){const{size:o=e.size}=t;if(Z(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,CC)}needUpdateTag(t){return super.needUpdateTag(t,CC)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=Z(e)?e:[e,e];return t.path?new ni().fromCustomPath2D(t.path,0,0,n[0],n[1]):new ni().fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new ol(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ol.NOWORK_ANIMATE_ATTR}};Cf.userSymbolMap={},Cf.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},kn);function Hl(i){return new Cf(i)}const yC=["segments","points","curveType","curveTension",...mn];let yf=class Sm extends Fi{constructor(t={}){super(t),this.type="line",this.numberType=yl}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=$v(n,o,e))}getGraphicTheme(){return zt(this).line}updateAABBBounds(t,e,n){this.updatePathProxyAABBBounds(n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,n):this.updateLineAABBBoundsByPoints(t,e,n)),X.graphicService.updateTempAABBBounds(n);const{lineJoin:o=e.lineJoin}=t;return X.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,yC)}needUpdateTag(t){return super.needUpdateTag(t,yC)}toCustomPath(){const t=this.attribute,e=new ni,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 Sm(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Sm.NOWORK_ANIMATE_ATTR}};yf.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},kn);function tn(i){return new yf(i)}const _C=["width","x1","y1","height","cornerRadius",...mn];let Zh=class xm extends Fi{constructor(t){super(t),this.type="rect",this.numberType=Wg}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return zt(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}=X.graphicService.updateTempAABBBounds(n);return Ml(t,e,o),n.union(o),o.setValue(r.x1,r.y1,r.x2,r.y2),X.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,_C)}needUpdateTag(t){return super.needUpdateTag(t,_C)}toCustomPath(){const t=this.attribute,{x:e,y:n,width:o,height:r}=BB(t),s=new ni;return s.moveTo(e,n),s.rect(e,n,o,r),s}clone(){return new xm(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return xm.NOWORK_ANIMATE_ATTR}};Zh.NOWORK_ANIMATE_ATTR=kn;function Re(i){return new Zh(i)}class O2{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=Rg[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 El{constructor(t,e,n){this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic";const o=bo(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}=ss(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}=ss(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=Ag(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}=ss(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&&(dB(t,this.character),t.strokeText(s,l,e)),hB(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=Ag(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,o),e+=this.ellipsisStr;const{width:r}=ss(this.text.slice(o),this.character);return n+this.ellipsisWidth-r}return n}}function D2(i,t){const e=i.text.slice(0,t),n=i.text.slice(t);return[new El(e,i.newLine,i.character),new El(n,!0,i.character)]}const wC=["width","height","image",...mn];let wo=class Rm extends Fi{constructor(t){super(t),this.type="image",this.numberType=_h,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 zt(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}=X.graphicService.updateTempAABBBounds(n);return Ml(t,e,o),n.union(o),o.setValue(r.x1,r.y1,r.x2,r.y2),X.graphicService.transformAABBBounds(t,n,e,!1,this),n}getDefaultAttribute(t){return ul[t]}needUpdateTags(t){return super.needUpdateTags(t,wC)}needUpdateTag(t){return super.needUpdateTag(t,wC)}clone(){return new Rm(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Rm.NOWORK_ANIMATE_ATTR}};wo.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},kn);function Jh(i){return new wo(i)}class So 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=vl(t.margin);this._marginArray=typeof e=="number"?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(e,n,o)=>{if(Z(o)&&o.indexOf("margin")!==-1||o==="margin")if(n.margin){const r=vl(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=ul.width,height:e=ul.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 W2{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 So?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=l,this.directionKey=Rg[this.direction],this.actualWidth=0;let h=0;this.paragraphs.forEach((d,u)=>{if(u===0&&d instanceof El){const c=aB.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 So?(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 So)break;if(this.direction==="vertical"&&u.direction!=="vertical"){u.verticalEllipsis=!0;break}const c=r===!0?"...":r||"";u.ellipsisStr=c;const{width:g}=ss(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 So)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 So)break;const{width:s}=ss(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 So?o.width:o.getWidthWithEllips(this.direction)}),n}}class N2{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=Rg[this.direction]}store(t){if(t instanceof So){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 W2(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 So?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=Ag(t.text,n,t.character,o,this.frame.wordBreak==="break-word");if(r!==0){const[s,l]=D2(t,r);this.store(s),e?this.send():this.deal(l)}else this.lineBuffer.length!==0&&(this.send(),this.deal(t))}}const SC=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize",...mn];class Dn extends Fi{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Ng,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:fo.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:fo.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:fo.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:fo.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:fo.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:fo.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:fo.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:fo.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return zt(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),X.graphicService.updateTempAABBBounds(n),t.forceBoundsHeight==null&&t.forceBoundsWidth==null||X.graphicService.updateHTMLTextAABBBounds(t,e,n),X.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,SC)}needUpdateTag(t){return super.needUpdateTag(t,SC)}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 R=0;R<v.length;R++)if("image"in v[R]){const x=this.combinedStyleToCharacter(v[R]);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 B=new So(x);B.successCallback=()=>{var M;this.addUpdateBoundTag(),(M=this.stage)===null||M===void 0||M.renderNextFrame()},B.richtextId=x.id,m.push(B)}}else{const x=this.combinedStyleToCharacter(v[R]);if(et(x.text)&&(x.text=`${x.text}`),x.text&&x.text.includes(`
|
|
@@ -361,11 +361,11 @@
|
|
|
361
361
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TN(i,t){if(i){if(typeof i=="string")return Zx(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Zx(i,t)}}function Zx(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=i[e];return n}function BN(i,t){var e=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(e!=null){var n=[],o=!0,r=!1,s,l;try{for(e=e.call(i);!(o=(s=e.next()).done)&&(n.push(s.value),!(t&&n.length===t));o=!0);}catch(a){r=!0,l=a}finally{try{!o&&e.return!=null&&e.return()}finally{if(r)throw l}}return n}}function MN(i){if(Array.isArray(i))return i}function Jx(i){var t=Xx(i),e=RN(t,2),n=e[0],o=e[1];return j0.setTwoToneColors({primaryColor:n,secondaryColor:o})}function PN(){var i=j0.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var HN=["class","icon","spin","rotate","tabindex","twoToneColor","onClick"];function EN(i,t){return IN(i)||FN(i,t)||kN(i,t)||LN()}function LN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
362
362
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kN(i,t){if(i){if(typeof i=="string")return Qx(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Qx(i,t)}}function Qx(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=i[e];return n}function FN(i,t){var e=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(e!=null){var n=[],o=!0,r=!1,s,l;try{for(e=e.call(i);!(o=(s=e.next()).done)&&(n.push(s.value),!(t&&n.length===t));o=!0);}catch(a){r=!0,l=a}finally{try{!o&&e.return!=null&&e.return()}finally{if(r)throw l}}return n}}function IN(i){if(Array.isArray(i))return i}function tR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){G0(i,o,e[o])})}return i}function G0(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function zN(i,t){if(i==null)return{};var e=ON(i,t),n,o;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);for(o=0;o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(e[n]=i[n])}return e}function ON(i,t){if(i==null)return{};var e={},n=Object.keys(i),o,r;for(r=0;r<n.length;r++)o=n[r],!(t.indexOf(o)>=0)&&(e[o]=i[o]);return e}Jx("#1890ff");var qs=function(t,e){var n,o=tR({},t,e.attrs),r=o.class,s=o.icon,l=o.spin,a=o.rotate,h=o.tabindex,d=o.twoToneColor,u=o.onClick,c=zN(o,HN),g=(n={anticon:!0},G0(n,"anticon-".concat(s.name),!!s.name),G0(n,r,r),n),f=l===""||l||s.name==="loading"?"anticon-spin":"",p=h;p===void 0&&u&&(p=-1,c.tabindex=p);var m=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,v=Xx(d),b=EN(v,2),w=b[0],y=b[1];return S.createVNode("span",tR({role:"img","aria-label":s.name},c,{onClick:u,class:g}),[S.createVNode(j0,{class:f,icon:s,primaryColor:w,secondaryColor:y,style:m},null)])};qs.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:String},qs.displayName="AntdIcon",qs.inheritAttrs=!1,qs.getTwoToneColor=PN,qs.setTwoToneColor=Jx;const hn=qs;var DN={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"};const WN=DN;function eR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){NN(i,o,e[o])})}return i}function NN(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var U0=function(t,e){var n=eR({},t,e.attrs);return S.createVNode(hn,eR({},n,{icon:WN}),null)};U0.displayName="CaretDownOutlined",U0.inheritAttrs=!1;const VN=U0;var jN={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};const GN=jN;function iR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){UN(i,o,e[o])})}return i}function UN(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var $0=function(t,e){var n=iR({},t,e.attrs);return S.createVNode(hn,iR({},n,{icon:GN}),null)};$0.displayName="CaretRightOutlined",$0.inheritAttrs=!1;const $N=$0;var KN={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};const YN=KN;function nR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){XN(i,o,e[o])})}return i}function XN(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var K0=function(t,e){var n=nR({},t,e.attrs);return S.createVNode(hn,nR({},n,{icon:YN}),null)};K0.displayName="DeleteOutlined",K0.inheritAttrs=!1;const qN=K0;var ZN={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"};const JN=ZN;function oR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){QN(i,o,e[o])})}return i}function QN(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Y0=function(t,e){var n=oR({},t,e.attrs);return S.createVNode(hn,oR({},n,{icon:JN}),null)};Y0.displayName="FilterOutlined",Y0.inheritAttrs=!1;const t8=Y0;var e8={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 512h-56c-4.4 0-8 3.6-8 8v320H184V184h320c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V520c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M355.9 534.9L354 653.8c-.1 8.9 7.1 16.2 16 16.2h.4l118-2.9c2-.1 4-.9 5.4-2.3l415.9-415c3.1-3.1 3.1-8.2 0-11.3L785.4 114.3c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-415.8 415a8.3 8.3 0 00-2.3 5.6zm63.5 23.6L779.7 199l45.2 45.1-360.5 359.7-45.7 1.1.7-46.4z"}}]},name:"form",theme:"outlined"};const i8=e8;function rR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){n8(i,o,e[o])})}return i}function n8(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var X0=function(t,e){var n=rR({},t,e.attrs);return S.createVNode(hn,rR({},n,{icon:i8}),null)};X0.displayName="FormOutlined",X0.inheritAttrs=!1;const sR=X0;var o8={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M878.7 336H145.3c-18.4 0-33.3 14.3-33.3 32v464c0 17.7 14.9 32 33.3 32h733.3c18.4 0 33.3-14.3 33.3-32V368c.1-17.7-14.8-32-33.2-32zM360 792H184V632h176v160zm0-224H184V408h176v160zm240 224H424V632h176v160zm0-224H424V408h176v160zm240 224H664V632h176v160zm0-224H664V408h176v160zm64-408H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8z"}}]},name:"insert-row-above",theme:"outlined"};const r8=o8;function lR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){s8(i,o,e[o])})}return i}function s8(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var q0=function(t,e){var n=lR({},t,e.attrs);return S.createVNode(hn,lR({},n,{icon:r8}),null)};q0.displayName="InsertRowAboveOutlined",q0.inheritAttrs=!1;const l8=q0;var a8={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M248 112h-80c-4.4 0-8 3.6-8 8v784c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8V120c0-4.4-3.6-8-8-8zm584 0H368c-17.7 0-32 14.9-32 33.3v733.3c0 18.4 14.3 33.3 32 33.3h464c17.7 0 32-14.9 32-33.3V145.3c0-18.4-14.3-33.3-32-33.3zM568 840H408V664h160v176zm0-240H408V424h160v176zm0-240H408V184h160v176zm224 480H632V664h160v176zm0-240H632V424h160v176zm0-240H632V184h160v176z"}}]},name:"insert-row-left",theme:"outlined"};const h8=a8;function aR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){d8(i,o,e[o])})}return i}function d8(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Z0=function(t,e){var n=aR({},t,e.attrs);return S.createVNode(hn,aR({},n,{icon:h8}),null)};Z0.displayName="InsertRowLeftOutlined",Z0.inheritAttrs=!1;const u8=Z0;var c8={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const g8=c8;function hR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){f8(i,o,e[o])})}return i}function f8(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var J0=function(t,e){var n=hR({},t,e.attrs);return S.createVNode(hn,hR({},n,{icon:g8}),null)};J0.displayName="LoadingOutlined",J0.inheritAttrs=!1;const p8=J0;var m8={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"};const v8=m8;function dR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){b8(i,o,e[o])})}return i}function b8(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Q0=function(t,e){var n=dR({},t,e.attrs);return S.createVNode(hn,dR({},n,{icon:v8}),null)};Q0.displayName="MinusCircleOutlined",Q0.inheritAttrs=!1;const uR=Q0;var C8={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const y8=C8;function cR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){_8(i,o,e[o])})}return i}function _8(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var tm=function(t,e){var n=cR({},t,e.attrs);return S.createVNode(hn,cR({},n,{icon:y8}),null)};tm.displayName="MinusSquareOutlined",tm.inheritAttrs=!1;const w8=tm;var S8={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"};const x8=S8;function gR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){R8(i,o,e[o])})}return i}function R8(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var em=function(t,e){var n=gR({},t,e.attrs);return S.createVNode(hn,gR({},n,{icon:x8}),null)};em.displayName="PlusCircleOutlined",em.inheritAttrs=!1;const fR=em;var A8={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"};const T8=A8;function pR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){B8(i,o,e[o])})}return i}function B8(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var im=function(t,e){var n=pR({},t,e.attrs);return S.createVNode(hn,pR({},n,{icon:T8}),null)};im.displayName="SettingOutlined",im.inheritAttrs=!1;const M8=im;var P8={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M320 224h-66v-56c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v56h-66c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8h66v56c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-56h66c4.4 0 8-3.6 8-8V232c0-4.4-3.6-8-8-8zm-60 508h-80V292h80v440zm644-436h-66v-96c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v96h-66c-4.4 0-8 3.6-8 8v416c0 4.4 3.6 8 8 8h66v96c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-96h66c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8zm-60 364h-80V364h80v296zM612 404h-66V232c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v172h-66c-4.4 0-8 3.6-8 8v200c0 4.4 3.6 8 8 8h66v172c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V620h66c4.4 0 8-3.6 8-8V412c0-4.4-3.6-8-8-8zm-60 145a3 3 0 01-3 3h-74a3 3 0 01-3-3v-74a3 3 0 013-3h74a3 3 0 013 3v74z"}}]},name:"sliders",theme:"outlined"};const H8=P8;function mR(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){E8(i,o,e[o])})}return i}function E8(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var nm=function(t,e){var n=mR({},t,e.attrs);return S.createVNode(hn,mR({},n,{icon:H8}),null)};nm.displayName="SlidersOutlined",nm.inheritAttrs=!1;const L8=nm,sj="",k8=S.defineComponent({name:"ConditionalItemConfig",components:{PlusCircleOutlined:fR,FormOutlined:sR,MinusCircleOutlined:uR},props:{config:{type:Array,default(){return[]}},theme:{type:String,default:"light"}},setup(i,{emit:t}){const e=S.ref("add"),n=S.ref(!1),o=S.ref(-1);S.watch(o,()=>{t("change",S.unref(o))});const r=S.ref("");function s(){e.value="add",r.value="",n.value=!0}function l(){if(S.unref(o)===-1){Kn.message.info("请选择要修改的条件项");return}e.value="edit",r.value=i.config[S.unref(o)].name,n.value=!0}function a(){if(S.unref(o)===-1){Kn.message.info("请选择要删除的条件项");return}i.config.splice(S.unref(o),1),o.value=-1}function h(){S.unref(e)==="add"?i.config.push({name:S.unref(r),conditions:[]}):i.config[S.unref(o)].name=S.unref(r),n.value=!1}const d=S.computed(()=>i.theme==="darkBlue"?"#b2c3dd":"");return{modalType:e,visible:n,selectedIndex:o,addItem:s,name:r,handleOk:h,editItem:l,deleteItem:a,fontColor:d}}}),F8={class:"content"},I8={style:{display:"flex","align-items":"center"}},z8={class:"list"},O8=["onClick"];function D8(i,t,e,n,o,r){const s=S.resolveComponent("plus-circle-outlined"),l=S.resolveComponent("a-button"),a=S.resolveComponent("form-outlined"),h=S.resolveComponent("minus-circle-outlined"),d=S.resolveComponent("a-input"),u=S.resolveComponent("a-form-item"),c=S.resolveComponent("a-form"),g=S.resolveComponent("a-modal");return S.openBlock(),S.createElementBlock(S.Fragment,null,[S.createElementVNode("div",F8,[S.createElementVNode("div",I8,[S.createElementVNode("div",{style:S.normalizeStyle({color:i.fontColor})},"条件项配置",4),S.createElementVNode("div",null,[S.createVNode(l,{class:"condition-button",onClick:i.addItem},{default:S.withCtx(()=>[S.createVNode(s,{class:"add-icon"})]),_:1},8,["onClick"]),S.createVNode(l,{class:"condition-button",onClick:i.editItem},{default:S.withCtx(()=>[S.createVNode(a,{class:"edit-icon"})]),_:1},8,["onClick"]),S.createVNode(l,{class:"condition-button",onClick:i.deleteItem},{default:S.withCtx(()=>[S.createVNode(h,{class:"delete-icon"})]),_:1},8,["onClick"])])]),S.createElementVNode("div",z8,[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.config,(f,p)=>(S.openBlock(),S.createElementBlock("div",{class:S.normalizeClass(["list-item",i.selectedIndex===p?"active":""]),key:p,onClick:m=>i.selectedIndex=p,style:S.normalizeStyle({color:i.fontColor})},S.toDisplayString(f.name),15,O8))),128))])]),S.createVNode(g,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=f=>i.visible=f),title:i.modalType==="add"?"添加条件项":"修改条件项","ok-text":"确认","cancel-text":"取消",destroyOnClose:!0,onOk:i.handleOk},{default:S.withCtx(()=>[S.createVNode(c,{name:"conditionItem"},{default:S.withCtx(()=>[S.createVNode(u,{label:"条件项名称"},{default:S.withCtx(()=>[S.createVNode(d,{value:i.name,"onUpdate:value":t[0]||(t[0]=f=>i.name=f)},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","title","onOk"])],64)}const W8=Mi(k8,[["render",D8],["__scopeId","data-v-ac94407c"]]),lj="",N8=S.defineComponent({name:"ConditionalConfig",components:{PlusCircleOutlined:fR,FormOutlined:sR,MinusCircleOutlined:uR},props:{config:{type:Array,default(){return[]}},isSelected:{type:Boolean},theme:{type:String,default:"light"}},setup(i){const t=S.ref("add"),e=S.ref(!1),n=S.ref(-1),o=S.ref({}),r=S.ref(!1),s=S.ref(),l=S.computed(()=>v=>{const b=`当前值 ${v.operation} ${v.value}`;return v.join?`${v.join} ${b}`:b});S.watch(()=>i.config,()=>{n.value=-1});const a=[{label:"与",value:"and"},{label:"或",value:"or"}],h=[{label:"大于",value:">"},{label:"大于等于",value:">="},{label:"小于",value:"<"},{label:"小于等于",value:"<="},{label:"等于",value:"=="},{label:"不等于",value:"!="}],d={operation:[{required:!0,message:"操作符不能为空"}],value:[{required:!0,message:"值不能为空"}]};function u(){t.value="add",r.value=i.config.length>0,S.unref(r)?o.value={join:"and",operation:"",value:""}:o.value={operation:"",value:""},e.value=!0}function c(){if(S.unref(n)===-1){Kn.message.info("请选择要修改的条件配置");return}t.value="edit",r.value=S.unref(n)!==0,o.value=i.config[S.unref(n)],e.value=!0}function g(){if(S.unref(n)===-1){Kn.message.info("请选择要删除的条件配置");return}i.config.splice(S.unref(n),1),n.value=-1}function f(){S.unref(s).validateFields().then(()=>{S.unref(t)==="add"?i.config.push(S.unref(o)):i.config[S.unref(n)]=S.unref(o),e.value=!1}).catch(()=>{})}const p=S.computed(()=>i.theme==="darkBlue"?"#b2c3dd":"");return{modalType:t,visible:e,selectedIndex:n,addItem:u,handleOk:f,editItem:c,deleteItem:g,operateOptions:h,formData:o,joinOptions:a,isShowJoin:r,formRules:d,formRef:s,conditionTitle:l,fontColor:p,getPopupContainer:()=>document.getElementsByClassName("update-config-modal")[0]||document.body}}}),V8={class:"content"},j8={style:{display:"flex","align-items":"center"}},G8={class:"list"},U8=["onClick"];function $8(i,t,e,n,o,r){const s=S.resolveComponent("plus-circle-outlined"),l=S.resolveComponent("a-button"),a=S.resolveComponent("form-outlined"),h=S.resolveComponent("minus-circle-outlined"),d=S.resolveComponent("a-select"),u=S.resolveComponent("a-form-item"),c=S.resolveComponent("a-input"),g=S.resolveComponent("a-form"),f=S.resolveComponent("a-modal");return S.openBlock(),S.createElementBlock(S.Fragment,null,[S.createElementVNode("div",V8,[S.createElementVNode("div",j8,[S.createElementVNode("div",{style:S.normalizeStyle({color:i.fontColor})},"条件配置",4),S.createElementVNode("div",null,[S.createVNode(l,{class:"condition-button",onClick:i.addItem,disabled:!i.isSelected},{default:S.withCtx(()=>[S.createVNode(s,{class:"add-icon"})]),_:1},8,["onClick","disabled"]),S.createVNode(l,{class:"condition-button",onClick:i.editItem,disabled:!i.isSelected},{default:S.withCtx(()=>[S.createVNode(a,{class:"edit-icon"})]),_:1},8,["onClick","disabled"]),S.createVNode(l,{class:"condition-button",onClick:i.deleteItem,disabled:!i.isSelected},{default:S.withCtx(()=>[S.createVNode(h,{class:"delete-icon"})]),_:1},8,["onClick","disabled"])])]),S.createElementVNode("div",G8,[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.config,(p,m)=>(S.openBlock(),S.createElementBlock("div",{class:S.normalizeClass(["list-item",i.selectedIndex===m?"active":""]),key:m,onClick:v=>i.selectedIndex=m,style:S.normalizeStyle({color:i.fontColor})},S.toDisplayString(i.conditionTitle(p)),15,U8))),128))])]),S.createVNode(f,{wrapClassName:i.theme+" update-config-modal",visible:i.visible,"onUpdate:visible":t[3]||(t[3]=p=>i.visible=p),title:i.modalType==="add"?"添加条件配置":"修改条件配置","ok-text":"确认","cancel-text":"取消",destroyOnClose:!0,onOk:i.handleOk},{default:S.withCtx(()=>[S.createVNode(g,{model:i.formData,rules:i.formRules,ref:"formRef"},{default:S.withCtx(()=>[i.isShowJoin?(S.openBlock(),S.createBlock(u,{key:0,label:"与上一条件关系",name:"join",required:!0},{default:S.withCtx(()=>[S.createVNode(d,{options:i.joinOptions,value:i.formData.join,"onUpdate:value":t[0]||(t[0]=p=>i.formData.join=p),getPopupContainer:i.getPopupContainer},null,8,["options","value","getPopupContainer"])]),_:1})):S.createCommentVNode("",!0),S.createVNode(u,{label:"操作符",name:"operation",required:!0},{default:S.withCtx(()=>[S.createVNode(d,{options:i.operateOptions,value:i.formData.operation,"onUpdate:value":t[1]||(t[1]=p=>i.formData.operation=p),getPopupContainer:i.getPopupContainer},null,8,["options","value","getPopupContainer"])]),_:1}),S.createVNode(u,{label:"值",name:"value",required:!0},{default:S.withCtx(()=>[S.createVNode(c,{type:"number",value:i.formData.value,"onUpdate:value":t[2]||(t[2]=p=>i.formData.value=p),style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["wrapClassName","visible","title","onOk"])],64)}const K8=Mi(N8,[["render",$8],["__scopeId","data-v-dbd50fb6"]]);var Ni="top",Tn="bottom",Bn="right",Vi="left",om="auto",Da=[Ni,Tn,Bn,Vi],Zs="start",Wa="end",Y8="clippingParents",vR="viewport",Na="popper",X8="reference",bR=Da.reduce(function(i,t){return i.concat([t+"-"+Zs,t+"-"+Wa])},[]),CR=[].concat(Da,[om]).reduce(function(i,t){return i.concat([t,t+"-"+Zs,t+"-"+Wa])},[]),q8="beforeRead",Z8="read",J8="afterRead",Q8="beforeMain",tV="main",eV="afterMain",iV="beforeWrite",nV="write",oV="afterWrite",rV=[q8,Z8,J8,Q8,tV,eV,iV,nV,oV];function so(i){return i?(i.nodeName||"").toLowerCase():null}function dn(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var t=i.ownerDocument;return t&&t.defaultView||window}return i}function Kr(i){var t=dn(i).Element;return i instanceof t||i instanceof Element}function Mn(i){var t=dn(i).HTMLElement;return i instanceof t||i instanceof HTMLElement}function rm(i){if(typeof ShadowRoot>"u")return!1;var t=dn(i).ShadowRoot;return i instanceof t||i instanceof ShadowRoot}function sV(i){var t=i.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];!Mn(r)||!so(r)||(Object.assign(r.style,n),Object.keys(o).forEach(function(s){var l=o[s];l===!1?r.removeAttribute(s):r.setAttribute(s,l===!0?"":l)}))})}function lV(i){var t=i.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],r=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:e[n]),l=s.reduce(function(a,h){return a[h]="",a},{});!Mn(o)||!so(o)||(Object.assign(o.style,l),Object.keys(r).forEach(function(a){o.removeAttribute(a)}))})}}const aV={name:"applyStyles",enabled:!0,phase:"write",fn:sV,effect:lV,requires:["computeStyles"]};function lo(i){return i.split("-")[0]}var Yr=Math.max,Pc=Math.min,Js=Math.round;function sm(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function yR(){return!/^((?!chrome|android).)*safari/i.test(sm())}function Qs(i,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var n=i.getBoundingClientRect(),o=1,r=1;t&&Mn(i)&&(o=i.offsetWidth>0&&Js(n.width)/i.offsetWidth||1,r=i.offsetHeight>0&&Js(n.height)/i.offsetHeight||1);var s=Kr(i)?dn(i):window,l=s.visualViewport,a=!yR()&&e,h=(n.left+(a&&l?l.offsetLeft:0))/o,d=(n.top+(a&&l?l.offsetTop:0))/r,u=n.width/o,c=n.height/r;return{width:u,height:c,top:d,right:h+u,bottom:d+c,left:h,x:h,y:d}}function lm(i){var t=Qs(i),e=i.offsetWidth,n=i.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:i.offsetLeft,y:i.offsetTop,width:e,height:n}}function _R(i,t){var e=t.getRootNode&&t.getRootNode();if(i.contains(t))return!0;if(e&&rm(e)){var n=t;do{if(n&&i.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Do(i){return dn(i).getComputedStyle(i)}function hV(i){return["table","td","th"].indexOf(so(i))>=0}function cr(i){return((Kr(i)?i.ownerDocument:i.document)||window.document).documentElement}function Hc(i){return so(i)==="html"?i:i.assignedSlot||i.parentNode||(rm(i)?i.host:null)||cr(i)}function wR(i){return!Mn(i)||Do(i).position==="fixed"?null:i.offsetParent}function dV(i){var t=/firefox/i.test(sm()),e=/Trident/i.test(sm());if(e&&Mn(i)){var n=Do(i);if(n.position==="fixed")return null}var o=Hc(i);for(rm(o)&&(o=o.host);Mn(o)&&["html","body"].indexOf(so(o))<0;){var r=Do(o);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return o;o=o.parentNode}return null}function Va(i){for(var t=dn(i),e=wR(i);e&&hV(e)&&Do(e).position==="static";)e=wR(e);return e&&(so(e)==="html"||so(e)==="body"&&Do(e).position==="static")?t:e||dV(i)||t}function am(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function ja(i,t,e){return Yr(i,Pc(t,e))}function uV(i,t,e){var n=ja(i,t,e);return n>e?e:n}function SR(){return{top:0,right:0,bottom:0,left:0}}function xR(i){return Object.assign({},SR(),i)}function RR(i,t){return t.reduce(function(e,n){return e[n]=i,e},{})}var cV=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,xR(typeof t!="number"?t:RR(t,Da))};function gV(i){var t,e=i.state,n=i.name,o=i.options,r=e.elements.arrow,s=e.modifiersData.popperOffsets,l=lo(e.placement),a=am(l),h=[Vi,Bn].indexOf(l)>=0,d=h?"height":"width";if(!(!r||!s)){var u=cV(o.padding,e),c=lm(r),g=a==="y"?Ni:Vi,f=a==="y"?Tn:Bn,p=e.rects.reference[d]+e.rects.reference[a]-s[a]-e.rects.popper[d],m=s[a]-e.rects.reference[a],v=Va(r),b=v?a==="y"?v.clientHeight||0:v.clientWidth||0:0,w=p/2-m/2,y=u[g],C=b-c[d]-u[f],_=b/2-c[d]/2+w,A=ja(y,_,C),R=a;e.modifiersData[n]=(t={},t[R]=A,t.centerOffset=A-_,t)}}function fV(i){var t=i.state,e=i.options,n=e.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||_R(t.elements.popper,o)&&(t.elements.arrow=o))}const pV={name:"arrow",enabled:!0,phase:"main",fn:gV,effect:fV,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function tl(i){return i.split("-")[1]}var mV={top:"auto",right:"auto",bottom:"auto",left:"auto"};function vV(i,t){var e=i.x,n=i.y,o=t.devicePixelRatio||1;return{x:Js(e*o)/o||0,y:Js(n*o)/o||0}}function AR(i){var t,e=i.popper,n=i.popperRect,o=i.placement,r=i.variation,s=i.offsets,l=i.position,a=i.gpuAcceleration,h=i.adaptive,d=i.roundOffsets,u=i.isFixed,c=s.x,g=c===void 0?0:c,f=s.y,p=f===void 0?0:f,m=typeof d=="function"?d({x:g,y:p}):{x:g,y:p};g=m.x,p=m.y;var v=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),w=Vi,y=Ni,C=window;if(h){var _=Va(e),A="clientHeight",R="clientWidth";if(_===dn(e)&&(_=cr(e),Do(_).position!=="static"&&l==="absolute"&&(A="scrollHeight",R="scrollWidth")),_=_,o===Ni||(o===Vi||o===Bn)&&r===Wa){y=Tn;var x=u&&_===C&&C.visualViewport?C.visualViewport.height:_[A];p-=x-n.height,p*=a?1:-1}if(o===Vi||(o===Ni||o===Tn)&&r===Wa){w=Bn;var T=u&&_===C&&C.visualViewport?C.visualViewport.width:_[R];g-=T-n.width,g*=a?1:-1}}var B=Object.assign({position:l},h&&mV),M=d===!0?vV({x:g,y:p},dn(e)):{x:g,y:p};if(g=M.x,p=M.y,a){var H;return Object.assign({},B,(H={},H[y]=b?"0":"",H[w]=v?"0":"",H.transform=(C.devicePixelRatio||1)<=1?"translate("+g+"px, "+p+"px)":"translate3d("+g+"px, "+p+"px, 0)",H))}return Object.assign({},B,(t={},t[y]=b?p+"px":"",t[w]=v?g+"px":"",t.transform="",t))}function bV(i){var t=i.state,e=i.options,n=e.gpuAcceleration,o=n===void 0?!0:n,r=e.adaptive,s=r===void 0?!0:r,l=e.roundOffsets,a=l===void 0?!0:l,h={placement:lo(t.placement),variation:tl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,AR(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:a})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,AR(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const CV={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:bV,data:{}};var Ec={passive:!0};function yV(i){var t=i.state,e=i.instance,n=i.options,o=n.scroll,r=o===void 0?!0:o,s=n.resize,l=s===void 0?!0:s,a=dn(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&h.forEach(function(d){d.addEventListener("scroll",e.update,Ec)}),l&&a.addEventListener("resize",e.update,Ec),function(){r&&h.forEach(function(d){d.removeEventListener("scroll",e.update,Ec)}),l&&a.removeEventListener("resize",e.update,Ec)}}const _V={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:yV,data:{}};var wV={left:"right",right:"left",bottom:"top",top:"bottom"};function Lc(i){return i.replace(/left|right|bottom|top/g,function(t){return wV[t]})}var SV={start:"end",end:"start"};function TR(i){return i.replace(/start|end/g,function(t){return SV[t]})}function hm(i){var t=dn(i),e=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:e,scrollTop:n}}function dm(i){return Qs(cr(i)).left+hm(i).scrollLeft}function xV(i,t){var e=dn(i),n=cr(i),o=e.visualViewport,r=n.clientWidth,s=n.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;var h=yR();(h||!h&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l+dm(i),y:a}}function RV(i){var t,e=cr(i),n=hm(i),o=(t=i.ownerDocument)==null?void 0:t.body,r=Yr(e.scrollWidth,e.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Yr(e.scrollHeight,e.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-n.scrollLeft+dm(i),a=-n.scrollTop;return Do(o||e).direction==="rtl"&&(l+=Yr(e.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}function um(i){var t=Do(i),e=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+o+n)}function BR(i){return["html","body","#document"].indexOf(so(i))>=0?i.ownerDocument.body:Mn(i)&&um(i)?i:BR(Hc(i))}function Ga(i,t){var e;t===void 0&&(t=[]);var n=BR(i),o=n===((e=i.ownerDocument)==null?void 0:e.body),r=dn(n),s=o?[r].concat(r.visualViewport||[],um(n)?n:[]):n,l=t.concat(s);return o?l:l.concat(Ga(Hc(s)))}function cm(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function AV(i,t){var e=Qs(i,!1,t==="fixed");return e.top=e.top+i.clientTop,e.left=e.left+i.clientLeft,e.bottom=e.top+i.clientHeight,e.right=e.left+i.clientWidth,e.width=i.clientWidth,e.height=i.clientHeight,e.x=e.left,e.y=e.top,e}function MR(i,t,e){return t===vR?cm(xV(i,e)):Kr(t)?AV(t,e):cm(RV(cr(i)))}function TV(i){var t=Ga(Hc(i)),e=["absolute","fixed"].indexOf(Do(i).position)>=0,n=e&&Mn(i)?Va(i):i;return Kr(n)?t.filter(function(o){return Kr(o)&&_R(o,n)&&so(o)!=="body"}):[]}function BV(i,t,e,n){var o=t==="clippingParents"?TV(i):[].concat(t),r=[].concat(o,[e]),s=r[0],l=r.reduce(function(a,h){var d=MR(i,h,n);return a.top=Yr(d.top,a.top),a.right=Pc(d.right,a.right),a.bottom=Pc(d.bottom,a.bottom),a.left=Yr(d.left,a.left),a},MR(i,s,n));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function PR(i){var t=i.reference,e=i.element,n=i.placement,o=n?lo(n):null,r=n?tl(n):null,s=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,a;switch(o){case Ni:a={x:s,y:t.y-e.height};break;case Tn:a={x:s,y:t.y+t.height};break;case Bn:a={x:t.x+t.width,y:l};break;case Vi:a={x:t.x-e.width,y:l};break;default:a={x:t.x,y:t.y}}var h=o?am(o):null;if(h!=null){var d=h==="y"?"height":"width";switch(r){case Zs:a[h]=a[h]-(t[d]/2-e[d]/2);break;case Wa:a[h]=a[h]+(t[d]/2-e[d]/2);break}}return a}function Ua(i,t){t===void 0&&(t={});var e=t,n=e.placement,o=n===void 0?i.placement:n,r=e.strategy,s=r===void 0?i.strategy:r,l=e.boundary,a=l===void 0?Y8:l,h=e.rootBoundary,d=h===void 0?vR:h,u=e.elementContext,c=u===void 0?Na:u,g=e.altBoundary,f=g===void 0?!1:g,p=e.padding,m=p===void 0?0:p,v=xR(typeof m!="number"?m:RR(m,Da)),b=c===Na?X8:Na,w=i.rects.popper,y=i.elements[f?b:c],C=BV(Kr(y)?y:y.contextElement||cr(i.elements.popper),a,d,s),_=Qs(i.elements.reference),A=PR({reference:_,element:w,strategy:"absolute",placement:o}),R=cm(Object.assign({},w,A)),x=c===Na?R:_,T={top:C.top-x.top+v.top,bottom:x.bottom-C.bottom+v.bottom,left:C.left-x.left+v.left,right:x.right-C.right+v.right},B=i.modifiersData.offset;if(c===Na&&B){var M=B[o];Object.keys(T).forEach(function(H){var F=[Bn,Tn].indexOf(H)>=0?1:-1,P=[Ni,Tn].indexOf(H)>=0?"y":"x";T[H]+=M[P]*F})}return T}function MV(i,t){t===void 0&&(t={});var e=t,n=e.placement,o=e.boundary,r=e.rootBoundary,s=e.padding,l=e.flipVariations,a=e.allowedAutoPlacements,h=a===void 0?CR:a,d=tl(n),u=d?l?bR:bR.filter(function(f){return tl(f)===d}):Da,c=u.filter(function(f){return h.indexOf(f)>=0});c.length===0&&(c=u);var g=c.reduce(function(f,p){return f[p]=Ua(i,{placement:p,boundary:o,rootBoundary:r,padding:s})[lo(p)],f},{});return Object.keys(g).sort(function(f,p){return g[f]-g[p]})}function PV(i){if(lo(i)===om)return[];var t=Lc(i);return[TR(i),t,TR(t)]}function HV(i){var t=i.state,e=i.options,n=i.name;if(!t.modifiersData[n]._skip){for(var o=e.mainAxis,r=o===void 0?!0:o,s=e.altAxis,l=s===void 0?!0:s,a=e.fallbackPlacements,h=e.padding,d=e.boundary,u=e.rootBoundary,c=e.altBoundary,g=e.flipVariations,f=g===void 0?!0:g,p=e.allowedAutoPlacements,m=t.options.placement,v=lo(m),b=v===m,w=a||(b||!f?[Lc(m)]:PV(m)),y=[m].concat(w).reduce(function(j,G){return j.concat(lo(G)===om?MV(t,{placement:G,boundary:d,rootBoundary:u,padding:h,flipVariations:f,allowedAutoPlacements:p}):G)},[]),C=t.rects.reference,_=t.rects.popper,A=new Map,R=!0,x=y[0],T=0;T<y.length;T++){var B=y[T],M=lo(B),H=tl(B)===Zs,F=[Ni,Tn].indexOf(M)>=0,P=F?"width":"height",L=Ua(t,{placement:B,boundary:d,rootBoundary:u,altBoundary:c,padding:h}),k=F?H?Bn:Vi:H?Tn:Ni;C[P]>_[P]&&(k=Lc(k));var I=Lc(k),E=[];if(r&&E.push(L[M]<=0),l&&E.push(L[k]<=0,L[I]<=0),E.every(function(j){return j})){x=B,R=!1;break}A.set(B,E)}if(R)for(var z=f?3:1,O=function(G){var V=y.find(function($){var U=A.get($);if(U)return U.slice(0,G).every(function(tt){return tt})});if(V)return x=V,"break"},N=z;N>0;N--){var W=O(N);if(W==="break")break}t.placement!==x&&(t.modifiersData[n]._skip=!0,t.placement=x,t.reset=!0)}}const EV={name:"flip",enabled:!0,phase:"main",fn:HV,requiresIfExists:["offset"],data:{_skip:!1}};function HR(i,t,e){return e===void 0&&(e={x:0,y:0}),{top:i.top-t.height-e.y,right:i.right-t.width+e.x,bottom:i.bottom-t.height+e.y,left:i.left-t.width-e.x}}function ER(i){return[Ni,Bn,Tn,Vi].some(function(t){return i[t]>=0})}function LV(i){var t=i.state,e=i.name,n=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,s=Ua(t,{elementContext:"reference"}),l=Ua(t,{altBoundary:!0}),a=HR(s,n),h=HR(l,o,r),d=ER(a),u=ER(h);t.modifiersData[e]={referenceClippingOffsets:a,popperEscapeOffsets:h,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const kV={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:LV};function FV(i,t,e){var n=lo(i),o=[Vi,Ni].indexOf(n)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:i})):e,s=r[0],l=r[1];return s=s||0,l=(l||0)*o,[Vi,Bn].indexOf(n)>=0?{x:l,y:s}:{x:s,y:l}}function IV(i){var t=i.state,e=i.options,n=i.name,o=e.offset,r=o===void 0?[0,0]:o,s=CR.reduce(function(d,u){return d[u]=FV(u,t.rects,r),d},{}),l=s[t.placement],a=l.x,h=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=h),t.modifiersData[n]=s}const zV={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:IV};function OV(i){var t=i.state,e=i.name;t.modifiersData[e]=PR({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const DV={name:"popperOffsets",enabled:!0,phase:"read",fn:OV,data:{}};function WV(i){return i==="x"?"y":"x"}function NV(i){var t=i.state,e=i.options,n=i.name,o=e.mainAxis,r=o===void 0?!0:o,s=e.altAxis,l=s===void 0?!1:s,a=e.boundary,h=e.rootBoundary,d=e.altBoundary,u=e.padding,c=e.tether,g=c===void 0?!0:c,f=e.tetherOffset,p=f===void 0?0:f,m=Ua(t,{boundary:a,rootBoundary:h,padding:u,altBoundary:d}),v=lo(t.placement),b=tl(t.placement),w=!b,y=am(v),C=WV(y),_=t.modifiersData.popperOffsets,A=t.rects.reference,R=t.rects.popper,x=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,T=typeof x=="number"?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),B=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(_){if(r){var H,F=y==="y"?Ni:Vi,P=y==="y"?Tn:Bn,L=y==="y"?"height":"width",k=_[y],I=k+m[F],E=k-m[P],z=g?-R[L]/2:0,O=b===Zs?A[L]:R[L],N=b===Zs?-R[L]:-A[L],W=t.elements.arrow,j=g&&W?lm(W):{width:0,height:0},G=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:SR(),V=G[F],$=G[P],U=ja(0,A[L],j[L]),tt=w?A[L]/2-z-U-V-T.mainAxis:O-U-V-T.mainAxis,ot=w?-A[L]/2+z+U+$+T.mainAxis:N+U+$+T.mainAxis,ut=t.elements.arrow&&Va(t.elements.arrow),pt=ut?y==="y"?ut.clientTop||0:ut.clientLeft||0:0,Y=(H=B==null?void 0:B[y])!=null?H:0,q=k+tt-Y-pt,dt=k+ot-Y,ht=ja(g?Pc(I,q):I,k,g?Yr(E,dt):E);_[y]=ht,M[y]=ht-k}if(l){var _t,Ct=y==="x"?Ni:Vi,wt=y==="x"?Tn:Bn,it=_[C],At=C==="y"?"height":"width",nt=it+m[Ct],Ut=it-m[wt],qt=[Ni,Vi].indexOf(v)!==-1,St=(_t=B==null?void 0:B[C])!=null?_t:0,Wt=qt?nt:it-A[At]-R[At]-St+T.altAxis,gi=qt?it+A[At]+R[At]-St-T.altAxis:Ut,_i=g&&qt?uV(Wt,it,gi):ja(g?Wt:nt,it,g?gi:Ut);_[C]=_i,M[C]=_i-it}t.modifiersData[n]=M}}const VV={name:"preventOverflow",enabled:!0,phase:"main",fn:NV,requiresIfExists:["offset"]};function jV(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function GV(i){return i===dn(i)||!Mn(i)?hm(i):jV(i)}function UV(i){var t=i.getBoundingClientRect(),e=Js(t.width)/i.offsetWidth||1,n=Js(t.height)/i.offsetHeight||1;return e!==1||n!==1}function $V(i,t,e){e===void 0&&(e=!1);var n=Mn(t),o=Mn(t)&&UV(t),r=cr(t),s=Qs(i,o,e),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(n||!n&&!e)&&((so(t)!=="body"||um(r))&&(l=GV(t)),Mn(t)?(a=Qs(t,!0),a.x+=t.clientLeft,a.y+=t.clientTop):r&&(a.x=dm(r))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function KV(i){var t=new Map,e=new Set,n=[];i.forEach(function(r){t.set(r.name,r)});function o(r){e.add(r.name);var s=[].concat(r.requires||[],r.requiresIfExists||[]);s.forEach(function(l){if(!e.has(l)){var a=t.get(l);a&&o(a)}}),n.push(r)}return i.forEach(function(r){e.has(r.name)||o(r)}),n}function YV(i){var t=KV(i);return rV.reduce(function(e,n){return e.concat(t.filter(function(o){return o.phase===n}))},[])}function XV(i){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(i())})})),t}}function qV(i){var t=i.reduce(function(e,n){var o=e[n.name];return e[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,e},{});return Object.keys(t).map(function(e){return t[e]})}var LR={placement:"bottom",modifiers:[],strategy:"absolute"};function kR(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function ZV(i){i===void 0&&(i={});var t=i,e=t.defaultModifiers,n=e===void 0?[]:e,o=t.defaultOptions,r=o===void 0?LR:o;return function(l,a,h){h===void 0&&(h=r);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},LR,r),modifiersData:{},elements:{reference:l,popper:a},attributes:{},styles:{}},u=[],c=!1,g={state:d,setOptions:function(v){var b=typeof v=="function"?v(d.options):v;p(),d.options=Object.assign({},r,d.options,b),d.scrollParents={reference:Kr(l)?Ga(l):l.contextElement?Ga(l.contextElement):[],popper:Ga(a)};var w=YV(qV([].concat(n,d.options.modifiers)));return d.orderedModifiers=w.filter(function(y){return y.enabled}),f(),g.update()},forceUpdate:function(){if(!c){var v=d.elements,b=v.reference,w=v.popper;if(kR(b,w)){d.rects={reference:$V(b,Va(w),d.options.strategy==="fixed"),popper:lm(w)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(T){return d.modifiersData[T.name]=Object.assign({},T.data)});for(var y=0;y<d.orderedModifiers.length;y++){if(d.reset===!0){d.reset=!1,y=-1;continue}var C=d.orderedModifiers[y],_=C.fn,A=C.options,R=A===void 0?{}:A,x=C.name;typeof _=="function"&&(d=_({state:d,options:R,name:x,instance:g})||d)}}}},update:XV(function(){return new Promise(function(m){g.forceUpdate(),m(d)})}),destroy:function(){p(),c=!0}};if(!kR(l,a))return g;g.setOptions(h).then(function(m){!c&&h.onFirstUpdate&&h.onFirstUpdate(m)});function f(){d.orderedModifiers.forEach(function(m){var v=m.name,b=m.options,w=b===void 0?{}:b,y=m.effect;if(typeof y=="function"){var C=y({state:d,name:v,instance:g,options:w}),_=function(){};u.push(C||_)}})}function p(){u.forEach(function(m){return m()}),u=[]}return g}}var JV=[_V,DV,CV,aV,zV,EV,VV,pV,kV],QV=ZV({defaultModifiers:JV});function gm(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=Array(t);e<t;e++)n[e]=i[e];return n}function FR(i,t){if(i){if(typeof i=="string")return gm(i,t);var e={}.toString.call(i).slice(8,-1);return e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set"?Array.from(i):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?gm(i,t):void 0}}function t9(i){return function(t){if(Array.isArray(t))return gm(t)}(i)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(i)||FR(i)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
363
363
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function el(i){return el=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},el(i)}function IR(i,t,e,n,o,r,s){try{var l=i[r](s),a=l.value}catch(h){return void e(h)}l.done?t(a):Promise.resolve(a).then(n,o)}function zR(i){return function(){var t=this,e=arguments;return new Promise(function(n,o){var r=i.apply(t,e);function s(a){IR(r,n,o,s,l,"next",a)}function l(a){IR(r,n,o,s,l,"throw",a)}s(void 0)})}}var OR={exports:{}},DR={exports:{}};(function(i){function t(e){return i.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},i.exports.__esModule=!0,i.exports.default=i.exports,t(e)}i.exports=t,i.exports.__esModule=!0,i.exports.default=i.exports})(DR),function(i){var t=DR.exports.default;function e(){i.exports=e=function(){return o},i.exports.__esModule=!0,i.exports.default=i.exports;var n,o={},r=Object.prototype,s=r.hasOwnProperty,l=Object.defineProperty||function(E,z,O){E[z]=O.value},a=typeof Symbol=="function"?Symbol:{},h=a.iterator||"@@iterator",d=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(E,z,O){return Object.defineProperty(E,z,{value:O,enumerable:!0,configurable:!0,writable:!0}),E[z]}try{c({},"")}catch{c=function(z,O,N){return z[O]=N}}function g(E,z,O,N){var W=z&&z.prototype instanceof y?z:y,j=Object.create(W.prototype),G=new k(N||[]);return l(j,"_invoke",{value:H(E,O,G)}),j}function f(E,z,O){try{return{type:"normal",arg:E.call(z,O)}}catch(N){return{type:"throw",arg:N}}}o.wrap=g;var p="suspendedStart",m="suspendedYield",v="executing",b="completed",w={};function y(){}function C(){}function _(){}var A={};c(A,h,function(){return this});var R=Object.getPrototypeOf,x=R&&R(R(I([])));x&&x!==r&&s.call(x,h)&&(A=x);var T=_.prototype=y.prototype=Object.create(A);function B(E){["next","throw","return"].forEach(function(z){c(E,z,function(O){return this._invoke(z,O)})})}function M(E,z){function O(W,j,G,V){var $=f(E[W],E,j);if($.type!=="throw"){var U=$.arg,tt=U.value;return tt&&t(tt)=="object"&&s.call(tt,"__await")?z.resolve(tt.__await).then(function(ot){O("next",ot,G,V)},function(ot){O("throw",ot,G,V)}):z.resolve(tt).then(function(ot){U.value=ot,G(U)},function(ot){return O("throw",ot,G,V)})}V($.arg)}var N;l(this,"_invoke",{value:function(W,j){function G(){return new z(function(V,$){O(W,j,V,$)})}return N=N?N.then(G,G):G()}})}function H(E,z,O){var N=p;return function(W,j){if(N===v)throw Error("Generator is already running");if(N===b){if(W==="throw")throw j;return{value:n,done:!0}}for(O.method=W,O.arg=j;;){var G=O.delegate;if(G){var V=F(G,O);if(V){if(V===w)continue;return V}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(N===p)throw N=b,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);N=v;var $=f(E,z,O);if($.type==="normal"){if(N=O.done?b:m,$.arg===w)continue;return{value:$.arg,done:O.done}}$.type==="throw"&&(N=b,O.method="throw",O.arg=$.arg)}}}function F(E,z){var O=z.method,N=E.iterator[O];if(N===n)return z.delegate=null,O==="throw"&&E.iterator.return&&(z.method="return",z.arg=n,F(E,z),z.method==="throw")||O!=="return"&&(z.method="throw",z.arg=new TypeError("The iterator does not provide a '"+O+"' method")),w;var W=f(N,E.iterator,z.arg);if(W.type==="throw")return z.method="throw",z.arg=W.arg,z.delegate=null,w;var j=W.arg;return j?j.done?(z[E.resultName]=j.value,z.next=E.nextLoc,z.method!=="return"&&(z.method="next",z.arg=n),z.delegate=null,w):j:(z.method="throw",z.arg=new TypeError("iterator result is not an object"),z.delegate=null,w)}function P(E){var z={tryLoc:E[0]};1 in E&&(z.catchLoc=E[1]),2 in E&&(z.finallyLoc=E[2],z.afterLoc=E[3]),this.tryEntries.push(z)}function L(E){var z=E.completion||{};z.type="normal",delete z.arg,E.completion=z}function k(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(P,this),this.reset(!0)}function I(E){if(E||E===""){var z=E[h];if(z)return z.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var O=-1,N=function W(){for(;++O<E.length;)if(s.call(E,O))return W.value=E[O],W.done=!1,W;return W.value=n,W.done=!0,W};return N.next=N}}throw new TypeError(t(E)+" is not iterable")}return C.prototype=_,l(T,"constructor",{value:_,configurable:!0}),l(_,"constructor",{value:C,configurable:!0}),C.displayName=c(_,u,"GeneratorFunction"),o.isGeneratorFunction=function(E){var z=typeof E=="function"&&E.constructor;return!!z&&(z===C||(z.displayName||z.name)==="GeneratorFunction")},o.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,_):(E.__proto__=_,c(E,u,"GeneratorFunction")),E.prototype=Object.create(T),E},o.awrap=function(E){return{__await:E}},B(M.prototype),c(M.prototype,d,function(){return this}),o.AsyncIterator=M,o.async=function(E,z,O,N,W){W===void 0&&(W=Promise);var j=new M(g(E,z,O,N),W);return o.isGeneratorFunction(z)?j:j.next().then(function(G){return G.done?G.value:j.next()})},B(T),c(T,u,"Generator"),c(T,h,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),o.keys=function(E){var z=Object(E),O=[];for(var N in z)O.push(N);return O.reverse(),function W(){for(;O.length;){var j=O.pop();if(j in z)return W.value=j,W.done=!1,W}return W.done=!0,W}},o.values=I,k.prototype={constructor:k,reset:function(E){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(L),!E)for(var z in this)z.charAt(0)==="t"&&s.call(this,z)&&!isNaN(+z.slice(1))&&(this[z]=n)},stop:function(){this.done=!0;var E=this.tryEntries[0].completion;if(E.type==="throw")throw E.arg;return this.rval},dispatchException:function(E){if(this.done)throw E;var z=this;function O($,U){return j.type="throw",j.arg=E,z.next=$,U&&(z.method="next",z.arg=n),!!U}for(var N=this.tryEntries.length-1;N>=0;--N){var W=this.tryEntries[N],j=W.completion;if(W.tryLoc==="root")return O("end");if(W.tryLoc<=this.prev){var G=s.call(W,"catchLoc"),V=s.call(W,"finallyLoc");if(G&&V){if(this.prev<W.catchLoc)return O(W.catchLoc,!0);if(this.prev<W.finallyLoc)return O(W.finallyLoc)}else if(G){if(this.prev<W.catchLoc)return O(W.catchLoc,!0)}else{if(!V)throw Error("try statement without catch or finally");if(this.prev<W.finallyLoc)return O(W.finallyLoc)}}}},abrupt:function(E,z){for(var O=this.tryEntries.length-1;O>=0;--O){var N=this.tryEntries[O];if(N.tryLoc<=this.prev&&s.call(N,"finallyLoc")&&this.prev<N.finallyLoc){var W=N;break}}W&&(E==="break"||E==="continue")&&W.tryLoc<=z&&z<=W.finallyLoc&&(W=null);var j=W?W.completion:{};return j.type=E,j.arg=z,W?(this.method="next",this.next=W.finallyLoc,w):this.complete(j)},complete:function(E,z){if(E.type==="throw")throw E.arg;return E.type==="break"||E.type==="continue"?this.next=E.arg:E.type==="return"?(this.rval=this.arg=E.arg,this.method="return",this.next="end"):E.type==="normal"&&z&&(this.next=z),w},finish:function(E){for(var z=this.tryEntries.length-1;z>=0;--z){var O=this.tryEntries[z];if(O.finallyLoc===E)return this.complete(O.completion,O.afterLoc),L(O),w}},catch:function(E){for(var z=this.tryEntries.length-1;z>=0;--z){var O=this.tryEntries[z];if(O.tryLoc===E){var N=O.completion;if(N.type==="throw"){var W=N.arg;L(O)}return W}}throw Error("illegal catch attempt")},delegateYield:function(E,z,O){return this.delegate={iterator:I(E),resultName:z,nextLoc:O},this.method==="next"&&(this.arg=n),w}},o}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports}(OR);var kc=OR.exports(),Fc=kc;try{regeneratorRuntime=kc}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=kc:Function("r","regeneratorRuntime = r")(kc)}function il(i,t){return function(e){if(Array.isArray(e))return e}(i)||function(e,n){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r,s,l,a,h=[],d=!0,u=!1;try{if(l=(o=o.call(e)).next,n===0){if(Object(o)!==o)return;d=!1}else for(;!(d=(r=l.call(o)).done)&&(h.push(r.value),h.length!==n);d=!0);}catch(c){u=!0,s=c}finally{try{if(!d&&o.return!=null&&(a=o.return(),Object(a)!==a))return}finally{if(u)throw s}}return h}}(i,t)||FR(i,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
364
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function e9(i){var t=function(e,n){if(el(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var r=o.call(e,n||"default");if(el(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(i,"string");return el(t)=="symbol"?t:t+""}function fm(i,t,e){return(t=e9(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Ic=S.defineComponent({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=S.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),background:"hsl(".concat(i.hue,", 100%, 50%)")}});return{saturationStyle:n,sliderStyle:S.computed(function(){return{top:"".concat((100-i.value)/100*i.size-5,"px"),left:"".concat(i.saturation*i.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(o){var r=o.target.getBoundingClientRect(),s=r.left,l=r.top,a=function(d){var u=d.clientX,c=d.clientY,g=u-s,f=c-l;g<0&&(g=0),f<0&&(f=0),g>i.size&&(g=i.size),f>i.size&&(f=i.size);var p=g/i.size*100,m=100-f/i.size*100;e("change",p,m)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(o),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}});function ao(i,t){t===void 0&&(t={});var e=t.insertAt;if(i&&typeof document<"u"){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i))}}ao(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),Ic.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("div",{class:"saturation",style:S.normalizeStyle(i.saturationStyle),onMousedown:t[0]||(t[0]=S.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[t[1]||(t[1]=S.createElementVNode("div",{class:"saturation-white"},null,-1)),t[2]||(t[2]=S.createElementVNode("div",{class:"saturation-black"},null,-1)),S.createElementVNode("div",{class:"slider",style:S.normalizeStyle(i.sliderStyle)},null,4)],36)},Ic.__scopeId="data-v-24517fec",Ic.__file="src/picker/Saturation.vue";var zc=S.defineComponent({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=S.computed(function(){return{top:"".concat((1-i.hue/360)*i.height-2,"px"),height:"".concat(4,"px")}}),o=S.ref();return S.onMounted(function(){(function(){o.value.width=i.width,o.value.height=i.height;var r=o.value.getContext("2d"),s=r.createLinearGradient(0,0,0,i.height);s.addColorStop(0,"#FF0000"),s.addColorStop(.17,"#FF00FF"),s.addColorStop(.34,"#0000FF"),s.addColorStop(.51,"#00FFFF"),s.addColorStop(.68,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),r.fillStyle=s,r.fillRect(0,0,i.width,i.height)})()}),{canvas:o,sliderStyle:n,onSelect:function(r){var s=r.target.getBoundingClientRect().top,l=function(h){var d=h.clientY-s;d<0&&(d=0),d>i.height&&(d=i.height);var u=-100*d/i.height+100;e("change",360*u/100)},a=function(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a)};l(r),document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}}}}),i9={ref:"canvas"};ao(".hue[data-v-78b9f4f0]{position:relative}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),zc.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("div",{class:"hue",onMousedown:t[0]||(t[0]=S.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[S.createElementVNode("canvas",i9,null,512),S.createElementVNode("div",{class:"slider",style:S.normalizeStyle(i.sliderStyle)},null,4)],32)},zc.__scopeId="data-v-78b9f4f0",zc.__file="src/picker/Hue.vue";var Oc=S.defineComponent({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(i,t){var e=t.emit,n=S.computed(function(){return{top:"".concat(i.alpha*i.height-2,"px"),height:"".concat(4,"px")}}),o=S.ref(),r=function(){var s=o.value.getContext("2d");o.value.width=i.width,o.value.height=i.height;var l=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);s.fillStyle=s.createPattern(l,"repeat"),s.fillRect(0,0,i.width,i.height);var a=s.createLinearGradient(0,0,0,i.height);a.addColorStop(.01,"rgba(255,255,255,0)"),a.addColorStop(.99,i.color),s.fillStyle=a,s.fillRect(0,0,i.width,i.height)};return S.watch(function(){return i.color},function(){r()}),S.onMounted(function(){r()}),{canvas:o,sliderStyle:n,onSelect:function(s){var l=s.target.getBoundingClientRect().top,a=function(d){var u=d.clientY-l;u<0&&(u=0),u>i.height&&(u=i.height);var c=parseFloat((u/i.height).toFixed(2));e("change",c)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(s),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}}),n9={ref:"canvas"};ao(".alpha[data-v-24dc9656]{position:relative}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),Oc.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("div",{class:"alpha",onMousedown:t[0]||(t[0]=S.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[S.createElementVNode("canvas",n9,null,512),S.createElementVNode("div",{class:"slider",style:S.normalizeStyle(i.sliderStyle)},null,4)],32)},Oc.__scopeId="data-v-24dc9656",Oc.__file="src/picker/Alpha.vue";var WR={rgb:"RGBA",hex:"HEX",hsl:"HSLA",hsv:"HSVA"},NR={rgb:"RGB",hex:"HEX",hsl:"HSL",hsv:"HSV"},o9={RGB:"rgb",RGBA:"rgb",HEX:"hex",HSL:"hsl",HSLA:"hsl",HSV:"hsv",HSVA:"hsv"};function VR(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function pm(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?VR(Object(e),!0).forEach(function(n){fm(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):VR(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}var Xr=null,jR=function(i,t,e){var n=S.ref({}),o=e||{},r=o.placement,s=o.defaultStyle,l={strategy:o.strategy||"absolute",placement:r||"auto",onFirstUpdate:function(){Xr.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(a){var h=a.state,d=h.styles,u=h.placement,c=d.popper;n.value=pm(pm(pm({},c),s),{},{transformOrigin:u==="top"?"center bottom":"center top"})}}]};return S.watch(function(){return[S.unref(i),S.unref(t)]},function(a,h){var d,u=il(a,2),c=u[0],g=u[1],f=il(h,2),p=f[0],m=f[1];if(c&&g&&(p!==c||m!==p)){(d=Xr)===null||d===void 0||d.destroy();var v=c.$el||c,b=g.$el||g;S.nextTick(function(){Xr=QV(v,b,l)})}}),S.onBeforeUnmount(function(){var a;Xr&&((a=Xr)===null||a===void 0||a.destroy(),Xr=null)}),{instance:Xr,style:n}},Dc=S.defineComponent({props:{value:{type:String,default:"RGBA"},showAlpha:{type:Boolean},options:{type:[Boolean,Array]}},emits:["change"],setup:function(i,t){var e=t.emit,n=S.ref(null),o=S.ref(null),r=S.ref(!1),s=jR(n,o,{strategy:"fixed",defaultStyle:{zIndex:2}}).style,l=S.computed(function(){return Array.isArray(i.options)&&i.options.length>1}),a=S.computed(function(){var d=i.options,u=i.showAlpha,c=i.value;return Array.isArray(d)?u?d.map(function(g){return WR[g]}).filter(function(g){return!g.includes(c)}):d.map(function(g){return NR[g]}).filter(function(g){return!g.includes(c)}):[]}),h=function(d){var u,c,g=d.target;!((u=S.unref(n))!==null&&u!==void 0&&u.isEqualNode(g))&&(!((c=S.unref(n))===null||c===void 0)&&c.contains(g))||(r.value=!1)};return S.onMounted(function(){document.addEventListener("mouseup",h,!1)}),S.onUnmounted(function(){document.removeEventListener("mouseup",h,!1)}),{targetRef:n,selectorRef:o,selectorStyle:s,isShowSelector:r,isNeedSelect:l,formatOptions:a,onShow:function(){l.value&&(r.value=!0)},onFormatChange:function(d){e("change",o9[d])}}}}),r9={class:"format"},s9={key:0,class:"arrow"},l9=["onClick"];ao(".format[data-v-5f6e8f5e]{position:relative}.label[data-v-5f6e8f5e]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;position:relative;width:60px}[pick-colors-theme=dark] .label[data-v-5f6e8f5e]{background:#252930;color:#999}.arrow[data-v-5f6e8f5e]{height:6px;margin-bottom:4px;margin-left:5px;transform:rotate(135deg);width:6px}.arrow[data-v-5f6e8f5e],[pick-colors-theme=dark] .arrow[data-v-5f6e8f5e]{border-right:1px solid #999;border-top:1px solid #999}.selector[data-v-5f6e8f5e]{align-items:center;background:#f7f8f9;border-radius:5px;box-shadow:0 0 16px 0 rgba(0,0,0,.16);cursor:pointer;display:flex;flex-direction:column;font-weight:400;justify-content:center;padding:4px}[pick-colors-theme=dark] .selector[data-v-5f6e8f5e]{background:#252930;color:#999}.selector-item[data-v-5f6e8f5e]{align-items:center;display:flex;height:30px;justify-content:center;width:60px}.selector-item[data-v-5f6e8f5e]:hover{background:#e1f2fe}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]{color:#fff}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]:hover{background:#0087fa}.active-selector-item[data-v-5f6e8f5e]{background:#e1f2fe}[pick-colors-theme=dark] .active-selector-item[data-v-5f6e8f5e]{background:#0087fa}.v-enter-active[data-v-5f6e8f5e],.v-leave-active[data-v-5f6e8f5e]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-5f6e8f5e],.v-leave-to[data-v-5f6e8f5e]{opacity:0;transform:scaleY(0)}"),Dc.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("div",r9,[S.createElementVNode("div",{class:"label",ref:"targetRef",onClick:t[0]||(t[0]=function(){return i.onShow&&i.onShow.apply(i,arguments)})},[S.createElementVNode("span",null,S.toDisplayString(i.value),1),i.isNeedSelect?(S.openBlock(),S.createElementBlock("div",s9)):S.createCommentVNode("v-if",!0)],512),S.createVNode(S.Transition,null,{default:S.withCtx(function(){return[i.isShowSelector?(S.openBlock(),S.createElementBlock("div",{key:0,class:"selector",ref:"selectorRef",style:S.normalizeStyle(i.selectorStyle)},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.formatOptions,function(s){return S.openBlock(),S.createElementBlock("div",{class:"selector-item",key:s,onClick:function(l){return i.onFormatChange(s)}},S.toDisplayString(s),9,l9)}),128))],4)):S.createCommentVNode("v-if",!0)]}),_:1})])},Dc.__scopeId="data-v-5f6e8f5e",Dc.__file="src/picker/input-value/FormatValue.vue";var Wc=S.defineComponent({name:"Input",components:{FormatValue:Dc},props:{format:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number},showAlpha:{type:Boolean},formatOptions:{type:[Boolean,Array]}},emits:["change","focus","blur","enter","formatChange"],setup:function(i,t){var e=t.emit;return{onInput:function(n){var o;e("change",(o=n.target)===null||o===void 0?void 0:o.value)},valueStyle:S.computed(function(){return{minWidth:"".concat(i.width,"px"),maxWidth:"".concat(i.width,"px"),width:"".concat(i.width,"px")}}),onFocus:function(){e("focus")},onBlur:function(){e("blur")},onEnter:function(){e("enter")},onFormatChange:function(n){e("formatChange",n)}}}}),a9={class:"input"},h9=[".value"];function GR(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Pn(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?GR(Object(e),!0).forEach(function(n){fm(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):GR(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}ao(".input[data-v-2c454c00]{display:flex;font-size:12px}.value[data-v-2c454c00]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-2c454c00]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-2c454c00]:focus{border:1px solid #1890ff;outline:none}"),Wc.render=function(i,t,e,n,o,r){var s=S.resolveComponent("FormatValue");return S.openBlock(),S.createElementBlock("div",a9,[S.createVNode(s,{value:i.format,showAlpha:i.showAlpha,options:i.formatOptions,onChange:i.onFormatChange},null,8,["value","showAlpha","options","onChange"]),S.createElementVNode("input",{class:"value",style:S.normalizeStyle(i.valueStyle),".value":i.value,onFocus:t[0]||(t[0]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onInput:t[1]||(t[1]=function(){return i.onInput&&i.onInput.apply(i,arguments)}),onBlur:t[2]||(t[2]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)}),onKeydown:t[3]||(t[3]=S.withKeys(function(){return i.onEnter&&i.onEnter.apply(i,arguments)},["enter"]))},null,44,h9)])},Wc.__scopeId="data-v-2c454c00",Wc.__file="src/picker/input-value/InputValue.vue";var UR=function(i,t,e){return[i,t*e/((i=(2-t)*e)<1?i:2-i)||0,i/2]},$R={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},Nc=function(i){i=Math.min(Math.round(i),255);var t=Math.floor(i/16),e=i%16;return"".concat($R[t]||t).concat($R[e]||e)},KR=function(i){var t=i.r,e=i.g,n=i.b;return isNaN(t)||isNaN(e)||isNaN(n)?"":"#".concat(Nc(t)).concat(Nc(e)).concat(Nc(n))},nl=function(i,t){var e;typeof(e=i)=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1&&(i="100%");var n=function(o){return typeof o=="string"&&o.indexOf("%")!==-1}(i);return i=Math.min(t,Math.max(0,parseFloat("".concat(i)))),n&&(i=parseInt("".concat(i*t),10)/100),Math.abs(i-t)<1e-6?1:i%t/parseFloat(t)},$a=function(i,t,e){i=6*nl(i,360),t=nl(t,100),e=nl(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:Math.round(255*h),g:Math.round(255*d),b:Math.round(255*u)}},YR=function(i,t,e){var n,o,r=i.h,s=i.s,l=i.v,a=i.a;if(e)switch(a=(o=(n=a).toString().match(/\.(\d{1,2})(\d*)/))&&o[2].length>0?parseFloat(n.toFixed(2)):n,t){case"hsl":var h=UR(r,s/100,l/100);return"hsla(".concat(r.toFixed(0),", ").concat(Math.round(100*h[1]),"%, ").concat(Math.round(100*h[2]),"%, ").concat(a,")");case"hsv":return"hsva(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%, ").concat(a,")");case"rgb":var d=$a(r,s,l),u=d.r,c=d.g,g=d.b;return"rgba(".concat(u,", ").concat(c,", ").concat(g,", ").concat(a,")");default:return"".concat(KR($a(r,s,l))).concat(Nc(255*a))}else switch(t){case"hsl":var f=UR(r,s/100,l/100);return"hsl(".concat(r.toFixed(0),", ").concat(Math.round(100*f[1]),"%, ").concat(Math.round(100*f[2]),"%)");case"hsv":return"hsv(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%)");case"rgb":var p=$a(r,s,l),m=p.r,v=p.g,b=p.b;return"rgb(".concat(m,", ").concat(v,", ").concat(b,")");default:return KR($a(r,s,l))}},Vc=function(i){var t=i.r,e=i.g,n=i.b;t=nl(t,255),e=nl(e,255),n=nl(n,255);var o,r=Math.max(t,e,n),s=Math.min(t,e,n),l=r,a=r-s,h=r===0?0:a/r;if(r===s)o=0;else{switch(r){case t:o=(e-n)/a+(e<n?6:0);break;case e:o=(n-t)/a+2;break;case n:o=(t-e)/a+4}o/=6}return{h:360*o,s:100*h,v:100*l}},XR=function(i){var t=i.h,e=i.s,n=i.l;n/=100;var o=e/=100,r=Math.max(n,.01);return e*=(n*=2)<=1?n:2-n,o*=r<=1?r:2-r,{h:+t,s:100*(n===0?2*o/(r+o):2*e/(n+e)),v:100*((n+e)/2)}},qR=function(i){var t=[];if(i.match(/^#([0-9a-fA-f]{3,4})$/g))for(var e=1;e<i.length;e++)t.push(parseInt("0x"+i[e].repeat(2)));else if(i.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var n=1;n<i.length;n+=2)t.push(parseInt("0x"+i.slice(n,n+2)));return{r:t[0],g:t[1],b:t[2],a:t[3]}},mm=function(i,t,e){if(typeof i=="string"&&i!==""){var n=jc(i,Gc(i),e),o=tA(n);return o==null?"":YR(o,t,e)}return""},ZR=function(i){var t=il(i.match(/(\d(\.\d+)?)+/g),4);return{r:t[0],g:t[1],b:t[2],a:t[3]}},JR=function(i){var t=il(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:e,s:parseFloat(n),l:parseFloat(o),a:r}},QR=function(i){var t=il(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:parseFloat(e),s:parseFloat(n),v:parseFloat(o),a:parseFloat(r)}},jc=function(i,t){if(!(arguments.length>2&&arguments[2]!==void 0)||arguments[2])switch(t){case"rgb":var e=ZR(i),n=e.r,o=e.g,r=e.b,s=e.a;return Pn(Pn({},Vc({r:n,g:o,b:r})),{},{a:+s});case"hsv":var l=QR(i);return{h:l.h,s:l.s,v:l.v,a:l.a};case"hsl":var a=JR(i),h=a.h,d=a.s,u=a.l,c=a.a;return Pn(Pn({},XR({h,s:d,l:u})),{},{a:+c});default:var g=qR(i),f=g.r,p=g.g,m=g.b,v=g.a;return Pn(Pn({},Vc({r:f,g:p,b:m})),{},{a:v/255})}else switch(t){case"rgb":return Pn(Pn({},Vc(ZR(i))),{},{a:1});case"hsv":var b=QR(i);return{h:b.h,s:b.s,v:b.v,a:1};case"hsl":return Pn(Pn({},XR(JR(i))),{},{a:1});default:return Pn(Pn({},Vc(qR(i))),{},{a:1})}},Gc=function(i){return i.match(/^#/)?"hex":i.match(/^rgb/)?"rgb":i.match(/^hsl/)?"hsl":i.match(/^hsv/)?"hsv":"hex"},tA=function(i){var t=i.h,e=i.s,n=i.v,o=i.a;return isNaN(t)&&isNaN(e)&&isNaN(n)?null:(isNaN(t)&&(t=0),isNaN(e)&&(e=0),isNaN(n)&&(n=0),isNaN(o)&&(o=1),{h:t,s:e,v:n,a:o})},Ka=S.defineComponent({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(i){var t=S.ref(),e=S.inject("theme",{theme:"light"}).theme,n=S.computed(function(){return parseFloat((i.width||i.size)+"")}),o=S.computed(function(){return parseFloat((i.height||i.size)+"")}),r=S.computed(function(){return{width:"".concat(S.unref(n),"px"),height:"".concat(S.unref(o),"px"),border:i.border?"1px solid ".concat(S.unref(e)==="dark"?"#434345":"#d9d9d9"):"",borderRadius:"".concat(i.borderRadius,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(S.unref(e)==="dark"?"#2681ff":"#1890ff"):""}}),s=function(){var l=t.value.getContext("2d");t.value.width=S.unref(n),t.value.height=S.unref(o);var a=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);l.fillStyle=l.createPattern(a,"repeat"),l.fillRect(0,0,S.unref(n),S.unref(o)),l.fillStyle=i.value,l.fillRect(0,0,S.unref(n),S.unref(o))};return S.watch(function(){return i.value},function(){s()}),S.onMounted(function(){s()}),{canvas:t,colorItemStyle:r}}}),d9=["draggable"];ao(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),Ka.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("canvas",{class:"color-item",style:S.normalizeStyle(i.colorItemStyle),ref:"canvas",draggable:i.draggable},null,12,d9)},Ka.__scopeId="data-v-02da71fd",Ka.__file="src/color-item/ColorItem.vue";var Uc=S.defineComponent({name:"Colors",components:{ColorItem:Ka},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(i,t){var e=t.emit;return{onSelectColor:function(n,o){e("change",n,o)},useColors:S.computed(function(){return i.colors.map(function(n){return mm(n,"hex",!0)})})}}}),u9={class:"colors"};function eA(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function ho(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?eA(Object(e),!0).forEach(function(n){fm(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):eA(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}ao(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),Uc.render=function(i,t,e,n,o,r){var s=S.resolveComponent("color-item");return S.openBlock(),S.createElementBlock("div",u9,[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.useColors,function(l,a){return S.openBlock(),S.createBlock(s,{key:a,class:"color-item",size:16,value:l,border:!1,"border-radius":3,selected:i.selectedIndex===a,onClick:S.withModifiers(function(h){return i.onSelectColor(l,+a)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},Uc.__scopeId="data-v-0f8b52a8",Uc.__file="src/picker/Colors.vue";var $c=S.defineComponent({name:"Picker",components:{Colors:Uc,Saturation:Ic,Hue:zc,Alpha:Oc,InputValue:Wc},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}},formatOptions:{type:[Boolean,Array]}},emits:["change","formatChange"],setup:function(i,t){var e=t.emit,n=S.computed(function(){return ho(ho({},i.style),{},{width:i.showAlpha?"230px":"205px"})}),o=S.ref(),r=S.ref(),s=S.ref(),l=function(){var p,m=(p=i.value)===null||p===void 0?void 0:p.trim();if(m!=null&&m!==""){var v=Gc(m);return tA(jc(m,v,i.showAlpha))}return null};S.watch(function(){return i.value},function(){i.value!==S.unref(s)&&(o.value=l())},{immediate:!0}),S.watch(function(){return[S.unref(o),i.format]},function(p){var m=il(p,2),v=m[0],b=m[1],w="";v!=null?(w=YR(ho({},v),i.format,i.showAlpha),r.value=ho({},v)):r.value=null,s.value=w;var y=l();JSON.stringify(v)!==JSON.stringify(y)&&JSON.stringify(v)!==JSON.stringify(b)&&e("change",w)},{immediate:!0});var a=S.computed(function(){var p;return((p=S.unref(o))===null||p===void 0?void 0:p.h)||0}),h=S.computed(function(){var p;return((p=S.unref(o))===null||p===void 0?void 0:p.s)||0}),d=S.computed(function(){var p;return((p=S.unref(o))===null||p===void 0?void 0:p.v)||0}),u=S.computed(function(){var p,m;return((p=S.unref(o))===null||p===void 0?void 0:p.a)!=null?(m=S.unref(o))===null||m===void 0?void 0:m.a:1}),c=S.computed(function(){return $a(S.unref(a),S.unref(h),S.unref(d))}),g=S.computed(function(){return"rgb(".concat(S.unref(c).r,", ").concat(S.unref(c).g,", ").concat(S.unref(c).b,")")}),f=S.ref(-1);return{h:a,s:h,v:d,a:u,rgbStr:g,onSelectSaturation:function(p,m){f.value=-1,S.unref(o)==null?o.value={h:S.unref(a),s:p,v:m,a:S.unref(u)}:o.value=ho(ho({},S.unref(o)),{},{s:p,v:m})},onSelectHue:function(p){f.value=-1,S.unref(o)==null&&(o.value={h:p,s:S.unref(h),v:S.unref(d),a:S.unref(u)}),o.value=ho(ho({},S.unref(o)),{},{h:p})},onSelectAlpha:function(p){f.value=-1,S.unref(o)==null?o.value={h:S.unref(a),s:S.unref(h),v:S.unref(d),a:p}:o.value=ho(ho({},S.unref(o)),{},{a:p})},handleInputFormat:function(p){return i.showAlpha?WR[p]:NR[p]},colorValue:s,pickerStyle:n,onInputChange:function(p){f.value=-1,s.value=p},handleChange:function(){var p,m=(p=S.unref(s))===null||p===void 0?void 0:p.trim();if(m!==""){var v=i.showAlpha,b=Gc(m),w=jc(m,b,v),y=function(C){var _=C.h,A=C.s,R=C.v,x=C.a;return!(isNaN(_)||isNaN(A)||isNaN(R)||isNaN(x))}(w);y?o.value=w:S.unref(r)!=null?o.value=S.unref(r):s.value=""}else o.value=null},selectColorIndex:f,onSelectColor:function(p,m){if(f.value=m,(p=p.trim())==="")o.value=null;else{var v=Gc(p);v?function(b,w,y){if(b.length!==0){var C=jc(b,w,y),_=C.h,A=C.s,R=C.v;if(!(isNaN(_)||isNaN(A)||isNaN(R))){var x=1,T=C.a;isNaN(T)||(x=T),o.value={h:_,s:A,v:R,a:x}}}}(p,v,!0):o.value=null}},onFormatChange:function(p){e("formatChange",p)}}}}),c9={class:"picker-inner"},g9={class:"picker-header"};ao(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),$c.render=function(i,t,e,n,o,r){var s=S.resolveComponent("saturation"),l=S.resolveComponent("hue"),a=S.resolveComponent("alpha"),h=S.resolveComponent("input-value"),d=S.resolveComponent("Colors");return S.openBlock(),S.createElementBlock("div",{class:"picker",style:S.normalizeStyle(i.pickerStyle)},[S.createElementVNode("div",c9,[S.createElementVNode("div",g9,[S.createVNode(s,{class:"saturation",hue:i.h,saturation:i.s,value:i.v,onChange:i.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),S.createVNode(l,{class:"hue",hue:i.h,onChange:i.onSelectHue},null,8,["hue","onChange"]),i.showAlpha?(S.openBlock(),S.createBlock(a,{key:0,class:"alpha",alpha:i.a,color:i.rgbStr,onChange:i.onSelectAlpha},null,8,["alpha","color","onChange"])):S.createCommentVNode("v-if",!0)]),S.createVNode(h,{format:i.handleInputFormat(i.format),value:i.colorValue,showAlpha:i.showAlpha,width:i.showAlpha?150:125,formatOptions:i.formatOptions,onChange:i.onInputChange,onBlur:i.handleChange,onEnter:i.handleChange,onFormatChange:i.onFormatChange},null,8,["format","value","showAlpha","width","formatOptions","onChange","onBlur","onEnter","onFormatChange"]),i.colors.length>0?(S.openBlock(),S.createBlock(d,{key:0,class:"colors",colors:i.colors,"selected-index":i.selectColorIndex,onChange:i.onSelectColor},null,8,["colors","selected-index","onChange"])):S.createCommentVNode("v-if",!0)])],4)},$c.__scopeId="data-v-6ceadec6",$c.__file="src/picker/Picker.vue";var Kc=S.defineComponent({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(i){var t=S.inject("theme",{theme:"light"}).theme;return{addColorItemStyle:S.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),lineHeight:"".concat(i.size,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(S.unref(t)==="dark"?"#2681ff":"#1890ff"):""}})}}});ao(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),Kc.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("svg",{class:"add-color-item",style:S.normalizeStyle(i.addColorItemStyle),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},t[0]||(t[0]=[S.createElementVNode("g",{class:"container"},[S.createElementVNode("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)]),4)},Kc.__scopeId="data-v-ceb1719c",Kc.__file="src/add-color-item/AddColorItem.vue";var Yc=S.defineComponent({name:"ColorPicker",components:{ColorItem:Ka,Picker:$c,AddColorItem:Kc},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean],default:"body"},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}},position:{type:String},placement:{type:String},formatOptions:{type:[Boolean,Array],default:!1}},emits:["change","update:value","update:showPicker","overflowMax","closePicker","formatChange"],setup:function(i,t){var e=t.emit,n=S.ref([]),o=S.computed(function(){return S.unref(n).map(function(x){return mm(x,"hex",i.showAlpha)})}),r=S.ref("hex");S.watch(function(){return i.format},function(){r.value=i.format},{immediate:!0}),S.watch(function(){return i.value},function(){var x=i.value||"",T=Array.isArray(x)?x:[x];n.value=T.map(function(B){return mm(B,S.unref(r),i.showAlpha)})},{immediate:!0});var s=S.ref(void 0),l=S.computed(function(){return S.unref(n)[S.unref(s)]}),a=S.ref(!1);S.watch(function(){return i.showPicker},function(){a.value=i.showPicker},{immediate:!0});var h,d,u=S.ref(null),c=S.ref(null),g=jR(u,c,{defaultStyle:{zIndex:i.zIndex},strategy:i.position,placement:i.placement}).style,f=function(){S.unref(u)==null&&(u.value=S.unref(R)[0]),S.unref(s)==null&&(s.value=0),i.showPicker===void 0?a.value=!0:e("update:showPicker",!0)},p=function(){s.value=void 0,i.showPicker===void 0?a.value=!1:e("update:showPicker",!1),e("closePicker",S.toRaw(Array.isArray(i.value)||i.addColor?S.unref(n):S.unref(n)[0]))},m=S.ref(),v=function(){var x=zR(Fc.mark(function T(B){var M,H,F,P;return Fc.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(H=B.target,(F=(M=H.dataset)===null||M===void 0?void 0:M.index)!=null&&F!==""){L.next=4;break}return L.abrupt("return");case 4:if(P=+F,S.unref(s)!==P){L.next=7;break}return L.abrupt("return");case 7:S.unref(s)!=null&&S.unref(s)!==P?(p(),h&&clearTimeout(h),h=setTimeout(function(){f(),clearTimeout(h)},100)):f(),s.value=P,u.value=H;case 10:case"end":return L.stop()}},T)}));return function(T){return x.apply(this,arguments)}}(),b=function(){var x=zR(Fc.mark(function T(B){var M,H,F,P,L;return Fc.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(P=B.target,!(!((M=S.unref(m))!==null&&M!==void 0&&M.isEqualNode(P))&&(!((H=S.unref(m))===null||H===void 0)&&H.contains(P)))){k.next=4;break}return k.abrupt("return");case 4:if(L=(F=S.unref(c))===null||F===void 0?void 0:F.$el,!(L!=null&&L.contains(P))){k.next=8;break}return k.abrupt("return");case 8:d&&clearTimeout(d),d=setTimeout(function(){S.unref(a)&&p()},0);case 10:case"end":return k.stop()}},T)}));return function(T){return x.apply(this,arguments)}}();S.watch(a,function(){S.unref(a)&&(f(),clearTimeout(d))});var w,y=S.ref(i.max>S.unref(n).length),C=S.computed(function(){return typeof i.popupContainer=="string"||el(i.popupContainer)==="object"&&i.popupContainer!=null?i.popupContainer:"body"}),_=S.computed(function(){return typeof i.popupContainer=="boolean"&&i.popupContainer===!1}),A=S.computed(function(){return i.theme});S.watch(function(){return[i.theme,S.unref(c)]},function(){S.nextTick(function(){var x,T;(x=S.unref(m))===null||x===void 0||x.setAttribute("pick-colors-theme",S.unref(A)),(T=S.unref(c))===null||T===void 0||(T=T.$el)===null||T===void 0||T.setAttribute("pick-colors-theme",S.unref(A))})},{immediate:!0}),S.provide("theme",{theme:A});var R=S.ref([]);return S.onMounted(function(){document.addEventListener("mouseup",b,!1),i.showPicker&&f()}),S.onUnmounted(function(){document.removeEventListener("mouseup",b,!1),h&&(clearTimeout(h),h=null),d&&(clearTimeout(d),d=null)}),{valueList:n,colorItemSelected:function(x){return(i.addColor?S.unref(n).length>0:S.unref(n).length>1)&&S.unref(s)===x},selectedColor:l,selectedIndex:s,isShowPicker:a,addColorItemShow:y,onPickerChange:function(x){var T=S.unref(s),B=S.unref(n).slice(),M=S.unref(n).length;if(T!=null){T>=0?B[T]=x:(s.value=M,B.push(x));var H="";H=Array.isArray(i.value)||i.addColor?B:x,n.value=Array.isArray(H)?H:[H],e("update:value",H),e("change",H,x,T),i.addColor&&M>=i.max&&(y.value=!1,e("overflowMax"))}},colorPicker:m,onColorClick:v,pickerRef:c,onColorItemDragStart:function(x){x.dataTransfer.effectAllowed="move";var T=x.target;w=+T.dataset.index},onColorItemDragOver:function(x){},onColorItemDrop:function(x){var T=+x.target.dataset.index,B=t9(S.unref(n)),M=B[w];B.splice(w,1);var H=B.slice(0,T),F=B.splice(T),P=H.concat([M]).concat(F);e("update:value",P),e("change",P,P[w],w)},colorItemsRef:R,pickerStyle:g,values:o,teleportDisabled:_,toPopupContainer:C,formatValue:r,onFormatChange:function(x){r.value=x,e("formatChange",x)}}}});ao(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),Yc.render=function(i,t,e,n,o,r){var s=S.resolveComponent("color-item"),l=S.resolveComponent("add-color-item"),a=S.resolveComponent("picker");return S.openBlock(),S.createElementBlock("div",{class:"color-picker",ref:"colorPicker",onDragstart:t[0]||(t[0]=S.withModifiers(function(){return i.onColorItemDragStart&&i.onColorItemDragStart.apply(i,arguments)},["stop"])),onDragover:t[1]||(t[1]=S.withModifiers(function(){return i.onColorItemDragOver&&i.onColorItemDragOver.apply(i,arguments)},["prevent","stop"])),onDrop:t[2]||(t[2]=S.withModifiers(function(){return i.onColorItemDrop&&i.onColorItemDrop.apply(i,arguments)},["prevent","stop"])),onClick:t[3]||(t[3]=S.withModifiers(function(){return i.onColorClick&&i.onColorClick.apply(i,arguments)},["stop"]))},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.values,function(h,d){return S.openBlock(),S.createBlock(s,{class:"color-item",key:d,ref_for:!0,ref:function(u){return i.colorItemsRef[d]=u},size:i.size,width:i.width,height:i.height,value:h,selected:i.colorItemSelected(d),"data-index":d,draggable:i.valueList.length>1,format:i.formatValue},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),i.addColor&&i.addColorItemShow?(S.openBlock(),S.createBlock(l,{key:0,class:"add-color-item",ref:"addColorItem",selected:i.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):S.createCommentVNode("v-if",!0),(S.openBlock(),S.createBlock(S.Teleport,{to:i.toPopupContainer,disabled:i.teleportDisabled},[S.createVNode(S.Transition,null,{default:S.withCtx(function(){return[i.isShowPicker?(S.openBlock(),S.createBlock(a,{key:0,class:"picker",style:S.normalizeStyle(i.pickerStyle),ref:"pickerRef",value:i.selectedColor,format:i.formatValue,"show-alpha":i.showAlpha,colors:i.colors,formatOptions:i.formatOptions,onChange:i.onPickerChange,onFormatChange:i.onFormatChange},null,8,["style","value","format","show-alpha","colors","formatOptions","onChange","onFormatChange"])):S.createCommentVNode("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},Yc.__scopeId="data-v-3c43ade8",Yc.__file="src/ColorPicker.vue";const aj="",f9=S.defineComponent({name:"ColorPick",components:{PickColors:Yc},props:{value:{type:String,default:""}},setup(i,{emit:t}){const e=S.ref(i.value);S.watch(()=>i.value,o=>{e.value=o},{immediate:!0});function n(){t("changeProp",S.unref(e))}return{myValue:e,onChange:n}}}),p9={class:"color-pick"};function m9(i,t,e,n,o,r){const s=S.resolveComponent("a-input"),l=S.resolveComponent("pick-colors");return S.openBlock(),S.createElementBlock("div",p9,[S.createVNode(s,{class:"input",size:"small",value:i.myValue,"onUpdate:value":t[0]||(t[0]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"]),S.createVNode(l,{value:i.myValue,"onUpdate:value":t[1]||(t[1]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"])])}const v9=Mi(f9,[["render",m9],["__scopeId","data-v-99378939"]]),b9=S.defineComponent({name:"Radio",props:{value:{type:String,default:""},options:{type:Array,default(){return[]}}},setup(i,{emit:t}){function e(n){t("changeProp",n.target.value)}return{onChange:e}}});function C9(i,t,e,n,o,r){const s=S.resolveComponent("a-radio-group");return S.openBlock(),S.createBlock(s,{value:i.value,size:"small",onChange:i.onChange,options:i.options,optionType:"button"},null,8,["value","onChange","options"])}const y9=Mi(b9,[["render",C9]]),hj="",_9=S.defineComponent({name:"PropertyConfig",components:{ColorPick:v9,Radio:y9},props:{config:{type:Object,default(){return{}}},selectedIndex:{type:Boolean},theme:{type:String,default:"light"}},setup(i){const t=[{label:"字体颜色",key:"color",component:"color-pick"},{label:"对齐方式",key:"align",component:"radio",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},{label:"图标",key:"icon",component:"radio",props:{options:[{label:"上涨",value:"increase"},{label:"下跌",value:"decline"}]}},{label:"图标颜色",key:"iconColor",component:"color-pick"}],e=S.ref([]);S.watch(()=>i.selectedIndex,()=>{if(i.selectedIndex>-1){const s=Object.keys(i.config);e.value=s}});function n(s,l){i.config[s]=l}function o(s,l){if(s.target.checked)i.config[l]="",S.unref(e).push(l);else{delete i.config[l];const a=S.unref(e).indexOf(l);S.unref(e).splice(a,1)}}const r=S.computed(()=>i.theme==="darkBlue"?"#b2c3dd":"");return{formConfig:t,handleSelect:o,selectedProperty:e,onChange:n,fontColor:r}}}),w9={class:"content"},S9={class:"list"};function x9(i,t,e,n,o,r){const s=S.resolveComponent("a-checkbox");return S.openBlock(),S.createElementBlock("div",w9,[S.createElementVNode("div",{style:S.normalizeStyle({color:i.fontColor,height:"32px",lineHeight:"32px"})},"属性配置",4),S.createElementVNode("div",S9,[i.selectedIndex>-1?(S.openBlock(!0),S.createElementBlock(S.Fragment,{key:0},S.renderList(i.formConfig,({label:l,component:a,props:h,key:d},u)=>(S.openBlock(),S.createElementBlock("div",{class:"list-item",style:{display:"flex"},key:u},[S.createVNode(s,{checked:i.selectedProperty.includes(d),onChange:c=>i.handleSelect(c,d)},null,8,["checked","onChange"]),S.createElementVNode("span",{style:S.normalizeStyle({padding:"0 8px",color:i.fontColor})},S.toDisplayString(l),5),i.selectedProperty.includes(d)?(S.openBlock(),S.createBlock(S.resolveDynamicComponent(a),S.mergeProps({key:0,value:i.config[d],ref_for:!0},h,{onChangeProp:c=>i.onChange(d,c)}),null,16,["value","onChangeProp"])):S.createCommentVNode("",!0)]))),128)):S.createCommentVNode("",!0)])])}const R9=Mi(_9,[["render",x9],["__scopeId","data-v-285d450e"]]),A9=S.defineComponent({name:"ConditionalProperty",props:{theme:{type:String,default:"light"}},components:{ConditionalItemConfig:W8,ConditionalConfig:K8,PropertyConfig:R9},setup(i,{emit:t,expose:e}){const n=S.ref(!1),o=S.ref([]),r=S.ref(-1);let s="";const l=S.computed(()=>S.unref(r)>-1?S.unref(o)[S.unref(r)]:{});function a(c,g=[]){s=c,o.value=g,n.value=!0}function h(c){r.value=c}function d(){t("change",s,S.unref(o)),r.value=-1,n.value=!1}function u(){r.value=-1,o.value=[]}return e({showModal:a}),{visible:n,config:o,changeSelectedItem:h,selectedConfig:l,selectedIndex:r,handleOk:d,handleClear:u}}}),T9={style:{display:"flex"}};function B9(i,t,e,n,o,r){const s=S.resolveComponent("conditional-item-config"),l=S.resolveComponent("conditional-config"),a=S.resolveComponent("property-config"),h=S.resolveComponent("a-button"),d=S.resolveComponent("a-modal");return S.openBlock(),S.createBlock(d,{wrapClassName:i.theme,title:"条件属性",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.visible=u),"ok-text":"确认","cancel-text":"取消",style:{width:"950px",top:"60px",height:"700px"},maskClosable:!1,destroyOnClose:!0,onOk:i.handleOk},{footer:S.withCtx(()=>[S.createVNode(h,{onClick:t[0]||(t[0]=u=>i.visible=!1)},{default:S.withCtx(()=>t[2]||(t[2]=[S.createTextVNode("取消")])),_:1}),S.createVNode(h,{onClick:i.handleClear},{default:S.withCtx(()=>t[3]||(t[3]=[S.createTextVNode("清除筛选")])),_:1},8,["onClick"]),S.createVNode(h,{type:"primary",onClick:i.handleOk},{default:S.withCtx(()=>t[4]||(t[4]=[S.createTextVNode("确定")])),_:1},8,["onClick"])]),default:S.withCtx(()=>[S.createElementVNode("div",T9,[S.createVNode(s,{config:i.config,theme:i.theme,onChange:i.changeSelectedItem},null,8,["config","theme","onChange"]),S.createVNode(l,{config:i.selectedConfig.conditions,theme:i.theme,isSelected:i.selectedIndex>-1},null,8,["config","theme","isSelected"]),S.createVNode(a,{config:i.selectedConfig,selectedIndex:i.selectedIndex,theme:i.theme},null,8,["config","selectedIndex","theme"])])]),_:1},8,["wrapClassName","visible","onOk"])}const M9=Mi(A9,[["render",B9]]),dj="",P9=S.defineComponent({name:"PivotChart",props:{data:{type:Object,default(){return{dimensionData:{},xLabel:"",yLabel:""}}},theme:{type:String,default:"light"}},components:{FilterOutlined:t8,MinusSquareOutlined:w8,PivotFilter:Fx},setup(i,{expose:t}){const e=S.ref();let n;const o=S.ref([]),r=S.computed(()=>{var F;return(F=S.unref(o)[S.unref(o).length-1])==null?void 0:F.key}),s=S.ref([]),l=S.ref(!1),a=S.ref(),h=S.ref({});let d={};const u=S.reactive({position:"absolute",top:"0",left:"0"});let c="",g;function f(){s.value=[],o.value=[],d={};const{dimensionData:F,xLabel:P}=i.data,L=F[P].map(k=>k.value);m(P,L),S.unref(o).push({key:P,drillValue:"",xAxisData:L}),v()}let p=[];S.onMounted(()=>{n=cA.init(e.value),w()});function m(F,P){const{yLabel:L,records:k}=i.data;let I=[];P.forEach(()=>{I.push(0)}),k.forEach(E=>{if(E[L]!==void 0){const z=P.indexOf(E[F]);if(z>-1){let O=!0;S.unref(o).forEach(W=>{W.drillValue&&E[W.key]!==W.drillValue&&(O=!1)});const N=Number(E[L]);O&&!isNaN(N)&&(I[z]+=Number(N))}}}),I=I.map(E=>E.toFixed(2)),g={tooltip:{},xAxis:{data:P},yAxis:{},series:[{name:L,type:"bar",label:{show:!0,position:"top"},data:I}]},p=I,n.setOption(g)}function v(){const F=Object.keys(i.data.dimensionData),P=S.unref(o).map(k=>k.key),L=[];F.forEach(k=>{P.includes(k)||L.push(k)}),s.value=L}function b(){c="",l.value=!1}function w(){n.on("contextmenu",function(F){const{event:{event:P},name:L}=F;c=L,P.preventDefault(),u.left=P.offsetX+90+"px",u.top=P.offsetY+80+"px",l.value=!0}),document.addEventListener("click",b)}function y(F){const P=[],{records:L}=i.data;for(const k of L){let I=!0;for(const E of S.unref(o))E.drillValue&&k[E.key]!==E.drillValue&&(I=!1);I&&!P.includes(k[F])&&P.push(k[F])}return P}function C(F){S.unref(o)[S.unref(o).length-1].drillValue=c;const P=y(F);m(F,P),S.unref(o).push({key:F,drillValue:"",xAxisData:P}),v()}function _(F,P){S.unref(o).splice(F+1,S.unref(o).length-F-1),S.unref(o)[F].drillValue="";const L=y(P);m(P,L),B(),v()}function A(F,P){const L=g.series[0].data,k=g.xAxis.data,I=L.map((z,O)=>({value:z,label:k[O]}));let E;P==="asc"?F==="dimension"?E=I.sort((z,O)=>z.label.localeCompare(O.label)):E=I.sort((z,O)=>z.value-O.value):P==="desc"&&(F==="dimension"?E=I.sort((z,O)=>O.label.localeCompare(z.label)):E=I.sort((z,O)=>O.value-z.value)),g.series[0].data=E.map(z=>z.value),g.xAxis.data=E.map(z=>z.label),n.setOption(g)}function R(F){if(F==="dimension"){const P=y(S.unref(r));m(S.unref(r),P),B()}else d={},B()}function x(F){if(F==="dimension"){const P=S.unref(o)[S.unref(o).length-1].xAxisData.map(L=>({value:L}));h.value={fieldName:S.unref(r),key:S.unref(r),type:F,filterData:g.xAxis.data,valueList:P}}else F==="indicators"&&(h.value={fieldName:i.data.yLabel,key:i.data.yLabel,type:"indicators",filterData:d});S.nextTick(()=>{a.value.show()})}function T({checkKeys:F,type:P}){P==="dimension"?m(S.unref(r),F):P==="indicators"&&(d=F,B())}function B(){const F=S.unref(o)[S.unref(o).length-1].xAxisData;let P=p.map((L,k)=>({value:L,label:F[k]}));P=P.filter(L=>M(L.value)),g.series[0].data=P.map(L=>L.value),g.xAxis.data=P.map(L=>L.label),n.setOption(g)}function M(F){let P=!1,{rule:L,value:k}=d;switch(k=Number(k),L){case"LESS":P=F<k;break;case"GREATER":P=F>k;break;case"EQUAL":P=F===k;break;case"NOT_EQUAL":P=F!==k;break;default:P=!0;break}return P}S.onBeforeUnmount(()=>{document.removeEventListener("click",b)}),t({init:f});const H=S.computed(()=>i.theme==="darkBlue"?"#b2c3dd":"");return{echartRef:e,dropdownList:s,isShowMenu:l,curXLabel:r,menuStyle:u,drillDimension:C,dimensionMap:o,deleteDimension:_,handleSort:A,handleClear:R,handleFilter:x,pivotFilterRef:a,filterData:h,onFilterChange:T,fontColor:H}}}),H9={style:{display:"flex",height:"400px"}},E9={style:{flex:"0 0 200px"}},L9={style:{flex:"0 0 650px",height:"100%"}},k9={key:0,style:{display:"flex","align-items":"center"}},F9={key:0,class:"dimension-item"},I9={key:1,style:{height:"30px"}},z9={style:{width:"100%",height:"100%"},ref:"echartRef"},O9=["onClick"];function D9(i,t,e,n,o,r){const s=S.resolveComponent("filter-outlined"),l=S.resolveComponent("a-menu-item"),a=S.resolveComponent("a-menu"),h=S.resolveComponent("a-dropdown"),d=S.resolveComponent("minus-square-outlined"),u=S.resolveComponent("pivot-filter");return S.openBlock(),S.createElementBlock(S.Fragment,null,[S.createElementVNode("div",H9,[S.createElementVNode("div",E9,[S.createElementVNode("div",{style:S.normalizeStyle({color:i.fontColor})},[S.createTextVNode(" 横轴:"+S.toDisplayString(i.curXLabel)+" ",1),S.createVNode(h,null,{overlay:S.withCtx(()=>[S.createVNode(a,null,{default:S.withCtx(()=>[S.createVNode(l,{key:"asc",onClick:t[0]||(t[0]=c=>i.handleSort("dimension","asc"))},{default:S.withCtx(()=>t[8]||(t[8]=[S.createTextVNode("升序")])),_:1}),S.createVNode(l,{key:"desc",onClick:t[1]||(t[1]=c=>i.handleSort("dimension","desc"))},{default:S.withCtx(()=>t[9]||(t[9]=[S.createTextVNode("降序")])),_:1}),S.createVNode(l,{key:"filter",onClick:t[2]||(t[2]=c=>i.handleFilter("dimension"))},{default:S.withCtx(()=>t[10]||(t[10]=[S.createTextVNode("筛选")])),_:1}),S.createVNode(l,{key:"clear",onClick:t[3]||(t[3]=c=>i.handleClear("dimension"))},{default:S.withCtx(()=>t[11]||(t[11]=[S.createTextVNode("清除")])),_:1})]),_:1})]),default:S.withCtx(()=>[S.createVNode(s,{class:"filter-icon",style:S.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4),S.createElementVNode("div",{style:S.normalizeStyle({color:i.fontColor})},[S.createTextVNode(" 纵轴:"+S.toDisplayString(i.data.yLabel)+" ",1),S.createVNode(h,null,{overlay:S.withCtx(()=>[S.createVNode(a,null,{default:S.withCtx(()=>[S.createVNode(l,{key:"asc",onClick:t[4]||(t[4]=c=>i.handleSort("indicators","asc"))},{default:S.withCtx(()=>t[12]||(t[12]=[S.createTextVNode("升序")])),_:1}),S.createVNode(l,{key:"desc",onClick:t[5]||(t[5]=c=>i.handleSort("indicators","desc"))},{default:S.withCtx(()=>t[13]||(t[13]=[S.createTextVNode("降序")])),_:1}),S.createVNode(l,{key:"filter",onClick:t[6]||(t[6]=c=>i.handleFilter("indicators"))},{default:S.withCtx(()=>t[14]||(t[14]=[S.createTextVNode("筛选")])),_:1}),S.createVNode(l,{key:"clear",onClick:t[7]||(t[7]=c=>i.handleClear("indicators"))},{default:S.withCtx(()=>t[15]||(t[15]=[S.createTextVNode("清除")])),_:1})]),_:1})]),default:S.withCtx(()=>[S.createVNode(s,{class:"filter-icon",style:S.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4)]),S.createElementVNode("div",L9,[i.dimensionMap.length>1?(S.openBlock(),S.createElementBlock("div",k9,[S.createElementVNode("span",{style:S.normalizeStyle({color:i.fontColor})},"钻取维度:",4),(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.dimensionMap,(c,g)=>(S.openBlock(),S.createElementBlock(S.Fragment,{key:g},[c.drillValue?(S.openBlock(),S.createElementBlock("div",F9,[S.createVNode(d,{class:"dimension-icon",onClick:f=>i.deleteDimension(g,c.key)},null,8,["onClick"]),S.createTextVNode(S.toDisplayString(c.key)+"("+S.toDisplayString(c.drillValue)+") ",1)])):S.createCommentVNode("",!0)],64))),128))])):(S.openBlock(),S.createElementBlock("div",I9)),S.createElementVNode("div",z9,null,512)]),S.withDirectives(S.createElementVNode("div",{style:S.normalizeStyle(i.menuStyle),class:"dropdown-menu"},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.dropdownList,c=>(S.openBlock(),S.createElementBlock("div",{class:"item",key:c,onClick:g=>i.drillDimension(c)},"下钻"+S.toDisplayString(c),9,O9))),128))],4),[[S.vShow,i.isShowMenu]])]),S.createVNode(u,{ref:"pivotFilterRef",theme:i.theme,data:i.filterData,onChange:i.onFilterChange},null,8,["theme","data","onChange"])],64)}const W9=Mi(P9,[["render",D9],["__scopeId","data-v-fd1263c8"]]),N9=S.defineComponent({components:{PivotChart:W9},name:"ChartModal",props:{theme:{type:String,default:"light"}},setup(i,{expose:t}){const e=S.ref(!1),n=S.ref({}),o=S.ref();function r(s){n.value=s,e.value=!0,S.nextTick(()=>{o.value.init()})}return t({showModal:r}),{visible:e,chartOptions:n,chartRef:o}}});function V9(i,t,e,n,o,r){const s=S.resolveComponent("pivot-chart"),l=S.resolveComponent("a-modal");return S.openBlock(),S.createBlock(l,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[0]||(t[0]=a=>i.visible=a),"ok-text":"确认","cancel-text":"取消",title:"图形",style:{width:"900px"},destroyOnClose:!0,onOk:t[1]||(t[1]=a=>i.visible=!1)},{default:S.withCtx(()=>[S.createVNode(s,{data:i.chartOptions,theme:i.theme,ref:"chartRef"},null,8,["data","theme"])]),_:1},8,["wrapClassName","visible"])}const j9=Mi(N9,[["render",V9]]),G9=S.defineComponent({name:"PivotAggregate",props:{theme:{type:String,default:"light"}},setup(i,{emit:t,expose:e}){const n=S.ref(!1),o=S.ref([]),r=S.ref(""),s=[{label:"合计",value:"SUM"},{label:"平均值",value:"AVG"},{label:"计数",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"方差",value:"VAR"},{label:"标准差",value:"STDEV"}];function l(){t("confirm",S.unref(o),r.value),n.value=!1}function a(d,u){o.value=co.cloneDeep(d),r.value=u,n.value=!0}const h=()=>document.getElementsByClassName("aggregate-modal")[0]||document.body;return e({showModal:a}),{visible:n,aggregationType:o,options:s,handleOk:l,getPopupContainer:h}}});function U9(i,t,e,n,o,r){const s=S.resolveComponent("a-select"),l=S.resolveComponent("a-form-item"),a=S.resolveComponent("a-form"),h=S.resolveComponent("a-modal");return S.openBlock(),S.createBlock(h,{wrapClassName:i.theme+" aggregate-modal",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:"聚合",destroyOnClose:!0,maskClosable:!1,onOk:i.handleOk,onCancel:t[2]||(t[2]=d=>i.visible=!1)},{default:S.withCtx(()=>[S.createVNode(a,null,{default:S.withCtx(()=>[S.createVNode(l,{label:"聚合方式"},{default:S.withCtx(()=>[S.createVNode(s,{value:i.aggregationType,"onUpdate:value":t[0]||(t[0]=d=>i.aggregationType=d),allowClear:"",options:i.options,mode:"multiple",getPopupContainer:i.getPopupContainer},null,8,["value","options","getPopupContainer"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","onOk"])}const $9=Mi(G9,[["render",U9]]),K9=S.defineComponent({name:"PivotTop",props:{theme:{type:String,default:"light"}},setup(i,{emit:t,expose:e}){const n=S.ref(!1),o=S.ref(""),r=S.ref("");function s(){t("confirm",{value:S.unref(o),key:S.unref(r)}),n.value=!1}function l(a){const{value:h,key:d}=a;o.value=h,n.value=!0,r.value=d}return e({showModal:l}),{visible:n,topNum:o,handleOk:s}}});function Y9(i,t,e,n,o,r){const s=S.resolveComponent("a-input"),l=S.resolveComponent("a-form-item"),a=S.resolveComponent("a-form"),h=S.resolveComponent("a-modal");return S.openBlock(),S.createBlock(h,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:"维度取Top",destroyOnClose:!0,onOk:i.handleOk},{default:S.withCtx(()=>[S.createVNode(a,null,{default:S.withCtx(()=>[S.createVNode(l,{label:"维度取Top"},{default:S.withCtx(()=>[S.createVNode(s,{value:i.topNum,"onUpdate:value":t[0]||(t[0]=d=>i.topNum=d),type:"number",style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","onOk"])}const X9=Mi(K9,[["render",Y9]]),q9=(i,t)=>{i.register.icon("sortDown",{name:"sortDown",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:15,visibleTime:"always",height:15,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:20,height:20,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"取消排序",placement:"top"}}),i.register.icon("sortUp",{name:"sortUp",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:15,visibleTime:"always",height:15,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:20,height:20,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击降序",placement:"top"}}),i.register.icon("sortNormal",{name:"sortNormal",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:15,visibleTime:"always",height:15,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:20,height:20,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击升序",placement:"top"}})};let Z9=(i=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(i));for(;i--;){let n=e[i]&63;n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n<63?t+="_":t+="-"}return t};const J9=S.defineComponent({props:{node:{type:[Object,String],required:!0}},render(){return this.node}}),Q9=((sA=window==null?void 0:window.config)==null?void 0:sA.indicatorURL)||"",vm=dA.create({baseURL:"/",validateStatus(i){return i===200},timeout:1e3*15});vm.interceptors.request.use(i=>i,i=>Promise.reject(i)),vm.interceptors.response.use(i=>{var t,e;return+((t=i==null?void 0:i.data)==null?void 0:t.code)==500&&Kn.message.error({content:((e=i==null?void 0:i.data)==null?void 0:e.msg)||"服务器异常",key:"SERVER_ERROR"}),i},i=>{if(i.message.includes("timeout"))Kn.message.error({content:"网络连接超时,请重试!",key:"TIMEOUT"});else{const{status:t}=i.response;t===401?Kn.message.error({content:"当前用户信息不正确",key:"REQUEST_ERROR"}):t>=500?Kn.message.error({content:"服务器异常",key:"REQUEST_ERROR"}):Kn.message.error({content:"请求异常",key:"REQUEST_ERROR"})}return Promise.reject(i)});const t7=S.defineComponent({name:"IndSourceList",components:{CaretRightOutlined:$N,CaretDownOutlined:VN,LoadingOutlined:p8,Draggable:Lm,ATooltip:Kn.Tooltip},props:{data:{type:Array,default:()=>[]},source:{type:String,default:""},isSub:{type:Boolean,default:!1},hasChildren:{type:Boolean,default:!1},pageId:{type:String,default:""}},setup(i,{emit:t,expose:e}){var y;const n=(y=window==null?void 0:window.config)==null?void 0:y.indicatorToken,o=S.inject("setItemDisabled",C=>!1),r=S.ref([]),s=S.ref(),l=S.reactive({pageSize:20,currentPage:1,totalResult:0}),a=S.ref(!1),h=S.ref(""),d=S.ref(!1);S.watch(()=>i.data,C=>{i.isSub&&(C==null||C.forEach(_=>{var A;_!=null&&_.isLeaf||(A=_.dataViewColumns)==null||A.forEach(R=>{R.show=!0,R.edit=!1,R.title&&(R.label=R.title)})}),r.value=C)},{deep:!0,immediate:!0});const u=()=>{var C;i.isSub||(C=S.unref(s))==null||C.removeEventListener("scroll",v)},c=async C=>{var A;if(S.unref(a))return;a.value=!0;const _={source:"INDICATOR_LIB",pageId:i.pageId,dataSourceId:"",indexName:h.value};C?(C.loading=!0,_.indexTypeGuid=C.indexTypeGuid,_.isLeaf=C.isLeaf):l&&(_.queryRequest={pageSize:l.pageSize,pageNum:l.currentPage});try{const R=await vm.post(`${Q9}/diagram/sourceList`,_,{headers:{Authentication:n,operateContext:"ygt"}}),{success:x,data:T={}}=R.data;if(x){const{rows:B=[],total:M=0}=T;B==null||B.forEach(H=>{var F;(C==null?void 0:C.isLeaf)==="1"?(F=H.dataViewColumns)==null||F.forEach(P=>{P.show=!0,P.edit=!1,P.title&&(P.label=P.title)}):H.show=!1}),C?(C.children=B,C.show=!0,B!=null&&B.length||(C.noData=!0)):(r.value=S.unref(r).concat(B),l.totalResult=+M,((A=S.unref(r))==null?void 0:A.length)>=M&&u())}C&&(C.loading=!1),a.value=!1}catch{C&&(C.loading=!1),a.value=!1}},g=async C=>{const _=r.value[C],{children:A=[]}=_;A!=null&&A.length?_.show=!_.show:!_.noData&&_.isLeaf?c(_):_.noData&&(_.show=!_.show)},f=(C,_)=>{t("onDragStart",C,_)},p=()=>{t("onDragEnd")},m=C=>{C.show=!C.show},v=C=>{C.target.scrollTop+C.target.clientHeight+20>=C.target.scrollHeight&&(l.currentPage++,c())},b=async()=>{await c(),S.nextTick(async()=>{S.unref(s).scrollHeight===S.unref(s).clientHeight&&l.totalResult>S.unref(r).length&&(l.currentPage++,b())})},w=async C=>{var _;u(),d.value=!0,l.currentPage=1,l.totalResult=0,r.value=[],h.value=C,await b(),d.value=!1,(_=S.unref(s))==null||_.addEventListener("scroll",v)};return S.onMounted(async()=>{var C;i.isSub||(b(),(C=S.unref(s))==null||C.addEventListener("scroll",v))}),S.onUnmounted(()=>{u()}),e({handleSearch:w}),{columnRef:s,sourceList:r,searchLoading:d,onToggleGroup:g,onToggleSource:m,setItemDisabled:o,onDragStart:f,onDragEnd:p,mapDataSetScope:vA,mapScope:mA,getLoadType:bA,getUseType:CA,getSourceType:yA}}}),uj="",e7={key:0,class:"no-data"},i7={class:"column-item"},n7=["onClick"],o7={key:3,class:"item-name"},r7={key:0},s7={class:"column-item"},l7={key:0},a7={key:1},h7={key:2},d7=["onClick"],u7={class:"column-child-item"},c7={class:"field"},g7={class:"column-child-item-name"};function f7(i,t,e,n,o,r){const s=S.resolveComponent("loading-outlined"),l=S.resolveComponent("caret-down-outlined"),a=S.resolveComponent("caret-right-outlined"),h=S.resolveComponent("ind-source-list",!0),d=S.resolveComponent("a-tooltip"),u=S.resolveComponent("draggable"),c=S.resolveComponent("a-spin");return S.openBlock(),S.createElementBlock("div",{class:S.normalizeClass(["columns",i.isSub?"sub-columns":""]),ref:"columnRef"},[S.createVNode(c,{spinning:i.searchLoading,tip:"数据源加载中..."},{default:S.withCtx(()=>{var g;return[!((g=i.sourceList)!=null&&g.length)&&!i.searchLoading?(S.openBlock(),S.createElementBlock("div",e7,"暂无数据")):i.hasChildren?(S.openBlock(!0),S.createElementBlock(S.Fragment,{key:1},S.renderList(i.sourceList,(f,p)=>(S.openBlock(),S.createElementBlock("div",{key:f.indexTypeGuid||f.id},[S.createElementVNode("div",i7,[S.createElementVNode("span",{style:{cursor:"pointer"},onClick:m=>i.onToggleGroup(p)},[f.loading?(S.openBlock(),S.createBlock(s,{key:0})):f.show?(S.openBlock(),S.createBlock(l,{key:1})):(S.openBlock(),S.createBlock(a,{key:2})),f.isLeaf?(S.openBlock(),S.createElementBlock("span",o7,S.toDisplayString(f.indexTypeCode+"."+f.indexTypeName),1)):S.createCommentVNode("",!0)],8,n7)]),f.show?(S.openBlock(),S.createElementBlock("div",r7,[S.createVNode(h,{data:f.children,isSub:!0,hasChildren:f.isLeaf==="0",pageId:i.pageId,source:"INDICATOR_LIB",onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd},null,8,["data","hasChildren","pageId","onOnDragStart","onOnDragEnd"])])):S.createCommentVNode("",!0)]))),128)):(S.openBlock(!0),S.createElementBlock(S.Fragment,{key:2},S.renderList(i.sourceList,f=>(S.openBlock(),S.createElementBlock("div",{key:f.id,class:S.normalizeClass(i.setItemDisabled(f.dataViewColumns)?"column-disabled":"")},[S.createElementVNode("div",s7,[S.createVNode(d,null,{title:S.withCtx(()=>[S.createElementVNode("div",null,"加载类型:"+S.toDisplayString(i.getLoadType(f.loadType)),1),f.useType?(S.openBlock(),S.createElementBlock("div",l7,"数据使用系统:"+S.toDisplayString(i.getUseType(f.useType)),1)):S.createCommentVNode("",!0),f.systemSource?(S.openBlock(),S.createElementBlock("div",a7,"制度出处:"+S.toDisplayString(f.systemSource),1)):S.createCommentVNode("",!0),f.dataTo?(S.openBlock(),S.createElementBlock("div",h7,"数据来源:"+S.toDisplayString(i.getSourceType(f.dataTo)),1)):S.createCommentVNode("",!0)]),default:S.withCtx(()=>[S.createElementVNode("span",{style:{cursor:"pointer"},onClick:p=>i.onToggleSource(f)},[f.show?(S.openBlock(),S.createBlock(l,{key:0})):(S.openBlock(),S.createBlock(a,{key:1})),S.createTextVNode(" "+S.toDisplayString((f.indexCode?f.indexCode:"")+" "+f.name),1)],8,d7)]),_:2},1024)]),f.show?(S.openBlock(),S.createBlock(u,{key:0,modelValue:f.dataViewColumns,"onUpdate:modelValue":p=>f.dataViewColumns=p,group:{name:"diGroup",pull:"clone",put:!1},"item-key":"id",sort:!1,disabled:i.setItemDisabled(f.dataViewColumns),onStart:p=>i.onDragStart(p,f),onEnd:i.onDragEnd},{item:S.withCtx(({element:p})=>[S.createElementVNode("div",u7,[S.createElementVNode("span",c7," 【"+S.toDisplayString(p.scope==="FIELD"?i.mapDataSetScope(p.genericType):i.mapScope(p.scope))+"】 ",1),S.createElementVNode("span",g7,S.toDisplayString(p.label),1)])]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onStart","onEnd"])):S.createCommentVNode("",!0)],2))),128))]}),_:1},8,["spinning"])],2)}const p7=Mi(t7,[["render",f7],["__scopeId","data-v-b4ff36e0"]]),m7={mounted(i){i.focus()}},v7=S.defineComponent({name:"PivotConfig",directives:{focus:m7},props:{theme:{type:String,default:"light"},fullMode:{type:Boolean,default:!1},pageId:{type:String,default:""}},components:{VNodeRender:J9,draggable:Lm,IndSourceList:p7,DeleteOutlined:qN},setup(i,{emit:t,expose:e}){const n=S.ref(!1),o=S.ref([]),r=S.ref(""),s=S.ref(),l=S.ref([]),a=S.ref([{title:"行维度",icon:S.createVNode(u8),fields:[]},{title:"列维度",icon:S.createVNode(l8),fields:[]},{title:"指标",icon:S.createVNode(L8),fields:[]}]),h=(A=[],R=[])=>{for(const x of S.unref(a))x.fields=[];for(const x of A)x.positionType==="rows"?S.unref(a)[0].fields.push(co.cloneDeep(x)):x.positionType==="columns"&&S.unref(a)[1].fields.push(co.cloneDeep(x));S.unref(a)[2].fields=co.cloneDeep(R),n.value=!0},d=S.computed(()=>[...S.unref(a)[0].fields.map(A=>({...A,positionType:"rows"})),...S.unref(a)[1].fields.map(A=>({...A,positionType:"columns"}))]),u=S.computed(()=>S.unref(a)[2].fields),c=()=>{l.value=[],t("confirm",S.unref(d),S.unref(u)),n.value=!1},g=(A,R)=>{const x=R.dataViewColumns[A.oldIndex]||{},{scope:T}=x;["IDX","BUILT_IN_IDX"].includes(T)?l.value=[0,1]:["DIM","BUILT_IN_DIM"].includes(T)&&(l.value=[2])},f=(A,R)=>{const x=R[A.oldIndex],{scope:T}=x;["IDX","BUILT_IN_IDX"].includes(T)?l.value=[0,1]:["DIM","BUILT_IN_DIM"].includes(T)&&(l.value=[2])},p=()=>{l.value=[]},m=()=>{a.value=co.cloneDeep(S.unref(a))},v=()=>{var A;(A=S.unref(s))==null||A.handleSearch(S.unref(r))},b=(A=[])=>{let R=!1;for(const x of S.unref(d))if(!A.find(B=>B.typeGuid===x.typeGuid)){R=!0;break}return R},w=(A,R)=>{S.unref(a)[A].fields.splice(R,1)},y=S.ref(),C=(A,R)=>{i.fullMode&&(y.value=`${A}_${R}`)},_=()=>{y.value=""};return S.provide("setItemDisabled",b),e({showModal:h}),{visible:n,fieldAreas:a,dataSourceList:o,indSourceRef:s,searchText:r,maskList:l,currentEditItem:y,handleOk:c,onSearch:v,onDragStart:g,onDragAreaStart:f,onDragEnd:p,handleDeleteField:w,handleEdit:C,onConfirmLabel:_,onDragAdd:m}}}),cj="",b7={key:0,class:"data-source-list"},C7={class:"area-title"},y7={class:"field-item"},_7=["onClick"];function w7(i,t,e,n,o,r){const s=S.resolveComponent("a-input-search"),l=S.resolveComponent("ind-source-list"),a=S.resolveComponent("v-node-render"),h=S.resolveComponent("a-input"),d=S.resolveComponent("delete-outlined"),u=S.resolveComponent("draggable"),c=S.resolveComponent("a-button"),g=S.resolveComponent("a-modal"),f=S.resolveDirective("focus");return S.openBlock(),S.createBlock(g,{wrapClassName:i.theme,title:"设置",visible:i.visible,"onUpdate:visible":t[2]||(t[2]=p=>i.visible=p),"ok-text":"确认","cancel-text":"取消",maskClosable:!1,destroyOnClose:!1,style:S.normalizeStyle({width:i.fullMode?"900px":"500px"}),bodyStyle:{padding:0},onOk:i.handleOk},{footer:S.withCtx(()=>[S.createVNode(c,{onClick:t[1]||(t[1]=p=>i.visible=!1)},{default:S.withCtx(()=>t[3]||(t[3]=[S.createTextVNode("取消")])),_:1}),S.createVNode(c,{type:"primary",onClick:i.handleOk},{default:S.withCtx(()=>t[4]||(t[4]=[S.createTextVNode("确定")])),_:1},8,["onClick"])]),default:S.withCtx(()=>[S.createElementVNode("div",{class:"config-wrap",style:S.normalizeStyle({height:i.fullMode?"350px":""})},[i.fullMode?(S.openBlock(),S.createElementBlock("div",b7,[S.createVNode(s,{value:i.searchText,"onUpdate:value":t[0]||(t[0]=p=>i.searchText=p),placeholder:"请输入关键字",style:{width:"90%"},onSearch:i.onSearch},null,8,["value","onSearch"]),S.createVNode(l,{ref:"indSourceRef",data:i.dataSourceList,hasChildren:!0,isSub:!1,pageId:i.pageId,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd,source:"INDICATOR_LIB"},null,8,["data","pageId","onOnDragStart","onOnDragEnd"])])):S.createCommentVNode("",!0),S.createElementVNode("div",{class:"area-content",style:S.normalizeStyle({width:i.fullMode?"60%":"100%"})},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.fieldAreas,(p,m)=>(S.openBlock(),S.createElementBlock("div",{class:"area-item",key:m},[S.createElementVNode("div",C7,[S.createVNode(a,{class:"area-icon",node:p.icon},null,8,["node"]),S.createTextVNode(" "+S.toDisplayString(p.title),1)]),S.createVNode(u,{class:"area-list",list:p.fields,"item-key":"index",group:{name:"diGroup"},disabled:i.maskList.includes(m),onStart:v=>i.onDragAreaStart(v,p.fields),onEnd:i.onDragEnd,onAdd:i.onDragAdd},{item:S.withCtx(({index:v,element:b})=>[S.createElementVNode("div",y7,[i.currentEditItem===`${m}_${v}`?S.withDirectives((S.openBlock(),S.createBlock(h,{key:0,size:"small",value:b.label,"onUpdate:value":w=>b.label=w,onPressEnter:i.onConfirmLabel,onBlur:i.onConfirmLabel},null,8,["value","onUpdate:value","onPressEnter","onBlur"])),[[f]]):(S.openBlock(),S.createElementBlock("div",{key:1,style:{width:"100%"},onClick:w=>i.handleEdit(m,v)},S.toDisplayString(b.label),9,_7)),i.fullMode?(S.openBlock(),S.createBlock(d,{key:2,style:{color:"red","padding-left":"8px"},onClick:w=>i.handleDeleteField(m,v)},null,8,["onClick"])):S.createCommentVNode("",!0)])]),_:2},1032,["list","disabled","onStart","onEnd","onAdd"])]))),128))],4)],4)]),_:1},8,["wrapClassName","visible","style","onOk"])}const S7=Mi(v7,[["render",w7],["__scopeId","data-v-5d2307d6"]]),bm=S.defineComponent({name:"PivotTable",components:{PivotFilter:Fx,PivotProperty:Y5,ConditionalProperty:M9,ChartModal:j9,PivotAggregate:$9,PivotTop:X9,PivotConfig:S7,SettingOutlined:M8},props:{id:{type:String,default:""},name:{type:String,default:""},keyName:{type:String,default:""},type:{type:String,default:""},width:{type:String,default:""},height:{type:String,default:""},position:{type:String,default:""},top:{type:String,default:""},left:{type:String,default:""},zIndex:{type:Number,default:1},events:{type:Array,default:()=>[]},dataType:{type:String,default:""},graphicConfig:{type:Object,default:()=>({})},data:{type:Array,default:()=>[]},scale:{type:Number,default:0},dimensionList:{type:Array,default:()=>[]},indicatorList:{type:Array,default:()=>[]},pageMode:{type:String,default:""},calculateList:{type:Array,default:()=>[]},styleConfig:{type:Object,default:()=>({})},theme:{type:String,default:"light"},fullMode:{type:Boolean,default:!1},pageId:{type:String,default:""},indicatorUrl:{type:String,default:""}},setup(i,{expose:t,emit:e}){let n=null;const o=S.ref(!1),r=S.ref(""),s=S.ref({}),l=S.ref(),a=S.ref({}),h=S.ref({}),d=S.ref(),u=S.ref(),c=S.ref({}),g=S.ref(),f=S.ref(),p=S.ref(),m=S.ref(),v=S.ref(),b=S.ref(),w=S.ref(),y=S.ref(!1),C=S.ref({}),_=S.ref({}),A=S.ref({}),R=S.ref(),x=S.ref([]),T=S.ref({}),B=S.ref("200px"),M=S.ref("200px");S.provide("indicatorUrl",i.indicatorUrl);const H={LAST_DATA:"上期值",SAME_DATA:"同期值",DIFF_DATA:"增减额",MOM_DATA:"环比(%)",YOY_DATA:"同比(%)"},F=[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"图形",menuKey:"graph"},{text:"筛选",menuKey:"filter"}],P=["合计","平均值","计数","最大值","最小值","方差","标准差"],L=`|${Z9(6)}|`,k=S.computed(()=>{const K={},{styleConfig:Q}=i;for(const rt in Q)K[rt]=Q[rt]||"transparent";return K}),I=S.ref([]),E=S.ref([]),z=S.computed(()=>{var K;return(K=S.unref(k))==null?void 0:K.dropDownMenuBgColor}),O=S.computed(()=>{var K;return(K=S.unref(k))==null?void 0:K.dropDownMenuColor}),N=S.computed(()=>{var K;return(K=S.unref(k))==null?void 0:K.dropDownMenuHightLightColor});q9(z5,{sortNotActiveColor:S.unref(k).sortNotActiveColor,sortActiveColor:S.unref(k).sortActiveColor});const W=S.ref([]),j=S.ref({}),G=S.ref({}),V=S.reactive({records:[],columnHeaderTitle:!0,excelOptions:{fillHandle:!0},rows:[],columns:[],indicators:[],corner:{titleOnDimension:"row"},dataConfig:{sortRules:[],filterRules:[]},widthMode:"standard",menu:{renderMode:"html",dropDownMenuHighlight:[]},theme:{cellInnerBorder:!1,underlayBackgroundColor:"transparent",headerStyle:{bgColor(K){return S.unref(W).includes(K.dataValue)?S.unref(k).indicatorsHeaderBgColor:S.unref(k).headerBgColor},color(K){return S.unref(W).includes(K.dataValue)?S.unref(k).indicatorsHeaderColor:S.unref(k).headerColor},borderColor:S.unref(k).borderColor},cornerHeaderStyle:{bgColor:S.unref(k).headerBgColor,color:S.unref(k).headerColor,borderColor:S.unref(k).borderColor},bodyStyle:{borderColor:S.unref(k).borderColor,color(K){var st,vt;const Q=K.cellHeaderPaths.rowHeaderPaths,rt=K.cellHeaderPaths.colHeaderPaths;return P.includes((st=Q==null?void 0:Q[Q.length-1])==null?void 0:st.value)?S.unref(k).aggregateColor:S.unref(W).includes((vt=rt==null?void 0:rt[rt.length-1])==null?void 0:vt.value)?S.unref(k).indicatorsBodyColor:S.unref(k).bodyColor},bgColor(K){var st,vt;const Q=K.cellHeaderPaths.rowHeaderPaths,rt=K.cellHeaderPaths.colHeaderPaths;return P.includes((st=Q==null?void 0:Q[Q.length-1])==null?void 0:st.value)?S.unref(k).aggregateBgColor:S.unref(W).includes((vt=rt==null?void 0:rt[rt.length-1])==null?void 0:vt.value)?S.unref(k).indicatorsBodyBgColor:S.unref(k).bodyBgColor}},rowHeaderStyle:{borderColor:S.unref(k).borderColor,bgColor(K){return P.includes(K.dataValue)?S.unref(k).aggregateBgColor:S.unref(k).bodyBgColor},color(K){return P.includes(K.dataValue)?S.unref(k).aggregateColor:S.unref(k).bodyColor}}}}),$=S.ref([]),U=S.ref({}),tt=S.ref({});S.watch(y,K=>{if(K){const Q={},rt=Cm();rt&&(Q.width=rt.width+"px",Q.height=rt.height+"px",Q.top=rt.top+"px",Q.left=rt.left+"px"),U.value=Q}});function ot(K,Q=!0,rt=-1){if(rt>-1)V.indicators.splice(rt,0,...K);else for(const st of K)V.indicators.push(st);Q&&n.updateOption(V)}function ut({label:K,calcType:Q}){const rt=[],st=S.unref(G)[K]||[];for(const vt in H)st.indexOf(vt)===-1&&rt.push({text:H[vt],menuKey:vt});return Q==="FORMULA"||!(rt!=null&&rt.length)?F:[{text:"计算",menuKey:"calculate",children:rt},...F]}function pt(){const K=[{text:"钻取",menuKey:"drill"},{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"筛选",menuKey:"filter"},{text:"聚合",menuKey:"aggregate"},{text:"取top",menuKey:"top"},{text:"删除",menuKey:"delete"}],Q=[],rt=S.unref($).filter(st=>S.unref(x).includes(st));if(rt!=null&&rt.length)for(const st of rt)Q.push({text:st,menuKey:st});return Q!=null&&Q.length?K[0].children=Q:K.splice(0,1),K}function Y(K,Q){y.value=!0,S.unref(T)[Q]=K||[],e("tableChange",{type:"9",data:S.unref(T)})}function q(K,Q=!0){var rt;for(const st of K){const{key:vt,name:Et,type:gt,dimensionKey:It,width:$t}=st;if(S.unref(x).includes(vt))continue;let Ce;if(It)Ce=st;else{const Te={dimensionKey:vt,title:Et,width:$t?`${$t}%`:"auto",type:gt};gt==="columns"?Te.headerStyle={textStick:!0}:gt==="rows"&&(Te.cornerHeaderIcon="sortNormal"),Te.headerFormat=$i=>{const Hi=$i==null?void 0:$i.split(L);return Hi!=null&&Hi.length?Hi[Hi.length-1]:$i},Ce=Te}if(Ce&&(Ce.headerStyle={textStick:!0},V[gt].push(Ce)),(rt=V[gt])!=null&&rt.length)for(const Te of V[gt])Te.cornerDropDownMenu=pt();V.dataConfig.sortRules.push({sortField:vt,sortType:S.unref(r)})}Q&&n.updateOption(V),S.nextTick(()=>{ht()})}function dt(K){const Q={},{records:rt}=V;for(const st of rt)for(const vt of K)fA(Q,vt)?Q[vt].find(Et=>Et.value===st[vt])||Q[vt].push({value:st[vt]}):Q[vt]=[{value:st[vt]}];return Q}function ht(){console.log("tableInstance",n);const{dataset:{columns:K,rows:Q}}=n,rt=Q.concat(K);s.value=dt(rt)}const _t=S.ref(),Ct=K=>{var Hi;let Q=K;K?_t.value=co.cloneDeep(K):Q=co.cloneDeep(S.unref(_t)),y.value=!0;const{data:rt={}}=(Q==null?void 0:Q.data)||{},{rows:st=[]}=rt,{calculateList:vt}=i,Et=[],gt=[];for(const Rt of S.unref(I)){if(!Rt.show)continue;const Be=V[Rt.positionType].find(wi=>wi.dimensionKey===Rt.label);Be?gt.push(Be):(S.unref($).includes(Rt.label)||$.value.push(Rt.label),gt.push({key:Rt.label,name:Rt.label,type:Rt.positionType,width:Rt.width}))}for(const Rt of S.unref(E)){if(!Rt.show)continue;const Be=ut(Rt),wi=V.indicators.find(Ki=>Ki.indicatorKey===Rt.label);let ii={};wi?ii={...wi,dropDownMenu:Be}:ii={indicatorKey:Rt.label,title:Rt.label,width:Rt!=null&&Rt.width?`${Rt.width}%`:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},dropDownMenu:Be,format:(Ki,qr,Zr,B7)=>{const ym=B7.getRecordByCell(qr,Zr)||[];return ym[0]&&isNaN(+ym[0][Rt.label])?ym[0][Rt.label]:Ki}},ii&&(ii.style={padding:[16,28,16,28]},Et.push(ii))}if(V.indicators=[],V.rows=[],V.columns=[],vt!=null&&vt.length)for(const Rt of vt)isNaN(+Rt.position)||Et.splice(+Rt.position,0,{...Rt.data,calculateType:Rt.calculateType});const{sortType:It,col:$t,row:Ce}=S.unref(R)||{};for(const Rt of Et)Rt&&(Rt.headerIcon=Be=>{const{col:wi,row:ii}=Be;if($t===wi&&Ce===ii){let Ki="sortNormal";return It==="ASC"?Ki="sortUp":It==="DESC"&&(Ki="sortDown"),Ki}else return"sortNormal"});ot(Et,!1),q(gt,!1);const Te=[],$i=gt.filter(Rt=>Rt.type==="rows").map(Rt=>Rt.key||Rt.dimensionKey);for(const Rt of st)for(const Be in Rt)if(!P.includes(Rt[Be])){const wi=$i.indexOf(Be);if(wi!==-1){const ii=[];for(let Ki=0;Ki<=wi;Ki++){const qr=Rt[$i[Ki]];if(qr.includes(L)){const Zr=qr.split(L);Zr!=null&&Zr.length&&ii.push(Zr[Zr.length-1])}else ii.push(qr)}ii!=null&&ii.length&&(Rt[Be]=ii.join(L))}}for(const Rt of gt){const Be=(Rt==null?void 0:Rt.key)||(Rt==null?void 0:Rt.dimensionKey);if(Rt.type==="columns"&&!S.unref(A)[Be])S.unref(A)[Be]=St("",Be,st);else if(Rt.type==="rows")if(S.unref(_)[Be]){const{type:wi}=S.unref(_)[Be]||{};Te.push(St(wi,Be,st))}else if(!S.unref(R)||S.unref(R).sortField===Be||!n)Te.push(St("",Be,st));else{const wi=V.dataConfig.sortRules.find(ii=>ii.sortField===Be);wi&&Te.push(wi)}}if(S.unref(R)&&Te.push(S.unref(R)),(Hi=Object.keys(S.unref(A)))!=null&&Hi.length)for(const Rt in S.unref(A))Te.push(S.unref(A)[Rt]);if(V.records=st,V.dataConfig.sortRules=Te,n)n.updateOption(V),S.nextTick(()=>{var Rt;(Rt=V.records)!=null&&Rt.length||it(),wt()}),y.value=!1;else{const Rt=document.getElementById(`pivotTableContainer_${i.id}`);n=new Ex(Rt,V),S.nextTick(()=>{var Be;(Be=V.records)!=null&&Be.length||it(),o.value=!0,y.value=!1;for(const wi of gt){const{key:ii}=wi,Ki=new Set;for(const qr of st)Ki.add(qr[ii]);S.unref(a)[ii]=Array.from(Ki)}wt()}),xt()}console.log("option",V)};function wt(){const K=Cm();K&&(S.unref(tt).right=parseFloat(i.width)-K.width+2+"px")}function it(){if(n){const{dataset:{rows:K}}=n,Q={};for(const rt of K)Q[rt]="";n.updateOption({...V,dataConfig:{...V.dataConfig,filterRules:[]},records:[Q]})}}function At(K,Q){y.value=!0,e("tableChange",{type:"3",data:{type:"indicators",key:K,rule:Q}})}function nt(K,Q){y.value=!0,e("tableChange",{type:"3",data:{type:"dimension",key:K,rule:Q}})}function Ut(K,Q){const rt=V[Q].findIndex(vt=>vt.dimensionKey===K),st=V.dataConfig.sortRules.findIndex(vt=>vt.sortField===K);if(rt!==-1){V[Q].splice(rt,1);for(const vt of V[Q])vt.cornerDropDownMenu=pt();S.unref(x).includes(K)||S.unref(x).push(K),y.value=!0,e("tableChange",{type:"7"})}st!==-1&&(V.dataConfig.sortRules[st].sortType=r),n.updateOption(V),S.nextTick(()=>{ht(),delete a.value[K]})}function qt(K){const{indicators:Q}=V,rt=Q.findIndex(st=>st.indicatorKey===K);if(rt!==-1){const st=Q[rt];if(Q.splice(rt,1),st.calculateType){const vt=st.indicatorKey.split("@"+st.calculateType)[0],Et=S.unref(G)[vt].indexOf(st.calculateType);Et!==-1&&S.unref(G)[vt].splice(Et,1);const gt=S.unref(W).indexOf(st.title);gt!==-1&&S.unref(W).splice(gt,1),delete S.unref(j)[st.title]}e("tableChange",{type:"2",data:st.indicatorKey})}}function St(K,Q,rt){let st=[];const vt=new Set;for(const Et of rt){const gt=Et[Q];gt&&!P.includes(gt)&&vt.add(gt)}return st=Array.from(vt),K==="asc"?st=st.sort((Et,gt)=>Et.localeCompare(gt)):K==="desc"&&(st=st.sort((Et,gt)=>gt.localeCompare(Et))),{sortField:Q,sortBy:[...st,...P]}}function Wt(K,Q,rt,st){y.value=!0;let{menu:{dropDownMenuHighlight:vt},rows:Et}=V;st=st+1,vt=vt.filter(It=>!(It.type==="dimension"&&It.field===Q)||It.type==="indicator"),vt.push({col:rt,row:st-1,field:Q,type:"dimension",menuKey:K}),V.menu.dropDownMenuHighlight=vt;const gt=Et.find(It=>It.dimensionKey===Q);if(gt){let It="sortNormal";K==="asc"?It="sortUp":K==="desc"&&(It="sortDown"),gt.cornerHeaderIcon=It}n.updateOption(V),K==="default-sort"?delete S.unref(_)[Q]:S.unref(_)[Q]={type:K},e("tableChange",{type:"4",data:{key:Q,order:K,type:"dimension"}})}function gi(K,Q,rt,st,vt){var Hi;y.value=!0;const{menu:Et}=V;let gt=Et.dropDownMenuHighlight,It="";(Hi=V.rows)!=null&&Hi.length&&(It=V.rows[V.rows.length-1].dimensionKey);const $t=rt.filter((Rt,Be)=>Be<rt.length-1),Ce=$t.map(Rt=>({columnName:Rt.dimensionKey})),Te=$t.map(Rt=>Rt.value),$i=gt.findIndex(Rt=>Rt.field===It&&Rt.type==="dimension");$i!==-1&>.splice($i,1),gt=gt.filter(Rt=>Rt.type==="dimension"),gt.push({col:st,row:vt,field:Q,type:"indicator",menuKey:K}),V.menu.dropDownMenuHighlight=gt,n.updateOption(V),K==="default-sort"?R.value=null:R.value={sortField:It,sortByIndicator:Q,sortType:K.toUpperCase(),query:Te,col:st,row:vt},e("tableChange",{type:"4",data:{key:Q,order:K,type:"indicators",columnData:Te,columnHeader:Ce}})}function _i(K,Q,rt){y.value=!0;const st=n.getCellValue(Q,rt),vt={};S.unref(a)[K]&&(vt.filterData=S.unref(a)[K]),e("tableChange",{type:"5",data:{key:K,callback:Et=>{d.value={tableInstance:n,fieldName:st,key:K,valueList:Et||[],type:"dimension",...vt},S.nextTick(()=>{y.value=!1,S.unref(u).show()})}}})}function Pi(K,Q){d.value={tableInstance:n,fieldName:Q,key:K,type:"indicators",filterData:S.unref(h)[K]},S.nextTick(()=>{S.unref(u).show()})}function ji({indicatorKey:K,menuKey:Q}){y.value=!0;let rt=V.indicators.length-1;const st=`${K}@${Q}`,vt=`${K}(${H[Q]}) fx`;S.unref(W).push(vt),S.unref(j)[vt]=st,V.indicators.forEach((Et,gt)=>{Et.indicatorKey===K&&(rt=gt+1)}),S.unref(G)[K]||(S.unref(G)[K]=[]),S.unref(G)[K].push(Q),e("tableChange",{type:"1",data:{data:{indicatorKey:st,title:vt,width:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},headerIcon:"sortNormal",dropDownMenu:[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"删除",menuKey:"delete"}],style:{padding:[16,28,16,28]},format:(Et,gt,It,$t)=>{const Ce=$t.getRecordByCell(gt,It)||[];return Ce[0]&&isNaN(+Ce[0][st])?Ce[0][st]:Et}},position:rt,indicatorKey:K,calculateType:Q}})}function Gi(){const K=V.rows[0]?V.rows[0].cornerDropDownMenu:[],Q=V.columns[0]?V.columns[0].cornerDropDownMenu:[],rt=V.rows.map(gt=>({...gt,cornerDropDownMenu:Q})),st=V.columns.map(gt=>({...gt,cornerDropDownMenu:K}));V.columns=rt,V.rows=st;const{type:vt,len:Et}=V.aggregate||{};vt&&(V.records.splice(-Et),V.aggregate={type:vt,len:0}),V.menu.dropDownMenuHighlight=[],a.value={},h.value={},c.value={},V.dataConfig.filterRules=[],n.updateOption(V)}function si({indicatorKey:K,fieldName:Q}){const rt=de(K);if(rt>-1){const st=V.indicators[rt].formatConfig||{};S.unref(g).showModal({...st,indicatorKey:K,fieldName:Q})}}function ei(K){const Q=de(K);if(Q>-1){const rt=V.indicators[Q].conditionalConfig||[];S.unref(f).showModal(K,rt)}}function de(K){return V.indicators.findIndex(Q=>Q.indicatorKey===K)}function yt(K){const Q=S.unref($)[0],rt=dt(S.unref($)),st={xLabel:Q,yLabel:K,dimensionData:rt,records:V.records};console.log(st),S.unref(b).showModal(st)}function xt(){n.on("resize_column",K=>{wt()}),n.on("icon_click",K=>{const{name:Q,col:rt,row:st}=K;if(["sortNormal","sortUp","sortDown"].includes(Q)){const{rows:vt,indicators:Et}=V;let gt=n.getCellValue(rt,st);S.unref(W).includes(gt)&&(gt=S.unref(j)[gt]);const It=vt.find(Te=>Te.dimensionKey===gt),$t=Et.find(Te=>Te.indicatorKey===gt);let Ce="default-sort";if(Q==="sortUp"?Ce="desc":Q==="sortDown"?Ce="default-sort":(!Q||Q==="sortNormal")&&(Ce="asc"),$t){const Te=n.getCellHeaderPaths(rt,st);gi(Ce,gt,(Te==null?void 0:Te.colHeaderPaths)||[],rt,st)}else It&&Wt(Ce,gt,rt,st)}}),n.on("show_menu",()=>{const K=document.querySelector(`#pivotTableContainer_${i.id} .vtable__menu-element`);K&&(K.classList.add("first"),B.value=parseFloat(K.style.left)+K.clientWidth+3+"px",M.value=parseFloat(K.style.top)+"px")}),n.on("dropdown_menu_click",K=>{const{menuKey:Q,field:rt,col:st,row:vt}=K,{dimensionKey:Et,indicatorKey:gt,value:It}=rt[rt.length-1];if(l.value=K,S.unref($).includes(Q)){if(S.unref(x).includes(Q)){const $t=S.unref(x).findIndex(Ce=>Ce===Q);S.unref(x).splice($t,1)}q([{key:Q,name:Q,type:"rows"}]),y.value=!0,e("tableChange",{type:"8"})}switch(Q){case"drill":alert("无维度可钻取");break;case"delete":Et?Ut(Et,"rows"):gt&&qt(gt);break;case"asc":case"desc":case"default-sort":Et?Wt(Q,Et,st,vt):gt&&gi(Q,gt,rt,st,vt);break;case"filter":Et?_i(Et,st,vt):gt&&Pi(gt,It);break;case"LAST_DATA":case"SAME_DATA":case"DIFF_DATA":case"MOM_DATA":case"YOY_DATA":case"zb":ji({indicatorKey:gt,menuKey:Q});break;case"trans":Gi();break;case"property":si({indicatorKey:gt,fieldName:It});break;case"conditionalProperty":ei(gt);break;case"aggregate":S.unref(p).showModal(S.unref(T)[Et]||[],Et);break;case"top":Vt(Et);break;case"graph":yt(gt);break}setTimeout(()=>{console.log("option",V)},500)})}function Vt(K){S.unref(m).showModal({value:S.unref(C)[K]||"",key:K})}function Zt(){S.unref(v).showModal(S.unref(I),S.unref(E))}function ge(K=[],Q=[]){I.value=K,E.value=Q,i.fullMode?(_.value={},R.value={},A.value={},y.value=!0,e("tableChange",{type:"10",data:{dimensions:S.unref(I),indicators:S.unref(E)}})):Ct()}const jt=K=>{Ct(K)},Pt=()=>{},fe=({checkKeys:K,key:Q,type:rt})=>{rt==="dimension"?(a.value[Q]=K,c.value={},nt(Q,K)):rt==="indicators"&&(h.value[Q]=K,At(Q,K))};function Tt(K){const{indicatorKey:Q,unit:rt="",format:st,floatLength:vt,position:Et}=K,gt=de(Q);if(gt>-1){const It=V.indicators[gt];It.formatConfig=K,It.format=($t,Ce,Te,$i)=>{const Hi=$i.getRecordByCell(Ce,Te)||[];return Hi[0]&&isNaN(+Hi[0][It.indicatorKey])?Hi[0][It.indicatorKey]:(st==="integer"?$t=Math.round(Number($t)):st==="float"&&!isNaN(vt)?$t=Number($t).toFixed(vt):st==="percent"&&($t=Number($t)*100+"%"),Et==="right"?$t+rt:rt+$t)},n.updateOption(V)}}function Ot(K,Q=[]){const rt=de(K);if(rt>-1){const st=V.indicators[rt];st.conditionalConfig=Q;const vt=[];Q.forEach(Et=>{let gt="";Et.conditions.forEach((It,$t)=>{$t>0&&(gt+=It.join==="and"?" && ":" || "),gt+=`value${It.operation}${It.value}`}),vt.push(gt)}),st.style.color=({dataValue:Et})=>{let gt="#333";return Q.forEach((It,$t)=>{It.color&&(gt=be(vt[$t],Et)?It.color:gt)}),gt},st.style.textAlign=({dataValue:Et})=>{let gt="left";return Q.forEach((It,$t)=>{It.align&&(gt=be(vt[$t],Et)?It.align:gt)}),gt},st.customRender=({rect:Et,dataValue:gt})=>{let It=[];return Q.forEach(($t,Ce)=>{if($t.icon&&be(vt[Ce],gt)){const $i=pA($t.icon,$t.iconColor);It=[{type:"icon",x:$t.align!=="right"?15:Et.width-25,y:Et.height/2-7,svg:$i,height:14,width:14}]}}),{elements:It,renderDefault:!0}},n.updateOption(V)}}function be(K,Q){K=K||"true";const rt=`function (value){
|
|
364
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function e9(i){var t=function(e,n){if(el(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var r=o.call(e,n||"default");if(el(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(i,"string");return el(t)=="symbol"?t:t+""}function fm(i,t,e){return(t=e9(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Ic=S.defineComponent({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=S.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),background:"hsl(".concat(i.hue,", 100%, 50%)")}});return{saturationStyle:n,sliderStyle:S.computed(function(){return{top:"".concat((100-i.value)/100*i.size-5,"px"),left:"".concat(i.saturation*i.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(o){var r=o.target.getBoundingClientRect(),s=r.left,l=r.top,a=function(d){var u=d.clientX,c=d.clientY,g=u-s,f=c-l;g<0&&(g=0),f<0&&(f=0),g>i.size&&(g=i.size),f>i.size&&(f=i.size);var p=g/i.size*100,m=100-f/i.size*100;e("change",p,m)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(o),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}});function ao(i,t){t===void 0&&(t={});var e=t.insertAt;if(i&&typeof document<"u"){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i))}}ao(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),Ic.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("div",{class:"saturation",style:S.normalizeStyle(i.saturationStyle),onMousedown:t[0]||(t[0]=S.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[t[1]||(t[1]=S.createElementVNode("div",{class:"saturation-white"},null,-1)),t[2]||(t[2]=S.createElementVNode("div",{class:"saturation-black"},null,-1)),S.createElementVNode("div",{class:"slider",style:S.normalizeStyle(i.sliderStyle)},null,4)],36)},Ic.__scopeId="data-v-24517fec",Ic.__file="src/picker/Saturation.vue";var zc=S.defineComponent({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=S.computed(function(){return{top:"".concat((1-i.hue/360)*i.height-2,"px"),height:"".concat(4,"px")}}),o=S.ref();return S.onMounted(function(){(function(){o.value.width=i.width,o.value.height=i.height;var r=o.value.getContext("2d"),s=r.createLinearGradient(0,0,0,i.height);s.addColorStop(0,"#FF0000"),s.addColorStop(.17,"#FF00FF"),s.addColorStop(.34,"#0000FF"),s.addColorStop(.51,"#00FFFF"),s.addColorStop(.68,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),r.fillStyle=s,r.fillRect(0,0,i.width,i.height)})()}),{canvas:o,sliderStyle:n,onSelect:function(r){var s=r.target.getBoundingClientRect().top,l=function(h){var d=h.clientY-s;d<0&&(d=0),d>i.height&&(d=i.height);var u=-100*d/i.height+100;e("change",360*u/100)},a=function(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a)};l(r),document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}}}}),i9={ref:"canvas"};ao(".hue[data-v-78b9f4f0]{position:relative}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),zc.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("div",{class:"hue",onMousedown:t[0]||(t[0]=S.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[S.createElementVNode("canvas",i9,null,512),S.createElementVNode("div",{class:"slider",style:S.normalizeStyle(i.sliderStyle)},null,4)],32)},zc.__scopeId="data-v-78b9f4f0",zc.__file="src/picker/Hue.vue";var Oc=S.defineComponent({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(i,t){var e=t.emit,n=S.computed(function(){return{top:"".concat(i.alpha*i.height-2,"px"),height:"".concat(4,"px")}}),o=S.ref(),r=function(){var s=o.value.getContext("2d");o.value.width=i.width,o.value.height=i.height;var l=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);s.fillStyle=s.createPattern(l,"repeat"),s.fillRect(0,0,i.width,i.height);var a=s.createLinearGradient(0,0,0,i.height);a.addColorStop(.01,"rgba(255,255,255,0)"),a.addColorStop(.99,i.color),s.fillStyle=a,s.fillRect(0,0,i.width,i.height)};return S.watch(function(){return i.color},function(){r()}),S.onMounted(function(){r()}),{canvas:o,sliderStyle:n,onSelect:function(s){var l=s.target.getBoundingClientRect().top,a=function(d){var u=d.clientY-l;u<0&&(u=0),u>i.height&&(u=i.height);var c=parseFloat((u/i.height).toFixed(2));e("change",c)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(s),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}}),n9={ref:"canvas"};ao(".alpha[data-v-24dc9656]{position:relative}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),Oc.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("div",{class:"alpha",onMousedown:t[0]||(t[0]=S.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[S.createElementVNode("canvas",n9,null,512),S.createElementVNode("div",{class:"slider",style:S.normalizeStyle(i.sliderStyle)},null,4)],32)},Oc.__scopeId="data-v-24dc9656",Oc.__file="src/picker/Alpha.vue";var WR={rgb:"RGBA",hex:"HEX",hsl:"HSLA",hsv:"HSVA"},NR={rgb:"RGB",hex:"HEX",hsl:"HSL",hsv:"HSV"},o9={RGB:"rgb",RGBA:"rgb",HEX:"hex",HSL:"hsl",HSLA:"hsl",HSV:"hsv",HSVA:"hsv"};function VR(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function pm(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?VR(Object(e),!0).forEach(function(n){fm(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):VR(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}var Xr=null,jR=function(i,t,e){var n=S.ref({}),o=e||{},r=o.placement,s=o.defaultStyle,l={strategy:o.strategy||"absolute",placement:r||"auto",onFirstUpdate:function(){Xr.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(a){var h=a.state,d=h.styles,u=h.placement,c=d.popper;n.value=pm(pm(pm({},c),s),{},{transformOrigin:u==="top"?"center bottom":"center top"})}}]};return S.watch(function(){return[S.unref(i),S.unref(t)]},function(a,h){var d,u=il(a,2),c=u[0],g=u[1],f=il(h,2),p=f[0],m=f[1];if(c&&g&&(p!==c||m!==p)){(d=Xr)===null||d===void 0||d.destroy();var v=c.$el||c,b=g.$el||g;S.nextTick(function(){Xr=QV(v,b,l)})}}),S.onBeforeUnmount(function(){var a;Xr&&((a=Xr)===null||a===void 0||a.destroy(),Xr=null)}),{instance:Xr,style:n}},Dc=S.defineComponent({props:{value:{type:String,default:"RGBA"},showAlpha:{type:Boolean},options:{type:[Boolean,Array]}},emits:["change"],setup:function(i,t){var e=t.emit,n=S.ref(null),o=S.ref(null),r=S.ref(!1),s=jR(n,o,{strategy:"fixed",defaultStyle:{zIndex:2}}).style,l=S.computed(function(){return Array.isArray(i.options)&&i.options.length>1}),a=S.computed(function(){var d=i.options,u=i.showAlpha,c=i.value;return Array.isArray(d)?u?d.map(function(g){return WR[g]}).filter(function(g){return!g.includes(c)}):d.map(function(g){return NR[g]}).filter(function(g){return!g.includes(c)}):[]}),h=function(d){var u,c,g=d.target;!((u=S.unref(n))!==null&&u!==void 0&&u.isEqualNode(g))&&(!((c=S.unref(n))===null||c===void 0)&&c.contains(g))||(r.value=!1)};return S.onMounted(function(){document.addEventListener("mouseup",h,!1)}),S.onUnmounted(function(){document.removeEventListener("mouseup",h,!1)}),{targetRef:n,selectorRef:o,selectorStyle:s,isShowSelector:r,isNeedSelect:l,formatOptions:a,onShow:function(){l.value&&(r.value=!0)},onFormatChange:function(d){e("change",o9[d])}}}}),r9={class:"format"},s9={key:0,class:"arrow"},l9=["onClick"];ao(".format[data-v-5f6e8f5e]{position:relative}.label[data-v-5f6e8f5e]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;position:relative;width:60px}[pick-colors-theme=dark] .label[data-v-5f6e8f5e]{background:#252930;color:#999}.arrow[data-v-5f6e8f5e]{height:6px;margin-bottom:4px;margin-left:5px;transform:rotate(135deg);width:6px}.arrow[data-v-5f6e8f5e],[pick-colors-theme=dark] .arrow[data-v-5f6e8f5e]{border-right:1px solid #999;border-top:1px solid #999}.selector[data-v-5f6e8f5e]{align-items:center;background:#f7f8f9;border-radius:5px;box-shadow:0 0 16px 0 rgba(0,0,0,.16);cursor:pointer;display:flex;flex-direction:column;font-weight:400;justify-content:center;padding:4px}[pick-colors-theme=dark] .selector[data-v-5f6e8f5e]{background:#252930;color:#999}.selector-item[data-v-5f6e8f5e]{align-items:center;display:flex;height:30px;justify-content:center;width:60px}.selector-item[data-v-5f6e8f5e]:hover{background:#e1f2fe}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]{color:#fff}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]:hover{background:#0087fa}.active-selector-item[data-v-5f6e8f5e]{background:#e1f2fe}[pick-colors-theme=dark] .active-selector-item[data-v-5f6e8f5e]{background:#0087fa}.v-enter-active[data-v-5f6e8f5e],.v-leave-active[data-v-5f6e8f5e]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-5f6e8f5e],.v-leave-to[data-v-5f6e8f5e]{opacity:0;transform:scaleY(0)}"),Dc.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("div",r9,[S.createElementVNode("div",{class:"label",ref:"targetRef",onClick:t[0]||(t[0]=function(){return i.onShow&&i.onShow.apply(i,arguments)})},[S.createElementVNode("span",null,S.toDisplayString(i.value),1),i.isNeedSelect?(S.openBlock(),S.createElementBlock("div",s9)):S.createCommentVNode("v-if",!0)],512),S.createVNode(S.Transition,null,{default:S.withCtx(function(){return[i.isShowSelector?(S.openBlock(),S.createElementBlock("div",{key:0,class:"selector",ref:"selectorRef",style:S.normalizeStyle(i.selectorStyle)},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.formatOptions,function(s){return S.openBlock(),S.createElementBlock("div",{class:"selector-item",key:s,onClick:function(l){return i.onFormatChange(s)}},S.toDisplayString(s),9,l9)}),128))],4)):S.createCommentVNode("v-if",!0)]}),_:1})])},Dc.__scopeId="data-v-5f6e8f5e",Dc.__file="src/picker/input-value/FormatValue.vue";var Wc=S.defineComponent({name:"Input",components:{FormatValue:Dc},props:{format:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number},showAlpha:{type:Boolean},formatOptions:{type:[Boolean,Array]}},emits:["change","focus","blur","enter","formatChange"],setup:function(i,t){var e=t.emit;return{onInput:function(n){var o;e("change",(o=n.target)===null||o===void 0?void 0:o.value)},valueStyle:S.computed(function(){return{minWidth:"".concat(i.width,"px"),maxWidth:"".concat(i.width,"px"),width:"".concat(i.width,"px")}}),onFocus:function(){e("focus")},onBlur:function(){e("blur")},onEnter:function(){e("enter")},onFormatChange:function(n){e("formatChange",n)}}}}),a9={class:"input"},h9=[".value"];function GR(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Pn(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?GR(Object(e),!0).forEach(function(n){fm(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):GR(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}ao(".input[data-v-2c454c00]{display:flex;font-size:12px}.value[data-v-2c454c00]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-2c454c00]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-2c454c00]:focus{border:1px solid #1890ff;outline:none}"),Wc.render=function(i,t,e,n,o,r){var s=S.resolveComponent("FormatValue");return S.openBlock(),S.createElementBlock("div",a9,[S.createVNode(s,{value:i.format,showAlpha:i.showAlpha,options:i.formatOptions,onChange:i.onFormatChange},null,8,["value","showAlpha","options","onChange"]),S.createElementVNode("input",{class:"value",style:S.normalizeStyle(i.valueStyle),".value":i.value,onFocus:t[0]||(t[0]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onInput:t[1]||(t[1]=function(){return i.onInput&&i.onInput.apply(i,arguments)}),onBlur:t[2]||(t[2]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)}),onKeydown:t[3]||(t[3]=S.withKeys(function(){return i.onEnter&&i.onEnter.apply(i,arguments)},["enter"]))},null,44,h9)])},Wc.__scopeId="data-v-2c454c00",Wc.__file="src/picker/input-value/InputValue.vue";var UR=function(i,t,e){return[i,t*e/((i=(2-t)*e)<1?i:2-i)||0,i/2]},$R={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},Nc=function(i){i=Math.min(Math.round(i),255);var t=Math.floor(i/16),e=i%16;return"".concat($R[t]||t).concat($R[e]||e)},KR=function(i){var t=i.r,e=i.g,n=i.b;return isNaN(t)||isNaN(e)||isNaN(n)?"":"#".concat(Nc(t)).concat(Nc(e)).concat(Nc(n))},nl=function(i,t){var e;typeof(e=i)=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1&&(i="100%");var n=function(o){return typeof o=="string"&&o.indexOf("%")!==-1}(i);return i=Math.min(t,Math.max(0,parseFloat("".concat(i)))),n&&(i=parseInt("".concat(i*t),10)/100),Math.abs(i-t)<1e-6?1:i%t/parseFloat(t)},$a=function(i,t,e){i=6*nl(i,360),t=nl(t,100),e=nl(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:Math.round(255*h),g:Math.round(255*d),b:Math.round(255*u)}},YR=function(i,t,e){var n,o,r=i.h,s=i.s,l=i.v,a=i.a;if(e)switch(a=(o=(n=a).toString().match(/\.(\d{1,2})(\d*)/))&&o[2].length>0?parseFloat(n.toFixed(2)):n,t){case"hsl":var h=UR(r,s/100,l/100);return"hsla(".concat(r.toFixed(0),", ").concat(Math.round(100*h[1]),"%, ").concat(Math.round(100*h[2]),"%, ").concat(a,")");case"hsv":return"hsva(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%, ").concat(a,")");case"rgb":var d=$a(r,s,l),u=d.r,c=d.g,g=d.b;return"rgba(".concat(u,", ").concat(c,", ").concat(g,", ").concat(a,")");default:return"".concat(KR($a(r,s,l))).concat(Nc(255*a))}else switch(t){case"hsl":var f=UR(r,s/100,l/100);return"hsl(".concat(r.toFixed(0),", ").concat(Math.round(100*f[1]),"%, ").concat(Math.round(100*f[2]),"%)");case"hsv":return"hsv(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%)");case"rgb":var p=$a(r,s,l),m=p.r,v=p.g,b=p.b;return"rgb(".concat(m,", ").concat(v,", ").concat(b,")");default:return KR($a(r,s,l))}},Vc=function(i){var t=i.r,e=i.g,n=i.b;t=nl(t,255),e=nl(e,255),n=nl(n,255);var o,r=Math.max(t,e,n),s=Math.min(t,e,n),l=r,a=r-s,h=r===0?0:a/r;if(r===s)o=0;else{switch(r){case t:o=(e-n)/a+(e<n?6:0);break;case e:o=(n-t)/a+2;break;case n:o=(t-e)/a+4}o/=6}return{h:360*o,s:100*h,v:100*l}},XR=function(i){var t=i.h,e=i.s,n=i.l;n/=100;var o=e/=100,r=Math.max(n,.01);return e*=(n*=2)<=1?n:2-n,o*=r<=1?r:2-r,{h:+t,s:100*(n===0?2*o/(r+o):2*e/(n+e)),v:100*((n+e)/2)}},qR=function(i){var t=[];if(i.match(/^#([0-9a-fA-f]{3,4})$/g))for(var e=1;e<i.length;e++)t.push(parseInt("0x"+i[e].repeat(2)));else if(i.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var n=1;n<i.length;n+=2)t.push(parseInt("0x"+i.slice(n,n+2)));return{r:t[0],g:t[1],b:t[2],a:t[3]}},mm=function(i,t,e){if(typeof i=="string"&&i!==""){var n=jc(i,Gc(i),e),o=tA(n);return o==null?"":YR(o,t,e)}return""},ZR=function(i){var t=il(i.match(/(\d(\.\d+)?)+/g),4);return{r:t[0],g:t[1],b:t[2],a:t[3]}},JR=function(i){var t=il(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:e,s:parseFloat(n),l:parseFloat(o),a:r}},QR=function(i){var t=il(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:parseFloat(e),s:parseFloat(n),v:parseFloat(o),a:parseFloat(r)}},jc=function(i,t){if(!(arguments.length>2&&arguments[2]!==void 0)||arguments[2])switch(t){case"rgb":var e=ZR(i),n=e.r,o=e.g,r=e.b,s=e.a;return Pn(Pn({},Vc({r:n,g:o,b:r})),{},{a:+s});case"hsv":var l=QR(i);return{h:l.h,s:l.s,v:l.v,a:l.a};case"hsl":var a=JR(i),h=a.h,d=a.s,u=a.l,c=a.a;return Pn(Pn({},XR({h,s:d,l:u})),{},{a:+c});default:var g=qR(i),f=g.r,p=g.g,m=g.b,v=g.a;return Pn(Pn({},Vc({r:f,g:p,b:m})),{},{a:v/255})}else switch(t){case"rgb":return Pn(Pn({},Vc(ZR(i))),{},{a:1});case"hsv":var b=QR(i);return{h:b.h,s:b.s,v:b.v,a:1};case"hsl":return Pn(Pn({},XR(JR(i))),{},{a:1});default:return Pn(Pn({},Vc(qR(i))),{},{a:1})}},Gc=function(i){return i.match(/^#/)?"hex":i.match(/^rgb/)?"rgb":i.match(/^hsl/)?"hsl":i.match(/^hsv/)?"hsv":"hex"},tA=function(i){var t=i.h,e=i.s,n=i.v,o=i.a;return isNaN(t)&&isNaN(e)&&isNaN(n)?null:(isNaN(t)&&(t=0),isNaN(e)&&(e=0),isNaN(n)&&(n=0),isNaN(o)&&(o=1),{h:t,s:e,v:n,a:o})},Ka=S.defineComponent({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(i){var t=S.ref(),e=S.inject("theme",{theme:"light"}).theme,n=S.computed(function(){return parseFloat((i.width||i.size)+"")}),o=S.computed(function(){return parseFloat((i.height||i.size)+"")}),r=S.computed(function(){return{width:"".concat(S.unref(n),"px"),height:"".concat(S.unref(o),"px"),border:i.border?"1px solid ".concat(S.unref(e)==="dark"?"#434345":"#d9d9d9"):"",borderRadius:"".concat(i.borderRadius,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(S.unref(e)==="dark"?"#2681ff":"#1890ff"):""}}),s=function(){var l=t.value.getContext("2d");t.value.width=S.unref(n),t.value.height=S.unref(o);var a=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);l.fillStyle=l.createPattern(a,"repeat"),l.fillRect(0,0,S.unref(n),S.unref(o)),l.fillStyle=i.value,l.fillRect(0,0,S.unref(n),S.unref(o))};return S.watch(function(){return i.value},function(){s()}),S.onMounted(function(){s()}),{canvas:t,colorItemStyle:r}}}),d9=["draggable"];ao(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),Ka.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("canvas",{class:"color-item",style:S.normalizeStyle(i.colorItemStyle),ref:"canvas",draggable:i.draggable},null,12,d9)},Ka.__scopeId="data-v-02da71fd",Ka.__file="src/color-item/ColorItem.vue";var Uc=S.defineComponent({name:"Colors",components:{ColorItem:Ka},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(i,t){var e=t.emit;return{onSelectColor:function(n,o){e("change",n,o)},useColors:S.computed(function(){return i.colors.map(function(n){return mm(n,"hex",!0)})})}}}),u9={class:"colors"};function eA(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function ho(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?eA(Object(e),!0).forEach(function(n){fm(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):eA(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}ao(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),Uc.render=function(i,t,e,n,o,r){var s=S.resolveComponent("color-item");return S.openBlock(),S.createElementBlock("div",u9,[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.useColors,function(l,a){return S.openBlock(),S.createBlock(s,{key:a,class:"color-item",size:16,value:l,border:!1,"border-radius":3,selected:i.selectedIndex===a,onClick:S.withModifiers(function(h){return i.onSelectColor(l,+a)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},Uc.__scopeId="data-v-0f8b52a8",Uc.__file="src/picker/Colors.vue";var $c=S.defineComponent({name:"Picker",components:{Colors:Uc,Saturation:Ic,Hue:zc,Alpha:Oc,InputValue:Wc},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}},formatOptions:{type:[Boolean,Array]}},emits:["change","formatChange"],setup:function(i,t){var e=t.emit,n=S.computed(function(){return ho(ho({},i.style),{},{width:i.showAlpha?"230px":"205px"})}),o=S.ref(),r=S.ref(),s=S.ref(),l=function(){var p,m=(p=i.value)===null||p===void 0?void 0:p.trim();if(m!=null&&m!==""){var v=Gc(m);return tA(jc(m,v,i.showAlpha))}return null};S.watch(function(){return i.value},function(){i.value!==S.unref(s)&&(o.value=l())},{immediate:!0}),S.watch(function(){return[S.unref(o),i.format]},function(p){var m=il(p,2),v=m[0],b=m[1],w="";v!=null?(w=YR(ho({},v),i.format,i.showAlpha),r.value=ho({},v)):r.value=null,s.value=w;var y=l();JSON.stringify(v)!==JSON.stringify(y)&&JSON.stringify(v)!==JSON.stringify(b)&&e("change",w)},{immediate:!0});var a=S.computed(function(){var p;return((p=S.unref(o))===null||p===void 0?void 0:p.h)||0}),h=S.computed(function(){var p;return((p=S.unref(o))===null||p===void 0?void 0:p.s)||0}),d=S.computed(function(){var p;return((p=S.unref(o))===null||p===void 0?void 0:p.v)||0}),u=S.computed(function(){var p,m;return((p=S.unref(o))===null||p===void 0?void 0:p.a)!=null?(m=S.unref(o))===null||m===void 0?void 0:m.a:1}),c=S.computed(function(){return $a(S.unref(a),S.unref(h),S.unref(d))}),g=S.computed(function(){return"rgb(".concat(S.unref(c).r,", ").concat(S.unref(c).g,", ").concat(S.unref(c).b,")")}),f=S.ref(-1);return{h:a,s:h,v:d,a:u,rgbStr:g,onSelectSaturation:function(p,m){f.value=-1,S.unref(o)==null?o.value={h:S.unref(a),s:p,v:m,a:S.unref(u)}:o.value=ho(ho({},S.unref(o)),{},{s:p,v:m})},onSelectHue:function(p){f.value=-1,S.unref(o)==null&&(o.value={h:p,s:S.unref(h),v:S.unref(d),a:S.unref(u)}),o.value=ho(ho({},S.unref(o)),{},{h:p})},onSelectAlpha:function(p){f.value=-1,S.unref(o)==null?o.value={h:S.unref(a),s:S.unref(h),v:S.unref(d),a:p}:o.value=ho(ho({},S.unref(o)),{},{a:p})},handleInputFormat:function(p){return i.showAlpha?WR[p]:NR[p]},colorValue:s,pickerStyle:n,onInputChange:function(p){f.value=-1,s.value=p},handleChange:function(){var p,m=(p=S.unref(s))===null||p===void 0?void 0:p.trim();if(m!==""){var v=i.showAlpha,b=Gc(m),w=jc(m,b,v),y=function(C){var _=C.h,A=C.s,R=C.v,x=C.a;return!(isNaN(_)||isNaN(A)||isNaN(R)||isNaN(x))}(w);y?o.value=w:S.unref(r)!=null?o.value=S.unref(r):s.value=""}else o.value=null},selectColorIndex:f,onSelectColor:function(p,m){if(f.value=m,(p=p.trim())==="")o.value=null;else{var v=Gc(p);v?function(b,w,y){if(b.length!==0){var C=jc(b,w,y),_=C.h,A=C.s,R=C.v;if(!(isNaN(_)||isNaN(A)||isNaN(R))){var x=1,T=C.a;isNaN(T)||(x=T),o.value={h:_,s:A,v:R,a:x}}}}(p,v,!0):o.value=null}},onFormatChange:function(p){e("formatChange",p)}}}}),c9={class:"picker-inner"},g9={class:"picker-header"};ao(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),$c.render=function(i,t,e,n,o,r){var s=S.resolveComponent("saturation"),l=S.resolveComponent("hue"),a=S.resolveComponent("alpha"),h=S.resolveComponent("input-value"),d=S.resolveComponent("Colors");return S.openBlock(),S.createElementBlock("div",{class:"picker",style:S.normalizeStyle(i.pickerStyle)},[S.createElementVNode("div",c9,[S.createElementVNode("div",g9,[S.createVNode(s,{class:"saturation",hue:i.h,saturation:i.s,value:i.v,onChange:i.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),S.createVNode(l,{class:"hue",hue:i.h,onChange:i.onSelectHue},null,8,["hue","onChange"]),i.showAlpha?(S.openBlock(),S.createBlock(a,{key:0,class:"alpha",alpha:i.a,color:i.rgbStr,onChange:i.onSelectAlpha},null,8,["alpha","color","onChange"])):S.createCommentVNode("v-if",!0)]),S.createVNode(h,{format:i.handleInputFormat(i.format),value:i.colorValue,showAlpha:i.showAlpha,width:i.showAlpha?150:125,formatOptions:i.formatOptions,onChange:i.onInputChange,onBlur:i.handleChange,onEnter:i.handleChange,onFormatChange:i.onFormatChange},null,8,["format","value","showAlpha","width","formatOptions","onChange","onBlur","onEnter","onFormatChange"]),i.colors.length>0?(S.openBlock(),S.createBlock(d,{key:0,class:"colors",colors:i.colors,"selected-index":i.selectColorIndex,onChange:i.onSelectColor},null,8,["colors","selected-index","onChange"])):S.createCommentVNode("v-if",!0)])],4)},$c.__scopeId="data-v-6ceadec6",$c.__file="src/picker/Picker.vue";var Kc=S.defineComponent({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(i){var t=S.inject("theme",{theme:"light"}).theme;return{addColorItemStyle:S.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),lineHeight:"".concat(i.size,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(S.unref(t)==="dark"?"#2681ff":"#1890ff"):""}})}}});ao(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),Kc.render=function(i,t,e,n,o,r){return S.openBlock(),S.createElementBlock("svg",{class:"add-color-item",style:S.normalizeStyle(i.addColorItemStyle),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},t[0]||(t[0]=[S.createElementVNode("g",{class:"container"},[S.createElementVNode("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)]),4)},Kc.__scopeId="data-v-ceb1719c",Kc.__file="src/add-color-item/AddColorItem.vue";var Yc=S.defineComponent({name:"ColorPicker",components:{ColorItem:Ka,Picker:$c,AddColorItem:Kc},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean],default:"body"},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}},position:{type:String},placement:{type:String},formatOptions:{type:[Boolean,Array],default:!1}},emits:["change","update:value","update:showPicker","overflowMax","closePicker","formatChange"],setup:function(i,t){var e=t.emit,n=S.ref([]),o=S.computed(function(){return S.unref(n).map(function(x){return mm(x,"hex",i.showAlpha)})}),r=S.ref("hex");S.watch(function(){return i.format},function(){r.value=i.format},{immediate:!0}),S.watch(function(){return i.value},function(){var x=i.value||"",T=Array.isArray(x)?x:[x];n.value=T.map(function(B){return mm(B,S.unref(r),i.showAlpha)})},{immediate:!0});var s=S.ref(void 0),l=S.computed(function(){return S.unref(n)[S.unref(s)]}),a=S.ref(!1);S.watch(function(){return i.showPicker},function(){a.value=i.showPicker},{immediate:!0});var h,d,u=S.ref(null),c=S.ref(null),g=jR(u,c,{defaultStyle:{zIndex:i.zIndex},strategy:i.position,placement:i.placement}).style,f=function(){S.unref(u)==null&&(u.value=S.unref(R)[0]),S.unref(s)==null&&(s.value=0),i.showPicker===void 0?a.value=!0:e("update:showPicker",!0)},p=function(){s.value=void 0,i.showPicker===void 0?a.value=!1:e("update:showPicker",!1),e("closePicker",S.toRaw(Array.isArray(i.value)||i.addColor?S.unref(n):S.unref(n)[0]))},m=S.ref(),v=function(){var x=zR(Fc.mark(function T(B){var M,H,F,P;return Fc.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(H=B.target,(F=(M=H.dataset)===null||M===void 0?void 0:M.index)!=null&&F!==""){L.next=4;break}return L.abrupt("return");case 4:if(P=+F,S.unref(s)!==P){L.next=7;break}return L.abrupt("return");case 7:S.unref(s)!=null&&S.unref(s)!==P?(p(),h&&clearTimeout(h),h=setTimeout(function(){f(),clearTimeout(h)},100)):f(),s.value=P,u.value=H;case 10:case"end":return L.stop()}},T)}));return function(T){return x.apply(this,arguments)}}(),b=function(){var x=zR(Fc.mark(function T(B){var M,H,F,P,L;return Fc.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(P=B.target,!(!((M=S.unref(m))!==null&&M!==void 0&&M.isEqualNode(P))&&(!((H=S.unref(m))===null||H===void 0)&&H.contains(P)))){k.next=4;break}return k.abrupt("return");case 4:if(L=(F=S.unref(c))===null||F===void 0?void 0:F.$el,!(L!=null&&L.contains(P))){k.next=8;break}return k.abrupt("return");case 8:d&&clearTimeout(d),d=setTimeout(function(){S.unref(a)&&p()},0);case 10:case"end":return k.stop()}},T)}));return function(T){return x.apply(this,arguments)}}();S.watch(a,function(){S.unref(a)&&(f(),clearTimeout(d))});var w,y=S.ref(i.max>S.unref(n).length),C=S.computed(function(){return typeof i.popupContainer=="string"||el(i.popupContainer)==="object"&&i.popupContainer!=null?i.popupContainer:"body"}),_=S.computed(function(){return typeof i.popupContainer=="boolean"&&i.popupContainer===!1}),A=S.computed(function(){return i.theme});S.watch(function(){return[i.theme,S.unref(c)]},function(){S.nextTick(function(){var x,T;(x=S.unref(m))===null||x===void 0||x.setAttribute("pick-colors-theme",S.unref(A)),(T=S.unref(c))===null||T===void 0||(T=T.$el)===null||T===void 0||T.setAttribute("pick-colors-theme",S.unref(A))})},{immediate:!0}),S.provide("theme",{theme:A});var R=S.ref([]);return S.onMounted(function(){document.addEventListener("mouseup",b,!1),i.showPicker&&f()}),S.onUnmounted(function(){document.removeEventListener("mouseup",b,!1),h&&(clearTimeout(h),h=null),d&&(clearTimeout(d),d=null)}),{valueList:n,colorItemSelected:function(x){return(i.addColor?S.unref(n).length>0:S.unref(n).length>1)&&S.unref(s)===x},selectedColor:l,selectedIndex:s,isShowPicker:a,addColorItemShow:y,onPickerChange:function(x){var T=S.unref(s),B=S.unref(n).slice(),M=S.unref(n).length;if(T!=null){T>=0?B[T]=x:(s.value=M,B.push(x));var H="";H=Array.isArray(i.value)||i.addColor?B:x,n.value=Array.isArray(H)?H:[H],e("update:value",H),e("change",H,x,T),i.addColor&&M>=i.max&&(y.value=!1,e("overflowMax"))}},colorPicker:m,onColorClick:v,pickerRef:c,onColorItemDragStart:function(x){x.dataTransfer.effectAllowed="move";var T=x.target;w=+T.dataset.index},onColorItemDragOver:function(x){},onColorItemDrop:function(x){var T=+x.target.dataset.index,B=t9(S.unref(n)),M=B[w];B.splice(w,1);var H=B.slice(0,T),F=B.splice(T),P=H.concat([M]).concat(F);e("update:value",P),e("change",P,P[w],w)},colorItemsRef:R,pickerStyle:g,values:o,teleportDisabled:_,toPopupContainer:C,formatValue:r,onFormatChange:function(x){r.value=x,e("formatChange",x)}}}});ao(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),Yc.render=function(i,t,e,n,o,r){var s=S.resolveComponent("color-item"),l=S.resolveComponent("add-color-item"),a=S.resolveComponent("picker");return S.openBlock(),S.createElementBlock("div",{class:"color-picker",ref:"colorPicker",onDragstart:t[0]||(t[0]=S.withModifiers(function(){return i.onColorItemDragStart&&i.onColorItemDragStart.apply(i,arguments)},["stop"])),onDragover:t[1]||(t[1]=S.withModifiers(function(){return i.onColorItemDragOver&&i.onColorItemDragOver.apply(i,arguments)},["prevent","stop"])),onDrop:t[2]||(t[2]=S.withModifiers(function(){return i.onColorItemDrop&&i.onColorItemDrop.apply(i,arguments)},["prevent","stop"])),onClick:t[3]||(t[3]=S.withModifiers(function(){return i.onColorClick&&i.onColorClick.apply(i,arguments)},["stop"]))},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.values,function(h,d){return S.openBlock(),S.createBlock(s,{class:"color-item",key:d,ref_for:!0,ref:function(u){return i.colorItemsRef[d]=u},size:i.size,width:i.width,height:i.height,value:h,selected:i.colorItemSelected(d),"data-index":d,draggable:i.valueList.length>1,format:i.formatValue},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),i.addColor&&i.addColorItemShow?(S.openBlock(),S.createBlock(l,{key:0,class:"add-color-item",ref:"addColorItem",selected:i.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):S.createCommentVNode("v-if",!0),(S.openBlock(),S.createBlock(S.Teleport,{to:i.toPopupContainer,disabled:i.teleportDisabled},[S.createVNode(S.Transition,null,{default:S.withCtx(function(){return[i.isShowPicker?(S.openBlock(),S.createBlock(a,{key:0,class:"picker",style:S.normalizeStyle(i.pickerStyle),ref:"pickerRef",value:i.selectedColor,format:i.formatValue,"show-alpha":i.showAlpha,colors:i.colors,formatOptions:i.formatOptions,onChange:i.onPickerChange,onFormatChange:i.onFormatChange},null,8,["style","value","format","show-alpha","colors","formatOptions","onChange","onFormatChange"])):S.createCommentVNode("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},Yc.__scopeId="data-v-3c43ade8",Yc.__file="src/ColorPicker.vue";const aj="",f9=S.defineComponent({name:"ColorPick",components:{PickColors:Yc},props:{value:{type:String,default:""}},setup(i,{emit:t}){const e=S.ref(i.value);S.watch(()=>i.value,o=>{e.value=o},{immediate:!0});function n(){t("changeProp",S.unref(e))}return{myValue:e,onChange:n}}}),p9={class:"color-pick"};function m9(i,t,e,n,o,r){const s=S.resolveComponent("a-input"),l=S.resolveComponent("pick-colors");return S.openBlock(),S.createElementBlock("div",p9,[S.createVNode(s,{class:"input",size:"small",value:i.myValue,"onUpdate:value":t[0]||(t[0]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"]),S.createVNode(l,{value:i.myValue,"onUpdate:value":t[1]||(t[1]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"])])}const v9=Mi(f9,[["render",m9],["__scopeId","data-v-99378939"]]),b9=S.defineComponent({name:"Radio",props:{value:{type:String,default:""},options:{type:Array,default(){return[]}}},setup(i,{emit:t}){function e(n){t("changeProp",n.target.value)}return{onChange:e}}});function C9(i,t,e,n,o,r){const s=S.resolveComponent("a-radio-group");return S.openBlock(),S.createBlock(s,{value:i.value,size:"small",onChange:i.onChange,options:i.options,optionType:"button"},null,8,["value","onChange","options"])}const y9=Mi(b9,[["render",C9]]),hj="",_9=S.defineComponent({name:"PropertyConfig",components:{ColorPick:v9,Radio:y9},props:{config:{type:Object,default(){return{}}},selectedIndex:{type:Boolean},theme:{type:String,default:"light"}},setup(i){const t=[{label:"字体颜色",key:"color",component:"color-pick"},{label:"对齐方式",key:"align",component:"radio",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},{label:"图标",key:"icon",component:"radio",props:{options:[{label:"上涨",value:"increase"},{label:"下跌",value:"decline"}]}},{label:"图标颜色",key:"iconColor",component:"color-pick"}],e=S.ref([]);S.watch(()=>i.selectedIndex,()=>{if(i.selectedIndex>-1){const s=Object.keys(i.config);e.value=s}});function n(s,l){i.config[s]=l}function o(s,l){if(s.target.checked)i.config[l]="",S.unref(e).push(l);else{delete i.config[l];const a=S.unref(e).indexOf(l);S.unref(e).splice(a,1)}}const r=S.computed(()=>i.theme==="darkBlue"?"#b2c3dd":"");return{formConfig:t,handleSelect:o,selectedProperty:e,onChange:n,fontColor:r}}}),w9={class:"content"},S9={class:"list"};function x9(i,t,e,n,o,r){const s=S.resolveComponent("a-checkbox");return S.openBlock(),S.createElementBlock("div",w9,[S.createElementVNode("div",{style:S.normalizeStyle({color:i.fontColor,height:"32px",lineHeight:"32px"})},"属性配置",4),S.createElementVNode("div",S9,[i.selectedIndex>-1?(S.openBlock(!0),S.createElementBlock(S.Fragment,{key:0},S.renderList(i.formConfig,({label:l,component:a,props:h,key:d},u)=>(S.openBlock(),S.createElementBlock("div",{class:"list-item",style:{display:"flex"},key:u},[S.createVNode(s,{checked:i.selectedProperty.includes(d),onChange:c=>i.handleSelect(c,d)},null,8,["checked","onChange"]),S.createElementVNode("span",{style:S.normalizeStyle({padding:"0 8px",color:i.fontColor})},S.toDisplayString(l),5),i.selectedProperty.includes(d)?(S.openBlock(),S.createBlock(S.resolveDynamicComponent(a),S.mergeProps({key:0,value:i.config[d],ref_for:!0},h,{onChangeProp:c=>i.onChange(d,c)}),null,16,["value","onChangeProp"])):S.createCommentVNode("",!0)]))),128)):S.createCommentVNode("",!0)])])}const R9=Mi(_9,[["render",x9],["__scopeId","data-v-285d450e"]]),A9=S.defineComponent({name:"ConditionalProperty",props:{theme:{type:String,default:"light"}},components:{ConditionalItemConfig:W8,ConditionalConfig:K8,PropertyConfig:R9},setup(i,{emit:t,expose:e}){const n=S.ref(!1),o=S.ref([]),r=S.ref(-1);let s="";const l=S.computed(()=>S.unref(r)>-1?S.unref(o)[S.unref(r)]:{});function a(c,g=[]){s=c,o.value=g,n.value=!0}function h(c){r.value=c}function d(){t("change",s,S.unref(o)),r.value=-1,n.value=!1}function u(){r.value=-1,o.value=[]}return e({showModal:a}),{visible:n,config:o,changeSelectedItem:h,selectedConfig:l,selectedIndex:r,handleOk:d,handleClear:u}}}),T9={style:{display:"flex"}};function B9(i,t,e,n,o,r){const s=S.resolveComponent("conditional-item-config"),l=S.resolveComponent("conditional-config"),a=S.resolveComponent("property-config"),h=S.resolveComponent("a-button"),d=S.resolveComponent("a-modal");return S.openBlock(),S.createBlock(d,{wrapClassName:i.theme,title:"条件属性",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.visible=u),"ok-text":"确认","cancel-text":"取消",style:{width:"950px",top:"60px",height:"700px"},maskClosable:!1,destroyOnClose:!0,onOk:i.handleOk},{footer:S.withCtx(()=>[S.createVNode(h,{onClick:t[0]||(t[0]=u=>i.visible=!1)},{default:S.withCtx(()=>t[2]||(t[2]=[S.createTextVNode("取消")])),_:1}),S.createVNode(h,{onClick:i.handleClear},{default:S.withCtx(()=>t[3]||(t[3]=[S.createTextVNode("清除筛选")])),_:1},8,["onClick"]),S.createVNode(h,{type:"primary",onClick:i.handleOk},{default:S.withCtx(()=>t[4]||(t[4]=[S.createTextVNode("确定")])),_:1},8,["onClick"])]),default:S.withCtx(()=>[S.createElementVNode("div",T9,[S.createVNode(s,{config:i.config,theme:i.theme,onChange:i.changeSelectedItem},null,8,["config","theme","onChange"]),S.createVNode(l,{config:i.selectedConfig.conditions,theme:i.theme,isSelected:i.selectedIndex>-1},null,8,["config","theme","isSelected"]),S.createVNode(a,{config:i.selectedConfig,selectedIndex:i.selectedIndex,theme:i.theme},null,8,["config","selectedIndex","theme"])])]),_:1},8,["wrapClassName","visible","onOk"])}const M9=Mi(A9,[["render",B9]]),dj="",P9=S.defineComponent({name:"PivotChart",props:{data:{type:Object,default(){return{dimensionData:{},xLabel:"",yLabel:""}}},theme:{type:String,default:"light"}},components:{FilterOutlined:t8,MinusSquareOutlined:w8,PivotFilter:Fx},setup(i,{expose:t}){const e=S.ref();let n;const o=S.ref([]),r=S.computed(()=>{var F;return(F=S.unref(o)[S.unref(o).length-1])==null?void 0:F.key}),s=S.ref([]),l=S.ref(!1),a=S.ref(),h=S.ref({});let d={};const u=S.reactive({position:"absolute",top:"0",left:"0"});let c="",g;function f(){s.value=[],o.value=[],d={};const{dimensionData:F,xLabel:P}=i.data,L=F[P].map(k=>k.value);m(P,L),S.unref(o).push({key:P,drillValue:"",xAxisData:L}),v()}let p=[];S.onMounted(()=>{n=cA.init(e.value),w()});function m(F,P){const{yLabel:L,records:k}=i.data;let I=[];P.forEach(()=>{I.push(0)}),k.forEach(E=>{if(E[L]!==void 0){const z=P.indexOf(E[F]);if(z>-1){let O=!0;S.unref(o).forEach(W=>{W.drillValue&&E[W.key]!==W.drillValue&&(O=!1)});const N=Number(E[L]);O&&!isNaN(N)&&(I[z]+=Number(N))}}}),I=I.map(E=>E.toFixed(2)),g={tooltip:{},xAxis:{data:P},yAxis:{},series:[{name:L,type:"bar",label:{show:!0,position:"top"},data:I}]},p=I,n.setOption(g)}function v(){const F=Object.keys(i.data.dimensionData),P=S.unref(o).map(k=>k.key),L=[];F.forEach(k=>{P.includes(k)||L.push(k)}),s.value=L}function b(){c="",l.value=!1}function w(){n.on("contextmenu",function(F){const{event:{event:P},name:L}=F;c=L,P.preventDefault(),u.left=P.offsetX+90+"px",u.top=P.offsetY+80+"px",l.value=!0}),document.addEventListener("click",b)}function y(F){const P=[],{records:L}=i.data;for(const k of L){let I=!0;for(const E of S.unref(o))E.drillValue&&k[E.key]!==E.drillValue&&(I=!1);I&&!P.includes(k[F])&&P.push(k[F])}return P}function C(F){S.unref(o)[S.unref(o).length-1].drillValue=c;const P=y(F);m(F,P),S.unref(o).push({key:F,drillValue:"",xAxisData:P}),v()}function _(F,P){S.unref(o).splice(F+1,S.unref(o).length-F-1),S.unref(o)[F].drillValue="";const L=y(P);m(P,L),B(),v()}function A(F,P){const L=g.series[0].data,k=g.xAxis.data,I=L.map((z,O)=>({value:z,label:k[O]}));let E;P==="asc"?F==="dimension"?E=I.sort((z,O)=>z.label.localeCompare(O.label)):E=I.sort((z,O)=>z.value-O.value):P==="desc"&&(F==="dimension"?E=I.sort((z,O)=>O.label.localeCompare(z.label)):E=I.sort((z,O)=>O.value-z.value)),g.series[0].data=E.map(z=>z.value),g.xAxis.data=E.map(z=>z.label),n.setOption(g)}function R(F){if(F==="dimension"){const P=y(S.unref(r));m(S.unref(r),P),B()}else d={},B()}function x(F){if(F==="dimension"){const P=S.unref(o)[S.unref(o).length-1].xAxisData.map(L=>({value:L}));h.value={fieldName:S.unref(r),key:S.unref(r),type:F,filterData:g.xAxis.data,valueList:P}}else F==="indicators"&&(h.value={fieldName:i.data.yLabel,key:i.data.yLabel,type:"indicators",filterData:d});S.nextTick(()=>{a.value.show()})}function T({checkKeys:F,type:P}){P==="dimension"?m(S.unref(r),F):P==="indicators"&&(d=F,B())}function B(){const F=S.unref(o)[S.unref(o).length-1].xAxisData;let P=p.map((L,k)=>({value:L,label:F[k]}));P=P.filter(L=>M(L.value)),g.series[0].data=P.map(L=>L.value),g.xAxis.data=P.map(L=>L.label),n.setOption(g)}function M(F){let P=!1,{rule:L,value:k}=d;switch(k=Number(k),L){case"LESS":P=F<k;break;case"GREATER":P=F>k;break;case"EQUAL":P=F===k;break;case"NOT_EQUAL":P=F!==k;break;default:P=!0;break}return P}S.onBeforeUnmount(()=>{document.removeEventListener("click",b)}),t({init:f});const H=S.computed(()=>i.theme==="darkBlue"?"#b2c3dd":"");return{echartRef:e,dropdownList:s,isShowMenu:l,curXLabel:r,menuStyle:u,drillDimension:C,dimensionMap:o,deleteDimension:_,handleSort:A,handleClear:R,handleFilter:x,pivotFilterRef:a,filterData:h,onFilterChange:T,fontColor:H}}}),H9={style:{display:"flex",height:"400px"}},E9={style:{flex:"0 0 200px"}},L9={style:{flex:"0 0 650px",height:"100%"}},k9={key:0,style:{display:"flex","align-items":"center"}},F9={key:0,class:"dimension-item"},I9={key:1,style:{height:"30px"}},z9={style:{width:"100%",height:"100%"},ref:"echartRef"},O9=["onClick"];function D9(i,t,e,n,o,r){const s=S.resolveComponent("filter-outlined"),l=S.resolveComponent("a-menu-item"),a=S.resolveComponent("a-menu"),h=S.resolveComponent("a-dropdown"),d=S.resolveComponent("minus-square-outlined"),u=S.resolveComponent("pivot-filter");return S.openBlock(),S.createElementBlock(S.Fragment,null,[S.createElementVNode("div",H9,[S.createElementVNode("div",E9,[S.createElementVNode("div",{style:S.normalizeStyle({color:i.fontColor})},[S.createTextVNode(" 横轴:"+S.toDisplayString(i.curXLabel)+" ",1),S.createVNode(h,null,{overlay:S.withCtx(()=>[S.createVNode(a,null,{default:S.withCtx(()=>[S.createVNode(l,{key:"asc",onClick:t[0]||(t[0]=c=>i.handleSort("dimension","asc"))},{default:S.withCtx(()=>t[8]||(t[8]=[S.createTextVNode("升序")])),_:1}),S.createVNode(l,{key:"desc",onClick:t[1]||(t[1]=c=>i.handleSort("dimension","desc"))},{default:S.withCtx(()=>t[9]||(t[9]=[S.createTextVNode("降序")])),_:1}),S.createVNode(l,{key:"filter",onClick:t[2]||(t[2]=c=>i.handleFilter("dimension"))},{default:S.withCtx(()=>t[10]||(t[10]=[S.createTextVNode("筛选")])),_:1}),S.createVNode(l,{key:"clear",onClick:t[3]||(t[3]=c=>i.handleClear("dimension"))},{default:S.withCtx(()=>t[11]||(t[11]=[S.createTextVNode("清除")])),_:1})]),_:1})]),default:S.withCtx(()=>[S.createVNode(s,{class:"filter-icon",style:S.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4),S.createElementVNode("div",{style:S.normalizeStyle({color:i.fontColor})},[S.createTextVNode(" 纵轴:"+S.toDisplayString(i.data.yLabel)+" ",1),S.createVNode(h,null,{overlay:S.withCtx(()=>[S.createVNode(a,null,{default:S.withCtx(()=>[S.createVNode(l,{key:"asc",onClick:t[4]||(t[4]=c=>i.handleSort("indicators","asc"))},{default:S.withCtx(()=>t[12]||(t[12]=[S.createTextVNode("升序")])),_:1}),S.createVNode(l,{key:"desc",onClick:t[5]||(t[5]=c=>i.handleSort("indicators","desc"))},{default:S.withCtx(()=>t[13]||(t[13]=[S.createTextVNode("降序")])),_:1}),S.createVNode(l,{key:"filter",onClick:t[6]||(t[6]=c=>i.handleFilter("indicators"))},{default:S.withCtx(()=>t[14]||(t[14]=[S.createTextVNode("筛选")])),_:1}),S.createVNode(l,{key:"clear",onClick:t[7]||(t[7]=c=>i.handleClear("indicators"))},{default:S.withCtx(()=>t[15]||(t[15]=[S.createTextVNode("清除")])),_:1})]),_:1})]),default:S.withCtx(()=>[S.createVNode(s,{class:"filter-icon",style:S.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4)]),S.createElementVNode("div",L9,[i.dimensionMap.length>1?(S.openBlock(),S.createElementBlock("div",k9,[S.createElementVNode("span",{style:S.normalizeStyle({color:i.fontColor})},"钻取维度:",4),(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.dimensionMap,(c,g)=>(S.openBlock(),S.createElementBlock(S.Fragment,{key:g},[c.drillValue?(S.openBlock(),S.createElementBlock("div",F9,[S.createVNode(d,{class:"dimension-icon",onClick:f=>i.deleteDimension(g,c.key)},null,8,["onClick"]),S.createTextVNode(S.toDisplayString(c.key)+"("+S.toDisplayString(c.drillValue)+") ",1)])):S.createCommentVNode("",!0)],64))),128))])):(S.openBlock(),S.createElementBlock("div",I9)),S.createElementVNode("div",z9,null,512)]),S.withDirectives(S.createElementVNode("div",{style:S.normalizeStyle(i.menuStyle),class:"dropdown-menu"},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.dropdownList,c=>(S.openBlock(),S.createElementBlock("div",{class:"item",key:c,onClick:g=>i.drillDimension(c)},"下钻"+S.toDisplayString(c),9,O9))),128))],4),[[S.vShow,i.isShowMenu]])]),S.createVNode(u,{ref:"pivotFilterRef",theme:i.theme,data:i.filterData,onChange:i.onFilterChange},null,8,["theme","data","onChange"])],64)}const W9=Mi(P9,[["render",D9],["__scopeId","data-v-fd1263c8"]]),N9=S.defineComponent({components:{PivotChart:W9},name:"ChartModal",props:{theme:{type:String,default:"light"}},setup(i,{expose:t}){const e=S.ref(!1),n=S.ref({}),o=S.ref();function r(s){n.value=s,e.value=!0,S.nextTick(()=>{o.value.init()})}return t({showModal:r}),{visible:e,chartOptions:n,chartRef:o}}});function V9(i,t,e,n,o,r){const s=S.resolveComponent("pivot-chart"),l=S.resolveComponent("a-modal");return S.openBlock(),S.createBlock(l,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[0]||(t[0]=a=>i.visible=a),"ok-text":"确认","cancel-text":"取消",title:"图形",style:{width:"900px"},destroyOnClose:!0,onOk:t[1]||(t[1]=a=>i.visible=!1)},{default:S.withCtx(()=>[S.createVNode(s,{data:i.chartOptions,theme:i.theme,ref:"chartRef"},null,8,["data","theme"])]),_:1},8,["wrapClassName","visible"])}const j9=Mi(N9,[["render",V9]]),G9=S.defineComponent({name:"PivotAggregate",props:{theme:{type:String,default:"light"}},setup(i,{emit:t,expose:e}){const n=S.ref(!1),o=S.ref([]),r=S.ref(""),s=[{label:"合计",value:"SUM"},{label:"平均值",value:"AVG"},{label:"计数",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"方差",value:"VAR"},{label:"标准差",value:"STDEV"}];function l(){t("confirm",S.unref(o),r.value),n.value=!1}function a(d,u){o.value=co.cloneDeep(d),r.value=u,n.value=!0}const h=()=>document.getElementsByClassName("aggregate-modal")[0]||document.body;return e({showModal:a}),{visible:n,aggregationType:o,options:s,dimensionKey:r,handleOk:l,getPopupContainer:h}}});function U9(i,t,e,n,o,r){const s=S.resolveComponent("a-select"),l=S.resolveComponent("a-form-item"),a=S.resolveComponent("a-form"),h=S.resolveComponent("a-modal");return S.openBlock(),S.createBlock(h,{wrapClassName:i.theme+" aggregate-modal",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:i.dimensionKey+"-聚合",destroyOnClose:!0,maskClosable:!1,onOk:i.handleOk,onCancel:t[2]||(t[2]=d=>i.visible=!1)},{default:S.withCtx(()=>[S.createVNode(a,null,{default:S.withCtx(()=>[S.createVNode(l,{label:"聚合方式"},{default:S.withCtx(()=>[S.createVNode(s,{value:i.aggregationType,"onUpdate:value":t[0]||(t[0]=d=>i.aggregationType=d),allowClear:"",options:i.options,mode:"multiple",getPopupContainer:i.getPopupContainer},null,8,["value","options","getPopupContainer"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","title","onOk"])}const $9=Mi(G9,[["render",U9]]),K9=S.defineComponent({name:"PivotTop",props:{theme:{type:String,default:"light"}},setup(i,{emit:t,expose:e}){const n=S.ref(!1),o=S.ref(""),r=S.ref("");function s(){t("confirm",{value:S.unref(o),key:S.unref(r)}),n.value=!1}function l(a){const{value:h,key:d}=a;o.value=h,n.value=!0,r.value=d}return e({showModal:l}),{visible:n,topNum:o,handleOk:s}}});function Y9(i,t,e,n,o,r){const s=S.resolveComponent("a-input"),l=S.resolveComponent("a-form-item"),a=S.resolveComponent("a-form"),h=S.resolveComponent("a-modal");return S.openBlock(),S.createBlock(h,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:"维度取Top",destroyOnClose:!0,onOk:i.handleOk},{default:S.withCtx(()=>[S.createVNode(a,null,{default:S.withCtx(()=>[S.createVNode(l,{label:"维度取Top"},{default:S.withCtx(()=>[S.createVNode(s,{value:i.topNum,"onUpdate:value":t[0]||(t[0]=d=>i.topNum=d),type:"number",style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","onOk"])}const X9=Mi(K9,[["render",Y9]]),q9=(i,t)=>{i.register.icon("sortDown",{name:"sortDown",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:15,visibleTime:"always",height:15,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:20,height:20,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"取消排序",placement:"top"}}),i.register.icon("sortUp",{name:"sortUp",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:15,visibleTime:"always",height:15,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:20,height:20,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击降序",placement:"top"}}),i.register.icon("sortNormal",{name:"sortNormal",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:15,visibleTime:"always",height:15,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:20,height:20,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击升序",placement:"top"}})};let Z9=(i=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(i));for(;i--;){let n=e[i]&63;n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n<63?t+="_":t+="-"}return t};const J9=S.defineComponent({props:{node:{type:[Object,String],required:!0}},render(){return this.node}}),Q9=((sA=window==null?void 0:window.config)==null?void 0:sA.indicatorURL)||"",vm=dA.create({baseURL:"/",validateStatus(i){return i===200},timeout:1e3*15});vm.interceptors.request.use(i=>i,i=>Promise.reject(i)),vm.interceptors.response.use(i=>{var t,e;return+((t=i==null?void 0:i.data)==null?void 0:t.code)==500&&Kn.message.error({content:((e=i==null?void 0:i.data)==null?void 0:e.msg)||"服务器异常",key:"SERVER_ERROR"}),i},i=>{if(i.message.includes("timeout"))Kn.message.error({content:"网络连接超时,请重试!",key:"TIMEOUT"});else{const{status:t}=i.response;t===401?Kn.message.error({content:"当前用户信息不正确",key:"REQUEST_ERROR"}):t>=500?Kn.message.error({content:"服务器异常",key:"REQUEST_ERROR"}):Kn.message.error({content:"请求异常",key:"REQUEST_ERROR"})}return Promise.reject(i)});const t7=S.defineComponent({name:"IndSourceList",components:{CaretRightOutlined:$N,CaretDownOutlined:VN,LoadingOutlined:p8,Draggable:Lm,ATooltip:Kn.Tooltip},props:{data:{type:Array,default:()=>[]},source:{type:String,default:""},isSub:{type:Boolean,default:!1},hasChildren:{type:Boolean,default:!1},pageId:{type:String,default:""}},setup(i,{emit:t,expose:e}){var y;const n=(y=window==null?void 0:window.config)==null?void 0:y.indicatorToken,o=S.inject("setItemDisabled",C=>!1),r=S.ref([]),s=S.ref(),l=S.reactive({pageSize:20,currentPage:1,totalResult:0}),a=S.ref(!1),h=S.ref(""),d=S.ref(!1);S.watch(()=>i.data,C=>{i.isSub&&(C==null||C.forEach(_=>{var A;_!=null&&_.isLeaf||(A=_.dataViewColumns)==null||A.forEach(R=>{R.show=!0,R.edit=!1,R.title&&(R.label=R.title)})}),r.value=C)},{deep:!0,immediate:!0});const u=()=>{var C;i.isSub||(C=S.unref(s))==null||C.removeEventListener("scroll",v)},c=async C=>{var A;if(S.unref(a))return;a.value=!0;const _={source:"INDICATOR_LIB",pageId:i.pageId,dataSourceId:"",indexName:h.value};C?(C.loading=!0,_.indexTypeGuid=C.indexTypeGuid,_.isLeaf=C.isLeaf):l&&(_.queryRequest={pageSize:l.pageSize,pageNum:l.currentPage});try{const R=await vm.post(`${Q9}/diagram/sourceList`,_,{headers:{Authentication:n,operateContext:"ygt"}}),{success:x,data:T={}}=R.data;if(x){const{rows:B=[],total:M=0}=T;B==null||B.forEach(H=>{var F;(C==null?void 0:C.isLeaf)==="1"?(F=H.dataViewColumns)==null||F.forEach(P=>{P.show=!0,P.edit=!1,P.title&&(P.label=P.title)}):H.show=!1}),C?(C.children=B,C.show=!0,B!=null&&B.length||(C.noData=!0)):(r.value=S.unref(r).concat(B),l.totalResult=+M,((A=S.unref(r))==null?void 0:A.length)>=M&&u())}C&&(C.loading=!1),a.value=!1}catch{C&&(C.loading=!1),a.value=!1}},g=async C=>{const _=r.value[C],{children:A=[]}=_;A!=null&&A.length?_.show=!_.show:!_.noData&&_.isLeaf?c(_):_.noData&&(_.show=!_.show)},f=(C,_)=>{t("onDragStart",C,_)},p=()=>{t("onDragEnd")},m=C=>{C.show=!C.show},v=C=>{C.target.scrollTop+C.target.clientHeight+20>=C.target.scrollHeight&&(l.currentPage++,c())},b=async()=>{await c(),S.nextTick(async()=>{S.unref(s).scrollHeight===S.unref(s).clientHeight&&l.totalResult>S.unref(r).length&&(l.currentPage++,b())})},w=async C=>{var _;u(),d.value=!0,l.currentPage=1,l.totalResult=0,r.value=[],h.value=C,await b(),d.value=!1,(_=S.unref(s))==null||_.addEventListener("scroll",v)};return S.onMounted(async()=>{var C;i.isSub||(b(),(C=S.unref(s))==null||C.addEventListener("scroll",v))}),S.onUnmounted(()=>{u()}),e({handleSearch:w}),{columnRef:s,sourceList:r,searchLoading:d,onToggleGroup:g,onToggleSource:m,setItemDisabled:o,onDragStart:f,onDragEnd:p,mapDataSetScope:vA,mapScope:mA,getLoadType:bA,getUseType:CA,getSourceType:yA}}}),uj="",e7={key:0,class:"no-data"},i7={class:"column-item"},n7=["onClick"],o7={key:3,class:"item-name"},r7={key:0},s7={class:"column-item"},l7={key:0},a7={key:1},h7={key:2},d7=["onClick"],u7={class:"column-child-item"},c7={class:"field"},g7={class:"column-child-item-name"};function f7(i,t,e,n,o,r){const s=S.resolveComponent("loading-outlined"),l=S.resolveComponent("caret-down-outlined"),a=S.resolveComponent("caret-right-outlined"),h=S.resolveComponent("ind-source-list",!0),d=S.resolveComponent("a-tooltip"),u=S.resolveComponent("draggable"),c=S.resolveComponent("a-spin");return S.openBlock(),S.createElementBlock("div",{class:S.normalizeClass(["columns",i.isSub?"sub-columns":""]),ref:"columnRef"},[S.createVNode(c,{spinning:i.searchLoading,tip:"数据源加载中..."},{default:S.withCtx(()=>{var g;return[!((g=i.sourceList)!=null&&g.length)&&!i.searchLoading?(S.openBlock(),S.createElementBlock("div",e7,"暂无数据")):i.hasChildren?(S.openBlock(!0),S.createElementBlock(S.Fragment,{key:1},S.renderList(i.sourceList,(f,p)=>(S.openBlock(),S.createElementBlock("div",{key:f.indexTypeGuid||f.id},[S.createElementVNode("div",i7,[S.createElementVNode("span",{style:{cursor:"pointer"},onClick:m=>i.onToggleGroup(p)},[f.loading?(S.openBlock(),S.createBlock(s,{key:0})):f.show?(S.openBlock(),S.createBlock(l,{key:1})):(S.openBlock(),S.createBlock(a,{key:2})),f.isLeaf?(S.openBlock(),S.createElementBlock("span",o7,S.toDisplayString(f.indexTypeCode+"."+f.indexTypeName),1)):S.createCommentVNode("",!0)],8,n7)]),f.show?(S.openBlock(),S.createElementBlock("div",r7,[S.createVNode(h,{data:f.children,isSub:!0,hasChildren:f.isLeaf==="0",pageId:i.pageId,source:"INDICATOR_LIB",onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd},null,8,["data","hasChildren","pageId","onOnDragStart","onOnDragEnd"])])):S.createCommentVNode("",!0)]))),128)):(S.openBlock(!0),S.createElementBlock(S.Fragment,{key:2},S.renderList(i.sourceList,f=>(S.openBlock(),S.createElementBlock("div",{key:f.id,class:S.normalizeClass(i.setItemDisabled(f.dataViewColumns)?"column-disabled":"")},[S.createElementVNode("div",s7,[S.createVNode(d,null,{title:S.withCtx(()=>[S.createElementVNode("div",null,"加载类型:"+S.toDisplayString(i.getLoadType(f.loadType)),1),f.useType?(S.openBlock(),S.createElementBlock("div",l7,"数据使用系统:"+S.toDisplayString(i.getUseType(f.useType)),1)):S.createCommentVNode("",!0),f.systemSource?(S.openBlock(),S.createElementBlock("div",a7,"制度出处:"+S.toDisplayString(f.systemSource),1)):S.createCommentVNode("",!0),f.dataTo?(S.openBlock(),S.createElementBlock("div",h7,"数据来源:"+S.toDisplayString(i.getSourceType(f.dataTo)),1)):S.createCommentVNode("",!0)]),default:S.withCtx(()=>[S.createElementVNode("span",{style:{cursor:"pointer"},onClick:p=>i.onToggleSource(f)},[f.show?(S.openBlock(),S.createBlock(l,{key:0})):(S.openBlock(),S.createBlock(a,{key:1})),S.createTextVNode(" "+S.toDisplayString((f.indexCode?f.indexCode:"")+" "+f.name),1)],8,d7)]),_:2},1024)]),f.show?(S.openBlock(),S.createBlock(u,{key:0,modelValue:f.dataViewColumns,"onUpdate:modelValue":p=>f.dataViewColumns=p,group:{name:"diGroup",pull:"clone",put:!1},"item-key":"id",sort:!1,disabled:i.setItemDisabled(f.dataViewColumns),onStart:p=>i.onDragStart(p,f),onEnd:i.onDragEnd},{item:S.withCtx(({element:p})=>[S.createElementVNode("div",u7,[S.createElementVNode("span",c7," 【"+S.toDisplayString(p.scope==="FIELD"?i.mapDataSetScope(p.genericType):i.mapScope(p.scope))+"】 ",1),S.createElementVNode("span",g7,S.toDisplayString(p.label),1)])]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onStart","onEnd"])):S.createCommentVNode("",!0)],2))),128))]}),_:1},8,["spinning"])],2)}const p7=Mi(t7,[["render",f7],["__scopeId","data-v-b4ff36e0"]]),m7={mounted(i){i.focus()}},v7=S.defineComponent({name:"PivotConfig",directives:{focus:m7},props:{theme:{type:String,default:"light"},fullMode:{type:Boolean,default:!1},pageId:{type:String,default:""}},components:{VNodeRender:J9,draggable:Lm,IndSourceList:p7,DeleteOutlined:qN},setup(i,{emit:t,expose:e}){const n=S.ref(!1),o=S.ref([]),r=S.ref(""),s=S.ref(),l=S.ref([]),a=S.ref([{title:"行维度",icon:S.createVNode(u8),fields:[]},{title:"列维度",icon:S.createVNode(l8),fields:[]},{title:"指标",icon:S.createVNode(L8),fields:[]}]),h=(A=[],R=[])=>{for(const x of S.unref(a))x.fields=[];for(const x of A)x.positionType==="rows"?S.unref(a)[0].fields.push(co.cloneDeep(x)):x.positionType==="columns"&&S.unref(a)[1].fields.push(co.cloneDeep(x));S.unref(a)[2].fields=co.cloneDeep(R),n.value=!0},d=S.computed(()=>[...S.unref(a)[0].fields.map(A=>({...A,positionType:"rows"})),...S.unref(a)[1].fields.map(A=>({...A,positionType:"columns"}))]),u=S.computed(()=>S.unref(a)[2].fields),c=()=>{l.value=[],t("confirm",S.unref(d),S.unref(u)),n.value=!1},g=(A,R)=>{const x=R.dataViewColumns[A.oldIndex]||{},{scope:T}=x;["IDX","BUILT_IN_IDX"].includes(T)?l.value=[0,1]:["DIM","BUILT_IN_DIM"].includes(T)&&(l.value=[2])},f=(A,R)=>{const x=R[A.oldIndex],{scope:T}=x;["IDX","BUILT_IN_IDX"].includes(T)?l.value=[0,1]:["DIM","BUILT_IN_DIM"].includes(T)&&(l.value=[2])},p=()=>{l.value=[]},m=()=>{a.value=co.cloneDeep(S.unref(a))},v=()=>{var A;(A=S.unref(s))==null||A.handleSearch(S.unref(r))},b=(A=[])=>{let R=!1;for(const x of S.unref(d))if(!A.find(B=>B.typeGuid===x.typeGuid)){R=!0;break}return R},w=(A,R)=>{S.unref(a)[A].fields.splice(R,1)},y=S.ref(),C=(A,R)=>{i.fullMode&&(y.value=`${A}_${R}`)},_=()=>{y.value=""};return S.provide("setItemDisabled",b),e({showModal:h}),{visible:n,fieldAreas:a,dataSourceList:o,indSourceRef:s,searchText:r,maskList:l,currentEditItem:y,handleOk:c,onSearch:v,onDragStart:g,onDragAreaStart:f,onDragEnd:p,handleDeleteField:w,handleEdit:C,onConfirmLabel:_,onDragAdd:m}}}),cj="",b7={key:0,class:"data-source-list"},C7={class:"area-title"},y7={class:"field-item"},_7=["onClick"];function w7(i,t,e,n,o,r){const s=S.resolveComponent("a-input-search"),l=S.resolveComponent("ind-source-list"),a=S.resolveComponent("v-node-render"),h=S.resolveComponent("a-input"),d=S.resolveComponent("delete-outlined"),u=S.resolveComponent("draggable"),c=S.resolveComponent("a-button"),g=S.resolveComponent("a-modal"),f=S.resolveDirective("focus");return S.openBlock(),S.createBlock(g,{wrapClassName:i.theme,title:"设置",visible:i.visible,"onUpdate:visible":t[2]||(t[2]=p=>i.visible=p),"ok-text":"确认","cancel-text":"取消",maskClosable:!1,destroyOnClose:!1,style:S.normalizeStyle({width:i.fullMode?"900px":"500px"}),bodyStyle:{padding:0},onOk:i.handleOk},{footer:S.withCtx(()=>[S.createVNode(c,{onClick:t[1]||(t[1]=p=>i.visible=!1)},{default:S.withCtx(()=>t[3]||(t[3]=[S.createTextVNode("取消")])),_:1}),S.createVNode(c,{type:"primary",onClick:i.handleOk},{default:S.withCtx(()=>t[4]||(t[4]=[S.createTextVNode("确定")])),_:1},8,["onClick"])]),default:S.withCtx(()=>[S.createElementVNode("div",{class:"config-wrap",style:S.normalizeStyle({height:i.fullMode?"350px":""})},[i.fullMode?(S.openBlock(),S.createElementBlock("div",b7,[S.createVNode(s,{value:i.searchText,"onUpdate:value":t[0]||(t[0]=p=>i.searchText=p),placeholder:"请输入关键字",style:{width:"90%"},onSearch:i.onSearch},null,8,["value","onSearch"]),S.createVNode(l,{ref:"indSourceRef",data:i.dataSourceList,hasChildren:!0,isSub:!1,pageId:i.pageId,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd,source:"INDICATOR_LIB"},null,8,["data","pageId","onOnDragStart","onOnDragEnd"])])):S.createCommentVNode("",!0),S.createElementVNode("div",{class:"area-content",style:S.normalizeStyle({width:i.fullMode?"60%":"100%"})},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(i.fieldAreas,(p,m)=>(S.openBlock(),S.createElementBlock("div",{class:"area-item",key:m},[S.createElementVNode("div",C7,[S.createVNode(a,{class:"area-icon",node:p.icon},null,8,["node"]),S.createTextVNode(" "+S.toDisplayString(p.title),1)]),S.createVNode(u,{class:"area-list",list:p.fields,"item-key":"index",group:{name:"diGroup"},disabled:i.maskList.includes(m),onStart:v=>i.onDragAreaStart(v,p.fields),onEnd:i.onDragEnd,onAdd:i.onDragAdd},{item:S.withCtx(({index:v,element:b})=>[S.createElementVNode("div",y7,[i.currentEditItem===`${m}_${v}`?S.withDirectives((S.openBlock(),S.createBlock(h,{key:0,size:"small",value:b.label,"onUpdate:value":w=>b.label=w,onPressEnter:i.onConfirmLabel,onBlur:i.onConfirmLabel},null,8,["value","onUpdate:value","onPressEnter","onBlur"])),[[f]]):(S.openBlock(),S.createElementBlock("div",{key:1,style:{width:"100%"},onClick:w=>i.handleEdit(m,v)},S.toDisplayString(b.label),9,_7)),i.fullMode?(S.openBlock(),S.createBlock(d,{key:2,style:{color:"red","padding-left":"8px"},onClick:w=>i.handleDeleteField(m,v)},null,8,["onClick"])):S.createCommentVNode("",!0)])]),_:2},1032,["list","disabled","onStart","onEnd","onAdd"])]))),128))],4)],4)]),_:1},8,["wrapClassName","visible","style","onOk"])}const S7=Mi(v7,[["render",w7],["__scopeId","data-v-5d2307d6"]]),bm=S.defineComponent({name:"PivotTable",components:{PivotFilter:Fx,PivotProperty:Y5,ConditionalProperty:M9,ChartModal:j9,PivotAggregate:$9,PivotTop:X9,PivotConfig:S7,SettingOutlined:M8},props:{id:{type:String,default:""},name:{type:String,default:""},keyName:{type:String,default:""},type:{type:String,default:""},width:{type:String,default:""},height:{type:String,default:""},position:{type:String,default:""},top:{type:String,default:""},left:{type:String,default:""},zIndex:{type:Number,default:1},events:{type:Array,default:()=>[]},dataType:{type:String,default:""},graphicConfig:{type:Object,default:()=>({})},data:{type:Array,default:()=>[]},scale:{type:Number,default:0},dimensionList:{type:Array,default:()=>[]},indicatorList:{type:Array,default:()=>[]},pageMode:{type:String,default:""},calculateList:{type:Array,default:()=>[]},styleConfig:{type:Object,default:()=>({})},theme:{type:String,default:"light"},fullMode:{type:Boolean,default:!1},pageId:{type:String,default:""},indicatorUrl:{type:String,default:""}},setup(i,{expose:t,emit:e}){let n=null;const o=S.ref(!1),r=S.ref(""),s=S.ref({}),l=S.ref(),a=S.ref({}),h=S.ref({}),d=S.ref(),u=S.ref(),c=S.ref({}),g=S.ref(),f=S.ref(),p=S.ref(),m=S.ref(),v=S.ref(),b=S.ref(),w=S.ref(),y=S.ref(!1),C=S.ref({}),_=S.ref({}),A=S.ref({}),R=S.ref(),x=S.ref([]),T=S.ref({}),B=S.ref("200px"),M=S.ref("200px");S.provide("indicatorUrl",i.indicatorUrl);const H={LAST_DATA:"上期值",SAME_DATA:"同期值",DIFF_DATA:"增减额",MOM_DATA:"环比(%)",YOY_DATA:"同比(%)"},F=[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"图形",menuKey:"graph"},{text:"筛选",menuKey:"filter"}],P=["合计","平均值","计数","最大值","最小值","方差","标准差"],L=`|${Z9(6)}|`,k=S.computed(()=>{const K={},{styleConfig:Q}=i;for(const rt in Q)K[rt]=Q[rt]||"transparent";return K}),I=S.ref([]),E=S.ref([]),z=S.computed(()=>{var K;return(K=S.unref(k))==null?void 0:K.dropDownMenuBgColor}),O=S.computed(()=>{var K;return(K=S.unref(k))==null?void 0:K.dropDownMenuColor}),N=S.computed(()=>{var K;return(K=S.unref(k))==null?void 0:K.dropDownMenuHightLightColor});q9(z5,{sortNotActiveColor:S.unref(k).sortNotActiveColor,sortActiveColor:S.unref(k).sortActiveColor});const W=S.ref([]),j=S.ref({}),G=S.ref({}),V=S.reactive({records:[],columnHeaderTitle:!0,excelOptions:{fillHandle:!0},rows:[],columns:[],indicators:[],corner:{titleOnDimension:"row"},dataConfig:{sortRules:[],filterRules:[]},widthMode:"standard",menu:{renderMode:"html",dropDownMenuHighlight:[]},theme:{cellInnerBorder:!1,underlayBackgroundColor:"transparent",headerStyle:{bgColor(K){return S.unref(W).includes(K.dataValue)?S.unref(k).indicatorsHeaderBgColor:S.unref(k).headerBgColor},color(K){return S.unref(W).includes(K.dataValue)?S.unref(k).indicatorsHeaderColor:S.unref(k).headerColor},borderColor:S.unref(k).borderColor},cornerHeaderStyle:{bgColor:S.unref(k).headerBgColor,color:S.unref(k).headerColor,borderColor:S.unref(k).borderColor},bodyStyle:{borderColor:S.unref(k).borderColor,color(K){var st,vt;const Q=K.cellHeaderPaths.rowHeaderPaths,rt=K.cellHeaderPaths.colHeaderPaths;return P.includes((st=Q==null?void 0:Q[Q.length-1])==null?void 0:st.value)?S.unref(k).aggregateColor:S.unref(W).includes((vt=rt==null?void 0:rt[rt.length-1])==null?void 0:vt.value)?S.unref(k).indicatorsBodyColor:S.unref(k).bodyColor},bgColor(K){var st,vt;const Q=K.cellHeaderPaths.rowHeaderPaths,rt=K.cellHeaderPaths.colHeaderPaths;return P.includes((st=Q==null?void 0:Q[Q.length-1])==null?void 0:st.value)?S.unref(k).aggregateBgColor:S.unref(W).includes((vt=rt==null?void 0:rt[rt.length-1])==null?void 0:vt.value)?S.unref(k).indicatorsBodyBgColor:S.unref(k).bodyBgColor}},rowHeaderStyle:{borderColor:S.unref(k).borderColor,bgColor(K){return P.includes(K.dataValue)?S.unref(k).aggregateBgColor:S.unref(k).bodyBgColor},color(K){return P.includes(K.dataValue)?S.unref(k).aggregateColor:S.unref(k).bodyColor}}}}),$=S.ref([]),U=S.ref({}),tt=S.ref({});S.watch(y,K=>{if(K){const Q={},rt=Cm();rt&&(Q.width=rt.width+"px",Q.height=rt.height+"px",Q.top=rt.top+"px",Q.left=rt.left+"px"),U.value=Q}});function ot(K,Q=!0,rt=-1){if(rt>-1)V.indicators.splice(rt,0,...K);else for(const st of K)V.indicators.push(st);Q&&n.updateOption(V)}function ut({label:K,calcType:Q}){const rt=[],st=S.unref(G)[K]||[];for(const vt in H)st.indexOf(vt)===-1&&rt.push({text:H[vt],menuKey:vt});return Q==="FORMULA"||!(rt!=null&&rt.length)?F:[{text:"计算",menuKey:"calculate",children:rt},...F]}function pt(){const K=[{text:"钻取",menuKey:"drill"},{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"筛选",menuKey:"filter"},{text:"聚合",menuKey:"aggregate"},{text:"取top",menuKey:"top"},{text:"删除",menuKey:"delete"}],Q=[],rt=S.unref($).filter(st=>S.unref(x).includes(st));if(rt!=null&&rt.length)for(const st of rt)Q.push({text:st,menuKey:st});return Q!=null&&Q.length?K[0].children=Q:K.splice(0,1),K}function Y(K,Q){y.value=!0,S.unref(T)[Q]=K||[],e("tableChange",{type:"9",data:S.unref(T)})}function q(K,Q=!0){var rt;for(const st of K){const{key:vt,name:Et,type:gt,dimensionKey:It,width:$t}=st;if(S.unref(x).includes(vt))continue;let Ce;if(It)Ce=st;else{const Te={dimensionKey:vt,title:Et,width:$t?`${$t}%`:"auto",type:gt};gt==="columns"?Te.headerStyle={textStick:!0}:gt==="rows"&&(Te.cornerHeaderIcon="sortNormal"),Te.headerFormat=$i=>{const Hi=$i==null?void 0:$i.split(L);return Hi!=null&&Hi.length?Hi[Hi.length-1]:$i},Ce=Te}if(Ce&&(Ce.headerStyle={textStick:!0},V[gt].push(Ce)),(rt=V[gt])!=null&&rt.length)for(const Te of V[gt])Te.cornerDropDownMenu=pt();V.dataConfig.sortRules.push({sortField:vt,sortType:S.unref(r)})}Q&&n.updateOption(V),S.nextTick(()=>{ht()})}function dt(K){const Q={},{records:rt}=V;for(const st of rt)for(const vt of K)fA(Q,vt)?Q[vt].find(Et=>Et.value===st[vt])||Q[vt].push({value:st[vt]}):Q[vt]=[{value:st[vt]}];return Q}function ht(){console.log("tableInstance",n);const{dataset:{columns:K,rows:Q}}=n,rt=Q.concat(K);s.value=dt(rt)}const _t=S.ref(),Ct=K=>{var Hi;let Q=K;K?_t.value=co.cloneDeep(K):Q=co.cloneDeep(S.unref(_t)),y.value=!0;const{data:rt={}}=(Q==null?void 0:Q.data)||{},{rows:st=[]}=rt,{calculateList:vt}=i,Et=[],gt=[];for(const Rt of S.unref(I)){if(!Rt.show)continue;const Be=V[Rt.positionType].find(wi=>wi.dimensionKey===Rt.label);Be?gt.push(Be):(S.unref($).includes(Rt.label)||$.value.push(Rt.label),gt.push({key:Rt.label,name:Rt.label,type:Rt.positionType,width:Rt.width}))}for(const Rt of S.unref(E)){if(!Rt.show)continue;const Be=ut(Rt),wi=V.indicators.find(Ki=>Ki.indicatorKey===Rt.label);let ii={};wi?ii={...wi,dropDownMenu:Be}:ii={indicatorKey:Rt.label,title:Rt.label,width:Rt!=null&&Rt.width?`${Rt.width}%`:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},dropDownMenu:Be,format:(Ki,qr,Zr,B7)=>{const ym=B7.getRecordByCell(qr,Zr)||[];return ym[0]&&isNaN(+ym[0][Rt.label])?ym[0][Rt.label]:Ki}},ii&&(ii.style={padding:[16,28,16,28]},Et.push(ii))}if(V.indicators=[],V.rows=[],V.columns=[],vt!=null&&vt.length)for(const Rt of vt)isNaN(+Rt.position)||Et.splice(+Rt.position,0,{...Rt.data,calculateType:Rt.calculateType});const{sortType:It,col:$t,row:Ce}=S.unref(R)||{};for(const Rt of Et)Rt&&(Rt.headerIcon=Be=>{const{col:wi,row:ii}=Be;if($t===wi&&Ce===ii){let Ki="sortNormal";return It==="ASC"?Ki="sortUp":It==="DESC"&&(Ki="sortDown"),Ki}else return"sortNormal"});ot(Et,!1),q(gt,!1);const Te=[],$i=gt.filter(Rt=>Rt.type==="rows").map(Rt=>Rt.key||Rt.dimensionKey);for(const Rt of st)for(const Be in Rt)if(!P.includes(Rt[Be])){const wi=$i.indexOf(Be);if(wi!==-1){const ii=[];for(let Ki=0;Ki<=wi;Ki++){const qr=Rt[$i[Ki]];if(qr.includes(L)){const Zr=qr.split(L);Zr!=null&&Zr.length&&ii.push(Zr[Zr.length-1])}else ii.push(qr)}ii!=null&&ii.length&&(Rt[Be]=ii.join(L))}}for(const Rt of gt){const Be=(Rt==null?void 0:Rt.key)||(Rt==null?void 0:Rt.dimensionKey);if(Rt.type==="columns"&&!S.unref(A)[Be])S.unref(A)[Be]=St("",Be,st);else if(Rt.type==="rows")if(S.unref(_)[Be]){const{type:wi}=S.unref(_)[Be]||{};Te.push(St(wi,Be,st))}else if(!S.unref(R)||S.unref(R).sortField===Be||!n)Te.push(St("",Be,st));else{const wi=V.dataConfig.sortRules.find(ii=>ii.sortField===Be);wi&&Te.push(wi)}}if(S.unref(R)&&Te.push(S.unref(R)),(Hi=Object.keys(S.unref(A)))!=null&&Hi.length)for(const Rt in S.unref(A))Te.push(S.unref(A)[Rt]);if(V.records=st,V.dataConfig.sortRules=Te,n)n.updateOption(V),S.nextTick(()=>{var Rt;(Rt=V.records)!=null&&Rt.length||it(),wt()}),y.value=!1;else{const Rt=document.getElementById(`pivotTableContainer_${i.id}`);n=new Ex(Rt,V),S.nextTick(()=>{var Be;(Be=V.records)!=null&&Be.length||it(),o.value=!0,y.value=!1;for(const wi of gt){const{key:ii}=wi,Ki=new Set;for(const qr of st)Ki.add(qr[ii]);S.unref(a)[ii]=Array.from(Ki)}wt()}),xt()}console.log("option",V)};function wt(){const K=Cm();K&&(S.unref(tt).right=parseFloat(i.width)-K.width+2+"px")}function it(){if(n){const{dataset:{rows:K}}=n,Q={};for(const rt of K)Q[rt]="";n.updateOption({...V,dataConfig:{...V.dataConfig,filterRules:[]},records:[Q]})}}function At(K,Q){y.value=!0,e("tableChange",{type:"3",data:{type:"indicators",key:K,rule:Q}})}function nt(K,Q){y.value=!0,e("tableChange",{type:"3",data:{type:"dimension",key:K,rule:Q}})}function Ut(K,Q){const rt=V[Q].findIndex(vt=>vt.dimensionKey===K),st=V.dataConfig.sortRules.findIndex(vt=>vt.sortField===K);if(rt!==-1){V[Q].splice(rt,1);for(const vt of V[Q])vt.cornerDropDownMenu=pt();S.unref(x).includes(K)||S.unref(x).push(K),y.value=!0,e("tableChange",{type:"7"})}st!==-1&&(V.dataConfig.sortRules[st].sortType=r),n.updateOption(V),S.nextTick(()=>{ht(),delete a.value[K]})}function qt(K){const{indicators:Q}=V,rt=Q.findIndex(st=>st.indicatorKey===K);if(rt!==-1){const st=Q[rt];if(Q.splice(rt,1),st.calculateType){const vt=st.indicatorKey.split("@"+st.calculateType)[0],Et=S.unref(G)[vt].indexOf(st.calculateType);Et!==-1&&S.unref(G)[vt].splice(Et,1);const gt=S.unref(W).indexOf(st.title);gt!==-1&&S.unref(W).splice(gt,1),delete S.unref(j)[st.title]}e("tableChange",{type:"2",data:st.indicatorKey})}}function St(K,Q,rt){let st=[];const vt=new Set;for(const Et of rt){const gt=Et[Q];gt&&!P.includes(gt)&&vt.add(gt)}return st=Array.from(vt),K==="asc"?st=st.sort((Et,gt)=>Et.localeCompare(gt)):K==="desc"&&(st=st.sort((Et,gt)=>gt.localeCompare(Et))),{sortField:Q,sortBy:[...st,...P]}}function Wt(K,Q,rt,st){y.value=!0;let{menu:{dropDownMenuHighlight:vt},rows:Et}=V;st=st+1,vt=vt.filter(It=>!(It.type==="dimension"&&It.field===Q)||It.type==="indicator"),vt.push({col:rt,row:st-1,field:Q,type:"dimension",menuKey:K}),V.menu.dropDownMenuHighlight=vt;const gt=Et.find(It=>It.dimensionKey===Q);if(gt){let It="sortNormal";K==="asc"?It="sortUp":K==="desc"&&(It="sortDown"),gt.cornerHeaderIcon=It}n.updateOption(V),K==="default-sort"?delete S.unref(_)[Q]:S.unref(_)[Q]={type:K},e("tableChange",{type:"4",data:{key:Q,order:K,type:"dimension"}})}function gi(K,Q,rt,st,vt){var Hi;y.value=!0;const{menu:Et}=V;let gt=Et.dropDownMenuHighlight,It="";(Hi=V.rows)!=null&&Hi.length&&(It=V.rows[V.rows.length-1].dimensionKey);const $t=rt.filter((Rt,Be)=>Be<rt.length-1),Ce=$t.map(Rt=>({columnName:Rt.dimensionKey})),Te=$t.map(Rt=>Rt.value),$i=gt.findIndex(Rt=>Rt.field===It&&Rt.type==="dimension");$i!==-1&>.splice($i,1),gt=gt.filter(Rt=>Rt.type==="dimension"),gt.push({col:st,row:vt,field:Q,type:"indicator",menuKey:K}),V.menu.dropDownMenuHighlight=gt,n.updateOption(V),K==="default-sort"?R.value=null:R.value={sortField:It,sortByIndicator:Q,sortType:K.toUpperCase(),query:Te,col:st,row:vt},e("tableChange",{type:"4",data:{key:Q,order:K,type:"indicators",columnData:Te,columnHeader:Ce}})}function _i(K,Q,rt){y.value=!0;const st=n.getCellValue(Q,rt),vt={};S.unref(a)[K]&&(vt.filterData=S.unref(a)[K]),e("tableChange",{type:"5",data:{key:K,callback:Et=>{d.value={tableInstance:n,fieldName:st,key:K,valueList:Et||[],type:"dimension",...vt},S.nextTick(()=>{y.value=!1,S.unref(u).show()})}}})}function Pi(K,Q){d.value={tableInstance:n,fieldName:Q,key:K,type:"indicators",filterData:S.unref(h)[K]},S.nextTick(()=>{S.unref(u).show()})}function ji({indicatorKey:K,menuKey:Q}){y.value=!0;let rt=V.indicators.length-1;const st=`${K}@${Q}`,vt=`${K}(${H[Q]}) fx`;S.unref(W).push(vt),S.unref(j)[vt]=st,V.indicators.forEach((Et,gt)=>{Et.indicatorKey===K&&(rt=gt+1)}),S.unref(G)[K]||(S.unref(G)[K]=[]),S.unref(G)[K].push(Q),e("tableChange",{type:"1",data:{data:{indicatorKey:st,title:vt,width:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},headerIcon:"sortNormal",dropDownMenu:[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"删除",menuKey:"delete"}],style:{padding:[16,28,16,28]},format:(Et,gt,It,$t)=>{const Ce=$t.getRecordByCell(gt,It)||[];return Ce[0]&&isNaN(+Ce[0][st])?Ce[0][st]:Et}},position:rt,indicatorKey:K,calculateType:Q}})}function Gi(){const K=V.rows[0]?V.rows[0].cornerDropDownMenu:[],Q=V.columns[0]?V.columns[0].cornerDropDownMenu:[],rt=V.rows.map(gt=>({...gt,cornerDropDownMenu:Q})),st=V.columns.map(gt=>({...gt,cornerDropDownMenu:K}));V.columns=rt,V.rows=st;const{type:vt,len:Et}=V.aggregate||{};vt&&(V.records.splice(-Et),V.aggregate={type:vt,len:0}),V.menu.dropDownMenuHighlight=[],a.value={},h.value={},c.value={},V.dataConfig.filterRules=[],n.updateOption(V)}function si({indicatorKey:K,fieldName:Q}){const rt=de(K);if(rt>-1){const st=V.indicators[rt].formatConfig||{};S.unref(g).showModal({...st,indicatorKey:K,fieldName:Q})}}function ei(K){const Q=de(K);if(Q>-1){const rt=V.indicators[Q].conditionalConfig||[];S.unref(f).showModal(K,rt)}}function de(K){return V.indicators.findIndex(Q=>Q.indicatorKey===K)}function yt(K){const Q=S.unref($)[0],rt=dt(S.unref($)),st={xLabel:Q,yLabel:K,dimensionData:rt,records:V.records};console.log(st),S.unref(b).showModal(st)}function xt(){n.on("resize_column",K=>{wt()}),n.on("icon_click",K=>{const{name:Q,col:rt,row:st}=K;if(["sortNormal","sortUp","sortDown"].includes(Q)){const{rows:vt,indicators:Et}=V;let gt=n.getCellValue(rt,st);S.unref(W).includes(gt)&&(gt=S.unref(j)[gt]);const It=vt.find(Te=>Te.dimensionKey===gt),$t=Et.find(Te=>Te.indicatorKey===gt);let Ce="default-sort";if(Q==="sortUp"?Ce="desc":Q==="sortDown"?Ce="default-sort":(!Q||Q==="sortNormal")&&(Ce="asc"),$t){const Te=n.getCellHeaderPaths(rt,st);gi(Ce,gt,(Te==null?void 0:Te.colHeaderPaths)||[],rt,st)}else It&&Wt(Ce,gt,rt,st)}}),n.on("show_menu",()=>{const K=document.querySelector(`#pivotTableContainer_${i.id} .vtable__menu-element`);K&&(K.classList.add("first"),B.value=parseFloat(K.style.left)+K.clientWidth+3+"px",M.value=parseFloat(K.style.top)+"px")}),n.on("dropdown_menu_click",K=>{const{menuKey:Q,field:rt,col:st,row:vt}=K,{dimensionKey:Et,indicatorKey:gt,value:It}=rt[rt.length-1];if(l.value=K,S.unref($).includes(Q)){if(S.unref(x).includes(Q)){const $t=S.unref(x).findIndex(Ce=>Ce===Q);S.unref(x).splice($t,1)}q([{key:Q,name:Q,type:"rows"}]),y.value=!0,e("tableChange",{type:"8"})}switch(Q){case"drill":alert("无维度可钻取");break;case"delete":Et?Ut(Et,"rows"):gt&&qt(gt);break;case"asc":case"desc":case"default-sort":Et?Wt(Q,Et,st,vt):gt&&gi(Q,gt,rt,st,vt);break;case"filter":Et?_i(Et,st,vt):gt&&Pi(gt,It);break;case"LAST_DATA":case"SAME_DATA":case"DIFF_DATA":case"MOM_DATA":case"YOY_DATA":case"zb":ji({indicatorKey:gt,menuKey:Q});break;case"trans":Gi();break;case"property":si({indicatorKey:gt,fieldName:It});break;case"conditionalProperty":ei(gt);break;case"aggregate":S.unref(p).showModal(S.unref(T)[Et]||[],Et);break;case"top":Vt(Et);break;case"graph":yt(gt);break}setTimeout(()=>{console.log("option",V)},500)})}function Vt(K){S.unref(m).showModal({value:S.unref(C)[K]||"",key:K})}function Zt(){S.unref(v).showModal(S.unref(I),S.unref(E))}function ge(K=[],Q=[]){I.value=K,E.value=Q,i.fullMode?(_.value={},R.value={},A.value={},y.value=!0,e("tableChange",{type:"10",data:{dimensions:S.unref(I),indicators:S.unref(E)}})):Ct()}const jt=K=>{Ct(K)},Pt=()=>{},fe=({checkKeys:K,key:Q,type:rt})=>{rt==="dimension"?(a.value[Q]=K,c.value={},nt(Q,K)):rt==="indicators"&&(h.value[Q]=K,At(Q,K))};function Tt(K){const{indicatorKey:Q,unit:rt="",format:st,floatLength:vt,position:Et}=K,gt=de(Q);if(gt>-1){const It=V.indicators[gt];It.formatConfig=K,It.format=($t,Ce,Te,$i)=>{const Hi=$i.getRecordByCell(Ce,Te)||[];return Hi[0]&&isNaN(+Hi[0][It.indicatorKey])?Hi[0][It.indicatorKey]:(st==="integer"?$t=Math.round(Number($t)):st==="float"&&!isNaN(vt)?$t=Number($t).toFixed(vt):st==="percent"&&($t=Number($t)*100+"%"),Et==="right"?$t+rt:rt+$t)},n.updateOption(V)}}function Ot(K,Q=[]){const rt=de(K);if(rt>-1){const st=V.indicators[rt];st.conditionalConfig=Q;const vt=[];Q.forEach(Et=>{let gt="";Et.conditions.forEach((It,$t)=>{$t>0&&(gt+=It.join==="and"?" && ":" || "),gt+=`value${It.operation}${It.value}`}),vt.push(gt)}),st.style.color=({dataValue:Et})=>{let gt="#333";return Q.forEach((It,$t)=>{It.color&&(gt=be(vt[$t],Et)?It.color:gt)}),gt},st.style.textAlign=({dataValue:Et})=>{let gt="left";return Q.forEach((It,$t)=>{It.align&&(gt=be(vt[$t],Et)?It.align:gt)}),gt},st.customRender=({rect:Et,dataValue:gt})=>{let It=[];return Q.forEach(($t,Ce)=>{if($t.icon&&be(vt[Ce],gt)){const $i=pA($t.icon,$t.iconColor);It=[{type:"icon",x:$t.align!=="right"?15:Et.width-25,y:Et.height/2-7,svg:$i,height:14,width:14}]}}),{elements:It,renderDefault:!0}},n.updateOption(V)}}function be(K,Q){K=K||"true";const rt=`function (value){
|
|
365
365
|
if(${K}){
|
|
366
366
|
return true
|
|
367
367
|
}else{
|
|
368
368
|
return false
|
|
369
369
|
}
|
|
370
|
-
}`;return Function(`"use strict";return (${rt})`)().call(this,Q)}function Ui(K){y.value=!0;const{value:Q,key:rt}=K;S.unref(C)[rt]=Q,e("tableChange",{type:"6",data:S.unref(C)})}function Cm(){return n==null?void 0:n.getDrawRange()}return t({option:V,refreshData:jt,click:Pt,getDrawRange:Cm}),S.
|
|
370
|
+
}`;return Function(`"use strict";return (${rt})`)().call(this,Q)}function Ui(K){y.value=!0;const{value:Q,key:rt}=K;S.unref(C)[rt]=Q,e("tableChange",{type:"6",data:S.unref(C)})}function Cm(){return n==null?void 0:n.getDrawRange()}return t({option:V,refreshData:jt,click:Pt,getDrawRange:Cm}),S.watch(()=>[i.graphicConfig,i.dimensionList,i.indicatorList],([K,Q,rt])=>{const{queryColumnList:st=[],indicators:vt=[]}=K,Et=co.cloneDeep(st),gt=co.cloneDeep(vt);for(const It of Et){const $t=Q.find(Ce=>Ce.key===It.name);It.positionType=($t==null?void 0:$t.position)||"rows",It.width=$t==null?void 0:$t.width}for(const It of gt){const $t=rt.find(Ce=>Ce.key===It.name);It.width=$t==null?void 0:$t.width}I.value=Et,E.value=gt},{immediate:!0,deep:!0}),S.onMounted(()=>{}),{dropDownMenuColor:O,dropDownMenuBgColor:z,dropDownMenuHightLightColor:N,styleData:k,subMenuLeft:B,subMenuTop:M,pivotTableRef:w,pivotFilterRef:u,pivotPropertyRef:g,conditionalPropertyRef:f,chartModalRef:b,pivotTopRef:m,pivotConfigRef:v,pivotAggregateRef:p,filterData:d,loadingRect:U,loading:y,click:Pt,isTableInit:o,configStyle:tt,onFilterChange:fe,handleFormat:Tt,handleCondition:Ot,handleAggregate:Y,handleGetTop:Ui,handleConfig:Zt,handleGetConfig:ge}}}),iA=()=>{S.useCssVars(i=>({"446837ea":i.dropDownMenuBgColor,"57ad9490":i.dropDownMenuColor,f49644e8:i.dropDownMenuHightLightColor,"41ec7ea3":i.subMenuLeft,e2f8c18e:i.subMenuTop}))},nA=bm.setup;bm.setup=nA?(i,t)=>(iA(),nA(i,t)):iA;const gj="",fj="",x7={key:0,class:"design-template"},R7=["id"];function A7(i,t,e,n,o,r){const s=S.resolveComponent("pivot-filter"),l=S.resolveComponent("pivot-property"),a=S.resolveComponent("conditional-property"),h=S.resolveComponent("chart-modal"),d=S.resolveComponent("pivot-aggregate"),u=S.resolveComponent("pivot-top"),c=S.resolveComponent("pivot-config"),g=S.resolveComponent("a-spin"),f=S.resolveComponent("setting-outlined");return i.pageMode==="design"?(S.openBlock(),S.createElementBlock("div",x7," 透视表格 ")):(S.openBlock(),S.createElementBlock(S.Fragment,{key:1},[S.createElementVNode("div",{class:"table-instance",id:i.pageMode!=="design"?`pivotTableContainer_${i.id}`:"",ref:"pivotTableRef"},null,8,R7),S.createVNode(s,{ref:"pivotFilterRef",data:i.filterData,theme:i.theme,onChange:i.onFilterChange},null,8,["data","theme","onChange"]),S.createVNode(l,{ref:"pivotPropertyRef",theme:i.theme,onChange:i.handleFormat},null,8,["theme","onChange"]),S.createVNode(a,{ref:"conditionalPropertyRef",theme:i.theme,onChange:i.handleCondition},null,8,["theme","onChange"]),S.createVNode(h,{ref:"chartModalRef",theme:i.theme},null,8,["theme"]),S.createVNode(d,{ref:"pivotAggregateRef",theme:i.theme,onConfirm:i.handleAggregate},null,8,["theme","onConfirm"]),S.createVNode(u,{ref:"pivotTopRef",theme:i.theme,onConfirm:i.handleGetTop},null,8,["theme","onConfirm"]),S.createVNode(c,{ref:"pivotConfigRef",theme:i.theme,fullMode:i.fullMode,pageId:i.pageId,onConfirm:i.handleGetConfig},null,8,["theme","fullMode","pageId","onConfirm"]),i.loading?(S.openBlock(),S.createElementBlock("div",{key:0,class:"pivot-loading",style:S.normalizeStyle(i.loadingRect)},[S.createVNode(g,{size:"large"})],4)):S.createCommentVNode("",!0),i.pageMode!=="design"&&!i.graphicConfig.preview&&i.isTableInit?(S.openBlock(),S.createElementBlock("div",{key:1,class:S.normalizeClass(["pivot-config",i.theme]),style:S.normalizeStyle(i.configStyle),onClick:t[0]||(t[0]=(...p)=>i.handleConfig&&i.handleConfig(...p))},[S.createVNode(f,{style:{"font-size":"22px"}})],6)):S.createCommentVNode("",!0)],64))}const oA=gA(Mi(bm,[["render",A7],["__scopeId","data-v-f7872593"]])),rA=Object.freeze(Object.defineProperty({__proto__:null,EcanPivotTable:oA},Symbol.toStringTag,{value:"Module"})),T7={install:(i,t)=>{const{request:e}=t;i.provide("$request",e),Object.keys(rA).forEach(n=>{const o=rA[n];o.install&&i.use(o)})}};Ei.EcanPivotTable=oA,Ei.default=T7,Object.defineProperties(Ei,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
371
371
|
//# sourceMappingURL=index.umd.js.map
|