evui 3.22.0 → 3.23.0

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.
@@ -1,18 +1,18 @@
1
- (function(le,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(le=typeof globalThis<"u"?globalThis:le||self,o(le.evui={},le.Vue))})(this,function(le,o){"use strict";function jc(e,t){const n=Object.create(null),i=e.split(",");for(let s=0;s<i.length;s++)n[i[s]]=!0;return s=>!!n[s]}const Bs=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV==="production"||Object.freeze([]);const Cl=()=>{},Qc=/^on[^a-z]/,$c=e=>Qc.test(e),dt=Object.assign,qc=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ed=Object.prototype.hasOwnProperty,Wi=(e,t)=>ed.call(e,t),Ce=Array.isArray,mn=e=>Zi(e)==="[object Map]",td=e=>Zi(e)==="[object Set]",Be=e=>typeof e=="function",xt=e=>typeof e=="string",Gi=e=>typeof e=="symbol",Ue=e=>e!==null&&typeof e=="object",nd=e=>(Ue(e)||Be(e))&&Be(e.then)&&Be(e.catch),id=Object.prototype.toString,Zi=e=>id.call(e),kl=e=>Zi(e).slice(8,-1),sd=e=>Zi(e)==="[object Object]",Os=e=>xt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,od=(e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),pn=(e,t)=>!Object.is(e,t),ld=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})};let wl;const Ys=()=>wl||(wl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Fs(e){if(Ce(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],s=xt(i)?dd(i):Fs(i);if(s)for(const l in s)t[l]=s[l]}return t}if(xt(e)||Ue(e))return e}const ad=/;(?![^(]*\))/g,rd=/:([^]+)/,cd=/\/\*[^]*?\*\//g;function dd(e){const t={};return e.replace(cd,"").split(ad).forEach(n=>{if(n){const i=n.split(rd);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function zs(e){let t="";if(xt(e))t=e;else if(Ce(e))for(let n=0;n<e.length;n++){const i=zs(e[n]);i&&(t+=i+" ")}else if(Ue(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Il(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Tl;const Hs=e=>{const t=new Set(e);return t.w=0,t.n=0,t},Ll=e=>(e.w&Nt)>0,Ml=e=>(e.n&Nt)>0,As=new WeakMap;let Wn=0,Nt=1;const _s=30;let Je;const Ut=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Ks=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");class hd{constructor(t,n=null,i){this.fn=t,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,function(s,l=Tl){l&&l.active&&l.effects.push(s)}(this,i)}run(){if(!this.active)return this.fn();let t=Je,n=Jt;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=Je,Je=this,Jt=!0,Nt=1<<++Wn,Wn<=_s?(({deps:i})=>{if(i.length)for(let s=0;s<i.length;s++)i[s].w|=Nt})(this):vl(this),this.fn()}finally{Wn<=_s&&(i=>{const{deps:s}=i;if(s.length){let l=0;for(let a=0;a<s.length;a++){const r=s[a];Ll(r)&&!Ml(r)?r.delete(i):s[l++]=r,r.w&=~Nt,r.n&=~Nt}s.length=l}})(this),Nt=1<<--Wn,Je=this.parent,Jt=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Je===this?this.deferStop=!0:this.active&&(vl(this),this.onStop&&this.onStop(),this.active=!1)}}function vl(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let Jt=!0;const Rl=[];function Vl(){Rl.push(Jt),Jt=!1}function El(){const e=Rl.pop();Jt=e===void 0||e}function nt(e,t,n){if(Jt&&Je){let i=As.get(e);i||As.set(e,i=new Map);let s=i.get(n);s||i.set(n,s=Hs()),function(l,a){let r=!1;Wn<=_s?Ml(l)||(l.n|=Nt,r=!Ll(l)):r=!l.has(Je),r&&(l.add(Je),Je.deps.push(l),process.env.NODE_ENV!=="production"&&Je.onTrack&&Je.onTrack(dt({effect:Je},a)))}(s,process.env.NODE_ENV!=="production"?{effect:Je,target:e,type:t,key:n}:void 0)}}function Pt(e,t,n,i,s,l){const a=As.get(e);if(!a)return;let r=[];if(t==="clear")r=[...a.values()];else if(n==="length"&&Ce(e)){const d=Number(i);a.forEach((h,u)=>{(u==="length"||!Gi(u)&&u>=d)&&r.push(h)})}else switch(n!==void 0&&r.push(a.get(n)),t){case"add":Ce(e)?Os(n)&&r.push(a.get("length")):(r.push(a.get(Ut)),mn(e)&&r.push(a.get(Ks)));break;case"delete":Ce(e)||(r.push(a.get(Ut)),mn(e)&&r.push(a.get(Ks)));break;case"set":mn(e)&&r.push(a.get(Ut))}const c=process.env.NODE_ENV!=="production"?{target:e,type:t,key:n,newValue:i,oldValue:s,oldTarget:l}:void 0;if(r.length===1)r[0]&&(process.env.NODE_ENV!=="production"?Xi(r[0],c):Xi(r[0]));else{const d=[];for(const h of r)h&&d.push(...h);process.env.NODE_ENV!=="production"?Xi(Hs(d),c):Xi(Hs(d))}}function Xi(e,t){const n=Ce(e)?e:[...e];for(const i of n)i.computed&&Wl(i,t);for(const i of n)i.computed||Wl(i,t)}function Wl(e,t){(e!==Je||e.allowRecurse)&&(process.env.NODE_ENV!=="production"&&e.onTrigger&&e.onTrigger(dt({effect:e},t)),e.scheduler?e.scheduler():e.run())}const ud=jc("__proto__,__v_isRef,__isVue"),Gl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Gi)),Zl=fd();function fd(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const i=ge(this);for(let l=0,a=this.length;l<a;l++)nt(i,"get",l+"");const s=i[t](...n);return s===-1||s===!1?i[t](...n.map(ge)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){Vl();const i=ge(this)[t].apply(this,n);return El(),i}}),e}function md(e){const t=ge(this);return nt(t,"has",e),t.hasOwnProperty(e)}class Xl{constructor(t=!1,n=!1){this._isReadonly=t,this._shallow=n}get(t,n,i){const s=this._isReadonly,l=this._shallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return l;if(n==="__v_raw"&&i===(s?l?Hl:zl:l?Md:Fl).get(t))return t;const a=Ce(t);if(!s){if(a&&Wi(Zl,n))return Reflect.get(Zl,n,i);if(n==="hasOwnProperty")return md}const r=Reflect.get(t,n,i);return(Gi(n)?Gl.has(n):ud(n))?r:(s||nt(t,"get",n),l?r:je(r)?a&&Os(n)?r:r.value:Ue(r)?s?_l(r):Al(r):r)}}class pd extends Xl{constructor(t=!1){super(!1,t)}set(t,n,i,s){let l=t[n];if(Qt(l)&&je(l)&&!je(i))return!1;if(!this._shallow&&(Qs(i)||Qt(i)||(l=ge(l),i=ge(i)),!Ce(t)&&je(l)&&!je(i)))return l.value=i,!0;const a=Ce(t)&&Os(n)?Number(n)<t.length:Wi(t,n),r=Reflect.set(t,n,i,s);return t===ge(s)&&(a?pn(i,l)&&Pt(t,"set",n,i,l):Pt(t,"add",n,i)),r}deleteProperty(t,n){const i=Wi(t,n),s=t[n],l=Reflect.deleteProperty(t,n);return l&&i&&Pt(t,"delete",n,void 0,s),l}has(t,n){const i=Reflect.has(t,n);return Gi(n)&&Gl.has(n)||nt(t,"has",n),i}ownKeys(t){return nt(t,"iterate",Ce(t)?"length":Ut),Reflect.ownKeys(t)}}class Nl extends Xl{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&Il(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&Il(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const gd=new pd,bd=new Nl,yd=new Nl(!0),Us=e=>e,Ni=e=>Reflect.getPrototypeOf(e);function Pi(e,t,n=!1,i=!1){const s=ge(e=e.__v_raw),l=ge(t);n||(pn(t,l)&&nt(s,"get",t),nt(s,"get",l));const{has:a}=Ni(s),r=i?Us:n?eo:qs;return a.call(s,t)?r(e.get(t)):a.call(s,l)?r(e.get(l)):void(e!==s&&e.get(t))}function Di(e,t=!1){const n=this.__v_raw,i=ge(n),s=ge(e);return t||(pn(e,s)&&nt(i,"has",e),nt(i,"has",s)),e===s?n.has(e):n.has(e)||n.has(s)}function Bi(e,t=!1){return e=e.__v_raw,!t&&nt(ge(e),"iterate",Ut),Reflect.get(e,"size",e)}function Pl(e){e=ge(e);const t=ge(this);return Ni(t).has.call(t,e)||(t.add(e),Pt(t,"add",e,e)),this}function Dl(e,t){t=ge(t);const n=ge(this),{has:i,get:s}=Ni(n);let l=i.call(n,e);l?process.env.NODE_ENV!=="production"&&Yl(n,i,e):(e=ge(e),l=i.call(n,e));const a=s.call(n,e);return n.set(e,t),l?pn(t,a)&&Pt(n,"set",e,t,a):Pt(n,"add",e,t),this}function Bl(e){const t=ge(this),{has:n,get:i}=Ni(t);let s=n.call(t,e);s?process.env.NODE_ENV!=="production"&&Yl(t,n,e):(e=ge(e),s=n.call(t,e));const l=i?i.call(t,e):void 0,a=t.delete(e);return s&&Pt(t,"delete",e,void 0,l),a}function Ol(){const e=ge(this),t=e.size!==0,n=process.env.NODE_ENV!=="production"?mn(e)?new Map(e):new Set(e):void 0,i=e.clear();return t&&Pt(e,"clear",void 0,void 0,n),i}function Oi(e,t){return function(n,i){const s=this,l=s.__v_raw,a=ge(l),r=t?Us:e?eo:qs;return!e&&nt(a,"iterate",Ut),l.forEach((c,d)=>n.call(i,r(c),r(d),s))}}function Yi(e,t,n){return function(...i){const s=this.__v_raw,l=ge(s),a=mn(l),r=e==="entries"||e===Symbol.iterator&&a,c=e==="keys"&&a,d=s[e](...i),h=n?Us:t?eo:qs;return!t&&nt(l,"iterate",c?Ks:Ut),{next(){const{value:u,done:f}=d.next();return f?{value:u,done:f}:{value:r?[h(u[0]),h(u[1])]:h(u),done:f}},[Symbol.iterator](){return this}}}}function Dt(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";console.warn(`${od(e)} operation ${n}failed: target is readonly.`,ge(this))}return e!=="delete"&&(e==="clear"?void 0:this)}}function xd(){const e={get(s){return Pi(this,s)},get size(){return Bi(this)},has:Di,add:Pl,set:Dl,delete:Bl,clear:Ol,forEach:Oi(!1,!1)},t={get(s){return Pi(this,s,!1,!0)},get size(){return Bi(this)},has:Di,add:Pl,set:Dl,delete:Bl,clear:Ol,forEach:Oi(!1,!0)},n={get(s){return Pi(this,s,!0)},get size(){return Bi(this,!0)},has(s){return Di.call(this,s,!0)},add:Dt("add"),set:Dt("set"),delete:Dt("delete"),clear:Dt("clear"),forEach:Oi(!0,!1)},i={get(s){return Pi(this,s,!0,!0)},get size(){return Bi(this,!0)},has(s){return Di.call(this,s,!0)},add:Dt("add"),set:Dt("set"),delete:Dt("delete"),clear:Dt("clear"),forEach:Oi(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=Yi(s,!1,!1),n[s]=Yi(s,!0,!1),t[s]=Yi(s,!1,!0),i[s]=Yi(s,!0,!0)}),[e,n,t,i]}const[Sd,Cd,kd,wd]=xd();function Js(e,t){const n=t?e?wd:kd:e?Cd:Sd;return(i,s,l)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?i:Reflect.get(Wi(n,s)&&s in i?n:i,s,l)}const Id={get:Js(!1,!1)},Td={get:Js(!0,!1)},Ld={get:Js(!0,!0)};function Yl(e,t,n){const i=ge(n);if(i!==n&&t.call(e,i)){const s=kl(e);console.warn(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Fl=new WeakMap,Md=new WeakMap,zl=new WeakMap,Hl=new WeakMap;function Al(e){return Qt(e)?e:js(e,!1,gd,Id,Fl)}function _l(e){return js(e,!0,bd,Td,zl)}function Fi(e){return js(e,!0,yd,Ld,Hl)}function js(e,t,n,i,s){if(!Ue(e))return process.env.NODE_ENV!=="production"&&console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const l=s.get(e);if(l)return l;const a=(r=e).__v_skip||!Object.isExtensible(r)?0:function(d){switch(d){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(kl(r));var r;if(a===0)return e;const c=new Proxy(e,a===2?i:n);return s.set(e,c),c}function jt(e){return Qt(e)?jt(e.__v_raw):!(!e||!e.__v_isReactive)}function Qt(e){return!(!e||!e.__v_isReadonly)}function Qs(e){return!(!e||!e.__v_isShallow)}function $s(e){return jt(e)||Qt(e)}function ge(e){const t=e&&e.__v_raw;return t?ge(t):e}const qs=e=>Ue(e)?Al(e):e,eo=e=>Ue(e)?_l(e):e;function je(e){return!(!e||e.__v_isRef!==!0)}const vd={get:(e,t,n)=>{return je(i=Reflect.get(e,t,n))?i.value:i;var i},set:(e,t,n,i)=>{const s=e[t];return je(s)&&!je(n)?(s.value=n,!0):Reflect.set(e,t,n,i)}},$t=[];function St(e,...t){if(process.env.NODE_ENV==="production")return;Vl();const n=$t.length?$t[$t.length-1].component:null,i=n&&n.appContext.config.warnHandler,s=function(){let l=$t[$t.length-1];if(!l)return[];const a=[];for(;l;){const r=a[0];r&&r.vnode===l?r.recurseCount++:a.push({vnode:l,recurseCount:0});const c=l.component&&l.component.parent;l=c&&c.vnode}return a}();if(i)qt(i,n,11,[e+t.join(""),n&&n.proxy,s.map(({vnode:l})=>`at <${ga(n,l.type)}>`).join(`
1
+ (function(le,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(le=typeof globalThis<"u"?globalThis:le||self,o(le.evui={},le.Vue))})(this,function(le,o){"use strict";function td(e,t){const n=Object.create(null),i=e.split(",");for(let s=0;s<i.length;s++)n[i[s]]=!0;return s=>!!n[s]}const Fs=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV==="production"||Object.freeze([]);const Tl=()=>{},nd=/^on[^a-z]/,id=e=>nd.test(e),dt=Object.assign,sd=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},od=Object.prototype.hasOwnProperty,Wi=(e,t)=>od.call(e,t),Ce=Array.isArray,fn=e=>Zi(e)==="[object Map]",ld=e=>Zi(e)==="[object Set]",Oe=e=>typeof e=="function",xt=e=>typeof e=="string",Gi=e=>typeof e=="symbol",Ue=e=>e!==null&&typeof e=="object",ad=e=>(Ue(e)||Oe(e))&&Oe(e.then)&&Oe(e.catch),rd=Object.prototype.toString,Zi=e=>rd.call(e),Ll=e=>Zi(e).slice(8,-1),cd=e=>Zi(e)==="[object Object]",Hs=e=>xt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,dd=(e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),mn=(e,t)=>!Object.is(e,t),hd=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})};let Ml;const zs=()=>Ml||(Ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function As(e){if(Ce(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],s=xt(i)?pd(i):As(i);if(s)for(const l in s)t[l]=s[l]}return t}if(xt(e)||Ue(e))return e}const ud=/;(?![^(]*\))/g,fd=/:([^]+)/,md=/\/\*[^]*?\*\//g;function pd(e){const t={};return e.replace(md,"").split(ud).forEach(n=>{if(n){const i=n.split(fd);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function _s(e){let t="";if(xt(e))t=e;else if(Ce(e))for(let n=0;n<e.length;n++){const i=_s(e[n]);i&&(t+=i+" ")}else if(Ue(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function vl(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Rl;const Ks=e=>{const t=new Set(e);return t.w=0,t.n=0,t},Vl=e=>(e.w&Nt)>0,El=e=>(e.n&Nt)>0,Us=new WeakMap;let En=0,Nt=1;const Js=30;let Je;const Jt=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),js=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");class gd{constructor(t,n=null,i){this.fn=t,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,function(s,l=Rl){l&&l.active&&l.effects.push(s)}(this,i)}run(){if(!this.active)return this.fn();let t=Je,n=jt;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=Je,Je=this,jt=!0,Nt=1<<++En,En<=Js?(({deps:i})=>{if(i.length)for(let s=0;s<i.length;s++)i[s].w|=Nt})(this):Wl(this),this.fn()}finally{En<=Js&&(i=>{const{deps:s}=i;if(s.length){let l=0;for(let a=0;a<s.length;a++){const r=s[a];Vl(r)&&!El(r)?r.delete(i):s[l++]=r,r.w&=~Nt,r.n&=~Nt}s.length=l}})(this),Nt=1<<--En,Je=this.parent,jt=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Je===this?this.deferStop=!0:this.active&&(Wl(this),this.onStop&&this.onStop(),this.active=!1)}}function Wl(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let jt=!0;const Gl=[];function Zl(){Gl.push(jt),jt=!1}function Xl(){const e=Gl.pop();jt=e===void 0||e}function nt(e,t,n){if(jt&&Je){let i=Us.get(e);i||Us.set(e,i=new Map);let s=i.get(n);s||i.set(n,s=Ks()),function(l,a){let r=!1;En<=Js?El(l)||(l.n|=Nt,r=!Vl(l)):r=!l.has(Je),r&&(l.add(Je),Je.deps.push(l),process.env.NODE_ENV!=="production"&&Je.onTrack&&Je.onTrack(dt({effect:Je},a)))}(s,process.env.NODE_ENV!=="production"?{effect:Je,target:e,type:t,key:n}:void 0)}}function Pt(e,t,n,i,s,l){const a=Us.get(e);if(!a)return;let r=[];if(t==="clear")r=[...a.values()];else if(n==="length"&&Ce(e)){const d=Number(i);a.forEach((h,u)=>{(u==="length"||!Gi(u)&&u>=d)&&r.push(h)})}else switch(n!==void 0&&r.push(a.get(n)),t){case"add":Ce(e)?Hs(n)&&r.push(a.get("length")):(r.push(a.get(Jt)),fn(e)&&r.push(a.get(js)));break;case"delete":Ce(e)||(r.push(a.get(Jt)),fn(e)&&r.push(a.get(js)));break;case"set":fn(e)&&r.push(a.get(Jt))}const c=process.env.NODE_ENV!=="production"?{target:e,type:t,key:n,newValue:i,oldValue:s,oldTarget:l}:void 0;if(r.length===1)r[0]&&(process.env.NODE_ENV!=="production"?Xi(r[0],c):Xi(r[0]));else{const d=[];for(const h of r)h&&d.push(...h);process.env.NODE_ENV!=="production"?Xi(Ks(d),c):Xi(Ks(d))}}function Xi(e,t){const n=Ce(e)?e:[...e];for(const i of n)i.computed&&Nl(i,t);for(const i of n)i.computed||Nl(i,t)}function Nl(e,t){(e!==Je||e.allowRecurse)&&(process.env.NODE_ENV!=="production"&&e.onTrigger&&e.onTrigger(dt({effect:e},t)),e.scheduler?e.scheduler():e.run())}const bd=td("__proto__,__v_isRef,__isVue"),Pl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Gi)),Dl=yd();function yd(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const i=ge(this);for(let l=0,a=this.length;l<a;l++)nt(i,"get",l+"");const s=i[t](...n);return s===-1||s===!1?i[t](...n.map(ge)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){Zl();const i=ge(this)[t].apply(this,n);return Xl(),i}}),e}function xd(e){const t=ge(this);return nt(t,"has",e),t.hasOwnProperty(e)}class Bl{constructor(t=!1,n=!1){this._isReadonly=t,this._shallow=n}get(t,n,i){const s=this._isReadonly,l=this._shallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return l;if(n==="__v_raw"&&i===(s?l?Ul:Kl:l?Wd:_l).get(t))return t;const a=Ce(t);if(!s){if(a&&Wi(Dl,n))return Reflect.get(Dl,n,i);if(n==="hasOwnProperty")return xd}const r=Reflect.get(t,n,i);return(Gi(n)?Pl.has(n):bd(n))?r:(s||nt(t,"get",n),l?r:je(r)?a&&Hs(n)?r:r.value:Ue(r)?s?jl(r):Jl(r):r)}}class Sd extends Bl{constructor(t=!1){super(!1,t)}set(t,n,i,s){let l=t[n];if($t(l)&&je(l)&&!je(i))return!1;if(!this._shallow&&(eo(i)||$t(i)||(l=ge(l),i=ge(i)),!Ce(t)&&je(l)&&!je(i)))return l.value=i,!0;const a=Ce(t)&&Hs(n)?Number(n)<t.length:Wi(t,n),r=Reflect.set(t,n,i,s);return t===ge(s)&&(a?mn(i,l)&&Pt(t,"set",n,i,l):Pt(t,"add",n,i)),r}deleteProperty(t,n){const i=Wi(t,n),s=t[n],l=Reflect.deleteProperty(t,n);return l&&i&&Pt(t,"delete",n,void 0,s),l}has(t,n){const i=Reflect.has(t,n);return Gi(n)&&Pl.has(n)||nt(t,"has",n),i}ownKeys(t){return nt(t,"iterate",Ce(t)?"length":Jt),Reflect.ownKeys(t)}}class Ol extends Bl{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&vl(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&vl(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Cd=new Sd,kd=new Ol,wd=new Ol(!0),Qs=e=>e,Ni=e=>Reflect.getPrototypeOf(e);function Pi(e,t,n=!1,i=!1){const s=ge(e=e.__v_raw),l=ge(t);n||(mn(t,l)&&nt(s,"get",t),nt(s,"get",l));const{has:a}=Ni(s),r=i?Qs:n?io:no;return a.call(s,t)?r(e.get(t)):a.call(s,l)?r(e.get(l)):void(e!==s&&e.get(t))}function Di(e,t=!1){const n=this.__v_raw,i=ge(n),s=ge(e);return t||(mn(e,s)&&nt(i,"has",e),nt(i,"has",s)),e===s?n.has(e):n.has(e)||n.has(s)}function Bi(e,t=!1){return e=e.__v_raw,!t&&nt(ge(e),"iterate",Jt),Reflect.get(e,"size",e)}function Yl(e){e=ge(e);const t=ge(this);return Ni(t).has.call(t,e)||(t.add(e),Pt(t,"add",e,e)),this}function Fl(e,t){t=ge(t);const n=ge(this),{has:i,get:s}=Ni(n);let l=i.call(n,e);l?process.env.NODE_ENV!=="production"&&Al(n,i,e):(e=ge(e),l=i.call(n,e));const a=s.call(n,e);return n.set(e,t),l?mn(t,a)&&Pt(n,"set",e,t,a):Pt(n,"add",e,t),this}function Hl(e){const t=ge(this),{has:n,get:i}=Ni(t);let s=n.call(t,e);s?process.env.NODE_ENV!=="production"&&Al(t,n,e):(e=ge(e),s=n.call(t,e));const l=i?i.call(t,e):void 0,a=t.delete(e);return s&&Pt(t,"delete",e,void 0,l),a}function zl(){const e=ge(this),t=e.size!==0,n=process.env.NODE_ENV!=="production"?fn(e)?new Map(e):new Set(e):void 0,i=e.clear();return t&&Pt(e,"clear",void 0,void 0,n),i}function Oi(e,t){return function(n,i){const s=this,l=s.__v_raw,a=ge(l),r=t?Qs:e?io:no;return!e&&nt(a,"iterate",Jt),l.forEach((c,d)=>n.call(i,r(c),r(d),s))}}function Yi(e,t,n){return function(...i){const s=this.__v_raw,l=ge(s),a=fn(l),r=e==="entries"||e===Symbol.iterator&&a,c=e==="keys"&&a,d=s[e](...i),h=n?Qs:t?io:no;return!t&&nt(l,"iterate",c?js:Jt),{next(){const{value:u,done:m}=d.next();return m?{value:u,done:m}:{value:r?[h(u[0]),h(u[1])]:h(u),done:m}},[Symbol.iterator](){return this}}}}function Dt(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";console.warn(`${dd(e)} operation ${n}failed: target is readonly.`,ge(this))}return e!=="delete"&&(e==="clear"?void 0:this)}}function Id(){const e={get(s){return Pi(this,s)},get size(){return Bi(this)},has:Di,add:Yl,set:Fl,delete:Hl,clear:zl,forEach:Oi(!1,!1)},t={get(s){return Pi(this,s,!1,!0)},get size(){return Bi(this)},has:Di,add:Yl,set:Fl,delete:Hl,clear:zl,forEach:Oi(!1,!0)},n={get(s){return Pi(this,s,!0)},get size(){return Bi(this,!0)},has(s){return Di.call(this,s,!0)},add:Dt("add"),set:Dt("set"),delete:Dt("delete"),clear:Dt("clear"),forEach:Oi(!0,!1)},i={get(s){return Pi(this,s,!0,!0)},get size(){return Bi(this,!0)},has(s){return Di.call(this,s,!0)},add:Dt("add"),set:Dt("set"),delete:Dt("delete"),clear:Dt("clear"),forEach:Oi(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=Yi(s,!1,!1),n[s]=Yi(s,!0,!1),t[s]=Yi(s,!1,!0),i[s]=Yi(s,!0,!0)}),[e,n,t,i]}const[Td,Ld,Md,vd]=Id();function $s(e,t){const n=t?e?vd:Md:e?Ld:Td;return(i,s,l)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?i:Reflect.get(Wi(n,s)&&s in i?n:i,s,l)}const Rd={get:$s(!1,!1)},Vd={get:$s(!0,!1)},Ed={get:$s(!0,!0)};function Al(e,t,n){const i=ge(n);if(i!==n&&t.call(e,i)){const s=Ll(e);console.warn(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const _l=new WeakMap,Wd=new WeakMap,Kl=new WeakMap,Ul=new WeakMap;function Jl(e){return $t(e)?e:qs(e,!1,Cd,Rd,_l)}function jl(e){return qs(e,!0,kd,Vd,Kl)}function Fi(e){return qs(e,!0,wd,Ed,Ul)}function qs(e,t,n,i,s){if(!Ue(e))return process.env.NODE_ENV!=="production"&&console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const l=s.get(e);if(l)return l;const a=(r=e).__v_skip||!Object.isExtensible(r)?0:function(d){switch(d){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(Ll(r));var r;if(a===0)return e;const c=new Proxy(e,a===2?i:n);return s.set(e,c),c}function Qt(e){return $t(e)?Qt(e.__v_raw):!(!e||!e.__v_isReactive)}function $t(e){return!(!e||!e.__v_isReadonly)}function eo(e){return!(!e||!e.__v_isShallow)}function to(e){return Qt(e)||$t(e)}function ge(e){const t=e&&e.__v_raw;return t?ge(t):e}const no=e=>Ue(e)?Jl(e):e,io=e=>Ue(e)?jl(e):e;function je(e){return!(!e||e.__v_isRef!==!0)}const Gd={get:(e,t,n)=>{return je(i=Reflect.get(e,t,n))?i.value:i;var i},set:(e,t,n,i)=>{const s=e[t];return je(s)&&!je(n)?(s.value=n,!0):Reflect.set(e,t,n,i)}},qt=[];function St(e,...t){if(process.env.NODE_ENV==="production")return;Zl();const n=qt.length?qt[qt.length-1].component:null,i=n&&n.appContext.config.warnHandler,s=function(){let l=qt[qt.length-1];if(!l)return[];const a=[];for(;l;){const r=a[0];r&&r.vnode===l?r.recurseCount++:a.push({vnode:l,recurseCount:0});const c=l.component&&l.component.parent;l=c&&c.vnode}return a}();if(i)en(i,n,11,[e+t.join(""),n&&n.proxy,s.map(({vnode:l})=>`at <${Sa(n,l.type)}>`).join(`
2
2
  `),s]);else{const l=[`[Vue warn]: ${e}`,...t];s.length&&l.push(`
3
3
  `,...function(a){const r=[];return a.forEach((c,d)=>{r.push(...d===0?[]:[`
4
- `],...function({vnode:h,recurseCount:u}){const f=u>0?`... (${u} recursive calls)`:"",m=!!h.component&&h.component.parent==null,g=` at <${ga(h.component,h.type,m)}`,p=">"+f;return h.props?[g,...Rd(h.props),p]:[g+p]}(c))}),r}(s)),console.warn(...l)}El()}function Rd(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(i=>{t.push(...Kl(i,e[i]))}),n.length>3&&t.push(" ..."),t}function Kl(e,t,n){return xt(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:je(t)?(t=Kl(e,ge(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Be(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=ge(t),n?t:[`${e}=`,t])}const Ul={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"};function qt(e,t,n,i){let s;try{s=i?e(...i):e()}catch(l){Jl(l,t,n)}return s}function to(e,t,n,i){if(Be(e)){const l=qt(e,t,n,i);return l&&nd(l)&&l.catch(a=>{Jl(a,t,n)}),l}const s=[];for(let l=0;l<e.length;l++)s.push(to(e[l],t,n,i));return s}function Jl(e,t,n,i=!0){const s=t?t.vnode:null;if(t){let l=t.parent;const a=t.proxy,r=process.env.NODE_ENV!=="production"?Ul[n]:n;for(;l;){const d=l.ec;if(d){for(let h=0;h<d.length;h++)if(d[h](e,a,r)===!1)return}l=l.parent}const c=t.appContext.config.errorHandler;if(c)return void qt(c,null,10,[e,a,r])}(function(l,a,r,c=!0){if(process.env.NODE_ENV!=="production"){const h=Ul[a];if(r&&(d=r,$t.push(d)),St("Unhandled error"+(h?` during execution of ${h}`:"")),r&&$t.pop(),c)throw l;console.error(l)}else console.error(l);var d})(e,n,s,i)}let zi=!1,no=!1;const ht=[];let Bt=0;const gn=[];let Ct=null,Ot=0;const jl=Promise.resolve();let io=null;const Vd=100;function Ql(e){const t=io||jl;return e?t.then(this?e.bind(this):e):t}function so(e){ht.length&&ht.includes(e,zi&&e.allowRecurse?Bt+1:Bt)||(e.id==null?ht.push(e):ht.splice(function(t){let n=Bt+1,i=ht.length;for(;n<i;){const s=n+i>>>1,l=ht[s],a=Gn(l);a<t||a===t&&l.pre?n=s+1:i=s}return n}(e.id),0,e),$l())}function $l(){zi||no||(no=!0,io=jl.then(ea))}function ql(e){Ce(e)?gn.push(...e):Ct&&Ct.includes(e,e.allowRecurse?Ot+1:Ot)||gn.push(e),$l()}const Gn=e=>e.id==null?1/0:e.id,Ed=(e,t)=>{const n=Gn(e)-Gn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function ea(e){no=!1,zi=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),ht.sort(Ed);const t=process.env.NODE_ENV!=="production"?n=>ta(e,n):Cl;try{for(Bt=0;Bt<ht.length;Bt++){const n=ht[Bt];if(n&&n.active!==!1){if(process.env.NODE_ENV!=="production"&&t(n))continue;qt(n,null,14)}}}finally{Bt=0,ht.length=0,function(n){if(gn.length){const i=[...new Set(gn)];if(gn.length=0,Ct)return void Ct.push(...i);for(Ct=i,process.env.NODE_ENV!=="production"&&(n=n||new Map),Ct.sort((s,l)=>Gn(s)-Gn(l)),Ot=0;Ot<Ct.length;Ot++)process.env.NODE_ENV!=="production"&&ta(n,Ct[Ot])||Ct[Ot]();Ct=null,Ot=0}}(e),zi=!1,io=null,(ht.length||gn.length)&&ea(e)}}function ta(e,t){if(e.has(t)){const n=e.get(t);if(n>Vd){const i=t.ownerInstance,s=i&&pa(i.type);return St(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`),!0}e.set(t,n+1)}else e.set(t,1)}const Zn=new Set;process.env.NODE_ENV!=="production"&&(Ys().__VUE_HMR_RUNTIME__={createRecord:oo(function(e,t){return Hi.has(e)?!1:(Hi.set(e,{initialDef:Xn(t),instances:new Set}),!0)}),rerender:oo(function(e,t){const n=Hi.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(i=>{t&&(i.render=t,Xn(i.type).render=t),i.renderCache=[],i.update()}))}),reload:oo(function(e,t){const n=Hi.get(e);if(!n)return;t=Xn(t),na(n.initialDef,t);const i=[...n.instances];for(const s of i){const l=Xn(s.type);Zn.has(l)||(l!==n.initialDef&&na(l,t),Zn.add(l)),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(Zn.add(l),s.ceReload(t.styles),Zn.delete(l)):s.parent?so(s.parent.update):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}ql(()=>{for(const s of i)Zn.delete(Xn(s.type))})})});const Hi=new Map;function Xn(e){return ba(e)?e.__vccOpts:e}function na(e,t){dt(e,t);for(const n in e)n==="__file"||n in t||delete e[n]}function oo(e){return(t,n)=>{try{return e(t,n)}catch(i){console.error(i),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Nn=null,Wd=null;const Gd=Symbol.for("v-ndc"),Ai={};function Zd(e,t,{immediate:n,deep:i,flush:s,onTrack:l,onTrigger:a}=Bs){var r;process.env.NODE_ENV==="production"||t||(n!==void 0&&St('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&St('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));const c=k=>{St("Invalid watch source: ",k,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},d=Tl===((r=xn)==null?void 0:r.scope)?xn:null;let h,u,f=!1,m=!1;if(je(e)?(h=()=>e.value,f=Qs(e)):jt(e)?(h=()=>e,i=!0):Ce(e)?(m=!0,f=e.some(k=>jt(k)||Qs(k)),h=()=>e.map(k=>je(k)?k.value:jt(k)?bn(k):Be(k)?qt(k,d,2):void(process.env.NODE_ENV!=="production"&&c(k)))):Be(e)?h=t?()=>qt(e,d,2):()=>{if(!d||!d.isUnmounted)return u&&u(),to(e,d,3,[g])}:(h=Cl,process.env.NODE_ENV!=="production"&&c(e)),t&&i){const k=h;h=()=>bn(k())}let g=k=>{u=b.onStop=()=>{qt(k,d,4),u=b.onStop=void 0}},p=m?new Array(e.length).fill(Ai):Ai;const y=()=>{if(b.active)if(t){const k=b.run();(i||f||(m?k.some((L,w)=>pn(L,p[w])):pn(k,p)))&&(u&&u(),to(t,d,3,[k,p===Ai?void 0:m&&p[0]===Ai?[]:p,g]),p=k)}else b.run()};let C;y.allowRecurse=!!t,s==="sync"?C=y:s==="post"?C=()=>aa(y,d&&d.suspense):(y.pre=!0,d&&(y.id=d.uid),C=()=>so(y));const b=new hd(h,C);return process.env.NODE_ENV!=="production"&&(b.onTrack=l,b.onTrigger=a),t?n?y():p=b.run():s==="post"?aa(b.run.bind(b),d&&d.suspense):b.run(),()=>{b.stop(),d&&d.scope&&qc(d.scope.effects,b)}}function Xd(e,t,n){const i=this.proxy,s=xt(e)?e.includes(".")?function(c,d){const h=d.split(".");return()=>{let u=c;for(let f=0;f<h.length&&u;f++)u=u[h[f]];return u}}(i,e):()=>i[e]:e.bind(i,i);let l;Be(t)?l=t:(l=t.handler,n=t);const a=xn;ma(this);const r=Zd(s,l.bind(i),n);return a?ma(a):Yd(),r}function bn(e,t){if(!Ue(e)||e.__v_skip||(t=t||new Set).has(e))return e;if(t.add(e),je(e))bn(e.value,t);else if(Ce(e))for(let n=0;n<e.length;n++)bn(e[n],t);else if(td(e)||mn(e))e.forEach(n=>{bn(n,t)});else if(sd(e))for(const n in e)bn(e[n],t);return e}const lo=e=>e?4&e.vnode.shapeFlag?function(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy((i=t.exposed,ld(i,"__v_skip",!0),jt(n=i)?n:new Proxy(n,vd)),{get:(s,l)=>l in s?s[l]:l in ao?ao[l](t):void 0,has:(s,l)=>l in s||l in ao}));var n,i}(e)||e.proxy:lo(e.parent):null,ao=dt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?Fi(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?Fi(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?Fi(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?Fi(e.refs):e.refs,$parent:e=>lo(e.parent),$root:e=>lo(e.root),$emit:e=>e.emit,$options:e=>function(t){const n=t.type,{mixins:i,extends:s}=n,{mixins:l,optionsCache:a,config:{optionMergeStrategies:r}}=t.appContext,c=a.get(n);let d;return c?d=c:l.length||i||s?(d={},l.length&&l.forEach(h=>_i(d,h,r,!0)),_i(d,n,r)):d=n,Ue(n)&&a.set(n,d),d}(e),$forceUpdate:e=>e.f||(e.f=()=>so(e.update)),$nextTick:e=>e.n||(e.n=Ql.bind(e.proxy)),$watch:e=>Xd.bind(e)});function ia(e){return Ce(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}process.env.NODE_ENV;function _i(e,t,n,i=!1){const{mixins:s,extends:l}=t;l&&_i(e,l,n,!0),s&&s.forEach(a=>_i(e,a,n,!0));for(const a in t)if(i&&a==="expose")process.env.NODE_ENV!=="production"&&St('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const r=Nd[a]||n&&n[a];e[a]=r?r(e[a],t[a]):t[a]}return e}const Nd={data:sa,props:la,emits:la,methods:Pn,computed:Pn,beforeCreate:Ye,created:Ye,beforeMount:Ye,mounted:Ye,beforeUpdate:Ye,updated:Ye,beforeDestroy:Ye,beforeUnmount:Ye,destroyed:Ye,unmounted:Ye,activated:Ye,deactivated:Ye,errorCaptured:Ye,serverPrefetch:Ye,components:Pn,directives:Pn,watch:function(e,t){if(!e)return t;if(!t)return e;const n=dt(Object.create(null),e);for(const i in t)n[i]=Ye(e[i],t[i]);return n},provide:sa,inject:function(e,t){return Pn(oa(e),oa(t))}};function sa(e,t){return t?e?function(){return dt(Be(e)?e.call(this,this):e,Be(t)?t.call(this,this):t)}:t:e}function oa(e){if(Ce(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ye(e,t){return e?[...new Set([].concat(e,t))]:t}function Pn(e,t){return e?dt(Object.create(null),e,t):t}function la(e,t){return e?Ce(e)&&Ce(t)?[...new Set([...e,...t])]:dt(Object.create(null),ia(e),ia(t??{})):t}const aa=function(e,t){t&&t.pendingBranch?Ce(e)?t.effects.push(...e):t.effects.push(e):ql(e)},ra=Symbol.for("v-fgt"),Pd=Symbol.for("v-txt"),Dd=Symbol.for("v-cmt"),ca="__vInternal",da=({key:e})=>e??null,Ki=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?xt(e)||je(e)||Be(e)?{i:Nn,r:e,k:t,f:!!n}:e:null),Bd=process.env.NODE_ENV!=="production"?(...e)=>ha(...e):ha;function ha(e,t=null,n=null,i=0,s=null,l=!1){if(e&&e!==Gd||(process.env.NODE_ENV==="production"||e||St(`Invalid vnode type when creating vnode: ${e}.`),e=Dd),(a=e)&&a.__v_isVNode===!0){const c=Ui(e,t,!0);return n&&ro(c,n),c.patchFlag|=-2,c}var a;if(ba(e)&&(e=e.__vccOpts),t){t=function(h){return h?$s(h)||ca in h?dt({},h):h:null}(t);let{class:c,style:d}=t;c&&!xt(c)&&(t.class=zs(c)),Ue(d)&&($s(d)&&!Ce(d)&&(d=dt({},d)),t.style=Fs(d))}const r=xt(e)?1:(c=>c.__isSuspense)(e)?128:(c=>c.__isTeleport)(e)?64:Ue(e)?4:Be(e)?2:0;return process.env.NODE_ENV!=="production"&&4&r&&$s(e)&&St("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
5
- Component that was made reactive: `,e=ge(e)),function(c,d=null,h=null,u=0,f=null,m=c===ra?0:1,g=!1,p=!1){const y={__v_isVNode:!0,__v_skip:!0,type:c,props:d,key:d&&da(d),ref:d&&Ki(d),scopeId:Wd,slotScopeIds:null,children:h,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:m,patchFlag:u,dynamicProps:f,dynamicChildren:null,appContext:null,ctx:Nn};return p?(ro(y,h),128&m&&c.normalize(y)):h&&(y.shapeFlag|=xt(h)?8:16),process.env.NODE_ENV!=="production"&&y.key!=y.key&&St("VNode created with invalid key (NaN). VNode type:",y.type),y}(e,t,n,i,s,r,l,!0)}function Ui(e,t,n=!1){const{props:i,ref:s,patchFlag:l,children:a}=e,r=t?function(...c){const d={};for(let h=0;h<c.length;h++){const u=c[h];for(const f in u)if(f==="class")d.class!==u.class&&(d.class=zs([d.class,u.class]));else if(f==="style")d.style=Fs([d.style,u.style]);else if($c(f)){const m=d[f],g=u[f];!g||m===g||Ce(m)&&m.includes(g)||(d[f]=m?[].concat(m,g):g)}else f!==""&&(d[f]=u[f])}return d}(i||{},t):i;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:r,key:r&&da(r),ref:t&&t.ref?n&&s?Ce(s)?s.concat(Ki(t)):[s,Ki(t)]:Ki(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&Ce(a)?a.map(ua):a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ra?l===-1?16:16|l:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ui(e.ssContent),ssFallback:e.ssFallback&&Ui(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function ua(e){const t=Ui(e);return Ce(e.children)&&(t.children=e.children.map(ua)),t}function Od(e=" ",t=0){return Bd(Pd,null,e,t)}function ro(e,t){let n=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(Ce(t))n=16;else if(typeof t=="object"){if(65&i){const s=t.default;return void(s&&(s._c&&(s._d=!1),ro(e,s()),s._c&&(s._d=!0)))}{n=32;const s=t._;s||ca in t||(t._ctx=Nn)}}else Be(t)?(t={default:t,_ctx:Nn},n=32):(t=String(t),64&i?(n=16,t=[Od(t)]):n=8);e.children=t,e.shapeFlag|=n}let co,yn,xn=null,fa="__VUE_INSTANCE_SETTERS__";(yn=Ys()[fa])||(yn=Ys()[fa]=[]),yn.push(e=>xn=e),co=e=>{yn.length>1?yn.forEach(t=>t(e)):yn[0](e)};const ma=e=>{co(e),e.scope.on()},Yd=()=>{xn&&xn.scope.off(),co(null)},Fd=/(?:^|[-_])(\w)/g,zd=e=>e.replace(Fd,t=>t.toUpperCase()).replace(/[-_]/g,"");function pa(e,t=!0){return Be(e)?e.displayName||e.name:e.name||t&&e.__name}function ga(e,t,n=!1){let i=pa(t);if(!i&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(i=s[1])}if(!i&&e&&e.parent){const s=l=>{for(const a in l)if(l[a]===t)return a};i=s(e.components||e.parent.type.components)||s(e.appContext.components)}return i?zd(i):n?"App":"Anonymous"}function ba(e){return Be(e)&&"__vccOpts"in e}function ho(e){return!(!e||!e.__v_isShallow)}function ya(e,t,n){if(arguments.length===2)for(var i,s=0,l=t.length;s<l;s++)!i&&s in t||(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}function xa(e,t){if(e===t)return!0;if(typeof e=="object"){for(var n in e)if(!xa(e[n],t[n]))return!1;return!0}return!1}process.env.NODE_ENV!=="production"&&function(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#0b1bc9"},n={style:"color:#b62e24"},i={style:"color:#9d288c"},s={header:u=>Ue(u)?u.__isVue?["div",e,"VueInstance"]:je(u)?["div",{},["span",e,h(u)],"<",r(u.value),">"]:jt(u)?["div",{},["span",e,ho(u)?"ShallowReactive":"Reactive"],"<",r(u),">"+(Qt(u)?" (readonly)":"")]:Qt(u)?["div",{},["span",e,ho(u)?"ShallowReadonly":"Readonly"],"<",r(u),">"]:null:null,hasBody:u=>u&&u.__isVue,body(u){if(u&&u.__isVue)return["div",{},...l(u.$)]}};function l(u){const f=[];u.type.props&&u.props&&f.push(a("props",ge(u.props))),u.setupState!==Bs&&f.push(a("setup",u.setupState)),u.data!==Bs&&f.push(a("data",ge(u.data)));const m=c(u,"computed");m&&f.push(a("computed",m));const g=c(u,"inject");return g&&f.push(a("injected",g)),f.push(["div",{},["span",{style:i.style+";opacity:0.66"},"$ (internal): "],["object",{object:u}]]),f}function a(u,f){return f=dt({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},u],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(m=>["div",{},["span",i,m+": "],r(f[m],!1)])]]:["span",{}]}function r(u,f=!0){return typeof u=="number"?["span",t,u]:typeof u=="string"?["span",n,JSON.stringify(u)]:typeof u=="boolean"?["span",i,u]:Ue(u)?["object",{object:f?ge(u):u}]:["span",n,String(u)]}function c(u,f){const m=u.type;if(Be(m))return;const g={};for(const p in u.ctx)d(m,p,f)&&(g[p]=u.ctx[p]);return g}function d(u,f,m){const g=u[m];return!!(Ce(g)&&g.includes(f)||Ue(g)&&f in g)||!(!u.extends||!d(u.extends,f,m))||!(!u.mixins||!u.mixins.some(p=>d(p,f,m)))||void 0}function h(u){return ho(u)?"ShallowRef":u.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}(),typeof SuppressedError=="function"&&SuppressedError;var Hd=function(){function e(t,n){this.el=t,this.observer=null,this.frozen=!1,this.createObserver(n)}return Object.defineProperty(e.prototype,"threshold",{get:function(){return this.options.intersection&&this.options.intersection.threshold||0},enumerable:!1,configurable:!0}),e.prototype.createObserver=function(t){var n=this;if(this.observer&&this.destroyObserver(),!this.frozen){var i;if(this.options=typeof(i=t)=="function"?{callback:i}:i,this.callback=function(l,a){n.options.callback(l,a),l&&n.options.once&&(n.frozen=!0,n.destroyObserver())},this.callback&&this.options.throttle){var s=(this.options.throttleOptions||{}).leading;this.callback=function(l,a,r){var c,d,h;r===void 0&&(r={});var u=function(f){for(var m=[],g=1;g<arguments.length;g++)m[g-1]=arguments[g];if(h=m,!c||f!==d){var p=r.leading;typeof p=="function"&&(p=p(f,d)),c&&f===d||!p||l.apply(void 0,ya([f],h,!1)),d=f,clearTimeout(c),c=setTimeout(function(){l.apply(void 0,ya([f],h,!1)),c=0},a)}};return u._clear=function(){clearTimeout(c),c=null},u}(this.callback,this.options.throttle,{leading:function(l){return s==="both"||s==="visible"&&l||s==="hidden"&&!l}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(l){var a=l[0];if(l.length>1){var r=l.find(function(d){return d.isIntersecting});r&&(a=r)}if(n.callback){var c=a.isIntersecting&&a.intersectionRatio>=n.threshold;if(c===n.oldResult)return;n.oldResult=c,n.callback(c,a)}},this.options.intersection),Ql(function(){n.observer&&n.observer.observe(n.el)})}},e.prototype.destroyObserver=function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)},e}(),uo={beforeMount:function(e,t){var n=t.value;n&&(typeof IntersectionObserver>"u"?console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill"):e._vue_visibilityState=new Hd(e,n))},updated:function(e,t){var n=t.value;if(!xa(n,t.oldValue)){var i=e._vue_visibilityState;n&&i&&i.createObserver(n)}},unmounted:function(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}};const Dn={mounted(e,t){if(typeof ResizeObserver>"u")return;const n=t.value;if(typeof n!="function")return;getComputedStyle(e).position==="static"&&e.style.setProperty("position","relative","important");const i=new ResizeObserver(s=>{for(const l of s){const{width:a,height:r}=l.contentRect;n({width:a,height:r})}});i.observe(e),e.__resizeObserver__=i},unmounted(e){const t=e.__resizeObserver__;t&&(t.disconnect(),e.__resizeObserver__=null)}},ce=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n},Ad={name:"EvTabs",directives:{observeVisibility:uo,resize:Dn},props:{modelValue:{type:[String,Number],default:null},panels:{type:Array,default:()=>[],validator:e=>{const t=e.map(i=>i.value),n=[...new Set(t)];return e.length!==n.length?(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is duplicate values."),!1):e.every(i=>Object.hasOwnProperty.call(i,"value"))?!0:(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is essential."),!1)}},closable:{type:Boolean,default:!1},stretch:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:{"update:modelValue":[String,Number],"update:panels":[Array],change:[String,Number]},setup(e,{emit:t}){const n=o.ref(!1),i=o.ref([]),s=o.computed({get:()=>e.modelValue,set:x=>{t("update:modelValue",x),t("change",x)}});o.provide("evTabs",s);const l=o.computed({get:()=>e.panels,set:x=>t("update:panels",x)}),a=o.computed(()=>!e.draggable||!n.value?l.value:i.value),r=l.value.map(x=>x.value),c=o.ref(null),d=o.ref(null),h=o.ref(!1),u=o.reactive({x:0}),f=o.computed(()=>({transform:`translateX(${u.x}px)`})),m=()=>{if(!h.value||!d.value||!c.value)return;const x=a.value.findIndex(P=>P.value===s.value);if(x<0)return;const I=d.value.children[x];if(!I)return;const T=c.value.offsetWidth,v=d.value.offsetWidth,E=T-v,Z=I.offsetLeft,W=Z+I.offsetWidth,R=-u.x,X=R+T,G=a.value.length-1;let N=u.x;Z<R?N=x===0?0:-Z:W>X&&(N=x===G?E:T-W),u.x=Math.min(0,Math.max(E,N))},g=()=>{const x=c.value.offsetWidth,I=d.value.offsetWidth;if(h.value=x<I,h.value){const T=x-I;T>u.x&&(u.x=T),o.nextTick(m)}else u.x=0};o.watch(s,()=>{o.nextTick(m)}),o.onBeforeUpdate(()=>{if(r.length===l.value.length+1){let x,I;r.length>l.value.length?(x=r,I=l.value.map(v=>v.value)):(x=l.value.map(v=>v.value),I=r);const T=x.filter(v=>!I.includes(v))[0];if(s.value===T){const v=r.findIndex(E=>E===T);v===0?s.value=l.value[0].value:s.value=l.value[v-1].value}}});const p=x=>{s.value=x},y=x=>{if(l.value.length<2)return;const I=l.value.findIndex(T=>T.value===x);if(I<0){s.value=l.value[0].value;return}x===s.value&&(I===0?s.value=l.value[1].value:s.value=l.value[I-1].value),l.value.splice(I,1),o.nextTick(()=>{r.splice(I,1)}),o.triggerRef(l)},C=(x,I=100)=>{const T=c.value.offsetWidth,v=d.value.offsetWidth,E=T-v;x==="next"&&u.x!==E?E>=u.x-I?u.x=E:u.x-=I:x==="prev"&&u.x!==0&&(I*-1<=u.x?u.x=0:u.x+=I)},b=o.reactive({item:{},idx:null});return{mv:s,computedTabList:a,clickTab:p,removeTab:y,listWrapperRef:c,listRef:d,hasScroll:h,listRefStyle:f,scrollTab:C,dragstartTab:(x,I)=>{e.draggable&&(i.value=[...l.value],b.item=x,b.idx=I,n.value=!0)},dragoverTab:x=>{var v;if(!e.draggable||((v=b.item)==null?void 0:v.value)===x)return;const I=i.value.findIndex(E=>{var Z;return E.value===((Z=b.item)==null?void 0:Z.value)}),T=i.value.findIndex(E=>E.value===x);i.value.splice(I,1),i.value.splice(T,0,b.item)},dragendTab:()=>{e.draggable&&(l.value=[...i.value],b.item={},b.idx=null,n.value=!1,i.value.splice(0))},dragSelectCls:x=>{var I;return e.draggable&&((I=b.item)==null?void 0:I.value)===x},selectIdxCls:x=>e.draggable&&b.idx===x,onResize:()=>{g()}}}},_d={class:"ev-tabs-header"},Kd={ref:"listWrapperRef",class:"ev-tabs-list-wrapper"},Ud=["onClick","onDragstart","onDragover"],Jd=["title"],jd=["onClick"],Qd={class:"ev-tabs-body"};function $d(e,t,n,i,s,l){const a=o.resolveDirective("resize"),r=o.resolveDirective("observe-visibility");return o.withDirectives((o.openBlock(),o.createElementBlock("section",{class:o.normalizeClass(["ev-tabs",{closable:n.closable,stretch:n.stretch}])},[o.createElementVNode("div",_d,[o.createElementVNode("div",{class:o.normalizeClass(["ev-tabs-nav-wrapper",{"has-scroll":i.hasScroll}])},[i.hasScroll?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{class:"ev-tabs-arrow prev",onClick:t[0]||(t[0]=c=>i.scrollTab("prev"))},[...t[3]||(t[3]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-left"},null,-1)])]),o.createElementVNode("span",{class:"ev-tabs-arrow next",onClick:t[1]||(t[1]=c=>i.scrollTab("next"))},[...t[4]||(t[4]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-right"},null,-1)])])],64)):o.createCommentVNode("",!0),o.createElementVNode("div",Kd,[o.withDirectives((o.openBlock(),o.createElementBlock("ul",{ref:"listRef",class:"ev-tabs-list",style:o.normalizeStyle(i.listRefStyle)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.computedTabList,(c,d)=>(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:`${c.value}_${d}`,class:"ev-tabs-title"},{ref_for:!0},{draggable:n.draggable},{class:{active:c.value===i.mv,"has-icon":c.iconClass,"drag-select":i.dragSelectCls(c.value),"select-idx":i.selectIdxCls(d)},onClick:h=>i.clickTab(c.value),onDragstart:o.withModifiers(h=>i.dragstartTab(c,d),["stop"]),onDragover:o.withModifiers(h=>i.dragoverTab(c.value),["prevent"]),onDragend:t[2]||(t[2]=o.withModifiers((...h)=>i.dragendTab&&i.dragendTab(...h),["prevent"]))}),[c.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["ev-tabs-icon",c.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"text",title:c.text},o.toDisplayString(c.text),9,Jd),n.closable?(o.openBlock(),o.createElementBlock("span",{key:1,class:"close-icon",onClick:o.withModifiers(h=>i.removeTab(c.value),["stop"])},[...t[5]||(t[5]=[o.createElementVNode("i",{class:"ev-icon-s-close"},null,-1)])],8,jd)):o.createCommentVNode("",!0)],16,Ud))),128))],4)),[[a,i.onResize]])],512)],2)]),o.createElementVNode("div",Qd,[o.renderSlot(e.$slots,"default")])],2)),[[a,i.onResize],[r,{callback:i.onResize,once:!0}]])}const Bn=ce(Ad,[["render",$d]]);Bn.install=e=>{e.component(Bn.name,Bn)};const qd={name:"EvTabPanel",props:{text:{type:[String,Number],default:null},value:{type:[String,Number],default:null,required:!0},disabled:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1}},emits:{},setup(e){const t=o.inject("evTabs",null),n=o.computed(()=>e.value===t.value),i=o.ref(n.value);return o.watch(n,s=>{s&&(i.value=!0)}),{isSelected:n,hasBeenSelected:i}}},eh={key:0,class:"ev-tab-panel"};function th(e,t,n,i,s,l){return!n.lazy||i.hasBeenSelected?o.withDirectives((o.openBlock(),o.createElementBlock("article",eh,[o.renderSlot(e.$slots,"default")],512)),[[o.vShow,i.isSelected]]):o.createCommentVNode("",!0)}const On=ce(qd,[["render",th]]);On.install=e=>{e.component(On.name,On)};const nh={name:"EvButton",props:{disabled:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},type:{type:String,default:"default"},htmlType:{type:String,default:"button",validator:e=>["button","submit","reset"].includes(e)},shape:{type:String,default:"square"},size:{type:String,default:"medium"}},emits:{click:null},setup(e){const t=o.ref(null);return o.onMounted(()=>{e.autoFocus&&t.value.focus()}),{buttonRef:t}}},ih=["type","disabled","autofocus"];function sh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("button",{ref:"buttonRef",class:o.normalizeClass(["ev-button",{disabled:n.disabled,[`type-${n.type}`]:!!n.type,[`shape-${n.shape}`]:n.shape!=="square",[`size-${n.size}`]:n.size!=="medium"}]),type:n.htmlType,disabled:n.disabled,autofocus:n.autoFocus,onClick:t[0]||(t[0]=a=>e.$emit("click",a))},[o.renderSlot(e.$slots,"default")],10,ih)}const Sn=ce(nh,[["render",sh]]);Sn.install=e=>{e.component(Sn.name,Sn)};const oh={name:"EvButtonGroup"},lh={class:"ev-button-group"};function ah(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",lh,[o.renderSlot(e.$slots,"default")])}const Yn=ce(oh,[["render",ah]]);Yn.install=e=>{e.component(Yn.name,Yn)};const rh={name:"EvCheckbox",props:{modelValue:{type:[String,Number,Boolean,Symbol,Array],default:!1},label:{type:[String,Number,Boolean,Symbol,Object],default:null},tooltipTitle:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:{"update:modelValue":null,"update:indeterminate":[Boolean],change:null},setup(e,{emit:t}){const n=o.ref();o.onMounted(()=>{n.value&&e.tooltipTitle&&(n.value.title=e.tooltipTitle)});const i=o.ref(null),s=o.inject("EvCheckboxGroupMv",o.computed({get:()=>e.modelValue,set:c=>{c&&!i.value.indeterminate&&t("update:indeterminate",!1),t("update:modelValue",c)}})),l=o.computed(()=>e.label),a=o.computed(()=>Array.isArray(s.value)?s.value.includes(l.value):s.value),r=o.inject("EvCheckboxGroupChange",async c=>{await o.nextTick(),t("change",s.value,c)});return o.watch(()=>e.indeterminate,c=>{o.nextTick(()=>{i.value&&(i.value.indeterminate=c)})},{immediate:!0}),{mv:s,checkboxLabel:n,checkbox:i,checked:a,changeMv:r}}},ch=["disabled","value","readonly"],dh={ref:"checkboxLabel",class:"ev-checkbox-label"};function hh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(["ev-checkbox",[{disabled:n.disabled},{checked:i.checked}]])},[o.withDirectives(o.createElementVNode("input",{ref:"checkbox","onUpdate:modelValue":t[0]||(t[0]=a=>i.mv=a),type:"checkbox",class:"ev-checkbox-input",disabled:n.disabled,value:n.label,readonly:n.readonly,onChange:t[1]||(t[1]=(...a)=>i.changeMv&&i.changeMv(...a))},null,40,ch),[[o.vModelCheckbox,i.mv]]),o.createElementVNode("span",dh,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.label),1)],64))],512)],2)}const Cn=ce(rh,[["render",hh]]);Cn.install=e=>{e.component(Cn.name,Cn)};const uh={name:"EvCheckboxGroup",props:{modelValue:{type:Array,default:()=>[]},type:{type:String,default:"checkbox"}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:s=>t("update:modelValue",s)});o.provide("EvCheckboxGroupMv",n);const i=async s=>{await o.nextTick(),t("change",n.value,s)};o.provide("EvCheckboxGroupChange",i)}};function fh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-checkbox-group",{"type-button":n.type==="button"}]),role:"group"},[o.renderSlot(e.$slots,"default")],2)}const kn=ce(uh,[["render",fh]]);kn.install=e=>{e.component(kn.name,kn)};const mh={name:"EvRadio",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},label:{type:[String,Number,Symbol,Boolean],default:null},disabled:{type:Boolean,default:!1},size:{type:String,default:""}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=o.inject("EvRadioGroupMv",o.computed({get:()=>e.modelValue,set:l=>t("update:modelValue",l)})),i=o.inject("EvRadioGroupChange",async l=>{await o.nextTick(),t("change",n.value,l)}),s=o.computed(()=>n.value===e.label);return{mv:n,checked:s,changeMv:i}}},ph=["value","disabled"],gh={class:"ev-radio-label"};function bh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(["ev-radio",[{disabled:n.disabled,checked:i.checked},n.size]])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>i.mv=a),type:"radio",class:"ev-radio-input",value:n.label,disabled:n.disabled,onChange:t[1]||(t[1]=o.withModifiers((...a)=>i.changeMv&&i.changeMv(...a),["stop"]))},null,40,ph),[[o.vModelRadio,i.mv]]),o.createElementVNode("span",gh,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.label),1)],64))])],2)}const Fn=ce(mh,[["render",bh]]);Fn.install=e=>{e.component(Fn.name,Fn)};const yh={name:"EvRadioGroup",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},type:{type:String,default:"radio"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:s=>t("update:modelValue",s)});o.provide("EvRadioGroupMv",n);const i=async s=>{await o.nextTick(),t("change",n.value,s)};o.provide("EvRadioGroupChange",i)}};function xh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-radio-group",{"type-button":n.type==="button"}]),role:"group"},[o.renderSlot(e.$slots,"default")],2)}const zn=ce(yh,[["render",xh]]);zn.install=e=>{e.component(zn.name,zn)};const Ji={mounted(e,t){const n=e,i=t.modifiers.bubbles,s=l=>{(i||n!==l.target&&!n.contains(l.target))&&t.value(l)};n.vueClickOutside=s,document.addEventListener("mousedown",s)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}},Sh={mounted(e,t){const n=e;let i=null;const s=t.modifiers.bubble,l=document.body.getElementsByClassName("ev-select-dropbox"),a="ev-tag-name",r="ev-tag-suffix-close",c=d=>{if(!(d.target.classList.contains(a)||d.target.classList.contains(r))&&l&&l.length&&(s||n!==d.target&&!n.contains(d.target))){for(let h=0;h<l.length;h++)if(i=l[h],i!==d.target&&!i.contains(d.target)){t.value(d);break}}};n.vueClickOutside=c,document.addEventListener("mousedown",c)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}},Ch={mounted(e,t){const n=e,i=t.modifiers.bubbles,s=document.body.getElementsByClassName("ev-date-picker-dropdown"),l=a=>{(!s&&(i||n!==a.target&&!n.contains(a.target))||s&&s[0]&&s[0]!==a.target&&!s[0].contains(a.target)&&n!==a.target&&!n.contains(a.target))&&t.value(a)};n.vueClickOutside=l,document.addEventListener("mousedown",l)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}};var Yt=function(){return Yt=Object.assign||function(t){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Yt.apply(this,arguments)};function wn(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,l;i<s;i++)(l||!(i in t))&&(l||(l=Array.prototype.slice.call(t,0,i)),l[i]=t[i]);return e.concat(l||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ji=44032,Hn=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Fe=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"],Ze=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Ft={ㄲ:["ㄱ","ㄱ"],ㄳ:["ㄱ","ㅅ"],ㄵ:["ㄴ","ㅈ"],ㄶ:["ㄴ","ㅎ"],ㄺ:["ㄹ","ㄱ"],ㄻ:["ㄹ","ㅁ"],ㄼ:["ㄹ","ㅂ"],ㄽ:["ㄹ","ㅅ"],ㄾ:["ㄹ","ㅌ"],ㄿ:["ㄹ","ㅍ"],ㅀ:["ㄹ","ㅎ"],ㅄ:["ㅂ","ㅅ"],ㅆ:["ㅅ","ㅅ"],ㅘ:["ㅗ","ㅏ"],ㅙ:["ㅗ","ㅐ"],ㅚ:["ㅗ","ㅣ"],ㅝ:["ㅜ","ㅓ"],ㅞ:["ㅜ","ㅔ"],ㅟ:["ㅜ","ㅣ"],ㅢ:["ㅡ","ㅣ"]},fo={ㅗ:["ㅗ","ㅚ"],ㅜ:["ㅜ","ㅟ"],ㅡ:["ㅡ","ㅢ"]},Sa=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ","ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅛ","ㅜ","ㅠ","ㅡ","ㅣ"],Ca=[["ㄱ","r"],["ㄲ","R"],["ㄴ","s"],["ㄷ","e"],["ㄸ","E"],["ㄹ","f"],["ㅁ","a"],["ㅂ","q"],["ㅃ","Q"],["ㅅ","t"],["ㅆ","T"],["ㅇ","d"],["ㅈ","w"],["ㅉ","W"],["ㅊ","c"],["ㅋ","z"],["ㅌ","x"],["ㅍ","v"],["ㅎ","g"],["ㅏ","k"],["ㅐ","o"],["ㅑ","i"],["ㅒ","O"],["ㅓ","j"],["ㅔ","p"],["ㅕ","u"],["ㅖ","P"],["ㅗ","h"],["ㅛ","y"],["ㅜ","n"],["ㅠ","b"],["ㅡ","m"],["ㅣ","l"]];function ka(e){var t="",n="",i="",s=-1,l=-1,a=-1;if(e.match(/[ㄱ-ㅎ]/))t=e,s=Hn.join("").search(e);else if(e.match(/[가-힣]/)){var r=e.charCodeAt(0)-ji;a=r%Ze.length,l=(r-a)/Ze.length%Fe.length,s=((r-a)/Ze.length-l)/Fe.length,t=Hn[s],n=Fe[l],i=Ze[a]}return{initial:t,medial:n,finale:i,initialOffset:s,medialOffset:l,finaleOffset:a}}[["은","는"],["이","가"],["을","를"],["과","와"]].reduce(function(e,t){var n=t[0],i=t[1];return wn(wn([],e,!0),[[RegExp(`([가-힣]['" ]{0,1})`.concat(n,"\\(").concat(i,"\\)(\\s+)"),"g"),n,i],[RegExp(`([가-힣]['" ]{0,1})`.concat(i,"\\(").concat(n,"\\)(\\s+)"),"g"),n,i]],!1)},[]);function kh(e,t){var n=t===void 0?{}:t,i=n.grouped,s=i===void 0?!1:i,l=[];return e.split("").forEach(function(a){var r=ka(a),c=r.initial,d=r.medial,h=r.finale,u=r.initialOffset,f=r.medialOffset,m=r.finaleOffset;l.push((u!==-1||f!==-1||m!==-1?[c,Ft[d]&&Sa.indexOf(d)===-1?Ft[d]:d,Ft[h]&&Sa.indexOf(h)===-1?Ft[h]:h].filter(Boolean):[a]).flat())}),s?l:l.flat()}var en=Object.entries(Ft).reduce(function(e,t){var n,i=t[0],s=t[1];return Yt(Yt({},e),(n={},n[s.join("")]=i,n))},{}),wa=function(e){return typeof e<"u"};function wh(e){var t=e.findIndex(function(d){return Fe.indexOf(d)!==-1}),n=t!==-1&&Fe.indexOf(e[t+1])!==-1?t+1:t,i=e.slice(0,t).join(""),s=e.slice(t,n+1).join(""),l=e.slice(n+1).join(""),a=Hn.indexOf(en[i]||i),r=Fe.indexOf(en[s]||s),c=Ze.indexOf(en[l]||l);return a!==-1&&r!==-1?String.fromCharCode(ji+a*(Fe.length*Ze.length)+r*Ze.length+c):e.join("")}function Ih(e){var t=[];(typeof e=="string"?e.split(""):e).forEach(function(l,a,r){typeof l=="string"&&t.length>0&&Fe.indexOf(r[a-1])!==-1&&Fe.indexOf(l)!==-1&&en["".concat(r[a-1]).concat(l)]?t[t.length-1]=en["".concat(r[a-1]).concat(l)]:t.push(l)});var n={medial:null,finales:[]},i=[n];t.forEach(function(l){Array.isArray(l)?(n={medial:null,finales:[]},i.push({grouped:l,finales:[]}),i.push(n)):Fe.indexOf(l)!==-1?(n={medial:l,finales:[]},i.push(n)):n.finales.push(l)}),i.forEach(function(l,a,r){if(a>0){var c=r[a-1];if(!c.medial||c.finales.length===1)l.initials=c.finales,c.finales=[];else{var d=c.finales,h=d[0],u=d.slice(1);l.initials=u,c.finales=h?[h]:[]}if(l.finales.length>2||a===i.length-1&&l.finales.length>1){var f=l.finales,m=f[0],g=f[1],p=f.slice(2);en["".concat(m).concat(g)]&&(l.finales=wn([en["".concat(m).concat(g)]],p,!0))}}});var s=[];return i.forEach(function(l){var a=l.initials,r=a===void 0?[]:a,c=l.medial,d=l.finales,h=l.grouped;if(h)s.push(h);else{var u=r.slice(),f=u.pop(),m=d[0],g=d.slice(1);Ze.indexOf(m)===-1&&(g=wn([m],g,!0),m=""),u.filter(wa).forEach(function(p){return s.push([p])}),s.push([f,c,m].filter(Boolean)),g.filter(wa).forEach(function(p){return s.push([p])})}}),s.map(wh).join("")}var Th=Object.values(Ca).reduce(function(e,t){var n,i=t[0],s=t[1];return Yt(Yt({},e),(n={},n[s]=i,n))},{});function Ia(e){return Ih(e.split("").map(function(t){return Th[t]||t}).join(""))}var Ta=/[\\^$.*+?()[\]{}|]/g,Lh=RegExp(Ta.source);function mo(e){return e&&Lh.test(e)?e.replace(Ta,"\\$&"):e||""}var Qi=function(e,t){t===void 0&&(t=!1);var n=Hn.indexOf(e);if(n!==-1){var i=n*Fe.length*Ze.length+ji;return"[".concat(t?e:"").concat(String.fromCharCode(i),"-").concat(String.fromCharCode(i+Fe.length*Ze.length-1),"]")}return e},La="__".concat(parseInt("fuzzy",36),"__"),Ma="__".concat(parseInt("ignorespace",36),"__"),Mh=function(){var e,t;return function(n,i){var s=i===void 0?{}:i,l=s.initialSearch,a=l===void 0?!1:l,r=s.startsWith,c=r===void 0?!1:r,d=s.endsWith,h=d===void 0?!1:d,u=s.ignoreSpace,f=u===void 0?!1:u,m=s.ignoreCase,g=m===void 0?!0:m,p=s.global,y=p===void 0?!1:p,C=s.fuzzy,b=C===void 0?!1:C,k=s.nonCaptureGroup,L=k===void 0?!1:k,w=s.engToKor,M=w===void 0?!1:w;if(e===n)return t;var V=n,S=[];if(M&&n.trim().match(/^([a-zA-Z0-9\s]{2,})$/)){var x=Ia(n.trim());x.match(/^[가-힣ㄱ-ㅎ0-9]/)&&(V=x,S.push(mo(n.trim())))}var I=V.split(""),T=I.slice(-1)[0],v="",E=ka(T||"");if(E.initialOffset!==-1){I=I.slice(0,-1);var Z=E.initial,W=E.medial,R=E.finale,X=E.initialOffset,G=E.medialOffset,N=X*Fe.length*Ze.length+ji,P=[];switch(!0){case R!=="":{P.push(T),Hn.includes(R)&&P.push("".concat(String.fromCharCode(N+G*Ze.length)).concat(Qi(R))),Ft[R]&&P.push("".concat(String.fromCharCode(N+G*Ze.length+Ze.join("").search(Ft[R][0])+1)).concat(Qi(Ft[R][1])));break}case W!=="":{var B=void 0,z=void 0;fo[W]?(B=N+Fe.join("").search(fo[W][0])*Ze.length,z=N+Fe.join("").search(fo[W][1])*Ze.length+Ze.length-1):(B=N+G*Ze.length,z=B+Ze.length-1),P.push("[".concat(String.fromCharCode(B),"-").concat(String.fromCharCode(z),"]"));break}case Z!=="":{P.push(Qi(Z,!0));break}}v=P.length>1?L?"(?:".concat(P.join("|"),")"):"(".concat(P.join("|"),")"):P[0]}var D=b?La:f?Ma:"",Y=a?I.map(function(j){return j.search(/[ㄱ-ㅎ]/)!==-1?Qi(j,!0):mo(j)}).join(D):mo(I.join(D)),F=Y.trim()!==""&&v.trim()!=="",O=F?"".concat(Y).concat(D).concat(v):"".concat(Y).concat(v),H=(c?"^":"")+O+(h?"$":"");return D&&(H=H.replace(RegExp(La,"g"),".*").replace(RegExp(Ma,"g"),"\\s*")),S.length>0&&(H=wn(wn([],S,!0),[H],!1).map(function(j){return"(".concat(j,")")}).join("|")),t=RegExp(H,(y?"g":"")+(g?"i":"")),t}}(),vh=Object.values(Ca).reduce(function(e,t){var n,i=t[0],s=t[1];return Yt(Yt({},e),(n={},n[i]=s,n))},{});function Rh(e){return e.split("").map(function(t){return kh(t,{grouped:!1}).map(function(n){return vh[n]||n})}).flat().join("")}const va=new Set,Ra=(e,...t)=>{va.has(e)||(va.add(e),console.warn(...t))},Vh=(e,t="Component")=>{if(!e)return"body";const n=`${t}::${e}`;try{const i=document.querySelector(e);return i||(Ra(n,`[${t}] teleport selector "${e}" did not match any element. Falling back to document.body.`),document.body)}catch(i){return Ra(n,`[${t}] teleport selector "${e}" is invalid. Falling back to document.body.`,i),document.body}},Eh=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n={get:()=>e.items.some(p=>p.value===e.modelValue)?e.modelValue:null,set:p=>t("update:modelValue",p)},i={get:()=>Array.isArray(e.modelValue)?e.modelValue:[],set:p=>t("update:modelValue",p)},s=o.computed(e.multiple?i:n),l=()=>{var p;return(p=e.items.find(y=>y.value===s.value))==null?void 0:p.name},a=()=>e.items.filter(p=>e.modelValue.includes(p.value)),r=o.computed(e.multiple?a:l),c=o.computed(()=>e.multiple&&s.value.length?null:e.placeholder),d=()=>s.value,h=()=>s.value.length,u=o.computed(e.multiple?h:d),f=()=>{e.disabled||(e.multiple?(s.value.splice(0),s.value=[...s.value]):s.value=null)},m=async()=>{await o.nextTick(),t("change",s.value)};return{mv:s,selectedModel:r,computedPlaceholder:c,isClearableIcon:u,removeAllMv:f,removeMv:async p=>{if(!e.disabled){const y=s.value.indexOf(p);s.value.splice(y,1),s.value=[...s.value],await m()}},changeMv:m}},Wh=e=>{const{props:t}=o.getCurrentInstance(),{mv:n,changeMv:i}=e,s=o.ref(!1),l=o.ref(t.filterText),a=o.ref(null),r=o.ref(null),c=o.ref(null),d=o.ref(null),h=o.ref("100%"),u=o.ref(null),f=o.reactive({top:0,left:"auto"}),m=o.ref(!1),g=o.ref("body"),p=(D,Y)=>D?[D,Ia(D),Rh(D)].filter(Boolean).map(F=>Mh(F,Y)):[],y=o.computed(()=>{var F;const D=(F=l.value)==null?void 0:F.trim();if(!D||!t.filterable)return t.items;const Y=p(D);return t.items.filter(({name:O})=>Y.some(H=>O.search(H)>-1))}),C=o.computed(()=>{var D,Y;return!!((D=t.highlight)!=null&&D.match)&&t.filterable&&!!((Y=l.value)!=null&&Y.trim())}),b=o.computed(()=>{var D;return p((D=l.value)==null?void 0:D.trim(),{global:!0})}),k=D=>{const Y=[{text:D,matched:!1}];if(typeof D!="string"||!D)return Y;const F=[];if(b.value.forEach(U=>{U.lastIndex=0;let Q=U.exec(D);for(;Q;)Q[0].length?F.push([Q.index,Q.index+Q[0].length]):U.lastIndex+=1,Q=U.exec(D)}),!F.length)return Y;F.sort((U,Q)=>U[0]-Q[0]);const O=[F[0]];F.slice(1).forEach(([U,Q])=>{const J=O[O.length-1];U<=J[1]?J[1]=Math.max(J[1],Q):O.push([U,Q])});const H=[];let j=0;return O.forEach(([U,Q])=>{U>j&&H.push({text:D.slice(j,U),matched:!1}),H.push({text:D.slice(U,Q),matched:!0}),j=Q}),j<D.length&&H.push({text:D.slice(j),matched:!1}),H},L=o.computed(()=>C.value?y.value.map(({name:D})=>k(D)):[]),w=o.computed(()=>{var D;return(D=t.highlight)!=null&&D.color?{color:t.highlight.color}:null}),M=D=>{var Y;l.value=(Y=D==null?void 0:D.target)==null?void 0:Y.value},V=D=>{let Y=D==null?void 0:D.parentElement;for(;Y&&Y!==document.documentElement;){const F=window.getComputedStyle(Y);if(/(auto|scroll|overlay|hidden|clip)/.test(F.overflowY))return Y;Y=Y.parentElement}return document.documentElement},S=async({recomputeDirection:D=!1}={})=>{if(await o.nextTick(),!r.value||!c.value)return;const Y=r.value.getBoundingClientRect(),F=Y.height,O=Y.y,H=c.value.getBoundingClientRect().height;if(t.teleport){const j=document.documentElement.clientHeight;if(D){const U=Y.top,Q=j-Y.bottom,J=H>Q;m.value=J&&U>Q&&U>=H}f.top=m.value?`${Y.top-H}px`:`${Y.bottom}px`,f.left=`${Y.left}px`;return}if(D){const j=V(r.value),U=j===document.documentElement,Q=j.getBoundingClientRect(),J=document.documentElement.clientHeight,ne=U?J:Math.min(Q.bottom,J),q=U?0:Math.max(Q.top,0),ee=O-q,$=ne-(O+F),he=H>$;m.value=he&&ee>$&&ee>=H}m.value?f.top=`-${H}px`:f.top=`${F}px`,f.left="auto"},x=()=>{var H,j,U;if(!((U=(j=(H=d.value)==null?void 0:H.children[0])==null?void 0:j.children)!=null&&U.length))return;const D="selected",Y=d.value.children[0].children,F=d.value.offsetTop;let O=null;for(let Q=0;Q<Y.length;Q++)if(O=Y[Q],O.classList.contains(D)){if(!O.offsetTop)return;d.value.scrollTop=O.offsetTop-F;break}},I=async()=>{if(d.value&&c.value){await o.nextTick(),(u.value===null||u.value!==r.value.offsetWidth)&&(u.value=r.value.offsetWidth),t.teleport||(h.value=`${u.value}px`,await o.nextTick());const D=d.value.querySelectorAll(".ev-select-dropbox-item");let Y=0;D.forEach(ee=>{const $=ee.scrollWidth;$>Y&&(Y=$)});const{borderLeftWidth:F,borderRightWidth:O}=window.getComputedStyle(c.value),H=parseInt(F)+parseInt(O),j=d.value.offsetWidth-d.value.clientWidth;Y+=j+H;const U=window.innerWidth,J=c.value.getBoundingClientRect().left,ne=U-J-20,q=Math.max(Math.min(Y,ne),u.value);h.value=`${q}px`}else h.value="100%"};o.watch(()=>s.value,async D=>{D&&(await x(),await I())}),o.watch(()=>y.value,async()=>{await S()});const T=async()=>{if(t.items.length&&!t.disabled&&(s.value=!s.value,s.value)){if(t.teleport&&(g.value=Vh(t.teleport,"EvSelect"),r.value)){const D=r.value.getBoundingClientRect();h.value=`${D.width}px`,f.top=`${D.bottom}px`,f.left=`${D.left}px`}await S({recomputeDirection:!0})}},v=()=>{t.filterable&&(l.value=""),s.value=!1},E=o.ref(!1),Z=D=>{D||(E.value=!E.value),E.value?n.value=y.value.filter(Y=>!Y.disabled).map(Y=>Y.value):n.value=[]},W=D=>{t.filterable&&(l.value=""),s.value=!1,n.value!==D&&(n.value=D,i())},R=D=>{if(t.filterable&&(l.value=""),!n.value.includes(D))n.value.push(D);else{const Y=n.value.indexOf(D);n.value.splice(Y,1)}E.value=n.value.length===y.value.filter(Y=>!Y.disabled).length,n.value=[...n.value],i()},X=t.multiple?R:W,G=D=>D===n.value,N=D=>n.value.includes(D),P=t.multiple?N:G;o.watch(()=>n.value,D=>{t.multiple&&t.checkable&&(D.length===0?E.value=!1:E.value=D.length===y.value.filter(Y=>!Y.disabled).length,S())});const B=()=>{if(s.value){if(t.teleport){v();return}I(),S({recomputeDirection:!0})}},z=D=>{var O,H;if(!s.value)return;const Y=D.target;Y instanceof Element&&((O=c.value)!=null&&O.contains(Y)||(H=a.value)!=null&&H.contains(Y))||v()};return o.onMounted(()=>{window.addEventListener("resize",B)}),o.onUnmounted(()=>{window.removeEventListener("resize",B)}),o.watch(()=>!!t.teleport&&s.value,(D,Y,F)=>{D&&(window.addEventListener("scroll",z,{capture:!0,passive:!0}),F(()=>{window.removeEventListener("scroll",z,{capture:!0})}))}),{select:a,selectWrapper:r,dropbox:c,itemWrapper:d,isDropbox:s,dropboxPosition:f,filterTextRef:l,filteredItems:y,isHighlightMatch:C,itemChunks:L,highlightStyle:w,clickSelectInput:T,clickOutsideDropbox:v,changeFilterText:M,changeDropboxPosition:S,clickItem:X,selectedItemClass:P,allCheck:E,changeAllCheck:Z,dropboxWidth:h,teleportTarget:g}},Gh={name:"EvSelect",components:{EvCheckbox:Cn,EvCheckboxGroup:kn},directives:{clickoutside:Sh},props:{modelValue:{type:[Boolean,String,Number,Array,Object],default:null},placeholder:{type:String,default:""},searchPlaceholder:{type:String,default:"Please Enter a Search Words."},noMatchingText:{type:String,default:"NO MATCHING DATA"},items:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},filterText:{type:String,default:""},allCheckLabel:{type:String,default:"Select All"},teleport:{type:String,default:""},tagMaxRows:{type:Number,default:0,validator:e=>Number.isInteger(e)&&e>=0},highlight:{type:Object,default:()=>({}),validator:e=>(e.match===void 0||typeof e.match=="boolean")&&(e.color===void 0||typeof e.color=="string")&&Object.keys(e).every(t=>["match","color"].includes(t))}},emits:{"update:modelValue":null,change:null},setup(e){const t=o.computed(()=>e.tagMaxRows>0),{mv:n,selectedModel:i,computedPlaceholder:s,isClearableIcon:l,changeMv:a,removeMv:r,removeAllMv:c}=Eh(),{select:d,selectWrapper:h,dropbox:u,itemWrapper:f,isDropbox:m,dropboxPosition:g,filterTextRef:p,filteredItems:y,isHighlightMatch:C,itemChunks:b,highlightStyle:k,clickSelectInput:L,clickOutsideDropbox:w,changeFilterText:M,changeDropboxPosition:V,clickItem:S,selectedItemClass:x,allCheck:I,changeAllCheck:T,dropboxWidth:v,teleportTarget:E}=Wh({mv:n,changeMv:a});return{hasMaxRows:t,mv:n,selectedModel:i,computedPlaceholder:s,isClearableIcon:l,changeMv:a,removeMv:r,removeAllMv:c,select:d,selectWrapper:h,dropbox:u,itemWrapper:f,isDropbox:m,dropboxPosition:g,filterTextRef:p,filteredItems:y,isHighlightMatch:C,itemChunks:b,highlightStyle:k,clickSelectInput:L,clickOutsideDropbox:w,changeFilterText:M,changeDropboxPosition:V,clickItem:S,selectedItemClass:x,allCheck:I,changeAllCheck:T,dropboxWidth:v,teleportTarget:E}}},Zh={ref:"selectWrapper",class:"ev-select__wrapper"},Xh=["placeholder","disabled"],Nh=["tabindex","placeholder","disabled"],Ph={class:"ev-tag-name"},Dh=["onClick"],Bh={class:"ev-tag-name"},Oh={class:"ev-tag-name"},Yh={class:"ev-select-dropbox-wrapper"},Fh=["placeholder","value"],zh={ref:"itemWrapper",class:"ev-select-dropbox-list"},Hh={key:0,class:"ev-select-dropbox-ul"},Ah=["title","onClick"],_h={key:1},Kh={class:"ev-select-dropbox-item disabled"},Uh={key:0,class:"ev-select-dropbox-ul"},Jh=["title","onClick"],jh={key:2,ref:"itemWrapper",class:"ev-select-dropbox-list"},Qh={key:0,class:"ev-select-dropbox-ul"},$h=["title","onClick"],qh={key:1},eu={class:"ev-select-dropbox-item disabled"};function tu(e,t,n,i,s,l){const a=o.resolveComponent("ev-checkbox"),r=o.resolveComponent("ev-checkbox-group"),c=o.resolveDirective("clickoutside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"select",class:o.normalizeClass(["ev-select",{selected:i.isDropbox,disabled:n.disabled}])},[o.createElementVNode("div",Zh,[n.multiple?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["ev-select-tag-wrapper",{"has-max-rows":i.hasMaxRows}]),style:o.normalizeStyle(i.hasMaxRows?{"--ev-select-tag-max-rows":n.tagMaxRows}:null),onClick:t[9]||(t[9]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:t[3]||(t[3]=o.withModifiers((...d)=>i.clickSelectInput&&i.clickSelectInput(...d),["stop"]))},[o.createElementVNode("i",{class:o.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:i.isDropbox}])},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("input",{type:"text",class:"ev-input multiple",readonly:"",tabindex:i.hasMaxRows?-1:null,placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:t[4]||(t[4]=o.withModifiers((...d)=>i.clickSelectInput&&i.clickSelectInput(...d),["stop"]))},null,8,Nh),n.collapseTags?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[i.selectedModel.length?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ev-select-tag",onClick:t[7]||(t[7]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",Bh,o.toDisplayString(i.selectedModel[0].name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:t[6]||(t[6]=o.withModifiers(d=>[i.removeMv(i.selectedModel[0].value),i.changeDropboxPosition()],["stop"]))},[...t[17]||(t[17]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])])])):o.createCommentVNode("",!0),i.selectedModel.length>1?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-select-tag num",onClick:t[8]||(t[8]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",Oh," + "+o.toDisplayString(i.selectedModel.length-1),1)])):o.createCommentVNode("",!0)],64)):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.selectedModel,d=>(o.openBlock(),o.createElementBlock("div",{key:d,class:"ev-select-tag",onClick:t[5]||(t[5]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",Ph,o.toDisplayString(d.name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:o.withModifiers(h=>[i.removeMv(d.value),i.changeDropboxPosition()],["stop"])},[...t[16]||(t[16]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,Dh)]))),128))],6)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:t[0]||(t[0]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[o.createElementVNode("i",{class:o.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:i.isDropbox}])},null,2)])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=d=>i.selectedModel=d),type:"text",class:"ev-input",readonly:"",placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:t[2]||(t[2]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},null,8,Xh),[[o.vModelText,i.selectedModel]])],64)),n.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-input-suffix",onClick:t[10]||(t[10]=o.withModifiers(d=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...t[18]||(t[18]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",Yh,[(o.openBlock(),o.createBlock(o.Teleport,{to:i.teleportTarget,disabled:!n.teleport},[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:o.normalizeClass(["ev-select-dropbox",{teleported:!!n.teleport}]),style:o.normalizeStyle([i.dropboxPosition,{width:i.dropboxWidth}])},[n.filterable?o.renderSlot(e.$slots,"search-filter",{key:0,item:{value:i.filterTextRef,onInput:i.changeFilterText,class:"ev-input-query",placeholder:n.searchPlaceholder}},()=>[o.createElementVNode("input",{type:"text",class:"ev-input-query",placeholder:n.searchPlaceholder,value:i.filterTextRef,onInput:t[11]||(t[11]=(...d)=>i.changeFilterText&&i.changeFilterText(...d))},null,40,Fh)]):o.createCommentVNode("",!0),n.checkable?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.multiple?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-select-dropbox-item all-check",{selected:i.allCheck}]),onClick:t[14]||(t[14]=o.withModifiers(d=>[i.changeAllCheck(!1),i.changeDropboxPosition()],["self","prevent"]))},[o.createVNode(a,{modelValue:i.allCheck,"onUpdate:modelValue":t[12]||(t[12]=d=>i.allCheck=d),label:n.allCheckLabel,onChange:t[13]||(t[13]=d=>[i.changeAllCheck(!0),i.changeDropboxPosition()])},null,8,["modelValue","label"])],2)):o.createCommentVNode("",!0),o.createElementVNode("div",zh,[n.multiple?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.mv,"onUpdate:modelValue":t[15]||(t[15]=d=>i.mv=d)},{default:o.withCtx(()=>[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",Hh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["self","prevent"])},[o.createVNode(a,{label:d.value,disabled:d.disabled},{default:o.withCtx(()=>[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,f)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))]),_:2},1032,["label","disabled"])],10,Ah))),128))])):(o.openBlock(),o.createElementBlock("ul",_h,[o.createElementVNode("li",Kh,o.toDisplayString(n.noMatchingText),1)]))]),_:1},8,["modelValue"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",Uh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["stop","prevent"])},[o.createVNode(a,{"model-value":i.mv===d.value,disabled:d.disabled},{default:o.withCtx(()=>[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,f)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))]),_:2},1032,["model-value","disabled"])],10,Jh))),128))])):o.createCommentVNode("",!0)],64))],512)],64)):(o.openBlock(),o.createElementBlock("div",jh,[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",Qh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["stop","prevent"])},[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,f)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))],10,$h))),128))])):(o.openBlock(),o.createElementBlock("ul",qh,[o.createElementVNode("li",eu,o.toDisplayString(n.noMatchingText),1)]))],512))],6)):o.createCommentVNode("",!0)],8,["to","disabled"]))])],512)],2)),[[c,i.clickOutsideDropbox]])}const An=ce(Gh,[["render",tu]]);An.install=e=>{e.component(An.name,An)};const nu={name:"EvToggle",props:{modelValue:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:40},activeColor:{type:String,default:"#409EFF"},inactiveColor:{type:String,default:"#DCDFE6"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:s=>{t("update:modelValue",s),t("change",s)}});return{mv:n,clickMv:()=>{!e.disabled&&!e.readonly&&(n.value=!n.value)}}}};function iu(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-toggle",{checked:n.modelValue,disabled:n.disabled,readonly:n.readonly}]),style:o.normalizeStyle({width:`${n.width}px`,border:`1px solid ${n.modelValue?n.activeColor:n.inactiveColor}`,"background-color":`${n.modelValue?n.activeColor:n.inactiveColor}`}),onClick:t[0]||(t[0]=(...a)=>i.clickMv&&i.clickMv(...a))},null,6)}const _n=ce(nu,[["render",iu]]);_n.install=e=>{e.component(_n.name,_n)};const su={name:"EvTextField",props:{modelValue:{type:[String,Number],default:null},type:{type:String,default:"text"},placeholder:{type:String,default:""},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},maxLength:{type:Number,default:null},maxUnit:{type:String,default:"count"},showMaxLength:{type:Boolean,default:!1},errorMsg:{type:String,default:""},autocomplete:{type:String,default:"off"},modelModifiers:{type:Object,default:()=>({})}},emits:["update:modelValue","focus","blur","input","change","search"],setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:p=>t("update:modelValue",p)}),i=o.ref(!1),s=()=>{e.type==="password"&&(i.value=!i.value)},l=o.computed(()=>e.type==="password"?i.value?"text":"password":e.type==="search"?"text":e.type);o.watch(()=>e.type,p=>{p!=="password"&&(i.value=!1)});const a=()=>{n.value=""},r=()=>{t("search",n.value)},c=p=>{e.type==="search"&&(p.key==="Enter"||p.keyCode===13)&&r()},d=p=>{t("focus",p)},h=p=>{if(e.modelModifiers.trim&&typeof p.target.value=="string"){const y=p.target.value.trim();y!==p.target.value&&(n.value=y,p.target.value=y)}t("blur",p)},u=p=>new TextEncoder().encode(p).length,f=o.computed(()=>e.maxUnit==="byte"?u(n.value||""):(n.value||"").length);return{mv:n,inputType:l,isPasswordVisible:i,clearValue:a,changePasswordVisible:s,searchValue:r,keyupInput:c,focusInput:d,blurInput:h,inputMv:p=>{let y=p.target.value;if(e.maxLength&&e.maxUnit==="byte"){for(;u(y)>e.maxLength;)y=y.slice(0,-1);p.target.value=y}n.value=y,t("input",y,p)},changeMv:p=>t("change",n.value,p),currentLength:f}}},ou={class:"ev-text-field-wrapper"},lu=["placeholder","disabled","readonly","autocomplete","maxlength"],au=["type","placeholder","disabled","readonly","autocomplete","maxlength"],ru={key:3,class:"ev-text-field-icon icon-suffix"},cu={key:4,class:"ev-text-field-icon icon-prefix"},du={key:0,class:"ev-text-field-error"},hu={class:"curr-length"};function uu(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-text-field",{disabled:n.disabled,clearable:n.clearable,readonly:n.readonly,error:!!n.errorMsg,"show-password":n.showPassword,"show-maxlength":n.showMaxLength,[`type-${n.type}`]:!!n.type,"ev-text-field-prefix":e.$slots["icon-prefix"],"ev-text-field-suffix":e.$slots["icon-suffix"],"ev-text-field-prefix-suffix":e.$slots["icon-prefix"]&&e.$slots["icon-suffix"]}])},[o.createElementVNode("div",ou,[n.type==="textarea"?o.withDirectives((o.openBlock(),o.createElementBlock("textarea",{key:0,"onUpdate:modelValue":t[0]||(t[0]=a=>i.mv=a),class:"ev-textarea",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:t[1]||(t[1]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:t[2]||(t[2]=(...a)=>i.blurInput&&i.blurInput(...a)),onInput:t[3]||(t[3]=(...a)=>i.inputMv&&i.inputMv(...a)),onChange:t[4]||(t[4]=(...a)=>i.changeMv&&i.changeMv(...a))},null,40,lu)),[[o.vModelText,i.mv]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[5]||(t[5]=a=>i.mv=a),class:"ev-input",type:i.inputType,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:t[6]||(t[6]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:t[7]||(t[7]=(...a)=>i.blurInput&&i.blurInput(...a)),onInput:t[8]||(t[8]=(...a)=>i.inputMv&&i.inputMv(...a)),onChange:t[9]||(t[9]=(...a)=>i.changeMv&&i.changeMv(...a)),onKeyup:t[10]||(t[10]=(...a)=>i.keyupInput&&i.keyupInput(...a))},null,40,au),[[o.vModelDynamic,i.mv]]),n.type==="text"&&n.clearable?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-text-field-icon icon-clear",onClick:t[11]||(t[11]=(...a)=>i.clearValue&&i.clearValue(...a))},[...t[14]||(t[14]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])])):o.createCommentVNode("",!0),n.type==="password"&&n.showPassword?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["ev-text-field-icon icon-password",{on:i.isPasswordVisible}]),onClick:t[12]||(t[12]=(...a)=>i.changePasswordVisible&&i.changePasswordVisible(...a))},[o.createElementVNode("i",{class:o.normalizeClass(i.isPasswordVisible?"ev-icon-visibility":"ev-icon-visibility-off")},null,2)],2)):o.createCommentVNode("",!0),n.type==="search"?(o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-text-field-icon icon-search",onClick:t[13]||(t[13]=(...a)=>i.searchValue&&i.searchValue(...a))},[...t[15]||(t[15]=[o.createElementVNode("i",{class:"ev-icon-search"},null,-1)])])):o.createCommentVNode("",!0),e.$slots["icon-suffix"]?(o.openBlock(),o.createElementBlock("span",ru,[o.renderSlot(e.$slots,"icon-suffix")])):o.createCommentVNode("",!0),e.$slots["icon-prefix"]?(o.openBlock(),o.createElementBlock("span",cu,[o.renderSlot(e.$slots,"icon-prefix")])):o.createCommentVNode("",!0)],64))]),n.errorMsg?(o.openBlock(),o.createElementBlock("div",du,o.toDisplayString(n.errorMsg),1)):o.createCommentVNode("",!0),n.maxLength&&n.showMaxLength?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["ev-text-field-maxlength",{max:i.currentLength>n.maxLength}])},[o.createElementVNode("span",hu,o.toDisplayString(i.currentLength),1),o.createTextVNode(" / "+o.toDisplayString(n.maxLength)+o.toDisplayString(n.maxUnit==="byte"?" Bytes":""),1)],2)):o.createCommentVNode("",!0)],2)}const Kn=ce(su,[["render",uu]]);Kn.install=e=>{e.component(Kn.name,Kn)};const tn=globalThis.console,ye={log(...e){tn.log(...e)},warn(...e){tn.warn(...e)},info(...e){tn.info(...e)},error(...e){tn.error(...e)},debug(...e){tn.debug(...e)},dir(e,t){tn.dir(e,t)},table(e,t){tn.table(e,t)}};function Va(e){let t=null;if(typeof e=="string"||typeof e=="number"){const n=/^(normal|(-*\d+(?:\.\d+)?)(px|%)?)$/.exec(e);t=n?{value:+n[2],unit:n[3]||void 0}:null}return t}function Re(e){return typeof e=="number"&&!Number.isNaN(e)}function kt(...e){return e.every(Re)}function $e(e,t){const n=e/t*100;return!kt(e,t,n)||e===0||t===0?0:n.toFixed(2)}function fu(e){return kt(e)?1e6*e:0}function mu(e){return kt(e)?1e9*e:0}function pu(e){return kt(e)?1e12*e:0}function gu(e){return kt(e)?1e15*e:0}function nn(e){const t=/\B(?=(\d{3})+(?!\d))/g;if(kt(e)){if(Number.isInteger(e))return e.toString().replace(t,",");const n=e.toString().split(".");return n[0].replace(t,",")+(n[1]?`.${n[1]}`:"")}return!1}function Un(e){const t=(e==null?void 0:e.toString().split(".")[1])||0;return t?t.length:0}function po(e){return e==null}function bu(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||"ontouchstart"in window}function sn(e,{min:t,max:n,step:i}){const s=Math.floor((e-t)/i),l=(e-t)%i,a=Math.floor((n-t)/i),r=Math.max(Un(i),Un(t));let c=!1,d;if(r){let h=+parseFloat(i*s).toFixed(r);d=+(h+t).toFixed(r),c=s===a&&+(n-d).toFixed(r)!==i,l>i/2&&!c&&(d=+(d+i).toFixed(r)),d>n?(h=+parseFloat(i*a).toFixed(r),d=+(h+t).toFixed(r)):d<t&&(d=t)}else d=i*s+t,c=s===a&&n-d!==i,l>i/2&&!c&&(d+=i),d>n?d=i*a+t:d<t&&(d=t);return d}function yu(){const{props:e,emit:t}=o.getCurrentInstance(),n=o.ref(e.modelValue),i=o.ref(e.modelValue),s=d=>{if(e.precision&&(d||d===0)){const h=Number(d).toFixed(e.precision);return e.trimTrailingZero?String(parseFloat(h)):h}return d},l=d=>{let h=d;!d&&d!==0?e.disableEmpty?(h=0,e.stepStrictly?h=sn(h,{min:e.min===-1/0?0:e.min,max:e.max,step:e.step}):(e.min||e.min===0)&&h<e.min?h=e.min:(e.max||e.max===0)&&h>e.max&&(h=e.max)):h=e.stepStrictly?i.value:null:isNaN(d)?h=i.value:e.stepStrictly?(e.min===-1/0&&(e.min=0),h=sn(d,{min:e.min,max:e.max,step:e.step})):(e.min||e.min===0)&&h<e.min?h=e.min:(e.max||e.max===0)&&h>e.max?h=e.max:h=+h,n.value=s(h),i.value=s(h),t("update:modelValue",h),t("change",h)},a=d=>{t("focus",d)},r=d=>{t("blur",d)},c=d=>{l(d.target.value)};return o.watch(()=>e.modelValue,(d,h)=>{d!==h&&(n.value=s(d))}),{currentValue:n,validateValue:l,focusInput:a,blurInput:r,changeMv:c}}function xu(e){const{props:t}=o.getCurrentInstance(),{currentValue:n,validateValue:i}=e;return{stepValue:l=>{if(t.readonly||t.disabled)return;const a=!n.value&&n.value!==0;let r;if(a)r=t.min===-1/0?0:t.min;else{const c=+n.value,d=l==="up"?t.step:t.step*-1,u=10**Math.max(Un(c),Un(t.step));r=(Math.round(c*u)+Math.round(d*u))/u}if(t.clampOnStep){r<t.min?r=t.min:r>t.max&&(r=t.max);const c=t.stepStrictly?sn(r,{min:t.min===-1/0?0:t.min,max:t.max,step:t.step}):r;(a||c!==+n.value)&&i(r)}else r>=t.min&&r<=t.max&&i(r)}}}function Su(e){const{props:t}=o.getCurrentInstance(),{currentValue:n,validateValue:i}=e,s=t.max||t.max===0,l=t.min||t.min===0,a=()=>{s&&l&&t.max<=t.min&&console.warn("[EVUI][InputNumber] Max value must be greater than min value."),t.step&&(t.precision||t.precision===0)&&Un(t.step)>t.precision&&console.warn("[EVUI][InputNumber] It cannot be calculated because the step is smaller than the precision setting.")},r=()=>{let c=n.value;isNaN(n.value)&&(c=0),(c||c===0)&&(s&&c>t.max?c=t.max:l&&c<t.min&&(c=t.min)),i(c)};o.onBeforeMount(()=>{a(),r()})}const Cu={name:"EvInputNumber",props:{modelValue:{type:[String,Number],default:null},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},step:{type:Number,default:1,validator:e=>e>0},stepStrictly:{type:Boolean,default:!1},precision:{type:Number,default:0,validator:e=>e>=0&&e<=100&&e===parseInt(e,10)},trimTrailingZero:{type:Boolean,default:!1},disableEmpty:{type:Boolean,default:!1},clampOnStep:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur","input","change"],setup(){const{currentValue:e,validateValue:t,focusInput:n,blurInput:i,changeMv:s}=yu(),{stepValue:l}=xu({currentValue:e,validateValue:t});return Su({currentValue:e,validateValue:t}),{currentValue:e,validateValue:t,focusInput:n,blurInput:i,changeMv:s,stepValue:l}}},ku={class:"ev-input-number__wrapper"},wu=["onClick"],Iu=["placeholder","disabled","readonly"];function Tu(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-input-number",{disabled:n.disabled,readonly:n.readonly}])},[o.createElementVNode("div",ku,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["up","down"],a=>o.createElementVNode("span",{key:`step-arrow-${a}`,class:o.normalizeClass(["ev-input-number-icon",`step-${a}`]),onClick:r=>i.stepValue(a)},[o.createElementVNode("i",{class:o.normalizeClass(`ev-icon-s-arrow-${a}`)},null,2)],10,wu)),64)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>i.currentValue=a),class:"ev-input",type:"text",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,onFocus:t[1]||(t[1]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:t[2]||(t[2]=(...a)=>i.blurInput&&i.blurInput(...a)),onChange:t[3]||(t[3]=(...a)=>i.changeMv&&i.changeMv(...a)),onKeydown:[t[4]||(t[4]=o.withKeys(o.withModifiers(a=>i.stepValue("up"),["prevent"]),["up"])),t[5]||(t[5]=o.withKeys(o.withModifiers(a=>i.stepValue("down"),["prevent"]),["down"])),t[6]||(t[6]=o.withKeys(o.withModifiers(a=>i.validateValue(i.currentValue),["prevent"]),["enter"]))]},null,40,Iu),[[o.vModelText,i.currentValue,void 0,{trim:!0}]])])],2)}const Jn=ce(Cu,[["render",Tu]]);Jn.install=e=>{e.component(Jn.name,Jn)};var Ea=typeof global=="object"&&global&&global.Object===Object&&global,Lu=typeof self=="object"&&self&&self.Object===Object&&self,ut=Ea||Lu||Function("return this")(),wt=ut.Symbol,Wa=Object.prototype,Mu=Wa.hasOwnProperty,vu=Wa.toString,jn=wt?wt.toStringTag:void 0;function Ru(e){var t=Mu.call(e,jn),n=e[jn];try{e[jn]=void 0;var i=!0}catch{}var s=vu.call(e);return i&&(t?e[jn]=n:delete e[jn]),s}var Vu=Object.prototype,Eu=Vu.toString;function Wu(e){return Eu.call(e)}var Gu="[object Null]",Zu="[object Undefined]",Ga=wt?wt.toStringTag:void 0;function zt(e){return e==null?e===void 0?Zu:Gu:Ga&&Ga in Object(e)?Ru(e):Wu(e)}function ft(e){return e!=null&&typeof e=="object"}var Xu="[object Symbol]";function $i(e){return typeof e=="symbol"||ft(e)&&zt(e)==Xu}function Nu(e,t){for(var n=-1,i=e==null?0:e.length,s=Array(i);++n<i;)s[n]=t(e[n],n,e);return s}var it=Array.isArray,Za=wt?wt.prototype:void 0,Xa=Za?Za.toString:void 0;function Na(e){if(typeof e=="string")return e;if(it(e))return Nu(e,Na)+"";if($i(e))return Xa?Xa.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Pu=/\s/;function Du(e){for(var t=e.length;t--&&Pu.test(e.charAt(t)););return t}var Bu=/^\s+/;function Ou(e){return e&&e.slice(0,Du(e)+1).replace(Bu,"")}function ze(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Pa=NaN,Yu=/^[-+]0x[0-9a-f]+$/i,Fu=/^0b[01]+$/i,zu=/^0o[0-7]+$/i,Hu=parseInt;function qi(e){if(typeof e=="number")return e;if($i(e))return Pa;if(ze(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ze(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ou(e);var n=Fu.test(e);return n||zu.test(e)?Hu(e.slice(2),n?2:8):Yu.test(e)?Pa:+e}var Da=1/0,Au=17976931348623157e292;function Ba(e){if(!e)return e===0?e:0;if(e=qi(e),e===Da||e===-Da){var t=e<0?-1:1;return t*Au}return e===e?e:0}function go(e){return e}var _u="[object AsyncFunction]",Ku="[object Function]",Uu="[object GeneratorFunction]",Ju="[object Proxy]";function Qn(e){if(!ze(e))return!1;var t=zt(e);return t==Ku||t==Uu||t==_u||t==Ju}var bo=ut["__core-js_shared__"],Oa=function(){var e=/[^.]+$/.exec(bo&&bo.keys&&bo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ju(e){return!!Oa&&Oa in e}var Qu=Function.prototype,$u=Qu.toString;function on(e){if(e!=null){try{return $u.call(e)}catch{}try{return e+""}catch{}}return""}var qu=/[\\^$.*+?()[\]{}|]/g,ef=/^\[object .+?Constructor\]$/,tf=Function.prototype,nf=Object.prototype,sf=tf.toString,of=nf.hasOwnProperty,lf=RegExp("^"+sf.call(of).replace(qu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function af(e){if(!ze(e)||ju(e))return!1;var t=Qn(e)?lf:ef;return t.test(on(e))}function rf(e,t){return e==null?void 0:e[t]}function ln(e,t){var n=rf(e,t);return af(n)?n:void 0}var yo=ln(ut,"WeakMap"),Ya=Object.create,cf=function(){function e(){}return function(t){if(!ze(t))return{};if(Ya)return Ya(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Fa(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function df(){}function hf(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}var uf=800,ff=16,mf=Date.now;function pf(e){var t=0,n=0;return function(){var i=mf(),s=ff-(i-n);if(n=i,s>0){if(++t>=uf)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function gf(e){return function(){return e}}var es=function(){try{var e=ln(Object,"defineProperty");return e({},"",{}),e}catch{}}(),bf=es?function(e,t){return es(e,"toString",{configurable:!0,enumerable:!1,value:gf(t),writable:!0})}:go,yf=pf(bf);function xf(e,t){for(var n=-1,i=e==null?0:e.length;++n<i&&t(e[n],n,e)!==!1;);return e}function Sf(e,t,n,i){for(var s=e.length,l=n+-1;++l<s;)if(t(e[l],l,e))return l;return-1}function Cf(e){return e!==e}function kf(e,t,n){for(var i=n-1,s=e.length;++i<s;)if(e[i]===t)return i;return-1}function wf(e,t,n){return t===t?kf(e,t,n):Sf(e,Cf,n)}function If(e,t){var n=e==null?0:e.length;return!!n&&wf(e,t,0)>-1}var Tf=9007199254740991,Lf=/^(?:0|[1-9]\d*)$/;function xo(e,t){var n=typeof e;return t=t??Tf,!!t&&(n=="number"||n!="symbol"&&Lf.test(e))&&e>-1&&e%1==0&&e<t}function So(e,t,n){t=="__proto__"&&es?es(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function In(e,t){return e===t||e!==e&&t!==t}var Mf=Object.prototype,vf=Mf.hasOwnProperty;function za(e,t,n){var i=e[t];(!(vf.call(e,t)&&In(i,n))||n===void 0&&!(t in e))&&So(e,t,n)}function Rf(e,t,n,i){var s=!n;n||(n={});for(var l=-1,a=t.length;++l<a;){var r=t[l],c=void 0;c===void 0&&(c=e[r]),s?So(n,r,c):za(n,r,c)}return n}var Ha=Math.max;function Vf(e,t,n){return t=Ha(t===void 0?e.length-1:t,0),function(){for(var i=arguments,s=-1,l=Ha(i.length-t,0),a=Array(l);++s<l;)a[s]=i[t+s];s=-1;for(var r=Array(t+1);++s<t;)r[s]=i[s];return r[t]=n(a),Fa(e,this,r)}}function Co(e,t){return yf(Vf(e,t,go),e+"")}var Ef=9007199254740991;function ko(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ef}function ts(e){return e!=null&&ko(e.length)&&!Qn(e)}function Aa(e,t,n){if(!ze(n))return!1;var i=typeof t;return(i=="number"?ts(n)&&xo(t,n.length):i=="string"&&t in n)?In(n[t],e):!1}function _a(e){return Co(function(t,n){var i=-1,s=n.length,l=s>1?n[s-1]:void 0,a=s>2?n[2]:void 0;for(l=e.length>3&&typeof l=="function"?(s--,l):void 0,a&&Aa(n[0],n[1],a)&&(l=s<3?void 0:l,s=1),t=Object(t);++i<s;){var r=n[i];r&&e(t,r,i,l)}return t})}var Wf=Object.prototype;function wo(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Wf;return e===n}function Gf(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}var Zf="[object Arguments]";function Ka(e){return ft(e)&&zt(e)==Zf}var Ua=Object.prototype,Xf=Ua.hasOwnProperty,Nf=Ua.propertyIsEnumerable,ns=Ka(function(){return arguments}())?Ka:function(e){return ft(e)&&Xf.call(e,"callee")&&!Nf.call(e,"callee")};function Pf(){return!1}var Ja=typeof le=="object"&&le&&!le.nodeType&&le,ja=Ja&&typeof module=="object"&&module&&!module.nodeType&&module,Df=ja&&ja.exports===Ja,Qa=Df?ut.Buffer:void 0,Bf=Qa?Qa.isBuffer:void 0,$n=Bf||Pf,Of="[object Arguments]",Yf="[object Array]",Ff="[object Boolean]",zf="[object Date]",Hf="[object Error]",Af="[object Function]",_f="[object Map]",Kf="[object Number]",Uf="[object Object]",Jf="[object RegExp]",jf="[object Set]",Qf="[object String]",$f="[object WeakMap]",qf="[object ArrayBuffer]",em="[object DataView]",tm="[object Float32Array]",nm="[object Float64Array]",im="[object Int8Array]",sm="[object Int16Array]",om="[object Int32Array]",lm="[object Uint8Array]",am="[object Uint8ClampedArray]",rm="[object Uint16Array]",cm="[object Uint32Array]",ke={};ke[tm]=ke[nm]=ke[im]=ke[sm]=ke[om]=ke[lm]=ke[am]=ke[rm]=ke[cm]=!0,ke[Of]=ke[Yf]=ke[qf]=ke[Ff]=ke[em]=ke[zf]=ke[Hf]=ke[Af]=ke[_f]=ke[Kf]=ke[Uf]=ke[Jf]=ke[jf]=ke[Qf]=ke[$f]=!1;function dm(e){return ft(e)&&ko(e.length)&&!!ke[zt(e)]}function Io(e){return function(t){return e(t)}}var $a=typeof le=="object"&&le&&!le.nodeType&&le,qn=$a&&typeof module=="object"&&module&&!module.nodeType&&module,hm=qn&&qn.exports===$a,To=hm&&Ea.process,Tn=function(){try{var e=qn&&qn.require&&qn.require("util").types;return e||To&&To.binding&&To.binding("util")}catch{}}(),qa=Tn&&Tn.isTypedArray,Lo=qa?Io(qa):dm,um=Object.prototype,fm=um.hasOwnProperty;function er(e,t){var n=it(e),i=!n&&ns(e),s=!n&&!i&&$n(e),l=!n&&!i&&!s&&Lo(e),a=n||i||s||l,r=a?Gf(e.length,String):[],c=r.length;for(var d in e)(t||fm.call(e,d))&&!(a&&(d=="length"||s&&(d=="offset"||d=="parent")||l&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||xo(d,c)))&&r.push(d);return r}function tr(e,t){return function(n){return e(t(n))}}var mm=tr(Object.keys,Object),pm=Object.prototype,gm=pm.hasOwnProperty;function bm(e){if(!wo(e))return mm(e);var t=[];for(var n in Object(e))gm.call(e,n)&&n!="constructor"&&t.push(n);return t}function nr(e){return ts(e)?er(e):bm(e)}function ym(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var xm=Object.prototype,Sm=xm.hasOwnProperty;function Cm(e){if(!ze(e))return ym(e);var t=wo(e),n=[];for(var i in e)i=="constructor"&&(t||!Sm.call(e,i))||n.push(i);return n}function Mo(e){return ts(e)?er(e,!0):Cm(e)}var km=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wm=/^\w*$/;function vo(e,t){if(it(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||$i(e)?!0:wm.test(e)||!km.test(e)||t!=null&&e in Object(t)}var ei=ln(Object,"create");function Im(){this.__data__=ei?ei(null):{},this.size=0}function Tm(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Lm="__lodash_hash_undefined__",Mm=Object.prototype,vm=Mm.hasOwnProperty;function Rm(e){var t=this.__data__;if(ei){var n=t[e];return n===Lm?void 0:n}return vm.call(t,e)?t[e]:void 0}var Vm=Object.prototype,Em=Vm.hasOwnProperty;function Wm(e){var t=this.__data__;return ei?t[e]!==void 0:Em.call(t,e)}var Gm="__lodash_hash_undefined__";function Zm(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ei&&t===void 0?Gm:t,this}function an(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}an.prototype.clear=Im,an.prototype.delete=Tm,an.prototype.get=Rm,an.prototype.has=Wm,an.prototype.set=Zm;function Xm(){this.__data__=[],this.size=0}function is(e,t){for(var n=e.length;n--;)if(In(e[n][0],t))return n;return-1}var Nm=Array.prototype,Pm=Nm.splice;function Dm(e){var t=this.__data__,n=is(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():Pm.call(t,n,1),--this.size,!0}function Bm(e){var t=this.__data__,n=is(t,e);return n<0?void 0:t[n][1]}function Om(e){return is(this.__data__,e)>-1}function Ym(e,t){var n=this.__data__,i=is(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function vt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}vt.prototype.clear=Xm,vt.prototype.delete=Dm,vt.prototype.get=Bm,vt.prototype.has=Om,vt.prototype.set=Ym;var ti=ln(ut,"Map");function Fm(){this.size=0,this.__data__={hash:new an,map:new(ti||vt),string:new an}}function zm(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ss(e,t){var n=e.__data__;return zm(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Hm(e){var t=ss(this,e).delete(e);return this.size-=t?1:0,t}function Am(e){return ss(this,e).get(e)}function _m(e){return ss(this,e).has(e)}function Km(e,t){var n=ss(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function Rt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Rt.prototype.clear=Fm,Rt.prototype.delete=Hm,Rt.prototype.get=Am,Rt.prototype.has=_m,Rt.prototype.set=Km;var Um="Expected a function";function Ro(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Um);var n=function(){var i=arguments,s=t?t.apply(this,i):i[0],l=n.cache;if(l.has(s))return l.get(s);var a=e.apply(this,i);return n.cache=l.set(s,a)||l,a};return n.cache=new(Ro.Cache||Rt),n}Ro.Cache=Rt;var Jm=500;function jm(e){var t=Ro(e,function(i){return n.size===Jm&&n.clear(),i}),n=t.cache;return t}var Qm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$m=/\\(\\)?/g,qm=jm(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Qm,function(n,i,s,l){t.push(s?l.replace($m,"$1"):i||n)}),t});function ep(e){return e==null?"":Na(e)}function ir(e,t){return it(e)?e:vo(e,t)?[e]:qm(ep(e))}function os(e){if(typeof e=="string"||$i(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function sr(e,t){t=ir(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[os(t[n++])];return n&&n==i?e:void 0}function tp(e,t,n){var i=e==null?void 0:sr(e,t);return i===void 0?n:i}function np(e,t){for(var n=-1,i=t.length,s=e.length;++n<i;)e[s+n]=t[n];return e}var or=tr(Object.getPrototypeOf,Object),ip="[object Object]",sp=Function.prototype,op=Object.prototype,lr=sp.toString,lp=op.hasOwnProperty,ap=lr.call(Object);function rp(e){if(!ft(e)||zt(e)!=ip)return!1;var t=or(e);if(t===null)return!0;var n=lp.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&lr.call(n)==ap}function cp(){this.__data__=new vt,this.size=0}function dp(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hp(e){return this.__data__.get(e)}function up(e){return this.__data__.has(e)}var fp=200;function mp(e,t){var n=this.__data__;if(n instanceof vt){var i=n.__data__;if(!ti||i.length<fp-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Rt(i)}return n.set(e,t),this.size=n.size,this}function mt(e){var t=this.__data__=new vt(e);this.size=t.size}mt.prototype.clear=cp,mt.prototype.delete=dp,mt.prototype.get=hp,mt.prototype.has=up,mt.prototype.set=mp;var ar=typeof le=="object"&&le&&!le.nodeType&&le,rr=ar&&typeof module=="object"&&module&&!module.nodeType&&module,pp=rr&&rr.exports===ar,cr=pp?ut.Buffer:void 0,dr=cr?cr.allocUnsafe:void 0;function hr(e,t){if(t)return e.slice();var n=e.length,i=dr?dr(n):new e.constructor(n);return e.copy(i),i}function gp(e,t){for(var n=-1,i=e==null?0:e.length,s=0,l=[];++n<i;){var a=e[n];t(a,n,e)&&(l[s++]=a)}return l}function bp(){return[]}var yp=Object.prototype,xp=yp.propertyIsEnumerable,ur=Object.getOwnPropertySymbols,Sp=ur?function(e){return e==null?[]:(e=Object(e),gp(ur(e),function(t){return xp.call(e,t)}))}:bp;function Cp(e,t,n){var i=t(e);return it(e)?i:np(i,n(e))}function Vo(e){return Cp(e,nr,Sp)}var Eo=ln(ut,"DataView"),Wo=ln(ut,"Promise"),Ln=ln(ut,"Set"),fr="[object Map]",kp="[object Object]",mr="[object Promise]",pr="[object Set]",gr="[object WeakMap]",br="[object DataView]",wp=on(Eo),Ip=on(ti),Tp=on(Wo),Lp=on(Ln),Mp=on(yo),pt=zt;(Eo&&pt(new Eo(new ArrayBuffer(1)))!=br||ti&&pt(new ti)!=fr||Wo&&pt(Wo.resolve())!=mr||Ln&&pt(new Ln)!=pr||yo&&pt(new yo)!=gr)&&(pt=function(e){var t=zt(e),n=t==kp?e.constructor:void 0,i=n?on(n):"";if(i)switch(i){case wp:return br;case Ip:return fr;case Tp:return mr;case Lp:return pr;case Mp:return gr}return t});var vp=Object.prototype,Rp=vp.hasOwnProperty;function Vp(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Rp.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var ls=ut.Uint8Array;function Go(e){var t=new e.constructor(e.byteLength);return new ls(t).set(new ls(e)),t}function Ep(e,t){var n=Go(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Wp=/\w*$/;function Gp(e){var t=new e.constructor(e.source,Wp.exec(e));return t.lastIndex=e.lastIndex,t}var yr=wt?wt.prototype:void 0,xr=yr?yr.valueOf:void 0;function Zp(e){return xr?Object(xr.call(e)):{}}function Sr(e,t){var n=t?Go(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Xp="[object Boolean]",Np="[object Date]",Pp="[object Map]",Dp="[object Number]",Bp="[object RegExp]",Op="[object Set]",Yp="[object String]",Fp="[object Symbol]",zp="[object ArrayBuffer]",Hp="[object DataView]",Ap="[object Float32Array]",_p="[object Float64Array]",Kp="[object Int8Array]",Up="[object Int16Array]",Jp="[object Int32Array]",jp="[object Uint8Array]",Qp="[object Uint8ClampedArray]",$p="[object Uint16Array]",qp="[object Uint32Array]";function eg(e,t,n){var i=e.constructor;switch(t){case zp:return Go(e);case Xp:case Np:return new i(+e);case Hp:return Ep(e);case Ap:case _p:case Kp:case Up:case Jp:case jp:case Qp:case $p:case qp:return Sr(e,n);case Pp:return new i;case Dp:case Yp:return new i(e);case Bp:return Gp(e);case Op:return new i;case Fp:return Zp(e)}}function Cr(e){return typeof e.constructor=="function"&&!wo(e)?cf(or(e)):{}}var tg="[object Map]";function ng(e){return ft(e)&&pt(e)==tg}var kr=Tn&&Tn.isMap,ig=kr?Io(kr):ng,sg="[object Set]";function og(e){return ft(e)&&pt(e)==sg}var wr=Tn&&Tn.isSet,lg=wr?Io(wr):og,ag=1,Ir="[object Arguments]",rg="[object Array]",cg="[object Boolean]",dg="[object Date]",hg="[object Error]",Tr="[object Function]",ug="[object GeneratorFunction]",fg="[object Map]",mg="[object Number]",Lr="[object Object]",pg="[object RegExp]",gg="[object Set]",bg="[object String]",yg="[object Symbol]",xg="[object WeakMap]",Sg="[object ArrayBuffer]",Cg="[object DataView]",kg="[object Float32Array]",wg="[object Float64Array]",Ig="[object Int8Array]",Tg="[object Int16Array]",Lg="[object Int32Array]",Mg="[object Uint8Array]",vg="[object Uint8ClampedArray]",Rg="[object Uint16Array]",Vg="[object Uint32Array]",xe={};xe[Ir]=xe[rg]=xe[Sg]=xe[Cg]=xe[cg]=xe[dg]=xe[kg]=xe[wg]=xe[Ig]=xe[Tg]=xe[Lg]=xe[fg]=xe[mg]=xe[Lr]=xe[pg]=xe[gg]=xe[bg]=xe[yg]=xe[Mg]=xe[vg]=xe[Rg]=xe[Vg]=!0,xe[hg]=xe[Tr]=xe[xg]=!1;function ni(e,t,n,i,s,l){var a,r=t&ag;if(n&&(a=s?n(e,i,s,l):n(e)),a!==void 0)return a;if(!ze(e))return e;var c=it(e);if(c)a=Vp(e);else{var d=pt(e),h=d==Tr||d==ug;if($n(e))return hr(e,r);if(d==Lr||d==Ir||h&&!s)a=h?{}:Cr(e);else{if(!xe[d])return s?e:{};a=eg(e,d,r)}}l||(l=new mt);var u=l.get(e);if(u)return u;l.set(e,a),lg(e)?e.forEach(function(g){a.add(ni(g,t,n,g,e,l))}):ig(e)&&e.forEach(function(g,p){a.set(p,ni(g,t,n,p,e,l))});var f=Vo,m=c?void 0:f(e);return xf(m||e,function(g,p){m&&(p=g,g=e[p]),za(a,p,ni(g,t,n,p,e,l))}),a}var Eg=1,Wg=4;function Ve(e){return ni(e,Eg|Wg)}var Gg=1,Zg=4;function Mr(e,t){return t=typeof t=="function"?t:void 0,ni(e,Gg|Zg,t)}var Xg="__lodash_hash_undefined__";function Ng(e){return this.__data__.set(e,Xg),this}function Pg(e){return this.__data__.has(e)}function ii(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Rt;++t<n;)this.add(e[t])}ii.prototype.add=ii.prototype.push=Ng,ii.prototype.has=Pg;function Dg(e,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function vr(e,t){return e.has(t)}var Bg=1,Og=2;function Rr(e,t,n,i,s,l){var a=n&Bg,r=e.length,c=t.length;if(r!=c&&!(a&&c>r))return!1;var d=l.get(e),h=l.get(t);if(d&&h)return d==t&&h==e;var u=-1,f=!0,m=n&Og?new ii:void 0;for(l.set(e,t),l.set(t,e);++u<r;){var g=e[u],p=t[u];if(i)var y=a?i(p,g,u,t,e,l):i(g,p,u,e,t,l);if(y!==void 0){if(y)continue;f=!1;break}if(m){if(!Dg(t,function(C,b){if(!vr(m,b)&&(g===C||s(g,C,n,i,l)))return m.push(b)})){f=!1;break}}else if(!(g===p||s(g,p,n,i,l))){f=!1;break}}return l.delete(e),l.delete(t),f}function Yg(e){var t=-1,n=Array(e.size);return e.forEach(function(i,s){n[++t]=[s,i]}),n}function Zo(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var Fg=1,zg=2,Hg="[object Boolean]",Ag="[object Date]",_g="[object Error]",Kg="[object Map]",Ug="[object Number]",Jg="[object RegExp]",jg="[object Set]",Qg="[object String]",$g="[object Symbol]",qg="[object ArrayBuffer]",eb="[object DataView]",Vr=wt?wt.prototype:void 0,Xo=Vr?Vr.valueOf:void 0;function tb(e,t,n,i,s,l,a){switch(n){case eb:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case qg:return!(e.byteLength!=t.byteLength||!l(new ls(e),new ls(t)));case Hg:case Ag:case Ug:return In(+e,+t);case _g:return e.name==t.name&&e.message==t.message;case Jg:case Qg:return e==t+"";case Kg:var r=Yg;case jg:var c=i&Fg;if(r||(r=Zo),e.size!=t.size&&!c)return!1;var d=a.get(e);if(d)return d==t;i|=zg,a.set(e,t);var h=Rr(r(e),r(t),i,s,l,a);return a.delete(e),h;case $g:if(Xo)return Xo.call(e)==Xo.call(t)}return!1}var nb=1,ib=Object.prototype,sb=ib.hasOwnProperty;function ob(e,t,n,i,s,l){var a=n&nb,r=Vo(e),c=r.length,d=Vo(t),h=d.length;if(c!=h&&!a)return!1;for(var u=c;u--;){var f=r[u];if(!(a?f in t:sb.call(t,f)))return!1}var m=l.get(e),g=l.get(t);if(m&&g)return m==t&&g==e;var p=!0;l.set(e,t),l.set(t,e);for(var y=a;++u<c;){f=r[u];var C=e[f],b=t[f];if(i)var k=a?i(b,C,f,t,e,l):i(C,b,f,e,t,l);if(!(k===void 0?C===b||s(C,b,n,i,l):k)){p=!1;break}y||(y=f=="constructor")}if(p&&!y){var L=e.constructor,w=t.constructor;L!=w&&"constructor"in e&&"constructor"in t&&!(typeof L=="function"&&L instanceof L&&typeof w=="function"&&w instanceof w)&&(p=!1)}return l.delete(e),l.delete(t),p}var lb=1,Er="[object Arguments]",Wr="[object Array]",as="[object Object]",ab=Object.prototype,Gr=ab.hasOwnProperty;function rb(e,t,n,i,s,l){var a=it(e),r=it(t),c=a?Wr:pt(e),d=r?Wr:pt(t);c=c==Er?as:c,d=d==Er?as:d;var h=c==as,u=d==as,f=c==d;if(f&&$n(e)){if(!$n(t))return!1;a=!0,h=!1}if(f&&!h)return l||(l=new mt),a||Lo(e)?Rr(e,t,n,i,s,l):tb(e,t,c,n,i,s,l);if(!(n&lb)){var m=h&&Gr.call(e,"__wrapped__"),g=u&&Gr.call(t,"__wrapped__");if(m||g){var p=m?e.value():e,y=g?t.value():t;return l||(l=new mt),s(p,y,n,i,l)}}return f?(l||(l=new mt),ob(e,t,n,i,s,l)):!1}function rs(e,t,n,i,s){return e===t?!0:e==null||t==null||!ft(e)&&!ft(t)?e!==e&&t!==t:rb(e,t,n,i,rs,s)}var cb=1,db=2;function hb(e,t,n,i){var s=n.length,l=s;if(e==null)return!l;for(e=Object(e);s--;){var a=n[s];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++s<l;){a=n[s];var r=a[0],c=e[r],d=a[1];if(a[2]){if(c===void 0&&!(r in e))return!1}else{var h=new mt,u;if(!(u===void 0?rs(d,c,cb|db,i,h):u))return!1}}return!0}function Zr(e){return e===e&&!ze(e)}function ub(e){for(var t=nr(e),n=t.length;n--;){var i=t[n],s=e[i];t[n]=[i,s,Zr(s)]}return t}function Xr(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function fb(e){var t=ub(e);return t.length==1&&t[0][2]?Xr(t[0][0],t[0][1]):function(n){return n===e||hb(n,e,t)}}function mb(e,t){return e!=null&&t in Object(e)}function pb(e,t,n){t=ir(t,e);for(var i=-1,s=t.length,l=!1;++i<s;){var a=os(t[i]);if(!(l=e!=null&&n(e,a)))break;e=e[a]}return l||++i!=s?l:(s=e==null?0:e.length,!!s&&ko(s)&&xo(a,s)&&(it(e)||ns(e)))}function gb(e,t){return e!=null&&pb(e,t,mb)}var bb=1,yb=2;function xb(e,t){return vo(e)&&Zr(t)?Xr(os(e),t):function(n){var i=tp(n,e);return i===void 0&&i===t?gb(n,e):rs(t,i,bb|yb)}}function Sb(e){return function(t){return t==null?void 0:t[e]}}function Cb(e){return function(t){return sr(t,e)}}function kb(e){return vo(e)?Sb(os(e)):Cb(e)}function wb(e){return typeof e=="function"?e:e==null?go:typeof e=="object"?it(e)?xb(e[0],e[1]):fb(e):kb(e)}function Ib(e){return function(t,n,i){for(var s=-1,l=Object(t),a=i(t),r=a.length;r--;){var c=a[++s];if(n(l[c],c,l)===!1)break}return t}}var Tb=Ib(),No=function(){return ut.Date.now()},Lb="Expected a function",Mb=Math.max,vb=Math.min;function cs(e,t,n){var i,s,l,a,r,c,d=0,h=!1,u=!1,f=!0;if(typeof e!="function")throw new TypeError(Lb);t=qi(t)||0,ze(n)&&(h=!!n.leading,u="maxWait"in n,l=u?Mb(qi(n.maxWait)||0,t):l,f="trailing"in n?!!n.trailing:f);function m(M){var V=i,S=s;return i=s=void 0,d=M,a=e.apply(S,V),a}function g(M){return d=M,r=setTimeout(C,t),h?m(M):a}function p(M){var V=M-c,S=M-d,x=t-V;return u?vb(x,l-S):x}function y(M){var V=M-c,S=M-d;return c===void 0||V>=t||V<0||u&&S>=l}function C(){var M=No();if(y(M))return b(M);r=setTimeout(C,p(M))}function b(M){return r=void 0,f&&i?m(M):(i=s=void 0,a)}function k(){r!==void 0&&clearTimeout(r),d=0,i=c=s=r=void 0}function L(){return r===void 0?a:b(No())}function w(){var M=No(),V=y(M);if(i=arguments,s=this,c=M,V){if(r===void 0)return g(c);if(u)return clearTimeout(r),r=setTimeout(C,t),m(c)}return r===void 0&&(r=setTimeout(C,t)),a}return w.cancel=k,w.flush=L,w}var Nr=Object.prototype,Rb=Nr.hasOwnProperty,Vb=Co(function(e,t){e=Object(e);var n=-1,i=t.length,s=i>2?t[2]:void 0;for(s&&Aa(t[0],t[1],s)&&(i=1);++n<i;)for(var l=t[n],a=Mo(l),r=-1,c=a.length;++r<c;){var d=a[r],h=e[d];(h===void 0||In(h,Nr[d])&&!Rb.call(e,d))&&(e[d]=l[d])}return e});function Po(e,t,n){(n!==void 0&&!In(e[t],n)||n===void 0&&!(t in e))&&So(e,t,n)}function Eb(e){return ft(e)&&ts(e)}function Do(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Wb(e){return Rf(e,Mo(e))}function Gb(e,t,n,i,s,l,a){var r=Do(e,n),c=Do(t,n),d=a.get(c);if(d){Po(e,n,d);return}var h=l?l(r,c,n+"",e,t,a):void 0,u=h===void 0;if(u){var f=it(c),m=!f&&$n(c),g=!f&&!m&&Lo(c);h=c,f||m||g?it(r)?h=r:Eb(r)?h=hf(r):m?(u=!1,h=hr(c,!0)):g?(u=!1,h=Sr(c,!0)):h=[]:rp(c)||ns(c)?(h=r,ns(r)?h=Wb(r):(!ze(r)||Qn(r))&&(h=Cr(c))):u=!1}u&&(a.set(c,h),s(h,c,i,l,a),a.delete(c)),Po(e,n,h)}function ds(e,t,n,i,s){e!==t&&Tb(t,function(l,a){if(s||(s=new mt),ze(l))Gb(e,t,a,n,ds,i,s);else{var r=i?i(Do(e,a),l,a+"",e,t,s):void 0;r===void 0&&(r=l),Po(e,a,r)}},Mo)}function Pr(e,t,n,i,s,l){return ze(e)&&ze(t)&&(l.set(t,e),ds(e,t,void 0,Pr,l),l.delete(t)),e}var Zb=_a(function(e,t,n,i){ds(e,t,n,i)}),Pe=Co(function(e){return e.push(void 0,Pr),Fa(Zb,void 0,e)}),Xb=Math.max,Nb=Math.min;function Pb(e,t,n){return e>=Nb(t,n)&&e<Xb(t,n)}function It(e,t,n){return t=Ba(t),n===void 0?(n=t,t=0):n=Ba(n),e=qi(e),Pb(e,t,n)}function He(e,t){return rs(e,t)}var Db="[object Number]";function Bb(e){return typeof e=="number"||ft(e)&&zt(e)==Db}function Ht(e){return e==null}function Ob(e){return e===void 0}var Bo=_a(function(e,t,n){ds(e,t,n)}),Yb=Array.prototype,Fb=Yb.reverse;function zb(e){return e==null?e:Fb.call(e)}var Hb="Expected a function";function hs(e,t,n){var i=!0,s=!0;if(typeof e!="function")throw new TypeError(Hb);return ze(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),cs(e,t,{leading:i,maxWait:t,trailing:s})}var Ab=1/0,_b=Ln&&1/Zo(new Ln([,-0]))[1]==Ab?function(e){return new Ln(e)}:df,Kb=200;function Ub(e,t,n){var i=-1,s=If,l=e.length,a=!0,r=[],c=r;if(l>=Kb){var d=t?null:_b(e);if(d)return Zo(d);a=!1,s=vr,c=new ii}else c=t?[]:r;e:for(;++i<l;){var h=e[i],u=t?t(h):h;if(h=h!==0?h:0,a&&u===u){for(var f=c.length;f--;)if(c[f]===u)continue e;t&&c.push(u),r.push(h)}else s(c,u,n)||(c!==r&&c.push(u),r.push(h))}return r}function Jb(e,t){return e&&e.length?Ub(e,wb(t)):[]}const jb=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.ref(e.modelValue),i=()=>{if(!e.showStep)return[];const f=e.max-e.min,m=f/e.step,g=$e(e.step,f),p=[];for(let y=1;y<m;y++)p.push(y*g);return p},s=()=>{if(!e.mark||!Object.keys(e.mark).length)return[];const f=(g,p="value")=>{if(!g)return[];const y=e.mark.style&&typeof e.mark.style=="object"?e.mark.style:{},C=Object.keys(g),b=[];let k;for(let L=0;L<C.length;L++)k=+C[L],isNaN(k)||b.push({posX:p==="value"?$e(k,e.max-e.min):k,label:g[k],style:y});return b};return e.mark.value||e.mark.percent?[...f(e.mark.value),...f(e.mark.percent,"percent")]:[...f(e.mark)]},l=o.reactive({isInit:!1,dragging:!1,handleType:null,leftValue:null,rightValue:null}),a=o.reactive({valueRange:0,stepList:o.computed(i),markList:o.computed(s),offset:{left:0,width:0}}),r=o.ref(),c=o.computed(()=>{const f=e.tooltipFormat,m=f instanceof Function;return{left:m?f(l.leftValue):l.leftValue,right:m?f(l.rightValue):l.rightValue}}),d=f=>{const m={min:e.min,max:e.max,step:e.step};let g,p;e.range&&Array.isArray(f)?(g=typeof f[0]=="number"&&!isNaN(f[0])?f[0]:e.min,p=typeof f[1]=="number"&&!isNaN(f[1])?f[1]:e.min,l.leftValue=sn(g,m),l.rightValue=sn(p,m)):(g=e.min,p=typeof f=="number"&&!isNaN(f)?f:e.min,l.leftValue=sn(g,m),l.rightValue=sn(p,m))},h=f=>{if(a.valueRange<=0)return;d(f);let m;if(e.range&&Array.isArray(f)){const g=Math.min(l.leftValue,l.rightValue),p=Math.max(l.leftValue,l.rightValue);m=[g,p]}else m=l.rightValue;n.value=m,t("update:modelValue",m),t("change",m)},u=()=>{const f=r.value.getBoundingClientRect();a.offset.left=f.left,a.offset.width=f.width,a.valueRange=e.max-e.min};return o.watch(()=>e.modelValue,(f,m)=>{Bb(f)&&f>=0&&!He(f,m)&&!l.dragging&&(d(f),n.value=f)}),o.watch(()=>e.step,()=>{h(n.value)}),{currentValue:n,state:l,slider:a,formatValue:c,sliderLine:r,updateSliderInfo:u,setSliderValue:h}},Qb=e=>{const{props:t}=o.getCurrentInstance(),{state:n,slider:i}=e,s="transparent",l=o.computed(()=>({left:i.valueRange>0?`${$e(n.leftValue-t.min,i.valueRange)}%`:0})),a=o.computed(()=>({left:i.valueRange>0?`${$e(n.rightValue-t.min,i.valueRange)}%`:0})),r=o.computed(()=>!t.color||Array.isArray(t.color)&&t.color.length!==1?{}:{borderColor:(typeof t.color=="string"?t.color:t.color[0])||s}),c=o.computed(()=>t.color&&Array.isArray(t.color)),d=o.computed(()=>{const f=Math.min(n.leftValue,n.rightValue),g=+(Math.max(n.leftValue,n.rightValue)-f).toFixed(2),p=i.valueRange>0&&t.range?$e(+(f-t.min).toFixed(2),i.valueRange):0,y=g>0?$e(g,i.valueRange):0,C={};return t.color&&(typeof t.color=="string"||Array.isArray(t.color)&&t.color.length===1?C.backgroundColor=(typeof t.color=="string"?t.color:t.color[0])||s:Array.isArray(t.color)&&t.color.length>1&&(C.backgroundColor=(t.range?t.color[1]:t.color[0])||s)),{left:`${p}%`,width:`${y}%`,...C}}),h=o.computed(()=>{if(!c.value||t.color.length<2||!t.range)return{};const f=Math.min(n.leftValue,n.rightValue);return{width:`${$e(Math.abs(f-t.min),i.valueRange)}%`,backgroundColor:t.color[0]||s}}),u=o.computed(()=>{if(!c.value||t.color.length<2)return{};const f=Math.max(n.leftValue,n.rightValue),m=$e(+(f-t.min).toFixed(2),i.valueRange),g=$e(+(t.max-f).toFixed(2),i.valueRange),p=t.range?2:t.color.length-1;return{left:`${m}%`,width:`${g}%`,backgroundColor:t.color[p]||s}});return{isColorArray:c,leftHandleStyle:l,rightHandleStyle:a,handleBtnStyle:r,rangeThumbStyle:d,leftThumbStyle:h,rightThumbStyle:u}},$b=e=>{const{props:t}=o.getCurrentInstance(),{currentValue:n,state:i,slider:s,updateSliderInfo:l,setSliderValue:a}=e,r=m=>{i.dragging||l();const g=m.type.indexOf("touch")!==-1?m.touches[0].clientX:m.clientX,{valueRange:p,offset:y}=s;let C=t.min+(g-y.left)*p/y.width;return C<t.min?C=t.min:C>t.max&&(C=t.max),C},c=m=>{if(t.readonly||t.disabled||i.dragging)return;const g=r(m);let p;if(t.range){const C=Math.min(i.leftValue,i.rightValue)+Math.abs((i.rightValue-i.leftValue)/2),b=i.leftValue>i.rightValue;g<C?i.handleType=b?"right":"left":i.handleType=b?"left":"right",p=i.handleType==="left"?[g,i.rightValue]:[i.leftValue,g]}else i.handleType="right",p=g;a(p)},d=m=>{const g=r(m);i.dragging=!0;let p;t.range?p=i.handleType==="left"?[g,i.rightValue]:[i.leftValue,g]:p=g,a(p)},h=()=>{i.handleType=null,i.dragging=!1,document.body.style.cursor="",window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)};return{startDrag:m=>{t.readonly||t.disabled||(i.handleType=m,document.body.style.cursor="grabbing",window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),window.addEventListener("mouseup",h),window.addEventListener("touchend",h))},clickSlider:c,changeInput:(m,g)=>{if(t.showInput&&!i.dragging&&i.isInit)if(t.range&&Array.isArray(n.value)){const p=g==="left"?[m,n.value[1]]:[n.value[0],m];a(p)}else t.range||a(m)}}},qb=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{currentValue:i,state:s,slider:l,updateSliderInfo:a,setSliderValue:r}=e,c=()=>{const h=t.max||t.max===0,u=t.min||t.min===0;h&&u&&t.max<=t.min&&console.warn("[EVUI][Slider] Max value must be greater than min value.")},d=()=>{a(),l.valueRange<=0&&(i.value=t.range?[t.min,t.min]:t.min,n("update:modelValue",i.value)),r(i.value),s.isInit=!0};o.onMounted(()=>{c(),d()})},ey={name:"EvSlider",components:{},props:{modelValue:{type:[Number,Array],default:null},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1,validator:e=>e>0},mark:{type:Object,default:()=>{}},showStep:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},showInput:{type:Boolean,default:!1},color:{type:[String,Array],default:null},tooltipFormat:{type:Function,default:null}},emits:["update:modelValue","change"],setup(){const{currentValue:e,state:t,slider:n,formatValue:i,sliderLine:s,updateSliderInfo:l,setSliderValue:a}=jb(),{isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:f,rightThumbStyle:m}=Qb({state:t,slider:n}),{startDrag:g,clickSlider:p,changeInput:y}=$b({currentValue:e,state:t,slider:n,updateSliderInfo:l,setSliderValue:a});return qb({currentValue:e,state:t,slider:n,updateSliderInfo:l,setSliderValue:a}),{currentValue:e,isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:f,rightThumbStyle:m,sliderLine:s,...o.toRefs(t),...o.toRefs(n),formatValue:i,startDrag:g,clickSlider:p,changeInput:y}}},ty={class:"ev-slider-wrapper"},ny={ref:"sliderLine",class:"ev-slider-line"},iy={key:0,class:"ev-slider-step-wrapper"},sy={key:2,class:"ev-slider-mark-wrapper"},oy={class:"ev-slider-mark-label"},ly=["innerHTML"],ay=["innerHTML"];function ry(e,t,n,i,s,l){const a=o.resolveComponent("ev-input-number");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-slider",{readonly:n.readonly,disabled:n.disabled,"hide-tooltip":!n.showTooltip,"show-input":n.showInput,"color-range":i.isColorArray,"show-mark":e.markList.length}])},[o.createElementVNode("div",ty,[o.createElementVNode("div",ny,[n.showStep&&n.step?(o.openBlock(),o.createElementBlock("div",iy,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.stepList,(r,c)=>(o.openBlock(),o.createElementBlock("span",{key:`slider-step-${c}`,style:o.normalizeStyle({left:`${r}%`}),class:"ev-slider-step"},null,4))),128))])):o.createCommentVNode("",!0),i.isColorArray&&n.color.length>1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.range?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle(i.leftThumbStyle),class:"ev-slider-thumb left"},null,4)):o.createCommentVNode("",!0),o.createElementVNode("div",{style:o.normalizeStyle(i.rightThumbStyle),class:"ev-slider-thumb right"},null,4)],64)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"ev-slider-thumb",style:o.normalizeStyle(i.rangeThumbStyle)},null,4),e.markList.length>0?(o.openBlock(),o.createElementBlock("div",sy,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.markList,(r,c)=>(o.openBlock(),o.createElementBlock("div",{key:`slider-step-${c}`,style:o.normalizeStyle({...r.style,left:`${r.posX}%`}),class:"ev-slider-mark"},[o.createElementVNode("span",oy,o.toDisplayString(r.label),1)],4))),128))])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"ev-slider-line-layer",onClick:t[0]||(t[0]=(...r)=>i.clickSlider&&i.clickSlider(...r))})],512),n.range?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-slider-handle",{dragging:e.dragging&&e.handleType==="left"}]),style:o.normalizeStyle(i.leftHandleStyle),onMousedown:t[1]||(t[1]=o.withModifiers(r=>i.startDrag("left"),["stop","prevent"]))},[o.createElementVNode("span",{style:o.normalizeStyle(i.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),o.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:i.formatValue.left},null,8,ly)],38)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["ev-slider-handle",{dragging:e.dragging&&e.handleType==="right"}]),style:o.normalizeStyle(i.rightHandleStyle),onMousedown:t[2]||(t[2]=o.withModifiers(r=>i.startDrag("right"),["stop","prevent"]))},[o.createElementVNode("span",{style:o.normalizeStyle(i.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),o.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:i.formatValue.right},null,8,ay)],38)]),n.showInput&&!n.range?(o.openBlock(),o.createBlock(a,{key:0,modelValue:i.currentValue,"onUpdate:modelValue":t[3]||(t[3]=r=>i.currentValue=r),step:n.step,min:n.min,max:n.max,"step-strictly":"",onChange:i.changeInput},null,8,["modelValue","step","min","max","onChange"])):n.showInput&&n.range&&Array.isArray(n.modelValue)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(a,{modelValue:i.currentValue[0],"onUpdate:modelValue":t[4]||(t[4]=r=>i.currentValue[0]=r),step:n.step,min:n.min,max:i.currentValue[1],"step-strictly":"",onChange:t[5]||(t[5]=r=>i.changeInput(r,"left"))},null,8,["modelValue","step","min","max"]),o.createVNode(a,{modelValue:i.currentValue[1],"onUpdate:modelValue":t[6]||(t[6]=r=>i.currentValue[1]=r),step:n.step,min:i.currentValue[0],max:n.max,"step-strictly":"",onChange:t[7]||(t[7]=r=>i.changeInput(r,"right"))},null,8,["modelValue","step","min","max"])],64)):o.createCommentVNode("",!0)],2)}const si=ce(ey,[["render",ry]]);si.install=e=>{e.component(si.name,si)};const cy={name:"EvIcon",props:{icon:{type:String,default:""},size:{type:String,default:""},color:{type:String,default:""}},emits:{click:null,"dbl-click":null,"context-menu":null},setup(e,{emit:t}){return{onClick:l=>{t("click",l)},onDblClick:l=>{t("dbl-click",l)},onContextMenu:l=>{t("context-menu",l)}}}};function dy(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("i",{class:o.normalizeClass([n.icon,{[`ev-icon-${n.size}`]:!!n.size}]),style:o.normalizeStyle({color:n.color}),onClick:t[0]||(t[0]=(...a)=>i.onClick&&i.onClick(...a)),"on:dblClick":t[1]||(t[1]=(...a)=>i.onDblClick&&i.onDblClick(...a)),onContextmenu:t[2]||(t[2]=(...a)=>i.onContextMenu&&i.onContextMenu(...a))},null,38)}const Mn=ce(cy,[["render",dy]]);Mn.install=e=>{e.component(Mn.name,Mn)};const Oo=6,Yo=7,Fo=4,zo=3,Ho=5,Ao=4,qe=12,hy=24,uy=60,fy=60,gt=12,Dr=4,_o=20,Ko={fullName:["January","February","March","April","May","June","July","August","September","October","November","December"],numberName:["1","2","3","4","5","6","7","8","9","10","11","12"],abbrName:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],korName:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},my={abbrUpperName:["SUN","MON","TUE","WED","THU","FRI","SAT"],abbrLowerName:["sun","mon","tue","wed","thu","fri","sat"],abbrPascalName:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],abbrKorName:["일","월","화","수","목","금","토"]},st={DATE:"date",MONTH:"month",YEAR:"year"},us=864e5,fs=+new Date("1970-01-01 00:00:00"),Br=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),Or=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),py=(e,t)=>e.length?e.reduce((n,i)=>new Date(n).getTime()>new Date(i).getTime()?n:i):"",Xe=e=>e===null?"00":+e<10?`0${e}`:e,vn=(e,t)=>Array.from(Array(e),()=>Array(t).fill(!1)),gy=(e,t)=>new Date(`${e}-${t}-1`).getDay(),Uo=(e,t)=>{let n;switch(t){case 4:case 6:case 9:case 11:n=30;break;case 2:e%4===0&&e%100!==0||e%400===0?n=29:n=28;break;default:n=31;break}return n},oi=({year:e,month:t,date:n,hour:i,min:s,sec:l})=>i!==void 0&&s!==void 0&&l!==void 0?`${e}-${Xe(t)}-${Xe(n)} ${Xe(i)}:${Xe(s)}:${Xe(l)}`:`${e}-${Xe(t)}-${Xe(n)}`,Ne=(e,t)=>{var s,l,a,r,c,d;let n=o.unref(e);Array.isArray(n)&&(n=py(e));const i={year:+((s=n==null?void 0:n.split(" ")[0])==null?void 0:s.split("-")[0])||null,month:+((l=n==null?void 0:n.split(" ")[0])==null?void 0:l.split("-")[1])||null,date:+((a=n==null?void 0:n.split(" ")[0])==null?void 0:a.split("-")[2])||null,hour:+((r=n==null?void 0:n.split(" ")[1])==null?void 0:r.split(":")[0])||0,min:+((c=n==null?void 0:n.split(" ")[1])==null?void 0:c.split(":")[1])||0,sec:+((d=n==null?void 0:n.split(" ")[1])==null?void 0:d.split(":")[2])||0};return t==="year"?i.year:t==="month"?i.month:t==="date"?i.date:t==="hour"?i.hour:t==="min"?i.min:t==="sec"?i.sec:i},Yr=(e,t,n)=>e==="next"?{year:n===12?t+1:t,month:(n+1)%12||12}:{year:n===1?t-1:t,month:(n-1)%12||12},li=(e,t,n)=>{const i=Ne(t,n);if(e){const s=e==null?void 0:e.split(":")[0],l=e==null?void 0:e.split(":")[1],a=e==null?void 0:e.split(":")[2];if(n==="hour")return s==="HH"?i:+s;if(n==="min")return l==="mm"?i:+l;if(n==="sec")return a==="ss"?i:+a}return i},Me=(e,t)=>{if(!t)return"";const n=Xe(li(e,t,"hour")),i=Xe(li(e,t,"min")),s=Xe(li(e,t,"sec"));return`${t.split(" ")[0]} ${n}:${i}:${s}`},ms=(e,t,n,i)=>{if(!i.length)return!1;let s=t==="main"?n:i[0],l=t==="expanded"?n:i[1],a=s,r=l;if(!n.split(" ")[1])if(e==="dateTimeRange"){s=s.split(" ")[0],l=l.split(" ")[0];const c=i[0].split(" ")[1],d=i[1].split(" ")[1];a=`${s} ${c}`,r=`${l} ${d}`}else a=`${s} 00:00:00`,r=`${l} 23:59:59`;return a&&r&&new Date(a).getTime()>+new Date(r).getTime()},Rn=e=>new Date(`${e}`).getTime(),Fr=e=>{const t=10**(e.toString().length-1),n=Math.floor(e/t),i=Math.floor(e%(t*n)),s=n*t+Math.floor(i/_o)*_o,l=s+_o-1;return{start:s,end:l}},by=()=>{var p,y,C;const{props:e}=o.getCurrentInstance(),t=(p=e.options)==null?void 0:p.timeFormat,n=o.computed(()=>["dateRange","dateTimeRange"].includes(e.mode)?["main","expanded"]:["main"]);let i;if(e.mode!=="dateMulti"&&e.mode!=="dateRange"&&e.mode!=="dateTimeRange")if(e.modelValue&&(e.modelValue.length===10&&Br.exec((y=e.modelValue)==null?void 0:y.toString())||e.modelValue.length===19&&Or.exec((C=e.modelValue)==null?void 0:C.toString())))if(e.mode==="dateTime"&&t){const b=Me(t,e.modelValue);i=o.ref(b)}else i=o.ref(e.modelValue);else i=o.ref("");else if(Array.isArray(e.modelValue)&&e.modelValue.every(b=>!b||b.length===10&&Br.exec(b)||b.length===19&&Or.exec(b)))if(e.mode==="dateTimeRange"&&e.modelValue.length===2&&t){const b=[];b.push(Me(t[0],e.modelValue[0])),b.push(Me(t[1],e.modelValue[1])),i=o.ref([...b])}else i=o.ref([...e.modelValue]);else i=o.ref([]);const s=()=>{e.mode==="date"&&e.modelValue&&typeof e.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'date', v-model must be 'String' type."):e.mode==="dateTime"&&e.modelValue&&typeof e.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'dateTime', v-model must be 'String' type."):e.mode==="dateMulti"&&e.modelValue&&!Array.isArray(e.modelValue)?console.warn("[EVUI][Calendar] When mode is 'dateMulti', v-model must be 'Array' type."):e.mode==="dateRange"&&e.modelValue?Array.isArray(e.modelValue)?Rn(`${e.modelValue[0]} 00:00:00`)>Rn(`${e.modelValue[1]} 00:00:00`)&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateRange', v-model must be 'Array' type."):e.mode==="dateTimeRange"&&e.modelValue&&(Array.isArray(e.modelValue)?Rn(e.modelValue[0])>Rn(e.modelValue[1])&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateTimeRange', v-model must be 'Array' type."))};let l;const a=["dateRange","dateTimeRange"].includes(e.mode)?i.value[0]:i.value;a!=null&&a.length?l={year:Ne(a,"year"),month:Ne(a,"month"),hour:Math.floor(Ne(a,"hour")/gt)+1||1,min:Math.floor(Ne(a,"min")/gt)+1||1,sec:Math.floor(Ne(a,"sec")/gt)+1||1}:l={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};let r;if(["dateRange","dateTimeRange"].includes(e.mode)&&Array.isArray(i.value)&&i.value[1]){const b=i.value[1];r={year:Ne(b,"year"),month:Ne(b,"month")},e.mode==="dateTimeRange"&&(r.hour=Math.floor(Ne(b,"hour")/gt)+1||1,r.min=Math.floor(Ne(b,"min")/gt)+1||1,r.sec=Math.floor(Ne(b,"sec")/gt)+1||1)}else r={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};const c=o.reactive({main:l,expanded:r}),d=o.reactive({main:o.computed(()=>Fr(c.main.year)),expanded:o.computed(()=>Fr(c.expanded.year))}),h=o.computed(()=>Ko[e.monthNotation][c.main.month-1]),u=o.computed(()=>Ko[e.monthNotation][c.expanded.month-1]),f=o.reactive({main:h,expanded:u}),m=o.computed(()=>my[e.dayOfTheWeekNotation]),g=o.reactive({main:st.DATE,expanded:st.DATE});return o.onBeforeMount(()=>{s()}),{calendarList:n,selectedValue:i,calendarPageInfo:c,calendarYearRangeInfo:d,calendarMonth:f,dayOfTheWeekList:m,selectedListType:g}},yy=e=>{const{props:t}=o.getCurrentInstance(),{selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:s}=e,l=o.reactive({main:vn(Ho,Ao),expanded:vn(Ho,Ao)}),a=o.reactive({main:vn(Fo,zo),expanded:vn(Fo,zo)}),r=o.reactive({main:vn(Oo,Yo),expanded:vn(Oo,Yo)}),c=o.reactive({main:{hour:[],min:[],sec:[]},expanded:{hour:[],min:[],sec:[]}});return{calendarTableInfo:r,calendarMonthTableInfo:a,calendarYearTableInfo:l,calendarTimeTableInfo:c,setCalendarDate:g=>{const p=i[g];let y=t.options.disabledDate;y&&Array.isArray(y)&&(y=g==="main"?y[0]:y[1]);const C=["dateRange","dateTimeRange"].includes(t.mode),b=oi({year:new Date().getFullYear(),month:new Date().getMonth()+1,date:new Date().getDate()}),k=(qe+p.month-1)%qe||qe,L=(p.month+1)%qe||qe,w=p.month===1?p.year-1:p.year,M=p.month===12?p.year+1:p.year,V=gy(p.year,p.month),S=Uo(p.month===1?p.year-1:p.year,(qe+p.month-1)%qe||qe),x=Uo(p.year,p.month);let I="";t.mode.includes("Time")&&(t.mode==="dateTime"?I=n.value:I=g==="main"?n.value[0]:n.value[1]);let T=0,v=0,E=0,Z=0,W="";const R=(X,G,N)=>{var O,H,j;W=oi({year:v,month:E,date:Z});const P=(I==null?void 0:I.split(" ")[1])??"",B=C&&!y&&ms(t.mode,g,W,n.value)||+new Date(`${W} ${P}`)<fs,z=y&&y(new Date(`${W} ${P}`))||B,D=+(g!=="main"),Y=C&&n.value.length>D&&((H=(O=n.value)==null?void 0:O[D])==null?void 0:H.includes(W)),F=!z&&(C?Y:(j=n.value)==null?void 0:j.includes(W));r[g][G][N]={monthType:`${X}${z?" disabled":""}`,isToday:b===W,isSelected:F,year:v,month:E,date:Z}};for(let X=0;X<Oo;X++)for(let G=0;G<Yo;G++)X===0?V!==0?G<V?(v=w,E=k,Z=S-V+1+G,R("prev",X,G)):(T++,v=p.year,E=p.month,Z=T,R("",X,G)):(v=w,E=k,Z=S-6+G,R("prev",X,G)):x<=T?(T++,v=M,E=L,Z=T-x,R("next",X,G)):(T++,v=p.year,E=p.month,Z=T,R("",X,G))},setCalendarMonth:g=>{let p=0;const y=new Date().getFullYear(),C=new Date().getMonth()+1,{year:b,month:k}=i[g];for(let L=0;L<Fo;L++)for(let w=0;w<zo;w++)a[g][L][w]={label:Ko.abbrName[p++],value:p,today:b===y&&p===C,isSelected:p===k}},setCalendarYear:g=>{let p=s[g].start;const y=new Date().getFullYear(),C=new Date(fs).getFullYear();for(let b=0;b<Ho;b++)for(let k=0;k<Ao;k++)l[g][b][k]={label:p,value:p,today:p===y,isSelected:p===i[g].year,disabled:p<C},p++},setHmsTime:()=>{var V,S;const g=(V=t.options)==null?void 0:V.timeFormat,p=(S=t.options)==null?void 0:S.disabledDate,y=Array.isArray(g)?g[0]:g,C=Array.isArray(g)?g[1]:"",b=t.mode==="dateTimeRange"?n.value[0]:n.value,k=t.mode==="dateTimeRange"?n.value[1]:"",L=Array.isArray(p)?p[0]:p,w=Array.isArray(p)?p[1]:p,M=(x,I,T)=>{const v=x==="main"?b:k,E=x==="main"?L:w;if(!v)return!1;const Z=v.split(" ")[0];let W=Ne(v,"hour"),R=Ne(v,"min"),X=Ne(v,"sec");I==="hour"?W=T:I==="min"?R=T:I==="sec"&&(X=T);const G=`${Z} ${Xe(W)}:${Xe(R)}:${Xe(X)}`;return E&&E(new Date(G))?!0:!E&&ms(t.mode,x,G,n.value)};["hour","min","sec"].forEach(x=>{let I=fy;x==="hour"?I=hy:x==="min"&&(I=uy);const T=b&&b.length>0?li(y,b,x):-1,v=k&&k.length>0?li(C,k,x):-1;for(let E=0;E<I;E++){let Z=t.mode==="dateTimeRange"&&M("main",x,E);c.main[x][E]={timeType:x,num:E,isSelected:!Z&&T===E,isDisabled:Z},t.mode==="dateTimeRange"&&(Z=M("expanded",x,E),c.expanded[x][E]={timeType:x,num:E,isSelected:!Z&&v===E,isDisabled:Z})}})},getTimeInfo:(g,p,y,C)=>{const b=i[C],k=c[C],L=b[g]-1,w=p-1,M=y-1,V=L*gt+w*Dr+M;return k[g][V]}}},xy=e=>{var W;const{props:t,emit:n}=o.getCurrentInstance(),i=(W=t.options)==null?void 0:W.timeFormat,{selectedValue:s,calendarPageInfo:l,calendarTimeTableInfo:a,setCalendarDate:r,setCalendarMonth:c,setCalendarYear:d,setHmsTime:h,selectedListType:u}=e,f=o.ref(""),m=o.ref(null),g=Array.isArray(i)?i[0]:i,p=Array.isArray(i)?i[1]:"",y={main:{hour:g&&g.split(":")[0]!=="HH",min:g&&g.split(":")[1]!=="mm",sec:g&&g.split(":")[2]!=="ss"},expanded:{hour:p&&p.split(":")[0]!=="HH",min:p&&p.split(":")[1]!=="mm",sec:p&&p.split(":")[2]!=="ss"}},C=(R,X)=>{const G=l[R],{year:N,month:P,hour:B,min:z,sec:D}=X;N&&(G.year=N),P&&(G.month=P),B&&(G.hour=B),z&&(G.min=z),D&&(G.sec=D)},b=R=>{R==null||R.forEach((X,G)=>{const N=G===0?"main":"expanded";C(N,{year:Ne(X,"year"),month:Ne(X,"month"),hour:Math.floor(Ne(X,"hour")/gt)+1,min:Math.floor(Ne(X,"min")/gt)+1,sec:Math.floor(Ne(X,"sec")/gt)+1}),r(N)})},k=(R,X)=>{const G=u[R]===st.MONTH?1:20,N=X==="prev"?-G:G,P=new Date(fs).getFullYear(),B=l[R].year+N;l[R].year=B<P?P:B},L=(R,X)=>{const G=l[R];if(X==="prev"){const N=new Date(fs).getFullYear();if(G.year===N&&G.month===1)return;G.month===1?(G.year-=1,G.month=12):G.month-=1}else G.month===12?(G.year+=1,G.month=1):G.month+=1},w=(R,X)=>{switch(u[R]){case st.DATE:{L(R,X),r(R);break}case st.MONTH:k(R,X),c(R);break;case st.YEAR:k(R,X),d(R);break}},M=(R,X)=>{X===st.DATE?r(R):X===st.MONTH?c(R):X===st.YEAR&&d(R),u[R]=X},V=(R,X)=>{const{value:G}=X;X.disabled||(u[R]===st.YEAR?(l[R].year=G,u[R]=st.MONTH,c(R)):(l[R].month=G,u[R]=st.DATE,r(R)))},S=(R,X)=>{var J,ne,q,ee;const{year:G,month:N,date:P,monthType:B}=X,z=oi({year:G,month:N,date:P}),D=t.modelValue?(Array.isArray(t.modelValue)?((J=t.modelValue)==null?void 0:J.map($=>$==null?void 0:$.split(" ")[0]))??[]:t.modelValue.split(" ")[0]).includes(z):!1;let Y=t.options.disabledDate;if(Y&&Array.isArray(Y)&&(Y=R==="main"?Y[0]:Y[1]),Y&&Y(new Date(z))&&!D)return;if(!Y&&["dateRange","dateTimeRange"].includes(t.mode)&&ms(t.mode,R,z,s.value))return;const F=l[R],O=(qe+F.month-1)%qe||qe,H=F.month===1?F.year-1:F.year,j=(F.month+1)%qe||qe,U=F.month===12?F.year+1:F.year,Q=()=>{B.includes("prev")?(F.year=H,F.month=O):B.includes("next")&&(F.year=U,F.month=j)};switch(t.mode){case"date":n("update:modelValue",z);break;case"dateTime":{const he=!!((ne=s.value)!=null&&ne.split(" ")[1])?(q=s.value)==null?void 0:q.split(" ")[1]:"00:00:00",fe=Me(i,`${z} ${he}`);n("update:modelValue",fe);break}case"dateMulti":{const $=t.options.multiType,he=t.options.multiDayLimit;if($==="date"){const fe=s.value.indexOf(z);fe>-1?(s.value.splice(fe,1),n("update:modelValue",[...s.value])):s.value.length<he&&(s.value.push(z),Q(),n("update:modelValue",[...s.value]))}else if($==="week"||$==="weekday"){const fe=$==="week"?7:5,ae=$==="week"?6:5,Se=new Date(`${z} 00:00:00`),be=Se.getDay(),oe=ae-be,re=Se.getTime()+us*oe;for(let pe=0;pe<fe;pe++){const Te=new Date(re-pe*us).getFullYear(),Ge=new Date(re-pe*us).getMonth()+1,Lt=new Date(re-pe*us).getDate(),Zt=`${Te}-${Xe(Ge)}-${Xe(Lt)}`;if(pe===0)if(s.value.includes(Zt)){s.value.splice(0);break}else s.value.splice(0),Q();(!Y||!Y(new Date(Zt)))&&s.value.unshift(Zt)}n("update:modelValue",[...s.value])}r("main");break}case"dateRange":{let $=[...s.value];if(!s.value.length)$=[z,z];else{const he=+(R==="expanded");$[he]=z}n("update:modelValue",$);break}case"dateTimeRange":{let $=[...s.value];if($.length){const he=+(R==="expanded"),fe=((ee=$[he])==null?void 0:ee.split(" ")[1])||"00:00:00";let ae=`${z} ${fe}`;i&&i.length&&(ae=Me(i[he],ae)),$[he]=ae}else{let he=`${z} 00:00:00`,fe=`${z} 00:00:00`;i&&i.length&&(he=Me(i[0],he),fe=Me(i[1],fe)),$=[he,fe]}n("update:modelValue",$);break}}},x=(R,X,G)=>{if(y[R][X])return;const N=l[R],P=1;X==="hour"?G==="down"&&N.hour<2?N.hour++:G==="up"&&N.hour>P&&N.hour--:X==="min"?G==="down"&&N.min<5?N.min++:G==="up"&&N.min>P&&N.min--:X==="sec"&&(G==="down"&&N.sec<5?N.sec++:G==="up"&&N.sec>P&&N.sec--)},I=(R,X,G,N)=>{var ne;if(y[R][X])return;const P=l[R],B=a[R],z=P[X]-1,D=G-1,Y=N-1,F=z*gt+D*Dr+Y;if((ne=B[X][F])!=null&&ne.isDisabled)return;const O=new Date,H={year:O.getFullYear(),month:O.getMonth()+1,date:O.getDate()};let j=!0,U=[];const Q=()=>{let q;return X==="hour"?q=`${Xe(F)}:00:00'`:X==="min"?q=`00:${Xe(F)}:00`:X==="sec"&&(q=`00:00:${Xe(F)}`),`${oi(H)} ${q}`},J=q=>{let ae=11;return X==="min"?ae=14:X==="sec"&&(ae=17),`${q==null?void 0:q.substr(0,ae)}${Xe(F)}${q==null?void 0:q.substr(ae+2)}`};if(t.mode==="dateTime"){let q;t.modelValue?q=Me(i,J(t.modelValue)):(j=!1,q=Me(i,Q())),n("update:modelValue",q),U.push(q)}else{const q=R!=="main"|0;let ee=[...s.value];if(t.modelValue.length){let $=J(t.modelValue[q]);i&&i.length&&($=Me(i[q],$)),ee[q]=$}else{const $=Q();ee=[$,$],i&&i.length&&(ee=[...ee.map((he,fe)=>Me(i[fe],he))]),j=!1,U=ee}n("update:modelValue",ee)}h(),j||b(U)},T=(R,X)=>{w(R,X.deltaY>0?"next":"prev")},v=(R,X,G)=>{y[R][X]||x(R,X,G.deltaY>0?"down":"up")},E=hs((R,X)=>{const G=X.target.tagName==="TD"?X.target:X.target.parentElement,N=G.classList.contains("disabled"),P=G.classList.contains("prev"),B=G.classList.contains("next");if(G.classList.length>0&&!N){const z=l[R];let D={year:+z.year,month:+z.month,date:X.target.innerText};P?D={...D,...Yr("prev",D.year,D.month)}:B&&(D={...D,...Yr("next",D.year,D.month)});const Y=f.value,F=oi({year:D.year,month:D.month,date:D.date});Rn(F)<Rn(Y)?(s.value[0]=F,s.value[1]=Y):(s.value[0]=Y,s.value[1]=F),r("main"),r("expanded")}},10),Z=R=>{const X=["dateRange","dateMulti","dateTimeRange"].includes(t.mode),G=t.options.disabledDate;if(X){const[N,P]=s.value;let[B,z]=[G,G];if(G&&Array.isArray(G)&&([B,z]=G),R[0]&&R[0]!==N&&B&&B(new Date(R[0])))return!0;if(R[1]&&R[1]!==P&&z&&z(new Date(R[1])))return!0;if(!G&&ms(t.mode,"main",R[0],R))return!0}else{if(t.mode==="dateMulti")return R.some(N=>G&&G(new Date(N)));if(G&&G(new Date(R)))return!0}return!1};return o.watch(()=>t.modelValue,R=>{if(Z(R)){n("update:modelValue",s.value);return}const X=["dateRange","dateMulti","dateTimeRange"].includes(t.mode);if(s.value=X?[...R]:R,t.mode==="dateRange")b(R);else if(t.mode.includes("Time")){let G=[];t.mode==="dateTime"?G=[R]:t.mode==="dateTimeRange"&&(G=R),b(G),h()}else t.mode==="date"&&b([R])}),{clickYearMonthBtn:M,clickPrevNextBtn:w,clickDate:S,clickYearMonth:V,clickHmsBtn:x,clickTime:I,wheelMonth:T,wheelTime:v,calendarEventName:m,onMousemoveDate:E,preventTimeEventType:y}},Sy={name:"EvCalendar",props:{modelValue:{type:[String,Array],default:"",validator:e=>{const t=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(e)?e.every(i=>!!(!i||i.length===10&&t.exec(i))||i.length===19&&n.exec(i)):!!(!e||e.length===10&&t.exec(e)||e.length===19&&n.exec(e))}},mode:{type:String,default:"date",validator:e=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(e)!==-1},monthNotation:{type:String,default:"fullName",validator:e=>["fullName","abbrName","numberName","korName"].indexOf(e)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:e=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(e)!==-1},options:{type:Object,default:()=>({multiType:"date",limit:1}),validator:({multiType:e,multiDayLimit:t,disabledDate:n,timeFormat:i})=>{const s=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!e||["weekday","week","date"].indexOf(e)!==-1)&&(!t||typeof t=="number"&&t>0)&&(!n||typeof n=="function"||Array.isArray(n))&&Array.isArray(i)?i.every(l=>!!(!l||s.exec(l))):!!(!i||s.exec(i))}}},emits:{"update:modelValue":[Array,String]},setup(e){const{calendarList:t,selectedValue:n,calendarPageInfo:i,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r}=by(),{calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,setCalendarDate:f,setCalendarMonth:m,setCalendarYear:g,setHmsTime:p,getTimeInfo:y}=yy({selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:a}),{clickPrevNextBtn:C,clickYearMonthBtn:b,clickDate:k,clickYearMonth:L,clickHmsBtn:w,clickTime:M,wheelMonth:V,wheelTime:S,calendarEventName:x,onMousemoveDate:I,preventTimeEventType:T}=xy({selectedValue:n,calendarPageInfo:i,calendarTimeTableInfo:u,selectedListType:r,setCalendarDate:f,setCalendarMonth:m,setCalendarYear:g,setHmsTime:p});return f("main"),["dateRange","dateTimeRange"].includes(e.mode)&&f("expanded"),["dateTime","dateTimeRange"].includes(e.mode)&&p(),{calendarList:t,selectedValue:n,calendarPageInfo:i,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r,calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,getTimeInfo:y,clickPrevNextBtn:C,clickYearMonthBtn:b,clickDate:k,clickYearMonth:L,clickHmsBtn:w,clickTime:M,wheelMonth:V,wheelTime:S,calendarEventName:x,onMousemoveDate:I,preventTimeEventType:T}}},Cy={class:"ev-calendar-wrapper"},ky={class:"ev-calendar-date-area"},wy={class:"ev-calendar-header"},Iy=["onClick"],Ty={class:"ev-calendar-year-month-wrapper"},Ly={key:0,class:"ev-calendar-year-range"},My=["onClick"],vy=["onClick"],Ry=["onClick"],Vy={class:"ev-calendar-body"},Ey=["onWheel"],Wy=["onClick"],Gy=["onWheel"],Zy=["onClick"],Xy={key:2,class:"ev-calendar-selector-btn-wrapper"},Ny={key:0,class:"ev-calendar-time-area"},Py={key:0,class:"ev-calendar-time-area-disabled"},Dy={class:"ev-calendar-time-side"},By={class:"ev-calendar-time-center"},Oy=["onWheel"],Yy=["onClick"],Fy={class:"ev-calendar-time-side"},zy=["onClick"];function Hy(e,t,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createElementBlock("div",Cy,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarList,r=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:r},[o.createElementVNode("div",ky,[o.createElementVNode("div",wy,[o.createElementVNode("div",{class:"move-month-arrow",onClick:c=>i.clickPrevNextBtn(r,"prev")},[...t[0]||(t[0]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-left move-month-arrow-icon"},null,-1)])],8,Iy),o.createElementVNode("div",Ty,[i.selectedListType[r]==="year"?(o.openBlock(),o.createElementBlock("span",Ly,o.toDisplayString(i.calendarYearRangeInfo[r].start+" - "+i.calendarYearRangeInfo[r].end),1)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("span",{class:"ev-calendar-year",onClick:c=>i.clickYearMonthBtn(r,"year")},o.toDisplayString(i.calendarPageInfo[r].year),9,My),i.selectedListType[r]==="date"?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-calendar-month",onClick:c=>i.clickYearMonthBtn(r,"month")},o.toDisplayString(i.calendarMonth[r]),9,vy)):o.createCommentVNode("",!0)],64))]),o.createElementVNode("div",{class:"move-month-arrow",onClick:c=>i.clickPrevNextBtn(r,"next")},[...t[1]||(t[1]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-right move-month-arrow-icon"},null,-1)])],8,Ry)]),o.createElementVNode("div",Vy,[i.selectedListType[r]==="date"?(o.openBlock(),o.createElementBlock("table",{key:`${r}_calendar_table`,class:"ev-calendar-table"},[o.createElementVNode("thead",null,[o.createElementVNode("tr",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.dayOfTheWeekList,c=>(o.openBlock(),o.createElementBlock("th",{key:c},o.toDisplayString(c),1))),128))])]),o.createElementVNode("tbody",{onWheel:o.withModifiers(c=>i.wheelMonth(r,c),["prevent"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarTableInfo[r],c=>(o.openBlock(),o.createElementBlock("tr",{key:c},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,d=>(o.openBlock(),o.createElementBlock("td",o.mergeProps({key:d,class:["ev-calendar-date-td",{[d.monthType]:!!d.monthType},{today:d.isToday},{selected:d.isSelected}],onClick:h=>i.clickDate(r,d)},{[o.toHandlerKey(`${i.calendarEventName}`)]:h=>i.onMousemoveDate(r,h)}),[o.createElementVNode("div",null,[o.createElementVNode("span",null,o.toDisplayString(d.date),1)])],16,Wy))),128))]))),128))],40,Ey)])):(o.openBlock(),o.createElementBlock("table",{key:1,class:o.normalizeClass(["ev-calendar-selector-table",`ev-calendar-selector-table--${i.selectedListType[r]}`])},[o.createElementVNode("tbody",{onWheel:o.withModifiers(c=>i.wheelMonth(r,c),["prevent"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.selectedListType[r]==="month"?i.calendarMonthTableInfo[r]:i.calendarYearTableInfo[r],c=>(o.openBlock(),o.createElementBlock("tr",{key:c},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,d=>(o.openBlock(),o.createElementBlock("td",{key:d.value,onClick:h=>i.clickYearMonth(r,d)},[o.createElementVNode("div",{class:o.normalizeClass(["ev-calendar-selector",{selected:d.isSelected},{today:d.today},{disabled:d.disabled}])},o.toDisplayString(d.label),3)],8,Zy))),128))]))),128))],40,Gy)],2)),i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",Xy,[o.createVNode(a,{onClick:c=>i.clickYearMonthBtn(r,"date")},{default:o.withCtx(()=>[...t[2]||(t[2]=[o.createTextVNode(" Done ",-1)])]),_:1},8,["onClick"])])):o.createCommentVNode("",!0)])]),["dateTime","dateTimeRange"].includes(n.mode)?(o.openBlock(),o.createElementBlock("div",Ny,[i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",Py)):o.createCommentVNode("",!0),o.createElementVNode("div",Dy,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["HOUR","MIN","SEC"],c=>o.createElementVNode("div",{key:`${c}_label`,class:"ev-calendar-time-side--label"},o.toDisplayString(c),1)),64))]),o.createElementVNode("div",By,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["hour","min","sec"],c=>o.createElementVNode("table",{key:`${c}_table`,class:"ev-calendar-time-table"},[o.createElementVNode("tbody",{onWheel:o.withModifiers(d=>i.wheelTime(r,c,d),["prevent"])},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,d=>o.createElementVNode("tr",{key:`${c}_${d}_tr`},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(4,h=>o.createElementVNode("td",{key:`${c}_${d}_${h}_td`,class:o.normalizeClass(["ev-calendar-time-td",{selected:i.getTimeInfo(c,d,h,r).isSelected},{disabled:i.preventTimeEventType[r][c]||i.getTimeInfo(c,d,h,r).isDisabled}]),onClick:u=>i.clickTime(r,c,d,h)},[o.createElementVNode("div",null,o.toDisplayString(i.getTimeInfo(c,d,h,r).num),1)],10,Yy)),64))])),64))],40,Oy)])),64))]),o.createElementVNode("div",Fy,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["hour","min","sec"],c=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${c}_btn_area`},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["up","down"],d=>o.createElementVNode("div",{key:`${c}_${d}_btn`,class:o.normalizeClass(["ev-calendar-time-side--btn",`arrow-${c}`,{disabled:i.preventTimeEventType[r][c]}]),onClick:h=>i.clickHmsBtn(r,c,d)},[o.createElementVNode("i",{class:o.normalizeClass(`ev-icon-arrow-${d}`)},null,2)],10,zy)),64))],64))),64))])])):o.createCommentVNode("",!0)],64))),128))])}const ai=ce(Sy,[["render",Hy]]);ai.install=e=>{e.component(ai.name,ai)};const Ay=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),_y=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),Ky=()=>{var f;const{props:e,emit:t}=o.getCurrentInstance(),n=(f=e.options)==null?void 0:f.timeFormat,i=["dateTimeRange","dateRange","dateMulti"].includes(e.mode),s=m=>{let g;if(e.mode==="dateTime")g=Me(n,m);else if(e.modelValue.length){const[p,y]=n;g=[Me(p,m[0]),Me(y,m[1])]}return g},l=o.computed({get:()=>e.modelValue?["dateTime","dateTimeRange"].includes(e.mode)&&n?s(e.modelValue):i?[...e.modelValue]:e.modelValue:e.mode==="date"||e.mode==="dateTime"?"":[],set:m=>{if(["dateTime","dateTimeRange"].includes(e.mode)&&n){t("update:modelValue",s(m));return}t("update:modelValue",m)}});let a;if(["dateTimeRange","dateTime"].includes(e.mode)&&n)if(e.mode==="dateTimeRange"&&Array.isArray(e.modelValue)&&e.modelValue.length===2){const[m,g]=e.modelValue,[p,y]=n;e.modelValue=[Me(p,m),Me(y,g)],a=o.ref([...e.modelValue])}else e.mode==="dateTime"&&e.modelValue?a=o.ref(Me(n,e.modelValue)):a=o.ref(e.modelValue);else a=o.ref(i?[...e.modelValue]:e.modelValue);const r=m=>{const g=b=>!!(b.length===10&&Ay.exec(b)),p=b=>!!(b.length===19&&_y.exec(b)),y=b=>{const k=b.split(" ")[0],L=+k.split("-")[0],w=+k.split("-")[1],M=+k.split("-")[2],V=Uo(L,w);return+M<=V&&L>=new Date(0).getFullYear()};let C=!0;e.mode==="date"?C=g(m)&&y(m):e.mode==="dateTime"?C=p(m)&&y(m):e.mode==="dateRange"?C=m.every(b=>g(b)&&y(b)):e.mode==="dateTimeRange"&&(C=m.every(b=>p(b)&&y(b))),C&&(l.value=i?[...m]:m),a.value=i?[...l.value]:l.value},c=o.computed(()=>e.mode==="date"||e.mode==="dateTime"?l.value:l.value.length);return{mv:l,currentValue:a,isClearableIcon:c,validateValue:r,removeAllMv:()=>{e.mode==="date"||e.mode==="dateTime"?l.value=null:(l.value.splice(0),l.value=[...l.value])},changeMv:async m=>{await o.nextTick(),t("change",l.value,m)},removeMv:m=>{if(!e.disabled){const g=l.value.indexOf(m);l.value.splice(g,1),l.value=[...l.value]}}}},Uy=()=>{const{props:e}=o.getCurrentInstance(),t=o.ref(!1),n=o.ref(null),i=o.ref(null),s=o.ref(null),l=o.ref(null),a=o.reactive({top:null,right:null,left:null}),r=async()=>{var k,L;await o.nextTick();const h=(k=i.value)==null?void 0:k.getBoundingClientRect(),u=(L=s.value)==null?void 0:L.getBoundingClientRect(),f=h.height,m=h.y,g=h.x,p=u.height,y=u.width,C=document.documentElement.clientHeight,b=document.documentElement.clientWidth;C<m+f+p?(a.top=`-${p}px`,b<g+y?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto")):(a.top=`${f}px`,b<g+y?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto"))};return{isDropbox:t,datePicker:n,datePickerWrapper:i,dropbox:s,itemWrapper:l,dropboxPosition:a,clickSelectInput:async()=>{e.disabled||(t.value=e.enableTextInput?!0:!t.value,t.value&&await r())},clickOutsideDropbox:()=>{t.value=!1},changeDropboxPosition:r}},Jy=e=>{var m;const{props:t}=o.getCurrentInstance(),{mv:n,currentValue:i,clickOutsideDropbox:s}=e,l=o.reactive([]);(m=t.shortcuts)==null||m.forEach(({value:g,label:p,shortcutDate:y})=>{l.push({key:g,label:p,shortcutDate:y,isActive:!1})});const a=()=>{const g=l.find(p=>p.isActive);g&&(g.isActive=!1)},r=g=>{const p=l.find(y=>y.key===g);p&&(p.isActive=!0)},c=g=>g===null?"00":+g<10?`0${g}`:g,d=g=>{const p=g?new Date(g):new Date,y=p.getFullYear(),C=p.getMonth()+1,b=p.getDate();return`${y}-${c(C)}-${c(b)}`},h=g=>{const p=g?new Date(g):new Date,y=p.getHours(),C=p.getMinutes(),b=p.getSeconds();return`${d(p)} ${c(y)}:${c(C)}:${c(b)}`},u=()=>{var y,C;a();const g=["dateRange","dateTimeRange"].includes(t.mode);if(!l.length||t.mode==="dateMulti"&&((y=t.options)==null?void 0:y.multiType)!=="date"||g&&!n.value.length||!g&&!n.value)return;let p;if(g){const b=(C=t.options)==null?void 0:C.timeFormat,[k,L]=n.value;let w;t.mode==="dateTimeRange"&&(b!=null&&b.length)?w=l.find(({shortcutDate:M})=>{const[V,S]=M(),[x,I]=b,T=Me(x,h(V)),v=Me(I,h(S)),E=T===h(k),Z=v===h(L);return E&&Z}):w=l.find(({shortcutDate:M})=>{const[V,S]=M(),x=t.mode==="dateTimeRange"?h:d,I=x(V)===x(k),T=x(S)===x(L);return I&&T}),p=w==null?void 0:w.key}else{const b=t.mode==="dateTime"?h:d,k=b(n.value),L=l.find(({shortcutDate:w})=>b(w())===k);p=L==null?void 0:L.key}p&&r(p)},f=g=>{var k;const p=["dateRange","dateTimeRange"].includes(t.mode),y=l.find(({key:L})=>L===g);if(!y)return;const C=y.shortcutDate,b=(k=t.options)==null?void 0:k.timeFormat;if(p){const[L,w]=C();if(t.mode==="dateTimeRange")if(b!=null&&b.length){const[M,V]=b;n.value=[Me(M,h(L)),Me(V,h(w))]}else n.value=[h(L),h(w)];else n.value=[d(L),d(w)]}else{const L=C();n.value=t.mode==="dateTime"?Me(b,h(L)):d(L)}a(),r(g)};return o.watch(()=>t.modelValue,g=>{var p,y;if(u(),!(t.mode==="dateMulti"&&((p=t==null?void 0:t.options)==null?void 0:p.multiType)==="date"&&((y=t==null?void 0:t.options)==null?void 0:y.multiDayLimit)>g.length)){if(t.mode==="dateRange"||t.mode==="dateTimeRange"){i.value=[...g];return}else if(t.mode==="dateTime"){i.value=g;return}i.value=g,s()}}),{usedShortcuts:l,clickShortcut:f,setActiveShortcut:u}},jy={name:"EvDatePicker",directives:{clickoutside:Ch},props:{modelValue:{type:[String,Array],default:"",validator:e=>{const t=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(e)?e.every(i=>!!(!i||i.length===10&&t.exec(i))||i.length===19&&n.exec(i)):!!(!e||e.length===10&&t.exec(e)||e.length===19&&n.exec(e))}},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},enableTextInput:{type:Boolean,default:!1},mode:{type:String,default:"date",validator:e=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(e)!==-1},monthNotation:{type:String,default:"fullName",validator:e=>["fullName","abbrName","numberName","korName"].indexOf(e)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:e=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(e)!==-1},options:{type:Object,default:()=>({type:"date",limit:1,tagShorten:!1}),validator:({multiType:e,multiDayLimit:t,disabledDate:n,tagShorten:i,timeFormat:s})=>{const l=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!e||["weekday","week","date"].indexOf(e)!==-1)&&(!t||typeof t=="number"&&t>0)&&(!n||typeof n=="function"||Array.isArray(n))&&(i===void 0||typeof i=="boolean")&&Array.isArray(s)?s.every(a=>!!(!a||l.exec(a))):!!(!s||l.exec(s))}},shortcuts:{type:Array,default:()=>[],validator:e=>e.length?e.every(({shortcutDate:t})=>{if(typeof t!="function")return!1;const n=t();return Array.isArray(n)&&n.every(i=>i instanceof Date)&&n[0]<=n[1]||typeof n=="object"&&n instanceof Date}):!0}},emits:{"update:modelValue":[Array,String]},setup(){const{mv:e,currentValue:t,isClearableIcon:n,validateValue:i,removeAllMv:s,changeMv:l,removeMv:a}=Ky(),{isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:m,clickOutsideDropbox:g,changeDropboxPosition:p}=Uy(),{usedShortcuts:y,clickShortcut:C,setActiveShortcut:b}=Jy({mv:e,currentValue:t,clickOutsideDropbox:g});return b(),{mv:e,currentValue:t,isClearableIcon:n,validateValue:i,removeAllMv:s,changeMv:l,removeMv:a,isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:m,clickOutsideDropbox:g,changeDropboxPosition:p,usedShortcuts:y,clickShortcut:C}}},Qy={ref:"datePickerWrapper",class:"ev-date-picker__wrapper"},$y=["placeholder","readonly","disabled"],qy=["placeholder","disabled"],ex={class:"ev-tag-name"},tx=["onClick"],nx={key:0,class:"ev-select-tag num"},ix={class:"ev-tag-name"},sx={class:"ev-select-tag num"},ox={class:"ev-tag-name"},lx={class:"ev-date-picker-dropbox-wrapper"},ax={key:0,class:"ev-date-picker-dropbox__button-layout"},rx={key:1,class:"ev-date-picker-dropbox__divider"};function cx(e,t,n,i,s,l){const a=o.resolveComponent("ev-button"),r=o.resolveComponent("ev-button-group"),c=o.resolveComponent("ev-calendar"),d=o.resolveDirective("clickoutside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"datePicker",class:o.normalizeClass(["ev-date-picker",{disabled:e.$props.disabled}])},[o.createElementVNode("div",Qy,[e.$props.mode==="date"||e.$props.mode==="dateTime"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t[15]||(t[15]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=h=>i.currentValue=h),type:"text",class:o.normalizeClass(["ev-input",{readonly:!e.$props.enableTextInput}]),placeholder:e.$props.placeholder,readonly:!e.$props.enableTextInput,disabled:e.$props.disabled,onClick:t[1]||(t[1]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h)),onKeydown:t[2]||(t[2]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:t[3]||(t[3]=h=>i.validateValue(i.currentValue))},null,42,$y),[[o.vModelText,i.currentValue,void 0,{trim:!0}]])],64)):e.$props.mode==="dateMulti"||!e.$props.enableTextInput?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-date-picker-tag-wrapper",onClick:t[4]||(t[4]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h))},[t[18]||(t[18]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.createElementVNode("input",{type:"text",class:"ev-input readonly",readonly:"",placeholder:e.$props.placeholder,disabled:e.$props.disabled},null,8,qy),e.$props.mode==="dateMulti"&&(e.$props.options.multiType==="date"||!e.$props.options.tagShorten)?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.mv,(h,u)=>(o.openBlock(),o.createElementBlock("div",{key:`${h}_${u}`,class:o.normalizeClass(["ev-select-tag",{num:e.$props.options.multiType!=="date"}])},[o.createElementVNode("span",ex,o.toDisplayString(h),1),e.$props.options.multiType==="date"?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-tag-suffix",onClick:o.withModifiers(f=>[i.removeMv(h),i.changeDropboxPosition()],["stop"])},[...t[16]||(t[16]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,tx)):o.createCommentVNode("",!0)],2))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.mv[0]?(o.openBlock(),o.createElementBlock("div",nx,[o.createElementVNode("span",ix,o.toDisplayString(i.mv[0]),1)])):o.createCommentVNode("",!0),i.mv[i.mv.length-1]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[t[17]||(t[17]=o.createElementVNode("div",{class:"ev-select-tag num"},[o.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),o.createElementVNode("div",sx,[o.createElementVNode("span",ox,o.toDisplayString(i.mv[i.mv.length-1]),1)])],64)):o.createCommentVNode("",!0)],64))])):(o.openBlock(),o.createElementBlock("div",{key:2,class:"ev-date-picker-input-wrapper",onClick:t[11]||(t[11]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h))},[t[20]||(t[20]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[5]||(t[5]=h=>i.currentValue[0]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:t[6]||(t[6]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:t[7]||(t[7]=h=>i.validateValue(i.currentValue))},null,544),[[o.vModelText,i.currentValue[0],void 0,{trim:!0}]]),i.currentValue[i.currentValue.length-1]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t[19]||(t[19]=o.createElementVNode("div",{class:"ev-date-picker-range-separator"},[o.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[8]||(t[8]=h=>i.currentValue[i.currentValue.length-1]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:t[9]||(t[9]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:t[10]||(t[10]=h=>i.validateValue(i.currentValue))},null,544),[[o.vModelText,i.currentValue[i.currentValue.length-1],void 0,{trim:!0}]])],64)):o.createCommentVNode("",!0)])),e.$props.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:3,class:"ev-input-suffix",onClick:t[12]||(t[12]=o.withModifiers(h=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...t[21]||(t[21]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",lx,[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:o.normalizeClass(["ev-date-picker-dropdown",e.$props.mode]),style:o.normalizeStyle(i.dropboxPosition)},[i.usedShortcuts.length?(o.openBlock(),o.createElementBlock("div",ax,[i.usedShortcuts.length===1?(o.openBlock(),o.createBlock(a,{key:0,type:i.usedShortcuts[0].isActive?"primary":"default",onClick:t[13]||(t[13]=h=>i.clickShortcut(i.usedShortcuts[0].key))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.usedShortcuts[0].label),1)]),_:1},8,["type"])):(o.openBlock(),o.createBlock(r,{key:1},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.usedShortcuts,h=>(o.openBlock(),o.createBlock(a,{key:h.key,type:h.isActive?"primary":"default",onClick:u=>i.clickShortcut(h.key)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.label),1)]),_:2},1032,["type","onClick"]))),128))]),_:1}))])):o.createCommentVNode("",!0),i.usedShortcuts.length?(o.openBlock(),o.createElementBlock("div",rx)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass({"ev-date-picker-dropbox__calendar":i.usedShortcuts.length})},[o.createVNode(c,{key:"fromCalendar",modelValue:i.mv,"onUpdate:modelValue":t[14]||(t[14]=h=>i.mv=h),mode:e.$props.mode,"month-notation":e.$props.monthNotation,"day-of-the-week-notation":e.$props.dayOfTheWeekNotation,options:e.$props.options},null,8,["modelValue","mode","month-notation","day-of-the-week-notation","options"])],2)],6)):o.createCommentVNode("",!0)])],512)],2)),[[d,i.clickOutsideDropbox]])}const ri=ce(jy,[["render",cx]]);ri.install=e=>{e.component(ri.name,ri)};const dx={name:"EvMessage",props:{type:{type:String,default:"info",validator:e=>["info","success","warning","error"].includes(e)},message:{type:String,default:""},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!1},iconClass:{type:String,default:""},onClose:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(e,t){const n=o.reactive({timer:null,isShow:!0}),i=()=>{clearTimeout(n.timer),n.timer=null},s=()=>{n.isShow=!1,e.onClose&&e.onClose(),i(),e.unmount&&setTimeout(e.unmount,1e3)},l=()=>{e.duration>0&&(n.timer=setTimeout(()=>{n.isShow&&s()},e.duration))},a=c=>{c.keyCode===27&&n.isShow&&s()},r=()=>{s()};return o.onMounted(()=>{l(),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),i()}),t.expose({hide:r}),{startTimer:l,clearTimer:i,closeMsg:s,...o.toRefs(n),hide:r}}},hx={key:0,class:"ev-message-icon"},ux=["innerHTML"],fx={key:2,class:"ev-message-content"};function mx(e,t,n,i,s,l){return o.openBlock(),o.createBlock(o.Teleport,{to:"#ev-message-modal"},[o.createVNode(o.Transition,{name:"ev-message-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref:"msgRef",class:o.normalizeClass(["ev-message",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass}]),onMouseenter:t[1]||(t[1]=(...a)=>i.clearTimer&&i.clearTimer(...a)),onMouseleave:t[2]||(t[2]=(...a)=>i.startTimer&&i.startTimer(...a))},[n.iconClass?(o.openBlock(),o.createElementBlock("span",hx,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-message-content",innerHTML:n.message},null,8,ux)):(o.openBlock(),o.createElementBlock("div",fx,o.toDisplayString(n.message),1)),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:3,class:"ev-message-close",onClick:t[0]||(t[0]=(...a)=>i.closeMsg&&i.closeMsg(...a))},[...t[3]||(t[3]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],34),[[o.vShow,e.isShow]])]),_:1})])}const px=ce(dx,[["render",mx]]),gx=o.defineComponent(px),zr="ev-message-modal",Hr=document.createElement("div");Hr.id=zr;const ps=(e={})=>{document.getElementById(zr)||document.body.appendChild(Hr);const n=document.createElement("div"),i=()=>o.render(null,n),s=typeof e=="string"?{message:e,unmount:i}:{...e,unmount:i},l=o.h(gx,s);return o.render(l,n),l.component.exposed};ps.install=e=>{const t=e.config.globalProperties;t.$message=ps};const bx={name:"EvNotification",props:{type:{type:String,default:"info",validator:e=>["info","success","warning","error"].includes(e)},title:{type:String,default:""},message:{type:String,default:""},position:{type:String,default:"top-right",validator:e=>["top-left","top-right","bottom-left","bottom-right"].includes(e)},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!0},iconClass:{type:String,default:""},onClose:{type:Function,default:null},onClick:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(e){const t=o.reactive({timer:null,isShow:!0}),n=()=>{clearTimeout(t.timer),t.timer=null},i=r=>{r.target.className!=="ev-notification-close"&&e.onClick&&e.onClick()},s=()=>{t.isShow=!1,e.onClose&&e.onClose(),n(),e.unmount&&setTimeout(e.unmount,1e3)},l=()=>{e.duration>0&&(t.timer=setTimeout(()=>{t.isShow&&s()},e.duration))},a=r=>{r.keyCode===27&&t.isShow&&s()};return o.onMounted(()=>{l(),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),n()}),{startTimer:l,clearTimer:n,clickMsg:i,closeMsg:s,...o.toRefs(t)}}},yx={key:0,class:"ev-notification-icon"},xx={class:"ev-notification-content"},Sx={key:0,class:"title"},Cx=["innerHTML"],kx={key:2,class:"message"};function wx(e,t,n,i,s,l){return o.openBlock(),o.createBlock(o.Transition,{name:"ev-notification-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(["ev-notification",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-click":!!n.onClick}]),onMouseenter:t[1]||(t[1]=(...a)=>i.clearTimer&&i.clearTimer(...a)),onMouseleave:t[2]||(t[2]=(...a)=>i.startTimer&&i.startTimer(...a)),onClick:t[3]||(t[3]=(...a)=>i.clickMsg&&i.clickMsg(...a))},[n.iconClass?(o.openBlock(),o.createElementBlock("span",yx,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",xx,[n.title?(o.openBlock(),o.createElementBlock("p",Sx,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"message",innerHTML:n.message},null,8,Cx)):(o.openBlock(),o.createElementBlock("p",kx,o.toDisplayString(n.message),1))]),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:1,class:"ev-notification-close",onClick:t[0]||(t[0]=(...a)=>i.closeMsg&&i.closeMsg(...a))},[...t[4]||(t[4]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],34),[[o.vShow,e.isShow]])]),_:1})}const Ix=ce(bx,[["render",wx]]),Tx=o.defineComponent(Ix),Ar="ev-notification-modal",gs=document.createElement("div");gs.id=Ar;const Lx=["top-left","top-right","bottom-left","bottom-right"],bs=(e={})=>{const t=e.position||"top-right";if(!Lx.includes(t)){console.warn("[EVUI][Notification] The position value is incorrectly entered.");return}document.getElementById(Ar)||document.body.appendChild(gs);let i=gs.getElementsByClassName(`modal-${t}`);i.length?i=i[0]:(i=document.createElement("div"),i.classList.add(`modal-${t}`),gs.appendChild(i));const l=document.createElement("div"),a=()=>o.render(null,l),r=typeof e=="string"?{message:e,unmount:a}:{...e,unmount:a},c=o.h(Tx,r);o.render(c,l),i.appendChild(c.el)};bs.install=e=>{const t=e.config.globalProperties;t.$notify=bs};const Mx={name:"EvMessageBox",components:{EvButton:Sn},props:{type:{type:String,default:"",validator:e=>["","info","success","warning","error"].includes(e)},title:{type:String,default:""},message:{type:[String,Array],default:""},iconClass:{type:String,default:""},onClose:{type:Function,default:null},showClose:{type:Boolean,default:!0},showConfirmBtn:{type:Boolean,default:!0},showCancelBtn:{type:Boolean,default:!0},confirmBtnText:{type:String,default:"OK"},cancelBtnText:{type:String,default:"Cancel"},closeOnClickModal:{type:Boolean,default:!0},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null},focusable:{type:Boolean,default:!1}},setup(e){const t=o.ref(null),n=o.reactive({isShow:!0,iconClass:""}),i=c=>{if(!e.closeOnClickModal&&c==="modal")return;const d=c==="modal"?"cancel":c;n.isShow=!1,e.onClose&&e.onClose(d),e.unmount&&setTimeout(e.unmount,1e3)},s=c=>{c.keyCode===27&&n.isShow&&i()},l=c=>{switch(c){case"success":return"ev-icon-arrow-check";case"warning":return"ev-icon-warning2";case"error":return"ev-icon-warning3";case"info":default:return"ev-icon-info2"}},a=()=>{e.iconClass?n.iconClass=e.iconClass:e.type&&(n.iconClass=l(e.type))},r=c=>{if(!e.focusable)return!1;switch(c){case"confirmBtn":return e.showConfirmBtn;case"cancelBtn":return!e.showConfirmBtn&&e.showCancelBtn;case"messagebox":return!e.showConfirmBtn&&!e.showCancelBtn;default:return!1}};return o.onMounted(()=>{a(),document.addEventListener("keydown",s),r("messagebox")&&t.value.focus()}),o.watch(()=>n.isShow,c=>{c||document.removeEventListener("keydown",s)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",s)}),{closeMsg:i,...o.toRefs(n),msgRef:t,hasFocus:r}}},vx={key:0,class:"ev-message-box-icon"},Rx={class:"ev-message-box-content"},Vx={key:0,class:"ev-message-box-title"},Ex=["innerHTML"],Wx={key:2,class:"ev-message-box-message"},Gx={class:"ev-message-box-btn"};function Zx(e,t,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(o.Transition,{name:"ev-message-box-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{id:"ev-message-box-modal",onClick:t[3]||(t[3]=o.withModifiers(r=>i.closeMsg("modal"),["self"])),onWheel:o.withModifiers(()=>{},["stop","prevent"])},[o.createElementVNode("div",{ref:"msgRef",class:o.normalizeClass(["ev-message-box",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-title":!!n.title}]),tabindex:"-1"},[n.iconClass?(o.openBlock(),o.createElementBlock("span",vx,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",Rx,[n.title?(o.openBlock(),o.createElementBlock("p",Vx,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"ev-message-box-message",innerHTML:n.message},null,8,Ex)):(o.openBlock(),o.createElementBlock("p",Wx,o.toDisplayString(n.message),1))]),o.createElementVNode("div",Gx,[n.showCancelBtn?(o.openBlock(),o.createBlock(a,{key:0,size:"small",class:"ev-message-box-cancel","auto-focus":i.hasFocus("cancelBtn"),onClick:t[0]||(t[0]=r=>i.closeMsg("cancel"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.cancelBtnText),1)]),_:1},8,["auto-focus"])):o.createCommentVNode("",!0),n.showConfirmBtn?(o.openBlock(),o.createBlock(a,{key:1,type:"primary",size:"small",class:"ev-message-box-confirm","auto-focus":i.hasFocus("confirmBtn"),onClick:t[1]||(t[1]=r=>i.closeMsg("ok"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.confirmBtnText),1)]),_:1},8,["auto-focus"])):o.createCommentVNode("",!0)]),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:1,class:"ev-message-box-close",onClick:t[2]||(t[2]=r=>i.closeMsg("cancel"))},[...t[4]||(t[4]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],2)],544),[[o.vShow,e.isShow]])]),_:1})])}const Xx=ce(Mx,[["render",Zx]]),Nx=o.defineComponent(Xx),ys=(e={})=>{const t=document.createElement("div"),n=()=>o.render(null,t),i=typeof e=="string"?{message:e,unmount:n}:{...e,unmount:n},s=o.h(Nx,i);o.render(s,t)};ys.install=e=>{const t=e.config.globalProperties;t.$messagebox=ys};const _r=(e,t)=>Array.from(Array(e),()=>Array(t).fill(!1)),Px=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.computed({get:()=>e.modelValue.length!==e.rowLabels.length||!e.modelValue[0]||e.modelValue[0].length!==e.colLabels.length?_r(e.rowLabels.length,e.colLabels.length):e.modelValue,set:s=>{t("update:modelValue",s),t("change",s)}});return{mv:n,validateValue:()=>{(e.modelValue.length!==e.rowLabels.length||!e.modelValue[0]||e.modelValue[0].length!==e.colLabels.length)&&(n.value=[..._r(e.rowLabels.length,e.colLabels.length)])}}},Dx=e=>{const{mv:t}=e,n=o.reactive({startRow:null,startCol:null,dragRow:null,dragCol:null,endRow:null,endCol:null,dragEventName:null}),i=(h,u)=>{if(n.dragCol===null||n.dragRow===null)return{};const f=n.startRow<n.dragRow?n.startRow:n.dragRow,m=n.startRow>n.dragRow?n.startRow:n.dragRow,g=n.startCol<n.dragCol?n.startCol:n.dragCol,p=n.startCol>n.dragCol?n.startCol:n.dragCol;if(f>h||m<h||g>u||p<u)return{};const y="2px solid #5292F7";let C={};return h===f&&(C={...C,"border-top":y}),h===m&&(C={...C,"border-bottom":y}),u===g&&(C={...C,"border-left":y}),u===p&&(C={...C,"border-right":y}),C},s=(h,u)=>{n.startRow=h,n.startCol=u,n.dragRow=h,n.dragCol=u,n.dragEventName="mousemove"},l=(h,u)=>{if(!n.dragEventName)return;n.endRow=h,n.endCol=u,n.dragEventName=null;const f=[...t.value],m=n.startRow<n.endRow?n.startRow:n.endRow,g=n.startRow>n.endRow?n.startRow:n.endRow,p=n.startCol<n.endCol?n.startCol:n.endCol,y=n.startCol>n.endCol?n.startCol:n.endCol;for(let C=m;C<=g;C++)for(let b=p;b<=y;b++)f[C][b]=!f[C][b];t.value=[...f],n.dragRow=null,n.dragCol=null};return{mousePos:n,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:(h,u)=>{n.dragRow=h,n.dragCol=u},mouseleaveBoxArea:()=>{l(n.dragRow,n.dragCol)},selectColumn:h=>{const u=[...t.value],f=u[0][h];for(let m=0;m<u.length;m++)u[m][h]=!f;t.value=[...u]},selectRow:h=>{const u=[...t.value],f=u[h][0];for(let m=0;m<u[0].length;m++)u[h][m]=!f;t.value=[...u]}}},Bx={name:"EvScheduler",props:{modelValue:{type:Array,default:()=>[]},colLabels:{type:Array,default:()=>['<span style="color: #FF0000">SUN</span>',"MON","TUE","WED","THU","FRI",'<span style="color: #0006F9">SAT</span>']},rowLabels:{type:Array,default:()=>["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"]}},emits:{"update:modelValue":Array,change:Array},setup(){const{mv:e,validateValue:t}=Px();t();const{mousePos:n,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d}=Dx({mv:e});return{mv:e,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d,...o.toRefs(n)}}},Ox={class:"ev-scheduler-header"},Yx=["onClick","innerHTML"],Fx=["onClick","innerHTML"],zx=["onMousedown","onMouseup"];function Hx(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("table",{class:o.normalizeClass(["ev-scheduler",{draggable:!!e.dragEventName}])},[o.createElementVNode("thead",null,[o.createElementVNode("tr",Ox,[t[1]||(t[1]=o.createElementVNode("td",null,null,-1)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colLabels.length,(a,r)=>(o.openBlock(),o.createElementBlock("td",{key:`${a}_${r}_header`,class:"ev-scheduler-header-label",onClick:c=>i.selectColumn(r),innerHTML:n.colLabels[r]},null,8,Yx))),128))])]),o.createElementVNode("tbody",{onMouseleave:t[0]||(t[0]=(...a)=>i.mouseleaveBoxArea&&i.mouseleaveBoxArea(...a))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.rowLabels.length,(a,r)=>(o.openBlock(),o.createElementBlock("tr",{key:`${a}_${r}_body`,class:"ev-scheduler-body"},[(o.openBlock(),o.createElementBlock("td",{key:`${a}_${r}_${n.rowLabels[r]}`,class:"ev-scheduler-body-label",onClick:c=>i.selectRow(r),innerHTML:n.rowLabels[r]},null,8,Fx)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colLabels.length,(c,d)=>(o.openBlock(),o.createElementBlock("td",o.mergeProps({key:`${c}_${r}_${d}_body`,class:["ev-scheduler-body-box",{selected:i.mv[r][d]}],style:i.selectionStyle(r,d),onMousedown:o.withModifiers(h=>i.mousedownBox(r,d,h),["stop","prevent"]),onMouseup:o.withModifiers(h=>i.mouseupBox(r,d),["stop","prevent"])},{[o.toHandlerKey(`${e.dragEventName}`)]:h=>i.mousemoveBox(r,d)}),null,16,zx))),128))]))),128))],32)],2)}const ci=ce(Bx,[["render",Hx]]);ci.install=e=>{e.component(ci.name,ci)};const Ax=()=>{const e=o.defineComponent(Kr),t=o.ref([]);return{comp:e,childrenItems:t,initWrapperDiv:()=>{const i=document.createElement("div");i.id="ev-context-menu-modal",i.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-context-menu-modal")||document.body.appendChild(i)}}},_x=()=>{const{props:e}=o.getCurrentInstance(),t=o.computed(()=>e.isShowMenuOnClick),n=o.ref(!1),i=o.ref(null),s=o.reactive({top:null,left:null,right:null,pageY:null,pageX:null,clientX:null});return{isShow:n,rootMenuList:i,menuStyle:s,show:async r=>{var d,h;n.value=!0,await o.nextTick();const c=(h=(d=i.value)==null?void 0:d.$el)==null?void 0:h.children[0].getBoundingClientRect();if(c){const u=c.height,f=c.width,m=document.documentElement.clientHeight,g=document.documentElement.clientWidth,p=20;s.pageX=r.pageX,s.pageY=r.pageY,s.clientX=r.clientX,m<r.clientY+u?s.top=`${r.pageY-u}px`:s.top=`${r.pageY}px`,g<r.clientX+f+p?s.left=`${r.pageX-f}px`:s.left=`${r.pageX}px`}},hide:async()=>{await o.nextTick(),!t.value&&(n.value=!1)}}},Kx=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.computed({get:()=>e.isShow,set:f=>t("update:isShow",f)}),i=o.computed(()=>!!e.items.some(f=>f.children)),s=o.ref([]),l=o.ref(!1),a=o.ref(null),r=o.reactive({top:null,left:null,right:null}),c=f=>{f||(n.value=!1)},d=f=>{var T,v,E;const m=document.documentElement.clientWidth,g=document.documentElement.clientHeight,p=20,y=(T=f.target.parentElement)==null?void 0:T.getBoundingClientRect(),{x:C,y:b,width:k,height:L}=y,w=(E=(v=a.value)==null?void 0:v.$el)==null?void 0:E.children[0].getBoundingClientRect(),{width:M,height:V}=w,S=f.target.offsetTop,x=g<b+S+V,I=m<C+k+M+p;x?r.top=`${L-V}px`:r.top=`${S}px`,I?r.left=`${0-M}px`:r.left=`${k}px`};return{computedIsShow:n,isExistChild:i,isShowChild:l,childMenu:a,menuStyle:r,childrenItems:s,handleItemClick:f=>{f.click&&!f.disabled&&f.click(f),f.isShowMenu||c(f.children)},handleMouseEnter:async(f,m)=>{!m.children||!Array.isArray(m.children)||m.disabled?l.value=!1:(l.value=!0,s.value=m.children,await o.nextTick(),d(f))},hideAll:c}},Ux={name:"EvMenuList",props:{isShow:{type:Boolean,default:!1},items:{type:Array,default:()=>[],validator:e=>e.some(t=>t.children!==void 0&&!Array.isArray(t.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):e.some(t=>t.click!==void 0&&typeof t.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},comp:{type:Object,default:()=>{}}},emits:{"update:isShow":[Boolean]},setup(){const{isExistChild:e,computedIsShow:t,isShowChild:n,childMenu:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}=Kx();return{isExistChild:e,computedIsShow:t,isShowChild:n,childMenu:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}}},Jx={class:"ev-menu-list"},jx={class:"ev-menu-ul"},Qx=["onClick","onMouseenter"],$x={class:"ev-menu-li-text"},qx={key:1,class:"ev-menu-li-suffix ev-icon-arrow-right2"};function e0(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Jx,[o.createElementVNode("ul",jx,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.items,(a,r)=>o.withDirectives((o.openBlock(),o.createElementBlock("li",{key:`${a.value}_${r}`,class:o.normalizeClass(["ev-menu-li",{disabled:a.disabled,[a.itemClass]:a.itemClass}]),onClick:c=>i.handleItemClick(a),onMouseenter:c=>i.handleMouseEnter(c,a)},[a.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["ev-menu-li-prefix",a.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",$x,[a.slotKey?o.renderSlot(e.$slots,a.slotKey,{key:0,item:a},()=>[o.createTextVNode(o.toDisplayString(a.text),1)]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(a.text),1)],64))]),a.children||a.isShowMenu?(o.openBlock(),o.createElementBlock("i",qx)):o.createCommentVNode("",!0)],42,Qx)),[[o.vShow,!a.hidden]])),128))]),i.isExistChild?o.withDirectives((o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:0,ref:"childMenu",isShow:i.computedIsShow,"onUpdate:isShow":t[0]||(t[0]=a=>i.computedIsShow=a),comp:n.comp,items:i.childrenItems,style:o.normalizeStyle(i.menuStyle)},o.createSlots({_:2},[o.renderList(e.$slots,(a,r)=>({name:r,fn:o.withCtx(c=>[o.renderSlot(e.$slots,r,o.normalizeProps(o.guardReactiveProps(c)))])}))]),1064,["isShow","comp","items","style"])),[[o.vShow,i.childrenItems.length&&i.isShowChild]]):o.createCommentVNode("",!0)])}const Kr=ce(Ux,[["render",e0]]),t0={name:"EvContextMenu",directives:{clickoutside:Ji},components:{MenuList:Kr},props:{items:{type:Array,default:()=>[],validator:e=>e.some(t=>t.children!==void 0&&!Array.isArray(t.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):e.some(t=>t.click!==void 0&&typeof t.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},customClass:{type:String,default:""},isShowMenuOnClick:{type:Boolean,default:!1}},setup(){const{comp:e,initWrapperDiv:t}=Ax(),{isShow:n,rootMenuList:i,menuStyle:s,show:l,hide:a}=_x();return o.onBeforeMount(()=>t()),{isShow:n,rootMenuList:i,menuStyle:s,comp:e,show:l,hide:a}}};function n0(e,t,n,i,s,l){const a=o.resolveComponent("menu-list"),r=o.resolveDirective("clickoutside");return i.isShow&&n.items.length?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-context-menu-modal"},[o.withDirectives((o.openBlock(),o.createBlock(a,{ref:"rootMenuList",isShow:i.isShow,"onUpdate:isShow":t[0]||(t[0]=c=>i.isShow=c),class:o.normalizeClass(n.customClass),items:n.items,style:o.normalizeStyle(i.menuStyle),comp:i.comp},o.createSlots({_:2},[o.renderList(e.$slots,(c,d)=>({name:d,fn:o.withCtx(h=>[o.renderSlot(e.$slots,d,o.normalizeProps(o.guardReactiveProps(h)))])}))]),1032,["isShow","class","items","style","comp"])),[[r,i.hide]])])):o.createCommentVNode("",!0)}const di=ce(t0,[["render",n0]]);di.install=e=>{e.component(di.name,di)};const i0=()=>window.innerWidth-document.documentElement.clientWidth,s0=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.ref(),i=o.ref(),s=o.ref(!1),l=o.computed(()=>s.value?"ev-icon-compress":"ev-icon-expand");let a=document.getElementById("ev-window-modal");(()=>{if(!a){const p=document.createElement("div");p.id="ev-window-modal",document.body.appendChild(p),a=document.getElementById("ev-window-modal")}})();const c=p=>{let y,C;if(typeof p=="string"||typeof p=="number"){const b=/^(normal|(-*\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(p);y=b?{value:+b[2],unit:b[3]||void 0}:void 0}else y=void 0;return y==null?C=void 0:y.unit?C=`${y.value}${y.unit}`:C=`${y.value}px`,C},d=(p,y="horizontal")=>{if(typeof p=="number")return p;if(!p)return 0;let C=0;const b=/^(normal|(\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(p);if(y&&["%","vw","vh"].includes(b[3])&&b[2]){const k=y==="horizontal"?window.innerWidth:window.innerHeight;C=Math.floor(k*+b[2]/100)}else b[2]&&(C=+b[2]);return C},h=o.reactive({}),u=o.computed(()=>({...e.style,...h})),f=()=>{if(h.position="fixed",e.fullscreen){h.width="100%",h.height="100%",h.top=0,h.left=0;return}const p=d(e.width,"horizontal"),y=d(e.minWidth,"horizontal");p<y?(console.warn("[EVUI][Window] Since width is less than min-width, it is replaced by min-width."),h.width=c(e.minWidth)):h.width=c(e.width);const C=d(e.height,"vertical"),b=d(e.minHeight,"vertical");C<b?(console.warn("[EVUI][Window] Since height is less than min-height, it is replaced by min-height."),h.height=c(e.minHeight)):h.height=c(e.height),h.top=`calc((100% - ${h.height}) / 2)`,h.left=`calc((100% - ${h.width}) / 2)`,d(e.width,"horizontal")>window.innerWidth&&(h.left=0),d(e.height,"vertical")>window.innerHeight&&(h.top=0)},m=p=>{p==="layer"&&!e.closeOnClickModal||t("update:visible",!1)},g=p=>{var b;const y=(b=a==null?void 0:a.getElementsByClassName("scroll-lock"))==null?void 0:b.length,C=document.body;if(p){if(e.hideScroll){if(!y){const k=i0();C.style.paddingRight=`${k}px`}C.classList.add("ev-window-scroll-lock")}}else e.hideScroll&&y===1&&(C.style.removeProperty("padding-right"),C.classList.remove("ev-window-scroll-lock"))};return f(),o.watch(()=>e.visible,async p=>{g(p),p&&await o.nextTick(()=>{f()})}),{windowRef:n,headerRef:i,isFullExpandWindow:s,maximizableIcon:l,baseStyle:u,closeWin:m,numberToUnit:c,removeUnit:d}},o0=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{windowRef:i,headerRef:s,isFullExpandWindow:l,numberToUnit:a,removeUnit:r}=e,c=50,d=5,h=o.reactive({}),u=o.reactive({state:"",pressedSpot:"",top:0,left:0,width:0,height:0,clientX:0,clientY:0}),f=o.reactive({top:0,left:0}),m=o.reactive({top:!1,right:!1,left:!1,bottom:!1}),g=o.reactive({width:null,height:null,top:null,left:null}),p=(T,v)=>{if(T==null||v==null)return!1;const E=i.value.getBoundingClientRect(),Z=+T-E.left,W=+v-E.top,R=s.value.style,X={top:r(R.paddingTop,"vertical"),left:r(R.paddingLeft,"horizontal"),right:r(R.paddingRight,"horizontal")},G=X.left,N=E.width-X.right,P=X.top,B=P+s.value.offsetHeight;return Z>G&&Z<N&&W>P&&W<B},y=T=>{if(T===null||typeof T!="object")return;let v,E,Z,W,R,X;const G=i.value,N=Object.prototype.hasOwnProperty;N.call(T,"top")?v=T.top:v=u.top,N.call(T,"left")?E=T.left:E=u.left,N.call(T,"width")?Z=T.width:Z=G.offsetWidth,N.call(T,"height")?W=T.height:W=G.offsetHeight,N.call(T,"minWidth")?R=T.minWidth:R=t.minWidth,N.call(T,"minHeight")?X=T.minHeight:X=t.minHeight,Z=r(Z,"horizontal")>r(R,"horizontal")?Z:R,W=r(W,"vertical")>r(X,"vertical")?W:X,h.top=a(v),h.left=a(E),h.width=a(Z),h.height=a(W),h.minWidth=a(R),h.minHeight=a(X)},C=T=>{if(!(!i.value||u.pressedSpot))if(t.resizable){const v=i.value.getBoundingClientRect(),E=T.clientX-v.left,Z=T.clientY-v.top,W=Z<d,R=E<d,X=E>=v.width-d,G=Z>=v.height-d;W&&R||G&&X?i.value.style.cursor="nwse-resize":W&&X||G&&R?i.value.style.cursor="nesw-resize":X||R?i.value.style.cursor="ew-resize":G||W?i.value.style.cursor="ns-resize":t.draggable&&p(T.clientX,T.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"}else t.draggable&&p(T.clientX,T.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"},b=T=>{const v=window.innerWidth,E=window.innerHeight,Z=m.top,W=m.left,R=m.right,X=m.bottom,G=r(t.minWidth,"horizontal"),N=r(t.minHeight,"vertical"),P=T.clientX>=v?v:T.clientX;let B=T.clientY>=E?E:T.clientY;B=T.clientY>0?B:0;const z=P-u.clientX,D=B-u.clientY;let Y=u.top,F=u.left,O=u.width,H=u.height;const j=Y+u.height-N,U=F+u.width-G;Z&&(Y=u.top+D,H=u.height-D,Y>j&&(Y=j)),W&&(F=u.left+z,O=u.width-z,F>U&&(F=U)),R&&(O=u.width+z),X&&(H=u.height+D),O=Math.min(Math.max(O,G),v),H=Math.min(Math.max(H,N),E);const Q={top:Y,left:F,width:O,height:H};y(Q),n("resize",T,{...Q})},k=(T,v)=>{let E=v;return E<0?E=0:E>T-c&&(E=Math.floor(T-c)),E},L=(T,v)=>{let E=v;return E<-(u.width-c)?E=-Math.floor(u.width-c):E>T-c&&(E=Math.floor(T-c)),E},w=T=>{if(T.preventDefault(),u.state="mousedown-mousemove",t.draggable&&u.pressedSpot==="header"){const v=document.documentElement.clientWidth,E=document.documentElement.clientHeight,Z=T.clientY-u.clientY,W=T.clientX-u.clientX;let R=u.top+Z,X=u.left+W;R=k(E,R),X=L(v,X),y({top:`${R}px`,left:`${X}px`,width:h.width??t.width,height:h.height??t.height})}else t.resizable&&u.pressedSpot==="border"&&b(T);n("mousedown-mousemove",T)},M=T=>{u.state="",u.pressedSpot="",n("mousedown-mouseup",T),window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",M)},V=T=>{if(!i.value||!t.resizable&&!t.draggable)return;let v="";if(t.resizable){const E=i.value.getBoundingClientRect(),Z=T.clientX-E.left,W=T.clientY-E.top,R=W<d,X=Z<d,G=Z>=E.width-d,N=W>=E.height-d;m.top=R,m.left=X,m.right=G,m.bottom=N,(R||X||G||N)&&(v="border")}if(v!=="border"&&p(T.clientX,T.clientY)&&(v="header"),!v||!t.draggable&&v==="header"||!t.resizable&&v==="border"){u.state="mousedown",u.pressedSpot="",u.top=i.value.offsetTop,u.left=i.value.offsetLeft,u.width=i.value.offsetWidth,u.height=i.value.offsetHeight,u.clientX=T.clientX,u.clientY=T.clientY,n("mousedown",{...u,ref:i.value});return}u.state="mousedown",u.pressedSpot=v,u.top=i.value.offsetTop,u.left=i.value.offsetLeft,u.width=i.value.offsetWidth,u.height=i.value.offsetHeight,u.clientX=T.clientX,u.clientY=T.clientY,n("mousedown",{...u,ref:i.value}),window.addEventListener("mousemove",w),window.addEventListener("mouseup",M)},S=T=>{!t.draggable&&!t.resizable||C(T)},x=()=>{l.value=!l.value,o.nextTick(()=>{l.value?(g.top=i.value.offsetTop,g.left=i.value.offsetLeft,g.width=i.value.offsetWidth,g.height=i.value.offsetHeight,y({top:0,left:0,width:document.body.clientWidth,height:document.body.clientHeight})):y({top:g.top,left:g.left,width:g.width,height:g.height}),n("expand",{top:g.top,left:g.left,width:g.width,height:g.height})})},I=()=>{l.value=!1,u.state="",u.pressedSpot="",u.top=0,u.left=0,u.width=0,u.height=0,u.clientX=0,u.clientY=0,f.top=0,f.left=0,m.top=!1,m.left=!1,m.right=!1,m.bottom=!1,g.top=null,g.left=null,g.width=null,g.height=null,Object.keys(h).forEach(T=>{delete h[T]})};return o.watch(()=>t.visible,T=>{T||I()}),{dragStyle:h,startDrag:V,moveMouse:S,clickExpandBtn:x}},Vt=(()=>{let e=[],t=0;return{add(n){if(n!=null)return n.sequence=t++,e.push(n),n.sequence},remove(n){n!=null&&(e=e.filter(i=>i.sequence!==n.sequence))},get windows(){return e.slice()},getWindowBySequence(n){return e.find(i=>i.sequence===n)},isEmpty(){return e.length<=0},isFirstWindowOpen(){return t===1}}})(),Et=(()=>{let l=700;return{getNext(){return l>=748?748:(l+=1,l)},getNextOverLimit(){return 749},getPrevFrom(a){const r=l-a*1;return r<=700?700:r},isUpperLimitClose(){return l>=748},resetToLower(){l=700},getAllocableCount(){return Math.floor(48/1)}}})(),l0=e=>{const t=window.getComputedStyle(e).getPropertyValue("z-index").trim();return!t||isNaN(t)?700:parseInt(t)},Jo=()=>{const e=(n,i)=>n.zIndex>i.zIndex?1:n.zIndex<i.zIndex?-1:n.sequence>i.sequence?1:-1;return Array.prototype.map.call(Vt.windows,n=>({...n,zIndex:l0(n.elem)})).sort(e)},a0=({closeWin:e,windowRef:t})=>{const{props:n}=o.getCurrentInstance();let i=null,s=null;const l=()=>Vt.add({sequence:i,closeWin:e,elem:t.value,escClose:n.escClose}),a=y=>{Vt.remove(y)},r=y=>{if(Vt.isEmpty())return;const{code:C}=y;if(C!=="Escape")return;const b=Jo(),k=b[b.length-1];k.escClose&&k.closeWin()},c=()=>{i=l(),t.value.dataset.sequence=i,Vt.isFirstWindowOpen()&&document.addEventListener("keydown",r)},d=()=>{const y=Vt.getWindowBySequence(i);a(y)},h=({elem:y,zIndex:C})=>{if(n.isModal){const b=y.parentElement.getElementsByClassName("ev-window-dim-layer")[0];b.style.zIndex=C}y.style.zIndex=C},u=()=>{Vt.windows.length===1&&Et.resetToLower();const y=Et.getNext();h({elem:t.value,zIndex:y})},f=y=>String(y.sequence)===t.value.dataset.sequence,m=()=>{const y=Jo();if(Vt.windows.length>Et.getAllocableCount()){const b=y.reverse();let k=0;b.forEach(w=>{if(f(w))return;const M=Et.getPrevFrom(k++);h({elem:w.elem,zIndex:M})});const L=Et.getNextOverLimit();h({elem:t.value,zIndex:L})}else{Et.resetToLower(),y.forEach(k=>{if(f(k))return;const L=Et.getNext();h({elem:k.elem,zIndex:L})});const b=Et.getNext();h({elem:t.value,zIndex:b})}},g=()=>{Et.isUpperLimitClose()?m():u()},p=()=>{if(!t.value||!n.focusable)return;const y=Jo(),C=y[y.length-1];f(C)||g()};return o.onMounted(()=>{n.visible&&(c(),s=setTimeout(g,0))}),o.onBeforeUnmount(()=>{n.visible&&(d(),clearTimeout(s))}),o.watch(()=>n.visible,y=>{o.nextTick(()=>{y?(c(),s=setTimeout(g,0)):(d(),clearTimeout(s))})}),o.watch(()=>n.escClose,y=>{if(!n.visible)return;const C=Vt.getWindowBySequence(i);C&&(C.escClose=y)}),{setFocus:p}},r0={name:"EvWindow",props:{style:{type:Object,default(){return{}}},visible:{type:Boolean,default:!1},title:{type:[String,Number],default:null},windowClass:{type:String,default:""},iconClass:{type:String,default:""},width:{type:[String,Number],default:"50vw"},height:{type:[String,Number],default:"50vh"},minWidth:{type:[String,Number],default:150},minHeight:{type:[String,Number],default:150},fullscreen:{type:Boolean,default:!1},isModal:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!1},hideScroll:{type:Boolean,default:!0},draggable:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},maximizable:{type:Boolean,default:!1},escClose:{type:Boolean,default:!1},focusable:{type:Boolean,default:!1}},emits:["update:visible","mousedown","mousedown-mouseup","mousedown-mousemove","resize","expand"],setup(){const{windowRef:e,headerRef:t,isFullExpandWindow:n,maximizableIcon:i,baseStyle:s,closeWin:l,numberToUnit:a,removeUnit:r}=s0(),{dragStyle:c,startDrag:d,moveMouse:h,clickExpandBtn:u}=o0({windowRef:e,headerRef:t,isFullExpandWindow:n,numberToUnit:a,removeUnit:r}),{setFocus:f}=a0({closeWin:l,windowRef:e});return{windowRef:e,headerRef:t,baseStyle:s,dragStyle:c,maximizableIcon:i,closeWin:l,startDrag:d,moveMouse:h,clickExpandBtn:u,setFocus:f}}},c0={key:0,ref:"headerRef",class:"ev-window-header"},d0={key:0,class:"ev-window-icon"},h0={key:1,class:"ev-window-title"},u0={class:"ev-window-content"},f0={key:1,class:"ev-window-footer"},m0={class:"ev-window-top-right-icon"};function p0(e,t,n,i,s,l){return o.openBlock(),o.createBlock(o.Teleport,{to:"#ev-window-modal"},[o.createVNode(o.Transition,{name:"ev-window-fade",appear:""},{default:o.withCtx(()=>[n.visible?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-window-wrapper",{"scroll-lock":n.hideScroll},{"scroll-allow":!n.hideScroll&&!n.isModal}])},[n.isModal?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ev-window-dim-layer",onClick:t[0]||(t[0]=a=>i.closeWin("layer")),onWheel:o.withModifiers(()=>{},["stop","prevent"])},null,32)):o.createCommentVNode("",!0),o.createElementVNode("div",{ref:"windowRef",class:o.normalizeClass(["ev-window",n.windowClass,{fullscreen:!!n.fullscreen}]),style:o.normalizeStyle({...i.baseStyle,...i.dragStyle}),onMousedown:t[3]||(t[3]=(...a)=>i.startDrag&&i.startDrag(...a)),onMousemove:t[4]||(t[4]=(...a)=>i.moveMouse&&i.moveMouse(...a)),onClick:t[5]||(t[5]=(...a)=>i.setFocus&&i.setFocus(...a))},[e.$slots.header||n.iconClass||n.title?(o.openBlock(),o.createElementBlock("div",c0,[e.$slots.header?o.renderSlot(e.$slots,"header",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.iconClass?(o.openBlock(),o.createElementBlock("span",d0,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.title?(o.openBlock(),o.createElementBlock("p",h0,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0)],64))],512)):o.createCommentVNode("",!0),o.createElementVNode("div",u0,[o.renderSlot(e.$slots,"default")]),e.$slots.footer?(o.openBlock(),o.createElementBlock("div",f0,[o.renderSlot(e.$slots,"footer")])):o.createCommentVNode("",!0),o.createElementVNode("div",m0,[n.maximizable&&!n.fullscreen?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-window-maximizable",onClick:t[1]||(t[1]=(...a)=>i.clickExpandBtn&&i.clickExpandBtn(...a))},[o.createElementVNode("i",{class:o.normalizeClass(i.maximizableIcon)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"ev-window-close",onClick:t[2]||(t[2]=(...a)=>i.closeWin&&i.closeWin(...a))},[...t[6]||(t[6]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])])],38)],2)):o.createCommentVNode("",!0)]),_:3})])}const hi=ce(r0,[["render",p0]]);hi.install=e=>{e.component(hi.name,hi)};const g0={name:"EvLoading",props:{modelValue:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},clickOutside:{type:Boolean,default:!1},iconClass:{type:String,default:null},iconStyle:{type:Object,default:()=>{}}},emits:{"update:modelValue":[Boolean]},setup(e,{emit:t}){return{clickEventName:o.computed(()=>e.clickOutside?"click":null),closeLoading:()=>t("update:modelValue",!1)}}},b0={class:"ev-loading-spinner"},y0={class:"ev-loading-spinner"};function x0(e,t,n,i,s,l){return n.fullscreen?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"body"},[n.modelValue?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"ev-loading full-screen"},{[o.toHandlerKey(`${i.clickEventName}`)]:t[0]||(t[0]=(...a)=>i.closeLoading&&i.closeLoading(...a))}),[o.createElementVNode("div",b0,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:o.normalizeStyle(n.iconStyle)},null,6))])],16)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.modelValue?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"ev-loading"},{[o.toHandlerKey(`${i.clickEventName}`)]:t[1]||(t[1]=(...a)=>i.closeLoading&&i.closeLoading(...a))}),[o.createElementVNode("div",y0,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:o.normalizeStyle(n.iconStyle)},null,6))])],16)):o.createCommentVNode("",!0)],64))}const ui=ce(g0,[["render",x0]]);ui.install=e=>{e.component(ui.name,ui)};const S0={name:"EvProgress",props:{modelValue:{type:Number,default:0,validator:e=>e>=0&&e<=100},color:{type:[String,Array],default:"#409EFF"},strokeWidth:{type:Number,default:6},innerText:{type:String,default:""}},emits:{},setup(e){const t=o.computed(()=>({height:`${e.strokeWidth}px`})),n=o.computed(()=>{if(Array.isArray(e.color)){const i=[...e.color].sort((l,a)=>l.value-a.value);let s=i[0].color;if(!e.modelValue)return{width:`${e.modelValue}%`,"background-color":s};for(let l=0;l<i.length;l++){const a=l===0?0:i[l-1].value,r=i[l].value;if(e.modelValue>a&&e.modelValue<=r){s=i[l].color;break}}return{width:`${e.modelValue}%`,"background-color":s}}return{width:`${e.modelValue}%`,"background-color":e.color}});return{wrapperStyle:t,innerStyle:n}}},C0={class:"ev-progress"},k0={key:0,class:"ev-progress-inner-text"},w0={key:0,class:"ev-progress-label"};function I0(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",C0,[o.createElementVNode("div",{class:"ev-progress-wrapper",style:o.normalizeStyle(i.wrapperStyle)},[o.createElementVNode("div",{class:"ev-progress-inner",style:o.normalizeStyle(i.innerStyle)},[n.innerText?(o.openBlock(),o.createElementBlock("div",k0,o.toDisplayString(n.innerText),1)):o.createCommentVNode("",!0)],4)],4),e.$slots.default?(o.openBlock(),o.createElementBlock("div",w0,[o.renderSlot(e.$slots,"default")])):o.createCommentVNode("",!0)])}const fi=ce(S0,[["render",I0]]);fi.install=e=>{e.component(fi.name,fi)};const T0={name:"MenuItem",props:{selectedItem:{type:[String,Number],default:""},item:{type:Object,default:()=>{},validator:e=>{if(e.value){if(e.children!==void 0&&!Array.isArray(e.children))return console.warn("[EVUI][Menu] children attribute must be 'Array' type."),!1;if(e.expand!==void 0&&typeof e.expand!="boolean")return console.warn("[EVUI][Menu] expand attribute must be 'Boolean' type."),!1;if(e.hidden!==void 0&&typeof e.hidden!="boolean")return console.warn("[EVUI][Menu] hidden attribute must be 'Boolean' type."),!1;if(e.disabled!==void 0&&typeof e.disabled!="boolean")return console.warn("[EVUI][Menu] disabled attribute must be 'Boolean' type."),!1;if(e.slotKey!==void 0&&typeof e.slotKey!="string")return console.warn("[EVUI][Menu] slotKey attribute must be 'String' type."),!1}else return console.warn("[EVUI][Menu] value attribute is required."),!1;return!0}},depth:{type:Number,default:1},expandable:{type:Boolean,default:!0},comp:{type:Object,default:()=>{}},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=e.expandable&&e.item.expand!==void 0&&typeof e.item.expand=="boolean"?e.item.expand:!0,i=o.ref(n),s=o.computed(()=>!!e.item.children&&!!e.item.children.length);return{isExpand:i,hasChild:s,clickMenu:a=>{s.value&&a.depth===e.depth?e.expandable&&(i.value=!i.value):t("click",a)}}}},L0={class:"text"};function M0(e,t,n,i,s,l){return n.item.hidden?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(["ev-menu-item",`depth${n.depth}`,{active:!n.item.disabled&&n.item.value===n.selectedItem}])},[o.createElementVNode("div",{class:o.normalizeClass(["ev-menu-title",{expandable:i.hasChild&&n.expandable,disabled:n.item.disabled}]),onClick:t[0]||(t[0]=a=>i.clickMenu({item:n.item,depth:n.depth,disabled:n.item.disabled}))},[n.item.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["front-icon",n.item.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",L0,[n.item.slotKey?o.renderSlot(e.$slots,n.item.slotKey,{key:0,item:n.item,depth:n.depth,selectedItem:n.selectedItem},()=>[o.createTextVNode(o.toDisplayString(n.item.text||n.item.value),1)]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.item.text||n.item.value),1)],64))]),n.expandable&&i.hasChild?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["list-expend-icon",{expend:n.expandable&&i.isExpand}])},[...t[1]||(t[1]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-up"},null,-1)])],2)):o.createCommentVNode("",!0)],2),i.hasChild?o.withDirectives((o.openBlock(),o.createElementBlock("ol",{key:0,class:o.normalizeClass(["ev-menu-sub",`depth${n.depth}`])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.item.children,(a,r)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:`${a.value}_${r}_${n.depth+1}`,depth:n.depth+1,item:a,"selected-item":n.selectedItem,expandable:n.expandable,disabled:n.disabled,comp:n.comp,onClick:i.clickMenu},null,8,["depth","item","selected-item","expandable","disabled","comp","onClick"]))),128))],2)),[[o.vShow,i.isExpand]]):o.createCommentVNode("",!0)],2))}const Ur=ce(T0,[["render",M0]]),v0={name:"EvMenu",components:{MenuItem:Ur},props:{modelValue:{type:[String,Number],default:""},items:{type:Array,default:()=>[]},expandable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=o.ref(e.items.filter(l=>e.modelValue===l.value));return{clickMenu:l=>{if(!l.disabled){const a=l.item;t("update:modelValue",a.value),t("change",a,n.value),n.value=a}},component:Ur}}},R0={class:"ev-menu"};function V0(e,t,n,i,s,l){const a=o.resolveComponent("menu-item");return o.openBlock(),o.createElementBlock("ul",R0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.items,(r,c)=>(o.openBlock(),o.createBlock(a,{key:`${r.text}_${c}_0`,item:r,"selected-item":n.modelValue,expandable:n.expandable,disabled:n.disabled,comp:i.component,onClick:i.clickMenu},o.createSlots({_:2},[o.renderList(e.$slots,(d,h)=>({name:h,fn:o.withCtx(u=>[o.renderSlot(e.$slots,h,o.mergeProps({ref_for:!0},u))])}))]),1032,["item","selected-item","expandable","disabled","comp","onClick"]))),128))])}const mi=ce(v0,[["render",V0]]);mi.install=e=>{e.component(mi.name,mi)};const E0={name:"TreeNode",props:{data:{type:Object,require:!0,default:()=>({})},useCheckbox:{type:Boolean,default:!1},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},comp:{type:Object,default:()=>{}}},emits:{"update-checked-info":null,"click-node":null,"dblclick-node":null,"show-context-menu":null},setup(e,{emit:t}){const n=o.reactive(e.data),i=o.computed(()=>e.data.children&&e.data.children.length),s=o.computed(()=>{const p=e.expandIcon?e.expandIcon:"ev-icon-s-play",y=e.expandIcon?e.collapseIcon:"ev-icon-s-play";return e.data.expand?y:p}),l=o.computed(()=>e.data.children);function a(p,y){t("update-checked-info",{nodeKey:y,isChecked:p})}function r({nodeKey:p,isChecked:y}){t("update-checked-info",{nodeKey:p,isChecked:y})}function c(){n.expand=!n.expand}function d(){n.disabled||(n.selected=!n.selected,t("click-node",n.nodeKey))}function h(p){t("click-node",p)}function u(){n.disabled||t("dblclick-node",n.nodeKey)}function f(p){t("dblclick-node",p)}function m(p){t("show-context-menu",!0,p)}return{expandIconClasses:s,showExpandIcon:i,treeData:n,childrenInfo:l,handleCheck:a,emitCheckedInfo:r,handleExpand:c,clickTreeContent:d,emitClickedContent:h,dblClickTreeContent:u,emitDblClickedContent:f,handleContextmenu:m,emitContextMenuFlag:(p,y)=>{t("show-context-menu",p,y)}}}},W0={class:"ev-tree-children"},G0={class:"ev-tree-node"};function Z0(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-checkbox");return o.withDirectives((o.openBlock(),o.createElementBlock("ul",W0,[o.createElementVNode("li",null,[o.createElementVNode("span",{class:o.normalizeClass([{expand:i.treeData.expand},"ev-tree-toggle"])},[i.showExpandIcon?(o.openBlock(),o.createBlock(a,{key:0,icon:i.expandIconClasses,onClick:i.handleExpand},null,8,["icon","onClick"])):o.createCommentVNode("",!0)],2),o.createElementVNode("div",G0,[n.useCheckbox?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.treeData.checked,"onUpdate:modelValue":t[0]||(t[0]=c=>i.treeData.checked=c),indeterminate:i.treeData.indeterminate,disabled:i.treeData.disabled,onChange:t[1]||(t[1]=c=>i.handleCheck(i.treeData.checked,i.treeData.nodeKey))},null,8,["modelValue","indeterminate","disabled"])):o.createCommentVNode("",!0),i.treeData.iconClass?(o.openBlock(),o.createBlock(a,{key:1,icon:i.treeData.iconClass,class:"ev-tree-icon"},null,8,["icon"])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:o.normalizeClass([{"ev-tree-title-selected":i.treeData.selected,"ev-tree-title-disabled":i.treeData.disabled},"ev-tree-title"]),onContextmenu:t[2]||(t[2]=(...c)=>i.handleContextmenu&&i.handleContextmenu(...c)),onClick:t[3]||(t[3]=(...c)=>i.clickTreeContent&&i.clickTreeContent(...c)),onDblclick:t[4]||(t[4]=(...c)=>i.dblClickTreeContent&&i.dblClickTreeContent(...c))},o.toDisplayString(i.treeData.title),35)]),o.createVNode(o.TransitionGroup,{name:"fade"},{default:o.withCtx(()=>[i.treeData.expand?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.childrenInfo,(c,d)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:`${c.value}-${d}`,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:n.comp,onUpdateCheckedInfo:i.emitCheckedInfo,onClickNode:i.emitClickedContent,onDblclickNode:i.emitDblClickedContent,onShowContextMenu:i.emitContextMenuFlag},null,40,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu"]))),128)):o.createCommentVNode("",!0)]),_:1})])],512)),[[o.vShow,i.treeData.visible]])}const Jr=ce(E0,[["render",Z0]]),X0={name:"EvTree",components:{TreeNode:Jr},props:{data:{type:Array,default:()=>[]},useCheckbox:{type:Boolean,default:!1},emptyText:{type:String,default:"No Data"},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},contextMenuItems:{type:Array,default:()=>[]},searchWord:{type:String,default:""},searchIncludeChildren:{type:Boolean,default:!1}},emits:{"click-node":null,"dblclick-node":null,check:Array},setup(e,{emit:t}){const n=o.ref(e.data);let i=[];const s=o.ref(null);let l=!1;const a=Jr;function r(S){const x=i[S].parent;if(typeof x>"u")return;const I=i[S].node,T=i[x].node;if(!(I.checked===T.checked&&I.indeterminate===T.indeterminate)){if(I.checked)T.checked=T.children.every(v=>v.checked),T.indeterminate=!T.checked;else{const v=E=>E.checked||I.indeterminate;T.checked=!1,T.indeterminate=T.children.some(v)}r(x)}}function c(S,x={}){const I=Object.keys(x);for(let T=0;T<I.length;T++)S[I[T]]=x[I[T]];S.children&&S.children.forEach(T=>{c(T,x)})}function d(){let S=0;const x=[],I=[];function T(v,E){const Z=v;Z.nodeKey=S++,Object.hasOwnProperty.call(Z,"selected")||(Z.selected=!1),Object.hasOwnProperty.call(Z,"visible")||(Z.visible=!0),"value"in Z&&I.includes(Z.value)?(console.warn("[EVUI][Tree] The 'value' of data should be unique."),Z.value+=Z.nodeKey):"value"in Z||(Z.value=Z.title+Z.nodeKey),I.push(Z.value),x[Z.nodeKey]={node:Z,nodeKey:Z.nodeKey},typeof E<"u"&&(x[Z.nodeKey].parent=E.nodeKey,x[E.nodeKey].children.push(Z.nodeKey)),Z.children&&(x[Z.nodeKey].children=[],Z.children.forEach(W=>T(W,Z)))}return n.value.length&&T(n.value[0]),x}i=d();function h(){return i.filter(S=>S.node.checked).map(S=>S.node)}function u(){h().forEach(x=>{c(x,{checked:!0});const I=i[x.nodeKey].parent;if(!I&&I!==0)return;const T=i[I].node;typeof x.checked<"u"&&x.checked&&T.checked!==x.checked&&r(x.nodeKey)})}function f({nodeKey:S,isChecked:x}){const I=i[S].node;I.checked=x,I.indeterminate=!1,r(S),c(I,{checked:x,indeterminate:!1});const T=h();t("check",T),u()}function m(S){const x=i[S].node;for(let I=0;I<i.length;I++)i[I].node.nodeKey!==S&&(i[I].node.selected=!1);t("click-node",{title:x.title,value:x.value})}function g(S){const x=i[S].node;t("dblclick-node",{title:x.title,value:x.value})}const p=S=>{e.contextMenuItems.length&&l&&(s.value.show(S),l=!1)},y=(S,x)=>{l=S,p(x)},C=(S,x)=>S.toLowerCase().includes(x.toLowerCase()),b=S=>{var x;if(S.children){const I=!!((x=S.children.filter(T=>C(T.title,e.searchWord)))!=null&&x.length);S.children.forEach(T=>{b(T),T.visible=I&&C(T.title,e.searchWord)||!I})}};function k(S){S.children&&S.children.forEach(x=>{x.visible=!1,k(x)})}function L(S){if(!S&&S!==0)return;const x=i[S];x.node.visible=!0,x.parent!==void 0&&L(x.parent)}function w(S){i.forEach(I=>{const T=I.node;T.visible=!1}),i.filter(I=>C(I.node.title,S)).forEach(I=>{const T=I.node;T.visible=!0,e.searchIncludeChildren?b(T):k(T);const v=i[T.nodeKey].parent;L(v)})}const M=o.computed(()=>!n.value.length||n.value.every(S=>!S.visible));o.watch(()=>e.data,S=>{n.value=S,i=d()},{deep:!0});let V;return o.watch(()=>e.searchWord,S=>{V&&clearTimeout(V),V=setTimeout(()=>{S?w(S):i.forEach(x=>{const I=x.node;I.visible=!0})},200)}),o.onMounted(()=>{u();const S=h();S.length&&t("check",S)}),o.onBeforeUnmount(()=>{V&&clearTimeout(V)}),{treeNodeData:n,contextMenu:s,component:a,isShowEmptyText:M,updateCheckedInfo:f,clickContent:m,dblClickContent:g,showContextMenu:p,getContextMenuFlag:y}}},N0={class:"ev-tree-view"},P0={key:0};function D0(e,t,n,i,s,l){const a=o.resolveComponent("tree-node"),r=o.resolveComponent("ev-context-menu");return o.openBlock(),o.createElementBlock("div",N0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.treeNodeData,(c,d)=>(o.openBlock(),o.createBlock(a,{key:d,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:i.component,onUpdateCheckedInfo:i.updateCheckedInfo,onClickNode:i.clickContent,onDblclickNode:i.dblClickContent,onShowContextMenu:i.getContextMenuFlag,onContextmenu:o.withModifiers(i.showContextMenu,["prevent"])},null,8,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu","onContextmenu"]))),128)),i.isShowEmptyText?(o.openBlock(),o.createElementBlock("div",P0,o.toDisplayString(n.emptyText),1)):o.createCommentVNode("",!0),n.contextMenuItems.length?(o.openBlock(),o.createBlock(r,{key:1,ref:"contextMenu",items:n.contextMenuItems},null,8,["items"])):o.createCommentVNode("",!0)])}const pi=ce(X0,[["render",D0]]);pi.install=e=>{e.component(pi.name,pi)};const B0={name:"EvTimePicker",props:{modelValue:{type:[Array,String],default:"",validator:e=>{const t=/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;return Array.isArray(e)&&(!t.test(e[0])||!t.test(e[1]))||!Array.isArray(e)&&!t.test(e)?(console.warn("[EVUI][TimePicker] Please check the time format in the Timepicker."),!1):!0}},type:{type:String,default:"range"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},placeholder:{type:[String,Array],required:!1,default:void 0}},emits:{"update:modelValue":null,focus:null,blur:null,change:null},setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:w=>{if(e.type==="range"){if(Array.isArray(w)){const M=w[0]>w[1]?"00:00":w[0],V=M.value>w[1]?"23:59":w[1];t("update:modelValue",[M,V])}}else t("update:modelValue",w)}}),i=o.computed(()=>{const w=["start time","end time"];return Array.isArray(e.placeholder)?[typeof e.placeholder[0]=="string"?e.placeholder[0]:w[0],typeof e.placeholder[1]=="string"?e.placeholder[1]:w[1]]:typeof e.placeholder=="string"?[e.placeholder,e.placeholder]:w}),s=o.ref(Array.isArray(n.value)?[`${n.value[0]}`,`${n.value[1]}`]:`${n.value}`),l=o.reactive({single:!1,rangeStart:!1,rangeEnd:!1}),a=w=>/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(w),r=()=>{Array.isArray(n.value)&&(a(n.value[0])||(n.value[0]=s.value[0]),n.value[1]&&n.value[0]>n.value[1]&&(n.value[0]=n.value[1]),s.value[0]=n.value[0])},c=()=>{Array.isArray(n.value)&&(a(n.value[1])||(n.value[1]=s.value[1]),n.value[0]&&n.value[0]>n.value[1]&&(n.value[1]=s.value[1],n.value[0]>s.value[1]&&(n.value[1]=n.value[0])),s.value[1]=n.value[1])};return{time:n,isWrongType:l,previousValue:s,clearContents:()=>{n.value="",l.single=!0},clearStartTime:()=>{n.value[0]="",l.rangeStart=!0},clearEndTime:()=>{n.value[1]="",l.rangeEnd=!0},focusInputTime:w=>{t("focus",w)},blurInputTime:w=>{t("blur",w)},changeTime:w=>{a(n.value)?s.value=n.value:n.value=s.value,l.single=!a(n.value),t("change",w,n.value)},focusInputStartTime:w=>{t("focus",w)},blurInputStartTime:w=>{t("blur",w)},changeStartTime:w=>{r(),l.rangeStart=!1,t("change",w,n.value)},focusInputEndTime:w=>{t("focus",w)},blurInputEndTime:w=>{t("blur",w)},changeEndTime:w=>{c(),l.rangeEnd=!1,t("change",w,n.value)},placeholders:i}}},O0={class:"ev-time-picker"},Y0={key:0,class:"ev-time-picker-range"},F0=["disabled","readonly","placeholder"],z0=["disabled","readonly","placeholder"],H0={key:1,class:"ev-time-picker-single"},A0=["disabled","readonly","placeholder"];function _0(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",O0,[n.type==="range"?(o.openBlock(),o.createElementBlock("div",Y0,[o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.rangeStart,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=r=>i.time[0]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:i.placeholders[0],onFocus:t[1]||(t[1]=(...r)=>i.focusInputStartTime&&i.focusInputStartTime(...r)),onBlur:t[2]||(t[2]=(...r)=>i.blurInputStartTime&&i.blurInputStartTime(...r)),onChange:t[3]||(t[3]=(...r)=>i.changeStartTime&&i.changeStartTime(...r))},null,40,F0),[[o.vModelText,i.time[0]]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearStartTime},null,8,["onClick"])):o.createCommentVNode("",!0)],2),t[12]||(t[12]=o.createElementVNode("p",{class:"tilde"},"~",-1)),o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.rangeEnd,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>i.time[1]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:i.placeholders[1],onFocus:t[5]||(t[5]=(...r)=>i.focusInputEndTime&&i.focusInputEndTime(...r)),onBlur:t[6]||(t[6]=(...r)=>i.blurInputEndTime&&i.blurInputEndTime(...r)),onChange:t[7]||(t[7]=(...r)=>i.changeEndTime&&i.changeEndTime(...r))},null,40,z0),[[o.vModelText,i.time[1]]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearEndTime},null,8,["onClick"])):o.createCommentVNode("",!0)],2)])):(o.openBlock(),o.createElementBlock("div",H0,[o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.single,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[8]||(t[8]=r=>i.time=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:typeof n.placeholder=="string"?n.placeholder:"Enter time",onFocus:t[9]||(t[9]=(...r)=>i.focusInputTime&&i.focusInputTime(...r)),onBlur:t[10]||(t[10]=(...r)=>i.blurInputTime&&i.blurInputTime(...r)),onChange:t[11]||(t[11]=(...r)=>i.changeTime&&i.changeTime(...r))},null,40,A0),[[o.vModelText,i.time]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearContents},null,8,["onClick"])):o.createCommentVNode("",!0)],2)]))])}const gi=ce(B0,[["render",_0]]);gi.install=e=>{e.component(gi.name,gi)};const K0={name:"EvGridToolbar"},U0={class:"gridToolbar"};function J0(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",U0,[o.renderSlot(e.$slots,"toolbarWrapper")])}const j0=ce(K0,[["render",J0]]),Q0={name:"EvGridPagination",props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:e=>["left","right","center"].includes(e)}},emits:{"update:modelValue":null},setup(e,{emit:t}){const n=o.ref(e.modelValue),i=s=>{n.value=s>0?s:1,t("update:modelValue",n.value)};return o.watch(()=>e.modelValue,s=>{n.value=s}),{currentValue:n,changePage:i}}},$0={class:"grid-pagination"};function q0(e,t,n,i,s,l){const a=o.resolveComponent("ev-pagination");return o.openBlock(),o.createElementBlock("div",$0,[o.createVNode(a,{modelValue:i.currentValue,"onUpdate:modelValue":t[0]||(t[0]=r=>i.currentValue=r),total:n.total,"per-page":n.perPage,"visible-page":n.visiblePage,"show-page-info":n.showPageInfo,order:n.order,onChange:i.changePage},null,8,["modelValue","total","per-page","visible-page","show-page-info","order","onChange"])])}const jr=ce(Q0,[["render",q0],["__scopeId","data-v-2e265290"]]);var eS=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,jo=Math.ceil,ot=Math.floor,Qe="[BigNumber Error] ",Qr=Qe+"Number primitive has more than 15 significant digits: ",bt=1e14,de=14,Qo=9007199254740991,$o=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],At=1e7,De=1e9;function $r(e){var t,n,i,s=b.prototype={constructor:b,toString:null,valueOf:null},l=new b(1),a=20,r=4,c=-7,d=21,h=-1e7,u=1e7,f=!1,m=1,g=0,p={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},y="0123456789abcdefghijklmnopqrstuvwxyz",C=!0;function b(S,x){var I,T,v,E,Z,W,R,X,G=this;if(!(G instanceof b))return new b(S,x);if(x==null){if(S&&S._isBigNumber===!0){G.s=S.s,!S.c||S.e>u?G.c=G.e=null:S.e<h?G.c=[G.e=0]:(G.e=S.e,G.c=S.c.slice());return}if((W=typeof S=="number")&&S*0==0){if(G.s=1/S<0?(S=-S,-1):1,S===~~S){for(E=0,Z=S;Z>=10;Z/=10,E++);E>u?G.c=G.e=null:(G.e=E,G.c=[S]);return}X=String(S)}else{if(!eS.test(X=String(S)))return i(G,X,W);G.s=X.charCodeAt(0)==45?(X=X.slice(1),-1):1}(E=X.indexOf("."))>-1&&(X=X.replace(".","")),(Z=X.search(/e/i))>0?(E<0&&(E=Z),E+=+X.slice(Z+1),X=X.substring(0,Z)):E<0&&(E=X.length)}else{if(Ie(x,2,y.length,"Base"),x==10&&C)return G=new b(S),M(G,a+G.e+1,r);if(X=String(S),W=typeof S=="number"){if(S*0!=0)return i(G,X,W,x);if(G.s=1/S<0?(X=X.slice(1),-1):1,b.DEBUG&&X.replace(/^0\.0*|\./,"").length>15)throw Error(Qr+S)}else G.s=X.charCodeAt(0)===45?(X=X.slice(1),-1):1;for(I=y.slice(0,x),E=Z=0,R=X.length;Z<R;Z++)if(I.indexOf(T=X.charAt(Z))<0){if(T=="."){if(Z>E){E=R;continue}}else if(!v&&(X==X.toUpperCase()&&(X=X.toLowerCase())||X==X.toLowerCase()&&(X=X.toUpperCase()))){v=!0,Z=-1,E=0;continue}return i(G,String(S),W,x)}W=!1,X=n(X,x,10,G.s),(E=X.indexOf("."))>-1?X=X.replace(".",""):E=X.length}for(Z=0;X.charCodeAt(Z)===48;Z++);for(R=X.length;X.charCodeAt(--R)===48;);if(X=X.slice(Z,++R)){if(R-=Z,W&&b.DEBUG&&R>15&&(S>Qo||S!==ot(S)))throw Error(Qr+G.s*S);if((E=E-Z-1)>u)G.c=G.e=null;else if(E<h)G.c=[G.e=0];else{if(G.e=E,G.c=[],Z=(E+1)%de,E<0&&(Z+=de),Z<R){for(Z&&G.c.push(+X.slice(0,Z)),R-=de;Z<R;)G.c.push(+X.slice(Z,Z+=de));Z=de-(X=X.slice(Z)).length}else Z-=R;for(;Z--;X+="0");G.c.push(+X)}}else G.c=[G.e=0]}b.clone=$r,b.ROUND_UP=0,b.ROUND_DOWN=1,b.ROUND_CEIL=2,b.ROUND_FLOOR=3,b.ROUND_HALF_UP=4,b.ROUND_HALF_DOWN=5,b.ROUND_HALF_EVEN=6,b.ROUND_HALF_CEIL=7,b.ROUND_HALF_FLOOR=8,b.EUCLID=9,b.config=b.set=function(S){var x,I;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(x="DECIMAL_PLACES")&&(I=S[x],Ie(I,0,De,x),a=I),S.hasOwnProperty(x="ROUNDING_MODE")&&(I=S[x],Ie(I,0,8,x),r=I),S.hasOwnProperty(x="EXPONENTIAL_AT")&&(I=S[x],I&&I.pop?(Ie(I[0],-De,0,x),Ie(I[1],0,De,x),c=I[0],d=I[1]):(Ie(I,-De,De,x),c=-(d=I<0?-I:I))),S.hasOwnProperty(x="RANGE"))if(I=S[x],I&&I.pop)Ie(I[0],-De,-1,x),Ie(I[1],1,De,x),h=I[0],u=I[1];else if(Ie(I,-De,De,x),I)h=-(u=I<0?-I:I);else throw Error(Qe+x+" cannot be zero: "+I);if(S.hasOwnProperty(x="CRYPTO"))if(I=S[x],I===!!I)if(I)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=I;else throw f=!I,Error(Qe+"crypto unavailable");else f=I;else throw Error(Qe+x+" not true or false: "+I);if(S.hasOwnProperty(x="MODULO_MODE")&&(I=S[x],Ie(I,0,9,x),m=I),S.hasOwnProperty(x="POW_PRECISION")&&(I=S[x],Ie(I,0,De,x),g=I),S.hasOwnProperty(x="FORMAT"))if(I=S[x],typeof I=="object")p=I;else throw Error(Qe+x+" not an object: "+I);if(S.hasOwnProperty(x="ALPHABET"))if(I=S[x],typeof I=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(I))C=I.slice(0,10)=="0123456789",y=I;else throw Error(Qe+x+" invalid: "+I)}else throw Error(Qe+"Object expected: "+S);return{DECIMAL_PLACES:a,ROUNDING_MODE:r,EXPONENTIAL_AT:[c,d],RANGE:[h,u],CRYPTO:f,MODULO_MODE:m,POW_PRECISION:g,FORMAT:p,ALPHABET:y}},b.isBigNumber=function(S){if(!S||S._isBigNumber!==!0)return!1;if(!b.DEBUG)return!0;var x,I,T=S.c,v=S.e,E=S.s;e:if({}.toString.call(T)=="[object Array]"){if((E===1||E===-1)&&v>=-De&&v<=De&&v===ot(v)){if(T[0]===0){if(v===0&&T.length===1)return!0;break e}if(x=(v+1)%de,x<1&&(x+=de),String(T[0]).length==x){for(x=0;x<T.length;x++)if(I=T[x],I<0||I>=bt||I!==ot(I))break e;if(I!==0)return!0}}}else if(T===null&&v===null&&(E===null||E===1||E===-1))return!0;throw Error(Qe+"Invalid BigNumber: "+S)},b.maximum=b.max=function(){return L(arguments,-1)},b.minimum=b.min=function(){return L(arguments,1)},b.random=function(){var S=9007199254740992,x=Math.random()*S&2097151?function(){return ot(Math.random()*S)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(I){var T,v,E,Z,W,R=0,X=[],G=new b(l);if(I==null?I=a:Ie(I,0,De),Z=jo(I/de),f)if(crypto.getRandomValues){for(T=crypto.getRandomValues(new Uint32Array(Z*=2));R<Z;)W=T[R]*131072+(T[R+1]>>>11),W>=9e15?(v=crypto.getRandomValues(new Uint32Array(2)),T[R]=v[0],T[R+1]=v[1]):(X.push(W%1e14),R+=2);R=Z/2}else if(crypto.randomBytes){for(T=crypto.randomBytes(Z*=7);R<Z;)W=(T[R]&31)*281474976710656+T[R+1]*1099511627776+T[R+2]*4294967296+T[R+3]*16777216+(T[R+4]<<16)+(T[R+5]<<8)+T[R+6],W>=9e15?crypto.randomBytes(7).copy(T,R):(X.push(W%1e14),R+=7);R=Z/7}else throw f=!1,Error(Qe+"crypto unavailable");if(!f)for(;R<Z;)W=x(),W<9e15&&(X[R++]=W%1e14);for(Z=X[--R],I%=de,Z&&I&&(W=$o[de-I],X[R]=ot(Z/W)*W);X[R]===0;X.pop(),R--);if(R<0)X=[E=0];else{for(E=-1;X[0]===0;X.splice(0,1),E-=de);for(R=1,W=X[0];W>=10;W/=10,R++);R<de&&(E-=de-R)}return G.e=E,G.c=X,G}}(),b.sum=function(){for(var S=1,x=arguments,I=new b(x[0]);S<x.length;)I=I.plus(x[S++]);return I},n=function(){var S="0123456789";function x(I,T,v,E){for(var Z,W=[0],R,X=0,G=I.length;X<G;){for(R=W.length;R--;W[R]*=T);for(W[0]+=E.indexOf(I.charAt(X++)),Z=0;Z<W.length;Z++)W[Z]>v-1&&(W[Z+1]==null&&(W[Z+1]=0),W[Z+1]+=W[Z]/v|0,W[Z]%=v)}return W.reverse()}return function(I,T,v,E,Z){var W,R,X,G,N,P,B,z,D=I.indexOf("."),Y=a,F=r;for(D>=0&&(G=g,g=0,I=I.replace(".",""),z=new b(T),P=z.pow(I.length-D),g=G,z.c=x(Wt(at(P.c),P.e,"0"),10,v,S),z.e=z.c.length),B=x(I,T,v,Z?(W=y,S):(W=S,y)),X=G=B.length;B[--G]==0;B.pop());if(!B[0])return W.charAt(0);if(D<0?--X:(P.c=B,P.e=X,P.s=E,P=t(P,z,Y,F,v),B=P.c,N=P.r,X=P.e),R=X+Y+1,D=B[R],G=v/2,N=N||R<0||B[R+1]!=null,N=F<4?(D!=null||N)&&(F==0||F==(P.s<0?3:2)):D>G||D==G&&(F==4||N||F==6&&B[R-1]&1||F==(P.s<0?8:7)),R<1||!B[0])I=N?Wt(W.charAt(1),-Y,W.charAt(0)):W.charAt(0);else{if(B.length=R,N)for(--v;++B[--R]>v;)B[R]=0,R||(++X,B=[1].concat(B));for(G=B.length;!B[--G];);for(D=0,I="";D<=G;I+=W.charAt(B[D++]));I=Wt(I,X,W.charAt(0))}return I}}(),t=function(){function S(T,v,E){var Z,W,R,X,G=0,N=T.length,P=v%At,B=v/At|0;for(T=T.slice();N--;)R=T[N]%At,X=T[N]/At|0,Z=B*R+X*P,W=P*R+Z%At*At+G,G=(W/E|0)+(Z/At|0)+B*X,T[N]=W%E;return G&&(T=[G].concat(T)),T}function x(T,v,E,Z){var W,R;if(E!=Z)R=E>Z?1:-1;else for(W=R=0;W<E;W++)if(T[W]!=v[W]){R=T[W]>v[W]?1:-1;break}return R}function I(T,v,E,Z){for(var W=0;E--;)T[E]-=W,W=T[E]<v[E]?1:0,T[E]=W*Z+T[E]-v[E];for(;!T[0]&&T.length>1;T.splice(0,1));}return function(T,v,E,Z,W){var R,X,G,N,P,B,z,D,Y,F,O,H,j,U,Q,J,ne,q=T.s==v.s?1:-1,ee=T.c,$=v.c;if(!ee||!ee[0]||!$||!$[0])return new b(!T.s||!v.s||(ee?$&&ee[0]==$[0]:!$)?NaN:ee&&ee[0]==0||!$?q*0:q/0);for(D=new b(q),Y=D.c=[],X=T.e-v.e,q=E+X+1,W||(W=bt,X=lt(T.e/de)-lt(v.e/de),q=q/de|0),G=0;$[G]==(ee[G]||0);G++);if($[G]>(ee[G]||0)&&X--,q<0)Y.push(1),N=!0;else{for(U=ee.length,J=$.length,G=0,q+=2,P=ot(W/($[0]+1)),P>1&&($=S($,P,W),ee=S(ee,P,W),J=$.length,U=ee.length),j=J,F=ee.slice(0,J),O=F.length;O<J;F[O++]=0);ne=$.slice(),ne=[0].concat(ne),Q=$[0],$[1]>=W/2&&Q++;do{if(P=0,R=x($,F,J,O),R<0){if(H=F[0],J!=O&&(H=H*W+(F[1]||0)),P=ot(H/Q),P>1)for(P>=W&&(P=W-1),B=S($,P,W),z=B.length,O=F.length;x(B,F,z,O)==1;)P--,I(B,J<z?ne:$,z,W),z=B.length,R=1;else P==0&&(R=P=1),B=$.slice(),z=B.length;if(z<O&&(B=[0].concat(B)),I(F,B,O,W),O=F.length,R==-1)for(;x($,F,J,O)<1;)P++,I(F,J<O?ne:$,O,W),O=F.length}else R===0&&(P++,F=[0]);Y[G++]=P,F[0]?F[O++]=ee[j]||0:(F=[ee[j]],O=1)}while((j++<U||F[0]!=null)&&q--);N=F[0]!=null,Y[0]||Y.splice(0,1)}if(W==bt){for(G=1,q=Y[0];q>=10;q/=10,G++);M(D,E+(D.e=G+X*de-1)+1,Z,N)}else D.e=X,D.r=+N;return D}}();function k(S,x,I,T){var v,E,Z,W,R;if(I==null?I=r:Ie(I,0,8),!S.c)return S.toString();if(v=S.c[0],Z=S.e,x==null)R=at(S.c),R=T==1||T==2&&(Z<=c||Z>=d)?Ss(R,Z):Wt(R,Z,"0");else if(S=M(new b(S),x,I),E=S.e,R=at(S.c),W=R.length,T==1||T==2&&(x<=E||E<=c)){for(;W<x;R+="0",W++);R=Ss(R,E)}else if(x-=Z+(T===2&&E>Z),R=Wt(R,E,"0"),E+1>W){if(--x>0)for(R+=".";x--;R+="0");}else if(x+=E-W,x>0)for(E+1==W&&(R+=".");x--;R+="0");return S.s<0&&v?"-"+R:R}function L(S,x){for(var I,T,v=1,E=new b(S[0]);v<S.length;v++)T=new b(S[v]),(!T.s||(I=rn(E,T))===x||I===0&&E.s===x)&&(E=T);return E}function w(S,x,I){for(var T=1,v=x.length;!x[--v];x.pop());for(v=x[0];v>=10;v/=10,T++);return(I=T+I*de-1)>u?S.c=S.e=null:I<h?S.c=[S.e=0]:(S.e=I,S.c=x),S}i=function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,I=/^\.([^.]+)$/,T=/^-?(Infinity|NaN)$/,v=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(E,Z,W,R){var X,G=W?Z:Z.replace(v,"");if(T.test(G))E.s=isNaN(G)?null:G<0?-1:1;else{if(!W&&(G=G.replace(S,function(N,P,B){return X=(B=B.toLowerCase())=="x"?16:B=="b"?2:8,!R||R==X?P:N}),R&&(X=R,G=G.replace(x,"$1").replace(I,"0.$1")),Z!=G))return new b(G,X);if(b.DEBUG)throw Error(Qe+"Not a"+(R?" base "+R:"")+" number: "+Z);E.s=null}E.c=E.e=null}}();function M(S,x,I,T){var v,E,Z,W,R,X,G,N=S.c,P=$o;if(N){e:{for(v=1,W=N[0];W>=10;W/=10,v++);if(E=x-v,E<0)E+=de,Z=x,R=N[X=0],G=ot(R/P[v-Z-1]%10);else if(X=jo((E+1)/de),X>=N.length)if(T){for(;N.length<=X;N.push(0));R=G=0,v=1,E%=de,Z=E-de+1}else break e;else{for(R=W=N[X],v=1;W>=10;W/=10,v++);E%=de,Z=E-de+v,G=Z<0?0:ot(R/P[v-Z-1]%10)}if(T=T||x<0||N[X+1]!=null||(Z<0?R:R%P[v-Z-1]),T=I<4?(G||T)&&(I==0||I==(S.s<0?3:2)):G>5||G==5&&(I==4||T||I==6&&(E>0?Z>0?R/P[v-Z]:0:N[X-1])%10&1||I==(S.s<0?8:7)),x<1||!N[0])return N.length=0,T?(x-=S.e+1,N[0]=P[(de-x%de)%de],S.e=-x||0):N[0]=S.e=0,S;if(E==0?(N.length=X,W=1,X--):(N.length=X+1,W=P[de-E],N[X]=Z>0?ot(R/P[v-Z]%P[Z])*W:0),T)for(;;)if(X==0){for(E=1,Z=N[0];Z>=10;Z/=10,E++);for(Z=N[0]+=W,W=1;Z>=10;Z/=10,W++);E!=W&&(S.e++,N[0]==bt&&(N[0]=1));break}else{if(N[X]+=W,N[X]!=bt)break;N[X--]=0,W=1}for(E=N.length;N[--E]===0;N.pop());}S.e>u?S.c=S.e=null:S.e<h&&(S.c=[S.e=0])}return S}function V(S){var x,I=S.e;return I===null?S.toString():(x=at(S.c),x=I<=c||I>=d?Ss(x,I):Wt(x,I,"0"),S.s<0?"-"+x:x)}return s.absoluteValue=s.abs=function(){var S=new b(this);return S.s<0&&(S.s=1),S},s.comparedTo=function(S,x){return rn(this,new b(S,x))},s.decimalPlaces=s.dp=function(S,x){var I,T,v,E=this;if(S!=null)return Ie(S,0,De),x==null?x=r:Ie(x,0,8),M(new b(E),S+E.e+1,x);if(!(I=E.c))return null;if(T=((v=I.length-1)-lt(this.e/de))*de,v=I[v])for(;v%10==0;v/=10,T--);return T<0&&(T=0),T},s.dividedBy=s.div=function(S,x){return t(this,new b(S,x),a,r)},s.dividedToIntegerBy=s.idiv=function(S,x){return t(this,new b(S,x),0,1)},s.exponentiatedBy=s.pow=function(S,x){var I,T,v,E,Z,W,R,X,G,N=this;if(S=new b(S),S.c&&!S.isInteger())throw Error(Qe+"Exponent not an integer: "+V(S));if(x!=null&&(x=new b(x)),W=S.e>14,!N.c||!N.c[0]||N.c[0]==1&&!N.e&&N.c.length==1||!S.c||!S.c[0])return G=new b(Math.pow(+V(N),W?S.s*(2-xs(S)):+V(S))),x?G.mod(x):G;if(R=S.s<0,x){if(x.c?!x.c[0]:!x.s)return new b(NaN);T=!R&&N.isInteger()&&x.isInteger(),T&&(N=N.mod(x))}else{if(S.e>9&&(N.e>0||N.e<-1||(N.e==0?N.c[0]>1||W&&N.c[1]>=24e7:N.c[0]<8e13||W&&N.c[0]<=9999975e7)))return E=N.s<0&&xs(S)?-0:0,N.e>-1&&(E=1/E),new b(R?1/E:E);g&&(E=jo(g/de+2))}for(W?(I=new b(.5),R&&(S.s=1),X=xs(S)):(v=Math.abs(+V(S)),X=v%2),G=new b(l);;){if(X){if(G=G.times(N),!G.c)break;E?G.c.length>E&&(G.c.length=E):T&&(G=G.mod(x))}if(v){if(v=ot(v/2),v===0)break;X=v%2}else if(S=S.times(I),M(S,S.e+1,1),S.e>14)X=xs(S);else{if(v=+V(S),v===0)break;X=v%2}N=N.times(N),E?N.c&&N.c.length>E&&(N.c.length=E):T&&(N=N.mod(x))}return T?G:(R&&(G=l.div(G)),x?G.mod(x):E?M(G,g,r,Z):G)},s.integerValue=function(S){var x=new b(this);return S==null?S=r:Ie(S,0,8),M(x,x.e+1,S)},s.isEqualTo=s.eq=function(S,x){return rn(this,new b(S,x))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(S,x){return rn(this,new b(S,x))>0},s.isGreaterThanOrEqualTo=s.gte=function(S,x){return(x=rn(this,new b(S,x)))===1||x===0},s.isInteger=function(){return!!this.c&&lt(this.e/de)>this.c.length-2},s.isLessThan=s.lt=function(S,x){return rn(this,new b(S,x))<0},s.isLessThanOrEqualTo=s.lte=function(S,x){return(x=rn(this,new b(S,x)))===-1||x===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(S,x){var I,T,v,E,Z=this,W=Z.s;if(S=new b(S,x),x=S.s,!W||!x)return new b(NaN);if(W!=x)return S.s=-x,Z.plus(S);var R=Z.e/de,X=S.e/de,G=Z.c,N=S.c;if(!R||!X){if(!G||!N)return G?(S.s=-x,S):new b(N?Z:NaN);if(!G[0]||!N[0])return N[0]?(S.s=-x,S):new b(G[0]?Z:r==3?-0:0)}if(R=lt(R),X=lt(X),G=G.slice(),W=R-X){for((E=W<0)?(W=-W,v=G):(X=R,v=N),v.reverse(),x=W;x--;v.push(0));v.reverse()}else for(T=(E=(W=G.length)<(x=N.length))?W:x,W=x=0;x<T;x++)if(G[x]!=N[x]){E=G[x]<N[x];break}if(E&&(v=G,G=N,N=v,S.s=-S.s),x=(T=N.length)-(I=G.length),x>0)for(;x--;G[I++]=0);for(x=bt-1;T>W;){if(G[--T]<N[T]){for(I=T;I&&!G[--I];G[I]=x);--G[I],G[T]+=bt}G[T]-=N[T]}for(;G[0]==0;G.splice(0,1),--X);return G[0]?w(S,G,X):(S.s=r==3?-1:1,S.c=[S.e=0],S)},s.modulo=s.mod=function(S,x){var I,T,v=this;return S=new b(S,x),!v.c||!S.s||S.c&&!S.c[0]?new b(NaN):!S.c||v.c&&!v.c[0]?new b(v):(m==9?(T=S.s,S.s=1,I=t(v,S,0,3),S.s=T,I.s*=T):I=t(v,S,0,m),S=v.minus(I.times(S)),!S.c[0]&&m==1&&(S.s=v.s),S)},s.multipliedBy=s.times=function(S,x){var I,T,v,E,Z,W,R,X,G,N,P,B,z,D,Y,F=this,O=F.c,H=(S=new b(S,x)).c;if(!O||!H||!O[0]||!H[0])return!F.s||!S.s||O&&!O[0]&&!H||H&&!H[0]&&!O?S.c=S.e=S.s=null:(S.s*=F.s,!O||!H?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(T=lt(F.e/de)+lt(S.e/de),S.s*=F.s,R=O.length,N=H.length,R<N&&(z=O,O=H,H=z,v=R,R=N,N=v),v=R+N,z=[];v--;z.push(0));for(D=bt,Y=At,v=N;--v>=0;){for(I=0,P=H[v]%Y,B=H[v]/Y|0,Z=R,E=v+Z;E>v;)X=O[--Z]%Y,G=O[Z]/Y|0,W=B*X+G*P,X=P*X+W%Y*Y+z[E]+I,I=(X/D|0)+(W/Y|0)+B*G,z[E--]=X%D;z[E]=I}return I?++T:z.splice(0,1),w(S,z,T)},s.negated=function(){var S=new b(this);return S.s=-S.s||null,S},s.plus=function(S,x){var I,T=this,v=T.s;if(S=new b(S,x),x=S.s,!v||!x)return new b(NaN);if(v!=x)return S.s=-x,T.minus(S);var E=T.e/de,Z=S.e/de,W=T.c,R=S.c;if(!E||!Z){if(!W||!R)return new b(v/0);if(!W[0]||!R[0])return R[0]?S:new b(W[0]?T:v*0)}if(E=lt(E),Z=lt(Z),W=W.slice(),v=E-Z){for(v>0?(Z=E,I=R):(v=-v,I=W),I.reverse();v--;I.push(0));I.reverse()}for(v=W.length,x=R.length,v-x<0&&(I=R,R=W,W=I,x=v),v=0;x;)v=(W[--x]=W[x]+R[x]+v)/bt|0,W[x]=bt===W[x]?0:W[x]%bt;return v&&(W=[v].concat(W),++Z),w(S,W,Z)},s.precision=s.sd=function(S,x){var I,T,v,E=this;if(S!=null&&S!==!!S)return Ie(S,1,De),x==null?x=r:Ie(x,0,8),M(new b(E),S,x);if(!(I=E.c))return null;if(v=I.length-1,T=v*de+1,v=I[v]){for(;v%10==0;v/=10,T--);for(v=I[0];v>=10;v/=10,T++);}return S&&E.e+1>T&&(T=E.e+1),T},s.shiftedBy=function(S){return Ie(S,-Qo,Qo),this.times("1e"+S)},s.squareRoot=s.sqrt=function(){var S,x,I,T,v,E=this,Z=E.c,W=E.s,R=E.e,X=a+4,G=new b("0.5");if(W!==1||!Z||!Z[0])return new b(!W||W<0&&(!Z||Z[0])?NaN:Z?E:1/0);if(W=Math.sqrt(+V(E)),W==0||W==1/0?(x=at(Z),(x.length+R)%2==0&&(x+="0"),W=Math.sqrt(+x),R=lt((R+1)/2)-(R<0||R%2),W==1/0?x="5e"+R:(x=W.toExponential(),x=x.slice(0,x.indexOf("e")+1)+R),I=new b(x)):I=new b(W+""),I.c[0]){for(R=I.e,W=R+X,W<3&&(W=0);;)if(v=I,I=G.times(v.plus(t(E,v,X,1))),at(v.c).slice(0,W)===(x=at(I.c)).slice(0,W))if(I.e<R&&--W,x=x.slice(W-3,W+1),x=="9999"||!T&&x=="4999"){if(!T&&(M(v,v.e+a+2,0),v.times(v).eq(E))){I=v;break}X+=4,W+=4,T=1}else{(!+x||!+x.slice(1)&&x.charAt(0)=="5")&&(M(I,I.e+a+2,1),S=!I.times(I).eq(E));break}}return M(I,I.e+a+1,r,S)},s.toExponential=function(S,x){return S!=null&&(Ie(S,0,De),S++),k(this,S,x,1)},s.toFixed=function(S,x){return S!=null&&(Ie(S,0,De),S=S+this.e+1),k(this,S,x)},s.toFormat=function(S,x,I){var T,v=this;if(I==null)S!=null&&x&&typeof x=="object"?(I=x,x=null):S&&typeof S=="object"?(I=S,S=x=null):I=p;else if(typeof I!="object")throw Error(Qe+"Argument not an object: "+I);if(T=v.toFixed(S,x),v.c){var E,Z=T.split("."),W=+I.groupSize,R=+I.secondaryGroupSize,X=I.groupSeparator||"",G=Z[0],N=Z[1],P=v.s<0,B=P?G.slice(1):G,z=B.length;if(R&&(E=W,W=R,R=E,z-=E),W>0&&z>0){for(E=z%W||W,G=B.substr(0,E);E<z;E+=W)G+=X+B.substr(E,W);R>0&&(G+=X+B.slice(E)),P&&(G="-"+G)}T=N?G+(I.decimalSeparator||"")+((R=+I.fractionGroupSize)?N.replace(new RegExp("\\d{"+R+"}\\B","g"),"$&"+(I.fractionGroupSeparator||"")):N):G}return(I.prefix||"")+T+(I.suffix||"")},s.toFraction=function(S){var x,I,T,v,E,Z,W,R,X,G,N,P,B=this,z=B.c;if(S!=null&&(W=new b(S),!W.isInteger()&&(W.c||W.s!==1)||W.lt(l)))throw Error(Qe+"Argument "+(W.isInteger()?"out of range: ":"not an integer: ")+V(W));if(!z)return new b(B);for(x=new b(l),X=I=new b(l),T=R=new b(l),P=at(z),E=x.e=P.length-B.e-1,x.c[0]=$o[(Z=E%de)<0?de+Z:Z],S=!S||W.comparedTo(x)>0?E>0?x:X:W,Z=u,u=1/0,W=new b(P),R.c[0]=0;G=t(W,x,0,1),v=I.plus(G.times(T)),v.comparedTo(S)!=1;)I=T,T=v,X=R.plus(G.times(v=X)),R=v,x=W.minus(G.times(v=x)),W=v;return v=t(S.minus(I),T,0,1),R=R.plus(v.times(X)),I=I.plus(v.times(T)),R.s=X.s=B.s,E=E*2,N=t(X,T,E,r).minus(B).abs().comparedTo(t(R,I,E,r).minus(B).abs())<1?[X,T]:[R,I],u=Z,N},s.toNumber=function(){return+V(this)},s.toPrecision=function(S,x){return S!=null&&Ie(S,1,De),k(this,S,x,2)},s.toString=function(S){var x,I=this,T=I.s,v=I.e;return v===null?T?(x="Infinity",T<0&&(x="-"+x)):x="NaN":(S==null?x=v<=c||v>=d?Ss(at(I.c),v):Wt(at(I.c),v,"0"):S===10&&C?(I=M(new b(I),a+v+1,r),x=Wt(at(I.c),I.e,"0")):(Ie(S,2,y.length,"Base"),x=n(Wt(at(I.c),v,"0"),10,S,T,!0)),T<0&&I.c[0]&&(x="-"+x)),x},s.valueOf=s.toJSON=function(){return V(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&b.set(e),b}function lt(e){var t=e|0;return e>0||e===t?t:t-1}function at(e){for(var t,n,i=1,s=e.length,l=e[0]+"";i<s;){for(t=e[i++]+"",n=de-t.length;n--;t="0"+t);l+=t}for(s=l.length;l.charCodeAt(--s)===48;);return l.slice(0,s+1||1)}function rn(e,t){var n,i,s=e.c,l=t.c,a=e.s,r=t.s,c=e.e,d=t.e;if(!a||!r)return null;if(n=s&&!s[0],i=l&&!l[0],n||i)return n?i?0:-r:a;if(a!=r)return a;if(n=a<0,i=c==d,!s||!l)return i?0:!s^n?1:-1;if(!i)return c>d^n?1:-1;for(r=(c=s.length)<(d=l.length)?c:d,a=0;a<r;a++)if(s[a]!=l[a])return s[a]>l[a]^n?1:-1;return c==d?0:c>d^n?1:-1}function Ie(e,t,n,i){if(e<t||e>n||e!==ot(e))throw Error(Qe+(i||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function xs(e){var t=e.c.length-1;return lt(e.e/de)==t&&e.c[t]%2!=0}function Ss(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Wt(e,t,n){var i,s;if(t<0){for(s=n+".";++t;s+=n);e=s+e}else if(i=e.length,++t>i){for(s=n,t-=i;--t;s+=n);e+=s}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}var qr=$r();function cn(e){return new qr(e)}function qo(e,t){return cn(e).plus(cn(t)).toNumber()}function tS(e,t){return cn(e).minus(cn(t)).toNumber()}function nS(e,t){return cn(e).dividedBy(cn(t)).toNumber()}function ec(e,t){return cn(e).decimalPlaces(t,qr.ROUND_DOWN).toNumber()}const iS={name:"EvGridSummary",props:{stores:{type:Object,default:()=>({})},orderedColumns:{type:Object,default:()=>({})},useCheckbox:{type:Boolean,default:!1},styleOption:{type:Object,default:()=>({})},isTree:{type:Boolean,default:!1},scrollLeft:{type:Number,default:0}},setup(e){const t={max:20,default:3},n=o.ref(),i=2,s=o.computed(()=>e.stores),l=o.computed(()=>e.orderedColumns),a=o.computed(()=>e.useCheckbox),r=o.computed(()=>e.styleOption),c=m=>m==null||m<0?t.default:m>t.max?t.max:m,d=(m,g)=>{if(typeof g=="string"&&g.length===0)return g;const{type:p,decimal:y}=m;let C=g;return p==="number"?(C=nn(g),C=C===!1?g:C):p==="float"&&(C=C.toFixed(c(y??t.default)).replace(/\B(?=(\d{3})+(?!\d))/g,",")),C},h=m=>l.value.findIndex(g=>g.field===m),u=m=>{const{type:g,field:p,summaryType:y,summaryDecimal:C,summaryOnlyTopParent:b}=m;let k="";const L=h(p);if(L>=0){if(y==="count")return s.value.store.length;if(g==="number"||g==="float"){let w=[];switch(e.isTree?w=s.value.store.reduce((M,V)=>{var S,x;return b?V.parent||M.push((S=V.data)==null?void 0:S[p]):M.push((x=V.data)==null?void 0:x[p]),M},[]):w=s.value.store.map(M=>M[i][L]),y){case"sum":{const M=w.reduce((V,S)=>{const x=Number(S);return Number.isNaN(x)?V:qo(V,x)},0);k=M&&ec(M,c(C??t.default));break}case"average":{const M=w.reduce((V,S)=>{const x=Number(S);return Number.isNaN(x)?V:qo(V,x)},0);k=M&&ec(nS(M,w.length),c(C??t.default));break}case"max":{const M=w.filter(V=>V!=null);k=M.length?Math.max(...M):"";break}case"min":{const M=w.filter(V=>V!=null);k=M.length?Math.min(...M):"";break}}k=d(m,k)}}return k},f=m=>{const g=m.summaryRenderer,p=m.summaryData?m.summaryData:[],y=[m.field,...p];let C=g;return y.forEach((b,k)=>{const L=h(b);if(L>=0){const w=u(s.value.orderedColumns[L]);C=C.replace(`{${k}}`,w)}}),C};return o.watch(()=>e.scrollLeft,m=>{o.nextTick(()=>{n.value.scrollLeft=m})}),{columns:l,styleInfo:r,showCheckbox:a,summaryRef:n,getSummaryValue:u,getSummaryRenderer:f}}},sS={class:"column-list"},oS=["title"],lS=["title"];function aS(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{ref:"summaryRef",class:o.normalizeClass({"grid-summary":!0,"non-border":i.styleInfo.borderStyle==="none"})},[o.createElementVNode("ul",sS,[i.showCheckbox?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"non-border":!!i.styleInfo.borderStyle}),style:o.normalizeStyle({width:`${i.styleInfo.minWidth}px`,"line-height":`${i.styleInfo.rowHeight}px`})},[o.createElementVNode("span",{style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4)],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.columns,(a,r)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`summary_${r}`},[a.hide?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"non-border":!!i.styleInfo.borderStyle,[a.type]:a.type,[a.align]:a.align}),style:o.normalizeStyle({width:`${a.width}px`,"min-width":`${i.styleInfo.minWidth}px`,"line-height":`${i.styleInfo.rowHeight}px`})},[a.summaryType||a.summaryRenderer?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle({width:"100%",height:`${i.styleInfo.rowHeight}px`})},[a.summaryRenderer?(o.openBlock(),o.createElementBlock("div",{key:0,title:i.getSummaryRenderer(a)},o.toDisplayString(i.getSummaryRenderer(a)),9,oS)):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getSummaryValue(a)},o.toDisplayString(i.getSummaryValue(a)),9,lS))],4)):(o.openBlock(),o.createElementBlock("span",{key:1,style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4))],6))],64))),128))])],2)}const tc=ce(iS,[["render",aS],["__scopeId","data-v-4b9bef37"]]),rS={name:"EVGridColumnSetting",directives:{clickoutside:Ji},props:{isShow:{type:Boolean,default:!1},columns:{type:[Array],default:()=>[]},hiddenColumn:{type:String,default:""},position:{type:Object,default:()=>({top:0,left:0,columnListMenuWidth:0})},isShowMenuOnClick:{type:Boolean,default:!1},textInfo:{type:Object,default:()=>({title:"Column List",search:"Search",empty:"No records",ok:"OK"})}},emits:{"update:isShow":[Boolean],"update:isShowMenuOnClick":[Boolean],"apply-column":null},setup(e,{emit:t}){const n=o.computed({get:()=>e.isShow,set:T=>t("update:isShow",T)}),i=o.ref(null),s=o.ref(""),l=o.ref(!1),a=o.ref([]),r=o.ref([]),c=o.ref([]),d=o.ref([]),h=o.computed(()=>l.value?c.value:r.value),u=o.computed(()=>!h.value.length);let f=null,m=null;const g=o.reactive({top:null,left:null}),p=o.computed({get:()=>e.isShowMenuOnClick,set:T=>t("update:isShowMenuOnClick",T)}),y=T=>{var v;(T==null?void 0:T.length)===1?m=T[0]:(T==null?void 0:T.length)<1&&(m==null&&(m=(v=r.value[0])==null?void 0:v.text),a.value.push(m))},C=T=>{f&&clearTimeout(f),f=setTimeout(()=>{if(l.value=!1,T){const v=T.toString().toLowerCase();c.value=r.value.filter(E=>E.label.toString().toLowerCase().includes(v)),l.value=!0}},500)},b=()=>{s.value="",l.value=!1,c.value.length=0},k=()=>{const T=d.value.length?d.value:r.value;a.value=T.filter(v=>v.originChecked).map(v=>v.text),b()},L=()=>{d.value=r.value.filter(v=>a.value.includes(v.text));const T=d.value.map(v=>v.text);t("apply-column",T),n.value=!1,p.value=!1},w=o.ref(),M=o.ref(),V=()=>{M.value=Ve(a.value),r.value=e.columns.filter(T=>!T.hide&&T.caption).map(T=>{var Z,W;const v=(Z=w.value)==null?void 0:Z.find(R=>R.field===T.field);let E=!1;return v?E=(v==null?void 0:v.hiddenDisplay)!==(T==null?void 0:T.hiddenDisplay)||!((W=M.value)!=null&&W.length)?!(T!=null&&T.hiddenDisplay):M.value.includes(T.field):E=!T.hiddenDisplay,{label:T.caption,text:T.field,originChecked:!T.hiddenDisplay,checked:E,fixed:T.fixed}}),a.value=r.value.filter(T=>T.checked).map(T=>T.text),d.value.length=0,w.value=Ve(e.columns)},S=()=>{n.value=!1,p.value=!1},x=()=>{const T=document.createElement("div");T.id="ev-grid-column-setting-modal",T.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-column-setting-modal")||document.body.appendChild(T)},I=async()=>{var B;await o.nextTick();const T=document.documentElement.clientWidth,v=document.documentElement.clientHeight,E=(B=i.value)==null?void 0:B.getBoundingClientRect(),Z=E==null?void 0:E.width,W=E==null?void 0:E.height,{top:R,left:X,columnListMenuWidth:G}=e.position;let N;G?(N=X,T<X+Z&&(N=X-Z-G)):N=X-Z;const P=v-W;g.top=`${Math.min(R,P)+document.documentElement.scrollTop}px`,g.left=`${N+document.documentElement.scrollLeft}px`};return o.onBeforeMount(()=>x()),o.watch(()=>e.columns,()=>{V()},{immediate:!0,deep:!0}),o.watch(()=>n.value,async()=>{k(),n.value&&await I()}),o.watch(()=>e.hiddenColumn,T=>{const v=d.value.length?d.value.filter(E=>E.text!==T):r.value.filter(E=>E.text!==T&&E.checked);d.value=v,a.value=v.map(E=>E.text)}),{columnSettingWrapper:i,columnSettingStyle:g,isShowColumnSetting:n,checkColumnGroup:a,columnList:h,searchVm:s,isDisabled:u,onSearchColumn:C,onApplyColumn:L,onCheckColumn:y,hideColumnSetting:S}}},cS={class:"ev-grid-column-setting__header"},dS={class:"header-title"},hS={class:"ev-grid-column-setting__content"},uS={key:1,class:"is-empty"},fS={class:"ev-grid-column-setting__footer"};function mS(e,t,n,i,s,l){const a=o.resolveComponent("ev-text-field"),r=o.resolveComponent("ev-checkbox"),c=o.resolveComponent("ev-checkbox-group"),d=o.resolveComponent("ev-button"),h=o.resolveDirective("clickoutside");return i.isShowColumnSetting?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-grid-column-setting-modal"},[o.withDirectives((o.openBlock(),o.createElementBlock("section",{ref:"columnSettingWrapper",class:"ev-grid-column-setting",style:o.normalizeStyle(i.columnSettingStyle)},[o.createElementVNode("div",cS,[o.createElementVNode("p",dS,o.toDisplayString(n.textInfo.title),1),o.createVNode(a,{modelValue:i.searchVm,"onUpdate:modelValue":t[0]||(t[0]=u=>i.searchVm=u),type:"search",placeholder:n.textInfo.search,onInput:i.onSearchColumn},null,8,["modelValue","placeholder","onInput"])]),o.createElementVNode("div",hS,[i.columnList.length?(o.openBlock(),o.createBlock(c,{key:0,modelValue:i.checkColumnGroup,"onUpdate:modelValue":t[1]||(t[1]=u=>i.checkColumnGroup=u),onChange:i.onCheckColumn},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.columnList,(u,f)=>(o.openBlock(),o.createBlock(r,{key:`column_${f}`,label:u==null?void 0:u.text,disabled:!!(u!=null&&u.fixed),"tooltip-title":(u==null?void 0:u.label)??""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(u==null?void 0:u.label),1)]),_:2},1032,["label","disabled","tooltip-title"]))),128))]),_:1},8,["modelValue","onChange"])):(o.openBlock(),o.createElementBlock("p",uS,o.toDisplayString(n.textInfo.empty),1))]),o.createElementVNode("div",fS,[o.createVNode(d,{type:"primary",disabled:i.isDisabled,onClick:i.onApplyColumn},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.textInfo.ok),1)]),_:1},8,["disabled","onClick"])])],4)),[[h,i.hideColumnSetting]])])):o.createCommentVNode("",!0)}const nc=ce(rS,[["render",mS]]),pS={name:"EVGridFilterSetting",directives:{clickoutside:Ji},props:{isShow:{type:Boolean,default:!1},position:{type:Object,default:()=>({top:0,left:0})},column:{type:Object,default:()=>({})},items:{type:Object,default:()=>({})}},emits:{"update:isShow":null,"apply-filtering":null},setup(e,{emit:t}){const n=o.ref([]),i=o.computed(()=>e.column),s=[{name:"AND",value:"and"},{name:"OR",value:"or"}],l=[{name:"true",value:"true"},{name:"false",value:"false"}],a=[{name:"=",value:"="},{name:"!=",value:"!="},{name:"<",value:"<"},{name:">",value:">"},{name:"<=",value:"<="},{name:">=",value:">="}],r=[{name:"s%",value:"s%"},{name:"%s",value:"%s"},{name:"%s%",value:"%s%"},{name:"Not Like",value:"notLike"},{name:"=",value:"="},{name:"!=",value:"!="}],c=[{name:"Is empty",value:"isEmpty"},{name:"Is not empty",value:"isNotEmpty"}],d=L=>L==="string"||L==="stringNumber"?[...r,...c]:L==="number"||L==="float"?[...a,...c]:L==="boolean"?[{name:"=",value:"="}]:[],h=o.computed(()=>d(e.column.type)),u=o.computed({get:()=>e.isShow,set:L=>t("update:isShow",L)}),f=()=>{const L=n.value.length>=2?n.value[1].operator:"and";n.value.push({comparison:"=",operator:L,value:"",caption:i.value.caption})},m=L=>{n.value.length>1?n.value.splice(L,1):L===0&&(n.value[0].comparison="=",n.value[0].value="")},g=(L,w)=>{(L==="isEmpty"||L==="isNotEmpty")&&(n.value[w].value="")},p=L=>{n.value=n.value.map(w=>({...w,operator:L}))},y=()=>{t("apply-filtering",i.value.field,n.value.filter(L=>L.value||L.comparison==="isEmpty"||L.comparison==="isNotEmpty"))};o.watch(()=>e.isShow,L=>{var V;const w=[],M=Ve(e.items);L&&i.value.field&&((V=M[i.value.field])!=null&&V.length?M[i.value.field].forEach(S=>{w.push(S)}):w.push({comparison:"=",operator:"and",value:"",caption:i.value.caption}),n.value=w)});const C=(L,w)=>{var M;return((M=L.find(V=>V.value===w))==null?void 0:M.name)||""},b=()=>{const L=document.createElement("div");L.id="ev-grid-filter-setting-modal",L.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filter-setting-modal")||document.body.appendChild(L)};return o.onBeforeMount(()=>{b()}),{filteringItems:n,isShowFilterSetting:u,items1:s,items2:h,booleanItems:l,addRow:f,removeRow:m,changeOperator:p,applyFiltering:y,changeComparison:g,getSelectTitle:C,validateValue:(L,w)=>{(L==="number"||L==="float")&&(w.value=w.value.replace(/[^0-9.,]/g,""))}}}},gS={class:"ev-grid-filter-setting__header"},bS={class:"header-title"},yS={class:"ev-grid-filter-setting__content"},xS={class:"ev-grid-filter-setting__row--button"},SS={class:"ev-grid-filter-setting__footer"};function CS(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-select"),c=o.resolveComponent("ev-text-field"),d=o.resolveComponent("ev-button"),h=o.resolveDirective("clickoutside");return i.isShowFilterSetting?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-grid-filter-setting-modal"},[o.withDirectives((o.openBlock(),o.createElementBlock("section",{class:"ev-grid-filter-setting",style:o.normalizeStyle({top:e.$props.position.top,left:e.$props.position.left})},[o.createElementVNode("div",gS,[o.createVNode(a,{icon:"ev-icon-filter-list"}),o.createElementVNode("span",bS," Filter ("+o.toDisplayString(e.$props.column.caption)+") ",1)]),o.createElementVNode("div",yS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteringItems,(u,f)=>(o.openBlock(),o.createElementBlock("div",{key:f,class:"ev-grid-filter-setting__row"},[o.createVNode(r,{modelValue:u.operator,"onUpdate:modelValue":m=>u.operator=m,class:"ev-grid-filter-setting__row--operator",title:i.getSelectTitle(i.items1,u.operator),items:i.items1,disabled:f>1,style:o.normalizeStyle({visibility:f>0?"visible":"hidden"}),onChange:i.changeOperator},null,8,["modelValue","onUpdate:modelValue","title","items","disabled","style","onChange"]),o.createVNode(r,{modelValue:u.comparison,"onUpdate:modelValue":m=>u.comparison=m,class:"ev-grid-filter-setting__row--comparison",title:i.getSelectTitle(i.items2,u.comparison),items:i.items2,onChange:m=>i.changeComparison(u.comparison,f)},null,8,["modelValue","onUpdate:modelValue","title","items","onChange"]),e.$props.column.type==="boolean"?(o.openBlock(),o.createBlock(r,{key:0,modelValue:u.value,"onUpdate:modelValue":m=>u.value=m,class:"ev-grid-filter-setting__row--comparison",items:i.booleanItems},null,8,["modelValue","onUpdate:modelValue","items"])):(o.openBlock(),o.createBlock(c,{key:1,modelValue:u.value,"onUpdate:modelValue":m=>u.value=m,class:"ev-grid-filter-setting__row--value",disabled:u.comparison==="isEmpty"||u.comparison==="isNotEmpty",onInput:m=>i.validateValue(e.$props.column.type,u)},null,8,["modelValue","onUpdate:modelValue","disabled","onInput"])),o.createElementVNode("div",xS,[o.createVNode(a,{icon:"ev-icon-trash2",onClick:m=>i.removeRow(f)},null,8,["onClick"])])]))),128))]),o.createElementVNode("div",SS,[o.createVNode(d,{type:"primary",onClick:i.applyFiltering},{default:o.withCtx(()=>[...t[0]||(t[0]=[o.createTextVNode(" OK ",-1)])]),_:1},8,["onClick"])])],4)),[[h,()=>{i.isShowFilterSetting=!1}]])])):o.createCommentVNode("",!0)}const kS=ce(pS,[["render",CS]]),wS={name:"GridSortButton",props:{icon:{type:String,default:""}}},IS={key:0},TS={key:1},LS={key:2};function MS(e,t,n,i,s,l){return n.icon==="basic"?(o.openBlock(),o.createElementBlock("span",IS,[...t[0]||(t[0]=[o.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o.createElementVNode("rect",{width:"14",height:"14",rx:"2",fill:"#F1F3F5"}),o.createElementVNode("path",{d:`M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508 4.795L5.41508
4
+ `],...function({vnode:h,recurseCount:u}){const m=u>0?`... (${u} recursive calls)`:"",f=!!h.component&&h.component.parent==null,g=` at <${Sa(h.component,h.type,f)}`,p=">"+m;return h.props?[g,...Zd(h.props),p]:[g+p]}(c))}),r}(s)),console.warn(...l)}Xl()}function Zd(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(i=>{t.push(...Ql(i,e[i]))}),n.length>3&&t.push(" ..."),t}function Ql(e,t,n){return xt(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:je(t)?(t=Ql(e,ge(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Oe(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=ge(t),n?t:[`${e}=`,t])}const $l={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"};function en(e,t,n,i){let s;try{s=i?e(...i):e()}catch(l){ql(l,t,n)}return s}function so(e,t,n,i){if(Oe(e)){const l=en(e,t,n,i);return l&&ad(l)&&l.catch(a=>{ql(a,t,n)}),l}const s=[];for(let l=0;l<e.length;l++)s.push(so(e[l],t,n,i));return s}function ql(e,t,n,i=!0){const s=t?t.vnode:null;if(t){let l=t.parent;const a=t.proxy,r=process.env.NODE_ENV!=="production"?$l[n]:n;for(;l;){const d=l.ec;if(d){for(let h=0;h<d.length;h++)if(d[h](e,a,r)===!1)return}l=l.parent}const c=t.appContext.config.errorHandler;if(c)return void en(c,null,10,[e,a,r])}(function(l,a,r,c=!0){if(process.env.NODE_ENV!=="production"){const h=$l[a];if(r&&(d=r,qt.push(d)),St("Unhandled error"+(h?` during execution of ${h}`:"")),r&&qt.pop(),c)throw l;console.error(l)}else console.error(l);var d})(e,n,s,i)}let Hi=!1,oo=!1;const ht=[];let Bt=0;const pn=[];let Ct=null,Ot=0;const ea=Promise.resolve();let lo=null;const Xd=100;function ta(e){const t=lo||ea;return e?t.then(this?e.bind(this):e):t}function ao(e){ht.length&&ht.includes(e,Hi&&e.allowRecurse?Bt+1:Bt)||(e.id==null?ht.push(e):ht.splice(function(t){let n=Bt+1,i=ht.length;for(;n<i;){const s=n+i>>>1,l=ht[s],a=Wn(l);a<t||a===t&&l.pre?n=s+1:i=s}return n}(e.id),0,e),na())}function na(){Hi||oo||(oo=!0,lo=ea.then(sa))}function ia(e){Ce(e)?pn.push(...e):Ct&&Ct.includes(e,e.allowRecurse?Ot+1:Ot)||pn.push(e),na()}const Wn=e=>e.id==null?1/0:e.id,Nd=(e,t)=>{const n=Wn(e)-Wn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function sa(e){oo=!1,Hi=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),ht.sort(Nd);const t=process.env.NODE_ENV!=="production"?n=>oa(e,n):Tl;try{for(Bt=0;Bt<ht.length;Bt++){const n=ht[Bt];if(n&&n.active!==!1){if(process.env.NODE_ENV!=="production"&&t(n))continue;en(n,null,14)}}}finally{Bt=0,ht.length=0,function(n){if(pn.length){const i=[...new Set(pn)];if(pn.length=0,Ct)return void Ct.push(...i);for(Ct=i,process.env.NODE_ENV!=="production"&&(n=n||new Map),Ct.sort((s,l)=>Wn(s)-Wn(l)),Ot=0;Ot<Ct.length;Ot++)process.env.NODE_ENV!=="production"&&oa(n,Ct[Ot])||Ct[Ot]();Ct=null,Ot=0}}(e),Hi=!1,lo=null,(ht.length||pn.length)&&sa(e)}}function oa(e,t){if(e.has(t)){const n=e.get(t);if(n>Xd){const i=t.ownerInstance,s=i&&xa(i.type);return St(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`),!0}e.set(t,n+1)}else e.set(t,1)}const Gn=new Set;process.env.NODE_ENV!=="production"&&(zs().__VUE_HMR_RUNTIME__={createRecord:ro(function(e,t){return zi.has(e)?!1:(zi.set(e,{initialDef:Zn(t),instances:new Set}),!0)}),rerender:ro(function(e,t){const n=zi.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(i=>{t&&(i.render=t,Zn(i.type).render=t),i.renderCache=[],i.update()}))}),reload:ro(function(e,t){const n=zi.get(e);if(!n)return;t=Zn(t),la(n.initialDef,t);const i=[...n.instances];for(const s of i){const l=Zn(s.type);Gn.has(l)||(l!==n.initialDef&&la(l,t),Gn.add(l)),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(Gn.add(l),s.ceReload(t.styles),Gn.delete(l)):s.parent?ao(s.parent.update):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}ia(()=>{for(const s of i)Gn.delete(Zn(s.type))})})});const zi=new Map;function Zn(e){return Ca(e)?e.__vccOpts:e}function la(e,t){dt(e,t);for(const n in e)n==="__file"||n in t||delete e[n]}function ro(e){return(t,n)=>{try{return e(t,n)}catch(i){console.error(i),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Xn=null,Pd=null;const Dd=Symbol.for("v-ndc"),Ai={};function Bd(e,t,{immediate:n,deep:i,flush:s,onTrack:l,onTrigger:a}=Fs){var r;process.env.NODE_ENV==="production"||t||(n!==void 0&&St('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&St('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));const c=k=>{St("Invalid watch source: ",k,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},d=Rl===((r=yn)==null?void 0:r.scope)?yn:null;let h,u,m=!1,f=!1;if(je(e)?(h=()=>e.value,m=eo(e)):Qt(e)?(h=()=>e,i=!0):Ce(e)?(f=!0,m=e.some(k=>Qt(k)||eo(k)),h=()=>e.map(k=>je(k)?k.value:Qt(k)?gn(k):Oe(k)?en(k,d,2):void(process.env.NODE_ENV!=="production"&&c(k)))):Oe(e)?h=t?()=>en(e,d,2):()=>{if(!d||!d.isUnmounted)return u&&u(),so(e,d,3,[g])}:(h=Tl,process.env.NODE_ENV!=="production"&&c(e)),t&&i){const k=h;h=()=>gn(k())}let g=k=>{u=b.onStop=()=>{en(k,d,4),u=b.onStop=void 0}},p=f?new Array(e.length).fill(Ai):Ai;const y=()=>{if(b.active)if(t){const k=b.run();(i||m||(f?k.some((L,w)=>mn(L,p[w])):mn(k,p)))&&(u&&u(),so(t,d,3,[k,p===Ai?void 0:f&&p[0]===Ai?[]:p,g]),p=k)}else b.run()};let C;y.allowRecurse=!!t,s==="sync"?C=y:s==="post"?C=()=>ha(y,d&&d.suspense):(y.pre=!0,d&&(y.id=d.uid),C=()=>ao(y));const b=new gd(h,C);return process.env.NODE_ENV!=="production"&&(b.onTrack=l,b.onTrigger=a),t?n?y():p=b.run():s==="post"?ha(b.run.bind(b),d&&d.suspense):b.run(),()=>{b.stop(),d&&d.scope&&sd(d.scope.effects,b)}}function Od(e,t,n){const i=this.proxy,s=xt(e)?e.includes(".")?function(c,d){const h=d.split(".");return()=>{let u=c;for(let m=0;m<h.length&&u;m++)u=u[h[m]];return u}}(i,e):()=>i[e]:e.bind(i,i);let l;Oe(t)?l=t:(l=t.handler,n=t);const a=yn;ya(this);const r=Bd(s,l.bind(i),n);return a?ya(a):_d(),r}function gn(e,t){if(!Ue(e)||e.__v_skip||(t=t||new Set).has(e))return e;if(t.add(e),je(e))gn(e.value,t);else if(Ce(e))for(let n=0;n<e.length;n++)gn(e[n],t);else if(ld(e)||fn(e))e.forEach(n=>{gn(n,t)});else if(cd(e))for(const n in e)gn(e[n],t);return e}const co=e=>e?4&e.vnode.shapeFlag?function(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy((i=t.exposed,hd(i,"__v_skip",!0),Qt(n=i)?n:new Proxy(n,Gd)),{get:(s,l)=>l in s?s[l]:l in ho?ho[l](t):void 0,has:(s,l)=>l in s||l in ho}));var n,i}(e)||e.proxy:co(e.parent):null,ho=dt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?Fi(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?Fi(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?Fi(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?Fi(e.refs):e.refs,$parent:e=>co(e.parent),$root:e=>co(e.root),$emit:e=>e.emit,$options:e=>function(t){const n=t.type,{mixins:i,extends:s}=n,{mixins:l,optionsCache:a,config:{optionMergeStrategies:r}}=t.appContext,c=a.get(n);let d;return c?d=c:l.length||i||s?(d={},l.length&&l.forEach(h=>_i(d,h,r,!0)),_i(d,n,r)):d=n,Ue(n)&&a.set(n,d),d}(e),$forceUpdate:e=>e.f||(e.f=()=>ao(e.update)),$nextTick:e=>e.n||(e.n=ta.bind(e.proxy)),$watch:e=>Od.bind(e)});function aa(e){return Ce(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}process.env.NODE_ENV;function _i(e,t,n,i=!1){const{mixins:s,extends:l}=t;l&&_i(e,l,n,!0),s&&s.forEach(a=>_i(e,a,n,!0));for(const a in t)if(i&&a==="expose")process.env.NODE_ENV!=="production"&&St('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const r=Yd[a]||n&&n[a];e[a]=r?r(e[a],t[a]):t[a]}return e}const Yd={data:ra,props:da,emits:da,methods:Nn,computed:Nn,beforeCreate:Fe,created:Fe,beforeMount:Fe,mounted:Fe,beforeUpdate:Fe,updated:Fe,beforeDestroy:Fe,beforeUnmount:Fe,destroyed:Fe,unmounted:Fe,activated:Fe,deactivated:Fe,errorCaptured:Fe,serverPrefetch:Fe,components:Nn,directives:Nn,watch:function(e,t){if(!e)return t;if(!t)return e;const n=dt(Object.create(null),e);for(const i in t)n[i]=Fe(e[i],t[i]);return n},provide:ra,inject:function(e,t){return Nn(ca(e),ca(t))}};function ra(e,t){return t?e?function(){return dt(Oe(e)?e.call(this,this):e,Oe(t)?t.call(this,this):t)}:t:e}function ca(e){if(Ce(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Fe(e,t){return e?[...new Set([].concat(e,t))]:t}function Nn(e,t){return e?dt(Object.create(null),e,t):t}function da(e,t){return e?Ce(e)&&Ce(t)?[...new Set([...e,...t])]:dt(Object.create(null),aa(e),aa(t??{})):t}const ha=function(e,t){t&&t.pendingBranch?Ce(e)?t.effects.push(...e):t.effects.push(e):ia(e)},ua=Symbol.for("v-fgt"),Fd=Symbol.for("v-txt"),Hd=Symbol.for("v-cmt"),fa="__vInternal",ma=({key:e})=>e??null,Ki=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?xt(e)||je(e)||Oe(e)?{i:Xn,r:e,k:t,f:!!n}:e:null),zd=process.env.NODE_ENV!=="production"?(...e)=>pa(...e):pa;function pa(e,t=null,n=null,i=0,s=null,l=!1){if(e&&e!==Dd||(process.env.NODE_ENV==="production"||e||St(`Invalid vnode type when creating vnode: ${e}.`),e=Hd),(a=e)&&a.__v_isVNode===!0){const c=Ui(e,t,!0);return n&&uo(c,n),c.patchFlag|=-2,c}var a;if(Ca(e)&&(e=e.__vccOpts),t){t=function(h){return h?to(h)||fa in h?dt({},h):h:null}(t);let{class:c,style:d}=t;c&&!xt(c)&&(t.class=_s(c)),Ue(d)&&(to(d)&&!Ce(d)&&(d=dt({},d)),t.style=As(d))}const r=xt(e)?1:(c=>c.__isSuspense)(e)?128:(c=>c.__isTeleport)(e)?64:Ue(e)?4:Oe(e)?2:0;return process.env.NODE_ENV!=="production"&&4&r&&to(e)&&St("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
5
+ Component that was made reactive: `,e=ge(e)),function(c,d=null,h=null,u=0,m=null,f=c===ua?0:1,g=!1,p=!1){const y={__v_isVNode:!0,__v_skip:!0,type:c,props:d,key:d&&ma(d),ref:d&&Ki(d),scopeId:Pd,slotScopeIds:null,children:h,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:f,patchFlag:u,dynamicProps:m,dynamicChildren:null,appContext:null,ctx:Xn};return p?(uo(y,h),128&f&&c.normalize(y)):h&&(y.shapeFlag|=xt(h)?8:16),process.env.NODE_ENV!=="production"&&y.key!=y.key&&St("VNode created with invalid key (NaN). VNode type:",y.type),y}(e,t,n,i,s,r,l,!0)}function Ui(e,t,n=!1){const{props:i,ref:s,patchFlag:l,children:a}=e,r=t?function(...c){const d={};for(let h=0;h<c.length;h++){const u=c[h];for(const m in u)if(m==="class")d.class!==u.class&&(d.class=_s([d.class,u.class]));else if(m==="style")d.style=As([d.style,u.style]);else if(id(m)){const f=d[m],g=u[m];!g||f===g||Ce(f)&&f.includes(g)||(d[m]=f?[].concat(f,g):g)}else m!==""&&(d[m]=u[m])}return d}(i||{},t):i;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:r,key:r&&ma(r),ref:t&&t.ref?n&&s?Ce(s)?s.concat(Ki(t)):[s,Ki(t)]:Ki(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&Ce(a)?a.map(ga):a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ua?l===-1?16:16|l:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ui(e.ssContent),ssFallback:e.ssFallback&&Ui(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function ga(e){const t=Ui(e);return Ce(e.children)&&(t.children=e.children.map(ga)),t}function Ad(e=" ",t=0){return zd(Fd,null,e,t)}function uo(e,t){let n=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(Ce(t))n=16;else if(typeof t=="object"){if(65&i){const s=t.default;return void(s&&(s._c&&(s._d=!1),uo(e,s()),s._c&&(s._d=!0)))}{n=32;const s=t._;s||fa in t||(t._ctx=Xn)}}else Oe(t)?(t={default:t,_ctx:Xn},n=32):(t=String(t),64&i?(n=16,t=[Ad(t)]):n=8);e.children=t,e.shapeFlag|=n}let fo,bn,yn=null,ba="__VUE_INSTANCE_SETTERS__";(bn=zs()[ba])||(bn=zs()[ba]=[]),bn.push(e=>yn=e),fo=e=>{bn.length>1?bn.forEach(t=>t(e)):bn[0](e)};const ya=e=>{fo(e),e.scope.on()},_d=()=>{yn&&yn.scope.off(),fo(null)},Kd=/(?:^|[-_])(\w)/g,Ud=e=>e.replace(Kd,t=>t.toUpperCase()).replace(/[-_]/g,"");function xa(e,t=!0){return Oe(e)?e.displayName||e.name:e.name||t&&e.__name}function Sa(e,t,n=!1){let i=xa(t);if(!i&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(i=s[1])}if(!i&&e&&e.parent){const s=l=>{for(const a in l)if(l[a]===t)return a};i=s(e.components||e.parent.type.components)||s(e.appContext.components)}return i?Ud(i):n?"App":"Anonymous"}function Ca(e){return Oe(e)&&"__vccOpts"in e}function mo(e){return!(!e||!e.__v_isShallow)}function ka(e,t,n){if(arguments.length===2)for(var i,s=0,l=t.length;s<l;s++)!i&&s in t||(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}function wa(e,t){if(e===t)return!0;if(typeof e=="object"){for(var n in e)if(!wa(e[n],t[n]))return!1;return!0}return!1}process.env.NODE_ENV!=="production"&&function(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#0b1bc9"},n={style:"color:#b62e24"},i={style:"color:#9d288c"},s={header:u=>Ue(u)?u.__isVue?["div",e,"VueInstance"]:je(u)?["div",{},["span",e,h(u)],"<",r(u.value),">"]:Qt(u)?["div",{},["span",e,mo(u)?"ShallowReactive":"Reactive"],"<",r(u),">"+($t(u)?" (readonly)":"")]:$t(u)?["div",{},["span",e,mo(u)?"ShallowReadonly":"Readonly"],"<",r(u),">"]:null:null,hasBody:u=>u&&u.__isVue,body(u){if(u&&u.__isVue)return["div",{},...l(u.$)]}};function l(u){const m=[];u.type.props&&u.props&&m.push(a("props",ge(u.props))),u.setupState!==Fs&&m.push(a("setup",u.setupState)),u.data!==Fs&&m.push(a("data",ge(u.data)));const f=c(u,"computed");f&&m.push(a("computed",f));const g=c(u,"inject");return g&&m.push(a("injected",g)),m.push(["div",{},["span",{style:i.style+";opacity:0.66"},"$ (internal): "],["object",{object:u}]]),m}function a(u,m){return m=dt({},m),Object.keys(m).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},u],["div",{style:"padding-left:1.25em"},...Object.keys(m).map(f=>["div",{},["span",i,f+": "],r(m[f],!1)])]]:["span",{}]}function r(u,m=!0){return typeof u=="number"?["span",t,u]:typeof u=="string"?["span",n,JSON.stringify(u)]:typeof u=="boolean"?["span",i,u]:Ue(u)?["object",{object:m?ge(u):u}]:["span",n,String(u)]}function c(u,m){const f=u.type;if(Oe(f))return;const g={};for(const p in u.ctx)d(f,p,m)&&(g[p]=u.ctx[p]);return g}function d(u,m,f){const g=u[f];return!!(Ce(g)&&g.includes(m)||Ue(g)&&m in g)||!(!u.extends||!d(u.extends,m,f))||!(!u.mixins||!u.mixins.some(p=>d(p,m,f)))||void 0}function h(u){return mo(u)?"ShallowRef":u.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}(),typeof SuppressedError=="function"&&SuppressedError;var Jd=function(){function e(t,n){this.el=t,this.observer=null,this.frozen=!1,this.createObserver(n)}return Object.defineProperty(e.prototype,"threshold",{get:function(){return this.options.intersection&&this.options.intersection.threshold||0},enumerable:!1,configurable:!0}),e.prototype.createObserver=function(t){var n=this;if(this.observer&&this.destroyObserver(),!this.frozen){var i;if(this.options=typeof(i=t)=="function"?{callback:i}:i,this.callback=function(l,a){n.options.callback(l,a),l&&n.options.once&&(n.frozen=!0,n.destroyObserver())},this.callback&&this.options.throttle){var s=(this.options.throttleOptions||{}).leading;this.callback=function(l,a,r){var c,d,h;r===void 0&&(r={});var u=function(m){for(var f=[],g=1;g<arguments.length;g++)f[g-1]=arguments[g];if(h=f,!c||m!==d){var p=r.leading;typeof p=="function"&&(p=p(m,d)),c&&m===d||!p||l.apply(void 0,ka([m],h,!1)),d=m,clearTimeout(c),c=setTimeout(function(){l.apply(void 0,ka([m],h,!1)),c=0},a)}};return u._clear=function(){clearTimeout(c),c=null},u}(this.callback,this.options.throttle,{leading:function(l){return s==="both"||s==="visible"&&l||s==="hidden"&&!l}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(l){var a=l[0];if(l.length>1){var r=l.find(function(d){return d.isIntersecting});r&&(a=r)}if(n.callback){var c=a.isIntersecting&&a.intersectionRatio>=n.threshold;if(c===n.oldResult)return;n.oldResult=c,n.callback(c,a)}},this.options.intersection),ta(function(){n.observer&&n.observer.observe(n.el)})}},e.prototype.destroyObserver=function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)},e}(),po={beforeMount:function(e,t){var n=t.value;n&&(typeof IntersectionObserver>"u"?console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill"):e._vue_visibilityState=new Jd(e,n))},updated:function(e,t){var n=t.value;if(!wa(n,t.oldValue)){var i=e._vue_visibilityState;n&&i&&i.createObserver(n)}},unmounted:function(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}};const Pn={mounted(e,t){if(typeof ResizeObserver>"u")return;const n=t.value;if(typeof n!="function")return;getComputedStyle(e).position==="static"&&e.style.setProperty("position","relative","important");const i=new ResizeObserver(s=>{for(const l of s){const{width:a,height:r}=l.contentRect;n({width:a,height:r})}});i.observe(e),e.__resizeObserver__=i},unmounted(e){const t=e.__resizeObserver__;t&&(t.disconnect(),e.__resizeObserver__=null)}},ce=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n},jd={name:"EvTabs",directives:{observeVisibility:po,resize:Pn},props:{modelValue:{type:[String,Number],default:null},panels:{type:Array,default:()=>[],validator:e=>{const t=e.map(i=>i.value),n=[...new Set(t)];return e.length!==n.length?(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is duplicate values."),!1):e.every(i=>Object.hasOwnProperty.call(i,"value"))?!0:(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is essential."),!1)}},closable:{type:Boolean,default:!1},stretch:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:{"update:modelValue":[String,Number],"update:panels":[Array],change:[String,Number]},setup(e,{emit:t}){const n=o.ref(!1),i=o.ref([]),s=o.computed({get:()=>e.modelValue,set:x=>{t("update:modelValue",x),t("change",x)}});o.provide("evTabs",s);const l=o.computed({get:()=>e.panels,set:x=>t("update:panels",x)}),a=o.computed(()=>!e.draggable||!n.value?l.value:i.value),r=l.value.map(x=>x.value),c=o.ref(null),d=o.ref(null),h=o.ref(!1),u=o.reactive({x:0}),m=o.computed(()=>({transform:`translateX(${u.x}px)`})),f=()=>{if(!h.value||!d.value||!c.value)return;const x=a.value.findIndex(P=>P.value===s.value);if(x<0)return;const I=d.value.children[x];if(!I)return;const T=c.value.offsetWidth,v=d.value.offsetWidth,E=T-v,Z=I.offsetLeft,W=Z+I.offsetWidth,R=-u.x,X=R+T,G=a.value.length-1;let N=u.x;Z<R?N=x===0?0:-Z:W>X&&(N=x===G?E:T-W),u.x=Math.min(0,Math.max(E,N))},g=()=>{const x=c.value.offsetWidth,I=d.value.offsetWidth;if(h.value=x<I,h.value){const T=x-I;T>u.x&&(u.x=T),o.nextTick(f)}else u.x=0};o.watch(s,()=>{o.nextTick(f)}),o.onBeforeUpdate(()=>{if(r.length===l.value.length+1){let x,I;r.length>l.value.length?(x=r,I=l.value.map(v=>v.value)):(x=l.value.map(v=>v.value),I=r);const T=x.filter(v=>!I.includes(v))[0];if(s.value===T){const v=r.findIndex(E=>E===T);v===0?s.value=l.value[0].value:s.value=l.value[v-1].value}}});const p=x=>{s.value=x},y=x=>{if(l.value.length<2)return;const I=l.value.findIndex(T=>T.value===x);if(I<0){s.value=l.value[0].value;return}x===s.value&&(I===0?s.value=l.value[1].value:s.value=l.value[I-1].value),l.value.splice(I,1),o.nextTick(()=>{r.splice(I,1)}),o.triggerRef(l)},C=(x,I=100)=>{const T=c.value.offsetWidth,v=d.value.offsetWidth,E=T-v;x==="next"&&u.x!==E?E>=u.x-I?u.x=E:u.x-=I:x==="prev"&&u.x!==0&&(I*-1<=u.x?u.x=0:u.x+=I)},b=o.reactive({item:{},idx:null});return{mv:s,computedTabList:a,clickTab:p,removeTab:y,listWrapperRef:c,listRef:d,hasScroll:h,listRefStyle:m,scrollTab:C,dragstartTab:(x,I)=>{e.draggable&&(i.value=[...l.value],b.item=x,b.idx=I,n.value=!0)},dragoverTab:x=>{var v;if(!e.draggable||((v=b.item)==null?void 0:v.value)===x)return;const I=i.value.findIndex(E=>{var Z;return E.value===((Z=b.item)==null?void 0:Z.value)}),T=i.value.findIndex(E=>E.value===x);i.value.splice(I,1),i.value.splice(T,0,b.item)},dragendTab:()=>{e.draggable&&(l.value=[...i.value],b.item={},b.idx=null,n.value=!1,i.value.splice(0))},dragSelectCls:x=>{var I;return e.draggable&&((I=b.item)==null?void 0:I.value)===x},selectIdxCls:x=>e.draggable&&b.idx===x,onResize:()=>{g()}}}},Qd={class:"ev-tabs-header"},$d={ref:"listWrapperRef",class:"ev-tabs-list-wrapper"},qd=["onClick","onDragstart","onDragover"],eh=["title"],th=["onClick"],nh={class:"ev-tabs-body"};function ih(e,t,n,i,s,l){const a=o.resolveDirective("resize"),r=o.resolveDirective("observe-visibility");return o.withDirectives((o.openBlock(),o.createElementBlock("section",{class:o.normalizeClass(["ev-tabs",{closable:n.closable,stretch:n.stretch}])},[o.createElementVNode("div",Qd,[o.createElementVNode("div",{class:o.normalizeClass(["ev-tabs-nav-wrapper",{"has-scroll":i.hasScroll}])},[i.hasScroll?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{class:"ev-tabs-arrow prev",onClick:t[0]||(t[0]=c=>i.scrollTab("prev"))},[...t[3]||(t[3]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-left"},null,-1)])]),o.createElementVNode("span",{class:"ev-tabs-arrow next",onClick:t[1]||(t[1]=c=>i.scrollTab("next"))},[...t[4]||(t[4]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-right"},null,-1)])])],64)):o.createCommentVNode("",!0),o.createElementVNode("div",$d,[o.withDirectives((o.openBlock(),o.createElementBlock("ul",{ref:"listRef",class:"ev-tabs-list",style:o.normalizeStyle(i.listRefStyle)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.computedTabList,(c,d)=>(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:`${c.value}_${d}`,class:"ev-tabs-title"},{ref_for:!0},{draggable:n.draggable},{class:{active:c.value===i.mv,"has-icon":c.iconClass,"drag-select":i.dragSelectCls(c.value),"select-idx":i.selectIdxCls(d)},onClick:h=>i.clickTab(c.value),onDragstart:o.withModifiers(h=>i.dragstartTab(c,d),["stop"]),onDragover:o.withModifiers(h=>i.dragoverTab(c.value),["prevent"]),onDragend:t[2]||(t[2]=o.withModifiers((...h)=>i.dragendTab&&i.dragendTab(...h),["prevent"]))}),[c.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["ev-tabs-icon",c.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"text",title:c.text},o.toDisplayString(c.text),9,eh),n.closable?(o.openBlock(),o.createElementBlock("span",{key:1,class:"close-icon",onClick:o.withModifiers(h=>i.removeTab(c.value),["stop"])},[...t[5]||(t[5]=[o.createElementVNode("i",{class:"ev-icon-s-close"},null,-1)])],8,th)):o.createCommentVNode("",!0)],16,qd))),128))],4)),[[a,i.onResize]])],512)],2)]),o.createElementVNode("div",nh,[o.renderSlot(e.$slots,"default")])],2)),[[a,i.onResize],[r,{callback:i.onResize,once:!0}]])}const Dn=ce(jd,[["render",ih]]);Dn.install=e=>{e.component(Dn.name,Dn)};const sh={name:"EvTabPanel",props:{text:{type:[String,Number],default:null},value:{type:[String,Number],default:null,required:!0},disabled:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1}},emits:{},setup(e){const t=o.inject("evTabs",null),n=o.computed(()=>e.value===t.value),i=o.ref(n.value);return o.watch(n,s=>{s&&(i.value=!0)}),{isSelected:n,hasBeenSelected:i}}},oh={key:0,class:"ev-tab-panel"};function lh(e,t,n,i,s,l){return!n.lazy||i.hasBeenSelected?o.withDirectives((o.openBlock(),o.createElementBlock("article",oh,[o.renderSlot(e.$slots,"default")],512)),[[o.vShow,i.isSelected]]):o.createCommentVNode("",!0)}const Bn=ce(sh,[["render",lh]]);Bn.install=e=>{e.component(Bn.name,Bn)};const ah={name:"EvButton",props:{disabled:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},type:{type:String,default:"default"},htmlType:{type:String,default:"button",validator:e=>["button","submit","reset"].includes(e)},shape:{type:String,default:"square"},size:{type:String,default:"medium"}},emits:{click:null},setup(e){const t=o.ref(null);return o.onMounted(()=>{e.autoFocus&&t.value.focus()}),{buttonRef:t}}},rh=["type","disabled","autofocus"];function ch(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("button",{ref:"buttonRef",class:o.normalizeClass(["ev-button",{disabled:n.disabled,[`type-${n.type}`]:!!n.type,[`shape-${n.shape}`]:n.shape!=="square",[`size-${n.size}`]:n.size!=="medium"}]),type:n.htmlType,disabled:n.disabled,autofocus:n.autoFocus,onClick:t[0]||(t[0]=a=>e.$emit("click",a))},[o.renderSlot(e.$slots,"default")],10,rh)}const xn=ce(ah,[["render",ch]]);xn.install=e=>{e.component(xn.name,xn)};const dh={name:"EvButtonGroup"},hh={class:"ev-button-group"};function uh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",hh,[o.renderSlot(e.$slots,"default")])}const On=ce(dh,[["render",uh]]);On.install=e=>{e.component(On.name,On)};const fh={name:"EvCheckbox",props:{modelValue:{type:[String,Number,Boolean,Symbol,Array],default:!1},label:{type:[String,Number,Boolean,Symbol,Object],default:null},tooltipTitle:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:{"update:modelValue":null,"update:indeterminate":[Boolean],change:null},setup(e,{emit:t}){const n=o.ref();o.onMounted(()=>{n.value&&e.tooltipTitle&&(n.value.title=e.tooltipTitle)});const i=o.ref(null),s=o.inject("EvCheckboxGroupMv",o.computed({get:()=>e.modelValue,set:c=>{c&&!i.value.indeterminate&&t("update:indeterminate",!1),t("update:modelValue",c)}})),l=o.computed(()=>e.label),a=o.computed(()=>Array.isArray(s.value)?s.value.includes(l.value):s.value),r=o.inject("EvCheckboxGroupChange",async c=>{await o.nextTick(),t("change",s.value,c)});return o.watch(()=>e.indeterminate,c=>{o.nextTick(()=>{i.value&&(i.value.indeterminate=c)})},{immediate:!0}),{mv:s,checkboxLabel:n,checkbox:i,checked:a,changeMv:r}}},mh=["disabled","value","readonly"],ph={ref:"checkboxLabel",class:"ev-checkbox-label"};function gh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(["ev-checkbox",[{disabled:n.disabled},{checked:i.checked}]])},[o.withDirectives(o.createElementVNode("input",{ref:"checkbox","onUpdate:modelValue":t[0]||(t[0]=a=>i.mv=a),type:"checkbox",class:"ev-checkbox-input",disabled:n.disabled,value:n.label,readonly:n.readonly,onChange:t[1]||(t[1]=(...a)=>i.changeMv&&i.changeMv(...a))},null,40,mh),[[o.vModelCheckbox,i.mv]]),o.createElementVNode("span",ph,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.label),1)],64))],512)],2)}const Sn=ce(fh,[["render",gh]]);Sn.install=e=>{e.component(Sn.name,Sn)};const bh={name:"EvCheckboxGroup",props:{modelValue:{type:Array,default:()=>[]},type:{type:String,default:"checkbox"}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:s=>t("update:modelValue",s)});o.provide("EvCheckboxGroupMv",n);const i=async s=>{await o.nextTick(),t("change",n.value,s)};o.provide("EvCheckboxGroupChange",i)}};function yh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-checkbox-group",{"type-button":n.type==="button"}]),role:"group"},[o.renderSlot(e.$slots,"default")],2)}const Cn=ce(bh,[["render",yh]]);Cn.install=e=>{e.component(Cn.name,Cn)};const xh={name:"EvRadio",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},label:{type:[String,Number,Symbol,Boolean],default:null},disabled:{type:Boolean,default:!1},size:{type:String,default:""}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=o.inject("EvRadioGroupMv",o.computed({get:()=>e.modelValue,set:l=>t("update:modelValue",l)})),i=o.inject("EvRadioGroupChange",async l=>{await o.nextTick(),t("change",n.value,l)}),s=o.computed(()=>n.value===e.label);return{mv:n,checked:s,changeMv:i}}},Sh=["value","disabled"],Ch={class:"ev-radio-label"};function kh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(["ev-radio",[{disabled:n.disabled,checked:i.checked},n.size]])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>i.mv=a),type:"radio",class:"ev-radio-input",value:n.label,disabled:n.disabled,onChange:t[1]||(t[1]=o.withModifiers((...a)=>i.changeMv&&i.changeMv(...a),["stop"]))},null,40,Sh),[[o.vModelRadio,i.mv]]),o.createElementVNode("span",Ch,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.label),1)],64))])],2)}const Yn=ce(xh,[["render",kh]]);Yn.install=e=>{e.component(Yn.name,Yn)};const wh={name:"EvRadioGroup",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},type:{type:String,default:"radio"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:s=>t("update:modelValue",s)});o.provide("EvRadioGroupMv",n);const i=async s=>{await o.nextTick(),t("change",n.value,s)};o.provide("EvRadioGroupChange",i)}};function Ih(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-radio-group",{"type-button":n.type==="button"}]),role:"group"},[o.renderSlot(e.$slots,"default")],2)}const Fn=ce(wh,[["render",Ih]]);Fn.install=e=>{e.component(Fn.name,Fn)};const Ji={mounted(e,t){const n=e,i=t.modifiers.bubbles,s=l=>{(i||n!==l.target&&!n.contains(l.target))&&t.value(l)};n.vueClickOutside=s,document.addEventListener("mousedown",s)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}},Th={mounted(e,t){const n=e;let i=null;const s=t.modifiers.bubble,l=document.body.getElementsByClassName("ev-select-dropbox"),a="ev-tag-name",r="ev-tag-suffix-close",c=d=>{if(!(d.target.classList.contains(a)||d.target.classList.contains(r))&&l&&l.length&&(s||n!==d.target&&!n.contains(d.target))){for(let h=0;h<l.length;h++)if(i=l[h],i!==d.target&&!i.contains(d.target)){t.value(d);break}}};n.vueClickOutside=c,document.addEventListener("mousedown",c)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}},Lh={mounted(e,t){const n=e,i=t.modifiers.bubbles,s=document.body.getElementsByClassName("ev-date-picker-dropdown"),l=a=>{(!s&&(i||n!==a.target&&!n.contains(a.target))||s&&s[0]&&s[0]!==a.target&&!s[0].contains(a.target)&&n!==a.target&&!n.contains(a.target))&&t.value(a)};n.vueClickOutside=l,document.addEventListener("mousedown",l)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}};var Yt=function(){return Yt=Object.assign||function(t){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Yt.apply(this,arguments)};function kn(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,l;i<s;i++)(l||!(i in t))&&(l||(l=Array.prototype.slice.call(t,0,i)),l[i]=t[i]);return e.concat(l||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ji=44032,Hn=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],He=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"],Ze=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Ft={ㄲ:["ㄱ","ㄱ"],ㄳ:["ㄱ","ㅅ"],ㄵ:["ㄴ","ㅈ"],ㄶ:["ㄴ","ㅎ"],ㄺ:["ㄹ","ㄱ"],ㄻ:["ㄹ","ㅁ"],ㄼ:["ㄹ","ㅂ"],ㄽ:["ㄹ","ㅅ"],ㄾ:["ㄹ","ㅌ"],ㄿ:["ㄹ","ㅍ"],ㅀ:["ㄹ","ㅎ"],ㅄ:["ㅂ","ㅅ"],ㅆ:["ㅅ","ㅅ"],ㅘ:["ㅗ","ㅏ"],ㅙ:["ㅗ","ㅐ"],ㅚ:["ㅗ","ㅣ"],ㅝ:["ㅜ","ㅓ"],ㅞ:["ㅜ","ㅔ"],ㅟ:["ㅜ","ㅣ"],ㅢ:["ㅡ","ㅣ"]},go={ㅗ:["ㅗ","ㅚ"],ㅜ:["ㅜ","ㅟ"],ㅡ:["ㅡ","ㅢ"]},Ia=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ","ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅛ","ㅜ","ㅠ","ㅡ","ㅣ"],Ta=[["ㄱ","r"],["ㄲ","R"],["ㄴ","s"],["ㄷ","e"],["ㄸ","E"],["ㄹ","f"],["ㅁ","a"],["ㅂ","q"],["ㅃ","Q"],["ㅅ","t"],["ㅆ","T"],["ㅇ","d"],["ㅈ","w"],["ㅉ","W"],["ㅊ","c"],["ㅋ","z"],["ㅌ","x"],["ㅍ","v"],["ㅎ","g"],["ㅏ","k"],["ㅐ","o"],["ㅑ","i"],["ㅒ","O"],["ㅓ","j"],["ㅔ","p"],["ㅕ","u"],["ㅖ","P"],["ㅗ","h"],["ㅛ","y"],["ㅜ","n"],["ㅠ","b"],["ㅡ","m"],["ㅣ","l"]];function La(e){var t="",n="",i="",s=-1,l=-1,a=-1;if(e.match(/[ㄱ-ㅎ]/))t=e,s=Hn.join("").search(e);else if(e.match(/[가-힣]/)){var r=e.charCodeAt(0)-ji;a=r%Ze.length,l=(r-a)/Ze.length%He.length,s=((r-a)/Ze.length-l)/He.length,t=Hn[s],n=He[l],i=Ze[a]}return{initial:t,medial:n,finale:i,initialOffset:s,medialOffset:l,finaleOffset:a}}[["은","는"],["이","가"],["을","를"],["과","와"]].reduce(function(e,t){var n=t[0],i=t[1];return kn(kn([],e,!0),[[RegExp(`([가-힣]['" ]{0,1})`.concat(n,"\\(").concat(i,"\\)(\\s+)"),"g"),n,i],[RegExp(`([가-힣]['" ]{0,1})`.concat(i,"\\(").concat(n,"\\)(\\s+)"),"g"),n,i]],!1)},[]);function Mh(e,t){var n=t===void 0?{}:t,i=n.grouped,s=i===void 0?!1:i,l=[];return e.split("").forEach(function(a){var r=La(a),c=r.initial,d=r.medial,h=r.finale,u=r.initialOffset,m=r.medialOffset,f=r.finaleOffset;l.push((u!==-1||m!==-1||f!==-1?[c,Ft[d]&&Ia.indexOf(d)===-1?Ft[d]:d,Ft[h]&&Ia.indexOf(h)===-1?Ft[h]:h].filter(Boolean):[a]).flat())}),s?l:l.flat()}var tn=Object.entries(Ft).reduce(function(e,t){var n,i=t[0],s=t[1];return Yt(Yt({},e),(n={},n[s.join("")]=i,n))},{}),Ma=function(e){return typeof e<"u"};function vh(e){var t=e.findIndex(function(d){return He.indexOf(d)!==-1}),n=t!==-1&&He.indexOf(e[t+1])!==-1?t+1:t,i=e.slice(0,t).join(""),s=e.slice(t,n+1).join(""),l=e.slice(n+1).join(""),a=Hn.indexOf(tn[i]||i),r=He.indexOf(tn[s]||s),c=Ze.indexOf(tn[l]||l);return a!==-1&&r!==-1?String.fromCharCode(ji+a*(He.length*Ze.length)+r*Ze.length+c):e.join("")}function Rh(e){var t=[];(typeof e=="string"?e.split(""):e).forEach(function(l,a,r){typeof l=="string"&&t.length>0&&He.indexOf(r[a-1])!==-1&&He.indexOf(l)!==-1&&tn["".concat(r[a-1]).concat(l)]?t[t.length-1]=tn["".concat(r[a-1]).concat(l)]:t.push(l)});var n={medial:null,finales:[]},i=[n];t.forEach(function(l){Array.isArray(l)?(n={medial:null,finales:[]},i.push({grouped:l,finales:[]}),i.push(n)):He.indexOf(l)!==-1?(n={medial:l,finales:[]},i.push(n)):n.finales.push(l)}),i.forEach(function(l,a,r){if(a>0){var c=r[a-1];if(!c.medial||c.finales.length===1)l.initials=c.finales,c.finales=[];else{var d=c.finales,h=d[0],u=d.slice(1);l.initials=u,c.finales=h?[h]:[]}if(l.finales.length>2||a===i.length-1&&l.finales.length>1){var m=l.finales,f=m[0],g=m[1],p=m.slice(2);tn["".concat(f).concat(g)]&&(l.finales=kn([tn["".concat(f).concat(g)]],p,!0))}}});var s=[];return i.forEach(function(l){var a=l.initials,r=a===void 0?[]:a,c=l.medial,d=l.finales,h=l.grouped;if(h)s.push(h);else{var u=r.slice(),m=u.pop(),f=d[0],g=d.slice(1);Ze.indexOf(f)===-1&&(g=kn([f],g,!0),f=""),u.filter(Ma).forEach(function(p){return s.push([p])}),s.push([m,c,f].filter(Boolean)),g.filter(Ma).forEach(function(p){return s.push([p])})}}),s.map(vh).join("")}var Vh=Object.values(Ta).reduce(function(e,t){var n,i=t[0],s=t[1];return Yt(Yt({},e),(n={},n[s]=i,n))},{});function va(e){return Rh(e.split("").map(function(t){return Vh[t]||t}).join(""))}var Ra=/[\\^$.*+?()[\]{}|]/g,Eh=RegExp(Ra.source);function bo(e){return e&&Eh.test(e)?e.replace(Ra,"\\$&"):e||""}var Qi=function(e,t){t===void 0&&(t=!1);var n=Hn.indexOf(e);if(n!==-1){var i=n*He.length*Ze.length+ji;return"[".concat(t?e:"").concat(String.fromCharCode(i),"-").concat(String.fromCharCode(i+He.length*Ze.length-1),"]")}return e},Va="__".concat(parseInt("fuzzy",36),"__"),Ea="__".concat(parseInt("ignorespace",36),"__"),Wh=function(){var e,t;return function(n,i){var s=i===void 0?{}:i,l=s.initialSearch,a=l===void 0?!1:l,r=s.startsWith,c=r===void 0?!1:r,d=s.endsWith,h=d===void 0?!1:d,u=s.ignoreSpace,m=u===void 0?!1:u,f=s.ignoreCase,g=f===void 0?!0:f,p=s.global,y=p===void 0?!1:p,C=s.fuzzy,b=C===void 0?!1:C,k=s.nonCaptureGroup,L=k===void 0?!1:k,w=s.engToKor,M=w===void 0?!1:w;if(e===n)return t;var V=n,S=[];if(M&&n.trim().match(/^([a-zA-Z0-9\s]{2,})$/)){var x=va(n.trim());x.match(/^[가-힣ㄱ-ㅎ0-9]/)&&(V=x,S.push(bo(n.trim())))}var I=V.split(""),T=I.slice(-1)[0],v="",E=La(T||"");if(E.initialOffset!==-1){I=I.slice(0,-1);var Z=E.initial,W=E.medial,R=E.finale,X=E.initialOffset,G=E.medialOffset,N=X*He.length*Ze.length+ji,P=[];switch(!0){case R!=="":{P.push(T),Hn.includes(R)&&P.push("".concat(String.fromCharCode(N+G*Ze.length)).concat(Qi(R))),Ft[R]&&P.push("".concat(String.fromCharCode(N+G*Ze.length+Ze.join("").search(Ft[R][0])+1)).concat(Qi(Ft[R][1])));break}case W!=="":{var B=void 0,H=void 0;go[W]?(B=N+He.join("").search(go[W][0])*Ze.length,H=N+He.join("").search(go[W][1])*Ze.length+Ze.length-1):(B=N+G*Ze.length,H=B+Ze.length-1),P.push("[".concat(String.fromCharCode(B),"-").concat(String.fromCharCode(H),"]"));break}case Z!=="":{P.push(Qi(Z,!0));break}}v=P.length>1?L?"(?:".concat(P.join("|"),")"):"(".concat(P.join("|"),")"):P[0]}var D=b?Va:m?Ea:"",Y=a?I.map(function(j){return j.search(/[ㄱ-ㅎ]/)!==-1?Qi(j,!0):bo(j)}).join(D):bo(I.join(D)),F=Y.trim()!==""&&v.trim()!=="",O=F?"".concat(Y).concat(D).concat(v):"".concat(Y).concat(v),z=(c?"^":"")+O+(h?"$":"");return D&&(z=z.replace(RegExp(Va,"g"),".*").replace(RegExp(Ea,"g"),"\\s*")),S.length>0&&(z=kn(kn([],S,!0),[z],!1).map(function(j){return"(".concat(j,")")}).join("|")),t=RegExp(z,(y?"g":"")+(g?"i":"")),t}}(),Gh=Object.values(Ta).reduce(function(e,t){var n,i=t[0],s=t[1];return Yt(Yt({},e),(n={},n[i]=s,n))},{});function Zh(e){return e.split("").map(function(t){return Mh(t,{grouped:!1}).map(function(n){return Gh[n]||n})}).flat().join("")}const Wa=new Set,Ga=(e,...t)=>{Wa.has(e)||(Wa.add(e),console.warn(...t))},Xh=(e,t="Component")=>{if(!e)return"body";const n=`${t}::${e}`;try{const i=document.querySelector(e);return i||(Ga(n,`[${t}] teleport selector "${e}" did not match any element. Falling back to document.body.`),document.body)}catch(i){return Ga(n,`[${t}] teleport selector "${e}" is invalid. Falling back to document.body.`,i),document.body}},Nh=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n={get:()=>e.items.some(p=>p.value===e.modelValue)?e.modelValue:null,set:p=>t("update:modelValue",p)},i={get:()=>Array.isArray(e.modelValue)?e.modelValue:[],set:p=>t("update:modelValue",p)},s=o.computed(e.multiple?i:n),l=()=>{var p;return(p=e.items.find(y=>y.value===s.value))==null?void 0:p.name},a=()=>e.items.filter(p=>e.modelValue.includes(p.value)),r=o.computed(e.multiple?a:l),c=o.computed(()=>e.multiple&&s.value.length?null:e.placeholder),d=()=>s.value,h=()=>s.value.length,u=o.computed(e.multiple?h:d),m=()=>{e.disabled||(e.multiple?(s.value.splice(0),s.value=[...s.value]):s.value=null)},f=async()=>{await o.nextTick(),t("change",s.value)};return{mv:s,selectedModel:r,computedPlaceholder:c,isClearableIcon:u,removeAllMv:m,removeMv:async p=>{if(!e.disabled){const y=s.value.indexOf(p);s.value.splice(y,1),s.value=[...s.value],await f()}},changeMv:f}},Ph=e=>{const{props:t}=o.getCurrentInstance(),{mv:n,changeMv:i}=e,s=o.ref(!1),l=o.ref(t.filterText),a=o.ref(null),r=o.ref(null),c=o.ref(null),d=o.ref(null),h=o.ref("100%"),u=o.ref(null),m=o.reactive({top:0,left:"auto"}),f=o.ref(!1),g=o.ref("body"),p=(D,Y)=>D?[D,va(D),Zh(D)].filter(Boolean).map(F=>Wh(F,Y)):[],y=o.computed(()=>{var F;const D=(F=l.value)==null?void 0:F.trim();if(!D||!t.filterable)return t.items;const Y=p(D);return t.items.filter(({name:O})=>Y.some(z=>O.search(z)>-1))}),C=o.computed(()=>{var D,Y;return!!((D=t.highlight)!=null&&D.match)&&t.filterable&&!!((Y=l.value)!=null&&Y.trim())}),b=o.computed(()=>{var D;return p((D=l.value)==null?void 0:D.trim(),{global:!0})}),k=D=>{const Y=[{text:D,matched:!1}];if(typeof D!="string"||!D)return Y;const F=[];if(b.value.forEach(U=>{U.lastIndex=0;let Q=U.exec(D);for(;Q;)Q[0].length?F.push([Q.index,Q.index+Q[0].length]):U.lastIndex+=1,Q=U.exec(D)}),!F.length)return Y;F.sort((U,Q)=>U[0]-Q[0]);const O=[F[0]];F.slice(1).forEach(([U,Q])=>{const J=O[O.length-1];U<=J[1]?J[1]=Math.max(J[1],Q):O.push([U,Q])});const z=[];let j=0;return O.forEach(([U,Q])=>{U>j&&z.push({text:D.slice(j,U),matched:!1}),z.push({text:D.slice(U,Q),matched:!0}),j=Q}),j<D.length&&z.push({text:D.slice(j),matched:!1}),z},L=o.computed(()=>C.value?y.value.map(({name:D})=>k(D)):[]),w=o.computed(()=>{var D;return(D=t.highlight)!=null&&D.color?{color:t.highlight.color}:null}),M=D=>{var Y;l.value=(Y=D==null?void 0:D.target)==null?void 0:Y.value},V=D=>{let Y=D==null?void 0:D.parentElement;for(;Y&&Y!==document.documentElement;){const F=window.getComputedStyle(Y);if(/(auto|scroll|overlay|hidden|clip)/.test(F.overflowY))return Y;Y=Y.parentElement}return document.documentElement},S=async({recomputeDirection:D=!1}={})=>{if(await o.nextTick(),!r.value||!c.value)return;const Y=r.value.getBoundingClientRect(),F=Y.height,O=Y.y,z=c.value.getBoundingClientRect().height;if(t.teleport){const j=document.documentElement.clientHeight;if(D){const U=Y.top,Q=j-Y.bottom,J=z>Q;f.value=J&&U>Q&&U>=z}m.top=f.value?`${Y.top-z}px`:`${Y.bottom}px`,m.left=`${Y.left}px`;return}if(D){const j=V(r.value),U=j===document.documentElement,Q=j.getBoundingClientRect(),J=document.documentElement.clientHeight,ne=U?J:Math.min(Q.bottom,J),q=U?0:Math.max(Q.top,0),ee=O-q,$=ne-(O+F),he=z>$;f.value=he&&ee>$&&ee>=z}f.value?m.top=`-${z}px`:m.top=`${F}px`,m.left="auto"},x=()=>{var z,j,U;if(!((U=(j=(z=d.value)==null?void 0:z.children[0])==null?void 0:j.children)!=null&&U.length))return;const D="selected",Y=d.value.children[0].children,F=d.value.offsetTop;let O=null;for(let Q=0;Q<Y.length;Q++)if(O=Y[Q],O.classList.contains(D)){if(!O.offsetTop)return;d.value.scrollTop=O.offsetTop-F;break}},I=async()=>{if(d.value&&c.value){await o.nextTick(),(u.value===null||u.value!==r.value.offsetWidth)&&(u.value=r.value.offsetWidth),t.teleport||(h.value=`${u.value}px`,await o.nextTick());const D=d.value.querySelectorAll(".ev-select-dropbox-item");let Y=0;D.forEach(ee=>{const $=ee.scrollWidth;$>Y&&(Y=$)});const{borderLeftWidth:F,borderRightWidth:O}=window.getComputedStyle(c.value),z=parseInt(F)+parseInt(O),j=d.value.offsetWidth-d.value.clientWidth;Y+=j+z;const U=window.innerWidth,J=c.value.getBoundingClientRect().left,ne=U-J-20,q=Math.max(Math.min(Y,ne),u.value);h.value=`${q}px`}else h.value="100%"};o.watch(()=>s.value,async D=>{D&&(await x(),await I())}),o.watch(()=>y.value,async()=>{await S()});const T=async()=>{if(t.items.length&&!t.disabled&&(s.value=!s.value,s.value)){if(t.teleport&&(g.value=Xh(t.teleport,"EvSelect"),r.value)){const D=r.value.getBoundingClientRect();h.value=`${D.width}px`,m.top=`${D.bottom}px`,m.left=`${D.left}px`}await S({recomputeDirection:!0})}},v=()=>{t.filterable&&(l.value=""),s.value=!1},E=o.ref(!1),Z=D=>{D||(E.value=!E.value),E.value?n.value=y.value.filter(Y=>!Y.disabled).map(Y=>Y.value):n.value=[]},W=D=>{t.filterable&&(l.value=""),s.value=!1,n.value!==D&&(n.value=D,i())},R=D=>{if(t.filterable&&(l.value=""),!n.value.includes(D))n.value.push(D);else{const Y=n.value.indexOf(D);n.value.splice(Y,1)}E.value=n.value.length===y.value.filter(Y=>!Y.disabled).length,n.value=[...n.value],i()},X=t.multiple?R:W,G=D=>D===n.value,N=D=>n.value.includes(D),P=t.multiple?N:G;o.watch(()=>n.value,D=>{t.multiple&&t.checkable&&(D.length===0?E.value=!1:E.value=D.length===y.value.filter(Y=>!Y.disabled).length,S())});const B=()=>{if(s.value){if(t.teleport){v();return}I(),S({recomputeDirection:!0})}},H=D=>{var O,z;if(!s.value)return;const Y=D.target;Y instanceof Element&&((O=c.value)!=null&&O.contains(Y)||(z=a.value)!=null&&z.contains(Y))||v()};return o.onMounted(()=>{window.addEventListener("resize",B)}),o.onUnmounted(()=>{window.removeEventListener("resize",B)}),o.watch(()=>!!t.teleport&&s.value,(D,Y,F)=>{D&&(window.addEventListener("scroll",H,{capture:!0,passive:!0}),F(()=>{window.removeEventListener("scroll",H,{capture:!0})}))}),{select:a,selectWrapper:r,dropbox:c,itemWrapper:d,isDropbox:s,dropboxPosition:m,filterTextRef:l,filteredItems:y,isHighlightMatch:C,itemChunks:L,highlightStyle:w,clickSelectInput:T,clickOutsideDropbox:v,changeFilterText:M,changeDropboxPosition:S,clickItem:X,selectedItemClass:P,allCheck:E,changeAllCheck:Z,dropboxWidth:h,teleportTarget:g}},Dh={name:"EvSelect",components:{EvCheckbox:Sn,EvCheckboxGroup:Cn},directives:{clickoutside:Th},props:{modelValue:{type:[Boolean,String,Number,Array,Object],default:null},placeholder:{type:String,default:""},searchPlaceholder:{type:String,default:"Please Enter a Search Words."},noMatchingText:{type:String,default:"NO MATCHING DATA"},items:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},filterText:{type:String,default:""},allCheckLabel:{type:String,default:"Select All"},teleport:{type:String,default:""},tagMaxRows:{type:Number,default:0,validator:e=>Number.isInteger(e)&&e>=0},highlight:{type:Object,default:()=>({}),validator:e=>(e.match===void 0||typeof e.match=="boolean")&&(e.color===void 0||typeof e.color=="string")&&Object.keys(e).every(t=>["match","color"].includes(t))}},emits:{"update:modelValue":null,change:null},setup(e){const t=o.computed(()=>e.tagMaxRows>0),{mv:n,selectedModel:i,computedPlaceholder:s,isClearableIcon:l,changeMv:a,removeMv:r,removeAllMv:c}=Nh(),{select:d,selectWrapper:h,dropbox:u,itemWrapper:m,isDropbox:f,dropboxPosition:g,filterTextRef:p,filteredItems:y,isHighlightMatch:C,itemChunks:b,highlightStyle:k,clickSelectInput:L,clickOutsideDropbox:w,changeFilterText:M,changeDropboxPosition:V,clickItem:S,selectedItemClass:x,allCheck:I,changeAllCheck:T,dropboxWidth:v,teleportTarget:E}=Ph({mv:n,changeMv:a});return{hasMaxRows:t,mv:n,selectedModel:i,computedPlaceholder:s,isClearableIcon:l,changeMv:a,removeMv:r,removeAllMv:c,select:d,selectWrapper:h,dropbox:u,itemWrapper:m,isDropbox:f,dropboxPosition:g,filterTextRef:p,filteredItems:y,isHighlightMatch:C,itemChunks:b,highlightStyle:k,clickSelectInput:L,clickOutsideDropbox:w,changeFilterText:M,changeDropboxPosition:V,clickItem:S,selectedItemClass:x,allCheck:I,changeAllCheck:T,dropboxWidth:v,teleportTarget:E}}},Bh={ref:"selectWrapper",class:"ev-select__wrapper"},Oh=["placeholder","disabled"],Yh=["tabindex","placeholder","disabled"],Fh={class:"ev-tag-name"},Hh=["onClick"],zh={class:"ev-tag-name"},Ah={class:"ev-tag-name"},_h={class:"ev-select-dropbox-wrapper"},Kh=["placeholder","value"],Uh={ref:"itemWrapper",class:"ev-select-dropbox-list"},Jh={key:0,class:"ev-select-dropbox-ul"},jh=["title","onClick"],Qh={key:1},$h={class:"ev-select-dropbox-item disabled"},qh={key:0,class:"ev-select-dropbox-ul"},eu=["title","onClick"],tu={key:2,ref:"itemWrapper",class:"ev-select-dropbox-list"},nu={key:0,class:"ev-select-dropbox-ul"},iu=["title","onClick"],su={key:1},ou={class:"ev-select-dropbox-item disabled"};function lu(e,t,n,i,s,l){const a=o.resolveComponent("ev-checkbox"),r=o.resolveComponent("ev-checkbox-group"),c=o.resolveDirective("clickoutside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"select",class:o.normalizeClass(["ev-select",{selected:i.isDropbox,disabled:n.disabled}])},[o.createElementVNode("div",Bh,[n.multiple?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["ev-select-tag-wrapper",{"has-max-rows":i.hasMaxRows}]),style:o.normalizeStyle(i.hasMaxRows?{"--ev-select-tag-max-rows":n.tagMaxRows}:null),onClick:t[9]||(t[9]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:t[3]||(t[3]=o.withModifiers((...d)=>i.clickSelectInput&&i.clickSelectInput(...d),["stop"]))},[o.createElementVNode("i",{class:o.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:i.isDropbox}])},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("input",{type:"text",class:"ev-input multiple",readonly:"",tabindex:i.hasMaxRows?-1:null,placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:t[4]||(t[4]=o.withModifiers((...d)=>i.clickSelectInput&&i.clickSelectInput(...d),["stop"]))},null,8,Yh),n.collapseTags?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[i.selectedModel.length?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ev-select-tag",onClick:t[7]||(t[7]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",zh,o.toDisplayString(i.selectedModel[0].name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:t[6]||(t[6]=o.withModifiers(d=>[i.removeMv(i.selectedModel[0].value),i.changeDropboxPosition()],["stop"]))},[...t[17]||(t[17]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])])])):o.createCommentVNode("",!0),i.selectedModel.length>1?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-select-tag num",onClick:t[8]||(t[8]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",Ah," + "+o.toDisplayString(i.selectedModel.length-1),1)])):o.createCommentVNode("",!0)],64)):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.selectedModel,d=>(o.openBlock(),o.createElementBlock("div",{key:d,class:"ev-select-tag",onClick:t[5]||(t[5]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("span",Fh,o.toDisplayString(d.name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:o.withModifiers(h=>[i.removeMv(d.value),i.changeDropboxPosition()],["stop"])},[...t[16]||(t[16]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,Hh)]))),128))],6)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:t[0]||(t[0]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[o.createElementVNode("i",{class:o.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:i.isDropbox}])},null,2)])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=d=>i.selectedModel=d),type:"text",class:"ev-input",readonly:"",placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:t[2]||(t[2]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},null,8,Oh),[[o.vModelText,i.selectedModel]])],64)),n.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-input-suffix",onClick:t[10]||(t[10]=o.withModifiers(d=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...t[18]||(t[18]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",_h,[(o.openBlock(),o.createBlock(o.Teleport,{to:i.teleportTarget,disabled:!n.teleport},[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:o.normalizeClass(["ev-select-dropbox",{teleported:!!n.teleport}]),style:o.normalizeStyle([i.dropboxPosition,{width:i.dropboxWidth}])},[n.filterable?o.renderSlot(e.$slots,"search-filter",{key:0,item:{value:i.filterTextRef,onInput:i.changeFilterText,class:"ev-input-query",placeholder:n.searchPlaceholder}},()=>[o.createElementVNode("input",{type:"text",class:"ev-input-query",placeholder:n.searchPlaceholder,value:i.filterTextRef,onInput:t[11]||(t[11]=(...d)=>i.changeFilterText&&i.changeFilterText(...d))},null,40,Kh)]):o.createCommentVNode("",!0),n.checkable?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.multiple?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-select-dropbox-item all-check",{selected:i.allCheck}]),onClick:t[14]||(t[14]=o.withModifiers(d=>[i.changeAllCheck(!1),i.changeDropboxPosition()],["self","prevent"]))},[o.createVNode(a,{modelValue:i.allCheck,"onUpdate:modelValue":t[12]||(t[12]=d=>i.allCheck=d),label:n.allCheckLabel,onChange:t[13]||(t[13]=d=>[i.changeAllCheck(!0),i.changeDropboxPosition()])},null,8,["modelValue","label"])],2)):o.createCommentVNode("",!0),o.createElementVNode("div",Uh,[n.multiple?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.mv,"onUpdate:modelValue":t[15]||(t[15]=d=>i.mv=d)},{default:o.withCtx(()=>[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",Jh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["self","prevent"])},[o.createVNode(a,{label:d.value,disabled:d.disabled},{default:o.withCtx(()=>[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,m)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:m},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))]),_:2},1032,["label","disabled"])],10,jh))),128))])):(o.openBlock(),o.createElementBlock("ul",Qh,[o.createElementVNode("li",$h,o.toDisplayString(n.noMatchingText),1)]))]),_:1},8,["modelValue"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",qh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["stop","prevent"])},[o.createVNode(a,{"model-value":i.mv===d.value,disabled:d.disabled},{default:o.withCtx(()=>[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,m)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:m},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))]),_:2},1032,["model-value","disabled"])],10,eu))),128))])):o.createCommentVNode("",!0)],64))],512)],64)):(o.openBlock(),o.createElementBlock("div",tu,[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",nu,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["stop","prevent"])},[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),i.isHighlightMatch?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.itemChunks[h],(u,m)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:m},[u.matched?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-select-item-highlight",style:o.normalizeStyle(d.disabled?null:i.highlightStyle)},o.toDisplayString(u.text),5)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(u.text),1)],64))],64))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString(d.name),1)],64))],10,iu))),128))])):(o.openBlock(),o.createElementBlock("ul",su,[o.createElementVNode("li",ou,o.toDisplayString(n.noMatchingText),1)]))],512))],6)):o.createCommentVNode("",!0)],8,["to","disabled"]))])],512)],2)),[[c,i.clickOutsideDropbox]])}const zn=ce(Dh,[["render",lu]]);zn.install=e=>{e.component(zn.name,zn)};const au={name:"EvToggle",props:{modelValue:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:40},activeColor:{type:String,default:"#409EFF"},inactiveColor:{type:String,default:"#DCDFE6"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:s=>{t("update:modelValue",s),t("change",s)}});return{mv:n,clickMv:()=>{!e.disabled&&!e.readonly&&(n.value=!n.value)}}}};function ru(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-toggle",{checked:n.modelValue,disabled:n.disabled,readonly:n.readonly}]),style:o.normalizeStyle({width:`${n.width}px`,border:`1px solid ${n.modelValue?n.activeColor:n.inactiveColor}`,"background-color":`${n.modelValue?n.activeColor:n.inactiveColor}`}),onClick:t[0]||(t[0]=(...a)=>i.clickMv&&i.clickMv(...a))},null,6)}const An=ce(au,[["render",ru]]);An.install=e=>{e.component(An.name,An)};const cu={name:"EvTextField",props:{modelValue:{type:[String,Number],default:null},type:{type:String,default:"text"},placeholder:{type:String,default:""},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},maxLength:{type:Number,default:null},maxUnit:{type:String,default:"count"},showMaxLength:{type:Boolean,default:!1},errorMsg:{type:String,default:""},autocomplete:{type:String,default:"off"},modelModifiers:{type:Object,default:()=>({})}},emits:["update:modelValue","focus","blur","input","change","search"],setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:p=>t("update:modelValue",p)}),i=o.ref(!1),s=()=>{e.type==="password"&&(i.value=!i.value)},l=o.computed(()=>e.type==="password"?i.value?"text":"password":e.type==="search"?"text":e.type);o.watch(()=>e.type,p=>{p!=="password"&&(i.value=!1)});const a=()=>{n.value=""},r=()=>{t("search",n.value)},c=p=>{e.type==="search"&&(p.key==="Enter"||p.keyCode===13)&&r()},d=p=>{t("focus",p)},h=p=>{if(e.modelModifiers.trim&&typeof p.target.value=="string"){const y=p.target.value.trim();y!==p.target.value&&(n.value=y,p.target.value=y)}t("blur",p)},u=p=>new TextEncoder().encode(p).length,m=o.computed(()=>e.maxUnit==="byte"?u(n.value||""):(n.value||"").length);return{mv:n,inputType:l,isPasswordVisible:i,clearValue:a,changePasswordVisible:s,searchValue:r,keyupInput:c,focusInput:d,blurInput:h,inputMv:p=>{let y=p.target.value;if(e.maxLength&&e.maxUnit==="byte"){for(;u(y)>e.maxLength;)y=y.slice(0,-1);p.target.value=y}n.value=y,t("input",y,p)},changeMv:p=>t("change",n.value,p),currentLength:m}}},du={class:"ev-text-field-wrapper"},hu=["placeholder","disabled","readonly","autocomplete","maxlength"],uu=["type","placeholder","disabled","readonly","autocomplete","maxlength"],fu={key:3,class:"ev-text-field-icon icon-suffix"},mu={key:4,class:"ev-text-field-icon icon-prefix"},pu={key:0,class:"ev-text-field-error"},gu={class:"curr-length"};function bu(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-text-field",{disabled:n.disabled,clearable:n.clearable,readonly:n.readonly,error:!!n.errorMsg,"show-password":n.showPassword,"show-maxlength":n.showMaxLength,[`type-${n.type}`]:!!n.type,"ev-text-field-prefix":e.$slots["icon-prefix"],"ev-text-field-suffix":e.$slots["icon-suffix"],"ev-text-field-prefix-suffix":e.$slots["icon-prefix"]&&e.$slots["icon-suffix"]}])},[o.createElementVNode("div",du,[n.type==="textarea"?o.withDirectives((o.openBlock(),o.createElementBlock("textarea",{key:0,"onUpdate:modelValue":t[0]||(t[0]=a=>i.mv=a),class:"ev-textarea",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:t[1]||(t[1]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:t[2]||(t[2]=(...a)=>i.blurInput&&i.blurInput(...a)),onInput:t[3]||(t[3]=(...a)=>i.inputMv&&i.inputMv(...a)),onChange:t[4]||(t[4]=(...a)=>i.changeMv&&i.changeMv(...a))},null,40,hu)),[[o.vModelText,i.mv]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[5]||(t[5]=a=>i.mv=a),class:"ev-input",type:i.inputType,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:t[6]||(t[6]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:t[7]||(t[7]=(...a)=>i.blurInput&&i.blurInput(...a)),onInput:t[8]||(t[8]=(...a)=>i.inputMv&&i.inputMv(...a)),onChange:t[9]||(t[9]=(...a)=>i.changeMv&&i.changeMv(...a)),onKeyup:t[10]||(t[10]=(...a)=>i.keyupInput&&i.keyupInput(...a))},null,40,uu),[[o.vModelDynamic,i.mv]]),n.type==="text"&&n.clearable?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-text-field-icon icon-clear",onClick:t[11]||(t[11]=(...a)=>i.clearValue&&i.clearValue(...a))},[...t[14]||(t[14]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])])):o.createCommentVNode("",!0),n.type==="password"&&n.showPassword?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["ev-text-field-icon icon-password",{on:i.isPasswordVisible}]),onClick:t[12]||(t[12]=(...a)=>i.changePasswordVisible&&i.changePasswordVisible(...a))},[o.createElementVNode("i",{class:o.normalizeClass(i.isPasswordVisible?"ev-icon-visibility":"ev-icon-visibility-off")},null,2)],2)):o.createCommentVNode("",!0),n.type==="search"?(o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-text-field-icon icon-search",onClick:t[13]||(t[13]=(...a)=>i.searchValue&&i.searchValue(...a))},[...t[15]||(t[15]=[o.createElementVNode("i",{class:"ev-icon-search"},null,-1)])])):o.createCommentVNode("",!0),e.$slots["icon-suffix"]?(o.openBlock(),o.createElementBlock("span",fu,[o.renderSlot(e.$slots,"icon-suffix")])):o.createCommentVNode("",!0),e.$slots["icon-prefix"]?(o.openBlock(),o.createElementBlock("span",mu,[o.renderSlot(e.$slots,"icon-prefix")])):o.createCommentVNode("",!0)],64))]),n.errorMsg?(o.openBlock(),o.createElementBlock("div",pu,o.toDisplayString(n.errorMsg),1)):o.createCommentVNode("",!0),n.maxLength&&n.showMaxLength?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["ev-text-field-maxlength",{max:i.currentLength>n.maxLength}])},[o.createElementVNode("span",gu,o.toDisplayString(i.currentLength),1),o.createTextVNode(" / "+o.toDisplayString(n.maxLength)+o.toDisplayString(n.maxUnit==="byte"?" Bytes":""),1)],2)):o.createCommentVNode("",!0)],2)}const _n=ce(cu,[["render",bu]]);_n.install=e=>{e.component(_n.name,_n)};const nn=globalThis.console,be={log(...e){nn.log(...e)},warn(...e){nn.warn(...e)},info(...e){nn.info(...e)},error(...e){nn.error(...e)},debug(...e){nn.debug(...e)},dir(e,t){nn.dir(e,t)},table(e,t){nn.table(e,t)}};function Za(e){let t=null;if(typeof e=="string"||typeof e=="number"){const n=/^(normal|(-*\d+(?:\.\d+)?)(px|%)?)$/.exec(e);t=n?{value:+n[2],unit:n[3]||void 0}:null}return t}function Re(e){return typeof e=="number"&&!Number.isNaN(e)}function kt(...e){return e.every(Re)}function qe(e,t){const n=e/t*100;return!kt(e,t,n)||e===0||t===0?0:n.toFixed(2)}function yu(e){return kt(e)?1e6*e:0}function xu(e){return kt(e)?1e9*e:0}function Su(e){return kt(e)?1e12*e:0}function Cu(e){return kt(e)?1e15*e:0}function sn(e){const t=/\B(?=(\d{3})+(?!\d))/g;if(kt(e)){if(Number.isInteger(e))return e.toString().replace(t,",");const n=e.toString().split(".");return n[0].replace(t,",")+(n[1]?`.${n[1]}`:"")}return!1}function Kn(e){const t=(e==null?void 0:e.toString().split(".")[1])||0;return t?t.length:0}function yo(e){return e==null}function ku(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||"ontouchstart"in window}function on(e,{min:t,max:n,step:i}){const s=Math.floor((e-t)/i),l=(e-t)%i,a=Math.floor((n-t)/i),r=Math.max(Kn(i),Kn(t));let c=!1,d;if(r){let h=+parseFloat(i*s).toFixed(r);d=+(h+t).toFixed(r),c=s===a&&+(n-d).toFixed(r)!==i,l>i/2&&!c&&(d=+(d+i).toFixed(r)),d>n?(h=+parseFloat(i*a).toFixed(r),d=+(h+t).toFixed(r)):d<t&&(d=t)}else d=i*s+t,c=s===a&&n-d!==i,l>i/2&&!c&&(d+=i),d>n?d=i*a+t:d<t&&(d=t);return d}function wu(){const{props:e,emit:t}=o.getCurrentInstance(),n=o.ref(e.modelValue),i=o.ref(e.modelValue),s=d=>{if(e.precision&&(d||d===0)){const h=Number(d).toFixed(e.precision);return e.trimTrailingZero?String(parseFloat(h)):h}return d},l=d=>{let h=d;!d&&d!==0?e.disableEmpty?(h=0,e.stepStrictly?h=on(h,{min:e.min===-1/0?0:e.min,max:e.max,step:e.step}):(e.min||e.min===0)&&h<e.min?h=e.min:(e.max||e.max===0)&&h>e.max&&(h=e.max)):h=e.stepStrictly?i.value:null:isNaN(d)?h=i.value:e.stepStrictly?(e.min===-1/0&&(e.min=0),h=on(d,{min:e.min,max:e.max,step:e.step})):(e.min||e.min===0)&&h<e.min?h=e.min:(e.max||e.max===0)&&h>e.max?h=e.max:h=+h,n.value=s(h),i.value=s(h),t("update:modelValue",h),t("change",h)},a=d=>{t("focus",d)},r=d=>{t("blur",d)},c=d=>{l(d.target.value)};return o.watch(()=>e.modelValue,(d,h)=>{d!==h&&(n.value=s(d))}),{currentValue:n,validateValue:l,focusInput:a,blurInput:r,changeMv:c}}function Iu(e){const{props:t}=o.getCurrentInstance(),{currentValue:n,validateValue:i}=e;return{stepValue:l=>{if(t.readonly||t.disabled)return;const a=!n.value&&n.value!==0;let r;if(a)r=t.min===-1/0?0:t.min;else{const c=+n.value,d=l==="up"?t.step:t.step*-1,u=10**Math.max(Kn(c),Kn(t.step));r=(Math.round(c*u)+Math.round(d*u))/u}if(t.clampOnStep){r<t.min?r=t.min:r>t.max&&(r=t.max);const c=t.stepStrictly?on(r,{min:t.min===-1/0?0:t.min,max:t.max,step:t.step}):r;(a||c!==+n.value)&&i(r)}else r>=t.min&&r<=t.max&&i(r)}}}function Tu(e){const{props:t}=o.getCurrentInstance(),{currentValue:n,validateValue:i}=e,s=t.max||t.max===0,l=t.min||t.min===0,a=()=>{s&&l&&t.max<=t.min&&console.warn("[EVUI][InputNumber] Max value must be greater than min value."),t.step&&(t.precision||t.precision===0)&&Kn(t.step)>t.precision&&console.warn("[EVUI][InputNumber] It cannot be calculated because the step is smaller than the precision setting.")},r=()=>{let c=n.value;isNaN(n.value)&&(c=0),(c||c===0)&&(s&&c>t.max?c=t.max:l&&c<t.min&&(c=t.min)),i(c)};o.onBeforeMount(()=>{a(),r()})}const Lu={name:"EvInputNumber",props:{modelValue:{type:[String,Number],default:null},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},step:{type:Number,default:1,validator:e=>e>0},stepStrictly:{type:Boolean,default:!1},precision:{type:Number,default:0,validator:e=>e>=0&&e<=100&&e===parseInt(e,10)},trimTrailingZero:{type:Boolean,default:!1},disableEmpty:{type:Boolean,default:!1},clampOnStep:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur","input","change"],setup(){const{currentValue:e,validateValue:t,focusInput:n,blurInput:i,changeMv:s}=wu(),{stepValue:l}=Iu({currentValue:e,validateValue:t});return Tu({currentValue:e,validateValue:t}),{currentValue:e,validateValue:t,focusInput:n,blurInput:i,changeMv:s,stepValue:l}}},Mu={class:"ev-input-number__wrapper"},vu=["onClick"],Ru=["placeholder","disabled","readonly"];function Vu(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-input-number",{disabled:n.disabled,readonly:n.readonly}])},[o.createElementVNode("div",Mu,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["up","down"],a=>o.createElementVNode("span",{key:`step-arrow-${a}`,class:o.normalizeClass(["ev-input-number-icon",`step-${a}`]),onClick:r=>i.stepValue(a)},[o.createElementVNode("i",{class:o.normalizeClass(`ev-icon-s-arrow-${a}`)},null,2)],10,vu)),64)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>i.currentValue=a),class:"ev-input",type:"text",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,onFocus:t[1]||(t[1]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:t[2]||(t[2]=(...a)=>i.blurInput&&i.blurInput(...a)),onChange:t[3]||(t[3]=(...a)=>i.changeMv&&i.changeMv(...a)),onKeydown:[t[4]||(t[4]=o.withKeys(o.withModifiers(a=>i.stepValue("up"),["prevent"]),["up"])),t[5]||(t[5]=o.withKeys(o.withModifiers(a=>i.stepValue("down"),["prevent"]),["down"])),t[6]||(t[6]=o.withKeys(o.withModifiers(a=>i.validateValue(i.currentValue),["prevent"]),["enter"]))]},null,40,Ru),[[o.vModelText,i.currentValue,void 0,{trim:!0}]])])],2)}const Un=ce(Lu,[["render",Vu]]);Un.install=e=>{e.component(Un.name,Un)};var Xa=typeof global=="object"&&global&&global.Object===Object&&global,Eu=typeof self=="object"&&self&&self.Object===Object&&self,ut=Xa||Eu||Function("return this")(),wt=ut.Symbol,Na=Object.prototype,Wu=Na.hasOwnProperty,Gu=Na.toString,Jn=wt?wt.toStringTag:void 0;function Zu(e){var t=Wu.call(e,Jn),n=e[Jn];try{e[Jn]=void 0;var i=!0}catch{}var s=Gu.call(e);return i&&(t?e[Jn]=n:delete e[Jn]),s}var Xu=Object.prototype,Nu=Xu.toString;function Pu(e){return Nu.call(e)}var Du="[object Null]",Bu="[object Undefined]",Pa=wt?wt.toStringTag:void 0;function Ht(e){return e==null?e===void 0?Bu:Du:Pa&&Pa in Object(e)?Zu(e):Pu(e)}function ft(e){return e!=null&&typeof e=="object"}var Ou="[object Symbol]";function $i(e){return typeof e=="symbol"||ft(e)&&Ht(e)==Ou}function Yu(e,t){for(var n=-1,i=e==null?0:e.length,s=Array(i);++n<i;)s[n]=t(e[n],n,e);return s}var it=Array.isArray,Da=wt?wt.prototype:void 0,Ba=Da?Da.toString:void 0;function Oa(e){if(typeof e=="string")return e;if(it(e))return Yu(e,Oa)+"";if($i(e))return Ba?Ba.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Fu=/\s/;function Hu(e){for(var t=e.length;t--&&Fu.test(e.charAt(t)););return t}var zu=/^\s+/;function Au(e){return e&&e.slice(0,Hu(e)+1).replace(zu,"")}function ze(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ya=NaN,_u=/^[-+]0x[0-9a-f]+$/i,Ku=/^0b[01]+$/i,Uu=/^0o[0-7]+$/i,Ju=parseInt;function qi(e){if(typeof e=="number")return e;if($i(e))return Ya;if(ze(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ze(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Au(e);var n=Ku.test(e);return n||Uu.test(e)?Ju(e.slice(2),n?2:8):_u.test(e)?Ya:+e}var Fa=1/0,ju=17976931348623157e292;function Ha(e){if(!e)return e===0?e:0;if(e=qi(e),e===Fa||e===-Fa){var t=e<0?-1:1;return t*ju}return e===e?e:0}function xo(e){return e}var Qu="[object AsyncFunction]",$u="[object Function]",qu="[object GeneratorFunction]",ef="[object Proxy]";function jn(e){if(!ze(e))return!1;var t=Ht(e);return t==$u||t==qu||t==Qu||t==ef}var So=ut["__core-js_shared__"],za=function(){var e=/[^.]+$/.exec(So&&So.keys&&So.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function tf(e){return!!za&&za in e}var nf=Function.prototype,sf=nf.toString;function ln(e){if(e!=null){try{return sf.call(e)}catch{}try{return e+""}catch{}}return""}var of=/[\\^$.*+?()[\]{}|]/g,lf=/^\[object .+?Constructor\]$/,af=Function.prototype,rf=Object.prototype,cf=af.toString,df=rf.hasOwnProperty,hf=RegExp("^"+cf.call(df).replace(of,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function uf(e){if(!ze(e)||tf(e))return!1;var t=jn(e)?hf:lf;return t.test(ln(e))}function ff(e,t){return e==null?void 0:e[t]}function an(e,t){var n=ff(e,t);return uf(n)?n:void 0}var Co=an(ut,"WeakMap"),Aa=Object.create,mf=function(){function e(){}return function(t){if(!ze(t))return{};if(Aa)return Aa(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function _a(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function pf(){}function gf(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}var bf=800,yf=16,xf=Date.now;function Sf(e){var t=0,n=0;return function(){var i=xf(),s=yf-(i-n);if(n=i,s>0){if(++t>=bf)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Cf(e){return function(){return e}}var es=function(){try{var e=an(Object,"defineProperty");return e({},"",{}),e}catch{}}(),kf=es?function(e,t){return es(e,"toString",{configurable:!0,enumerable:!1,value:Cf(t),writable:!0})}:xo,wf=Sf(kf);function If(e,t){for(var n=-1,i=e==null?0:e.length;++n<i&&t(e[n],n,e)!==!1;);return e}function Tf(e,t,n,i){for(var s=e.length,l=n+-1;++l<s;)if(t(e[l],l,e))return l;return-1}function Lf(e){return e!==e}function Mf(e,t,n){for(var i=n-1,s=e.length;++i<s;)if(e[i]===t)return i;return-1}function vf(e,t,n){return t===t?Mf(e,t,n):Tf(e,Lf,n)}function Rf(e,t){var n=e==null?0:e.length;return!!n&&vf(e,t,0)>-1}var Vf=9007199254740991,Ef=/^(?:0|[1-9]\d*)$/;function ko(e,t){var n=typeof e;return t=t??Vf,!!t&&(n=="number"||n!="symbol"&&Ef.test(e))&&e>-1&&e%1==0&&e<t}function wo(e,t,n){t=="__proto__"&&es?es(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function wn(e,t){return e===t||e!==e&&t!==t}var Wf=Object.prototype,Gf=Wf.hasOwnProperty;function Ka(e,t,n){var i=e[t];(!(Gf.call(e,t)&&wn(i,n))||n===void 0&&!(t in e))&&wo(e,t,n)}function Zf(e,t,n,i){var s=!n;n||(n={});for(var l=-1,a=t.length;++l<a;){var r=t[l],c=void 0;c===void 0&&(c=e[r]),s?wo(n,r,c):Ka(n,r,c)}return n}var Ua=Math.max;function Xf(e,t,n){return t=Ua(t===void 0?e.length-1:t,0),function(){for(var i=arguments,s=-1,l=Ua(i.length-t,0),a=Array(l);++s<l;)a[s]=i[t+s];s=-1;for(var r=Array(t+1);++s<t;)r[s]=i[s];return r[t]=n(a),_a(e,this,r)}}function Io(e,t){return wf(Xf(e,t,xo),e+"")}var Nf=9007199254740991;function To(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Nf}function ts(e){return e!=null&&To(e.length)&&!jn(e)}function Ja(e,t,n){if(!ze(n))return!1;var i=typeof t;return(i=="number"?ts(n)&&ko(t,n.length):i=="string"&&t in n)?wn(n[t],e):!1}function ja(e){return Io(function(t,n){var i=-1,s=n.length,l=s>1?n[s-1]:void 0,a=s>2?n[2]:void 0;for(l=e.length>3&&typeof l=="function"?(s--,l):void 0,a&&Ja(n[0],n[1],a)&&(l=s<3?void 0:l,s=1),t=Object(t);++i<s;){var r=n[i];r&&e(t,r,i,l)}return t})}var Pf=Object.prototype;function Lo(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Pf;return e===n}function Df(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}var Bf="[object Arguments]";function Qa(e){return ft(e)&&Ht(e)==Bf}var $a=Object.prototype,Of=$a.hasOwnProperty,Yf=$a.propertyIsEnumerable,ns=Qa(function(){return arguments}())?Qa:function(e){return ft(e)&&Of.call(e,"callee")&&!Yf.call(e,"callee")};function Ff(){return!1}var qa=typeof le=="object"&&le&&!le.nodeType&&le,er=qa&&typeof module=="object"&&module&&!module.nodeType&&module,Hf=er&&er.exports===qa,tr=Hf?ut.Buffer:void 0,zf=tr?tr.isBuffer:void 0,Qn=zf||Ff,Af="[object Arguments]",_f="[object Array]",Kf="[object Boolean]",Uf="[object Date]",Jf="[object Error]",jf="[object Function]",Qf="[object Map]",$f="[object Number]",qf="[object Object]",em="[object RegExp]",tm="[object Set]",nm="[object String]",im="[object WeakMap]",sm="[object ArrayBuffer]",om="[object DataView]",lm="[object Float32Array]",am="[object Float64Array]",rm="[object Int8Array]",cm="[object Int16Array]",dm="[object Int32Array]",hm="[object Uint8Array]",um="[object Uint8ClampedArray]",fm="[object Uint16Array]",mm="[object Uint32Array]",ke={};ke[lm]=ke[am]=ke[rm]=ke[cm]=ke[dm]=ke[hm]=ke[um]=ke[fm]=ke[mm]=!0,ke[Af]=ke[_f]=ke[sm]=ke[Kf]=ke[om]=ke[Uf]=ke[Jf]=ke[jf]=ke[Qf]=ke[$f]=ke[qf]=ke[em]=ke[tm]=ke[nm]=ke[im]=!1;function pm(e){return ft(e)&&To(e.length)&&!!ke[Ht(e)]}function Mo(e){return function(t){return e(t)}}var nr=typeof le=="object"&&le&&!le.nodeType&&le,$n=nr&&typeof module=="object"&&module&&!module.nodeType&&module,gm=$n&&$n.exports===nr,vo=gm&&Xa.process,In=function(){try{var e=$n&&$n.require&&$n.require("util").types;return e||vo&&vo.binding&&vo.binding("util")}catch{}}(),ir=In&&In.isTypedArray,Ro=ir?Mo(ir):pm,bm=Object.prototype,ym=bm.hasOwnProperty;function sr(e,t){var n=it(e),i=!n&&ns(e),s=!n&&!i&&Qn(e),l=!n&&!i&&!s&&Ro(e),a=n||i||s||l,r=a?Df(e.length,String):[],c=r.length;for(var d in e)(t||ym.call(e,d))&&!(a&&(d=="length"||s&&(d=="offset"||d=="parent")||l&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||ko(d,c)))&&r.push(d);return r}function or(e,t){return function(n){return e(t(n))}}var xm=or(Object.keys,Object),Sm=Object.prototype,Cm=Sm.hasOwnProperty;function km(e){if(!Lo(e))return xm(e);var t=[];for(var n in Object(e))Cm.call(e,n)&&n!="constructor"&&t.push(n);return t}function lr(e){return ts(e)?sr(e):km(e)}function wm(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Im=Object.prototype,Tm=Im.hasOwnProperty;function Lm(e){if(!ze(e))return wm(e);var t=Lo(e),n=[];for(var i in e)i=="constructor"&&(t||!Tm.call(e,i))||n.push(i);return n}function Vo(e){return ts(e)?sr(e,!0):Lm(e)}var Mm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vm=/^\w*$/;function Eo(e,t){if(it(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||$i(e)?!0:vm.test(e)||!Mm.test(e)||t!=null&&e in Object(t)}var qn=an(Object,"create");function Rm(){this.__data__=qn?qn(null):{},this.size=0}function Vm(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Em="__lodash_hash_undefined__",Wm=Object.prototype,Gm=Wm.hasOwnProperty;function Zm(e){var t=this.__data__;if(qn){var n=t[e];return n===Em?void 0:n}return Gm.call(t,e)?t[e]:void 0}var Xm=Object.prototype,Nm=Xm.hasOwnProperty;function Pm(e){var t=this.__data__;return qn?t[e]!==void 0:Nm.call(t,e)}var Dm="__lodash_hash_undefined__";function Bm(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=qn&&t===void 0?Dm:t,this}function rn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}rn.prototype.clear=Rm,rn.prototype.delete=Vm,rn.prototype.get=Zm,rn.prototype.has=Pm,rn.prototype.set=Bm;function Om(){this.__data__=[],this.size=0}function is(e,t){for(var n=e.length;n--;)if(wn(e[n][0],t))return n;return-1}var Ym=Array.prototype,Fm=Ym.splice;function Hm(e){var t=this.__data__,n=is(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():Fm.call(t,n,1),--this.size,!0}function zm(e){var t=this.__data__,n=is(t,e);return n<0?void 0:t[n][1]}function Am(e){return is(this.__data__,e)>-1}function _m(e,t){var n=this.__data__,i=is(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function vt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}vt.prototype.clear=Om,vt.prototype.delete=Hm,vt.prototype.get=zm,vt.prototype.has=Am,vt.prototype.set=_m;var ei=an(ut,"Map");function Km(){this.size=0,this.__data__={hash:new rn,map:new(ei||vt),string:new rn}}function Um(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ss(e,t){var n=e.__data__;return Um(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Jm(e){var t=ss(this,e).delete(e);return this.size-=t?1:0,t}function jm(e){return ss(this,e).get(e)}function Qm(e){return ss(this,e).has(e)}function $m(e,t){var n=ss(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function Rt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Rt.prototype.clear=Km,Rt.prototype.delete=Jm,Rt.prototype.get=jm,Rt.prototype.has=Qm,Rt.prototype.set=$m;var qm="Expected a function";function Wo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(qm);var n=function(){var i=arguments,s=t?t.apply(this,i):i[0],l=n.cache;if(l.has(s))return l.get(s);var a=e.apply(this,i);return n.cache=l.set(s,a)||l,a};return n.cache=new(Wo.Cache||Rt),n}Wo.Cache=Rt;var ep=500;function tp(e){var t=Wo(e,function(i){return n.size===ep&&n.clear(),i}),n=t.cache;return t}var np=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ip=/\\(\\)?/g,sp=tp(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(np,function(n,i,s,l){t.push(s?l.replace(ip,"$1"):i||n)}),t});function op(e){return e==null?"":Oa(e)}function ar(e,t){return it(e)?e:Eo(e,t)?[e]:sp(op(e))}function os(e){if(typeof e=="string"||$i(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function rr(e,t){t=ar(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[os(t[n++])];return n&&n==i?e:void 0}function lp(e,t,n){var i=e==null?void 0:rr(e,t);return i===void 0?n:i}function ap(e,t){for(var n=-1,i=t.length,s=e.length;++n<i;)e[s+n]=t[n];return e}var cr=or(Object.getPrototypeOf,Object),rp="[object Object]",cp=Function.prototype,dp=Object.prototype,dr=cp.toString,hp=dp.hasOwnProperty,up=dr.call(Object);function fp(e){if(!ft(e)||Ht(e)!=rp)return!1;var t=cr(e);if(t===null)return!0;var n=hp.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&dr.call(n)==up}function mp(){this.__data__=new vt,this.size=0}function pp(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function gp(e){return this.__data__.get(e)}function bp(e){return this.__data__.has(e)}var yp=200;function xp(e,t){var n=this.__data__;if(n instanceof vt){var i=n.__data__;if(!ei||i.length<yp-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Rt(i)}return n.set(e,t),this.size=n.size,this}function mt(e){var t=this.__data__=new vt(e);this.size=t.size}mt.prototype.clear=mp,mt.prototype.delete=pp,mt.prototype.get=gp,mt.prototype.has=bp,mt.prototype.set=xp;var hr=typeof le=="object"&&le&&!le.nodeType&&le,ur=hr&&typeof module=="object"&&module&&!module.nodeType&&module,Sp=ur&&ur.exports===hr,fr=Sp?ut.Buffer:void 0,mr=fr?fr.allocUnsafe:void 0;function pr(e,t){if(t)return e.slice();var n=e.length,i=mr?mr(n):new e.constructor(n);return e.copy(i),i}function Cp(e,t){for(var n=-1,i=e==null?0:e.length,s=0,l=[];++n<i;){var a=e[n];t(a,n,e)&&(l[s++]=a)}return l}function kp(){return[]}var wp=Object.prototype,Ip=wp.propertyIsEnumerable,gr=Object.getOwnPropertySymbols,Tp=gr?function(e){return e==null?[]:(e=Object(e),Cp(gr(e),function(t){return Ip.call(e,t)}))}:kp;function Lp(e,t,n){var i=t(e);return it(e)?i:ap(i,n(e))}function Go(e){return Lp(e,lr,Tp)}var Zo=an(ut,"DataView"),Xo=an(ut,"Promise"),Tn=an(ut,"Set"),br="[object Map]",Mp="[object Object]",yr="[object Promise]",xr="[object Set]",Sr="[object WeakMap]",Cr="[object DataView]",vp=ln(Zo),Rp=ln(ei),Vp=ln(Xo),Ep=ln(Tn),Wp=ln(Co),pt=Ht;(Zo&&pt(new Zo(new ArrayBuffer(1)))!=Cr||ei&&pt(new ei)!=br||Xo&&pt(Xo.resolve())!=yr||Tn&&pt(new Tn)!=xr||Co&&pt(new Co)!=Sr)&&(pt=function(e){var t=Ht(e),n=t==Mp?e.constructor:void 0,i=n?ln(n):"";if(i)switch(i){case vp:return Cr;case Rp:return br;case Vp:return yr;case Ep:return xr;case Wp:return Sr}return t});var Gp=Object.prototype,Zp=Gp.hasOwnProperty;function Xp(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Zp.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var ls=ut.Uint8Array;function No(e){var t=new e.constructor(e.byteLength);return new ls(t).set(new ls(e)),t}function Np(e,t){var n=No(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Pp=/\w*$/;function Dp(e){var t=new e.constructor(e.source,Pp.exec(e));return t.lastIndex=e.lastIndex,t}var kr=wt?wt.prototype:void 0,wr=kr?kr.valueOf:void 0;function Bp(e){return wr?Object(wr.call(e)):{}}function Ir(e,t){var n=t?No(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Op="[object Boolean]",Yp="[object Date]",Fp="[object Map]",Hp="[object Number]",zp="[object RegExp]",Ap="[object Set]",_p="[object String]",Kp="[object Symbol]",Up="[object ArrayBuffer]",Jp="[object DataView]",jp="[object Float32Array]",Qp="[object Float64Array]",$p="[object Int8Array]",qp="[object Int16Array]",eg="[object Int32Array]",tg="[object Uint8Array]",ng="[object Uint8ClampedArray]",ig="[object Uint16Array]",sg="[object Uint32Array]";function og(e,t,n){var i=e.constructor;switch(t){case Up:return No(e);case Op:case Yp:return new i(+e);case Jp:return Np(e);case jp:case Qp:case $p:case qp:case eg:case tg:case ng:case ig:case sg:return Ir(e,n);case Fp:return new i;case Hp:case _p:return new i(e);case zp:return Dp(e);case Ap:return new i;case Kp:return Bp(e)}}function Tr(e){return typeof e.constructor=="function"&&!Lo(e)?mf(cr(e)):{}}var lg="[object Map]";function ag(e){return ft(e)&&pt(e)==lg}var Lr=In&&In.isMap,rg=Lr?Mo(Lr):ag,cg="[object Set]";function dg(e){return ft(e)&&pt(e)==cg}var Mr=In&&In.isSet,hg=Mr?Mo(Mr):dg,ug=1,vr="[object Arguments]",fg="[object Array]",mg="[object Boolean]",pg="[object Date]",gg="[object Error]",Rr="[object Function]",bg="[object GeneratorFunction]",yg="[object Map]",xg="[object Number]",Vr="[object Object]",Sg="[object RegExp]",Cg="[object Set]",kg="[object String]",wg="[object Symbol]",Ig="[object WeakMap]",Tg="[object ArrayBuffer]",Lg="[object DataView]",Mg="[object Float32Array]",vg="[object Float64Array]",Rg="[object Int8Array]",Vg="[object Int16Array]",Eg="[object Int32Array]",Wg="[object Uint8Array]",Gg="[object Uint8ClampedArray]",Zg="[object Uint16Array]",Xg="[object Uint32Array]",xe={};xe[vr]=xe[fg]=xe[Tg]=xe[Lg]=xe[mg]=xe[pg]=xe[Mg]=xe[vg]=xe[Rg]=xe[Vg]=xe[Eg]=xe[yg]=xe[xg]=xe[Vr]=xe[Sg]=xe[Cg]=xe[kg]=xe[wg]=xe[Wg]=xe[Gg]=xe[Zg]=xe[Xg]=!0,xe[gg]=xe[Rr]=xe[Ig]=!1;function ti(e,t,n,i,s,l){var a,r=t&ug;if(n&&(a=s?n(e,i,s,l):n(e)),a!==void 0)return a;if(!ze(e))return e;var c=it(e);if(c)a=Xp(e);else{var d=pt(e),h=d==Rr||d==bg;if(Qn(e))return pr(e,r);if(d==Vr||d==vr||h&&!s)a=h?{}:Tr(e);else{if(!xe[d])return s?e:{};a=og(e,d,r)}}l||(l=new mt);var u=l.get(e);if(u)return u;l.set(e,a),hg(e)?e.forEach(function(g){a.add(ti(g,t,n,g,e,l))}):rg(e)&&e.forEach(function(g,p){a.set(p,ti(g,t,n,p,e,l))});var m=Go,f=c?void 0:m(e);return If(f||e,function(g,p){f&&(p=g,g=e[p]),Ka(a,p,ti(g,t,n,p,e,l))}),a}var Ng=1,Pg=4;function Ve(e){return ti(e,Ng|Pg)}var Dg=1,Bg=4;function Er(e,t){return t=typeof t=="function"?t:void 0,ti(e,Dg|Bg,t)}var Og="__lodash_hash_undefined__";function Yg(e){return this.__data__.set(e,Og),this}function Fg(e){return this.__data__.has(e)}function ni(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Rt;++t<n;)this.add(e[t])}ni.prototype.add=ni.prototype.push=Yg,ni.prototype.has=Fg;function Hg(e,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function Wr(e,t){return e.has(t)}var zg=1,Ag=2;function Gr(e,t,n,i,s,l){var a=n&zg,r=e.length,c=t.length;if(r!=c&&!(a&&c>r))return!1;var d=l.get(e),h=l.get(t);if(d&&h)return d==t&&h==e;var u=-1,m=!0,f=n&Ag?new ni:void 0;for(l.set(e,t),l.set(t,e);++u<r;){var g=e[u],p=t[u];if(i)var y=a?i(p,g,u,t,e,l):i(g,p,u,e,t,l);if(y!==void 0){if(y)continue;m=!1;break}if(f){if(!Hg(t,function(C,b){if(!Wr(f,b)&&(g===C||s(g,C,n,i,l)))return f.push(b)})){m=!1;break}}else if(!(g===p||s(g,p,n,i,l))){m=!1;break}}return l.delete(e),l.delete(t),m}function _g(e){var t=-1,n=Array(e.size);return e.forEach(function(i,s){n[++t]=[s,i]}),n}function Po(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var Kg=1,Ug=2,Jg="[object Boolean]",jg="[object Date]",Qg="[object Error]",$g="[object Map]",qg="[object Number]",eb="[object RegExp]",tb="[object Set]",nb="[object String]",ib="[object Symbol]",sb="[object ArrayBuffer]",ob="[object DataView]",Zr=wt?wt.prototype:void 0,Do=Zr?Zr.valueOf:void 0;function lb(e,t,n,i,s,l,a){switch(n){case ob:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case sb:return!(e.byteLength!=t.byteLength||!l(new ls(e),new ls(t)));case Jg:case jg:case qg:return wn(+e,+t);case Qg:return e.name==t.name&&e.message==t.message;case eb:case nb:return e==t+"";case $g:var r=_g;case tb:var c=i&Kg;if(r||(r=Po),e.size!=t.size&&!c)return!1;var d=a.get(e);if(d)return d==t;i|=Ug,a.set(e,t);var h=Gr(r(e),r(t),i,s,l,a);return a.delete(e),h;case ib:if(Do)return Do.call(e)==Do.call(t)}return!1}var ab=1,rb=Object.prototype,cb=rb.hasOwnProperty;function db(e,t,n,i,s,l){var a=n&ab,r=Go(e),c=r.length,d=Go(t),h=d.length;if(c!=h&&!a)return!1;for(var u=c;u--;){var m=r[u];if(!(a?m in t:cb.call(t,m)))return!1}var f=l.get(e),g=l.get(t);if(f&&g)return f==t&&g==e;var p=!0;l.set(e,t),l.set(t,e);for(var y=a;++u<c;){m=r[u];var C=e[m],b=t[m];if(i)var k=a?i(b,C,m,t,e,l):i(C,b,m,e,t,l);if(!(k===void 0?C===b||s(C,b,n,i,l):k)){p=!1;break}y||(y=m=="constructor")}if(p&&!y){var L=e.constructor,w=t.constructor;L!=w&&"constructor"in e&&"constructor"in t&&!(typeof L=="function"&&L instanceof L&&typeof w=="function"&&w instanceof w)&&(p=!1)}return l.delete(e),l.delete(t),p}var hb=1,Xr="[object Arguments]",Nr="[object Array]",as="[object Object]",ub=Object.prototype,Pr=ub.hasOwnProperty;function fb(e,t,n,i,s,l){var a=it(e),r=it(t),c=a?Nr:pt(e),d=r?Nr:pt(t);c=c==Xr?as:c,d=d==Xr?as:d;var h=c==as,u=d==as,m=c==d;if(m&&Qn(e)){if(!Qn(t))return!1;a=!0,h=!1}if(m&&!h)return l||(l=new mt),a||Ro(e)?Gr(e,t,n,i,s,l):lb(e,t,c,n,i,s,l);if(!(n&hb)){var f=h&&Pr.call(e,"__wrapped__"),g=u&&Pr.call(t,"__wrapped__");if(f||g){var p=f?e.value():e,y=g?t.value():t;return l||(l=new mt),s(p,y,n,i,l)}}return m?(l||(l=new mt),db(e,t,n,i,s,l)):!1}function rs(e,t,n,i,s){return e===t?!0:e==null||t==null||!ft(e)&&!ft(t)?e!==e&&t!==t:fb(e,t,n,i,rs,s)}var mb=1,pb=2;function gb(e,t,n,i){var s=n.length,l=s;if(e==null)return!l;for(e=Object(e);s--;){var a=n[s];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++s<l;){a=n[s];var r=a[0],c=e[r],d=a[1];if(a[2]){if(c===void 0&&!(r in e))return!1}else{var h=new mt,u;if(!(u===void 0?rs(d,c,mb|pb,i,h):u))return!1}}return!0}function Dr(e){return e===e&&!ze(e)}function bb(e){for(var t=lr(e),n=t.length;n--;){var i=t[n],s=e[i];t[n]=[i,s,Dr(s)]}return t}function Br(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function yb(e){var t=bb(e);return t.length==1&&t[0][2]?Br(t[0][0],t[0][1]):function(n){return n===e||gb(n,e,t)}}function xb(e,t){return e!=null&&t in Object(e)}function Sb(e,t,n){t=ar(t,e);for(var i=-1,s=t.length,l=!1;++i<s;){var a=os(t[i]);if(!(l=e!=null&&n(e,a)))break;e=e[a]}return l||++i!=s?l:(s=e==null?0:e.length,!!s&&To(s)&&ko(a,s)&&(it(e)||ns(e)))}function Cb(e,t){return e!=null&&Sb(e,t,xb)}var kb=1,wb=2;function Ib(e,t){return Eo(e)&&Dr(t)?Br(os(e),t):function(n){var i=lp(n,e);return i===void 0&&i===t?Cb(n,e):rs(t,i,kb|wb)}}function Tb(e){return function(t){return t==null?void 0:t[e]}}function Lb(e){return function(t){return rr(t,e)}}function Mb(e){return Eo(e)?Tb(os(e)):Lb(e)}function vb(e){return typeof e=="function"?e:e==null?xo:typeof e=="object"?it(e)?Ib(e[0],e[1]):yb(e):Mb(e)}function Rb(e){return function(t,n,i){for(var s=-1,l=Object(t),a=i(t),r=a.length;r--;){var c=a[++s];if(n(l[c],c,l)===!1)break}return t}}var Vb=Rb(),Bo=function(){return ut.Date.now()},Eb="Expected a function",Wb=Math.max,Gb=Math.min;function cs(e,t,n){var i,s,l,a,r,c,d=0,h=!1,u=!1,m=!0;if(typeof e!="function")throw new TypeError(Eb);t=qi(t)||0,ze(n)&&(h=!!n.leading,u="maxWait"in n,l=u?Wb(qi(n.maxWait)||0,t):l,m="trailing"in n?!!n.trailing:m);function f(M){var V=i,S=s;return i=s=void 0,d=M,a=e.apply(S,V),a}function g(M){return d=M,r=setTimeout(C,t),h?f(M):a}function p(M){var V=M-c,S=M-d,x=t-V;return u?Gb(x,l-S):x}function y(M){var V=M-c,S=M-d;return c===void 0||V>=t||V<0||u&&S>=l}function C(){var M=Bo();if(y(M))return b(M);r=setTimeout(C,p(M))}function b(M){return r=void 0,m&&i?f(M):(i=s=void 0,a)}function k(){r!==void 0&&clearTimeout(r),d=0,i=c=s=r=void 0}function L(){return r===void 0?a:b(Bo())}function w(){var M=Bo(),V=y(M);if(i=arguments,s=this,c=M,V){if(r===void 0)return g(c);if(u)return clearTimeout(r),r=setTimeout(C,t),f(c)}return r===void 0&&(r=setTimeout(C,t)),a}return w.cancel=k,w.flush=L,w}var Or=Object.prototype,Zb=Or.hasOwnProperty,Xb=Io(function(e,t){e=Object(e);var n=-1,i=t.length,s=i>2?t[2]:void 0;for(s&&Ja(t[0],t[1],s)&&(i=1);++n<i;)for(var l=t[n],a=Vo(l),r=-1,c=a.length;++r<c;){var d=a[r],h=e[d];(h===void 0||wn(h,Or[d])&&!Zb.call(e,d))&&(e[d]=l[d])}return e});function Oo(e,t,n){(n!==void 0&&!wn(e[t],n)||n===void 0&&!(t in e))&&wo(e,t,n)}function Nb(e){return ft(e)&&ts(e)}function Yo(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Pb(e){return Zf(e,Vo(e))}function Db(e,t,n,i,s,l,a){var r=Yo(e,n),c=Yo(t,n),d=a.get(c);if(d){Oo(e,n,d);return}var h=l?l(r,c,n+"",e,t,a):void 0,u=h===void 0;if(u){var m=it(c),f=!m&&Qn(c),g=!m&&!f&&Ro(c);h=c,m||f||g?it(r)?h=r:Nb(r)?h=gf(r):f?(u=!1,h=pr(c,!0)):g?(u=!1,h=Ir(c,!0)):h=[]:fp(c)||ns(c)?(h=r,ns(r)?h=Pb(r):(!ze(r)||jn(r))&&(h=Tr(c))):u=!1}u&&(a.set(c,h),s(h,c,i,l,a),a.delete(c)),Oo(e,n,h)}function ds(e,t,n,i,s){e!==t&&Vb(t,function(l,a){if(s||(s=new mt),ze(l))Db(e,t,a,n,ds,i,s);else{var r=i?i(Yo(e,a),l,a+"",e,t,s):void 0;r===void 0&&(r=l),Oo(e,a,r)}},Vo)}function Yr(e,t,n,i,s,l){return ze(e)&&ze(t)&&(l.set(t,e),ds(e,t,void 0,Yr,l),l.delete(t)),e}var Bb=ja(function(e,t,n,i){ds(e,t,n,i)}),Pe=Io(function(e){return e.push(void 0,Yr),_a(Bb,void 0,e)}),Ob=Math.max,Yb=Math.min;function Fb(e,t,n){return e>=Yb(t,n)&&e<Ob(t,n)}function It(e,t,n){return t=Ha(t),n===void 0?(n=t,t=0):n=Ha(n),e=qi(e),Fb(e,t,n)}function Ae(e,t){return rs(e,t)}var Hb="[object Number]";function zb(e){return typeof e=="number"||ft(e)&&Ht(e)==Hb}function zt(e){return e==null}function Ab(e){return e===void 0}var Fo=ja(function(e,t,n){ds(e,t,n)}),_b=Array.prototype,Kb=_b.reverse;function Ub(e){return e==null?e:Kb.call(e)}var Jb="Expected a function";function hs(e,t,n){var i=!0,s=!0;if(typeof e!="function")throw new TypeError(Jb);return ze(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),cs(e,t,{leading:i,maxWait:t,trailing:s})}var jb=1/0,Qb=Tn&&1/Po(new Tn([,-0]))[1]==jb?function(e){return new Tn(e)}:pf,$b=200;function qb(e,t,n){var i=-1,s=Rf,l=e.length,a=!0,r=[],c=r;if(l>=$b){var d=t?null:Qb(e);if(d)return Po(d);a=!1,s=Wr,c=new ni}else c=t?[]:r;e:for(;++i<l;){var h=e[i],u=t?t(h):h;if(h=h!==0?h:0,a&&u===u){for(var m=c.length;m--;)if(c[m]===u)continue e;t&&c.push(u),r.push(h)}else s(c,u,n)||(c!==r&&c.push(u),r.push(h))}return r}function ey(e,t){return e&&e.length?qb(e,vb(t)):[]}const ty=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.ref(e.modelValue),i=()=>{if(!e.showStep)return[];const m=e.max-e.min,f=m/e.step,g=qe(e.step,m),p=[];for(let y=1;y<f;y++)p.push(y*g);return p},s=()=>{if(!e.mark||!Object.keys(e.mark).length)return[];const m=(g,p="value")=>{if(!g)return[];const y=e.mark.style&&typeof e.mark.style=="object"?e.mark.style:{},C=Object.keys(g),b=[];let k;for(let L=0;L<C.length;L++)k=+C[L],isNaN(k)||b.push({posX:p==="value"?qe(k,e.max-e.min):k,label:g[k],style:y});return b};return e.mark.value||e.mark.percent?[...m(e.mark.value),...m(e.mark.percent,"percent")]:[...m(e.mark)]},l=o.reactive({isInit:!1,dragging:!1,handleType:null,leftValue:null,rightValue:null}),a=o.reactive({valueRange:0,stepList:o.computed(i),markList:o.computed(s),offset:{left:0,width:0}}),r=o.ref(),c=o.computed(()=>{const m=e.tooltipFormat,f=m instanceof Function;return{left:f?m(l.leftValue):l.leftValue,right:f?m(l.rightValue):l.rightValue}}),d=m=>{const f={min:e.min,max:e.max,step:e.step};let g,p;e.range&&Array.isArray(m)?(g=typeof m[0]=="number"&&!isNaN(m[0])?m[0]:e.min,p=typeof m[1]=="number"&&!isNaN(m[1])?m[1]:e.min,l.leftValue=on(g,f),l.rightValue=on(p,f)):(g=e.min,p=typeof m=="number"&&!isNaN(m)?m:e.min,l.leftValue=on(g,f),l.rightValue=on(p,f))},h=m=>{if(a.valueRange<=0)return;d(m);let f;if(e.range&&Array.isArray(m)){const g=Math.min(l.leftValue,l.rightValue),p=Math.max(l.leftValue,l.rightValue);f=[g,p]}else f=l.rightValue;n.value=f,t("update:modelValue",f),t("change",f)},u=()=>{const m=r.value.getBoundingClientRect();a.offset.left=m.left,a.offset.width=m.width,a.valueRange=e.max-e.min};return o.watch(()=>e.modelValue,(m,f)=>{zb(m)&&m>=0&&!Ae(m,f)&&!l.dragging&&(d(m),n.value=m)}),o.watch(()=>e.step,()=>{h(n.value)}),{currentValue:n,state:l,slider:a,formatValue:c,sliderLine:r,updateSliderInfo:u,setSliderValue:h}},ny=e=>{const{props:t}=o.getCurrentInstance(),{state:n,slider:i}=e,s="transparent",l=o.computed(()=>({left:i.valueRange>0?`${qe(n.leftValue-t.min,i.valueRange)}%`:0})),a=o.computed(()=>({left:i.valueRange>0?`${qe(n.rightValue-t.min,i.valueRange)}%`:0})),r=o.computed(()=>!t.color||Array.isArray(t.color)&&t.color.length!==1?{}:{borderColor:(typeof t.color=="string"?t.color:t.color[0])||s}),c=o.computed(()=>t.color&&Array.isArray(t.color)),d=o.computed(()=>{const m=Math.min(n.leftValue,n.rightValue),g=+(Math.max(n.leftValue,n.rightValue)-m).toFixed(2),p=i.valueRange>0&&t.range?qe(+(m-t.min).toFixed(2),i.valueRange):0,y=g>0?qe(g,i.valueRange):0,C={};return t.color&&(typeof t.color=="string"||Array.isArray(t.color)&&t.color.length===1?C.backgroundColor=(typeof t.color=="string"?t.color:t.color[0])||s:Array.isArray(t.color)&&t.color.length>1&&(C.backgroundColor=(t.range?t.color[1]:t.color[0])||s)),{left:`${p}%`,width:`${y}%`,...C}}),h=o.computed(()=>{if(!c.value||t.color.length<2||!t.range)return{};const m=Math.min(n.leftValue,n.rightValue);return{width:`${qe(Math.abs(m-t.min),i.valueRange)}%`,backgroundColor:t.color[0]||s}}),u=o.computed(()=>{if(!c.value||t.color.length<2)return{};const m=Math.max(n.leftValue,n.rightValue),f=qe(+(m-t.min).toFixed(2),i.valueRange),g=qe(+(t.max-m).toFixed(2),i.valueRange),p=t.range?2:t.color.length-1;return{left:`${f}%`,width:`${g}%`,backgroundColor:t.color[p]||s}});return{isColorArray:c,leftHandleStyle:l,rightHandleStyle:a,handleBtnStyle:r,rangeThumbStyle:d,leftThumbStyle:h,rightThumbStyle:u}},iy=e=>{const{props:t}=o.getCurrentInstance(),{currentValue:n,state:i,slider:s,updateSliderInfo:l,setSliderValue:a}=e,r=f=>{i.dragging||l();const g=f.type.indexOf("touch")!==-1?f.touches[0].clientX:f.clientX,{valueRange:p,offset:y}=s;let C=t.min+(g-y.left)*p/y.width;return C<t.min?C=t.min:C>t.max&&(C=t.max),C},c=f=>{if(t.readonly||t.disabled||i.dragging)return;const g=r(f);let p;if(t.range){const C=Math.min(i.leftValue,i.rightValue)+Math.abs((i.rightValue-i.leftValue)/2),b=i.leftValue>i.rightValue;g<C?i.handleType=b?"right":"left":i.handleType=b?"left":"right",p=i.handleType==="left"?[g,i.rightValue]:[i.leftValue,g]}else i.handleType="right",p=g;a(p)},d=f=>{const g=r(f);i.dragging=!0;let p;t.range?p=i.handleType==="left"?[g,i.rightValue]:[i.leftValue,g]:p=g,a(p)},h=()=>{i.handleType=null,i.dragging=!1,document.body.style.cursor="",window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)};return{startDrag:f=>{t.readonly||t.disabled||(i.handleType=f,document.body.style.cursor="grabbing",window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),window.addEventListener("mouseup",h),window.addEventListener("touchend",h))},clickSlider:c,changeInput:(f,g)=>{if(t.showInput&&!i.dragging&&i.isInit)if(t.range&&Array.isArray(n.value)){const p=g==="left"?[f,n.value[1]]:[n.value[0],f];a(p)}else t.range||a(f)}}},sy=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{currentValue:i,state:s,slider:l,updateSliderInfo:a,setSliderValue:r}=e,c=()=>{const h=t.max||t.max===0,u=t.min||t.min===0;h&&u&&t.max<=t.min&&console.warn("[EVUI][Slider] Max value must be greater than min value.")},d=()=>{a(),l.valueRange<=0&&(i.value=t.range?[t.min,t.min]:t.min,n("update:modelValue",i.value)),r(i.value),s.isInit=!0};o.onMounted(()=>{c(),d()})},oy={name:"EvSlider",components:{},props:{modelValue:{type:[Number,Array],default:null},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1,validator:e=>e>0},mark:{type:Object,default:()=>{}},showStep:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},showInput:{type:Boolean,default:!1},color:{type:[String,Array],default:null},tooltipFormat:{type:Function,default:null}},emits:["update:modelValue","change"],setup(){const{currentValue:e,state:t,slider:n,formatValue:i,sliderLine:s,updateSliderInfo:l,setSliderValue:a}=ty(),{isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:m,rightThumbStyle:f}=ny({state:t,slider:n}),{startDrag:g,clickSlider:p,changeInput:y}=iy({currentValue:e,state:t,slider:n,updateSliderInfo:l,setSliderValue:a});return sy({currentValue:e,state:t,slider:n,updateSliderInfo:l,setSliderValue:a}),{currentValue:e,isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:m,rightThumbStyle:f,sliderLine:s,...o.toRefs(t),...o.toRefs(n),formatValue:i,startDrag:g,clickSlider:p,changeInput:y}}},ly={class:"ev-slider-wrapper"},ay={ref:"sliderLine",class:"ev-slider-line"},ry={key:0,class:"ev-slider-step-wrapper"},cy={key:2,class:"ev-slider-mark-wrapper"},dy={class:"ev-slider-mark-label"},hy=["innerHTML"],uy=["innerHTML"];function fy(e,t,n,i,s,l){const a=o.resolveComponent("ev-input-number");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-slider",{readonly:n.readonly,disabled:n.disabled,"hide-tooltip":!n.showTooltip,"show-input":n.showInput,"color-range":i.isColorArray,"show-mark":e.markList.length}])},[o.createElementVNode("div",ly,[o.createElementVNode("div",ay,[n.showStep&&n.step?(o.openBlock(),o.createElementBlock("div",ry,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.stepList,(r,c)=>(o.openBlock(),o.createElementBlock("span",{key:`slider-step-${c}`,style:o.normalizeStyle({left:`${r}%`}),class:"ev-slider-step"},null,4))),128))])):o.createCommentVNode("",!0),i.isColorArray&&n.color.length>1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.range?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle(i.leftThumbStyle),class:"ev-slider-thumb left"},null,4)):o.createCommentVNode("",!0),o.createElementVNode("div",{style:o.normalizeStyle(i.rightThumbStyle),class:"ev-slider-thumb right"},null,4)],64)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"ev-slider-thumb",style:o.normalizeStyle(i.rangeThumbStyle)},null,4),e.markList.length>0?(o.openBlock(),o.createElementBlock("div",cy,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.markList,(r,c)=>(o.openBlock(),o.createElementBlock("div",{key:`slider-step-${c}`,style:o.normalizeStyle({...r.style,left:`${r.posX}%`}),class:"ev-slider-mark"},[o.createElementVNode("span",dy,o.toDisplayString(r.label),1)],4))),128))])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"ev-slider-line-layer",onClick:t[0]||(t[0]=(...r)=>i.clickSlider&&i.clickSlider(...r))})],512),n.range?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-slider-handle",{dragging:e.dragging&&e.handleType==="left"}]),style:o.normalizeStyle(i.leftHandleStyle),onMousedown:t[1]||(t[1]=o.withModifiers(r=>i.startDrag("left"),["stop","prevent"]))},[o.createElementVNode("span",{style:o.normalizeStyle(i.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),o.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:i.formatValue.left},null,8,hy)],38)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["ev-slider-handle",{dragging:e.dragging&&e.handleType==="right"}]),style:o.normalizeStyle(i.rightHandleStyle),onMousedown:t[2]||(t[2]=o.withModifiers(r=>i.startDrag("right"),["stop","prevent"]))},[o.createElementVNode("span",{style:o.normalizeStyle(i.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),o.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:i.formatValue.right},null,8,uy)],38)]),n.showInput&&!n.range?(o.openBlock(),o.createBlock(a,{key:0,modelValue:i.currentValue,"onUpdate:modelValue":t[3]||(t[3]=r=>i.currentValue=r),step:n.step,min:n.min,max:n.max,"step-strictly":"",onChange:i.changeInput},null,8,["modelValue","step","min","max","onChange"])):n.showInput&&n.range&&Array.isArray(n.modelValue)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(a,{modelValue:i.currentValue[0],"onUpdate:modelValue":t[4]||(t[4]=r=>i.currentValue[0]=r),step:n.step,min:n.min,max:i.currentValue[1],"step-strictly":"",onChange:t[5]||(t[5]=r=>i.changeInput(r,"left"))},null,8,["modelValue","step","min","max"]),o.createVNode(a,{modelValue:i.currentValue[1],"onUpdate:modelValue":t[6]||(t[6]=r=>i.currentValue[1]=r),step:n.step,min:i.currentValue[0],max:n.max,"step-strictly":"",onChange:t[7]||(t[7]=r=>i.changeInput(r,"right"))},null,8,["modelValue","step","min","max"])],64)):o.createCommentVNode("",!0)],2)}const ii=ce(oy,[["render",fy]]);ii.install=e=>{e.component(ii.name,ii)};const my={name:"EvIcon",props:{icon:{type:String,default:""},size:{type:String,default:""},color:{type:String,default:""}},emits:{click:null,"dbl-click":null,"context-menu":null},setup(e,{emit:t}){return{onClick:l=>{t("click",l)},onDblClick:l=>{t("dbl-click",l)},onContextMenu:l=>{t("context-menu",l)}}}};function py(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("i",{class:o.normalizeClass([n.icon,{[`ev-icon-${n.size}`]:!!n.size}]),style:o.normalizeStyle({color:n.color}),onClick:t[0]||(t[0]=(...a)=>i.onClick&&i.onClick(...a)),"on:dblClick":t[1]||(t[1]=(...a)=>i.onDblClick&&i.onDblClick(...a)),onContextmenu:t[2]||(t[2]=(...a)=>i.onContextMenu&&i.onContextMenu(...a))},null,38)}const Ln=ce(my,[["render",py]]);Ln.install=e=>{e.component(Ln.name,Ln)};const Ho=6,zo=7,Ao=4,_o=3,Ko=5,Uo=4,et=12,gy=24,by=60,yy=60,gt=12,Fr=4,Jo=20,jo={fullName:["January","February","March","April","May","June","July","August","September","October","November","December"],numberName:["1","2","3","4","5","6","7","8","9","10","11","12"],abbrName:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],korName:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},xy={abbrUpperName:["SUN","MON","TUE","WED","THU","FRI","SAT"],abbrLowerName:["sun","mon","tue","wed","thu","fri","sat"],abbrPascalName:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],abbrKorName:["일","월","화","수","목","금","토"]},st={DATE:"date",MONTH:"month",YEAR:"year"},us=864e5,fs=+new Date("1970-01-01 00:00:00"),Hr=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),zr=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),Sy=(e,t)=>e.length?e.reduce((n,i)=>new Date(n).getTime()>new Date(i).getTime()?n:i):"",Xe=e=>e===null?"00":+e<10?`0${e}`:e,Mn=(e,t)=>Array.from(Array(e),()=>Array(t).fill(!1)),Cy=(e,t)=>new Date(`${e}-${t}-1`).getDay(),Qo=(e,t)=>{let n;switch(t){case 4:case 6:case 9:case 11:n=30;break;case 2:e%4===0&&e%100!==0||e%400===0?n=29:n=28;break;default:n=31;break}return n},si=({year:e,month:t,date:n,hour:i,min:s,sec:l})=>i!==void 0&&s!==void 0&&l!==void 0?`${e}-${Xe(t)}-${Xe(n)} ${Xe(i)}:${Xe(s)}:${Xe(l)}`:`${e}-${Xe(t)}-${Xe(n)}`,Ne=(e,t)=>{var s,l,a,r,c,d;let n=o.unref(e);Array.isArray(n)&&(n=Sy(e));const i={year:+((s=n==null?void 0:n.split(" ")[0])==null?void 0:s.split("-")[0])||null,month:+((l=n==null?void 0:n.split(" ")[0])==null?void 0:l.split("-")[1])||null,date:+((a=n==null?void 0:n.split(" ")[0])==null?void 0:a.split("-")[2])||null,hour:+((r=n==null?void 0:n.split(" ")[1])==null?void 0:r.split(":")[0])||0,min:+((c=n==null?void 0:n.split(" ")[1])==null?void 0:c.split(":")[1])||0,sec:+((d=n==null?void 0:n.split(" ")[1])==null?void 0:d.split(":")[2])||0};return t==="year"?i.year:t==="month"?i.month:t==="date"?i.date:t==="hour"?i.hour:t==="min"?i.min:t==="sec"?i.sec:i},Ar=(e,t,n)=>e==="next"?{year:n===12?t+1:t,month:(n+1)%12||12}:{year:n===1?t-1:t,month:(n-1)%12||12},oi=(e,t,n)=>{const i=Ne(t,n);if(e){const s=e==null?void 0:e.split(":")[0],l=e==null?void 0:e.split(":")[1],a=e==null?void 0:e.split(":")[2];if(n==="hour")return s==="HH"?i:+s;if(n==="min")return l==="mm"?i:+l;if(n==="sec")return a==="ss"?i:+a}return i},Me=(e,t)=>{if(!t)return"";const n=Xe(oi(e,t,"hour")),i=Xe(oi(e,t,"min")),s=Xe(oi(e,t,"sec"));return`${t.split(" ")[0]} ${n}:${i}:${s}`},ms=(e,t,n,i)=>{if(!i.length)return!1;let s=t==="main"?n:i[0],l=t==="expanded"?n:i[1],a=s,r=l;if(!n.split(" ")[1])if(e==="dateTimeRange"){s=s.split(" ")[0],l=l.split(" ")[0];const c=i[0].split(" ")[1],d=i[1].split(" ")[1];a=`${s} ${c}`,r=`${l} ${d}`}else a=`${s} 00:00:00`,r=`${l} 23:59:59`;return a&&r&&new Date(a).getTime()>+new Date(r).getTime()},vn=e=>new Date(`${e}`).getTime(),_r=e=>{const t=10**(e.toString().length-1),n=Math.floor(e/t),i=Math.floor(e%(t*n)),s=n*t+Math.floor(i/Jo)*Jo,l=s+Jo-1;return{start:s,end:l}},ky=()=>{var p,y,C;const{props:e}=o.getCurrentInstance(),t=(p=e.options)==null?void 0:p.timeFormat,n=o.computed(()=>["dateRange","dateTimeRange"].includes(e.mode)?["main","expanded"]:["main"]);let i;if(e.mode!=="dateMulti"&&e.mode!=="dateRange"&&e.mode!=="dateTimeRange")if(e.modelValue&&(e.modelValue.length===10&&Hr.exec((y=e.modelValue)==null?void 0:y.toString())||e.modelValue.length===19&&zr.exec((C=e.modelValue)==null?void 0:C.toString())))if(e.mode==="dateTime"&&t){const b=Me(t,e.modelValue);i=o.ref(b)}else i=o.ref(e.modelValue);else i=o.ref("");else if(Array.isArray(e.modelValue)&&e.modelValue.every(b=>!b||b.length===10&&Hr.exec(b)||b.length===19&&zr.exec(b)))if(e.mode==="dateTimeRange"&&e.modelValue.length===2&&t){const b=[];b.push(Me(t[0],e.modelValue[0])),b.push(Me(t[1],e.modelValue[1])),i=o.ref([...b])}else i=o.ref([...e.modelValue]);else i=o.ref([]);const s=()=>{e.mode==="date"&&e.modelValue&&typeof e.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'date', v-model must be 'String' type."):e.mode==="dateTime"&&e.modelValue&&typeof e.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'dateTime', v-model must be 'String' type."):e.mode==="dateMulti"&&e.modelValue&&!Array.isArray(e.modelValue)?console.warn("[EVUI][Calendar] When mode is 'dateMulti', v-model must be 'Array' type."):e.mode==="dateRange"&&e.modelValue?Array.isArray(e.modelValue)?vn(`${e.modelValue[0]} 00:00:00`)>vn(`${e.modelValue[1]} 00:00:00`)&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateRange', v-model must be 'Array' type."):e.mode==="dateTimeRange"&&e.modelValue&&(Array.isArray(e.modelValue)?vn(e.modelValue[0])>vn(e.modelValue[1])&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateTimeRange', v-model must be 'Array' type."))};let l;const a=["dateRange","dateTimeRange"].includes(e.mode)?i.value[0]:i.value;a!=null&&a.length?l={year:Ne(a,"year"),month:Ne(a,"month"),hour:Math.floor(Ne(a,"hour")/gt)+1||1,min:Math.floor(Ne(a,"min")/gt)+1||1,sec:Math.floor(Ne(a,"sec")/gt)+1||1}:l={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};let r;if(["dateRange","dateTimeRange"].includes(e.mode)&&Array.isArray(i.value)&&i.value[1]){const b=i.value[1];r={year:Ne(b,"year"),month:Ne(b,"month")},e.mode==="dateTimeRange"&&(r.hour=Math.floor(Ne(b,"hour")/gt)+1||1,r.min=Math.floor(Ne(b,"min")/gt)+1||1,r.sec=Math.floor(Ne(b,"sec")/gt)+1||1)}else r={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};const c=o.reactive({main:l,expanded:r}),d=o.reactive({main:o.computed(()=>_r(c.main.year)),expanded:o.computed(()=>_r(c.expanded.year))}),h=o.computed(()=>jo[e.monthNotation][c.main.month-1]),u=o.computed(()=>jo[e.monthNotation][c.expanded.month-1]),m=o.reactive({main:h,expanded:u}),f=o.computed(()=>xy[e.dayOfTheWeekNotation]),g=o.reactive({main:st.DATE,expanded:st.DATE});return o.onBeforeMount(()=>{s()}),{calendarList:n,selectedValue:i,calendarPageInfo:c,calendarYearRangeInfo:d,calendarMonth:m,dayOfTheWeekList:f,selectedListType:g}},wy=e=>{const{props:t}=o.getCurrentInstance(),{selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:s}=e,l=o.reactive({main:Mn(Ko,Uo),expanded:Mn(Ko,Uo)}),a=o.reactive({main:Mn(Ao,_o),expanded:Mn(Ao,_o)}),r=o.reactive({main:Mn(Ho,zo),expanded:Mn(Ho,zo)}),c=o.reactive({main:{hour:[],min:[],sec:[]},expanded:{hour:[],min:[],sec:[]}});return{calendarTableInfo:r,calendarMonthTableInfo:a,calendarYearTableInfo:l,calendarTimeTableInfo:c,setCalendarDate:g=>{const p=i[g];let y=t.options.disabledDate;y&&Array.isArray(y)&&(y=g==="main"?y[0]:y[1]);const C=["dateRange","dateTimeRange"].includes(t.mode),b=si({year:new Date().getFullYear(),month:new Date().getMonth()+1,date:new Date().getDate()}),k=(et+p.month-1)%et||et,L=(p.month+1)%et||et,w=p.month===1?p.year-1:p.year,M=p.month===12?p.year+1:p.year,V=Cy(p.year,p.month),S=Qo(p.month===1?p.year-1:p.year,(et+p.month-1)%et||et),x=Qo(p.year,p.month);let I="";t.mode.includes("Time")&&(t.mode==="dateTime"?I=n.value:I=g==="main"?n.value[0]:n.value[1]);let T=0,v=0,E=0,Z=0,W="";const R=(X,G,N)=>{var O,z,j;W=si({year:v,month:E,date:Z});const P=(I==null?void 0:I.split(" ")[1])??"",B=C&&!y&&ms(t.mode,g,W,n.value)||+new Date(`${W} ${P}`)<fs,H=y&&y(new Date(`${W} ${P}`))||B,D=+(g!=="main"),Y=C&&n.value.length>D&&((z=(O=n.value)==null?void 0:O[D])==null?void 0:z.includes(W)),F=!H&&(C?Y:(j=n.value)==null?void 0:j.includes(W));r[g][G][N]={monthType:`${X}${H?" disabled":""}`,isToday:b===W,isSelected:F,year:v,month:E,date:Z}};for(let X=0;X<Ho;X++)for(let G=0;G<zo;G++)X===0?V!==0?G<V?(v=w,E=k,Z=S-V+1+G,R("prev",X,G)):(T++,v=p.year,E=p.month,Z=T,R("",X,G)):(v=w,E=k,Z=S-6+G,R("prev",X,G)):x<=T?(T++,v=M,E=L,Z=T-x,R("next",X,G)):(T++,v=p.year,E=p.month,Z=T,R("",X,G))},setCalendarMonth:g=>{let p=0;const y=new Date().getFullYear(),C=new Date().getMonth()+1,{year:b,month:k}=i[g];for(let L=0;L<Ao;L++)for(let w=0;w<_o;w++)a[g][L][w]={label:jo.abbrName[p++],value:p,today:b===y&&p===C,isSelected:p===k}},setCalendarYear:g=>{let p=s[g].start;const y=new Date().getFullYear(),C=new Date(fs).getFullYear();for(let b=0;b<Ko;b++)for(let k=0;k<Uo;k++)l[g][b][k]={label:p,value:p,today:p===y,isSelected:p===i[g].year,disabled:p<C},p++},setHmsTime:()=>{var V,S;const g=(V=t.options)==null?void 0:V.timeFormat,p=(S=t.options)==null?void 0:S.disabledDate,y=Array.isArray(g)?g[0]:g,C=Array.isArray(g)?g[1]:"",b=t.mode==="dateTimeRange"?n.value[0]:n.value,k=t.mode==="dateTimeRange"?n.value[1]:"",L=Array.isArray(p)?p[0]:p,w=Array.isArray(p)?p[1]:p,M=(x,I,T)=>{const v=x==="main"?b:k,E=x==="main"?L:w;if(!v)return!1;const Z=v.split(" ")[0];let W=Ne(v,"hour"),R=Ne(v,"min"),X=Ne(v,"sec");I==="hour"?W=T:I==="min"?R=T:I==="sec"&&(X=T);const G=`${Z} ${Xe(W)}:${Xe(R)}:${Xe(X)}`;return E&&E(new Date(G))?!0:!E&&ms(t.mode,x,G,n.value)};["hour","min","sec"].forEach(x=>{let I=yy;x==="hour"?I=gy:x==="min"&&(I=by);const T=b&&b.length>0?oi(y,b,x):-1,v=k&&k.length>0?oi(C,k,x):-1;for(let E=0;E<I;E++){let Z=t.mode==="dateTimeRange"&&M("main",x,E);c.main[x][E]={timeType:x,num:E,isSelected:!Z&&T===E,isDisabled:Z},t.mode==="dateTimeRange"&&(Z=M("expanded",x,E),c.expanded[x][E]={timeType:x,num:E,isSelected:!Z&&v===E,isDisabled:Z})}})},getTimeInfo:(g,p,y,C)=>{const b=i[C],k=c[C],L=b[g]-1,w=p-1,M=y-1,V=L*gt+w*Fr+M;return k[g][V]}}},Iy=e=>{var W;const{props:t,emit:n}=o.getCurrentInstance(),i=(W=t.options)==null?void 0:W.timeFormat,{selectedValue:s,calendarPageInfo:l,calendarTimeTableInfo:a,setCalendarDate:r,setCalendarMonth:c,setCalendarYear:d,setHmsTime:h,selectedListType:u}=e,m=o.ref(""),f=o.ref(null),g=Array.isArray(i)?i[0]:i,p=Array.isArray(i)?i[1]:"",y={main:{hour:g&&g.split(":")[0]!=="HH",min:g&&g.split(":")[1]!=="mm",sec:g&&g.split(":")[2]!=="ss"},expanded:{hour:p&&p.split(":")[0]!=="HH",min:p&&p.split(":")[1]!=="mm",sec:p&&p.split(":")[2]!=="ss"}},C=(R,X)=>{const G=l[R],{year:N,month:P,hour:B,min:H,sec:D}=X;N&&(G.year=N),P&&(G.month=P),B&&(G.hour=B),H&&(G.min=H),D&&(G.sec=D)},b=R=>{R==null||R.forEach((X,G)=>{const N=G===0?"main":"expanded";C(N,{year:Ne(X,"year"),month:Ne(X,"month"),hour:Math.floor(Ne(X,"hour")/gt)+1,min:Math.floor(Ne(X,"min")/gt)+1,sec:Math.floor(Ne(X,"sec")/gt)+1}),r(N)})},k=(R,X)=>{const G=u[R]===st.MONTH?1:20,N=X==="prev"?-G:G,P=new Date(fs).getFullYear(),B=l[R].year+N;l[R].year=B<P?P:B},L=(R,X)=>{const G=l[R];if(X==="prev"){const N=new Date(fs).getFullYear();if(G.year===N&&G.month===1)return;G.month===1?(G.year-=1,G.month=12):G.month-=1}else G.month===12?(G.year+=1,G.month=1):G.month+=1},w=(R,X)=>{switch(u[R]){case st.DATE:{L(R,X),r(R);break}case st.MONTH:k(R,X),c(R);break;case st.YEAR:k(R,X),d(R);break}},M=(R,X)=>{X===st.DATE?r(R):X===st.MONTH?c(R):X===st.YEAR&&d(R),u[R]=X},V=(R,X)=>{const{value:G}=X;X.disabled||(u[R]===st.YEAR?(l[R].year=G,u[R]=st.MONTH,c(R)):(l[R].month=G,u[R]=st.DATE,r(R)))},S=(R,X)=>{var J,ne,q,ee;const{year:G,month:N,date:P,monthType:B}=X,H=si({year:G,month:N,date:P}),D=t.modelValue?(Array.isArray(t.modelValue)?((J=t.modelValue)==null?void 0:J.map($=>$==null?void 0:$.split(" ")[0]))??[]:t.modelValue.split(" ")[0]).includes(H):!1;let Y=t.options.disabledDate;if(Y&&Array.isArray(Y)&&(Y=R==="main"?Y[0]:Y[1]),Y&&Y(new Date(H))&&!D)return;if(!Y&&["dateRange","dateTimeRange"].includes(t.mode)&&ms(t.mode,R,H,s.value))return;const F=l[R],O=(et+F.month-1)%et||et,z=F.month===1?F.year-1:F.year,j=(F.month+1)%et||et,U=F.month===12?F.year+1:F.year,Q=()=>{B.includes("prev")?(F.year=z,F.month=O):B.includes("next")&&(F.year=U,F.month=j)};switch(t.mode){case"date":n("update:modelValue",H);break;case"dateTime":{const he=!!((ne=s.value)!=null&&ne.split(" ")[1])?(q=s.value)==null?void 0:q.split(" ")[1]:"00:00:00",fe=Me(i,`${H} ${he}`);n("update:modelValue",fe);break}case"dateMulti":{const $=t.options.multiType,he=t.options.multiDayLimit;if($==="date"){const fe=s.value.indexOf(H);fe>-1?(s.value.splice(fe,1),n("update:modelValue",[...s.value])):s.value.length<he&&(s.value.push(H),Q(),n("update:modelValue",[...s.value]))}else if($==="week"||$==="weekday"){const fe=$==="week"?7:5,ae=$==="week"?6:5,Se=new Date(`${H} 00:00:00`),ye=Se.getDay(),oe=ae-ye,re=Se.getTime()+us*oe;for(let pe=0;pe<fe;pe++){const Te=new Date(re-pe*us).getFullYear(),Ge=new Date(re-pe*us).getMonth()+1,Lt=new Date(re-pe*us).getDate(),Zt=`${Te}-${Xe(Ge)}-${Xe(Lt)}`;if(pe===0)if(s.value.includes(Zt)){s.value.splice(0);break}else s.value.splice(0),Q();(!Y||!Y(new Date(Zt)))&&s.value.unshift(Zt)}n("update:modelValue",[...s.value])}r("main");break}case"dateRange":{let $=[...s.value];if(!s.value.length)$=[H,H];else{const he=+(R==="expanded");$[he]=H}n("update:modelValue",$);break}case"dateTimeRange":{let $=[...s.value];if($.length){const he=+(R==="expanded"),fe=((ee=$[he])==null?void 0:ee.split(" ")[1])||"00:00:00";let ae=`${H} ${fe}`;i&&i.length&&(ae=Me(i[he],ae)),$[he]=ae}else{let he=`${H} 00:00:00`,fe=`${H} 00:00:00`;i&&i.length&&(he=Me(i[0],he),fe=Me(i[1],fe)),$=[he,fe]}n("update:modelValue",$);break}}},x=(R,X,G)=>{if(y[R][X])return;const N=l[R],P=1;X==="hour"?G==="down"&&N.hour<2?N.hour++:G==="up"&&N.hour>P&&N.hour--:X==="min"?G==="down"&&N.min<5?N.min++:G==="up"&&N.min>P&&N.min--:X==="sec"&&(G==="down"&&N.sec<5?N.sec++:G==="up"&&N.sec>P&&N.sec--)},I=(R,X,G,N)=>{var ne;if(y[R][X])return;const P=l[R],B=a[R],H=P[X]-1,D=G-1,Y=N-1,F=H*gt+D*Fr+Y;if((ne=B[X][F])!=null&&ne.isDisabled)return;const O=new Date,z={year:O.getFullYear(),month:O.getMonth()+1,date:O.getDate()};let j=!0,U=[];const Q=()=>{let q;return X==="hour"?q=`${Xe(F)}:00:00'`:X==="min"?q=`00:${Xe(F)}:00`:X==="sec"&&(q=`00:00:${Xe(F)}`),`${si(z)} ${q}`},J=q=>{let ae=11;return X==="min"?ae=14:X==="sec"&&(ae=17),`${q==null?void 0:q.substr(0,ae)}${Xe(F)}${q==null?void 0:q.substr(ae+2)}`};if(t.mode==="dateTime"){let q;t.modelValue?q=Me(i,J(t.modelValue)):(j=!1,q=Me(i,Q())),n("update:modelValue",q),U.push(q)}else{const q=R!=="main"|0;let ee=[...s.value];if(t.modelValue.length){let $=J(t.modelValue[q]);i&&i.length&&($=Me(i[q],$)),ee[q]=$}else{const $=Q();ee=[$,$],i&&i.length&&(ee=[...ee.map((he,fe)=>Me(i[fe],he))]),j=!1,U=ee}n("update:modelValue",ee)}h(),j||b(U)},T=(R,X)=>{w(R,X.deltaY>0?"next":"prev")},v=(R,X,G)=>{y[R][X]||x(R,X,G.deltaY>0?"down":"up")},E=hs((R,X)=>{const G=X.target.tagName==="TD"?X.target:X.target.parentElement,N=G.classList.contains("disabled"),P=G.classList.contains("prev"),B=G.classList.contains("next");if(G.classList.length>0&&!N){const H=l[R];let D={year:+H.year,month:+H.month,date:X.target.innerText};P?D={...D,...Ar("prev",D.year,D.month)}:B&&(D={...D,...Ar("next",D.year,D.month)});const Y=m.value,F=si({year:D.year,month:D.month,date:D.date});vn(F)<vn(Y)?(s.value[0]=F,s.value[1]=Y):(s.value[0]=Y,s.value[1]=F),r("main"),r("expanded")}},10),Z=R=>{const X=["dateRange","dateMulti","dateTimeRange"].includes(t.mode),G=t.options.disabledDate;if(X){const[N,P]=s.value;let[B,H]=[G,G];if(G&&Array.isArray(G)&&([B,H]=G),R[0]&&R[0]!==N&&B&&B(new Date(R[0])))return!0;if(R[1]&&R[1]!==P&&H&&H(new Date(R[1])))return!0;if(!G&&ms(t.mode,"main",R[0],R))return!0}else{if(t.mode==="dateMulti")return R.some(N=>G&&G(new Date(N)));if(G&&G(new Date(R)))return!0}return!1};return o.watch(()=>t.modelValue,R=>{if(Z(R)){n("update:modelValue",s.value);return}const X=["dateRange","dateMulti","dateTimeRange"].includes(t.mode);if(s.value=X?[...R]:R,t.mode==="dateRange")b(R);else if(t.mode.includes("Time")){let G=[];t.mode==="dateTime"?G=[R]:t.mode==="dateTimeRange"&&(G=R),b(G),h()}else t.mode==="date"&&b([R])}),{clickYearMonthBtn:M,clickPrevNextBtn:w,clickDate:S,clickYearMonth:V,clickHmsBtn:x,clickTime:I,wheelMonth:T,wheelTime:v,calendarEventName:f,onMousemoveDate:E,preventTimeEventType:y}},Ty={name:"EvCalendar",props:{modelValue:{type:[String,Array],default:"",validator:e=>{const t=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(e)?e.every(i=>!!(!i||i.length===10&&t.exec(i))||i.length===19&&n.exec(i)):!!(!e||e.length===10&&t.exec(e)||e.length===19&&n.exec(e))}},mode:{type:String,default:"date",validator:e=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(e)!==-1},monthNotation:{type:String,default:"fullName",validator:e=>["fullName","abbrName","numberName","korName"].indexOf(e)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:e=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(e)!==-1},options:{type:Object,default:()=>({multiType:"date",limit:1}),validator:({multiType:e,multiDayLimit:t,disabledDate:n,timeFormat:i})=>{const s=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!e||["weekday","week","date"].indexOf(e)!==-1)&&(!t||typeof t=="number"&&t>0)&&(!n||typeof n=="function"||Array.isArray(n))&&Array.isArray(i)?i.every(l=>!!(!l||s.exec(l))):!!(!i||s.exec(i))}}},emits:{"update:modelValue":[Array,String]},setup(e){const{calendarList:t,selectedValue:n,calendarPageInfo:i,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r}=ky(),{calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,setCalendarDate:m,setCalendarMonth:f,setCalendarYear:g,setHmsTime:p,getTimeInfo:y}=wy({selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:a}),{clickPrevNextBtn:C,clickYearMonthBtn:b,clickDate:k,clickYearMonth:L,clickHmsBtn:w,clickTime:M,wheelMonth:V,wheelTime:S,calendarEventName:x,onMousemoveDate:I,preventTimeEventType:T}=Iy({selectedValue:n,calendarPageInfo:i,calendarTimeTableInfo:u,selectedListType:r,setCalendarDate:m,setCalendarMonth:f,setCalendarYear:g,setHmsTime:p});return m("main"),["dateRange","dateTimeRange"].includes(e.mode)&&m("expanded"),["dateTime","dateTimeRange"].includes(e.mode)&&p(),{calendarList:t,selectedValue:n,calendarPageInfo:i,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r,calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,getTimeInfo:y,clickPrevNextBtn:C,clickYearMonthBtn:b,clickDate:k,clickYearMonth:L,clickHmsBtn:w,clickTime:M,wheelMonth:V,wheelTime:S,calendarEventName:x,onMousemoveDate:I,preventTimeEventType:T}}},Ly={class:"ev-calendar-wrapper"},My={class:"ev-calendar-date-area"},vy={class:"ev-calendar-header"},Ry=["onClick"],Vy={class:"ev-calendar-year-month-wrapper"},Ey={key:0,class:"ev-calendar-year-range"},Wy=["onClick"],Gy=["onClick"],Zy=["onClick"],Xy={class:"ev-calendar-body"},Ny=["onWheel"],Py=["onClick"],Dy=["onWheel"],By=["onClick"],Oy={key:2,class:"ev-calendar-selector-btn-wrapper"},Yy={key:0,class:"ev-calendar-time-area"},Fy={key:0,class:"ev-calendar-time-area-disabled"},Hy={class:"ev-calendar-time-side"},zy={class:"ev-calendar-time-center"},Ay=["onWheel"],_y=["onClick"],Ky={class:"ev-calendar-time-side"},Uy=["onClick"];function Jy(e,t,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createElementBlock("div",Ly,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarList,r=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:r},[o.createElementVNode("div",My,[o.createElementVNode("div",vy,[o.createElementVNode("div",{class:"move-month-arrow",onClick:c=>i.clickPrevNextBtn(r,"prev")},[...t[0]||(t[0]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-left move-month-arrow-icon"},null,-1)])],8,Ry),o.createElementVNode("div",Vy,[i.selectedListType[r]==="year"?(o.openBlock(),o.createElementBlock("span",Ey,o.toDisplayString(i.calendarYearRangeInfo[r].start+" - "+i.calendarYearRangeInfo[r].end),1)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("span",{class:"ev-calendar-year",onClick:c=>i.clickYearMonthBtn(r,"year")},o.toDisplayString(i.calendarPageInfo[r].year),9,Wy),i.selectedListType[r]==="date"?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-calendar-month",onClick:c=>i.clickYearMonthBtn(r,"month")},o.toDisplayString(i.calendarMonth[r]),9,Gy)):o.createCommentVNode("",!0)],64))]),o.createElementVNode("div",{class:"move-month-arrow",onClick:c=>i.clickPrevNextBtn(r,"next")},[...t[1]||(t[1]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-right move-month-arrow-icon"},null,-1)])],8,Zy)]),o.createElementVNode("div",Xy,[i.selectedListType[r]==="date"?(o.openBlock(),o.createElementBlock("table",{key:`${r}_calendar_table`,class:"ev-calendar-table"},[o.createElementVNode("thead",null,[o.createElementVNode("tr",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.dayOfTheWeekList,c=>(o.openBlock(),o.createElementBlock("th",{key:c},o.toDisplayString(c),1))),128))])]),o.createElementVNode("tbody",{onWheel:o.withModifiers(c=>i.wheelMonth(r,c),["prevent"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarTableInfo[r],c=>(o.openBlock(),o.createElementBlock("tr",{key:c},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,d=>(o.openBlock(),o.createElementBlock("td",o.mergeProps({key:d,class:["ev-calendar-date-td",{[d.monthType]:!!d.monthType},{today:d.isToday},{selected:d.isSelected}],onClick:h=>i.clickDate(r,d)},{[o.toHandlerKey(`${i.calendarEventName}`)]:h=>i.onMousemoveDate(r,h)}),[o.createElementVNode("div",null,[o.createElementVNode("span",null,o.toDisplayString(d.date),1)])],16,Py))),128))]))),128))],40,Ny)])):(o.openBlock(),o.createElementBlock("table",{key:1,class:o.normalizeClass(["ev-calendar-selector-table",`ev-calendar-selector-table--${i.selectedListType[r]}`])},[o.createElementVNode("tbody",{onWheel:o.withModifiers(c=>i.wheelMonth(r,c),["prevent"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.selectedListType[r]==="month"?i.calendarMonthTableInfo[r]:i.calendarYearTableInfo[r],c=>(o.openBlock(),o.createElementBlock("tr",{key:c},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,d=>(o.openBlock(),o.createElementBlock("td",{key:d.value,onClick:h=>i.clickYearMonth(r,d)},[o.createElementVNode("div",{class:o.normalizeClass(["ev-calendar-selector",{selected:d.isSelected},{today:d.today},{disabled:d.disabled}])},o.toDisplayString(d.label),3)],8,By))),128))]))),128))],40,Dy)],2)),i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",Oy,[o.createVNode(a,{onClick:c=>i.clickYearMonthBtn(r,"date")},{default:o.withCtx(()=>[...t[2]||(t[2]=[o.createTextVNode(" Done ",-1)])]),_:1},8,["onClick"])])):o.createCommentVNode("",!0)])]),["dateTime","dateTimeRange"].includes(n.mode)?(o.openBlock(),o.createElementBlock("div",Yy,[i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",Fy)):o.createCommentVNode("",!0),o.createElementVNode("div",Hy,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["HOUR","MIN","SEC"],c=>o.createElementVNode("div",{key:`${c}_label`,class:"ev-calendar-time-side--label"},o.toDisplayString(c),1)),64))]),o.createElementVNode("div",zy,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["hour","min","sec"],c=>o.createElementVNode("table",{key:`${c}_table`,class:"ev-calendar-time-table"},[o.createElementVNode("tbody",{onWheel:o.withModifiers(d=>i.wheelTime(r,c,d),["prevent"])},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,d=>o.createElementVNode("tr",{key:`${c}_${d}_tr`},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(4,h=>o.createElementVNode("td",{key:`${c}_${d}_${h}_td`,class:o.normalizeClass(["ev-calendar-time-td",{selected:i.getTimeInfo(c,d,h,r).isSelected},{disabled:i.preventTimeEventType[r][c]||i.getTimeInfo(c,d,h,r).isDisabled}]),onClick:u=>i.clickTime(r,c,d,h)},[o.createElementVNode("div",null,o.toDisplayString(i.getTimeInfo(c,d,h,r).num),1)],10,_y)),64))])),64))],40,Ay)])),64))]),o.createElementVNode("div",Ky,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["hour","min","sec"],c=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${c}_btn_area`},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["up","down"],d=>o.createElementVNode("div",{key:`${c}_${d}_btn`,class:o.normalizeClass(["ev-calendar-time-side--btn",`arrow-${c}`,{disabled:i.preventTimeEventType[r][c]}]),onClick:h=>i.clickHmsBtn(r,c,d)},[o.createElementVNode("i",{class:o.normalizeClass(`ev-icon-arrow-${d}`)},null,2)],10,Uy)),64))],64))),64))])])):o.createCommentVNode("",!0)],64))),128))])}const li=ce(Ty,[["render",Jy]]);li.install=e=>{e.component(li.name,li)};const jy=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),Qy=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),$y=()=>{var m;const{props:e,emit:t}=o.getCurrentInstance(),n=(m=e.options)==null?void 0:m.timeFormat,i=["dateTimeRange","dateRange","dateMulti"].includes(e.mode),s=f=>{let g;if(e.mode==="dateTime")g=Me(n,f);else if(e.modelValue.length){const[p,y]=n;g=[Me(p,f[0]),Me(y,f[1])]}return g},l=o.computed({get:()=>e.modelValue?["dateTime","dateTimeRange"].includes(e.mode)&&n?s(e.modelValue):i?[...e.modelValue]:e.modelValue:e.mode==="date"||e.mode==="dateTime"?"":[],set:f=>{if(["dateTime","dateTimeRange"].includes(e.mode)&&n){t("update:modelValue",s(f));return}t("update:modelValue",f)}});let a;if(["dateTimeRange","dateTime"].includes(e.mode)&&n)if(e.mode==="dateTimeRange"&&Array.isArray(e.modelValue)&&e.modelValue.length===2){const[f,g]=e.modelValue,[p,y]=n;e.modelValue=[Me(p,f),Me(y,g)],a=o.ref([...e.modelValue])}else e.mode==="dateTime"&&e.modelValue?a=o.ref(Me(n,e.modelValue)):a=o.ref(e.modelValue);else a=o.ref(i?[...e.modelValue]:e.modelValue);const r=f=>{const g=b=>!!(b.length===10&&jy.exec(b)),p=b=>!!(b.length===19&&Qy.exec(b)),y=b=>{const k=b.split(" ")[0],L=+k.split("-")[0],w=+k.split("-")[1],M=+k.split("-")[2],V=Qo(L,w);return+M<=V&&L>=new Date(0).getFullYear()};let C=!0;e.mode==="date"?C=g(f)&&y(f):e.mode==="dateTime"?C=p(f)&&y(f):e.mode==="dateRange"?C=f.every(b=>g(b)&&y(b)):e.mode==="dateTimeRange"&&(C=f.every(b=>p(b)&&y(b))),C&&(l.value=i?[...f]:f),a.value=i?[...l.value]:l.value},c=o.computed(()=>e.mode==="date"||e.mode==="dateTime"?l.value:l.value.length);return{mv:l,currentValue:a,isClearableIcon:c,validateValue:r,removeAllMv:()=>{e.mode==="date"||e.mode==="dateTime"?l.value=null:(l.value.splice(0),l.value=[...l.value])},changeMv:async f=>{await o.nextTick(),t("change",l.value,f)},removeMv:f=>{if(!e.disabled){const g=l.value.indexOf(f);l.value.splice(g,1),l.value=[...l.value]}}}},qy=()=>{const{props:e}=o.getCurrentInstance(),t=o.ref(!1),n=o.ref(null),i=o.ref(null),s=o.ref(null),l=o.ref(null),a=o.reactive({top:null,right:null,left:null}),r=async()=>{var k,L;await o.nextTick();const h=(k=i.value)==null?void 0:k.getBoundingClientRect(),u=(L=s.value)==null?void 0:L.getBoundingClientRect(),m=h.height,f=h.y,g=h.x,p=u.height,y=u.width,C=document.documentElement.clientHeight,b=document.documentElement.clientWidth;C<f+m+p?(a.top=`-${p}px`,b<g+y?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto")):(a.top=`${m}px`,b<g+y?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto"))};return{isDropbox:t,datePicker:n,datePickerWrapper:i,dropbox:s,itemWrapper:l,dropboxPosition:a,clickSelectInput:async()=>{e.disabled||(t.value=e.enableTextInput?!0:!t.value,t.value&&await r())},clickOutsideDropbox:()=>{t.value=!1},changeDropboxPosition:r}},ex=e=>{var f;const{props:t}=o.getCurrentInstance(),{mv:n,currentValue:i,clickOutsideDropbox:s}=e,l=o.reactive([]);(f=t.shortcuts)==null||f.forEach(({value:g,label:p,shortcutDate:y})=>{l.push({key:g,label:p,shortcutDate:y,isActive:!1})});const a=()=>{const g=l.find(p=>p.isActive);g&&(g.isActive=!1)},r=g=>{const p=l.find(y=>y.key===g);p&&(p.isActive=!0)},c=g=>g===null?"00":+g<10?`0${g}`:g,d=g=>{const p=g?new Date(g):new Date,y=p.getFullYear(),C=p.getMonth()+1,b=p.getDate();return`${y}-${c(C)}-${c(b)}`},h=g=>{const p=g?new Date(g):new Date,y=p.getHours(),C=p.getMinutes(),b=p.getSeconds();return`${d(p)} ${c(y)}:${c(C)}:${c(b)}`},u=()=>{var y,C;a();const g=["dateRange","dateTimeRange"].includes(t.mode);if(!l.length||t.mode==="dateMulti"&&((y=t.options)==null?void 0:y.multiType)!=="date"||g&&!n.value.length||!g&&!n.value)return;let p;if(g){const b=(C=t.options)==null?void 0:C.timeFormat,[k,L]=n.value;let w;t.mode==="dateTimeRange"&&(b!=null&&b.length)?w=l.find(({shortcutDate:M})=>{const[V,S]=M(),[x,I]=b,T=Me(x,h(V)),v=Me(I,h(S)),E=T===h(k),Z=v===h(L);return E&&Z}):w=l.find(({shortcutDate:M})=>{const[V,S]=M(),x=t.mode==="dateTimeRange"?h:d,I=x(V)===x(k),T=x(S)===x(L);return I&&T}),p=w==null?void 0:w.key}else{const b=t.mode==="dateTime"?h:d,k=b(n.value),L=l.find(({shortcutDate:w})=>b(w())===k);p=L==null?void 0:L.key}p&&r(p)},m=g=>{var k;const p=["dateRange","dateTimeRange"].includes(t.mode),y=l.find(({key:L})=>L===g);if(!y)return;const C=y.shortcutDate,b=(k=t.options)==null?void 0:k.timeFormat;if(p){const[L,w]=C();if(t.mode==="dateTimeRange")if(b!=null&&b.length){const[M,V]=b;n.value=[Me(M,h(L)),Me(V,h(w))]}else n.value=[h(L),h(w)];else n.value=[d(L),d(w)]}else{const L=C();n.value=t.mode==="dateTime"?Me(b,h(L)):d(L)}a(),r(g)};return o.watch(()=>t.modelValue,g=>{var p,y;if(u(),!(t.mode==="dateMulti"&&((p=t==null?void 0:t.options)==null?void 0:p.multiType)==="date"&&((y=t==null?void 0:t.options)==null?void 0:y.multiDayLimit)>g.length)){if(t.mode==="dateRange"||t.mode==="dateTimeRange"){i.value=[...g];return}else if(t.mode==="dateTime"){i.value=g;return}i.value=g,s()}}),{usedShortcuts:l,clickShortcut:m,setActiveShortcut:u}},tx={name:"EvDatePicker",directives:{clickoutside:Lh},props:{modelValue:{type:[String,Array],default:"",validator:e=>{const t=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(e)?e.every(i=>!!(!i||i.length===10&&t.exec(i))||i.length===19&&n.exec(i)):!!(!e||e.length===10&&t.exec(e)||e.length===19&&n.exec(e))}},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},enableTextInput:{type:Boolean,default:!1},mode:{type:String,default:"date",validator:e=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(e)!==-1},monthNotation:{type:String,default:"fullName",validator:e=>["fullName","abbrName","numberName","korName"].indexOf(e)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:e=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(e)!==-1},options:{type:Object,default:()=>({type:"date",limit:1,tagShorten:!1}),validator:({multiType:e,multiDayLimit:t,disabledDate:n,tagShorten:i,timeFormat:s})=>{const l=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!e||["weekday","week","date"].indexOf(e)!==-1)&&(!t||typeof t=="number"&&t>0)&&(!n||typeof n=="function"||Array.isArray(n))&&(i===void 0||typeof i=="boolean")&&Array.isArray(s)?s.every(a=>!!(!a||l.exec(a))):!!(!s||l.exec(s))}},shortcuts:{type:Array,default:()=>[],validator:e=>e.length?e.every(({shortcutDate:t})=>{if(typeof t!="function")return!1;const n=t();return Array.isArray(n)&&n.every(i=>i instanceof Date)&&n[0]<=n[1]||typeof n=="object"&&n instanceof Date}):!0}},emits:{"update:modelValue":[Array,String]},setup(){const{mv:e,currentValue:t,isClearableIcon:n,validateValue:i,removeAllMv:s,changeMv:l,removeMv:a}=$y(),{isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:m,clickSelectInput:f,clickOutsideDropbox:g,changeDropboxPosition:p}=qy(),{usedShortcuts:y,clickShortcut:C,setActiveShortcut:b}=ex({mv:e,currentValue:t,clickOutsideDropbox:g});return b(),{mv:e,currentValue:t,isClearableIcon:n,validateValue:i,removeAllMv:s,changeMv:l,removeMv:a,isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:m,clickSelectInput:f,clickOutsideDropbox:g,changeDropboxPosition:p,usedShortcuts:y,clickShortcut:C}}},nx={ref:"datePickerWrapper",class:"ev-date-picker__wrapper"},ix=["placeholder","readonly","disabled"],sx=["placeholder","disabled"],ox={class:"ev-tag-name"},lx=["onClick"],ax={key:0,class:"ev-select-tag num"},rx={class:"ev-tag-name"},cx={class:"ev-select-tag num"},dx={class:"ev-tag-name"},hx={class:"ev-date-picker-dropbox-wrapper"},ux={key:0,class:"ev-date-picker-dropbox__button-layout"},fx={key:1,class:"ev-date-picker-dropbox__divider"};function mx(e,t,n,i,s,l){const a=o.resolveComponent("ev-button"),r=o.resolveComponent("ev-button-group"),c=o.resolveComponent("ev-calendar"),d=o.resolveDirective("clickoutside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"datePicker",class:o.normalizeClass(["ev-date-picker",{disabled:e.$props.disabled}])},[o.createElementVNode("div",nx,[e.$props.mode==="date"||e.$props.mode==="dateTime"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t[15]||(t[15]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=h=>i.currentValue=h),type:"text",class:o.normalizeClass(["ev-input",{readonly:!e.$props.enableTextInput}]),placeholder:e.$props.placeholder,readonly:!e.$props.enableTextInput,disabled:e.$props.disabled,onClick:t[1]||(t[1]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h)),onKeydown:t[2]||(t[2]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:t[3]||(t[3]=h=>i.validateValue(i.currentValue))},null,42,ix),[[o.vModelText,i.currentValue,void 0,{trim:!0}]])],64)):e.$props.mode==="dateMulti"||!e.$props.enableTextInput?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-date-picker-tag-wrapper",onClick:t[4]||(t[4]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h))},[t[18]||(t[18]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.createElementVNode("input",{type:"text",class:"ev-input readonly",readonly:"",placeholder:e.$props.placeholder,disabled:e.$props.disabled},null,8,sx),e.$props.mode==="dateMulti"&&(e.$props.options.multiType==="date"||!e.$props.options.tagShorten)?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.mv,(h,u)=>(o.openBlock(),o.createElementBlock("div",{key:`${h}_${u}`,class:o.normalizeClass(["ev-select-tag",{num:e.$props.options.multiType!=="date"}])},[o.createElementVNode("span",ox,o.toDisplayString(h),1),e.$props.options.multiType==="date"?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-tag-suffix",onClick:o.withModifiers(m=>[i.removeMv(h),i.changeDropboxPosition()],["stop"])},[...t[16]||(t[16]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,lx)):o.createCommentVNode("",!0)],2))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.mv[0]?(o.openBlock(),o.createElementBlock("div",ax,[o.createElementVNode("span",rx,o.toDisplayString(i.mv[0]),1)])):o.createCommentVNode("",!0),i.mv[i.mv.length-1]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[t[17]||(t[17]=o.createElementVNode("div",{class:"ev-select-tag num"},[o.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),o.createElementVNode("div",cx,[o.createElementVNode("span",dx,o.toDisplayString(i.mv[i.mv.length-1]),1)])],64)):o.createCommentVNode("",!0)],64))])):(o.openBlock(),o.createElementBlock("div",{key:2,class:"ev-date-picker-input-wrapper",onClick:t[11]||(t[11]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h))},[t[20]||(t[20]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[5]||(t[5]=h=>i.currentValue[0]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:t[6]||(t[6]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:t[7]||(t[7]=h=>i.validateValue(i.currentValue))},null,544),[[o.vModelText,i.currentValue[0],void 0,{trim:!0}]]),i.currentValue[i.currentValue.length-1]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t[19]||(t[19]=o.createElementVNode("div",{class:"ev-date-picker-range-separator"},[o.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[8]||(t[8]=h=>i.currentValue[i.currentValue.length-1]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:t[9]||(t[9]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:t[10]||(t[10]=h=>i.validateValue(i.currentValue))},null,544),[[o.vModelText,i.currentValue[i.currentValue.length-1],void 0,{trim:!0}]])],64)):o.createCommentVNode("",!0)])),e.$props.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:3,class:"ev-input-suffix",onClick:t[12]||(t[12]=o.withModifiers(h=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...t[21]||(t[21]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",hx,[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:o.normalizeClass(["ev-date-picker-dropdown",e.$props.mode]),style:o.normalizeStyle(i.dropboxPosition)},[i.usedShortcuts.length?(o.openBlock(),o.createElementBlock("div",ux,[i.usedShortcuts.length===1?(o.openBlock(),o.createBlock(a,{key:0,type:i.usedShortcuts[0].isActive?"primary":"default",onClick:t[13]||(t[13]=h=>i.clickShortcut(i.usedShortcuts[0].key))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.usedShortcuts[0].label),1)]),_:1},8,["type"])):(o.openBlock(),o.createBlock(r,{key:1},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.usedShortcuts,h=>(o.openBlock(),o.createBlock(a,{key:h.key,type:h.isActive?"primary":"default",onClick:u=>i.clickShortcut(h.key)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.label),1)]),_:2},1032,["type","onClick"]))),128))]),_:1}))])):o.createCommentVNode("",!0),i.usedShortcuts.length?(o.openBlock(),o.createElementBlock("div",fx)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass({"ev-date-picker-dropbox__calendar":i.usedShortcuts.length})},[o.createVNode(c,{key:"fromCalendar",modelValue:i.mv,"onUpdate:modelValue":t[14]||(t[14]=h=>i.mv=h),mode:e.$props.mode,"month-notation":e.$props.monthNotation,"day-of-the-week-notation":e.$props.dayOfTheWeekNotation,options:e.$props.options},null,8,["modelValue","mode","month-notation","day-of-the-week-notation","options"])],2)],6)):o.createCommentVNode("",!0)])],512)],2)),[[d,i.clickOutsideDropbox]])}const ai=ce(tx,[["render",mx]]);ai.install=e=>{e.component(ai.name,ai)};const px={name:"EvMessage",props:{type:{type:String,default:"info",validator:e=>["info","success","warning","error"].includes(e)},message:{type:String,default:""},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!1},iconClass:{type:String,default:""},onClose:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(e,t){const n=o.reactive({timer:null,isShow:!0}),i=()=>{clearTimeout(n.timer),n.timer=null},s=()=>{n.isShow=!1,e.onClose&&e.onClose(),i(),e.unmount&&setTimeout(e.unmount,1e3)},l=()=>{e.duration>0&&(n.timer=setTimeout(()=>{n.isShow&&s()},e.duration))},a=c=>{c.keyCode===27&&n.isShow&&s()},r=()=>{s()};return o.onMounted(()=>{l(),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),i()}),t.expose({hide:r}),{startTimer:l,clearTimer:i,closeMsg:s,...o.toRefs(n),hide:r}}},gx={key:0,class:"ev-message-icon"},bx=["innerHTML"],yx={key:2,class:"ev-message-content"};function xx(e,t,n,i,s,l){return o.openBlock(),o.createBlock(o.Teleport,{to:"#ev-message-modal"},[o.createVNode(o.Transition,{name:"ev-message-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref:"msgRef",class:o.normalizeClass(["ev-message",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass}]),onMouseenter:t[1]||(t[1]=(...a)=>i.clearTimer&&i.clearTimer(...a)),onMouseleave:t[2]||(t[2]=(...a)=>i.startTimer&&i.startTimer(...a))},[n.iconClass?(o.openBlock(),o.createElementBlock("span",gx,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-message-content",innerHTML:n.message},null,8,bx)):(o.openBlock(),o.createElementBlock("div",yx,o.toDisplayString(n.message),1)),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:3,class:"ev-message-close",onClick:t[0]||(t[0]=(...a)=>i.closeMsg&&i.closeMsg(...a))},[...t[3]||(t[3]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],34),[[o.vShow,e.isShow]])]),_:1})])}const Sx=ce(px,[["render",xx]]),Cx=o.defineComponent(Sx),Kr="ev-message-modal",Ur=document.createElement("div");Ur.id=Kr;const ps=(e={})=>{document.getElementById(Kr)||document.body.appendChild(Ur);const n=document.createElement("div"),i=()=>o.render(null,n),s=typeof e=="string"?{message:e,unmount:i}:{...e,unmount:i},l=o.h(Cx,s);return o.render(l,n),l.component.exposed};ps.install=e=>{const t=e.config.globalProperties;t.$message=ps};const kx={name:"EvNotification",props:{type:{type:String,default:"info",validator:e=>["info","success","warning","error"].includes(e)},title:{type:String,default:""},message:{type:String,default:""},position:{type:String,default:"top-right",validator:e=>["top-left","top-right","bottom-left","bottom-right"].includes(e)},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!0},iconClass:{type:String,default:""},onClose:{type:Function,default:null},onClick:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(e){const t=o.reactive({timer:null,isShow:!0}),n=()=>{clearTimeout(t.timer),t.timer=null},i=r=>{r.target.className!=="ev-notification-close"&&e.onClick&&e.onClick()},s=()=>{t.isShow=!1,e.onClose&&e.onClose(),n(),e.unmount&&setTimeout(e.unmount,1e3)},l=()=>{e.duration>0&&(t.timer=setTimeout(()=>{t.isShow&&s()},e.duration))},a=r=>{r.keyCode===27&&t.isShow&&s()};return o.onMounted(()=>{l(),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),n()}),{startTimer:l,clearTimer:n,clickMsg:i,closeMsg:s,...o.toRefs(t)}}},wx={key:0,class:"ev-notification-icon"},Ix={class:"ev-notification-content"},Tx={key:0,class:"title"},Lx=["innerHTML"],Mx={key:2,class:"message"};function vx(e,t,n,i,s,l){return o.openBlock(),o.createBlock(o.Transition,{name:"ev-notification-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(["ev-notification",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-click":!!n.onClick}]),onMouseenter:t[1]||(t[1]=(...a)=>i.clearTimer&&i.clearTimer(...a)),onMouseleave:t[2]||(t[2]=(...a)=>i.startTimer&&i.startTimer(...a)),onClick:t[3]||(t[3]=(...a)=>i.clickMsg&&i.clickMsg(...a))},[n.iconClass?(o.openBlock(),o.createElementBlock("span",wx,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",Ix,[n.title?(o.openBlock(),o.createElementBlock("p",Tx,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"message",innerHTML:n.message},null,8,Lx)):(o.openBlock(),o.createElementBlock("p",Mx,o.toDisplayString(n.message),1))]),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:1,class:"ev-notification-close",onClick:t[0]||(t[0]=(...a)=>i.closeMsg&&i.closeMsg(...a))},[...t[4]||(t[4]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],34),[[o.vShow,e.isShow]])]),_:1})}const Rx=ce(kx,[["render",vx]]),Vx=o.defineComponent(Rx),Jr="ev-notification-modal",gs=document.createElement("div");gs.id=Jr;const Ex=["top-left","top-right","bottom-left","bottom-right"],bs=(e={})=>{const t=e.position||"top-right";if(!Ex.includes(t)){console.warn("[EVUI][Notification] The position value is incorrectly entered.");return}document.getElementById(Jr)||document.body.appendChild(gs);let i=gs.getElementsByClassName(`modal-${t}`);i.length?i=i[0]:(i=document.createElement("div"),i.classList.add(`modal-${t}`),gs.appendChild(i));const l=document.createElement("div"),a=()=>o.render(null,l),r=typeof e=="string"?{message:e,unmount:a}:{...e,unmount:a},c=o.h(Vx,r);o.render(c,l),i.appendChild(c.el)};bs.install=e=>{const t=e.config.globalProperties;t.$notify=bs};const Wx={name:"EvMessageBox",components:{EvButton:xn},props:{type:{type:String,default:"",validator:e=>["","info","success","warning","error"].includes(e)},title:{type:String,default:""},message:{type:[String,Array],default:""},iconClass:{type:String,default:""},onClose:{type:Function,default:null},showClose:{type:Boolean,default:!0},showConfirmBtn:{type:Boolean,default:!0},showCancelBtn:{type:Boolean,default:!0},confirmBtnText:{type:String,default:"OK"},cancelBtnText:{type:String,default:"Cancel"},closeOnClickModal:{type:Boolean,default:!0},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null},focusable:{type:Boolean,default:!1}},setup(e){const t=o.ref(null),n=o.reactive({isShow:!0,iconClass:""}),i=c=>{if(!e.closeOnClickModal&&c==="modal")return;const d=c==="modal"?"cancel":c;n.isShow=!1,e.onClose&&e.onClose(d),e.unmount&&setTimeout(e.unmount,1e3)},s=c=>{c.keyCode===27&&n.isShow&&i()},l=c=>{switch(c){case"success":return"ev-icon-arrow-check";case"warning":return"ev-icon-warning2";case"error":return"ev-icon-warning3";case"info":default:return"ev-icon-info2"}},a=()=>{e.iconClass?n.iconClass=e.iconClass:e.type&&(n.iconClass=l(e.type))},r=c=>{if(!e.focusable)return!1;switch(c){case"confirmBtn":return e.showConfirmBtn;case"cancelBtn":return!e.showConfirmBtn&&e.showCancelBtn;case"messagebox":return!e.showConfirmBtn&&!e.showCancelBtn;default:return!1}};return o.onMounted(()=>{a(),document.addEventListener("keydown",s),r("messagebox")&&t.value.focus()}),o.watch(()=>n.isShow,c=>{c||document.removeEventListener("keydown",s)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",s)}),{closeMsg:i,...o.toRefs(n),msgRef:t,hasFocus:r}}},Gx={key:0,class:"ev-message-box-icon"},Zx={class:"ev-message-box-content"},Xx={key:0,class:"ev-message-box-title"},Nx=["innerHTML"],Px={key:2,class:"ev-message-box-message"},Dx={class:"ev-message-box-btn"};function Bx(e,t,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(o.Transition,{name:"ev-message-box-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{id:"ev-message-box-modal",onClick:t[3]||(t[3]=o.withModifiers(r=>i.closeMsg("modal"),["self"])),onWheel:o.withModifiers(()=>{},["stop","prevent"])},[o.createElementVNode("div",{ref:"msgRef",class:o.normalizeClass(["ev-message-box",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-title":!!n.title}]),tabindex:"-1"},[n.iconClass?(o.openBlock(),o.createElementBlock("span",Gx,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",Zx,[n.title?(o.openBlock(),o.createElementBlock("p",Xx,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"ev-message-box-message",innerHTML:n.message},null,8,Nx)):(o.openBlock(),o.createElementBlock("p",Px,o.toDisplayString(n.message),1))]),o.createElementVNode("div",Dx,[n.showCancelBtn?(o.openBlock(),o.createBlock(a,{key:0,size:"small",class:"ev-message-box-cancel","auto-focus":i.hasFocus("cancelBtn"),onClick:t[0]||(t[0]=r=>i.closeMsg("cancel"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.cancelBtnText),1)]),_:1},8,["auto-focus"])):o.createCommentVNode("",!0),n.showConfirmBtn?(o.openBlock(),o.createBlock(a,{key:1,type:"primary",size:"small",class:"ev-message-box-confirm","auto-focus":i.hasFocus("confirmBtn"),onClick:t[1]||(t[1]=r=>i.closeMsg("ok"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.confirmBtnText),1)]),_:1},8,["auto-focus"])):o.createCommentVNode("",!0)]),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:1,class:"ev-message-box-close",onClick:t[2]||(t[2]=r=>i.closeMsg("cancel"))},[...t[4]||(t[4]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],2)],544),[[o.vShow,e.isShow]])]),_:1})])}const Ox=ce(Wx,[["render",Bx]]),Yx=o.defineComponent(Ox),ys=(e={})=>{const t=document.createElement("div"),n=()=>o.render(null,t),i=typeof e=="string"?{message:e,unmount:n}:{...e,unmount:n},s=o.h(Yx,i);o.render(s,t)};ys.install=e=>{const t=e.config.globalProperties;t.$messagebox=ys};const jr=(e,t)=>Array.from(Array(e),()=>Array(t).fill(!1)),Fx=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.computed({get:()=>e.modelValue.length!==e.rowLabels.length||!e.modelValue[0]||e.modelValue[0].length!==e.colLabels.length?jr(e.rowLabels.length,e.colLabels.length):e.modelValue,set:s=>{t("update:modelValue",s),t("change",s)}});return{mv:n,validateValue:()=>{(e.modelValue.length!==e.rowLabels.length||!e.modelValue[0]||e.modelValue[0].length!==e.colLabels.length)&&(n.value=[...jr(e.rowLabels.length,e.colLabels.length)])}}},Hx=e=>{const{mv:t}=e,n=o.reactive({startRow:null,startCol:null,dragRow:null,dragCol:null,endRow:null,endCol:null,dragEventName:null}),i=(h,u)=>{if(n.dragCol===null||n.dragRow===null)return{};const m=n.startRow<n.dragRow?n.startRow:n.dragRow,f=n.startRow>n.dragRow?n.startRow:n.dragRow,g=n.startCol<n.dragCol?n.startCol:n.dragCol,p=n.startCol>n.dragCol?n.startCol:n.dragCol;if(m>h||f<h||g>u||p<u)return{};const y="2px solid #5292F7";let C={};return h===m&&(C={...C,"border-top":y}),h===f&&(C={...C,"border-bottom":y}),u===g&&(C={...C,"border-left":y}),u===p&&(C={...C,"border-right":y}),C},s=(h,u)=>{n.startRow=h,n.startCol=u,n.dragRow=h,n.dragCol=u,n.dragEventName="mousemove"},l=(h,u)=>{if(!n.dragEventName)return;n.endRow=h,n.endCol=u,n.dragEventName=null;const m=[...t.value],f=n.startRow<n.endRow?n.startRow:n.endRow,g=n.startRow>n.endRow?n.startRow:n.endRow,p=n.startCol<n.endCol?n.startCol:n.endCol,y=n.startCol>n.endCol?n.startCol:n.endCol;for(let C=f;C<=g;C++)for(let b=p;b<=y;b++)m[C][b]=!m[C][b];t.value=[...m],n.dragRow=null,n.dragCol=null};return{mousePos:n,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:(h,u)=>{n.dragRow=h,n.dragCol=u},mouseleaveBoxArea:()=>{l(n.dragRow,n.dragCol)},selectColumn:h=>{const u=[...t.value],m=u[0][h];for(let f=0;f<u.length;f++)u[f][h]=!m;t.value=[...u]},selectRow:h=>{const u=[...t.value],m=u[h][0];for(let f=0;f<u[0].length;f++)u[h][f]=!m;t.value=[...u]}}},zx={name:"EvScheduler",props:{modelValue:{type:Array,default:()=>[]},colLabels:{type:Array,default:()=>['<span style="color: #FF0000">SUN</span>',"MON","TUE","WED","THU","FRI",'<span style="color: #0006F9">SAT</span>']},rowLabels:{type:Array,default:()=>["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"]}},emits:{"update:modelValue":Array,change:Array},setup(){const{mv:e,validateValue:t}=Fx();t();const{mousePos:n,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d}=Hx({mv:e});return{mv:e,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d,...o.toRefs(n)}}},Ax={class:"ev-scheduler-header"},_x=["onClick","innerHTML"],Kx=["onClick","innerHTML"],Ux=["onMousedown","onMouseup"];function Jx(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("table",{class:o.normalizeClass(["ev-scheduler",{draggable:!!e.dragEventName}])},[o.createElementVNode("thead",null,[o.createElementVNode("tr",Ax,[t[1]||(t[1]=o.createElementVNode("td",null,null,-1)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colLabels.length,(a,r)=>(o.openBlock(),o.createElementBlock("td",{key:`${a}_${r}_header`,class:"ev-scheduler-header-label",onClick:c=>i.selectColumn(r),innerHTML:n.colLabels[r]},null,8,_x))),128))])]),o.createElementVNode("tbody",{onMouseleave:t[0]||(t[0]=(...a)=>i.mouseleaveBoxArea&&i.mouseleaveBoxArea(...a))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.rowLabels.length,(a,r)=>(o.openBlock(),o.createElementBlock("tr",{key:`${a}_${r}_body`,class:"ev-scheduler-body"},[(o.openBlock(),o.createElementBlock("td",{key:`${a}_${r}_${n.rowLabels[r]}`,class:"ev-scheduler-body-label",onClick:c=>i.selectRow(r),innerHTML:n.rowLabels[r]},null,8,Kx)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colLabels.length,(c,d)=>(o.openBlock(),o.createElementBlock("td",o.mergeProps({key:`${c}_${r}_${d}_body`,class:["ev-scheduler-body-box",{selected:i.mv[r][d]}],style:i.selectionStyle(r,d),onMousedown:o.withModifiers(h=>i.mousedownBox(r,d,h),["stop","prevent"]),onMouseup:o.withModifiers(h=>i.mouseupBox(r,d),["stop","prevent"])},{[o.toHandlerKey(`${e.dragEventName}`)]:h=>i.mousemoveBox(r,d)}),null,16,Ux))),128))]))),128))],32)],2)}const ri=ce(zx,[["render",Jx]]);ri.install=e=>{e.component(ri.name,ri)};const jx=()=>{const e=o.defineComponent(Qr),t=o.ref([]);return{comp:e,childrenItems:t,initWrapperDiv:()=>{const i=document.createElement("div");i.id="ev-context-menu-modal",i.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-context-menu-modal")||document.body.appendChild(i)}}},Qx=()=>{const{props:e}=o.getCurrentInstance(),t=o.computed(()=>e.isShowMenuOnClick),n=o.ref(!1),i=o.ref(null),s=o.reactive({top:null,left:null,right:null,pageY:null,pageX:null,clientX:null});return{isShow:n,rootMenuList:i,menuStyle:s,show:async r=>{var d,h;n.value=!0,await o.nextTick();const c=(h=(d=i.value)==null?void 0:d.$el)==null?void 0:h.children[0].getBoundingClientRect();if(c){const u=c.height,m=c.width,f=document.documentElement.clientHeight,g=document.documentElement.clientWidth,p=20;s.pageX=r.pageX,s.pageY=r.pageY,s.clientX=r.clientX,f<r.clientY+u?s.top=`${r.pageY-u}px`:s.top=`${r.pageY}px`,g<r.clientX+m+p?s.left=`${r.pageX-m}px`:s.left=`${r.pageX}px`}},hide:async()=>{await o.nextTick(),!t.value&&(n.value=!1)}}},$x=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.computed({get:()=>e.isShow,set:m=>t("update:isShow",m)}),i=o.computed(()=>!!e.items.some(m=>m.children)),s=o.ref([]),l=o.ref(!1),a=o.ref(null),r=o.reactive({top:null,left:null,right:null}),c=m=>{m||(n.value=!1)},d=m=>{var T,v,E;const f=document.documentElement.clientWidth,g=document.documentElement.clientHeight,p=20,y=(T=m.target.parentElement)==null?void 0:T.getBoundingClientRect(),{x:C,y:b,width:k,height:L}=y,w=(E=(v=a.value)==null?void 0:v.$el)==null?void 0:E.children[0].getBoundingClientRect(),{width:M,height:V}=w,S=m.target.offsetTop,x=g<b+S+V,I=f<C+k+M+p;x?r.top=`${L-V}px`:r.top=`${S}px`,I?r.left=`${0-M}px`:r.left=`${k}px`};return{computedIsShow:n,isExistChild:i,isShowChild:l,childMenu:a,menuStyle:r,childrenItems:s,handleItemClick:m=>{m.click&&!m.disabled&&m.click(m),m.isShowMenu||c(m.children)},handleMouseEnter:async(m,f)=>{!f.children||!Array.isArray(f.children)||f.disabled?l.value=!1:(l.value=!0,s.value=f.children,await o.nextTick(),d(m))},hideAll:c}},qx={name:"EvMenuList",props:{isShow:{type:Boolean,default:!1},items:{type:Array,default:()=>[],validator:e=>e.some(t=>t.children!==void 0&&!Array.isArray(t.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):e.some(t=>t.click!==void 0&&typeof t.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},comp:{type:Object,default:()=>{}}},emits:{"update:isShow":[Boolean]},setup(){const{isExistChild:e,computedIsShow:t,isShowChild:n,childMenu:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}=$x();return{isExistChild:e,computedIsShow:t,isShowChild:n,childMenu:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}}},e0={class:"ev-menu-list"},t0={class:"ev-menu-ul"},n0=["onClick","onMouseenter"],i0={class:"ev-menu-li-text"},s0={key:1,class:"ev-menu-li-suffix ev-icon-arrow-right2"};function o0(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",e0,[o.createElementVNode("ul",t0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.items,(a,r)=>o.withDirectives((o.openBlock(),o.createElementBlock("li",{key:`${a.value}_${r}`,class:o.normalizeClass(["ev-menu-li",{disabled:a.disabled,[a.itemClass]:a.itemClass}]),onClick:c=>i.handleItemClick(a),onMouseenter:c=>i.handleMouseEnter(c,a)},[a.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["ev-menu-li-prefix",a.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",i0,[a.slotKey?o.renderSlot(e.$slots,a.slotKey,{key:0,item:a},()=>[o.createTextVNode(o.toDisplayString(a.text),1)]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(a.text),1)],64))]),a.children||a.isShowMenu?(o.openBlock(),o.createElementBlock("i",s0)):o.createCommentVNode("",!0)],42,n0)),[[o.vShow,!a.hidden]])),128))]),i.isExistChild?o.withDirectives((o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:0,ref:"childMenu",isShow:i.computedIsShow,"onUpdate:isShow":t[0]||(t[0]=a=>i.computedIsShow=a),comp:n.comp,items:i.childrenItems,style:o.normalizeStyle(i.menuStyle)},o.createSlots({_:2},[o.renderList(e.$slots,(a,r)=>({name:r,fn:o.withCtx(c=>[o.renderSlot(e.$slots,r,o.normalizeProps(o.guardReactiveProps(c)))])}))]),1064,["isShow","comp","items","style"])),[[o.vShow,i.childrenItems.length&&i.isShowChild]]):o.createCommentVNode("",!0)])}const Qr=ce(qx,[["render",o0]]),l0={name:"EvContextMenu",directives:{clickoutside:Ji},components:{MenuList:Qr},props:{items:{type:Array,default:()=>[],validator:e=>e.some(t=>t.children!==void 0&&!Array.isArray(t.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):e.some(t=>t.click!==void 0&&typeof t.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},customClass:{type:String,default:""},isShowMenuOnClick:{type:Boolean,default:!1}},setup(){const{comp:e,initWrapperDiv:t}=jx(),{isShow:n,rootMenuList:i,menuStyle:s,show:l,hide:a}=Qx();return o.onBeforeMount(()=>t()),{isShow:n,rootMenuList:i,menuStyle:s,comp:e,show:l,hide:a}}};function a0(e,t,n,i,s,l){const a=o.resolveComponent("menu-list"),r=o.resolveDirective("clickoutside");return i.isShow&&n.items.length?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-context-menu-modal"},[o.withDirectives((o.openBlock(),o.createBlock(a,{ref:"rootMenuList",isShow:i.isShow,"onUpdate:isShow":t[0]||(t[0]=c=>i.isShow=c),class:o.normalizeClass(n.customClass),items:n.items,style:o.normalizeStyle(i.menuStyle),comp:i.comp},o.createSlots({_:2},[o.renderList(e.$slots,(c,d)=>({name:d,fn:o.withCtx(h=>[o.renderSlot(e.$slots,d,o.normalizeProps(o.guardReactiveProps(h)))])}))]),1032,["isShow","class","items","style","comp"])),[[r,i.hide]])])):o.createCommentVNode("",!0)}const ci=ce(l0,[["render",a0]]);ci.install=e=>{e.component(ci.name,ci)};const r0=()=>window.innerWidth-document.documentElement.clientWidth,c0=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.ref(),i=o.ref(),s=o.ref(!1),l=o.computed(()=>s.value?"ev-icon-compress":"ev-icon-expand");let a=document.getElementById("ev-window-modal");(()=>{if(!a){const p=document.createElement("div");p.id="ev-window-modal",document.body.appendChild(p),a=document.getElementById("ev-window-modal")}})();const c=p=>{let y,C;if(typeof p=="string"||typeof p=="number"){const b=/^(normal|(-*\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(p);y=b?{value:+b[2],unit:b[3]||void 0}:void 0}else y=void 0;return y==null?C=void 0:y.unit?C=`${y.value}${y.unit}`:C=`${y.value}px`,C},d=(p,y="horizontal")=>{if(typeof p=="number")return p;if(!p)return 0;let C=0;const b=/^(normal|(\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(p);if(y&&["%","vw","vh"].includes(b[3])&&b[2]){const k=y==="horizontal"?window.innerWidth:window.innerHeight;C=Math.floor(k*+b[2]/100)}else b[2]&&(C=+b[2]);return C},h=o.reactive({}),u=o.computed(()=>({...e.style,...h})),m=()=>{if(h.position="fixed",e.fullscreen){h.width="100%",h.height="100%",h.top=0,h.left=0;return}const p=d(e.width,"horizontal"),y=d(e.minWidth,"horizontal");p<y?(console.warn("[EVUI][Window] Since width is less than min-width, it is replaced by min-width."),h.width=c(e.minWidth)):h.width=c(e.width);const C=d(e.height,"vertical"),b=d(e.minHeight,"vertical");C<b?(console.warn("[EVUI][Window] Since height is less than min-height, it is replaced by min-height."),h.height=c(e.minHeight)):h.height=c(e.height),h.top=`calc((100% - ${h.height}) / 2)`,h.left=`calc((100% - ${h.width}) / 2)`,d(e.width,"horizontal")>window.innerWidth&&(h.left=0),d(e.height,"vertical")>window.innerHeight&&(h.top=0)},f=p=>{p==="layer"&&!e.closeOnClickModal||t("update:visible",!1)},g=p=>{var b;const y=(b=a==null?void 0:a.getElementsByClassName("scroll-lock"))==null?void 0:b.length,C=document.body;if(p){if(e.hideScroll){if(!y){const k=r0();C.style.paddingRight=`${k}px`}C.classList.add("ev-window-scroll-lock")}}else e.hideScroll&&y===1&&(C.style.removeProperty("padding-right"),C.classList.remove("ev-window-scroll-lock"))};return m(),o.watch(()=>e.visible,async p=>{g(p),p&&await o.nextTick(()=>{m()})}),{windowRef:n,headerRef:i,isFullExpandWindow:s,maximizableIcon:l,baseStyle:u,closeWin:f,numberToUnit:c,removeUnit:d}},d0=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{windowRef:i,headerRef:s,isFullExpandWindow:l,numberToUnit:a,removeUnit:r}=e,c=50,d=5,h=o.reactive({}),u=o.reactive({state:"",pressedSpot:"",top:0,left:0,width:0,height:0,clientX:0,clientY:0}),m=o.reactive({top:0,left:0}),f=o.reactive({top:!1,right:!1,left:!1,bottom:!1}),g=o.reactive({width:null,height:null,top:null,left:null}),p=(T,v)=>{if(T==null||v==null)return!1;const E=i.value.getBoundingClientRect(),Z=+T-E.left,W=+v-E.top,R=s.value.style,X={top:r(R.paddingTop,"vertical"),left:r(R.paddingLeft,"horizontal"),right:r(R.paddingRight,"horizontal")},G=X.left,N=E.width-X.right,P=X.top,B=P+s.value.offsetHeight;return Z>G&&Z<N&&W>P&&W<B},y=T=>{if(T===null||typeof T!="object")return;let v,E,Z,W,R,X;const G=i.value,N=Object.prototype.hasOwnProperty;N.call(T,"top")?v=T.top:v=u.top,N.call(T,"left")?E=T.left:E=u.left,N.call(T,"width")?Z=T.width:Z=G.offsetWidth,N.call(T,"height")?W=T.height:W=G.offsetHeight,N.call(T,"minWidth")?R=T.minWidth:R=t.minWidth,N.call(T,"minHeight")?X=T.minHeight:X=t.minHeight,Z=r(Z,"horizontal")>r(R,"horizontal")?Z:R,W=r(W,"vertical")>r(X,"vertical")?W:X,h.top=a(v),h.left=a(E),h.width=a(Z),h.height=a(W),h.minWidth=a(R),h.minHeight=a(X)},C=T=>{if(!(!i.value||u.pressedSpot))if(t.resizable){const v=i.value.getBoundingClientRect(),E=T.clientX-v.left,Z=T.clientY-v.top,W=Z<d,R=E<d,X=E>=v.width-d,G=Z>=v.height-d;W&&R||G&&X?i.value.style.cursor="nwse-resize":W&&X||G&&R?i.value.style.cursor="nesw-resize":X||R?i.value.style.cursor="ew-resize":G||W?i.value.style.cursor="ns-resize":t.draggable&&p(T.clientX,T.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"}else t.draggable&&p(T.clientX,T.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"},b=T=>{const v=window.innerWidth,E=window.innerHeight,Z=f.top,W=f.left,R=f.right,X=f.bottom,G=r(t.minWidth,"horizontal"),N=r(t.minHeight,"vertical"),P=T.clientX>=v?v:T.clientX;let B=T.clientY>=E?E:T.clientY;B=T.clientY>0?B:0;const H=P-u.clientX,D=B-u.clientY;let Y=u.top,F=u.left,O=u.width,z=u.height;const j=Y+u.height-N,U=F+u.width-G;Z&&(Y=u.top+D,z=u.height-D,Y>j&&(Y=j)),W&&(F=u.left+H,O=u.width-H,F>U&&(F=U)),R&&(O=u.width+H),X&&(z=u.height+D),O=Math.min(Math.max(O,G),v),z=Math.min(Math.max(z,N),E);const Q={top:Y,left:F,width:O,height:z};y(Q),n("resize",T,{...Q})},k=(T,v)=>{let E=v;return E<0?E=0:E>T-c&&(E=Math.floor(T-c)),E},L=(T,v)=>{let E=v;return E<-(u.width-c)?E=-Math.floor(u.width-c):E>T-c&&(E=Math.floor(T-c)),E},w=T=>{if(T.preventDefault(),u.state="mousedown-mousemove",t.draggable&&u.pressedSpot==="header"){const v=document.documentElement.clientWidth,E=document.documentElement.clientHeight,Z=T.clientY-u.clientY,W=T.clientX-u.clientX;let R=u.top+Z,X=u.left+W;R=k(E,R),X=L(v,X),y({top:`${R}px`,left:`${X}px`,width:h.width??t.width,height:h.height??t.height})}else t.resizable&&u.pressedSpot==="border"&&b(T);n("mousedown-mousemove",T)},M=T=>{u.state="",u.pressedSpot="",n("mousedown-mouseup",T),window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",M)},V=T=>{if(!i.value||!t.resizable&&!t.draggable)return;let v="";if(t.resizable){const E=i.value.getBoundingClientRect(),Z=T.clientX-E.left,W=T.clientY-E.top,R=W<d,X=Z<d,G=Z>=E.width-d,N=W>=E.height-d;f.top=R,f.left=X,f.right=G,f.bottom=N,(R||X||G||N)&&(v="border")}if(v!=="border"&&p(T.clientX,T.clientY)&&(v="header"),!v||!t.draggable&&v==="header"||!t.resizable&&v==="border"){u.state="mousedown",u.pressedSpot="",u.top=i.value.offsetTop,u.left=i.value.offsetLeft,u.width=i.value.offsetWidth,u.height=i.value.offsetHeight,u.clientX=T.clientX,u.clientY=T.clientY,n("mousedown",{...u,ref:i.value});return}u.state="mousedown",u.pressedSpot=v,u.top=i.value.offsetTop,u.left=i.value.offsetLeft,u.width=i.value.offsetWidth,u.height=i.value.offsetHeight,u.clientX=T.clientX,u.clientY=T.clientY,n("mousedown",{...u,ref:i.value}),window.addEventListener("mousemove",w),window.addEventListener("mouseup",M)},S=T=>{!t.draggable&&!t.resizable||C(T)},x=()=>{l.value=!l.value,o.nextTick(()=>{l.value?(g.top=i.value.offsetTop,g.left=i.value.offsetLeft,g.width=i.value.offsetWidth,g.height=i.value.offsetHeight,y({top:0,left:0,width:document.body.clientWidth,height:document.body.clientHeight})):y({top:g.top,left:g.left,width:g.width,height:g.height}),n("expand",{top:g.top,left:g.left,width:g.width,height:g.height})})},I=()=>{l.value=!1,u.state="",u.pressedSpot="",u.top=0,u.left=0,u.width=0,u.height=0,u.clientX=0,u.clientY=0,m.top=0,m.left=0,f.top=!1,f.left=!1,f.right=!1,f.bottom=!1,g.top=null,g.left=null,g.width=null,g.height=null,Object.keys(h).forEach(T=>{delete h[T]})};return o.watch(()=>t.visible,T=>{T||I()}),{dragStyle:h,startDrag:V,moveMouse:S,clickExpandBtn:x}},Vt=(()=>{let e=[],t=0;return{add(n){if(n!=null)return n.sequence=t++,e.push(n),n.sequence},remove(n){n!=null&&(e=e.filter(i=>i.sequence!==n.sequence))},get windows(){return e.slice()},getWindowBySequence(n){return e.find(i=>i.sequence===n)},isEmpty(){return e.length<=0},isFirstWindowOpen(){return t===1}}})(),Et=(()=>{let l=700;return{getNext(){return l>=748?748:(l+=1,l)},getNextOverLimit(){return 749},getPrevFrom(a){const r=l-a*1;return r<=700?700:r},isUpperLimitClose(){return l>=748},resetToLower(){l=700},getAllocableCount(){return Math.floor(48/1)}}})(),h0=e=>{const t=window.getComputedStyle(e).getPropertyValue("z-index").trim();return!t||isNaN(t)?700:parseInt(t)},$o=()=>{const e=(n,i)=>n.zIndex>i.zIndex?1:n.zIndex<i.zIndex?-1:n.sequence>i.sequence?1:-1;return Array.prototype.map.call(Vt.windows,n=>({...n,zIndex:h0(n.elem)})).sort(e)},u0=({closeWin:e,windowRef:t})=>{const{props:n}=o.getCurrentInstance();let i=null,s=null;const l=()=>Vt.add({sequence:i,closeWin:e,elem:t.value,escClose:n.escClose}),a=y=>{Vt.remove(y)},r=y=>{if(Vt.isEmpty())return;const{code:C}=y;if(C!=="Escape")return;const b=$o(),k=b[b.length-1];k.escClose&&k.closeWin()},c=()=>{i=l(),t.value.dataset.sequence=i,Vt.isFirstWindowOpen()&&document.addEventListener("keydown",r)},d=()=>{const y=Vt.getWindowBySequence(i);a(y)},h=({elem:y,zIndex:C})=>{if(n.isModal){const b=y.parentElement.getElementsByClassName("ev-window-dim-layer")[0];b.style.zIndex=C}y.style.zIndex=C},u=()=>{Vt.windows.length===1&&Et.resetToLower();const y=Et.getNext();h({elem:t.value,zIndex:y})},m=y=>String(y.sequence)===t.value.dataset.sequence,f=()=>{const y=$o();if(Vt.windows.length>Et.getAllocableCount()){const b=y.reverse();let k=0;b.forEach(w=>{if(m(w))return;const M=Et.getPrevFrom(k++);h({elem:w.elem,zIndex:M})});const L=Et.getNextOverLimit();h({elem:t.value,zIndex:L})}else{Et.resetToLower(),y.forEach(k=>{if(m(k))return;const L=Et.getNext();h({elem:k.elem,zIndex:L})});const b=Et.getNext();h({elem:t.value,zIndex:b})}},g=()=>{Et.isUpperLimitClose()?f():u()},p=()=>{if(!t.value||!n.focusable)return;const y=$o(),C=y[y.length-1];m(C)||g()};return o.onMounted(()=>{n.visible&&(c(),s=setTimeout(g,0))}),o.onBeforeUnmount(()=>{n.visible&&(d(),clearTimeout(s))}),o.watch(()=>n.visible,y=>{o.nextTick(()=>{y?(c(),s=setTimeout(g,0)):(d(),clearTimeout(s))})}),o.watch(()=>n.escClose,y=>{if(!n.visible)return;const C=Vt.getWindowBySequence(i);C&&(C.escClose=y)}),{setFocus:p}},f0={name:"EvWindow",props:{style:{type:Object,default(){return{}}},visible:{type:Boolean,default:!1},title:{type:[String,Number],default:null},windowClass:{type:String,default:""},iconClass:{type:String,default:""},width:{type:[String,Number],default:"50vw"},height:{type:[String,Number],default:"50vh"},minWidth:{type:[String,Number],default:150},minHeight:{type:[String,Number],default:150},fullscreen:{type:Boolean,default:!1},isModal:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!1},hideScroll:{type:Boolean,default:!0},draggable:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},maximizable:{type:Boolean,default:!1},escClose:{type:Boolean,default:!1},focusable:{type:Boolean,default:!1}},emits:["update:visible","mousedown","mousedown-mouseup","mousedown-mousemove","resize","expand"],setup(){const{windowRef:e,headerRef:t,isFullExpandWindow:n,maximizableIcon:i,baseStyle:s,closeWin:l,numberToUnit:a,removeUnit:r}=c0(),{dragStyle:c,startDrag:d,moveMouse:h,clickExpandBtn:u}=d0({windowRef:e,headerRef:t,isFullExpandWindow:n,numberToUnit:a,removeUnit:r}),{setFocus:m}=u0({closeWin:l,windowRef:e});return{windowRef:e,headerRef:t,baseStyle:s,dragStyle:c,maximizableIcon:i,closeWin:l,startDrag:d,moveMouse:h,clickExpandBtn:u,setFocus:m}}},m0={key:0,ref:"headerRef",class:"ev-window-header"},p0={key:0,class:"ev-window-icon"},g0={key:1,class:"ev-window-title"},b0={class:"ev-window-content"},y0={key:1,class:"ev-window-footer"},x0={class:"ev-window-top-right-icon"};function S0(e,t,n,i,s,l){return o.openBlock(),o.createBlock(o.Teleport,{to:"#ev-window-modal"},[o.createVNode(o.Transition,{name:"ev-window-fade",appear:""},{default:o.withCtx(()=>[n.visible?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-window-wrapper",{"scroll-lock":n.hideScroll},{"scroll-allow":!n.hideScroll&&!n.isModal}])},[n.isModal?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ev-window-dim-layer",onClick:t[0]||(t[0]=a=>i.closeWin("layer")),onWheel:o.withModifiers(()=>{},["stop","prevent"])},null,32)):o.createCommentVNode("",!0),o.createElementVNode("div",{ref:"windowRef",class:o.normalizeClass(["ev-window",n.windowClass,{fullscreen:!!n.fullscreen}]),style:o.normalizeStyle({...i.baseStyle,...i.dragStyle}),onMousedown:t[3]||(t[3]=(...a)=>i.startDrag&&i.startDrag(...a)),onMousemove:t[4]||(t[4]=(...a)=>i.moveMouse&&i.moveMouse(...a)),onClick:t[5]||(t[5]=(...a)=>i.setFocus&&i.setFocus(...a))},[e.$slots.header||n.iconClass||n.title?(o.openBlock(),o.createElementBlock("div",m0,[e.$slots.header?o.renderSlot(e.$slots,"header",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.iconClass?(o.openBlock(),o.createElementBlock("span",p0,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.title?(o.openBlock(),o.createElementBlock("p",g0,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0)],64))],512)):o.createCommentVNode("",!0),o.createElementVNode("div",b0,[o.renderSlot(e.$slots,"default")]),e.$slots.footer?(o.openBlock(),o.createElementBlock("div",y0,[o.renderSlot(e.$slots,"footer")])):o.createCommentVNode("",!0),o.createElementVNode("div",x0,[n.maximizable&&!n.fullscreen?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-window-maximizable",onClick:t[1]||(t[1]=(...a)=>i.clickExpandBtn&&i.clickExpandBtn(...a))},[o.createElementVNode("i",{class:o.normalizeClass(i.maximizableIcon)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"ev-window-close",onClick:t[2]||(t[2]=(...a)=>i.closeWin&&i.closeWin(...a))},[...t[6]||(t[6]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])])],38)],2)):o.createCommentVNode("",!0)]),_:3})])}const di=ce(f0,[["render",S0]]);di.install=e=>{e.component(di.name,di)};const C0={name:"EvLoading",props:{modelValue:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},clickOutside:{type:Boolean,default:!1},iconClass:{type:String,default:null},iconStyle:{type:Object,default:()=>{}}},emits:{"update:modelValue":[Boolean]},setup(e,{emit:t}){return{clickEventName:o.computed(()=>e.clickOutside?"click":null),closeLoading:()=>t("update:modelValue",!1)}}},k0={class:"ev-loading-spinner"},w0={class:"ev-loading-spinner"};function I0(e,t,n,i,s,l){return n.fullscreen?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"body"},[n.modelValue?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"ev-loading full-screen"},{[o.toHandlerKey(`${i.clickEventName}`)]:t[0]||(t[0]=(...a)=>i.closeLoading&&i.closeLoading(...a))}),[o.createElementVNode("div",k0,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:o.normalizeStyle(n.iconStyle)},null,6))])],16)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.modelValue?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"ev-loading"},{[o.toHandlerKey(`${i.clickEventName}`)]:t[1]||(t[1]=(...a)=>i.closeLoading&&i.closeLoading(...a))}),[o.createElementVNode("div",w0,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:o.normalizeStyle(n.iconStyle)},null,6))])],16)):o.createCommentVNode("",!0)],64))}const hi=ce(C0,[["render",I0]]);hi.install=e=>{e.component(hi.name,hi)};const T0={name:"EvProgress",props:{modelValue:{type:Number,default:0,validator:e=>e>=0&&e<=100},color:{type:[String,Array],default:"#409EFF"},strokeWidth:{type:Number,default:6},innerText:{type:String,default:""}},emits:{},setup(e){const t=o.computed(()=>({height:`${e.strokeWidth}px`})),n=o.computed(()=>{if(Array.isArray(e.color)){const i=[...e.color].sort((l,a)=>l.value-a.value);let s=i[0].color;if(!e.modelValue)return{width:`${e.modelValue}%`,"background-color":s};for(let l=0;l<i.length;l++){const a=l===0?0:i[l-1].value,r=i[l].value;if(e.modelValue>a&&e.modelValue<=r){s=i[l].color;break}}return{width:`${e.modelValue}%`,"background-color":s}}return{width:`${e.modelValue}%`,"background-color":e.color}});return{wrapperStyle:t,innerStyle:n}}},L0={class:"ev-progress"},M0={key:0,class:"ev-progress-inner-text"},v0={key:0,class:"ev-progress-label"};function R0(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",L0,[o.createElementVNode("div",{class:"ev-progress-wrapper",style:o.normalizeStyle(i.wrapperStyle)},[o.createElementVNode("div",{class:"ev-progress-inner",style:o.normalizeStyle(i.innerStyle)},[n.innerText?(o.openBlock(),o.createElementBlock("div",M0,o.toDisplayString(n.innerText),1)):o.createCommentVNode("",!0)],4)],4),e.$slots.default?(o.openBlock(),o.createElementBlock("div",v0,[o.renderSlot(e.$slots,"default")])):o.createCommentVNode("",!0)])}const ui=ce(T0,[["render",R0]]);ui.install=e=>{e.component(ui.name,ui)};const V0={name:"MenuItem",props:{selectedItem:{type:[String,Number],default:""},item:{type:Object,default:()=>{},validator:e=>{if(e.value){if(e.children!==void 0&&!Array.isArray(e.children))return console.warn("[EVUI][Menu] children attribute must be 'Array' type."),!1;if(e.expand!==void 0&&typeof e.expand!="boolean")return console.warn("[EVUI][Menu] expand attribute must be 'Boolean' type."),!1;if(e.hidden!==void 0&&typeof e.hidden!="boolean")return console.warn("[EVUI][Menu] hidden attribute must be 'Boolean' type."),!1;if(e.disabled!==void 0&&typeof e.disabled!="boolean")return console.warn("[EVUI][Menu] disabled attribute must be 'Boolean' type."),!1;if(e.slotKey!==void 0&&typeof e.slotKey!="string")return console.warn("[EVUI][Menu] slotKey attribute must be 'String' type."),!1}else return console.warn("[EVUI][Menu] value attribute is required."),!1;return!0}},depth:{type:Number,default:1},expandable:{type:Boolean,default:!0},comp:{type:Object,default:()=>{}},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=e.expandable&&e.item.expand!==void 0&&typeof e.item.expand=="boolean"?e.item.expand:!0,i=o.ref(n),s=o.computed(()=>!!e.item.children&&!!e.item.children.length);return{isExpand:i,hasChild:s,clickMenu:a=>{s.value&&a.depth===e.depth?e.expandable&&(i.value=!i.value):t("click",a)}}}},E0={class:"text"};function W0(e,t,n,i,s,l){return n.item.hidden?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(["ev-menu-item",`depth${n.depth}`,{active:!n.item.disabled&&n.item.value===n.selectedItem}])},[o.createElementVNode("div",{class:o.normalizeClass(["ev-menu-title",{expandable:i.hasChild&&n.expandable,disabled:n.item.disabled}]),onClick:t[0]||(t[0]=a=>i.clickMenu({item:n.item,depth:n.depth,disabled:n.item.disabled}))},[n.item.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["front-icon",n.item.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",E0,[n.item.slotKey?o.renderSlot(e.$slots,n.item.slotKey,{key:0,item:n.item,depth:n.depth,selectedItem:n.selectedItem},()=>[o.createTextVNode(o.toDisplayString(n.item.text||n.item.value),1)]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.item.text||n.item.value),1)],64))]),n.expandable&&i.hasChild?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["list-expend-icon",{expend:n.expandable&&i.isExpand}])},[...t[1]||(t[1]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-up"},null,-1)])],2)):o.createCommentVNode("",!0)],2),i.hasChild?o.withDirectives((o.openBlock(),o.createElementBlock("ol",{key:0,class:o.normalizeClass(["ev-menu-sub",`depth${n.depth}`])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.item.children,(a,r)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:`${a.value}_${r}_${n.depth+1}`,depth:n.depth+1,item:a,"selected-item":n.selectedItem,expandable:n.expandable,disabled:n.disabled,comp:n.comp,onClick:i.clickMenu},null,8,["depth","item","selected-item","expandable","disabled","comp","onClick"]))),128))],2)),[[o.vShow,i.isExpand]]):o.createCommentVNode("",!0)],2))}const $r=ce(V0,[["render",W0]]),G0={name:"EvMenu",components:{MenuItem:$r},props:{modelValue:{type:[String,Number],default:""},items:{type:Array,default:()=>[]},expandable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=o.ref(e.items.filter(l=>e.modelValue===l.value));return{clickMenu:l=>{if(!l.disabled){const a=l.item;t("update:modelValue",a.value),t("change",a,n.value),n.value=a}},component:$r}}},Z0={class:"ev-menu"};function X0(e,t,n,i,s,l){const a=o.resolveComponent("menu-item");return o.openBlock(),o.createElementBlock("ul",Z0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.items,(r,c)=>(o.openBlock(),o.createBlock(a,{key:`${r.text}_${c}_0`,item:r,"selected-item":n.modelValue,expandable:n.expandable,disabled:n.disabled,comp:i.component,onClick:i.clickMenu},o.createSlots({_:2},[o.renderList(e.$slots,(d,h)=>({name:h,fn:o.withCtx(u=>[o.renderSlot(e.$slots,h,o.mergeProps({ref_for:!0},u))])}))]),1032,["item","selected-item","expandable","disabled","comp","onClick"]))),128))])}const fi=ce(G0,[["render",X0]]);fi.install=e=>{e.component(fi.name,fi)};const N0={name:"TreeNode",props:{data:{type:Object,require:!0,default:()=>({})},useCheckbox:{type:Boolean,default:!1},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},comp:{type:Object,default:()=>{}}},emits:{"update-checked-info":null,"click-node":null,"dblclick-node":null,"show-context-menu":null},setup(e,{emit:t}){const n=o.reactive(e.data),i=o.computed(()=>e.data.children&&e.data.children.length),s=o.computed(()=>{const p=e.expandIcon?e.expandIcon:"ev-icon-s-play",y=e.expandIcon?e.collapseIcon:"ev-icon-s-play";return e.data.expand?y:p}),l=o.computed(()=>e.data.children);function a(p,y){t("update-checked-info",{nodeKey:y,isChecked:p})}function r({nodeKey:p,isChecked:y}){t("update-checked-info",{nodeKey:p,isChecked:y})}function c(){n.expand=!n.expand}function d(){n.disabled||(n.selected=!n.selected,t("click-node",n.nodeKey))}function h(p){t("click-node",p)}function u(){n.disabled||t("dblclick-node",n.nodeKey)}function m(p){t("dblclick-node",p)}function f(p){t("show-context-menu",!0,p)}return{expandIconClasses:s,showExpandIcon:i,treeData:n,childrenInfo:l,handleCheck:a,emitCheckedInfo:r,handleExpand:c,clickTreeContent:d,emitClickedContent:h,dblClickTreeContent:u,emitDblClickedContent:m,handleContextmenu:f,emitContextMenuFlag:(p,y)=>{t("show-context-menu",p,y)}}}},P0={class:"ev-tree-children"},D0={class:"ev-tree-node"};function B0(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-checkbox");return o.withDirectives((o.openBlock(),o.createElementBlock("ul",P0,[o.createElementVNode("li",null,[o.createElementVNode("span",{class:o.normalizeClass([{expand:i.treeData.expand},"ev-tree-toggle"])},[i.showExpandIcon?(o.openBlock(),o.createBlock(a,{key:0,icon:i.expandIconClasses,onClick:i.handleExpand},null,8,["icon","onClick"])):o.createCommentVNode("",!0)],2),o.createElementVNode("div",D0,[n.useCheckbox?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.treeData.checked,"onUpdate:modelValue":t[0]||(t[0]=c=>i.treeData.checked=c),indeterminate:i.treeData.indeterminate,disabled:i.treeData.disabled,onChange:t[1]||(t[1]=c=>i.handleCheck(i.treeData.checked,i.treeData.nodeKey))},null,8,["modelValue","indeterminate","disabled"])):o.createCommentVNode("",!0),i.treeData.iconClass?(o.openBlock(),o.createBlock(a,{key:1,icon:i.treeData.iconClass,class:"ev-tree-icon"},null,8,["icon"])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:o.normalizeClass([{"ev-tree-title-selected":i.treeData.selected,"ev-tree-title-disabled":i.treeData.disabled},"ev-tree-title"]),onContextmenu:t[2]||(t[2]=(...c)=>i.handleContextmenu&&i.handleContextmenu(...c)),onClick:t[3]||(t[3]=(...c)=>i.clickTreeContent&&i.clickTreeContent(...c)),onDblclick:t[4]||(t[4]=(...c)=>i.dblClickTreeContent&&i.dblClickTreeContent(...c))},o.toDisplayString(i.treeData.title),35)]),o.createVNode(o.TransitionGroup,{name:"fade"},{default:o.withCtx(()=>[i.treeData.expand?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.childrenInfo,(c,d)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:`${c.value}-${d}`,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:n.comp,onUpdateCheckedInfo:i.emitCheckedInfo,onClickNode:i.emitClickedContent,onDblclickNode:i.emitDblClickedContent,onShowContextMenu:i.emitContextMenuFlag},null,40,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu"]))),128)):o.createCommentVNode("",!0)]),_:1})])],512)),[[o.vShow,i.treeData.visible]])}const qr=ce(N0,[["render",B0]]),O0={name:"EvTree",components:{TreeNode:qr},props:{data:{type:Array,default:()=>[]},useCheckbox:{type:Boolean,default:!1},emptyText:{type:String,default:"No Data"},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},contextMenuItems:{type:Array,default:()=>[]},searchWord:{type:String,default:""},searchIncludeChildren:{type:Boolean,default:!1}},emits:{"click-node":null,"dblclick-node":null,check:Array},setup(e,{emit:t}){const n=o.ref(e.data);let i=[];const s=o.ref(null);let l=!1;const a=qr;function r(S){const x=i[S].parent;if(typeof x>"u")return;const I=i[S].node,T=i[x].node;if(!(I.checked===T.checked&&I.indeterminate===T.indeterminate)){if(I.checked)T.checked=T.children.every(v=>v.checked),T.indeterminate=!T.checked;else{const v=E=>E.checked||I.indeterminate;T.checked=!1,T.indeterminate=T.children.some(v)}r(x)}}function c(S,x={}){const I=Object.keys(x);for(let T=0;T<I.length;T++)S[I[T]]=x[I[T]];S.children&&S.children.forEach(T=>{c(T,x)})}function d(){let S=0;const x=[],I=[];function T(v,E){const Z=v;Z.nodeKey=S++,Object.hasOwnProperty.call(Z,"selected")||(Z.selected=!1),Object.hasOwnProperty.call(Z,"visible")||(Z.visible=!0),"value"in Z&&I.includes(Z.value)?(console.warn("[EVUI][Tree] The 'value' of data should be unique."),Z.value+=Z.nodeKey):"value"in Z||(Z.value=Z.title+Z.nodeKey),I.push(Z.value),x[Z.nodeKey]={node:Z,nodeKey:Z.nodeKey},typeof E<"u"&&(x[Z.nodeKey].parent=E.nodeKey,x[E.nodeKey].children.push(Z.nodeKey)),Z.children&&(x[Z.nodeKey].children=[],Z.children.forEach(W=>T(W,Z)))}return n.value.length&&T(n.value[0]),x}i=d();function h(){return i.filter(S=>S.node.checked).map(S=>S.node)}function u(){h().forEach(x=>{c(x,{checked:!0});const I=i[x.nodeKey].parent;if(!I&&I!==0)return;const T=i[I].node;typeof x.checked<"u"&&x.checked&&T.checked!==x.checked&&r(x.nodeKey)})}function m({nodeKey:S,isChecked:x}){const I=i[S].node;I.checked=x,I.indeterminate=!1,r(S),c(I,{checked:x,indeterminate:!1});const T=h();t("check",T),u()}function f(S){const x=i[S].node;for(let I=0;I<i.length;I++)i[I].node.nodeKey!==S&&(i[I].node.selected=!1);t("click-node",{title:x.title,value:x.value})}function g(S){const x=i[S].node;t("dblclick-node",{title:x.title,value:x.value})}const p=S=>{e.contextMenuItems.length&&l&&(s.value.show(S),l=!1)},y=(S,x)=>{l=S,p(x)},C=(S,x)=>S.toLowerCase().includes(x.toLowerCase()),b=S=>{var x;if(S.children){const I=!!((x=S.children.filter(T=>C(T.title,e.searchWord)))!=null&&x.length);S.children.forEach(T=>{b(T),T.visible=I&&C(T.title,e.searchWord)||!I})}};function k(S){S.children&&S.children.forEach(x=>{x.visible=!1,k(x)})}function L(S){if(!S&&S!==0)return;const x=i[S];x.node.visible=!0,x.parent!==void 0&&L(x.parent)}function w(S){i.forEach(I=>{const T=I.node;T.visible=!1}),i.filter(I=>C(I.node.title,S)).forEach(I=>{const T=I.node;T.visible=!0,e.searchIncludeChildren?b(T):k(T);const v=i[T.nodeKey].parent;L(v)})}const M=o.computed(()=>!n.value.length||n.value.every(S=>!S.visible));o.watch(()=>e.data,S=>{n.value=S,i=d()},{deep:!0});let V;return o.watch(()=>e.searchWord,S=>{V&&clearTimeout(V),V=setTimeout(()=>{S?w(S):i.forEach(x=>{const I=x.node;I.visible=!0})},200)}),o.onMounted(()=>{u();const S=h();S.length&&t("check",S)}),o.onBeforeUnmount(()=>{V&&clearTimeout(V)}),{treeNodeData:n,contextMenu:s,component:a,isShowEmptyText:M,updateCheckedInfo:m,clickContent:f,dblClickContent:g,showContextMenu:p,getContextMenuFlag:y}}},Y0={class:"ev-tree-view"},F0={key:0};function H0(e,t,n,i,s,l){const a=o.resolveComponent("tree-node"),r=o.resolveComponent("ev-context-menu");return o.openBlock(),o.createElementBlock("div",Y0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.treeNodeData,(c,d)=>(o.openBlock(),o.createBlock(a,{key:d,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:i.component,onUpdateCheckedInfo:i.updateCheckedInfo,onClickNode:i.clickContent,onDblclickNode:i.dblClickContent,onShowContextMenu:i.getContextMenuFlag,onContextmenu:o.withModifiers(i.showContextMenu,["prevent"])},null,8,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu","onContextmenu"]))),128)),i.isShowEmptyText?(o.openBlock(),o.createElementBlock("div",F0,o.toDisplayString(n.emptyText),1)):o.createCommentVNode("",!0),n.contextMenuItems.length?(o.openBlock(),o.createBlock(r,{key:1,ref:"contextMenu",items:n.contextMenuItems},null,8,["items"])):o.createCommentVNode("",!0)])}const mi=ce(O0,[["render",H0]]);mi.install=e=>{e.component(mi.name,mi)};const z0={name:"EvTimePicker",props:{modelValue:{type:[Array,String],default:"",validator:e=>{const t=/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;return Array.isArray(e)&&(!t.test(e[0])||!t.test(e[1]))||!Array.isArray(e)&&!t.test(e)?(console.warn("[EVUI][TimePicker] Please check the time format in the Timepicker."),!1):!0}},type:{type:String,default:"range"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},placeholder:{type:[String,Array],required:!1,default:void 0}},emits:{"update:modelValue":null,focus:null,blur:null,change:null},setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:w=>{if(e.type==="range"){if(Array.isArray(w)){const M=w[0]>w[1]?"00:00":w[0],V=M.value>w[1]?"23:59":w[1];t("update:modelValue",[M,V])}}else t("update:modelValue",w)}}),i=o.computed(()=>{const w=["start time","end time"];return Array.isArray(e.placeholder)?[typeof e.placeholder[0]=="string"?e.placeholder[0]:w[0],typeof e.placeholder[1]=="string"?e.placeholder[1]:w[1]]:typeof e.placeholder=="string"?[e.placeholder,e.placeholder]:w}),s=o.ref(Array.isArray(n.value)?[`${n.value[0]}`,`${n.value[1]}`]:`${n.value}`),l=o.reactive({single:!1,rangeStart:!1,rangeEnd:!1}),a=w=>/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(w),r=()=>{Array.isArray(n.value)&&(a(n.value[0])||(n.value[0]=s.value[0]),n.value[1]&&n.value[0]>n.value[1]&&(n.value[0]=n.value[1]),s.value[0]=n.value[0])},c=()=>{Array.isArray(n.value)&&(a(n.value[1])||(n.value[1]=s.value[1]),n.value[0]&&n.value[0]>n.value[1]&&(n.value[1]=s.value[1],n.value[0]>s.value[1]&&(n.value[1]=n.value[0])),s.value[1]=n.value[1])};return{time:n,isWrongType:l,previousValue:s,clearContents:()=>{n.value="",l.single=!0},clearStartTime:()=>{n.value[0]="",l.rangeStart=!0},clearEndTime:()=>{n.value[1]="",l.rangeEnd=!0},focusInputTime:w=>{t("focus",w)},blurInputTime:w=>{t("blur",w)},changeTime:w=>{a(n.value)?s.value=n.value:n.value=s.value,l.single=!a(n.value),t("change",w,n.value)},focusInputStartTime:w=>{t("focus",w)},blurInputStartTime:w=>{t("blur",w)},changeStartTime:w=>{r(),l.rangeStart=!1,t("change",w,n.value)},focusInputEndTime:w=>{t("focus",w)},blurInputEndTime:w=>{t("blur",w)},changeEndTime:w=>{c(),l.rangeEnd=!1,t("change",w,n.value)},placeholders:i}}},A0={class:"ev-time-picker"},_0={key:0,class:"ev-time-picker-range"},K0=["disabled","readonly","placeholder"],U0=["disabled","readonly","placeholder"],J0={key:1,class:"ev-time-picker-single"},j0=["disabled","readonly","placeholder"];function Q0(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",A0,[n.type==="range"?(o.openBlock(),o.createElementBlock("div",_0,[o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.rangeStart,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=r=>i.time[0]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:i.placeholders[0],onFocus:t[1]||(t[1]=(...r)=>i.focusInputStartTime&&i.focusInputStartTime(...r)),onBlur:t[2]||(t[2]=(...r)=>i.blurInputStartTime&&i.blurInputStartTime(...r)),onChange:t[3]||(t[3]=(...r)=>i.changeStartTime&&i.changeStartTime(...r))},null,40,K0),[[o.vModelText,i.time[0]]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearStartTime},null,8,["onClick"])):o.createCommentVNode("",!0)],2),t[12]||(t[12]=o.createElementVNode("p",{class:"tilde"},"~",-1)),o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.rangeEnd,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>i.time[1]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:i.placeholders[1],onFocus:t[5]||(t[5]=(...r)=>i.focusInputEndTime&&i.focusInputEndTime(...r)),onBlur:t[6]||(t[6]=(...r)=>i.blurInputEndTime&&i.blurInputEndTime(...r)),onChange:t[7]||(t[7]=(...r)=>i.changeEndTime&&i.changeEndTime(...r))},null,40,U0),[[o.vModelText,i.time[1]]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearEndTime},null,8,["onClick"])):o.createCommentVNode("",!0)],2)])):(o.openBlock(),o.createElementBlock("div",J0,[o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.single,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[8]||(t[8]=r=>i.time=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:typeof n.placeholder=="string"?n.placeholder:"Enter time",onFocus:t[9]||(t[9]=(...r)=>i.focusInputTime&&i.focusInputTime(...r)),onBlur:t[10]||(t[10]=(...r)=>i.blurInputTime&&i.blurInputTime(...r)),onChange:t[11]||(t[11]=(...r)=>i.changeTime&&i.changeTime(...r))},null,40,j0),[[o.vModelText,i.time]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearContents},null,8,["onClick"])):o.createCommentVNode("",!0)],2)]))])}const pi=ce(z0,[["render",Q0]]);pi.install=e=>{e.component(pi.name,pi)};const $0={name:"EvGridToolbar"},q0={class:"gridToolbar"};function eS(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",q0,[o.renderSlot(e.$slots,"toolbarWrapper")])}const tS=ce($0,[["render",eS]]),nS={name:"EvGridPagination",props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:e=>["left","right","center"].includes(e)}},emits:{"update:modelValue":null},setup(e,{emit:t}){const n=o.ref(e.modelValue),i=s=>{n.value=s>0?s:1,t("update:modelValue",n.value)};return o.watch(()=>e.modelValue,s=>{n.value=s}),{currentValue:n,changePage:i}}},iS={class:"grid-pagination"};function sS(e,t,n,i,s,l){const a=o.resolveComponent("ev-pagination");return o.openBlock(),o.createElementBlock("div",iS,[o.createVNode(a,{modelValue:i.currentValue,"onUpdate:modelValue":t[0]||(t[0]=r=>i.currentValue=r),total:n.total,"per-page":n.perPage,"visible-page":n.visiblePage,"show-page-info":n.showPageInfo,order:n.order,onChange:i.changePage},null,8,["modelValue","total","per-page","visible-page","show-page-info","order","onChange"])])}const ec=ce(nS,[["render",sS],["__scopeId","data-v-2e265290"]]);var oS=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,qo=Math.ceil,ot=Math.floor,Qe="[BigNumber Error] ",tc=Qe+"Number primitive has more than 15 significant digits: ",bt=1e14,de=14,el=9007199254740991,tl=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],At=1e7,De=1e9;function nc(e){var t,n,i,s=b.prototype={constructor:b,toString:null,valueOf:null},l=new b(1),a=20,r=4,c=-7,d=21,h=-1e7,u=1e7,m=!1,f=1,g=0,p={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},y="0123456789abcdefghijklmnopqrstuvwxyz",C=!0;function b(S,x){var I,T,v,E,Z,W,R,X,G=this;if(!(G instanceof b))return new b(S,x);if(x==null){if(S&&S._isBigNumber===!0){G.s=S.s,!S.c||S.e>u?G.c=G.e=null:S.e<h?G.c=[G.e=0]:(G.e=S.e,G.c=S.c.slice());return}if((W=typeof S=="number")&&S*0==0){if(G.s=1/S<0?(S=-S,-1):1,S===~~S){for(E=0,Z=S;Z>=10;Z/=10,E++);E>u?G.c=G.e=null:(G.e=E,G.c=[S]);return}X=String(S)}else{if(!oS.test(X=String(S)))return i(G,X,W);G.s=X.charCodeAt(0)==45?(X=X.slice(1),-1):1}(E=X.indexOf("."))>-1&&(X=X.replace(".","")),(Z=X.search(/e/i))>0?(E<0&&(E=Z),E+=+X.slice(Z+1),X=X.substring(0,Z)):E<0&&(E=X.length)}else{if(Ie(x,2,y.length,"Base"),x==10&&C)return G=new b(S),M(G,a+G.e+1,r);if(X=String(S),W=typeof S=="number"){if(S*0!=0)return i(G,X,W,x);if(G.s=1/S<0?(X=X.slice(1),-1):1,b.DEBUG&&X.replace(/^0\.0*|\./,"").length>15)throw Error(tc+S)}else G.s=X.charCodeAt(0)===45?(X=X.slice(1),-1):1;for(I=y.slice(0,x),E=Z=0,R=X.length;Z<R;Z++)if(I.indexOf(T=X.charAt(Z))<0){if(T=="."){if(Z>E){E=R;continue}}else if(!v&&(X==X.toUpperCase()&&(X=X.toLowerCase())||X==X.toLowerCase()&&(X=X.toUpperCase()))){v=!0,Z=-1,E=0;continue}return i(G,String(S),W,x)}W=!1,X=n(X,x,10,G.s),(E=X.indexOf("."))>-1?X=X.replace(".",""):E=X.length}for(Z=0;X.charCodeAt(Z)===48;Z++);for(R=X.length;X.charCodeAt(--R)===48;);if(X=X.slice(Z,++R)){if(R-=Z,W&&b.DEBUG&&R>15&&(S>el||S!==ot(S)))throw Error(tc+G.s*S);if((E=E-Z-1)>u)G.c=G.e=null;else if(E<h)G.c=[G.e=0];else{if(G.e=E,G.c=[],Z=(E+1)%de,E<0&&(Z+=de),Z<R){for(Z&&G.c.push(+X.slice(0,Z)),R-=de;Z<R;)G.c.push(+X.slice(Z,Z+=de));Z=de-(X=X.slice(Z)).length}else Z-=R;for(;Z--;X+="0");G.c.push(+X)}}else G.c=[G.e=0]}b.clone=nc,b.ROUND_UP=0,b.ROUND_DOWN=1,b.ROUND_CEIL=2,b.ROUND_FLOOR=3,b.ROUND_HALF_UP=4,b.ROUND_HALF_DOWN=5,b.ROUND_HALF_EVEN=6,b.ROUND_HALF_CEIL=7,b.ROUND_HALF_FLOOR=8,b.EUCLID=9,b.config=b.set=function(S){var x,I;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(x="DECIMAL_PLACES")&&(I=S[x],Ie(I,0,De,x),a=I),S.hasOwnProperty(x="ROUNDING_MODE")&&(I=S[x],Ie(I,0,8,x),r=I),S.hasOwnProperty(x="EXPONENTIAL_AT")&&(I=S[x],I&&I.pop?(Ie(I[0],-De,0,x),Ie(I[1],0,De,x),c=I[0],d=I[1]):(Ie(I,-De,De,x),c=-(d=I<0?-I:I))),S.hasOwnProperty(x="RANGE"))if(I=S[x],I&&I.pop)Ie(I[0],-De,-1,x),Ie(I[1],1,De,x),h=I[0],u=I[1];else if(Ie(I,-De,De,x),I)h=-(u=I<0?-I:I);else throw Error(Qe+x+" cannot be zero: "+I);if(S.hasOwnProperty(x="CRYPTO"))if(I=S[x],I===!!I)if(I)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))m=I;else throw m=!I,Error(Qe+"crypto unavailable");else m=I;else throw Error(Qe+x+" not true or false: "+I);if(S.hasOwnProperty(x="MODULO_MODE")&&(I=S[x],Ie(I,0,9,x),f=I),S.hasOwnProperty(x="POW_PRECISION")&&(I=S[x],Ie(I,0,De,x),g=I),S.hasOwnProperty(x="FORMAT"))if(I=S[x],typeof I=="object")p=I;else throw Error(Qe+x+" not an object: "+I);if(S.hasOwnProperty(x="ALPHABET"))if(I=S[x],typeof I=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(I))C=I.slice(0,10)=="0123456789",y=I;else throw Error(Qe+x+" invalid: "+I)}else throw Error(Qe+"Object expected: "+S);return{DECIMAL_PLACES:a,ROUNDING_MODE:r,EXPONENTIAL_AT:[c,d],RANGE:[h,u],CRYPTO:m,MODULO_MODE:f,POW_PRECISION:g,FORMAT:p,ALPHABET:y}},b.isBigNumber=function(S){if(!S||S._isBigNumber!==!0)return!1;if(!b.DEBUG)return!0;var x,I,T=S.c,v=S.e,E=S.s;e:if({}.toString.call(T)=="[object Array]"){if((E===1||E===-1)&&v>=-De&&v<=De&&v===ot(v)){if(T[0]===0){if(v===0&&T.length===1)return!0;break e}if(x=(v+1)%de,x<1&&(x+=de),String(T[0]).length==x){for(x=0;x<T.length;x++)if(I=T[x],I<0||I>=bt||I!==ot(I))break e;if(I!==0)return!0}}}else if(T===null&&v===null&&(E===null||E===1||E===-1))return!0;throw Error(Qe+"Invalid BigNumber: "+S)},b.maximum=b.max=function(){return L(arguments,-1)},b.minimum=b.min=function(){return L(arguments,1)},b.random=function(){var S=9007199254740992,x=Math.random()*S&2097151?function(){return ot(Math.random()*S)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(I){var T,v,E,Z,W,R=0,X=[],G=new b(l);if(I==null?I=a:Ie(I,0,De),Z=qo(I/de),m)if(crypto.getRandomValues){for(T=crypto.getRandomValues(new Uint32Array(Z*=2));R<Z;)W=T[R]*131072+(T[R+1]>>>11),W>=9e15?(v=crypto.getRandomValues(new Uint32Array(2)),T[R]=v[0],T[R+1]=v[1]):(X.push(W%1e14),R+=2);R=Z/2}else if(crypto.randomBytes){for(T=crypto.randomBytes(Z*=7);R<Z;)W=(T[R]&31)*281474976710656+T[R+1]*1099511627776+T[R+2]*4294967296+T[R+3]*16777216+(T[R+4]<<16)+(T[R+5]<<8)+T[R+6],W>=9e15?crypto.randomBytes(7).copy(T,R):(X.push(W%1e14),R+=7);R=Z/7}else throw m=!1,Error(Qe+"crypto unavailable");if(!m)for(;R<Z;)W=x(),W<9e15&&(X[R++]=W%1e14);for(Z=X[--R],I%=de,Z&&I&&(W=tl[de-I],X[R]=ot(Z/W)*W);X[R]===0;X.pop(),R--);if(R<0)X=[E=0];else{for(E=-1;X[0]===0;X.splice(0,1),E-=de);for(R=1,W=X[0];W>=10;W/=10,R++);R<de&&(E-=de-R)}return G.e=E,G.c=X,G}}(),b.sum=function(){for(var S=1,x=arguments,I=new b(x[0]);S<x.length;)I=I.plus(x[S++]);return I},n=function(){var S="0123456789";function x(I,T,v,E){for(var Z,W=[0],R,X=0,G=I.length;X<G;){for(R=W.length;R--;W[R]*=T);for(W[0]+=E.indexOf(I.charAt(X++)),Z=0;Z<W.length;Z++)W[Z]>v-1&&(W[Z+1]==null&&(W[Z+1]=0),W[Z+1]+=W[Z]/v|0,W[Z]%=v)}return W.reverse()}return function(I,T,v,E,Z){var W,R,X,G,N,P,B,H,D=I.indexOf("."),Y=a,F=r;for(D>=0&&(G=g,g=0,I=I.replace(".",""),H=new b(T),P=H.pow(I.length-D),g=G,H.c=x(Wt(at(P.c),P.e,"0"),10,v,S),H.e=H.c.length),B=x(I,T,v,Z?(W=y,S):(W=S,y)),X=G=B.length;B[--G]==0;B.pop());if(!B[0])return W.charAt(0);if(D<0?--X:(P.c=B,P.e=X,P.s=E,P=t(P,H,Y,F,v),B=P.c,N=P.r,X=P.e),R=X+Y+1,D=B[R],G=v/2,N=N||R<0||B[R+1]!=null,N=F<4?(D!=null||N)&&(F==0||F==(P.s<0?3:2)):D>G||D==G&&(F==4||N||F==6&&B[R-1]&1||F==(P.s<0?8:7)),R<1||!B[0])I=N?Wt(W.charAt(1),-Y,W.charAt(0)):W.charAt(0);else{if(B.length=R,N)for(--v;++B[--R]>v;)B[R]=0,R||(++X,B=[1].concat(B));for(G=B.length;!B[--G];);for(D=0,I="";D<=G;I+=W.charAt(B[D++]));I=Wt(I,X,W.charAt(0))}return I}}(),t=function(){function S(T,v,E){var Z,W,R,X,G=0,N=T.length,P=v%At,B=v/At|0;for(T=T.slice();N--;)R=T[N]%At,X=T[N]/At|0,Z=B*R+X*P,W=P*R+Z%At*At+G,G=(W/E|0)+(Z/At|0)+B*X,T[N]=W%E;return G&&(T=[G].concat(T)),T}function x(T,v,E,Z){var W,R;if(E!=Z)R=E>Z?1:-1;else for(W=R=0;W<E;W++)if(T[W]!=v[W]){R=T[W]>v[W]?1:-1;break}return R}function I(T,v,E,Z){for(var W=0;E--;)T[E]-=W,W=T[E]<v[E]?1:0,T[E]=W*Z+T[E]-v[E];for(;!T[0]&&T.length>1;T.splice(0,1));}return function(T,v,E,Z,W){var R,X,G,N,P,B,H,D,Y,F,O,z,j,U,Q,J,ne,q=T.s==v.s?1:-1,ee=T.c,$=v.c;if(!ee||!ee[0]||!$||!$[0])return new b(!T.s||!v.s||(ee?$&&ee[0]==$[0]:!$)?NaN:ee&&ee[0]==0||!$?q*0:q/0);for(D=new b(q),Y=D.c=[],X=T.e-v.e,q=E+X+1,W||(W=bt,X=lt(T.e/de)-lt(v.e/de),q=q/de|0),G=0;$[G]==(ee[G]||0);G++);if($[G]>(ee[G]||0)&&X--,q<0)Y.push(1),N=!0;else{for(U=ee.length,J=$.length,G=0,q+=2,P=ot(W/($[0]+1)),P>1&&($=S($,P,W),ee=S(ee,P,W),J=$.length,U=ee.length),j=J,F=ee.slice(0,J),O=F.length;O<J;F[O++]=0);ne=$.slice(),ne=[0].concat(ne),Q=$[0],$[1]>=W/2&&Q++;do{if(P=0,R=x($,F,J,O),R<0){if(z=F[0],J!=O&&(z=z*W+(F[1]||0)),P=ot(z/Q),P>1)for(P>=W&&(P=W-1),B=S($,P,W),H=B.length,O=F.length;x(B,F,H,O)==1;)P--,I(B,J<H?ne:$,H,W),H=B.length,R=1;else P==0&&(R=P=1),B=$.slice(),H=B.length;if(H<O&&(B=[0].concat(B)),I(F,B,O,W),O=F.length,R==-1)for(;x($,F,J,O)<1;)P++,I(F,J<O?ne:$,O,W),O=F.length}else R===0&&(P++,F=[0]);Y[G++]=P,F[0]?F[O++]=ee[j]||0:(F=[ee[j]],O=1)}while((j++<U||F[0]!=null)&&q--);N=F[0]!=null,Y[0]||Y.splice(0,1)}if(W==bt){for(G=1,q=Y[0];q>=10;q/=10,G++);M(D,E+(D.e=G+X*de-1)+1,Z,N)}else D.e=X,D.r=+N;return D}}();function k(S,x,I,T){var v,E,Z,W,R;if(I==null?I=r:Ie(I,0,8),!S.c)return S.toString();if(v=S.c[0],Z=S.e,x==null)R=at(S.c),R=T==1||T==2&&(Z<=c||Z>=d)?Ss(R,Z):Wt(R,Z,"0");else if(S=M(new b(S),x,I),E=S.e,R=at(S.c),W=R.length,T==1||T==2&&(x<=E||E<=c)){for(;W<x;R+="0",W++);R=Ss(R,E)}else if(x-=Z+(T===2&&E>Z),R=Wt(R,E,"0"),E+1>W){if(--x>0)for(R+=".";x--;R+="0");}else if(x+=E-W,x>0)for(E+1==W&&(R+=".");x--;R+="0");return S.s<0&&v?"-"+R:R}function L(S,x){for(var I,T,v=1,E=new b(S[0]);v<S.length;v++)T=new b(S[v]),(!T.s||(I=cn(E,T))===x||I===0&&E.s===x)&&(E=T);return E}function w(S,x,I){for(var T=1,v=x.length;!x[--v];x.pop());for(v=x[0];v>=10;v/=10,T++);return(I=T+I*de-1)>u?S.c=S.e=null:I<h?S.c=[S.e=0]:(S.e=I,S.c=x),S}i=function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,I=/^\.([^.]+)$/,T=/^-?(Infinity|NaN)$/,v=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(E,Z,W,R){var X,G=W?Z:Z.replace(v,"");if(T.test(G))E.s=isNaN(G)?null:G<0?-1:1;else{if(!W&&(G=G.replace(S,function(N,P,B){return X=(B=B.toLowerCase())=="x"?16:B=="b"?2:8,!R||R==X?P:N}),R&&(X=R,G=G.replace(x,"$1").replace(I,"0.$1")),Z!=G))return new b(G,X);if(b.DEBUG)throw Error(Qe+"Not a"+(R?" base "+R:"")+" number: "+Z);E.s=null}E.c=E.e=null}}();function M(S,x,I,T){var v,E,Z,W,R,X,G,N=S.c,P=tl;if(N){e:{for(v=1,W=N[0];W>=10;W/=10,v++);if(E=x-v,E<0)E+=de,Z=x,R=N[X=0],G=ot(R/P[v-Z-1]%10);else if(X=qo((E+1)/de),X>=N.length)if(T){for(;N.length<=X;N.push(0));R=G=0,v=1,E%=de,Z=E-de+1}else break e;else{for(R=W=N[X],v=1;W>=10;W/=10,v++);E%=de,Z=E-de+v,G=Z<0?0:ot(R/P[v-Z-1]%10)}if(T=T||x<0||N[X+1]!=null||(Z<0?R:R%P[v-Z-1]),T=I<4?(G||T)&&(I==0||I==(S.s<0?3:2)):G>5||G==5&&(I==4||T||I==6&&(E>0?Z>0?R/P[v-Z]:0:N[X-1])%10&1||I==(S.s<0?8:7)),x<1||!N[0])return N.length=0,T?(x-=S.e+1,N[0]=P[(de-x%de)%de],S.e=-x||0):N[0]=S.e=0,S;if(E==0?(N.length=X,W=1,X--):(N.length=X+1,W=P[de-E],N[X]=Z>0?ot(R/P[v-Z]%P[Z])*W:0),T)for(;;)if(X==0){for(E=1,Z=N[0];Z>=10;Z/=10,E++);for(Z=N[0]+=W,W=1;Z>=10;Z/=10,W++);E!=W&&(S.e++,N[0]==bt&&(N[0]=1));break}else{if(N[X]+=W,N[X]!=bt)break;N[X--]=0,W=1}for(E=N.length;N[--E]===0;N.pop());}S.e>u?S.c=S.e=null:S.e<h&&(S.c=[S.e=0])}return S}function V(S){var x,I=S.e;return I===null?S.toString():(x=at(S.c),x=I<=c||I>=d?Ss(x,I):Wt(x,I,"0"),S.s<0?"-"+x:x)}return s.absoluteValue=s.abs=function(){var S=new b(this);return S.s<0&&(S.s=1),S},s.comparedTo=function(S,x){return cn(this,new b(S,x))},s.decimalPlaces=s.dp=function(S,x){var I,T,v,E=this;if(S!=null)return Ie(S,0,De),x==null?x=r:Ie(x,0,8),M(new b(E),S+E.e+1,x);if(!(I=E.c))return null;if(T=((v=I.length-1)-lt(this.e/de))*de,v=I[v])for(;v%10==0;v/=10,T--);return T<0&&(T=0),T},s.dividedBy=s.div=function(S,x){return t(this,new b(S,x),a,r)},s.dividedToIntegerBy=s.idiv=function(S,x){return t(this,new b(S,x),0,1)},s.exponentiatedBy=s.pow=function(S,x){var I,T,v,E,Z,W,R,X,G,N=this;if(S=new b(S),S.c&&!S.isInteger())throw Error(Qe+"Exponent not an integer: "+V(S));if(x!=null&&(x=new b(x)),W=S.e>14,!N.c||!N.c[0]||N.c[0]==1&&!N.e&&N.c.length==1||!S.c||!S.c[0])return G=new b(Math.pow(+V(N),W?S.s*(2-xs(S)):+V(S))),x?G.mod(x):G;if(R=S.s<0,x){if(x.c?!x.c[0]:!x.s)return new b(NaN);T=!R&&N.isInteger()&&x.isInteger(),T&&(N=N.mod(x))}else{if(S.e>9&&(N.e>0||N.e<-1||(N.e==0?N.c[0]>1||W&&N.c[1]>=24e7:N.c[0]<8e13||W&&N.c[0]<=9999975e7)))return E=N.s<0&&xs(S)?-0:0,N.e>-1&&(E=1/E),new b(R?1/E:E);g&&(E=qo(g/de+2))}for(W?(I=new b(.5),R&&(S.s=1),X=xs(S)):(v=Math.abs(+V(S)),X=v%2),G=new b(l);;){if(X){if(G=G.times(N),!G.c)break;E?G.c.length>E&&(G.c.length=E):T&&(G=G.mod(x))}if(v){if(v=ot(v/2),v===0)break;X=v%2}else if(S=S.times(I),M(S,S.e+1,1),S.e>14)X=xs(S);else{if(v=+V(S),v===0)break;X=v%2}N=N.times(N),E?N.c&&N.c.length>E&&(N.c.length=E):T&&(N=N.mod(x))}return T?G:(R&&(G=l.div(G)),x?G.mod(x):E?M(G,g,r,Z):G)},s.integerValue=function(S){var x=new b(this);return S==null?S=r:Ie(S,0,8),M(x,x.e+1,S)},s.isEqualTo=s.eq=function(S,x){return cn(this,new b(S,x))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(S,x){return cn(this,new b(S,x))>0},s.isGreaterThanOrEqualTo=s.gte=function(S,x){return(x=cn(this,new b(S,x)))===1||x===0},s.isInteger=function(){return!!this.c&&lt(this.e/de)>this.c.length-2},s.isLessThan=s.lt=function(S,x){return cn(this,new b(S,x))<0},s.isLessThanOrEqualTo=s.lte=function(S,x){return(x=cn(this,new b(S,x)))===-1||x===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(S,x){var I,T,v,E,Z=this,W=Z.s;if(S=new b(S,x),x=S.s,!W||!x)return new b(NaN);if(W!=x)return S.s=-x,Z.plus(S);var R=Z.e/de,X=S.e/de,G=Z.c,N=S.c;if(!R||!X){if(!G||!N)return G?(S.s=-x,S):new b(N?Z:NaN);if(!G[0]||!N[0])return N[0]?(S.s=-x,S):new b(G[0]?Z:r==3?-0:0)}if(R=lt(R),X=lt(X),G=G.slice(),W=R-X){for((E=W<0)?(W=-W,v=G):(X=R,v=N),v.reverse(),x=W;x--;v.push(0));v.reverse()}else for(T=(E=(W=G.length)<(x=N.length))?W:x,W=x=0;x<T;x++)if(G[x]!=N[x]){E=G[x]<N[x];break}if(E&&(v=G,G=N,N=v,S.s=-S.s),x=(T=N.length)-(I=G.length),x>0)for(;x--;G[I++]=0);for(x=bt-1;T>W;){if(G[--T]<N[T]){for(I=T;I&&!G[--I];G[I]=x);--G[I],G[T]+=bt}G[T]-=N[T]}for(;G[0]==0;G.splice(0,1),--X);return G[0]?w(S,G,X):(S.s=r==3?-1:1,S.c=[S.e=0],S)},s.modulo=s.mod=function(S,x){var I,T,v=this;return S=new b(S,x),!v.c||!S.s||S.c&&!S.c[0]?new b(NaN):!S.c||v.c&&!v.c[0]?new b(v):(f==9?(T=S.s,S.s=1,I=t(v,S,0,3),S.s=T,I.s*=T):I=t(v,S,0,f),S=v.minus(I.times(S)),!S.c[0]&&f==1&&(S.s=v.s),S)},s.multipliedBy=s.times=function(S,x){var I,T,v,E,Z,W,R,X,G,N,P,B,H,D,Y,F=this,O=F.c,z=(S=new b(S,x)).c;if(!O||!z||!O[0]||!z[0])return!F.s||!S.s||O&&!O[0]&&!z||z&&!z[0]&&!O?S.c=S.e=S.s=null:(S.s*=F.s,!O||!z?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(T=lt(F.e/de)+lt(S.e/de),S.s*=F.s,R=O.length,N=z.length,R<N&&(H=O,O=z,z=H,v=R,R=N,N=v),v=R+N,H=[];v--;H.push(0));for(D=bt,Y=At,v=N;--v>=0;){for(I=0,P=z[v]%Y,B=z[v]/Y|0,Z=R,E=v+Z;E>v;)X=O[--Z]%Y,G=O[Z]/Y|0,W=B*X+G*P,X=P*X+W%Y*Y+H[E]+I,I=(X/D|0)+(W/Y|0)+B*G,H[E--]=X%D;H[E]=I}return I?++T:H.splice(0,1),w(S,H,T)},s.negated=function(){var S=new b(this);return S.s=-S.s||null,S},s.plus=function(S,x){var I,T=this,v=T.s;if(S=new b(S,x),x=S.s,!v||!x)return new b(NaN);if(v!=x)return S.s=-x,T.minus(S);var E=T.e/de,Z=S.e/de,W=T.c,R=S.c;if(!E||!Z){if(!W||!R)return new b(v/0);if(!W[0]||!R[0])return R[0]?S:new b(W[0]?T:v*0)}if(E=lt(E),Z=lt(Z),W=W.slice(),v=E-Z){for(v>0?(Z=E,I=R):(v=-v,I=W),I.reverse();v--;I.push(0));I.reverse()}for(v=W.length,x=R.length,v-x<0&&(I=R,R=W,W=I,x=v),v=0;x;)v=(W[--x]=W[x]+R[x]+v)/bt|0,W[x]=bt===W[x]?0:W[x]%bt;return v&&(W=[v].concat(W),++Z),w(S,W,Z)},s.precision=s.sd=function(S,x){var I,T,v,E=this;if(S!=null&&S!==!!S)return Ie(S,1,De),x==null?x=r:Ie(x,0,8),M(new b(E),S,x);if(!(I=E.c))return null;if(v=I.length-1,T=v*de+1,v=I[v]){for(;v%10==0;v/=10,T--);for(v=I[0];v>=10;v/=10,T++);}return S&&E.e+1>T&&(T=E.e+1),T},s.shiftedBy=function(S){return Ie(S,-el,el),this.times("1e"+S)},s.squareRoot=s.sqrt=function(){var S,x,I,T,v,E=this,Z=E.c,W=E.s,R=E.e,X=a+4,G=new b("0.5");if(W!==1||!Z||!Z[0])return new b(!W||W<0&&(!Z||Z[0])?NaN:Z?E:1/0);if(W=Math.sqrt(+V(E)),W==0||W==1/0?(x=at(Z),(x.length+R)%2==0&&(x+="0"),W=Math.sqrt(+x),R=lt((R+1)/2)-(R<0||R%2),W==1/0?x="5e"+R:(x=W.toExponential(),x=x.slice(0,x.indexOf("e")+1)+R),I=new b(x)):I=new b(W+""),I.c[0]){for(R=I.e,W=R+X,W<3&&(W=0);;)if(v=I,I=G.times(v.plus(t(E,v,X,1))),at(v.c).slice(0,W)===(x=at(I.c)).slice(0,W))if(I.e<R&&--W,x=x.slice(W-3,W+1),x=="9999"||!T&&x=="4999"){if(!T&&(M(v,v.e+a+2,0),v.times(v).eq(E))){I=v;break}X+=4,W+=4,T=1}else{(!+x||!+x.slice(1)&&x.charAt(0)=="5")&&(M(I,I.e+a+2,1),S=!I.times(I).eq(E));break}}return M(I,I.e+a+1,r,S)},s.toExponential=function(S,x){return S!=null&&(Ie(S,0,De),S++),k(this,S,x,1)},s.toFixed=function(S,x){return S!=null&&(Ie(S,0,De),S=S+this.e+1),k(this,S,x)},s.toFormat=function(S,x,I){var T,v=this;if(I==null)S!=null&&x&&typeof x=="object"?(I=x,x=null):S&&typeof S=="object"?(I=S,S=x=null):I=p;else if(typeof I!="object")throw Error(Qe+"Argument not an object: "+I);if(T=v.toFixed(S,x),v.c){var E,Z=T.split("."),W=+I.groupSize,R=+I.secondaryGroupSize,X=I.groupSeparator||"",G=Z[0],N=Z[1],P=v.s<0,B=P?G.slice(1):G,H=B.length;if(R&&(E=W,W=R,R=E,H-=E),W>0&&H>0){for(E=H%W||W,G=B.substr(0,E);E<H;E+=W)G+=X+B.substr(E,W);R>0&&(G+=X+B.slice(E)),P&&(G="-"+G)}T=N?G+(I.decimalSeparator||"")+((R=+I.fractionGroupSize)?N.replace(new RegExp("\\d{"+R+"}\\B","g"),"$&"+(I.fractionGroupSeparator||"")):N):G}return(I.prefix||"")+T+(I.suffix||"")},s.toFraction=function(S){var x,I,T,v,E,Z,W,R,X,G,N,P,B=this,H=B.c;if(S!=null&&(W=new b(S),!W.isInteger()&&(W.c||W.s!==1)||W.lt(l)))throw Error(Qe+"Argument "+(W.isInteger()?"out of range: ":"not an integer: ")+V(W));if(!H)return new b(B);for(x=new b(l),X=I=new b(l),T=R=new b(l),P=at(H),E=x.e=P.length-B.e-1,x.c[0]=tl[(Z=E%de)<0?de+Z:Z],S=!S||W.comparedTo(x)>0?E>0?x:X:W,Z=u,u=1/0,W=new b(P),R.c[0]=0;G=t(W,x,0,1),v=I.plus(G.times(T)),v.comparedTo(S)!=1;)I=T,T=v,X=R.plus(G.times(v=X)),R=v,x=W.minus(G.times(v=x)),W=v;return v=t(S.minus(I),T,0,1),R=R.plus(v.times(X)),I=I.plus(v.times(T)),R.s=X.s=B.s,E=E*2,N=t(X,T,E,r).minus(B).abs().comparedTo(t(R,I,E,r).minus(B).abs())<1?[X,T]:[R,I],u=Z,N},s.toNumber=function(){return+V(this)},s.toPrecision=function(S,x){return S!=null&&Ie(S,1,De),k(this,S,x,2)},s.toString=function(S){var x,I=this,T=I.s,v=I.e;return v===null?T?(x="Infinity",T<0&&(x="-"+x)):x="NaN":(S==null?x=v<=c||v>=d?Ss(at(I.c),v):Wt(at(I.c),v,"0"):S===10&&C?(I=M(new b(I),a+v+1,r),x=Wt(at(I.c),I.e,"0")):(Ie(S,2,y.length,"Base"),x=n(Wt(at(I.c),v,"0"),10,S,T,!0)),T<0&&I.c[0]&&(x="-"+x)),x},s.valueOf=s.toJSON=function(){return V(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&b.set(e),b}function lt(e){var t=e|0;return e>0||e===t?t:t-1}function at(e){for(var t,n,i=1,s=e.length,l=e[0]+"";i<s;){for(t=e[i++]+"",n=de-t.length;n--;t="0"+t);l+=t}for(s=l.length;l.charCodeAt(--s)===48;);return l.slice(0,s+1||1)}function cn(e,t){var n,i,s=e.c,l=t.c,a=e.s,r=t.s,c=e.e,d=t.e;if(!a||!r)return null;if(n=s&&!s[0],i=l&&!l[0],n||i)return n?i?0:-r:a;if(a!=r)return a;if(n=a<0,i=c==d,!s||!l)return i?0:!s^n?1:-1;if(!i)return c>d^n?1:-1;for(r=(c=s.length)<(d=l.length)?c:d,a=0;a<r;a++)if(s[a]!=l[a])return s[a]>l[a]^n?1:-1;return c==d?0:c>d^n?1:-1}function Ie(e,t,n,i){if(e<t||e>n||e!==ot(e))throw Error(Qe+(i||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function xs(e){var t=e.c.length-1;return lt(e.e/de)==t&&e.c[t]%2!=0}function Ss(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Wt(e,t,n){var i,s;if(t<0){for(s=n+".";++t;s+=n);e=s+e}else if(i=e.length,++t>i){for(s=n,t-=i;--t;s+=n);e+=s}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}var ic=nc();function dn(e){return new ic(e)}function nl(e,t){return dn(e).plus(dn(t)).toNumber()}function lS(e,t){return dn(e).minus(dn(t)).toNumber()}function aS(e,t){return dn(e).dividedBy(dn(t)).toNumber()}function sc(e,t){return dn(e).decimalPlaces(t,ic.ROUND_DOWN).toNumber()}const rS={name:"EvGridSummary",props:{stores:{type:Object,default:()=>({})},orderedColumns:{type:Object,default:()=>({})},useCheckbox:{type:Boolean,default:!1},styleOption:{type:Object,default:()=>({})},isTree:{type:Boolean,default:!1},scrollLeft:{type:Number,default:0}},setup(e){const t={max:20,default:3},n=o.ref(),i=2,s=o.computed(()=>e.stores),l=o.computed(()=>e.orderedColumns),a=o.computed(()=>e.useCheckbox),r=o.computed(()=>e.styleOption),c=f=>f==null||f<0?t.default:f>t.max?t.max:f,d=(f,g)=>{if(typeof g=="string"&&g.length===0)return g;const{type:p,decimal:y}=f;let C=g;return p==="number"?(C=sn(g),C=C===!1?g:C):p==="float"&&(C=C.toFixed(c(y??t.default)).replace(/\B(?=(\d{3})+(?!\d))/g,",")),C},h=f=>l.value.findIndex(g=>g.field===f),u=f=>{const{type:g,field:p,summaryType:y,summaryDecimal:C,summaryOnlyTopParent:b}=f;let k="";const L=h(p);if(L>=0){if(y==="count")return s.value.store.length;if(g==="number"||g==="float"){let w=[];switch(e.isTree?w=s.value.store.reduce((M,V)=>{var S,x;return b?V.parent||M.push((S=V.data)==null?void 0:S[p]):M.push((x=V.data)==null?void 0:x[p]),M},[]):w=s.value.store.map(M=>M[i][L]),y){case"sum":{const M=w.reduce((V,S)=>{const x=Number(S);return Number.isNaN(x)?V:nl(V,x)},0);k=M&&sc(M,c(C??t.default));break}case"average":{const M=w.reduce((V,S)=>{const x=Number(S);return Number.isNaN(x)?V:nl(V,x)},0);k=M&&sc(aS(M,w.length),c(C??t.default));break}case"max":{const M=w.filter(V=>V!=null);k=M.length?Math.max(...M):"";break}case"min":{const M=w.filter(V=>V!=null);k=M.length?Math.min(...M):"";break}}k=d(f,k)}}return k},m=f=>{const g=f.summaryRenderer,p=f.summaryData?f.summaryData:[],y=[f.field,...p];let C=g;return y.forEach((b,k)=>{const L=h(b);if(L>=0){const w=u(s.value.orderedColumns[L]);C=C.replace(`{${k}}`,w)}}),C};return o.watch(()=>e.scrollLeft,f=>{o.nextTick(()=>{n.value.scrollLeft=f})}),{columns:l,styleInfo:r,showCheckbox:a,summaryRef:n,getSummaryValue:u,getSummaryRenderer:m}}},cS={class:"column-list"},dS=["title"],hS=["title"];function uS(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{ref:"summaryRef",class:o.normalizeClass({"grid-summary":!0,"non-border":i.styleInfo.borderStyle==="none"})},[o.createElementVNode("ul",cS,[i.showCheckbox?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"non-border":!!i.styleInfo.borderStyle}),style:o.normalizeStyle({width:`${i.styleInfo.minWidth}px`,"line-height":`${i.styleInfo.rowHeight}px`})},[o.createElementVNode("span",{style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4)],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.columns,(a,r)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`summary_${r}`},[a.hide?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"non-border":!!i.styleInfo.borderStyle,[a.type]:a.type,[a.align]:a.align}),style:o.normalizeStyle({width:`${a.width}px`,"min-width":`${i.styleInfo.minWidth}px`,"line-height":`${i.styleInfo.rowHeight}px`})},[a.summaryType||a.summaryRenderer?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle({width:"100%",height:`${i.styleInfo.rowHeight}px`})},[a.summaryRenderer?(o.openBlock(),o.createElementBlock("div",{key:0,title:i.getSummaryRenderer(a)},o.toDisplayString(i.getSummaryRenderer(a)),9,dS)):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getSummaryValue(a)},o.toDisplayString(i.getSummaryValue(a)),9,hS))],4)):(o.openBlock(),o.createElementBlock("span",{key:1,style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4))],6))],64))),128))])],2)}const oc=ce(rS,[["render",uS],["__scopeId","data-v-4b9bef37"]]),fS={name:"EVGridColumnSetting",directives:{clickoutside:Ji},props:{isShow:{type:Boolean,default:!1},columns:{type:[Array],default:()=>[]},hiddenColumn:{type:String,default:""},position:{type:Object,default:()=>({top:0,left:0,columnListMenuWidth:0})},isShowMenuOnClick:{type:Boolean,default:!1},textInfo:{type:Object,default:()=>({title:"Column List",search:"Search",empty:"No records",ok:"OK"})}},emits:{"update:isShow":[Boolean],"update:isShowMenuOnClick":[Boolean],"apply-column":null},setup(e,{emit:t}){const n=o.computed({get:()=>e.isShow,set:T=>t("update:isShow",T)}),i=o.ref(null),s=o.ref(""),l=o.ref(!1),a=o.ref([]),r=o.ref([]),c=o.ref([]),d=o.ref([]),h=o.computed(()=>l.value?c.value:r.value),u=o.computed(()=>!h.value.length);let m=null,f=null;const g=o.reactive({top:null,left:null}),p=o.computed({get:()=>e.isShowMenuOnClick,set:T=>t("update:isShowMenuOnClick",T)}),y=T=>{var v;(T==null?void 0:T.length)===1?f=T[0]:(T==null?void 0:T.length)<1&&(f==null&&(f=(v=r.value[0])==null?void 0:v.text),a.value.push(f))},C=T=>{m&&clearTimeout(m),m=setTimeout(()=>{if(l.value=!1,T){const v=T.toString().toLowerCase();c.value=r.value.filter(E=>E.label.toString().toLowerCase().includes(v)),l.value=!0}},500)},b=()=>{s.value="",l.value=!1,c.value.length=0},k=()=>{const T=d.value.length?d.value:r.value;a.value=T.filter(v=>v.originChecked).map(v=>v.text),b()},L=()=>{d.value=r.value.filter(v=>a.value.includes(v.text));const T=d.value.map(v=>v.text);t("apply-column",T),n.value=!1,p.value=!1},w=o.ref(),M=o.ref(),V=()=>{M.value=Ve(a.value),r.value=e.columns.filter(T=>!T.hide&&T.caption).map(T=>{var Z,W;const v=(Z=w.value)==null?void 0:Z.find(R=>R.field===T.field);let E=!1;return v?E=(v==null?void 0:v.hiddenDisplay)!==(T==null?void 0:T.hiddenDisplay)||!((W=M.value)!=null&&W.length)?!(T!=null&&T.hiddenDisplay):M.value.includes(T.field):E=!T.hiddenDisplay,{label:T.caption,text:T.field,originChecked:!T.hiddenDisplay,checked:E,fixed:T.fixed}}),a.value=r.value.filter(T=>T.checked).map(T=>T.text),d.value.length=0,w.value=Ve(e.columns)},S=()=>{n.value=!1,p.value=!1},x=()=>{const T=document.createElement("div");T.id="ev-grid-column-setting-modal",T.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-column-setting-modal")||document.body.appendChild(T)},I=async()=>{var B;await o.nextTick();const T=document.documentElement.clientWidth,v=document.documentElement.clientHeight,E=(B=i.value)==null?void 0:B.getBoundingClientRect(),Z=E==null?void 0:E.width,W=E==null?void 0:E.height,{top:R,left:X,columnListMenuWidth:G}=e.position;let N;G?(N=X,T<X+Z&&(N=X-Z-G)):N=X-Z;const P=v-W;g.top=`${Math.min(R,P)+document.documentElement.scrollTop}px`,g.left=`${N+document.documentElement.scrollLeft}px`};return o.onBeforeMount(()=>x()),o.watch(()=>e.columns,()=>{V()},{immediate:!0,deep:!0}),o.watch(()=>n.value,async()=>{k(),n.value&&await I()}),o.watch(()=>e.hiddenColumn,T=>{const v=d.value.length?d.value.filter(E=>E.text!==T):r.value.filter(E=>E.text!==T&&E.checked);d.value=v,a.value=v.map(E=>E.text)}),{columnSettingWrapper:i,columnSettingStyle:g,isShowColumnSetting:n,checkColumnGroup:a,columnList:h,searchVm:s,isDisabled:u,onSearchColumn:C,onApplyColumn:L,onCheckColumn:y,hideColumnSetting:S}}},mS={class:"ev-grid-column-setting__header"},pS={class:"header-title"},gS={class:"ev-grid-column-setting__content"},bS={key:1,class:"is-empty"},yS={class:"ev-grid-column-setting__footer"};function xS(e,t,n,i,s,l){const a=o.resolveComponent("ev-text-field"),r=o.resolveComponent("ev-checkbox"),c=o.resolveComponent("ev-checkbox-group"),d=o.resolveComponent("ev-button"),h=o.resolveDirective("clickoutside");return i.isShowColumnSetting?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-grid-column-setting-modal"},[o.withDirectives((o.openBlock(),o.createElementBlock("section",{ref:"columnSettingWrapper",class:"ev-grid-column-setting",style:o.normalizeStyle(i.columnSettingStyle)},[o.createElementVNode("div",mS,[o.createElementVNode("p",pS,o.toDisplayString(n.textInfo.title),1),o.createVNode(a,{modelValue:i.searchVm,"onUpdate:modelValue":t[0]||(t[0]=u=>i.searchVm=u),type:"search",placeholder:n.textInfo.search,onInput:i.onSearchColumn},null,8,["modelValue","placeholder","onInput"])]),o.createElementVNode("div",gS,[i.columnList.length?(o.openBlock(),o.createBlock(c,{key:0,modelValue:i.checkColumnGroup,"onUpdate:modelValue":t[1]||(t[1]=u=>i.checkColumnGroup=u),onChange:i.onCheckColumn},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.columnList,(u,m)=>(o.openBlock(),o.createBlock(r,{key:`column_${m}`,label:u==null?void 0:u.text,disabled:!!(u!=null&&u.fixed),"tooltip-title":(u==null?void 0:u.label)??""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(u==null?void 0:u.label),1)]),_:2},1032,["label","disabled","tooltip-title"]))),128))]),_:1},8,["modelValue","onChange"])):(o.openBlock(),o.createElementBlock("p",bS,o.toDisplayString(n.textInfo.empty),1))]),o.createElementVNode("div",yS,[o.createVNode(d,{type:"primary",disabled:i.isDisabled,onClick:i.onApplyColumn},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.textInfo.ok),1)]),_:1},8,["disabled","onClick"])])],4)),[[h,i.hideColumnSetting]])])):o.createCommentVNode("",!0)}const lc=ce(fS,[["render",xS]]),SS={name:"EVGridFilterSetting",directives:{clickoutside:Ji},props:{isShow:{type:Boolean,default:!1},position:{type:Object,default:()=>({top:0,left:0})},column:{type:Object,default:()=>({})},items:{type:Object,default:()=>({})}},emits:{"update:isShow":null,"apply-filtering":null},setup(e,{emit:t}){const n=o.ref([]),i=o.computed(()=>e.column),s=[{name:"AND",value:"and"},{name:"OR",value:"or"}],l=[{name:"true",value:"true"},{name:"false",value:"false"}],a=[{name:"=",value:"="},{name:"!=",value:"!="},{name:"<",value:"<"},{name:">",value:">"},{name:"<=",value:"<="},{name:">=",value:">="}],r=[{name:"s%",value:"s%"},{name:"%s",value:"%s"},{name:"%s%",value:"%s%"},{name:"Not Like",value:"notLike"},{name:"=",value:"="},{name:"!=",value:"!="}],c=[{name:"Is empty",value:"isEmpty"},{name:"Is not empty",value:"isNotEmpty"}],d=L=>L==="string"||L==="stringNumber"?[...r,...c]:L==="number"||L==="float"?[...a,...c]:L==="boolean"?[{name:"=",value:"="}]:[],h=o.computed(()=>d(e.column.type)),u=o.computed({get:()=>e.isShow,set:L=>t("update:isShow",L)}),m=()=>{const L=n.value.length>=2?n.value[1].operator:"and";n.value.push({comparison:"=",operator:L,value:"",caption:i.value.caption})},f=L=>{n.value.length>1?n.value.splice(L,1):L===0&&(n.value[0].comparison="=",n.value[0].value="")},g=(L,w)=>{(L==="isEmpty"||L==="isNotEmpty")&&(n.value[w].value="")},p=L=>{n.value=n.value.map(w=>({...w,operator:L}))},y=()=>{t("apply-filtering",i.value.field,n.value.filter(L=>L.value||L.comparison==="isEmpty"||L.comparison==="isNotEmpty"))};o.watch(()=>e.isShow,L=>{var V;const w=[],M=Ve(e.items);L&&i.value.field&&((V=M[i.value.field])!=null&&V.length?M[i.value.field].forEach(S=>{w.push(S)}):w.push({comparison:"=",operator:"and",value:"",caption:i.value.caption}),n.value=w)});const C=(L,w)=>{var M;return((M=L.find(V=>V.value===w))==null?void 0:M.name)||""},b=()=>{const L=document.createElement("div");L.id="ev-grid-filter-setting-modal",L.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filter-setting-modal")||document.body.appendChild(L)};return o.onBeforeMount(()=>{b()}),{filteringItems:n,isShowFilterSetting:u,items1:s,items2:h,booleanItems:l,addRow:m,removeRow:f,changeOperator:p,applyFiltering:y,changeComparison:g,getSelectTitle:C,validateValue:(L,w)=>{(L==="number"||L==="float")&&(w.value=w.value.replace(/[^0-9.,]/g,""))}}}},CS={class:"ev-grid-filter-setting__header"},kS={class:"header-title"},wS={class:"ev-grid-filter-setting__content"},IS={class:"ev-grid-filter-setting__row--button"},TS={class:"ev-grid-filter-setting__footer"};function LS(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-select"),c=o.resolveComponent("ev-text-field"),d=o.resolveComponent("ev-button"),h=o.resolveDirective("clickoutside");return i.isShowFilterSetting?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-grid-filter-setting-modal"},[o.withDirectives((o.openBlock(),o.createElementBlock("section",{class:"ev-grid-filter-setting",style:o.normalizeStyle({top:e.$props.position.top,left:e.$props.position.left})},[o.createElementVNode("div",CS,[o.createVNode(a,{icon:"ev-icon-filter-list"}),o.createElementVNode("span",kS," Filter ("+o.toDisplayString(e.$props.column.caption)+") ",1)]),o.createElementVNode("div",wS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteringItems,(u,m)=>(o.openBlock(),o.createElementBlock("div",{key:m,class:"ev-grid-filter-setting__row"},[o.createVNode(r,{modelValue:u.operator,"onUpdate:modelValue":f=>u.operator=f,class:"ev-grid-filter-setting__row--operator",title:i.getSelectTitle(i.items1,u.operator),items:i.items1,disabled:m>1,style:o.normalizeStyle({visibility:m>0?"visible":"hidden"}),onChange:i.changeOperator},null,8,["modelValue","onUpdate:modelValue","title","items","disabled","style","onChange"]),o.createVNode(r,{modelValue:u.comparison,"onUpdate:modelValue":f=>u.comparison=f,class:"ev-grid-filter-setting__row--comparison",title:i.getSelectTitle(i.items2,u.comparison),items:i.items2,onChange:f=>i.changeComparison(u.comparison,m)},null,8,["modelValue","onUpdate:modelValue","title","items","onChange"]),e.$props.column.type==="boolean"?(o.openBlock(),o.createBlock(r,{key:0,modelValue:u.value,"onUpdate:modelValue":f=>u.value=f,class:"ev-grid-filter-setting__row--comparison",items:i.booleanItems},null,8,["modelValue","onUpdate:modelValue","items"])):(o.openBlock(),o.createBlock(c,{key:1,modelValue:u.value,"onUpdate:modelValue":f=>u.value=f,class:"ev-grid-filter-setting__row--value",disabled:u.comparison==="isEmpty"||u.comparison==="isNotEmpty",onInput:f=>i.validateValue(e.$props.column.type,u)},null,8,["modelValue","onUpdate:modelValue","disabled","onInput"])),o.createElementVNode("div",IS,[o.createVNode(a,{icon:"ev-icon-trash2",onClick:f=>i.removeRow(m)},null,8,["onClick"])])]))),128))]),o.createElementVNode("div",TS,[o.createVNode(d,{type:"primary",onClick:i.applyFiltering},{default:o.withCtx(()=>[...t[0]||(t[0]=[o.createTextVNode(" OK ",-1)])]),_:1},8,["onClick"])])],4)),[[h,()=>{i.isShowFilterSetting=!1}]])])):o.createCommentVNode("",!0)}const MS=ce(SS,[["render",LS]]),vS={name:"GridSortButton",props:{icon:{type:String,default:""}}},RS={key:0},VS={key:1},ES={key:2};function WS(e,t,n,i,s,l){return n.icon==="basic"?(o.openBlock(),o.createElementBlock("span",RS,[...t[0]||(t[0]=[o.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o.createElementVNode("rect",{width:"14",height:"14",rx:"2",fill:"#F1F3F5"}),o.createElementVNode("path",{d:`M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508 4.795L5.41508
6
6
  5.5L7.00008 3.915ZM7.00008 10.085L5.41508 8.5L4.71008 9.205L7.00008
7
7
  11.5L9.29508 9.205L8.58508 8.5L7.00008 10.085Z`,fill:"#121212"}),o.createElementVNode("path",{d:`M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008
8
8
  2.5L4.70508 4.795L5.41508 5.5L7.00008 3.915ZM7.00008 10.085L5.41508
9
- 8.5L4.71008 9.205L7.00008 11.5L9.29508 9.205L8.58508 8.5L7.00008 10.085Z`,fill:"#D8D8D8","fill-opacity":"0.09"})],-1)])])):n.icon==="asc"?(o.openBlock(),o.createElementBlock("span",TS,[...t[1]||(t[1]=[o.createStaticVNode(`<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="14" height="14" rx="2" fill="#F1F3F5"></rect><path d="M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508
9
+ 8.5L4.71008 9.205L7.00008 11.5L9.29508 9.205L8.58508 8.5L7.00008 10.085Z`,fill:"#D8D8D8","fill-opacity":"0.09"})],-1)])])):n.icon==="asc"?(o.openBlock(),o.createElementBlock("span",VS,[...t[1]||(t[1]=[o.createStaticVNode(`<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="14" height="14" rx="2" fill="#F1F3F5"></rect><path d="M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508
10
10
  4.795L5.41508 5.5L7.00008 3.915Z" fill="#121212"></path><path d="M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508
11
11
  4.795L5.41508 5.5L7.00008 3.915Z" fill="#D8D8D8" fill-opacity="0.09"></path><path d="M7.00008 9.585L8.58508 8L9.29008 8.705L7.00008 11L4.70508
12
- 8.705L5.41508 8L7.00008 9.585Z" fill="#DEE2E6"></path></svg>`,1)])])):n.icon==="desc"?(o.openBlock(),o.createElementBlock("span",LS,[...t[2]||(t[2]=[o.createStaticVNode(`<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="14" height="14" rx="2" fill="#F1F3F5"></rect><path d="M7.00008 9.585L8.58508 8L9.29008 8.705L7.00008 11L4.70508
12
+ 8.705L5.41508 8L7.00008 9.585Z" fill="#DEE2E6"></path></svg>`,1)])])):n.icon==="desc"?(o.openBlock(),o.createElementBlock("span",ES,[...t[2]||(t[2]=[o.createStaticVNode(`<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="14" height="14" rx="2" fill="#F1F3F5"></rect><path d="M7.00008 9.585L8.58508 8L9.29008 8.705L7.00008 11L4.70508
13
13
  8.705L5.41508 8L7.00008 9.585Z" fill="#121212"></path><path d="M7.00008 9.585L8.58508 8L9.29008 8.705L7.00008 11L4.70508
14
14
  8.705L5.41508 8L7.00008 9.585Z" fill="#D8D8D8" fill-opacity="0.09"></path><path d="M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508
15
- 4.795L5.41508 5.5L7.00008 3.915Z" fill="#DEE2E6"></path></svg>`,1)])])):o.createCommentVNode("",!0)}const ic=ce(wS,[["render",MS]]),vS={name:"GridOptionButton"},RS={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function VS(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("svg",RS,[...t[0]||(t[0]=[o.createElementVNode("circle",{cx:"6.49805",cy:"11.998",r:"1.5",transform:"rotate(-90 6.49805 11.998)",fill:"#ADB5BD"},null,-1),o.createElementVNode("circle",{cx:"11.998",cy:"11.998",r:"1.5",transform:"rotate(-90 11.998 11.998)",fill:"#ADB5BD"},null,-1),o.createElementVNode("path",{d:`M17.498 10.498C18.3265 10.498 18.998 11.1696 18.998 11.998C18.998
15
+ 4.795L5.41508 5.5L7.00008 3.915Z" fill="#DEE2E6"></path></svg>`,1)])])):o.createCommentVNode("",!0)}const ac=ce(vS,[["render",WS]]),GS={name:"GridOptionButton"},ZS={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function XS(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("svg",ZS,[...t[0]||(t[0]=[o.createElementVNode("circle",{cx:"6.49805",cy:"11.998",r:"1.5",transform:"rotate(-90 6.49805 11.998)",fill:"#ADB5BD"},null,-1),o.createElementVNode("circle",{cx:"11.998",cy:"11.998",r:"1.5",transform:"rotate(-90 11.998 11.998)",fill:"#ADB5BD"},null,-1),o.createElementVNode("path",{d:`M17.498 10.498C18.3265 10.498 18.998 11.1696 18.998 11.998C18.998
16
16
  12.8265 18.3265 13.498 17.498 13.498C16.6696 13.498 15.998 12.8265
17
- 15.998 11.998C15.998 11.1696 16.6696 10.498 17.498 10.498Z`,fill:"#ADB5BD"},null,-1)])])}const el=ce(vS,[["render",VS]]),Gt=0,Vn=1,ue=2,bi=3,tl=4,ES=()=>{const{props:e}=o.getCurrentInstance();return{isRenderer:(a={})=>{var r;return!!((r=a==null?void 0:a.render)!=null&&r.use)},getComponentName:(a="")=>{const r=h=>h.charAt(0).toUpperCase()+h.slice(1),c="Renderer";let d="";if(a.indexOf("_")!==-1){const h=a.split("_");for(let u=0;u<h.length;u++)d+=r(h[u])}else d=r(a);return d+c},getConvertValue:(a,r)=>{let c=a.type==="number"||a.type==="float"?Number(r):r;return a.type==="number"?(c=nn(r),c=c===!1?r:c):a.type==="float"&&(c=c.toFixed(a.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),c},getColumnIndex:a=>e.columns.findIndex(r=>r.field===a),setPixelUnit:a=>{let r=a;const c=r.toString().indexOf("px")>=0,d=r.toString().indexOf("%")>=0;return!c&&!d&&(r=`${r}px`),r}}},Cs=e=>{var i;const t=((i=e.movedColumns)!=null&&i.length?e.movedColumns:e.originColumns)??[],n=new Map((e.filteredColumns??[]).map(s=>[s.index,s]));return t.map(s=>{const l=n.get(s.index)??{};return{...s,...l}})},WS=e=>{const{scrollInfo:t,stores:n,elementInfo:i,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c,expandedInfo:d}=e,h=g=>{var b,k;const p=i.body,y=s.rowHeight,C=d.detailRowHeight??0;if(p){let L=n.store;l.isClientPaging&&(L=r());const w=((b=d.expandedRows)==null?void 0:b.length)??0,M=((k=d.expandedRows)==null?void 0:k.map(R=>L.findIndex(X=>X[ue]===R)))??[],V=L.length*y+w*C;let S=0,x=0;if(w)for(S=0;x+y<p.scrollTop;S++)M.includes(S)&&(x+=C),x+=y;else S=Math.floor(p.scrollTop/y),x=Math.max(S,0)*y;S>L.length-1&&(S=0);let I=0,T=0;if(w)for(let R=S;T<=p.clientHeight;R++)M.includes(R)&&(T+=C),T+=y,I+=1;else I=p.clientHeight>y?Math.ceil(p.clientHeight/y):L.length,T=I*y;const v=S+I+1,E=Math.max(S,0),Z=v,W=i.table;n.viewStore=L.slice(E,Z),t.hasVerticalScrollBar=I<L.length||p.clientHeight<W.clientHeight,t.vScrollTopHeight=x,t.vScrollBottomHeight=V-T-t.vScrollTopHeight,g&&l.isInfinite&&t.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(Z/l.perPage)+1,l.startIndex=Z,c({onScrollEnd:!0}))}},u=g=>{if(d.useRowDetail&&!d.detailRowHeight){let p=n.store;l.isClientPaging&&(p=r()),n.viewStore=[...p],t.vScrollTopHeight=0,t.vScrollBottomHeight=0}else h(g)},f=()=>{const g=i.header,p=i.body,y=i.table;g.scrollLeft=p.scrollLeft,a.value=p.scrollLeft,t.hasHorizontalScrollBar=p.clientWidth<y.clientWidth};return{updateVScroll:u,updateHScroll:f,onScroll:()=>{const g=i.body,p=g.scrollTop,y=g.scrollLeft,C=t.lastScroll.top,b=t.lastScroll.left,k=y!==b;p!==C&&(g!=null&&g.clientHeight)&&u(!0),k&&f(),t.lastScroll.top=p,t.lastScroll.left=y}}},GS=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{resizeInfo:i,elementInfo:s,checkInfo:l,expandedInfo:a,stores:r,isRenderer:c,updateVScroll:d,updateHScroll:h,contextInfo:u}=e,f=()=>{var b;let y=i.columnWidth,C=0;if(i.adjust){const k=s.body;let L=k.offsetWidth;const w=k.offsetHeight,M=((b=k.querySelector("tr"))==null?void 0:b.offsetHeight)||i.rowHeight,V=L-k.clientWidth,S=r.orderedColumns.reduce((x,I)=>(I.hide||I.hiddenDisplay||(I.width?x.totalWidth+=I.width:x.emptyCount++),x),{totalWidth:u.customContextMenu.length?30:0,emptyCount:0});if(M*t.rows.length>w&&(L-=V),l.useCheckbox.use&&(L-=i.minWidth),a.useRowDetail&&(L-=i.minWidth),y=L-S.totalWidth,y>0){const x=S.emptyCount===0?0:Math.floor(y/S.emptyCount);C=y-x*S.emptyCount,y=S.emptyCount!==0?x:y}else y=i.columnWidth;y=y<i.minWidth?i.minWidth:y,i.columnWidth=y}if(r.orderedColumns.forEach(k=>{const L=c(k)?i.rendererMinWidth:i.minWidth;k.width&&k.width<L&&(k.width=L),!k.width&&!k.hide&&(k.width=y)}),C&&r.orderedColumns.length){let k=r.orderedColumns.length-1,L=r.orderedColumns[k];for(;k>0&&L&&(L.hide||L.hiddenDisplay);)k-=1,L=r.orderedColumns[k];L&&(L.width+=C)}},m=()=>{const y=new Map(t.columns.map(C=>[C.field,C.width]));o.nextTick(()=>{var C,b;i.adjust&&r.orderedColumns.forEach(k=>{const L=k;return L.resized||(L.width=y.get(L.field)??0),L},void 0),f(),(C=s.body)!=null&&C.clientHeight&&d(),(b=s.body)!=null&&b.clientWidth&&h()})};return{calculatedColumn:f,onResize:m,onShow:y=>{y&&m()},onColumnResize:(y,C)=>{C.preventDefault();const b=s.header,k=s.body,L=b.getBoundingClientRect().left,w=b.querySelector(`li[data-index="${y}"]`),M=c(r.orderedColumns[y])?i.rendererMinWidth:i.minWidth,V=w.getBoundingClientRect(),S=s.resizeLine,x=V.left-L+M,I=V.right-L,T=C.clientX,v=V.left-L;k.style.overflow="auto",S.style.left=`${I}px`,i.showResizeLine=!0;const E=W=>{const R=W.clientX-T,X=I+R,G=Math.max(x,X);S.style.left=`${G}px`},Z=()=>{const R=parseInt(S.style.left,10)-v;r.orderedColumns[y]&&(r.orderedColumns[y].width=R,r.orderedColumns[y].resized=!0),i.showResizeLine=!1,document.removeEventListener("mousemove",E),m();const X=Cs(r);n("resize-column",{column:r.orderedColumns[y],columns:X}),n("change-column-info",{type:"resize",columns:X})};document.addEventListener("mousemove",E),document.addEventListener("mouseup",Z,{once:!0})}}},ZS=e=>{const{emit:t}=o.getCurrentInstance(),{selectInfo:n,stores:i}=e,s=(d,h)=>{var m;const u=(m=d.target.tagName)==null?void 0:m.toLowerCase();let f={};return u==="td"?f=d.target.dataset:f=d.target.parentNode.dataset,{event:d,rowData:h[ue],rowIndex:h[Gt],cellName:f.name,cellIndex:f.index}};let l=null,a=-1;return{onRowClick:(d,h,u)=>{var g,p,y;if((g=d.target.parentElement.classList)!=null&&g.contains("row-checkbox-input"))return!1;const f=!!((y=(p=d.target.closest("td"))==null?void 0:p.classList)!=null&&y.contains("row-contextmenu")),m=(C,b,k)=>{if(C==="shift"){const L=h[Gt];if(a>-1)for(let w=Math.min(L,a);w<=Math.max(L,a);w++)if(!b)i.originStore[w][bi]=!0,a!==w&&n.selectedRow.push(i.originStore[w][ue]);else{i.originStore[w][bi]=!1;const M=n.selectedRow.indexOf(i.originStore[w][ue]);M>-1&&n.selectedRow.splice(M,1)}}else C==="ctrl"&&(b?n.selectedRow.splice(n.selectedRow.indexOf(h[ue]),1):n.selectedRow.push(k))};return l&&clearTimeout(l),l=setTimeout(()=>{if(n.useSelect){const C=h[ue],b=h[bi];h[bi]=!h[bi];let k="";d.shiftKey?k="shift":d.ctrlKey&&(k="ctrl"),n.multiple&&k?m(k,b,C):u||f?(n.selectedRow=[...n.selectedRow],n.selectedRow.includes(C)||(n.selectedRow=[C])):b?n.selectedRow=[]:n.selectedRow=[C],a=h[Gt],t("update:selected",n.selectedRow),t("click-row",s(d,h))}},100),!0},onRowDblClick:(d,h)=>{l&&clearTimeout(l),t("dblclick-row",s(d,h))}}},XS=e=>{const{checkInfo:t,stores:n,pageInfo:i,getPagingData:s}=e,{props:l,emit:a}=o.getCurrentInstance(),r=h=>{const u=n.originStore.findIndex(f=>f[ue]===h[ue]);u!==-1&&(n.originStore[u][Vn]=h[Vn])};return{onCheck:(h,u)=>{if(t.useCheckbox.mode==="single"&&t.prevCheckedRow.length&&(t.prevCheckedRow=[],r(t.prevCheckedRow)),u[Vn]){t.useCheckbox.mode==="single"?t.checkedRows=[u[ue]]:t.checkedRows.push(u[ue]);let f=n.store;i.isClientPaging&&(f=s());const m=f.filter(g=>!l.uncheckable.includes(g[ue])).filter(g=>!l.disabledRows.includes(g[ue])).every(g=>g[Vn]);f.length&&m&&(t.isHeaderChecked=!0),t.isHeaderIndeterminate=f.length&&!m}else t.useCheckbox.mode==="single"?t.checkedRows=[]:t.checkedRows.splice(t.checkedRows.indexOf(u[ue]),1),t.isHeaderChecked=!1,t.isHeaderIndeterminate=!!(n.store.length&&t.checkedRows.length);t.prevCheckedRow=u.slice(),a("update:checked",t.checkedRows),a("check-row",h,u[Gt],u[ue])},onCheckAll:h=>{const u=t.isHeaderChecked;let f=n.store;i.isClientPaging&&(f=s()),f.forEach(m=>{const g=l.uncheckable.includes(m[ue])||l.disabledRows.includes(m[ue]);u?!t.checkedRows.includes(m[ue])&&!g&&t.checkedRows.push(m[ue]):t.checkedRows.splice(t.checkedRows.indexOf(m[ue]),1),g||(m[Vn]=u)}),t.isHeaderIndeterminate=!1,a("update:checked",t.checkedRows),a("check-all",h,t.checkedRows)}}},NS=e=>{const{expandedInfo:t}=e,{emit:n}=o.getCurrentInstance();return{onExpanded:(s,l)=>{const a=l[ue],r=t.expandedRows.indexOf(a);r===-1?t.expandedRows.push(a):t.expandedRows.splice(r,1),l[tl]=!l[tl],n("update:expanded",t.expandedRows),n("expand-row",s,l[ue],l[tl],l[Gt])}}},PS=e=>{const{sortInfo:t,stores:n,updatePagingInfo:i}=e,{emit:s}=o.getCurrentInstance(),l=(p=!0)=>p?["asc","desc","init"]:["asc","desc"];function a(){this.orders=l(),this.dequeue=()=>this.orders.shift(),this.enqueue=p=>this.orders.push(p)}const r=(p,y="init")=>{n.orderedColumns.forEach(C=>{C.index===(p==null?void 0:p.index)&&y?C.sortOption={sortType:y}:C.sortOption={sortType:"init"}})},c=()=>{const p=n.originColumns.filter(y=>y.hiddenDisplay||y.hide);p.length&&p.forEach(y=>{y.sortOption={sortType:"init"}})},d=new a,h=(p,y=!0)=>{const{sortType:C}=(p==null?void 0:p.sortOption)||{};t.sortColumn=p,t.sortField=p==null?void 0:p.field,t.sortOrder=C,t.isSorting=!!C,y&&(r(p,C),s("change-column-info",{type:"sort",columns:Cs(n)}))},u=(p,y)=>{if(p.sortable===void 0?!0:p.sortable){t.sortColumn=p,t.sortField!==(p==null?void 0:p.field)&&(d.orders=l(),t.sortField=p==null?void 0:p.field),y&&(d.orders=l(),y==="desc"&&(t.sortOrder=d.dequeue(),d.enqueue(t.sortOrder))),t.sortOrder=d.dequeue(),d.enqueue(t.sortOrder),t.isSorting=!0,i({onSort:!0}),c(),r(p,t.sortOrder);const b=Cs(n);s("sort-column",{field:t.sortField,order:t.sortOrder,column:t.sortColumn,columns:b}),s("change-column-info",{type:"sort",columns:b})}},f=()=>{var I;const{field:p,index:y}=t.sortColumn||{},C=((I=t.sortFunction)==null?void 0:I[p])??null,b=(T,v)=>T>v?-1:1,k=(T,v)=>T<v?-1:1,L=(T,v)=>(T===null)-(v===null)||Number(v)-Number(T),w=(T,v)=>(T===null)-(v===null)||Number(T)-Number(v);if(t.sortOrder==="init"||!t.sortField&&!t.isSorting){n.store.sort((T,v)=>typeof T[Gt]=="number"?k(T[Gt],v[Gt]):0);return}const M=t.sortColumn.type||"string",V=t.sortOrder==="desc"?b:k,S=t.sortOrder==="desc"?L:w,x=(T,v)=>{var W,R;let E=T[ue][y],Z=v[ue][y];return T[ue][y]&&typeof T[ue][y]=="object"&&(E=T[ue][y][(W=n.originColumns[y])==null?void 0:W.field],Z=v[ue][y][(R=n.originColumns[y])==null?void 0:R.field]),{aCol:E,bCol:Z}};if(C){n.store.sort((T,v)=>{const E=T[ue][y],Z=v[ue][y],W=C(E,Z);return t.sortOrder==="desc"?-W:W});return}switch(M){case"string":n.store.sort((T,v)=>{let{aCol:E,bCol:Z}=x(T,v);if((!E||typeof E=="string")&&(!Z||typeof Z=="string")){E=E||"",Z=Z||"";const W=E.toLowerCase(),R=Z.toLowerCase();if(E!==Z&&W===R){const X=Array.from(E).findIndex((G,N)=>G!==Z[N]);return V(E[X],Z[X])}return V(W,R)}return 0});break;case"stringNumber":n.store.sort((T,v)=>{let{aCol:E,bCol:Z}=x(T,v);return!E||typeof E=="string"||typeof E=="number"?(E=E===""?null:E,Z=Z===""?null:Z,S(E??null,Z??null)):0});break;default:n.store.sort((T,v)=>{const{aCol:E,bCol:Z}=x(T,v);return!E||typeof E=="number"||typeof E=="boolean"?S(E??null,Z??null):0});break}},m=()=>{var p;return(p=n.orderedColumns)==null?void 0:p.find(y=>(y==null?void 0:y.sortOption)&&l(!1).includes(y.sortOption.sortType))};return{onSort:u,getSortTarget:m,setSort:f,setSortInfo:h,hasSortTarget:()=>!!m()}},DS=e=>{const{props:t}=o.getCurrentInstance(),{columnSettingInfo:n,filterInfo:i,stores:s,checkInfo:l,pageInfo:a,getConvertValue:r,updateVScroll:c,getPagingData:d,updatePagingInfo:h,getColumnIndex:u}=e,f=w=>{let M=0;w.forEach(V=>{const S=l.checkedRows.includes(V[ue]);V[Vn]=S,M+=S?1:0}),w.length&&(l.isHeaderChecked=w.length===M,l.isHeaderIndeterminate=w.length!==M&&M>0,l.isHeaderUncheckable=w.every(V=>t.uncheckable.includes(V[ue])||t.disabledRows.includes(V[ue])))},m=(w,M,V)=>{if(typeof w!="string"||M===null)return!1;const S=M==null?void 0:M.toLowerCase(),x=w==null?void 0:w.toLowerCase();let I=S.includes(x);return V&&(V==="start"?I=S.startsWith(x):V==="end"&&(I=S.endsWith(x))),I},g=(w,M)=>{const V=M.comparison,S=M.value;let x=w[ue][M.index];(x||x===0)&&(x=`${w[ue][M.index]}`);let I;return V==="="?I=(S==null?void 0:S.toLowerCase())===(x==null?void 0:x.toLowerCase()):V==="!="?I=(S==null?void 0:S.toLowerCase())!==(x==null?void 0:x.toLowerCase()):V==="%s%"?I=m(S,x):V==="notLike"?I=!m(S,x):V==="s%"?I=m(S,x,"start"):V==="%s"?I=m(S,x,"end"):V==="isEmpty"?I=x==null||x==="":V==="isNotEmpty"&&(I=!!x),I},p=(w,M,V)=>{const S=M.comparison,x=Number(M.value.replace(/,/g,""));let I=Number(w[ue][M.index]),T;return V==="float"&&(I=Number(I.toFixed(3))),S==="="?T=I===x:S===">"?T=I>x:S==="<"?T=I<x:S==="<="?T=I<=x:S===">="?T=I>=x:S==="!="?T=I!==x:S==="isEmpty"?T=I==null||isNaN(I):S==="isNotEmpty"&&(T=!!I||I===0),T},y=(w,M)=>{const V=M.comparison,S=M.value,x=`${w[ue][M.index]}`;let I;return V==="="&&(I=x===S),I},C=(w,M,V)=>{let S=M==="string"||M==="stringNumber"?g:p;return M==="boolean"&&(S=y),w.filter(x=>S(x,V,M))||[]},b=()=>{const w=i.filteringItemsByColumn,M=Object.keys(w),V=s.originStore;let S=[],x=!1,I=[];M.forEach((T,v)=>{const E=w[T],Z=u(T),W=t.columns[Z].type,R=i.columnOperator==="or",X=v>0&&i.columnOperator==="and";E.forEach((G,N)=>{!S.length&&!x?S=C(V,W,{...G,index:Z}):X&&G.operator==="or"?N>0?S.push(...C(I,W,{...G,index:Z})):S=C(I,W,{...G,index:Z}):N===0&&R||N!==0&&G.operator==="or"?S.push(...C(V,W,{...G,index:Z})):S=C(S,W,{...G,index:Z}),x=!0}),I=JSON.parse(JSON.stringify(S))}),x?s.filterStore=Jb(S,JSON.stringify):s.filterStore=V};let k=null;return{onSearch:w=>{k&&clearTimeout(k),k=setTimeout(()=>{i.isSearch=!1,i.searchWord=w,w&&(s.searchStore=s.store.filter(M=>{let V=!1;const S=n.isFilteringColumn?M[ue].filter((x,I)=>n.visibleColumnIdx.includes(I)):M[ue];for(let x=0;x<s.orderedColumns.length;x++){const I=s.orderedColumns[x]||{};let T=S[I.index]??null;if(I.type=I.type||"string",T!==null&&(T instanceof Array?T=JSON.stringify(T):typeof T=="object"&&(T=T[I.field]),!I.hide&&((I==null?void 0:I.searchable)===void 0||I!=null&&I.searchable)&&(T=r(I,T).toString(),V=T.toLowerCase().includes(w.toString().toLowerCase()),V)))break}return V}),i.isSearch=!0),f(s.store),!w&&a.isClientPaging&&a.prevPage&&(a.currentPage=1,s.pagingStore=d()),h({onSearch:!0}),c()},500)},setFilter:b,setHeaderCheckboxByFilter:f}},BS=e=>{const{contextInfo:t,stores:n,selectInfo:i,onSort:s,filterInfo:l,useGridSetting:a,columnSettingInfo:r,setColumnHidden:c}=e;let d=null;const{emit:h}=o.getCurrentInstance(),u=p=>{d&&clearTimeout(d);const y=[];d=setTimeout(()=>{if(t.customContextMenu.length){const C=t.customContextMenu.map(b=>{const k=b;return k.validate&&(k.disabled=!k.validate(k.itemId,i.selectedRow)),k.selectedRow=i.selectedRow??[],k.contextmenuInfo=i.contextmenuInfo??[],k});y.push(...C)}t.contextMenuItems=y,t.menu.show(p)},200)};return{setContextMenu:u,onContextMenu:p=>{var k,L,w;p.preventDefault();const C=(L=(k=p.target.closest(".row"))==null?void 0:k.dataset)==null?void 0:L.index;let b=null;C&&(b=(w=n.viewStore.find(M=>M[Gt]===+C))==null?void 0:w[ue]),b&&(i.contextmenuInfo=[b],u(p))},onColumnContextMenu:(p,y)=>{var C,b,k,L,w,M,V,S;if(p.target.className==="column-name"){const x=y.sortable===void 0?!0:y.sortable,I=l.isFiltering&&y.filterable===void 0?!0:y.filterable,T=[{text:((C=t.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!x,hidden:(b=t.hiddenColumnMenuItem)==null?void 0:b.ascending,click:()=>s(y,"asc")},{text:((k=t.columnMenuTextInfo)==null?void 0:k.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!x,hidden:(L=t.hiddenColumnMenuItem)==null?void 0:L.descending,click:()=>s(y,"desc")},{text:((w=t.columnMenuTextInfo)==null?void 0:w.filter)??"Filter",iconClass:"ev-icon-filter-list",click:()=>{const v=document.documentElement.clientWidth,E=t.columnMenu.menuStyle.clientX,Z=t.columnMenu.menuStyle.pageX,W=350;v<E+W&&(t.columnMenu.menuStyle.left=`${Z-W}px`),l.filterSettingPosition={top:t.columnMenu.menuStyle.top,left:t.columnMenu.menuStyle.left},l.isShowFilterSetting=!0,l.filteringColumn=y,h("change-column-info",{type:"filter",columns:n.updatedColumns})},disabled:!I,hidden:((M=t.hiddenColumnMenuItem)==null?void 0:M.filter)||!l.isFiltering},{text:((V=t.columnMenuTextInfo)==null?void 0:V.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!a.value||n.orderedColumns.length===1||y.fixed,hidden:((S=t.hiddenColumnMenuItem)==null?void 0:S.hide)||!a.value,click:()=>{c(y.field),h("change-column-status",{columns:n.updatedColumns}),h("change-column-info",{type:"display",columns:n.updatedColumns})}}];if(t.columnMenuItems=[],!x&&!I&&!a.value)return;t.columnMenuItems=T.filter(v=>!v.hidden)}},onGridSettingContextMenu:p=>{const{useDefaultColumnSetting:y,columnSettingTextInfo:C}=r,b={text:(C==null?void 0:C.title)??"Column List",isShowMenu:!0,click:()=>{r.isShowColumnSetting=!0,t.isShowMenuOnClick=!0}};t.customGridSettingContextMenu.length&&(t.gridSettingContextMenuItems=[...t.customGridSettingContextMenu]),y&&t.gridSettingContextMenuItems.push(b),t.gridSettingMenu.show(p)}}},OS=e=>{const{props:t}=o.getCurrentInstance(),{selectInfo:n,checkInfo:i,stores:s,sortInfo:l,elementInfo:a,filterInfo:r,expandedInfo:c,setSort:d,setSortInfo:h,updateVScroll:u,setFilter:f}=e;return{setStore:({rows:g,isMakeIndex:p=!0,isInit:y=!1})=>{var b,k,L;const C=s.orderedColumns.find(w=>(w==null?void 0:w.sortOption)&&["asc","desc"].includes(w.sortOption.sortType));if(p){const w=[];let M=!1;g.forEach((V,S)=>{const x=t.checked.includes(V),I=t.uncheckable.includes(V)||t.disabledRows.includes(V);let T=!1;n.useSelect&&(T=t.selected.includes(V)),!x&&!I&&(M=!0);let v=!1;c.useRowDetail&&(v=t.expanded.includes(V));const E=t.disabledRows.includes(V);w.push([S,x,V,T,v,I,E])}),g.length!==t.checked.length&&(g.length===((b=t.uncheckable)==null?void 0:b.length)||g.length===((k=t.disabledRows)==null?void 0:k.length))&&(M=!0),i.isHeaderChecked=g.length>0?!M:!1,i.isHeaderIndeterminate=M&&!!i.checkedRows.length,i.isHeaderUncheckable=g.every(V=>t.uncheckable.includes(V)||t.disabledRows.includes(V)),s.originStore=w}r.isFiltering&&f(),C&&y&&h(C,!1),l.sortField&&d(),(L=a.body)!=null&&L.clientHeight&&u()}}},YS=e=>{const{emit:t}=o.getCurrentInstance(),{stores:n,pageInfo:i,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=e,c=()=>{const u=(i.currentPage-1)*i.perPage,f=parseInt(u,10)+parseInt(i.perPage,10);return n.store.slice(u,f)},d=u=>{t("page-change",{eventName:u,pageInfo:{currentPage:i.currentPage,prevPage:i.prevPage,startIndex:i.startIndex,total:i.pageTotal,perPage:i.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(f=>!f.hide&&((f==null?void 0:f.searchable)===void 0||(f==null?void 0:f.searchable))).map(f=>f.field)}}),i.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(i.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(i.isClientPaging)if(i.prevPage=u,n.store.length<=i.perPage)n.pagingStore=n.store;else{const f=(i.currentPage-1)*i.perPage,m=parseInt(f,10)+parseInt(i.perPage,10);n.pagingStore=n.store.slice(f,m),a.body.scrollTop=0,i.startIndex=f}d({onChangePage:!0})}}},sc=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{stores:i,columnSettingInfo:s,contextInfo:l,onSearch:a,onResize:r}=e,c=p=>{var y,C,b;if(s.isShowColumnSetting)if(s.columnSettingPosition.columnListMenuWidth=0,l.gridSettingContextMenuItems.length){const k=l.gridSettingContextMenuItems.length-1,L=(b=(C=(y=l.gridSettingMenu)==null?void 0:y.rootMenuList)==null?void 0:C.$el)==null?void 0:b.children[0].children[k].getBoundingClientRect();s.columnSettingPosition.columnListMenuWidth=L.width,s.columnSettingPosition.top=L.top,s.columnSettingPosition.left=L.right}else{const k=p==null?void 0:p.getBoundingClientRect(),L=k==null?void 0:k.height;s.columnSettingPosition.top=(k==null?void 0:k.top)+L,s.columnSettingPosition.left=k==null?void 0:k.right}},d=()=>{i.filteredColumns.length=0,s.isFilteringColumn=!1,s.visibleColumnIdx=[],s.hiddenColumn=""},h=()=>Array.isArray(i.movedColumns)&&i.movedColumns.length?i.movedColumns:i.originColumns||[],u=(p,y)=>{var b;if(!p)return;p.hiddenDisplay=y;const C=(b=i.originColumns)==null?void 0:b.find(k=>k.index===p.index);if(C&&C!==p&&(C.hiddenDisplay=y),Array.isArray(i.movedColumns)){const k=i.movedColumns.find(L=>L.index===p.index);k&&k!==p&&(k.hiddenDisplay=y)}},f=()=>{s.visibleColumnIdx=i.filteredColumns.map(C=>C.index);const p=i.originColumns.filter(C=>!C.hide||C.hiddenDisplay).map(C=>C.index),y=s.visibleColumnIdx;s.isFilteringColumn=y.length!==p.length,t.option.searchValue&&a(t.option.searchValue),r()};return{setPositionColumnSetting:c,initColumnSettingInfo:d,onApplyColumn:p=>{const y=i.orderedColumns.filter(L=>!L.hide&&!L.hiddenDisplay);if(p.length===y.length&&y.every(L=>p.includes(L.field)))return;const b=h(),k=new Set(p);i.filteredColumns=b.filter(L=>{const w=k.has(L.field)||!L.caption;return u(L,!w),w}),s.hiddenColumn="",f(),n("change-column-status",{columns:i.updatedColumns}),n("change-column-info",{type:"display",columns:i.updatedColumns})},setColumnHidden:p=>{const y=i.orderedColumns.filter(b=>!b.hide&&!b.hiddenDisplay);if(y.length===1)return;i.filteredColumns=y.filter(b=>{const k=b.field===p;return u(b,k),!k}),h().forEach(b=>{b.field===p&&u(b,!0)}),s.hiddenColumn=p,f()}}},FS=({stores:e})=>{const{emit:t}=o.getCurrentInstance(),n=r=>{var u;const c=(u=e.movedColumns)!=null&&u.length?[...e.movedColumns]:[...e.originColumns],d=[...r],h=new Set(d.map(f=>f.index));e.movedColumns=c.map(f=>h.has(f.index)?d.shift():f)},i=(r,c)=>{const d=parseInt(r,10),h=parseInt(c,10);if(!Number.isInteger(d)||!Number.isInteger(h))return;const u=[...e.orderedColumns],f=u[d];u.splice(d,1),u.splice(h,0,f),e.filteredColumns.length&&(e.filteredColumns=u),n(u)};return{onDragStart:r=>{r.dataTransfer.setData("text/plain",r.currentTarget.dataset.index)},onDragOver:r=>{r.preventDefault()},onDrop:r=>{r.preventDefault();const c=r.dataTransfer.getData("text/plain"),d=r.target.parentNode.dataset.index;i(c,d),t("change-column-order",{column:e.orderedColumns[d],columns:e.updatedColumns}),t("change-column-info",{type:"order",columns:e.updatedColumns})}}},zS={name:"EvGrid",directives:{clickoutside:Ji,observeVisibility:uo,resize:Dn},components:{Toolbar:j0,GridPagination:jr,GridSummary:tc,ColumnSetting:nc,FilterSetting:kS,GridSortButton:ic,GridOptionButton:el},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array],default:()=>[]},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},uncheckable:{type:[Array],default:()=>[]},expanded:{type:[Array],default:()=>[]},disabledRows:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})}},emits:{"update:selected":null,"update:checked":null,"update:expanded":null,"check-row":null,"check-all":null,"click-row":null,"dblclick-row":null,"page-change":null,"sort-column":null,"expand-row":null,"resize-column":({column:e,columns:t})=>({column:e,columns:t}),"change-column-order":({column:e,columns:t})=>({column:e,columns:t}),"change-column-status":({columns:e})=>({columns:e}),"change-column-info":({type:e,columns:t})=>({type:e,columns:t})},setup(e){var Oc,Yc,Fc,zc,Hc,Ac,_c,Kc,Uc;const{isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h}=ES(),u=o.ref(null),f=o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.useGridSetting)==null?void 0:ie.use)||!1}),m=o.computed(()=>e.option.showHeader??!0),g=o.computed(()=>{var _;return((_=e.option)==null?void 0:_.useSummary)||!1}),p=o.computed(()=>{var _;return((_=e.option.style)==null?void 0:_.stripe)||!1}),y=o.computed(()=>{var _;return((_=e.option.style)==null?void 0:_.border)||""}),C=o.computed(()=>{var _;return((_=e.option.style)==null?void 0:_.highlight)??-1}),b=o.computed(()=>e.option.emptyText??"No records"),k=e.option.rowMinHeight||35,L=o.ref(0),w=o.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),M=o.reactive({isSearch:!1,searchWord:"",isFiltering:o.computed(()=>e.option.useFilter??!1),isShowFilterSetting:!1,filterSettingPosition:{left:0,top:0},filteringColumn:null,filteringItemsByColumn:{},columnOperator:"and"}),V=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.useGridSetting)==null?void 0:ie.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((Yc=(Oc=e.option)==null?void 0:Oc.useGridSetting)==null?void 0:Yc.columnMenuText)??"Column List",search:((zc=(Fc=e.option)==null?void 0:Fc.useGridSetting)==null?void 0:zc.searchText)??"Search",empty:((Ac=(Hc=e.option)==null?void 0:Hc.useGridSetting)==null?void 0:Ac.emptyText)??"No records",ok:((Kc=(_c=e.option)==null?void 0:_c.useGridSetting)==null?void 0:Kc.okBtnText)??"OK"}}),S=o.reactive({viewStore:[],originStore:[],pagingStore:[],searchStore:[],filterStore:[],store:o.computed(()=>{const _=M.isFiltering?S.filterStore:S.originStore;return M.isSearch?S.searchStore:_}),filteredColumns:[],movedColumns:[],originColumns:o.computed(()=>e.columns.map((_,ie)=>{var Le;return{index:ie,hiddenDisplay:!1,..._,width:isFinite(_.width)?_.width:void 0,sortOption:{sortType:((Le=_==null?void 0:_.sortOption)==null?void 0:Le.sortType)||"init"}}})),orderedColumns:o.computed(()=>{const _=S.movedColumns.length?S.movedColumns:S.originColumns;return S.filteredColumns.length?S.filteredColumns:_}),updatedColumns:o.computed(()=>Cs(S))}),x=o.reactive({usePage:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.use)||!1}),useClient:((Uc=e.option.page)==null?void 0:Uc.useClient)||!1,isInfinite:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var _,ie;return(_=e.option.page)!=null&&_.useClient?S.store.length:(ie=e.option.page)==null?void 0:ie.total}),perPage:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.perPage)||20}),visiblePage:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.visiblePage)||8}),order:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.order)||"center"}),showPageInfo:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.showPageInfo)||!1}),isClientPaging:o.computed(()=>x.useClient&&x.usePage&&!x.isInfinite),isHighlight:!1,highlightPage:0}),I=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:e.checked,useCheckbox:o.computed(()=>e.option.useCheckbox||{})}),T=o.reactive({expandedRows:e.expanded,useRowDetail:o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.rowDetail)==null?void 0:ie.use)??!1}),detailRowHeight:o.computed(()=>{var _,ie;return(ie=(_=e.option)==null?void 0:_.rowDetail)==null?void 0:ie.detailRowHeight})}),v=o.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),E=o.reactive({contextmenuInfo:e.contextmenuInfo,selectedRow:e.selected,useSelect:o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.useSelection)==null?void 0:ie.use)??!0}),multiple:o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.useSelection)==null?void 0:ie.multiple)??!1})}),Z=o.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:e.option.customAscFunction??{}}),W=o.reactive({menu:null,contextMenuItems:[],contextMenuClass:e.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:e.option.columnMenuText||{},hiddenColumnMenuItem:e.option.hiddenColumnMenuItem||{},customContextMenu:e.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.useGridSetting)==null?void 0:ie.customContextMenu)||[]}),isShowMenuOnClick:!1}),R=o.reactive({minWidth:40,rendererMinWidth:80,iconWidth:42,showResizeLine:!1,adjust:e.option.adjust||!1,columnWidth:e.option.columnWidth||80,scrollWidth:e.option.scrollWidth||17,rowHeight:o.computed(()=>e.option.rowHeight>k?e.option.rowHeight:k),gridWidth:o.computed(()=>e.width?h(e.width):"100%"),gridHeight:o.computed(()=>e.height?h(e.height):"100%")}),X=()=>{I.checkedRows=[],I.isHeaderChecked=!1,I.isHeaderIndeterminate=!1,S.store.forEach(_=>{_[1]=!1})},G=()=>{E.selectedRow=[],S.store.forEach(_=>{_[3]=!1})},N=()=>{S.store.forEach(_=>{_[4]=!1}),T.expandedRows=[]},{getPagingData:P,updatePagingInfo:B,changePage:z}=YS({stores:S,pageInfo:x,sortInfo:Z,filterInfo:M,elementInfo:w,clearCheckInfo:X}),D=o.ref(0),{updateVScroll:Y,updateHScroll:F,onScroll:O}=WS({scrollInfo:v,stores:S,elementInfo:w,resizeInfo:R,pageInfo:x,summaryScroll:D,expandedInfo:T,getPagingData:P,updatePagingInfo:B}),{onCheck:H,onCheckAll:j}=XS({checkInfo:I,stores:S,pageInfo:x,getPagingData:P}),{onExpanded:U}=NS({expandedInfo:T}),{onSort:Q,getSortTarget:J,setSort:ne,setSortInfo:q,hasSortTarget:ee}=PS({sortInfo:Z,stores:S,updatePagingInfo:B}),{onSearch:$,setFilter:he,setHeaderCheckboxByFilter:fe}=DS({columnSettingInfo:V,filterInfo:M,stores:S,checkInfo:I,pageInfo:x,getConvertValue:c,updateVScroll:Y,getPagingData:P,updatePagingInfo:B,getColumnIndex:d}),{setStore:ae}=OS({selectInfo:E,checkInfo:I,stores:S,sortInfo:Z,elementInfo:w,filterInfo:M,expandedInfo:T,setSort:ne,setSortInfo:q,updateVScroll:Y,setFilter:he}),{calculatedColumn:Se,onResize:be,onShow:oe,onColumnResize:re}=GS({resizeInfo:R,elementInfo:w,checkInfo:I,expandedInfo:T,stores:S,isRenderer:a,updateVScroll:Y,updateHScroll:F,contextInfo:W}),{setPositionColumnSetting:pe,initColumnSettingInfo:Te,onApplyColumn:Ge,setColumnHidden:Lt}=sc({stores:S,columnSettingInfo:V,contextInfo:W,onSearch:$,onResize:be}),{setContextMenu:Zt,onContextMenu:gl,onColumnContextMenu:bl,onGridSettingContextMenu:Vs}=BS({contextInfo:W,stores:S,selectInfo:E,useGridSetting:f,filterInfo:M,columnSettingInfo:V,setColumnHidden:Lt,onSort:Q}),{onRowClick:Es,onRowDblClick:Ws}=ZS({selectInfo:E,stores:S}),{onDragStart:Gs,onDragOver:Zs,onDrop:Xs}=FS({stores:S}),Ns=_=>{W.gridSettingContextMenuItems.length=0,W.customGridSettingContextMenu.length?Vs(_):V.isShowColumnSetting=!0},un=_=>{var ie,Le,Mt,fn,Ei,Xt,ct,Ps,Ds,Jc;_.type==="wheel"&&((ie=W.menu)==null||ie.hide(_)),_.type==="scroll"&&!((Le=_.target.classList)!=null&&Le.contains("table-body"))&&!((fn=(Mt=_.target.offsetParent)==null?void 0:Mt.classList)!=null&&fn.contains("ev-select-dropbox"))&&!((Xt=(Ei=_.target.offsetParent)==null?void 0:Ei.classList)!=null&&Xt.contains("ev-grid-column-setting"))&&!((Ps=(ct=_.target.offsetParent)==null?void 0:ct.classList)!=null&&Ps.contains("ev-text-field-wrapper"))&&(M.isShowFilterSetting=!1,V.isShowColumnSetting=!1,W.isShowMenuOnClick=!1,(Ds=W.columnMenu)==null||Ds.hide(_),(Jc=W.gridSettingMenu)==null||Jc.hide())};o.onMounted(()=>{Se(),ae({rows:e.rows,isInit:!0}),document.addEventListener("wheel",un,{capture:!1}),document.addEventListener("scroll",un,{capture:!0})}),o.onUnmounted(()=>{document.removeEventListener("wheel",un,{capture:!1}),document.removeEventListener("scroll",un,{capture:!0})}),o.onActivated(()=>{be()}),o.onUpdated(()=>{var _;L.value=((_=w["grid-wrapper"])==null?void 0:_.offsetWidth)/1.5||0}),o.watch(()=>V.isShowColumnSetting,_=>{var ie;if(!_){(ie=W.gridSettingMenu)==null||ie.hide();return}pe(u.value)}),o.watch(()=>e.columns,()=>{ee()?q(J()):(q(J()),ne()),M.filteringColumn=null,M.filteringItemsByColumn={},S.filterStore=[],ae({rows:[],isMakeIndex:!1}),Te(),S.movedColumns.length=0},{deep:!0}),o.watch(()=>Z.isSorting,_=>{_&&(ae({rows:S.originStore,isMakeIndex:!1}),Z.isSorting=!_,x.isClientPaging&&(x.currentPage=1,S.pagingStore=P(),X()))}),o.watch(()=>e.rows,_=>{ae({rows:_}),M.isSearch&&$(M.searchWord),be()},{deep:!0}),o.watch(()=>e.uncheckable,()=>{ae({rows:e.rows})},{deep:!0}),o.watch(()=>e.checked,_=>{I.checkedRows=_}),o.watch(()=>e.disabledRows,()=>{S.store.length&&S.store.forEach(_=>{_[6]=e.disabledRows.includes(_[2])})},{deep:!0}),o.watch(()=>I.checkedRows,_=>{I.isHeaderChecked=!1;let ie=S.store;x.isClientPaging&&(ie=P()),ie.length&&(ie.forEach(Le=>{Le[1]=_.includes(Le[2])}),I.isHeaderChecked=_.length===ie.length),Y()}),o.watch(()=>e.selected,_=>{E.useSelect&&(E.selectedRow=_)}),o.watch(()=>E.selectedRow,_=>{E.useSelect&&(S.store.forEach(ie=>{ie[3]=_.includes(ie[2])&&!e.disabledRows.includes(ie[2])}),Y())}),o.watch(()=>C.value,async _=>{if(await o.nextTick(),_>=0){if(x.usePage&&!x.isInfinite&&(x.highlightPage=Math.ceil(_/x.perPage)||1,x.highlightPage!==x.currentPage)){x.currentPage=x.highlightPage,x.isHighlight=!0;return}w.body.scrollTop=R.rowHeight*C.value}}),o.watch(()=>I.useCheckbox.mode,()=>{X()}),o.watch(()=>E.useSelect,()=>{G()}),o.watch(()=>E.multiple,()=>{G()}),o.watch(()=>e.checked.length,_=>{_||X()}),o.watch(()=>e.expanded.length,_=>{_||N(),Y()}),o.watch(()=>[e.option.columnWidth,R.gridWidth],async()=>{await o.nextTick(),R.columnWidth=e.option.columnWidth;const _=w["grid-wrapper"];_.style.width=R.gridWidth,_.style.height=R.gridHeight,S.orderedColumns.map(ie=>{var Mt;const Le=ie;return!((Mt=e.columns[ie.index])!=null&&Mt.width)&&!Le.resized&&(Le.width=0),Le}),be()}),o.watch(()=>e.option.searchValue,_=>{_!==void 0&&($((_==null?void 0:_.value)??_),x.isClientPaging&&(X(),G()))},{immediate:!0}),o.watch(()=>{var _;return(_=e.option.page)==null?void 0:_.currentPage},_=>{var Le;const ie=_||1;x.currentPage=(Le=e.option.page)!=null&&Le.isInfinite?1:ie},{immediate:!0}),o.watch(()=>x.currentPage,(_,ie)=>{o.nextTick(()=>{z(ie),x.isClientPaging&&_!==ie&&(X(),G()),Y(),_===x.highlightPage&&x.isHighlight&&(w.body.scrollTop=R.rowHeight*C.value,x.isHighlight=!x.isHighlight)})});const En=o.reactive({boxTop:0,boxLeft:0}),K=o.ref(null),se=o.ref(!1),me=o.ref(!1),we=o.ref(null),Ee=o.ref({}),Ke=o.reactive({caption:"",field:""}),tt=o.ref([]),jw=[{name:"AND",value:"and"},{name:"OR",value:"or"}],yl=o.ref(0),Qw=({caption:_,field:ie},Le)=>{if(Ke.caption=_,Ke.field=ie,tt.value=Le,(Le==null?void 0:Le.length)>1){se.value=!0;const Mt=K.value.getBoundingClientRect().left,fn=window.pageYOffset+K.value.getBoundingClientRect().top+K.value.getBoundingClientRect().height;En.boxTop=`${fn}px`,En.boxLeft=`${Mt}px`}},$w=()=>{S.filterStore=[],ae({rows:[],isMakeIndex:!1})},xl=async _=>{var fn,Ei;_&&me.value&&(yl.value=0);const ie=(fn=K.value)==null?void 0:fn.getElementsByClassName("filtering-items__item"),Le=[];let Mt=0;if(ie){for(let Xt=0;Xt<ie.length;Xt++){const ct=ie[Xt];ct.classList.remove("non-display");const Ps=(Ei=K.value.getBoundingClientRect())==null?void 0:Ei.width,{width:Ds}=ct.getBoundingClientRect();Mt+=Ds+10,Ps-150<=Mt&&!ct.classList.contains("filtering-items__item--count")?(yl.value++,Le.push(ct),Ee.value={...Ee.value,[ct.dataset.field]:Ve(M.filteringItemsByColumn[ct.dataset.field])}):delete Ee.value[ct.dataset.field]}ie.forEach(Xt=>{const ct=Le.includes(Xt);Xt.classList.toggle("non-display",ct)})}},qw=async(_,ie)=>{ie!=null&&ie.length?(M.filteringItemsByColumn[_]=ie,me.value=!0):(delete Ee.value[_],delete M.filteringItemsByColumn[_]),await o.nextTick(),xl(!0),M.isShowFilterSetting=!1,S.filterStore=[],ae({rows:[],isMakeIndex:!1}),fe(S.filterStore)};let Sl=null;const eI=()=>{Sl&&clearTimeout(Sl),Sl=setTimeout(()=>{me.value=!me.value,xl(me.value)},150)},tI=()=>{M.filteringColumn=null,M.filteringItemsByColumn={},Ee.value={},S.filterStore=[],ae({rows:[],isMakeIndex:!1})},nI=o.computed(()=>{var _;return{width:`${L.value}px`,top:`${((_=K.value)==null?void 0:_.getBoundingClientRect().height)||0}px`}}),iI=_=>{const ie=M.filteringItemsByColumn[_];return ie==null?void 0:ie[ie.length-1]},sI=()=>{const _=document.createElement("div");_.id="ev-grid-filtering-items-modal",_.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filtering-items-modal")||document.body.appendChild(_)};return o.onBeforeMount(()=>sI()),{idColIndex:o.computed(()=>{var _;return(_=S.orderedColumns.find(ie=>ie.field==="id"))==null?void 0:_.index}),summaryScroll:D,showHeader:m,stripeStyle:p,borderStyle:y,highlightIdx:C,useSummary:g,useGridSetting:f,toolbarRef:u,stores:S,emptyText:b,...o.toRefs(w),...o.toRefs(S),...o.toRefs(M),...o.toRefs(v),...o.toRefs(x),...o.toRefs(R),...o.toRefs(E),...o.toRefs(I),...o.toRefs(T),...o.toRefs(Z),...o.toRefs(W),...o.toRefs(V),isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h,updateVScroll:Y,updateHScroll:F,onScroll:O,calculatedColumn:Se,onResize:be,onShow:oe,onColumnResize:re,onRowClick:Es,onRowDblClick:Ws,onCheck:H,onCheckAll:j,onExpanded:U,onSort:Q,setSort:ne,setStore:ae,setContextMenu:Zt,onContextMenu:gl,onSearch:$,setGridSetting:Ns,onApplyColumn:Ge,onColumnContextMenu:bl,filteringItemsWidth:L,isShowColumnFilteringItems:me,operatorItems:jw,selectedFilteringItems:tt,selectedFilteringColumn:Ke,filteringItemsRef:K,isShowFilteringItemsBox:se,filteringItemsStyle:nI,hiddenFilteringItemsCount:yl,...o.toRefs(En),hiddenFilteringItemsRef:we,hiddenFilteringItemsByColumn:Ee,removeAllFiltering:tI,onExpandFilteringItems:eI,setColumnFilteringItems:xl,onChangeOperator:$w,onApplyFilter:qw,onClickFilteringItem:Qw,getFilteringItemByField:iI,onDragStart:Gs,onDragOver:Zs,onDrop:Xs,ROW_DISABLED_INDEX:6}}},HS={key:0,class:"filtering-items filtering-items--used"},AS={key:1,ref:"filteringItemsRef",class:"filtering-items"},_S=["data-field","onClick"],KS={class:"filtering-items__item--title"},US=["title"],JS={key:1,class:"filtering-items__item--value"},jS=["onClick"],QS={class:"filtering-items__item--title"},$S=["title"],qS={key:1,class:"filtering-items__item--value"},eC={class:"column-list"},tC=["data-index"],nC=["title","onClick"],iC=["onClick"],sC=["onMousedown"],oC={ref:"table"},lC=["data-index","disabled","onClick","onContextmenu","onDblclick"],aC=["data-name","data-index","disabled"],rC={key:0},cC=["title"],dC=["disabled"],hC=["disabled"],uC={key:0},fC=["colspan"],mC={key:0},pC={class:"is-empty"},gC={ref:"resizeLine",class:"table-resize-line"};function bC(e,t,n,i,s,l){var L;const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-select"),c=o.resolveComponent("grid-option-button"),d=o.resolveComponent("toolbar"),h=o.resolveComponent("ev-checkbox"),u=o.resolveComponent("grid-sort-button"),f=o.resolveComponent("ev-context-menu"),m=o.resolveComponent("grid-summary"),g=o.resolveComponent("grid-pagination"),p=o.resolveComponent("filter-setting"),y=o.resolveComponent("column-setting"),C=o.resolveDirective("clickoutside"),b=o.resolveDirective("resize"),k=o.resolveDirective("observe-visibility");return o.openBlock(),o.createElementBlock(o.Fragment,null,[e.$slots.toolbar||i.useGridSetting?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:o.normalizeStyle(`width: ${e.gridWidth};`)},[o.createVNode(d,null,{toolbarWrapper:o.withCtx(()=>[o.createElementVNode("div",{class:"filtering",style:o.normalizeStyle({width:`${i.filteringItemsWidth}px`})},[e.isFiltering&&!Object.keys(e.filteringItemsByColumn).length?(o.openBlock(),o.createElementBlock("div",HS,[o.createVNode(a,{icon:"ev-icon-filter-list"}),t[18]||(t[18]=o.createElementVNode("span",null,"Filter",-1))])):o.createCommentVNode("",!0),e.isFiltering&&Object.keys(e.filteringItemsByColumn).length?(o.openBlock(),o.createElementBlock("div",AS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(e.filteringItemsByColumn),(w,M)=>{var V,S,x,I;return o.openBlock(),o.createElementBlock(o.Fragment,{key:M},[M===0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--filter",onClick:t[0]||(t[0]=o.withModifiers((...T)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...T),["stop"]))},[o.createVNode(a,{icon:"ev-icon-filter-list",class:"filtering-items-expand"}),o.createElementVNode("span",null," Filter ("+o.toDisplayString(Object.keys(e.filteringItemsByColumn).length)+") ",1),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",style:{"margin-left":"0"},onClick:o.withModifiers(i.removeAllFiltering,["stop"])},null,8,["onClick"])])):o.createCommentVNode("",!0),M===1?(o.openBlock(),o.createBlock(r,{key:1,modelValue:e.columnOperator,"onUpdate:modelValue":t[1]||(t[1]=T=>e.columnOperator=T),items:i.operatorItems,class:"filtering-items__item--operator",onChange:i.onChangeOperator},null,8,["modelValue","items","onChange"])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"filtering-items__item non-display","data-field":w,onClick:o.withModifiers(T=>{var v;return i.onClickFilteringItem({caption:(v=i.getFilteringItemByField(w))==null?void 0:v.caption,field:w},e.filteringItemsByColumn[w])},["stop"])},[o.createElementVNode("span",KS,o.toDisplayString((V=i.getFilteringItemByField(w))==null?void 0:V.caption)+" "+o.toDisplayString((S=i.getFilteringItemByField(w))==null?void 0:S.comparison),1),e.filteringItemsByColumn[w].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(x=i.getFilteringItemByField(w))==null?void 0:x.value},o.toDisplayString((I=i.getFilteringItemByField(w))==null?void 0:I.value),9,US)):(o.openBlock(),o.createElementBlock("span",JS," + "+o.toDisplayString(e.filteringItemsByColumn[w].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:T=>i.onApplyFilter(w,[])},null,8,["onClick"])],8,_S)],64)}),128)),i.isShowColumnFilteringItems&&Object.keys(e.filteringItemsByColumn).length&&i.hiddenFilteringItemsCount>0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--count",onClick:t[2]||(t[2]=(...w)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...w))}," + "+o.toDisplayString(i.hiddenFilteringItemsCount),1)):o.createCommentVNode("",!0)],512)):o.createCommentVNode("",!0),!i.isShowColumnFilteringItems&&Object.keys(i.hiddenFilteringItemsByColumn).length?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:2,ref:"hiddenFilteringItemsRef",class:"filtering-items filtering-items__hidden-items",style:o.normalizeStyle(i.filteringItemsStyle)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(i.hiddenFilteringItemsByColumn),(w,M)=>{var V,S,x,I;return o.openBlock(),o.createElementBlock("div",{key:M,class:"filtering-items__item",onClick:o.withModifiers(T=>{var v;return i.onClickFilteringItem({caption:(v=i.getFilteringItemByField(w))==null?void 0:v.caption,field:w},i.hiddenFilteringItemsByColumn[w])},["stop"])},[o.createElementVNode("span",QS,o.toDisplayString((V=i.getFilteringItemByField(w))==null?void 0:V.caption)+" "+o.toDisplayString((S=i.getFilteringItemByField(w))==null?void 0:S.comparison),1),i.hiddenFilteringItemsByColumn[w].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(x=i.getFilteringItemByField(w))==null?void 0:x.value},o.toDisplayString((I=i.getFilteringItemByField(w))==null?void 0:I.value),9,$S)):(o.openBlock(),o.createElementBlock("span",qS," + "+o.toDisplayString(i.hiddenFilteringItemsByColumn[w].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:T=>i.onApplyFilter(w,[],!0)},null,8,["onClick"])],8,jS)}),128))],4)),[[C,()=>{i.isShowColumnFilteringItems||i.onExpandFilteringItems()}]]):o.createCommentVNode("",!0)],4),i.useGridSetting?(o.openBlock(),o.createBlock(c,{key:0,class:"grid-setting__icon",onClick:t[3]||(t[3]=w=>i.setGridSetting(w))})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"toolbar",{item:{onSearch:i.onSearch}},void 0,!0)]),_:3})],4)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("div",o.mergeProps({ref:"grid-wrapper"},e.$attrs,{class:"grid-wrapper",style:`width: ${e.gridWidth}; height: ${e.gridHeight};`}),[o.createElementVNode("div",{ref:"grid",class:o.normalizeClass({table:!0,adjust:e.adjust,"ev-grid":!0,"non-header":!i.showHeader,"ev-grid--empty":!e.viewStore.length})},[o.withDirectives(o.createElementVNode("div",{ref:"header",class:o.normalizeClass({"table-header":!0,"non-border":!!i.borderStyle})},[o.createElementVNode("ul",eC,[e.useCheckbox.use?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"checkbox-all":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[e.useCheckbox.use&&e.useCheckbox.headerCheck&&e.useCheckbox.mode!=="single"?(o.openBlock(),o.createBlock(h,{key:0,modelValue:e.isHeaderChecked,"onUpdate:modelValue":t[4]||(t[4]=w=>e.isHeaderChecked=w),disabled:e.isHeaderUncheckable,indeterminate:e.isHeaderIndeterminate,onChange:i.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):o.createCommentVNode("",!0)],6)):o.createCommentVNode("",!0),e.useRowDetail?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({column:!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},null,6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.orderedColumns,(w,M)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:M},[!w.hide&&!w.hiddenDisplay?(o.openBlock(),o.createElementBlock("li",{key:0,"data-index":M,class:o.normalizeClass({column:!0,render:i.isRenderer(w),"non-border":!!i.borderStyle,[w.field]:w.field}),style:o.normalizeStyle({width:`${w.width}px`,"min-width":`${i.isRenderer(w)?e.rendererMinWidth:e.minWidth}px`,"margin-right":e.orderedColumns.length-1===M&&(e.hasVerticalScrollBar||e.hasHorizontalScrollBar)?`${e.scrollWidth}px`:"0px","border-right":e.orderedColumns.length-1===M?"none":"1px solid #CFCFCF"}),draggable:!0,onDragstart:t[6]||(t[6]=(...V)=>i.onDragStart&&i.onDragStart(...V)),onDragover:t[7]||(t[7]=(...V)=>i.onDragOver&&i.onDragOver(...V)),onDrop:t[8]||(t[8]=(...V)=>i.onDrop&&i.onDrop(...V))},[w.customHeader&&e.$slots.customHeader?o.renderSlot(e.$slots,"customHeader",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:w.caption,class:"column-name",onClick:[V=>i.onColumnContextMenu(V,w),t[5]||(t[5]=o.withModifiers((...V)=>e.columnMenu.show&&e.columnMenu.show(...V),["prevent"]))]},[o.createTextVNode(o.toDisplayString(w.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(V=>i.onSort(w),["stop"])},[e.$slots.sortIcon?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[w.sortable===void 0||w.sortable?(o.openBlock(),o.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,"sortIcon",{},void 0,!0)],4)):o.createCommentVNode("",!0),e.sortField===w.field?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":e.sortOrder==="asc","column-sort__icon--desc":e.sortOrder==="desc"}]),style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,`sortIcon_${e.sortOrder}`,{},void 0,!0)],6)):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[w.sortable===void 0||w.sortable?(o.openBlock(),o.createBlock(u,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},null,8,["style"])):o.createCommentVNode("",!0),e.sortField===w.field?(o.openBlock(),o.createBlock(u,{key:1,class:o.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":e.sortOrder==="asc","column-sort__icon--desc":e.sortOrder==="desc"}]),icon:e.sortOrder,style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,visibility:e.sortOrder?w.hidden:!0})},null,8,["class","icon","style"])):o.createCommentVNode("",!0)],64))],8,iC)],8,nC)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(V=>i.onColumnResize(M,V),["stop","left"])},null,40,sC)],46,tC)):o.createCommentVNode("",!0)],64))),128)),(L=e.$props.option.customContextMenu)!=null&&L.length?(o.openBlock(),o.createElementBlock("li",{key:2,class:o.normalizeClass({column:!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:"30px","min-width":"30px","margin-right":e.hasVerticalScrollBar||e.hasHorizontalScrollBar?`${e.scrollWidth}px`:"0px"})},null,6)):o.createCommentVNode("",!0)])],2),[[o.vShow,i.showHeader]]),o.createElementVNode("div",{ref:"body",class:o.normalizeClass({stripe:i.stripeStyle,"table-body":!0,"bottom-border":!!e.viewStore.length,"non-border":!!i.borderStyle}),onScroll:t[11]||(t[11]=(...w)=>i.onScroll&&i.onScroll(...w)),onContextmenu:t[12]||(t[12]=w=>i.onContextMenu(w))},[o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),o.createElementVNode("table",oC,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.viewStore,(w,M)=>{var V,S;return o.openBlock(),o.createElementBlock(o.Fragment,{key:i.idColIndex!=null?w[2][i.idColIndex]:M},[o.createElementVNode("tr",{"data-index":w[0],class:o.normalizeClass({row:!0,selected:w[3],highlight:w[0]===i.highlightIdx,"non-border":!!i.borderStyle&&i.borderStyle!=="rows"}),disabled:w[i.ROW_DISABLED_INDEX],onClick:x=>i.onRowClick(x,w),onContextmenu:x=>i.onRowClick(x,w,!0),onDblclick:x=>i.onRowDblClick(x,w)},[e.useCheckbox.use?(o.openBlock(),o.createElementBlock("td",{key:0,class:o.normalizeClass({cell:!0,"row-checkbox":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${e.minWidth}px`,height:`${e.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(h,{modelValue:w[1],"onUpdate:modelValue":x=>w[1]=x,class:"row-checkbox-input",disabled:w[5]||w[i.ROW_DISABLED_INDEX],onChange:x=>i.onCheck(x,w)},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])],6)):o.createCommentVNode("",!0),e.useRowDetail?(o.openBlock(),o.createElementBlock("td",{key:1,class:o.normalizeClass({cell:!0,"row-detail-toggle":!0,"non-border":!!i.borderStyle,"row-detail-toggle--expanded":w[4]}),style:o.normalizeStyle({width:`${e.minWidth}px`,height:`${e.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(a,{modelValue:w[4],"onUpdate:modelValue":x=>w[4]=x,icon:"ev-icon-s-play",class:"row-detail-toggle-icon",onClick:o.withModifiers(x=>i.onExpanded(x,w),["stop"])},null,8,["modelValue","onUpdate:modelValue","onClick"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.orderedColumns,(x,I)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${i.idColIndex!=null?w[2][i.idColIndex]:M}-${I}`},[!x.hide&&!x.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":x.field,"data-index":x.index,class:o.normalizeClass({cell:!0,render:i.isRenderer(x),[x.type]:x.type,[x.align]:x.align,[x.field]:x.field,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${x.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${i.isRenderer(x)?e.rendererMinWidth:e.minWidth}px`,"border-right":e.orderedColumns.length-1===I?"none":"1px solid #CFCFCF"}),disabled:w[i.ROW_DISABLED_INDEX]},[e.$slots[x.field]?(o.openBlock(),o.createElementBlock("div",rC,[o.renderSlot(e.$slots,x.field,{item:{row:w,column:x},disabled:w[i.ROW_DISABLED_INDEX]},void 0,!0)])):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getConvertValue(x,w[2][x.index])},o.toDisplayString(i.getConvertValue(x,w[2][x.index])),9,cC))],14,aC)):o.createCommentVNode("",!0)],64))),128)),(V=e.$props.option.customContextMenu)!=null&&V.length?(o.openBlock(),o.createElementBlock("td",{key:2,class:o.normalizeClass({"row-contextmenu":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${e.rowHeight}px`,"min-width":"30px","line-height":`${e.rowHeight}px`}),disabled:w[i.ROW_DISABLED_INDEX]},[e.$slots.contextmenuIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"row-contextmenu__btn",disabled:w[i.ROW_DISABLED_INDEX],onClick:t[9]||(t[9]=x=>i.onContextMenu(x))},[o.renderSlot(e.$slots,"contextmenuIcon",{},void 0,!0)],8,hC)):(o.openBlock(),o.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",disabled:w[i.ROW_DISABLED_INDEX],onClick:t[10]||(t[10]=x=>i.onContextMenu(x))},null,8,["disabled"]))],14,dC)):o.createCommentVNode("",!0)],42,lC),e.useRowDetail&&((S=e.$slots)!=null&&S.rowDetail)&&w[4]?(o.openBlock(),o.createElementBlock("tr",uC,[o.createElementVNode("td",{colspan:w.length},[o.createElementVNode("div",{style:o.normalizeStyle({width:"100%",height:`${e.detailRowHeight}px`,"min-height":`${e.detailRowHeight}px`,"max-height":`${e.detailRowHeight}px`})},[o.renderSlot(e.$slots,"rowDetail",{item:{row:w}},void 0,!0)],4)],8,fC)])):o.createCommentVNode("",!0)],64)}),128)),e.viewStore.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",mC,[o.createElementVNode("td",pC,o.toDisplayString(i.emptyText),1)]))])],512),o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),o.createVNode(f,{ref:"menu","custom-class":e.contextMenuClass,items:e.contextMenuItems},null,8,["custom-class","items"]),o.createVNode(f,{ref:"columnMenu",items:e.columnMenuItems},null,8,["items"]),o.createVNode(f,{ref:"gridSettingMenu",items:e.gridSettingContextMenuItems,"is-show-menu-on-click":e.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),o.withDirectives(o.createElementVNode("div",gC,null,512),[[o.vShow,e.showResizeLine]])],2)],16)),[[b,i.onResize],[k,{callback:i.onShow,once:!0}]]),i.useSummary?(o.openBlock(),o.createBlock(m,{key:1,"ordered-columns":e.orderedColumns,stores:i.stores,"use-checkbox":e.useCheckbox.use,"style-option":{borderStyle:i.borderStyle,minWidth:e.minWidth,rowHeight:e.rowHeight},"scroll-left":i.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):o.createCommentVNode("",!0),e.usePage&&!e.isInfinite?(o.openBlock(),o.createBlock(g,{key:2,modelValue:e.currentPage,"onUpdate:modelValue":t[13]||(t[13]=w=>e.currentPage=w),total:e.pageTotal,"per-page":e.perPage,"visible-page":e.visiblePage,"show-page-info":e.showPageInfo,order:e.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):o.createCommentVNode("",!0),o.createVNode(p,{"is-show":e.isShowFilterSetting,"onUpdate:isShow":t[14]||(t[14]=w=>e.isShowFilterSetting=w),items:e.filteringItemsByColumn,"onUpdate:items":t[15]||(t[15]=w=>e.filteringItemsByColumn=w),column:e.filteringColumn,position:e.filterSettingPosition,onApplyFiltering:i.onApplyFilter},null,8,["is-show","items","column","position","onApplyFiltering"]),o.createVNode(y,{"is-show":e.isShowColumnSetting,"onUpdate:isShow":t[16]||(t[16]=w=>e.isShowColumnSetting=w),"is-show-menu-on-click":e.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":t[17]||(t[17]=w=>e.isShowMenuOnClick=w),columns:e.updatedColumns,"hidden-column":e.hiddenColumn,position:e.columnSettingPosition,"text-info":e.columnSettingTextInfo,onApplyColumn:i.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const yi=ce(zS,[["render",bC],["__scopeId","data-v-22cd2bf6"]]);yi.install=e=>{e.component(yi.name,yi)};let xi=null;function yC(){return xi||(typeof document<"u"?xi=document.createElement("canvas").getContext("2d"):typeof OffscreenCanvas<"u"&&(xi=new OffscreenCanvas(1,1).getContext("2d")),xi)}const Si=new Map,xC=512,A={hexToRgb(e){if(!e)return!1;const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e),n=parseInt(t[1],16),i=parseInt(t[2],16),s=parseInt(t[3],16);return`${n},${i},${s}`},getColorStringType(e){if(!e)return"";const t=e.replace(/ /g,""),n=/^#(?:[A-Fa-f0-9]{3}){1,2}$/.exec(t),i=/^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/.exec(t),s=/^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1?)\s*[)]$/.exec(t);let l="";return n?l="HEX":i?l="RGB":s?l="RGBA":l="NONE",l},colorStringToRgba(e,t=1){const n=`${e}|${t}`,i=Si.get(n);if(i!==void 0)return i;const s=e.replace(/ /g,""),l=this.getColorStringType(s);let a="";switch(l){case"HEX":a=`rgba(${this.hexToRgb(s)},${t})`;break;case"RGB":a=s.replace(")",`, ${t})`).replace("rgb","rgba");break;case"RGBA":{const r=s.replace(/^.*,(.+)\)/,"$1");a=s.replace(`${r})`,`${t})`);break}default:a=`rgba(0, 0, 0, ${t})`;break}return Si.size>=xC&&Si.delete(Si.keys().next().value),Si.set(n,a),a},getOpacity(e){const t=e==null?void 0:e.replace(/ /g,"");return this.getColorStringType(t)==="RGBA"?t.replace(/^.*,(.+)\)/,"$1"):"1"},calculateMagnitude(e){return Math.floor(Math.log(e)/Math.LN10)},aliasPixel(e){return e%2===0?0:.5},coordinateKey(e,t){return`${e}|${t}`},getLabelStyle(e){const{fontStyle:t="normal",fontWeight:n="normal",fontSize:i="12",fontFamily:s="Roboto"}=e;return`${t} normal ${n} ${i}px ${s}`},labelSignFormat(e,t=null){const n=gu(1),i=pu(1),s=mu(1),l=fu(1),a=1e3;let r;if(!kt(e))return e;const c=e<0,d=Math.abs(e),h=(u,f,m)=>{let g;return u%f===0?g=Ht(t)?`${u/f}${m}`:`${(u/f).toFixed(t)}${m}`:g=`${(u/f).toFixed(1)}${m}`,c?`-${g}`:g};if(d>=n)r=h(d,n,"P");else if(d>=i)r=h(d,i,"T");else if(d>=s)r=h(d,s,"G");else if(d>=l)r=h(d,l,"M");else if(d>=a)r=h(d,1e3,"K");else{const u=Ht(t)?d:d.toFixed(t);r=c?`-${u}`:`${u}`}return r},calcTextSize(e,t,n=0){const i=document.createElement("span"),s=`visibility:hidden; position:absolute; top:-10000px; font: ${t}; padding: 0 ${n}px`;i.setAttribute("style",s),i.style.font=t,i.textContent=e,document.body.appendChild(i);const l=i.getBoundingClientRect(),a=l.width||2,r=l.height||2;return i.remove(),{width:a,height:r}},calcTextSizeCanvas(e,t){if(!e)return{width:2,height:2};const n=yC();n.save(),n.font=t;const i=n.measureText(e),s=t.match(/(\d+(?:\.\d+)?)px/),a=(s?Number(s[1]):14)*1.2;return n.restore(),{width:Math.max(Math.ceil(i.width),2),height:Math.max(Math.ceil(a),2)}},getStringMinMax(e){const t={min:e[0],max:e[0]};return e.forEach(n=>{var i,s;((i=t==null?void 0:t.max)==null?void 0:i.length)<(n==null?void 0:n.length)&&(t.max=n),((s=t==null?void 0:t.min)==null?void 0:s.length)>(n==null?void 0:n.length)&&(t.min=n)}),t},truncateLabelWithEllipsis(e,t,n,i="right"){if(!e)return"";if(!t)return e;const s="…",l=n.measureText(s).width;let a=e,r=n.measureText(a).width;if(r<=t||r<=l)return e;let c=a.length;for(;r>=t-l&&c-- >0;)a=i==="right"?a.substring(0,c):a.substring(1,a.length),r=n.measureText(a).width;return i==="right"?a+s:s+a},showLabelTip(e){const{ctx:t,width:n,height:i,x:s,y:l,arrowSize:a,borderRadius:r,text:c,backgroundColor:d,textColor:h}=e,u=s-n/2,f=s+n/2,m=l-i,g=l;t.beginPath(),t.save(),t.fillStyle=d||"#E96E2C",t.strokeStyle=d||"#E96E2C",t.shadowBlur=0,t.moveTo(u+r,m),t.quadraticCurveTo(u,m,u,m+r),t.lineTo(u,g-r),t.quadraticCurveTo(u,g,u+r,g),t.lineTo(f-r,g),t.quadraticCurveTo(f,g,f,g-r),t.lineTo(f,m+r),t.quadraticCurveTo(f,m,f-r,m),t.lineTo(s-a,m),t.lineTo(s,m-a),t.lineTo(s+a,m),t.lineTo(u+r,m),t.closePath(),t.fill(),t.restore(),t.save(),t.font="normal normal bold 12px Roboto",t.fillStyle=h||"#FFF",t.textBaseline="middle",t.textAlign="center",t.fillText(`${c}`,s,m+i/2),t.restore(),t.beginPath()},isPieType(e){return e==="pie"||e==="doughnut"||e==="sunburst"},isDoughnutHole(e){return e==="doughnut"||e==="sunburst"},setDOMStyle(e,t){var n;!e||!t||(n=Object.keys(t))==null||n.forEach(i=>{e.style[i]=t[i]})},checkSafeInteger(e){return e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER},htmlToElement(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild},isNullOrUndefined(e){return e==null},rgbaAdjustHalfOpacity(e){const t=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/,n=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;if(t.test(e)){const[,i,s,l]=e.match(t);return`rgba(${i}, ${s}, ${l}, 0.5)`}if(n.test(e)){const[,i,s,l,a]=e.match(n),r=(parseFloat(a)/2).toFixed(2);return`rgba(${i}, ${s}, ${l}, ${r})`}return e.startsWith("#")&&e.length>7?e:`${e}80`},calcBoxDistance(e,t,n){if(e.w!==null&&e.w!==void 0&&e.h!==null&&e.h!==void 0){const i=e.xp,s=e.yp,l=Math.min(i,i+e.w),a=Math.max(i,i+e.w),r=Math.min(s,s+e.h),c=Math.max(s,s+e.h),d=Math.max(0,l-t,t-a),h=Math.max(0,r-n,n-c);return d*d+h*h}return(e.xp-t)**2+(e.yp-n)**2}};function SC(e){const t=(String(e).split(".")[1]??"").length;return e.toFixed(t+1)}var CC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oc={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(CC,function(){var n=1e3,i=6e4,s=36e5,l="millisecond",a="second",r="minute",c="hour",d="day",h="week",u="month",f="quarter",m="year",g="date",p="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var W=["th","st","nd","rd"],R=Z%100;return"["+Z+(W[(R-20)%10]||W[R]||W[0])+"]"}},k=function(Z,W,R){var X=String(Z);return!X||X.length>=W?Z:""+Array(W+1-X.length).join(R)+Z},L={s:k,z:function(Z){var W=-Z.utcOffset(),R=Math.abs(W),X=Math.floor(R/60),G=R%60;return(W<=0?"+":"-")+k(X,2,"0")+":"+k(G,2,"0")},m:function Z(W,R){if(W.date()<R.date())return-Z(R,W);var X=12*(R.year()-W.year())+(R.month()-W.month()),G=W.clone().add(X,u),N=R-G<0,P=W.clone().add(X+(N?-1:1),u);return+(-(X+(R-G)/(N?G-P:P-G))||0)},a:function(Z){return Z<0?Math.ceil(Z)||0:Math.floor(Z)},p:function(Z){return{M:u,y:m,w:h,d,D:g,h:c,m:r,s:a,ms:l,Q:f}[Z]||String(Z||"").toLowerCase().replace(/s$/,"")},u:function(Z){return Z===void 0}},w="en",M={};M[w]=b;var V="$isDayjsObject",S=function(Z){return Z instanceof v||!(!Z||!Z[V])},x=function Z(W,R,X){var G;if(!W)return w;if(typeof W=="string"){var N=W.toLowerCase();M[N]&&(G=N),R&&(M[N]=R,G=N);var P=W.split("-");if(!G&&P.length>1)return Z(P[0])}else{var B=W.name;M[B]=W,G=B}return!X&&G&&(w=G),G||!X&&w},I=function(Z,W){if(S(Z))return Z.clone();var R=typeof W=="object"?W:{};return R.date=Z,R.args=arguments,new v(R)},T=L;T.l=x,T.i=S,T.w=function(Z,W){return I(Z,{locale:W.$L,utc:W.$u,x:W.$x,$offset:W.$offset})};var v=function(){function Z(R){this.$L=x(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[V]=!0}var W=Z.prototype;return W.parse=function(R){this.$d=function(X){var G=X.date,N=X.utc;if(G===null)return new Date(NaN);if(T.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var P=G.match(y);if(P){var B=P[2]-1||0,z=(P[7]||"0").substring(0,3);return N?new Date(Date.UTC(P[1],B,P[3]||1,P[4]||0,P[5]||0,P[6]||0,z)):new Date(P[1],B,P[3]||1,P[4]||0,P[5]||0,P[6]||0,z)}}return new Date(G)}(R),this.init()},W.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},W.$utils=function(){return T},W.isValid=function(){return this.$d.toString()!==p},W.isSame=function(R,X){var G=I(R);return this.startOf(X)<=G&&G<=this.endOf(X)},W.isAfter=function(R,X){return I(R)<this.startOf(X)},W.isBefore=function(R,X){return this.endOf(X)<I(R)},W.$g=function(R,X,G){return T.u(R)?this[X]:this.set(G,R)},W.unix=function(){return Math.floor(this.valueOf()/1e3)},W.valueOf=function(){return this.$d.getTime()},W.startOf=function(R,X){var G=this,N=!!T.u(X)||X,P=T.p(R),B=function(U,Q){var J=T.w(G.$u?Date.UTC(G.$y,Q,U):new Date(G.$y,Q,U),G);return N?J:J.endOf(d)},z=function(U,Q){return T.w(G.toDate()[U].apply(G.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(Q)),G)},D=this.$W,Y=this.$M,F=this.$D,O="set"+(this.$u?"UTC":"");switch(P){case m:return N?B(1,0):B(31,11);case u:return N?B(1,Y):B(0,Y+1);case h:var H=this.$locale().weekStart||0,j=(D<H?D+7:D)-H;return B(N?F-j:F+(6-j),Y);case d:case g:return z(O+"Hours",0);case c:return z(O+"Minutes",1);case r:return z(O+"Seconds",2);case a:return z(O+"Milliseconds",3);default:return this.clone()}},W.endOf=function(R){return this.startOf(R,!1)},W.$set=function(R,X){var G,N=T.p(R),P="set"+(this.$u?"UTC":""),B=(G={},G[d]=P+"Date",G[g]=P+"Date",G[u]=P+"Month",G[m]=P+"FullYear",G[c]=P+"Hours",G[r]=P+"Minutes",G[a]=P+"Seconds",G[l]=P+"Milliseconds",G)[N],z=N===d?this.$D+(X-this.$W):X;if(N===u||N===m){var D=this.clone().set(g,1);D.$d[B](z),D.init(),this.$d=D.set(g,Math.min(this.$D,D.daysInMonth())).$d}else B&&this.$d[B](z);return this.init(),this},W.set=function(R,X){return this.clone().$set(R,X)},W.get=function(R){return this[T.p(R)]()},W.add=function(R,X){var G,N=this;R=Number(R);var P=T.p(X),B=function(Y){var F=I(N);return T.w(F.date(F.date()+Math.round(Y*R)),N)};if(P===u)return this.set(u,this.$M+R);if(P===m)return this.set(m,this.$y+R);if(P===d)return B(1);if(P===h)return B(7);var z=(G={},G[r]=i,G[c]=s,G[a]=n,G)[P]||1,D=this.$d.getTime()+R*z;return T.w(D,this)},W.subtract=function(R,X){return this.add(-1*R,X)},W.format=function(R){var X=this,G=this.$locale();if(!this.isValid())return G.invalidDate||p;var N=R||"YYYY-MM-DDTHH:mm:ssZ",P=T.z(this),B=this.$H,z=this.$m,D=this.$M,Y=G.weekdays,F=G.months,O=G.meridiem,H=function(Q,J,ne,q){return Q&&(Q[J]||Q(X,N))||ne[J].slice(0,q)},j=function(Q){return T.s(B%12||12,Q,"0")},U=O||function(Q,J,ne){var q=Q<12?"AM":"PM";return ne?q.toLowerCase():q};return N.replace(C,function(Q,J){return J||function(ne){switch(ne){case"YY":return String(X.$y).slice(-2);case"YYYY":return T.s(X.$y,4,"0");case"M":return D+1;case"MM":return T.s(D+1,2,"0");case"MMM":return H(G.monthsShort,D,F,3);case"MMMM":return H(F,D);case"D":return X.$D;case"DD":return T.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return H(G.weekdaysMin,X.$W,Y,2);case"ddd":return H(G.weekdaysShort,X.$W,Y,3);case"dddd":return Y[X.$W];case"H":return String(B);case"HH":return T.s(B,2,"0");case"h":return j(1);case"hh":return j(2);case"a":return U(B,z,!0);case"A":return U(B,z,!1);case"m":return String(z);case"mm":return T.s(z,2,"0");case"s":return String(X.$s);case"ss":return T.s(X.$s,2,"0");case"SSS":return T.s(X.$ms,3,"0");case"Z":return P}return null}(Q)||P.replace(":","")})},W.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},W.diff=function(R,X,G){var N,P=this,B=T.p(X),z=I(R),D=(z.utcOffset()-this.utcOffset())*i,Y=this-z,F=function(){return T.m(P,z)};switch(B){case m:N=F()/12;break;case u:N=F();break;case f:N=F()/3;break;case h:N=(Y-D)/6048e5;break;case d:N=(Y-D)/864e5;break;case c:N=Y/s;break;case r:N=Y/i;break;case a:N=Y/n;break;default:N=Y}return G?N:T.a(N)},W.daysInMonth=function(){return this.endOf(u).$D},W.$locale=function(){return M[this.$L]},W.locale=function(R,X){if(!R)return this.$L;var G=this.clone(),N=x(R,X,!0);return N&&(G.$L=N),G},W.clone=function(){return T.w(this.$d,this)},W.toDate=function(){return new Date(this.valueOf())},W.toJSON=function(){return this.isValid()?this.toISOString():null},W.toISOString=function(){return this.$d.toISOString()},W.toString=function(){return this.$d.toUTCString()},Z}(),E=v.prototype;return I.prototype=E,[["$ms",l],["$s",a],["$m",r],["$H",c],["$W",d],["$M",u],["$y",m],["$D",g]].forEach(function(Z){E[Z[1]]=function(W){return this.$g(W,Z[0],Z[1])}}),I.extend=function(Z,W){return Z.$i||(Z(W,v,I),Z.$i=!0),I},I.locale=x,I.isDayjs=S,I.unix=function(Z){return I(1e3*Z)},I.en=M[w],I.Ls=M,I.p={},I})})(oc);var wC=oc.exports;const We=kC(wC),Ci="3.21.1",dn="__evuiChart__",hn="__EVUI_CHART__",ks="__EVUI_CHART_LOG_EMPTY__",nl="EVUI_CHART_LOG_EMPTY",et=1e3,IC="YYYY-MM-DD HH:mm:ss",Ae=`[EVUI ${Ci}]`,il=e=>Math.floor(e/et)*et,_e=e=>Number.isFinite(e)&&e?We(e).format(IC):"-",TC=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(e instanceof Date){const t=e.getTime();return Number.isFinite(t)?t:null}if(typeof e=="string"){const t=We(e);return t.isValid()?t.valueOf():null}return null},LC=(e,t,n)=>{const i={},s=[["from",e],["to",t]];for(let l=0;l<s.length;l++){const[a,r]=s[l];if(r==null){if(!n)return ye.warn(`${Ae} 저장소에 데이터가 없어 ${a} 를 생략할 수 없다`),null;i[a]=n[a]}else{const c=TC(r);if(c===null)return ye.warn(`${Ae} 시각을 해석할 수 없다: ${String(r)} (예: '2026-10-02 10:02:00' 또는 ms 숫자)`),null;i[a]=il(c)}}return i.from>i.to?(ye.warn(`${Ae} from 이 to 보다 늦다`),null):i},MC=e=>{var s,l,a,r,c,d;const t=(a=(l=(s=e.seriesInfo)==null?void 0:s.charts)==null?void 0:l.scatter)==null?void 0:a[0],n=(c=(r=e.seriesList)==null?void 0:r[t])==null?void 0:c.minMax,i=(d=n==null?void 0:n.maxX)==null?void 0:d.valueOf();return i?{from:n.minX.valueOf(),to:i}:null},lc=(e,t)=>t?e.to<t.from||e.from>t.to?"창 밖":e.from<t.from||e.to>t.to?"일부 창 밖":"창 안":"저장소 없음",ac=e=>({mode:e._lastFrameMode??"-",lastRasterAt:e._lastRasterAt??0,lastRasterText:_e(e._lastRasterAt),framesSinceFullRedraw:e._framesSinceFullRedraw,pointsLayerValid:e.pointsLayerValid}),vC=5,RC=e=>{if(!e.length)return null;const t=[...e].sort((n,i)=>n-i);return t.length>vC?`${t[0]} ~ ${t.at(-1)} (${t.length}개)`:t.join(", ")},VC=(e,t)=>{const n=t.map(s=>{var l,a;return((a=(l=e.seriesList)==null?void 0:l[s])==null?void 0:a.name)||s}),i={};return t.forEach((s,l)=>{const a=n.indexOf(n[l])!==n.lastIndexOf(n[l]);i[s]=a?`${n[l]} (${s.slice(0,8)})`:n[l]}),i},rc=(e,t,n)=>{var m,g;if(!((g=(m=e.options)==null?void 0:m.realTimeScatter)!=null&&g.use))return ye.warn(`${Ae} realTimeScatter 차트가 아니다 — chart 속성으로 인스턴스를 직접 본다`),null;const i=e.dataSet??{},s=MC(e),l=LC(t,n,s);if(!l)return null;const a=Object.keys(i),r=VC(e,a),c=s?Math.max(l.from,s.from):0,d=s?Math.min(l.to,s.to):-1,h=new Map;for(let p=c;p<=d;p+=et){const y={time:_e(p),total:0};a.forEach(C=>{y[r[C]]=[]}),h.set(p,y)}const u=a.map(p=>{var k,L,w;const y=i[p],C={id:p,name:((L=(k=e.seriesList)==null?void 0:k[p])==null?void 0:L.name)??"",window:lc(l,{from:y.fromTime+et,to:y.toTime}),points:0,stored:0,outOfWindow:0},b=y.dataGroup??[];for(let M=0;M<b.length;M++){const V=((w=b[M])==null?void 0:w.data)??[];for(let S=0;S<V.length;S++){const x=V[S];if(x.y!=null){const I=il(x.x),T=h.get(I);C.stored++,!s||I<s.from||I>s.to?C.outOfWindow++:T&&(C.points++,T[r[p]].push(x.y),T.total++)}}}return C}),f=a.map(p=>{var C;const y=i[p];return{id:p,fromTime:y.fromTime,fromText:_e(y.fromTime),toTime:y.toTime,toText:_e(y.toTime),lastDataTime:y.lastDataTime,lastDataText:_e(y.lastDataTime),length:y.length,startIndex:y.startIndex,endIndex:y.endIndex,buckets:((C=y.dataGroup)==null?void 0:C.length)??0,lastTick:y.lastTick?{...y.lastTick}:null}});return{version:Ci,request:{...l,fromText:_e(l.from),toText:_e(l.to)},window:s?{...s,fromText:_e(s.from),toText:_e(s.to)}:null,judge:lc(l,s),series:u,seconds:[...h.values()].map(p=>(a.forEach(y=>{p[r[y]]=RC(p[r[y]])}),p)),store:f,pruned:[...e.prunedRealTimeScatterSeries??[]],frame:ac(e)}},EC=(e,t,n)=>{var s,l;const i=rc(e,t,n);return i?(ye.log(`${Ae} realTimeScatter 조회 ${i.request.fromText} ~ ${i.request.toText} — ${i.judge} (창 ${((s=i.window)==null?void 0:s.fromText)??"-"} ~ ${((l=i.window)==null?void 0:l.toText)??"-"})`),ye.table(i.series),ye.table(i.seconds),ye.table(i.store.map(({lastTick:a,...r})=>({...r,gapCount:a==null?void 0:a.gapCount}))),ye.log(`${Ae} 만료 series:`,i.pruned,"직전 프레임:",i.frame),i):null},WC=(e,t,n)=>{const i=rc(e,t,n);if(!i)return null;const s=i.seconds.filter(c=>c.total>0),a=Object.keys(i.seconds[0]??{}).filter(c=>!["time","total"].includes(c)).filter(c=>s.some(d=>d[c]!==null)),r=s.map(c=>{const d={time:c.time,total:c.total};return a.forEach(h=>{d[h]=c[h]}),d});return ye.log(`${Ae} realTimeScatter 데이터 있는 초 ${r.length}초 / ${i.seconds.length}초 ${i.request.fromText} ~ ${i.request.toText} — ${i.judge}`),ye.table(r),{version:i.version,request:i.request,window:i.window,judge:i.judge,seconds:r}},GC=e=>{if(!e.isInit)return ye.warn(`${Ae} 초기화되지 않은 차트다`),null;e.pointsLayerValid=!1,e.render();const t=ac(e);return ye.log(`${Ae} 강제 full redraw`,t),t},ZC=()=>{var e;try{return((e=window.localStorage)==null?void 0:e.getItem(nl))==="1"}catch{return!1}},sl=()=>typeof window>"u"?!1:(window[ks]===void 0&&(window[ks]=ZC()),window[ks]===!0),XC=(e,t)=>{var s,l;if(!((s=e.dataGroup)!=null&&s.length)||t>e.toTime||t<=e.fromTime)return!1;let n=e.endIndex-(e.toTime-t)/et;n<0&&(n+=e.length);const i=((l=e.dataGroup[n])==null?void 0:l.data)??[];for(let a=0;a<i.length;a++)if(i[a].y!=null&&il(i[a].x)===t)return!0;return!1},ol=e=>{var t,n;return((n=(t=e.options)==null?void 0:t.realTimeScatter)==null?void 0:n.label)||""},NC=(e,t)=>{const n=t.map(i=>{var s,l;return((l=(s=e.seriesList)==null?void 0:s[i])==null?void 0:l.name)??i});return n.length>3?`${n.slice(0,3).join(", ")} 외 ${n.length-3}`:n.join(", ")},cc=(e,t)=>{const n=(t-e)/et+1;return{range:n>1?`${_e(e)} ~ ${_e(t)}`:_e(e),count:n}},ws="color: #fff; border-radius: 3px; padding: 0 4px;",PC={start:`${ws} background: #e8590c;`,range:`${ws} background: #2b8a3e;`,late:`${ws} background: #1971c2;`,on:`${ws} background: #495057;`},ll=new Set,dc=["#9775fa","#e64980","#1098ad","#5c940d","#fa5252","#5c7cfa","#cc5de8","#0ca678"],Is=e=>{if(e._inspectNo==null){let t=1;for(;ll.has(t);)t++;ll.add(t),e._inspectNo=t}return e._inspectNo},DC=e=>{const t=dc[(e-1)%dc.length];return`color: ${t}; border: 1px solid ${t}; border-radius: 3px; padding: 0 4px; font-weight: bold;`},ki=(e,t,n,i)=>{var r;const s=Is(e),l=ol(e),a=(r=e.data)==null?void 0:r.logInfo;return[`${Ae} realTimeScatter %c차트 #${s}${l?` ${l}`:""}%c %c${n}%c ${i}${a?` — ${a}`:""}`,DC(s),"",PC[t],""]},hc=(e,t,n,i="")=>{const{range:s,count:l}=cc(t,n);ye.warn(...ki(e,"range","빈 초",`${s} (${l}초${i})`))},uc=(e,t,n="")=>{ye.warn(...ki(e,"start","빈 초 시작",`${_e(t)}${n?` (${n})`:""} — 데이터가 다시 들어오면 구간을 한 줄로 찍는다`))},BC=e=>{const t=[];return[...e].sort((n,i)=>n-i).forEach(n=>{const i=t.at(-1);i&&n===i[1]+et?i[1]=n:t.push([n,n])}),t},OC=(e,t,n)=>{const i=e._emptyLogReported;if(!(i!=null&&i.size))return;const s=[];i.forEach(l=>{l<n?i.delete(l):t(l)||(s.push(l),i.delete(l))}),BC(s).forEach(([l,a])=>{const{range:r,count:c}=cc(l,a);ye.warn(...ki(e,"late","늦게 채워짐",`${r} (${c}초) — 앞서 빈 초로 찍은 초에 데이터가 늦게 들어왔다`))})},YC=(e,t,n,i)=>{e._emptyLogReported??(e._emptyLogReported=new Set);for(let s=Math.max(t,i);s<=n;s+=et)e._emptyLogReported.add(s)};let al=0;const FC=(e,t,n)=>{var y,C;e._emptyLogGeneration!==al&&(e._emptyLogGeneration=al,e._emptyLogCheckedTo=null,e._emptyLogOpenFrom=null,e._emptyLogFilledStart=null,(y=e._emptyLogReported)==null||y.clear(),e._emptyLogAnnounced=!1);const i=e.dataSet??{},s=Object.keys(i),l=b=>!s.some(k=>XC(i[k],b)),a=n-et,r=e._emptyLogCheckedTo,c=ol(e);if(e._emptyLogAnnounced&&c&&c!==e._emptyLogLabel&&ye.log(...ki(e,"on","차트 이름","— 이후 줄은 이 이름으로 찍는다")),e._emptyLogLabel=c,r==null){const b=Object.values(i).some(k=>k.lastDataTime>0);if(n&&b&&(e._emptyLogCheckedTo=a),!e._emptyLogAnnounced){e._emptyLogAnnounced=!0;const k=e._emptyLogCheckedTo==null?"첫 데이터가 들어오면 그 시각부터 본다":`${_e(n)} 부터 지나가는 초를 본다`,L=Is(e);ye.log(...ki(e,"on","빈 초 로그 켜짐",`— ${k} — 조회: ${hn}(${L}).query()`))}return}if(!n)return;if(a<r){const b=e._emptyLogOpenFrom;b!=null&&hc(e,b,r,", 시각이 뒤로 가 기준을 다시 잡음"),e._emptyLogOpenFrom=null,e._emptyLogFilledStart=null,(C=e._emptyLogReported)==null||C.clear(),e._emptyLogCheckedTo=a;return}OC(e,l,t);const d=e._emptyLogOpenFrom,h=d??r+et,u=Math.max(h,t);let f=h<t?h:null,m=d==null,g=e._emptyLogFilledStart??null;const p=b=>`앞서 찍은 시작 ${_e(b)} 은 늦게 채워짐`;e._emptyLogCheckedTo=a;for(let b=u;b<=a;b+=et){const k=l(b);if(k&&f===null)f=b;else if(!k&&f!==null){const L=!m&&f!==d?d:g,w=L==null?"":`, ${p(L)}`;hc(e,f,b-et,w),YC(e,f,b-et,t),g=null,m=!0,f=null}}!m&&f===null?g=d:!m&&f!==d?uc(e,f,p(d)):m&&f!==null&&(uc(e,f,g==null?"":p(g)),g=null),e._emptyLogOpenFrom=f,e._emptyLogFilledStart=g},rl=new WeakMap,zC=e=>{const t=n=>(...i)=>{var l;const s=(l=e.getChart)==null?void 0:l.call(e);return s?n(s,...i):(ye.warn(`${Ae} 언마운트된 차트다 — 화면의 차트 목록: ${hn}.list()`),null)};return{get chart(){var n;return((n=e.getChart)==null?void 0:n.call(e))??null},version:Ci,query:t(EC),queryData:t(WC),redraw:t(GC)}},HC=e=>{var i,s;const t=(i=e==null?void 0:e.closest)==null?void 0:i.call(e,".ev-chart");if(t)return t;const n=((s=e==null?void 0:e.querySelectorAll)==null?void 0:s.call(e,".ev-chart"))??[];return n.length>1&&ye.warn(`${Ae} 고른 요소 안에 차트가 ${n.length}개다 — 차트 안쪽 요소를 고른다`),n.length===1?n[0]:null},AC=e=>[...document.querySelectorAll(".ev-chart")].find(t=>{var n,i;return((i=(n=t[dn])==null?void 0:n.chart)==null?void 0:i._inspectNo)===e})??null,Ts=e=>{const t=typeof e=="number"?AC(e):HC(e),n=t==null?void 0:t[dn];return n||(ye.warn(`${Ae} 차트를 찾지 못했다 — Elements 패널에서 차트 안 요소를 고른 뒤 ${hn}($0) 또는 로그의 차트 번호로 ${hn}(번호). 화면의 차트 목록은 ${hn}.list()`),null)};Ts.version=Ci,Ts.logEmpty=e=>{if(e===void 0)return sl();e&&!sl()&&(al+=1),window[ks]=!!e;try{e?window.localStorage.setItem(nl,"1"):window.localStorage.removeItem(nl)}catch{ye.warn(`${Ae} localStorage 를 쓸 수 없어 이 창에서만 적용된다`)}return ye.log(`${Ae} realTimeScatter 빈 초 로그 ${e?"켬":"끔"} — 이미 열린 다른 창은 새로고침해야 반영된다`),!!e},Ts.list=()=>{const e=[...document.querySelectorAll(".ev-chart")].filter(t=>t[dn]).map(t=>{var i,s,l;const{chart:n}=t[dn];return{no:Is(n),title:ol(n),type:(i=n.options)==null?void 0:i.type,realTimeScatter:!!((l=(s=n.options)==null?void 0:s.realTimeScatter)!=null&&l.use),series:NC(n,Object.keys(n.seriesList??{}))}});return ye.table(e),e};const _C=(e,t)=>{if(!e)return;const n={getChart:t};rl.set(e,n),Object.defineProperty(e,dn,{configurable:!0,enumerable:!1,get:()=>t()?zC(n):null});const i=t();i&&Is(i),typeof window<"u"&&!window[hn]&&(window[hn]=Ts)},KC=e=>{var t,n;if(e){const i=(n=(t=e[dn])==null?void 0:t.chart)==null?void 0:n._inspectNo;i!=null&&ll.delete(i);const s=rl.get(e);s&&(s.getChart=null,rl.delete(e)),delete e[dn]}},UC={createDataSet(e,t){var n;this._dataEpoch=(this._dataEpoch??0)+1,Object.keys(this.seriesInfo.charts).forEach(i=>{var l;const s=this.seriesInfo.charts[i];if(s.length)if(i==="pie")this.options.sunburst?this.createSunburstDataSet(e):this.createPieDataSet(e,s);else if(i==="scatter")s.forEach(a=>{const r=this.seriesList[a],c=e[a],d=r==null?void 0:r.passingValue;r&&c&&(r.data=this.addSeriesDSforScatter(c),r.minMax=this.getSeriesMinMax(r.data,d))});else if(i==="heatMap")s.forEach(a=>{const r=this.seriesList[a],c=r==null?void 0:r.passingValue,d=e[a];r&&d&&(r.labels=t,r.data=this.addSeriesDSForHeatMap(d),r.minMax=this.getSeriesMinMax(r.data,c),r.valueOpt=this.getSeriesValueOptForHeatMap(r))});else{const a=s[0],r=(l=this.seriesList[a])==null?void 0:l.passingValue,c=new Map;for(let d=0;d<s.length;d++){const h=s[d],u=this.seriesList[h];if(u&&u.show!==!1){const f=e==null?void 0:e[h],{passingValue:m,interpolation:g}=u,p=g==="zero"||m!=null&&m!==void 0;let y=!1,C;if(!f)C=f;else if(!p)C=f;else{C=new Array(f.length);for(let b=0;b<f.length;b++){const k=f[b];g==="zero"&&!k?C[b]=0:k===m?(y=!0,C[b]=null):C[b]=k}}if(u.hasPassingValueInData=y,C){const b=u.isExistGrp&&!u.isOverlapping;let k=null;b&&(k=c.get(u.groupIndex),k||(k={pos:[],neg:[]},c.set(u.groupIndex,k))),b&&u.stackIndex?u.data=this.addSeriesStackDS(C,t,u.stackIndex,k,u.data):u.data=this.addSeriesDS(C,t,u.isExistGrp,r,u.data),u.minMax=this.getSeriesMinMax(u.data,u.passingValue),b&&this.updateStackTops(k,u)}}}}}),(n=this.buildLabelValidMask)==null||n.call(this)},createRealTimeScatterDataSet(e){var l,a,r,c;const t=this.prunedRealTimeScatterSeries;let n=t!=null&&t.size?Object.keys(e).filter(d=>!t.has(d)):Object.keys(e);n.length||(n=Object.keys(this.dataSet));const i={maxY:-1/0,minY:1/0,fromTime:0,toTime:0},s={fromTime:0,toTime:0};for(let d=0;d<n.length;d++){const h=n[d],u=e[h],f=u==null?void 0:u.length;if(!this.isInit||this.updateSeries||!this.dataSet[h]){const R={dataGroup:[],startIndex:0,endIndex:null,length:0,fromTime:0,toTime:0,lastDataTime:0};this.dataSet[h]={...R,...this.dataSet[h]}}const m=this.dataSet[h],g=m.dataGroup,p=this.options.realTimeScatter.range||300,y=m.length!==p;m.length=p;const C=m.length;let b=0;for(let R=0;R<f;R++){const X=u[R];X&&b<X.x&&(b=X.x)}b=b?Math.floor(b/1e3)*1e3:0;const k=((r=(a=(l=g.at(-1))==null?void 0:l.data)==null?void 0:a.at(-1))==null?void 0:r.x)||Date.now(),L=Math.floor(k/1e3)*1e3,w=m.toTime||L;let M=w;b&&(M=b<m.lastDataTime-C*1e3?b:Math.max(b,m.lastDataTime),m.lastDataTime=M);const V=R=>{R.data.length=0,R.dataKeys?R.dataKeys.clear():R.dataKeys=new Set,R.max=0,R.min=1/0};if(m.endIndex==null||y){m.startIndex=0,m.endIndex=C-1,g.length=C;for(let R=0;R<C;R++)g[R]=g[R]||{data:[],dataKeys:new Set,max:0,min:1/0},V(g[R]);m.toTime=M,m.fromTime=m.toTime-C*1e3}const S=(M-w)/1e3,x=Number.isFinite(S)?Math.max(0,Math.floor(S)):0;m.toTime=M,m.fromTime=m.toTime-C*1e3;for(let R=0;R<C;R++)g[R]?g[R].data?g[R].dataKeys||(g[R].dataKeys=new Set):(g[R].data=[],g[R].dataKeys=new Set,g[R].max=0,g[R].min=1/0):g[R]={data:[],dataKeys:new Set,max:0,min:1/0};if(x>0)if(x>=C){for(let R=0;R<C;R++)V(g[R]);m.startIndex=0,m.endIndex=C-1}else{let R=m.startIndex,X=m.endIndex;for(let G=0;G<x;G++)V(g[R]),R=(R+1)%C,X=(X+1)%C;m.startIndex=R,m.endIndex=X}const I=this.options.coordinateDedupe!==!1;let T=-1;for(let R=0;R<f;R++){const X=u[R];if(X){const G=Math.floor(X.x/1e3)*1e3;if(m.fromTime<=G){let N=m.endIndex-(m.toTime-G)/1e3;N<0&&(N=C+N);const P=g[N],B=A.coordinateKey(X.x,X.y);if(!(I&&P.dataKeys.has(B))){I&&P.dataKeys.add(B),P.data.push({x:X.x,y:X.y,o:X.value??X.y,color:X.color,k:I&&this.seriesInfo.charts.scatter.length>1?B:void 0}),P.max=Math.max(P.max,X.y),P.min=Math.min(P.min,X.y);const D=(m.toTime-G)/1e3;D>T&&(T=D)}}}}m.lastTick={seq:(((c=m.lastTick)==null?void 0:c.seq)??0)+1,gapCount:x,prevToTime:w,toTime:m.toTime,length:C,startIndex:m.startIndex,endIndex:m.endIndex,maxDirtyAge:T};const v=1e3,E={maxY:-1/0,minY:1/0};for(let R=0;R<C;R++){const X=g[R];for(let G=0;G<X.data.length;G++){const N=X.data[G],P=Math.floor(N.x/v)*v;P>=m.fromTime&&P<=m.toTime&&Number.isFinite(N.y)&&(N.y>E.maxY&&(E.maxY=N.y),N.y<E.minY&&(E.minY=N.y))}}Number.isFinite(E.minY)&&(i.maxY=Math.max(i.maxY,E.maxY),i.minY=Math.min(i.minY,E.minY));const W=m.lastDataTime?i:s;m.toTime>W.toTime&&(W.toTime=m.toTime,W.fromTime=m.fromTime)}i.toTime||(i.toTime=s.toTime,i.fromTime=s.fromTime),Number.isFinite(i.minY)||(i.minY=0,i.maxY=0),this.pruneExpiredRealTimeScatterSeries(e),this.seriesInfo.charts.scatter.forEach(d=>{const h=this.seriesList[d];h.data=this.dataSet,h.minMax={minX:We(i.fromTime+1e3),minY:i.minY,maxX:We(i.toTime),maxY:i.maxY}}),sl()&&FC(this,i.fromTime+1e3,i.toTime)},pruneExpiredRealTimeScatterSeries(e){var d,h,u,f;const t=this.dataSet,n=Object.keys(t);if(!n.length)return;let i=0,s=0;for(let m=0;m<n.length;m++){const g=t[n[m]],p=g.toTime||0;g.lastDataTime?i=Math.max(i,p):s=Math.max(s,p)}i||(i=s);const l=((d=this.options.realTimeScatter)==null?void 0:d.range)||300,a=i-(l-1)*1e3,r=[];for(let m=0;m<n.length;m++){const g=n[m],y=t[g].toTime<a,C=!((h=e[g])!=null&&h.length);y&&C&&r.push(g)}if(!r.length)return;for(let m=0;m<r.length;m++)this.removeRealTimeScatterSeries(r[m]);const c=this.options.legend;c!=null&&c.show&&(c!=null&&c.external)?(u=this.emitLegendData)==null||u.call(this):c!=null&&c.show&&((f=this.updateLegend)==null||f.call(this))},removeRealTimeScatterSeries(e){var i,s,l,a,r,c;delete this.dataSet[e],(i=this.seriesList)!=null&&i[e]&&delete this.seriesList[e];const t=(l=(s=this.seriesInfo)==null?void 0:s.charts)==null?void 0:l.scatter;if(Array.isArray(t)){const d=t.indexOf(e);d!==-1&&t.splice(d,1)}(a=this._updateSeriesCount)==null||a.call(this),(this.prunedRealTimeScatterSeries??(this.prunedRealTimeScatterSeries=new Set)).add(e);const n=(r=this.defaultSelectInfo)==null?void 0:r.seriesId;if(Array.isArray(n)){const d=n.indexOf(e);d!==-1&&n.splice(d,1)}((c=this.defaultSelectItemInfo)==null?void 0:c.seriesID)===e&&(this.defaultSelectItemInfo=null)},resetRealTimeScatterDataSet(){Object.values(this.dataSet??{}).forEach(e=>{e.dataGroup=[],e.lastDataTime=0})},createSunburstDataSet(e){this.pieDataSet=[];const t=this.pieDataSet,n=[];for(let i=0;i<e.length;i++){const s=e[i],l=this.seriesList[s.id];let a=!1;if(t[0]||(t[0]={ir:0,or:0,total:0,data:[]}),l.show){if(t[0].total+=s.value||0,t[0].data.push({parent:"$ev-root",id:s.id,value:s.value,sa:0,ea:0}),s.children)for(let r=0;r<s.children.length;r++)this.seriesList[s.children[r].id].show&&(a=!0),n.push({parent:s.id,data:s.children[r],depth:1});else{const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}if(!a){const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}}}for(t[0].data.sort((i,s)=>s.value-i.value);n.length;){const i=n.shift(),s=i.parent,l=i.data,a=i.depth;let r=!1;t[a]||(t[a]={ir:0,or:0,total:{},data:[]}),t[a].total[s]||(t[a].total[s]=0);const c=this.seriesList[l.id];if(l.id==="dummy")t[a].data.push({parent:s,id:"dummy",value:l.value,sa:0,ea:0}),t[a].total[s]+=l.value;else if(c&&c.show){if(t[a].data.push({parent:s,id:l.id,value:l.value,sa:0,ea:0}),t[a].total[s]+=l.value,l.children)for(let d=0;d<l.children.length;d++)this.seriesList[l.children[d].id].show&&(r=!0),n.push({parent:l.id,data:l.children[d],depth:a+1});else{const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}if(!r){const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}}t[a].data.sort((d,h)=>h.value-d.value)}},createPieDataSet(e,t){this.pieDataSet=[];const n=this.pieDataSet;n[0]={data:[],ir:0,or:0,total:0},t.forEach(i=>{if(this.seriesList[i].show){const s=e[i][0]??0;n[0].total+=s,n[0].data.push({id:i,value:s,sa:0,ea:0})}}),n.forEach(i=>{i.data.sort((s,l)=>l.value-s.value)})},addSeriesStackDS(e,t,n=0,i=null,s){const l=this.options.horizontal,a=[],r=i==null?void 0:i.pos,c=i==null?void 0:i.neg,d=Array.isArray(s)?s:null;return e.forEach((h,u)=>{let f=(h>=0?r==null?void 0:r[u]:c==null?void 0:c[u])??0,m=h,g=t[u],p=h;if(f!=null&&g!=null){p&&typeof p=="object"&&("x"in p||"y"in p)&&(m=l?h.x:h.y,g=l?h.y:h.x);const y=(m==null?void 0:m.value)??m;n>0?y!=null?p=f+y:p=m:(f=0,p=y);const C=d&&d[a.length];a.push(this.addData(p,g,m,f,C||null))}}),a},updateStackTops(e,t){if(!t.show)return;const n=this.options.horizontal,i=t.passingValue,s=!A.isNullOrUndefined(i),l=t.data,a=e.pos,r=e.neg;for(let c=0;c<l.length;c++){const d=l[c],h=n?d.x:d.y,u=d.o,f=s&&u===i;h!=null&&!f&&(u>=0?a[c]=h:r[c]=h)}},addSeriesDS(e,t,n,i,s){const l=this.options.horizontal,a=[],r=n&&!A.isNullOrUndefined(i),c=Array.isArray(s)?s:null;for(let d=0;d<e.length;d++){let h=e[d],u=t[d];if(h&&typeof h=="object"&&(h.x||h.y)&&(h=l?h.x:h.y,u=l?e[d].y:e[d].x),u!==null){const f=r&&h===i?0:h;if(f!==null&&typeof f=="object"||h!==null&&typeof h=="object")a.push(this.addData(f,u,h));else{const m=f??null,g=h??null,p=c&&c[a.length];p&&typeof p=="object"?(p.x=l?m:u,p.y=l?u:m,p.o=g,p.b=null,p.xp=null,p.yp=null,p.w=null,p.h=null,p.dataColor=null,p.dataTextColor=null,a.push(p)):a.push(l?{x:m,y:u,o:g,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null}:{x:u,y:m,o:g,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null})}}}return a},addSeriesDSforScatter(e){return e.map(t=>{const n=t.x,i={value:t.y,color:(t==null?void 0:t.color)||null};return this.addData(i,n,i)})},addSeriesDSForHeatMap(e){return e.map(({x:t,y:n,value:i,color:s=null})=>({x:t,y:n,o:i,xp:null,yp:null,w:null,h:null,dataColor:s,cId:null}))},addData(e,t,n=null,i=null,s=null){let l=null,a=null,r=null,c=null,d=null;e!==null&&typeof e=="object"?(l=e.value,r=e.color,d=e.textColor):l=e??null,n!==null&&typeof n=="object"?(a=n.value,c=n.color):a=n??null;const h=s||{};return this.options.horizontal?(h.x=l,h.y=t):(h.x=t,h.y=l),h.o=a,h.b=i,h.xp=null,h.yp=null,h.w=null,h.h=null,h.dataColor=r??c,h.dataTextColor=d,h},getSeriesMinMax(e,t){const n={minX:null,minY:null,maxX:null,maxY:null,maxDomain:null},i=this.options.horizontal;if(e.length){const s=!A.isNullOrUndefined(t),l={minX:e[0].x,minY:e[0].y,maxX:e[0].x,maxY:e[0].y,maxDomain:i?e[0].y:e[0].x,maxDomainIndex:0};for(let a=0;a<e.length;a++){const r=e[a],c=r.x,d=r.y,h=r.o;(!s||h!==t)&&(c<=l.minX&&(l.minX=c===null?0:c),d<=l.minY&&(l.minY=d===null?0:d),c>=l.maxX&&(l.maxX=c===null?0:c,i&&c!==null&&(l.maxDomain=d,l.maxDomainIndex=a)),d>=l.maxY&&(l.maxY=d===null?0:d,!i&&d!==null&&(l.maxDomain=c,l.maxDomainIndex=a)))}return l}return n},getVisibleWindowMaxSeries(e,t){var l;if(!Number.isFinite(e)||!Number.isFinite(t)||t<e)return null;const n=this.options.horizontal;let i=null;const s=Object.keys(this.seriesList);for(let a=0;a<s.length;a+=1){const r=this.seriesList[s[a]];if(r!=null&&r.show&&((l=r.data)!=null&&l.length)){const c=Math.max(0,e),d=Math.min(r.data.length-1,t);for(let h=c;h<=d;h+=1){const u=r.data[h],f=n?u==null?void 0:u.x:u==null?void 0:u.y;Number.isFinite(f)&&(!i||f>i.value)&&(i={sId:r.sId,value:f,index:h,domain:n?u==null?void 0:u.y:u==null?void 0:u.x})}}}return i},getSeriesValueOptForHeatMap(e){const{data:t,colorState:n,isGradient:i}=e,s=this.options.heatMapColor,l=s.colorsByRange.length||s.rangeCount,a=s.decimalPoint;let r,c=0,d=!1;t.forEach(({o:u})=>{c<u&&(c=Math.max(c,u)),u<0?d=!0:r===void 0?r=u:r=Math.min(r,u)}),d&&!i&&n.length===l&&n.push({id:`color#${l}`,color:s.error,state:"normal",label:"Error",show:!0});let h=c>r?Math.floor((c-r)/l):1;return c-r<=l&&(a>0?h=+((c-r)/l).toFixed(a):h=1),{min:r,max:c,interval:h,existError:d,decimalPoint:a}},getItemByLabelIndex(e){if(e<0)return!1;const t=Object.keys(this.seriesList),n=!!this.options.horizontal;let i=null,s=null,l=null,a="",r=0,c=!1,d=!1;if(e>-1){for(let h=0;h<t.length;h++){const u=t[h],f=this.seriesList[u],m=f.data[e];if(m&&f.show&&f.showLegend){const g=n?m.y:m.x,p=n?m.yp:m.xp;if(g!=null){const y=n?m.o||m.x:m.o||m.y;f.stackIndex?(r+=isNaN(m.o)?0:m.o,c=!0):r+=m.y,(l===null||l<=y)&&(l=y,a=u,i=g,s=p)}}}d={label:i,pos:s,value:l===null?0:l,sId:a,acc:r,useStack:c,maxIndex:e}}return d},getItem(e,t=!1){const{seriesID:n,dataIndex:i}=e;let s;if("seriesID"in e){const l=this.getDataByValues(n,i);if(!l||!(l!=null&&l.xp)||!(l!=null&&l.yp))return null;s=[this.getHitItemByPosition([l.xp,l.yp],t,i,!0)]}else{const l=Object.entries(this.seriesList);let a;for(let r=0;r<l.length;r++){const[c,d]=l[r];if(d.show){a=c;break}}s=i==null?void 0:i.map(r=>{var h,u;const c=this.getDataByValues(a,r);if(!c)return null;const d=this.getHitItemByPosition([(c==null?void 0:c.xp)??0,(c==null?void 0:c.yp)??0],t,r,!0);return d&&!d.sId&&(d.sId=a,d.label=((u=(h=this.data)==null?void 0:h.labels)==null?void 0:u[r])??d.label,d.dataIndex=r),d})}return s},getDataByValues(e,t){const n=this.seriesList[e];return!n||isNaN(t)||t<0||(n==null?void 0:n.data.length)<=t?!1:n.data[t]},getHitItemByPosition(e,t=!1,n,i=!1,s=!1){var v;const l=Object.keys(this.seriesList),a=!!this.options.horizontal,[r,c]=e;let d=n;if(d===void 0&&!t){const E=l.find(Z=>{var R;const W=this.seriesList[Z];return(W==null?void 0:W.show)&&((R=W==null?void 0:W.data)==null?void 0:R.length)>0});if(E){const Z=this.seriesList[E].data,W=a?e[1]:e[0];let R=1/0,X=-1;for(let G=0;G<Z.length;G++){const N=s||l.some(B=>{var D,Y,F,O;const z=this.seriesList[B];return(z==null?void 0:z.show)&&((Y=(D=z.data)==null?void 0:D[G])==null?void 0:Y.o)!==null&&((O=(F=z.data)==null?void 0:F[G])==null?void 0:O.o)!==void 0}),P=Z[G];if(N&&P){let B;if(a?B=P.h?P.yp+P.h/2:P.yp:B=P.w?P.xp+P.w/2:P.xp,B!=null){const z=Math.abs(W-B);z<R&&(R=z,X=G)}}}X!==-1&&(d=X)}}let h=null,u=null,f=null,m=null,g="",p=null,y=1/0,C=!1,b=null,k=null,L=null,w=null,M="",V=null,S=1/0,x=0,I=!1;for(let E=0;E<l.length;E++){const Z=l[E],W=this.seriesList[Z],R=t?W.findApproximateData:W.findGraphData;if(R){const X=R.call(W,e,a,d,i),G=X.data,N=X.index;if(G)if(A.isPieType(X.type))h=X.type,u=Z,g=Z,f=(G.ea-G.sa)/2,m=G.o,p=G.index;else{const P=a?G.y:G.x,B=a?G.yp:G.xp;if(P!=null){const z=a?G.o||G.x:G.o||G.y;W.stackIndex!=null?(x+=isNaN(G.o)?0:G.o,I=!0):x+=G.y;const D=z!=null&&!Number.isNaN(z),Y=G.xp!==null&&G.xp!==void 0&&G.yp!==null&&G.yp!==void 0;if(D&&Y){const F=A.calcBoxDistance(G,r,c);(M===""||F<S)&&(S=F,b=W.type,k=P,L=B,w=z,M=Z,V=N)}else D&&M===""&&(b=W.type,k=P,L=B,w=z,M=Z,V=N);if(X.hit&&G.xp!==void 0&&G.yp!==void 0){const F=(G.xp-e[0])**2+(G.yp-e[1])**2;X.directHit?((!C||F<y)&&(y=F,h=W.type,u=P,f=B,m=z,g=Z,p=N),C=!0):C||F<y&&(y=F,h=W.type,u=P,f=B,m=z,g=Z,p=N)}}}}}if(s&&g===""&&M===""&&d!==void 0&&d>=0){const E=l.find(W=>{var X;const R=this.seriesList[W];return(R==null?void 0:R.show)&&((X=R==null?void 0:R.data)==null?void 0:X.length)>0}),Z=E?(v=this.seriesList[E].data)==null?void 0:v[d]:null;Z&&(k=a?Z.y:Z.x,V=d)}const T=g!=="";return{type:T?h:b,label:T?u:k,pos:T?f:L,value:T?m:w,sId:T?g:M,acc:x,useStack:I,dataIndex:T?p:V}},getLabelInfoByPosition(e,t){var p,y,C;const[n,i]=e,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=this.data.series,a=((p=Object.values(l).sort((b,k)=>k.pointSize??0-b.pointSize??0)[0])==null?void 0:p.pointSize)??3,{horizontal:r,selectLabel:c}=this.options;let d,h;t==="xAxis"?(d=this.axesX[0],h=this.scrollbar.x):t==="yAxis"?(d=this.axesY[0],h=this.scrollbar.y):(d=r?this.axesY[0]:this.axesX[0],h=r?this.scrollbar.y:this.scrollbar.x);const u=s[d.units.rectStart],f=s[d.units.rectEnd];let m,g;if(h!=null&&h.use&&((y=d==null?void 0:d.labels)!=null&&y.length)){const{type:b,range:k,interval:L=1}=h,[w,M]=k??[0,d.labels.length],V=Math.floor((+M-+w)/L)+1,S=(f-u)/V,I=Math.floor(((t==="yAxis"||r?i:n)-u)/S);b==="step"?m=w+I:m=(d==null?void 0:d.labels.findIndex(v=>v===+w))+I}else if((C=d==null?void 0:d.labels)!=null&&C.length){const b=(f-u)/d.labels.length,L=Math.floor(((t==="yAxis"?i:n)-u)/b);m=d.labels.length>L?L:-1}else{let b,k;n<u-a?(b=u,k=0):n>f+a?(b=f,k=this.data.labels.length-1):b=n,g=this.getHitItemByPosition([b,i],c==null?void 0:c.useApproximateValue,k,!0,!0),m=g.dataIndex??-1}return{labelIndex:m,hitInfo:g}},getCurMouseLabelVal(e,t,n){const{type:i,horizontal:s}=this.options,l=e==="xAxis",a=l?"x":"y";let r="",c=-1;const d=()=>{let u="";switch(i){case"bar":case"line":{u=s&&!l||!s&&l?this.data.labels[n]:"";break}case"heatMap":{u=this.data.labels[a][n];break}}return u},h=()=>{let u="";const f={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},{steps:m,interval:g,graphMin:p}=this.axesSteps[a][0],{width:y,height:C}=this.axesRange[a][0].size,b=l?this.axesX:this.axesY,k=f[b[0].units.rectStart],L=f[b[0].units.rectEnd],w=Math.abs(t[l?0:1]-k),M=(l?y:C)/2,V=Math.abs(k-L)/m,S=Math.floor((w+M)/V);return V*S+M>w&&V*S-M<w&&(u=S*g+p),u};return typeof n=="number"&&(r=d(),c=n),r||(r=h(),c=-1),{labelVal:r,labelIdx:c}},getStoreMinMax(){const e=Object.keys(this.seriesList),t=this.options.horizontal,n={x:[{min:null,max:null}],y:[{min:null,max:null}]};return e.length?e.reduce((i,s)=>{const l=i,a=this.seriesList[s],r=a.minMax,c=a.xAxisIndex,d=a.yAxisIndex;if(l.x[c]||(l.x[c]={min:null,max:null,maxSID:null}),l.y[d]||(l.y[d]={min:null,max:null,maxSID:null}),r&&a.show){t?((l.x[c].min===null||r.minX!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),r.minY!==null&&(l.y[d].min===null||r.minY!==null&&r.minY<l.y[d].min)&&(l.y[d].min=r.minY)):(r.minX!==null&&(l.x[c].min===null||r.minX!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),(l.y[d].min===null||r.minY!==null&&r.minY<l.y[d].min)&&(l.y[d].min=r.minY));const h=this.seriesList[s].isExistGrp,u=l.x[c].max<0;(h&&u||!l.x[c].max||r.maxX>=l.x[c].max)&&(l.x[c].max=r.maxX,l.x[c].maxSID=s);const f=l.y[d].max<0;(h&&f||!l.y[d].max||r.maxY>=l.y[d].max)&&(l.y[d].max=r.maxY,l.y[d].maxSID=s)}return l},{x:[{min:null,max:null,maxSID:null}],y:[{min:null,max:null,maxSID:null}]}):n},calculateAngle(){const e=this.pieDataSet;let t,n,i,s,l,a,r,c,d;const h=[],u={"$ev-root":1.5*Math.PI};for(let f=0;f<e.length;f++){const m=e[f];d=!0;for(let g=0;g<m.data.length;g++)if(t=m.data[g],n=t.value,d&&(d=t.id==="dummy"),!f)a=u["$ev-root"],l=2*Math.PI*(n/m.total),r=a+l,t.sa=a,t.ea=r,u["$ev-root"]+=l;else{if(i=this.getParentInfo(f-1,t.parent),!i)break;u[t.parent]||(u[t.parent]=i.sa),a=u[t.parent],c=i.ea-i.sa,s=m.total[t.parent]||0,l=c*(n/s),r=a+l,t.sa=a,t.ea=r,u[t.parent]+=l}d&&h.push(f)}for(let f=0;f<h.length;f++)this.pieDataSet.splice(h,1);this.options.reverse&&(this.pieDataSet=zb(this.pieDataSet))},getParentInfo(e,t){for(let n=e;n>=0;n--){const i=this.pieDataSet[n];for(let s=0;s<i.data.length;s++)if(i.data[s].id===t)return i.data[s]}return null},getAggregations(){const e=this.data.data,t=this.data.series,n={},i=Object.keys(t);return i==null||i.forEach(s=>{const l=e[s].map(f=>f!=null&&f.value?f.value:f),a=l[l.length-1],r=l.filter(f=>f!=null),c=Math.min(...r),d=Math.max(...r),h=r.reduce((f,m)=>f+m,0),u=h/r.length||0;(!A.checkSafeInteger(c)||!A.checkSafeInteger(d)||!A.checkSafeInteger(u)||!A.checkSafeInteger(h)||!A.checkSafeInteger(a))&&console.warn("[EVUI][Chart] The aggregated value exceeds 9007199254740991 or less than -9007199254740991."),n[s]={min:c,max:d,avg:u,total:h,last:a}}),n}},JC={x:{rectStart:"x1",rectEnd:"x2",rectOffsetCounter:e=>e==="top"?"y2":"y1",rectOffset:e=>e==="top"?"y1":"y2"},y:{rectStart:"y2",rectEnd:"y1",rectOffsetCounter:e=>e==="left"?"x2":"x1",rectOffset:e=>e==="left"?"x1":"x2"}},_t=["#2b99f0","#8ac449","#00C4C5","#ffde00","#ff7781","#8470ff","#75cd8e","#48d1cc","#fec64f","#fe984f","#0052ff","#00a48c","#83cfde","#dfe32d","#ff7d40","#99c7ff","#a5fee3","#0379c9","#eef093","#ffa891","#00c5cd","#009bc7","#cacaff","#ffc125","#df6264"],wi={show:!0,highlight:{defaultSize:4,maxSize:6,maxShadowSize:10,maxShadowOpacity:.4},xAxisIndex:0,yAxisIndex:0,point:!0,pointHighlight:!0,pointSize:3,pointStyle:"",lineWidth:2,fill:!1,fillOpacity:.4,showLegend:!0,passingValue:null,interpolation:"none"},jC={show:!0,highlight:{pointSize:5},xAxisIndex:0,yAxisIndex:0,category:!0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:null}},QC={show:!0,showLegend:!0,stroke:{show:!0,color:"#FFFFFF",lineWidth:2},showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null}},fc={min:null,max:null,autoScaleRatio:null,startToZero:!1,showAxis:!0,axisLineColor:"#C9CFDC",axisLineWidth:1,showGrid:!0,gridLineColor:"#C9CFDC",showAxisTick:!0,showIndicator:!1,timeFormat:"mm:ss",range:null,interval:null,decimalPoint:"auto",fixedSteps:!1,scaleChange:!1,labelStyle:{show:!0,fontSize:12,color:"#25262E",fontFamily:"Roboto",fontWeight:400,fitWidth:!1,fitDir:"right",alignToGridLine:!1,padding:0,fixWidth:void 0},showLastLabel:!1,lastLabelFontStyle:null,firstLabelFontStyle:null,title:{use:!1,text:null,fontWeight:400,fontSize:12,fontFamily:"Roboto",textAlign:"right",fontStyle:"normal",color:"#808080"},scrollbar:{use:!1,width:14,height:14,background:"#F2F2F2",showButton:!0,thumbStyle:{background:"#929292",radius:0}}},mc={show:!1,fontSize:12,fontColor:"#FF0000",fillColor:"#FFFFFF",lineColor:"#FF0000",lineWidth:0,fontWeight:400,fontFamily:"Roboto",verticalAlign:"middle",textAlign:"center",textOverflow:"none",maxWidth:null,text:null,borderRadius:0,gap:null,padding:null,pointer:{show:!1,color:null},position:"outside",showValue:!1,valueFormatter:null,responsive:{valueOnlyBelow:null,hideBelow:null},showTextOnHover:{use:!1,backgroundColor:"#4C4C4C",fontColor:"#FFFFFF",borderColor:null,borderRadius:4,fontSize:12,fontWeight:400,fontFamily:"Roboto",useShadow:!1,shadowOpacity:.25,padding:{top:4,right:8,bottom:4,left:8}}},cl={color:"#FF0000",lineWidth:1,label:mc},dl={color:"#FAE59D",border:null},$C={show:!0,xAxisIndex:0,yAxisIndex:0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:0},highlight:{stroke:{use:!1,color:null,width:1,radius:0},shadow:{use:!0,offsetX:0,offsetY:0,blur:4,color:"#959494"}}},Tt={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:26784e5,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},qC=Object.freeze([1,2,5]),pc=["cross","crossRot","star","line"],te={calculateX(e,t,n,i,s=0){if(e==null||e>n||e<t)return null;const l=i/(n-t);return Math.ceil(s+l*(e-t))},calculateSubX(e,t,n,i,s=0){if(e==null)return null;const l=i/(n-t);return Math.ceil(s+l*(e-t))},calculateY(e,t,n,i,s=0){let l;if(e==null||e>n||e<t)return null;const a=i/(n-t);return s?l=s-a*(e-(t||0)):l=-(a*(e-(t||0))),Math.floor(l)},drawPoint(e,t,n,i,s){if(!(isNaN(n)||n<=0)){if(t==="rect"){const l=1/Math.SQRT2*n;e.fillRect(i-l,s-l,2*l,2*l),e.strokeRect(i-l,s-l,2*l,2*l);return}e.beginPath(),this._appendPointPath(e,t,n,i,s),pc.includes(t)||e.fill(),e.stroke()}},_appendPointPath(e,t,n,i,s){let l,a,r,c,d,h,u,f,m;switch(t){case"triangle":l=3*n/Math.sqrt(3),c=l*Math.sqrt(3)/2,e.moveTo(i-l/2,s+c/3),e.lineTo(i+l/2,s+c/3),e.lineTo(i,s-2*c/3),e.closePath();break;case"rectRounded":h=n/Math.SQRT2,u=i-h,f=s-h,m=Math.SQRT2*n,this.roundedRect(e,u,f,m,m,n/2),e.closePath();break;case"rectRot":d=1/Math.SQRT2*n,e.moveTo(i-d,s),e.lineTo(i,s+d),e.lineTo(i+d,s),e.lineTo(i,s-d),e.closePath();break;case"cross":e.moveTo(i,s+n),e.lineTo(i,s-n),e.moveTo(i-n,s),e.lineTo(i+n,s),e.closePath();break;case"crossRot":a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,e.moveTo(i-a,s-r),e.lineTo(i+a,s+r),e.moveTo(i-a,s+r),e.lineTo(i+a,s-r),e.closePath();break;case"star":e.moveTo(i,s+n),e.lineTo(i,s-n),e.moveTo(i-n,s),e.lineTo(i+n,s),a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,e.moveTo(i-a,s-r),e.lineTo(i+a,s+r),e.moveTo(i-a,s+r),e.lineTo(i+a,s-r),e.closePath();break;case"line":e.moveTo(i-n,s),e.lineTo(i+n,s),e.closePath();break;default:e.moveTo(i+n,s),e.arc(i,s,n,0,Math.PI*2);break}},drawPointBatch(e,t,n,i){if(!(isNaN(n)||n<=0||!i||!i.length)){if(t==="rect"){const s=1/Math.SQRT2*n;for(let l=0;l<i.length;l++)e.fillRect(i[l].xp-s,i[l].yp-s,2*s,2*s),e.strokeRect(i[l].xp-s,i[l].yp-s,2*s,2*s);return}e.beginPath();for(let s=0;s<i.length;s++)this._appendPointPath(e,t,n,i[s].xp,i[s].yp);pc.includes(t)||e.fill(),e.stroke()}},roundedRect(e,t,n,i,s,l){const a=Math.PI,r=a/2;if(l){const c=Math.min(l,s/2,i/2),d=t+c,h=n+c,u=t+i-c,f=n+s-c;e.moveTo(t,h),d<u&&h<f?(e.arc(d,h,c,-a,-r),e.arc(u,h,c,-r,0),e.arc(u,f,c,0,r),e.arc(d,f,c,r,a)):d<u?(e.moveTo(d,n),e.arc(u,h,c,-r,r),e.arc(d,h,c,r,a+r)):h<f?(e.arc(d,h,c,-a,0),e.arc(d,f,c,0,a)):e.arc(d,h,c,-a,a),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,i,s)},createGradient(e,t,n,i,s,l){const{x:a,y:r,w:c,h:d}=n;let h;t?h=e.createLinearGradient(a,0,a+c,0):h=e.createLinearGradient(0,r,0,r+d);for(let u=0;u<i.length;u++){const f=i[u][0]??0,m=i[u][1]??"rgba(255, 255, 255, 0)",g=m.includes("rgba")?A.getOpacity(m):1,p=s?l:g;h.addColorStop(f,A.colorStringToRgba(m,p))}return h}},e1=new Set(["triangle","rect","rectRounded","rectRot","cross","crossRot","star","line"]),gc=Math.PI*2;class t1{constructor(t,n,i){const s=Pe({},n,wi);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${i}`),["color","pointFill","fillColor"].forEach(l=>{this[l]===void 0&&(this[l]=l==="pointFill"?this.color:_t[i%_t.length])}),this.type="line",this.sId=t,this.extent={downplay:{opacity:.3,lineWidth:1},normal:{opacity:1,lineWidth:1},highlight:{opacity:1,lineWidth:2}},this.data=[],this.beforeMouseXp=0,this.beforeMouseYp=0,this.beforeFindItemIndex=-1,this.size={comboOffset:0}}useLinearInterpolation(){return this.interpolation==="linear"||this.interpolation==="none"&&!!this.passingValue&&this.hasPassingValueInData}_getValidGData(){const t=this.data,n=this._validGDataCache;if(n&&n.src===t&&n.length===t.length)return n.value;const i=t.filter(s=>!A.isNullOrUndefined(s.x));return this._validGDataCache={src:t,length:t.length,value:i},i}computeGeometry(t){if(!this.show)return;const n=t.scaleVersion!=null&&t.dataEpoch!=null;if(n&&this._lastDataEpoch===t.dataEpoch&&this._lastScaleVersion===t.scaleVersion&&this._lastGeomData===this.data)return;const{chartRect:i,labelOffset:s,axesSteps:l,displayOverflow:a}=t,r=this.useLinearInterpolation();let c=0;const d=l.x[this.xAxisIndex],h=l.y[this.yAxisIndex];let u=i.chartWidth-(s.left+s.right);const f=i.chartHeight-(s.top+s.bottom);this.combo&&(c=u/(this.data.length||1),u-=c,this.size.comboOffset=c);const m=i.x1+s.left+c/2,g=i.y2-s.bottom,p=d.graphMin,y=d.graphMax,C=h.graphMin,b=h.graphMax,k=u/(y-p),L=f/(b-C),w=C||0,M=S=>S==null||S<p||S>y?null:Math.ceil(m+k*(S-p)),V=S=>{const x=a&&S>b?b:S;return x==null||x<C||x>b?null:Math.floor(g?g-L*(x-w):-(L*(x-w)))};for(let S=0;S<this.data.length;S++){const x=this.data[S];let I=M(x.x),T=V(x.y);this.isExistGrp&&r&&x.o===null&&(T=V(x.b??0)),I!==null&&(I+=A.aliasPixel(I)),x.xp=I,x.yp=T}n&&(this._lastDataEpoch=t.dataEpoch,this._lastScaleVersion=t.scaleVersion,this._lastGeomData=this.data)}hasRenderableValue(){return this.data.some(t=>t.o!==null&&t.o!==void 0)}draw(t){var z,D,Y,F,O,H,j,U,Q;if(!this.show)return;const{ctx:n,chartRect:i,labelOffset:s,axesSteps:l,selectLabel:a,selectSeries:r,legendHitInfo:c,isBrush:d,unSelectedOpacity:h,displayOverflow:u}=t;if(this.computeGeometry(t),!this.hasRenderableValue()&&!this.isExistGrp)return;const f=a==null?void 0:a.option,m=(f==null?void 0:f.use)&&(f==null?void 0:f.useSeriesOpacity),g=((z=a==null?void 0:a.selected)==null?void 0:z.dataIndex)??[];let p;if(c)p=this.extent[(c==null?void 0:c.sId)===this.sId?"highlight":"downplay"];else if((D=r==null?void 0:r.option)!=null&&D.use&&((F=(Y=r==null?void 0:r.selected)==null?void 0:Y.seriesId)!=null&&F.length)){const J=(H=(O=r==null?void 0:r.selected)==null?void 0:O.seriesId)==null?void 0:H.includes(this.sId);p=this.extent[J?"highlight":"downplay"]}else m&&g.length?p=this.extent.downplay:p=this.extent.normal;p===this.extent.downplay&&(p={...p,opacity:h});const y=J=>J!=null&&J.includes("rgba")?A.getOpacity(J):p.opacity,C=this.color,b=y(C),k=this.pointFill,L=y(k),w=this.extent.downplay?this.fillOpacity*p.opacity:this.fillOpacity,M=this.lineWidth*p.lineWidth,V=this._rgbaCache||(this._rgbaCache={}),S=(J,ne,q)=>{const ee=V[J];if(ee!==void 0&&ee.s===ne&&ee.o===q)return ee.v;const $=A.colorStringToRgba(ne,q);return V[J]={s:ne,o:q,v:$},$};n.beginPath(),n.save(),n.lineJoin="round",n.lineWidth=M,n.strokeStyle=S("stroke",C,b),this.segments&&n.setLineDash(this.segments);const x=this.useLinearInterpolation();let I=0;const T=l.x[this.xAxisIndex],v=l.y[this.yAxisIndex];let E=i.chartWidth-(s.left+s.right);const Z=i.chartHeight-(s.top+s.bottom);this.combo&&(I=E/(this.data.length||1),E-=I,this.size.comboOffset=I);const W=i.x1+s.left+I/2,R=i.y2-s.bottom,X=J=>te.calculateX(J,T.graphMin,T.graphMax,E,W),G=J=>te.calculateY(u&&J>v.graphMax?v.graphMax:J,v.graphMin,v.graphMax,Z,R);let N,P=null,B=null;for(let J=0;J<this.data.length;J++){const ne=this.data[J],q=ne.xp,ee=ne.yp;x&&ne.o===null||(q===null||ee===null?N=void 0:(Ht(N==null?void 0:N.y)&&!this.isExistGrp||!x&&(Ht(N==null?void 0:N.y)||Ht(ne.o))?(n.moveTo(q,ee),P=q,B=ee):(q!==P||ee!==B)&&(n.lineTo(q,ee),P=q,B=ee),N=ne))}if(n.stroke(),this.segments&&n.setLineDash([]),this.fill&&this.data.length){n.beginPath();const J=this.data.some(ae=>ae.o<0),ne=J?G(0):i.y2-s.bottom,q=S("fill",this.fillColor||C,w);if((j=this.fill)!=null&&j.gradient){let ae=this.data[0].yp,Se=this.data[0].y;this.data.forEach(re=>{re.yp&&re.yp<=ae?ae=re.yp:re.y&&re.y>=Se&&(Se=re.y)});const be=n.createLinearGradient(0,i.y2,0,ae),oe=p.opacity<1?q:C;be.addColorStop(0,J?oe:q),be.addColorStop(.5,q),be.addColorStop(1,oe),n.fillStyle=be}else n.fillStyle=q;let ee=null,$=null;const he=[],fe=this.data.length;for(let ae=0;ae<fe+1;ae++){const Se=(U=this.data[ae])==null?void 0:U.o;if(x&&Ob(Se)||!x&&Ht(Se)){if(ee!==null&&$!==null){let be=ee-1;for(let oe=ae-1;oe>=ee;oe--){const re=(Q=this.data[oe])==null?void 0:Q.o;if(!Ht(re)&&re!==null){be=oe;break}}he.push([ee,be]),ee=null,$=null}}else x&&Se===null||(ee=ee===null?ae:ee),$=ae}he.forEach(([ae,Se])=>{if(ae===Se){const oe=this.data[ae];if(oe.xp===null||oe.yp===null)return;n.moveTo(oe.xp-M,oe.yp),n.lineTo(oe.xp+M,oe.yp),n.lineTo(oe.xp+M,G(oe.b)??ne);return}let be=!1;for(let oe=ae;oe<=Se;oe++){const re=this.data[oe];if(re.xp!==null&&re.yp!==null&&(be?re.o!==null&&n.lineTo(re.xp,re.yp):(n.moveTo(re.xp,re.yp),be=!0)),oe===Se)for(let Te=Se;Te>=ae;Te--){const Ge=this.data[Te],Lt=X(Ge.x);if(Lt!==null&&Ge.o!==null){const Zt=G(Ge.b)??G(0);n.lineTo(Lt,Zt)}}}}),n.fill()}if(!d){n.strokeStyle=S("stroke",C,b);const J=S("focus",k,1),ne=S("blur",k,L);let q=!1;if(this.interpolation==="linear"){let oe=0;for(let re=0;re<this.data.length&&!(this.data[re].o!==null&&(oe++,oe>1));re++);q=oe===1}const ee=g.length?new Set(g):null,$=this.pointSize,he=this.pointStyle,fe=this.data,ae=fe.length,Se=!e1.has(he),be=oe=>{const re=fe[oe];if(re.xp===null||re.yp===null||re.o===null)return 0;let pe;if(q)pe=!0;else if(x)pe=!1;else{const Ge=oe>0?fe[oe-1].o:null,Lt=oe+1<ae?fe[oe+1].o:null;pe=Ge==null&&Lt==null}const Te=ee?ee.has(oe):!1;return this.point||pe||Te?Te&&!c?2:1:0};if(Se){let oe=!1,re=null;for(let pe=0;pe<ae;pe++){const Te=be(pe);if(Te!==0){const Ge=fe[pe];Te===2?(re===null&&(re=[]),re.push(Ge)):(oe||(n.beginPath(),oe=!0),n.moveTo(Ge.xp+$,Ge.yp),n.arc(Ge.xp,Ge.yp,$,0,gc))}}if(oe&&(n.fillStyle=ne,n.fill(),n.stroke()),re!==null){n.beginPath();for(let pe=0;pe<re.length;pe++){const Te=re[pe];n.moveTo(Te.xp+$,Te.yp),n.arc(Te.xp,Te.yp,$,0,gc)}n.fillStyle=J,n.fill(),n.stroke()}}else{let oe=null,re=null;for(let pe=0;pe<ae;pe++){const Te=be(pe);if(Te!==0){const Ge=fe[pe];Te===2?(re===null&&(re=[]),re.push(Ge)):(oe===null&&(oe=[]),oe.push(Ge))}}oe!==null&&(n.fillStyle=ne,te.drawPointBatch(n,he,$,oe)),re!==null&&(n.fillStyle=J,te.drawPointBatch(n,he,$,re))}}n.restore()}itemHighlight(t,n){const i=t.data,s=n,{xp:l,yp:a,o:r}=i;s.save(),l!==null&&a!==null&&r!==null&&this.pointHighlight&&(s.strokeStyle=A.colorStringToRgba(this.color,0),s.fillStyle=A.colorStringToRgba(this.color,this.highlight.maxShadowOpacity),te.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=this.color,te.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",te.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)),s.restore()}findGraphData(t,n,i,s){var f;const l=t[0],a=t[1],r={data:null,hit:!1,color:this.color},c=this._getValidGData(),d=this.useLinearInterpolation(),h=Math.max((this.pointSize??wi.pointSize)+wi.pointSize,wi.highlight.maxSize),u=m=>{if(!m||m.xp===void 0||m.yp===void 0)return!1;const g=l-m.xp,p=a-m.yp;return g*g+p*p<=h*h};if(c!=null&&c.length)if(typeof i=="number"&&this.show){if(r.data=c[i],r.index=i,r.data){const m=c[i];m.o!==null&&m.o!==void 0&&m.yp!==null&&m.yp!==void 0&&(Math.abs(a-m.yp)<=15&&(r.hit=!0),u(m)&&(r.hit=!0,r.directHit=!0))}}else if(typeof this.beforeFindItemIndex=="number"&&this.beforeFindItemIndex!==-1&&this.show&&s)r.data=c[this.beforeFindItemIndex],r.index=this.beforeFindItemIndex;else{let m=1/0,g=-1;const p=[];c.forEach((k,L)=>{k.xp!==null&&k.yp!==null&&k.o!==null&&p.push({...k,originalIndex:L})}),p.length===0&&c.forEach((k,L)=>{p.push({...k,originalIndex:L})});let y=0,C=p.length-1;for(;y<=C;){const k=Math.floor((y+C)/2),L=p[k],w=Math.abs(l-L.xp);if(w<m&&(m=w,g=L.originalIndex),L.xp<l){if(y=k+1,y<p.length){const M=Math.abs(l-p[y].xp);M<m&&(m=M,g=p[y].originalIndex)}}else if(L.xp>l){if(C=k-1,C>=0){const M=Math.abs(l-p[C].xp);M<m&&(m=M,g=p[C].originalIndex)}}else break}const b=p.findIndex(k=>k.originalIndex===g);if(b!==-1)for(let k=Math.max(0,b-2);k<=Math.min(p.length-1,b+2);k++){const L=p[k],w=Math.abs(l-L.xp);w<m&&(m=w,g=L.originalIndex)}if(g!==-1){let k=50;if(c.length>1){const w=[];for(let M=1;M<c.length;M++)c[M].xp!==null&&c[M-1].xp!==null&&w.push(Math.abs(c[M].xp-c[M-1].xp));w.length>0&&(k=w.reduce((M,V)=>M+V,0)/w.length)}const L=Math.max(k,1);if(m<=L)r.data=c[g],r.index=g;else{let w=!1,M=d?1/0:L;const V=d?p:c;for(let S=0;S<V.length;S++){const x=Math.abs(l-V[S].xp);x<=M&&(w=!0,M=x,g=d?V[S].originalIndex:S)}w&&(r.data=c[g],r.index=g)}if(r.data){const w=c[g];Math.abs(a-w.yp)<=15&&(r.hit=!0),u(w)&&(r.hit=!0,r.directHit=!0)}}}return s||(this.beforeMouseXp=l,this.beforeMouseYp=a,typeof r.index=="number"&&(this.beforeFindItemIndex=r.index)),d&&((f=r==null?void 0:r.data)==null?void 0:f.o)===null&&(r.data=null),r}findApproximateData(t){var f,m;const n=t[0],i=t[1],s={data:null,hit:!1,color:this.color},l=this.data.filter(g=>!A.isNullOrUndefined(g.x));if(!l.length)return s;const a=l.length>1?Math.abs(((f=l[1])==null?void 0:f.xp)-((m=l[0])==null?void 0:m.xp)):50,r=Math.max(a*.4,10);let c=0,d=l.length-1,h=-1,u=1/0;for(;c<=d;){const g=Math.floor((c+d)/2),p=l[g].xp;if(p-r<=n&&n<=p+r){const y=Math.max(0,g-2),C=Math.min(l.length-1,g+2);for(let b=y;b<=C;b++)if(l[b].xp!==null&&l[b].yp!==null){const k=Math.sqrt((n-l[b].xp)**2+(i-l[b].yp)**2);k<u&&(u=k,h=b)}return h!==-1&&(s.data=l[h],s.index=h,u<5&&(s.hit=!0)),s}else if(p+r<n){if(g<d&&n<l[g+1].xp){const y=Math.abs(l[g].xp-n),C=Math.abs(l[g+1].xp-n);s.data=y>C?l[g+1]:l[g],s.index=y>C?g+1:g;const b=s.data;return Math.abs(i-b.yp)<10&&(s.hit=!0),s}c=g+1}else{if(g>0&&n>l[g-1].xp){const y=Math.abs(l[g-1].xp-n),C=Math.abs(l[g].xp-n);s.data=y>C?l[g]:l[g-1],s.index=y>C?g:g-1;const b=s.data;return Math.abs(i-b.yp)<10&&(s.hit=!0),s}d=g-1}}return s}findItems({xsp:t,width:n}){const i=t+n;return this.data.filter(s=>t-1<=s.xp&&s.xp<=i+1)}}class n1{constructor(t,n,i,s=!1){const l=Bo({},wi,n);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${i}`),["color","pointFill","fillColor","overflowColor"].forEach(a=>{this[a]===void 0&&(this[a]=_t[i%_t.length])}),this.sId=t,this.data=[],this.type="scatter",this.realTimeScatter=s,this._rtTotalCount=0,this._colorCache=new Map}getCachedColor(t,n){const i=`${t}_${n}`;if(this._colorCache.has(i))return this._colorCache.get(i);const s=A.colorStringToRgba(t,n);if(this._colorCache.size>100){const l=this._colorCache.keys().next().value;this._colorCache.delete(l)}return this._colorCache.set(i,s),s}draw(t){this.show&&(this.computeGeometry(t),this.realTimeScatter?this.realTimeScatterDraw(t):this.defaultScatterDraw(t))}computeGeometry(t){this.show&&(this.realTimeScatter?this.computeRealTimeGeometry(t):this.computeDefaultGeometry(t))}computeDefaultGeometry(t){const{duple:n,legendHitInfo:i,coordinateDedupe:s}=t,l=new Set,a=s!==!1;for(let r=0;r<this.data.length;r++){const c=this.data[r],d=A.coordinateKey(c.x,c.y);let h;i?h=i.sId===this.sId:a?h=n.get(d)===this.sId&&!l.has(d):h=!0,h&&(this.calcItem(c,t),c.xp!==null&&c.yp!==null&&a&&!i&&l.add(d))}}computeRealTimeGeometry(t){var r,c,d,h,u,f;const{duple:n,legendHitInfo:i,coordinateDedupe:s}=t,l=s!==!1;let a=0;for(let m=0;m<((c=(r=this.data[this.sId])==null?void 0:r.dataGroup)==null?void 0:c.length);m++)for(let g=0;g<((h=(d=this.data[this.sId])==null?void 0:d.dataGroup[m])==null?void 0:h.data.length);g++){const p=(f=(u=this.data[this.sId])==null?void 0:u.dataGroup[m])==null?void 0:f.data[g];a++;let y;i?y=i.sId===this.sId:l?y=n.get(A.coordinateKey(p.x,p.y))===this.sId:y=!0,y&&this.calcItem(p,t)}this._rtTotalCount=a}getOpacity(t,n,i){const s=n.includes("rgba")?A.getOpacity(n):1;let l=!1;const{selectInfo:a,legendHitInfo:r,unSelectedOpacity:c}=t;return r?l=r.sId!==this.sId:a&&(l=(a==null?void 0:a.seriesID)!==this.sId||(a==null?void 0:a.dataIndex)!==i),l?c:s}calcItem(t,n){const{chartRect:i,labelOffset:s,axesSteps:l,displayOverflow:a}=n,r=l.x[this.xAxisIndex],c=l.y[this.yAxisIndex],d=i.chartWidth-(s.left+s.right),h=i.chartHeight-(s.top+s.bottom),u=this.realTimeScatter?n.rtXOffsetCss??0:0,f=i.x1+s.left+u,m=i.y2-s.bottom;let g=te.calculateX(t.x,r.graphMin,r.graphMax,d,f);const p=te.calculateY(a&&t.y>c.graphMax?c.graphMax:t.y,c.graphMin,c.graphMax,h,m);g!==null&&!this.realTimeScatter&&(g+=A.aliasPixel(g)),t.xp=g,t.yp=p}defaultScatterDraw(t){const{ctx:n,axesSteps:i,duple:s,legendHitInfo:l,coordinateDedupe:a}=t,r=i.y[this.yAxisIndex],c=new Set,d=a!==!1,h=d&&!l,u=h?new Map:null;for(let f=0;f<this.data.length;f++){const m=this.data[f],g=f,p=A.coordinateKey(m.x,m.y);let y;if(l?y=l.sId===this.sId:d?y=s.get(p)===this.sId&&!c.has(p):y=!0,y&&m.xp!==null&&m.yp!==null){const b=m.y>r.graphMax&&this.overflowColor||m.dataColor||this.color,k=this.getOpacity(t,b,g),L=this.getCachedColor(b,k),w=m.dataColor||this.pointFill,M=this.getOpacity(t,w,g),V=this.getCachedColor(w,M);if(h){const S=`${L} ${V}`;let x=u.get(S);x||(x={strokeStyle:L,fillStyle:V,points:[]},u.set(S,x)),x.points.push(m),c.add(p)}else n.strokeStyle=L,n.fillStyle=V,te.drawPoint(n,this.pointStyle,this.pointSize,m.xp,m.yp)}}h&&u.forEach(f=>{n.strokeStyle=f.strokeStyle,n.fillStyle=f.fillStyle,te.drawPointBatch(n,this.pointStyle,this.pointSize,f.points)})}realTimeScatterDraw(t){var g,p,y,C,b,k;const{ctx:n,axesSteps:i,duple:s,legendHitInfo:l,coordinateDedupe:a}=t,r=i.y[this.yAxisIndex],c=typeof this.pointStyle=="string"?this.pointStyle:this.pointStyle.value,d=typeof this.pointSize=="number"?this.pointSize:this.pointSize.value;let h=0;const u=a!==!1,f=u&&!l,m=f?new Map:null;for(let L=0;L<((p=(g=this.data[this.sId])==null?void 0:g.dataGroup)==null?void 0:p.length);L++)for(let w=0;w<((C=(y=this.data[this.sId])==null?void 0:y.dataGroup[L])==null?void 0:C.data.length);w++){const M=(k=(b=this.data[this.sId])==null?void 0:b.dataGroup[L])==null?void 0:k.data[w];h++;let V;if(l?V=l.sId===this.sId:u?V=s.get(M.k??A.coordinateKey(M.x,M.y))===this.sId:V=!0,V&&M.xp!==null&&M.yp!==null){const S=M.y>r.graphMax&&this.overflowColor,x=S||M.color||this.color,I=S||M.color||this.pointFill||this.color,T=this.getOpacity(t,x,w),v=this.getOpacity(t,I,w),E=this.getCachedColor(x,T),Z=this.getCachedColor(I,v);if(f){const W=`${E} ${Z}`;let R=m.get(W);R||(R={strokeStyle:E,fillStyle:Z,points:[]},m.set(W,R)),R.points.push(M)}else n.strokeStyle=E,n.fillStyle=Z,te.drawPoint(n,c,d,M.xp,M.yp);t.markDrawn&&(M.drawn=!0)}}f&&m.forEach(L=>{n.strokeStyle=L.strokeStyle,n.fillStyle=L.fillStyle,te.drawPointBatch(n,c,d,L.points)}),this._rtTotalCount=h}realTimeScatterDrawStrip(t,n,i){var u;if(!this.show)return;const s=(u=this.data[this.sId])==null?void 0:u.dataGroup;if(!s)return;const{duple:l,coordinateDedupe:a}=i,r=a!==!1&&!!l,c=i.axesSteps.y[this.yAxisIndex],d=typeof this.pointStyle=="string"?this.pointStyle:this.pointStyle.value,h=typeof this.pointSize=="number"?this.pointSize:this.pointSize.value;for(let f=0;f<n.length;f++){const m=s[n[f]];if(m!=null&&m.data)for(let g=0;g<m.data.length;g++){const p=m.data[g];if(!p.drawn&&!(r&&l.get(p.k??A.coordinateKey(p.x,p.y))!==this.sId)&&(this.calcItem(p,i),p.xp!==null&&p.yp!==null)){const y=p.y>c.graphMax&&this.overflowColor,C=y||p.color||this.color,b=y||p.color||this.pointFill||this.color,k=this.getOpacity(i,C,g),L=this.getOpacity(i,b,g);t.strokeStyle=this.getCachedColor(C,k),t.fillStyle=this.getCachedColor(b,L),te.drawPoint(t,d,h,p.xp,p.yp),p.drawn=!0}}}}refreshRtHitCoords(t){var i,s;const n=(i=this.data[this.sId])==null?void 0:i.dataGroup;if(n)for(let l=0;l<n.length;l++){const a=(s=n[l])==null?void 0:s.data;if(a)for(let r=0;r<a.length;r++)this.calcItem(a[r],t)}}refreshRtTotalCount(){var i,s,l;let t=0;const n=(i=this.data[this.sId])==null?void 0:i.dataGroup;if(n)for(let a=0;a<n.length;a++)t+=((l=(s=n[a])==null?void 0:s.data)==null?void 0:l.length)??0;return this._rtTotalCount=t,t}findItemsInRange(t,n,i,s,l){return t.filter(a=>n-1<=a.xp&&a.xp<=s+1&&i-1<=a.yp&&a.yp<=l+1)}defaultScatterFindItems(t,n,i,s,l){return this.findItemsInRange(t,n,i,s,l)}realTimeScatterFindItems(t,n,i,s,l){const a=[];for(let r=0;r<t[this.sId].dataGroup.length;r++){const c=t[this.sId].dataGroup[r];a.push(...this.findItemsInRange(c.data,n,i,s,l))}return a}findItems({xsp:t,ysp:n,width:i,height:s}){const l=this.data,a=t+i,r=n+s;let c=[];return this.realTimeScatter?c=this.realTimeScatterFindItems(l,t,n,a,r):c=this.defaultScatterFindItems(l,t,n,a,r),c}itemHighlight(t,n){const i=t.data,s=n,l=i.xp,a=i.yp;if(s.save(),l!==null&&a!==null){const r=i.dataColor||this.color,c=i.dataColor||this.pointFill;s.strokeStyle=this.getCachedColor(r,0),s.fillStyle=this.getCachedColor(c,this.highlight.maxShadowOpacity),te.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=r,te.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",te.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)}s.restore()}findGraphData(t){var c;const n=t[0],i=t[1],s={data:null,hit:!1,color:this.color,index:null},l=this.pointSize;if(this.realTimeScatter){const d=(c=this.data[this.sId])==null?void 0:c.dataGroup;if(!d)return s;let u=this._rtTotalCount-1;for(let f=d.length-1;f>=0;f--){const m=d[f];if(m!=null&&m.data)for(let g=m.data.length-1;g>=0;g--){const p=m.data[g];if(p.xp!==null&&p.yp!==null){const y=p.xp,C=p.yp;if(y-l<=n&&n<=y+l&&C-l<=i&&i<=C+l)return s.data=p,s.index=u,s.hit=!0,s}u--}}return s}const a=this.data,r=a.findIndex(d=>{const h=d.xp,u=d.yp;return h-l<=n&&n<=h+l&&u-l<=i&&i<=u+l});return r>-1&&(s.data=a[r],s.index=r,s.hit=!0),s}}class bc{constructor(t,n,i,s){const l=Pe({},n,jC);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=_t[i%_t.length]),this.type="bar",this.sId=t,this.data=[],this.isHorizontal=s,this.size={cat:0,bar:0,cPad:0,bPad:0,w:0,h:0,ix:0}}computeGeometry(t){if(!this.show)return;const n=t.scaleVersion!=null&&t.dataEpoch!=null,i=t.showIndex??0,s=t.showSeriesCount??0;if(n&&this._lastDataEpoch===t.dataEpoch&&this._lastScaleVersion===t.scaleVersion&&this._lastShowIndex===i&&this._lastShowSeriesCount===s&&this._lastGeomData===this.data)return;const l=t.chartRect,a=t.labelOffset,r=t.axesSteps,c=t.showIndex,d=t.thickness,h=t.showSeriesCount;this.isHorizontal=t.isHorizontal;const{isHorizontal:u}=this;let f,m;const g=r.x[this.xAxisIndex],p=r.y[this.yAxisIndex];let y=this.data.length;const[C,b]=u?[p.minIndex,p.maxIndex]:[g.minIndex,g.maxIndex];Re(C)&&Re(b)&&(y=b-C+1);const k=l.chartWidth-(a.left+a.right),L=l.chartHeight-(a.top+a.bottom),w=l.x1+a.left,M=l.y2-a.bottom,V=te.calculateX(0,g.graphMin,g.graphMax,k),S=te.calculateY(0,p.graphMin,p.graphMax,L),x=u?w+V:w,I=u?M:M+S,T=u?L:k,v=T/(y||1);let E;t.cPadRatio>=1||t.cPadRatio<=0?E=2:E=Math.max(T*(t.cPadRatio/2)/y,2);let W,R,X;W=v>E*2?v-E*2:v,W=this.isExistGrp?W:W/h;const G=this.calculateBarSize(d,W);R=u?null:G,X=u?G:null;const N=u?(W-X)/2:(W-R)/2,P=this.isExistGrp?1:c+1;this.size.cat=v,this.size.bar=W,this.size.cPad=E,this.size.bPad=N,this.size.w=R,this.size.h=X,this.size.ix=P,this.chartRect=l,this.labelOffset=a,this.borderRadius=t.borderRadius,this.filteredCount=y;const B=Re(C)?C:0,z=Re(b)?b:this.data.length-1;this.visibleStartIndex=B;for(let D=B;D<=z;D++){const Y=D-B,F=this.data[D];if(F){const O=u?I-v*Y-E:x+v*Y+E;if(u?(f=x,m=Math.round(O-(W*P-(X+N)))):(f=Math.round(O+(W*P-(R+N))),m=I),u){const H=F.b?F.o:F.x,j=t.displayOverflow&&H>g.graphMax?g.graphMax:H;R=te.calculateX(j,g.graphMin,g.graphMax,k,-V),F.b&&(f=te.calculateX(F.b,g.graphMin,g.graphMax,k,x-V));const U=H>0?-1:1;R=H&&R!==null&&Math.abs(R)===0?U:R}else{const H=F.b?F.o:F.y,j=t.displayOverflow&&H>p.graphMax?p.graphMax:H;X=te.calculateY(j,p.graphMin,p.graphMax,L,-S),F.b&&(m=te.calculateY(F.b,p.graphMin,p.graphMax,L,I-S));const U=H>0?-1:1;X=H&&X!==null&&Math.abs(X)===0?U:X}F.xp=f,F.yp=m,F.w=R,F.h=u?-X:X,F.index=D}}n&&(this._lastDataEpoch=t.dataEpoch,this._lastScaleVersion=t.scaleVersion,this._lastShowIndex=i,this._lastShowSeriesCount=s,this._lastGeomData=this.data)}draw(t){var Y,F,O,H,j;if(!this.show)return;this.computeGeometry(t);const n=t.ctx,i=t.chartRect,s=t.labelOffset,l=t.axesSteps,a=t.showIndex,r=t.thickness,c=t.showSeriesCount,d=t.displayOverflow;this.isHorizontal=t.isHorizontal;const{isHorizontal:h,showValue:u}=this;let f,m;const g=l.x[this.xAxisIndex],p=l.y[this.yAxisIndex],[y,C]=h?[p.minIndex,p.maxIndex]:[g.minIndex,g.maxIndex],b=Re(y)&&Re(C),k=b?y:0,L=b?C:this.data.length-1,w=L-k+1,M=i.chartWidth-(s.left+s.right),V=i.chartHeight-(s.top+s.bottom),S=i.x1+s.left,x=i.y2-s.bottom,I=te.calculateX(0,g.graphMin,g.graphMax,M),T=te.calculateY(0,p.graphMin,p.graphMax,V),v=h?S+I:S,E=h?x:x+T,Z=h?V:M,W=Z/(w||1);let R;t.cPadRatio>=1||t.cPadRatio<=0?R=2:R=Math.max(Z*(t.cPadRatio/2)/w,2);let G,N,P;G=W>R*2?W-R*2:W,G=this.isExistGrp?G:G/c;const B=this.calculateBarSize(r,G);N=h?null:B,P=h?B:null;const z=h?(G-P)/2:(G-N)/2,D=this.isExistGrp?1:a+1;this.size.cat=W,this.size.bar=G,this.size.cPad=R,this.size.bPad=z,this.size.w=N,this.size.h=P,this.size.ix=D,this.chartRect=i,this.labelOffset=s,this.borderRadius=t.borderRadius,this.filteredCount=w,this.visibleStartIndex=k;for(let U=k;U<=L;U++){const Q=U-k,J=this.data[U];if(J){const ne=h?E-W*Q-R:v+W*Q+R;if(h?(f=v,m=Math.round(ne-(G*D-(P+z)))):(f=Math.round(ne+(G*D-(N+z))),m=E),h){const oe=J.b?J.o:J.x,re=d&&oe>g.graphMax?g.graphMax:oe;N=te.calculateX(re,g.graphMin,g.graphMax,M,-I),J.b&&(f=te.calculateX(J.b,g.graphMin,g.graphMax,M,v-I));const pe=oe>0?-1:1;N=oe&&N!==null&&Math.abs(N)===0?pe:N}else{const oe=J.b?J.o:J.y,re=d&&oe>p.graphMax?p.graphMax:oe;P=te.calculateY(re,p.graphMin,p.graphMax,V,-T),J.b&&(m=te.calculateY(J.b,p.graphMin,p.graphMax,V,E-T));const pe=oe>0?-1:1;P=oe&&P!==null&&Math.abs(P)===0?pe:P}const q=J.dataColor||this.color,ee=t==null?void 0:t.legendHitInfo,$=(Y=t==null?void 0:t.selectLabel)==null?void 0:Y.option,he=(F=t==null?void 0:t.selectItem)==null?void 0:F.option,fe=((H=(O=t==null?void 0:t.selectLabel)==null?void 0:O.selected)==null?void 0:H.dataIndex)??[],{dataIndex:ae,seriesID:Se}=((j=t==null?void 0:t.selectItem)==null?void 0:j.selected)??{};let be=!1;if(ee?be=(ee==null?void 0:ee.sId)!==this.sId:$!=null&&$.use&&($!=null&&$.useSeriesOpacity)?be=fe.length&&!fe.includes(U):kt(ae)&&(he!=null&&he.useSeriesOpacity)&&(this.isExistGrp?be=ae!==U:be=ae!==U||Se!==this.sId),typeof q!="string")n.fillStyle=te.createGradient(n,h,{x:f,y:m,w:N,h:P},q,be,t.unSelectedOpacity);else{const oe=q.includes("rgba")?A.getOpacity(q):1,re=be?t.unSelectedOpacity:oe;n.fillStyle=A.colorStringToRgba(q,re)}this.drawBar({ctx:n,positions:{x:f,y:m,w:N,h:P}}),u.use&&this.drawValueLabels({context:n,data:J,positions:{x:f,y:m,h:P,w:N},isHighlight:!1,textColor:J.dataTextColor,index:U})}}}itemHighlight(t,n,i,s){const l=this.showValue,a=t.data,r=n,c=a.xp,d=a.yp,h=a.w,u=a.h;r.save(),r.shadowOffsetX=0,r.shadowOffsetY=0,r.shadowBlur=4;const f=t.data.dataColor||this.color;if(typeof f!="string"){const m=te.createGradient(r,this.isHorizontal,{x:c,y:d,w:h,h:u},f,!1,s);r.fillStyle=m,r.shadowColor=f[f.length-1][1]}else r.fillStyle=f,r.shadowColor=f;r.beginPath(),this.drawBar({ctx:r,positions:{x:c,y:d,w:h,h:this.isHorizontal?-u:u}}),l.use&&this.drawValueLabels({context:r,data:a,positions:{x:c,y:d,h:u,w:h},isHighlight:!0,textColor:t.data.dataTextColor||t.dataTextColor,index:i}),r.restore()}findGraphData(t,n,i,s){if(typeof i=="number"&&this.show&&s){const l=this.data,a={data:null,hit:!1,color:this.color},r=this.visibleStartIndex??0,c=r+(this.filteredCount??l.length)-1,d=Math.max(r,Math.min(i,c));return l[d]&&(a.data=l[d],a.index=d,a.hit=this.isPointInBar(t,l[d]),a.directHit=a.hit),a}return n?this.findGraphRangeCount(t):this.findGraphRange(t)}binarySearchBar(t,n){const[i,s]=t,l={data:null,hit:!1,color:this.color},a=this.data,r=this.visibleStartIndex??0,c=this.filteredCount??a.length;let d=r,h=Math.min(r+c-1,a.length-1);for(;d<=h;){const u=Math.floor((d+h)/2),f=a[u];if(!f){console.warn(`[EVUI][Bar] binarySearchBar: gdata[${u}] is falsy`);break}const{xp:m,yp:g,w:p,h:y}=f,C=m+p,b=g+y;if(n?b<=s&&s<=g:m<=i&&i<=C)return l.data=f,l.index=f.index,l.hit=this.isPointInBar(t,f),l.directHit=l.hit,l;(n?!(b<s):m+4<i)?d=u+1:h=u-1}return l}findGraphRange(t){return this.binarySearchBar(t,!1)}findGraphRangeCount(t){return this.binarySearchBar(t,!0)}drawValueLabels({context:t,data:n,positions:i,isHighlight:s,textColor:l,index:a}){const r=this.isHorizontal,{fontSize:c,textColor:d,align:h,formatter:u,decimalPoint:f}=this.showValue,{x:m,y:g,w:p,h:y}=i,C=t;C.save(),C.beginPath(),C.font=`normal normal normal ${c}px Roboto`,C.fillStyle=l||d,C.lineWidth=1,C.textBaseline="middle",C.textAlign=r&&h!=="center"?"left":"center";let b;const k=kt(this.stackIndex);k?b=n.o:b=(r?n.x:n.y)??"";let L;u&&(L=u(b,{label:r?n.y:n.x,index:a})),(!u||typeof L!="string")&&(L=A.labelSignFormat(b,f)??"");const w=b<0,M=Math.round(C.measureText(L).width),V=c,S=r&&h!=="end"?10:4,x=w?m-S:m+S,I=w?g+S:g-S,T=m+p/2,v=s?g+y/2:g-y/2,E=r?v+c*.1:v,Z=Math.abs(p),W=Math.abs(y),R=Z-S,X=W-S,G=M<=Z&&Z>=V;switch(h){case"start":{if(r){if(M<R&&V<W){const N=w?x-M:x;C.fillText(L,N,E)}}else if(G&&V+S<=W){const N=w?g+V/2+S:g-V/2-S;C.fillText(L,T,N)}break}case"center":{r?M<R&&V<W&&C.fillText(L,T,E):G&&V<X&&C.fillText(L,T,g+y/2);break}case"out":{if(k){console.warn("[EVUI][Bar Chart] In case of Stack Bar Chart, 'out' of 'showValue''s align is not supported.");return}if(r){const N=this.chartRect.x1+this.labelOffset.left,P=this.chartRect.x2-this.labelOffset.right;if(V<this.size.bar)if(w){const B=m-S+p-M;B>N&&C.fillText(L,B,E)}else{const B=m+S+p;B+M<P&&C.fillText(L,B,E)}}else{const N=this.chartRect.y1+this.labelOffset.top,P=this.chartRect.y2-this.labelOffset.bottom;if(M<=this.size.bar)if(w){const B=g+y+S+V/2;B+V/2<=P&&C.fillText(L,T,B)}else{const B=g+y-S-V/2;B-V/2>=N&&C.fillText(L,T,B)}}break}default:case"end":{if(r){if(M<R&&V<W){const N=w?m+p+S:m+p-M-S;C.fillText(L,N,E)}}else if(w){const N=g+y-V/2-S;N>I&&G&&V+S<=W&&C.fillText(L,T,N)}else G&&V+S<=W&&C.fillText(L,T,g+y+V/2+S);break}}C.restore()}calculateBarSize(t,n){return typeof t=="string"&&/[0-9]+px/.test(t)?Math.min(n,Number(t.replace("px",""))):typeof t=="number"&&t<=1&&t>=0?Math.ceil(n*t):n}drawBar({ctx:t,positions:n}){const{isHorizontal:i,borderRadius:s}=this,l="stackIndex"in this,a=s&&s>0,{x:r,y:c,w:d}=n,h=i?-n.h:n.h;if(!(d===0||h===0)){if(t.save(),a&&!l)try{this.drawRoundedRect(t,n)}catch{t.fillRect(r,c,d,h)}else t.fillRect(r,c,d,h);t.restore()}}isPointInBar(t,n){const[i,s]=t,{xp:l,yp:a,w:r,h:c}=n,d=l+r,h=a+c;return l<=i&&i<=d&&h<=s&&s<=a}drawRoundedRect(t,n){const{chartRect:i,labelOffset:s,isHorizontal:l,borderRadius:a}=this,{x:r,y:c}=n;let{w:d,h}=n,u=a;const f=new Path2D;f.rect(i.x1+s.left,i.y1,i.chartWidth-s.right,i.chartHeight-s.bottom),t.clip(f),t.beginPath(),t.moveTo(r,c),Math.abs(d)<u*2&&(u=Math.abs(d)/2),Math.abs(h)<u*2&&(u=Math.abs(h)/2),l?d<0?(d+=u,t.lineTo(r+d,c),t.arcTo(r+d-u,c,r+d-u,c-u,u),t.arcTo(r+d-u,c-h,r+d,c-h,u),t.lineTo(r,c-h),t.lineTo(r,c)):(d-=u,t.lineTo(r+d,c),t.arcTo(r+d+u,c,r+d+u,c-u,u),t.arcTo(r+d+u,c-h,r+d,c-h,u),t.lineTo(r,c-h),t.lineTo(r,c)):h>0?(h-=u,t.lineTo(r+d,c),t.lineTo(r+d,c+h),t.arcTo(r+d,c+h+u,r-d+u,c+h+u,u),t.arcTo(r,c+h+u,r,c+h,u),t.lineTo(r,c)):(h+=u,t.lineTo(r+d,c),t.lineTo(r+d,c+h),t.arcTo(r+d,c+h-u,r+d-u,c+h-u,u),t.arcTo(r,c+h-u,r,c+h,u),t.lineTo(r,c)),t.fill(),t.closePath()}findItems({xsp:t,width:n}){if(!this.show||this.isHorizontal)return[];const i=t+n,s=this.visibleStartIndex??0,l=this.filteredCount??this.data.length,a=Math.min(s+l-1,this.data.length-1);return this.data.slice(s,a+1).filter(({xp:r,w:c})=>r!=null&&r<=i&&r+c>=t)}}class i1 extends bc{computeGeometry(t){if(!this.show)return;const n=t.chartRect,i=t.labelOffset,s=t.axesSteps,l=t.showIndex,a=t.isHorizontal,r=t.thickness,c=t.showSeriesCount;let d,h;const u=s.x[this.xAxisIndex],f=s.y[this.yAxisIndex],m=n.chartWidth-(i.left+i.right),g=n.chartHeight-(i.top+i.bottom),p=n.x1+i.left,y=n.y2-i.bottom,C=n.x2-i.right,k=(a?g:m)/(this.data.length||1),L=2;let w;this.isExistGrp?w=k-L*2:w=(k-L*2)/c;const V=typeof r=="string"&&/[0-9]+px/.test(r)?Math.min(w,Number(r.replace("px",""))):typeof r=="number"&&r<=1&&r>=0?Math.ceil(w*r):w;let S=a?null:V,x=a?null:V,I=a?V:null;const T=a?(w-I)/2:(w-S)/2,v=this.isExistGrp?1:l+1;this.size.cat=k,this.size.bar=w,this.size.cPad=L,this.size.bPad=T,this.size.w=S,this.size.ix=v,this.chartRect=n,this.labelOffset=i,this.borderRadius=t.borderRadius,this.data.forEach(E=>{a?(d=p,h=te.calculateY(E.y,f.graphMin,f.graphMax,g,y)):(d=te.calculateSubX(E.x,u.graphMin,u.graphMax,m,p),d<p?(x-=p-d,d=d+S<p?null:p):d+S>C&&(x-=x-(C-d)),d>=C&&(d=null),d!==null&&(d+=Math.ceil(w*v)-Math.round(S+T)),h=y),a?E.b?(S=te.calculateX(E.x-E.b,u.graphMin,u.graphMax,m),d=te.calculateX(E.b,u.graphMin,u.graphMax,m,p)):S=te.calculateX(E.x,u.graphMin,u.graphMax,m):E.b?(I=te.calculateY(E.y-E.b,f.graphMin,f.graphMax,g),h=te.calculateY(E.b,f.graphMin,f.graphMax,g,y)):I=te.calculateY(E.y,f.graphMin,f.graphMax,g),d!==null&&h!==null&&typeof(E.dataColor||this.color)!="string"&&(S=S!==x?x:S),x=S,E.xp=d,E.yp=h,E.w=S,E.h=a?-I:I})}draw(t){if(!this.show)return;this.computeGeometry(t);const n=t.ctx,i=t.chartRect,s=t.labelOffset,l=t.axesSteps,a=t.showIndex,r=t.isHorizontal,c=t.thickness,d=t.showSeriesCount;let h,u;const f=l.x[this.xAxisIndex],m=l.y[this.yAxisIndex],g=i.chartWidth-(s.left+s.right),p=i.chartHeight-(s.top+s.bottom),y=i.x1+s.left,C=i.y2-s.bottom,b=i.x2-s.right,L=(r?p:g)/(this.data.length||1),w=2;let M;this.isExistGrp?M=L-w*2:M=(L-w*2)/d;const S=typeof c=="string"&&/[0-9]+px/.test(c)?Math.min(M,Number(c.replace("px",""))):typeof c=="number"&&c<=1&&c>=0?Math.ceil(M*c):M;let x=r?null:S,I=r?null:S,T=r?S:null;const v=r?(M-T)/2:(M-x)/2,E=this.isExistGrp?1:a+1;this.size.cat=L,this.size.bar=M,this.size.cPad=w,this.size.bPad=v,this.size.w=x,this.size.ix=E,this.chartRect=i,this.labelOffset=s,this.borderRadius=t.borderRadius,this.data.forEach((Z,W)=>{if(n.beginPath(),r?(h=y,u=te.calculateY(Z.y,m.graphMin,m.graphMax,p,C)):(h=te.calculateSubX(Z.x,f.graphMin,f.graphMax,g,y),h<y?(I-=y-h,h=h+x<y?null:y):h+x>b&&(I-=I-(b-h)),h>=b&&(h=null),h!==null&&(h+=Math.ceil(M*E)-Math.round(x+v)),u=C),r?Z.b?(x=te.calculateX(Z.x-Z.b,f.graphMin,f.graphMax,g),h=te.calculateX(Z.b,f.graphMin,f.graphMax,g,y)):x=te.calculateX(Z.x,f.graphMin,f.graphMax,g):Z.b?(T=te.calculateY(Z.y-Z.b,m.graphMin,m.graphMax,p),u=te.calculateY(Z.b,m.graphMin,m.graphMax,p,C)):T=te.calculateY(Z.y,m.graphMin,m.graphMax,p),h!==null&&u!==null){const R=Z.dataColor||this.color,X=R.includes("rgba")?A.getOpacity(R):1,G=this.state==="downplay"?t.unSelectedOpacity:X;typeof R!="string"?(x=x!==I?I:x,n.fillStyle=te.createGradient(n,r,{x:h,y:u,w:x,h:T},R,this.state==="downplay",t.unSelectedOpacity)):n.fillStyle=A.colorStringToRgba(R,G),this.drawBar({ctx:n,positions:{x:h,y:u,w:x,h:T}}),this.showValue.use&&this.drawValueLabels({context:n,data:Z,positions:{x:h,y:u,h:T,w:x},isHighlight:!1,index:W})}I=x})}}class s1{constructor(t,n,i){const s=Bo({},QC,n);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=_t[i%_t.length]),this.sId=t,this.show=!0,this.data=[],this.type="pie",this.centerX=0,this.centerY=0,this.radius=0,this.doughnutHoleSize=0,this.startAngle=0,this.endAngle=0,this.ctx=null,this.isSelect=!1}draw(t,n,i){var h;const s=t??this.ctx,l=new Path2D,a=this.isSelect?this.radius+5:this.radius,r=this.color,c=r.includes("rgba")?A.getOpacity(r):1,d=this.isDownplay?i:c;s.beginPath(),l.moveTo(this.centerX,this.centerY),l.arc(this.centerX,this.centerY,a,this.startAngle,this.endAngle),l.lineTo(this.centerX,this.centerY),s.fillStyle=A.colorStringToRgba(r,d),s.fill(l),n.use&&(s.lineCap="round",s.lineWidth=n==null?void 0:n.lineWidth,s.strokeStyle=n==null?void 0:n.color,s.stroke(l)),(h=this.showValue)!=null&&h.use&&this.drawValueLabels(s),s.closePath(),this.ctx=s}findGraphData([t,n]){const i={data:null,hit:!1,color:null,index:-1},{radius:s,startAngle:l,endAngle:a,centerX:r,centerY:c}=this,d=Math.sqrt((t-r)**2+(n-c)**2),h=2.5*Math.PI-Math.atan2(t-r,n-c),u=s>d&&h>=l&&h<=a;return this.show&&u&&(i.type=this.type,i.data=this.data,i.hit=!0,i.color=this.color,i.index=0),i}itemHighlight(t,n){var a,r;const i=n,s=this.isSelect?this.radius+5:this.radius;i.save(),i.shadowOffsetX=0,i.shadowOffsetY=0,i.shadowBlur=4;const l=((a=t==null?void 0:t.data)==null?void 0:a.dataColor)||this.color;i.fillStyle=l,i.shadowColor=l,i.beginPath(),i.moveTo(this.centerX,this.centerY),i.arc(this.centerX,this.centerY,s,this.startAngle,this.endAngle),i.lineTo(this.centerX,this.centerY),i.fill(),(r=this.showValue)!=null&&r.use&&this.drawValueLabels(i),i.closePath(),i.restore()}drawValueLabels(t){const n=t,i=this.data.o,{fontSize:s,textColor:l,formatter:a}=this.showValue;let r;a&&(r=a({value:i,percentage:this.data.percentage})),(!a||typeof r!="string")&&(r=A.labelSignFormat(i));const c=1.8,d=this.radius-this.doughnutHoleSize,h=(this.endAngle-this.startAngle)*180/Math.PI,u=s+4,f=Math.round(n.measureText(r).width);if(h>=f*c&&h>=u*c&&d>=f*c&&d>=u*c){n.save(),n.beginPath();const m=l.includes("rgba")?A.getOpacity(l):1,g=this.state==="downplay"?this.unSelectedOpacity:m;n.font=`normal normal normal ${s}px Roboto`,n.fillStyle=A.colorStringToRgba(l,g),n.lineWidth=1,n.textAlign="center",n.textBaseline="middle";const p=d/2+this.doughnutHoleSize,y=(this.endAngle-this.startAngle)/2+this.startAngle,C=p*Math.cos(y)+this.centerX,b=p*Math.sin(y)+this.centerY;n.fillText(r,C,b),n.restore()}}}class o1{constructor(t,n,i,s,l){const a=Bo({},$C,n);Object.keys(a).forEach(r=>{this[r]=a[r]}),this.isHorizontal=s,this.isGradient=l,this.createColorState(i),this.sId=t,this.data=[],this.labels={x:[],y:[]},this.valueOpt={},this.size={w:0,h:0},this.type="heatMap",this.currentLabelInfo={x:{steps:0,min:0,max:0},y:{steps:0,min:0,max:0}}}createColorState(t){const n=[],i=/[^0-9]&[^,]/g,{min:s,max:l,rangeCount:a,colorsByRange:r,error:c,stroke:d}=t,h=s.includes("#")?A.hexToRgb(s):s.replace(i,""),u=l.includes("#")?A.hexToRgb(l):l.replace(i,""),[f,m,g]=h.split(","),[p,y,C]=u.split(",");if(this.isGradient)n.push({minColor:{minR:f,minG:m,minB:g},maxColor:{maxR:p,maxG:y,maxB:C},rangeCount:a,start:0,end:100,selectedValue:null});else if(r.length)r.forEach(({color:b,label:k},L)=>{n.push({id:`color#${L}`,color:b,label:k,state:"normal",show:!0})});else{const b=Math.floor((f-p)/(a-1)),k=Math.floor((m-y)/(a-1)),L=Math.floor((g-C)/(a-1));for(let w=0;w<a;w++){const M=+f-b*w,V=+m-k*w,S=+g-L*w;n.push({id:`color#${w}`,color:`rgb(${M},${V},${S})`,state:"normal",show:!0})}}this.colorState=n,this.errorColor=c,this.stroke=d}getColorForGradient(t){const{minColor:n,maxColor:i}=this.colorState[0],{minR:s,minG:l,minB:a}=n,{maxR:r,maxG:c,maxB:d}=i,h=+s-Math.floor((s-r)*t/100),u=+l-Math.floor((l-c)*t/100),f=+a-Math.floor((a-d)*t/100);return`rgb(${h},${u},${f})`}getColorIndexByValue(t){const{existError:n,min:i,interval:s,decimalPoint:l}=this.valueOpt,a=this.colorState.length-1;if(n&&t<0)return a;const r=Math.floor(+(t-i).toFixed(l)/s);return r>=a?n?a-1:a:r}getItemInfo(t){const{min:n,max:i}=this.valueOpt,s={show:!1,opacity:1,dataColor:null,id:null,isHighlight:null};if(this.isGradient){const l=$e(t-n,i-n),{start:a,end:r,selectedValue:c}=this.colorState[0];(t<0||a<=l&&l<=r)&&(s.show=!0,s.isHighlight=c!==null&&Math.floor(t)===Math.floor(n+(i-n)*(c/100)),s.dataColor=t<0?this.errorColor:this.getColorForGradient(l))}else{const l=this.getColorIndexByValue(t),{show:a,state:r,color:c,id:d}=this.colorState[l];s.show=a,s.opacity=r==="downplay"?.1:1,s.dataColor=t<0?this.errorColor:c,s.id=d}return s}drawItem(t,n,i,s,l,a){if(t.beginPath(),!(s<0||l<0)){if(a.show){const{radius:r}=a;if(r>0){const c=Math.min(s,l);let d=r;d>c/2&&(d=Math.floor(c/2)),t.moveTo(n+d,i),t.arcTo(n+s,i,n+s,i+l,d),t.arcTo(n+s,i+l,n,i+l,d),t.arcTo(n,i+l,n,i,d),t.arcTo(n,i,n+s,i,d),t.stroke(),t.fill()}else t.strokeRect(n,i,s,l),t.fillRect(n,i,s,l)}else{const r=A.aliasPixel(1);t.fillRect(n,i-r,s+r,l+r)}t.closePath()}}calculateXY(t,n,i,s){let l=null;if(this.labels[t]&&this.labels[t].length){let a=this.labels[t].findIndex(f=>f===n);a===-1&&(a=this.labels[t].findIndex(f=>+f==+n));const{minIndex:r,maxIndex:c,graphMin:d,graphMax:h}=s;if(Re(c)&&a>c||Re(r)&&a<r||po(r)&&po(c)&&(n<d||n>h))return null;const u=r??this.labels[t].findIndex(f=>+f==+d);a>-1&&(a-=u>-1?u:0,l=t==="x"?i+this.size.w*a:i-this.size.h*(a+1))}return l}computeGeometry(t){if(!this.show)return;const{chartRect:n,labelOffset:i,selectItem:s,axesSteps:l}=t,a=n.chartWidth-(i.left+i.right),r=n.chartHeight-(i.top+i.bottom),c=n.x1+i.left,d=n.y2-i.bottom,h=l.x[this.xAxisIndex],u=l.y[this.yAxisIndex];this.size.w=a/h.oriSteps,this.size.h=r/u.oriSteps,this.currentLabelInfo={x:{steps:h.oriSteps,min:h.graphMin,max:h.graphMax},y:{steps:u.oriSteps,min:u.graphMin,max:u.graphMax}},this.data.forEach((f,m)=>{var L;let p=this.calculateXY("x",f.x,c,h),y=this.calculateXY("y",f.y,d,u),C=this.size.w,b=this.size.h;const k=f.o;if(p!==null&&y!==null&&k!==null&&k!==void 0){const{show:w,dataColor:M,id:V}=this.getItemInfo(k);if(f.dataColor||(f.dataColor=M),f.cId=V,w){let S=this.stroke;const x=s==null?void 0:s.option,I=(x==null?void 0:x.use)&&(x==null?void 0:x.showBorder),T=m===((L=s==null?void 0:s.selected)==null?void 0:L.dataIndex);if(I&&T&&(S={show:x==null?void 0:x.showBorder,...x==null?void 0:x.borderStyle}),S.show&&S.lineWidth>0){const{lineWidth:v}=S,E=v*2;E<Math.floor(C)&&E<Math.floor(b)&&(p+=v,y+=v,C-=E,b-=E)}p+=1,f.xp=p,f.yp=y,f.w=C,f.h=b}}})}draw(t){if(!this.show)return;this.computeGeometry(t);const{ctx:n,chartRect:i,labelOffset:s,selectLabel:l,legendHitInfo:a,selectItem:r,axesSteps:c}=t,d=i.chartWidth-(s.left+s.right),h=i.chartHeight-(s.top+s.bottom),u=i.x1+s.left,f=i.y2-s.bottom,m=c.x[this.xAxisIndex],g=c.y[this.yAxisIndex];this.size.w=d/m.oriSteps,this.size.h=h/g.oriSteps,this.currentLabelInfo={x:{steps:m.oriSteps,min:m.graphMin,max:m.graphMax},y:{steps:g.oriSteps,min:g.graphMin,max:g.graphMax}};const p=(y,C,b)=>{var k,L;if(!a){let w;const{option:M,selected:V}=r,{option:S,selected:x}=l,I=kt(V==null?void 0:V.dataIndex)&&(V==null?void 0:V.dataIndex)>-1,T=((k=x==null?void 0:x.label)==null?void 0:k.length)>0;return I?w=M.useSeriesOpacity?b!==(V==null?void 0:V.dataIndex):!1:T&&(w=S.useSeriesOpacity?!((L=x==null?void 0:x.label)!=null&&L.includes(this.getItemLabel(l,y))):!1),w?.1:C}return C};this.data.forEach((y,C)=>{var S;let k=this.calculateXY("x",y.x,u,m),L=this.calculateXY("y",y.y,f,g),w=this.size.w,M=this.size.h;const V=y.o;if(k!==null&&L!==null&&V!==null&&V!==void 0){const{show:x,opacity:I,dataColor:T,id:v}=this.getItemInfo(V);let E=I;I===1&&A.getColorStringType(y.dataColor)==="RGBA"&&(E=A.getOpacity(y.dataColor));const Z=p(y,E,C);if(y.dataColor||(y.dataColor=T),y.cId=v,n.save(),x){n.fillStyle=A.colorStringToRgba(y.dataColor,Z);let W=this.stroke;const R=r==null?void 0:r.option,X=(R==null?void 0:R.use)&&(R==null?void 0:R.showBorder),G=C===((S=r==null?void 0:r.selected)==null?void 0:S.dataIndex);X&&G&&(W={show:R==null?void 0:R.showBorder,...R==null?void 0:R.borderStyle});let N=!1;if(W.show&&W.lineWidth>0){const{color:P,lineWidth:B,opacity:z}=W,D=B*2;N=D<Math.floor(w)&&D<Math.floor(M),n.strokeStyle=N?A.colorStringToRgba(P,Z===1?z:Z):void 0,N?(n.lineWidth=B,k+=B,L+=B,w-=D,M-=D):n.lineWidth=0}k+=1,this.drawItem(n,k,L,w,M,{...W,show:N}),n.restore(),this.showValue.use&&this.drawValueLabels({context:n,data:y})}}})}drawOverlay(t){if(!this.show)return;const{overlayCtx:n,chartRect:i,labelOffset:s,axesSteps:l}=t;if(!n)return;const a=i.x1+s.left,r=i.y2-s.bottom,c=l.x[this.xAxisIndex],d=l.y[this.yAxisIndex];this.data.forEach(h=>{const u=this.calculateXY("x",h.x,a,c),f=this.calculateXY("y",h.y,r,d),m=h.o;if(u!==null&&f!==null&&m!==null&&m!==void 0){const{show:g,isHighlight:p}=this.getItemInfo(m);g&&p&&this.itemHighlight({data:h},n)}})}drawValueLabels({context:t,data:n}){const{fontSize:i,textColor:s,align:l,formatter:a,decimalPoint:r}=this.showValue,{xp:c,yp:d,w:h,h:u,o:f}=n,m=t;m.save(),m.beginPath(),m.font=`normal normal normal ${i}px Roboto`,m.fillStyle=s,m.lineWidth=1,m.textBaseline="middle",m.textAlign=l!=="center"?"left":"center";let g;a&&(g=a(f)),(!a||typeof g!="string")&&(g=A.labelSignFormat(f,r));const p=Math.round(m.measureText(g).width),y=i,C=c+h/2,b=d+u/2;if(!(p>=h||y>=u||g<0)){switch(l){case"top":{const k=C-p/2,L=b-y/2;m.fillText(g,k,L);break}case"right":{const k=c+h-p;m.fillText(g,k,b);break}case"bottom":{const k=C-p/2,L=b+y/2;m.fillText(g,k,L);break}case"left":m.fillText(g,c,b);break;default:{const k=C-p/2;m.fillText(g,k,b);break}}m.restore()}}getAdjustedBounds({xp:t,yp:n,width:i,height:s}){const a=Math.max(0,i),r=Math.max(0,s);return{xsp:Math.floor(t*100)/100,xep:Math.ceil((t+a)*100)/100,ysp:Math.floor(n*100)/100,yep:Math.ceil((n+r)*100)/100}}findItems(t){const n=this.data,{xsp:i,xep:s,ysp:l,yep:a}=this.getAdjustedBounds({xp:t.xsp,yp:t.ysp,width:t.width,height:t.height});return n.filter(({xp:r,yp:c,w:d,h})=>{const{xsp:u,xep:f,ysp:m,yep:g}=this.getAdjustedBounds({xp:r,yp:c,width:d,height:h});return u>=i&&f<=s&&m>=l&&g<=a})}itemHighlight(t,n){var p;const i=t.data,s=n,{stroke:l,shadow:a}=this.highlight,r=i.xp,c=i.yp,d=i.w,h=i.h,u=i.cId;let f;if(this.isGradient){const{min:y,max:C}=this.valueOpt,b=$e(i.o-y,C-y),{start:k,end:L}=this.colorState[0];f=k<=b&&b<=L||i.o===-1}else f=(p=this.colorState.find(({id:y})=>y===u))==null?void 0:p.show;if(r===null||c===null||!f)return;s.save();const m=A.getColorStringType(i.dataColor)==="RGBA"?t.dataColor:A.colorStringToRgba(i.dataColor,1);s.fillStyle=m,a.use&&(s.shadowOffsetX=a.offsetX,s.shadowOffsetY=a.offsetY,s.shadowBlur=a.blur,s.shadowColor=a.color);const g={color:"",lineWidth:1,opacity:1,radius:0,show:!0};if(l.use){const{color:y,width:C,radius:b}=l;g.show=!0,g.radius=b,s.lineWidth=C,g.lineWidth=C,s.strokeStyle=y||m,g.color=y||m}else g.show=!1,s.strokeStyle=m,g.color=m;this.drawItem(s,r-.5,c-.5,d+1,h+1,g),s.restore(),this.showValue.use&&this.drawValueLabels({context:s,data:i})}findGraphData(t){const n=t[0],i=t[1],s={data:null,hit:!1,color:null,dataColor:null,name:null},l=this.data,a=l.findIndex(r=>{const{xp:c,yp:d,w:h,h:u}=r;return c<=n&&n<=c+h&&d<=i&&i<=d+u});if(a>-1){const r=l[a];s.data=r,s.color=r.dataColor,s.dataColor=r.dataColor,s.index=a,s.hit=!0}return s}findBlockRange({xcp:t,xep:n,ycp:i,yep:s,range:l}){const a=this.labels,r=1,c={xsp:Math.min(t,n),ysp:Math.min(i,s),width:Math.ceil(Math.abs(n-t)),height:Math.ceil(Math.abs(s-i))};if(a.x.length&&a.y.length){const d=this.currentLabelInfo.x.steps||a.x.length,h=this.currentLabelInfo.y.steps||a.y.length,{x1:u,x2:f,y1:m,y2:g}=l,p=(f-u)/d,y=(g-m)/h,C={xsp:t,xep:n,ysp:i,yep:s},b=(k,L,w)=>{let M,V,S;k==="x"?(V=p,S=u+r):(V=y,S=m),a[k].findIndex((I,T)=>(M=S+V*T,M<=L&&L<=M+V))>-1?C[w]=["xsp","ysp"].includes(w)?M:M+V:L<S&&(C[w]=S)};b("x",Math.min(t,n),"xsp"),b("x",Math.max(t,n),"xep"),b("y",Math.min(i,s),"ysp"),b("y",Math.max(i,s),"yep"),c.xsp=Math.min(C.xsp,C.xep),c.ysp=Math.min(C.ysp,C.yep),c.width=Math.abs(C.xep-C.xsp),c.height=Math.abs(C.yep-C.ysp)}return c}getFilteredLabel(t,n,i,s){return t.length!==n?t.filter(l=>i<=l&&l<=s):t}findSelectionRange(t){const{xsp:n,ysp:i,width:s,height:l,range:a}=t;let r=null;const{x1:c,x2:d,y1:h,y2:u}=a,{x:f,y:m}=this.labels;if(f.length&&m.length){const{x:{steps:g,min:p,max:y},y:{steps:C,min:b,max:k}}=this.currentLabelInfo,L=g||f.length,w=C||m.length,M=(d-c)/L,V=(u-h)/w,S=n+s,x=i+l,I={min:Math.floor((n-c)/M),max:Math.floor((S-c-M)/M)},T=w-1,v={min:T-Math.round((x-h-V)/V),max:T-Math.round((i-h)/V)},E=this.getFilteredLabel(f,L,p,y),Z=this.getFilteredLabel(m,w,b,k);r={xMin:E[I.min],xMax:E[I.max],yMin:Z[v.min],yMax:Z[v.max]}}return r}getItemLabel(t,n){const{option:i,selected:s}=t;let l=this.isHorizontal?n.y:n.x;return i!=null&&i.useBothAxis&&(s!=null&&s.targetAxis)&&(l=(s==null?void 0:s.targetAxis)==="yAxis"?n.y:n.x),l}}const yc={Store:UC,Series:{createSeriesSet(e,t,n,i){let s=Object.keys(e);this.options.overlapping.use&&(s=this.getOverlappingSeriesKeys(e,t,i)),s.forEach((l,a)=>{const r=e[l].type||t;this.seriesList[l]=this.addSeries({type:r,id:l,opt:e[l],index:a,isHorizontal:n})})},reconcileSeriesSet(e,t,n,i,s){var d,h,u;let l=Object.keys(e);this.options.overlapping.use&&(l=this.getOverlappingSeriesKeys(e,t,i));const a=s||{},r={},c=this.prunedRealTimeScatterSeries;if(c!=null&&c.size){for(let f=0;f<l.length;f++){const m=l[f];c.has(m)&&((u=(h=(d=this.data)==null?void 0:d.data)==null?void 0:h[m])!=null&&u.length)&&c.delete(m)}l=l.filter(f=>!c.has(f))}for(let f=0;f<l.length;f++){const m=l[f],g=e[m],p=g.type||t,y=a[m];y&&this.canReuseSeries(y,p,g,n)?(this.seriesInfo.charts[p].push(m),y.show=y._freshShow,this.resetSeriesGroupMeta(y),r[m]=y):r[m]=this.addSeries({type:p,id:m,opt:g,index:f,isHorizontal:n})}this.seriesList=r},computeReconcileKey(e,t,n){var i,s;return{type:e,isHorizontal:n,timeMode:e==="bar"&&!!t.timeMode,realTime:e==="scatter"&&!!((i=this.options.realTimeScatter)!=null&&i.use),heatMapColor:e==="heatMap"?this.options.heatMapColor:null,isGradient:e==="heatMap"&&((s=this.options.legend)==null?void 0:s.type)==="gradient"}},canReuseSeries(e,t,n,i){const s=e._reconcileKey;if(!s||e._optSnapshot===void 0)return!1;const l=this.computeReconcileKey(t,n,i);return s.type!==l.type||s.isHorizontal!==l.isHorizontal||s.timeMode!==l.timeMode||s.realTime!==l.realTime||s.heatMapColor!==l.heatMapColor||s.isGradient!==l.isGradient?!1:He(e._optSnapshot,n)},resetSeriesGroupMeta(e){e.isExistGrp=!1,e.stackIndex=0,e.groupIndex=null,e.bsId=null,e.bsIds=[],e.isOverlapping=!1},getOverlappingSeriesKeys(e,t,n){const i=[],s=[],l=n.flat();return Object.keys(e).forEach(a=>{if((e[a].type||t)==="bar"&&l.length){const d=l.findIndex(h=>h===a);i.push({key:a,overlappingIdx:d})}else s.push({key:a})}),i.sort((a,r)=>r.overlappingIdx-a.overlappingIdx),[...i,...s].map(({key:a})=>a)},addSeries(e){var r;const{type:t,id:n,opt:i,index:s,isHorizontal:l}=e;let a=!1;if(t==="line")this.seriesInfo.charts.line.push(n),a=new t1(n,i,s);else if(t==="scatter")this.seriesInfo.charts.scatter.push(n),a=new n1(n,i,s,(r=this.options.realTimeScatter)==null?void 0:r.use);else if(t==="bar")this.seriesInfo.charts.bar.push(n),i.timeMode?a=new i1(n,i,s,l):a=new bc(n,i,s,l);else if(t==="pie")this.seriesInfo.charts.pie.push(n),a=new s1(n,i,s);else if(t==="heatMap"){this.seriesInfo.charts.heatMap.push(n);const{heatMapColor:c,legend:d}=this.options,h=d.type==="gradient";a=new o1(n,i,c,l,h)}return a&&(a._reconcileKey=this.computeReconcileKey(t,i,l),a._optSnapshot=i,a._freshShow=a.show),a},addGroupInfo(e){e.forEach((t,n)=>{let i=0;t.reduce((s,l,a)=>{const r=this.seriesList[l];return r.stackIndex=a+i,r.groupIndex=n,r.isExistGrp=!0,r.bsId=s,r.bsIds=t.filter((c,d)=>c!==l&&a>d),r.isOverlapping=this.options.overlapping.use,r.show||i--,r.show?l:s},t[0])})}}};class Ii{constructor(t,n,i,s){const l=Pe({},n,fc);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.type=t,this.ctx=i,this.units=JC[this.type],this.options=s,this.position||(this.position=t==="x"?"bottom":"left")}calculateLabelRange(t,n,i,s){let l,a,r;t==="x"?(l=n.chartWidth,r=Math.floor(s*1.2),a=[i.left,i.right]):(l=n.chartHeight,a=[i.top,i.bottom],r=s+Math.floor(l*.1));const c=l-(a[0]+a[1]),d=1,h=Math.max(Math.floor(c/r),1);return{min:d,max:h}}calculateScaleRange(t,n){var d;let i,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(i=a[1]>+t.max?+t.max:a[1],s=a[0]<+t.min?+t.min:a[0]):(i=a[1],s=a[0]):typeof a=="function"?[s,i]=a(t.min,t.max):(i=t.max,s=t.min),this.autoScaleRatio&&(i=Math.ceil(i*(this.autoScaleRatio+1))),this.startToZero&&(s=0),i===s&&(i+=1,l=!0);const r=this.getLabelFormat(s),c=this.getLabelFormat(i,{isMaxValueSameAsMin:l});return{min:s,max:i,minLabel:r,maxLabel:c,size:A.calcTextSizeCanvas(c,A.getLabelStyle(this.labelStyle),(d=this.labelStyle)==null?void 0:d.padding)}}getLabelWidthHasMaxLength(t,n,i=[]){const s=A.getLabelStyle(this.labelStyle);return[...(t??[]).map(r=>this.getLabelFormat(r)),...i].reduce((r,c)=>{var h;const d=((h=A.calcTextSizeCanvas(c,s))==null?void 0:h.width)??0;return Math.max(r,d)},0)}calculateSteps(t){const{maxValue:n,minValue:i}=t;let{maxSteps:s}=t,l=this.getInterval(t),a=i,r;for(;a<n;)a+=l;const c=a,d=i,h=c-d;if(r=Math.round(h/l),n===1&&(this.decimalPoint?s>2?(l=.2,r=5,s=5):(l=.5,r=2,s=2):(l=1,r=1,s=1)),this.fixedSteps)return{steps:r,interval:l,graphMin:d,graphMax:c};for(;r>s;)l*=2,r=Math.round(h/l),l=Math.ceil(h/r);return c-d>r*l&&(l=Math.ceil((c-d)/r)),{steps:r,interval:l,graphMin:d,graphMax:c}}drawAxisTitle(t,n){const i=this.title;if(!(i!=null&&i.use)||isNaN(i.fontSize))return;const s=this.ctx;s.save(),s.font=A.getLabelStyle(i),s.fillStyle=i.color,s.textAlign=i.textAlign;const l={xLeft:t.x1+n.left,xRight:t.x2-n.right,yTop:t.y1};let a,r;const c=10;this.type==="x"?(a=l.xRight,r=t.y2+i.fontSize+c):(r=l.yTop-i.fontSize-c,a=l.xLeft),a>0&&r>0&&s.fillText(i.text,a,r),s.restore()}draw(t,n,i,s,l,a){var L,w,M,V,S,x,I,T,v,E,Z,W,R,X,G,N,P,B;const r=this.ctx,c=this.options,d={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},h=i.steps,u=i.graphMin,f=i.graphMax,m=i.interval,g=d[this.units.rectStart],p=d[this.units.rectEnd],y=d[this.units.rectOffset(this.position)],C=d[this.units.rectOffsetCounter(this.position)],b=5;let k;if(this.drawAxisTitle(t,n),r.font=A.getLabelStyle(this.labelStyle),r.fillStyle=this.labelStyle.color,this.type==="x"?(r.textAlign="center",r.textBaseline=this.position==="top"?"bottom":"top"):(r.textAlign=this.position==="left"?"right":"left",r.textBaseline="middle"),this.showAxis&&(r.lineWidth=this.axisLineWidth,k=A.aliasPixel(r.lineWidth),r.beginPath(),r.strokeStyle=this.axisLineColor,this.type==="x"?(r.moveTo(g,y+k),r.lineTo(p,y+k)):(r.moveTo(y+k,g),r.lineTo(y+k,p)),r.stroke(),r.closePath()),!(h===0||u===null)){if((L=this.labelStyle)!=null&&L.show){const z=p-g,D=z/h,Y=[],F=i.interval;let O=null,H=null,j=g,U=u;if(this.type==="x"&&(c!=null&&c.axesX[0].flow)&&a.length!==h+1){const J=Math.floor(u/F)*F;J!==+u&&(U=J+F,j+=z/(f-u)*(U-u))}r.strokeStyle=this.gridLineColor,r.lineWidth=1,k=A.aliasPixel(r.lineWidth);let Q;for(let J=0;J<=h;J++)if(O=Math.round(j+D*J),O<=p||this.type!=="x"||!(c!=null&&c.axesX[0].flow)||a.length===h+1){r.beginPath(),Y[J]=U+J*m,Y[J]===0&&this.zeroLineColor?r.strokeStyle=this.zeroLineColor:r.strokeStyle=this.gridLineColor,H=O+k,Q=this.getLabelFormat(Math.min(f,Y[J]),{prev:Y[J-1]??""});const q=((M=(w=this.options)==null?void 0:w.selectLabel)==null?void 0:M.use)&&((S=(V=this.options)==null?void 0:V.selectLabel)==null?void 0:S.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((x=l==null?void 0:l.dataIndex)==null?void 0:x.length)&&!(l!=null&&l.label.map(fe=>this.getLabelFormat(Math.min(f,fe),{prev:Y[J-1]??""})).includes(Q));let ee;J===h&&this.lastLabelFontStyle?(r.font=A.getLabelStyle(this.lastLabelFontStyle),ee=this.lastLabelFontStyle.color):J===0&&this.firstLabelFontStyle?(r.font=A.getLabelStyle(this.firstLabelFontStyle),ee=this.firstLabelFontStyle.color):(r.font=A.getLabelStyle(this.labelStyle),ee=this.labelStyle.color);let $=1;A.getColorStringType(ee)==="RGBA"&&($=A.getOpacity(ee)),r.fillStyle=A.colorStringToRgba(ee,q?(I=this.options)==null?void 0:I.unSelectedOpacity:$);let he;if(this.type==="x"){if(he=this.position==="top"?y-10:y+10,((T=c==null?void 0:c.brush)!=null&&T.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(Q),O,he),!q&&((v=c==null?void 0:c.selectItem)!=null&&v.showLabelTip)&&(s!=null&&s.label)&&!((E=this.options)!=null&&E.horizontal)){const fe=this.getLabelFormat(Math.min(f,s.label+0*m));if(fe===Q){const ae=Math.round(r.measureText((Z=this.labelStyle)==null?void 0:Z.fontSize).width);A.showLabelTip({ctx:this.ctx,width:Math.round(r.measureText(fe).width)+10,height:ae,x:O,y:he+(ae-2),borderRadius:2,arrowSize:3,text:Q,backgroundColor:(R=(W=c==null?void 0:c.selectItem)==null?void 0:W.labelTipStyle)==null?void 0:R.backgroundColor,textColor:(G=(X=c==null?void 0:c.selectItem)==null?void 0:X.labelTipStyle)==null?void 0:G.textColor})}}this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(H,y),r.lineTo(H,y+b),r.stroke(),r.closePath()),(J!==0||c!=null&&c.axesX[0].flow)&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(H,y),r.lineTo(H,C),r.stroke(),r.closePath())}else he=this.position==="left"?y-10:y+10,((N=c==null?void 0:c.brush)!=null&&N.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(Q),he,O),J===h&&(H-=1),this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(y+(this.axisLineWidth??1),H),r.lineTo(y-b,H),r.stroke(),r.closePath()),J!==0&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(y,H),r.lineTo(C,H),r.stroke(),r.closePath())}}((P=this.plotBands)!=null&&P.length||(B=this.plotLines)!=null&&B.length)&&(this._plotGeom={aPos:d,axisMin:u,axisMax:f,aliasPixel:k,chartRect:t,labelOffset:n})}}drawPlots(){var p,y,C,b;if(!((p=this.plotBands)!=null&&p.length||(y=this.plotLines)!=null&&y.length)||!this._plotGeom)return;const{aPos:t,axisMin:n,axisMax:i,aliasPixel:s,chartRect:l,labelOffset:a}=this._plotGeom,r=l.chartWidth-(a.left+a.right),c=l.chartHeight-(a.top+a.bottom),d=s+1,h=t.x1,u=t.x2+d,f=t.y1-d,m=t.y2,g={minX:h,maxX:u,minY:f,maxY:m};this.plotLabelHitRegions=[],(C=this.plotBands)==null||C.forEach(k=>{const L=Pe({},k,dl),{from:w,to:M,label:V,border:S}=L,x=A.isNullOrUndefined(w)?n:Math.max(w,n),I=A.isNullOrUndefined(M)?i:Math.min(M,i);let T,v;if(this.type==="x"){if(T=te.calculateX(x,n,i,r,h),v=te.calculateX(I,n,i,r,h),T===null||v===null)return;this.setPlotBandStyle(L),this.drawXPlotBand(T,v,h,u,f,m,S)}else{if(T=te.calculateY(x,n,i,c,m),v=te.calculateY(I,n,i,c,m),T===null||v===null)return;this.setPlotBandStyle(L),this.drawYPlotBand(T,v,h,u,f,m,S)}this.drawPlotBandLabel(T,v,V,g,l,x,I)}),(b=this.plotLines)==null||b.forEach(k=>{if(!Number.isFinite(+k.value))return;const L=Pe({},k,cl),{value:w,label:M}=L;let V;if(this.type==="x"){if(V=te.calculateX(w,n,i,r,h),V===null)return;this.setPlotLineStyle(L),this.drawXPlotLine(V,h,u,f,m)}else{if(V=te.calculateY(w,n,i,c,m),V===null)return;this.setPlotLineStyle(L),this.drawYPlotLine(V,h,u,f,m)}this.drawPlotLineLabel(V,M,g,l,w)})}setPlotLineStyle(t){const n=this.ctx,{color:i,lineWidth:s}=t;n.beginPath(),n.save(),n.lineWidth=s,n.strokeStyle=i,n.setLineDash(t.segments??[])}setPlotBandStyle(t){const n=this.ctx,{color:i}=t;n.beginPath(),n.save(),n.fillStyle=i}drawXPlotBand(t,n,i,s,l,a,r){const c=this.ctx;if(!Number.isFinite(t)||!Number.isFinite(n)){c.closePath(),c.restore();return}c.moveTo(t,l),c.lineTo(t,a),c.lineTo(n,a),c.lineTo(n,l),c.lineTo(t,l),c.fill(),this.drawPlotBandBorder(r,[[t,l,t,a],[n,l,n,a]]),c.restore(),c.closePath()}drawXPlotLine(t,n,i,s,l){const a=this.ctx;if(!Number.isFinite(t)||t<n||t>i){a.closePath(),a.restore();return}let r=t;r+=A.aliasPixel(a.lineWidth),a.moveTo(r,l),a.lineTo(r,s),a.stroke(),a.restore(),a.closePath()}drawYPlotLine(t,n,i,s,l){const a=this.ctx;if(!Number.isFinite(t)||t>l||t<s){a.closePath(),a.restore();return}let r=t;r+=A.aliasPixel(a.lineWidth),a.moveTo(n,r),a.lineTo(i,r),a.stroke(),a.restore(),a.closePath()}drawYPlotBand(t,n,i,s,l,a,r){const c=this.ctx;if(!Number.isFinite(t)||!Number.isFinite(n)){c.closePath(),c.restore();return}c.moveTo(i,t),c.lineTo(i,n),c.lineTo(s,n),c.lineTo(s,t),c.lineTo(i,t),c.fill(),this.drawPlotBandBorder(r,[[i,t,s,t],[i,n,s,n]]),c.restore(),c.closePath()}drawPlotBandBorder(t,n){if(!t||!(t.width>0))return;const i=this.ctx;i.save(),i.beginPath(),i.strokeStyle=t.color??"#000000",i.lineWidth=t.width,i.setLineDash(t.segments??[]),n.forEach(([s,l,a,r])=>{i.moveTo(s,l),i.lineTo(a,r)}),i.stroke(),i.restore()}getNormalizedLabelOptions(t,n,i=null){const s=Pe({},n,mc),l=this.ctx,{maxWidth:a,responsive:r}=s,c=s.fontSize>20?20:s.fontSize,d=t.chartWidth,h=r==null?void 0:r.valueOnlyBelow,u=r==null?void 0:r.hideBelow,f=!A.isNullOrUndefined(u)&&d<u,m=!f&&!A.isNullOrUndefined(h)&&d<h,g=s.text!=null?String(s.text):"",p=!A.isNullOrUndefined(i)&&Number.isFinite(+i);let y="";if(s.showValue&&p)if(typeof s.valueFormatter=="function"){const T=s.valueFormatter(i);y=T==null?String(this.getLabelFormat(i)):String(T)}else y=String(this.getLabelFormat(i));let C;s.showValue?C=m?y:[g,y].filter(T=>T).join(" "):C=g,l.save(),l.font=A.getLabelStyle({...s,fontSize:c});let b=C,k=a??l.measureText(b).width;const L=this.type==="y"?t.width-t.chartWidth:a??t.width;s.position==="outside"&&L<l.measureText(b).width&&s.textOverflow==="ellipsis"&&(b=A.truncateLabelWithEllipsis(C,L,l),k=l.measureText(b).width),l.restore();const w=c/4,M=s.padding;let V=w,S=w,x=w,I=w;return typeof M=="number"?(V=M,S=M,x=M,I=M):M&&typeof M=="object"&&(V=M.top??w,S=M.right??w,x=M.bottom??w,I=M.left??w),{...s,label:b,fontSize:c,labelWidth:k,padTop:V,padRight:S,padBottom:x,padLeft:I,lineGap:s.gap!=null?s.gap:w+2,borderRadius:Math.max(0,s.borderRadius??0),hidden:f,valueOnly:m,hoverText:g}}getPlotBandLabelPosition(t,n,i,s){const{fontSize:l,labelWidth:a,padTop:r,padRight:c,padBottom:d,padLeft:h,position:u}=i,{maxX:f}=s;if(l<=0)return null;const m=(t+n)/2;if(this.type==="x")return this.computeTopLabelBox(m,i,s);if(u==="innerStart"||u==="innerEnd")return this.computeInnerLabelBox(m,i,s);const g=a+h+c,p=l+r+d,y=f+h,C=y+g;let b;switch(i.verticalAlign){case"top":b=n;break;case"bottom":b=t;break;case"middle":default:b=(t+n)/2;break}const k=b-p/2,L=b+p/2;return{textX:y+h+a/2,textY:k+r+l/2,textAlign:"center",textBaseline:"middle",box:{left:y,top:k,right:C,bottom:L},pointerEdge:"left"}}getPlotLineLabelPosition(t,n,i){const{fontSize:s,labelWidth:l,padTop:a,padRight:r,padBottom:c,padLeft:d,position:h}=n,{maxX:u}=i;if(s<=0)return null;if(this.type==="x")return this.computeTopLabelBox(t,n,i);if(h==="innerStart"||h==="innerEnd")return this.computeInnerLabelBox(t,n,i);const f=l+d+r,m=s+a+c,g=u+d,p=g+f;let y,C;switch(n.verticalAlign){case"top":C=t,y=C-m;break;case"bottom":y=t,C=y+m;break;case"middle":default:y=t-m/2,C=t+m/2;break}return{textX:g+d+l/2,textY:y+a+s/2,textAlign:"center",textBaseline:"middle",box:{left:g,top:y,right:p,bottom:C},pointerEdge:"left"}}computeTopLabelBox(t,n,i){const{labelWidth:s,fontSize:l,padTop:a,padRight:r,padBottom:c,padLeft:d,textAlign:h}=n,{minY:u}=i,f=s+d+r,m=l+a+c,g=n.gap!=null?n.gap:2,p=u-g,y=p-m,C=0;let b,k;switch(h){case"left":k=t-C,b=k-f;break;case"right":b=t+C,k=b+f;break;default:b=t-f/2,k=t+f/2;break}return{textX:b+d+s/2,textY:y+a+l/2,textAlign:"center",textBaseline:"middle",box:{left:b,top:y,right:k,bottom:p},pointerEdge:"bottom",pointerTipX:t}}computeInnerLabelBox(t,n,i){const{labelWidth:s,fontSize:l,padTop:a,padRight:r,padBottom:c,padLeft:d,lineGap:h,position:u,verticalAlign:f,textAlign:m}=n,{minX:g,maxX:p,minY:y,maxY:C}=i,b=s+d+r,k=l+a+c;let L,w,M,V;if(this.type==="x")switch(u==="innerEnd"?(V=C-h,w=V-k):(w=y+h,V=w+k),m){case"left":L=t+h,M=L+b;break;case"right":M=t-h,L=M-b;break;default:L=t-b/2,M=t+b/2;break}else switch(u==="innerEnd"?(M=p-h,L=M-b):(L=g+h,M=L+b),f){case"top":V=t-h,w=V-k;break;case"bottom":w=t+h,V=w+k;break;default:w=t-k/2,V=t+k/2;break}let S;return this.type==="x"?S=u==="innerEnd"?"top":"bottom":f==="top"?S="bottom":f==="bottom"?S="top":S=null,{textX:L+d+s/2,textY:w+a+l/2,textAlign:"center",textBaseline:"middle",box:{left:L,top:w,right:M,bottom:V},pointerEdge:S}}drawPlotLabel(t,n){var w,M;if(!n)return;const{textX:i,textY:s,textAlign:l="left",textBaseline:a="alphabetic",box:r}=n,{label:c,fontSize:d,fontColor:h,fillColor:u,lineColor:f,lineWidth:m,borderRadius:g=0}=t;if(d<=0||!r)return;const{left:p,top:y,right:C,bottom:b}=r,k=this.ctx;k.save(),k.beginPath(),k.font=A.getLabelStyle(t),k.setLineDash([]),k.fillStyle=u,k.strokeStyle=f,k.lineWidth=m;const L=Math.min(g,Math.abs(C-p)/2,Math.abs(b-y)/2);L>0?(k.moveTo(p+L,y),k.lineTo(C-L,y),k.arcTo(C,y,C,y+L,L),k.lineTo(C,b-L),k.arcTo(C,b,C-L,b,L),k.lineTo(p+L,b),k.arcTo(p,b,p,b-L,L),k.lineTo(p,y+L),k.arcTo(p,y,p+L,y,L),k.closePath()):(k.moveTo(p,b),k.lineTo(p,y),k.lineTo(C,y),k.lineTo(C,b),k.lineTo(p,b)),k.fill(),m>0&&k.stroke(),(w=t.pointer)!=null&&w.show&&n.pointerEdge&&this.drawLabelPointer(r,n.pointerEdge,t.pointer.color??u,f,m,n.pointerTipX,L),k.fillStyle=h,k.textAlign=l,k.textBaseline=a,k.fillText(c,i,s),k.closePath(),k.restore(),t.valueOnly&&((M=t.showTextOnHover)!=null&&M.use)&&t.hoverText&&(this.plotLabelHitRegions||(this.plotLabelHitRegions=[]),this.plotLabelHitRegions.push({x:Math.min(p,C),y:Math.min(y,b),width:Math.abs(C-p),height:Math.abs(b-y),text:t.hoverText,style:t.showTextOnHover}))}drawLabelPointer(t,n,i,s,l,a,r=0){const c=this.ctx,d=4,h=4,u=(t.left+t.right)/2,f=(t.top+t.bottom)/2,m=Math.min(r+h,(t.right-t.left)/2),g=Math.min(r+h,(t.bottom-t.top)/2),p=a??u,y=Math.max(t.left+m,Math.min(t.right-m,p)),C=Math.max(t.top+g,Math.min(t.bottom-g,f));let b,k,L,w,M,V;switch(n){case"top":b=y-h,k=t.top,L=y+h,w=t.top,M=p,V=t.top-d;break;case"left":b=t.left,k=C-h,L=t.left,w=C+h,M=t.left-d,V=C;break;case"right":b=t.right,k=C-h,L=t.right,w=C+h,M=t.right+d,V=C;break;case"bottom":default:b=y-h,k=t.bottom,L=y+h,w=t.bottom,M=p,V=t.bottom+d;break}c.beginPath(),c.moveTo(b,k),c.lineTo(M,V),c.lineTo(L,w),c.closePath(),c.fillStyle=i,c.fill(),l>0&&(c.beginPath(),c.moveTo(b,k),c.lineTo(M,V),c.lineTo(L,w),c.strokeStyle=s,c.lineWidth=l,c.stroke())}drawPlotLineLabel(t,n,i,s,l=null){if(!(n!=null&&n.show))return;const a=this.getNormalizedLabelOptions(s,n,l);if(a.hidden)return;const r=this.getPlotLineLabelPosition(t,a,i);this.drawPlotLabel(a,r)}drawPlotBandLabel(t,n,i,s,l,a,r){if(!(i!=null&&i.show))return;if(i.showValue){const h=a<=r,u=this.type==="x"?{textAlign:h?"left":"right"}:{verticalAlign:h?"bottom":"top"},f=this.type==="x"?{textAlign:h?"right":"left"}:{verticalAlign:h?"top":"bottom"};this.drawPlotLineLabel(t,{...i,...u},s,l,a),this.drawPlotLineLabel(n,{...i,...f},s,l,r);return}const c=this.getNormalizedLabelOptions(l,i,null);if(c.hidden)return;const d=this.getPlotBandLabelPosition(t,n,c,s);this.drawPlotLabel(c,d)}checkFixWidth(t){const{fixWidth:n,fitDir:i}=this.labelStyle;return Re(n)&&n>0?A.truncateLabelWithEllipsis(t,n,this.ctx,i):t}}function l1(e){if(typeof e=="string"&&Tt[e])return{ms:Tt[e].size,unit:e,time:1};if(typeof e=="object"&&e!==null&&e.unit&&e.time>0){const t=Tt[e.unit];return t?{ms:e.time*t.size,unit:e.unit,time:e.time}:null}return typeof e=="number"&&e>0&&Number.isFinite(e)?{ms:e,unit:null,time:null}:null}function xc(e){return e.hour()===0&&e.minute()===0&&e.second()===0&&e.millisecond()===0?e:e.startOf("day")}function a1(e,t){if(!t.unit)return We(e.valueOf()+t.ms);const n=t.time||1;switch(t.unit){case"month":return e.add(n,"month");case"quarter":return e.add(n*3,"month");case"year":return e.add(n,"year");case"week":return xc(e.add(n*7,"day"));case"day":return xc(e.add(n,"day"));default:return We(e.valueOf()+t.ms)}}function r1(e,t){return t.unit?a1(We(e),t).valueOf():e+t.ms}function c1(e,t){if(!t.unit)return Math.ceil(e/t.ms)*t.ms;const n=t.time||1,i=We(e);if(["millisecond","second","minute","hour"].includes(t.unit)){const s=i.startOf("day").valueOf(),l=Tt[t.unit].size*n,a=e-s;return s+Math.ceil(a/l)*l}if(t.unit==="day"){const s=i.startOf("year"),l=i.startOf("day"),a=Math.round((l.valueOf()-s.valueOf())/Tt.day.size),r=l.valueOf()>=e?a:a+1,c=Math.ceil(r/n)*n;return s.add(c,"day").valueOf()}if(t.unit==="week"){const s=i.startOf("year"),l=s.subtract((s.day()+6)%7,"day"),a=i.subtract((i.day()+6)%7,"day").startOf("day"),r=Math.round((a.valueOf()-l.valueOf())/Tt.week.size),c=a.valueOf()>=e?r:r+1,d=Math.ceil(c/n)*n;return l.add(d*7,"day").valueOf()}if(t.unit==="month"){const s=i.startOf("year"),l=i.startOf("month"),a=i.month(),r=l.valueOf()>=e?a:a+1,c=Math.ceil(r/n)*n;return s.add(c,"month").valueOf()}if(t.unit==="quarter"){const s=i.startOf("year"),l=Math.floor(i.month()/3),r=i.month(l*3).startOf("month").valueOf()>=e?l:l+1,c=Math.ceil(r/n)*n;return s.add(c*3,"month").valueOf()}if(t.unit==="year"){const s=i.startOf("year"),l=2e3,a=s.valueOf()>=e?i.year()-l:i.year()+1-l,r=Math.ceil(a/n)*n;return We(`${l+r}-01-01`).startOf("day").valueOf()}return e}function d1(e,t,n){const i=[];let s=c1(e,n);const l=1e4;for(;s<=t&&i.length<l;)i.push(s),s=r1(s,n);return i}const hl=864e5,h1=["millisecond","second","minute","hour"],ul=new Map;function u1(e){if(ul.has(e))return ul.get(e);const t=[],n=[];for(let s=1;s*s<=e;s+=1)e%s===0&&(t.push(s),s!==e/s&&n.push(e/s));const i=t.concat(n.reverse());return ul.set(e,i),i}function Sc(e,t,n){const i=Math.ceil(t/e.ms);let s=i>n?Math.max(1,Math.floor(i/n)):1,l=e.ms*s;const a=s+1e4;for(;s<=a&&Math.floor(t/l)+1>n;)s+=1,l=e.ms*s;return e.unit?{ms:l,unit:e.unit,time:(e.time||1)*s}:{ms:l,unit:null,time:null}}function f1(e,t,n){const i=s=>Math.floor(t/s)+1<=n;if(i(e.ms))return e;if(e.unit&&h1.includes(e.unit)&&hl%e.ms===0){const s=u1(hl/e.ms);for(let l=0;l<s.length;l+=1){const a=e.ms*s[l];if(i(a))return{ms:a,unit:e.unit,time:(e.time||1)*s[l]}}return Sc({ms:hl,unit:"day",time:1},t,n)}return Sc(e,t,n)}function Cc(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=We(e).valueOf();return Number.isFinite(t)?t:null}class m1 extends Ii{normalizeTimeValue(t){return Cc(t)}calculateScaleRange(t,n){const i=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(i)||typeof i=="function")&&((t==null?void 0:t.min)==null||(t==null?void 0:t.max)==null))return{min:null,max:null,minLabel:"",maxLabel:"",size:A.calcTextSizeCanvas("",A.getLabelStyle(this.labelStyle))};let l=i;Array.isArray(i)&&i.length===2?l=[this.normalizeTimeValue(i[0]),this.normalizeTimeValue(i[1])]:typeof i=="function"&&(l=(...h)=>{const[u,f]=i(...h);return[this.normalizeTimeValue(u),this.normalizeTimeValue(f)]});const a=this.range,r=n!=null&&n.use?{...n,range:l}:n,c={...t,min:this.normalizeTimeValue(t==null?void 0:t.min),max:this.normalizeTimeValue(t==null?void 0:t.max)};let d;try{n!=null&&n.use||(this.range=l),d=super.calculateScaleRange(c,r)}finally{this.range=a}return{...d,min:this.normalizeTimeValue(d.min),max:this.normalizeTimeValue(d.max)}}getLabelFormat(t,n={}){if(this.formatter){const i=this.formatter(t,n);if(typeof i=="string")return i}return We(t).format(this.timeFormat)}getInterval(t){const n=this.normalizeTimeValue(t.maxValue),i=this.normalizeTimeValue(t.minValue),s=t.maxSteps;if(this.interval){let l;if(typeof this.interval=="string"?l=Tt[this.interval].size:typeof this.interval=="object"?l=this.interval.time*Tt[this.interval.unit].size:typeof this.interval=="number"&&(l=this.interval),l>0&&Number.isFinite(l))return l}return Math.ceil((n-i)/s)}calculateSteps(t){const n=this.normalizeTimeValue(t.minValue),i=this.normalizeTimeValue(t.maxValue),s=Math.max(1,t.maxSteps??1);if(n==null||i==null)return{steps:0,interval:0,baseInterval:0,graphMin:null,graphMax:null,ticks:[]};const l=+n,a=+i;if(l>=a)return{steps:0,interval:0,baseInterval:0,graphMin:l,graphMax:a,ticks:[]};const r=l1(this.interval);let c;r?c=r:c={ms:Math.max(1,Math.ceil((a-l)/Math.max(1,s))),unit:null,time:null};const d=a-l,h=this.fixedSteps?c:f1(c,d,s),u=h.ms,f=d1(l,a,h);return{steps:Math.max(0,f.length-1),interval:u,baseInterval:c.ms,graphMin:l,graphMax:a,ticks:f}}draw(t,n,i,s,l){var b,k,L,w,M,V,S,x,I,T,v,E,Z,W,R,X,G,N;const a=this.ctx,r=this.options,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=i.graphMin,h=i.graphMax,u=i.ticks,f=c[this.units.rectStart],m=c[this.units.rectEnd],g=c[this.units.rectOffset(this.position)],p=c[this.units.rectOffsetCounter(this.position)],y=5;let C=0;if(this.drawAxisTitle(t,n),a.font=A.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),this.showAxis&&(a.lineWidth=this.axisLineWidth,C=A.aliasPixel(a.lineWidth),a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,g+C),a.lineTo(m,g+C)):(a.moveTo(g+C,f),a.lineTo(g+C,m)),a.stroke(),a.closePath()),!(!(u!=null&&u.length)||d===null)){if((b=this.labelStyle)!=null&&b.show){const P=c.x2-c.x1,B=c.y2-c.y1;a.strokeStyle=this.gridLineColor,a.lineWidth=1,C=A.aliasPixel(a.lineWidth);let z;for(let D=0;D<u.length;D++){const Y=u[D];let F;if(this.type==="x"?F=te.calculateX(Y,d,h,P,c.x1):F=te.calculateY(Y,d,h,B,c.y2),F===null)continue;Y===0&&this.zeroLineColor?a.strokeStyle=this.zeroLineColor:a.strokeStyle=this.gridLineColor;const H=F+C;z=this.getLabelFormat(Y,{prev:u[D-1]??""});const j=((L=(k=this.options)==null?void 0:k.selectLabel)==null?void 0:L.use)&&((M=(w=this.options)==null?void 0:w.selectLabel)==null?void 0:M.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((V=l==null?void 0:l.dataIndex)==null?void 0:V.length)&&!(l!=null&&l.label.map(ne=>this.getLabelFormat(ne,{prev:u[D-1]??""})).includes(z));let U;D===u.length-1&&this.lastLabelFontStyle?(a.font=A.getLabelStyle(this.lastLabelFontStyle),U=this.lastLabelFontStyle.color):D===0&&this.firstLabelFontStyle?(a.font=A.getLabelStyle(this.firstLabelFontStyle),U=this.firstLabelFontStyle.color):(a.font=A.getLabelStyle(this.labelStyle),U=this.labelStyle.color);let Q=1;A.getColorStringType(U)==="RGBA"&&(Q=A.getOpacity(U)),a.fillStyle=A.colorStringToRgba(U,j?(S=this.options)==null?void 0:S.unSelectedOpacity:Q);let J;if(this.type==="x"){if(J=this.position==="top"?g-10:g+10,((x=r==null?void 0:r.brush)!=null&&x.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(z),F,J),!j&&((I=r==null?void 0:r.selectItem)!=null&&I.showLabelTip)&&(s!=null&&s.label)&&!((T=this.options)!=null&&T.horizontal)){const ne=this.getLabelFormat(s.label);if(ne===z){const q=Math.round(a.measureText((v=this.labelStyle)==null?void 0:v.fontSize).width);A.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(ne).width)+10,height:q,x:F,y:J+(q-2),borderRadius:2,arrowSize:3,text:z,backgroundColor:(Z=(E=r==null?void 0:r.selectItem)==null?void 0:E.labelTipStyle)==null?void 0:Z.backgroundColor,textColor:(R=(W=r==null?void 0:r.selectItem)==null?void 0:W.labelTipStyle)==null?void 0:R.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(H,g),a.lineTo(H,g+y),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(H,g),a.lineTo(H,p),a.stroke(),a.closePath())}else{J=this.position==="left"?g-10:g+10,((X=r==null?void 0:r.brush)!=null&&X.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(z),J,F);let ne=H;D===u.length-1&&(ne-=1),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),ne),a.lineTo(g-y,ne),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(g,ne),a.lineTo(p,ne),a.stroke(),a.closePath())}}}((G=this.plotBands)!=null&&G.length||(N=this.plotLines)!=null&&N.length)&&(this._plotGeom={aPos:c,axisMin:d,axisMax:h,aliasPixel:C,chartRect:t,labelOffset:n})}}drawPlots(){var p,y,C,b;if(!((p=this.plotBands)!=null&&p.length||(y=this.plotLines)!=null&&y.length)||!this._plotGeom)return;const{aPos:t,axisMin:n,axisMax:i,aliasPixel:s,chartRect:l,labelOffset:a}=this._plotGeom,r=l.chartWidth-(a.left+a.right),c=l.chartHeight-(a.top+a.bottom),d=s+1,h=t.x1,u=t.x2+d,f=t.y1-d,m=t.y2,g={minX:h,maxX:u,minY:f,maxY:m};this.plotLabelHitRegions=[],(C=this.plotBands)==null||C.forEach(k=>{const L=Pe({},k,dl),{from:w,to:M,label:V,border:S}=L,x=A.isNullOrUndefined(w)?n:Math.max(w,n),I=A.isNullOrUndefined(M)?i:Math.min(M,i);let T,v;if(this.type==="x"){if(T=te.calculateX(x,n,i,r,h),v=te.calculateX(I,n,i,r,h),T===null||v===null)return;this.setPlotBandStyle(L),this.drawXPlotBand(T,v,h,u,f,m,S)}else{if(T=te.calculateY(x,n,i,c,m),v=te.calculateY(I,n,i,c,m),T===null||v===null)return;this.setPlotBandStyle(L),this.drawYPlotBand(T,v,h,u,f,m,S)}this.drawPlotBandLabel(T,v,V,g,l,x,I)}),(b=this.plotLines)==null||b.forEach(k=>{if(!Number.isFinite(+k.value))return;const L=Pe({},k,cl),{value:w,label:M}=L;let V;if(this.type==="x"){if(V=te.calculateX(w,n,i,r,h),V===null)return;this.setPlotLineStyle(L),this.drawXPlotLine(V,h,u,f,m)}else{if(V=te.calculateY(w,n,i,c,m),V===null)return;this.setPlotLineStyle(L),this.drawYPlotLine(V,h,u,f,m)}this.drawPlotLineLabel(V,M,g,l,w)})}}class p1 extends Ii{getTruthyValue(t){const n=this.adjustedDecimalPoint??this.decimalPoint;return Re(t)?Number(t.toFixed(n)):t}getLabelFormat(t,n={}){if(this.formatter){const s=this.getTruthyValue(t),l=this.formatter(s,{...n,prevOriginalValue:n==null?void 0:n.prev,prevDecimalPointValue:this.getTruthyValue(n==null?void 0:n.prev),currentOriginalValue:t,currentDecimalPointValue:s});if(typeof l=="string")return l}const i=this.adjustedDecimalPoint??this.decimalPoint;return A.labelSignFormat(t,i)}getInterval(t){if(this.interval)return this.interval;let n=0;const i=t.maxValue,s=t.minValue,l=t.maxSteps;if(!l||l<=0)return 0;if(this.startToZero&&s<0){const a=Math.abs(s)+Math.abs(i),r=Math.abs(s)/a,c=Math.abs(i)/a;let d=Math.max(1,Math.round(r*l)),h=Math.max(1,l-d);d+h>l&&(r>c?d-=1:h-=1),n=Math.max(Math.abs(s)/(d||1),Math.abs(i)/(h||1))}else n=(i-s)/l;return this.decimalPoint?n:Math.ceil(n)}getExactInterval(t,n){if(!Number.isFinite(t)||t<=0)return{interval:1,steps:1};const i=Math.max(1,n);let s=null,l=0,a=1/0;for(let r=i;r>=1;r--){const c=t/r;let d=1;for(let h=0;h<=12;h++,d*=10){const u=c*d;if(Math.abs(u-Math.round(u))<1e-6){h<a&&c<t&&(a=h,s=Math.round(u)/d,l=r);break}}if(a===0)break}return l>0?{interval:s,steps:l}:{interval:parseFloat((t/i).toFixed(12)),steps:i}}getStepsWithNiceScale({max:t,min:n,maxSteps:i}){const s=t-n;if(!Number.isFinite(s)||s<=0)return{max:n+1,min:n,interval:1,steps:1};const l=s/i,a=Math.floor(Math.log10(l)),r=Math.ceil(Math.log10(s));let c=t,d=n,h=0,u=0,f=1/0;for(let m=a;m<=r;m++){const g=10**m;for(const p of qC){const y=p*g;if(y>=l){const C=y*1e-10,b=Math.floor((n+C)/y)*y,k=Math.ceil((t-b-C)/y),L=b+y*k;if(k<=i&&L>=t-C){const w=n-b+(L-t);w<f&&(c=L,d=b,h=y,u=k,f=w)}}}}if(!(h>0)||u<=0){const m=Math.max(1,i),g=s/m||1;return{max:t,min:n,interval:g,steps:m}}return{max:c,min:d,interval:h,steps:u}}getDecimalPointFromInterval(t){if(!Number.isFinite(t)||t===0)return 0;const n=Math.abs(t),i=10,s=1e-10,l=(c,d=0)=>{const h=10**d;return Math.round((c+Number.EPSILON)*h)/h},a=(c,d)=>{const h=l(c,d);return Math.abs(c-h)<s};if(n>=1&&a(n,0))return 0;const r=n>=1?0:Math.max(0,Math.ceil(-Math.log10(n)));for(let c=r;c<=i;c+=1)if(a(n,c))return c;return i}getLegacyOneMaxScale(t){return this.decimalPoint?t>2?{interval:.2,steps:5}:{interval:.5,steps:2}:{interval:1,steps:1}}calculateSteps(t){const{minValue:n,maxValue:i}=t,s=Math.max(1,t.maxSteps??1),l=Array.isArray(this.range)&&this.range.length===2,r=typeof this.interval=="number"||typeof this.interval=="object"&&this.interval!==null?this.getInterval(t):null,c=r!=null&&r>0&&Number.isFinite(r),d=l?+this.range[0]:null,h=l?+this.range[1]:null,u=1e-10,f=b=>{if(this.decimalPoint==="auto"){const k=this.getDecimalPointFromInterval(b);k!=null&&!Number.isNaN(k)?this.adjustedDecimalPoint=k:typeof this.getAutoDecimalPointFromInterval=="function"?this.adjustedDecimalPoint=this.getAutoDecimalPointFromInterval(b):this.adjustedDecimalPoint=0}else this.adjustedDecimalPoint=this.decimalPoint},m=(b,k)=>Math.max(1,Math.round(b/k+u)),g=({min:b,max:k,interval:L})=>{let w=0,M=0;return b>=0?(w=+b,M=Math.ceil(k/L)*L):k>=0?(w=Math.floor(b/L)*L,M=Math.ceil(k/L)*L):(M=+k,w=Math.floor(b/L)*L),{graphMin:w,graphMax:M}};if(l&&c){const b=d,k=h,L=r,M=(k-b)/L;if(Math.abs(M-Math.round(M))<u&&M<=s||this.fixedSteps){const S=Math.round(M);return f(L),{steps:S,interval:L,graphMin:b,graphMax:k}}}if(l){const b=d,k=h,L=k-b,{interval:w,steps:M}=this.getExactInterval(L,s);return f(w),{steps:M,interval:w,graphMin:b,graphMax:k}}if(c){let b=r,k=0,L=0,w=0,M=0;for({graphMin:k,graphMax:L}=g({min:n,max:i,interval:b}),w=L-k,M=m(w,b);M>s;)b+=r,{graphMin:k,graphMax:L}=g({min:n,max:i,interval:b}),w=L-k,M=m(w,b);return f(b),{steps:M,interval:b,graphMin:k,graphMax:L}}const p=this.startToZero&&n>=0?0:n,y=this.startToZero&&i<=0?0:i;if(p===0&&y===1){const b=this.getLegacyOneMaxScale(s);return f(b.interval),{steps:b.steps,interval:b.interval,graphMin:p,graphMax:y}}const C=this.getStepsWithNiceScale({min:p,max:y,maxSteps:s});return f(C.interval),{steps:C.steps,interval:C.interval,graphMin:C.min,graphMax:C.max}}calculateScaleRange(t,n){var u;let i,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(a)||typeof a=="function")&&((t==null?void 0:t.min)==null||(t==null?void 0:t.max)==null)){const f=this.getLabelFormat(0),m=this.getLabelFormat(1,{isMaxValueSameAsMin:!0});return{min:0,max:1,minLabel:f,maxLabel:m,size:A.calcTextSizeCanvas(m,A.getLabelStyle(this.labelStyle))}}Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(i=a[1]>+t.max?+t.max:a[1],s=a[0]<+t.min?+t.min:a[0]):(i=a[1],s=a[0]):typeof a=="function"?[s,i]=a(t.min,t.max):(i=t.max,s=t.min);const c=Array.isArray(this.range)&&this.range.length===2;if(this.autoScaleRatio&&!c){const f=i,m=i*(this.autoScaleRatio+1);if(i=this.decimalPoint?m:Math.ceil(m),i>0&&s<0){const g=f-i;s+=g}else if(i<0&&s<0){const g=s*(this.autoScaleRatio+1);s=this.decimalPoint?g:Math.ceil(g)}}this.startToZero&&!c&&(s>0&&(s=0),i<0&&(i=0)),i===s&&(i+=1,l=!0);const d=this.getLabelFormat(s),h=this.getLabelFormat(i,{isMaxValueSameAsMin:l});return{min:s,max:i,minLabel:d,maxLabel:h,size:A.calcTextSizeCanvas(h,A.getLabelStyle(this.labelStyle),(u=this.labelStyle)==null?void 0:u.padding)}}}class g1 extends Ii{calculateScaleRange(t){let n,i,s=!1;Array.isArray(this.range)&&this.range.length===2?(n=this.range[1],i=this.range[0]):typeof range=="function"?[i,n]=this.range(t.min,t.max):(n=t.max,i=t.min);const l=A.calculateMagnitude(n-i);n=Math.ceil(n/10**l)*10**l,this.startToZero&&(i=0),n===i&&(n+=1,s=!0);const a=this.getLabelFormat(i),r=this.getLabelFormat(n,{isMaxValueSameAsMin:s});return{min:i,max:n,minLabel:a,maxLabel:r,size:A.calcTextSizeCanvas(r,A.getLabelStyle(this.labelStyle))}}calculateSteps(t,n){const i=t.maxValue,s=t.minValue,l=t.maxSteps,a=A.calculateMagnitude(i-s);let r=this.getInterval(t),c;const d=i,h=s,u=d-h;for(c=Math.round(u/r),i===1&&(r=.2,c=5);(c>l||c*2<l)&&!n;)if(c>l)r*=2,c=Math.ceil(u/r);else if(a>=0)if(r/2%1===0)r/=2,c=Math.ceil(u/r);else break;else r/=2,c=Math.ceil(u/r);return{steps:c,interval:r,graphMin:h,graphMax:Math.ceil(h+c*r)}}getLabelFormat(t,n={}){if(this.formatter){const i=this.formatter(t,n);if(typeof i=="string")return i}return A.labelSignFormat(t,this.decimalPoint)}getInterval(t){const n=t.maxValue,i=t.minValue;return 10**A.calculateMagnitude(n-i)}}const fl=new WeakMap;class b1 extends Ii{constructor(t,n,i,s,l){super(t,n,i,l),this.labels=s}getMaxWidth(t,n){var s;const i=(s=this.labelStyle)==null?void 0:s.maxWidth;if(i==null)return n;if(typeof i=="string"){const l=i.trim();if(l.includes("%")){const r=Number.parseFloat(l.replace("%",""));return Number.isNaN(r)?n:t.chartWidth*(r/100)}const a=Number.parseFloat(l);return Number.isNaN(a)?n:a}return i}getStepMinMax(t,n){return this.labelStyle.alignToGridLine?t:n!=null&&n.use?(fl.has(this.labels)||fl.set(this.labels,A.getStringMinMax(this.labels)),fl.get(this.labels)):A.getStringMinMax(this.labels)}calculateScaleRange(t,n,i){const s=this.getStepMinMax(t,n);let l=s.max,a=s.min,r=0,c=this.labels.length-1,d=this.labels.length;const h=n!=null&&n.use?n==null?void 0:n.range:this.range;if(Array.isArray(h)&&(h!=null&&h.length)){const[f,m]=h;Re(f)&&Re(m)&&(r=f<r?r:f,c=m>c?c:m,l=this.labels[c],a=this.labels[r],d=c-r+1)}else if(typeof h=="function"){const[f,m]=h(a,l);r=f<r?r:f,c=m>c?c:m,l=this.labels[c],a=this.labels[r],d=c-r+1}const u=this.getMaxWidth(i,i.chartWidth/(d+2));return{min:a,max:l,minIndex:r,maxIndex:c,minLabel:this.getLabelFormat(a,u),maxLabel:this.getLabelFormat(l,u),size:A.calcTextSizeCanvas(this.getLabelFormat(l,u),A.getLabelStyle(this.labelStyle))}}getIndexInterval(t){const n=t.maxSteps;return this.interval?this.interval:Math.ceil(this.labels.length/n)}calculateSteps(t){const{minValue:n,maxValue:i,minIndex:s,maxIndex:l}=t,a=l-s+1;let r=1;const c=this.labels.every(d=>!isNaN(d));return this.labelStyle.alignToGridLine&&c&&(r=this.getIndexInterval(t)),{oriSteps:a,steps:a,indexInterval:r,graphMin:n,graphMax:i,minIndex:s,maxIndex:l}}draw(t,n,i,s,l){var b,k,L,w,M,V,S,x,I;const a=this.ctx,r=this.labels,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=i.steps,h=i.indexInterval,u=i.minIndex,f=c[this.units.rectStart],m=c[this.units.rectEnd],g=c[this.units.rectOffset(this.position)],p=c[this.units.rectOffsetCounter(this.position)],y=this.getMaxWidth(t,t.chartWidth/(d+2)),C=5;if(this.drawAxisTitle(t,n),(b=this.labelStyle)!=null&&b.show){a.font=A.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const T=A.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,g+T),a.lineTo(m,g+T)):(a.moveTo(g+T,f),a.lineTo(g+T,m)),a.stroke(),d===0)return;const v=(m-f)/d,E=this.labelStyle.alignToGridLine;let Z=null,W=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let R,X,G;for(G=0;G<d;G+=h){const N=u+G,P=this.labels[N];Z=Math.round(f+v*G),W=Z+T,R=this.getLabelFormat(P,y);const{selectLabel:B,selectItem:z,horizontal:D}=this.options;let Y;l!=null&&l.targetAxis?Y=(l==null?void 0:l.targetAxis)==="yAxis"?"y":"x":Y=D?"y":"x";const F=(B==null?void 0:B.use)&&(B==null?void 0:B.useLabelOpacity)&&Y===this.type&&((k=l==null?void 0:l.dataIndex)==null?void 0:k.length)&&!((L=l==null?void 0:l.dataIndex)!=null&&L.includes(N));let O;G===d-1&&this.lastLabelFontStyle?(a.font=A.getLabelStyle(this.lastLabelFontStyle),O=this.lastLabelFontStyle.color):G===0&&this.firstLabelFontStyle?(a.font=A.getLabelStyle(this.firstLabelFontStyle),O=this.firstLabelFontStyle.color):(a.font=A.getLabelStyle(this.labelStyle),O=this.labelStyle.color);let H=1;if(A.getColorStringType(O)==="RGBA"&&(H=A.getOpacity(O)),a.fillStyle=A.colorStringToRgba(O,F?(w=this.options)==null?void 0:w.unSelectedOpacity:H),this.type==="x"){X=this.position==="top"?g-10:g+10;const j=E?Z:Z+v/2;if(a.fillText(this.checkFixWidth(R),j,X),!F&&(z!=null&&z.showLabelTip)&&(s!=null&&s.label)&&!D){const U=s.label;if(U===R){const Q=Math.round(a.measureText((M=this.labelStyle)==null?void 0:M.fontSize).width);A.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(U).width)+10,height:Q,x:Z+v/2,y:X+(Q-2),borderRadius:2,arrowSize:3,text:R,backgroundColor:(V=z==null?void 0:z.labelTipStyle)==null?void 0:V.backgroundColor,textColor:(S=z==null?void 0:z.labelTipStyle)==null?void 0:S.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(Z+v/2,g),a.lineTo(Z+v/2,g+C),a.stroke(),a.closePath()),G>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(W,g),a.lineTo(W,p),a.stroke(),a.closePath())}else{X=this.position==="left"?g-10:g+10;const j=E?Z:Z+v/2;a.fillText(this.checkFixWidth(R),X,j),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),j),a.lineTo(g-C,j),a.stroke(),a.closePath()),G>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(g,W),a.lineTo(p,W),a.stroke(),a.closePath())}a.stroke()}if(this.showLastLabel){const N=u+d-1;if(u+Math.floor((d-1)/h)*h!==N){const B=Math.round(f+v*(d-1)),z=E?B:B+v/2,D=this.getLabelFormat(r[N],y);a.font=this.lastLabelFontStyle?A.getLabelStyle(this.lastLabelFontStyle):A.getLabelStyle(this.labelStyle),a.fillStyle=this.lastLabelFontStyle?this.lastLabelFontStyle.color:this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(D),z,X):a.fillText(this.checkFixWidth(D),X,z),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(z,g),a.lineTo(z,g+C)):(a.moveTo(g+(this.axisLineWidth??1),z),a.lineTo(g-C,z)),a.stroke(),a.closePath())}}if(E&&!this.showLastLabel){const N=tS(+r[1],+r[0]),P=qo(+r[r.length-1],N);if(isNaN(P))return;Z=Math.round(f+v*this.labels.length),W=Z+T;const B=this.getLabelFormat(`${P}`,y),z=Z+v/2;a.font=A.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(B),Z,X):a.fillText(this.checkFixWidth(B),X,Z),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(z,g),a.lineTo(z,g+C)):(a.moveTo(g+(this.axisLineWidth??1),W),a.lineTo(g-C,W)),a.stroke(),a.closePath())}a.closePath()}((x=this.plotBands)!=null&&x.length||(I=this.plotLines)!=null&&I.length)&&(this._plotGeom={aPos:c,startPoint:f,endPoint:m,chartRect:t,aliasPixel:A.aliasPixel(a.lineWidth)})}drawPlots(){var g,p,y,C;if(!((g=this.plotBands)!=null&&g.length||(p=this.plotLines)!=null&&p.length)||!this._plotGeom)return;const t=this.labels,{aPos:n,startPoint:i,endPoint:s,chartRect:l,aliasPixel:a}=this._plotGeom,r=a+1,c=n.x1+r,d=n.x2,h=n.y1+r,u=n.y2,f=(s-i)/(this.labelStyle.show?t.length:1),m={minX:c,maxX:d,minY:h,maxY:u};this.plotLabelHitRegions=[],(y=this.plotBands)==null||y.forEach(b=>{if(A.isNullOrUndefined(b.from)&&A.isNullOrUndefined(b.to))return;const k=Pe({},b,dl),{from:L=0,to:w=t.length,label:M,border:V}=k,S=Math.round(i+f*L),x=Math.round(i+f*w);this.setPlotBandStyle(k),this.type==="x"?this.drawXPlotBand(S,x,c,d,h,u,V):this.drawYPlotBand(S,x,c,d,h,u,V),this.drawPlotBandLabel(S,x,M,m,l,L,w)}),(C=this.plotLines)==null||C.forEach(b=>{if(A.isNullOrUndefined(b.value))return;const k=Pe({},b,cl),{value:L,label:w}=k,M=Math.round(i+f*L)+f/2;this.setPlotLineStyle(k),this.type==="x"?this.drawXPlotLine(M,c,d,h,u):this.drawYPlotLine(M,c,d,h,u),this.drawPlotLineLabel(M,w,m,l,L)})}getLabelFormat(t,n,i={}){if(this.formatter){const s=this.formatter(t,i);if(typeof s=="string")return s}return this.labelStyle.fitWidth?this.fittingString(t,n):t}fittingString(t,n){const i=this.ctx;i.save(),i.font=A.getLabelStyle(this.labelStyle);const s=this.labelStyle.fitDir;return A.truncateLabelWithEllipsis(t,n,i,s)}getLabelWidthHasMaxLength(t,n,i=[]){const s=A.getLabelStyle(this.labelStyle),l=(t==null?void 0:t.length)??0,a=this.getMaxWidth(n,(n==null?void 0:n.chartWidth)/(l+2));return[...(t??[]).map(d=>this.getLabelFormat(d,a)),...i].reduce((d,h)=>{var f;const u=((f=A.calcTextSizeCanvas(h,s))==null?void 0:f.width)??0;return Math.max(d,u)},0)}}class y1 extends Ii{constructor(t,n,i,s,l){super(t,n,i),this.labels=s,this.options=l}getLabelFormat(t,n={}){if(this.formatter){const i=this.formatter(t,n);if(typeof i=="string")return i}return We(t).format(this.timeFormat)}calculateScaleRange(t,n,i){const s=super.calculateScaleRange(t,n,i),l=this.labels;if(!(l!=null&&l.length))return{...s,minIndex:0,maxIndex:-1};let a=0,r=l.length-1;const{min:c,max:d}=s;if(Number.isFinite(c)&&Number.isFinite(d)){const h=l.findIndex(f=>f>=c);let u=-1;for(let f=l.length-1;f>=0;f-=1)if(l[f]<=d){u=f;break}h===-1||u===-1||u<h?(a=0,r=-1):(a=h,r=u)}else{const h=n!=null&&n.use?n==null?void 0:n.range:this.range;h!=null&&console.warn("[EVUI][TimeCategoryScale] axis range가 유효한 min/max 숫자로 해석되지 않아 전체 라벨 범위로 폴백합니다. range 설정을 확인하세요:",h)}return{...s,minIndex:a,maxIndex:r}}getInterval(t){const n=t.maxValue,i=t.minValue,s=t.maxSteps;if(this.interval){if(typeof this.interval=="string")return Tt[this.interval].size;if(typeof this.interval=="object")return this.interval.time*Tt[this.interval.unit].size;if(typeof this.interval=="number")return this.interval}return Math.ceil((n-i)/s)}calculateSteps(t){const{maxValue:n,minValue:i,maxSteps:s,minIndex:l,maxIndex:a}=t,r=this.getInterval(t);let c=r,d=i,h;for(;d<n;)d+=c;const u=d>n?n:d,f=i,m=u-f;h=Math.round(m/c)+1;const g=h;for(n===1&&(c=.2,h=5);h>s;)c*=2,h=Math.round(m/c),c=Math.ceil(m/h);return u-f>h*c&&(c=Math.ceil((u-f)/h)),{steps:h,oriSteps:g,interval:c,rawInterval:r,graphMin:f,graphMax:u,minIndex:l,maxIndex:a}}draw(t,n,i,s,l){var Z,W,R,X,G,N,P,B,z,D,Y,F,O,H,j,U;const a=this.ctx,r=this.labels,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=i.steps,h=i.graphMin,u=i.graphMax,f=i.rawInterval,m=i.oriSteps;let g=c[this.units.rectStart];const p=c[this.units.rectEnd],y=c[this.units.rectOffset(this.position)],C=c[this.units.rectOffsetCounter(this.position)],b=5;this.drawAxisTitle(t,n),a.font=A.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const k=A.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(g,y+k),a.lineTo(p,y+k)):(a.moveTo(y+k,g),a.lineTo(y+k,p)),a.stroke(),a.closePath(),d===0||h===null)return;const L=this.labelStyle.alignToGridLine,w=(p-g)/(m||1);this.categoryMode&&!L&&(g+=Math.ceil(w/2)-2);const M=[];let V=null,S=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let x,I,T;const v=d<=2?Math.max(1,m-1):Math.round(m/d),E=v===m?m:m-1;for(T=0;T<=E;T+=v){M[T]=We(h).valueOf()+T*f,V=Math.round(g+w*T),S=V+k;let Q;for(let ee=0;ee<M.length;ee++)M[ee]!==void 0&&ee!==T&&(Q=M[ee]);x=this.getLabelFormat(Math.min(u,M[T]),{prev:Q});const J=((W=(Z=this.options)==null?void 0:Z.selectLabel)==null?void 0:W.use)&&((X=(R=this.options)==null?void 0:R.selectLabel)==null?void 0:X.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((G=l==null?void 0:l.dataIndex)==null?void 0:G.length)&&!(l!=null&&l.label.map(ee=>this.getLabelFormat(Math.min(u,ee),{prev:Q})).includes(x)),ne=this.labelStyle.color;let q=1;if(A.getColorStringType(ne)==="RGBA"&&(q=A.getOpacity(ne)),a.fillStyle=A.colorStringToRgba(ne,J?(N=this.options)==null?void 0:N.unSelectedOpacity:q),this.type==="x"){if(I=this.position==="top"?y-10:y+10,a.fillText(this.checkFixWidth(x),V,I),!J&&((B=(P=this.options)==null?void 0:P.selectItem)!=null&&B.showLabelTip)&&(s!=null&&s.label)&&!((z=this.options)!=null&&z.horizontal)){const ee=this.getLabelFormat(Math.min(u,s.label+0*f));if(ee===x){const $=Math.round(a.measureText((D=this.labelStyle)==null?void 0:D.fontSize).width);A.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(ee).width)+10,height:$,x:V,y:I+($-2),borderRadius:2,arrowSize:3,text:x,backgroundColor:(O=(F=(Y=this.options)==null?void 0:Y.selectItem)==null?void 0:F.labelTipStyle)==null?void 0:O.backgroundColor,textColor:(U=(j=(H=this.options)==null?void 0:H.selectItem)==null?void 0:j.labelTipStyle)==null?void 0:U.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(S,y),a.lineTo(S,y+b),a.stroke(),a.closePath()),T<m&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(S,y),a.lineTo(S,C),a.stroke(),a.closePath())}else I=this.position==="left"?y-10:y+10,a.fillText(this.checkFixWidth(x),I,V),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(y+(this.axisLineWidth??1),S),a.lineTo(y-b,S),a.stroke(),a.closePath()),T<m&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(y,S),a.lineTo(C,S),a.stroke(),a.closePath());a.stroke()}if(this.categoryMode&&L&&T*v===m){const Q=We(r[1]).diff(We(r[0])),J=this.getLabelFormat(We(M[m-1]+Q));V=Math.round(g+w*m),S=V+k,this.type==="x"?(a.fillText(this.checkFixWidth(J),V,I),this.showGrid&&(a.moveTo(S,y),a.lineTo(S,C))):(a.fillText(this.checkFixWidth(J),I,V),this.showGrid&&(a.moveTo(y,S),a.lineTo(C,S))),a.stroke()}a.closePath()}}const x1={createTitle(){this.titleDOM=document.createElement("div"),this.titleDOM.className="ev-chart-title",this.wrapperDOM.appendChild(this.titleDOM)},initTitle(){this.isInitTitle||this.createTitle(),this.updateTitle(),this.isInitTitle=!0},showTitle(){this.titleDOM.style.display="block",this.wrapperDOM.style.paddingTop=`${this.options.title.height}px`},hideTitle(){this.titleDOM.style.display="none",this.wrapperDOM.style.paddingTop="0px"},updateTitle(){const e=this.options.title;Object.keys(e.style).forEach(t=>{this.titleDOM.style[t]=e.style[t]}),this.titleDOM.textContent=e.text,this.titleDOM.style.height=`${e.height}px`,this.titleDOM.style.lineHeight=`${e.height}px`}},S1={createLegendLayout(){var e,t;this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",(t=(e=this.options)==null?void 0:e.legend)!=null&&t.allowResize&&(this.resizeDOM=document.createElement("div"),this.resizeDOM.className="ev-chart-resize-bar",this.ghostDOM=document.createElement("div"),this.ghostDOM.className="ev-chart-resize-ghost",this.wrapperDOM.appendChild(this.resizeDOM)),this.useTable?(this.legendTableDOM=document.createElement("table"),this.legendTableDOM.className="ev-chart-legend--table",this.setLegendColumnHeader(),this.legendBoxDOM.appendChild(this.legendTableDOM),this.legendDOM.style.overflow="auto"):(this.legendBoxDOM.style.overflowX="hidden",this.legendBoxDOM.style.overflowY="auto",this.legendBoxDOM.style.height="100%"),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM),this.options.legend.virtualScroll&&!this.useTable&&(this.legendTopSpacer=document.createElement("div"),this.legendTopSpacer.className="ev-chart-legend--top-spacer",this.legendTopSpacer.style.clear="both",this.legendTopSpacer.style.opacity=0,this.legendBottomSpacer=document.createElement("div"),this.legendBottomSpacer.className="ev-chart-legend--bottom-spacer",this.legendBottomSpacer.style.clear="both",this.legendBottomSpacer.style.opacity=0,this.legendBoxDOM.appendChild(this.legendTopSpacer),this.legendBoxDOM.appendChild(this.legendBottomSpacer),this.updateVisibleRowCountFrameId=requestAnimationFrame(()=>{this.updateVisibleRowCount()}))},setLegendColumnHeader(){var i;const e=(i=this.options.legend)==null?void 0:i.table,t=e.columns;["color",...Object.keys(t)].forEach(s=>{var a,r;const l=document.createElement("th");if(l.className="ev-chart-legend--table__column-name",(a=t[s])!=null&&a.use||s==="color"||s==="name"){const c=t[s],d=(c==null?void 0:c.title)??"";l.textContent=d,l.setAttribute("title",d),l.dataset.type=d,A.setDOMStyle(l,(r=e==null?void 0:e.style)==null?void 0:r.header),this.legendTableDOM.append(l)}})},initLegend(){var e,t;this.isHeatMapType=this.options.type==="heatMap",this.useTable=!!((t=(e=this.options.legend)==null?void 0:e.table)!=null&&t.use)&&this.options.type!=="heatmap"&&this.options.type!=="scatter",this.legendItemHeight=18,this.isInitLegend||this.createLegendLayout(),this.isHeatMapType?(this.initEventForColorLegend(),this.addColorLegendList()):(this.initEvent(),this.addLegendList()),this.initResizeEvent(),this.isInitLegend=!0,this.isLegendMove=!1},updateVisibleRowCount(){const e=this.options.legend.position==="right"||this.options.legend.position==="left",t=this.legendBoxDOM.clientHeight,n=this.legendBoxDOM.clientWidth,i=Math.max(this.options.legend.width-8,1),s=Object.values(this.seriesList).filter(l=>l.showLegend!==!1).length;this.itemsPerRow=e?1:Math.floor(n/i),this.totalRowCount=Math.ceil(s/this.itemsPerRow),this.visibleRowCount=t>this.legendItemHeight?Math.round(t/this.legendItemHeight)+1:this.totalRowCount},updateStartEndRowIndex(){var t;const e=Math.max(Math.floor(((t=this.legendBoxDOM)==null?void 0:t.scrollTop)/this.legendItemHeight),0);this.startRowIndex=Math.min(e,Math.max(this.totalRowCount-this.visibleRowCount,0)),this.endRowIndex=this.startRowIndex+this.visibleRowCount+1},renderVisibleLegends(){this.updateStartEndRowIndex();const e=this.legendBoxDOM.querySelectorAll(".ev-chart-legend-container");if(e&&e.length)for(const c of e)c.remove();const t=this.totalRowCount*this.legendItemHeight,n=this.startRowIndex*this.legendItemHeight,i=Math.max(t-this.visibleRowCount*this.legendItemHeight-n,0);this.legendTopSpacer.style.height=`${n}px`,this.legendBottomSpacer.style.height=`${i}px`;const s=this.startRowIndex*this.itemsPerRow,l=this.endRowIndex*this.itemsPerRow,a=this.data.groups.at(0);let r=[];if(a?r=a.filter(c=>this.seriesList[c].showLegend).map(c=>[c,this.seriesList[c]]):r=Object.entries(this.seriesList).filter(([,c])=>c.showLegend),r&&r.length)for(let c=s;c<l&&c<r.length;c++){const[,d]=r[c];this.addLegend(d)}},addLegendList(){const{groups:e}=this.data,{seriesList:t}=this;this.options.legend.virtualScroll&&!this.useTable?this.renderVisibleLegendsFrameId=requestAnimationFrame(()=>{this.renderVisibleLegends()}):(this.addLegendForGroups(e,t,this.useTable),this.addStandaloneLegends(t,this.useTable))},addLegendForGroups(e,t,n){e==null||e.forEach(i=>{i==null||i.forEach(s=>{const l=t[s];l&&l.showLegend&&this.addLegendBasedOnType(l,n)})})},addStandaloneLegends(e,t){Object.values(e).forEach(n=>{!n.isExistGrp&&n.showLegend&&this.addLegendBasedOnType(n,t)})},addLegendBasedOnType(e,t){t?this.addLegendWithValues(e):this.addLegend(e)},addColorLegendList(){const e=this.seriesList;Object.values(e).forEach(t=>{if(!t.isExistGrp&&t.showLegend){const{colorState:n,valueOpt:i}=t,{min:s,max:l,interval:a,existError:r,decimalPoint:c}=i,d=n.length,h=r?d-2:d-1;for(let u=0;u<d;u++){const{id:f,color:m,label:g=""}=n[u],p=s+a*u;let y=p+a;u<h?y-=.1**c:y=l+.1**c;let C=g;if(!C)if(C=`${p.toFixed(c)} - ${y.toFixed(c)}`,s===void 0||l===void 0)if(u===0)C="0";else break;else{if(p>l)break;a<=1&&c===0&&(C=p)}this.addLegend({cId:f,color:m,name:C,show:!0})}}})},getContainerDOM(e){let t=null;const n=e.target.dataset.type;return n==="container"?t=e.target:["name","color","min","max","avg","total","last"].includes(n)&&(t=e.target.parentElement,t!=null&&t.series||(t=t.parentElement)),t},initEvent(){if(this.isInitLegend)return;const e={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`,value:`ev-chart-legend${this.useTable?"--table__value":"-value"}`},t=(l,a)=>{const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=l==null?void 0:l.getElementsByClassName(e.value),h=l==null?void 0:l.series;if(r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a,d&&d.length)for(const u of d)u.style.color=a;h.show=!1,l.dataset.inactive=!0},n=(l,a)=>{var f,m;let r;const c=l==null?void 0:l.getElementsByClassName(e.color)[0],d=l==null?void 0:l.getElementsByClassName(e.name)[0],h=l==null?void 0:l.getElementsByClassName(e.value),u=l==null?void 0:l.series;if(typeof u.color!="string"?r=u.color[u.color.length-1][1]:r=u.color,u.type==="line"&&u.fill?(c.style.height="8px",c.style.backgroundColor=A.rgbaAdjustHalfOpacity(r),c.style.border=`1px solid ${r}`):c.style.backgroundColor=r,d.style.color=a,h&&h.length)for(const g of h){const p=(m=(f=this.options.legend.table)==null?void 0:f.columns[g.dataset.type])==null?void 0:m.style;g.style.color=p!=null&&p.color?p.color:a}u.show=!0,l.dataset.inactive=!1},i=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!1})},s=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!0})};this.onLegendBoxClick=l=>{var y;const{legend:a}=this.options;if(a!=null&&a.stopClickEvt)return;const{chartIdx:r}=this.data,c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(e.color)[0],h=c==null?void 0:c.getElementsByClassName(e.name)[0],u=(c==null?void 0:c.dataset.inactive)==="false";if(!d||!h)return;if(a.clickMode==="active"){const C=Array.from(this.legendBoxDOM.getElementsByClassName(e.container));C.every(L=>L.dataset.inactive==="false")?(C.forEach(L=>{t(L,a.inactive)}),i(),n(c,a.color),this.seriesInfo.count=1):u?(t(c,a.inactive),this.seriesInfo.count--):u||(n(c,a.color),this.seriesInfo.count++),C.every(L=>L.dataset.inactive==="true")&&(C.forEach(L=>{n(L,a.color)}),s(),this.seriesInfo.count=C.length)}if(a.clickMode!=="active"){if(u&&this.seriesInfo.count===1)return;u?(t(c,a.inactive),this.seriesInfo.count--):(n(c,a.color),this.seriesInfo.count++)}if(this.brushSeries){const C=[...this.brushSeries.list];C[r]=this.seriesList,this.brushSeries.list=C,this.brushSeries.chartIdx=r}((y=this.options.eventBehavior)==null?void 0:y.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const m=Object.values(this.seriesList).filter(C=>C.show).map(C=>C.sId),g=m.length===Object.values(this.seriesList).length,p={e:l,data:{seriesIds:g?[]:m,isActiveAll:g}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](p)},this.onLegendBoxLeave=()=>{this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})},this.onLegendBoxOver=l=>{var d;const a=this.getContainerDOM(l);if(!a){this.onLegendBoxLeave();return}const c={sId:(d=a==null?void 0:a.series)==null?void 0:d.sId,type:this.options.type};this.legendHover=c,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:c},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.addEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.addEventListener("scroll",this.renderVisibleLegends.bind(this))),this.initResizeEvent()},initEventForColorLegend(){if(this.isInitLegend)return;const e={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`},t=(l,a)=>{var f;const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=Object.values(this.seriesList)[0],h=(f=l==null?void 0:l.series)==null?void 0:f.cId;r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a;const u=d.colorState.findIndex(m=>m.id===h);u>-1&&(d.colorState[u].show=!1),l.dataset.inactive=!0},n=(l,a)=>{var f,m;const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=Object.values(this.seriesList)[0],h=(f=l==null?void 0:l.series)==null?void 0:f.cId;r.style.backgroundColor=(m=l==null?void 0:l.series)==null?void 0:m.color,c.style.color=a;const u=d.colorState.findIndex(g=>g.id===h);u>-1&&(d.colorState[u].show=!0),l.dataset.inactive=!1},i=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!1})},s=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!0})};this.onLegendBoxClick=l=>{var C;const a=this.options.legend;if(a!=null&&a.stopClickEvt)return;const r=Object.values(this.seriesList)[0],c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(e.color)[0],h=c==null?void 0:c.getElementsByClassName(e.name)[0],u=(c==null?void 0:c.dataset.inactive)==="false",f=r.colorState.filter(b=>b.show).length;if(!d||!h)return;if(a.clickMode==="active"){const b=Array.from(this.legendBoxDOM.getElementsByClassName(e.container));b.every(w=>w.dataset.inactive==="false")?(b.forEach(w=>{t(w,a.inactive)}),i(),n(c,a.color)):u?t(c,a.inactive):u||n(c,a.color),b.every(w=>w.dataset.inactive==="true")&&(b.forEach(w=>{n(w,a.color)}),s())}if(a.clickMode!=="active"){if(u&&f===1)return;u?t(c,a.inactive):n(c,a.color)}((C=this.options.eventBehavior)==null?void 0:C.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const m=r.colorState.filter(b=>b.show),g=m.map(b=>+b.id.split("#")[1]),p=r.colorState.length===m.length,y={e:l,data:{seriesIndices:p?[]:g,isActiveAll:p}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](y)},this.onLegendBoxLeave=()=>{this.legendHover=null,Object.values(this.seriesList)[0].colorState.forEach(a=>{a.state="normal"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:!0})},this.onLegendBoxOver=l=>{var h,u;const a=(h=Object.values(this.seriesList))==null?void 0:h[0],r=this.getContainerDOM(l);if(!r){this.onLegendBoxLeave();return}const c=(u=r==null?void 0:r.series)==null?void 0:u.cId,d={sId:c,type:this.options.type};this.legendHover=d,a.colorState.forEach(f=>{f.state=f.id===c?"highlight":"downplay"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:d},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.initResizeEvent()},initResizeEvent(){this.onResizeMouseDown=e=>{e.stopPropagation(),e.preventDefault();const t=this.options,n=t.legend.position,i=t.title.show?t.title.height:0,s=this.ghostDOM;this.resizeDOM.style.display="none",this.wrapperDOM.appendChild(s),n==="left"||n==="right"?(s.style.top=`${i}px`,s.style.left=this.resizeDOM.style.left,s.style.right=this.resizeDOM.style.right,s.style.height=this.resizeDOM.style.height):(s.classList.add("horizontal"),n==="top"?s.style.top=this.resizeDOM.style.top:n==="bottom"&&(s.style.bottom=this.resizeDOM.style.bottom)),this.wrapperDOM.addEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.addEventListener("mouseup",this.mouseUp,!1)},this.resizeDOM&&(this.resizeDOM.addEventListener("mousedown",this.onResizeMouseDown),this.mouseMove=this.onMouseMove.bind(this),this.mouseUp=this.onMouseUp.bind(this))},updateLegend(){this.resetLegend(),this.isHeatMapType?this.addColorLegendList():this.addLegendList()},updateLegendTableValues(){var i,s,l,a,r;const e=(l=(s=(i=this.options)==null?void 0:i.legend)==null?void 0:s.table)==null?void 0:l.columns,t=this.getAggregations(),n=(a=this.legendBoxDOM)==null?void 0:a.getElementsByClassName("ev-chart-legend--table__row");if(n&&n.length)for(const c of n){const d=c==null?void 0:c.getElementsByClassName("ev-chart-legend--table__value");if(d&&d.length)for(const h of d){const u=h.dataset.type;if(u!=="name"){const f=c.series.sId,m=(r=t==null?void 0:t[f])==null?void 0:r[u];h.textContent=this.getFormattedValue(e[u],m)}}}},forceUpdateLegend(){this.destroyLegend(),this.initLegend()},resetLegend(){var t,n;const e=this.legendBoxDOM;if(e){if(this.useTable){const i=this.legendTableDOM;for(;i.hasChildNodes();)i.removeChild(i.firstChild);this.setLegendColumnHeader()}else if(this.options.legend.virtualScroll)((n=(t=this.legendDOM)==null?void 0:t.style)==null?void 0:n.display)==="none"?this.legendNeedsUpdate=!0:(this.updateVisibleRowCount(),this.renderVisibleLegends());else for(;e.hasChildNodes();)e.removeChild(e.firstChild);this.seriesInfo.count=0}},destroyLegend(){const e=this.legendDOM;this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),e&&(e.remove(),this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.isInitLegend=!1,this.seriesInfo.count=0)},addLegend(e){const t=this.options.legend,n=document.createElement("div"),i=document.createElement("span"),s=document.createElement("div");n.className="ev-chart-legend-container",n.dataset.inactive=!e.show,n.series=e,i.className="ev-chart-legend-color",e.type==="line"&&e.point&&!e.fill&&(i.className+=" ev-chart-legend-color--point-line"),s.className="ev-chart-legend-name";let l;e.show?typeof e.color!="string"?l=e.color[e.color.length-1][1]:l=e.color:l=t.inactive,e.type==="line"&&e.fill?(i.style.height="8px",i.style.backgroundColor=e.show?A.rgbaAdjustHalfOpacity(l):t.inactive,i.style.border=`1px solid ${l}`):i.style.backgroundColor=l,i.dataset.type="color",s.style.color=t.color,s.textContent=e.name,s.setAttribute("title",e.name),s.dataset.type="name",n.appendChild(i),n.appendChild(s),t.position==="top"||t.position==="bottom"?(n.style.width=`${t.width-8}px`,n.style.margin="0 4px"):n.style.width="100%",n.style.height=`${this.legendItemHeight}px`,n.style.display="inline-block",n.style.overflow="hidden",n.dataset.type="container",this.legendBoxDOM.insertBefore(n,this.legendBottomSpacer),e.show&&this.seriesInfo.count++},addLegendWithValues(e){var h,u,f,m,g;const t=this.options.legend,n=(h=t==null?void 0:t.table)==null?void 0:h.columns,i=(u=this.getAggregations())==null?void 0:u[e==null?void 0:e.sId];if(!i||!n)return;const s=document.createElement("tr");s.className="ev-chart-legend--table__row",s.dataset.inactive=!e.show,A.setDOMStyle(s,(m=(f=t.table)==null?void 0:f.style)==null?void 0:m.row),s.series=e,s.dataset.type="container";const l=document.createElement("td");l.className="ev-chart-legend--table__color-wrapper",l.dataset.type="color";const a=document.createElement("div");a.className="ev-chart-legend--table__color",a.dataset.type="color";let r;switch(e.show?typeof e.color!="string"?r=e.color[e.color.length-1][1]:r=e.color:r=t.inactive,e.type){case"line":{e.fill?(a.style.backgroundColor=A.rgbaAdjustHalfOpacity(r),a.style.border=`1px solid ${r}`):(e.point&&(a.className+=" ev-chart-legend--table__color--point-line"),a.className+=" ev-chart-legend--table__color--line",a.style.backgroundColor=r);break}case"bar":case"pie":default:{a.style.height="10px",a.style.backgroundColor=r;break}}e.type==="line"&&e.fill?(a.style.height="8px",a.style.backgroundColor=e.show?A.rgbaAdjustHalfOpacity(r):t.inactive,a.style.border=`1px solid ${r}`):a.style.backgroundColor=r,l.appendChild(a),s.appendChild(l);const c=document.createElement("td");c.className="ev-chart-legend--table__name",c.style.color=e.show?t.color:t.inactive,c.textContent=e.name,c.setAttribute("title",e.name),c.dataset.type="name",A.setDOMStyle(c,(g=n==null?void 0:n.name)==null?void 0:g.style),e.show||(c.style.color=t.inactive),s.appendChild(c);const d=Object.keys(n);d==null||d.forEach(p=>{var y;if(p!=="name"&&n[p].use){const C=this.getFormattedValue(n[p],i[p]),b=document.createElement("td");b.className="ev-chart-legend--table__value",b.style.color=e.show?t.color:t.inactive,b.textContent=C,b.dataset.type=p.toString(),A.setDOMStyle(b,(y=n[p])==null?void 0:y.style),e.show||(b.style.color=t.inactive),s.appendChild(b)}}),this.legendTableDOM.appendChild(s),e.show&&this.seriesInfo.count++},setLegendPosition(){var g,p,y,C,b,k,L,w,M;const e=this.options,t=(g=e==null?void 0:e.legend)==null?void 0:g.position,n=(p=this.wrapperDOM)==null?void 0:p.style,i=(y=this.legendDOM)==null?void 0:y.style,s=(C=this.legendBoxDOM)==null?void 0:C.style,l=(b=this.resizeDOM)==null?void 0:b.style;let a,r;const c=(k=e==null?void 0:e.title)!=null&&k.show?(L=e==null?void 0:e.title)==null?void 0:L.height:0,d=c+((w=e==null?void 0:e.legend)==null?void 0:w.height),{top:h=0,bottom:u=0,left:f=0,right:m=0}=((M=e==null?void 0:e.legend)==null?void 0:M.padding)??{};if(!(!n||!i))switch(s.padding=`${h}px ${m}px ${u}px ${f}px`,t){case"top":n.padding=`${d}px 0 0 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(i.paddingTop)+parseInt(i.paddingBottom),s.width="100%",s.height=`${e.legend.height-r}px`,i.top=`${c}px`,i.right="",i.bottom="",i.left="",i.width=`${a.width}px`,i.height=`${e.legend.height+(l?4:0)}px`,l&&(l.top=`${d}px`,l.right="",l.bottom="",l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"right":n.padding=`${c}px ${e.legend.width}px 0 0`,a=this.chartDOM.getBoundingClientRect(),s.width=`${e.legend.width-10}px`,s.maxHeight=`${a.height}px`,i.paddingLeft="10px",i.top=`${c}px`,i.right="0px",i.bottom="",i.left="",i.width=`${e.legend.width}px`,i.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right=`${e.legend.width}px`,l.bottom="",l.left="",l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break;case"bottom":n.padding=`${c}px 0 ${e.legend.height}px 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(i.paddingTop)+parseInt(i.paddingBottom),s.width="100%",s.height=`${e.legend.height-r}px`,i.top="",i.right="",i.bottom="0px",i.left="0px",i.width=`${a.width}px`,i.height=`${e.legend.height+(l?4:0)}px`,l&&(l.top="",l.right="",l.bottom=`${e.legend.height}px`,l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"left":n.padding=`${c}px 0 0 ${e.legend.width}px`,a=this.chartDOM.getBoundingClientRect(),s.width=`${e.legend.width}px`,s.maxHeight=`${a.height}px`,s.display="absolute",s.bottom="0px",i.top=`${c}px`,i.right="",i.bottom="",i.left="0px",i.width=`${e.legend.width}px`,i.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right="",l.bottom="",l.left=`${e.legend.width}px`,l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break}},updateLegendContainerSize(){var n;if(!this.options||!this.legendBoxDOM)return;const e=(n=this.options)==null?void 0:n.legend,t=this.legendBoxDOM.getElementsByClassName("ev-chart-legend-container");if(t)for(let i=0;i<t.length;i++)e.position==="top"||e.position==="bottom"?(t[i].style.width=`${e.width-8}px`,t[i].style.margin="0 4px"):t[i].style.width="100%"},onMouseMove(e){e.stopPropagation(),e.preventDefault();const t=this.wrapperDOM.getBoundingClientRect(),n=this.wrapperDOM.offsetWidth,i=this.wrapperDOM.offsetHeight,s=this.options.title.show?this.options.title.height:0,l=this.options.legend.position,a=150,r=70,c=120,d=20;let h;switch(l){case"left":h=e.clientX-t.left,h<c?h=c:h>n-a&&(h=n-a),this.ghostDOM.style.left=`${h}px`;break;case"right":h=e.clientX-t.left,h<a?h=a:h>n-c&&(h=n-c),this.ghostDOM.style.left=`${h}px`;break;case"top":h=e.clientY-t.top,h<d+s?h=d+s:h>i-r&&(h=i-r),this.ghostDOM.style.top=`${h}px`;break;case"bottom":h=e.clientY-t.top,h<r+s?h=r+s:h>i-d&&(h=i-d),this.ghostDOM.style.bottom=`${this.wrapperDOM.offsetHeight-h}px`;break}this.isLegendMove=!0},onMouseUp(e){e.stopPropagation(),e.preventDefault(),this.wrapperDOM.removeEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.removeEventListener("mouseup",this.mouseUp,!1);const t=this.options,n=t.legend.position,i=this.resizeDOM.style,s=this.legendDOM.style,l=this.legendBoxDOM.style,a=this.ghostDOM.style,r=this.wrapperDOM.style,c=t.title.show?t.title.height:0,d=+this.legendDOM.style.paddingLeft.replace("px","");let h;if(this.isLegendMove)switch(n){case"top":i.top=a.top,h=+a.top.replace("px",""),s.height=`${h-c}px`,l.height=`${h-c-4}px`,t.legend.height=h-c-4,r.padding=`${h}px 0 0 0`;break;case"right":i.left=a.left,h=+a.left.replace("px",""),s.width=`${this.wrapperDOM.offsetWidth-h-4}px`,l.width=`${this.wrapperDOM.offsetWidth-h-4-d}px`,t.legend.width=this.wrapperDOM.offsetWidth-h-4,r.padding=`${c}px ${this.wrapperDOM.offsetWidth-h}px 0 0`;break;case"bottom":i.bottom=a.bottom,h=this.wrapperDOM.offsetHeight-+a.bottom.replace("px",""),s.height=`${this.wrapperDOM.offsetHeight-h}px`,l.height=`${h-c-4}px`,t.legend.height=this.wrapperDOM.offsetHeight-h,r.padding=`${c}px 0 ${this.wrapperDOM.offsetHeight-h}px 0`;break;case"left":i.left=a.left,h=+a.left.replace("px",""),s.width=`${h}px`,l.width=`${h}px`,t.legend.width=h,r.padding=`${c}px 0 0 ${h-4}px`;break}i.display="block",this.ghostDOM.remove(),this.isLegendMove&&(this.render(),this.isLegendMove=!1)},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block"),this.legendNeedsUpdate&&this.options.legend.virtualScroll&&!this.useTable&&(this.legendNeedsUpdate=!1,this.updateVisibleRowCount(),this.renderVisibleLegends())},hideLegend(){var l,a,r,c,d;const e=this.options,t=(l=this.wrapperDOM)==null?void 0:l.style,n=(a=this.resizeDOM)==null?void 0:a.style,i=(r=this.legendDOM)==null?void 0:r.style,s=(c=e==null?void 0:e.title)!=null&&c.show?(d=e==null?void 0:e.title)==null?void 0:d.height:0;!i||!t||(n&&(n.display="none"),i.display="none",i.width="0",i.height="0",t.padding=`${s}px 0 0 0`)},getFormattedValue({formatter:e,decimalPoint:t},n){if(n==null)return"Null";let i;return e&&(i=e(+n)),(!e||typeof i!="string")&&(i=A.labelSignFormat(+n,t)),i}},kc=28,C1={width:70,height:60},k1={createLegendLayout(){this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",this.containerDOM=document.createElement("div"),this.containerDOM.className="ev-chart-legend-container",this.legendBoxDOM.appendChild(this.containerDOM),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM)},initLegend(){this.isInitLegend||(this.createLegendLayout(),this.createLegend()),Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)}),this.initEvent(),this.isInitLegend=!0,this.legendDragInfo={dragging:!1,isStart:!0}},initEvent(){this.isInitLegend||(this.onLegendMouseDown=e=>{e.stopPropagation(),e.preventDefault();const t=e.target.dataset.type;let n;if(t==="handle")n=e.target;else if(t==="handle-btn")n=e.target.parentElement;else if(t==="handle-btn-color")n=e.target.parentElement.parentElement;else return;const i=Object.values(this.seriesList);if(!i.length)return;const{colorState:s}=i[0],{start:l,end:a}=s[0];s[0].selectedValue=null,this.clearOverlay(),this.legendDragInfo.dragging=!0,this.legendDragInfo.isStart=l!==a?n.className.includes("start"):this.legendDragInfo.isStart,n.classList.add("dragging"),this.legendBoxDOM.addEventListener("mousemove",this.onLegendMouseMove,!1),this.legendBoxDOM.addEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendMouseMove=e=>{e.stopPropagation(),e.preventDefault();const{dragging:t,isStart:n}=this.legendDragInfo;if(t){let i=this.getSelectedValue(e);i=this.isSide?100-i:i;const s=n?"start":"end",l=Object.values(this.seriesList);if(!l.length)return;const{colorState:a}=l[0],{start:r,end:c}=a[0];if(n&&i>c||!n&&i<r)return;a[0][s]=i,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})}},this.onLegendMouseUp=()=>{this.legendDragInfo.dragging=!1;const e=this.containerDOM.getElementsByClassName("ev-chart-legend-handle dragging")[0];e==null||e.classList.remove("dragging"),this.legendBoxDOM.removeEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendBoxOver=e=>{const t=e.target.dataset.type,n=Object.values(this.seriesList);if(!n.length)return;const{colorState:i,valueOpt:s}=n[0],l=i[0];let a=this.getSelectedValue(e);if(a=this.isSide?100-a:a,["line","thumb","layer","overlay","overlay-item"].includes(t))if(l.start<=a&&a<=l.end)l.selectedValue=a,this.createLegendOverlay(a,s);else return;else if(["handle","handle-btn","handle-btn-color"].includes(t)){const r=e.target.className.includes("start");l.selectedValue=r?l.start:l.end,this.clearOverlay()}else return;this.legendHover={sId:"gradient",type:this.options.type},this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.onLegendBoxLeave=()=>{this.legendDragInfo.dragging=!1,this.legendHover=null,this.clearOverlay();const e=Object.values(this.seriesList);if(!e.length)return;const{colorState:t}=e[0];t[0].selectedValue=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.legendBoxDOM.addEventListener("mousedown",this.onLegendMouseDown),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave))},getSelectedValue(e){const{x:t,y:n,width:i,height:s}=this.containerDOM.getBoundingClientRect(),l=!this.isSide,a=l?t:n,r=l?i:s;let c=l?e.clientX:e.clientY;c<a?c=a:c>a+r&&(c=a+r);const d=c-a;return+$e(d,r)},updateLegend(){this.resetLegend(),this.createLegend(),Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)})},resetLegend(){const e=this.containerDOM;if(e)for(;e.hasChildNodes();)e.removeChild(e.firstChild)},clearOverlay(){const e=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],t=e==null?void 0:e.getElementsByClassName("ev-chart-legend-overlay")[0];if(t){e.removeChild(t);const i=e.getElementsByClassName("ev-chart-legend-thumb")[0].children;if(i&&i.length)for(const s of i)s.style.opacity=1}},createLegendOverlay(e,t){this.clearOverlay();const n=this.legendHandleSize,{min:i,max:s}=t;if(i===void 0||s===void 0)return;const l=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],a=document.createElement("div");a.className="ev-chart-legend-overlay",a.dataset.type="overlay";const r=document.createElement("div");r.className="ev-chart-legend-overlay-tooltip",r.innerText=Math.floor(i+(s-i)*(e/100));const c=document.createElement("span");c.className="ev-chart-legend-overlay-item",c.dataset.type="overlay-item";let d,h;const u=Math.floor(n/2)+14;this.isSide?(h=`top:${100-e}%;left:${u}px;transform:translateY(-50%);`,d=`top:${100-e}%;transform:translateY(-50%);`):(h=`top:-${u}px;left:${e}%;transform:translateX(-50%);`,d=`left:${e}%;transform:translateX(-50%);`),d+=`width:${n-10}px;height:${n-10}px;`,r.style.cssText=h,c.style.cssText=d,a.appendChild(r),a.appendChild(c),l==null||l.appendChild(a);const f=l==null?void 0:l.getElementsByClassName("ev-chart-legend-thumb")[0];if(f){const m=f.children;if(m&&m.length)for(const g of m)g.style.opacity=.2}},createLegendHandle(e){const t=document.createElement("span");t.className=`ev-chart-legend-handle-btn-color ${e}`,t.dataset.type="handle-btn-color";const n=document.createElement("div");n.className=`ev-chart-legend-handle-btn ${e}`,n.dataset.type="handle-btn",n.appendChild(t);const i=document.createElement("div");return i.className=`ev-chart-legend-handle ${e}`,i.dataset.type="handle",i.appendChild(n),i},createLegendLabel(){const e=document.createElement("span");e.className="ev-chart-legend-label-text";const t=document.createElement("div");return t.className="ev-chart-legend-label",t},createLegend(){if(!Object.values(this.seriesList).length)return;const e=this.options.legend;this.isSide=!["top","bottom"].includes(e.position);const t=this.isSide?e.width:e.height;this.legendHandleSize=t>kc?kc:t;const n=this.legendHandleSize,i=this.createLegendHandle(this.isSide?"end":"start",n),s=this.createLegendHandle(this.isSide?"start":"end",n),l=document.createElement("div");l.className="ev-chart-legend-line-layer",l.dataset.type="line-layer";const a=document.createElement("div");a.className="ev-chart-legend-thumb",a.dataset.type="thumb",a.appendChild(this.createLegendLabel()),a.appendChild(this.createLegendLabel());const r=document.createElement("div");r.className="ev-chart-legend-line",r.dataset.type="line",r.appendChild(l),r.appendChild(a),this.containerDOM.appendChild(r),this.containerDOM.appendChild(i),this.containerDOM.appendChild(s)},setLegendStyle(e){const t=this.isSide?"top":"right",n=this.legendHandleSize,{valueOpt:i,colorState:s}=e,{min:l,max:a,decimalPoint:r}=i,{start:c,end:d}=s[0],h=e.getColorForGradient(c),u=e.getColorForGradient(d);let f=`linear-gradient(to ${t}, `;f+=`${h}, ${u})`;const m=Math.floor(n/2)+14;let g=`width:${n}px;height:${n}px;`,p,y,C,b=`background:${f};`;this.isSide?(g+=`margin-top:-${n/2}px;`,p=`left:${m}px;transform:translateY(-50%);top:`,y=`top:${100-d}%;`,C=`top:${100-c}%;`,b+=`top:${100-d}%;height:${d-c}%;`):(g+=`margin-left:-${n/2}px;`,p=`top:-${m}px;transform:translateX(-50%);left:`,y=`left:${c}%;`,C=`left:${d}%;`,b+=`left:${c}%;width:${d-c}%;`);const k=(l+(a-l)*(c/100)).toFixed(r),L=(l+(a-l)*(d/100)).toFixed(r),w=this.containerDOM.getElementsByClassName("ev-chart-legend-thumb")[0];w.style.cssText=b;const M=w.getElementsByClassName("ev-chart-legend-label");M[0].style.cssText=`${p}0%;`,M[1].style.cssText=`${p}100%;`,l!==void 0&&a!==void 0&&(M[0].innerText=this.isSide?L:k,M[1].innerText=this.isSide?k:L);const V=this.containerDOM.getElementsByClassName("ev-chart-legend-handle");V[0].style.cssText=g+y,V[1].style.cssText=g+C;const S=this.containerDOM.getElementsByClassName("ev-chart-legend-handle-btn-color");S[0].style.backgroundColor=this.isSide?u:h,S[1].style.backgroundColor=this.isSide?h:u},setLegendPosition(){var y,C,b,k;const e=this.options,t=(y=e==null?void 0:e.legend)==null?void 0:y.position,{width:n,height:i}=C1,s=this.legendHandleSize,l=(C=e==null?void 0:e.title)!=null&&C.show?(b=e==null?void 0:e.title)==null?void 0:b.height:0,a=l+i,{top:r=0,bottom:c=0,left:d=0,right:h=0}=((k=e==null?void 0:e.legend)==null?void 0:k.padding)??{},u=this.wrapperDOM.style;if(!u)return;let f,m,g,p;switch(t){case"top":u.padding=`${a}px 0 0 0`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${s+7}px ${h}px ${c}px ${d}px;`,m+="width:100%",m+=`height${i}px;`,f=`width:${p.width}px;`,f+=`height:${i}px;`,f+=`top:${l}px;`;break;case"right":u.padding=`${l}px ${n}px 0 0`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${r}px ${h}px ${c}px ${d}px;`,m+=`width:${n}px;`,m+="height:100%;",m+=`max-height:${p.height}px;`,f=`width:${n}px;`,f+=`height:${p.height}px;`,f+=`top:${l}px;right:0px;`;break;case"bottom":u.padding=`${l}px 0 ${i}px 0`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${s+7}px ${h}px ${c}px ${d}px;`,m+="width:100%;",m+=`height:${i}px;`,f=`width:${p.width}px;`,f+=`height:${i}px;`,f+="bottom:0px;left:0px;";break;case"left":u.padding=`${l}px 0 0 ${n}px`,p=this.chartDOM.getBoundingClientRect(),m=`padding:${r}px ${h}px ${c}px ${d}px;`,m+="display:absolute;",m+="bottom:0px;",m+=`width:${n}px;`,m+="height:100%;",m+=`maxHeight:${p.height}px;`,f=`width:${n}px;`,f+=`height:${p.height}px;`,f+=`top:${l}px;left:0px`;break}if(["top","bottom"].includes(t)){const L=p.width/2;g=`left:${p.width/2-L/2}px;`,g+=`width:${L}px;`,g+=`height:${s}px;`,g+="padding:4px 0;",g+="margin:0 4px;"}else{const L=p.height/2;g=`top:${p.height/2-L/2}px;`,g+="left:5px;",g+=`width:${s}px;`,g+=`height:${L}px;`,g+="padding:0 4px;",g+="margin:4px 0;"}this.containerDOM.style.cssText=g,this.legendBoxDOM.style.cssText=m,this.legendDOM.style.cssText=f},updateLegendContainerSize(){Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)})},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block")},hideLegend(){var s,l,a,r;const e=this.options,t=(s=this.wrapperDOM)==null?void 0:s.style,n=(l=this.legendDOM)==null?void 0:l.style,i=(a=e==null?void 0:e.title)!=null&&a.show?(r=e==null?void 0:e.title)==null?void 0:r.height:0;!n||!t||(n.display="none",n.width="0",n.height="0",t.padding=`${i}px 0 0 0`)}},w1={initScrollbar(){var e,t,n,i,s,l;(n=(t=(e=this.options.axesX)==null?void 0:e[0])==null?void 0:t.scrollbar)!=null&&n.use&&this.initScrollbarInfo(this.options.axesX,"x"),(l=(s=(i=this.options.axesY)==null?void 0:i[0])==null?void 0:s.scrollbar)!=null&&l.use&&this.initScrollbarInfo(this.options.axesY,"y")},initScrollbarInfo(e,t){var s,l,a,r,c,d;const n=this.scrollbar[t],i=Pe({},(s=e==null?void 0:e[0])==null?void 0:s.scrollbar,fc.scrollbar);Object.keys(i).forEach(h=>{n[h]=i[h]}),n.resetPosition&&(n.range=(a=(l=e==null?void 0:e[0])==null?void 0:l.range)!=null&&a.length?[...e[0].range]:null,this.updateScrollbarAnchorEdge(t)),n.isInit||(n.type=(r=e==null?void 0:e[0])==null?void 0:r.type,n.range=(d=(c=e==null?void 0:e[0])==null?void 0:c.range)!=null&&d.length?[...e[0].range]:null,this.initScrollbarRange(t),this.updateScrollbarAnchorEdge(t),this.createScrollbarLayout(t),this.createScrollbar(t),this.createScrollEvent(t),n.isInit=!0)},initScrollbarRange(e){var i;const t=this.scrollbar[e],n=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels;if((i=t.range)!=null&&i.length&&n.length){const[s,l]=t.range;if(Re(s)&&Re(l)){const a=this.getScrollbarLimits(e);if(!a)return;const{limitMin:r,limitMax:c}=a,d=l-s,h=c-r;if(d>=h)t.range[0]=r,t.range[1]=c;else{let u=+s<r?r:+s,f=u+d;f>c&&(f=c,u=f-d,u<r&&(u=r)),t.range[0]=u,t.range[1]=f}}}},updateScrollbarInfo(e,t){var r,c,d,h,u,f,m,g,p,y,C,b,k,L,w;const{axesX:n,axesY:i}=this.options,s=e==="x"?n:i;if(!this.scrollbar[e].isInit&&((c=(r=s==null?void 0:s[0])==null?void 0:r.scrollbar)!=null&&c.use)&&((d=s==null?void 0:s[0])!=null&&d.range)){this.initScrollbarInfo(s,e);return}else if(!((h=s==null?void 0:s[0].scrollbar)!=null&&h.use)||po((u=s==null?void 0:s[0])==null?void 0:u.range)){this.destroyScrollbar(e);return}const l=e==="x"?this.axesX:this.axesY,a=!He((f=s==null?void 0:s[0])==null?void 0:f.range,(m=l==null?void 0:l[0])==null?void 0:m.range);if(a||t){const M=e==="x"?(y=(p=(g=this.options.axesX)==null?void 0:g[0])==null?void 0:p.scrollbar)==null?void 0:y.resetPosition:(k=(b=(C=this.options.axesY)==null?void 0:C[0])==null?void 0:b.scrollbar)==null?void 0:k.resetPosition;if(a){const V=(L=s==null?void 0:s[0])==null?void 0:L.range,S=this.scrollbar[e].range;if(!M&&(V!=null&&V.length)&&(S!=null&&S.length)){const x=V[1]-V[0],I=this.scrollbar[e].anchorEdge,T=I?this.getScrollbarLimits(e):null;I==="start"&&T?this.scrollbar[e].range=[T.limitMin,T.limitMin+x]:I==="end"&&T?this.scrollbar[e].range=[T.limitMax-x,T.limitMax]:this.scrollbar[e].range=[S[0],S[0]+x]}else this.scrollbar[e].range=V!=null&&V.length?[...V]:null}this.initScrollbarRange(e),a&&this.updateScrollbarAnchorEdge(e)}this.scrollbar[e].use=!!((w=s==null?void 0:s[0].scrollbar)!=null&&w.use)},updateScrollbarPosition(e){var t,n,i,s;(t=this.scrollbar.x)!=null&&t.use&&((n=this.scrollbar.x)!=null&&n.isInit)&&this.setScrollbarPosition("x",e),(i=this.scrollbar.y)!=null&&i.use&&((s=this.scrollbar.y)!=null&&s.isInit)&&this.setScrollbarPosition("y",e)},createScrollbarLayout(e){const t=this.scrollbar[e];t.dom=document.createElement("div"),t.dom.className="ev-chart-scrollbar",t.dom.dataset.type="scrollbar";const n=document.createElement("div");n.className="ev-chart-scrollbar-container",n.dataset.type=e,t.dom.appendChild(n),this.wrapperDOM.appendChild(t.dom)},createScrollbar(e){const t=this.scrollbar[e],n=t.dom.children[0];this.createScrollbarTrack(n),this.createScrollbarThumb(n),t.showButton&&this.createScrollbarButton(n)},createScrollbarTrack(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-track",t.dataset.type="track",e.appendChild(t)},createScrollbarThumb(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-thumb",t.dataset.type="thumb",e.appendChild(t)},createScrollbarButton(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-up",t.dataset.type="button";const n=document.createElement("i");n.className="ev-icon ev-icon-triangle-up ev-chart-scrollbar-button-icon",n.dataset.type="button-icon",t.appendChild(n);const i=document.createElement("div");i.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-down",i.dataset.type="button";const s=document.createElement("i");s.className="ev-icon ev-icon-triangle-down ev-chart-scrollbar-button-icon",s.dataset.type="button-icon",i.appendChild(s),e.appendChild(t),e.appendChild(i)},setScrollbarPosition(e,t){var V,S;const n=this.scrollbar[e];if(!n.use||!n.range)return;const i=n.dom,s=this.chartRect,l=t??this.labelOffset,a={x1:s.x1+l.left,x2:s.x2-l.right,y1:s.y1+l.top,y2:s.y2-l.bottom},r=(V=this.options.title)!=null&&V.show?(S=this.options.title)==null?void 0:S.height:0,c=e==="x",d=c?n.height:n.width,h=c?a.x2-a.x1:a.y2-a.y1,u=n.showButton?d:0,f=h-u*2,m=this.getScrollbarThumbSize(e,f),g=Math.max(0,f-m.size);m.position=Math.min(Math.max(m.position,0),g);let p="display: block;",y,C,b,k,L=`width:${u}px;height:${u}px;`;c?(p=`top: ${s.y2+r+l.top}px;`,p+=`left: ${a.x1}px;`,p+=`width: ${h}px;`,p+=` height: ${d}px;`,y="top: 0;",y+=`left: ${u}px;`,y+=`width: ${f}px;`,y+="height: 100%;",C=`width: ${m.size}px;`,C+="height: 100%;",C+=`left: ${m.position+u}px`,L+="transform:rotate(90deg);top: 0;",b=`${L}right:0;`,k=`${L}left:0;`):(p=`top: ${a.y1+r}px;`,p+=`left: ${a.x2+10}px;`,p+=`width: ${d}px;`,p+=`height: ${h}px;`,y=`top: ${u}px;`,y+="left: 0;",y+="width: 100%;",y+=`height: ${f}px;`,C="width: 100%;",C+=`height: ${m.size}px;`,C+=`bottom: ${m.position+u}px`,L+="left:0;",b=`${L}top: 0;`,k=`${L}bottom: 0;`),i.style.cssText=p;const w=i.getElementsByClassName("ev-chart-scrollbar-track");w[0].style.cssText=y,w[0].style.backgroundColor=n.background;const M=i.getElementsByClassName("ev-chart-scrollbar-thumb");if(M[0].style.cssText=C,M[0].style.backgroundColor=n.thumbStyle.background,M[0].style.borderRadius=`${n.thumbStyle.radius}px`,n.showButton){const x=i.getElementsByClassName("ev-chart-scrollbar-button-up"),I=Math.floor(f-m.size),T=Math.floor(m.position)>I?.5:1;x[0].style.cssText=`background-color: ${n.background};${b}`,x[0].style.opacity=T,x[0].children[0].style.display="block";const v=i.getElementsByClassName("ev-chart-scrollbar-button-down");v[0].style.cssText=`background-color: ${n.background};${k}`,v[0].style.opacity=Math.floor(m.position)<0?.5:1,v[0].children[0].style.display="block"}},getScrollbarThumbSize(e,t){var u,f,m,g;const n=this.scrollbar[e],[i,s]=n.range,l=n.type;let a,r,c=1,d=0,h=0;if(l==="step"){const p=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels,y=s-i+1;r=p.length;const C=t/r;a=C*y,h=C*i}else{const p=e==="x"?this.axesX:this.axesY,y=(u=this.minMax[e])==null?void 0:u[0],C=+y.max-+y.min,b=+s-+i;l==="time"&&(c=(g=p==null?void 0:p[0])==null?void 0:g.getInterval({minValue:y.min,maxValue:y.max,maxSteps:(m=(f=this.labelRange[e])==null?void 0:f[0])==null?void 0:m.max})),r=Math.ceil(C/c)+1,d=+y.min;const k=t/r,L=b/c+1,w=+i-d;a=k*L,h=k*(w/c)}return n.startValue=d,n.steps=r,n.interval=c,{size:a,position:h}},getScrollbarContainerDOM(e){const t=["track","thumb","button"],n=e.dataset.type;return t.includes(n)?e.parentElement:n==="button-icon"?e.parentElement.parentElement:n==="scrollbar"?e.getElementsByClassName("ev-chart-scrollbar-container")[0]:e},updateScrollbarRange(e,t){const n=this.scrollbar[e],{startValue:i,range:s,interval:l,steps:a}=n,r=i+l*a,c=e==="x"?this.axesX[0]:this.axesY[0],[d,h]=s??[];(!Re(d)||!Re(h))&&(n.range=(c==null?void 0:c.range)||null);let u,f,m=!1;t?(u=d+l,f=h+l,m=f>=r):(u=d-l,f=h-l,m=u<i),m||(n.range=[u,f],this.updateScrollbarAnchorEdge(e),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:u>1,updateByScrollbar:!0}))},getScrollbarLimits(e){var l,a;const t=this.scrollbar[e];if((t==null?void 0:t.type)==="step"){const r=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels;return r!=null&&r.length?{limitMin:0,limitMax:r.length-1}:null}const n=(a=(l=this.minMax)==null?void 0:l[e])==null?void 0:a[0];if((n==null?void 0:n.min)==null||(n==null?void 0:n.max)==null)return null;const i=+n.min,s=+n.max;return!Number.isFinite(i)||!Number.isFinite(s)?null:{limitMin:i,limitMax:s}},updateScrollbarAnchorEdge(e){const t=this.scrollbar[e];if(!t)return;const n=t.range,i=this.getScrollbarLimits(e);if(!Array.isArray(n)||n.length!==2||!i){t.anchorEdge=null;return}n[0]<=i.limitMin?t.anchorEdge="start":n[1]>=i.limitMax?t.anchorEdge="end":t.anchorEdge=null},createScrollEvent(){var t,n,i;this.onScrollbarClick=s=>{s.preventDefault();const l=s.target.dataset.type,a=this.getScrollbarContainerDOM(s.target),r=["button","button-icon"],c=a.dataset.type;let d;if(r.includes(l)){let h;l==="button"?h=s.target:l==="button-icon"&&(h=s.target.parentElement),d=h.className.includes("up")}else if(l==="track"){const h=a.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:u,y:f}=h[0].getBoundingClientRect(),m=c==="x",g=m?s.clientX:-s.clientY,p=m?u:-f;d=g>p}else return;this.updateScrollbarRange(c,d)},this.onScrollbarDown=s=>{if(s.preventDefault(),s.target.dataset.type!=="thumb")return;const l=this.getScrollbarContainerDOM(s.target),a=l.dataset.type,r=l.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:c,y:d,height:h}=r[0].getBoundingClientRect(),u=this.scrollbar[a];u.scrolling=!0,a==="x"?u.pointInThumb=s.clientX-c:u.pointInThumb=d+h-s.clientY;const f=u.dom;f.addEventListener("mousemove",this.onScrollbarMove),f.addEventListener("mouseup",this.onScrollbarUp)};const e=s=>{this.scrolling(s)};if(this.onScrollbarMove=hs(e,5),this.onScrollbarUp=s=>{s.preventDefault(),this.stopScrolling(s)},this.onScrollbarLeave=s=>{s.preventDefault(),this.scrolling(s),this.stopScrolling(s)},this.onScrollbarWheel=s=>{var h,u,f,m,g,p,y,C;const l=((u=(h=this.tooltipDOM)==null?void 0:h.style)==null?void 0:u.display)==="block",a=this.tooltipBodyDOM||((f=this.tooltipDOM)==null?void 0:f.querySelector(this.options.tooltip.htmlScrollTarget));if(l&&a){const{scrollTop:b,scrollHeight:k,clientHeight:L}=a,w=b<=0,M=Math.ceil(b)+L>=k,V=s.deltaY<0,S=s.deltaY>0;if(!(w&&V||M&&S))return}s.preventDefault();const r=1;if((m=this.scrollbar.x)!=null&&m.use&&s.shiftKey&&Math.abs(s.deltaY)>r){this.updateScrollbarRange("x",s.deltaY>0);return}const c=Math.abs(s.deltaX),d=Math.abs(s.deltaY);if(c>r&&d>r){c>d&&((g=this.scrollbar.x)!=null&&g.use)?this.updateScrollbarRange("x",s.deltaX>0):d>c&&((p=this.scrollbar.y)!=null&&p.use)&&this.updateScrollbarRange("y",s.deltaY<0);return}if((y=this.scrollbar.x)!=null&&y.use&&c>r){this.updateScrollbarRange("x",s.deltaX>0);return}(C=this.scrollbar.y)!=null&&C.use&&d>r&&this.updateScrollbarRange("y",s.deltaY<0)},this.scrollbar.x.use&&!this.scrollbar.x.isInit){const s=this.scrollbar.x.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}if(this.scrollbar.y.use&&!this.scrollbar.y.isInit){const s=this.scrollbar.y.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}((t=this.scrollbar.x)!=null&&t.use||(n=this.scrollbar.y)!=null&&n.use)&&((i=this.overlayCanvas)==null||i.addEventListener("wheel",this.onScrollbarWheel,{passive:!1}))},scrolling(e){const t=this.getScrollbarContainerDOM(e.target),n=t.dataset.type;if(!this.scrollbar[n].scrolling)return;const{steps:i,range:s,pointInThumb:l,startValue:a,interval:r}=this.scrollbar[n],c=t.getElementsByClassName("ev-chart-scrollbar-track"),{x:d,y:h,width:u,height:f}=c[0].getBoundingClientRect(),m=n==="x",g=m?d:h,p=m?u:f,y=p/i,C=a+(i-1)*r;let b=m?e.clientX:e.clientY;b<g?b=g:b>g+p&&(b=g+p);let k;if(m?k=b-g-l:k=g+p-b-l,k<=0)return;let L,w;const M=Math.round(Math.abs(k)/y)*r,[V,S]=s;if(k>0){const x=a+(M-+V);L=+V+x,w=L+(+S-+V)}L<a||w>C||(this.scrollbar[n].range=[L,w],this.updateScrollbarAnchorEdge(n),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:L>1,updateByScrollbar:!0}))},stopScrolling(e){const n=this.getScrollbarContainerDOM(e.target).dataset.type,i=this.scrollbar[n];if(i.scrolling){i.scrolling=!1;const s=i.dom;s.removeEventListener("mousemove",this.onScrollbarMove,!1),s.removeEventListener("mouseup",this.onScrollbarUp,!1)}},hideScrollbar(e){const t=this.scrollbar[e].dom;if(!t)return;const n=t==null?void 0:t.style;n.display="none",n.width="0",n.height="0"},destroyScrollbar(e){var n,i,s;const t=this.scrollbar[e].dom;t&&(t.remove(),this.scrollbar[e]={isInit:!1},!((n=this.scrollbar.x)!=null&&n.use)&&!((i=this.scrollbar.y)!=null&&i.use)&&((s=this.overlayCanvas)==null||s.removeEventListener("wheel",this.onScrollbarWheel,{passive:!1})))}};function I1(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")}function wc(e,t,n){let i,s,l,a,r,c,d=0,h=!1,u=!1,f=!0;const m=!t&&t!==0&&typeof root.requestAnimationFrame=="function";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0,I1(n)&&(h=!!n.leading,u="maxWait"in n,l=u?Math.max(+n.maxWait||0,t):l,f="trailing"in n?!!n.trailing:f);function g(I){const T=i,v=s;return i=s=void 0,d=I,a=e.apply(v,T),a}function p(I,T){return m?(window.cancelAnimationFrame(r),window.requestAnimationFrame(I)):setTimeout(I,T)}function y(I){if(m)return window.cancelAnimationFrame(I);clearTimeout(I)}function C(I){return d=I,r=p(L,t),h?g(I):a}function b(I){const T=I-c,v=I-d,E=t-T;return u?Math.min(E,l-v):E}function k(I){const T=I-c,v=I-d;return c===void 0||T>=t||T<0||u&&v>=l}function L(){const I=Date.now();if(k(I))return w(I);r=p(L,b(I))}function w(I){return r=void 0,f&&i?g(I):(i=s=void 0,a)}function M(){r!==void 0&&y(r),d=0,i=c=s=r=void 0}function V(){return r===void 0?a:w(Date.now())}function S(){return r!==void 0}function x(...I){const T=Date.now(),v=k(T);if(i=I,s=this,c=T,v){if(r===void 0)return C(c);if(u)return r=p(L,t),g(c)}return r===void 0&&(r=p(L,t)),a}return x.cancel=M,x.flush=V,x.pending=S,x}const T1="Expected a function";function L1(e,t,n){let i=!0,s=!0;if(typeof e!="function")throw new TypeError(T1);return wc(e,t,{leading:i,maxWait:t,trailing:s})}const M1={createEventFunctions(){var s,l,a,r;this.onMouseMove=c=>{var w,M;if((w=this.dragInfo)!=null&&w.isMove||this.isMobile)return;const d={e:c},{indicator:h,tooltip:u,type:f}=this.options,m=this.getMousePosition(c),g=this.findHitItem(m),p=this.findPlotLabelHitRegion(m);p&&(g.items={},g.hitId=null),!p&&(u!=null&&u.showAllValueInRange)&&(g!=null&&g.items)&&this.addNotHitInfo(g);const y=this.overlayCtx,C=Object.keys(g.items),b=C.length>0;let k="";if(b){k=`h=${g.hitId}`;const V=C.slice().sort();for(let S=0;S<V.length;S++){const x=V[S];k+=`|${x}:${g.items[x].index}`}}const L=k!==""&&k===this._lastHoverSig&&this.tooltipDOM&&this.tooltipDOM.style.display!=="none";if(this.overlayClear(),b){if(u.use&&this.isInitTooltip)if(this.drawItemsHighlight(g,y),typeof(u==null?void 0:u.returnValue)=="function"){const S=[];for(let x=0;x<C.length;x++){const I=C[x],T=g.items[I];S.push({sId:I,data:T.data,color:T.color,name:T.name,dataId:T.id,index:T.index})}this.hideTooltipDOM(),u.returnValue(S,c)}else(M=u==null?void 0:u.formatter)!=null&&M.html?(L||this.drawCustomTooltip(g==null?void 0:g.items),this.setCustomTooltipLayoutPosition(g,c)):(this.setTooltipLayoutPosition(g,c),f==="scatter"?this.drawTooltipForScatter(g,this.tooltipCtx):f==="heatMap"?this.drawToolTipForHeatMap(g,this.tooltipCtx):this.drawTooltip(g,this.tooltipCtx));const V=Object.values(this.seriesList||{}).some(S=>S.type==="line");if(u.use&&(f==="line"||V)){const S=this.drawIndicatorForTooltip(g,h.color),x=S==null?void 0:S.labelValue,I=this.getTimeLabel(m);d.hoveredLabel={horizontal:this.options.horizontal,label:I,mousePosition:[c.clientX,c.clientY],dataLabel:x}}}else u.use&&this.isInitTooltip&&(typeof(u==null?void 0:u.returnValue)=="function"&&u.returnValue([],c),this.hideTooltipDOM());if(this.handlePlotLabelHover(p,c),this._lastHoverSig=k,this.dragInfoBackup&&!this.dragDisplayCanvas&&this.drawSelectionArea(this.dragInfoBackup),!d.hoveredLabel&&!this.isNotUseIndicator()){const V=Object.values(this.seriesList||{}).some(x=>x.type==="line");(f!=="line"&&!V||!u.use||!Object.keys(g.items).length)&&this.drawIndicator(m,h.color);const S=this.getTimeLabel(m);d.hoveredLabel={horizontal:this.options.horizontal,label:S,mousePosition:[c.clientX,c.clientY]}}else d.hoveredLabel||(d.hoveredLabel={label:""});typeof this.listeners["mouse-move"]=="function"&&(f!=="pie"&&(d.curMouseTargetVal=this.getCurMouseTargetVal(m,g)),this.listeners["mouse-move"](d))},this.onMouseLeave=c=>{var u;const{tooltip:d,dragSelection:h}=this.options;d.throttledMove&&this.onMouseMove.cancel(),(!h.use||!h.keepDisplay)&&this.overlayClear(),(u=this.hidePlotLabelTooltip)==null||u.call(this),d.use&&this.isInitTooltip&&(typeof(d==null?void 0:d.returnValue)=="function"&&d.returnValue([],c),this.tooltipClear()),this._lastHoverSig="",this.invalidateClientRectCache(),this.listeners["mouse-leave"]()},this.onDblClick=c=>{const d={e:c},h=this.getMousePosition(c),{type:u,selectItem:f,selectLabel:m,selectSeries:g}=this.options,p=(f==null?void 0:f.use)&&(f==null?void 0:f.useClick),y=(m==null?void 0:m.use)&&(m==null?void 0:m.useClick),C=(g==null?void 0:g.use)&&(g==null?void 0:g.useClick);p?d.eventTarget="item":y?d.eventTarget="label":C&&(d.eventTarget="series");const b=()=>{var S,x;const w=this.findHitItem(h,!0),M=w.hitId??Object.keys(w.items)[0],V=w.items[M];V&&(d.label=V.label,d.value=(S=V.data)==null?void 0:S.o,d.seriesId=M,d.dataIndex=V.index,d.acc=(x=V.data)==null?void 0:x.acc)},k=w=>{var T,v;const M=this.findHitItem(h,!0),V=M.hitId??Object.keys(M.items)[0],S=M.items[V],{labelIndex:x}=this.getLabelInfoByPosition(h,w),{dataIndex:I}=this.regulateSelectedLabelInfo(x,w);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(I,w),S&&(d.label=S.label,d.seriesId=V,d.value=(T=S.data)==null?void 0:T.o,d.acc=(v=S.data)==null?void 0:v.acc,d.dataIndex=S.index)},L=()=>{var S,x,I;const w=this.findHitItem(h,!0),M=w.hitId??Object.keys(w.items)[0],V=w.items[M];if(M!==null){const T=this.updateSelectedSeriesInfo(M,!0);V&&(d.label=V.label,d.value=(S=V.data)==null?void 0:S.o,d.seriesId=(x=T.seriesId)==null?void 0:x.at(0),d.acc=(I=V.data)==null?void 0:I.acc,d.dataIndex=V.index)}};switch(u){case"bar":{y?k(this.options.horizontal?"yAxis":"xAxis"):b();break}case"line":{p?b():y?k():C&&L();break}default:{b();break}}typeof this.listeners["dbl-click"]=="function"&&this.listeners["dbl-click"](d)},this.onClick=c=>{var w;if(this.isMouseMove){this.isMouseMove=!1;return}const d={e:c},h=this.getMousePosition(c),{type:u,selectItem:f,selectLabel:m,selectSeries:g}=this.options,p=(f==null?void 0:f.use)&&(f==null?void 0:f.useClick),y=(m==null?void 0:m.use)&&(m==null?void 0:m.useClick),C=(g==null?void 0:g.use)&&(g==null?void 0:g.useClick),b=()=>{const M=this.getHitItemByPosition(h,!1,void 0,!1,!0);({label:d.label,value:d.value,sId:d.seriesId,dataIndex:d.dataIndex,acc:d.acc}=M),M!=null&&M.sId&&(d.selected={eventTarget:"item",seriesId:this.isDeselectItem(M)?null:M.sId,dataIndex:this.isDeselectItem(M)?null:M.dataIndex})},k=M=>{var x,I,T,v;const{labelIndex:V}=this.getLabelInfoByPosition(h,M),{dataIndex:S}=this.regulateSelectedLabelInfo(V,M);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(S,M),M&&(this.defaultSelectInfo.targetAxis=S!=null&&S.length?M:null),d.selected={eventTarget:"label",...Ve(this.defaultSelectInfo)},d.label=(I=(x=this.defaultSelectInfo)==null?void 0:x.label)==null?void 0:I.at(0),d.dataIndex=(v=(T=this.defaultSelectInfo)==null?void 0:T.dataIndex)==null?void 0:v.at(0)},L=()=>{const M=this.findHitItem(h,!0),V=M.hitId??Object.keys(M.items)[0],S=M.items[V];if(!Ht(V)){const x=this.updateSelectedSeriesInfo(V,!1);this.defaultSelectInfo.seriesId=x.seriesId,d.selected={eventTarget:"series",...Ve(this.defaultSelectInfo)},d.label=S.label,d.dataIndex=S.index}};switch(u){default:case"bar":{p?b():y&&k(this.options.horizontal?"yAxis":"xAxis");break}case"line":{p?b():y?k():C&&L();break}case"heatMap":{const M=!!this.options.horizontal;if(p&&y){const{useBothAxis:V}=m,S=this.getCurMouseLocation(h);if(S==="chartBackground")this.clearSelectedLabelInfo(),d.deselected={eventTarget:"label"},b();else if(S==="yAxis"||S==="xAxis"){if(this.clearSelectedItemInfo(),d.deselected={eventTarget:"item"},!V&&S!==(M?"yAxis":"xAxis"))return;k(S)}}else if(p)b();else if(y){const{useBothAxis:V}=m,S=this.getCurMouseLocation(h);if((S==="yAxis"||S==="xAxis")&&!V&&S!==(M?"yAxis":"xAxis"))return;S!=="canvas"&&k(V?S:null)}break}case"pie":{p&&b();break}case"scatter":{if(p&&b(),(w=this.options.dragSelection)!=null&&w.use&&this.isMobile){let M=this.setTouchInfo(c);this.overlayClear(),this.options.dragSelection.keepDisplay&&(c.layerX<M.range.x1||c.layerY<M.range.y1||c.layerX>M.range.x2||c.layerY>M.range.y2)?this.isTouchOverlay=!1:(M=this.setTouchBoxDimensions(M),this.isTouchOverlay=!0,this.drawSelectionArea(M)),this.options.dragSelection.keepDisplay||setTimeout(()=>{this.isTouchOverlay=!1,this.overlayClear()},100),d.e=c,d.touchInfo=M,d.data=this.findSelectedItems(M),d.range=this.getSelectionRange(M),typeof this.listeners["drag-select"]=="function"&&this.listeners["drag-select"](d)}break}}typeof this.listeners.click=="function"&&(this.dragInfoBackup||this.listeners.click(d))},this.onMouseDown=c=>{const{dragSelection:d,type:h,horizontal:u}=this.options,f=h==="bar"&&!u,m=!h&&!u;d.use&&(h==="scatter"||h==="line"||h==="heatMap"||f||m)&&(this.removeSelectionArea(),this.dragStart(c,h))},this.onWheel=c=>{var b,k,L,w;if(!(((k=(b=this.tooltipDOM)==null?void 0:b.style)==null?void 0:k.display)==="block"))return;const h=((L=this.vsState)==null?void 0:L.scrollEl)||(this.options.tooltip.htmlScrollTarget?(w=this.tooltipDOM)==null?void 0:w.querySelector(this.options.tooltip.htmlScrollTarget):null)||this.tooltipBodyDOM;if(!h||h.scrollHeight<=h.clientHeight){this.hideTooltipDOM();return}const{scrollTop:u,scrollHeight:f,clientHeight:m}=h,g=u<=0,p=Math.ceil(u)+m>=f,y=c.deltaY<0,C=c.deltaY>0;c.preventDefault(),!(g&&y)&&!(p&&C)&&(h.scrollTop+=c.deltaY)};const e=(s=this.options)==null?void 0:s.tooltip,t=!!((l=e==null?void 0:e.formatter)!=null&&l.html)&&!!(e!=null&&e.virtualScroll)&&e.virtualScroll.use!==!1;(e!=null&&e.useScrollbar||t)&&this.overlayCanvas.addEventListener("wheel",this.onWheel,{passive:!1}),(r=(a=this.options)==null?void 0:a.tooltip)!=null&&r.throttledMove&&(this.onMouseMove=L1(this.onMouseMove,30)),this.overlayCanvas.addEventListener("mousemove",this.onMouseMove),this.overlayCanvas.addEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.addEventListener("dblclick",this.onDblClick),this.overlayCanvas.addEventListener("click",this.onClick);const{startArea:n,displayFromStartArea:i}=this.options.dragSelection;this.dragStartTarget=n&&this.target.closest(n)||this.overlayCanvas,this.dragStartTarget.addEventListener("mousedown",this.onMouseDown),i&&this.options.type==="scatter"&&!this.isMobile&&this.dragStartTarget!==this.overlayCanvas&&this.createDragDisplayCanvas(),this.dragTouchSelectionEvent=c=>this.dragTouchSelectionDestroy(c),window.addEventListener("click",this.dragTouchSelectionEvent),this.invalidateRectOnScroll=()=>this.invalidateClientRectCache(),window.addEventListener("scroll",this.invalidateRectOnScroll,{capture:!0,passive:!0})},dragStart(e,t){this.dragDisplayCanvas&&this.refreshDragDisplayCanvas();let n;this.dragDisplayCanvas&&(n=this.dragStartTarget.style.userSelect,this.dragStartTarget.style.userSelect="none");const[i,s,l,a]=this.getMousePosition(e);let r=i,c=s;const d=this.chartRect,h=this.labelOffset,u={x1:d.x1+h.left,x2:d.x2-h.right,y1:d.y1+h.top,y2:d.y2-h.bottom};r<u.x1&&(r=u.x1),r>u.x2&&(r=u.x2),c<u.y1&&(c=u.y1),c>u.y2&&(c=u.y2),this.dragInfo={xcp:r,ycp:c,range:u};const f=(C,b)=>C>=0&&C<=l&&b>=0&&b<=a;let m=!1;const g=()=>{m||(m=!0,this.removeSelectionArea())};(f(i,s)||this.dragDisplayCanvas)&&g();const p=C=>{const[b,k]=this.getMousePosition(C);if(!m)if(f(b,k))g();else return;C.preventDefault();const L=this.dragInfo,{xcp:w,ycp:M,range:V}=L;let S,x;if(L.isMove=!0,this.isMouseMove=!0,b<V.x1?S=V.x1:b>V.x2?S=V.x2:S=b,k<V.y1?x=u.y1:k>V.y2?x=V.y2:x=k,t==="heatMap"){const I={xcp:w,xep:S,ycp:M,yep:x,range:V},{xsp:T,ysp:v,width:E,height:Z}=this.getDragInfoForHeatMap(I);L.xsp=T,L.ysp=v,L.width=E,L.height=Z}else L.xsp=Math.min(w,S),L.ysp=t==="scatter"?Math.min(M,x):V.y1,L.width=Math.ceil(Math.abs(S-w)),L.height=t==="scatter"?Math.ceil(Math.abs(x-M)):V.y2-V.y1;this.dragDisplayCanvas&&t==="scatter"&&(L.displayRect={xsp:Math.min(i,b),ysp:Math.min(s,k),width:Math.ceil(Math.abs(b-i)),height:Math.ceil(Math.abs(k-s)),range:V}),this.overlayClear(),this.drawSelectionArea(L)},y=C=>{var k,L,w,M;const b=this.dragInfo;if(m&&(b!=null&&b.isMove)&&(b==null?void 0:b.width)>1&&(b==null?void 0:b.height)>1){const V={e:C,data:this.findSelectedItems(b),range:t==="heatMap"?this.getSelectionRangeForHeatMap(b):this.getSelectionRange(b)};if(this.dragInfoBackup=Pe({},b),typeof this.listeners["drag-select"]=="function"&&!((L=(k=this.options)==null?void 0:k.zoom)!=null&&L.use))this.listeners["drag-select"](V);else if(V.range){const{xsp:S,range:x,width:I}=b,T=S-x.x1;V.range.dragSelectionInfo={dragXsp:T,dragXep:T+I,exceptAxesYChartWidth:x.x2-x.x1,exceptAxesXChartHeight:x.y2-x.y1,chartRange:x,chartTitle:this.options.title.text},(M=(w=this.options.zoom)==null?void 0:w.getRangeInfo)==null||M.call(w,V)}this.options.dragSelection.keepDisplay||this.removeSelectionArea()}this.dragInfo=null,n!==void 0&&(this.dragStartTarget.style.userSelect=n),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",y)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",y)},drawSelectionArea(e){var h,u;const t=!!this.dragDisplayCanvas,n=t?this.dragDisplayCtx:this.overlayCtx,{fillColor:i,opacity:s}=this.options.dragSelection;let l=0,a=0;t&&(this.dragDisplayClear(),l=((h=this.dragDisplayOffset)==null?void 0:h.x)??0,a=((u=this.dragDisplayOffset)==null?void 0:u.y)??0);const r=this.chartRect,c=this.labelOffset,d={x1:r.x1+c.left,x2:r.x2-c.right,y1:r.y1+c.top,y2:r.y2-c.bottom};if(n.fillStyle=i,n.globalAlpha=s,t&&e.displayRect){const f=e.displayRect,{xsp:m,ysp:g,width:p,height:y,range:C}=e;let b=m,k=g,L=p,w=y;if(!He(d,C)){const I=C.x2-C.x1,T=C.y2-C.y1,v=d.x2-d.x1,E=d.y2-d.y1;b=d.x1+v*((m-C.x1)/I),k=d.y1+E*((g-C.y1)/T),L=v*(p/I),w=E*(y/T)}const M=m-f.xsp,V=g-f.ysp,S=f.xsp+f.width-(m+p),x=f.ysp+f.height-(g+y);n.fillRect(b-M+l,k-V+a,L+M+S,w+V+x)}else{const{xsp:f,ysp:m,width:g,height:p,range:y}=e;if(He(d,y))n.fillRect(f+l,m+a,g,p);else{const C=y.x2-y.x1,b=y.y2-y.y1,k=d.x2-d.x1,L=d.y2-d.y1,w=(f-y.x1)/C,M=(m-y.y1)/b,V=d.x1+k*w,S=d.y1+L*M,x=g/C,I=p/b,T=k*x,v=L*I;n.fillRect(V+l,S+a,T,v)}}n.globalAlpha=1},createDragDisplayCanvas(){const e=this.dragStartTarget;if(!e||e===this.overlayCanvas)return;window.getComputedStyle(e).position==="static"&&(this.dragStartAreaPrevPosition=e.style.position,e.style.position="relative");const t=document.createElement("canvas");t.className="ev-chart-drag-display-canvas",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.zIndex="3",t.style.pointerEvents="none",e.appendChild(t),this.dragDisplayCanvas=t,this.dragDisplayCtx=t.getContext("2d"),this.refreshDragDisplayCanvas()},refreshDragDisplayCanvas(){if(!this.dragDisplayCanvas||!this.dragStartTarget)return;const{width:e,height:t}=this.dragStartTarget.getBoundingClientRect(),n=Math.max(1,Math.round(e)),i=Math.max(1,Math.round(t)),s=n*this.pixelRatio,l=i*this.pixelRatio;(this.dragDisplayCanvas.width!==s||this.dragDisplayCanvas.height!==l)&&(this.dragDisplayCanvas.width=s,this.dragDisplayCanvas.height=l,this.dragDisplayCanvas.style.width=`${n}px`,this.dragDisplayCanvas.style.height=`${i}px`),this.dragDisplayCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.dragDisplayClear();const a=this.overlayCanvas.getBoundingClientRect(),r=this.dragDisplayCanvas.getBoundingClientRect();this.dragDisplayOffset={x:a.left-r.left,y:a.top-r.top}},dragDisplayClear(){if(!this.dragDisplayCtx||!this.dragDisplayCanvas)return;const e=this.pixelRatio<1?this.pixelRatio:1;this.dragDisplayCtx.clearRect(0,0,this.dragDisplayCanvas.width/e,this.dragDisplayCanvas.height/e)},removeSelectionArea(){this.dragInfoBackup=null,this.overlayClear(),this.dragDisplayCanvas&&this.dragDisplayClear()},getMousePosition(e){const t=e.originalEvent||e,n=this.getOverlayClientRect();return[t.clientX-n.left,t.clientY-n.top,n.width,n.height]},findPlotLabelHitRegion(e){const t=this.plotLabelHitRegions;if(!(t!=null&&t.length))return null;const[n,i]=e;return t.find(s=>n>=s.x&&n<=s.x+s.width&&i>=s.y&&i<=s.y+s.height)??null},handlePlotLabelHover(e,t){var n;e?this.showPlotLabelTooltip(e,t.originalEvent||t):(n=this.hidePlotLabelTooltip)==null||n.call(this)},getCurMouseTargetVal(e,t){const n=this.getCurMouseLocation(e),i={location:n,labelIdx:-1,labelVal:"",dataIdx:-1,maxDataVal:"",originVal:""};if(n==="chartBackground"){const{maxHighlight:s,items:l}=t;if(s!=null&&s.length){const[a,r]=s;l[a]&&(i.dataIdx=l[a].index,i.maxDataVal=r,i.originVal=t)}}else if(n==="xAxis"||n==="yAxis"){const{axesX:s,axesY:l}=this.options,a=(c,d,h)=>{i.labelIdx=d,i.labelVal=c[0].type==="time"?We(h).format(c[0].timeFormat):h,i.originVal=c[0].type==="time"?We(h):h};(c=>{const{labelIndex:d}=this.getLabelInfoByPosition(e,n),{labelVal:h,labelIdx:u}=this.getCurMouseLabelVal(c,e,d);a(c==="xAxis"?s:l,u,h)})(n)}return i},setTouchInfo(e){let[t,n]=this.getMousePosition(e);const i=this.chartRect,s=this.labelOffset,l={x1:i.x1+s.left,x2:i.x2-s.right,y1:i.y1+s.top,y2:i.y2-s.bottom};return t=Math.max(l.x1,Math.min(t,l.x2)),n=Math.max(l.y1,Math.min(n,l.y2)),{xcp:t,ycp:n,range:l}},setTouchBoxDimensions(e){var h;const t=((h=this.options.dragSelection)==null?void 0:h.size)||50,n=t/2,{xcp:i,ycp:s,range:l}=e;let a=i-n,r=s-n,c=t,d=t;return this.boxOverflow={x1:!1,x2:!1,y1:!1,y2:!1},i<l.x1+n&&(a=l.x1,c=n-(l.x1-i),this.boxOverflow.x1=!0),i>l.x2-n&&(c=n-(i-l.x2),this.boxOverflow.x2=!0),s<l.y1+n&&(r=l.y1,d=n-(l.y1-s),this.boxOverflow.y1=!0),s>l.y2-n&&(d=n-(s-l.y2),this.boxOverflow.y2=!0),e.xsp=a,e.ysp=r,e.width=c,e.height=d,e},dragTouchSelectionDestroy(e){var t;(t=this.options.dragSelection)!=null&&t.use&&e.target!==this.overlayCanvas&&this.isTouchOverlay&&(this.isTouchOverlay=!1,this.overlayClear())},findHitItem(e,t=!1){var w,M,V,S;(w=this.ensureHitCoordsFresh)==null||w.call(this);const n=Object.keys(this.seriesList),i={},s=!!this.options.horizontal,l=this.tooltipCtx,[a,r]=e;let c=null,d="",h=0,u="",f=null,m=null,g=1/0,p=!1,y=null,C=1/0;const b=this.findClosestDataIndex(e,n,t);if(b===-1&&!this.isNotUseIndicator())return{items:i,hitId:c,maxTip:[d,u],maxHighlight:null};const k=n.every(x=>this.seriesList[x].type==="bar");for(let x=0;x<n.length;x++){const I=n[x],T=this.seriesList[I];if(T.findGraphData&&T.show){const v=T.findGraphData(e,s,b,!k);if(v!=null&&v.data){let E;if(v.data.o===null&&T.interpolation!=="zero"?T.isExistGrp||(E=s?v.data.x:v.data.y):isNaN(v.data.o)||(E=v.data.o),E!=null){const Z=this.getFormattedTooltipLabel({dataId:T.id,seriesId:I,seriesName:T.name,itemData:v.data}),W=l?l.measureText(Z).width:1;v.id=T.id,v.name=Z,v.axis={x:T.xAxisIndex,y:T.yAxisIndex},v.label=s?(M=v.data)==null?void 0:M.y:(V=v.data)==null?void 0:V.x,i[I]=v;const R=this.getFormattedTooltipValue({dataId:T.id,seriesId:I,seriesName:Z,value:E,itemData:v.data});if(v.data.formatted=R,h<W&&(d=Z,h=W),u.length<=`${R}`.length&&(u=`${R}`),(f===null||f<=E)&&(f=E,m=I),v.hit&&v.data.xp!==void 0&&v.data.yp!==void 0){const X=(v.data.xp-e[0])**2+(v.data.yp-e[1])**2;v.directHit?((!p||X<g)&&(g=X,c=I),p=!0):!p&&X<g&&(g=X,c=I)}if(c===null&&v.data.xp!==void 0&&v.data.yp!==void 0&&v.data.xp!==null&&v.data.yp!==null){const X=A.calcBoxDistance(v.data,a,r);X<C&&(C=X,y=I)}}}}}c===null&&(c=y!==null?y:Object.keys(i)[0]);const L=f!==null?[m,f]:null;if(t&&Object.keys(i).length===0&&b!==-1){const x=n.find(T=>{var E;const v=this.seriesList[T];return(v==null?void 0:v.show)&&((E=v==null?void 0:v.data)==null?void 0:E.length)>0}),I=x?(S=this.seriesList[x].data)==null?void 0:S[b]:null;I&&(i[""]={id:"",name:"",label:s?I.y:I.x,index:b,axis:{x:0,y:0},data:{o:void 0,x:I.x,y:I.y}},c="")}return{items:i,hitId:c,maxTip:[d,u],maxHighlight:L}},buildLabelValidMask(e){var s,l;const t=e??Object.keys(this.seriesList);let n=0;for(let a=0;a<t.length;a++){const r=this.seriesList[t[a]];r!=null&&r.show&&((s=r.data)==null?void 0:s.length)>n&&(n=r.data.length)}const i=new Uint8Array(n);for(let a=0;a<t.length;a++){const r=this.seriesList[t[a]];if(r!=null&&r.show&&r.data){const{data:c}=r;for(let d=0;d<c.length;d++){const h=(l=c[d])==null?void 0:l.o;h!=null&&(i[d]=1)}}}return this.labelValidMask=i,i},findClosestDataIndex(e,t,n=!1){var p;const[i,s]=e,l=!!this.options.horizontal,a=l?s:i,r=t.find(y=>{var b;const C=this.seriesList[y];return(C==null?void 0:C.show)&&((b=C==null?void 0:C.data)==null?void 0:b.length)>0});if(!r||!((p=this.seriesList[r])!=null&&p.data))return-1;const c=this.seriesList[r].data;let d=50;if(c.length>1){const y=[];for(let C=1;C<c.length;C++){const b=c[C-1],k=c[C];if(b&&k){let L,w;l?(L=b.h?b.yp+b.h/2:b.yp,w=k.h?k.yp+k.h/2:k.yp):(L=b.w?b.xp+b.w/2:b.xp,w=k.w?k.xp+k.w/2:k.xp),L!==null&&w!==null&&y.push(Math.abs(w-L))}}y.length>0&&(d=y.reduce((C,b)=>C+b,0)/y.length)}let h=1/0,u=-1,f=this.labelValidMask;!n&&(!f||f.length<c.length)&&(f=this.buildLabelValidMask(t));for(let y=0;y<c.length;y++)if(n||f[y]===1){const b=c[y];if(b){let k;if(l?k=b.h?b.yp+b.h/2:b.yp:k=b.w?b.xp+b.w/2:b.xp,k!==null){const L=Math.abs(a-k);L<h&&(h=L,u=y)}}}if(u===-1)return-1;const g=Math.max(d,6);return h>=g?t.some(C=>{const b=this.seriesList[C];if(b!=null&&b.show){const k=b.passingValue,L=b.interpolation,w=b.hasPassingValueInData;return L==="linear"||L==="none"&&!!k&&w}return!1})?u:-1:u},getFormattedTooltipLabel({dataId:e,seriesId:t,seriesName:n,itemData:i}){var c;const l=this.options.tooltip,a=(c=l==null?void 0:l.formatter)==null?void 0:c.label;let r=n;return a&&(r=a({dataId:e,seriesId:t,seriesName:n,itemData:i})),r},getFormattedTooltipValue({dataId:e,seriesId:t,seriesName:n,value:i,itemData:s}){var u;const l=this.options,a=!!l.horizontal,r=l.tooltip,c=typeof(r==null?void 0:r.formatter)=="function"?r==null?void 0:r.formatter:(u=r==null?void 0:r.formatter)==null?void 0:u.value,d=s!==null&&typeof s=="object"&&c&&this._dataEpoch!=null;if(d){this._tooltipValueCacheEpoch!==this._dataEpoch&&(this._tooltipValueCache=null,this._tooltipValueCacheEpoch=this._dataEpoch),this._tooltipValueCache||(this._tooltipValueCache=new WeakMap);const f=this._tooltipValueCache.get(s);if(f!==void 0){const m=f[t];if(m!==void 0)return m}}let h=i;if(c&&(l.type==="pie"?h=c({value:i,name:n,percentage:s==null?void 0:s.percentage,seriesId:t,dataId:e}):l.type==="heatMap"?h=c({x:s==null?void 0:s.x,y:s==null?void 0:s.y,value:i>-1?i:"error",seriesId:t,dataId:e}):h=c({x:a?i:s==null?void 0:s.x,y:a?s==null?void 0:s.y:i,o:s==null?void 0:s.o,name:n,seriesId:t,dataId:e})),i&&(!c||typeof h!="string")&&(l.type==="heatMap"?h=i<0?"error":nn(i):h=nn(i)),d){let f=this._tooltipValueCache.get(s);f||(f=Object.create(null),this._tooltipValueCache.set(s,f)),f[t]=h}return h},addNotHitInfo(e){var c,d,h,u,f,m;const t=this.tooltipCtx,n=!!this.options.horizontal,i=Object.keys(e.items)[0],s=n?(h=(d=(c=e.items)==null?void 0:c[i])==null?void 0:d.data)==null?void 0:h.y:(m=(f=(u=e.items)==null?void 0:u[i])==null?void 0:f.data)==null?void 0:m.x;let l="",a="";const r=Object.keys(this.seriesList);for(let g=0;g<r.length;g++){const p=r[g],y=this.seriesList[p];if(y!=null&&y.show){const C=y.data.find(S=>n?(S==null?void 0:S.y)===s:(S==null?void 0:S.x)===s),b=this.getFormattedTooltipLabel({dataId:y.id,seriesId:p,seriesName:y.name,itemData:C}),k=this.getFormattedTooltipValue({dataId:y.id,seriesId:p,seriesName:b,value:C==null?void 0:C.o,itemData:C});if(C&&C.o!==null&&C.o!==void 0&&!e.items[p]){const S={};S.color=y.color,S.hit=!1,S.name=b,S.axis={x:y.xAxisIndex,y:y.yAxisIndex},S.index=n?y.yAxisIndex:y.xAxisIndex,S.data=C,S.data.formatted=k,e.items[p]=S}const L=t?t.measureText(l).width:1,w=t?t.measureText(b).width:1;L<w&&(l=b);const M=t?t.measureText(a).width:1,V=t?t.measureText(`${k}`).width:1;M<V&&(a=`${k}`)}}e.maxTip=[l,a]},selectItemByData(e,t){this.defaultSelectItemInfo=e;let n;t==="pie"?n={type:"pie",sId:e.seriesID}:n=isNaN(e==null?void 0:e.dataIndex)?null:this.getItem(e,!1),this.render(n)},selectLabelByData(e,t){this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(e,t),this.render()},selectSeriesByData(e){const t=e??[],n=this._renderedSelectSeriesIds;n&&n.length===t.length&&n.every((i,s)=>i===t[s])||(this.defaultSelectInfo.seriesId=e,this._renderedSelectSeriesIds=[...t],this.render())},getSelectedLabelInfoWithLabelData(e,t){const{selectLabel:n,type:i,horizontal:s}=this.options,l=Ve(this.defaultSelectInfo);switch(l.dataIndex=e,i){default:case"bar":case"line":{l.dataIndex.splice(n.limit),l.label=l.dataIndex.map(r=>this.data.labels[r]);const a=Object.entries(this.data.data);l.data=l.dataIndex.map(r=>Object.fromEntries(a.map(([c,d])=>[c,d[r]])));break}case"heatMap":{const{limit:a,useBothAxis:r}=this.options.selectLabel;l.dataIndex.splice(a);let c;r?c=t==="yAxis"?"y":"x":c=s?"y":"x",l.label=l.dataIndex.map(h=>this.data.labels[c][h]);const d=Object.values(this.data.data)[0];l.data=d.filter(({x:h,y:u})=>l.label.includes(c==="y"?u:h));break}}return l},regulateSelectedLabelInfo(e,t){var l,a;const n=((l=this.options)==null?void 0:l.selectLabel)??{},i=t===null||((a=this.defaultSelectInfo)==null?void 0:a.targetAxis)===t?{...this.defaultSelectInfo,targetAxis:t}:{dataIndex:[],targetAxis:t},s=Ve(i);if(i.dataIndex.includes(e)){const r=i.dataIndex.indexOf(e);s.dataIndex.splice(r,1)}else e>-1&&(s.dataIndex.push(e),n.limit>0&&n.limit<s.dataIndex.length&&(n.useDeselectOverflow?s.dataIndex.splice(0,1):s.dataIndex.pop()));return s},updateSelectedSeriesInfo(e,t){var l;const n=((l=this.options)==null?void 0:l.selectSeries)??{},i=this.defaultSelectInfo??{seriesId:[]};typeof i.seriesId=="string"&&(i.seriesId=[i.seriesId]);const s=Ve(i);if(i.seriesId.includes(e)){if(!t){const a=i.seriesId.indexOf(e);s.seriesId.splice(a,1)}}else e&&(s.seriesId.push(e),n.limit>0&&n.limit<s.seriesId.length&&(n.useDeselectOverflow?s.seriesId.splice(0,1):s.seriesId.pop()));return s},drawIndicatorForTooltip(e,t){var d;if(!(e!=null&&e.items)||!Object.keys(e.items).length)return null;const n=this.overlayCtx,{horizontal:i}=this.options,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=Object.keys(e.items)[0],a=e.items[l];if(!(a!=null&&a.data))return null;const r=i?a.data.y:a.data.x;let c;if(i){const h=a.data.yp+(a.data.h?a.data.h/2:0);c=[s.x1,h]}else c=[a.data.xp+(a.data.w?a.data.w/2:0),s.y1];return n.beginPath(),n.save(),n.strokeStyle=t,n.lineWidth=1,(d=this.options.indicator)!=null&&d.segments&&n.setLineDash(this.options.indicator.segments),i?(n.moveTo(s.x1,c[1]+.5),n.lineTo(s.x2,c[1]+.5)):(n.moveTo(c[0]+.5,s.y1),n.lineTo(c[0]+.5,s.y2)),n.stroke(),n.restore(),n.closePath(),{labelValue:r,position:c}},findSelectedItems(e){var i;(i=this.ensureHitCoordsFresh)==null||i.call(this);const t=[],n=Object.keys(this.seriesList);for(let s=0;s<n.length;s++){const l=n[s],a=this.seriesList[l],r=a.findItems;if(r){const c=r.call(a,e);c&&c.length&&t.push({seriesName:a.name,seriesId:l,items:c})}}return t},getSelectionRange({xsp:e,ysp:t,width:n,height:i,range:s}){var k,L,w,M;const l=this.axesSteps.x.length?this.axesSteps.x[0]:null,a=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!l||!a)return null;const r=e+n,c=t+i,d=l.graphMax-l.graphMin,h=a.graphMax-a.graphMin,u=this.getRatioInRange(s.x1,s.x2,e),f=this.getRatioInRange(s.x1,s.x2,r),m=this.getRatioInRange(s.y1,s.y2,c),g=this.getRatioInRange(s.y1,s.y2,t),p=this.isMobile&&((k=this.boxOverflow)!=null&&k.x1)?Math.min(this.minMax.x[0].min,l.graphMin):Math.max(l.graphMin+d*u,l.graphMin),y=this.isMobile&&((L=this.boxOverflow)!=null&&L.x2)?Math.max(this.minMax.x[0].max,l.graphMax):Math.min(l.graphMin+d*f,l.graphMax),C=this.isMobile&&((w=this.boxOverflow)!=null&&w.y2)?Math.min(this.minMax.y[0].min,a.graphMin):Math.max(a.graphMin+h*(1-m),a.graphMin),b=this.isMobile&&((M=this.boxOverflow)!=null&&M.y1)?Math.max(this.minMax.y[0].max,a.graphMax):Math.min(a.graphMin+h*(1-g),a.graphMax);return{xMin:+p.toFixed(3),xMax:+y.toFixed(3),yMin:+C.toFixed(3),yMax:+b.toFixed(3)}},getRatioInRange(e,t,n){const i=t-e;return(n-e)/i},getDragInfoForHeatMap(e){const t=Object.keys(this.seriesList)[0];return this.seriesList[t].findBlockRange(e)},getSelectionRangeForHeatMap(e){const t=this.axesSteps.x.length?this.axesSteps.x[0]:null,n=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!t||!n)return null;const i=Object.keys(this.seriesList)[0],{xMin:s,xMax:l,yMin:a,yMax:r}=this.seriesList[i].findSelectionRange(e)??{};return{xMin:s??t.graphMin,xMax:l??t.graphMax,yMin:a??n.graphMin,yMax:r??n.graphMax}},isDeselectItem(e){var t,n;return this.options.selectItem.useDeselectItem&&(e==null?void 0:e.dataIndex)===((t=this.defaultSelectItemInfo)==null?void 0:t.dataIndex)&&(e==null?void 0:e.sId)===((n=this.defaultSelectItemInfo)==null?void 0:n.seriesID)&&!isNaN(e==null?void 0:e.dataIndex)},getCurMouseLocation(e){const[t,n]=e,i={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},s=i[this.axesX[0].units.rectStart],l=i[this.axesX[0].units.rectEnd],a=i[this.axesY[0].units.rectStart],r=i[this.axesY[0].units.rectEnd];return It(t,this.chartRect.x1,i.x1)&&It(n,a,r)?"yAxis":It(t,s,l)&&It(n,i.y2,this.chartRect.y2)?"xAxis":It(t,i.x1,i.x2)&&It(n,i.y1,i.y2)?"chartBackground":"canvas"},isNotUseIndicator(){return this.options.type==="pie"||this.options.type==="scatter"||this.options.type==="heatMap"},clearSelectedLabelInfo(){this.defaultSelectInfo={dataIndex:[]}},clearSelectedItemInfo(){this.defaultSelectItemInfo=null}},v1=()=>{const e=document.documentElement,t=window.scrollX??0,n=window.scrollY??0;return{left:t,top:n,right:t+((e==null?void 0:e.clientWidth)||window.innerWidth||0),bottom:n+((e==null?void 0:e.clientHeight)||window.innerHeight||0)}},R1=e=>Math.floor(e/16)*16,Ic=e=>Number.isFinite(e)?Math.max(0,Math.min(1,e)):1,Tc=(e,t,n,i,s)=>{const l=(e==null?void 0:e.graphMax)-(e==null?void 0:e.graphMin);if(!t||!Number.isFinite(l)||l<=0)return null;const a=Ic((t.min-e.graphMin)/l),r=Ic((t.max-e.graphMin)/l),c=Math.min(a,r),d=Math.max(a,r);return s?[Math.floor(n-i*d),Math.ceil(n-i*c)]:[Math.floor(n+i*c),Math.ceil(n+i*d)]},ml=8,Ls=50,Ti=17,V1=8,Ms=15,E1={createTooltipDOM(){var e,t;this.tooltipDOM=document.createElement("div"),this.tooltipDOM.className="ev-chart-tooltip",this.tooltipHeaderDOM=document.createElement("div"),this.tooltipHeaderDOM.className="ev-chart-tooltip-header",this.tooltipBodyDOM=document.createElement("div"),this.tooltipBodyDOM.className="ev-chart-tooltip-body",this.tooltipCanvas=document.createElement("canvas"),this.tooltipCanvas.className="ev-chart-tooltip-canvas",this.tooltipCtx=this.tooltipCanvas.getContext("2d"),this.tooltipDOM.style.display="none",(t=(e=this.options.tooltip)==null?void 0:e.formatter)!=null&&t.html||this.setDefaultTooltipLayout(),document.body.appendChild(this.tooltipDOM),this.options.tooltip.debouncedHide?this.hideTooltipDOM=wc(()=>{this.tooltipDOM.style.display="none",this.resetTooltipPlacement()},200):this.hideTooltipDOM=()=>{this.tooltipDOM.style.display="none",this.resetTooltipPlacement()},this.isInitTooltip=!0},setDefaultTooltipLayout(){this.tooltipBodyDOM.appendChild(this.tooltipCanvas),this.tooltipDOM.appendChild(this.tooltipHeaderDOM),this.tooltipDOM.appendChild(this.tooltipBodyDOM)},createPlotLabelTooltipDOM(){this.plotLabelTooltipDOM=document.createElement("div"),this.plotLabelTooltipDOM.className="ev-chart-plot-label-tooltip",this.plotLabelTooltipDOM.style.position="fixed",this.plotLabelTooltipDOM.style.display="none",this.plotLabelTooltipDOM.style.pointerEvents="none",this.plotLabelTooltipDOM.style.zIndex="1000",this.plotLabelTooltipDOM.style.whiteSpace="nowrap",document.body.appendChild(this.plotLabelTooltipDOM)},showPlotLabelTooltip(e,t){this.plotLabelTooltipDOM||this.createPlotLabelTooltipDOM();const n=this.plotLabelTooltipDOM,i=e.style??{},s=i.padding??{top:4,right:8,bottom:4,left:8},l=i.backgroundColor??"#4C4C4C";n.textContent=e.text,n.style.backgroundColor=l,n.style.color=i.fontColor??"#FFFFFF",n.style.border=`1px solid ${i.borderColor??l}`,n.style.borderRadius=`${i.borderRadius??4}px`,n.style.fontSize=`${i.fontSize??12}px`,n.style.fontWeight=`${i.fontWeight??400}`,n.style.fontFamily=i.fontFamily??"Roboto",n.style.padding=`${s.top}px ${s.right}px ${s.bottom}px ${s.left}px`,n.style.boxShadow=i.useShadow?`2px 2px 4px rgba(0, 0, 0, ${i.shadowOpacity??.25})`:"none",n.style.left=`${t.clientX+10}px`,n.style.top=`${t.clientY+10}px`,n.style.display="block"},hidePlotLabelTooltip(){this.plotLabelTooltipDOM&&(this.plotLabelTooltipDOM.style.display="none")},getFontStyle(e){var s,l;const t=(s=this.options)==null?void 0:s.tooltip,n=((l=t==null?void 0:t.fontSize)==null?void 0:l[e])??14,i=(t==null?void 0:t.fontFamily)??"Roboto";return`normal normal lighter ${Math.max(n,0)}px ${i}`},getTextHeight(){var e,t,n;return(((n=(t=(e=this.options)==null?void 0:e.tooltip)==null?void 0:t.fontSize)==null?void 0:n.contents)??14)+6},getColorMargin(){var e,t,n;return(((n=(t=(e=this.options)==null?void 0:e.tooltip)==null?void 0:t.fontSize)==null?void 0:n.contents)??14)+2},getBoxPadding(){var s,l;const{top:e=0,right:t=20,bottom:n=3,left:i=16}=((l=(s=this.options)==null?void 0:s.tooltip)==null?void 0:l.rowPadding)??{};return{t:e,l:i,b:n,r:t}},setTooltipLayoutPosition(e,t){var E,Z,W,R,X,G,N,P;const n=this.tooltipCtx,i=t.pageX,s=t.pageY,l=e.items,[a,r]=e.maxTip,d=Object.keys(l).length,h=this.getBoxPadding(),u=this.options.tooltip,f=this.getColorMargin(),m=e.hitId,g=l[m].data,p=l[m].axis,y=(E=u.formatter)==null?void 0:E.title;this.axesX.length&&this.axesY.length&&u.showHeader&&(y?this.tooltipHeaderDOM.textContent=y({x:g.x,y:g.y}):this.tooltipHeaderDOM.textContent=this.options.horizontal?this.axesY[p.y].getLabelFormat(g.y):this.axesX[p.x].getLabelFormat(g.x)),u.textOverflow&&this.tooltipHeaderDOM.classList.add(`ev-chart-tooltip-header--${u.textOverflow}`),this.tooltipHeaderDOM.style.visibility="hidden",n.save(),n.font=this.getFontStyle("contents");const b=!!this.options.horizontal?(W=(Z=l[e.hitId])==null?void 0:Z.data)==null?void 0:W.y:(X=(R=l[e.hitId])==null?void 0:R.data)==null?void 0:X.x,k=(b==null?void 0:b.length)>a.length?b:a,L=Math.round(n.measureText(k).width),w=Math.round(n.measureText(r).width),M=L+w+h.l+h.r+f+Ls+Ti,V=M>u.maxWidth?u.maxWidth:M;let S=u.textOverflow==="wrap"?0:d;if(u.textOverflow==="wrap"){const B=u.maxWidth-(Math.round(n.measureText(r).width)+h.l+h.r+f+Ls+Ti);Object.values(l).map(D=>D.name).forEach(D=>{if(n.measureText(D).width>B){let Y="";for(let F=0;F<D.length;F++){const O=D[F],H=`${Y}${O}`;n.measureText(H).width>B?(Y=O,S+=1):Y=H}}S+=1}),n.restore()}const x=h.t+S*this.getTextHeight()+d*ml+h.b;let I;u.useScrollbar&&x>u.maxHeight?(this.tooltipBodyDOM.style.overflowY="auto",I=u.maxHeight):(this.tooltipBodyDOM.style.overflowY="hidden",I=x),this.tooltipCanvas.width=V*this.pixelRatio,this.tooltipCanvas.height=x*this.pixelRatio,this.tooltipCanvas.style.width=`${V}px`,this.tooltipCanvas.style.height=`${x}px`,this.tooltipHeaderDOM.style.width=`${V}px`,this.tooltipHeaderDOM.style.height="auto",this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${I+6}px`,this.tooltipDOM.style.maxWidth="",this.tooltipDOM.style.display="block";const T=((G=this.tooltipDOM)==null?void 0:G.offsetHeight)||((N=this.tooltipHeaderDOM)==null?void 0:N.offsetHeight)+I+V1,v=((P=this.tooltipDOM)==null?void 0:P.offsetWidth)||V;this.placeTooltipDOM(i,s,v,T)},drawSeriesColorShape(e,t,n){var a,r;const i=(r=(a=this.options.tooltip)==null?void 0:a.fontSize)==null?void 0:r.contents,{x:s,y:l}=n;if(t==="circle"){e.beginPath();const c=i/2;e.arc(s,l-c/2,c,0,2*Math.PI),e.fill()}else{const c=i;e.fillRect(s-c/3,l-c/1.2,c,c)}},drawTooltip(e,t){const n=t,i=e.items,[,s]=e.maxTip,l=this.alignSeriesList(Object.keys(i)),a=this.getBoxPadding(),r=this.options.horizontal,c=this.options.tooltip,d=this.getTextHeight(),h=this.getColorMargin();this.axesX.length&&this.axesY.length&&c.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let u=2,f=2;u+=A.aliasPixel(u),f+=A.aliasPixel(f),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=Ti),u+=a.l,f+=a.t,n.font=this.getFontStyle("contents");const m=[];l.forEach(y=>{m.push({id:y,data:i[y].data,color:i[y].color,name:i[y].name,dataId:i[y].id})}),c.sortByValue&&m.sort((y,C)=>{let b=y.data.o,k=C.data.o;return b==null&&(b=r?y.data.x:y.data.y),k==null&&(k=r?C.data.x:C.data.y),k-b}),this.setTooltipDOMStyle(c);const g=this.tooltipDOM.offsetWidth;let p=1;for(let y=0;y<m.length;y++){const C=m[y].data,b=m[y].color,k=m[y].name,L=C.formatted;let w=u+4,M=f+p*d;w+=A.aliasPixel(w),M+=A.aliasPixel(M),n.beginPath(),typeof b!="string"?n.fillStyle=te.createGradient(n,r,{x:w-4,y:M,w:12,h:-12},b):n.fillStyle=b;const V={id:m[y].id,name:m[y].name,value:L,dataId:m[y].dataId};this.drawSeriesColorShape(n,c.colorShape,{x:w,y:M}),n.fillStyle=typeof c.fontColor.label=="function"?c.fontColor.label(V):c.fontColor.label??c.fontColor;const S=c.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-h-Ls,x=w+h,I=M;if(S>n.measureText(k).width)n.fillText(k,x,I);else if(c.textOverflow==="wrap"){let T="",v=I;for(let E=0;E<k.length;E++){const Z=k[E],W=`${T}${Z}`;n.measureText(W).width>S?(n.fillText(T,x,v),T=Z,p+=1,v+=d):T=W}n.fillText(T,x,v)}else{const T=A.truncateLabelWithEllipsis(k,S,n);n.fillText(T,x,I)}n.save(),n.fillStyle=typeof c.fontColor.value=="function"?c.fontColor.value(V):c.fontColor.value??c.fontColor,n.textAlign="right",n.fillText(L,g-a.r,M),n.restore(),n.closePath(),f+=ml,p+=1}n.restore()},drawToolTipForHeatMap(e,t){const n=t,i=e.items,s=e.hitId,l=i[s].data,a=i[s].axis,r=i[s].color,c=this.getBoxPadding(),d=this.options.horizontal,h=this.options.tooltip,u=Object.values(this.seriesList)[0],f=this.getTextHeight(),m=this.getColorMargin();let g=!1,p=l.formatted;const{colorState:y,isGradient:C}=u;if(C){const{min:M,max:V}=u.valueOpt,S=$e(l.o-M,V-M),{start:x,end:I}=y[0];g=x<=S&&S<=I||l.o===-1}else{const M=y.find(({id:V})=>V===l.cId);g=M==null?void 0:M.show,p=(M==null?void 0:M.label)??p}if(!g){this.tooltipClear();return}this.axesX.length&&this.axesY.length&&h.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none",this.setTooltipDOMStyle(h);const b=this.tooltipDOM.offsetWidth;n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(c.r+=Ti);const k=c.l+2,L=c.t+f+2;n.font=this.getFontStyle("contents"),n.beginPath(),typeof r!="string"?n.fillStyle=te.createGradient(n,d,{x:k,y:L,w:12,h:-12},r):n.fillStyle=r;const w={id:e.hitId,name:l.y,value:p,dataId:i[s].id};this.drawSeriesColorShape(n,h.colorShape,{x:k,y:L}),n.fillStyle=typeof h.fontColor.label=="function"?h.fontColor.label(w):h.fontColor.label??h.fontColor,this.axesY.length&&n.fillText(this.axesY[a.y].getLabelFormat(l.y),k+m,L),n.textAlign="right",n.fillStyle=typeof h.fontColor.value=="function"?h.fontColor.value(w):h.fontColor.value??h.fontColor,n.fillText(p,b-c.r,L),n.closePath()},drawTooltipForScatter(e,t){const n=t,i=e.items,[,s]=e.maxTip,l=this.alignSeriesList(Object.keys(i)),a=this.getBoxPadding(),r=this.options.tooltip,c=this.getTextHeight(),d=this.getColorMargin();this.axesX.length&&this.axesY.length&&r.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let h=2,u=2;h+=A.aliasPixel(h),u+=A.aliasPixel(u),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=Ti),h+=a.l,u+=a.t,n.font=this.getFontStyle("contents");const f=[];l.forEach(p=>{f.push({data:i[p].data,color:i[p].color,name:i[p].name})}),r.sortByValue&&f.sort((p,y)=>{let C=p.data.o,b=y.data.o;return C==null&&(C=p.data.y),b==null&&(b=y.data.y),b-C}),this.setTooltipDOMStyle(r);const m=this.tooltipDOM.offsetWidth;let g=1;for(let p=0;p<f.length;p++){const y=f[p].data,C=f[p].color,b=f[p].name,k=y.formatted;let L=h+4,w=u+g*c;L+=A.aliasPixel(L),w+=A.aliasPixel(w),n.beginPath(),typeof C!="string"?n.fillStyle=te.createGradient(n,!1,{x:L-4,y:w,w:12,h:-12},C):n.fillStyle=C;const M={id:e.hitId,name:f[p].name,value:k,dataId:f[p].dataId};this.drawSeriesColorShape(n,r.colorShape,{x:L,y:w}),n.fillStyle=typeof r.fontColor.label=="function"?r.fontColor.label(M):r.fontColor.label??r.fontColor;const V=r.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-d-Ls,S=L+d,x=w;if(V>n.measureText(b).width)n.fillText(b,S,x);else if(r.textOverflow==="wrap"){let I="",T=x;for(let v=0;v<b.length;v++){const E=b[v],Z=`${I}${E}`;n.measureText(Z).width>V?(n.fillText(I,S,T),I=E,g+=1,T+=c):I=Z}n.fillText(I,S,T)}else{const I=A.truncateLabelWithEllipsis(b,V,n);n.fillText(I,S,x)}n.save(),n.textAlign="right",n.fillStyle=typeof r.fontColor.value=="function"?r.fontColor.value(M):r.fontColor.value??r.fontColor,n.fillText(k,m-a.r,w),n.restore(),n.closePath(),u+=ml,g+=1}n.restore()},setCustomTooltipLayoutPosition(e,t){var r;const n=t.pageX,i=t.pageY;if(!this.tooltipDOM)return;let s=this.tooltipDOM.firstElementChild;if(!s&&(e!=null&&e.items)&&Object.keys(e.items).length&&(this.drawCustomTooltip(e.items),s=this.tooltipDOM.firstElementChild),!s)return;this.tooltipDOM.style.maxWidth="",this.tooltipDOM.style.display="block";const l=s.offsetHeight;this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${l+6}px`;const a=(r=this.tooltipDOM)==null?void 0:r.getBoundingClientRect();this.placeTooltipDOM(n,i,a==null?void 0:a.width,a==null?void 0:a.height)},placeTooltipDOM(e,t,n,i){var L,w;(w=(L=this.hideTooltipDOM)==null?void 0:L.cancel)==null||w.call(L);const s=v1(),l=20,a=e+l,r=e-l,c=s.right-a,d=r-s.left,h=n<=c,u=n<=d;let f;!h&&!u?f=d>c:f=this._tooltipFlipX?u:!h,this._tooltipFlipX=f;const m=f?r:a,g=t+l,p=s.bottom-g,y=t-l-s.top,b=i>p&&y>p?Math.max(s.top,t-i-l):g,k=f?d:c;this.tooltipDOM.style.maxWidth=`${n<=k?k:R1(k)}px`,this.tooltipDOM.style.transform=f?`translate3d(${m}px, ${b}px, 0) translateX(-100%)`:`translate3d(${m}px, ${b}px, 0)`},resetTooltipPlacement(){this._tooltipFlipX=!1},drawCustomTooltip(e){var l,a,r,c,d;const t=(l=this.options)==null?void 0:l.tooltip;if(!((a=t==null?void 0:t.formatter)!=null&&a.html))return;this.tooltipDOM.style.maxWidth="";const n=Object.keys(e).length;if((r=this._shouldVirtualizeCustomTooltip)!=null&&r.call(this,n)&&this.drawCustomTooltipVirtual(e))return;(c=this._teardownCustomTooltipVirtualScroll)==null||c.call(this),this.tooltipDOM.innerHTML="";const i=[];Object.keys(e).forEach(h=>{i.push({sId:h,data:e[h].data,color:e[h].color,name:e[h].name,dataId:e[h].id,index:e[h].index})});const s=A.htmlToElement(t.formatter.html(i));s&&this.tooltipDOM.appendChild(s),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=t.backgroundColor,this.tooltipDOM.style.border=`1px solid ${t.borderColor}`,this.tooltipDOM.style.color=((d=t.fontColor)==null?void 0:d.title)??t.fontColor},setTooltipDOMStyle(e){var t;if(this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=e.backgroundColor,this.tooltipDOM.style.border=`1px solid ${e.borderColor}`,this.tooltipDOM.style.color=((t=e.fontColor)==null?void 0:t.title)??e.fontColor,this.tooltipHeaderDOM.style.fontSize=`${e.fontSize.title}px`,this.tooltipHeaderDOM.style.fontFamily=this.getFontStyle("title"),e.useShadow){const n=`rgba(0, 0, 0, ${e.shadowOpacity})`;this.tooltipDOM.style.boxShadow=`2px 2px 2px ${n}`}this.tooltipDOM.style.display="block"},drawItemsHighlight(e,t){Object.keys(e.items).forEach(n=>{var s;const i=this.seriesList[n];i.itemHighlight(e.items[n],t,e.items[n].index,(s=this.options)==null?void 0:s.unSelectedOpacity),A.isDoughnutHole(i.type)&&this.drawDoughnutHole(t)})},getIndicatorHitBounds(){var h,u,f,m,g,p;const e=this.options,t=this.chartRect.x1+this.labelOffset.left,n=this.chartRect.x2-this.labelOffset.right,i=this.chartRect.y1+this.labelOffset.top,s=this.chartRect.y2-this.labelOffset.bottom;let l=1/0,a=-1/0,r=1/0,c=-1/0,d=!1;if(e.horizontal){const y=((h=this.axesSteps)==null?void 0:h.y)||[];for(let C=0;C<y.length;C+=1){const b=Tc(y[C],(f=(u=this.axesRange)==null?void 0:u.y)==null?void 0:f[C],s,s-i,!0);b?(r=Math.min(r,b[0]),c=Math.max(c,b[1])):d=!0}(d||!Number.isFinite(r))&&(r=i,c=s)}else{const y=((m=this.axesSteps)==null?void 0:m.x)||[];for(let C=0;C<y.length;C+=1){const b=Tc(y[C],(p=(g=this.axesRange)==null?void 0:g.x)==null?void 0:p[C],t,n-t,!1);b?(l=Math.min(l,b[0]),a=Math.max(a,b[1])):d=!0}(d||!Number.isFinite(l))&&(l=t,a=n)}return{x1:t,x2:n,y1:i,y2:s,hitXMin:e.horizontal?t-Ms:l,hitXMax:e.horizontal?n+Ms:a,hitYMin:e.horizontal?r:i-Ms,hitYMax:e.horizontal?c:s+Ms}},drawIndicator(e,t){var r;const n=this.overlayCtx,[i,s]=e,l=this.options,a=this.getIndicatorHitBounds();i>=a.hitXMin&&i<=a.hitXMax&&s>=a.hitYMin&&s<=a.hitYMax&&(n.beginPath(),n.save(),n.strokeStyle=t,n.lineWidth=1,(r=l.indicator)!=null&&r.segments&&n.setLineDash(l.indicator.segments),l.horizontal?(n.moveTo(a.x1,s+.5),n.lineTo(a.x2,s+.5)):(n.moveTo(i+.5,a.y1),n.lineTo(i+.5,a.y2)),n.stroke(),n.restore(),n.closePath())},getTimeLabel(e){var u,f,m,g;const t=this.options;if(t.syncHover===!1||!t.horizontal&&!t.axesX.every(({type:p})=>p==="time")||t.horizontal&&!t.axesY.every(({type:p})=>p==="time"))return null;const n=+((u=this.data.labels)==null?void 0:u[0]),i=+((f=this.data.labels)==null?void 0:f[this.data.labels.length-1]);if(n==null||i==null)return null;const[s,l]=e,a={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(t.horizontal?(m=t.axesY)==null?void 0:m.every(p=>p.categoryMode):(g=t.axesX)==null?void 0:g.every(p=>p.categoryMode)){const p=this.data.labels.length;if(!p)return null;let y;if(t.horizontal){const b=a.y2-a.y1;y=(l-a.y1)/b}else{const b=a.x2-a.x1;y=(s-a.x1)/b}const C=Math.min(Math.max(Math.floor(y*p),0),p-1);return+this.data.labels[C]}if(t.horizontal){const p=a.y2-a.y1,C=(l-a.y1)*(i-n)/p+n;return Math.round(C)}const c=a.x2-a.x1,h=(s-a.x1)*(i-n)/c+n;return Math.round(h)},drawSyncedIndicator({horizontal:e,label:t,mousePosition:n,dataLabel:i}){var g,p;if(!this._canDrawSyncedIndicator(e,n))return;if(i){this.drawSyncedIndicatorForTooltip({dataLabel:i,mousePosition:n});return}const s=+((g=this.data.labels)==null?void 0:g[0]),l=+((p=this.data.labels)==null?void 0:p[this.data.labels.length-1]),[a,r]=n,{top:c,bottom:d,left:h,right:u}=this.getChartDOMClientRect();if(It(a,h,u)&&It(r,d,c))return;this.overlayClear();const m={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(e){const C=(m.y2-m.y1)*(t-s)/(l-s)+m.y1;this.drawIndicator([m.x2,C],this.options.indicator.color)}else{const C=(m.x2-m.x1)*(t-s)/(l-s)+m.x1;this.drawIndicator([C,m.y2],this.options.indicator.color)}},_canDrawSyncedIndicator(e,t){return!t||!!e!=!!this.options.horizontal?!1:this._isTimeBasedSyncEnabled(e)&&this._hasValidTimeRange()},_isTimeBasedSyncEnabled(e){var n,i;return this.options.syncHover===!1||!((i=(n=this.data)==null?void 0:n.labels)!=null&&i.length)?!1:e?this.options.axesY.every(({type:s})=>s==="time"):this.options.axesX.every(({type:s})=>s==="time")},_hasValidTimeRange(){var n,i;const e=+((n=this.data.labels)==null?void 0:n[0]),t=+((i=this.data.labels)==null?void 0:i[this.data.labels.length-1]);return e!=null&&t!=null},drawSyncedIndicatorForTooltip({dataLabel:e,mousePosition:t}){var u,f,m,g,p,y,C,b,k,L,w,M,V;if(!((u=this.data)!=null&&u.labels)||!e)return;const n=this.data.labels.findIndex(S=>(S==null?void 0:S.valueOf())===(e==null?void 0:e.valueOf()));if(n===-1){this.overlayClear();return}const{horizontal:i}=this.options,s=this.getChartDOMClientRect(),[l,a]=t;if(It(l,s.left,s.right)&&It(a,s.bottom,s.top))return;this.overlayClear();const c={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},d=this.data.labels.length;let h;if(i){const S=c.y2-c.y1,x=(f=this.options.axesY)==null?void 0:f.some(v=>v.categoryMode),I=(m=this.options.axesY)==null?void 0:m.some(v=>v.type==="time");let T;if(x)T=c.y1+S*(n+.5)/d;else if(I){const v=(p=(g=this.axesSteps)==null?void 0:g.y)==null?void 0:p[0],E=(v==null?void 0:v.graphMin)??+((y=this.data.labels)==null?void 0:y[0]),Z=(v==null?void 0:v.graphMax)??+((C=this.data.labels)==null?void 0:C[this.data.labels.length-1]);T=c.y1+S*(+e-E)/(Z-E)}else T=c.y1+S*n/(d-1);h=[c.x2,T]}else{const S=c.x2-c.x1,x=(b=this.options.axesX)==null?void 0:b.some(v=>v.categoryMode),I=(k=this.options.axesX)==null?void 0:k.some(v=>v.type==="time");let T;if(x)T=c.x1+S*(n+.5)/d;else if(I){const v=(w=(L=this.axesSteps)==null?void 0:L.x)==null?void 0:w[0],E=(v==null?void 0:v.graphMin)??+((M=this.data.labels)==null?void 0:M[0]),Z=(v==null?void 0:v.graphMax)??+((V=this.data.labels)==null?void 0:V[this.data.labels.length-1]);T=c.x1+S*(+e-E)/(Z-E)}else T=c.x1+S*n/(d-1);h=[T,c.y2]}this.drawIndicator(h,this.options.indicator.color)},tooltipClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.tooltipCtx.clearRect(0,0,this.tooltipCanvas.width/this.clearRectRatio,this.tooltipCanvas.height/this.clearRectRatio),this.tooltipDOM.style.display="none",this.resetTooltipPlacement()},alignSeriesList(e){const t=this.data.groups,n=this.seriesList,i=[];return t.forEach(s=>{s.slice().reverse().forEach(l=>{const a=n[l];a&&a.showLegend&&e.includes(l)&&i.push(l)})}),Object.keys(n).forEach(s=>{const l=n[s];!l.isExistGrp&&l.showLegend&&e.includes(s)&&i.push(s)}),i},tooltipDestroy(){var e;(e=this._teardownCustomTooltipVirtualScroll)==null||e.call(this),this.tooltipDOM&&(this.tooltipDOM.remove(),this.tooltipDOM=null),this.plotLabelTooltipDOM&&(this.plotLabelTooltipDOM.remove(),this.plotLabelTooltipDOM=null),this.isInitTooltip=!1}},W1=480,G1=28,Z1=5,X1=50,N1={_shouldVirtualizeCustomTooltip(e){var i,s;if(this._vsDetectFailed)return!1;const t=(i=this.options)==null?void 0:i.tooltip;if(!((s=t==null?void 0:t.formatter)!=null&&s.html))return!1;const n=t.virtualScroll;return!n||n.use===!1?!1:n.use===!0?e>0:e>=(n.threshold??X1)},_findCustomTooltipContainer(e,t){if(!e||!e.querySelectorAll)return null;const n=e.querySelectorAll("[data-evui-tooltip-row]");if(n.length===t&&n.length>0){const s=n[0].parentElement;let l=!!s;for(let a=1;a<n.length;a++)if(n[a].parentElement!==s){l=!1;break}if(l)return s}const i=[e];for(;i.length;){const s=i.shift();if(s.children&&s.children.length===t)return s;if(s.children)for(let l=0;l<s.children.length;l++)i.push(s.children[l])}return null},_createVirtualScrollAnatomy(){const e=document.createElement("div");e.className="ev-chart-tooltip-virtual__spacer",e.setAttribute("aria-hidden","true");const t=document.createElement("div");t.className="ev-chart-tooltip-virtual__viewport";const n=document.createElement("div");return n.className="ev-chart-tooltip-virtual__spacer",n.setAttribute("aria-hidden","true"),{topSpacer:e,viewport:t,bottomSpacer:n}},_recomputeCustomTooltipPrefixSums(){const e=this.vsState,t=e.heights.length;e.prefixSums.length!==t+1&&(e.prefixSums=new Array(t+1));let n=0;e.prefixSums[0]=0;for(let i=0;i<t;i++)n+=e.heights[i],e.prefixSums[i+1]=n;e.totalHeight=n},_computeCustomTooltipVisibleRange(){const e=this.vsState,t=e.heights.length;if(!t)return{start:0,end:-1};const n=e.scrollEl.clientHeight||e.maxHeight,i=e.scrollEl.scrollTop;let s=0,l=t;for(;s<l;){const d=s+l>>>1;e.prefixSums[d+1]>i?l=d:s=d+1}const a=Math.max(0,s-e.overscan),r=i+n;for(s=a,l=t;s<l;){const d=s+l>>>1;e.prefixSums[d]>=r?l=d:s=d+1}const c=Math.min(t-1,s+e.overscan);return{start:a,end:c}},_syncCustomTooltipSpacers(){const e=this.vsState,t=e.prefixSums[e.range.start]||0,n=Math.max(0,e.totalHeight-(e.prefixSums[e.range.end+1]||e.totalHeight)),i=`${t}px`,s=`${n}px`;e.topSpacer.style.height!==i&&(e.topSpacer.style.height=i),e.bottomSpacer.style.height!==s&&(e.bottomSpacer.style.height=s)},_renderVisibleCustomTooltipRows(){const e=this.vsState;if(!e||!e.items.length)return;const t=this._computeCustomTooltipVisibleRange();if(e.range.start===t.start&&e.range.end===t.end)e.range=t;else{for(;e.viewport.firstChild;)e.viewport.removeChild(e.viewport.firstChild);const s=document.createDocumentFragment();for(let l=t.start;l<=t.end;l++){const a=e.items[l];a&&s.appendChild(a)}e.viewport.appendChild(s),e.range=t}this._syncCustomTooltipSpacers();let i=!1;for(let s=t.start;s<=t.end;s++)if(!e.measured[s]){i=!0;break}if(i){const s=e.measureDepth||0;if(s<2){e.measureDepth=s+1;try{this._measureVisibleCustomTooltipRows()}finally{e.measureDepth=s}}}},_measureVisibleCustomTooltipRows(){const e=this.vsState;if(!e||!e.viewport)return;const t=e.viewport.children,n=t.length;if(!n)return;const i=e.range.start,s=e.prefixSums[i]||0;let l=!1,a=0,r=0;for(let c=0;c<n;c++){const d=e.range.start+c,h=t[c].offsetHeight;h>0&&(h!==e.heights[d]&&(e.heights[d]=h,l=!0),e.measured[d]=!0),e.isRow[d]&&h>0&&(a+=h,r+=1)}if(r>0){const c=a/r;if(e.learnedAverageHeight=c,c>0&&Math.abs(c-e.estimatedRowHeight)>.5){e.estimatedRowHeight=c;for(let d=0;d<e.heights.length;d++)e.isRow[d]&&!e.measured[d]&&e.heights[d]!==c&&(e.heights[d]=c,l=!0)}}if(l){this._recomputeCustomTooltipPrefixSums();const d=(e.prefixSums[i]||0)-s;d!==0&&(e.suppressScroll=!0,e.scrollEl.scrollTop+=d,requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.vsState&&(this.vsState.suppressScroll=!1)})})),this._renderVisibleCustomTooltipRows()}else this._syncCustomTooltipSpacers()},drawCustomTooltipVirtual(e){var b,k,L;const t=(b=this.options)==null?void 0:b.tooltip;if(!((k=t==null?void 0:t.formatter)!=null&&k.html))return!1;const n=[];Object.keys(e).forEach(w=>{n.push({sId:w,data:e[w].data,color:e[w].color,name:e[w].name,dataId:e[w].id,index:e[w].index})});let i;try{i=t.formatter.html(n)}catch(w){return console.warn("[evui] tooltip.formatter.html threw, falling back:",w),!1}const s=A.htmlToElement(i);if(!s||!s.children)return!1;const l=this._findCustomTooltipContainer(s,n.length);if(!l)return this._vsDetectFailed=!0,this._vsWarnedFallback||(this._vsWarnedFallback=!0,console.warn("[evui] tooltip.virtualScroll: formatter.html 반환 구조에서 row를 식별하지 못해 가상 스크롤을 건너뜁니다. 시리즈당 wrapper element에 `data-evui-tooltip-row` 속성을 추가하거나, row 컨테이너 직속 자식이 시리즈 수와 일치하도록 마크업을 정리하세요.")),!1;const a=Array.from(l.children);if(!a.length)return!1;const r=w=>!!(w.hasAttribute&&w.hasAttribute("data-evui-tooltip-row")),c=a.some(r),d=a.map(w=>c?r(w):!0);for(let w=0;w<a.length;w++){const M=a[w];M.parentNode&&M.parentNode.removeChild(M)}for(;l.firstChild;)l.removeChild(l.firstChild);const{topSpacer:h,viewport:u,bottomSpacer:f}=this._createVirtualScrollAnatomy();l.appendChild(h),l.appendChild(u),l.appendChild(f);const m=t.maxHeight||W1;l.style.maxHeight=`${m}px`,l.style.overflowY="auto",l.style.overflowX="hidden",l.style.overflowAnchor="none",this._teardownCustomTooltipVirtualScroll();const g=t.virtualScroll||{},p=this._vsLearnedAverageHeight,y=p??g.estimatedRowHeight??G1;this.vsState={scrollEl:l,topSpacer:h,viewport:u,bottomSpacer:f,items:a,isRow:d,heights:new Array(a.length).fill(y),measured:new Array(a.length).fill(!1),prefixSums:[],totalHeight:0,range:{start:0,end:-1},estimatedRowHeight:y,overscan:g.overscan??Z1,maxHeight:m,rafPending:!1,suppressScroll:!1,learnedAverageHeight:p,resizeObserver:null,onScroll:null},this._recomputeCustomTooltipPrefixSums();const C=()=>{this.vsState&&(this.vsState.suppressScroll||this.vsState.rafPending||(this.vsState.rafPending=!0,requestAnimationFrame(()=>{this.vsState&&(this.vsState.rafPending=!1,this._renderVisibleCustomTooltipRows())})))};if(l.addEventListener("scroll",C,{passive:!0}),this.vsState.onScroll=C,typeof ResizeObserver<"u"){let w=l.clientWidth;const M=new ResizeObserver(()=>{if(!this.vsState)return;const V=l.clientWidth;V!==w&&(w=V,this.vsState.measured.fill(!1),this.vsState.heights.fill(this.vsState.estimatedRowHeight),this._recomputeCustomTooltipPrefixSums(),this._renderVisibleCustomTooltipRows())});M.observe(l),this.vsState.resizeObserver=M}for(;this.tooltipDOM.firstChild;)this.tooltipDOM.removeChild(this.tooltipDOM.firstChild);return this.tooltipDOM.appendChild(s),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=t.backgroundColor,this.tooltipDOM.style.border=`1px solid ${t.borderColor}`,this.tooltipDOM.style.color=((L=t.fontColor)==null?void 0:L.title)??t.fontColor,this._renderVisibleCustomTooltipRows(),!0},_teardownCustomTooltipVirtualScroll(){const e=this.vsState;e&&(e.scrollEl&&e.onScroll&&e.scrollEl.removeEventListener("scroll",e.onScroll),e.resizeObserver&&e.resizeObserver.disconnect(),e.learnedAverageHeight&&(this._vsLearnedAverageHeight=e.learnedAverageHeight),this.vsState=null)}},P1={pieDataSet:[],drawPie(e,t=this.bufferCtx){var L;const n=this.chartRect,i=this.pieDataSet,s=this.options,l=this.options.padding,a=!!s.doughnutHoleSize;let r,c,d,h=1.5*Math.PI,u,f,m;const g=n.width/2,p=n.height/2,y=g-(l.left+l.right),C=p-(l.bottom+l.top);if(typeof y=="number"&&y<0||typeof C=="number"&&C<0)return;const b=Math.min(y,C)*s.doughnutHoleSize,k=Math.min(y,C);for(let w=0;w<i.length;w++){const M=i[w];if(!M)return;let V=k-(k-b)/i.length*w;if((L=s==null?void 0:s.pieStroke)!=null&&L.use&&(V-=s.pieStroke.lineWidth),V<0)return;if(M.or=V,w<i.length-1?M.ir=k-(k-b)/i.length*(w+1):M.ir=1,M.total){for(let S=0;S<M.data.length;S++)if(r=M.data[S],c=r.value,m=c/M.total*100,d=2*Math.PI*(c/M.total),u=h+d,r.sa=h,r.ea=u,f=this.seriesList[r.id],c){const x={...s.pieStroke};M.data.length===1&&s.pieStroke.use&&(x.use=!1,t.lineWidth=s.pieStroke.lineWidth,t.strokeStyle=s.pieStroke.color,t.arc(g,p,V,0,2*Math.PI),t.stroke());const{selectInfo:I,legendHitInfo:T,unSelectedOpacity:v}=e;f.isSelect=(I==null?void 0:I.sId)===r.id,f.isDownplay=T&&T.sId!==r.id,f.type=a?"doughnut":"pie",f.centerX=g,f.centerY=p,f.radius=V,f.doughnutHoleSize=V*(s.doughnutHoleSize??0),f.startAngle=h,f.endAngle=u,f.data={o:c,percentage:m},f.draw(t,x,v),h+=d}}}},drawSunburst(e,t=this.bufferCtx){var p;const{width:n,height:i}=this.chartRect,s=this.pieDataSet,l=this.options,a=this.options.padding;this.calculateAngle();let r,c;const d=n/2,h=i/2,u=d-(a.left+a.right),f=h-(a.bottom+a.top);if(typeof u=="number"&&u<0||typeof f=="number"&&f<0)return;const m=Math.min(u,f)*l.doughnutHoleSize,g=Math.min(u,f);for(let y=0;y<s.length;y++){const C=s[y];if(!C)return;let b=g-(g-m)/s.length*y;if((p=l==null?void 0:l.pieStroke)!=null&&p.use&&(b-=l.pieStroke.lineWidth),b<0)return;C.or=b,y<s.length-1?C.ir=g-(g-m)/s.length*(y+1):C.ir=1;for(let k=0;k<C.data.length;k++)if(r=C.data[k],r.id==="dummy")t.save(),t.globalCompositeOperation="destination-out",t.beginPath(),t.fillStyle="#fff",t.lineWidth=2,t.strokeStyle="#fff",t.moveTo(d,h),t.arc(d,h,b,r.sa,r.ea),t.stroke(),t.fill(),t.closePath(),t.restore();else if(c=this.seriesList[r.id],r.value){const L={...l.pieStroke};C.data.length===1&&l.pieStroke.use&&(L.use=!1,t.lineWidth=l.pieStroke.lineWidth,t.strokeStyle=l.pieStroke.color,t.arc(d,h,b,0,2*Math.PI),t.stroke());const{selectInfo:w,legendHitInfo:M,unSelectedOpacity:V}=e;c.isSelect=(w==null?void 0:w.sId)===r.id,c.isDownplay=M&&M.sId!==r.id,c.type="sunburst",c.centerX=d,c.centerY=h,c.radius=b,c.doughnutHoleSize=b*(l.doughnutHoleSize??0),c.startAngle=r.sa,c.endAngle=r.ea,c.data={o:r.value},c.draw(t,L,V)}}},drawDoughnutHole(e=this.bufferCtx){var h;const t=this.options,{width:n,height:i}=this.chartRect,s=this.options.padding,l=n/2,a=i/2,r=l-(s.left+s.right),c=a-(s.bottom+s.top);if(typeof r=="number"&&r<0||typeof c=="number"&&c<0)return;const d=Math.min(r,c)*t.doughnutHoleSize;e.save(),e.globalCompositeOperation="destination-out",e.beginPath(),e.fillStyle="#fff",e.fillOpacity=0,e.arc(l,a,d,0,2*Math.PI),e.fill(),e.strokeStyle="#fff",e.stroke(),e.closePath(),e.restore(),(h=t==null?void 0:t.pieStroke)!=null&&h.use&&(e.beginPath(),e.strokeStyle=t.pieStroke.color,e.lineWidth=t.pieStroke.lineWidth,e.arc(l,a,d,0,Math.PI*2),e.stroke(),e.closePath()),this.pieDataSet[this.pieDataSet.length-1].ir=d}},D1={drawTips(e,t=this.bufferCtx){var u,f,m,g,p,y,C,b;const n=this.options;let i=null;const s=!!n.horizontal,l=n.maxTip,a=n.selectItem,r=n.selectLabel;let c,d;typeof((u=n.tooltip)==null?void 0:u.formatter)=="function"?i=(f=n.tooltip)==null?void 0:f.formatter:typeof((g=(m=n.tooltip)==null?void 0:m.formatter)==null?void 0:g.value)=="function"&&(i=(y=(p=n.tooltip)==null?void 0:p.formatter)==null?void 0:y.value),r.use&&r.showTip&&(d=n.type==="heatMap"?this.drawLabelTipForHeatMap(t):this.drawTipForSelectedLabel(t));const h=k=>{e.forEach(L=>{if(L){const w=this.seriesList[L==null?void 0:L.sId];if(!(w!=null&&w.show))return;const M=this.calculateTipInfo(w,"sel",L);if(M&&M.dp!==null){let V=!1;if(l.use&&(c==null?void 0:c.dp)===M.dp&&(V=!0),k.showTextTip||k.showTip){if(k.tipText==="label"){const S=s?n.axesY[0]:n.axesX[0],x=M.label;M.text=S.type==="time"?We(x).format(S.timeFormat):x}else M.text=nn(M.value);this.drawTextTip({opt:k,tipType:"sel",seriesOpt:w,isSamePos:V,ctx:t,...M})}k.showIndicator&&this.drawFixedIndicator({opt:k,seriesOpt:w,ctx:t,...M})}L&&(L!=null&&L.label)&&(L==null?void 0:L.label)===0&&(this.lastHitInfo=L)}})};if(e&&!d&&(a.use?h(a):r.use&&n.type==="line"&&h(r)),l.use&&!d){const k=s?this.axesSteps.y[0]:this.axesSteps.x[0],L=k==null?void 0:k.minIndex,w=k==null?void 0:k.maxIndex,M=(b=(C=s?this.axesY[0]:this.axesX[0])==null?void 0:C.labels)==null?void 0:b.length,V=Number.isFinite(M)?M-1:w,S=Number.isFinite(L)&&Number.isFinite(w),x=S&&w<L,I=S&&(L>0||w<V);let T,v=null;x?T=void 0:I?(v=this.getVisibleWindowMaxSeries(L,w),T=v==null?void 0:v.sId):T=this.minMax[s?"x":"y"][0].maxSID;const E=T?this.seriesList[T]:null;E&&(c=this.calculateTipInfo(E,"max",v),l.use&&c&&c.dp!==null&&(i?c.text=i({seriesId:E.sId,x:s?c.value:void 0,y:s?void 0:c.value}):c.text=nn(c.value),this.drawTextTip({opt:l,tipType:"max",seriesOpt:E,ctx:t,...c}),l.showIndicator&&this.drawFixedIndicator({opt:l,seriesOpt:E,ctx:t,...c})))}},calculateTipInfo(e,t,n){if(!e)return!1;const i=!!this.options.horizontal,s=this.lastTip,l=this.chartRect,a=this.labelOffset,r={x1:l.x1+a.left,x2:l.x2-a.right,y1:l.y1+a.top,y2:l.y2-a.bottom},c=l.chartHeight-(a.top+a.bottom),d=l.chartWidth-(a.left+a.right),h=this.axesSteps.x[e.xAxisIndex],u=this.axesSteps.y[e.yAxisIndex],f=r.x1,m=r.x2,g=r.y2,{type:p,size:y}=e,{maxDomain:C,maxDomainIndex:b}=e.minMax;if(C===null||b<0)return!1;const k=p==="bar"?n==null?void 0:n.index:n==null?void 0:n.domain,L=t==="max"&&n&&Number.isFinite(k)&&Number.isFinite(n.value);let w;L?w=k:w=p==="bar"?b:C,t==="sel"&&(n&&n.label!==null?(s.pos=p==="bar"?n.dataIndex:n.label,w=s.pos):s.pos!==null&&(w=s.pos));let M;L?M=n.value:M=i?e.minMax.maxX:e.minMax.maxY;let V;if(t==="sel"){if(n&&n.label!==null)V=n.label,n.value!==null?(M=n.useStack?n.acc:n.value,s.value=M):s.value!==null&&(M=s.value),s.label=V;else if(s.value!==null)M=s.value,V=s.label;else if(s.pos!==null){const Z=p==="bar"?"getItemByLabelIndex":"getItemByLabel";if(typeof this[Z]=="function"){const W=this[Z](s.pos);M=W.useStack?W.acc:W.value,V=W.label,s.value=M,s.label=V}}}const S=i?h.graphMax:u.graphMax;if((t==="max"||t==="sel")&&M>S&&!this.options.displayOverflow)return!1;let x,I,T;if(p==="bar"){const Z=i?this.scrollbar.y:this.scrollbar.x;if(Z!=null&&Z.use){const[W,R]=(Z==null?void 0:Z.range)??[];if(w>=W&&w<=R)w-=W??0;else return!1}else{const W=i?u:h,{minIndex:R,maxIndex:X}=W??{};if(Number.isFinite(R)&&Number.isFinite(X))if(w>=R&&w<=X)w-=R;else return!1}i?(I=Math.round(y.h/2),x=g-y.cat*w-y.cPad,T=x-(y.bar*y.ix-(y.h+y.bPad))-I):(I=Math.round(y.w/2),x=f+y.cat*w+y.cPad,T=x+(y.bar*y.ix-(y.w+y.bPad))+I)}else p==="line"?T=te.calculateX(w,h.graphMin,h.graphMax,d-y.comboOffset,f+y.comboOffset/2):p==="scatter"&&(T=te.calculateX(w,h.graphMin,h.graphMax,d,f));return{...{xArea:d,yArea:c,graphX:h,graphY:u,xsp:f,xep:m,ysp:g},...{dp:T,value:M,label:V,type:p}}},drawFixedIndicator(e){const t=!!this.options.horizontal,n=e.ctx??this.bufferCtx,{graphX:i,graphY:s,xArea:l,yArea:a,xsp:r,ysp:c,dp:d,type:h,value:u,opt:f,seriesOpt:m}=e;let g=0;h==="line"?g+=3:h==="scatter"&&(g+=(m==null?void 0:m.pointSize)??0);let p;if(f.fixedPosTop)t?p=te.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r):(p=te.calculateY(s.graphMax,s.graphMin,s.graphMax,a,c),p-=g);else if(t){const y=Math.min(Math.max(u,i.graphMin),i.graphMax);p=te.calculateX(y,i.graphMin,i.graphMax,l,r)}else{const y=Math.min(Math.max(u,s.graphMin),s.graphMax);p=te.calculateY(y,s.graphMin,s.graphMax,a,c),p-=g}d!==null&&(n.beginPath(),n.save(),n.strokeStyle=f.indicatorColor,n.lineWidth=2,t?(n.moveTo(r,d),n.lineTo(p,d)):(n.moveTo(d,c),n.lineTo(d,p)),n.stroke(),n.restore(),n.closePath())},drawTipForSelectedLabel(e=this.bufferCtx){var c,d;const t=this.options,n=!!t.horizontal,i=t.selectLabel,{dataIndex:s,data:l,label:a}=this.defaultSelectInfo;let r=!1;if(s.length){r=!0;const h=this.chartRect,u=this.labelOffset,f={x1:h.x1+u.left,x2:h.x2-u.right,y1:h.y1+u.top,y2:h.y2-u.bottom},m=n?this.axesY[0]:this.axesX[0],g=n?this.axesX[0]:this.axesY[0],p=n?this.axesSteps.x[0]:this.axesSteps.y[0],y=n?te.calculateX:te.calculateY,C=n?te.calculateY:te.calculateX,b=n?this.scrollbar.y:this.scrollbar.x,k=h.chartWidth-(u.left+u.right),L=h.chartHeight-(u.top+u.bottom),w=n?k:L,M=f[g.units.rectStart];let V=this.options.type==="bar"?4:6;V*=n?1:-1;const S=Object.keys(this.seriesList??{}),x=S.filter(D=>this.seriesList[D].show),I=S.some(D=>this.seriesList[D].isExistGrp&&!this.seriesList[D].isOverlapping),T=((c=this.data.groups)==null?void 0:c[0])??[];let v,E,Z,W,R,X,G,N,P,B=0,z=(d=m.labels)==null?void 0:d.length;if(m.labels){let D=m.labels.length;if(b!=null&&b.use){const{range:Y,interval:F,type:O}=b,[H,j]=Y??[];if(Re(H)&&Re(j))D=Math.floor((+j-+H)/F)+1,B=O==="step"?H:m.labels.findIndex(U=>U===+H),z=O==="step"?j:m.labels.findIndex(U=>U===+j);else{const U=n?this.axesSteps.y[0]:this.axesSteps.x[0];Number.isFinite(U==null?void 0:U.minIndex)&&Number.isFinite(U==null?void 0:U.maxIndex)&&U.minIndex<U.maxIndex&&(B=U.minIndex,z=U.maxIndex,D=z-B+1)}}W=f[m.units.rectStart],R=f[m.units.rectEnd],X=(R-W)/D}else G=this.axesSteps.x[0],N=S.find(D=>{var Y;return((Y=this.seriesList[D])==null?void 0:Y.type)==="line"}),P=this.seriesList[N].size;l.forEach((D,Y)=>{var F;if(Z=p.graphMax,!i.fixedPosTop){if(I){const O=x==null?void 0:x.reduce((U,Q)=>{var J,ne;return T.includes(Q)&&(((J=D[Q])==null?void 0:J.value)??D[Q])>0?U+(((ne=D[Q])==null?void 0:ne.value)??D[Q]):U},0),H=((F=x==null?void 0:x.filter(U=>!T.includes(U)))==null?void 0:F.map(U=>{var Q;return((Q=D[U])==null?void 0:Q.value)??D[U]}))??[],j=(H==null?void 0:H.length)>0?H.reduce((U,Q)=>Math.max(U,Q??-1/0),-1/0):-1/0;Z=O>0?Math.max(j,O):Math.max(j,0)}else if(x.length){const O=x.map(j=>{var U;return((U=D[j])==null?void 0:U.value)??D[j]}),H=O.length>0?O.reduce((j,U)=>Math.max(j,U??-1/0),-1/0):-1/0;Z=H>0||this.options.type!=="bar"?H:0}}if(m.labels){if(s[Y]<B||s[Y]>z)return;const O=s[Y]-B;v=Math.round(W+X*O)+X/2}else v=C(a[Y],G.graphMin,G.graphMax,k-P.comboOffset,f.x1+P.comboOffset/2);E=y(Z,p.graphMin,p.graphMax,w,M)+V,this.showTip({context:e,x:n?E:v,y:n?v:E,opt:i,isSamePos:!1})})}return r},drawLabelTipForHeatMap(e=this.bufferCtx){const t=this.options,n=!!t.horizontal,i=t.selectLabel,{dataIndex:s}=this.defaultSelectInfo;let l=!1;if(s){l=!0;const a=this.chartRect,r=this.labelOffset,c={x1:a.x1+r.left,x2:a.x2-r.right,y1:a.y1+r.top,y2:a.y2-r.bottom},d=n?this.axesY[0]:this.axesX[0],h=c[d.units.rectStart],f=(c[d.units.rectEnd]-h)/d.labels.length,m=n?this.axesX[0]:this.axesY[0],g=6*(n?1:-1),p=c[m.units.rectEnd]+g;s==null||s.forEach(y=>{const b=Math.round(h+f*y)+f/2;this.showTip({context:e,x:n?p:b,y:n?b:p,opt:i,isSamePos:!1})})}return l},drawTextTip(e){const t=!!this.options.horizontal,n=e.ctx??this.bufferCtx,{graphX:i,graphY:s,xArea:l,yArea:a,xsp:r,xep:c,ysp:d}=e,{dp:h,value:u,text:f,opt:m,type:g,tipType:p,isSamePos:y,seriesOpt:C}=e,b=4,k=4,{fontSize:L,fontFamily:w,fontWeight:M,height:V}=m.tipStyle,S=`normal normal ${M} ${L}px ${w}`;let x=1;g==="line"?x+=6:g==="scatter"?x+=C==null?void 0:C.pointSize:g==="bar"&&(x+=4);let I,T=h;if(m.fixedPosTop)t?(I=te.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r),I+=x):(I=te.calculateY(s.graphMax,s.graphMin,s.graphMax,a,d),I-=x);else if(t){const Z=Math.min(Math.max(u,i.graphMin),i.graphMax);I=te.calculateX(Z,i.graphMin,i.graphMax,l,r),I=u<0?I-x:I+x}else{const Z=g==="bar"&&u<0?0:u,W=Math.min(Math.max(Z,s.graphMin),s.graphMax);I=te.calculateY(W,s.graphMin,s.graphMax,a,d),I=Z<0?I+x:I-x}let v="center";n.save(),n.font=S;const E=Math.round(Math.max(n.measureText(f).width+12,40));t||(h+E/2>c-10?(v="right",T-=E/2-b*2):h-E/2<r+10&&(v="left",T+=E/2-b*2)),n.restore(),(m.showTextTip||p==="max")&&this.showTextTip({context:n,type:v,width:E,height:V,x:t?I+E/2:T,y:t?T+V/2:I,opt:m,arrowSize:b,borderRadius:k,text:f,textStyle:S,isNegative:u<0}),m.showTip&&p==="sel"&&this.showTip({context:n,x:t?I:h,y:t?h:I,opt:m,isSamePos:y})},showTextTip(e){const t=!!this.options.horizontal,{type:n,width:i,height:s,x:l,y:a,arrowSize:r,borderRadius:c,text:d,opt:h,textStyle:u,isNegative:f}=e,m=e.context;let g=l-i/2,p=l+i/2;const y=a-s,C=a;f&&t&&(g=l-i/2-i,p=l-i/2),m.save(),m.font=u,m.fillStyle=h.tipBackground??h.tipStyle.background,m.shadowBlur=0,m.beginPath(),m.moveTo(g+c,y),m.quadraticCurveTo(g,y,g,y+c),m.lineTo(g,C-c),m.quadraticCurveTo(g,C,g+c,C),m.lineTo(p-c,C),m.quadraticCurveTo(p,C,p,C-c),m.lineTo(p,y+c),m.quadraticCurveTo(p,y,p-c,y),m.lineTo(g+c,y),m.closePath(),m.fill(),m.beginPath(),t?(f?(m.moveTo(p,C),m.lineTo(p,y+c+r/2),m.lineTo(p+r,C-s/2),m.lineTo(p,C-c-r/2)):(m.moveTo(g,y),m.lineTo(g,y+c+r/2),m.lineTo(g-r,C-s/2),m.lineTo(g,C-c-r/2)),m.closePath(),m.fill()):(f?n==="left"?(m.lineTo(g+c+r,C+r),m.lineTo(g+c+r*2,C)):n==="right"?(m.lineTo(p-r*2-c,C),m.lineTo(p-r-c,C+r)):(m.lineTo(l-r,C),m.lineTo(l,C+r),m.lineTo(l+r,C)):f||(n==="left"?(m.moveTo(g,y),m.lineTo(g+c+r,C+r),m.lineTo(g+c+r*2,C)):n==="right"?(m.moveTo(p,y),m.lineTo(p-r*2-c,C),m.lineTo(p-r-c,C+r)):(m.lineTo(l-r,C),m.lineTo(l,C+r),m.lineTo(l+r,C))),m.closePath(),m.fill()),m.restore(),m.save(),m.font=u,m.fillStyle=h.tipTextColor??h.tipStyle.textColor,m.textBaseline="middle",m.textAlign="center",m.fillText(`${d}`,g+i/2,y+s/2),m.restore()},showTip(e){const t=!!this.options.horizontal,{x:n,y:i,opt:s,isSamePos:l}=e,a=e.context,c=i-(l?24:0);a.save(),a.fillStyle=s.tipBackground??s.tipStyle.background,a.beginPath(),a.moveTo(n,c),t?(a.lineTo(n+6,c-6),a.lineTo(n+6,c+6)):(a.lineTo(n+6,c-6),a.lineTo(n-6,c-6)),a.lineTo(n,c),a.closePath(),a.fill(),a.restore()}},B1={initBlitState(){var e;this._blitPrev=null,this._blitDiag=null,this.pointsLayers=new Map,this.pointsLayerValid=!1,this._blitCarry=0,this._framesSinceFullRedraw=0,this._pointsLayerStamp=null,this._pointsLayerOptionsRef=null,this._hitCoordsDirty=!1,(e=this.options.realTimeScatter)!=null&&e.use&&this.createPointsLayers()},createPointsLayers(){var l,a,r,c;const e=((a=(l=this.seriesInfo)==null?void 0:l.charts)==null?void 0:a.scatter)??[];if(this.pointsLayers.size===e.length&&e.every(d=>this.pointsLayers.has(d))&&this.pointsLayers.size)return;const n=((r=this.bufferCanvas)==null?void 0:r.width)??0,i=((c=this.bufferCanvas)==null?void 0:c.height)??0,s=new Map;for(let d=0;d<e.length;d++){const h=document.createElement("canvas"),u=document.createElement("canvas");n>1&&i>1&&(h.width=n,h.height=i,u.width=n,u.height=i),s.set(e[d],{a:h,b:u,actx:h.getContext("2d"),bctx:u.getContext("2d"),cur:"A"})}this.pointsLayers=s,this.pointsLayerValid=!1},getSeriesLayer(e){const t=this.pointsLayers.get(e);if(!t)return null;const n=t.cur==="A";return{src:n?t.a:t.b,srcCtx:n?t.actx:t.bctx,dst:n?t.b:t.a,dstCtx:n?t.bctx:t.actx,dstName:n?"B":"A",layer:t}},resizePointsLayers(e,t){let n=!1;return this.pointsLayers.forEach(i=>{(i.a.width!==e||i.a.height!==t)&&(i.a.width=e,i.a.height=t,i.b.width=e,i.b.height=t,n=!0)}),n},pointsLayersSized(){if(!this.pointsLayers.size||!this.bufferCanvas)return!1;const e=this.bufferCanvas.width,t=this.bufferCanvas.height;if(!(e>1)||!(t>1))return!1;let n=!0;return this.pointsLayers.forEach(i=>{(i.a.width!==e||i.a.height!==t)&&(n=!1)}),n},getBlitScatterSeriesList(){var n,i;const e=((i=(n=this.seriesInfo)==null?void 0:n.charts)==null?void 0:i.scatter)??[],t=[];for(let s=0;s<e.length;s++){const l=this.seriesList[e[s]];l!=null&&l.show&&t.push({sId:e[s],series:l,xi:l.xAxisIndex??0,yi:l.yAxisIndex??0})}return t},getBlitScatterSeries(){return this.getBlitScatterSeriesList()[0]??null},areBlitSeriesAligned(e){var n,i,s,l;if(!e||e.length<1)return!1;const t=(i=(n=this.dataSet)==null?void 0:n[e[0].sId])==null?void 0:i.lastTick;if(!t)return!1;for(let a=1;a<e.length;a++){const r=(l=(s=this.dataSet)==null?void 0:s[e[a].sId])==null?void 0:l.lastTick;if(!r||r.gapCount!==t.gapCount||r.toTime!==t.toTime||r.endIndex!==t.endIndex||r.length!==t.length)return!1}return!0},blitShiftDenominator(){const e=this.pixelRatio;if(!(e>0))return null;if(Number.isInteger(e))return 1;const t=4;for(let n=2;n<=t;n++)if(Math.abs(e*n-Math.round(e*n))<1e-6)return n;return null},evaluateBlitGate(e){var p,y,C,b,k,L,w,M,V,S,x,I,T,v,E;const t=this.options,n=this._blitPrev,i=this.isInit===!0&&((p=t.realTimeScatter)==null?void 0:p.use)===!0&&!t.brush&&this.updateSeries!==!0&&!e&&!((C=(y=this.scrollbar)==null?void 0:y.x)!=null&&C.use||(k=(b=this.scrollbar)==null?void 0:b.y)!=null&&k.use),s=this.getBlitScatterSeriesList(),l=this.areBlitSeriesAligned(s),a=!((L=t.selectItem)!=null&&L.use&&(((w=this.defaultSelectItemInfo)==null?void 0:w.dataIndex)!=null||((M=this.lastHitInfo)==null?void 0:M.dataIndex)!=null))&&!((V=t.selectSeries)!=null&&V.use&&this.defaultSelectInfo)&&!this.legendHover,r={modeOk:i,seriesAligned:l,selectionOk:a,scatterOnly:this.hasOnlyVisibleScatter(),deviceRatioBlittable:this.blitShiftDenominator()!==null,hasPrev:!!n,optionsStable:!!n&&n.optionsRef===this.options,yFixed:!1,xWidthStable:!1,xAreaStable:!1,labelOffsetStable:!1,xMonotonic:!1,deviceStable:!1,gapOk:!1};let c=0,d=0,h=0;const u=s[0]??null,f=u?(x=(S=this.axesSteps)==null?void 0:S.x)==null?void 0:x[u.xi]:null,m=u?(T=(I=this.axesSteps)==null?void 0:I.y)==null?void 0:T[u.yi]:null;if(u&&f&&m&&this.chartRect&&this.labelOffset){const Z=this.chartRect,W=Z.chartWidth-(this.labelOffset.left+this.labelOffset.right);n&&(r.yFixed=m.graphMin===n.graphMinY&&m.graphMax===n.graphMaxY,r.xWidthStable=f.graphMax-f.graphMin===n.graphMaxX-n.graphMinX,r.xAreaStable=W===n.xArea,r.labelOffsetStable=this.labelOffset.left===n.labelOffsetLeft&&this.labelOffset.right===n.labelOffsetRight,c=f.graphMin-n.graphMinX,r.xMonotonic=Number.isFinite(c)&&c>0,r.deviceStable=this.pixelRatio===n.pixelRatio&&Z.chartWidth===n.chartWidth&&Z.chartHeight===n.chartHeight&&Z.x1===n.x1&&Z.y2===n.y2);const R=(E=(v=this.dataSet)==null?void 0:v[u.sId])==null?void 0:E.lastTick;R&&(d=R.gapCount??0,h=R.length??0,r.gapOk=d>0&&d<h)}return{ok:r.modeOk&&r.seriesAligned&&r.selectionOk&&r.scatterOnly&&r.deviceRatioBlittable&&r.hasPrev&&r.optionsStable&&r.yFixed&&r.xWidthStable&&r.xAreaStable&&r.labelOffsetStable&&r.xMonotonic&&r.deviceStable&&r.gapOk,parts:r,shiftMs:c,gapCount:d,length:h,scatterList:s}},hasOnlyVisibleScatter(){var n,i;const e=((n=this.seriesInfo)==null?void 0:n.charts)??{},t=Object.keys(e);for(let s=0;s<t.length;s++){if(t[s]==="scatter")continue;const l=e[t[s]];for(let a=0;a<l.length;a++)if((i=this.seriesList[l[a]])!=null&&i.show)return!1}return!0},snapshotBlitState(){var s,l,a,r,c;if(!((s=this.options.realTimeScatter)!=null&&s.use))return null;const e=this.getBlitScatterSeries();if(!e)return null;const t=(a=(l=this.axesSteps)==null?void 0:l.x)==null?void 0:a[e.xi],n=(c=(r=this.axesSteps)==null?void 0:r.y)==null?void 0:c[e.yi];if(!t||!n||!this.chartRect||!this.labelOffset)return null;const i=this.chartRect;return{sId:e.sId,graphMinX:t.graphMin,graphMaxX:t.graphMax,graphMinY:n.graphMin,graphMaxY:n.graphMax,xArea:i.chartWidth-(this.labelOffset.left+this.labelOffset.right),labelOffsetLeft:this.labelOffset.left,labelOffsetRight:this.labelOffset.right,pixelRatio:this.pixelRatio,chartWidth:i.chartWidth,chartHeight:i.chartHeight,x1:i.x1,y2:i.y2,optionsRef:this.options}},recordBlitDiag(e,t,n){var s;if(typeof window>"u"||!window.__EVUI_BLIT_DEBUG__)return;(s=this.options.realTimeScatter)!=null&&s.use&&(window.__EVUI_BLIT_CHART__=this),this._blitDiag||(this._blitDiag={ticks:0,eligible:0,blitted:0,fail:{},rate:0,lastShiftMs:0,lastGap:0});const i=this._blitDiag;if(i.ticks++,i.lastShiftMs=e.shiftMs,i.lastGap=e.gapCount,e.ok)i.eligible++;else{const l=Object.keys(e.parts);for(let a=0;a<l.length;a++)e.parts[l[a]]||(i.fail[l[a]]=(i.fail[l[a]]||0)+1)}if(e.ok&&!t&&n){const l=Object.keys(n);for(let a=0;a<l.length;a++)n[l[a]]&&(i.fail[l[a]]=(i.fail[l[a]]||0)+1)}t&&i.blitted++,i.rate=i.blitted/i.ticks,window.__EVUI_BLIT_DIAG__=i},collectStripDuplicatePoints(e,t){var s,l,a;const n=((l=(s=this.seriesInfo)==null?void 0:s.charts)==null?void 0:l.scatter)??[],i=!!this.options.seriesReverse;for(let r=i?n.length-1:0;i?r>=0:r<n.length;i?r--:r++){const c=this.seriesList[n[r]];if(!(c!=null&&c.show))continue;const d=(a=c.data[c.sId])==null?void 0:a.dataGroup;if(d)for(let h=0;h<t.length;h++){const u=d[t[h]];if(u!=null&&u.data)for(let f=0;f<u.data.length;f++){const m=u.data[f];e.set(m.k??A.coordinateKey(m.x,m.y),c.sId)}}}},drawChartBlitFastPath(e,t){var v,E,Z,W;const n=t.scatterList??this.getBlitScatterSeriesList(),i=n[0]??null,s=(E=(v=this.dataSet)==null?void 0:v[i==null?void 0:i.sId])==null?void 0:E.lastTick;if(!i||!s)return!1;const l=this.pixelRatio,a=this.chartRect,r=this.labelOffset,c=this.axesSteps.x[i.xi],d=a.chartWidth-(r.left+r.right),h=c.graphMax-c.graphMin;if(!(h>0)||!(d>0))return!1;const u=this.blitShiftDenominator()??1,f=d/h*t.shiftMs,m=this._blitCarry+f,g=Math.round(m/u)*u;if(g<1)return!1;const p=Math.round(g*l);let y=s.maxDirtyAge,C=typeof i.series.pointSize=="number"?i.series.pointSize:i.series.pointSize.value;for(let R=1;R<n.length;R++){const X=(W=(Z=this.dataSet)==null?void 0:Z[n[R].sId])==null?void 0:W.lastTick;X&&X.maxDirtyAge>y&&(y=X.maxDirtyAge);const G=n[R].series.pointSize,N=typeof G=="number"?G:G.value;N>C&&(C=N)}if(y>s.gapCount+1)return!1;const b=this.bufferCanvas.width,k=this.bufferCanvas.height;if(p>=b)return!1;this._blitCarry=m-g;const{gapCount:L,endIndex:w,length:M}=s,V=Math.min(M,Math.max(L+1,y+1)),S=new Array(V);for(let R=0;R<V;R++){let X=(w-R)%M;X<0&&(X+=M),S[R]=X}const x=this.options.coordinateDedupe!==!1&&n.length>1,I=x?new Map:null;x&&this.collectStripDuplicatePoints(I,S);const T={chartRect:a,labelOffset:r,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity,duple:I,coordinateDedupe:x,rtXOffsetCss:this._blitCarry};for(let R=0;R<n.length;R++){const X=n[R],G=this.getSeriesLayer(X.sId);if(!G)return!1;G.dstCtx.setTransform(1,0,0,1,0,0),G.dstCtx.clearRect(0,0,b,k),G.dstCtx.drawImage(G.src,p,0,b-p,k,0,0,b-p,k),G.dstCtx.setTransform(l,0,0,l,0,0),X.series.realTimeScatterDrawStrip(G.dstCtx,S,T),G.dstCtx.setTransform(1,0,0,1,0,0),G.layer.cur=G.dstName,X.series.refreshRtTotalCount()}return this.drawStaticLayer(this.bufferCtx,e),this.compositePointsLayer(C),!0},compositePointsLayer(e){const t=this.pixelRatio,n=this.chartRect,i=this.labelOffset,s=n.chartWidth-(i.left+i.right),l=n.chartHeight-(i.top+i.bottom),a=n.x1+i.left,r=n.y2-i.bottom,c=r-l,d=a+s,h=(a-e)*t,u=(c-e)*t,f=this.blitShiftDenominator()??1,m=(Math.ceil(d)+e+Math.ceil(f/2)+1)*t,g=(r+e)*t,p=this.getBlitScatterSeriesList(),y=!!this.options.seriesReverse;this.bufferCtx.save(),this.bufferCtx.setTransform(1,0,0,1,0,0),this.bufferCtx.beginPath(),this.bufferCtx.rect(h,u,m-h,g-u),this.bufferCtx.clip();for(let C=0;C<p.length;C++){const b=y?p[p.length-1-C]:p[C],k=this.pointsLayers.get(b.sId);k&&this.bufferCtx.drawImage(k.cur==="A"?k.a:k.b,0,0)}this.bufferCtx.restore()},computePointsLayerStamp(){var s,l,a,r,c,d,h;if(!((s=this.options.realTimeScatter)!=null&&s.use))return null;const e=this.getBlitScatterSeriesList();if(!e.length||!this.chartRect||!this.labelOffset||!this.axesSteps)return null;const t=this.chartRect,n=this.labelOffset,i=[this.pixelRatio,(l=this.bufferCanvas)==null?void 0:l.width,(a=this.bufferCanvas)==null?void 0:a.height,t.chartWidth,t.chartHeight,t.x1,t.y2,n.left,n.right,n.top,n.bottom];for(let u=0;u<e.length;u++){const{sId:f,xi:m,yi:g}=e[u],p=(c=(r=this.dataSet)==null?void 0:r[f])==null?void 0:c.lastTick,y=(d=this.axesSteps.x)==null?void 0:d[m],C=(h=this.axesSteps.y)==null?void 0:h[g];if(!y||!C)return null;i.push(f,p?`${p.seq}/${p.toTime}/${p.endIndex}/${p.length}`:"nt",y.graphMin,y.graphMax,C.graphMin,C.graphMax)}return i.join("|")},maybeRebuildPointsLayer(e=!1){var n;if(!((n=this.options.realTimeScatter)!=null&&n.use))return!1;const t=this.computePointsLayerStamp();return!e&&t&&this.pointsLayerValid&&this._pointsLayerStamp===t&&this._pointsLayerOptionsRef===this.options?!1:(this.rebuildPointsLayer(),this._pointsLayerStamp=this.pointsLayerValid?t:null,this._pointsLayerOptionsRef=this.pointsLayerValid?this.options:null,this.pointsLayerValid)},canRouteFallbackViaLayer(e){var n,i,s,l,a;const t=this.options;return!((n=t.realTimeScatter)!=null&&n.use)||e||(i=t.selectItem)!=null&&i.use&&(((s=this.defaultSelectItemInfo)==null?void 0:s.dataIndex)!=null||((l=this.lastHitInfo)==null?void 0:l.dataIndex)!=null)||(a=t.selectSeries)!=null&&a.use&&this.defaultSelectInfo||!this.pointsLayersSized()||!this.hasOnlyVisibleScatter()?!1:this.getBlitScatterSeriesList().length>0},ensureHitCoordsFresh(){var n,i,s;if(!this._hitCoordsDirty||!((n=this.options.realTimeScatter)!=null&&n.use)||!this.chartRect||!this.labelOffset||!this.axesSteps)return;const e=this.getBlitScatterSeriesList(),t={chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,rtXOffsetCss:this._blitCarry};for(let l=0;l<e.length;l++)(s=(i=e[l].series).refreshRtHitCoords)==null||s.call(i,t);this._hitCoordsDirty=!1},getMaxVisibleScatterPointSize(){const e=this.getBlitScatterSeriesList();let t=0;for(let n=0;n<e.length;n++){const i=e[n].series.pointSize,s=typeof i=="number"?i:(i==null?void 0:i.value)??0;s>t&&(t=s)}return t},rebuildPointsLayer(){var l,a,r;if(!((l=this.options.realTimeScatter)!=null&&l.use)||!this.pointsLayersSized()){this.pointsLayerValid=!1;return}const e=this.getBlitScatterSeriesList();if(!e.length){this.pointsLayerValid=!1;return}const t=this.pixelRatio,n=((r=(a=this.seriesInfo)==null?void 0:a.charts)==null?void 0:r.scatter)??[],i=this.options.coordinateDedupe!==!1&&!this.canSkipRealtimeScatterDedupe(n),s=i?new Map:null;i&&this.collectDuplicatePoints(s,n);for(let c=0;c<e.length;c++){const d=e[c],h=this.pointsLayers.get(d.sId);if(!h){this.pointsLayerValid=!1;return}const u=h.cur==="A"?h.a:h.b,f=h.cur==="A"?h.actx:h.bctx;f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,u.width,u.height),f.setTransform(t,0,0,t,0,0);const m={ctx:f,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,duple:s,coordinateDedupe:i,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity,rtXOffsetCss:this._blitCarry,markDrawn:!0};d.series.computeGeometry(m),d.series.realTimeScatterDraw(m),f.setTransform(1,0,0,1,0,0)}this.pointsLayerValid=!0}},O1={selectedSeriesAllLineSafe(){var t;const e=((t=this.defaultSelectInfo)==null?void 0:t.seriesId)??[];for(let n=0;n<e.length;n++){const i=this.seriesList[e[n]];if(!i||i.type!=="line"||i.fill||i.isExistGrp)return!1}return!0},shouldDrawSelectedOnTop(e){var n,i,s,l;const t=this.options;return!((n=t.selectSeries)!=null&&n.use)||t.brush||(i=t.realTimeScatter)!=null&&i.use||t.workerRender||e!=null&&e.legend||this.legendHover||!((l=(s=this.defaultSelectInfo)==null?void 0:s.seriesId)!=null&&l.length)?!1:this.selectedSeriesAllLineSafe()},drawSelectedSeriesOnly(){var d;const{maxTip:e,selectLabel:t,selectItem:n,selectSeries:i,brush:s,displayOverflow:l,unSelectedOpacity:a}=this.options,r={ctx:this.bufferCtx,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,maxTipOpt:{background:e.background,color:e.color},selectLabel:{option:t,selected:this.defaultSelectInfo},selectSeries:{option:i,selected:this.defaultSelectInfo},selectItem:{option:n,selected:this.defaultSelectItemInfo},isBrush:!!s,displayOverflow:l,unSelectedOpacity:a,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion},c=((d=this.defaultSelectInfo)==null?void 0:d.seriesId)??[];for(let h=0;h<c.length;h++){const u=this.seriesList[c[h]];u&&u.show&&u.draw({...r})}}},Lc=2,Y1=["type","horizontal","sunburst","coordinateDedupe","unSelectedOpacity","displayOverflow","thickness","cPadRatio","borderRadius","seriesReverse","maxTip","padding","heatMapColor"],F1=["sId","type","name","show","color","fill","fillColor","fillOpacity","pointFill","point","lineWidth","thickness","pointSize","pointStyle","interpolation","passingValue","hasPassingValueInData","segments","combo","xAxisIndex","yAxisIndex","stackIndex","groupIndex","isExistGrp","showValue"];function rt(e){if(e===null)return null;const t=typeof e;if(t==="number"||t==="string"||t==="boolean")return e;if(t==="function"||t==="undefined"||t==="symbol"||t==="bigint")return;if(Array.isArray(e))return e.map(i=>rt(i)??null);const n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){const i={};return Object.keys(e).forEach(s=>{const l=rt(e[s]);l!==void 0&&(i[s]=l)}),i}}function Mc(e,t){const n={};return e&&t.forEach(i=>{const s=rt(e[i]);s!==void 0&&(n[i]=s)}),n}function vc(e,t){if(t==="time")return Cc(e);if(typeof e=="number")return e;if(t==="step"){const n=Number(e);return Number.isFinite(n)?n:null}return null}function z1(e,t={}){const n=e.data??[];if(e.type==="pie")return{value:n.map(d=>typeof(d==null?void 0:d.value)=="number"?d.value:null)};const i=t.x??"linear",s=t.y??"linear",l=new Array(n.length),a=new Array(n.length),r=new Array(n.length),c=new Array(n.length);for(let d=0;d<n.length;d++){const h=n[d]??{};l[d]=vc(h.x,i),a[d]=vc(h.y,s),r[d]=typeof h.o=="number"?h.o:null,c[d]=typeof h.b=="number"?h.b:null}return{x:l,y:a,o:r,b:c}}function H1(e){var s,l,a,r,c,d,h,u;const t=e.options??{},n=e.defaultSelectInfo,i=e.defaultSelectItemInfo;return{selectSeries:{use:!!((s=t.selectSeries)!=null&&s.use),selected:{seriesId:rt(n==null?void 0:n.seriesId)??[]}},selectItem:{use:!!((l=t.selectItem)!=null&&l.use),useSeriesOpacity:!!((a=t.selectItem)!=null&&a.useSeriesOpacity),showBorder:!!((r=t.selectItem)!=null&&r.showBorder),borderStyle:rt((c=t.selectItem)==null?void 0:c.borderStyle)??null,selected:i?{dataIndex:i.dataIndex??null,seriesID:i.seriesID??null}:null},selectLabel:{use:!!((d=t.selectLabel)!=null&&d.use),useSeriesOpacity:!!((h=t.selectLabel)!=null&&h.useSeriesOpacity),useBothAxis:!!((u=t.selectLabel)!=null&&u.useBothAxis),selected:{dataIndex:rt(n==null?void 0:n.dataIndex)??[],label:rt(n==null?void 0:n.label)??[],targetAxis:(n==null?void 0:n.targetAxis)??null}}}}function A1(e,t=0){var a,r,c,d,h;const n={},i=e.seriesList??{};Object.keys(i).forEach(u=>{var p,y,C,b,k,L;const f=i[u];if(!f||typeof f.hasRenderableValue=="function"&&!f.isExistGrp&&!f.hasRenderableValue())return;const m=((C=(y=(p=e.options)==null?void 0:p.axesX)==null?void 0:y[f.xAxisIndex??0])==null?void 0:C.type)??"linear",g=((L=(k=(b=e.options)==null?void 0:b.axesY)==null?void 0:k[f.yAxisIndex??0])==null?void 0:L.type)??"linear";n[u]={...Mc(f,F1),data:z1(f,{x:m,y:g})},f.type==="heatMap"&&f.labels&&(n[u].labels=rt(f.labels)??{})});const s={},l=((a=e.seriesInfo)==null?void 0:a.charts)??{};return Object.keys(l).forEach(u=>{s[u]=(l[u]??[]).filter(f=>n[f])}),{version:Lc,epoch:t,pixelRatio:e.pixelRatio??1,chartRect:rt(e.chartRect)??{},labelOffset:rt(e.labelOffset)??{},axesSteps:{x:rt((r=e.axesSteps)==null?void 0:r.x)??[],y:rt((c=e.axesSteps)==null?void 0:c.y)??[]},options:{...Mc(e.options,Y1),isGradient:((h=(d=e.options)==null?void 0:d.legend)==null?void 0:h.type)==="gradient"},selection:H1(e),seriesOrder:s,series:n}}function _1(e){const t={},n=[],i=e.series??{};return Object.keys(i).forEach(s=>{const l=i[s].data??{},a={};let r=0;Object.keys(l).forEach(c=>{const d=l[c]??[];r=d.length;const h=new Float64Array(d.length);for(let u=0;u<d.length;u++)h[u]=typeof d[u]=="number"?d[u]:NaN;a[c]=h,n.push(h.buffer)}),a.length=r,t[s]=a}),{columns:t,transferList:n}}const Rc="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBxdD10eXBlb2YgZ2xvYmFsPT0ib2JqZWN0IiYmZ2xvYmFsJiZnbG9iYWwuT2JqZWN0PT09T2JqZWN0JiZnbG9iYWwsQWU9dHlwZW9mIHNlbGY9PSJvYmplY3QiJiZzZWxmJiZzZWxmLk9iamVjdD09PU9iamVjdCYmc2VsZix5dD1xdHx8QWV8fEZ1bmN0aW9uKCJyZXR1cm4gdGhpcyIpKCksT3Q9eXQuU3ltYm9sLF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pO2NvbnN0IGY9TXMobixzKSxoPXBlcmZvcm1hbmNlLm5vdygpO1NzKG4sZixIdCk7Y29uc3QgcD1wZXJmb3JtYW5jZS5ub3coKS1oLGQ9cGVyZm9ybWFuY2Uubm93KCksdT13dC50cmFuc2ZlclRvSW1hZ2VCaXRtYXAoKSx4PXBlcmZvcm1hbmNlLm5vdygpLWQ7c2VsZi5wb3N0TWVzc2FnZSh7dHlwZToicmVuZGVyZWQiLGVwb2NoOnQsYml0bWFwOnUsZHJhd01zOnAsYml0bWFwTXM6eH0sW3VdKX1zZWxmLm9ubWVzc2FnZT1lPT57Y29uc3QgdD1lLmRhdGE7aWYodCl7aWYodC50eXBlPT09ImluaXQiKXtsZXQgbj10eXBlb2YgT2Zmc2NyZWVuQ2FudmFzPCJ1IjtpZihuKXRyeXtuPSEhbmV3IE9mZnNjcmVlbkNhbnZhcygxLDEpLmdldENvbnRleHQoIjJkIil9Y2F0Y2h7bj0hMX1zZWxmLnBvc3RNZXNzYWdlKHt0eXBlOm4/InJlYWR5IjoidW5zdXBwb3J0ZWQiLHZlcnNpb246Z3N9KTtyZXR1cm59aWYodC50eXBlPT09InJlbmRlciIpdHJ5e0lzKHQpfWNhdGNoKG4pe3NlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6InJlbmRlci1lcnJvciIsZXBvY2g6dC5lcG9jaCxtZXNzYWdlOlN0cmluZyhuJiZuLm1lc3NhZ2V8fG4pLG5hbWU6biYmbi5uYW1lLHN0YWNrOm4mJm4uc3RhY2t9KX19fX0pKCk7Cg==",K1=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Vc=typeof self<"u"&&self.Blob&&new Blob([K1(Rc)],{type:"text/javascript;charset=utf-8"});function U1(e){let t;try{if(t=Vc&&(self.URL||self.webkitURL).createObjectURL(Vc),!t)throw"";const n=new Worker(t,{name:e==null?void 0:e.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker("data:text/javascript;base64,"+Rc,{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const yt={IDLE:"idle",INITIALIZING:"initializing",READY:"ready",FAILED:"failed"},J1=3e3,j1=2,Q1=3,Kt=()=>{},$1={onInitFailure:Kt,onTimeout:Kt,onRenderException:Kt,onFallback:Kt};function q1(){return typeof Worker<"u"&&typeof OffscreenCanvas<"u"&&typeof OffscreenCanvas.prototype.transferToImageBitmap=="function"}function ek(e){if(typeof structuredClone!="function")return!1;try{return structuredClone(e),!0}catch{return!1}}function tk(){return new U1}class nk{constructor(t={}){this.state=yt.IDLE,this.worker=null,this.version=t.version??Lc,this.initTimeoutMs=t.initTimeoutMs??J1,this.maxInFlight=t.maxInFlight??j1,this.maxRenderErrors=t.maxRenderErrors??Q1,this.hooks={...$1,...t.hooks||{}},this._timer=null,this._frameHandler=Kt,this._errorHandler=Kt,this._inFlight=0,this._renderErrorStreak=0,this._isEnabled=t.isEnabled||(()=>!1),this._isSupported=t.isSupported||q1,this._createWorker=t.createWorker||tk}start(){if(this.state!==yt.IDLE)return this.state;if(!this._isEnabled())return this.hooks.onFallback("opt-in-off"),this.state;if(!this._isSupported())return this.hooks.onFallback("unsupported"),this.state;let t;try{t=this._createWorker()}catch(n){return this.state=yt.FAILED,this.hooks.onInitFailure(n),this.hooks.onFallback("worker-create-failed"),this.state}return t?(this.worker=t,this.state=yt.INITIALIZING,t.onmessage=n=>this._handleMessage(n),t.onerror=()=>this._fail("worker-error"),this._timer=setTimeout(()=>this._handleTimeout(),this.initTimeoutMs),t.postMessage({type:"init",version:this.version}),this.state):(this.state=yt.FAILED,this.hooks.onInitFailure("worker-create-failed"),this.hooks.onFallback("worker-create-failed"),this.state)}isReady(){return this.state===yt.READY}shouldRenderOnWorker(t){return this.isReady()&&ek(t)}setFrameHandler(t){this._frameHandler=t||Kt}setErrorHandler(t){this._errorHandler=t||Kt}canAcceptRender(){return this.isReady()&&this._inFlight<this.maxInFlight}render(t,n,i){if(!this.canAcceptRender()||!this.worker)return!1;this._inFlight+=1;try{this.worker.postMessage({type:"render",epoch:t.epoch,snapshot:t,columns:n},i||[])}catch(s){return this._inFlight=0,this.hooks.onRenderException(s),this._fail("post-message-failed"),!1}return!0}destroy(){this._clearTimer(),this.worker&&(this.worker.terminate(),this.worker=null),this.state=yt.IDLE}_handleMessage(t){const n=t&&t.data;if(n)if(n.type==="ready"&&this.state===yt.INITIALIZING){if(n.version!==this.version){this._fail("version-mismatch");return}this._clearTimer(),this.state=yt.READY}else n.type==="unsupported"?this._fail("worker-unsupported"):n.type==="rendered"?(this._inFlight=Math.max(0,this._inFlight-1),this._renderErrorStreak=0,this._frameHandler(n)):n.type==="render-error"&&(this._inFlight=Math.max(0,this._inFlight-1),this.hooks.onRenderException(n),this._errorHandler(n),this._renderErrorStreak+=1,this._renderErrorStreak>=this.maxRenderErrors&&(this._inFlight=0,this._fail("render-error-threshold")))}_handleTimeout(){this.state===yt.INITIALIZING&&(this.hooks.onTimeout("init-timeout"),this._fail("init-timeout"))}_fail(t){this._clearTimer(),this.state=yt.FAILED,this.worker&&(this.worker.terminate(),this.worker=null);const n=this._inFlight>0;this._inFlight=0,this.hooks.onInitFailure(t),this.hooks.onFallback(t),n&&this._errorHandler()}_clearTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}}const ik=["text","badge","callout","circle"],sk=["axis","pixel","series"],ok=["straight","elbow"],lk=["top","bottom","left","right","auto"],ak=["start","end"],rk={type:"pixel",xAxisIndex:0,yAxisIndex:0,xValue:null,yValue:null,x:0,y:0,seriesId:null,location:"end",offsetX:0,offsetY:0},ck={enabled:!1,type:"straight",style:{stroke:"#9E9E9E",strokeWidth:1,dashStyle:"solid"}},Ec={text:{style:{color:"#212121",backgroundColor:"transparent",borderColor:"transparent",borderWidth:0,borderRadius:0,padding:[0,0],fontSize:"11px",fontWeight:"normal",textAlign:"center"}},badge:{style:{color:"#8B2323",backgroundColor:"#FDF0F0",borderColor:"#B24C4C",borderWidth:1,borderRadius:6,padding:[6,10],fontSize:"11px",fontWeight:"normal",textAlign:"center"}},callout:{style:{anchor:"auto",arrowSize:4,color:"#212121",backgroundColor:"#FFFFFF",borderColor:"#B0B0B0",borderWidth:1,borderRadius:4,padding:[4,8],fontSize:"11px",fontWeight:"normal",textAlign:"center"}},circle:{style:{radius:10,backgroundColor:"rgba(178, 76, 76, 0.15)",borderColor:"#B24C4C",borderWidth:1}}};function dk(e){const t=n=>Number.isFinite(n)&&n>0?n:0;if(typeof e=="number"){const n=t(e);return[n,n,n,n]}if(Array.isArray(e)){const n=e.map(t);if(n.length===1)return[n[0],n[0],n[0],n[0]];if(n.length===2)return[n[0],n[1],n[0],n[1]];if(n.length===3)return[n[0],n[1],n[2],n[1]];if(n.length>=4)return[n[0],n[1],n[2],n[3]]}return[0,0,0,0]}function hk(e,t,n){if(sk.includes(e.type)||(n.push(`[annotation:${t}] unknown position.type "${e.type}" — fallback to "pixel".`),e.type="pixel"),e.type==="axis")(e.xValue==null||e.yValue==null)&&n.push(`[annotation:${t}] position.type "axis" requires both xValue and yValue.`);else if(e.type==="series"){e.seriesId==null&&n.push(`[annotation:${t}] position.type "series" requires seriesId.`);const i=e.location;ak.includes(i)||typeof i=="number"&&Number.isInteger(i)||(n.push(`[annotation:${t}] invalid location "${i}" — fallback to "end".`),e.location="end")}}function uk(e,t,n){const i=e.id!=null?String(e.id):`annotation-${t}`;let s=e.type;ik.includes(s)||(n.push(`[annotation:${i}] unknown type "${s}" — fallback to "text".`),s="text");const l=Ve(e.style)||{},a=Pe({},l,Ec[s].style);if("padding"in a){const h="padding"in l?l.padding:Ec[s].style.padding;a.padding=dk(h)}s==="circle"&&typeof a.radius=="number"&&a.radius<0&&(n.push(`[annotation:${i}] style.radius must be >= 0 — clamped to 0.`),a.radius=0),s==="callout"&&!lk.includes(a.anchor)&&(n.push(`[annotation:${i}] invalid style.anchor "${a.anchor}" — fallback to "auto".`),a.anchor="auto");const r=Pe({},Ve(e.position)||{},rk);hk(r,i,n);const c=Pe({},Ve(e.connector)||{},ck);ok.includes(c.type)||(n.push(`[annotation:${i}] invalid connector.type "${c.type}" — fallback to "straight".`),c.type="straight"),s==="callout"&&c.enabled&&(n.push(`[annotation:${i}] connector is ignored for type "callout" (the arrow acts as the connector).`),c.enabled=!1);let d=e.content;return s==="circle"?d="":!Qn(d)&&typeof d!="string"&&(d=d==null?"":String(d)),{id:i,type:s,content:d,position:r,connector:c,style:a}}function fk(e){const t=[];if(!Array.isArray(e))return{annotations:[],warnings:t};const n=new Set,i=e.filter(s=>s&&typeof s=="object").map((s,l)=>uk(s,l,t));return i.forEach(s=>{n.has(s.id)&&t.push(`[annotation:${s.id}] duplicate id — annotations should have unique ids.`),n.add(s.id)}),{annotations:i,warnings:t}}function mk(e,t){if(e==null)return null;if(((t==null?void 0:t.type)||"linear")==="time"){if(typeof e=="number")return Number.isFinite(e)?e:null;const s=We(e).valueOf();return Number.isFinite(s)?s:null}const i=typeof e=="number"?e:Number(e);return Number.isFinite(i)?i:null}function pk(e,t=[]){const i=(Array.isArray(t)?t:[]).indexOf(e);return i!==-1?i:typeof e=="number"&&Number.isInteger(e)?e:-1}function gk(e,t,n,i,s){const l=Array.isArray(t.labels)?t.labels:[],a=t.minIndex??0,r=t.maxIndex??l.length-1,c=r-a+1;if(c<=0)return null;const d=pk(e,l);if(d<a||d>r)return null;const h=n/c,u=h*(d-a)+h/2;return Math.round(s?i+u:i-u)}function Wc(e,t,n,i,s){if(!t)return null;if((t.type||"linear")==="step")return gk(e,t,n,i,s);const l=mk(e,t);return l===null?null:s?te.calculateX(l,t.graphMin,t.graphMax,n,i):te.calculateY(l,t.graphMin,t.graphMax,n,i)}function Gc(e,t,n=!1){const i=Array.isArray(t);let s=0;if(i?s=t.length:typeof t=="number"&&(s=t),s<=0)return-1;if(typeof e=="number"&&Number.isInteger(e))return Math.min(Math.max(e,0),s-1);const l=a=>a&&(n?a.x!=null:a.y!=null);if(e==="start"){if(!i)return 0;for(let a=0;a<s;a++)if(l(t[a]))return a;return-1}if(!i)return s-1;for(let a=s-1;a>=0;a--)if(l(t[a]))return a;return-1}function bk(e,t){var a,r,c,d,h,u,f,m,g;const n={x:0,y:0,anchorX:0,anchorY:0,isVisible:!1},{position:i}=e;if(!i)return n;const s=i.offsetX||0,l=i.offsetY||0;if(i.type==="pixel"){const p=i.x||0,y=i.y||0;return{x:p+s,y:y+l,anchorX:p,anchorY:y,isVisible:!0}}if(i.type==="axis"){const{chartRect:p,labelOffset:y}=t||{},C=((r=(a=t==null?void 0:t.axes)==null?void 0:a.x)==null?void 0:r[i.xAxisIndex])??((d=(c=t==null?void 0:t.axesSteps)==null?void 0:c.x)==null?void 0:d[i.xAxisIndex]),b=((u=(h=t==null?void 0:t.axes)==null?void 0:h.y)==null?void 0:u[i.yAxisIndex])??((m=(f=t==null?void 0:t.axesSteps)==null?void 0:f.y)==null?void 0:m[i.yAxisIndex]);if(!C||!b||!p||!y)return n;const k=p.chartWidth-(y.left+y.right),L=p.chartHeight-(y.top+y.bottom),w=p.x1+y.left,M=p.y2-y.bottom,V=Wc(i.xValue,C,k,w,!0),S=Wc(i.yValue,b,L,M,!1);return V===null||S===null?n:{x:V+s,y:S+l,anchorX:V,anchorY:S,isVisible:!0}}if(i.type==="series"){const p=(g=t==null?void 0:t.seriesList)==null?void 0:g[i.seriesId];if(!p||p.show===!1)return n;if(p.type==="pie"){const{centerX:M,centerY:V,radius:S,startAngle:x,endAngle:I}=p;if(M==null||V==null||S==null||x==null||I==null)return n;let T=(x+I)/2;Math.abs(I-x)>=Math.PI*2-1e-6&&(T=0);const E=M+Math.cos(T)*S,Z=V+Math.sin(T)*S;return{x:E+s,y:Z+l,anchorX:E,anchorY:Z,isVisible:!0}}const y=p.data;if(!Array.isArray(y))return n;const C=Gc(i.location,y,!!p.isHorizontal),b=C>=0?y[C]:null;if(!b||b.xp==null||b.yp==null)return n;let k=b.xp,L=b.yp;const w=typeof b.w=="number"&&typeof b.h=="number";return p.type==="bar"&&w?p.isHorizontal?(k=b.xp+b.w,L=b.yp+b.h/2):(k=b.xp+b.w/2,L=b.yp+b.h):w&&(k=b.xp+b.w/2,L=b.yp+b.h/2),{x:k+s,y:L+l,anchorX:k,anchorY:L,isVisible:!0}}return n}function yk(e,t){var s,l,a;const{position:n}=e,i={xValue:null,yValue:null,seriesId:null,seriesName:null,dataIndex:-1,percentage:null};if(!n)return i;if(n.type==="axis")i.xValue=n.xValue,i.yValue=n.yValue;else if(n.type==="series"){const r=(s=t==null?void 0:t.seriesList)==null?void 0:s[n.seriesId],c=r==null?void 0:r.data;if(i.seriesId=n.seriesId,i.seriesName=(r==null?void 0:r.name)??null,(r==null?void 0:r.type)==="pie")i.yValue=((l=r.data)==null?void 0:l.o)??null,i.percentage=((a=r.data)==null?void 0:a.percentage)??null,i.dataIndex=0;else if(Array.isArray(c)){const d=Gc(n.location,c,!!r.isHorizontal);i.dataIndex=d,d>=0&&c[d]&&(i.xValue=c[d].x,i.yValue=c[d].y)}}return i}function xk(e,t={}){if(Qn(e))try{const n=e(t);return n==null?"":String(n)}catch{return""}return typeof e!="string"?e==null?"":String(e):e.replace(/\{(\w+)\}/g,(n,i)=>i in t&&t[i]!=null?String(t[i]):n)}function Zc(e={}){const t=e.fontWeight||"normal",n=typeof e.fontSize=="number"?`${e.fontSize}px`:e.fontSize||"11px",i=e.fontFamily||"sans-serif";return`${t} ${n} ${i}`}function Sk(e,t,n=A.calcTextSizeCanvas){const s=(e==null?"":String(e)).split(`
18
- `);let l=0,a=0;const r=s.map(c=>{const d=n(c,t);return l=Math.max(l,d.width),a=Math.max(a,d.height),{text:c,width:d.width}});return{lines:r,width:l,height:a*r.length,lineHeight:a}}function Ck(e,t,n=A.calcTextSizeCanvas){const{type:i,style:s}=e;if(i==="circle"){const f=s.radius||0;return{w:f*2,h:f*2,content:null}}const l=Zc(s),a=`${l}|${t}`;let r;e._measure&&e._measure.key===a?r=e._measure.value:(r=Sk(t,l,n),e._measure={key:a,value:r});const[c,d,h,u]=s.padding||[0,0,0,0];return{w:r.width+u+d,h:r.height+c+h,content:r}}function kk(e,t,n){if(e&&e!=="auto")return e;const i=n.x-t.x,s=n.y-t.y;return i===0&&s===0?"bottom":Math.abs(s)>=Math.abs(i)?s>=0?"bottom":"top":i>=0?"right":"left"}function wk(e,t,n,i){const s=Math.max(i,1);let l,a;return n==="bottom"||n==="top"?(l=n==="bottom"?e.y+e.h:e.y,a=Math.min(Math.max(t.x,e.x+s),e.x+e.w-s),{side:n,tipX:t.x,tipY:t.y,baseAX:a-s,baseAY:l,baseBX:a+s,baseBY:l}):(l=n==="right"?e.x+e.w:e.x,a=Math.min(Math.max(t.y,e.y+s),e.y+e.h-s),{side:n,tipX:t.x,tipY:t.y,baseAX:l,baseAY:a-s,baseBX:l,baseBY:a+s})}function Ik(e,t,n,i=A.calcTextSizeCanvas){const{type:s,style:l}=e,a=Ck(e,n,i);if(s==="circle"){const d=l.radius||0,h={cx:t.x,cy:t.y,r:d},u={x:t.x-d,y:t.y-d,w:d*2,h:d*2};return{type:s,box:u,shape:h,content:null,tail:null}}const r={x:Math.round(t.x-a.w/2),y:Math.round(t.y-a.h/2),w:a.w,h:a.h};let c=null;if(s==="callout"){const d={x:r.x+r.w/2,y:r.y+r.h/2},h={x:t.anchorX,y:t.anchorY},u=kk(l.anchor,d,h);c=wk(r,h,u,l.arrowSize||8)}return{type:s,box:r,content:a.content,shape:null,tail:c}}const Xc={solid:[],dash:[4,4],dot:[1,3]};function Tk(e,t){return{x:Math.min(Math.max(t.x,e.x),e.x+e.w),y:Math.min(Math.max(t.y,e.y),e.y+e.h)}}function Lk(e,t,n,i){if(!(i!=null&&i.enabled))return;const s=Tk(n,t),l=i.style||{};e.save();try{e.beginPath(),e.strokeStyle=l.stroke||"#9E9E9E",e.lineWidth=l.strokeWidth||1,e.setLineDash(Xc[l.dashStyle]||Xc.solid),e.moveTo(t.x,t.y),i.type==="elbow"&&e.lineTo(s.x,t.y),e.lineTo(s.x,s.y),e.stroke()}finally{e.restore()}}function Mk(e,t,n){const i=n.backgroundColor&&n.backgroundColor!=="transparent",s=n.borderWidth>0&&n.borderColor&&n.borderColor!=="transparent";if(!(!i&&!s)){e.save();try{e.beginPath(),te.roundedRect(e,t.x,t.y,t.w,t.h,n.borderRadius||0),i&&(e.fillStyle=n.backgroundColor,e.fill()),s&&(e.lineWidth=n.borderWidth,e.strokeStyle=n.borderColor,e.stroke())}finally{e.restore()}}}function vk(e,t,n,i){const{x:s,y:l,w:a,h:r}=t,c=s,d=s+a,h=l,u=l+r,f=Math.min(i.borderRadius||0,a/2,r/2),m=n==null?void 0:n.side;e.save();try{e.beginPath(),e.moveTo(c+f,h),m==="top"&&(e.lineTo(Math.min(n.baseAX,n.baseBX),h),e.lineTo(n.tipX,n.tipY),e.lineTo(Math.max(n.baseAX,n.baseBX),h)),e.lineTo(d-f,h),e.quadraticCurveTo(d,h,d,h+f),m==="right"&&(e.lineTo(d,Math.min(n.baseAY,n.baseBY)),e.lineTo(n.tipX,n.tipY),e.lineTo(d,Math.max(n.baseAY,n.baseBY))),e.lineTo(d,u-f),e.quadraticCurveTo(d,u,d-f,u),m==="bottom"&&(e.lineTo(Math.max(n.baseAX,n.baseBX),u),e.lineTo(n.tipX,n.tipY),e.lineTo(Math.min(n.baseAX,n.baseBX),u)),e.lineTo(c+f,u),e.quadraticCurveTo(c,u,c,u-f),m==="left"&&(e.lineTo(c,Math.max(n.baseAY,n.baseBY)),e.lineTo(n.tipX,n.tipY),e.lineTo(c,Math.min(n.baseAY,n.baseBY))),e.lineTo(c,h+f),e.quadraticCurveTo(c,h,c+f,h),e.closePath(),i.backgroundColor&&i.backgroundColor!=="transparent"&&(e.fillStyle=i.backgroundColor,e.fill()),i.borderWidth>0&&i.borderColor&&i.borderColor!=="transparent"&&(e.lineWidth=i.borderWidth,e.strokeStyle=i.borderColor,e.stroke())}finally{e.restore()}}function Rk(e,t,n){e.save();try{e.beginPath(),e.arc(t.cx,t.cy,t.r,0,Math.PI*2),n.backgroundColor&&n.backgroundColor!=="transparent"&&(e.fillStyle=n.backgroundColor,e.fill()),n.borderWidth>0&&n.borderColor&&n.borderColor!=="transparent"&&(e.lineWidth=n.borderWidth,e.strokeStyle=n.borderColor,e.stroke())}finally{e.restore()}}function Vk(e,t,n,i){var s;if(!(!n||!((s=n.lines)!=null&&s.length))){e.save();try{e.fillStyle=i.color||"#212121",e.font=Zc(i);const l=["left","right"].includes(i.textAlign)?i.textAlign:"center";e.textAlign=l,e.textBaseline="middle";const[,a,,r]=i.padding||[0,0,0,0];let c;l==="left"?c=t.x+r:l==="right"?c=t.x+t.w-a:c=t.x+t.w/2;const{lineHeight:d}=n,h=d*n.lines.length,u=t.y+t.h/2-h/2+d/2;n.lines.forEach((f,m)=>{e.fillText(f.text,c,u+m*d)})}finally{e.restore()}}}function Ek(e,t,n,i){var a;const{type:s,style:l}=t;if(s==="circle"){Rk(e,n.shape,l);return}(a=t.connector)!=null&&a.enabled&&s!=="callout"&&Lk(e,{x:i.anchorX,y:i.anchorY},n.box,t.connector),s==="callout"?vk(e,n.box,n.tail,l):Mk(e,n.box,l),Vk(e,n.box,n.content,l)}function Wk(e,t,n,i=A.calcTextSizeCanvas){!e||!Array.isArray(t)||!t.length||t.forEach(s=>{try{const l=bk(s,n);if(!l.isVisible)return;const a=yk(s,n),r=s.type==="circle"?"":xk(s.content,a),c=Ik(s,l,r,i);Ek(e,s,c,l)}catch(l){ye.warn(`[EvChart] annotation render failed (id: ${s&&s.id}):`,l)}})}const Gk=300;let vs=class{constructor(t,n,i,s,l,a,r){Object.keys(yc).forEach(d=>Object.assign(this,yc[d])),i.brush||(Object.assign(this,E1),Object.assign(this,N1),Object.assign(this,M1),Object.assign(this,D1),Object.assign(this,S1),Object.assign(this,P1),Object.assign(this,x1),Object.assign(this,w1)),i.type==="heatMap"&&i.legend.type==="gradient"&&Object.assign(this,k1),this.isMobile=bu(),this.brushSeries=r,this.target=t,this.data=n,this.options=i,this.listeners=s,this.wrapperDOM=document.createElement("div"),this.wrapperDOM.className=i.brush?"ev-chart-brush-wrapper":"ev-chart-wrapper",this.chartDOM=document.createElement("div"),this.chartDOM.className=i.brush?"ev-chart-brush-container":"ev-chart-container",this.wrapperDOM.appendChild(this.chartDOM),this.target.appendChild(this.wrapperDOM);const c=i.type==="pie";this.displayCanvas=document.createElement("canvas"),this.displayCanvas.setAttribute("style","display: block;"),this.displayCtx=this.displayCanvas.getContext("2d",{willReadFrequently:c}),this.bufferCanvas=document.createElement("canvas"),this.bufferCanvas.setAttribute("style","display: block;"),this.bufferCtx=this.bufferCanvas.getContext("2d",{willReadFrequently:c}),this.pixelRatio=window.devicePixelRatio||1,this.oldPixelRatio=this.pixelRatio,this.chartDOM.appendChild(this.displayCanvas),i.brush||(this.overlayCanvas=document.createElement("canvas"),this.overlayCanvas.setAttribute("style","display: block; z-index: 2;"),this.overlayCanvas.setAttribute("class","overlay-canvas"),this.overlayCtx=this.overlayCanvas.getContext("2d",{willReadFrequently:c}),this.chartDOM.appendChild(this.overlayCanvas),this.overlayCanvas.style.position="absolute",this.overlayCanvas.style.top="0px",this.overlayCanvas.style.left="0px"),this.isInitLegend=!1,this.isInitTitle=!1,this.isInit=!1,this.scrollbar={x:{isInit:!1},y:{isInit:!1}},this.seriesList={},this.lastTip={pos:null,value:null},this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.defaultSelectItemInfo=l,this.defaultSelectInfo=a,this.legendHover=null,this.initBlitState(),this.renderWorkerGate=new nk({isEnabled:()=>!!this.options.workerRender,hooks:{onInitFailure:d=>ye.warn("[EvChart] workerRender 비활성화 — main 렌더로 fallback:",d),onRenderException:d=>ye.warn("[EvChart] workerRender 렌더 예외 — main 렌더로 fallback:",d),onFallback:d=>{d==="unsupported"&&ye.warn("[EvChart] workerRender 미지원 환경 — main 렌더 사용")}}}),this.renderEpoch=0,this.renderWorkerGate.setFrameHandler(d=>this.commitWorkerFrame(d)),this.renderWorkerGate.setErrorHandler(d=>this.drawSeriesLayerFallback(d)),this.renderWorkerGate.start()}init(){var u,f,m,g,p;const{series:t,data:n,labels:i,groups:s}=this.data,{type:l,axesX:a,axesY:r,tooltip:c,horizontal:d,realTimeScatter:h}=this.options;this.createSeriesSet(t,l,d,s),s.length&&this.addGroupInfo(s),h!=null&&h.use?(this.dataSet={},this.createRealTimeScatterDataSet(n)):this.createDataSet(n,i),this.minMax=this.getStoreMinMax(),this.initRect(),this.axesX=this.createAxes("x",a),this.axesY=this.createAxes("y",r),((f=(u=a==null?void 0:a[0])==null?void 0:u.scrollbar)!=null&&f.use||(g=(m=r==null?void 0:r[0])==null?void 0:m.scrollbar)!=null&&g.use)&&this.initScrollbar(),this.initDefaultSelectInfo(),this.drawChart(),c.use&&!this.isInitTooltip&&this.createTooltipDOM(),(p=this.createEventFunctions)==null||p.call(this),this.isInit=!0}_updateSeriesCount(){this.seriesInfo.count=Object.values(this.seriesList).filter(t=>t.show).length}initRect(){const t=this.options;t.title.show&&(this.isInitTitle||this.initTitle(),this.showTitle()),t.legend.show&&!t.legend.external?(this.isInitLegend||this.initLegend(),this.setLegendPosition()):t.legend.show&&t.legend.external&&this._updateSeriesCount(),this.chartRect=this.getChartRect()}drawSyncedIndicator({horizontal:t,label:n,mousePosition:i}){this.drawSyncedIndicator({horizontal:t,label:n,mousePosition:i})}adjustXAndYAxisWidth(){var i,s,l,a;const t=(r,c,d)=>{const{interval:h,graphMin:u,graphMax:f,steps:m=0,minIndex:g,maxIndex:p,indexInterval:y}=r??{};let C=[];if((d==null?void 0:d.type)==="step"&&g!==void 0&&p!==void 0&&y!==void 0){const{labels:b}=this.data,k=c==="x"?(b==null?void 0:b.x)??b??[]:(b==null?void 0:b.y)??b??[];C=[];for(let L=g;L<=p;L+=y)k[L]!==void 0&&C.push(k[L])}else if(h)C=Array.from({length:m},(b,k)=>u+k*h),C.push(f);else{const{labels:b}=this.data;C=c==="x"?(b==null?void 0:b.x)??b??[]:(b==null?void 0:b.y)??b??[]}return C},n={x:(s=(i=this.axesRange)==null?void 0:i.x)==null?void 0:s.map((r,c)=>{var y,C,b,k;const d=this.axesX[c],h=(y=this.axesSteps)==null?void 0:y.x[c],u=t(h,"x",d),f=Re((C=d==null?void 0:d.labelStyle)==null?void 0:C.fixWidth)?d.labelStyle.fixWidth:0;let m=[];const g=(b=this.axesSteps)==null?void 0:b.x[c];if((d==null?void 0:d.type)==="linear"&&g!=null){const{graphMin:L,graphMax:w}=g;if(typeof L=="number"&&typeof w=="number"){const M=Math.abs(L)>=Math.abs(w)?L:w;m=[SC(M)]}}const p=((k=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:k.call(d,u,this.chartRect,m))??0;return{...r,size:{width:f||Math.max(p,r.size.width),height:r.size.height}}}),y:(a=(l=this.axesRange)==null?void 0:l.y)==null?void 0:a.map((r,c)=>{var g,p,y;const d=this.axesY[c],h=(g=this.axesSteps)==null?void 0:g.y[c],u=t(h,"y",d),f=Re((p=d==null?void 0:d.labelStyle)==null?void 0:p.fixWidth)?d.labelStyle.fixWidth:0,m=((y=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:y.call(d,u,this.chartRect))??0;return{...r,size:{width:f||Math.max(m,r.size.width),height:r.size.height}}})};this.axesRange=n,this.labelOffset=this.getLabelOffset(n),this.labelRange=this.getAxesLabelRange(),this.axesSteps=this.calculateSteps()}computeAxesScaleChange(){var r;if(typeof((r=this.listeners)==null?void 0:r["axes-scale-change"])!="function")return null;const t=this._lastEmittedAxesRange,n=this.labelRange,i=(c,d)=>(c==null?void 0:c.min)===(d==null?void 0:d.min)&&(c==null?void 0:c.max)===(d==null?void 0:d.max),s=({min:c,max:d})=>({minSteps:c,maxSteps:d}),l=n.x.every((c,d)=>{var u;return!!!((u=this.options.axesX[d])!=null&&u.scaleChange)||!!t&&i(c,t.x[d])}),a=n.y.every((c,d)=>{var u;return!!!((u=this.options.axesY[d])!=null&&u.scaleChange)||!!t&&i(c,t.y[d])});return l&&a?null:(this._lastEmittedAxesRange=n,{x:n.x.map(s),y:n.y.map(s)})}emitDataMaxChange(){var i;const t=(i=this.listeners)==null?void 0:i["axes-data-max-change"];if(typeof t!="function")return;let n=-1/0;Object.values(this.seriesList).forEach(s=>{if(!(s!=null&&s.show)||!s.minMax)return;const l=s.minMax.maxY;Number.isFinite(l)&&l>n&&(n=l)}),t(Number.isFinite(n)?n:null)}prepareScale(){this.axesRange=this.getAxesRange(),this.labelOffset=this.getLabelOffset(),this.labelRange=this.getAxesLabelRange();const t=this.labelOffset;return this.axesSteps=this.calculateSteps(),this.adjustXAndYAxisWidth(),{scaleChange:this.computeAxesScaleChange(),scrollbarLabelOffset:t}}drawChart(t,n){var l,a,r,c,d,h;this.renderEpoch+=1,this.initScale();const{scaleChange:i,scrollbarLabelOffset:s}=this.prepareScale();this.computeScaleVersion(),((a=(l=this.scrollbar)==null?void 0:l.x)!=null&&a.use||(c=(r=this.scrollbar)==null?void 0:r.y)!=null&&c.use)&&this.updateScrollbarPosition(s),i&&typeof((d=this.listeners)==null?void 0:d["axes-scale-change"])=="function"&&this.listeners["axes-scale-change"](i),this.emitDataMaxChange(),!(!n&&this.tryDrawSeriesOnWorker(t))&&((h=this.options.realTimeScatter)!=null&&h.use?this.drawAxisAndSeries(t):(this.drawStaticLayer(this.bufferCtx,t),this.drawSeriesLayer(this.bufferCtx,t),this.shouldDrawSelectedOnTop(t)&&this.drawSelectedSeriesOnly()),this.drawSeriesOverlay(),this.drawForeground(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas),this.drawAnnotationLayer())}tryDrawSeriesOnWorker(t){var r;if(!((r=this.renderWorkerGate)!=null&&r.canAcceptRender())||!this.canRenderSeriesOnWorker(t).ok)return!1;const n=this.renderEpoch,i=A1(this,n),{columns:s,transferList:l}=_1(i);return this.drawStaticLayer(this.bufferCtx,t),this.computeSeriesGeometry(),this.renderWorkerGate.render(i,s,l)?this.drawSeriesOverlay():(this.drawSeriesLayer(this.bufferCtx,t),this.drawSeriesOverlay(),this.drawForeground(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas)),this.drawAnnotationLayer(),!0}canRenderSeriesOnWorker(t){var a;if(t||this.lastHitInfo)return{ok:!1,reason:"hit-info"};const n=((a=this.seriesInfo)==null?void 0:a.charts)??{},i={line:!0,bar:!0,heatMap:!0},s=Object.keys(n).find(r=>!i[r]&&(n[r]??[]).some(c=>{var d;return((d=this.seriesList[c])==null?void 0:d.show)!==!1}));return s?{ok:!1,reason:`unsupported-type:${s}`}:(n.bar??[]).some(r=>{const c=this.seriesList[r];return(c==null?void 0:c.show)!==!1&&(c==null?void 0:c.timeMode)})?{ok:!1,reason:"time-bar"}:{ok:!0}}commitWorkerFrame(t){const n=t==null?void 0:t.bitmap;if(!n)return;if(t.epoch!==this.renderEpoch){n.close();return}const i=this.displayCtx;this.commitToDisplay(i,this.bufferCanvas),i.drawImage(n,0,0),n.close(),i.save(),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.drawForeground(i),i.restore()}drawSeriesLayerFallback(t){var n;t&&t.epoch!==this.renderEpoch||(this.drawSeriesLayer(this.bufferCtx,void 0),((n=this.options.plot)==null?void 0:n.aboveSeries)!==!1&&this.drawPlotsFront(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas))}commitToDisplay(t,n){if(this.displayCanvas){const i=this.pixelRatio<1?this.pixelRatio:1;t.clearRect(0,0,this.displayCanvas.width/i,this.displayCanvas.height/i)}n&&(n==null?void 0:n.width)>1&&(n==null?void 0:n.height)>1&&t.drawImage(n,0,0),this._blitPrev=this.snapshotBlitState()}drawAxisAndSeries(t){var d;(d=this.options.realTimeScatter)!=null&&d.use&&this.createPointsLayers();const n=this.evaluateBlitGate(t),i=typeof window<"u"&&window.__EVUI_BLIT_FORCE_OFF__===!0,s=typeof window<"u"?window.__EVUI_BLIT_REFRESH_INTERVAL__:void 0,l=Number.isFinite(s)?s:this._blitRefreshInterval||Gk,a=n.ok&&!i&&this.pointsLayerValid&&this.pointsLayersSized()&&this._framesSinceFullRedraw<l,r={blockedByForceOff:i,blockedByLayerInvalid:!this.pointsLayerValid,blockedByLayerUnsized:!this.pointsLayersSized(),blockedByRefreshDue:this._framesSinceFullRedraw>=l};let c=!1;if(a&&(c=this.drawChartBlitFastPath(t,n)),this.recordBlitDiag(n,c,r),c)this._lastFrameMode="blit",this._framesSinceFullRedraw++,this._pointsLayerStamp=this.computePointsLayerStamp(),this._pointsLayerOptionsRef=this.options,this._hitCoordsDirty=!0;else{this.drawStaticLayer(this.bufferCtx,t);let h=!1,u=!1,f="direct";!i&&this.canRouteFallbackViaLayer(t)?(h=this.maybeRebuildPointsLayer(r.blockedByRefreshDue),this.pointsLayerValid?(this.compositePointsLayer(this.getMaxVisibleScatterPointSize()),f=h?"rebuild":"layer"):(this.drawSeriesLayer(this.bufferCtx,t),u=!0)):(this.drawSeriesLayer(this.bufferCtx,t),h=this.maybeRebuildPointsLayer(!1),u=!(t!=null&&t.legend)),(h||u)&&(this._hitCoordsDirty=!1),h&&(this._framesSinceFullRedraw=0),this._lastFrameMode=f,f!=="layer"&&(this._lastRasterAt=Date.now())}}collectDuplicatePoints(t,n){var s,l,a;const i=!!this.options.seriesReverse;for(let r=i?n.length-1:0;i?r>=0:r<n.length;i?r--:r++){const c=this.seriesList[n[r]];if(!!(c!=null&&c.show))if((s=this.options.realTimeScatter)!=null&&s.use){const h=(l=c.data[c.sId])==null?void 0:l.dataGroup;for(let u=0;u<h.length;u++){const f=((a=h[u])==null?void 0:a.data)||[];for(let m=0;m<f.length;m++){const g=f[m];t.set(g.k??A.coordinateKey(g.x,g.y),c.sId)}}}else{const h=this.data.data[n[r]]??[];for(let u=0;u<h.length;u++){const f=h[u];t.set(A.coordinateKey(f.x,f.y),c.sId)}}}}canSkipRealtimeScatterDedupe(t){var i,s;if(!((i=this.options.realTimeScatter)!=null&&i.use))return!1;let n=0;for(let l=0;l<t.length;l++)if((s=this.seriesList[t[l]])!=null&&s.show&&(n++,n>1))return!1;return n===1}computeScaleVersion(){var r,c;const t=this.chartRect??{},n=this.labelOffset??{},i=this.options??{},s=((r=this.axesSteps)==null?void 0:r.x)??[],l=((c=this.axesSteps)==null?void 0:c.y)??[];let a=`${t.x1},${t.x2},${t.y1},${t.y2},${t.chartWidth},${t.chartHeight}|${n.left},${n.right},${n.top},${n.bottom}|${this.pixelRatio}|${i.horizontal?1:0}|${i.thickness},${i.cPadRatio},${i.borderRadius}|`;for(let d=0;d<s.length;d++){const h=s[d];a+=`${h==null?void 0:h.graphMin}:${h==null?void 0:h.graphMax}:${h==null?void 0:h.minIndex}:${h==null?void 0:h.maxIndex}:${h==null?void 0:h.oriSteps};`}a+="|";for(let d=0;d<l.length;d++){const h=l[d];a+=`${h==null?void 0:h.graphMin}:${h==null?void 0:h.graphMax}:${h==null?void 0:h.minIndex}:${h==null?void 0:h.maxIndex}:${h==null?void 0:h.oriSteps};`}a!==this._scaleKey&&(this._scaleKey=a,this._scaleVersion=(this._scaleVersion??0)+1)}computeSeriesGeometry(){const t={chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion};let n=0;this.seriesInfo.charts.bar.forEach(r=>{var c;(c=this.seriesList[r])!=null&&c.show&&n++}),["line","heatMap"].forEach(r=>{this.seriesInfo.charts[r].forEach(c=>{var d,h;(h=(d=this.seriesList[c])==null?void 0:d.computeGeometry)==null||h.call(d,t)})});const{thickness:i,cPadRatio:s,borderRadius:l}=this.options;let a=0;this.seriesInfo.charts.bar.forEach(r=>{var d;const c=this.seriesList[r];c&&((d=c.computeGeometry)==null||d.call(c,{...t,thickness:i,cPadRatio:s,borderRadius:l,showSeriesCount:n,showIndex:a}),c.show&&a++)})}drawSeriesLayer(t,n){var p;const{maxTip:i,selectLabel:s,selectItem:l,selectSeries:a,brush:r,displayOverflow:c,unSelectedOpacity:d}=this.options,h={ctx:t,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,maxTipOpt:{background:i.background,color:i.color},selectLabel:{option:s,selected:this.defaultSelectInfo},selectSeries:{option:a,selected:this.defaultSelectInfo},selectItem:{option:l,selected:this.defaultSelectItemInfo},isBrush:!!r,displayOverflow:c,unSelectedOpacity:d,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion,rtXOffsetCss:this._blitCarry};let u=0,f=0;this.seriesInfo.charts.bar.forEach(y=>{this.seriesList[y].show&&f++});const m=new Map,g=Object.keys(this.seriesInfo.charts);for(let y=0;y<g.length;y++){const C=g[y],b=this.seriesInfo.charts[C];let k=!1;C==="scatter"&&(k=this.options.coordinateDedupe!==!1&&!this.canSkipRealtimeScatterDedupe(b),k&&this.collectDuplicatePoints(m,b));for(let L=0;L<b.length;L++){let w=this.seriesList[b[L]];switch(C){case"line":{const M=n==null?void 0:n.legend;w.draw({legendHitInfo:M,...h});break}case"heatMap":{const M=n==null?void 0:n.legend;w.draw({legendHitInfo:M,...h});break}case"bar":{const M=n==null?void 0:n.legend,{thickness:V,cPadRatio:S,borderRadius:x}=this.options;w.draw({thickness:V,cPadRatio:S,borderRadius:x,showSeriesCount:f,showIndex:u,legendHitInfo:M,...h}),w.show&&u++;break}case"pie":{const M=this.lastHitInfo??{sId:(p=this.defaultSelectItemInfo)==null?void 0:p.seriesID},V=n==null?void 0:n.legend;this.options.sunburst?this.drawSunburst({selectInfo:M,legendHitInfo:V,unSelectedOpacity:h.unSelectedOpacity},t):this.drawPie({selectInfo:M,legendHitInfo:V,unSelectedOpacity:h.unSelectedOpacity},t),this.options.doughnutHoleSize>0&&this.drawDoughnutHole(t);break}case"scatter":{const M=n==null?void 0:n.legend;let V;if(l.use&&l.useSeriesOpacity){const S=this.lastHitInfo,x=this.defaultSelectItemInfo;S!=null&&S.dataIndex||(S==null?void 0:S.dataIndex)===0?V={seriesID:S.sId,dataIndex:S.dataIndex}:x!=null&&x.dataIndex||(x==null?void 0:x.dataIndex)===0?V={...x}:V=null}this.options.seriesReverse&&(w=this.seriesList[b.at(-1-L)]),w.draw({legendHitInfo:M,selectInfo:V,duple:m,coordinateDedupe:k,...h});break}}}}}drawSeriesOverlay(){var s,l;const t=this.overlayCtx;if(!t)return;const n={overlayCtx:t,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps},i=this.seriesInfo.charts.heatMap;for(let a=0;a<i.length;a++)(l=(s=this.seriesList[i[a]])==null?void 0:s.drawOverlay)==null||l.call(s,n)}ensureAnnotationCanvas(){if(this.annotationCtx)return!0;if(this.options.brush||!this.chartDOM||!this.displayCanvas)return!1;const t=this.options.type==="pie";return this.annotationCanvas=document.createElement("canvas"),this.annotationCanvas.setAttribute("style","display: block; z-index: 3;"),this.annotationCanvas.setAttribute("class","annotation-canvas"),this.annotationCtx=this.annotationCanvas.getContext("2d",{willReadFrequently:t}),this.chartDOM.appendChild(this.annotationCanvas),this.annotationCanvas.style.position="absolute",this.annotationCanvas.style.top="0px",this.annotationCanvas.style.left="0px",this.annotationCanvas.style.pointerEvents="none",this.annotationCanvas.width=this.displayCanvas.width,this.annotationCanvas.style.width=this.displayCanvas.style.width,this.annotationCanvas.height=this.displayCanvas.height,this.annotationCanvas.style.height=this.displayCanvas.style.height,this.annotationCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),!0}drawAnnotationLayer(){var l;const t=(l=this.options)==null?void 0:l.annotations;if(!(Array.isArray(t)&&t.length>0)){if(this._hadAnnotations&&this.annotationCtx){const a=this.pixelRatio<1?this.pixelRatio:1;this.annotationCtx.clearRect(0,0,this.annotationCanvas.width/a,this.annotationCanvas.height/a),this._hadAnnotations=!1}return}if(!this.ensureAnnotationCanvas())return;const i=this.annotationCtx,s=this.pixelRatio<1?this.pixelRatio:1;if(i.clearRect(0,0,this.annotationCanvas.width/s,this.annotationCanvas.height/s),this._hadAnnotations=!0,this._annotationSource!==t){const{annotations:a,warnings:r}=fk(t);this._normalizedAnnotations=a,this._annotationSource=t,r.forEach(c=>ye.warn(c))}Wk(i,this._normalizedAnnotations,this.buildAnnotationViewport())}buildAnnotationViewport(){var a,r,c,d,h;const t=(a=this.data)==null?void 0:a.labels,n=t&&!Array.isArray(t)&&typeof t=="object",i=n?t.x:t,s=n?t.y:t,l=(u,f,m)=>(u??[]).map((g,p)=>{var y;return{...g,type:((y=f==null?void 0:f[p])==null?void 0:y.type)||"linear",labels:m}});return{chartRect:this.chartRect,labelOffset:this.labelOffset,axes:{x:l((r=this.axesSteps)==null?void 0:r.x,(c=this.options)==null?void 0:c.axesX,i),y:l((d=this.axesSteps)==null?void 0:d.y,(h=this.options)==null?void 0:h.axesY,s)},seriesList:this.seriesList}}drawTip(t){var i;let n;this.lastHitInfo?n=this.lastHitInfo:this.defaultSelectItemInfo?n=this.getItem(this.defaultSelectItemInfo,!1):this.defaultSelectInfo&&this.options.selectLabel.use?n=this.getItem(this.defaultSelectInfo,!1):n=null,(i=this.drawTips)==null||i.call(this,n,t)}createAxes(t,n=[]){const i=this.bufferCtx,l=this.options.type==="heatMap"?this.data.labels[t]:this.data.labels,a=this.options;return n.map(r=>{switch(r.type){case"linear":return new p1(t,r,i,a);case"time":return r.categoryMode?new y1(t,r,i,l,a):new m1(t,r,i,a);case"log":return new g1(t,r,i);case"step":return new b1(t,r,i,l,a);default:return!1}})}getAxesRange(){const t=this.axesX.map((i,s)=>i.calculateScaleRange(this.minMax.x[s],this.scrollbar.x,this.chartRect)),n=this.axesY.map((i,s)=>i.calculateScaleRange(this.minMax.y[s],this.scrollbar.y,this.chartRect));return{x:t,y:n}}drawStaticLayer(t,n){var i;this.axesX.forEach((s,l)=>{s.ctx=t,s.draw(this.chartRect,this.labelOffset,this.axesSteps.x[l],n,this.defaultSelectInfo,this.data.labels)}),this.axesY.forEach((s,l)=>{s.ctx=t,s.draw(this.chartRect,this.labelOffset,this.axesSteps.y[l],n,this.defaultSelectInfo)}),((i=this.options.plot)==null?void 0:i.aboveSeries)===!1&&this.drawPlotsFront(t)}drawPlotsFront(t=this.bufferCtx){this.plotLabelHitRegions=[],[...this.axesX??[],...this.axesY??[]].forEach(n=>{var i,s;n.ctx=t,(i=n.drawPlots)==null||i.call(n),(s=n.plotLabelHitRegions)!=null&&s.length&&this.plotLabelHitRegions.push(...n.plotLabelHitRegions)})}drawForeground(t=this.bufferCtx){var n;((n=this.options.plot)==null?void 0:n.aboveSeries)!==!1&&this.drawPlotsFront(t),this.drawTip(t)}calculateSteps(){const t=this.axesX.map((i,s)=>{const l={minValue:this.axesRange.x[s].min,maxValue:this.axesRange.x[s].max,minIndex:this.axesRange.x[s].minIndex,maxIndex:this.axesRange.x[s].maxIndex,minSteps:this.labelRange.x[s].min,maxSteps:this.labelRange.x[s].max};return i.calculateSteps(l)}),n=this.axesY.map((i,s)=>{const l={minValue:this.axesRange.y[s].min,maxValue:this.axesRange.y[s].max,minIndex:this.axesRange.y[s].minIndex,maxIndex:this.axesRange.y[s].maxIndex,minSteps:this.labelRange.y[s].min,maxSteps:this.labelRange.y[s].max};return i.calculateSteps(l)});return{x:t,y:n}}getAxesLabelRange(){const t=this.axesX.map((i,s)=>{const l=this.axesRange.x[s].size;return i.calculateLabelRange("x",this.chartRect,this.labelOffset,l.width)}),n=this.axesY.map((i,s)=>{const l=this.axesRange.y[s].size;return i.calculateLabelRange("y",this.chartRect,this.labelOffset,l.height)});return{x:t,y:n}}computePixelRatio(){const t=window.devicePixelRatio||1,n=this.displayCtx.webkitBackingStorePixelRatio||this.displayCtx.mozBackingStorePixelRatio||this.displayCtx.msBackingStorePixelRatio||this.displayCtx.oBackingStorePixelRatio||this.displayCtx.backingStorePixelRatio||1;return t/n}prepareLayout(t){this.pixelRatio=t,this.oldPixelRatio!==this.pixelRatio&&(this.oldPixelRatio=this.pixelRatio),this.bufferCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}initScale(){const t=this.computePixelRatio();this.prepareLayout(t),this.overlayCtx&&this.overlayCtx.setTransform(t,0,0,t,0,0),this.annotationCtx&&this.annotationCtx.setTransform(t,0,0,t,0,0)}getChartDOMRect(){var s;const t=(s=this.chartDOM)==null?void 0:s.getBoundingClientRect(),n=(t==null?void 0:t.width)||10,i=(t==null?void 0:t.height)||10;return this.setWidth(n),this.setHeight(i),{width:n,height:i}}getOverlayClientRect(){return!this.cachedOverlayRect&&this.overlayCanvas&&(this.cachedOverlayRect=this.overlayCanvas.getBoundingClientRect()),this.cachedOverlayRect}getChartDOMClientRect(){return!this.cachedChartDOMRect&&this.chartDOM&&(this.cachedChartDOMRect=this.chartDOM.getBoundingClientRect()),this.cachedChartDOMRect}invalidateClientRectCache(){this.cachedOverlayRect=null,this.cachedChartDOMRect=null}getChartRect(){var w,M,V,S;const{width:t,height:n}=this.getChartDOMRect(),i=this.options.padding,s=(M=(w=this.options.axesX)==null?void 0:w[0])==null?void 0:M.title,l=(S=(V=this.options.axesY)==null?void 0:V[0])==null?void 0:S.title,a=10;let r=0;s!=null&&s.use&&(s!=null&&s.text)&&(r=(isNaN(s==null?void 0:s.fontSize)?12:s==null?void 0:s.fontSize)+a);let c=0;l!=null&&l.use&&(l!=null&&l.text)&&(c=(isNaN(l==null?void 0:l.fontSize)?12:l==null?void 0:l.fontSize)+a);const d=this.scrollbar.x,h=this.scrollbar.y;let u=0;d!=null&&d.use&&(u=d==null?void 0:d.height);let f=0;h!=null&&h.use&&(f=h==null?void 0:h.width);const m=i.left+i.right+f,g=i.top+i.bottom+r+c+u,p=t>m?t-m:t,y=n>g?n-g:n,C=i.left,b=Math.max(t-i.right-f,C+2),k=i.top+c,L=Math.max(n-i.bottom-r-u,k+2);return{x1:C,x2:b,y1:k,y2:L,chartWidth:p,chartHeight:y,width:t,height:n}}setWidth(t){var i;if(!this.displayCanvas)return;const n=t*this.pixelRatio;this._deviceWidth!==n&&(this._deviceWidth=n,this.displayCanvas.width=n,this.displayCanvas.style.width=`${t}px`,this.bufferCanvas.width=n,this.bufferCanvas.style.width=`${t}px`,this.overlayCanvas&&(this.overlayCanvas.width=n,this.overlayCanvas.style.width=`${t}px`),this.annotationCanvas&&(this.annotationCanvas.width=n,this.annotationCanvas.style.width=`${t}px`),(i=this.pointsLayers)!=null&&i.size&&this.resizePointsLayers(this.bufferCanvas.width,this.bufferCanvas.height)&&(this.pointsLayerValid=!1))}setHeight(t){var i;if(!this.displayCanvas)return;const n=t*this.pixelRatio;this._deviceHeight!==n&&(this._deviceHeight=n,this.displayCanvas.height=n,this.displayCanvas.style.height=`${t}px`,this.bufferCanvas.height=n,this.bufferCanvas.style.height=`${t}px`,this.overlayCanvas&&(this.overlayCanvas.height=n,this.overlayCanvas.style.height=`${t}px`),this.annotationCanvas&&(this.annotationCanvas.height=n,this.annotationCanvas.style.height=`${t}px`),(i=this.pointsLayers)!=null&&i.size&&this.resizePointsLayers(this.bufferCanvas.width,this.bufferCanvas.height)&&(this.pointsLayerValid=!1))}getLabelOffset(t=null){const n=this.axesX,i=this.axesY,s=t??this.axesRange,l={top:2,left:2,right:2,bottom:2},a={width:14,height:4};let r=0,c=0;return n.forEach((d,h)=>{var u;(u=d.labelStyle)!=null&&u.show&&(r=s.x[h].size.width+a.width,c=s.x[h].size.height+a.height,d.position==="bottom"?c>l.bottom&&(l.bottom=c):d.position==="top"&&c>l.top&&(l.top=c),l.left=r/2>l.left?r/2:l.left,l.right=r/2>l.right?r/2:l.right)}),i.forEach((d,h)=>{var u;(u=d.labelStyle)!=null&&u.show&&(r=s.y[h].size.width+a.width,d.position==="left"?r>l.left&&(l.left=r):d.position==="right"&&r>l.right&&(l.right=r),l.top=c/2>l.top?c/2:l.top,l.bottom=c/2>l.bottom?c/2:l.bottom)}),l}updateScrollbar(t,n){var c,d,h,u,f,m,g,p,y,C;const i=n||t,s=((h=(d=(c=this.options.axesX)==null?void 0:c[0])==null?void 0:d.scrollbar)==null?void 0:h.use)??!1,l=((m=(f=(u=this.options.axesY)==null?void 0:u[0])==null?void 0:f.scrollbar)==null?void 0:m.use)??!1,a=((p=(g=this.scrollbar)==null?void 0:g.x)==null?void 0:p.use)??!1,r=((C=(y=this.scrollbar)==null?void 0:y.y)==null?void 0:C.use)??!1;(s!==a||s||i&&s)&&this.updateScrollbarInfo("x",t),(l!==r||l||i&&l)&&this.updateScrollbarInfo("y",t)}update(t){var y,C,b,k,L,w,M;const n=this.options,i=this.data.data,s=this.data.labels,l=this.data.groups,a=this.data.series,{updateSeries:r,updateSelTip:c,updateLegend:d,updateData:h,updateTooltip:u,lightUpdate:f,updateByScrollbar:m}=t;if(!this.isInit)return;if((h||r)&&(this._lastHoverSig=""),this.updateScrollbar(h,m),this.resetProps(),this.updateSeries=r,r&&(this.pointsLayerValid=!1),(y=this.options.realTimeScatter)!=null&&y.use&&this.createPointsLayers(),r){const V=this.seriesList;this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.lastTip={pos:null,value:null},this.reconcileSeriesSet(a,n.type,n.horizontal,l,V),this.legendDOM&&!n.legend.external&&this.updateLegend()}if(c.update&&(this.lastTip.value=null,c.keepDomain||(this.lastTip.pos=null,this.lastHitInfo=null)),!f)if(l.length&&this.addGroupInfo(l),(C=this.options.realTimeScatter)!=null&&C.use?(this.dataSet||(this.dataSet={}),this.createRealTimeScatterDataSet(i)):this.createDataSet(i,s),n.title.show?(this.isInitTitle?this.updateTitle():this.initTitle(),this.showTitle()):this.isInitTitle&&this.hideTitle(),n.legend.show&&!n.legend.external){const V=!!((k=(b=n.legend)==null?void 0:b.table)!=null&&k.use)&&n.type!=="heatMap"&&n.type!=="scatter";this.isInitLegend?r?this.updateLegend():d?this.forceUpdateLegend():V&&h&&this.updateLegendTableValues():this.initLegend(),this.setLegendPosition(),this.updateLegendContainerSize(),this.showLegend()}else n.legend.show&&n.legend.external?(r||h)&&(this._updateSeriesCount(),this.emitLegendData()):this.isInitLegend&&this.hideLegend();u&&(this.isInitTooltip||this.createTooltipDOM(),this.tooltipDOM.innerHTML="",(w=(L=n.tooltip)==null?void 0:L.formatter)!=null&&w.html||this.setDefaultTooltipLayout()),this.minMax=this.getStoreMinMax(),this.axesX=this.createAxes("x",n.axesX),this.axesY=this.createAxes("y",n.axesY),this.initDefaultSelectInfo();let g=t==null?void 0:t.hitInfo;!(g!=null&&g.legend)&&((M=this.legendHover)!=null&&M.sId)&&(g={...g||{},legend:this.legendHover}),this.render(g),this.dragDisplayCanvas&&this.refreshDragDisplayCanvas(),this.dragInfo&&this.drawSelectionArea?this.drawSelectionArea(this.dragInfo):this.dragInfoBackup&&(f?this.drawSelectionArea(this.dragInfoBackup):this.dragInfoBackup=null)}resetProps(){this.axesX[0]=null,this.axesY[0]=null,this.axesX=null,this.axesY=null,this.minMax=null,this.axesRange=null,this.labelOffset=null,this.chartRect=null}overlayClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}clear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.bufferCanvas&&this.bufferCtx.clearRect(0,0,this.bufferCanvas.width/this.clearRectRatio,this.bufferCanvas.height/this.clearRectRatio),this.overlayCanvas&&this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}resize(t){var n,i,s,l,a,r,c;this.invalidateClientRectCache(),this.clear(),this.bufferCtx.restore(),this.bufferCtx.save(),this.pointsLayerValid=!1,((s=(i=(n=this.options.axesX)==null?void 0:n[0])==null?void 0:i.scrollbar)!=null&&s.use||(r=(a=(l=this.options.axesY)==null?void 0:l[0])==null?void 0:a.scrollbar)!=null&&r.use)&&this.initScrollbar(),this.initRect(),this.initScale(),this.chartRect=this.getChartRect(),this.drawChart(void 0,!0),this.dragDisplayCanvas&&this.refreshDragDisplayCanvas(),this.dragInfoBackup&&((c=this.drawSelectionArea)==null||c.call(this,this.dragInfoBackup)),t&&t(!0)}render(t){this.isInit&&(this.invalidateClientRectCache(),this._vsDetectFailed=!1,this.clear(),this.chartRect=this.getChartRect(),this.drawChart(t))}_getLegendSeries(){var n;const t=(n=this.data.groups)==null?void 0:n.at(0);return t?t.filter(i=>{var s;return(s=this.seriesList[i])==null?void 0:s.showLegend}).map(i=>[i,this.seriesList[i]]):Object.entries(this.seriesList).filter(([,i])=>i.showLegend)}_seriesToLegendItem(t){const n=typeof t.color!="string"?t.color[t.color.length-1][1]:t.color;return{sId:t.sId,name:t.name,color:n,type:t.type,show:t.show,fill:t.fill,fillColor:t.fillColor}}buildLegendData(){return this._getLegendSeries().map(([,t])=>this._seriesToLegendItem(t))}emitLegendData(){typeof this.listeners["update:legendData"]=="function"&&this.listeners["update:legendData"](this.buildLegendData())}toggleSeries(t){var d;const n=this.seriesList[t];if(!n)return;const i=this.options.legend,s=this._getLegendSeries();if(i.clickMode==="active")s.every(([,f])=>f.show)?(s.forEach(([,f])=>{f.show=!1}),n.show=!0,this.seriesInfo.count=1):n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++),s.every(([,f])=>!f.show)&&(s.forEach(([,f])=>{f.show=!0}),this.seriesInfo.count=s.length);else{if(n.show&&this.seriesInfo.count===1)return;n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++)}if(this.brushSeries){const{chartIdx:h}=this.data,u=[...this.brushSeries.list];u[h]=this.seriesList,this.brushSeries.list=u,this.brushSeries.chartIdx=h}((d=this.options.eventBehavior)==null?void 0:d.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const a=Object.values(this.seriesList).filter(h=>h.show).map(h=>h.sId),r=a.length===Object.values(this.seriesList).length,c={data:{seriesIds:r?[]:a,isActiveAll:r}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](c),this.options.legend.show&&this.options.legend.external&&this.emitLegendData()}highlightSeries(t){const n={sId:t,type:this.options.type};this.legendHover=n,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:n},lightUpdate:!0})}unhighlightSeries(){this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})}destroy(){var n,i;if(!this.isInit)return;const t=this.target;for(this.options.legend.show&&!this.options.legend.external&&(this.legendBoxDOM&&(this.legendBoxDOM.removeEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.removeEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.removeEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.type==="gradient"&&this.legendBoxDOM.removeEventListener("mousedown",this.onLegendMouseDown),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.removeEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.removeEventListener("scroll",this.renderVisibleLegends))),this.resizeDOM&&this.resizeDOM.removeEventListener("mousedown",this.onResizeMouseDown)),this.overlayCanvas&&(this.overlayCanvas.removeEventListener("mousemove",this.onMouseMove),this.overlayCanvas.removeEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.removeEventListener("dblclick",this.onDblClick),this.overlayCanvas.removeEventListener("click",this.onClick),(n=this.dragStartTarget)==null||n.removeEventListener("mousedown",this.onMouseDown),this.overlayCanvas.removeEventListener("wheel",this.onWheel),window.removeEventListener("click",this.dragTouchSelectionEvent),this.invalidateRectOnScroll&&window.removeEventListener("scroll",this.invalidateRectOnScroll,{capture:!0}),this.dragDisplayCanvas&&((i=this.dragDisplayCanvas.parentNode)==null||i.removeChild(this.dragDisplayCanvas),this.dragDisplayCanvas=null,this.dragDisplayCtx=null,this.dragDisplayOffset=null),this.dragStartTarget&&this.dragStartAreaPrevPosition!==void 0&&(this.dragStartTarget.style.position=this.dragStartAreaPrevPosition,this.dragStartAreaPrevPosition=void 0)),this.isInitTooltip&&this.tooltipDestroy(),this.renderWorkerGate&&this.renderWorkerGate.destroy(),this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),this.wrapperDOM=null,this.chartDOM=null,this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.ghostDOM=null,this.titleDOM=null,this.displayCanvas=null,this.bufferCanvas=null,this.overlayCanvas=null,this.annotationCanvas=null,this.annotationCtx=null,this._normalizedAnnotations=null,this._annotationSource=null,this._hadAnnotations=!1;t.hasChildNodes();)t.removeChild(t.firstChild)}hideTooltip(){var t;this.options.tooltip.use&&((t=this.tooltipDOM)!=null&&t.style)&&(this.tooltipDOM.style.display="none")}initDefaultSelectInfo(){var s,l;const{type:t,selectLabel:n,selectSeries:i}=this.options;if(n.use){let a=null;t==="heatMap"&&(n!=null&&n.useBothAxis)&&(a=(s=this.defaultSelectInfo)==null?void 0:s.targetAxis),this.defaultSelectInfo=(l=this.defaultSelectInfo)!=null&&l.dataIndex?this.getSelectedLabelInfoWithLabelData(this.defaultSelectInfo.dataIndex,a):{dataIndex:[],label:[],data:[]}}i.use&&!this.defaultSelectInfo&&(this.defaultSelectInfo={seriesId:[]})}};Object.assign(vs.prototype,B1),Object.assign(vs.prototype,O1);const Zk={name:"EvChartToolbar",props:{toolbar:{type:Object,default:()=>({})}},emits:["onClickToolbar"]},Xk={class:"ev-chart-toolbar"},Nk={class:"ev-chart-toolbar__icon"};function Pk(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",Xk,[o.createElementVNode("div",Nk,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.$props.toolbar.items,(r,c)=>(o.openBlock(),o.createBlock(a,{key:`${c}-${r.icon}`,class:o.normalizeClass(c),icon:r.icon,size:r.size,title:r.title,onClick:d=>e.$emit("onClickToolbar",d,c)},null,8,["class","icon","size","title","onClick"]))),128))])])}const Nc=ce(Zk,[["render",Pk],["__scopeId","data-v-dfbffbab"]]);class Dk{constructor(t,n,i,s,l,a,r){this.isExecuteZoom=l,this.evChartProps=t.props,this.evChartCloneData=n.data,this.brushIdx=a;const c=i.zoom;this.setEvChartZoomOptions(c),this.setIcon(s);const d=n.data[0].labels.length-1;this.cloneLabelsLastIdx=d,this.isAnimationFinish=!0,this.zoomAreaMemory={previous:[],current:[[0,d]],latest:[]},r&&(this.emitFunc=r,r.updateZoomStartIdx(0),r.updateZoomEndIdx(d)),c.useWheelMove&&(this.wrapWheelMoveZoomArea=this.wheelMoveZoomArea.bind(this)),this.evChartDomContainers=c.useAnimation?this.drawAnimationCanvas(t.dom):t.dom}setEvChartZoomOptions(t){this.evChartZoomOptions=t}setIcon(t){if(!t)return;const n=t.querySelector(".dragZoom");this.resetIcon=t.querySelector(".reset"),this.previousIcon=t.querySelector(".previous"),this.latestIcon=t.querySelector(".latest"),this.dragZoomIcon=n,this.iconStyle(n,"enable")}drawAnimationCanvas(t){return t.forEach(n=>{const i=document.createElement("canvas");i.setAttribute("style","display: block;"),i.setAttribute("class","animation-canvas"),i.style.position="absolute",n.appendChild(i)}),t}setEventListener(t){const n=t?"addEventListener":"removeEventListener";this.isUseZoomMode=t,this.evChartDomContainers.forEach(i=>{i[n]("wheel",this.wrapWheelMoveZoomArea)})}wheelMoveZoomArea(t){t.preventDefault();const[n,i]=this.zoomAreaMemory.current[0];if(n===i)return;let s,l;if(t.deltaY>0){if(!n)return;s=n-1,l=i-1}else{if(i===this.cloneLabelsLastIdx)return;s=n+1,l=i+1}this.isUseToolbar=!0,this.executeZoom(s,l),this.zoomAreaMemory.current[0]=[s,l]}clickMoveZoomArea(t){if(!this.zoomAreaMemory[t].length)return;const[n,i]=this.zoomAreaMemory[t].pop();this.isUseToolbar=!0,this.executeZoom(n,i),this.setZoomAreaMemory(n,i,t==="previous"?"latest":"previous")}dragZoom({data:t,range:{dragSelectionInfo:n}}){const{dragXsp:i,dragXep:s,exceptAxesYChartWidth:l,chartTitle:a}=n,{options:r,data:c}=this.evChartProps,d=r.length>1?r.findIndex(h=>{var u;return(((u=h==null?void 0:h.title)==null?void 0:u.text)??"")===a}):0;if(r[d].axesX[0].type==="time"){const h=t[0].items,u=h[0].x,f=h[h.length-1].x,m=c[d].labels,g=this.evChartCloneData[d].labels,[p,y]=this.zoomAreaMemory.current[0];let C=g.findIndex(M=>+M.$d==+u.$d),b=g.findLastIndex(M=>+M.$d==+f.$d);const k=M=>l/(m.length-1)*(M-p);let L=k(C);if(C===b&&(L-i>=s-L?C-=1:b+=1),C===p&&b===y)return;C-b===-1&&(L=k(C));const w=k(b);this.evChartZoomOptions.useAnimation?this.dragZoomAnimation(n,C,b,L,w):(this.executeZoom(C,b),this.setZoomAreaMemory(C,b))}}dragZoomAnimation(t,n,i,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=t,d=window.devicePixelRatio||1,h=Array.from(this.evChartDomContainers).map(u=>{const f=u.querySelector(".animation-canvas");return[u.children[0],f]});for(let u=0;u<h.length;u++){const[f,m]=h[u],g=m.getContext("2d");m.style.top=`${a.y1}px`,m.style.left=`${a.x1}px`,m.width=r*d,m.style.width=`${r}px`,m.height=c*d,m.style.height=`${c}px`,m.style.display==="none"&&(m.style.display="block"),this.isAnimationFinish=!1,this.isUseToolbar=!0,this.executeDragZoomAnimation(f,g,t,s,l).then(p=>{m.style.display="none",p&&u===h.length-1&&(this.isAnimationFinish=p,this.executeZoom(n,i),this.setZoomAreaMemory(n,i))})}}executeZoom(t,n){this.isExecuteZoom&&(this.isExecuteZoom.value=!0);for(let i=0;i<this.evChartCloneData.length;i++){const{data:s,labels:l,series:a}=this.evChartCloneData[i],r=this.evChartProps.data[i],c=Object.keys(a);for(let d=0;d<c.length;d++){const h=c[d];r.data[h]=s[h].filter((u,f)=>t<=f&&n>=f)}r.labels=l.filter((d,h)=>t<=h&&n>=h)}!this.brushIdx.isUseButton&&!this.brushIdx.isUseScroll&&(this.brushIdx.start=t,this.brushIdx.end=n),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(t),this.emitFunc.updateZoomEndIdx(n))}setBrushIdx(t,n){this.brushIdx.end=-1;for(let i=0;i<n.value.length;i++){const s=t.data[n.value[i]];s.labels.length&&(this.brushIdx.start=0,this.brushIdx.end=s.labels.length-1)}}updateEvChartCloneData(t,n,i,s){const l=t.data[0].labels.length-1;if(this.cloneLabelsLastIdx=l,this.evChartCloneData=t.data,s){const a=this.zoomAreaMemory.current[0];let r=a[0],c=a[1];r===0&&c===-1&&(r=0,c=l,this.zoomAreaMemory={previous:[],current:[[r,c]],latest:[]}),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(r),this.emitFunc.updateZoomEndIdx(c)),this.executeZoom(r,c)}else this.dragZoomIcon&&this.dragZoomIcon.classList.remove("active"),this.zoomAreaMemory={previous:[],current:[[0,l]],latest:[]},this.emitFunc&&(this.emitFunc.updateZoomStartIdx(0),this.emitFunc.updateZoomEndIdx(l)),this.setIconStyle(i),this.setBrushIdx(t,n)}setZoomAreaMemory(t,n,i){if(t<0||n<=0)return;const{previous:s,current:l,latest:a}=this.zoomAreaMemory,r=l.pop(),{bufferMemoryCnt:c}=this.evChartZoomOptions;i?(s.length>=c&&s.splice(0,s.length-c+1),this.zoomAreaMemory[i].push(r)):(t!==r[0]||n!==r[1])&&(r[0]===0&&r[1]===-1?s.push([0,this.cloneLabelsLastIdx]):s.push(r),a.length=0),l.push([t,n]),this.setIconStyle(this.isUseZoomMode)}executeDragZoomAnimation(t,n,i,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=i;let d=0,h=s,u=l-s,f=l,m=1;const g=.0015;let p=.5;const y=.1,C=.05,b=50,k=Math.ceil(b*(s/r)),L=Math.ceil(b*((r-l)/r)),w=M=>(n.clearRect(0,0,r,c),h<=0&&u>=r?(t.style.opacity="initial",M(!0)):(p>=y&&(t.style.opacity=p,p-=C),n.globalAlpha=m,n.drawImage(t,a.x1,a.y1,s,c,d,0,s,c),n.drawImage(t,a.x1+s,a.y1,l-s,c,h,0,u,c),n.drawImage(t,a.x1+l,a.y1,r,c,f,0,r,c),m-=g,d-=k,h-=k,u+=k+L,f+=L,requestAnimationFrame(()=>w(M))));return new Promise(M=>w(M))}setIconStyle(t){const n=(i,s)=>{s?this.iconStyle(i,"enable"):this.iconStyle(i,"disable")};if(t&&this.dragZoomIcon.classList.contains("active")){const{previous:i,latest:s}=this.zoomAreaMemory;n(this.previousIcon,i.length),n(this.latestIcon,s.length),this.iconStyle(this.resetIcon,"enable")}else n(this.resetIcon),n(this.previousIcon),n(this.latestIcon)}iconStyle(t,n){if(!t)return;const[i,s]=n==="enable"?[1,"initial"]:[.5,"none"];t.style.opacity=i,t.style.pointerEvents=s}initZoom(){if(!this.isAnimationFinish)return;const[t,n]=this.zoomAreaMemory.current[0],i=this.cloneLabelsLastIdx;(t!==0||n!==i)&&(this.isUseToolbar=!0,this.executeZoom(0,i),this.setZoomAreaMemory(0,i))}}const Bk={padding:{top:20,right:2,left:2,bottom:4},border:2,title:{show:!1,height:40,text:"",style:{fontSize:15,color:"#000",fontFamily:"Roboto"}},legend:{show:!0,type:"icon",position:"right",color:"#353740",inactive:"#aaa",width:140,height:24,allowResize:!1,virtualScroll:!1,clickMode:"active",external:!1,table:{use:!1,columns:{name:{title:"Name"},min:{title:"MIN",use:!1},max:{title:"MAX",use:!1},avg:{title:"AVG",use:!1},total:{title:"TOTAL",use:!1},last:{title:"LAST",use:!1}}}},itemHighlight:!0,seriesHighlight:!0,unSelectedOpacity:.3,useSelect:!1,doughnutHoleSize:0,pieStroke:{use:!0,lineWidth:2,color:"#FFFFFF"},reverse:!1,horizontal:!1,displayOverflow:!1,overlapping:{use:!1},width:"100%",height:"100%",thickness:1,cPadRatio:0,borderRadius:0,combo:!1,tooltip:{use:!0,sortByValue:!0,backgroundColor:"#4C4C4C",fontColor:"#FFFFFF",borderColor:"#666666",shadowOpacity:.25,useShadow:!1,throttledMove:!0,debouncedHide:!1,useScrollbar:!1,textOverflow:"wrap",fontFamily:"Roboto",colorShape:"rect",fontSize:{title:16,contents:14},rowPadding:{top:0,bottom:3,right:20,left:16},showHeader:!0,virtualScroll:{use:"auto",threshold:50,estimatedRowHeight:28,overscan:5}},indicator:{use:!0,color:"#EE7F44",segments:null},plot:{aboveSeries:!0},maxTip:{use:!1,fixedPosTop:!1,showIndicator:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400}},selectItem:{use:!1,useClick:!0,showTextTip:!1,tipText:"value",showTip:!1,showIndicator:!1,fixedPosTop:!1,useApproximateValue:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},useSeriesOpacity:!1,useDeselectItem:!1,showBorder:!1,borderStyle:{color:"#FFFFFF",lineWidth:1,opacity:1,radius:0}},selectLabel:{use:!1,useClick:!0,tipText:"value",limit:1,useDeselectOverflow:!1,showTip:!1,useSeriesOpacity:!0,useLabelOpacity:!0,fixedPosTop:!1,useApproximateValue:!1,tipBackground:"#000000",indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},showTextTip:!1,showIndicator:!1,useBothAxis:!1},selectSeries:{use:!1,useClick:!0,limit:1,useDeselectOverflow:!1},dragSelection:{use:!1,keepDisplay:!0,size:50,fillColor:"#38ACEC",opacity:.65,startArea:"",displayFromStartArea:!1},zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}},heatMapColor:{min:"#FFFFFF",max:"#0052FF",rangeCount:1,colorsByRange:[],stroke:{show:!1,color:"#FFFFFF",lineWidth:1,opacity:1,radius:0},error:"#FF0000",decimalPoint:0},seriesReverse:!1,coordinateDedupe:!0,eventBehavior:{legendClick:"update"},workerRender:!1,shallowDataWatch:!1,shallowOptionsWatch:!1},Ok={series:{},groups:[],labels:[],data:{}},Yk=e=>Vb({...e},Ok),Fk=e=>e instanceof Date||e!==null&&typeof e=="object"&&typeof e.toDate=="function"&&typeof e.format=="function",pl=e=>Mr(e,function t(n){if(Fk(n))return n;if(o.isReactive(n))return Mr(o.toRaw(n),t)}),zk=(e,t)=>{if(!e)return t.data;const n=t.data??{},i={};return Object.keys(n).forEach(s=>{var l;i[s]=(l=e[s])!=null&&l.length?e[s].concat(n[s]??[]):n[s]}),Object.keys(e).forEach(s=>{var l;!(s in i)&&((l=t.series)!=null&&l[s])&&(i[s]=e[s])}),i},Hk=()=>{let e=null;const t=200;return{clickEventCallback:s=>{e&&(clearTimeout(e),e=null),e=setTimeout(()=>{s(),e=null},t)},dblClickEventCallback:s=>{e&&(clearTimeout(e),e=null),s()}}},Pc=(e,t)=>{var m;const n=o.getCurrentInstance(),{props:i,emit:s}=n,l=g=>{const p=Pe({},g,Bk);return(g.type==="scatter"||g.type==="heatMap")&&!(g!=null&&g.tooltip)&&(p.tooltip.use=!1),g.type==="pie"&&!(g!=null&&g.padding)&&(p.padding={top:2,right:2,left:2,bottom:4}),p},a=Yk,r=Ve(i.selectedItem),c=Ve(i.selectedLabel??(e==null?void 0:e.value)),d=Ve(i.selectedSeries),{clickEventCallback:h,dblClickEventCallback:u}=Hk(),f={click:async g=>{await o.nextTick(),h(()=>{const{seriesId:p,dataIndex:y,eventTarget:C,targetAxis:b}=(g==null?void 0:g.selected)??{},{eventTarget:k}=(g==null?void 0:g.deselected)??{};switch(C){case"item":{p!==null?(s("update:selectedItem",{seriesID:p,dataIndex:y}),k==="label"&&s("update:selectedLabel",{dataIndex:[]})):s("update:selectedItem",null);break}case"label":{e!=null&&e.value?e.value.dataIndex=y:(s("update:selectedLabel",{dataIndex:y,targetAxis:b}),k==="item"&&s("update:selectedItem",null));break}case"series":{s("update:selectedSeries",{seriesId:p});break}}s("click",g)})},"dbl-click":async g=>{await o.nextTick(),u(()=>{const{eventTarget:p}=g;switch(p){case"series":{s("update:selectedSeries",{seriesId:g.seriesId?[g.seriesId]:[]});break}}s("dbl-click",g)})},"drag-select":async g=>{await o.nextTick(),s("drag-select",g)},"mouse-move":async g=>{t!=null&&t.value&&(t.value=g.hoveredLabel),await o.nextTick(),s("mouse-move",g)},"mouse-leave":()=>{t!=null&&t.value&&(t.value.label=null)},"click-legend":async g=>{await o.nextTick(),s("click-legend",g)},"update:legendData":async g=>{await o.nextTick(),s("update:legendData",g)},"axes-scale-change":g=>{s("axes-scale-change",g)}};return(m=n.vnode.props)!=null&&m.onAxesDataMaxChange&&(f["axes-data-max-change"]=g=>{s("axes-data-max-change",g)}),{eventListeners:f,selectItemInfo:r,selectLabelInfo:c,selectSeriesInfo:d,getNormalizedData:a,getNormalizedOptions:l}},Dc=e=>{const t=o.ref(),n=o.computed(()=>{const i=s=>{let l;return s?l=s.unit?s.value+s.unit:`${s.value}px`:l=void 0,l};return{width:i(Va(e.width)),height:i(Va(e.height))}});return{wrapper:t,wrapperStyle:n}},Bc=(e,{wrapper:t,evChartGroupRef:n},i,s)=>{const{props:l,emit:a}=o.getCurrentInstance(),r=o.ref(!1),c=o.ref(!1),d=o.ref(!0),h=o.ref(),u=o.reactive({zoom:e.zoom}),f=o.reactive({start:0,end:-1,isUseButton:!1,isUseScroll:!1});let m=null;const g=o.reactive({dom:[],props:{data:[],options:[]}}),p=o.reactive({data:null,options:null}),y=o.ref([]),C=x=>{x.data.length&&x.range&&c.value&&m.dragZoom(x)},b=()=>{g.props.options.forEach((x,I)=>{if(x.zoom={...x.zoom,use:c.value,getRangeInfo:C},c.value)x.dragSelection={...x.dragSelection,use:!0,keepDisplay:!1};else{const{use:T,keepDisplay:v}=p.options[I].dragSelection??{};x.dragSelection={use:!!T,keepDisplay:!!v}}})},k=()=>{if(n!=null&&n.value?(g.dom=n.value.querySelectorAll(".ev-chart-container"),g.dom.length&&s.value.forEach(({data:x,options:I},T)=>{x.chartIdx=T,g.props.data.push(x),g.props.options.push(I),y.value.push(T)})):(g.dom=[t.value.querySelector(".ev-chart-container")],g.props.data.push(l.data),g.props.options.push(l.options)),g.props.data.length){p.data=Ve(g.props.data),p.options=Ve(g.props.options);const x={updateZoomStartIdx:I=>a("update:zoomStartIdx",I),updateZoomEndIdx:I=>a("update:zoomEndIdx",I)};m=new Dk(g,p,u,h.value,r,f,x)}},L=x=>{p.data[0].labels.length<=1||(c.value=!c.value,x?x.classList.toggle("active"):h.value.querySelector(".dragZoom").classList.toggle("active"),b(),m.setIconStyle(c.value),m.setEventListener(c.value))},w=(x,I)=>{if(m.isAnimationFinish)switch(I){case"dragZoom":L(x.target);break;case"reset":m.initZoom();break;case"previous":case"latest":m.clickMoveZoomArea(I);break}};o.onUpdated(()=>{m&&h.value&&m.setIcon(h.value)});const M=x=>{!He(x.zoom,u.zoom)&&(u.zoom=x.zoom,m?(!u.zoom.toolbar.show&&c.value&&L(),m.setEvChartZoomOptions(u.zoom)):u.zoom.toolbar.show&&!n&&k())},V=x=>{d.value?(r.value||(p.data=n?pl(x):[pl(x)],u.zoom.keepZoomStatus?d.value=!1:(c.value=!1,b()),m&&m.updateEvChartCloneData(p,y,c.value,u.zoom.keepZoomStatus)),r.value=!1):d.value=!0},S=(x,I)=>{if(m.isUseToolbar){m.isUseToolbar=!1;return}c.value&&(m.executeZoom(x,I),m.setZoomAreaMemory(x,I))};return o.watch(()=>[f.start,f.end],([x,I],[T])=>{if(i!=null&&i.value)if(typeof i.value.dataIndex=="number")x>=(T??0)?i.value.dataIndex-=x-(T??0):i.value.dataIndex+=T-x;else for(let v=0;v<i.value.dataIndex.length;v++)x>=(T??0)?i.value.dataIndex[v]-=x-(T??0):i.value.dataIndex[v]+=T-x;(f.isUseButton||f.isUseScroll)&&m.executeZoom(x,I)}),o.watch(()=>[f.isUseButton,f.isUseScroll],([x,I],[T,v])=>{T&&!x?m.setZoomAreaMemory(f.start,f.end):v&&!I&&(m.zoomAreaMemory.current[0]=[f.start,f.end])}),{evChartZoomOptions:u,evChartInfo:g,evChartToolbarRef:h,evChartClone:p,brushIdx:f,createEvChartZoom:k,setOptionsForUseZoom:M,setDataForUseZoom:V,controlZoomIdx:S,onClickToolbar:w}},Ak={name:"EvChart",components:{EvChartToolbar:Nc},directives:{resize:Dn},props:{selectedItem:{type:Object,default:null},selectedLabel:{type:Object,default:null},selectedSeries:{type:Object,default:null},options:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})},resizeTimeout:{type:Number,default:0},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},realTimeScatterReset:{type:Boolean,default:!1},legendData:{type:Array,default:()=>[]}},emits:["click","dbl-click","drag-select","mouse-move","update:selectedItem","update:selectedLabel","update:selectedSeries","update:zoomStartIdx","update:zoomEndIdx","update:realTimeScatterReset","click-legend","update:legendData","axes-scale-change","axes-data-max-change"],setup(e,{emit:t}){let n=null;const i=o.ref(!1),s=o.inject("isChartGroup",!1),l=o.inject("brushSeries",{list:[],chartIdx:null}),a=o.inject("groupSelectedLabel",null),r=o.inject("groupHoveredLabel",null),c=o.inject("brushIdx",{start:0,end:-1}),d=o.inject("evChartPropsInGroup",[]),h=o.inject("groupInteraction",null),{eventListeners:u,selectItemInfo:f,selectLabelInfo:m,selectSeriesInfo:g,getNormalizedData:p,getNormalizedOptions:y}=Pc(a,r),C=p(e.data),b=y(e.options),k=o.computed(()=>e.selectedLabel),L=o.computed(()=>e.selectedItem),{wrapper:w,wrapperStyle:M}=Dc(b),{evChartZoomOptions:V,evChartToolbarRef:S,createEvChartZoom:x,setOptionsForUseZoom:I,setDataForUseZoom:T,controlZoomIdx:v,onClickToolbar:E}=s?{}:Bc(b,{wrapper:w,evChartGroupRef:null},e.selectedLabel?k:L,d),Z=()=>typeof performance<"u"?performance.now():Date.now();let W=null,R=null,X=null;const G=O=>{var J;W?(O.updateSeries&&(W.updateSeries=!0),O.updateData&&(W.updateData=!0),O.updateLegend&&(W.updateLegend=!0),O.updateTooltip&&(W.updateTooltip=!0),(J=O.updateSelTip)!=null&&J.update&&(W.updateSelTip??(W.updateSelTip={}),W.updateSelTip.update=!0)):W={...O};const H=()=>{const q=((h==null?void 0:h.deferUntil)??0)-Z();if(q>0){R=setTimeout(H,q);return}W&&n&&n.update(W),W=null,R=null,X=null};clearTimeout(R);const j=Z(),U=(h==null?void 0:h.deferUntil)??0,Q=U>j?U-j:0;R=setTimeout(H,Q)},N=()=>{var j;let O;b.selectLabel.use?O=m:b.selectSeries.use&&(O=g);const H=(j=e.options.realTimeScatter)!=null&&j.use?{...e.data,groups:[],labels:[]}:C;n=new vs(w.value,H,b,u,f,O,l)},P=()=>{n&&(n.init(),!s&&b.zoom.toolbar.show&&x(),b.legend.show&&b.legend.external&&n.emitLegendData())};o.watch(()=>e.options,O=>{var J,ne;const H=y(O),j=((ne=(J=n.options)==null?void 0:J.legend)==null?void 0:ne.show)??!1,U=!He(H.legend.table,n.options.legend.table),Q=H.tooltip.use&&!He(H.tooltip,n.options.tooltip);n.options=H,G({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},updateLegend:U,updateTooltip:Q}),H.legend.show&&H.legend.external&&!j&&n.emitLegendData(),s||I(H)},{deep:!b.shallowOptionsWatch,flush:"post"}),o.watch(()=>e.data,O=>{var ee,$;const H=(ee=e.options.realTimeScatter)!=null&&ee.use?{...O,groups:[],labels:[]}:p(O),j=!He(H.series,n.data.series),U=!He(H.groups,n.data.groups),Q=n.prunedRealTimeScatterSeries,J=!!(Q!=null&&Q.size)&&Object.keys(H.data??{}).some(he=>{var fe;return Q.has(he)&&((fe=H.data[he])==null?void 0:fe.length)}),ne=j||U||J||e.options.type==="heatMap",q=j||U||!He(H.labels,n.data.labels)||!He(H.data,n.data.data);($=e.options.realTimeScatter)!=null&&$.use?(X=zk(X,H),n.data={...H,data:X}):n.data=pl(H),G({updateSeries:ne,updateSelTip:{update:!0,keepDomain:!1},updateData:q}),!s&&q&&T(H)},{deep:!b.shallowDataWatch,flush:"post"}),s&&!(a!=null&&a.value)&&o.watch(()=>c.start,(O,H)=>{if(k!=null&&k.value)for(let j=0;j<k.value.dataIndex.length;j++)O>=(H??0)?k.value.dataIndex[j]-=O-(H??0):k.value.dataIndex[j]+=H-O;else L!=null&&L.value&&(O>=(H??0)?L.value.dataIndex-=O-(H??0):L.value.dataIndex+=H-O)}),o.watch(()=>L.value,O=>{const H=e.options.type;n.selectItemByData(O,H)},{deep:!0,flush:"post"}),o.watch(()=>(a==null?void 0:a.value)??k.value,O=>{O!=null&&O.dataIndex&&n.selectLabelByData(O.dataIndex,O==null?void 0:O.targetAxis)},{deep:!0,flush:"post"}),o.watch(()=>e.selectedSeries,O=>{var H;(H=b.selectSeries)!=null&&H.use?O.seriesId&&n.selectSeriesByData(O.seriesId):console.warn("[EVUI][Chart] selectSeries.use is false, so selectedSeries is not working")},{deep:!0,flush:"post"}),s||o.watch(()=>[e.zoomStartIdx,e.zoomEndIdx],([O,H])=>{v(O,H)}),o.watch(()=>e.realTimeScatterReset,O=>{var H,j;O&&(n.resetRealTimeScatterDataSet(),(H=e.options.realTimeScatter)!=null&&H.use&&(X=null,n.data={...n.data,data:{}},n.pointsLayerValid=!1),(j=n.prunedRealTimeScatterSeries)==null||j.clear(),t("update:realTimeScatterReset",!1))}),o.watch(()=>{var O;return(O=e.options.realTimeScatter)==null?void 0:O.use},O=>{n.options.realTimeScatter.use=O??!1,n.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}),o.watch(()=>r==null?void 0:r.value,O=>{O&&e.options.syncHover!==!1&&(O.label==null?n.overlayClear():n.drawSyncedIndicator(O))},{deep:!0,flush:"post"}),o.onMounted(async()=>{d!=null&&d.value&&d.value.push(e),await N(),_C(w.value,()=>n),await P(),i.value=!0}),o.onBeforeUnmount(()=>{var O;KC(w.value),clearTimeout(R),W=null,R=null,X=null,n&&"destroy"in n&&n.destroy(),(O=d==null?void 0:d.value)!=null&&O.length&&(d.value.length=0),i.value=!1}),o.onDeactivated(()=>{n&&"hideTooltip"in n&&n.hideTooltip()});const B=O=>{n==null||n.toggleSeries(O)},z=O=>{n==null||n.highlightSeries(O)},D=()=>{n==null||n.unhighlightSeries()},Y=()=>{n&&"update"in n&&n.update({updateSeries:!0,updateSelTip:{update:!0,keepDomain:!1}})},F=cs(()=>{n&&"resize"in n&&n.resize()},e.resizeTimeout);return o.onActivated(()=>{i.value&&F()}),{wrapper:w,wrapperStyle:M,onResize:F,redraw:Y,toggleSeries:B,highlightSeries:z,unhighlightSeries:D,evChartToolbarRef:S,injectIsChartGroup:s,onClickToolbar:E,normalizedOptions:b,zoomOptions:o.toRef(V??{zoom:{}},"zoom")}}},_k={key:0,ref:"evChartToolbarRef"};function Kk(e,t,n,i,s,l){var c;const a=o.resolveComponent("ev-chart-toolbar"),r=o.resolveDirective("resize");return o.openBlock(),o.createElementBlock(o.Fragment,null,[(c=i.zoomOptions.toolbar)!=null&&c.show&&!i.injectIsChartGroup?(o.openBlock(),o.createElementBlock("div",_k,[o.createVNode(a,{toolbar:i.zoomOptions.toolbar,onOnClickToolbar:i.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{ref:"wrapper",style:o.normalizeStyle(i.wrapperStyle),class:"ev-chart"},null,4),[[r,i.onResize]])],64)}const Li=ce(Ak,[["render",Kk]]);Li.install=e=>{e.component(Li.name,Li)};const Uk={zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}}},Jk=()=>{const e=o.ref(!1),t=o.ref(),n=o.ref([]),i=o.reactive({list:[],chartIdx:null});return{getNormalizedOptions:a=>Pe({},a,Uk),isExecuteZoom:e,brushSeries:i,evChartGroupRef:t,evChartPropsInGroup:n,groupInteraction:{deferUntil:0}}},jk={name:"EvChartGroup",components:{evChartToolbar:Nc},props:{options:{type:Object,default:()=>({})},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},groupSelectedLabel:{type:Object,default:null}},emits:["update:groupSelectedLabel","update:zoomStartIdx","update:zoomEndIdx","update:groupHoveredLabel"],setup(e,{emit:t}){const{getNormalizedOptions:n,isExecuteZoom:i,brushSeries:s,evChartGroupRef:l,evChartPropsInGroup:a,groupInteraction:r}=Jk(),c=n(e.options);o.provide("isExecuteZoom",i),o.provide("isChartGroup",!0),o.provide("brushSeries",s),o.provide("evChartPropsInGroup",a),o.provide("groupInteraction",r);const d=2e3,h=800,u=()=>typeof performance<"u"?performance.now():Date.now(),f=(x=h)=>{const I=Number.isFinite(x)?Math.min(Math.max(x,0),d):h,T=u();r.deferUntil=Math.min(Math.max(r.deferUntil,T+I),T+d)};o.provide("deferPollingRedraw",f);const m=o.computed({get:()=>e.groupSelectedLabel,set:x=>t("update:groupSelectedLabel",x)});o.provide("groupSelectedLabel",m);const g=o.ref(null);o.provide("groupHoveredLabel",g),o.watch(()=>e.options.syncHover,x=>{x?g.value={label:"",horizontal:!1}:g.value=null},{immediate:!0});const{evChartZoomOptions:p,evChartInfo:y,evChartToolbarRef:C,evChartClone:b,brushIdx:k,createEvChartZoom:L,setOptionsForUseZoom:w,setDataForUseZoom:M,controlZoomIdx:V,onClickToolbar:S}=Bc(c,{wrapper:null,evChartGroupRef:l},m,a);return o.provide("evChartClone",b),o.provide("evChartInfo",y),o.provide("brushIdx",k),o.onMounted(()=>{L()}),o.watch(()=>y.props.data,x=>{M(x)},{deep:!0}),o.watch(()=>e.options,x=>{const I=n(x);w(I)},{deep:!0}),o.watch(()=>[e.zoomStartIdx,e.zoomEndIdx],([x,I])=>{k.isUseButton||k.isUseScroll||V(x,I)}),{evChartGroupRef:l,evChartToolbarRef:C,zoomOptions:o.toRef(p,"zoom"),onClickToolbar:S,deferPollingRedraw:f}}},Qk={key:0,ref:"evChartToolbarRef"},$k={ref:"evChartGroupRef",class:"ev-chart-group__wrapper"};function qk(e,t,n,i,s,l){const a=o.resolveComponent("ev-chart-toolbar");return o.openBlock(),o.createElementBlock(o.Fragment,null,[i.zoomOptions.toolbar.show?(o.openBlock(),o.createElementBlock("div",Qk,[o.createVNode(a,{toolbar:i.zoomOptions.toolbar,onOnClickToolbar:i.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):o.createCommentVNode("",!0),o.createElementVNode("div",$k,[o.renderSlot(e.$slots,"default",{},void 0,!0)],512)],64)}const Mi=ce(jk,[["render",qk],["__scopeId","data-v-dda98b9e"]]);Mi.install=e=>{e.component(Mi.name,Mi)};const ve={WHEEL:{UP:"MOVEUP_WHEEL",DOWN:"MOVEDOWN_WHEEL"},GRAB:{UP:"MOVEUP_GRAB",DOWN:"MOVEDOWN_GRAB"},BUTTON:{INCREASE:"INCREASE",DECREASE:"DECREASE"}},Oe={LEFT:"leftX",RIGHT:"rightX"};let ew=class{constructor(t,n,i,s,l){this.evChart=t,this.evChartBrushOptions=i,this.evChartBrushRef=l,this.evChartData=n,this.brushIdx=s,i.value.useDebounce&&(this.debounceBrushIdx={start:s.start,end:s.end})}init(t){var n;if(this.brushIdx.start>this.brushIdx.end){this.removeBrushCanvas();return}if((n=this.evChartBrushRef)!=null&&n.value){const i=this.evChartBrushRef.value.querySelector(".brush-canvas");if(i)this.drawBrushRect({brushCanvas:i,isResize:t});else{const s=document.createElement("canvas");s.setAttribute("class","brush-canvas"),s.setAttribute("style","display: block; z-index: 1;");const l=this.evChartBrushRef.value.querySelector(".ev-chart-brush-container");l&&(this.brushCanvas=s,l.appendChild(s),this.evChartBrushContainer=l,this.drawBrushRect({brushCanvas:s}),this.addEvent(s))}}}drawBrushRect({brushCanvas:t,isResize:n,isDebounce:i,mode:s,offsetX:l}){const{chartRect:a,labelOffset:r}=this.evChart;if(!a&&!r)return;const c=this.evChartData.value.labels.length-1;this.labelEndIdx=c;const d={x1:a.x1+r.left,x2:a.x2-r.right,y1:a.y1+r.top,y2:a.y2-r.bottom},h=this.setCanvasWidthHeight(d,t);if(!(n&&this.isEqualWidth)&&c>=0){const u=this.setBrushXAndWidth(h,l,i,s);h&&u&&this.drawBrush(h,u,d,t)}}setCanvasWidthHeight(t,n){const s=t.x2-t.x1+6,l=t.y2-t.y1,a=(t.x2-t.x1)/this.labelEndIdx,r=window.devicePixelRatio||1;return this.isEqualWidth=n.width===Math.floor(s*r),{brushButtonWidth:6,brushCanvasHeight:l,brushCanvasWidth:s,axesXInterval:a,pixelRatio:r}}setBrushXAndWidth(t,n=0,i,s){const{brushButtonWidth:l,brushCanvasWidth:a,axesXInterval:r,pixelRatio:c}=t;!i&&this.debounceBrushIdx&&(this.debounceBrushIdx.start=this.brushIdx.start,this.debounceBrushIdx.end=this.brushIdx.end);const d=this.debounceBrushIdx??this.brushIdx;switch(s){case ve.BUTTON.INCREASE:case ve.BUTTON.DECREASE:this.brushRectWidth=a*c,this.curBrushButtonType===Oe.LEFT?(this.brushRectWidth=this.beforeBrushRectWidth?this.beforeBrushRectWidth-n:this.brushRectWidth-n,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=n*c,this.beforeBrushRectX=this.brushRectX)):this.curBrushButtonType===Oe.RIGHT&&(this.brushRectWidth=n-this.beforeBrushRectX,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=this.beforeBrushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX));break;case ve.GRAB.UP:case ve.GRAB.DOWN:this.brushRectX<=0&&s===ve.GRAB.DOWN||this.brushRectX+this.brushRectWidth>=a&&s===ve.GRAB.UP?this.offsetXAndRectXInterval=null:(this.offsetXAndRectXInterval||(this.offsetXAndRectXInterval=n-this.brushRectX),this.brushRectX=n-this.offsetXAndRectXInterval);break;default:n||(this.brushRectX=d.start*r*c,this.brushRectWidth=(a-(this.labelEndIdx-(d.end-d.start))*r)*c,this.beforeBrushRectX=this.brushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX);break}const h=a*c;return s===ve.BUTTON.INCREASE||s===ve.BUTTON.DECREASE?(this.brushRectX<0&&(this.brushRectWidth+=this.brushRectX,this.brushRectX=0),this.brushRectX+this.brushRectWidth>h&&(this.brushRectWidth=h-this.brushRectX)):this.brushRectX<0?this.brushRectX=0:this.brushRectX+this.brushRectWidth>h&&(this.brushRectX=h-this.brushRectWidth),this.brushRectWidth>h&&(this.brushRectWidth=h),{brushRectX:this.brushRectX,brushRectWidth:this.brushRectWidth}}drawBrush(t,n,i,s){const{brushButtonWidth:l,brushCanvasHeight:a,brushCanvasWidth:r,axesXInterval:c,pixelRatio:d}=t,{brushRectX:h,brushRectWidth:u}=n,{height:f,selection:{fillColor:m,opacity:g}}=this.evChartBrushOptions.value,p=f-i.y1,y=h,C=h+u;s.style.position||(s.style.position="absolute",s.style.top=`${i.y1}px`,s.style.left=`${i.x1-l/2}px`),this.isEqualWidth||(s.width=r*d,s.style.width=`${r}px`,s.height=a*d,s.style.height=`${a}px`);const b=s.getContext("2d");b.clearRect(0,0,r*d,a*d),b.fillStyle=m,b.globalAlpha=g,b.fillRect(h,0,u,p),b.fillRect(y,0,l,p),b.fillRect(C-l,0,l,p),this.brushPosInfo={leftX:y/d,rightX:C/d,buttonWidth:l,axesXInterval:c,...t,...n}}getCanvasOffsetX(t){const n=this.brushCanvas.getBoundingClientRect();return t.clientX-n.left}addEvent(){let t;const n=l=>{if(this.isDragMode){const a=this.getCanvasOffsetX(l);this.mouseDownAndMove({offsetX:a})}};this.onDocumentMouseMove=hs(n,5),this.onDocumentMouseUp=()=>{document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),this.initEventState()},this.onMouseDown=l=>{l.preventDefault(),t.isInsideButton?this.isDragMode="button":t.isInsideBrush?(this.clickBrushInsideX=l.offsetX,this.isDragMode="grab"):t.isOutsideBrush&&this.teleportBrush(l),this.isDragMode&&(document.addEventListener("mousemove",this.onDocumentMouseMove),document.addEventListener("mouseup",this.onDocumentMouseUp))};const i=l=>{this.isDragMode||(t=this.getMousePosition(l),this.changeCursor(t))};this.onMouseMove=hs(i,5),this.onWheel=l=>{l.preventDefault();const a=l.deltaY>0?ve.WHEEL.DOWN:ve.WHEEL.UP;this.updateBrushIdx(a),this.debounceBrushIdx&&this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:a}),this.brushIdx.isUseScroll=!0},this.onMouseUp=()=>{this.initEventState()};const s=()=>{this.initEventState()};this.onWheelDebounce=cs(s,100),this.setEventListener("addEventListener")}getMousePosition(t){const n=d=>Math.abs(this.brushPosInfo[d]-t.offsetX),i=n(Oe.RIGHT)>n(Oe.LEFT)?Oe.LEFT:Oe.RIGHT,s=d=>t.offsetX>this.brushPosInfo[d],l=d=>t.offsetX<this.brushPosInfo[d],a=l(Oe.LEFT)||s(Oe.RIGHT),r=s(Oe.LEFT)&&l(Oe.RIGHT),c=t.offsetX+this.brushPosInfo.buttonWidth>=this.brushPosInfo[i]&&t.offsetX-this.brushPosInfo.buttonWidth<=this.brushPosInfo[i];return this.curBrushButtonType=c&&i,{isInsideButton:c,isInsideBrush:r,isOutsideBrush:a}}destroy(){if(this.brushCanvas&&(this.setEventListener("removeEventListener"),document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),this.brushCanvas=null),this.evChartBrushContainer){const t=this.evChartBrushContainer;for(;t.hasChildNodes();)t.removeChild(t.firstChild)}}setEventListener(t){this.brushCanvas[t]("mousemove",this.onMouseMove),this.brushCanvas[t]("mousedown",this.onMouseDown),this.brushCanvas[t]("mouseup",this.onMouseUp),this.evChartBrushOptions.value.useWheelMove&&(this.brushCanvas[t]("wheel",this.onWheel),this.brushCanvas[t]("wheel",this.onWheelDebounce))}removeBrushWrapper(){if(this.evChartBrushRef.value){const t=this.evChartBrushRef.value.querySelector(".ev-chart-brush-wrapper");t&&this.evChartBrushRef.value.removeChild(t)}}removeBrushCanvas(){if(this.evChartBrushContainer){const t=this.evChartBrushContainer.querySelector(".brush-canvas");t&&this.evChartBrushContainer.removeChild(t)}}teleportBrush(t){const n=this.debounceBrushIdx??this.brushIdx,i=(n.end-n.start)/2;let s,l,a;i>.5?(n.end-n.start)%2===0?(a=Math.round(t.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(i),l=Math.floor(i)):(a=Math.ceil(t.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(i),l=Math.floor(i)):(a=Math.floor(t.offsetX/this.brushPosInfo.axesXInterval),t.offsetX-a*this.brushPosInfo.axesXInterval>this.brushPosInfo.axesXInterval/2?(s=Math.floor(i),l=Math.ceil(i)):(s=Math.ceil(i),l=Math.floor(i),i<1&&(a+=1))),a-s<=0?(n.start=0,n.end=l+s):a+l>=this.labelEndIdx?(n.start=this.labelEndIdx-l-s,n.end=this.labelEndIdx):(n.start=a-s,n.end=a+l),this.brushIdx.isUseScroll=!0}changeCursor(t){t.isOutsideBrush?this.brushCanvas.style.cursor="pointer":t.isInsideBrush&&(t.isInsideButton?this.brushCanvas.style.cursor="ew-resize":this.brushCanvas.style.cursor="grab")}mouseDownAndMove(t){const n=this.debounceBrushIdx?0:this.brushPosInfo.axesXInterval/3;let i;t.offsetX>this.beforeMouseXPos?this.isDragMode==="grab"?this.clickBrushInsideX<t.offsetX-n&&(i=ve.GRAB.UP,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX+n):t.offsetX-this.brushPosInfo[this.curBrushButtonType]>n&&(i=this.curBrushButtonType===Oe.LEFT?ve.BUTTON.DECREASE:ve.BUTTON.INCREASE,this.brushIdx.isUseButton=!0):t.offsetX<this.beforeMouseXPos&&(this.isDragMode==="grab"?this.clickBrushInsideX>t.offsetX+n&&(i=ve.GRAB.DOWN,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX-n):this.brushPosInfo[this.curBrushButtonType]-t.offsetX>n&&(i=this.curBrushButtonType===Oe.LEFT?ve.BUTTON.INCREASE:ve.BUTTON.DECREASE,this.brushIdx.isUseButton=!0)),this.debounceBrushIdx?this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:i,offsetX:t.offsetX}):this.updateBrushIdx(i),this.beforeMouseXPos=t.offsetX}updateBrushIdx(t){const n=this.debounceBrushIdx??this.brushIdx;switch(t){case ve.WHEEL.UP:case ve.GRAB.UP:if(n.end>=this.labelEndIdx)return;n.start+=1,n.end+=1;break;case ve.WHEEL.DOWN:case ve.GRAB.DOWN:if(n.start<=0)return;n.start-=1,n.end-=1;break;case ve.BUTTON.INCREASE:if(this.curBrushButtonType===Oe.LEFT){if(!n.start)return;n.start-=1}else{if(n.end===this.labelEndIdx)return;n.end+=1}break;case ve.BUTTON.DECREASE:if(n.start===n.end-1)return;this.curBrushButtonType===Oe.LEFT?n.start+=1:n.end-=1;break}}updateBrushIdxUseXPos(){if(!this.debounceBrushIdx)return;const t=()=>{let s,l;if(this.brushPosInfo){const{brushRectX:a,brushRectWidth:r,brushCanvasWidth:c,axesXInterval:d}=this.brushPosInfo;if(this.brushIdx.isUseButton||this.isUseBrushGrab){if(s=a/d,l=this.labelEndIdx-(c-(a+r))/d,this.curBrushButtonType===Oe.LEFT?(s=Math.round(s),l=this.brushIdx.end,s===l&&(s-=1)):this.curBrushButtonType===Oe.RIGHT?(s=this.brushIdx.start,l=Math.round(l),s===l&&(l+=1)):(s=Math.round(s),l=Math.round(l)),l>this.labelEndIdx){const h=l-this.labelEndIdx;s-=h,l-=h}if(s<0){const h=Math.abs(s);s=0,l+=h}}}return{brushStartIdx:s,brushEndIdx:l}},{brushStartIdx:n,brushEndIdx:i}=t();this.brushIdx.start===n&&this.brushIdx.end===i&&this.drawBrushRect({brushCanvas:this.brushCanvas}),this.brushIdx.start=n??this.debounceBrushIdx.start,this.brushIdx.end=i??this.debounceBrushIdx.end}initEventState(){if(this.isCleaningUp)return;this.isCleaningUp=!0,new Promise(n=>{this.updateBrushIdxUseXPos(),n(!0)}).then(n=>{n&&(this.clickBrushInsideX=null,this.isDragMode=null,this.beforeMouseXPos=null,this.curBrushButtonType=null,this.isUseBrushGrab=!1,this.offsetXAndRectXInterval=null,this.brushIdx.isUseButton=!1,this.brushIdx.isUseScroll=!1),this.isCleaningUp=!1})}};const tw={show:!0,useDebounce:!0,chartIdx:0,height:100,showLabel:!1,selection:{fillColor:"#38ACEC",opacity:.65},useWheelMove:!0},nw=()=>({getNormalizedBrushOptions:t=>Pe({},t,tw)}),iw={name:"EvChartBrush",directives:{resize:Dn},props:{options:{type:Object,default:()=>({})}},setup(e){let t=null,n=null;const i=o.ref(!1),s=o.inject("evChartClone",{data:[]}),l=o.inject("evChartInfo",{props:{options:[]}}),a=o.inject("brushIdx",{start:0,end:-1,isUseButton:!1,isUseScroll:!1}),r=o.inject("brushSeries",{list:[],chartIdx:null}),{getNormalizedBrushOptions:c}=nw(),d=o.computed(()=>c(e.options)),{eventListeners:h,selectItemInfo:u,selectLabelInfo:f,selectSeriesInfo:m,getNormalizedData:g,getNormalizedOptions:p}=Pc(),y=o.computed(()=>g((s.data??[])[d.value.chartIdx])),C=o.computed(()=>{var T,v;const x=l.props.options[d.value.chartIdx],I={...x,brush:{use:!0,...d.value},height:d.value.height,zoom:{use:!1},dragSelection:{use:!1},title:{show:!1},tooltip:{use:!1},legend:{show:!1},selectLabel:{use:!1},selectSeries:{use:!1},axesX:[{...(T=x==null?void 0:x.axesX)==null?void 0:T[0],title:{use:!1}}],axesY:[{...(v=x==null?void 0:x.axesY)==null?void 0:v[0],title:{use:!1}}]};return p(I)}),{wrapper:b,wrapperStyle:k}=Dc(C.value);o.watch(()=>r.list,()=>{b.value&&r.chartIdx===d.value.chartIdx&&(t.seriesList=r.list[d.value.chartIdx],t.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}}))}),o.watch(C,(x,I)=>{var T;x.brush.chartIdx<=((T=s.data)==null?void 0:T.length)-1?n&&!He(I.brush,x.brush)?n.removeBrushWrapper():t&&!He(x,I)&&(t.options=Ve(x),t.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})):(t.data=Ve(y.value),t.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1}),n.removeBrushCanvas())}),o.watch(()=>s.data,x=>{if(t){const I=x[d.value.chartIdx];if(I){const T=!He(I.series,t.data.series),v=r.list[d.value.chartIdx];typeof v=="object"&&Object.keys(v).length&&Object.keys(I.series).forEach(E=>{var Z;"show"in I.series[E]||(I.series[E].show=((Z=v[E])==null?void 0:Z.show)??!0)}),t.data=Ve(g(I)),t.update({updateSeries:T,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}}});const L=()=>{let x;C.value.selectLabel.use?x=f:C.value.selectSeries.use&&(x=m),t=new vs(b.value,y.value,C.value,h,u,x)},w=()=>{n=new ew(t,y,d,a,b)},M=()=>{t&&t.init()},V=x=>{n&&n.init(x)};o.watch(()=>[a.start,a.end],()=>{var x;b.value&&d.value.chartIdx<=((x=s.data)==null?void 0:x.length)-1&&V()}),o.onMounted(async()=>{d.value.show&&(await L(),await M(),w(),V()),i.value=!0}),o.onUpdated(async()=>{var x;if(d.value.show&&d.value.chartIdx<=((x=s.data)==null?void 0:x.length)-1){const I=r.list[d.value.chartIdx];typeof I=="object"&&Object.keys(I).length&&Object.keys(y.value.series).forEach(T=>{var v;"show"in y.value.series[T]||(y.value.series[T].show=((v=I[T])==null?void 0:v.show)??!0)}),await L(),await M(),w(),V()}}),o.onBeforeUnmount(()=>{t&&"destroy"in t&&t.destroy(),n&&n.destroy(),i.value=!1}),o.onDeactivated(()=>{t&&"hideTooltip"in t&&t.hideTooltip()});const S=cs(()=>{t&&"resize"in t&&new Promise(I=>t.resize(I)).then(I=>{I&&V(I)})},0);return o.onActivated(()=>{i.value&&S()}),{evChartBrushOptions:d,evChartBrushRef:b,evChartBrushStyle:k,onResize:S}}};function sw(e,t,n,i,s,l){const a=o.resolveDirective("resize");return i.evChartBrushOptions.show?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,ref:"evChartBrushRef",style:o.normalizeStyle(i.evChartBrushStyle),class:"ev-chart-brush"},null,4)),[[a,i.onResize]]):o.createCommentVNode("",!0)}const vi=ce(iw,[["render",sw]]);vi.install=e=>{e.component(vi.name,vi)};const ow={name:"TreeGridNode",components:{GridOptionButton:el},props:{dataIndex:{type:Number,default:0},nodeData:{type:Object,default:()=>({})},selectedData:{type:Object,default:()=>({})},useCheckbox:{type:Object,default:()=>({})},orderedColumns:{type:[Array],default:()=>[]},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},parentIcon:{type:String,default:""},childIcon:{type:String,default:""},customContextMenu:{type:[Array],default:()=>[]},menuRef:{type:Object,default:null},rowHeight:{type:Number,default:35},minWidth:{type:Number,default:40},borderStyle:{type:String,default:""},highlightIndex:{type:Number,default:-1}},emits:{"check-tree-data":null,"expand-tree-data":null,"click-tree-data":null,"dbl-click-tree-data":null,"context-menu":null},setup(e,{emit:t}){const n=(b,k)=>{t("check-tree-data",b,k)},i=b=>{t("expand-tree-data",b)},s=(b,k)=>{t("click-tree-data",b,k)},l=(b,k)=>{t("dbl-click-tree-data",b,k)},a=b=>{t("context-menu",b)},r=b=>{const k=e.expandIcon?e.expandIcon:"",L=e.expandIcon?e.collapseIcon:"";return b.expand?L:k},c=o.computed(()=>e.nodeData||{}),d=o.computed(()=>e.parentIcon||"tree-parent-icon"),h=o.computed(()=>e.childIcon||"tree-child-icon"),u=o.computed(()=>d.value!=="none"||h.value!=="none"),f=o.computed(()=>{const b=e.orderedColumns||[],k=b.findIndex(w=>w.expandColumn&&!w.hide&&!w.hiddenDisplay);if(k!==-1)return k;const L=b.findIndex(w=>!w.hide&&!w.hiddenDisplay);return L!==-1?L:0}),m=b=>({row:!0,"tree-row":!0,[`tree-row--level-${b==null?void 0:b.level}`]:!0,highlight:(b==null?void 0:b.index)===e.highlightIndex,selected:b.selected,"non-border":!!e.borderStyle&&e.borderStyle!=="rows"}),g=o.computed(()=>({cell:!0,"row-checkbox":!0,"non-border":!!e.borderStyle}));return{parentIconMV:d,childIconMV:h,node:c,isDataIcon:u,checkboxClass:g,expandColumnIdx:f,onCheck:n,onExpand:i,onClick:s,onDblClick:l,onContextMenu:a,expandIconClasses:r,getRowClass:m,getColumnClass:(b,k)=>({cell:!0,"tree-td":k===0,[b.type]:b.type,[b.align]:b.align,[b.field]:b.field,"non-border":!!e.borderStyle}),getColumnStyle:(b,k)=>({width:`${b.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${e.minWidth}px`,"border-right":e.orderedColumns.length-1===k?"none":"1px solid #CFCFCF"}),getDepthStyle:b=>({"margin-left":`${b*13}px`})}}},lw=["data-index"],aw=["data-name","data-index"],rw={class:"td-content__wrapper"},cw=["title"],dw={class:"td-content"};function hw(e,t,n,i,s,l){var d;const a=o.resolveComponent("ev-checkbox"),r=o.resolveComponent("ev-icon"),c=o.resolveComponent("grid-option-button");return o.openBlock(),o.createElementBlock("tr",{"data-index":i.node.index,class:o.normalizeClass(i.getRowClass(i.node)),onClick:t[7]||(t[7]=h=>i.onClick(h,i.node)),onDblclick:t[8]||(t[8]=h=>i.onDblClick(h,i.node))},[n.useCheckbox.use?(o.openBlock(),o.createElementBlock("td",{key:0,class:o.normalizeClass(i.checkboxClass),style:o.normalizeStyle({width:`${n.minWidth}px`,height:`${n.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(a,{modelValue:i.node.checked,"onUpdate:modelValue":t[0]||(t[0]=h=>i.node.checked=h),disabled:i.node.uncheckable,indeterminate:i.node.indeterminate,class:"row-checkbox-input",onChange:t[1]||(t[1]=h=>i.onCheck(h,i.node))},null,8,["modelValue","disabled","indeterminate"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.orderedColumns,(h,u)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:u},[!h.hide&&!h.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":h.field,"data-index":i.node.index,class:o.normalizeClass(i.getColumnClass(h,u)),style:o.normalizeStyle(i.getColumnStyle(h,u))},[o.createElementVNode("div",rw,[u===i.expandColumnIdx?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(i.getDepthStyle(i.node.level))},null,4)):o.createCommentVNode("",!0),u===i.expandColumnIdx?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass({expand:i.node.expand,"ev-tree-toggle":!0})},[i.node.hasChild?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[i.expandIconClasses(i.node)?(o.openBlock(),o.createBlock(r,{key:0,icon:i.expandIconClasses(i.node),style:{display:"block"},onClick:t[2]||(t[2]=f=>i.onExpand(i.node))},null,8,["icon"])):(o.openBlock(),o.createElementBlock("button",{key:1,class:"tree-expand-icon",onClick:t[3]||(t[3]=o.withModifiers(f=>i.onExpand(i.node),["stop"]))},[...t[9]||(t[9]=[o.createElementVNode("i",null,null,-1)])]))],64)):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),u===i.expandColumnIdx&&i.isDataIcon?(o.openBlock(),o.createElementBlock("span",{key:2,title:i.node[h.field],class:o.normalizeClass({expand:i.node.expand,"ev-tree-toggle":!0})},[o.createElementVNode("span",{class:o.normalizeClass(i.node.hasChild?i.parentIconMV:i.childIconMV)},[...t[10]||(t[10]=[o.createElementVNode("i",null,null,-1)])],2)],10,cw)):o.createCommentVNode("",!0),o.createElementVNode("div",dw,[e.$slots[h.field+"Node"]?o.renderSlot(e.$slots,h.field+"Node",{key:0,item:{data:i.node.data}},void 0,!0):o.createCommentVNode("",!0)])])],14,aw)):o.createCommentVNode("",!0)],64))),128)),(d=n.customContextMenu)!=null&&d.length?(o.openBlock(),o.createElementBlock("td",{key:1,class:o.normalizeClass({"row-contextmenu":!0,"non-border":!!n.borderStyle}),style:o.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${n.rowHeight}px`,"min-width":"30px","line-height":`${n.rowHeight}px`})},[e.$slots.contextmenuIconNode?(o.openBlock(),o.createElementBlock("span",{key:0,class:"row-contextmenu__btn",onClick:[t[4]||(t[4]=h=>i.onContextMenu(h)),t[5]||(t[5]=o.withModifiers((...h)=>n.menuRef.show&&n.menuRef.show(...h),["prevent"]))]},[o.renderSlot(e.$slots,"contextmenuIconNode",{},void 0,!0)])):(o.openBlock(),o.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",onClick:[t[6]||(t[6]=h=>i.onContextMenu(h)),o.withModifiers(n.menuRef.show,["prevent"])]},null,8,["onClick"]))],6)):o.createCommentVNode("",!0)],42,lw)}const uw=ce(ow,[["render",hw],["__scopeId","data-v-faab3696"]]),fw={name:"EvTreeGridToolbar"},mw={class:"tree-grid-toolbar"};function pw(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",mw,[o.renderSlot(e.$slots,"toolbarWrapper")])}const gw=ce(fw,[["render",pw]]),bw=e=>{const{props:t}=o.getCurrentInstance(),{checkInfo:n}=e;return{isRenderer:(d={})=>{var h;return!!((h=d==null?void 0:d.render)!=null&&h.use)},getComponentName:(d="")=>{const h=m=>m.charAt(0).toUpperCase()+m.slice(1),u="Renderer";let f="";if(d.indexOf("_")!==-1){const m=d.split("_");for(let g=0;g<m.length;g++)f+=h(m[g])}else f=h(d);return f+u},getConvertValue:(d,h)=>{let u=d.type==="number"||d.type==="float"?Number(h):h;return d.type==="number"?(u=nn(h),u=u===!1?h:u):d.type==="float"&&(u=u.toFixed(d.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),u},getColumnIndex:d=>t.columns.findIndex(h=>h.field===d),setPixelUnit:d=>{let h=d;const u=h.toString().indexOf("px")>=0,f=h.toString().indexOf("%")>=0;return!u&&!f&&(h=`${h}px`),h},checkHeader:d=>{n.isHeaderChecked=!!d.length&&d.every(u=>u.checked);const h=d.filter(u=>u.uncheckable);if(h.length){const u=d.filter(m=>m.checked),f=d.every(m=>h.includes(m));n.isHeaderChecked=!f&&h.length+u.length===d.length,n.isHeaderUncheckable=f}n.isHeaderIndeterminate=!!d.length&&d.some(u=>u.checked||u.indeterminate)&&!n.isHeaderChecked}}},Rs=e=>{const{originColumns:t,filteredColumns:n}=e;return t.map(i=>{const s=n.find(l=>l.index===i.index)??{};return{...i,...s}})},yw=e=>{const{scrollInfo:t,stores:n,elementInfo:i,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c}=e,d=f=>{let m=n.showTreeStore;l.isClientPaging&&(m=r());const g=i.body;if(g){const p=s.rowHeight,y=g.clientHeight>p?Math.ceil(g.clientHeight/p):m.length,C=m.length*p;let b=Math.floor(g.scrollTop/p);b>m.length-1&&(b=0);const k=b+y+1,L=Math.max(b,0),w=k,M=i.table;n.viewStore=m.slice(L,w),t.hasVerticalScrollBar=y<m.length||g.clientHeight<M.clientHeight,t.vScrollTopHeight=L*p,t.vScrollBottomHeight=C-n.viewStore.length*p-t.vScrollTopHeight,f&&l.isInfinite&&t.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(w/l.perPage)+1,l.startIndex=w,c({onScrollEnd:!0}))}},h=()=>{const f=i.header,m=i.body,g=i.table;f.scrollLeft=m.scrollLeft,a.value=m.scrollLeft,t.hasHorizontalScrollBar=m.clientWidth<g.clientWidth};return{updateVScroll:d,updateHScroll:h,onScroll:()=>{const f=i.body,m=f.scrollTop,g=f.scrollLeft,p=t.lastScroll.top,y=t.lastScroll.left,C=g!==y;m!==p&&f.clientHeight&&d(!0),C&&h(),t.lastScroll.top=m,t.lastScroll.left=g}}},xw=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{resizeInfo:i,elementInfo:s,checkInfo:l,stores:a,isRenderer:r,updateVScroll:c,updateHScroll:d,contextInfo:h}=e,u=()=>{a.viewStore=a.showTreeStore;const p=a.viewStore;let y=i.columnWidth;i.columnWidth>0&&(y=i.columnWidth),y=i.columnWidth;let C=0;if(i.adjust&&s.body){const b=s.body;let k=b.offsetWidth;const L=b.offsetHeight,w=a.orderedColumns.reduce((M,V)=>(V.hide||V.hiddenDisplay||(V.width?M.totalWidth+=V.width:M.emptyCount++),M),{totalWidth:h.customContextMenu.length?30:0,emptyCount:0});if(i.rowHeight*p.length>L-i.scrollWidth&&(k-=i.scrollWidth),l.useCheckbox.use&&(k-=i.minWidth),y=k-w.totalWidth,y>0){const M=w.emptyCount===0?0:Math.floor(y/w.emptyCount);C=y-M*w.emptyCount,y=w.emptyCount!==0?M:y}else y=i.columnWidth;y=y<i.minWidth?i.minWidth:y,i.columnWidth=y}if(a.orderedColumns.forEach(b=>{const k=r(b)?i.rendererMinWidth:i.minWidth;b.width&&b.width<k&&(b.width=k),!b.width&&!b.hide&&(b.width=y)}),C&&a.orderedColumns.length){let b=a.orderedColumns.length-1,k=a.orderedColumns[b];for(;b>0&&k&&(k.hide||k.hiddenDisplay);)b-=1,k=a.orderedColumns[b];k&&(k.width+=C)}i.isResize=!i.isResize},f=()=>{o.nextTick(()=>{var p,y;i.adjust&&a.orderedColumns.forEach(C=>{var k;const b=C;return!((k=t.columns[C.index])!=null&&k.width)&&!b.resized&&(b.width=0),b},void 0),u(),(p=s.body)!=null&&p.clientHeight&&c(),(y=s.body)!=null&&y.clientWidth&&d()})};return{calculatedColumn:u,onResize:f,onShow:p=>{p&&f()},onColumnResize:(p,y)=>{const C=s.header,b=s.body,k=C.getBoundingClientRect().left,L=C.querySelector(`li[data-index="${p}"]`),w=r(a.orderedColumns[p])?i.rendererMinWidth:i.minWidth,M=L.getBoundingClientRect(),V=b.getBoundingClientRect().right-k,S=s.resizeLine,x=M.left-k+w,I=M.right-k,T=y.clientX,v=M.left-k;b.style.overflow="auto",S.style.left=`${I}px`,i.showResizeLine=!0;const E=W=>{const R=W.clientX-T,X=I+R;let G=Math.max(x,X);G=Math.min(V,G),S.style.left=`${G}px`},Z=()=>{const R=parseInt(S.style.left,10)-v;a.orderedColumns[p]&&(a.orderedColumns[p].width=R,a.orderedColumns[p].resized=!0),i.showResizeLine=!1,document.removeEventListener("mousemove",E),f();const X=Rs(a);n("resize-column",{column:a.orderedColumns[p],columns:X}),n("change-column-info",{type:"resize",columns:X})};document.addEventListener("mousemove",E),document.addEventListener("mouseup",Z,{once:!0})}}},Sw=e=>{const{emit:t}=o.getCurrentInstance(),n=e,i=(r,c)=>{var u;const d=r.target.tagName.toLowerCase();let h={};return r.target.offsetParent&&(d==="td"?h=r.target.dataset:h=((u=r.target.closest("td"))==null?void 0:u.dataset)??{}),{event:r,rowData:c,rowIndex:c.index,cellName:h.name,cellIndex:h.index}};let s=null;return{onRowClick:(r,c)=>{var d,h;return r.target&&r.target.parentElement&&(r.target.parentElement.classList.contains("row-checkbox-input")||(h=(d=r.target.closest("td"))==null?void 0:d.classList)!=null&&h.contains("row-contextmenu"))?!1:(clearTimeout(s),s=setTimeout(()=>{n.useSelect&&(c.selected?(c.selected=!1,n.multiple?r.ctrlKey?n.selectedRow=n.selectedRow.filter(u=>u.index!==c.index):n.selectedRow=[c]:n.selectedRow=[]):(c.selected=!0,r.ctrlKey&&n.multiple&&(!n.limitCount||n.limitCount>n.selectedRow.length)?n.selectedRow.push(c):n.selectedRow=[c]),t("update:selected",n.selectedRow),t("click-row",i(r,c)))},100),!0)},onRowDblClick:(r,c)=>{clearTimeout(s),t("dblclick-row",i(r,c))}}},Cw=e=>{const{checkInfo:t,stores:n,checkHeader:i,pageInfo:s,getPagingData:l}=e,{emit:a}=o.getCurrentInstance(),r=()=>t.useCheckbox.mode==="each",c=m=>{const g=n.treeStore.findIndex(p=>p.index===m.index);g!==-1&&(n.treeStore[g].checked=m.checked)},d=m=>{r()||m.hasChild&&m.children.forEach(g=>{const p=g;m.checked&&!p.checked&&!p.uncheckable&&t.checkedRows.push(p),m.checked||(t.checkedRows=t.checkedRows.filter(y=>y.index!==p.index)),p.checked=m.checked&&!p.uncheckable,p.hasChild&&d(p)})},h=m=>{if(r())return;const g=m.parent;if(g){const p=g.children.every(C=>C.checked);g.checked=p&&!g.uncheckable;const y=g.children.filter(C=>C.uncheckable);if(y.length){const C=g.children.filter(b=>b.checked);y.length+C.length===g.children.length&&(g.checked=!0)}g.indeterminate=!p&&g.children.some(C=>C.checked||C.indeterminate),g.checked?t.checkedRows.push(g):t.checkedRows=t.checkedRows.filter(C=>C.index!==g.index),g.parent&&h(g)}};return{onCheck:(m,g)=>{let p=n.store;s.isClientPaging&&(p=l());const y=()=>t.useCheckbox.mode==="single",C=()=>{t.isHeaderChecked&&(t.isHeaderChecked=!1)},b=()=>{y()&&t.checkedRows.length>0&&(t.prevCheckedRow.checked=!1,c(t.prevCheckedRow))},k=w=>{if(y()){t.checkedRows=[w];return}d(w),h(w),t.checkedRows.push(w),w.indeterminate=!1},L=w=>{if(y()){t.checkedRows=[];return}t.checkedRows=t.checkedRows.filter(M=>M.index!==w.index)};b(),g.checked?(k(g),i(p)):(C(),L(g),d(g),h(g)),t.prevCheckedRow=g,a("update:checked",t.checkedRows),a("check-row",m,g.index,g)},onCheckAll:m=>{var y;const g=t.isHeaderChecked;let p=(y=n.store)==null?void 0:y.filter(C=>C.isFilter);s.isClientPaging&&(p=l()),p.forEach(C=>{C.checked=g&&!C.uncheckable,C.checked?t.checkedRows.find(b=>b.index===C.index)||t.checkedRows.push(C):t.checkedRows=t.checkedRows.filter(b=>b.index!==C.index),C.indeterminate=!1}),t.isHeaderIndeterminate=!1,a("update:checked",t.checkedRows),a("check-all",m,t.checkedRows)}}},kw=e=>{const{emit:t}=o.getCurrentInstance(),{contextInfo:n,stores:i,selectInfo:s,useGridSetting:l,columnSettingInfo:a,setColumnHidden:r,onSort:c}=e,d=(m=!0)=>{const g=[];if(m&&n.customContextMenu.length){const p=s.selectedRow,y=n.customContextMenu.map(C=>{const b=C;return b.validate&&(b.disabled=!b.validate(b.itemId,p)),b.selectedRow=p??[],b});g.push(...y)}n.contextMenuItems=g};return{setContextMenu:d,onContextMenu:m=>{var y,C;const p=(C=(y=m.target.closest(".row"))==null?void 0:y.dataset)==null?void 0:C.index;if(p){const b=i.viewStore.findIndex(L=>L.index===Number(p)),k=i.viewStore[b];s.selectedRow=[k],d(),t("update:selected",s.selectedRow)}else s.selectedRow=[],d(!1),t("update:selected",[])},onColumnContextMenu:(m,g)=>{var p,y,C,b,k,L;if(m.target.className.includes("column-name")){const w=!!g.sortable;n.columnMenuItems=[{text:((p=n.columnMenuTextInfo)==null?void 0:p.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!l.value||i.orderedColumns.length===1||!!g.fixed,hidden:((y=n.hiddenColumnMenuItem)==null?void 0:y.hide)||!l.value,click:()=>{r(g.field),t("change-column-status",{columns:i.updatedColumns}),t("change-column-info",{type:"display",columns:i.updatedColumns})}},{text:((C=n.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!w,hidden:(b=n.hiddenColumnMenuItem)==null?void 0:b.ascending,click:()=>c(g,"asc")},{text:((k=n.columnMenuTextInfo)==null?void 0:k.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!w,hidden:(L=n.hiddenColumnMenuItem)==null?void 0:L.descending,click:()=>c(g,"desc")}]}else n.columnMenuItems.length=0},onGridSettingContextMenu:m=>{const{useDefaultColumnSetting:g,columnSettingTextInfo:p}=a,y={text:(p==null?void 0:p.title)??"Column List",isShowMenu:!0,click:()=>{a.isShowColumnSetting=!0,n.isShowMenuOnClick=!0}};n.customGridSettingContextMenu.length&&(n.gridSettingContextMenuItems=[...n.customGridSettingContextMenu]),g&&n.gridSettingContextMenuItems.push(y),n.gridSettingMenu.show(m)}}},ww=e=>{const{emit:t}=o.getCurrentInstance(),{stores:n,onResize:i}=e,s=()=>{let r=0;const c=[];function d(u){const f={};return Object.keys(u).forEach(m=>{m!=="children"&&(f[m]=u[m])}),f}function h(u){const{node:f,level:m,isShow:g,parent:p,uncheckable:y}=u;f!==null&&typeof f=="object"&&(f.index=r++,f.level=m,Object.hasOwnProperty.call(f,"checked")||(f.checked=!1),Object.hasOwnProperty.call(f,"selected")||(f.selected=!1),Object.hasOwnProperty.call(f,"show")||(f.show=g),Object.hasOwnProperty.call(f,"expand")||(f.expand=!0),Object.hasOwnProperty.call(f,"isFilter")||(f.isFilter=!1),Object.hasOwnProperty.call(f,"uncheckable")||(f.uncheckable=y),Object.hasOwnProperty.call(f,"indeterminate")||(f.indeterminate=!1),Object.hasOwnProperty.call(f,"data")||(f.data=d(f)),c.push(f),Object.hasOwnProperty.call(f,"parent")||(f.parent=p),f.children&&(f.hasChild=!0,f.children.forEach(C=>h({node:C,level:m+1,isShow:f.show&&f.expand,parent:f,uncheckable:f.uncheckable}))))}return n.treeRows.forEach(u=>{h({node:u,level:0,isShow:!0,parent:void 0,uncheckable:!1})}),c},l=(r,c,d)=>{r.forEach(h=>{const u=h;u.show=d&&c?u.isFilter:c,u.hasChild&&l(u.children,u.show&&u.expand,u.isFilter)})};return{setTreeNodeStore:s,handleExpand:r=>{const c=!r.expand,d=r;d.expand=!d.expand,l(d.children,d.expand,d.isFilter),t("toggle-row",{row:d,isExpand:c}),i()}}},Iw=e=>{const{stores:t,filterInfo:n,pageInfo:i,getConvertValue:s,onResize:l,checkHeader:a,getPagingData:r,updatePagingInfo:c}=e,d=m=>{if(!(m!=null&&m.parent))return;const{parent:g}=m;g.show=!0,g.isFilter=!0,d(g)},h=m=>{if(!(m!=null&&m.children))return;const{children:g}=m;g.forEach(p=>{const y=p;y.parent.show&&y.parent.expand?y.show=!0:y.show=!1,y.isFilter=!0,y.hasChild&&h(y)})};let u=null;return{onSearch:m=>{u&&clearTimeout(u),u=setTimeout(()=>{n.isSearch=!1,n.searchWord=m;const g=t.treeStore;g.forEach(p=>{p.show=!1,p.isFilter=!1}),m?(g.filter(y=>{let C=!1;for(let b=0;b<t.orderedColumns.length;b++){const k=t.orderedColumns[b]||{};let L=y[k.field]??null;if(k.type=k.type||"string",L!==null&&!k.hide&&((k==null?void 0:k.searchable)===void 0||k!=null&&k.searchable)&&(L=s(k,L).toString(),C=L.toLowerCase().includes(m.toString().toLowerCase()),C))break}return C}).forEach(y=>{y.show=!0,y.parent&&!y.parent.expand&&(y.show=!1),y.isFilter=!0,d(y),h(y)}),n.isSearch=!0):(g.forEach(p=>{p.show=!0,p.isFilter=!1}),g.forEach(p=>{d(p),h(p)})),!m&&i.isClientPaging&&i.prevPage&&(i.currentPage=1,t.pagingStore=r()),c({onSearch:!0}),a(t.store),l()},500)}}},Tw=e=>{const{emit:t}=o.getCurrentInstance(),{stores:n,pageInfo:i,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=e,c=()=>{const u=(i.currentPage-1)*i.perPage,f=parseInt(u,10)+parseInt(i.perPage,10);return n.showTreeStore.slice(u,f)},d=u=>{t("page-change",{eventName:u,pageInfo:{currentPage:i.currentPage,prevPage:i.prevPage,startIndex:i.startIndex,total:i.pageTotal,perPage:i.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(f=>!f.hide&&((f==null?void 0:f.searchable)===void 0||(f==null?void 0:f.searchable))).map(f=>f.field)}}),i.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(i.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(i.isClientPaging)if(i.prevPage=u,n.showTreeStore.length<=i.perPage)n.pagingStore=n.showTreeStore;else{const f=(i.currentPage-1)*i.perPage,m=parseInt(f,10)+parseInt(i.perPage,10);n.pagingStore=n.showTreeStore.slice(f,m),a.body.scrollTop=0,i.startIndex=f}d({onChangePage:!0})}}},Lw=({sortInfo:e,stores:t})=>{const{emit:n}=o.getCurrentInstance(),i=(u=!0)=>u?["asc","desc","init"]:["asc","desc"];function s(){this.orders=i(),this.dequeue=()=>this.orders.shift(),this.enqueue=u=>this.orders.push(u)}const l=(u,f="init")=>{t.orderedColumns.forEach(m=>{m.index===(u==null?void 0:u.index)&&f?m.sortOption={sortType:f}:m.sortOption={sortType:"init"}})},a=()=>{const u=t.originColumns.filter(f=>f.hiddenDisplay||f.hide);u.length&&u.forEach(f=>{f.sortOption={sortType:"init"}})},r=new s;return{onSort:(u,f)=>{if(u.sortable===void 0?!0:u.sortable){e.sortColumn=u,e.sortField!==(u==null?void 0:u.field)&&(r.orders=i(),e.sortField=u==null?void 0:u.field),f&&(r.orders=i(),f==="desc"&&(e.sortOrder=r.dequeue(),r.enqueue(e.sortOrder))),e.sortOrder=r.dequeue(),r.enqueue(e.sortOrder),a(),l(u,e.sortOrder);const g=Rs(t);n("sort-column",{field:e.sortField,order:e.sortOrder,column:e.sortColumn,columns:g}),n("change-column-info",{type:"sort",columns:g})}},setSortInfo:(u,f=!0)=>{const m=u==null?void 0:u.findIndex(y=>{var C;return(y==null?void 0:y.sortable)&&((C=y==null?void 0:y.sortOption)==null?void 0:C.sortType)&&y.sortOption.sortType!=="init"}),g=u[m];m>-1&&(g.index=m);const{sortType:p}=(g==null?void 0:g.sortOption)||{};e.sortColumn=g,e.sortField=g==null?void 0:g.field,e.isSorting=!!p,e.sortOrder=p,l(g,p),f&&n("change-column-info",{type:"sort",columns:Rs(t)})},initSortInfo:u=>{e.isSorting=!1,e.sortOrder="init",u.forEach(f=>{var m;(m=f==null?void 0:f.sortOption)!=null&&m.sortType&&f.sortOption.sortType!=="init"&&(f.sortOption.sortType="init")})}}},Mw={name:"EvTreeGrid",components:{TreeGridNode:uw,Toolbar:gw,GridPagination:jr,GridSummary:tc,ColumnSetting:nc,GridSortButton:ic,GridOptionButton:el},directives:{observeVisibility:uo,resize:Dn},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array,Object],default:()=>null},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""}},emits:{"update:selected":null,"update:checked":null,"click-row":null,"dblclick-row":null,"check-row":null,"check-all":null,"page-change":null,"sort-column":null,"toggle-row":null,"resize-column":({column:e,columns:t})=>({column:e,columns:t}),"change-column-status":({columns:e})=>({columns:e}),"change-column-info":({type:e,columns:t})=>({type:e,columns:t})},setup(e){var Vs,Es,Ws,Gs,Zs,Xs,Ns,un,En;const t=o.ref(null),n=o.computed(()=>{var K,se;return((se=(K=e.option)==null?void 0:K.useGridSetting)==null?void 0:se.use)||!1}),i=o.computed(()=>{var K;return((K=e.option)==null?void 0:K.useSummary)||!1}),s=o.computed(()=>e.option.emptyText??"No records"),l=o.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),a=o.reactive({isSearch:!1,searchWord:""}),r=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var K,se;return((se=(K=e.option)==null?void 0:K.useGridSetting)==null?void 0:se.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((Es=(Vs=e.option)==null?void 0:Vs.useGridSetting)==null?void 0:Es.columnMenuText)??"Column List",search:((Gs=(Ws=e.option)==null?void 0:Ws.useGridSetting)==null?void 0:Gs.searchText)??"Search",empty:((Xs=(Zs=e.option)==null?void 0:Zs.useGridSetting)==null?void 0:Xs.emptyText)??"No records",ok:((un=(Ns=e.option)==null?void 0:Ns.useGridSetting)==null?void 0:un.okBtnText)??"OK"}}),c=o.reactive({treeStore:[],viewStore:[],filterStore:[],pagingStore:[],originStore:[],showTreeStore:o.computed(()=>c.treeStore.filter(K=>K.show)),searchStore:o.computed(()=>c.treeStore.filter(K=>K.isFilter)),store:o.computed(()=>a.isSearch?c.searchStore:c.treeStore),treeRows:e.rows,filteredColumns:[],originColumns:o.computed(()=>e.columns.map((K,se)=>{var me;return{index:se,hiddenDisplay:!1,...K,width:isFinite(K.width)?K.width:void 0,sortOption:{sortType:((me=K==null?void 0:K.sortOption)==null?void 0:me.sortType)||"init"}}})),orderedColumns:o.computed(()=>c.filteredColumns.length?c.filteredColumns:c.originColumns),updatedColumns:o.computed(()=>Rs(c))}),d=o.reactive({usePage:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.use)||!1}),useClient:((En=e.option.page)==null?void 0:En.useClient)||!1,isInfinite:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.total)||0}),perPage:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.perPage)||20}),visiblePage:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.visiblePage)||8}),order:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.order)||"center"}),showPageInfo:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.showPageInfo)||!1}),isClientPaging:o.computed(()=>d.useClient&&d.usePage&&!d.isInfinite),isHighlight:!1,highlightPage:0}),h=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:e.checked,useCheckbox:o.computed(()=>e.option.useCheckbox||{})}),{isRenderer:u,getComponentName:f,getConvertValue:m,getColumnIndex:g,setPixelUnit:p,checkHeader:y}=bw({checkInfo:h}),C=o.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),b=o.reactive({selectedRow:e.selected,useSelect:o.computed(()=>{var K,se;return((se=(K=e.option)==null?void 0:K.useSelection)==null?void 0:se.use)??!0}),limitCount:o.computed(()=>{var se,me;let K=(me=(se=e.option)==null?void 0:se.useSelection)==null?void 0:me.limitCount;return K=K&&K>=2?K:0,K}),multiple:o.computed(()=>{var K,se;return((se=(K=e.option)==null?void 0:K.useSelection)==null?void 0:se.multiple)??!1})}),k=o.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:e.option.customAscFunction??{}}),L=o.reactive({menu:null,contextMenuItems:[],contextMenuClass:e.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:e.option.columnMenuText||{},hiddenColumnMenuItem:e.option.hiddenColumnMenuItem||{},customContextMenu:e.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:o.computed(()=>{var K,se;return((se=(K=e.option)==null?void 0:K.useGridSetting)==null?void 0:se.customContextMenu)||[]}),isShowMenuOnClick:!1}),w=o.reactive({minWidth:40,rendererMinWidth:80,showResizeLine:!1,adjust:e.option.adjust||!1,columnWidth:e.option.columnWidth||80,scrollWidth:e.option.scrollWidth||17,rowHeight:o.computed(()=>e.option.rowHeight||35),gridWidth:o.computed(()=>e.width?p(e.width):"100%"),gridHeight:o.computed(()=>e.height?p(e.height):"100%"),isResize:!1}),M=o.reactive({showHeader:o.computed(()=>e.option.showHeader===void 0?!0:e.option.showHeader),stripeStyle:o.computed(()=>{var K;return((K=e.option.style)==null?void 0:K.stripe)||!1}),borderStyle:o.computed(()=>{var K;return((K=e.option.style)==null?void 0:K.border)||""}),highlightIdx:o.computed(()=>{var K;return((K=e.option.style)==null?void 0:K.highlight)??-1})}),V=()=>{b.selectedRow.length=0,c.store.forEach(K=>{K.selected=!1})},S=()=>{h.isHeaderChecked=!1,h.isHeaderIndeterminate=!1,h.checkedRows.length=0,c.store.forEach(K=>{K.checked=!1,K.indeterminate=!1})},{getPagingData:x,updatePagingInfo:I,changePage:T}=Tw({stores:c,pageInfo:d,sortInfo:k,filterInfo:a,elementInfo:l,clearCheckInfo:S}),v=o.ref(0),{updateVScroll:E,updateHScroll:Z,onScroll:W}=yw({scrollInfo:C,stores:c,elementInfo:l,resizeInfo:w,pageInfo:d,summaryScroll:v,getPagingData:x,updatePagingInfo:I}),{onRowClick:R,onRowDblClick:X}=Sw(b),{onCheck:G,onCheckAll:N}=Cw({checkInfo:h,stores:c,checkHeader:y,pageInfo:d,getPagingData:x}),{calculatedColumn:P,onResize:B,onShow:z,onColumnResize:D}=xw({resizeInfo:w,elementInfo:l,checkInfo:h,stores:c,isRenderer:u,updateVScroll:E,updateHScroll:Z,contextInfo:L}),{setTreeNodeStore:Y,handleExpand:F}=ww({stores:c,onResize:B}),{onSort:O,initSortInfo:H,setSortInfo:j}=Lw({sortInfo:k,stores:c}),{onSearch:U}=Iw({stores:c,filterInfo:a,pageInfo:d,getConvertValue:m,onResize:B,checkHeader:y,getPagingData:x,updatePagingInfo:I}),{setPositionColumnSetting:Q,initColumnSettingInfo:J,onApplyColumn:ne,setColumnHidden:q}=sc({stores:c,columnSettingInfo:r,contextInfo:L,onSearch:U,onResize:B}),{setContextMenu:ee,onContextMenu:$,onColumnContextMenu:he,onGridSettingContextMenu:fe}=kw({contextInfo:L,stores:c,selectInfo:b,useGridSetting:n,columnSettingInfo:r,setColumnHidden:q,onSort:O}),ae=K=>{L.gridSettingContextMenuItems.length=0,L.customGridSettingContextMenu.length?fe(K):r.isShowColumnSetting=!0},Se=K=>{var se,me,we,Ee,Ke,tt;K.type==="wheel"&&((se=L.menu)==null||se.hide(K)),K.type==="scroll"&&!((me=K.target.classList)!=null&&me.contains("table-body"))&&!((Ee=(we=K.target.offsetParent)==null?void 0:we.classList)!=null&&Ee.contains("ev-grid-column-setting"))&&(r.isShowColumnSetting=!1,L.isShowMenuOnClick=!1,(Ke=L.columnMenu)==null||Ke.hide(K),(tt=L.gridSettingMenu)==null||tt.hide())};o.onMounted(()=>{var K;if(c.treeStore=Y(),c.originStore=Ve(c.treeStore),(K=e.option)!=null&&K.useSort)j(e.columns,!1);else{const se=L.hiddenColumnMenuItem;se.ascending=!0,se.descending=!0}document.addEventListener("wheel",Se,{capture:!1}),document.addEventListener("scroll",Se,{capture:!0})}),o.onUnmounted(()=>{document.removeEventListener("wheel",Se,{capture:!1}),document.removeEventListener("scroll",Se,{capture:!0})}),o.onActivated(()=>{B()}),o.watch(()=>{var K;return(K=e.option)==null?void 0:K.useSort},K=>{const se=e.option.hiddenColumnMenuItem,me=L.hiddenColumnMenuItem;K?(me.ascending=(se==null?void 0:se.ascending)??!1,me.descending=(se==null?void 0:se.descending)??!1,j(e.columns,!1)):(me.ascending=!0,me.descending=!0,H(e.columns))}),o.watch(()=>r.isShowColumnSetting,K=>{var se;if(!K){(se=L.gridSettingMenu)==null||se.hide();return}Q(t.value)}),o.watch(()=>e.columns,()=>{J()},{deep:!0,immediate:!0}),o.watch(()=>e.checked,K=>{h.checkedRows=K}),o.watch(()=>h.checkedRows,K=>{h.isHeaderChecked=!1;let se=c.store;d.isClientPaging&&(se=x()),se.length&&(se.forEach(me=>{me.checked=!!K.find(we=>we.index===me.index)}),y(se)),E()}),o.watch(()=>e.selected,K=>{b.useSelect&&(b.selectedRow=K)}),o.watch(()=>b.selectedRow,K=>{b.useSelect&&(c.store.forEach(se=>{se.selected=!!K.find(me=>me.index===se.index)}),E())},{deep:!0}),o.watch(()=>M.highlightIdx,async K=>{await o.nextTick();const se=we=>{if(!(we!=null&&we.children))return;const{children:Ee}=we;Ee.forEach(Ke=>{const tt=Ke;tt.parent.show&&tt.parent.expand?tt.show=!0:tt.show=!1,tt.isFilter=!0,tt.hasChild&&se(tt)})},me=we=>{if(!(we!=null&&we.parent)){se(we);return}const{parent:Ee}=we;Ee.show=!0,Ee.isFilter=!0,Ee.expand=!0,se(Ee),me(Ee)};if(K>=0){const we=c.store.find(Ke=>Ke.index===K);if(!we)return;we.show=!0,we.isFilter=!0,me(we);const Ee=c.showTreeStore.map(Ke=>Ke.index).indexOf(we.index);if(d.usePage&&!d.isInfinite){const Ke=Math.ceil(Ee/d.perPage);if(d.highlightPage=Ee===d.perPage?Ke+1:Ke||1,d.highlightPage!==d.currentPage){d.currentPage=d.highlightPage,d.isHighlight=!0;return}}l.body.scrollTop=w.rowHeight*Ee}}),o.watch(()=>h.useCheckbox.mode,()=>{h.checkedRows=[],h.isHeaderChecked=!1}),o.watch(()=>b.useSelect,()=>{V()}),o.watch(()=>b.multiple,()=>{V()}),o.watch(()=>e.rows,K=>{c.treeRows=K,c.treeStore=Y(),B()},{deep:!0}),o.watch(()=>c.treeStore.length,()=>{y(c.store)}),o.watch(()=>[e.width,e.height,e.option.columnWidth],()=>{e.option.columnWidth!=null&&(w.columnWidth=e.option.columnWidth),c.orderedColumns.map(K=>{var me;const se=K;return!((me=e.columns[K.index])!=null&&me.width)&&!se.resized&&(se.width=0),se}),B()}),o.watch(()=>e.option.searchValue,K=>{o.nextTick(()=>{K!==void 0&&(U((K==null?void 0:K.value)??K),d.isClientPaging&&(S(),V()))})},{immediate:!0}),o.watch(()=>{var K;return(K=e.option.page)==null?void 0:K.currentPage},K=>{var me;const se=K||1;d.currentPage=(me=e.option.page)!=null&&me.isInfinite?1:se},{immediate:!0}),o.watch(()=>d.currentPage,(K,se)=>{o.nextTick(()=>{if(T(se),d.isClientPaging&&K!==se&&(S(),V()),E(),K===d.highlightPage&&d.isHighlight){const me=c.pagingStore.map(we=>we.index).indexOf(M.highlightIdx);l.body.scrollTop=w.rowHeight*me,d.isHighlight=!d.isHighlight}})});const be=()=>({"column-sort__icon":!0,"column-sort__icon--asc":k.sortOrder==="asc","column-sort__icon--desc":k.sortOrder==="desc"}),oe=o.computed(()=>({width:w.gridWidth,height:w.gridHeight})),re=o.computed(()=>({"table-body":!0,stripe:M.stripeStyle,"bottom-border":!!c.viewStore.length,"non-border":!!M.borderStyle})),pe=o.computed(()=>({table:!0,"ev-grid":!0,"ev-tree-grid":!0,adjust:w.adjust,"non-header":!M.showHeader,"ev-tree-grid--empty":!c.viewStore.length})),Te=o.computed(()=>({"table-header":!0,"non-border":!!M.borderStyle})),Ge=o.computed(()=>({column:!0,"checkbox-all":!0,"non-border":!!M.borderStyle})),Lt=o.computed(()=>h.useCheckbox.use&&h.useCheckbox.headerCheck&&h.useCheckbox.mode!=="single"),Zt=K=>({column:!0,render:u(K),"non-border":!!M.borderStyle,[K.field]:K.field}),gl=(K,se)=>{const me=u(K);return{width:`${K.width}px`,"min-width":me?`${w.rendererMinWidth}px;`:`${w.minWidth}px`,"margin-right":c.orderedColumns.length-1===se&&C.hasVerticalScrollBar&&C.hasHorizontalScrollBar?`${w.scrollWidth}px`:"0px","border-right":c.orderedColumns.length-1===se?"none":"1px solid #CFCFCF"}},bl=K=>`${K}Node`;return{summaryScroll:v,gridStyle:oe,gridClass:pe,headerClass:Te,headerCheckboxClass:Ge,isHeaderCheckbox:Lt,bodyStyle:re,useSummary:i,useGridSetting:n,toolbarRef:t,stores:c,emptyText:s,...o.toRefs(M),...o.toRefs(l),...o.toRefs(c),...o.toRefs(a),...o.toRefs(C),...o.toRefs(w),...o.toRefs(b),...o.toRefs(h),...o.toRefs(k),...o.toRefs(L),...o.toRefs(d),...o.toRefs(r),isRenderer:u,getComponentName:f,getConvertValue:m,getColumnIndex:g,setPixelUnit:p,updateVScroll:E,updateHScroll:Z,onScroll:W,calculatedColumn:P,onResize:B,onShow:z,onColumnResize:D,onRowClick:R,onRowDblClick:X,onCheck:G,onCheckAll:N,setContextMenu:ee,onContextMenu:$,onSearch:U,handleExpand:F,getColumnClass:Zt,getColumnStyle:gl,getSlotName:bl,setGridSetting:ae,onApplyColumn:ne,onColumnContextMenu:he,onSort:O,sortIconClass:be}}},vw={class:"column-list"},Rw=["data-index"],Vw=["title","onClick"],Ew=["onClick"],Ww=["onMousedown"],Gw={ref:"table"},Zw=["title"],Xw={key:0},Nw={class:"is-empty"},Pw={ref:"resizeLine",class:"table-resize-line"};function Dw(e,t,n,i,s,l){var C;const a=o.resolveComponent("grid-option-button"),r=o.resolveComponent("toolbar"),c=o.resolveComponent("ev-checkbox"),d=o.resolveComponent("grid-sort-button"),h=o.resolveComponent("tree-grid-node"),u=o.resolveComponent("ev-context-menu"),f=o.resolveComponent("grid-summary"),m=o.resolveComponent("grid-pagination"),g=o.resolveComponent("column-setting"),p=o.resolveDirective("resize"),y=o.resolveDirective("observe-visibility");return o.openBlock(),o.createElementBlock(o.Fragment,null,[e.$slots.toolbar||i.useGridSetting?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:o.normalizeStyle(`width: ${e.gridWidth};`)},[o.createVNode(r,null,{toolbarWrapper:o.withCtx(()=>[i.useGridSetting?(o.openBlock(),o.createBlock(a,{key:0,class:"grid-setting__icon",onClick:i.setGridSetting},null,8,["onClick"])):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"toolbar",{item:{onSearch:i.onSearch}},void 0,!0)]),_:3})],4)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"grid-wrapper",style:o.normalizeStyle(i.gridStyle)},[o.createElementVNode("div",{ref:"grid",class:o.normalizeClass(i.gridClass)},[o.withDirectives(o.createElementVNode("div",{ref:"header",class:o.normalizeClass(i.headerClass)},[o.createElementVNode("ul",vw,[e.useCheckbox.use?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(i.headerCheckboxClass),style:o.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[i.isHeaderCheckbox?(o.openBlock(),o.createBlock(c,{key:0,modelValue:e.isHeaderChecked,"onUpdate:modelValue":t[0]||(t[0]=b=>e.isHeaderChecked=b),disabled:e.isHeaderUncheckable,indeterminate:e.isHeaderIndeterminate,onChange:i.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):o.createCommentVNode("",!0)],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.orderedColumns,(b,k)=>{var L,w;return o.openBlock(),o.createElementBlock(o.Fragment,{key:k},[!b.hide&&!b.hiddenDisplay?(o.openBlock(),o.createElementBlock("li",{key:0,"data-index":k,class:o.normalizeClass(i.getColumnClass(b)),style:o.normalizeStyle(i.getColumnStyle(b,k))},[b.customHeader&&e.$slots.customHeader?o.renderSlot(e.$slots,"customHeader",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:b.caption,class:o.normalizeClass(["column-name",{"column-name--click":i.useGridSetting}]),onClick:[M=>i.onColumnContextMenu(M,b),t[1]||(t[1]=o.withModifiers((...M)=>e.columnMenu.show&&e.columnMenu.show(...M),["prevent"]))]},[o.createTextVNode(o.toDisplayString(b.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(M=>i.onSort(b),["stop"])},[e.$slots.sortIcon?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(L=e.$props.option)!=null&&L.useSort&&(b!=null&&b.sortable)?(o.openBlock(),o.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,"sortIcon",{},void 0,!0)],4)):o.createCommentVNode("",!0),e.sortField===b.field?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(i.sortIconClass(b)),style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,`sortIcon_${e.sortOrder}`,{},void 0,!0)],6)):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[(w=e.$props.option)!=null&&w.useSort&&(b!=null&&b.sortable)?(o.openBlock(),o.createBlock(d,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},null,8,["style"])):o.createCommentVNode("",!0),e.sortField===b.field?(o.openBlock(),o.createBlock(d,{key:1,class:o.normalizeClass(i.sortIconClass(b)),icon:e.sortOrder,style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,visibility:e.sortOrder?b.hidden:!0})},null,8,["class","icon","style"])):o.createCommentVNode("",!0)],64))],8,Ew)],10,Vw)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(M=>i.onColumnResize(k,M),["stop","left"])},null,40,Ww)],14,Rw)):o.createCommentVNode("",!0)],64)}),128)),(C=e.$props.option.customContextMenu)!=null&&C.length?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({column:!0,"non-border":!!e.borderStyle}),style:o.normalizeStyle({width:"30px","min-width":"30px","margin-right":e.hasVerticalScrollBar||e.hasHorizontalScrollBar?`${e.scrollWidth}px`:"0px"})},null,6)):o.createCommentVNode("",!0)])],2),[[o.vShow,e.showHeader]]),o.createElementVNode("div",{ref:"body",class:o.normalizeClass(i.bodyStyle),onScroll:t[2]||(t[2]=(...b)=>i.onScroll&&i.onScroll(...b)),onContextmenu:[t[3]||(t[3]=b=>i.onContextMenu(b)),t[4]||(t[4]=o.withModifiers((...b)=>e.menu.show&&e.menu.show(...b),["prevent"]))]},[o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),o.createElementVNode("table",Gw,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.viewStore,(b,k)=>(o.openBlock(),o.createBlock(h,{key:k,"selected-data":e.selectedRow,"node-data":b,"use-checkbox":e.useCheckbox,"ordered-columns":e.orderedColumns,"expand-icon":n.option.expandIcon,"collapse-icon":n.option.collapseIcon,"parent-icon":n.option.parentIcon,"child-icon":n.option.childIcon,"custom-context-menu":e.customContextMenu,"menu-ref":e.menu,"is-resize":e.isResize,"row-height":e.rowHeight,"min-width":e.minWidth,"highlight-index":e.highlightIdx,"border-style":e.borderStyle,onCheckTreeData:i.onCheck,onExpandTreeData:i.handleExpand,onClickTreeData:i.onRowClick,onDblClickTreeData:i.onRowDblClick,onContextMenu:i.onContextMenu},o.createSlots({_:2},[o.renderList(e.orderedColumns,(L,w)=>({name:i.getSlotName(L.field),fn:o.withCtx(({item:M})=>[e.$slots[L.field]?o.renderSlot(e.$slots,L.field,{key:0,item:{data:M.data,fieldName:L.field}},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:i.getConvertValue(L,b[L.field])},o.toDisplayString(i.getConvertValue(L,b[L.field])),9,Zw))])})),e.$slots.contextmenuIcon?{name:"contextmenuIconNode",fn:o.withCtx(()=>[o.renderSlot(e.$slots,"contextmenuIcon",{},void 0,!0)]),key:"0"}:void 0]),1032,["selected-data","node-data","use-checkbox","ordered-columns","expand-icon","collapse-icon","parent-icon","child-icon","custom-context-menu","menu-ref","is-resize","row-height","min-width","highlight-index","border-style","onCheckTreeData","onExpandTreeData","onClickTreeData","onDblClickTreeData","onContextMenu"]))),128)),e.viewStore.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",Xw,[o.createElementVNode("td",Nw,o.toDisplayString(i.emptyText),1)]))])],512),o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),o.createVNode(u,{ref:"menu","custom-class":e.contextMenuClass,items:e.contextMenuItems},null,8,["custom-class","items"]),o.createVNode(u,{ref:"columnMenu",items:e.columnMenuItems},null,8,["items"]),o.createVNode(u,{ref:"gridSettingMenu",items:e.gridSettingContextMenuItems,"is-show-menu-on-click":e.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),o.withDirectives(o.createElementVNode("div",Pw,null,512),[[o.vShow,e.showResizeLine]])],2)],4)),[[p,i.onResize],[y,{callback:i.onShow,once:!0}]]),i.useSummary?(o.openBlock(),o.createBlock(f,{key:1,"is-tree":!0,"ordered-columns":e.orderedColumns,stores:i.stores,"use-checkbox":e.useCheckbox.use,"style-option":{borderStyle:e.borderStyle,minWidth:e.minWidth,rowHeight:e.rowHeight},"scroll-left":i.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):o.createCommentVNode("",!0),e.usePage&&!e.isInfinite?(o.openBlock(),o.createBlock(m,{key:2,modelValue:e.currentPage,"onUpdate:modelValue":t[5]||(t[5]=b=>e.currentPage=b),total:e.showTreeStore.length,"per-page":e.perPage,"visible-page":e.visiblePage,"show-page-info":e.showPageInfo,order:e.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):o.createCommentVNode("",!0),o.createVNode(g,{"is-show":e.isShowColumnSetting,"onUpdate:isShow":t[6]||(t[6]=b=>e.isShowColumnSetting=b),"is-show-menu-on-click":e.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":t[7]||(t[7]=b=>e.isShowMenuOnClick=b),columns:e.updatedColumns,"hidden-column":e.hiddenColumn,position:e.columnSettingPosition,"text-info":e.columnSettingTextInfo,onApplyColumn:i.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const Ri=ce(Mw,[["render",Dw],["__scopeId","data-v-9ed705b7"]]);Ri.install=e=>{e.component(Ri.name,Ri)};const Bw={name:"PageButton",props:{page:{type:Object,required:!0},disabled:{type:Boolean,default:!1}}},Ow=["aria-current"];function Yw(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("span",o.mergeProps({class:{"is-current":n.page.isCurrent,"is-disabled":n.disabled||n.page.disabled,[n.page.class]:!0}},e.$attrs,{"aria-current":n.page.isCurrent,onClick:t[0]||(t[0]=o.withModifiers((...a)=>n.page.click&&n.page.click(...a),["stop"]))}),[o.renderSlot(e.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(n.page.number),1)])],16,Ow)}const Fw={name:"EvPagination",components:{EvIcon:Mn,pageButton:ce(Bw,[["render",Yw]])},props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:e=>["left","right","center"].includes(e)},pagePerJump:{type:[Number,void 0],default:void 0}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=o.computed(()=>e.visiblePage>7?e.visiblePage:7),i=o.computed(()=>e.modelValue),s=o.computed(()=>e.total===0?1:Math.ceil(e.total/e.perPage)),l=o.computed(()=>i.value>1),a=o.computed(()=>i.value<s.value),r=o.computed(()=>Math.max(i.value-e.pagePerJump,1)),c=o.computed(()=>Math.min(i.value+e.pagePerJump,s.value)),d=o.computed(()=>{const p=i.value*e.perPage-e.perPage+1;return p>=0?p:0}),h=(p,y)=>{i.value===p||p<1||p>s.value||(t("update:modelValue",p),t("change",p),y&&y.target&&o.nextTick(()=>y.target.focus()))},u=(p,y={})=>({number:p,isCurrent:y.isCurrent??i.value===p,click:C=>h(p,C),input:(C,b)=>h(+b,C),disabled:y.disabled||!1,class:y.class||""}),f=(p,y)=>{const C=[],b=p>0?p:1;for(let k=b;k<=y;k++)C.push(u(k));return C},m=o.computed(()=>{const p=parseInt(n.value,10);if(p===0)return[];const y=Math.min(Math.max(0,p)||s.value,s.value);if(s.value<=y)return f(1,s.value);const C=y%2===0?1:0,b=Math.floor(y/2),k=s.value-b+1+C;if(i.value>b&&i.value<k){const w=s.value,M=i.value-b+2,V=i.value+b-2-C,S=M-1===2?2:-1,x=V+1===w-1?V+1:-1;return[u(1),u(S),...f(M,V),u(x),u(s.value)]}else if(i.value===b){const L=i.value+b-1-C;return[...f(1,L),u(-1),u(s.value)]}else if(i.value===k){const L=i.value-b+1;return[u(1),u(-1),...f(L,s.value)]}return[...f(1,b),u(-1),...f(k,s.value)]}),g=o.computed(()=>({"justify-content":e.order,flex:"3 1 0%"}));return o.watch(()=>s.value,p=>{i.value>p&&h(p)}),o.watch(()=>i.value,(p,y)=>{s.value<p&&h(y)}),{pageCount:s,pagesInRange:m,hasPrev:l,hasNext:a,listClasses:g,firstData:d,current:i,changePage:h,getPage:u,prevJumpPage:r,nextJumpPage:c}}},zw={class:"pagination"},Hw={key:0,class:"pagination-info"},Aw={key:0,class:"pagination-ellipsis"},_w=["onClick"];function Kw(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("page-button");return o.openBlock(),o.createElementBlock("nav",zw,[n.showPageInfo?(o.openBlock(),o.createElementBlock("small",Hw,[n.perPage===1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(i.firstData)+" / "+o.toDisplayString(n.total),1)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(i.firstData)+" - "+o.toDisplayString(Math.min(i.current*n.perPage,n.total))+" / "+o.toDisplayString(n.total),1)],64))])):o.createCommentVNode("",!0),o.createElementVNode("ul",{class:"pagination-list",style:o.normalizeStyle(i.listClasses)},[e.$props.pagePerJump?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(["step-button",{"is-disabled":!i.hasPrev}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasPrev,page:i.getPage(i.prevJumpPage,{isCurrent:!1})},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-double-left"})]),_:1},8,["disabled","page"])],2)):o.createCommentVNode("",!0),o.createElementVNode("li",{class:o.normalizeClass(["step-button",{"is-disabled":!i.hasPrev}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasPrev,page:i.getPage(i.current-1)},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-arrow-left"})]),_:1},8,["disabled","page"])],2),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.pagesInRange,(c,d)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:d},[c.number===-1?(o.openBlock(),o.createElementBlock("li",Aw,[...t[0]||(t[0]=[o.createElementVNode("span",null,"…",-1)])])):(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({"is-current":c.isCurrent,"is-page":!0}),onClick:c.click},[o.createVNode(r,{page:c},null,8,["page"])],10,_w))],64))),128)),o.createElementVNode("li",{class:o.normalizeClass(["step-button",{"is-disabled":!i.hasNext}])},[o.createVNode(r,{class:"pagination-next",disabled:!i.hasNext,page:i.getPage(i.current+1)},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-arrow-right"})]),_:1},8,["disabled","page"])],2),e.$props.pagePerJump?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass(["step-button",{"is-disabled":!i.hasNext}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasNext,page:i.getPage(i.nextJumpPage,{isCurrent:!1})},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-double-right"})]),_:1},8,["disabled","page"])],2)):o.createCommentVNode("",!0)],4)])}const Vi=ce(Fw,[["render",Kw]]);Vi.install=e=>{e.component(Vi.name,Vi)};const Uw=[Bn,On,Sn,Yn,Cn,kn,Fn,zn,An,_n,Kn,Jn,si,Mn,ai,ri,ci,di,hi,ui,fi,mi,pi,gi,yi,Li,Mi,vi,ps,bs,ys,Ri,Vi],Jw={version:Ci,install:e=>{e&&Uw.forEach(t=>{e.use(t)})}};le.EvButton=Sn,le.EvButtonGroup=Yn,le.EvCalendar=ai,le.EvChart=Li,le.EvChartBrush=vi,le.EvChartGroup=Mi,le.EvCheckbox=Cn,le.EvCheckboxGroup=kn,le.EvContextMenu=di,le.EvDatePicker=ri,le.EvGrid=yi,le.EvIcon=Mn,le.EvInputNumber=Jn,le.EvLoading=ui,le.EvMenu=mi,le.EvMessage=ps,le.EvMessageBox=ys,le.EvNotification=bs,le.EvPagination=Vi,le.EvProgress=fi,le.EvRadio=Fn,le.EvRadioGroup=zn,le.EvScheduler=ci,le.EvSelect=An,le.EvSlider=si,le.EvTabPanel=On,le.EvTabs=Bn,le.EvTextField=Kn,le.EvTimePicker=gi,le.EvToggle=_n,le.EvTree=pi,le.EvTreeGrid=Ri,le.EvWindow=hi,le.default=Jw,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
17
+ 15.998 11.998C15.998 11.1696 16.6696 10.498 17.498 10.498Z`,fill:"#ADB5BD"},null,-1)])])}const il=ce(GS,[["render",XS]]),Gt=0,Rn=1,ue=2,gi=3,sl=4,NS=()=>{const{props:e}=o.getCurrentInstance();return{isRenderer:(a={})=>{var r;return!!((r=a==null?void 0:a.render)!=null&&r.use)},getComponentName:(a="")=>{const r=h=>h.charAt(0).toUpperCase()+h.slice(1),c="Renderer";let d="";if(a.indexOf("_")!==-1){const h=a.split("_");for(let u=0;u<h.length;u++)d+=r(h[u])}else d=r(a);return d+c},getConvertValue:(a,r)=>{let c=a.type==="number"||a.type==="float"?Number(r):r;return a.type==="number"?(c=sn(r),c=c===!1?r:c):a.type==="float"&&(c=c.toFixed(a.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),c},getColumnIndex:a=>e.columns.findIndex(r=>r.field===a),setPixelUnit:a=>{let r=a;const c=r.toString().indexOf("px")>=0,d=r.toString().indexOf("%")>=0;return!c&&!d&&(r=`${r}px`),r}}},Cs=e=>{var i;const t=((i=e.movedColumns)!=null&&i.length?e.movedColumns:e.originColumns)??[],n=new Map((e.filteredColumns??[]).map(s=>[s.index,s]));return t.map(s=>{const l=n.get(s.index)??{};return{...s,...l}})},PS=e=>{const{scrollInfo:t,stores:n,elementInfo:i,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c,expandedInfo:d}=e,h=g=>{var b,k;const p=i.body,y=s.rowHeight,C=d.detailRowHeight??0;if(p){let L=n.store;l.isClientPaging&&(L=r());const w=((b=d.expandedRows)==null?void 0:b.length)??0,M=((k=d.expandedRows)==null?void 0:k.map(R=>L.findIndex(X=>X[ue]===R)))??[],V=L.length*y+w*C;let S=0,x=0;if(w)for(S=0;x+y<p.scrollTop;S++)M.includes(S)&&(x+=C),x+=y;else S=Math.floor(p.scrollTop/y),x=Math.max(S,0)*y;S>L.length-1&&(S=0);let I=0,T=0;if(w)for(let R=S;T<=p.clientHeight;R++)M.includes(R)&&(T+=C),T+=y,I+=1;else I=p.clientHeight>y?Math.ceil(p.clientHeight/y):L.length,T=I*y;const v=S+I+1,E=Math.max(S,0),Z=v,W=i.table;n.viewStore=L.slice(E,Z),t.hasVerticalScrollBar=I<L.length||p.clientHeight<W.clientHeight,t.vScrollTopHeight=x,t.vScrollBottomHeight=V-T-t.vScrollTopHeight,g&&l.isInfinite&&t.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(Z/l.perPage)+1,l.startIndex=Z,c({onScrollEnd:!0}))}},u=g=>{if(d.useRowDetail&&!d.detailRowHeight){let p=n.store;l.isClientPaging&&(p=r()),n.viewStore=[...p],t.vScrollTopHeight=0,t.vScrollBottomHeight=0}else h(g)},m=()=>{const g=i.header,p=i.body,y=i.table;g.scrollLeft=p.scrollLeft,a.value=p.scrollLeft,t.hasHorizontalScrollBar=p.clientWidth<y.clientWidth};return{updateVScroll:u,updateHScroll:m,onScroll:()=>{const g=i.body,p=g.scrollTop,y=g.scrollLeft,C=t.lastScroll.top,b=t.lastScroll.left,k=y!==b;p!==C&&(g!=null&&g.clientHeight)&&u(!0),k&&m(),t.lastScroll.top=p,t.lastScroll.left=y}}},DS=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{resizeInfo:i,elementInfo:s,checkInfo:l,expandedInfo:a,stores:r,isRenderer:c,updateVScroll:d,updateHScroll:h,contextInfo:u}=e,m=()=>{var b;let y=i.columnWidth,C=0;if(i.adjust){const k=s.body;let L=k.offsetWidth;const w=k.offsetHeight,M=((b=k.querySelector("tr"))==null?void 0:b.offsetHeight)||i.rowHeight,V=L-k.clientWidth,S=r.orderedColumns.reduce((x,I)=>(I.hide||I.hiddenDisplay||(I.width?x.totalWidth+=I.width:x.emptyCount++),x),{totalWidth:u.customContextMenu.length?30:0,emptyCount:0});if(M*t.rows.length>w&&(L-=V),l.useCheckbox.use&&(L-=i.minWidth),a.useRowDetail&&(L-=i.minWidth),y=L-S.totalWidth,y>0){const x=S.emptyCount===0?0:Math.floor(y/S.emptyCount);C=y-x*S.emptyCount,y=S.emptyCount!==0?x:y}else y=i.columnWidth;y=y<i.minWidth?i.minWidth:y,i.columnWidth=y}if(r.orderedColumns.forEach(k=>{const L=c(k)?i.rendererMinWidth:i.minWidth;k.width&&k.width<L&&(k.width=L),!k.width&&!k.hide&&(k.width=y)}),C&&r.orderedColumns.length){let k=r.orderedColumns.length-1,L=r.orderedColumns[k];for(;k>0&&L&&(L.hide||L.hiddenDisplay);)k-=1,L=r.orderedColumns[k];L&&(L.width+=C)}},f=()=>{const y=new Map(t.columns.map(C=>[C.field,C.width]));o.nextTick(()=>{var C,b;i.adjust&&r.orderedColumns.forEach(k=>{const L=k;return L.resized||(L.width=y.get(L.field)??0),L},void 0),m(),(C=s.body)!=null&&C.clientHeight&&d(),(b=s.body)!=null&&b.clientWidth&&h()})};return{calculatedColumn:m,onResize:f,onShow:y=>{y&&f()},onColumnResize:(y,C)=>{C.preventDefault();const b=s.header,k=s.body,L=b.getBoundingClientRect().left,w=b.querySelector(`li[data-index="${y}"]`),M=c(r.orderedColumns[y])?i.rendererMinWidth:i.minWidth,V=w.getBoundingClientRect(),S=s.resizeLine,x=V.left-L+M,I=V.right-L,T=C.clientX,v=V.left-L;k.style.overflow="auto",S.style.left=`${I}px`,i.showResizeLine=!0;const E=W=>{const R=W.clientX-T,X=I+R,G=Math.max(x,X);S.style.left=`${G}px`},Z=()=>{const R=parseInt(S.style.left,10)-v;r.orderedColumns[y]&&(r.orderedColumns[y].width=R,r.orderedColumns[y].resized=!0),i.showResizeLine=!1,document.removeEventListener("mousemove",E),f();const X=Cs(r);n("resize-column",{column:r.orderedColumns[y],columns:X}),n("change-column-info",{type:"resize",columns:X})};document.addEventListener("mousemove",E),document.addEventListener("mouseup",Z,{once:!0})}}},BS=e=>{const{emit:t}=o.getCurrentInstance(),{selectInfo:n,stores:i}=e,s=(d,h)=>{var f;const u=(f=d.target.tagName)==null?void 0:f.toLowerCase();let m={};return u==="td"?m=d.target.dataset:m=d.target.parentNode.dataset,{event:d,rowData:h[ue],rowIndex:h[Gt],cellName:m.name,cellIndex:m.index}};let l=null,a=-1;return{onRowClick:(d,h,u)=>{var g,p,y;if((g=d.target.parentElement.classList)!=null&&g.contains("row-checkbox-input"))return!1;const m=!!((y=(p=d.target.closest("td"))==null?void 0:p.classList)!=null&&y.contains("row-contextmenu")),f=(C,b,k)=>{if(C==="shift"){const L=h[Gt];if(a>-1)for(let w=Math.min(L,a);w<=Math.max(L,a);w++)if(!b)i.originStore[w][gi]=!0,a!==w&&n.selectedRow.push(i.originStore[w][ue]);else{i.originStore[w][gi]=!1;const M=n.selectedRow.indexOf(i.originStore[w][ue]);M>-1&&n.selectedRow.splice(M,1)}}else C==="ctrl"&&(b?n.selectedRow.splice(n.selectedRow.indexOf(h[ue]),1):n.selectedRow.push(k))};return l&&clearTimeout(l),l=setTimeout(()=>{if(n.useSelect){const C=h[ue],b=h[gi];h[gi]=!h[gi];let k="";d.shiftKey?k="shift":d.ctrlKey&&(k="ctrl"),n.multiple&&k?f(k,b,C):u||m?(n.selectedRow=[...n.selectedRow],n.selectedRow.includes(C)||(n.selectedRow=[C])):b?n.selectedRow=[]:n.selectedRow=[C],a=h[Gt],t("update:selected",n.selectedRow),t("click-row",s(d,h))}},100),!0},onRowDblClick:(d,h)=>{l&&clearTimeout(l),t("dblclick-row",s(d,h))}}},OS=e=>{const{checkInfo:t,stores:n,pageInfo:i,getPagingData:s}=e,{props:l,emit:a}=o.getCurrentInstance(),r=h=>{const u=n.originStore.findIndex(m=>m[ue]===h[ue]);u!==-1&&(n.originStore[u][Rn]=h[Rn])};return{onCheck:(h,u)=>{if(t.useCheckbox.mode==="single"&&t.prevCheckedRow.length&&(t.prevCheckedRow=[],r(t.prevCheckedRow)),u[Rn]){t.useCheckbox.mode==="single"?t.checkedRows=[u[ue]]:t.checkedRows.push(u[ue]);let m=n.store;i.isClientPaging&&(m=s());const f=m.filter(g=>!l.uncheckable.includes(g[ue])).filter(g=>!l.disabledRows.includes(g[ue])).every(g=>g[Rn]);m.length&&f&&(t.isHeaderChecked=!0),t.isHeaderIndeterminate=m.length&&!f}else t.useCheckbox.mode==="single"?t.checkedRows=[]:t.checkedRows.splice(t.checkedRows.indexOf(u[ue]),1),t.isHeaderChecked=!1,t.isHeaderIndeterminate=!!(n.store.length&&t.checkedRows.length);t.prevCheckedRow=u.slice(),a("update:checked",t.checkedRows),a("check-row",h,u[Gt],u[ue])},onCheckAll:h=>{const u=t.isHeaderChecked;let m=n.store;i.isClientPaging&&(m=s()),m.forEach(f=>{const g=l.uncheckable.includes(f[ue])||l.disabledRows.includes(f[ue]);u?!t.checkedRows.includes(f[ue])&&!g&&t.checkedRows.push(f[ue]):t.checkedRows.splice(t.checkedRows.indexOf(f[ue]),1),g||(f[Rn]=u)}),t.isHeaderIndeterminate=!1,a("update:checked",t.checkedRows),a("check-all",h,t.checkedRows)}}},YS=e=>{const{expandedInfo:t}=e,{emit:n}=o.getCurrentInstance();return{onExpanded:(s,l)=>{const a=l[ue],r=t.expandedRows.indexOf(a);r===-1?t.expandedRows.push(a):t.expandedRows.splice(r,1),l[sl]=!l[sl],n("update:expanded",t.expandedRows),n("expand-row",s,l[ue],l[sl],l[Gt])}}},FS=e=>{const{sortInfo:t,stores:n,updatePagingInfo:i}=e,{emit:s}=o.getCurrentInstance(),l=(p=!0)=>p?["asc","desc","init"]:["asc","desc"];function a(){this.orders=l(),this.dequeue=()=>this.orders.shift(),this.enqueue=p=>this.orders.push(p)}const r=(p,y="init")=>{n.orderedColumns.forEach(C=>{C.index===(p==null?void 0:p.index)&&y?C.sortOption={sortType:y}:C.sortOption={sortType:"init"}})},c=()=>{const p=n.originColumns.filter(y=>y.hiddenDisplay||y.hide);p.length&&p.forEach(y=>{y.sortOption={sortType:"init"}})},d=new a,h=(p,y=!0)=>{const{sortType:C}=(p==null?void 0:p.sortOption)||{};t.sortColumn=p,t.sortField=p==null?void 0:p.field,t.sortOrder=C,t.isSorting=!!C,y&&(r(p,C),s("change-column-info",{type:"sort",columns:Cs(n)}))},u=(p,y)=>{if(p.sortable===void 0?!0:p.sortable){t.sortColumn=p,t.sortField!==(p==null?void 0:p.field)&&(d.orders=l(),t.sortField=p==null?void 0:p.field),y&&(d.orders=l(),y==="desc"&&(t.sortOrder=d.dequeue(),d.enqueue(t.sortOrder))),t.sortOrder=d.dequeue(),d.enqueue(t.sortOrder),t.isSorting=!0,i({onSort:!0}),c(),r(p,t.sortOrder);const b=Cs(n);s("sort-column",{field:t.sortField,order:t.sortOrder,column:t.sortColumn,columns:b}),s("change-column-info",{type:"sort",columns:b})}},m=()=>{var I;const{field:p,index:y}=t.sortColumn||{},C=((I=t.sortFunction)==null?void 0:I[p])??null,b=(T,v)=>T>v?-1:1,k=(T,v)=>T<v?-1:1,L=(T,v)=>(T===null)-(v===null)||Number(v)-Number(T),w=(T,v)=>(T===null)-(v===null)||Number(T)-Number(v);if(t.sortOrder==="init"||!t.sortField&&!t.isSorting){n.store.sort((T,v)=>typeof T[Gt]=="number"?k(T[Gt],v[Gt]):0);return}const M=t.sortColumn.type||"string",V=t.sortOrder==="desc"?b:k,S=t.sortOrder==="desc"?L:w,x=(T,v)=>{var W,R;let E=T[ue][y],Z=v[ue][y];return T[ue][y]&&typeof T[ue][y]=="object"&&(E=T[ue][y][(W=n.originColumns[y])==null?void 0:W.field],Z=v[ue][y][(R=n.originColumns[y])==null?void 0:R.field]),{aCol:E,bCol:Z}};if(C){n.store.sort((T,v)=>{const E=T[ue][y],Z=v[ue][y],W=C(E,Z);return t.sortOrder==="desc"?-W:W});return}switch(M){case"string":n.store.sort((T,v)=>{let{aCol:E,bCol:Z}=x(T,v);if((!E||typeof E=="string")&&(!Z||typeof Z=="string")){E=E||"",Z=Z||"";const W=E.toLowerCase(),R=Z.toLowerCase();if(E!==Z&&W===R){const X=Array.from(E).findIndex((G,N)=>G!==Z[N]);return V(E[X],Z[X])}return V(W,R)}return 0});break;case"stringNumber":n.store.sort((T,v)=>{let{aCol:E,bCol:Z}=x(T,v);return!E||typeof E=="string"||typeof E=="number"?(E=E===""?null:E,Z=Z===""?null:Z,S(E??null,Z??null)):0});break;default:n.store.sort((T,v)=>{const{aCol:E,bCol:Z}=x(T,v);return!E||typeof E=="number"||typeof E=="boolean"?S(E??null,Z??null):0});break}},f=()=>{var p;return(p=n.orderedColumns)==null?void 0:p.find(y=>(y==null?void 0:y.sortOption)&&l(!1).includes(y.sortOption.sortType))};return{onSort:u,getSortTarget:f,setSort:m,setSortInfo:h,hasSortTarget:()=>!!f()}},HS=e=>{const{props:t}=o.getCurrentInstance(),{columnSettingInfo:n,filterInfo:i,stores:s,checkInfo:l,pageInfo:a,getConvertValue:r,updateVScroll:c,getPagingData:d,updatePagingInfo:h,getColumnIndex:u}=e,m=w=>{let M=0;w.forEach(V=>{const S=l.checkedRows.includes(V[ue]);V[Rn]=S,M+=S?1:0}),w.length&&(l.isHeaderChecked=w.length===M,l.isHeaderIndeterminate=w.length!==M&&M>0,l.isHeaderUncheckable=w.every(V=>t.uncheckable.includes(V[ue])||t.disabledRows.includes(V[ue])))},f=(w,M,V)=>{if(typeof w!="string"||M===null)return!1;const S=M==null?void 0:M.toLowerCase(),x=w==null?void 0:w.toLowerCase();let I=S.includes(x);return V&&(V==="start"?I=S.startsWith(x):V==="end"&&(I=S.endsWith(x))),I},g=(w,M)=>{const V=M.comparison,S=M.value;let x=w[ue][M.index];(x||x===0)&&(x=`${w[ue][M.index]}`);let I;return V==="="?I=(S==null?void 0:S.toLowerCase())===(x==null?void 0:x.toLowerCase()):V==="!="?I=(S==null?void 0:S.toLowerCase())!==(x==null?void 0:x.toLowerCase()):V==="%s%"?I=f(S,x):V==="notLike"?I=!f(S,x):V==="s%"?I=f(S,x,"start"):V==="%s"?I=f(S,x,"end"):V==="isEmpty"?I=x==null||x==="":V==="isNotEmpty"&&(I=!!x),I},p=(w,M,V)=>{const S=M.comparison,x=Number(M.value.replace(/,/g,""));let I=Number(w[ue][M.index]),T;return V==="float"&&(I=Number(I.toFixed(3))),S==="="?T=I===x:S===">"?T=I>x:S==="<"?T=I<x:S==="<="?T=I<=x:S===">="?T=I>=x:S==="!="?T=I!==x:S==="isEmpty"?T=I==null||isNaN(I):S==="isNotEmpty"&&(T=!!I||I===0),T},y=(w,M)=>{const V=M.comparison,S=M.value,x=`${w[ue][M.index]}`;let I;return V==="="&&(I=x===S),I},C=(w,M,V)=>{let S=M==="string"||M==="stringNumber"?g:p;return M==="boolean"&&(S=y),w.filter(x=>S(x,V,M))||[]},b=()=>{const w=i.filteringItemsByColumn,M=Object.keys(w),V=s.originStore;let S=[],x=!1,I=[];M.forEach((T,v)=>{const E=w[T],Z=u(T),W=t.columns[Z].type,R=i.columnOperator==="or",X=v>0&&i.columnOperator==="and";E.forEach((G,N)=>{!S.length&&!x?S=C(V,W,{...G,index:Z}):X&&G.operator==="or"?N>0?S.push(...C(I,W,{...G,index:Z})):S=C(I,W,{...G,index:Z}):N===0&&R||N!==0&&G.operator==="or"?S.push(...C(V,W,{...G,index:Z})):S=C(S,W,{...G,index:Z}),x=!0}),I=JSON.parse(JSON.stringify(S))}),x?s.filterStore=ey(S,JSON.stringify):s.filterStore=V};let k=null;return{onSearch:w=>{k&&clearTimeout(k),k=setTimeout(()=>{i.isSearch=!1,i.searchWord=w,w&&(s.searchStore=s.store.filter(M=>{let V=!1;const S=n.isFilteringColumn?M[ue].filter((x,I)=>n.visibleColumnIdx.includes(I)):M[ue];for(let x=0;x<s.orderedColumns.length;x++){const I=s.orderedColumns[x]||{};let T=S[I.index]??null;if(I.type=I.type||"string",T!==null&&(T instanceof Array?T=JSON.stringify(T):typeof T=="object"&&(T=T[I.field]),!I.hide&&((I==null?void 0:I.searchable)===void 0||I!=null&&I.searchable)&&(T=r(I,T).toString(),V=T.toLowerCase().includes(w.toString().toLowerCase()),V)))break}return V}),i.isSearch=!0),m(s.store),!w&&a.isClientPaging&&a.prevPage&&(a.currentPage=1,s.pagingStore=d()),h({onSearch:!0}),c()},500)},setFilter:b,setHeaderCheckboxByFilter:m}},zS=e=>{const{contextInfo:t,stores:n,selectInfo:i,onSort:s,filterInfo:l,useGridSetting:a,columnSettingInfo:r,setColumnHidden:c}=e;let d=null;const{emit:h}=o.getCurrentInstance(),u=p=>{d&&clearTimeout(d);const y=[];d=setTimeout(()=>{if(t.customContextMenu.length){const C=t.customContextMenu.map(b=>{const k=b;return k.validate&&(k.disabled=!k.validate(k.itemId,i.selectedRow)),k.selectedRow=i.selectedRow??[],k.contextmenuInfo=i.contextmenuInfo??[],k});y.push(...C)}t.contextMenuItems=y,t.menu.show(p)},200)};return{setContextMenu:u,onContextMenu:p=>{var k,L,w;p.preventDefault();const C=(L=(k=p.target.closest(".row"))==null?void 0:k.dataset)==null?void 0:L.index;let b=null;C&&(b=(w=n.viewStore.find(M=>M[Gt]===+C))==null?void 0:w[ue]),b&&(i.contextmenuInfo=[b],u(p))},onColumnContextMenu:(p,y)=>{var C,b,k,L,w,M,V,S;if(p.target.className==="column-name"){const x=y.sortable===void 0?!0:y.sortable,I=l.isFiltering&&y.filterable===void 0?!0:y.filterable,T=[{text:((C=t.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!x,hidden:(b=t.hiddenColumnMenuItem)==null?void 0:b.ascending,click:()=>s(y,"asc")},{text:((k=t.columnMenuTextInfo)==null?void 0:k.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!x,hidden:(L=t.hiddenColumnMenuItem)==null?void 0:L.descending,click:()=>s(y,"desc")},{text:((w=t.columnMenuTextInfo)==null?void 0:w.filter)??"Filter",iconClass:"ev-icon-filter-list",click:()=>{const v=document.documentElement.clientWidth,E=t.columnMenu.menuStyle.clientX,Z=t.columnMenu.menuStyle.pageX,W=350;v<E+W&&(t.columnMenu.menuStyle.left=`${Z-W}px`),l.filterSettingPosition={top:t.columnMenu.menuStyle.top,left:t.columnMenu.menuStyle.left},l.isShowFilterSetting=!0,l.filteringColumn=y,h("change-column-info",{type:"filter",columns:n.updatedColumns})},disabled:!I,hidden:((M=t.hiddenColumnMenuItem)==null?void 0:M.filter)||!l.isFiltering},{text:((V=t.columnMenuTextInfo)==null?void 0:V.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!a.value||n.orderedColumns.length===1||y.fixed,hidden:((S=t.hiddenColumnMenuItem)==null?void 0:S.hide)||!a.value,click:()=>{c(y.field),h("change-column-status",{columns:n.updatedColumns}),h("change-column-info",{type:"display",columns:n.updatedColumns})}}];if(t.columnMenuItems=[],!x&&!I&&!a.value)return;t.columnMenuItems=T.filter(v=>!v.hidden)}},onGridSettingContextMenu:p=>{const{useDefaultColumnSetting:y,columnSettingTextInfo:C}=r,b={text:(C==null?void 0:C.title)??"Column List",isShowMenu:!0,click:()=>{r.isShowColumnSetting=!0,t.isShowMenuOnClick=!0}};t.customGridSettingContextMenu.length&&(t.gridSettingContextMenuItems=[...t.customGridSettingContextMenu]),y&&t.gridSettingContextMenuItems.push(b),t.gridSettingMenu.show(p)}}},AS=e=>{const{props:t}=o.getCurrentInstance(),{selectInfo:n,checkInfo:i,stores:s,sortInfo:l,elementInfo:a,filterInfo:r,expandedInfo:c,setSort:d,setSortInfo:h,updateVScroll:u,setFilter:m}=e;return{setStore:({rows:g,isMakeIndex:p=!0,isInit:y=!1})=>{var b,k,L;const C=s.orderedColumns.find(w=>(w==null?void 0:w.sortOption)&&["asc","desc"].includes(w.sortOption.sortType));if(p){const w=[];let M=!1;g.forEach((V,S)=>{const x=t.checked.includes(V),I=t.uncheckable.includes(V)||t.disabledRows.includes(V);let T=!1;n.useSelect&&(T=t.selected.includes(V)),!x&&!I&&(M=!0);let v=!1;c.useRowDetail&&(v=t.expanded.includes(V));const E=t.disabledRows.includes(V);w.push([S,x,V,T,v,I,E])}),g.length!==t.checked.length&&(g.length===((b=t.uncheckable)==null?void 0:b.length)||g.length===((k=t.disabledRows)==null?void 0:k.length))&&(M=!0),i.isHeaderChecked=g.length>0?!M:!1,i.isHeaderIndeterminate=M&&!!i.checkedRows.length,i.isHeaderUncheckable=g.every(V=>t.uncheckable.includes(V)||t.disabledRows.includes(V)),s.originStore=w}r.isFiltering&&m(),C&&y&&h(C,!1),l.sortField&&d(),(L=a.body)!=null&&L.clientHeight&&u()}}},_S=e=>{const{emit:t}=o.getCurrentInstance(),{stores:n,pageInfo:i,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=e,c=()=>{const u=(i.currentPage-1)*i.perPage,m=parseInt(u,10)+parseInt(i.perPage,10);return n.store.slice(u,m)},d=u=>{t("page-change",{eventName:u,pageInfo:{currentPage:i.currentPage,prevPage:i.prevPage,startIndex:i.startIndex,total:i.pageTotal,perPage:i.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(m=>!m.hide&&((m==null?void 0:m.searchable)===void 0||(m==null?void 0:m.searchable))).map(m=>m.field)}}),i.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(i.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(i.isClientPaging)if(i.prevPage=u,n.store.length<=i.perPage)n.pagingStore=n.store;else{const m=(i.currentPage-1)*i.perPage,f=parseInt(m,10)+parseInt(i.perPage,10);n.pagingStore=n.store.slice(m,f),a.body.scrollTop=0,i.startIndex=m}d({onChangePage:!0})}}},rc=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{stores:i,columnSettingInfo:s,contextInfo:l,onSearch:a,onResize:r}=e,c=p=>{var y,C,b;if(s.isShowColumnSetting)if(s.columnSettingPosition.columnListMenuWidth=0,l.gridSettingContextMenuItems.length){const k=l.gridSettingContextMenuItems.length-1,L=(b=(C=(y=l.gridSettingMenu)==null?void 0:y.rootMenuList)==null?void 0:C.$el)==null?void 0:b.children[0].children[k].getBoundingClientRect();s.columnSettingPosition.columnListMenuWidth=L.width,s.columnSettingPosition.top=L.top,s.columnSettingPosition.left=L.right}else{const k=p==null?void 0:p.getBoundingClientRect(),L=k==null?void 0:k.height;s.columnSettingPosition.top=(k==null?void 0:k.top)+L,s.columnSettingPosition.left=k==null?void 0:k.right}},d=()=>{i.filteredColumns.length=0,s.isFilteringColumn=!1,s.visibleColumnIdx=[],s.hiddenColumn=""},h=()=>Array.isArray(i.movedColumns)&&i.movedColumns.length?i.movedColumns:i.originColumns||[],u=(p,y)=>{var b;if(!p)return;p.hiddenDisplay=y;const C=(b=i.originColumns)==null?void 0:b.find(k=>k.index===p.index);if(C&&C!==p&&(C.hiddenDisplay=y),Array.isArray(i.movedColumns)){const k=i.movedColumns.find(L=>L.index===p.index);k&&k!==p&&(k.hiddenDisplay=y)}},m=()=>{s.visibleColumnIdx=i.filteredColumns.map(C=>C.index);const p=i.originColumns.filter(C=>!C.hide||C.hiddenDisplay).map(C=>C.index),y=s.visibleColumnIdx;s.isFilteringColumn=y.length!==p.length,t.option.searchValue&&a(t.option.searchValue),r()};return{setPositionColumnSetting:c,initColumnSettingInfo:d,onApplyColumn:p=>{const y=i.orderedColumns.filter(L=>!L.hide&&!L.hiddenDisplay);if(p.length===y.length&&y.every(L=>p.includes(L.field)))return;const b=h(),k=new Set(p);i.filteredColumns=b.filter(L=>{const w=k.has(L.field)||!L.caption;return u(L,!w),w}),s.hiddenColumn="",m(),n("change-column-status",{columns:i.updatedColumns}),n("change-column-info",{type:"display",columns:i.updatedColumns})},setColumnHidden:p=>{const y=i.orderedColumns.filter(b=>!b.hide&&!b.hiddenDisplay);if(y.length===1)return;i.filteredColumns=y.filter(b=>{const k=b.field===p;return u(b,k),!k}),h().forEach(b=>{b.field===p&&u(b,!0)}),s.hiddenColumn=p,m()}}},KS=({stores:e})=>{const{emit:t}=o.getCurrentInstance(),n=r=>{var u;const c=(u=e.movedColumns)!=null&&u.length?[...e.movedColumns]:[...e.originColumns],d=[...r],h=new Set(d.map(m=>m.index));e.movedColumns=c.map(m=>h.has(m.index)?d.shift():m)},i=(r,c)=>{const d=parseInt(r,10),h=parseInt(c,10);if(!Number.isInteger(d)||!Number.isInteger(h))return;const u=[...e.orderedColumns],m=u[d];u.splice(d,1),u.splice(h,0,m),e.filteredColumns.length&&(e.filteredColumns=u),n(u)};return{onDragStart:r=>{r.dataTransfer.setData("text/plain",r.currentTarget.dataset.index)},onDragOver:r=>{r.preventDefault()},onDrop:r=>{r.preventDefault();const c=r.dataTransfer.getData("text/plain"),d=r.target.parentNode.dataset.index;i(c,d),t("change-column-order",{column:e.orderedColumns[d],columns:e.updatedColumns}),t("change-column-info",{type:"order",columns:e.updatedColumns})}}},US={name:"EvGrid",directives:{clickoutside:Ji,observeVisibility:po,resize:Pn},components:{Toolbar:tS,GridPagination:ec,GridSummary:oc,ColumnSetting:lc,FilterSetting:MS,GridSortButton:ac,GridOptionButton:il},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array],default:()=>[]},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},uncheckable:{type:[Array],default:()=>[]},expanded:{type:[Array],default:()=>[]},disabledRows:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})}},emits:{"update:selected":null,"update:checked":null,"update:expanded":null,"check-row":null,"check-all":null,"click-row":null,"dblclick-row":null,"page-change":null,"sort-column":null,"expand-row":null,"resize-column":({column:e,columns:t})=>({column:e,columns:t}),"change-column-order":({column:e,columns:t})=>({column:e,columns:t}),"change-column-status":({columns:e})=>({columns:e}),"change-column-info":({type:e,columns:t})=>({type:e,columns:t})},setup(e){var Ac,_c,Kc,Uc,Jc,jc,Qc,$c,qc;const{isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h}=NS(),u=o.ref(null),m=o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.useGridSetting)==null?void 0:ie.use)||!1}),f=o.computed(()=>e.option.showHeader??!0),g=o.computed(()=>{var _;return((_=e.option)==null?void 0:_.useSummary)||!1}),p=o.computed(()=>{var _;return((_=e.option.style)==null?void 0:_.stripe)||!1}),y=o.computed(()=>{var _;return((_=e.option.style)==null?void 0:_.border)||""}),C=o.computed(()=>{var _;return((_=e.option.style)==null?void 0:_.highlight)??-1}),b=o.computed(()=>e.option.emptyText??"No records"),k=e.option.rowMinHeight||35,L=o.ref(0),w=o.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),M=o.reactive({isSearch:!1,searchWord:"",isFiltering:o.computed(()=>e.option.useFilter??!1),isShowFilterSetting:!1,filterSettingPosition:{left:0,top:0},filteringColumn:null,filteringItemsByColumn:{},columnOperator:"and"}),V=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.useGridSetting)==null?void 0:ie.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((_c=(Ac=e.option)==null?void 0:Ac.useGridSetting)==null?void 0:_c.columnMenuText)??"Column List",search:((Uc=(Kc=e.option)==null?void 0:Kc.useGridSetting)==null?void 0:Uc.searchText)??"Search",empty:((jc=(Jc=e.option)==null?void 0:Jc.useGridSetting)==null?void 0:jc.emptyText)??"No records",ok:(($c=(Qc=e.option)==null?void 0:Qc.useGridSetting)==null?void 0:$c.okBtnText)??"OK"}}),S=o.reactive({viewStore:[],originStore:[],pagingStore:[],searchStore:[],filterStore:[],store:o.computed(()=>{const _=M.isFiltering?S.filterStore:S.originStore;return M.isSearch?S.searchStore:_}),filteredColumns:[],movedColumns:[],originColumns:o.computed(()=>e.columns.map((_,ie)=>{var Le;return{index:ie,hiddenDisplay:!1,..._,width:isFinite(_.width)?_.width:void 0,sortOption:{sortType:((Le=_==null?void 0:_.sortOption)==null?void 0:Le.sortType)||"init"}}})),orderedColumns:o.computed(()=>{const _=S.movedColumns.length?S.movedColumns:S.originColumns;return S.filteredColumns.length?S.filteredColumns:_}),updatedColumns:o.computed(()=>Cs(S))}),x=o.reactive({usePage:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.use)||!1}),useClient:((qc=e.option.page)==null?void 0:qc.useClient)||!1,isInfinite:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var _,ie;return(_=e.option.page)!=null&&_.useClient?S.store.length:(ie=e.option.page)==null?void 0:ie.total}),perPage:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.perPage)||20}),visiblePage:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.visiblePage)||8}),order:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.order)||"center"}),showPageInfo:o.computed(()=>{var _;return((_=e.option.page)==null?void 0:_.showPageInfo)||!1}),isClientPaging:o.computed(()=>x.useClient&&x.usePage&&!x.isInfinite),isHighlight:!1,highlightPage:0}),I=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:e.checked,useCheckbox:o.computed(()=>e.option.useCheckbox||{})}),T=o.reactive({expandedRows:e.expanded,useRowDetail:o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.rowDetail)==null?void 0:ie.use)??!1}),detailRowHeight:o.computed(()=>{var _,ie;return(ie=(_=e.option)==null?void 0:_.rowDetail)==null?void 0:ie.detailRowHeight})}),v=o.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),E=o.reactive({contextmenuInfo:e.contextmenuInfo,selectedRow:e.selected,useSelect:o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.useSelection)==null?void 0:ie.use)??!0}),multiple:o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.useSelection)==null?void 0:ie.multiple)??!1})}),Z=o.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:e.option.customAscFunction??{}}),W=o.reactive({menu:null,contextMenuItems:[],contextMenuClass:e.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:e.option.columnMenuText||{},hiddenColumnMenuItem:e.option.hiddenColumnMenuItem||{},customContextMenu:e.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:o.computed(()=>{var _,ie;return((ie=(_=e.option)==null?void 0:_.useGridSetting)==null?void 0:ie.customContextMenu)||[]}),isShowMenuOnClick:!1}),R=o.reactive({minWidth:40,rendererMinWidth:80,iconWidth:42,showResizeLine:!1,adjust:e.option.adjust||!1,columnWidth:e.option.columnWidth||80,scrollWidth:e.option.scrollWidth||17,rowHeight:o.computed(()=>e.option.rowHeight>k?e.option.rowHeight:k),gridWidth:o.computed(()=>e.width?h(e.width):"100%"),gridHeight:o.computed(()=>e.height?h(e.height):"100%")}),X=()=>{I.checkedRows=[],I.isHeaderChecked=!1,I.isHeaderIndeterminate=!1,S.store.forEach(_=>{_[1]=!1})},G=()=>{E.selectedRow=[],S.store.forEach(_=>{_[3]=!1})},N=()=>{S.store.forEach(_=>{_[4]=!1}),T.expandedRows=[]},{getPagingData:P,updatePagingInfo:B,changePage:H}=_S({stores:S,pageInfo:x,sortInfo:Z,filterInfo:M,elementInfo:w,clearCheckInfo:X}),D=o.ref(0),{updateVScroll:Y,updateHScroll:F,onScroll:O}=PS({scrollInfo:v,stores:S,elementInfo:w,resizeInfo:R,pageInfo:x,summaryScroll:D,expandedInfo:T,getPagingData:P,updatePagingInfo:B}),{onCheck:z,onCheckAll:j}=OS({checkInfo:I,stores:S,pageInfo:x,getPagingData:P}),{onExpanded:U}=YS({expandedInfo:T}),{onSort:Q,getSortTarget:J,setSort:ne,setSortInfo:q,hasSortTarget:ee}=FS({sortInfo:Z,stores:S,updatePagingInfo:B}),{onSearch:$,setFilter:he,setHeaderCheckboxByFilter:fe}=HS({columnSettingInfo:V,filterInfo:M,stores:S,checkInfo:I,pageInfo:x,getConvertValue:c,updateVScroll:Y,getPagingData:P,updatePagingInfo:B,getColumnIndex:d}),{setStore:ae}=AS({selectInfo:E,checkInfo:I,stores:S,sortInfo:Z,elementInfo:w,filterInfo:M,expandedInfo:T,setSort:ne,setSortInfo:q,updateVScroll:Y,setFilter:he}),{calculatedColumn:Se,onResize:ye,onShow:oe,onColumnResize:re}=DS({resizeInfo:R,elementInfo:w,checkInfo:I,expandedInfo:T,stores:S,isRenderer:a,updateVScroll:Y,updateHScroll:F,contextInfo:W}),{setPositionColumnSetting:pe,initColumnSettingInfo:Te,onApplyColumn:Ge,setColumnHidden:Lt}=rc({stores:S,columnSettingInfo:V,contextInfo:W,onSearch:$,onResize:ye}),{setContextMenu:Zt,onContextMenu:Sl,onColumnContextMenu:Cl,onGridSettingContextMenu:Gs}=zS({contextInfo:W,stores:S,selectInfo:E,useGridSetting:m,filterInfo:M,columnSettingInfo:V,setColumnHidden:Lt,onSort:Q}),{onRowClick:Zs,onRowDblClick:Xs}=BS({selectInfo:E,stores:S}),{onDragStart:Ns,onDragOver:Ps,onDrop:Ds}=KS({stores:S}),Bs=_=>{W.gridSettingContextMenuItems.length=0,W.customGridSettingContextMenu.length?Gs(_):V.isShowColumnSetting=!0},hn=_=>{var ie,Le,Mt,un,Ei,Xt,ct,Os,Ys,ed;_.type==="wheel"&&((ie=W.menu)==null||ie.hide(_)),_.type==="scroll"&&!((Le=_.target.classList)!=null&&Le.contains("table-body"))&&!((un=(Mt=_.target.offsetParent)==null?void 0:Mt.classList)!=null&&un.contains("ev-select-dropbox"))&&!((Xt=(Ei=_.target.offsetParent)==null?void 0:Ei.classList)!=null&&Xt.contains("ev-grid-column-setting"))&&!((Os=(ct=_.target.offsetParent)==null?void 0:ct.classList)!=null&&Os.contains("ev-text-field-wrapper"))&&(M.isShowFilterSetting=!1,V.isShowColumnSetting=!1,W.isShowMenuOnClick=!1,(Ys=W.columnMenu)==null||Ys.hide(_),(ed=W.gridSettingMenu)==null||ed.hide())};o.onMounted(()=>{Se(),ae({rows:e.rows,isInit:!0}),document.addEventListener("wheel",hn,{capture:!1}),document.addEventListener("scroll",hn,{capture:!0})}),o.onUnmounted(()=>{document.removeEventListener("wheel",hn,{capture:!1}),document.removeEventListener("scroll",hn,{capture:!0})}),o.onActivated(()=>{ye()}),o.onUpdated(()=>{var _;L.value=((_=w["grid-wrapper"])==null?void 0:_.offsetWidth)/1.5||0}),o.watch(()=>V.isShowColumnSetting,_=>{var ie;if(!_){(ie=W.gridSettingMenu)==null||ie.hide();return}pe(u.value)}),o.watch(()=>e.columns,()=>{ee()?q(J()):(q(J()),ne()),M.filteringColumn=null,M.filteringItemsByColumn={},S.filterStore=[],ae({rows:[],isMakeIndex:!1}),Te(),S.movedColumns.length=0},{deep:!0}),o.watch(()=>Z.isSorting,_=>{_&&(ae({rows:S.originStore,isMakeIndex:!1}),Z.isSorting=!_,x.isClientPaging&&(x.currentPage=1,S.pagingStore=P(),X()))}),o.watch(()=>e.rows,_=>{ae({rows:_}),M.isSearch&&$(M.searchWord),ye()},{deep:!0}),o.watch(()=>e.uncheckable,()=>{ae({rows:e.rows})},{deep:!0}),o.watch(()=>e.checked,_=>{I.checkedRows=_}),o.watch(()=>e.disabledRows,()=>{S.store.length&&S.store.forEach(_=>{_[6]=e.disabledRows.includes(_[2])})},{deep:!0}),o.watch(()=>I.checkedRows,_=>{I.isHeaderChecked=!1;let ie=S.store;x.isClientPaging&&(ie=P()),ie.length&&(ie.forEach(Le=>{Le[1]=_.includes(Le[2])}),I.isHeaderChecked=_.length===ie.length),Y()}),o.watch(()=>e.selected,_=>{E.useSelect&&(E.selectedRow=_)}),o.watch(()=>E.selectedRow,_=>{E.useSelect&&(S.store.forEach(ie=>{ie[3]=_.includes(ie[2])&&!e.disabledRows.includes(ie[2])}),Y())}),o.watch(()=>C.value,async _=>{if(await o.nextTick(),_>=0){if(x.usePage&&!x.isInfinite&&(x.highlightPage=Math.ceil(_/x.perPage)||1,x.highlightPage!==x.currentPage)){x.currentPage=x.highlightPage,x.isHighlight=!0;return}w.body.scrollTop=R.rowHeight*C.value}}),o.watch(()=>I.useCheckbox.mode,()=>{X()}),o.watch(()=>E.useSelect,()=>{G()}),o.watch(()=>E.multiple,()=>{G()}),o.watch(()=>e.checked.length,_=>{_||X()}),o.watch(()=>e.expanded.length,_=>{_||N(),Y()}),o.watch(()=>[e.option.columnWidth,R.gridWidth],async()=>{await o.nextTick(),R.columnWidth=e.option.columnWidth;const _=w["grid-wrapper"];_.style.width=R.gridWidth,_.style.height=R.gridHeight,S.orderedColumns.map(ie=>{var Mt;const Le=ie;return!((Mt=e.columns[ie.index])!=null&&Mt.width)&&!Le.resized&&(Le.width=0),Le}),ye()}),o.watch(()=>e.option.searchValue,_=>{_!==void 0&&($((_==null?void 0:_.value)??_),x.isClientPaging&&(X(),G()))},{immediate:!0}),o.watch(()=>{var _;return(_=e.option.page)==null?void 0:_.currentPage},_=>{var Le;const ie=_||1;x.currentPage=(Le=e.option.page)!=null&&Le.isInfinite?1:ie},{immediate:!0}),o.watch(()=>x.currentPage,(_,ie)=>{o.nextTick(()=>{H(ie),x.isClientPaging&&_!==ie&&(X(),G()),Y(),_===x.highlightPage&&x.isHighlight&&(w.body.scrollTop=R.rowHeight*C.value,x.isHighlight=!x.isHighlight)})});const Vn=o.reactive({boxTop:0,boxLeft:0}),K=o.ref(null),se=o.ref(!1),me=o.ref(!1),we=o.ref(null),Ee=o.ref({}),Ke=o.reactive({caption:"",field:""}),tt=o.ref([]),nI=[{name:"AND",value:"and"},{name:"OR",value:"or"}],kl=o.ref(0),iI=({caption:_,field:ie},Le)=>{if(Ke.caption=_,Ke.field=ie,tt.value=Le,(Le==null?void 0:Le.length)>1){se.value=!0;const Mt=K.value.getBoundingClientRect().left,un=window.pageYOffset+K.value.getBoundingClientRect().top+K.value.getBoundingClientRect().height;Vn.boxTop=`${un}px`,Vn.boxLeft=`${Mt}px`}},sI=()=>{S.filterStore=[],ae({rows:[],isMakeIndex:!1})},wl=async _=>{var un,Ei;_&&me.value&&(kl.value=0);const ie=(un=K.value)==null?void 0:un.getElementsByClassName("filtering-items__item"),Le=[];let Mt=0;if(ie){for(let Xt=0;Xt<ie.length;Xt++){const ct=ie[Xt];ct.classList.remove("non-display");const Os=(Ei=K.value.getBoundingClientRect())==null?void 0:Ei.width,{width:Ys}=ct.getBoundingClientRect();Mt+=Ys+10,Os-150<=Mt&&!ct.classList.contains("filtering-items__item--count")?(kl.value++,Le.push(ct),Ee.value={...Ee.value,[ct.dataset.field]:Ve(M.filteringItemsByColumn[ct.dataset.field])}):delete Ee.value[ct.dataset.field]}ie.forEach(Xt=>{const ct=Le.includes(Xt);Xt.classList.toggle("non-display",ct)})}},oI=async(_,ie)=>{ie!=null&&ie.length?(M.filteringItemsByColumn[_]=ie,me.value=!0):(delete Ee.value[_],delete M.filteringItemsByColumn[_]),await o.nextTick(),wl(!0),M.isShowFilterSetting=!1,S.filterStore=[],ae({rows:[],isMakeIndex:!1}),fe(S.filterStore)};let Il=null;const lI=()=>{Il&&clearTimeout(Il),Il=setTimeout(()=>{me.value=!me.value,wl(me.value)},150)},aI=()=>{M.filteringColumn=null,M.filteringItemsByColumn={},Ee.value={},S.filterStore=[],ae({rows:[],isMakeIndex:!1})},rI=o.computed(()=>{var _;return{width:`${L.value}px`,top:`${((_=K.value)==null?void 0:_.getBoundingClientRect().height)||0}px`}}),cI=_=>{const ie=M.filteringItemsByColumn[_];return ie==null?void 0:ie[ie.length-1]},dI=()=>{const _=document.createElement("div");_.id="ev-grid-filtering-items-modal",_.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filtering-items-modal")||document.body.appendChild(_)};return o.onBeforeMount(()=>dI()),{idColIndex:o.computed(()=>{var _;return(_=S.orderedColumns.find(ie=>ie.field==="id"))==null?void 0:_.index}),summaryScroll:D,showHeader:f,stripeStyle:p,borderStyle:y,highlightIdx:C,useSummary:g,useGridSetting:m,toolbarRef:u,stores:S,emptyText:b,...o.toRefs(w),...o.toRefs(S),...o.toRefs(M),...o.toRefs(v),...o.toRefs(x),...o.toRefs(R),...o.toRefs(E),...o.toRefs(I),...o.toRefs(T),...o.toRefs(Z),...o.toRefs(W),...o.toRefs(V),isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h,updateVScroll:Y,updateHScroll:F,onScroll:O,calculatedColumn:Se,onResize:ye,onShow:oe,onColumnResize:re,onRowClick:Zs,onRowDblClick:Xs,onCheck:z,onCheckAll:j,onExpanded:U,onSort:Q,setSort:ne,setStore:ae,setContextMenu:Zt,onContextMenu:Sl,onSearch:$,setGridSetting:Bs,onApplyColumn:Ge,onColumnContextMenu:Cl,filteringItemsWidth:L,isShowColumnFilteringItems:me,operatorItems:nI,selectedFilteringItems:tt,selectedFilteringColumn:Ke,filteringItemsRef:K,isShowFilteringItemsBox:se,filteringItemsStyle:rI,hiddenFilteringItemsCount:kl,...o.toRefs(Vn),hiddenFilteringItemsRef:we,hiddenFilteringItemsByColumn:Ee,removeAllFiltering:aI,onExpandFilteringItems:lI,setColumnFilteringItems:wl,onChangeOperator:sI,onApplyFilter:oI,onClickFilteringItem:iI,getFilteringItemByField:cI,onDragStart:Ns,onDragOver:Ps,onDrop:Ds,ROW_DISABLED_INDEX:6}}},JS={key:0,class:"filtering-items filtering-items--used"},jS={key:1,ref:"filteringItemsRef",class:"filtering-items"},QS=["data-field","onClick"],$S={class:"filtering-items__item--title"},qS=["title"],eC={key:1,class:"filtering-items__item--value"},tC=["onClick"],nC={class:"filtering-items__item--title"},iC=["title"],sC={key:1,class:"filtering-items__item--value"},oC={class:"column-list"},lC=["data-index"],aC=["title","onClick"],rC=["onClick"],cC=["onMousedown"],dC={ref:"table"},hC=["data-index","disabled","onClick","onContextmenu","onDblclick"],uC=["data-name","data-index","disabled"],fC={key:0},mC=["title"],pC=["disabled"],gC=["disabled"],bC={key:0},yC=["colspan"],xC={key:0},SC={class:"is-empty"},CC={ref:"resizeLine",class:"table-resize-line"};function kC(e,t,n,i,s,l){var L;const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-select"),c=o.resolveComponent("grid-option-button"),d=o.resolveComponent("toolbar"),h=o.resolveComponent("ev-checkbox"),u=o.resolveComponent("grid-sort-button"),m=o.resolveComponent("ev-context-menu"),f=o.resolveComponent("grid-summary"),g=o.resolveComponent("grid-pagination"),p=o.resolveComponent("filter-setting"),y=o.resolveComponent("column-setting"),C=o.resolveDirective("clickoutside"),b=o.resolveDirective("resize"),k=o.resolveDirective("observe-visibility");return o.openBlock(),o.createElementBlock(o.Fragment,null,[e.$slots.toolbar||i.useGridSetting?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:o.normalizeStyle(`width: ${e.gridWidth};`)},[o.createVNode(d,null,{toolbarWrapper:o.withCtx(()=>[o.createElementVNode("div",{class:"filtering",style:o.normalizeStyle({width:`${i.filteringItemsWidth}px`})},[e.isFiltering&&!Object.keys(e.filteringItemsByColumn).length?(o.openBlock(),o.createElementBlock("div",JS,[o.createVNode(a,{icon:"ev-icon-filter-list"}),t[18]||(t[18]=o.createElementVNode("span",null,"Filter",-1))])):o.createCommentVNode("",!0),e.isFiltering&&Object.keys(e.filteringItemsByColumn).length?(o.openBlock(),o.createElementBlock("div",jS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(e.filteringItemsByColumn),(w,M)=>{var V,S,x,I;return o.openBlock(),o.createElementBlock(o.Fragment,{key:M},[M===0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--filter",onClick:t[0]||(t[0]=o.withModifiers((...T)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...T),["stop"]))},[o.createVNode(a,{icon:"ev-icon-filter-list",class:"filtering-items-expand"}),o.createElementVNode("span",null," Filter ("+o.toDisplayString(Object.keys(e.filteringItemsByColumn).length)+") ",1),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",style:{"margin-left":"0"},onClick:o.withModifiers(i.removeAllFiltering,["stop"])},null,8,["onClick"])])):o.createCommentVNode("",!0),M===1?(o.openBlock(),o.createBlock(r,{key:1,modelValue:e.columnOperator,"onUpdate:modelValue":t[1]||(t[1]=T=>e.columnOperator=T),items:i.operatorItems,class:"filtering-items__item--operator",onChange:i.onChangeOperator},null,8,["modelValue","items","onChange"])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"filtering-items__item non-display","data-field":w,onClick:o.withModifiers(T=>{var v;return i.onClickFilteringItem({caption:(v=i.getFilteringItemByField(w))==null?void 0:v.caption,field:w},e.filteringItemsByColumn[w])},["stop"])},[o.createElementVNode("span",$S,o.toDisplayString((V=i.getFilteringItemByField(w))==null?void 0:V.caption)+" "+o.toDisplayString((S=i.getFilteringItemByField(w))==null?void 0:S.comparison),1),e.filteringItemsByColumn[w].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(x=i.getFilteringItemByField(w))==null?void 0:x.value},o.toDisplayString((I=i.getFilteringItemByField(w))==null?void 0:I.value),9,qS)):(o.openBlock(),o.createElementBlock("span",eC," + "+o.toDisplayString(e.filteringItemsByColumn[w].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:T=>i.onApplyFilter(w,[])},null,8,["onClick"])],8,QS)],64)}),128)),i.isShowColumnFilteringItems&&Object.keys(e.filteringItemsByColumn).length&&i.hiddenFilteringItemsCount>0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--count",onClick:t[2]||(t[2]=(...w)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...w))}," + "+o.toDisplayString(i.hiddenFilteringItemsCount),1)):o.createCommentVNode("",!0)],512)):o.createCommentVNode("",!0),!i.isShowColumnFilteringItems&&Object.keys(i.hiddenFilteringItemsByColumn).length?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:2,ref:"hiddenFilteringItemsRef",class:"filtering-items filtering-items__hidden-items",style:o.normalizeStyle(i.filteringItemsStyle)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(i.hiddenFilteringItemsByColumn),(w,M)=>{var V,S,x,I;return o.openBlock(),o.createElementBlock("div",{key:M,class:"filtering-items__item",onClick:o.withModifiers(T=>{var v;return i.onClickFilteringItem({caption:(v=i.getFilteringItemByField(w))==null?void 0:v.caption,field:w},i.hiddenFilteringItemsByColumn[w])},["stop"])},[o.createElementVNode("span",nC,o.toDisplayString((V=i.getFilteringItemByField(w))==null?void 0:V.caption)+" "+o.toDisplayString((S=i.getFilteringItemByField(w))==null?void 0:S.comparison),1),i.hiddenFilteringItemsByColumn[w].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(x=i.getFilteringItemByField(w))==null?void 0:x.value},o.toDisplayString((I=i.getFilteringItemByField(w))==null?void 0:I.value),9,iC)):(o.openBlock(),o.createElementBlock("span",sC," + "+o.toDisplayString(i.hiddenFilteringItemsByColumn[w].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:T=>i.onApplyFilter(w,[],!0)},null,8,["onClick"])],8,tC)}),128))],4)),[[C,()=>{i.isShowColumnFilteringItems||i.onExpandFilteringItems()}]]):o.createCommentVNode("",!0)],4),i.useGridSetting?(o.openBlock(),o.createBlock(c,{key:0,class:"grid-setting__icon",onClick:t[3]||(t[3]=w=>i.setGridSetting(w))})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"toolbar",{item:{onSearch:i.onSearch}},void 0,!0)]),_:3})],4)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("div",o.mergeProps({ref:"grid-wrapper"},e.$attrs,{class:"grid-wrapper",style:`width: ${e.gridWidth}; height: ${e.gridHeight};`}),[o.createElementVNode("div",{ref:"grid",class:o.normalizeClass({table:!0,adjust:e.adjust,"ev-grid":!0,"non-header":!i.showHeader,"ev-grid--empty":!e.viewStore.length})},[o.withDirectives(o.createElementVNode("div",{ref:"header",class:o.normalizeClass({"table-header":!0,"non-border":!!i.borderStyle})},[o.createElementVNode("ul",oC,[e.useCheckbox.use?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"checkbox-all":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[e.useCheckbox.use&&e.useCheckbox.headerCheck&&e.useCheckbox.mode!=="single"?(o.openBlock(),o.createBlock(h,{key:0,modelValue:e.isHeaderChecked,"onUpdate:modelValue":t[4]||(t[4]=w=>e.isHeaderChecked=w),disabled:e.isHeaderUncheckable,indeterminate:e.isHeaderIndeterminate,onChange:i.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):o.createCommentVNode("",!0)],6)):o.createCommentVNode("",!0),e.useRowDetail?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({column:!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},null,6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.orderedColumns,(w,M)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:M},[!w.hide&&!w.hiddenDisplay?(o.openBlock(),o.createElementBlock("li",{key:0,"data-index":M,class:o.normalizeClass({column:!0,render:i.isRenderer(w),"non-border":!!i.borderStyle,[w.field]:w.field}),style:o.normalizeStyle({width:`${w.width}px`,"min-width":`${i.isRenderer(w)?e.rendererMinWidth:e.minWidth}px`,"margin-right":e.orderedColumns.length-1===M&&(e.hasVerticalScrollBar||e.hasHorizontalScrollBar)?`${e.scrollWidth}px`:"0px","border-right":e.orderedColumns.length-1===M?"none":"1px solid #CFCFCF"}),draggable:!0,onDragstart:t[6]||(t[6]=(...V)=>i.onDragStart&&i.onDragStart(...V)),onDragover:t[7]||(t[7]=(...V)=>i.onDragOver&&i.onDragOver(...V)),onDrop:t[8]||(t[8]=(...V)=>i.onDrop&&i.onDrop(...V))},[w.customHeader&&e.$slots.customHeader?o.renderSlot(e.$slots,"customHeader",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:w.caption,class:"column-name",onClick:[V=>i.onColumnContextMenu(V,w),t[5]||(t[5]=o.withModifiers((...V)=>e.columnMenu.show&&e.columnMenu.show(...V),["prevent"]))]},[o.createTextVNode(o.toDisplayString(w.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(V=>i.onSort(w),["stop"])},[e.$slots.sortIcon?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[w.sortable===void 0||w.sortable?(o.openBlock(),o.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,"sortIcon",{},void 0,!0)],4)):o.createCommentVNode("",!0),e.sortField===w.field?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":e.sortOrder==="asc","column-sort__icon--desc":e.sortOrder==="desc"}]),style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,`sortIcon_${e.sortOrder}`,{},void 0,!0)],6)):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[w.sortable===void 0||w.sortable?(o.openBlock(),o.createBlock(u,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},null,8,["style"])):o.createCommentVNode("",!0),e.sortField===w.field?(o.openBlock(),o.createBlock(u,{key:1,class:o.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":e.sortOrder==="asc","column-sort__icon--desc":e.sortOrder==="desc"}]),icon:e.sortOrder,style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,visibility:e.sortOrder?w.hidden:!0})},null,8,["class","icon","style"])):o.createCommentVNode("",!0)],64))],8,rC)],8,aC)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(V=>i.onColumnResize(M,V),["stop","left"])},null,40,cC)],46,lC)):o.createCommentVNode("",!0)],64))),128)),(L=e.$props.option.customContextMenu)!=null&&L.length?(o.openBlock(),o.createElementBlock("li",{key:2,class:o.normalizeClass({column:!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:"30px","min-width":"30px","margin-right":e.hasVerticalScrollBar||e.hasHorizontalScrollBar?`${e.scrollWidth}px`:"0px"})},null,6)):o.createCommentVNode("",!0)])],2),[[o.vShow,i.showHeader]]),o.createElementVNode("div",{ref:"body",class:o.normalizeClass({stripe:i.stripeStyle,"table-body":!0,"bottom-border":!!e.viewStore.length,"non-border":!!i.borderStyle}),onScroll:t[11]||(t[11]=(...w)=>i.onScroll&&i.onScroll(...w)),onContextmenu:t[12]||(t[12]=w=>i.onContextMenu(w))},[o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),o.createElementVNode("table",dC,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.viewStore,(w,M)=>{var V,S;return o.openBlock(),o.createElementBlock(o.Fragment,{key:i.idColIndex!=null?w[2][i.idColIndex]:M},[o.createElementVNode("tr",{"data-index":w[0],class:o.normalizeClass({row:!0,selected:w[3],highlight:w[0]===i.highlightIdx,"non-border":!!i.borderStyle&&i.borderStyle!=="rows"}),disabled:w[i.ROW_DISABLED_INDEX],onClick:x=>i.onRowClick(x,w),onContextmenu:x=>i.onRowClick(x,w,!0),onDblclick:x=>i.onRowDblClick(x,w)},[e.useCheckbox.use?(o.openBlock(),o.createElementBlock("td",{key:0,class:o.normalizeClass({cell:!0,"row-checkbox":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${e.minWidth}px`,height:`${e.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(h,{modelValue:w[1],"onUpdate:modelValue":x=>w[1]=x,class:"row-checkbox-input",disabled:w[5]||w[i.ROW_DISABLED_INDEX],onChange:x=>i.onCheck(x,w)},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])],6)):o.createCommentVNode("",!0),e.useRowDetail?(o.openBlock(),o.createElementBlock("td",{key:1,class:o.normalizeClass({cell:!0,"row-detail-toggle":!0,"non-border":!!i.borderStyle,"row-detail-toggle--expanded":w[4]}),style:o.normalizeStyle({width:`${e.minWidth}px`,height:`${e.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(a,{modelValue:w[4],"onUpdate:modelValue":x=>w[4]=x,icon:"ev-icon-s-play",class:"row-detail-toggle-icon",onClick:o.withModifiers(x=>i.onExpanded(x,w),["stop"])},null,8,["modelValue","onUpdate:modelValue","onClick"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.orderedColumns,(x,I)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${i.idColIndex!=null?w[2][i.idColIndex]:M}-${I}`},[!x.hide&&!x.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":x.field,"data-index":x.index,class:o.normalizeClass({cell:!0,render:i.isRenderer(x),[x.type]:x.type,[x.align]:x.align,[x.field]:x.field,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${x.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${i.isRenderer(x)?e.rendererMinWidth:e.minWidth}px`,"border-right":e.orderedColumns.length-1===I?"none":"1px solid #CFCFCF"}),disabled:w[i.ROW_DISABLED_INDEX]},[e.$slots[x.field]?(o.openBlock(),o.createElementBlock("div",fC,[o.renderSlot(e.$slots,x.field,{item:{row:w,column:x},disabled:w[i.ROW_DISABLED_INDEX]},void 0,!0)])):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getConvertValue(x,w[2][x.index])},o.toDisplayString(i.getConvertValue(x,w[2][x.index])),9,mC))],14,uC)):o.createCommentVNode("",!0)],64))),128)),(V=e.$props.option.customContextMenu)!=null&&V.length?(o.openBlock(),o.createElementBlock("td",{key:2,class:o.normalizeClass({"row-contextmenu":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${e.rowHeight}px`,"min-width":"30px","line-height":`${e.rowHeight}px`}),disabled:w[i.ROW_DISABLED_INDEX]},[e.$slots.contextmenuIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"row-contextmenu__btn",disabled:w[i.ROW_DISABLED_INDEX],onClick:t[9]||(t[9]=x=>i.onContextMenu(x))},[o.renderSlot(e.$slots,"contextmenuIcon",{},void 0,!0)],8,gC)):(o.openBlock(),o.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",disabled:w[i.ROW_DISABLED_INDEX],onClick:t[10]||(t[10]=x=>i.onContextMenu(x))},null,8,["disabled"]))],14,pC)):o.createCommentVNode("",!0)],42,hC),e.useRowDetail&&((S=e.$slots)!=null&&S.rowDetail)&&w[4]?(o.openBlock(),o.createElementBlock("tr",bC,[o.createElementVNode("td",{colspan:w.length},[o.createElementVNode("div",{style:o.normalizeStyle({width:"100%",height:`${e.detailRowHeight}px`,"min-height":`${e.detailRowHeight}px`,"max-height":`${e.detailRowHeight}px`})},[o.renderSlot(e.$slots,"rowDetail",{item:{row:w}},void 0,!0)],4)],8,yC)])):o.createCommentVNode("",!0)],64)}),128)),e.viewStore.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",xC,[o.createElementVNode("td",SC,o.toDisplayString(i.emptyText),1)]))])],512),o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),o.createVNode(m,{ref:"menu","custom-class":e.contextMenuClass,items:e.contextMenuItems},null,8,["custom-class","items"]),o.createVNode(m,{ref:"columnMenu",items:e.columnMenuItems},null,8,["items"]),o.createVNode(m,{ref:"gridSettingMenu",items:e.gridSettingContextMenuItems,"is-show-menu-on-click":e.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),o.withDirectives(o.createElementVNode("div",CC,null,512),[[o.vShow,e.showResizeLine]])],2)],16)),[[b,i.onResize],[k,{callback:i.onShow,once:!0}]]),i.useSummary?(o.openBlock(),o.createBlock(f,{key:1,"ordered-columns":e.orderedColumns,stores:i.stores,"use-checkbox":e.useCheckbox.use,"style-option":{borderStyle:i.borderStyle,minWidth:e.minWidth,rowHeight:e.rowHeight},"scroll-left":i.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):o.createCommentVNode("",!0),e.usePage&&!e.isInfinite?(o.openBlock(),o.createBlock(g,{key:2,modelValue:e.currentPage,"onUpdate:modelValue":t[13]||(t[13]=w=>e.currentPage=w),total:e.pageTotal,"per-page":e.perPage,"visible-page":e.visiblePage,"show-page-info":e.showPageInfo,order:e.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):o.createCommentVNode("",!0),o.createVNode(p,{"is-show":e.isShowFilterSetting,"onUpdate:isShow":t[14]||(t[14]=w=>e.isShowFilterSetting=w),items:e.filteringItemsByColumn,"onUpdate:items":t[15]||(t[15]=w=>e.filteringItemsByColumn=w),column:e.filteringColumn,position:e.filterSettingPosition,onApplyFiltering:i.onApplyFilter},null,8,["is-show","items","column","position","onApplyFiltering"]),o.createVNode(y,{"is-show":e.isShowColumnSetting,"onUpdate:isShow":t[16]||(t[16]=w=>e.isShowColumnSetting=w),"is-show-menu-on-click":e.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":t[17]||(t[17]=w=>e.isShowMenuOnClick=w),columns:e.updatedColumns,"hidden-column":e.hiddenColumn,position:e.columnSettingPosition,"text-info":e.columnSettingTextInfo,onApplyColumn:i.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const bi=ce(US,[["render",kC],["__scopeId","data-v-22cd2bf6"]]);bi.install=e=>{e.component(bi.name,bi)};let yi=null;function wC(){return yi||(typeof document<"u"?yi=document.createElement("canvas").getContext("2d"):typeof OffscreenCanvas<"u"&&(yi=new OffscreenCanvas(1,1).getContext("2d")),yi)}const xi=new Map,IC=512,A={hexToRgb(e){if(!e)return!1;const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e),n=parseInt(t[1],16),i=parseInt(t[2],16),s=parseInt(t[3],16);return`${n},${i},${s}`},getColorStringType(e){if(!e)return"";const t=e.replace(/ /g,""),n=/^#(?:[A-Fa-f0-9]{3}){1,2}$/.exec(t),i=/^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/.exec(t),s=/^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1?)\s*[)]$/.exec(t);let l="";return n?l="HEX":i?l="RGB":s?l="RGBA":l="NONE",l},colorStringToRgba(e,t=1){const n=`${e}|${t}`,i=xi.get(n);if(i!==void 0)return i;const s=e.replace(/ /g,""),l=this.getColorStringType(s);let a="";switch(l){case"HEX":a=`rgba(${this.hexToRgb(s)},${t})`;break;case"RGB":a=s.replace(")",`, ${t})`).replace("rgb","rgba");break;case"RGBA":{const r=s.replace(/^.*,(.+)\)/,"$1");a=s.replace(`${r})`,`${t})`);break}default:a=`rgba(0, 0, 0, ${t})`;break}return xi.size>=IC&&xi.delete(xi.keys().next().value),xi.set(n,a),a},getOpacity(e){const t=e==null?void 0:e.replace(/ /g,"");return this.getColorStringType(t)==="RGBA"?t.replace(/^.*,(.+)\)/,"$1"):"1"},calculateMagnitude(e){return Math.floor(Math.log(e)/Math.LN10)},aliasPixel(e){return e%2===0?0:.5},coordinateKey(e,t){return`${e}|${t}`},getLabelStyle(e){const{fontStyle:t="normal",fontWeight:n="normal",fontSize:i="12",fontFamily:s="Roboto"}=e;return`${t} normal ${n} ${i}px ${s}`},labelSignFormat(e,t=null){const n=Cu(1),i=Su(1),s=xu(1),l=yu(1),a=1e3;let r;if(!kt(e))return e;const c=e<0,d=Math.abs(e),h=(u,m,f)=>{let g;return u%m===0?g=zt(t)?`${u/m}${f}`:`${(u/m).toFixed(t)}${f}`:g=`${(u/m).toFixed(1)}${f}`,c?`-${g}`:g};if(d>=n)r=h(d,n,"P");else if(d>=i)r=h(d,i,"T");else if(d>=s)r=h(d,s,"G");else if(d>=l)r=h(d,l,"M");else if(d>=a)r=h(d,1e3,"K");else{const u=zt(t)?d:d.toFixed(t);r=c?`-${u}`:`${u}`}return r},calcTextSize(e,t,n=0){const i=document.createElement("span"),s=`visibility:hidden; position:absolute; top:-10000px; font: ${t}; padding: 0 ${n}px`;i.setAttribute("style",s),i.style.font=t,i.textContent=e,document.body.appendChild(i);const l=i.getBoundingClientRect(),a=l.width||2,r=l.height||2;return i.remove(),{width:a,height:r}},calcTextSizeCanvas(e,t){if(!e)return{width:2,height:2};const n=wC();n.save(),n.font=t;const i=n.measureText(e),s=t.match(/(\d+(?:\.\d+)?)px/),a=(s?Number(s[1]):14)*1.2;return n.restore(),{width:Math.max(Math.ceil(i.width),2),height:Math.max(Math.ceil(a),2)}},getStringMinMax(e){const t={min:e[0],max:e[0]};return e.forEach(n=>{var i,s;((i=t==null?void 0:t.max)==null?void 0:i.length)<(n==null?void 0:n.length)&&(t.max=n),((s=t==null?void 0:t.min)==null?void 0:s.length)>(n==null?void 0:n.length)&&(t.min=n)}),t},truncateLabelWithEllipsis(e,t,n,i="right"){if(!e)return"";if(!t)return e;const s="…",l=n.measureText(s).width;let a=e,r=n.measureText(a).width;if(r<=t||r<=l)return e;let c=a.length;for(;r>=t-l&&c-- >0;)a=i==="right"?a.substring(0,c):a.substring(1,a.length),r=n.measureText(a).width;return i==="right"?a+s:s+a},showLabelTip(e){const{ctx:t,width:n,height:i,x:s,y:l,arrowSize:a,borderRadius:r,text:c,backgroundColor:d,textColor:h}=e,u=s-n/2,m=s+n/2,f=l-i,g=l;t.beginPath(),t.save(),t.fillStyle=d||"#E96E2C",t.strokeStyle=d||"#E96E2C",t.shadowBlur=0,t.moveTo(u+r,f),t.quadraticCurveTo(u,f,u,f+r),t.lineTo(u,g-r),t.quadraticCurveTo(u,g,u+r,g),t.lineTo(m-r,g),t.quadraticCurveTo(m,g,m,g-r),t.lineTo(m,f+r),t.quadraticCurveTo(m,f,m-r,f),t.lineTo(s-a,f),t.lineTo(s,f-a),t.lineTo(s+a,f),t.lineTo(u+r,f),t.closePath(),t.fill(),t.restore(),t.save(),t.font="normal normal bold 12px Roboto",t.fillStyle=h||"#FFF",t.textBaseline="middle",t.textAlign="center",t.fillText(`${c}`,s,f+i/2),t.restore(),t.beginPath()},isPieType(e){return e==="pie"||e==="doughnut"||e==="sunburst"},isDoughnutHole(e){return e==="doughnut"||e==="sunburst"},setDOMStyle(e,t){var n;!e||!t||(n=Object.keys(t))==null||n.forEach(i=>{e.style[i]=t[i]})},checkSafeInteger(e){return e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER},htmlToElement(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild},isNullOrUndefined(e){return e==null},rgbaAdjustHalfOpacity(e){const t=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/,n=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;if(t.test(e)){const[,i,s,l]=e.match(t);return`rgba(${i}, ${s}, ${l}, 0.5)`}if(n.test(e)){const[,i,s,l,a]=e.match(n),r=(parseFloat(a)/2).toFixed(2);return`rgba(${i}, ${s}, ${l}, ${r})`}return e.startsWith("#")&&e.length>7?e:`${e}80`},calcBoxDistance(e,t,n){if(e.w!==null&&e.w!==void 0&&e.h!==null&&e.h!==void 0){const i=e.xp,s=e.yp,l=Math.min(i,i+e.w),a=Math.max(i,i+e.w),r=Math.min(s,s+e.h),c=Math.max(s,s+e.h),d=Math.max(0,l-t,t-a),h=Math.max(0,r-n,n-c);return d*d+h*h}return(e.xp-t)**2+(e.yp-n)**2}};function TC(e){const t=(String(e).split(".")[1]??"").length;return e.toFixed(t+1)}var LC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function MC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cc={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(LC,function(){var n=1e3,i=6e4,s=36e5,l="millisecond",a="second",r="minute",c="hour",d="day",h="week",u="month",m="quarter",f="year",g="date",p="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var W=["th","st","nd","rd"],R=Z%100;return"["+Z+(W[(R-20)%10]||W[R]||W[0])+"]"}},k=function(Z,W,R){var X=String(Z);return!X||X.length>=W?Z:""+Array(W+1-X.length).join(R)+Z},L={s:k,z:function(Z){var W=-Z.utcOffset(),R=Math.abs(W),X=Math.floor(R/60),G=R%60;return(W<=0?"+":"-")+k(X,2,"0")+":"+k(G,2,"0")},m:function Z(W,R){if(W.date()<R.date())return-Z(R,W);var X=12*(R.year()-W.year())+(R.month()-W.month()),G=W.clone().add(X,u),N=R-G<0,P=W.clone().add(X+(N?-1:1),u);return+(-(X+(R-G)/(N?G-P:P-G))||0)},a:function(Z){return Z<0?Math.ceil(Z)||0:Math.floor(Z)},p:function(Z){return{M:u,y:f,w:h,d,D:g,h:c,m:r,s:a,ms:l,Q:m}[Z]||String(Z||"").toLowerCase().replace(/s$/,"")},u:function(Z){return Z===void 0}},w="en",M={};M[w]=b;var V="$isDayjsObject",S=function(Z){return Z instanceof v||!(!Z||!Z[V])},x=function Z(W,R,X){var G;if(!W)return w;if(typeof W=="string"){var N=W.toLowerCase();M[N]&&(G=N),R&&(M[N]=R,G=N);var P=W.split("-");if(!G&&P.length>1)return Z(P[0])}else{var B=W.name;M[B]=W,G=B}return!X&&G&&(w=G),G||!X&&w},I=function(Z,W){if(S(Z))return Z.clone();var R=typeof W=="object"?W:{};return R.date=Z,R.args=arguments,new v(R)},T=L;T.l=x,T.i=S,T.w=function(Z,W){return I(Z,{locale:W.$L,utc:W.$u,x:W.$x,$offset:W.$offset})};var v=function(){function Z(R){this.$L=x(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[V]=!0}var W=Z.prototype;return W.parse=function(R){this.$d=function(X){var G=X.date,N=X.utc;if(G===null)return new Date(NaN);if(T.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var P=G.match(y);if(P){var B=P[2]-1||0,H=(P[7]||"0").substring(0,3);return N?new Date(Date.UTC(P[1],B,P[3]||1,P[4]||0,P[5]||0,P[6]||0,H)):new Date(P[1],B,P[3]||1,P[4]||0,P[5]||0,P[6]||0,H)}}return new Date(G)}(R),this.init()},W.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},W.$utils=function(){return T},W.isValid=function(){return this.$d.toString()!==p},W.isSame=function(R,X){var G=I(R);return this.startOf(X)<=G&&G<=this.endOf(X)},W.isAfter=function(R,X){return I(R)<this.startOf(X)},W.isBefore=function(R,X){return this.endOf(X)<I(R)},W.$g=function(R,X,G){return T.u(R)?this[X]:this.set(G,R)},W.unix=function(){return Math.floor(this.valueOf()/1e3)},W.valueOf=function(){return this.$d.getTime()},W.startOf=function(R,X){var G=this,N=!!T.u(X)||X,P=T.p(R),B=function(U,Q){var J=T.w(G.$u?Date.UTC(G.$y,Q,U):new Date(G.$y,Q,U),G);return N?J:J.endOf(d)},H=function(U,Q){return T.w(G.toDate()[U].apply(G.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(Q)),G)},D=this.$W,Y=this.$M,F=this.$D,O="set"+(this.$u?"UTC":"");switch(P){case f:return N?B(1,0):B(31,11);case u:return N?B(1,Y):B(0,Y+1);case h:var z=this.$locale().weekStart||0,j=(D<z?D+7:D)-z;return B(N?F-j:F+(6-j),Y);case d:case g:return H(O+"Hours",0);case c:return H(O+"Minutes",1);case r:return H(O+"Seconds",2);case a:return H(O+"Milliseconds",3);default:return this.clone()}},W.endOf=function(R){return this.startOf(R,!1)},W.$set=function(R,X){var G,N=T.p(R),P="set"+(this.$u?"UTC":""),B=(G={},G[d]=P+"Date",G[g]=P+"Date",G[u]=P+"Month",G[f]=P+"FullYear",G[c]=P+"Hours",G[r]=P+"Minutes",G[a]=P+"Seconds",G[l]=P+"Milliseconds",G)[N],H=N===d?this.$D+(X-this.$W):X;if(N===u||N===f){var D=this.clone().set(g,1);D.$d[B](H),D.init(),this.$d=D.set(g,Math.min(this.$D,D.daysInMonth())).$d}else B&&this.$d[B](H);return this.init(),this},W.set=function(R,X){return this.clone().$set(R,X)},W.get=function(R){return this[T.p(R)]()},W.add=function(R,X){var G,N=this;R=Number(R);var P=T.p(X),B=function(Y){var F=I(N);return T.w(F.date(F.date()+Math.round(Y*R)),N)};if(P===u)return this.set(u,this.$M+R);if(P===f)return this.set(f,this.$y+R);if(P===d)return B(1);if(P===h)return B(7);var H=(G={},G[r]=i,G[c]=s,G[a]=n,G)[P]||1,D=this.$d.getTime()+R*H;return T.w(D,this)},W.subtract=function(R,X){return this.add(-1*R,X)},W.format=function(R){var X=this,G=this.$locale();if(!this.isValid())return G.invalidDate||p;var N=R||"YYYY-MM-DDTHH:mm:ssZ",P=T.z(this),B=this.$H,H=this.$m,D=this.$M,Y=G.weekdays,F=G.months,O=G.meridiem,z=function(Q,J,ne,q){return Q&&(Q[J]||Q(X,N))||ne[J].slice(0,q)},j=function(Q){return T.s(B%12||12,Q,"0")},U=O||function(Q,J,ne){var q=Q<12?"AM":"PM";return ne?q.toLowerCase():q};return N.replace(C,function(Q,J){return J||function(ne){switch(ne){case"YY":return String(X.$y).slice(-2);case"YYYY":return T.s(X.$y,4,"0");case"M":return D+1;case"MM":return T.s(D+1,2,"0");case"MMM":return z(G.monthsShort,D,F,3);case"MMMM":return z(F,D);case"D":return X.$D;case"DD":return T.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return z(G.weekdaysMin,X.$W,Y,2);case"ddd":return z(G.weekdaysShort,X.$W,Y,3);case"dddd":return Y[X.$W];case"H":return String(B);case"HH":return T.s(B,2,"0");case"h":return j(1);case"hh":return j(2);case"a":return U(B,H,!0);case"A":return U(B,H,!1);case"m":return String(H);case"mm":return T.s(H,2,"0");case"s":return String(X.$s);case"ss":return T.s(X.$s,2,"0");case"SSS":return T.s(X.$ms,3,"0");case"Z":return P}return null}(Q)||P.replace(":","")})},W.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},W.diff=function(R,X,G){var N,P=this,B=T.p(X),H=I(R),D=(H.utcOffset()-this.utcOffset())*i,Y=this-H,F=function(){return T.m(P,H)};switch(B){case f:N=F()/12;break;case u:N=F();break;case m:N=F()/3;break;case h:N=(Y-D)/6048e5;break;case d:N=(Y-D)/864e5;break;case c:N=Y/s;break;case r:N=Y/i;break;case a:N=Y/n;break;default:N=Y}return G?N:T.a(N)},W.daysInMonth=function(){return this.endOf(u).$D},W.$locale=function(){return M[this.$L]},W.locale=function(R,X){if(!R)return this.$L;var G=this.clone(),N=x(R,X,!0);return N&&(G.$L=N),G},W.clone=function(){return T.w(this.$d,this)},W.toDate=function(){return new Date(this.valueOf())},W.toJSON=function(){return this.isValid()?this.toISOString():null},W.toISOString=function(){return this.$d.toISOString()},W.toString=function(){return this.$d.toUTCString()},Z}(),E=v.prototype;return I.prototype=E,[["$ms",l],["$s",a],["$m",r],["$H",c],["$W",d],["$M",u],["$y",f],["$D",g]].forEach(function(Z){E[Z[1]]=function(W){return this.$g(W,Z[0],Z[1])}}),I.extend=function(Z,W){return Z.$i||(Z(W,v,I),Z.$i=!0),I},I.locale=x,I.isDayjs=S,I.unix=function(Z){return I(1e3*Z)},I.en=M[w],I.Ls=M,I.p={},I})})(cc);var vC=cc.exports;const We=MC(vC),Si="3.22.0",ol="__evuiChart__",_t="__EVUI_CHART__",Ci="__EVUI_CHART_LOG_EMPTY__",ll="EVUI_CHART_LOG_EMPTY",$e=1e3,RC="YYYY-MM-DD HH:mm:ss",Be=`[EVUI ${Si}]`,al=e=>Math.floor(e/$e)*$e,_e=e=>Number.isFinite(e)&&e?We(e).format(RC):"-",VC=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(e instanceof Date){const t=e.getTime();return Number.isFinite(t)?t:null}if(typeof e=="string"){const t=We(e);return t.isValid()?t.valueOf():null}return null},EC=(e,t,n)=>{const i={},s=[["from",e],["to",t]];for(let l=0;l<s.length;l++){const[a,r]=s[l];if(r==null){if(!n)return be.warn(`${Be} 저장소에 데이터가 없어 ${a} 를 생략할 수 없다`),null;i[a]=n[a]}else{const c=VC(r);if(c===null)return be.warn(`${Be} 시각을 해석할 수 없다: ${String(r)} (예: '2026-10-02 10:02:00' 또는 ms 숫자)`),null;i[a]=al(c)}}return i.from>i.to?(be.warn(`${Be} from 이 to 보다 늦다`),null):i},WC=e=>{var s,l,a,r,c,d;const t=(a=(l=(s=e.seriesInfo)==null?void 0:s.charts)==null?void 0:l.scatter)==null?void 0:a[0],n=(c=(r=e.seriesList)==null?void 0:r[t])==null?void 0:c.minMax,i=(d=n==null?void 0:n.maxX)==null?void 0:d.valueOf();return i?{from:n.minX.valueOf(),to:i}:null},dc=(e,t)=>t?e.to<t.from||e.from>t.to?"창 밖":e.from<t.from||e.to>t.to?"일부 창 밖":"창 안":"저장소 없음",hc=e=>({mode:e._lastFrameMode??"-",lastRasterAt:e._lastRasterAt??0,lastRasterText:_e(e._lastRasterAt),framesSinceFullRedraw:e._framesSinceFullRedraw,pointsLayerValid:e.pointsLayerValid}),GC=5,ZC=e=>{if(!e.length)return null;const t=[...e].sort((n,i)=>n-i);return t.length>GC?`${t[0]} ~ ${t.at(-1)} (${t.length}개)`:t.join(", ")},XC=(e,t)=>{const n=t.map(s=>{var l,a;return((a=(l=e.seriesList)==null?void 0:l[s])==null?void 0:a.name)||s}),i={};return t.forEach((s,l)=>{const a=n.indexOf(n[l])!==n.lastIndexOf(n[l]);i[s]=a?`${n[l]} (${s.slice(0,8)})`:n[l]}),i},uc=(e,t,n)=>{var f,g;if(!((g=(f=e.options)==null?void 0:f.realTimeScatter)!=null&&g.use))return be.warn(`${Be} realTimeScatter 차트가 아니다 — chart 속성으로 인스턴스를 직접 본다`),null;const i=e.dataSet??{},s=WC(e),l=EC(t,n,s);if(!l)return null;const a=Object.keys(i),r=XC(e,a),c=s?Math.max(l.from,s.from):0,d=s?Math.min(l.to,s.to):-1,h=new Map;for(let p=c;p<=d;p+=$e){const y={time:_e(p),total:0};a.forEach(C=>{y[r[C]]=[]}),h.set(p,y)}const u=a.map(p=>{var k,L,w;const y=i[p],C={id:p,name:((L=(k=e.seriesList)==null?void 0:k[p])==null?void 0:L.name)??"",window:dc(l,{from:y.fromTime+$e,to:y.toTime}),points:0,stored:0,outOfWindow:0},b=y.dataGroup??[];for(let M=0;M<b.length;M++){const V=((w=b[M])==null?void 0:w.data)??[];for(let S=0;S<V.length;S++){const x=V[S];if(x.y!=null){const I=al(x.x),T=h.get(I);C.stored++,!s||I<s.from||I>s.to?C.outOfWindow++:T&&(C.points++,T[r[p]].push(x.y),T.total++)}}}return C}),m=a.map(p=>{var C;const y=i[p];return{id:p,fromTime:y.fromTime,fromText:_e(y.fromTime),toTime:y.toTime,toText:_e(y.toTime),lastDataTime:y.lastDataTime,lastDataText:_e(y.lastDataTime),length:y.length,startIndex:y.startIndex,endIndex:y.endIndex,buckets:((C=y.dataGroup)==null?void 0:C.length)??0,lastTick:y.lastTick?{...y.lastTick}:null}});return{version:Si,request:{...l,fromText:_e(l.from),toText:_e(l.to)},window:s?{...s,fromText:_e(s.from),toText:_e(s.to)}:null,judge:dc(l,s),series:u,seconds:[...h.values()].map(p=>(a.forEach(y=>{p[r[y]]=ZC(p[r[y]])}),p)),store:m,pruned:[...e.prunedRealTimeScatterSeries??[]],frame:hc(e)}},NC=(e,t,n)=>{var s,l;const i=uc(e,t,n);return i?(be.log(`${Be} realTimeScatter 조회 ${i.request.fromText} ~ ${i.request.toText} — ${i.judge} (창 ${((s=i.window)==null?void 0:s.fromText)??"-"} ~ ${((l=i.window)==null?void 0:l.toText)??"-"})`),be.table(i.series),be.table(i.seconds),be.table(i.store.map(({lastTick:a,...r})=>({...r,gapCount:a==null?void 0:a.gapCount}))),be.log(`${Be} 만료 series:`,i.pruned,"직전 프레임:",i.frame),i):null},PC=(e,t,n)=>{const i=uc(e,t,n);if(!i)return null;const s=i.seconds.filter(c=>c.total>0),a=Object.keys(i.seconds[0]??{}).filter(c=>!["time","total"].includes(c)).filter(c=>s.some(d=>d[c]!==null)),r=s.map(c=>{const d={time:c.time,total:c.total};return a.forEach(h=>{d[h]=c[h]}),d});return be.log(`${Be} realTimeScatter 데이터 있는 초 ${r.length}초 / ${i.seconds.length}초 ${i.request.fromText} ~ ${i.request.toText} — ${i.judge}`),be.table(r),{version:i.version,request:i.request,window:i.window,judge:i.judge,seconds:r}},DC=e=>{if(!e.isInit)return be.warn(`${Be} 초기화되지 않은 차트다`),null;e.pointsLayerValid=!1,e.render();const t=hc(e);return be.log(`${Be} 강제 full redraw`,t),t},fc=e=>Math.max(1,Math.floor(Number(e))||1),BC=()=>{var e;try{const t=Math.floor(Number((e=window.localStorage)==null?void 0:e.getItem(ll)));return t>=1?t:!1}catch{return!1}},rl=()=>typeof window>"u"?!1:(window[Ci]===void 0&&(window[Ci]=BC()),Number(window[Ci])>=1),ks=()=>fc(window[Ci]),cl=e=>`${e}초 이상 빈 구간만(공백이 끝나면 찍음)`,OC=(e,t)=>{var s,l;if(!((s=e.dataGroup)!=null&&s.length)||t>e.toTime||t<=e.fromTime)return!1;let n=e.endIndex-(e.toTime-t)/$e;n<0&&(n+=e.length);const i=((l=e.dataGroup[n])==null?void 0:l.data)??[];for(let a=0;a<i.length;a++)if(i[a].y!=null&&al(i[a].x)===t)return!0;return!1},dl=e=>{var t,n;return((n=(t=e.options)==null?void 0:t.realTimeScatter)==null?void 0:n.label)||""},YC=(e,t)=>{const n=t.map(i=>{var s,l;return((l=(s=e.seriesList)==null?void 0:s[i])==null?void 0:l.name)??i});return n.length>3?`${n.slice(0,3).join(", ")} 외 ${n.length-3}`:n.join(", ")},mc=(e,t)=>{const n=(t-e)/$e+1;return{range:n>1?`${_e(e)} ~ ${_e(t)}`:_e(e),count:n}},ws="color: #fff; border-radius: 3px; padding: 0 4px;",FC={start:`${ws} background: #e8590c;`,range:`${ws} background: #2b8a3e;`,late:`${ws} background: #1971c2;`,on:`${ws} background: #495057;`},hl=new Set,pc=["#9775fa","#e64980","#1098ad","#5c940d","#fa5252","#5c7cfa","#cc5de8","#0ca678"],Is=e=>{if(e._inspectNo==null){let t=1;for(;hl.has(t);)t++;hl.add(t),e._inspectNo=t}return e._inspectNo},HC=e=>{const t=pc[(e-1)%pc.length];return`color: ${t}; border: 1px solid ${t}; border-radius: 3px; padding: 0 4px; font-weight: bold;`},ki=(e,t,n,i)=>{var r;const s=Is(e),l=dl(e),a=(r=e.data)==null?void 0:r.logInfo;return[`${Be} realTimeScatter %c차트 #${s}${l?` ${l}`:""}%c %c${n}%c ${i}${a?` — ${a}`:""}`,HC(s),"",FC[t],""]},gc=(e,t,n,i="")=>{const{range:s,count:l}=mc(t,n);be.warn(...ki(e,"range","빈 초",`${s} (${l}초${i})`))},bc=(e,t,n="")=>{be.warn(...ki(e,"start","빈 초 시작",`${_e(t)}${n?` (${n})`:""} — 데이터가 다시 들어오면 구간을 한 줄로 찍는다`))},zC=e=>{const t=[];return[...e].sort((n,i)=>n-i).forEach(n=>{const i=t.at(-1);i&&n===i[1]+$e?i[1]=n:t.push([n,n])}),t},AC=(e,t,n)=>{const i=e._emptyLogReported;if(!(i!=null&&i.size))return;const s=[];i.forEach(l=>{l<n?i.delete(l):t(l)||(s.push(l),i.delete(l))}),zC(s).forEach(([l,a])=>{const{range:r,count:c}=mc(l,a);be.warn(...ki(e,"late","늦게 채워짐",`${r} (${c}초) — 앞서 빈 초로 찍은 초에 데이터가 늦게 들어왔다`))})},_C=(e,t,n,i)=>{e._emptyLogReported??(e._emptyLogReported=new Set);for(let s=Math.max(t,i);s<=n;s+=$e)e._emptyLogReported.add(s)};let ul=0;const KC=(e,t,n)=>{var w,M;e._emptyLogGeneration!==ul&&(e._emptyLogGeneration=ul,e._emptyLogCheckedTo=null,e._emptyLogOpenFrom=null,e._emptyLogFilledStart=null,(w=e._emptyLogReported)==null||w.clear(),e._emptyLogAnnounced=!1);const i=e.dataSet??{},s=Object.keys(i),l=V=>!s.some(S=>OC(i[S],V)),a=n-$e,r=e._emptyLogCheckedTo,c=dl(e);if(e._emptyLogAnnounced&&c&&c!==e._emptyLogLabel&&be.log(...ki(e,"on","차트 이름","— 이후 줄은 이 이름으로 찍는다")),e._emptyLogLabel=c,r==null){const V=Object.values(i).some(S=>S.lastDataTime>0);if(n&&V&&(e._emptyLogCheckedTo=a),!e._emptyLogAnnounced){e._emptyLogAnnounced=!0;const S=e._emptyLogCheckedTo==null?"첫 데이터가 들어오면 그 시각부터 본다":`${_e(n)} 부터 지나가는 초를 본다`,x=Is(e),I=ks(),T=I>1?` · ${cl(I)}`:"";be.log(...ki(e,"on","빈 초 로그 켜짐",`— ${S}${T} — 조회: ${_t}(${x}).query()`))}return}if(!n)return;const d=ks(),h=d===1,u=(V,S)=>(S-V)/$e+1,m=a<r;if(m||r+$e<t){const V=e._emptyLogOpenFrom;V!=null&&h&&gc(e,V,r,m?", 시각이 뒤로 가 기준을 다시 잡음":", 그 뒤로 데이터가 오지 않아 기준을 다시 잡음"),e._emptyLogOpenFrom=null,e._emptyLogFilledStart=null,(M=e._emptyLogReported)==null||M.clear(),e._emptyLogCheckedTo=a;return}AC(e,l,t);const f=e._emptyLogOpenFrom,g=f??r+$e,p=Math.max(g,t);let y=g<t?g:null,C=f==null;const b=h?f:null;let k=e._emptyLogFilledStart??null;const L=V=>`앞서 찍은 시작 ${_e(V)} 은 늦게 채워짐`;e._emptyLogCheckedTo=a;for(let V=p;V<=a;V+=$e){const S=l(V);if(S&&y===null)y=V;else if(!S&&y!==null){const x=V-$e;if(u(y,x)>=d){const I=!C&&b!=null&&y!==b?b:k,T=I==null?"":`, ${L(I)}`;gc(e,y,x,T),_C(e,y,x,t),k=null}C=!0,y=null}}!C&&y===null?b!=null&&(k=b):!C&&b!=null&&y!==b?bc(e,y,L(b)):C&&y!==null&&h&&(bc(e,y,k==null?"":L(k)),k=null),e._emptyLogOpenFrom=y,e._emptyLogFilledStart=k},Ts=new WeakMap,UC=e=>{const t=n=>(...i)=>{var l;const s=(l=e.getChart)==null?void 0:l.call(e);return s?n(s,...i):(be.warn(`${Be} 언마운트된 차트다 — 화면의 차트 목록: ${_t}.list()`),null)};return{get chart(){var n;return((n=e.getChart)==null?void 0:n.call(e))??null},version:Si,query:t(NC),queryData:t(PC),redraw:t(DC)}},JC=e=>{var i,s;const t=(i=e==null?void 0:e.closest)==null?void 0:i.call(e,".ev-chart");if(t)return t;const n=((s=e==null?void 0:e.querySelectorAll)==null?void 0:s.call(e,".ev-chart"))??[];return n.length>1&&be.warn(`${Be} 고른 요소 안에 차트가 ${n.length}개다 — 차트 안쪽 요소를 고른다`),n.length===1?n[0]:null},Ls=e=>{var t,n;return!!((n=(t=e==null?void 0:e.options)==null?void 0:t.realTimeScatter)!=null&&n.use)},Ms=e=>{var t,n;return((n=(t=Ts.get(e))==null?void 0:t.getChart)==null?void 0:n.call(t))??null},jC=e=>{const t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight;return(t.width>0||t.height>0)&&!(t.bottom<0||t.top>n)},QC=e=>[...document.querySelectorAll(".ev-chart")].find(t=>{var n;return((n=Ms(t))==null?void 0:n._inspectNo)===e})??null,vs=e=>{const t=typeof e=="number"?QC(e):JC(e),n=t?Ms(t):null;if(n&&!Ls(n))return be.warn(`${Be} realTimeScatter 차트가 아니다 — 대상 목록: ${_t}.list()`),null;const i=t==null?void 0:t[ol];return i||(be.warn(`${Be} 차트를 찾지 못했다 — Elements 패널에서 차트 안 요소를 고른 뒤 ${_t}($0) 또는 로그의 차트 번호로 ${_t}(번호). 화면의 차트 목록은 ${_t}.list()`),null)};vs.version=Si,vs.logEmpty=(e,t)=>{if(e===void 0){const s=rl(),l=ks(),a=l>1?cl(l):"모든 빈 초";return be.log(`${Be} realTimeScatter 빈 초 로그 ${s?`켜져 있음 — ${a}`:"꺼져 있음"}`),s}const n=fc(t==null?void 0:t.minSeconds);e&&(!rl()||ks()!==n)&&(ul+=1),window[Ci]=e?n:!1;try{e?window.localStorage.setItem(ll,String(n)):window.localStorage.removeItem(ll)}catch{be.warn(`${Be} localStorage 를 쓸 수 없어 이 창에서만 적용된다`)}const i=e?`켬${n>1?` (${cl(n)})`:""}`:"끔";return be.log(`${Be} realTimeScatter 빈 초 로그 ${i} — 이미 열린 다른 창은 새로고침해야 반영된다`),!!e},vs.list=()=>{const e=[...document.querySelectorAll(".ev-chart")].filter(jC).map(Ms).filter(Ls).map(t=>({no:Is(t),title:dl(t),series:YC(t,Object.keys(t.seriesList??{}))}));return be.table(e),e};const $C=(e,t)=>{if(!e)return;const n={getChart:t};Ts.set(e,n),Object.defineProperty(e,ol,{configurable:!0,enumerable:!1,get:()=>Ls(t())?UC(n):null});const i=t();Ls(i)&&Is(i),typeof window<"u"&&!window[_t]&&(window[_t]=vs)},qC=e=>{var t;if(e){const n=(t=Ms(e))==null?void 0:t._inspectNo;n!=null&&hl.delete(n);const i=Ts.get(e);i&&(i.getChart=null,Ts.delete(e)),delete e[ol]}},e1={createDataSet(e,t){var n;this._dataEpoch=(this._dataEpoch??0)+1,Object.keys(this.seriesInfo.charts).forEach(i=>{var l;const s=this.seriesInfo.charts[i];if(s.length)if(i==="pie")this.options.sunburst?this.createSunburstDataSet(e):this.createPieDataSet(e,s);else if(i==="scatter")s.forEach(a=>{const r=this.seriesList[a],c=e[a],d=r==null?void 0:r.passingValue;r&&c&&(r.data=this.addSeriesDSforScatter(c),r.minMax=this.getSeriesMinMax(r.data,d))});else if(i==="heatMap")s.forEach(a=>{const r=this.seriesList[a],c=r==null?void 0:r.passingValue,d=e[a];r&&d&&(r.labels=t,r.data=this.addSeriesDSForHeatMap(d),r.minMax=this.getSeriesMinMax(r.data,c),r.valueOpt=this.getSeriesValueOptForHeatMap(r))});else{const a=s[0],r=(l=this.seriesList[a])==null?void 0:l.passingValue,c=new Map;for(let d=0;d<s.length;d++){const h=s[d],u=this.seriesList[h];if(u&&u.show!==!1){const m=e==null?void 0:e[h],{passingValue:f,interpolation:g}=u,p=g==="zero"||f!=null&&f!==void 0;let y=!1,C;if(!m)C=m;else if(!p)C=m;else{C=new Array(m.length);for(let b=0;b<m.length;b++){const k=m[b];g==="zero"&&!k?C[b]=0:k===f?(y=!0,C[b]=null):C[b]=k}}if(u.hasPassingValueInData=y,C){const b=u.isExistGrp&&!u.isOverlapping;let k=null;b&&(k=c.get(u.groupIndex),k||(k={pos:[],neg:[]},c.set(u.groupIndex,k))),b&&u.stackIndex?u.data=this.addSeriesStackDS(C,t,u.stackIndex,k,u.data):u.data=this.addSeriesDS(C,t,u.isExistGrp,r,u.data),u.minMax=this.getSeriesMinMax(u.data,u.passingValue),b&&this.updateStackTops(k,u)}}}}}),(n=this.buildLabelValidMask)==null||n.call(this)},createRealTimeScatterDataSet(e){var l,a,r,c;const t=this.prunedRealTimeScatterSeries;let n=t!=null&&t.size?Object.keys(e).filter(d=>!t.has(d)):Object.keys(e);n.length||(n=Object.keys(this.dataSet));const i={maxY:-1/0,minY:1/0,fromTime:0,toTime:0},s={fromTime:0,toTime:0};for(let d=0;d<n.length;d++){const h=n[d],u=e[h],m=u==null?void 0:u.length;if(!this.isInit||this.updateSeries||!this.dataSet[h]){const R={dataGroup:[],startIndex:0,endIndex:null,length:0,fromTime:0,toTime:0,lastDataTime:0};this.dataSet[h]={...R,...this.dataSet[h]}}const f=this.dataSet[h],g=f.dataGroup,p=this.options.realTimeScatter.range||300,y=f.length!==p;f.length=p;const C=f.length;let b=0;for(let R=0;R<m;R++){const X=u[R];X&&b<X.x&&(b=X.x)}b=b?Math.floor(b/1e3)*1e3:0;const k=((r=(a=(l=g.at(-1))==null?void 0:l.data)==null?void 0:a.at(-1))==null?void 0:r.x)||Date.now(),L=Math.floor(k/1e3)*1e3,w=f.toTime||L;let M=w;b&&(M=b<f.lastDataTime-C*1e3?b:Math.max(b,f.lastDataTime),f.lastDataTime=M);const V=R=>{R.data.length=0,R.dataKeys?R.dataKeys.clear():R.dataKeys=new Set,R.max=0,R.min=1/0};if(f.endIndex==null||y){f.startIndex=0,f.endIndex=C-1,g.length=C;for(let R=0;R<C;R++)g[R]=g[R]||{data:[],dataKeys:new Set,max:0,min:1/0},V(g[R]);f.toTime=M,f.fromTime=f.toTime-C*1e3}const S=(M-w)/1e3,x=Number.isFinite(S)?Math.max(0,Math.floor(S)):0;f.toTime=M,f.fromTime=f.toTime-C*1e3;for(let R=0;R<C;R++)g[R]?g[R].data?g[R].dataKeys||(g[R].dataKeys=new Set):(g[R].data=[],g[R].dataKeys=new Set,g[R].max=0,g[R].min=1/0):g[R]={data:[],dataKeys:new Set,max:0,min:1/0};if(x>0)if(x>=C){for(let R=0;R<C;R++)V(g[R]);f.startIndex=0,f.endIndex=C-1}else{let R=f.startIndex,X=f.endIndex;for(let G=0;G<x;G++)V(g[R]),R=(R+1)%C,X=(X+1)%C;f.startIndex=R,f.endIndex=X}const I=this.options.coordinateDedupe!==!1;let T=-1;for(let R=0;R<m;R++){const X=u[R];if(X){const G=Math.floor(X.x/1e3)*1e3;if(f.fromTime<=G){let N=f.endIndex-(f.toTime-G)/1e3;N<0&&(N=C+N);const P=g[N],B=A.coordinateKey(X.x,X.y);if(!(I&&P.dataKeys.has(B))){I&&P.dataKeys.add(B),P.data.push({x:X.x,y:X.y,o:X.value??X.y,color:X.color,k:I&&this.seriesInfo.charts.scatter.length>1?B:void 0}),P.max=Math.max(P.max,X.y),P.min=Math.min(P.min,X.y);const D=(f.toTime-G)/1e3;D>T&&(T=D)}}}}f.lastTick={seq:(((c=f.lastTick)==null?void 0:c.seq)??0)+1,gapCount:x,prevToTime:w,toTime:f.toTime,length:C,startIndex:f.startIndex,endIndex:f.endIndex,maxDirtyAge:T};const v=1e3,E={maxY:-1/0,minY:1/0};for(let R=0;R<C;R++){const X=g[R];for(let G=0;G<X.data.length;G++){const N=X.data[G],P=Math.floor(N.x/v)*v;P>=f.fromTime&&P<=f.toTime&&Number.isFinite(N.y)&&(N.y>E.maxY&&(E.maxY=N.y),N.y<E.minY&&(E.minY=N.y))}}Number.isFinite(E.minY)&&(i.maxY=Math.max(i.maxY,E.maxY),i.minY=Math.min(i.minY,E.minY));const W=f.lastDataTime?i:s;f.toTime>W.toTime&&(W.toTime=f.toTime,W.fromTime=f.fromTime)}i.toTime||(i.toTime=s.toTime,i.fromTime=s.fromTime),Number.isFinite(i.minY)||(i.minY=0,i.maxY=0),this.pruneExpiredRealTimeScatterSeries(e),this.seriesInfo.charts.scatter.forEach(d=>{const h=this.seriesList[d];h.data=this.dataSet,h.minMax={minX:We(i.fromTime+1e3),minY:i.minY,maxX:We(i.toTime),maxY:i.maxY}}),rl()&&KC(this,i.fromTime+1e3,i.toTime)},pruneExpiredRealTimeScatterSeries(e){var d,h,u,m;const t=this.dataSet,n=Object.keys(t);if(!n.length)return;let i=0,s=0;for(let f=0;f<n.length;f++){const g=t[n[f]],p=g.toTime||0;g.lastDataTime?i=Math.max(i,p):s=Math.max(s,p)}i||(i=s);const l=((d=this.options.realTimeScatter)==null?void 0:d.range)||300,a=i-(l-1)*1e3,r=[];for(let f=0;f<n.length;f++){const g=n[f],y=t[g].toTime<a,C=!((h=e[g])!=null&&h.length);y&&C&&r.push(g)}if(!r.length)return;for(let f=0;f<r.length;f++)this.removeRealTimeScatterSeries(r[f]);const c=this.options.legend;c!=null&&c.show&&(c!=null&&c.external)?(u=this.emitLegendData)==null||u.call(this):c!=null&&c.show&&((m=this.updateLegend)==null||m.call(this))},removeRealTimeScatterSeries(e){var i,s,l,a,r,c;delete this.dataSet[e],(i=this.seriesList)!=null&&i[e]&&delete this.seriesList[e];const t=(l=(s=this.seriesInfo)==null?void 0:s.charts)==null?void 0:l.scatter;if(Array.isArray(t)){const d=t.indexOf(e);d!==-1&&t.splice(d,1)}(a=this._updateSeriesCount)==null||a.call(this),(this.prunedRealTimeScatterSeries??(this.prunedRealTimeScatterSeries=new Set)).add(e);const n=(r=this.defaultSelectInfo)==null?void 0:r.seriesId;if(Array.isArray(n)){const d=n.indexOf(e);d!==-1&&n.splice(d,1)}((c=this.defaultSelectItemInfo)==null?void 0:c.seriesID)===e&&(this.defaultSelectItemInfo=null)},resetRealTimeScatterDataSet(){Object.values(this.dataSet??{}).forEach(e=>{e.dataGroup=[],e.lastDataTime=0})},createSunburstDataSet(e){this.pieDataSet=[];const t=this.pieDataSet,n=[];for(let i=0;i<e.length;i++){const s=e[i],l=this.seriesList[s.id];let a=!1;if(t[0]||(t[0]={ir:0,or:0,total:0,data:[]}),l.show){if(t[0].total+=s.value||0,t[0].data.push({parent:"$ev-root",id:s.id,value:s.value,sa:0,ea:0}),s.children)for(let r=0;r<s.children.length;r++)this.seriesList[s.children[r].id].show&&(a=!0),n.push({parent:s.id,data:s.children[r],depth:1});else{const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}if(!a){const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}}}for(t[0].data.sort((i,s)=>s.value-i.value);n.length;){const i=n.shift(),s=i.parent,l=i.data,a=i.depth;let r=!1;t[a]||(t[a]={ir:0,or:0,total:{},data:[]}),t[a].total[s]||(t[a].total[s]=0);const c=this.seriesList[l.id];if(l.id==="dummy")t[a].data.push({parent:s,id:"dummy",value:l.value,sa:0,ea:0}),t[a].total[s]+=l.value;else if(c&&c.show){if(t[a].data.push({parent:s,id:l.id,value:l.value,sa:0,ea:0}),t[a].total[s]+=l.value,l.children)for(let d=0;d<l.children.length;d++)this.seriesList[l.children[d].id].show&&(r=!0),n.push({parent:l.id,data:l.children[d],depth:a+1});else{const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}if(!r){const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}}t[a].data.sort((d,h)=>h.value-d.value)}},createPieDataSet(e,t){this.pieDataSet=[];const n=this.pieDataSet;n[0]={data:[],ir:0,or:0,total:0},t.forEach(i=>{if(this.seriesList[i].show){const s=e[i][0]??0;n[0].total+=s,n[0].data.push({id:i,value:s,sa:0,ea:0})}}),n.forEach(i=>{i.data.sort((s,l)=>l.value-s.value)})},addSeriesStackDS(e,t,n=0,i=null,s){const l=this.options.horizontal,a=[],r=i==null?void 0:i.pos,c=i==null?void 0:i.neg,d=Array.isArray(s)?s:null;return e.forEach((h,u)=>{let m=(h>=0?r==null?void 0:r[u]:c==null?void 0:c[u])??0,f=h,g=t[u],p=h;if(m!=null&&g!=null){p&&typeof p=="object"&&("x"in p||"y"in p)&&(f=l?h.x:h.y,g=l?h.y:h.x);const y=(f==null?void 0:f.value)??f;n>0?y!=null?p=m+y:p=f:(m=0,p=y);const C=d&&d[a.length];a.push(this.addData(p,g,f,m,C||null))}}),a},updateStackTops(e,t){if(!t.show)return;const n=this.options.horizontal,i=t.passingValue,s=!A.isNullOrUndefined(i),l=t.data,a=e.pos,r=e.neg;for(let c=0;c<l.length;c++){const d=l[c],h=n?d.x:d.y,u=d.o,m=s&&u===i;h!=null&&!m&&(u>=0?a[c]=h:r[c]=h)}},addSeriesDS(e,t,n,i,s){const l=this.options.horizontal,a=[],r=n&&!A.isNullOrUndefined(i),c=Array.isArray(s)?s:null;for(let d=0;d<e.length;d++){let h=e[d],u=t[d];if(h&&typeof h=="object"&&(h.x||h.y)&&(h=l?h.x:h.y,u=l?e[d].y:e[d].x),u!==null){const m=r&&h===i?0:h;if(m!==null&&typeof m=="object"||h!==null&&typeof h=="object")a.push(this.addData(m,u,h));else{const f=m??null,g=h??null,p=c&&c[a.length];p&&typeof p=="object"?(p.x=l?f:u,p.y=l?u:f,p.o=g,p.b=null,p.xp=null,p.yp=null,p.w=null,p.h=null,p.dataColor=null,p.dataTextColor=null,a.push(p)):a.push(l?{x:f,y:u,o:g,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null}:{x:u,y:f,o:g,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null})}}}return a},addSeriesDSforScatter(e){return e.map(t=>{const n=t.x,i={value:t.y,color:(t==null?void 0:t.color)||null};return this.addData(i,n,i)})},addSeriesDSForHeatMap(e){return e.map(({x:t,y:n,value:i,color:s=null})=>({x:t,y:n,o:i,xp:null,yp:null,w:null,h:null,dataColor:s,cId:null}))},addData(e,t,n=null,i=null,s=null){let l=null,a=null,r=null,c=null,d=null;e!==null&&typeof e=="object"?(l=e.value,r=e.color,d=e.textColor):l=e??null,n!==null&&typeof n=="object"?(a=n.value,c=n.color):a=n??null;const h=s||{};return this.options.horizontal?(h.x=l,h.y=t):(h.x=t,h.y=l),h.o=a,h.b=i,h.xp=null,h.yp=null,h.w=null,h.h=null,h.dataColor=r??c,h.dataTextColor=d,h},getSeriesMinMax(e,t){const n={minX:null,minY:null,maxX:null,maxY:null,maxDomain:null},i=this.options.horizontal;if(e.length){const s=!A.isNullOrUndefined(t),l={minX:e[0].x,minY:e[0].y,maxX:e[0].x,maxY:e[0].y,maxDomain:i?e[0].y:e[0].x,maxDomainIndex:0};for(let a=0;a<e.length;a++){const r=e[a],c=r.x,d=r.y,h=r.o;(!s||h!==t)&&(c<=l.minX&&(l.minX=c===null?0:c),d<=l.minY&&(l.minY=d===null?0:d),c>=l.maxX&&(l.maxX=c===null?0:c,i&&c!==null&&(l.maxDomain=d,l.maxDomainIndex=a)),d>=l.maxY&&(l.maxY=d===null?0:d,!i&&d!==null&&(l.maxDomain=c,l.maxDomainIndex=a)))}return l}return n},getVisibleWindowMaxSeries(e,t){var l;if(!Number.isFinite(e)||!Number.isFinite(t)||t<e)return null;const n=this.options.horizontal;let i=null;const s=Object.keys(this.seriesList);for(let a=0;a<s.length;a+=1){const r=this.seriesList[s[a]];if(r!=null&&r.show&&((l=r.data)!=null&&l.length)){const c=Math.max(0,e),d=Math.min(r.data.length-1,t);for(let h=c;h<=d;h+=1){const u=r.data[h],m=n?u==null?void 0:u.x:u==null?void 0:u.y;Number.isFinite(m)&&(!i||m>i.value)&&(i={sId:r.sId,value:m,index:h,domain:n?u==null?void 0:u.y:u==null?void 0:u.x})}}}return i},getSeriesValueOptForHeatMap(e){const{data:t,colorState:n,isGradient:i}=e,s=this.options.heatMapColor,l=s.colorsByRange.length||s.rangeCount,a=s.decimalPoint;let r,c=0,d=!1;t.forEach(({o:u})=>{c<u&&(c=Math.max(c,u)),u<0?d=!0:r===void 0?r=u:r=Math.min(r,u)}),d&&!i&&n.length===l&&n.push({id:`color#${l}`,color:s.error,state:"normal",label:"Error",show:!0});let h=c>r?Math.floor((c-r)/l):1;return c-r<=l&&(a>0?h=+((c-r)/l).toFixed(a):h=1),{min:r,max:c,interval:h,existError:d,decimalPoint:a}},getItemByLabelIndex(e){if(e<0)return!1;const t=Object.keys(this.seriesList),n=!!this.options.horizontal;let i=null,s=null,l=null,a="",r=0,c=!1,d=!1;if(e>-1){for(let h=0;h<t.length;h++){const u=t[h],m=this.seriesList[u],f=m.data[e];if(f&&m.show&&m.showLegend){const g=n?f.y:f.x,p=n?f.yp:f.xp;if(g!=null){const y=n?f.o||f.x:f.o||f.y;m.stackIndex?(r+=isNaN(f.o)?0:f.o,c=!0):r+=f.y,(l===null||l<=y)&&(l=y,a=u,i=g,s=p)}}}d={label:i,pos:s,value:l===null?0:l,sId:a,acc:r,useStack:c,maxIndex:e}}return d},getItem(e,t=!1){const{seriesID:n,dataIndex:i}=e;let s;if("seriesID"in e){const l=this.getDataByValues(n,i);if(!l||!(l!=null&&l.xp)||!(l!=null&&l.yp))return null;s=[this.getHitItemByPosition([l.xp,l.yp],t,i,!0)]}else{const l=Object.entries(this.seriesList);let a;for(let r=0;r<l.length;r++){const[c,d]=l[r];if(d.show){a=c;break}}s=i==null?void 0:i.map(r=>{var h,u;const c=this.getDataByValues(a,r);if(!c)return null;const d=this.getHitItemByPosition([(c==null?void 0:c.xp)??0,(c==null?void 0:c.yp)??0],t,r,!0);return d&&!d.sId&&(d.sId=a,d.label=((u=(h=this.data)==null?void 0:h.labels)==null?void 0:u[r])??d.label,d.dataIndex=r),d})}return s},getDataByValues(e,t){const n=this.seriesList[e];return!n||isNaN(t)||t<0||(n==null?void 0:n.data.length)<=t?!1:n.data[t]},getHitItemByPosition(e,t=!1,n,i=!1,s=!1){var v;const l=Object.keys(this.seriesList),a=!!this.options.horizontal,[r,c]=e;let d=n;if(d===void 0&&!t){const E=l.find(Z=>{var R;const W=this.seriesList[Z];return(W==null?void 0:W.show)&&((R=W==null?void 0:W.data)==null?void 0:R.length)>0});if(E){const Z=this.seriesList[E].data,W=a?e[1]:e[0];let R=1/0,X=-1;for(let G=0;G<Z.length;G++){const N=s||l.some(B=>{var D,Y,F,O;const H=this.seriesList[B];return(H==null?void 0:H.show)&&((Y=(D=H.data)==null?void 0:D[G])==null?void 0:Y.o)!==null&&((O=(F=H.data)==null?void 0:F[G])==null?void 0:O.o)!==void 0}),P=Z[G];if(N&&P){let B;if(a?B=P.h?P.yp+P.h/2:P.yp:B=P.w?P.xp+P.w/2:P.xp,B!=null){const H=Math.abs(W-B);H<R&&(R=H,X=G)}}}X!==-1&&(d=X)}}let h=null,u=null,m=null,f=null,g="",p=null,y=1/0,C=!1,b=null,k=null,L=null,w=null,M="",V=null,S=1/0,x=0,I=!1;for(let E=0;E<l.length;E++){const Z=l[E],W=this.seriesList[Z],R=t?W.findApproximateData:W.findGraphData;if(R){const X=R.call(W,e,a,d,i),G=X.data,N=X.index;if(G)if(A.isPieType(X.type))h=X.type,u=Z,g=Z,m=(G.ea-G.sa)/2,f=G.o,p=G.index;else{const P=a?G.y:G.x,B=a?G.yp:G.xp;if(P!=null){const H=a?G.o||G.x:G.o||G.y;W.stackIndex!=null?(x+=isNaN(G.o)?0:G.o,I=!0):x+=G.y;const D=H!=null&&!Number.isNaN(H),Y=G.xp!==null&&G.xp!==void 0&&G.yp!==null&&G.yp!==void 0;if(D&&Y){const F=A.calcBoxDistance(G,r,c);(M===""||F<S)&&(S=F,b=W.type,k=P,L=B,w=H,M=Z,V=N)}else D&&M===""&&(b=W.type,k=P,L=B,w=H,M=Z,V=N);if(X.hit&&G.xp!==void 0&&G.yp!==void 0){const F=(G.xp-e[0])**2+(G.yp-e[1])**2;X.directHit?((!C||F<y)&&(y=F,h=W.type,u=P,m=B,f=H,g=Z,p=N),C=!0):C||F<y&&(y=F,h=W.type,u=P,m=B,f=H,g=Z,p=N)}}}}}if(s&&g===""&&M===""&&d!==void 0&&d>=0){const E=l.find(W=>{var X;const R=this.seriesList[W];return(R==null?void 0:R.show)&&((X=R==null?void 0:R.data)==null?void 0:X.length)>0}),Z=E?(v=this.seriesList[E].data)==null?void 0:v[d]:null;Z&&(k=a?Z.y:Z.x,V=d)}const T=g!=="";return{type:T?h:b,label:T?u:k,pos:T?m:L,value:T?f:w,sId:T?g:M,acc:x,useStack:I,dataIndex:T?p:V}},getLabelInfoByPosition(e,t){var p,y,C;const[n,i]=e,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=this.data.series,a=((p=Object.values(l).sort((b,k)=>k.pointSize??0-b.pointSize??0)[0])==null?void 0:p.pointSize)??3,{horizontal:r,selectLabel:c}=this.options;let d,h;t==="xAxis"?(d=this.axesX[0],h=this.scrollbar.x):t==="yAxis"?(d=this.axesY[0],h=this.scrollbar.y):(d=r?this.axesY[0]:this.axesX[0],h=r?this.scrollbar.y:this.scrollbar.x);const u=s[d.units.rectStart],m=s[d.units.rectEnd];let f,g;if(h!=null&&h.use&&((y=d==null?void 0:d.labels)!=null&&y.length)){const{type:b,range:k,interval:L=1}=h,[w,M]=k??[0,d.labels.length],V=Math.floor((+M-+w)/L)+1,S=(m-u)/V,I=Math.floor(((t==="yAxis"||r?i:n)-u)/S);b==="step"?f=w+I:f=(d==null?void 0:d.labels.findIndex(v=>v===+w))+I}else if((C=d==null?void 0:d.labels)!=null&&C.length){const b=(m-u)/d.labels.length,L=Math.floor(((t==="yAxis"?i:n)-u)/b);f=d.labels.length>L?L:-1}else{let b,k;n<u-a?(b=u,k=0):n>m+a?(b=m,k=this.data.labels.length-1):b=n,g=this.getHitItemByPosition([b,i],c==null?void 0:c.useApproximateValue,k,!0,!0),f=g.dataIndex??-1}return{labelIndex:f,hitInfo:g}},getCurMouseLabelVal(e,t,n){const{type:i,horizontal:s}=this.options,l=e==="xAxis",a=l?"x":"y";let r="",c=-1;const d=()=>{let u="";switch(i){case"bar":case"line":{u=s&&!l||!s&&l?this.data.labels[n]:"";break}case"heatMap":{u=this.data.labels[a][n];break}}return u},h=()=>{let u="";const m={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},{steps:f,interval:g,graphMin:p}=this.axesSteps[a][0],{width:y,height:C}=this.axesRange[a][0].size,b=l?this.axesX:this.axesY,k=m[b[0].units.rectStart],L=m[b[0].units.rectEnd],w=Math.abs(t[l?0:1]-k),M=(l?y:C)/2,V=Math.abs(k-L)/f,S=Math.floor((w+M)/V);return V*S+M>w&&V*S-M<w&&(u=S*g+p),u};return typeof n=="number"&&(r=d(),c=n),r||(r=h(),c=-1),{labelVal:r,labelIdx:c}},getStoreMinMax(){const e=Object.keys(this.seriesList),t=this.options.horizontal,n={x:[{min:null,max:null}],y:[{min:null,max:null}]};return e.length?e.reduce((i,s)=>{const l=i,a=this.seriesList[s],r=a.minMax,c=a.xAxisIndex,d=a.yAxisIndex;if(l.x[c]||(l.x[c]={min:null,max:null,maxSID:null}),l.y[d]||(l.y[d]={min:null,max:null,maxSID:null}),r&&a.show){t?((l.x[c].min===null||r.minX!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),r.minY!==null&&(l.y[d].min===null||r.minY!==null&&r.minY<l.y[d].min)&&(l.y[d].min=r.minY)):(r.minX!==null&&(l.x[c].min===null||r.minX!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),(l.y[d].min===null||r.minY!==null&&r.minY<l.y[d].min)&&(l.y[d].min=r.minY));const h=this.seriesList[s].isExistGrp,u=l.x[c].max<0;(h&&u||!l.x[c].max||r.maxX>=l.x[c].max)&&(l.x[c].max=r.maxX,l.x[c].maxSID=s);const m=l.y[d].max<0;(h&&m||!l.y[d].max||r.maxY>=l.y[d].max)&&(l.y[d].max=r.maxY,l.y[d].maxSID=s)}return l},{x:[{min:null,max:null,maxSID:null}],y:[{min:null,max:null,maxSID:null}]}):n},calculateAngle(){const e=this.pieDataSet;let t,n,i,s,l,a,r,c,d;const h=[],u={"$ev-root":1.5*Math.PI};for(let m=0;m<e.length;m++){const f=e[m];d=!0;for(let g=0;g<f.data.length;g++)if(t=f.data[g],n=t.value,d&&(d=t.id==="dummy"),!m)a=u["$ev-root"],l=2*Math.PI*(n/f.total),r=a+l,t.sa=a,t.ea=r,u["$ev-root"]+=l;else{if(i=this.getParentInfo(m-1,t.parent),!i)break;u[t.parent]||(u[t.parent]=i.sa),a=u[t.parent],c=i.ea-i.sa,s=f.total[t.parent]||0,l=c*(n/s),r=a+l,t.sa=a,t.ea=r,u[t.parent]+=l}d&&h.push(m)}for(let m=0;m<h.length;m++)this.pieDataSet.splice(h,1);this.options.reverse&&(this.pieDataSet=Ub(this.pieDataSet))},getParentInfo(e,t){for(let n=e;n>=0;n--){const i=this.pieDataSet[n];for(let s=0;s<i.data.length;s++)if(i.data[s].id===t)return i.data[s]}return null},getAggregations(){const e=this.data.data,t=this.data.series,n={},i=Object.keys(t);return i==null||i.forEach(s=>{const l=e[s].map(m=>m!=null&&m.value?m.value:m),a=l[l.length-1],r=l.filter(m=>m!=null),c=Math.min(...r),d=Math.max(...r),h=r.reduce((m,f)=>m+f,0),u=h/r.length||0;(!A.checkSafeInteger(c)||!A.checkSafeInteger(d)||!A.checkSafeInteger(u)||!A.checkSafeInteger(h)||!A.checkSafeInteger(a))&&console.warn("[EVUI][Chart] The aggregated value exceeds 9007199254740991 or less than -9007199254740991."),n[s]={min:c,max:d,avg:u,total:h,last:a}}),n}},t1={x:{rectStart:"x1",rectEnd:"x2",rectOffsetCounter:e=>e==="top"?"y2":"y1",rectOffset:e=>e==="top"?"y1":"y2"},y:{rectStart:"y2",rectEnd:"y1",rectOffsetCounter:e=>e==="left"?"x2":"x1",rectOffset:e=>e==="left"?"x1":"x2"}},Kt=["#2b99f0","#8ac449","#00C4C5","#ffde00","#ff7781","#8470ff","#75cd8e","#48d1cc","#fec64f","#fe984f","#0052ff","#00a48c","#83cfde","#dfe32d","#ff7d40","#99c7ff","#a5fee3","#0379c9","#eef093","#ffa891","#00c5cd","#009bc7","#cacaff","#ffc125","#df6264"],wi={show:!0,highlight:{defaultSize:4,maxSize:6,maxShadowSize:10,maxShadowOpacity:.4},xAxisIndex:0,yAxisIndex:0,point:!0,pointHighlight:!0,pointSize:3,pointStyle:"",lineWidth:2,fill:!1,fillOpacity:.4,showLegend:!0,passingValue:null,interpolation:"none"},n1={show:!0,highlight:{pointSize:5},xAxisIndex:0,yAxisIndex:0,category:!0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:null}},i1={show:!0,showLegend:!0,stroke:{show:!0,color:"#FFFFFF",lineWidth:2},showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null}},yc={min:null,max:null,autoScaleRatio:null,startToZero:!1,showAxis:!0,axisLineColor:"#C9CFDC",axisLineWidth:1,showGrid:!0,gridLineColor:"#C9CFDC",showAxisTick:!0,showIndicator:!1,timeFormat:"mm:ss",range:null,interval:null,decimalPoint:"auto",fixedSteps:!1,scaleChange:!1,labelStyle:{show:!0,fontSize:12,color:"#25262E",fontFamily:"Roboto",fontWeight:400,fitWidth:!1,fitDir:"right",alignToGridLine:!1,padding:0,fixWidth:void 0},showLastLabel:!1,lastLabelFontStyle:null,firstLabelFontStyle:null,title:{use:!1,text:null,fontWeight:400,fontSize:12,fontFamily:"Roboto",textAlign:"right",fontStyle:"normal",color:"#808080"},scrollbar:{use:!1,width:14,height:14,background:"#F2F2F2",showButton:!0,thumbStyle:{background:"#929292",radius:0}}},xc={show:!1,fontSize:12,fontColor:"#FF0000",fillColor:"#FFFFFF",lineColor:"#FF0000",lineWidth:0,fontWeight:400,fontFamily:"Roboto",verticalAlign:"middle",textAlign:"center",textOverflow:"none",maxWidth:null,text:null,borderRadius:0,gap:null,padding:null,pointer:{show:!1,color:null},position:"outside",showValue:!1,valueFormatter:null,responsive:{valueOnlyBelow:null,hideBelow:null},showTextOnHover:{use:!1,backgroundColor:"#4C4C4C",fontColor:"#FFFFFF",borderColor:null,borderRadius:4,fontSize:12,fontWeight:400,fontFamily:"Roboto",useShadow:!1,shadowOpacity:.25,padding:{top:4,right:8,bottom:4,left:8}}},fl={color:"#FF0000",lineWidth:1,label:xc},ml={color:"#FAE59D",border:null},s1={show:!0,xAxisIndex:0,yAxisIndex:0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:0},highlight:{stroke:{use:!1,color:null,width:1,radius:0},shadow:{use:!0,offsetX:0,offsetY:0,blur:4,color:"#959494"}}},Tt={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:26784e5,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},o1=Object.freeze([1,2,5]),Sc=["cross","crossRot","star","line"],te={calculateX(e,t,n,i,s=0){if(e==null||e>n||e<t)return null;const l=i/(n-t);return Math.ceil(s+l*(e-t))},calculateSubX(e,t,n,i,s=0){if(e==null)return null;const l=i/(n-t);return Math.ceil(s+l*(e-t))},calculateY(e,t,n,i,s=0){let l;if(e==null||e>n||e<t)return null;const a=i/(n-t);return s?l=s-a*(e-(t||0)):l=-(a*(e-(t||0))),Math.floor(l)},drawPoint(e,t,n,i,s){if(!(isNaN(n)||n<=0)){if(t==="rect"){const l=1/Math.SQRT2*n;e.fillRect(i-l,s-l,2*l,2*l),e.strokeRect(i-l,s-l,2*l,2*l);return}e.beginPath(),this._appendPointPath(e,t,n,i,s),Sc.includes(t)||e.fill(),e.stroke()}},_appendPointPath(e,t,n,i,s){let l,a,r,c,d,h,u,m,f;switch(t){case"triangle":l=3*n/Math.sqrt(3),c=l*Math.sqrt(3)/2,e.moveTo(i-l/2,s+c/3),e.lineTo(i+l/2,s+c/3),e.lineTo(i,s-2*c/3),e.closePath();break;case"rectRounded":h=n/Math.SQRT2,u=i-h,m=s-h,f=Math.SQRT2*n,this.roundedRect(e,u,m,f,f,n/2),e.closePath();break;case"rectRot":d=1/Math.SQRT2*n,e.moveTo(i-d,s),e.lineTo(i,s+d),e.lineTo(i+d,s),e.lineTo(i,s-d),e.closePath();break;case"cross":e.moveTo(i,s+n),e.lineTo(i,s-n),e.moveTo(i-n,s),e.lineTo(i+n,s),e.closePath();break;case"crossRot":a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,e.moveTo(i-a,s-r),e.lineTo(i+a,s+r),e.moveTo(i-a,s+r),e.lineTo(i+a,s-r),e.closePath();break;case"star":e.moveTo(i,s+n),e.lineTo(i,s-n),e.moveTo(i-n,s),e.lineTo(i+n,s),a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,e.moveTo(i-a,s-r),e.lineTo(i+a,s+r),e.moveTo(i-a,s+r),e.lineTo(i+a,s-r),e.closePath();break;case"line":e.moveTo(i-n,s),e.lineTo(i+n,s),e.closePath();break;default:e.moveTo(i+n,s),e.arc(i,s,n,0,Math.PI*2);break}},drawPointBatch(e,t,n,i){if(!(isNaN(n)||n<=0||!i||!i.length)){if(t==="rect"){const s=1/Math.SQRT2*n;for(let l=0;l<i.length;l++)e.fillRect(i[l].xp-s,i[l].yp-s,2*s,2*s),e.strokeRect(i[l].xp-s,i[l].yp-s,2*s,2*s);return}e.beginPath();for(let s=0;s<i.length;s++)this._appendPointPath(e,t,n,i[s].xp,i[s].yp);Sc.includes(t)||e.fill(),e.stroke()}},roundedRect(e,t,n,i,s,l){const a=Math.PI,r=a/2;if(l){const c=Math.min(l,s/2,i/2),d=t+c,h=n+c,u=t+i-c,m=n+s-c;e.moveTo(t,h),d<u&&h<m?(e.arc(d,h,c,-a,-r),e.arc(u,h,c,-r,0),e.arc(u,m,c,0,r),e.arc(d,m,c,r,a)):d<u?(e.moveTo(d,n),e.arc(u,h,c,-r,r),e.arc(d,h,c,r,a+r)):h<m?(e.arc(d,h,c,-a,0),e.arc(d,m,c,0,a)):e.arc(d,h,c,-a,a),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,i,s)},createGradient(e,t,n,i,s,l){const{x:a,y:r,w:c,h:d}=n;let h;t?h=e.createLinearGradient(a,0,a+c,0):h=e.createLinearGradient(0,r,0,r+d);for(let u=0;u<i.length;u++){const m=i[u][0]??0,f=i[u][1]??"rgba(255, 255, 255, 0)",g=f.includes("rgba")?A.getOpacity(f):1,p=s?l:g;h.addColorStop(m,A.colorStringToRgba(f,p))}return h}},l1=new Set(["triangle","rect","rectRounded","rectRot","cross","crossRot","star","line"]),Cc=Math.PI*2;class a1{constructor(t,n,i){const s=Pe({},n,wi);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${i}`),["color","pointFill","fillColor"].forEach(l=>{this[l]===void 0&&(this[l]=l==="pointFill"?this.color:Kt[i%Kt.length])}),this.type="line",this.sId=t,this.extent={downplay:{opacity:.3,lineWidth:1},normal:{opacity:1,lineWidth:1},highlight:{opacity:1,lineWidth:2}},this.data=[],this.beforeMouseXp=0,this.beforeMouseYp=0,this.beforeFindItemIndex=-1,this.size={comboOffset:0}}useLinearInterpolation(){return this.interpolation==="linear"||this.interpolation==="none"&&!!this.passingValue&&this.hasPassingValueInData}_getValidGData(){const t=this.data,n=this._validGDataCache;if(n&&n.src===t&&n.length===t.length)return n.value;const i=t.filter(s=>!A.isNullOrUndefined(s.x));return this._validGDataCache={src:t,length:t.length,value:i},i}computeGeometry(t){if(!this.show)return;const n=t.scaleVersion!=null&&t.dataEpoch!=null;if(n&&this._lastDataEpoch===t.dataEpoch&&this._lastScaleVersion===t.scaleVersion&&this._lastGeomData===this.data)return;const{chartRect:i,labelOffset:s,axesSteps:l,displayOverflow:a}=t,r=this.useLinearInterpolation();let c=0;const d=l.x[this.xAxisIndex],h=l.y[this.yAxisIndex];let u=i.chartWidth-(s.left+s.right);const m=i.chartHeight-(s.top+s.bottom);this.combo&&(c=u/(this.data.length||1),u-=c,this.size.comboOffset=c);const f=i.x1+s.left+c/2,g=i.y2-s.bottom,p=d.graphMin,y=d.graphMax,C=h.graphMin,b=h.graphMax,k=u/(y-p),L=m/(b-C),w=C||0,M=S=>S==null||S<p||S>y?null:Math.ceil(f+k*(S-p)),V=S=>{const x=a&&S>b?b:S;return x==null||x<C||x>b?null:Math.floor(g?g-L*(x-w):-(L*(x-w)))};for(let S=0;S<this.data.length;S++){const x=this.data[S];let I=M(x.x),T=V(x.y);this.isExistGrp&&r&&x.o===null&&(T=V(x.b??0)),I!==null&&(I+=A.aliasPixel(I)),x.xp=I,x.yp=T}n&&(this._lastDataEpoch=t.dataEpoch,this._lastScaleVersion=t.scaleVersion,this._lastGeomData=this.data)}hasRenderableValue(){return this.data.some(t=>t.o!==null&&t.o!==void 0)}draw(t){var H,D,Y,F,O,z,j,U,Q;if(!this.show)return;const{ctx:n,chartRect:i,labelOffset:s,axesSteps:l,selectLabel:a,selectSeries:r,legendHitInfo:c,isBrush:d,unSelectedOpacity:h,displayOverflow:u}=t;if(this.computeGeometry(t),!this.hasRenderableValue()&&!this.isExistGrp)return;const m=a==null?void 0:a.option,f=(m==null?void 0:m.use)&&(m==null?void 0:m.useSeriesOpacity),g=((H=a==null?void 0:a.selected)==null?void 0:H.dataIndex)??[];let p;if(c)p=this.extent[(c==null?void 0:c.sId)===this.sId?"highlight":"downplay"];else if((D=r==null?void 0:r.option)!=null&&D.use&&((F=(Y=r==null?void 0:r.selected)==null?void 0:Y.seriesId)!=null&&F.length)){const J=(z=(O=r==null?void 0:r.selected)==null?void 0:O.seriesId)==null?void 0:z.includes(this.sId);p=this.extent[J?"highlight":"downplay"]}else f&&g.length?p=this.extent.downplay:p=this.extent.normal;p===this.extent.downplay&&(p={...p,opacity:h});const y=J=>J!=null&&J.includes("rgba")?A.getOpacity(J):p.opacity,C=this.color,b=y(C),k=this.pointFill,L=y(k),w=this.extent.downplay?this.fillOpacity*p.opacity:this.fillOpacity,M=this.lineWidth*p.lineWidth,V=this._rgbaCache||(this._rgbaCache={}),S=(J,ne,q)=>{const ee=V[J];if(ee!==void 0&&ee.s===ne&&ee.o===q)return ee.v;const $=A.colorStringToRgba(ne,q);return V[J]={s:ne,o:q,v:$},$};n.beginPath(),n.save(),n.lineJoin="round",n.lineWidth=M,n.strokeStyle=S("stroke",C,b),this.segments&&n.setLineDash(this.segments);const x=this.useLinearInterpolation();let I=0;const T=l.x[this.xAxisIndex],v=l.y[this.yAxisIndex];let E=i.chartWidth-(s.left+s.right);const Z=i.chartHeight-(s.top+s.bottom);this.combo&&(I=E/(this.data.length||1),E-=I,this.size.comboOffset=I);const W=i.x1+s.left+I/2,R=i.y2-s.bottom,X=J=>te.calculateX(J,T.graphMin,T.graphMax,E,W),G=J=>te.calculateY(u&&J>v.graphMax?v.graphMax:J,v.graphMin,v.graphMax,Z,R);let N,P=null,B=null;for(let J=0;J<this.data.length;J++){const ne=this.data[J],q=ne.xp,ee=ne.yp;x&&ne.o===null||(q===null||ee===null?N=void 0:(zt(N==null?void 0:N.y)&&!this.isExistGrp||!x&&(zt(N==null?void 0:N.y)||zt(ne.o))?(n.moveTo(q,ee),P=q,B=ee):(q!==P||ee!==B)&&(n.lineTo(q,ee),P=q,B=ee),N=ne))}if(n.stroke(),this.segments&&n.setLineDash([]),this.fill&&this.data.length){n.beginPath();const J=this.data.some(ae=>ae.o<0),ne=J?G(0):i.y2-s.bottom,q=S("fill",this.fillColor||C,w);if((j=this.fill)!=null&&j.gradient){let ae=this.data[0].yp,Se=this.data[0].y;this.data.forEach(re=>{re.yp&&re.yp<=ae?ae=re.yp:re.y&&re.y>=Se&&(Se=re.y)});const ye=n.createLinearGradient(0,i.y2,0,ae),oe=p.opacity<1?q:C;ye.addColorStop(0,J?oe:q),ye.addColorStop(.5,q),ye.addColorStop(1,oe),n.fillStyle=ye}else n.fillStyle=q;let ee=null,$=null;const he=[],fe=this.data.length;for(let ae=0;ae<fe+1;ae++){const Se=(U=this.data[ae])==null?void 0:U.o;if(x&&Ab(Se)||!x&&zt(Se)){if(ee!==null&&$!==null){let ye=ee-1;for(let oe=ae-1;oe>=ee;oe--){const re=(Q=this.data[oe])==null?void 0:Q.o;if(!zt(re)&&re!==null){ye=oe;break}}he.push([ee,ye]),ee=null,$=null}}else x&&Se===null||(ee=ee===null?ae:ee),$=ae}he.forEach(([ae,Se])=>{if(ae===Se){const oe=this.data[ae];if(oe.xp===null||oe.yp===null)return;n.moveTo(oe.xp-M,oe.yp),n.lineTo(oe.xp+M,oe.yp),n.lineTo(oe.xp+M,G(oe.b)??ne);return}let ye=!1;for(let oe=ae;oe<=Se;oe++){const re=this.data[oe];if(re.xp!==null&&re.yp!==null&&(ye?re.o!==null&&n.lineTo(re.xp,re.yp):(n.moveTo(re.xp,re.yp),ye=!0)),oe===Se)for(let Te=Se;Te>=ae;Te--){const Ge=this.data[Te],Lt=X(Ge.x);if(Lt!==null&&Ge.o!==null){const Zt=G(Ge.b)??G(0);n.lineTo(Lt,Zt)}}}}),n.fill()}if(!d){n.strokeStyle=S("stroke",C,b);const J=S("focus",k,1),ne=S("blur",k,L);let q=!1;if(this.interpolation==="linear"){let oe=0;for(let re=0;re<this.data.length&&!(this.data[re].o!==null&&(oe++,oe>1));re++);q=oe===1}const ee=g.length?new Set(g):null,$=this.pointSize,he=this.pointStyle,fe=this.data,ae=fe.length,Se=!l1.has(he),ye=oe=>{const re=fe[oe];if(re.xp===null||re.yp===null||re.o===null)return 0;let pe;if(q)pe=!0;else if(x)pe=!1;else{const Ge=oe>0?fe[oe-1].o:null,Lt=oe+1<ae?fe[oe+1].o:null;pe=Ge==null&&Lt==null}const Te=ee?ee.has(oe):!1;return this.point||pe||Te?Te&&!c?2:1:0};if(Se){let oe=!1,re=null;for(let pe=0;pe<ae;pe++){const Te=ye(pe);if(Te!==0){const Ge=fe[pe];Te===2?(re===null&&(re=[]),re.push(Ge)):(oe||(n.beginPath(),oe=!0),n.moveTo(Ge.xp+$,Ge.yp),n.arc(Ge.xp,Ge.yp,$,0,Cc))}}if(oe&&(n.fillStyle=ne,n.fill(),n.stroke()),re!==null){n.beginPath();for(let pe=0;pe<re.length;pe++){const Te=re[pe];n.moveTo(Te.xp+$,Te.yp),n.arc(Te.xp,Te.yp,$,0,Cc)}n.fillStyle=J,n.fill(),n.stroke()}}else{let oe=null,re=null;for(let pe=0;pe<ae;pe++){const Te=ye(pe);if(Te!==0){const Ge=fe[pe];Te===2?(re===null&&(re=[]),re.push(Ge)):(oe===null&&(oe=[]),oe.push(Ge))}}oe!==null&&(n.fillStyle=ne,te.drawPointBatch(n,he,$,oe)),re!==null&&(n.fillStyle=J,te.drawPointBatch(n,he,$,re))}}n.restore()}itemHighlight(t,n){const i=t.data,s=n,{xp:l,yp:a,o:r}=i;s.save(),l!==null&&a!==null&&r!==null&&this.pointHighlight&&(s.strokeStyle=A.colorStringToRgba(this.color,0),s.fillStyle=A.colorStringToRgba(this.color,this.highlight.maxShadowOpacity),te.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=this.color,te.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",te.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)),s.restore()}findGraphData(t,n,i,s){var m;const l=t[0],a=t[1],r={data:null,hit:!1,color:this.color},c=this._getValidGData(),d=this.useLinearInterpolation(),h=Math.max((this.pointSize??wi.pointSize)+wi.pointSize,wi.highlight.maxSize),u=f=>{if(!f||f.xp===void 0||f.yp===void 0)return!1;const g=l-f.xp,p=a-f.yp;return g*g+p*p<=h*h};if(c!=null&&c.length)if(typeof i=="number"&&this.show){if(r.data=c[i],r.index=i,r.data){const f=c[i];f.o!==null&&f.o!==void 0&&f.yp!==null&&f.yp!==void 0&&(Math.abs(a-f.yp)<=15&&(r.hit=!0),u(f)&&(r.hit=!0,r.directHit=!0))}}else if(typeof this.beforeFindItemIndex=="number"&&this.beforeFindItemIndex!==-1&&this.show&&s)r.data=c[this.beforeFindItemIndex],r.index=this.beforeFindItemIndex;else{let f=1/0,g=-1;const p=[];c.forEach((k,L)=>{k.xp!==null&&k.yp!==null&&k.o!==null&&p.push({...k,originalIndex:L})}),p.length===0&&c.forEach((k,L)=>{p.push({...k,originalIndex:L})});let y=0,C=p.length-1;for(;y<=C;){const k=Math.floor((y+C)/2),L=p[k],w=Math.abs(l-L.xp);if(w<f&&(f=w,g=L.originalIndex),L.xp<l){if(y=k+1,y<p.length){const M=Math.abs(l-p[y].xp);M<f&&(f=M,g=p[y].originalIndex)}}else if(L.xp>l){if(C=k-1,C>=0){const M=Math.abs(l-p[C].xp);M<f&&(f=M,g=p[C].originalIndex)}}else break}const b=p.findIndex(k=>k.originalIndex===g);if(b!==-1)for(let k=Math.max(0,b-2);k<=Math.min(p.length-1,b+2);k++){const L=p[k],w=Math.abs(l-L.xp);w<f&&(f=w,g=L.originalIndex)}if(g!==-1){let k=50;if(c.length>1){const w=[];for(let M=1;M<c.length;M++)c[M].xp!==null&&c[M-1].xp!==null&&w.push(Math.abs(c[M].xp-c[M-1].xp));w.length>0&&(k=w.reduce((M,V)=>M+V,0)/w.length)}const L=Math.max(k,1);if(f<=L)r.data=c[g],r.index=g;else{let w=!1,M=d?1/0:L;const V=d?p:c;for(let S=0;S<V.length;S++){const x=Math.abs(l-V[S].xp);x<=M&&(w=!0,M=x,g=d?V[S].originalIndex:S)}w&&(r.data=c[g],r.index=g)}if(r.data){const w=c[g];Math.abs(a-w.yp)<=15&&(r.hit=!0),u(w)&&(r.hit=!0,r.directHit=!0)}}}return s||(this.beforeMouseXp=l,this.beforeMouseYp=a,typeof r.index=="number"&&(this.beforeFindItemIndex=r.index)),d&&((m=r==null?void 0:r.data)==null?void 0:m.o)===null&&(r.data=null),r}findApproximateData(t){var m,f;const n=t[0],i=t[1],s={data:null,hit:!1,color:this.color},l=this.data.filter(g=>!A.isNullOrUndefined(g.x));if(!l.length)return s;const a=l.length>1?Math.abs(((m=l[1])==null?void 0:m.xp)-((f=l[0])==null?void 0:f.xp)):50,r=Math.max(a*.4,10);let c=0,d=l.length-1,h=-1,u=1/0;for(;c<=d;){const g=Math.floor((c+d)/2),p=l[g].xp;if(p-r<=n&&n<=p+r){const y=Math.max(0,g-2),C=Math.min(l.length-1,g+2);for(let b=y;b<=C;b++)if(l[b].xp!==null&&l[b].yp!==null){const k=Math.sqrt((n-l[b].xp)**2+(i-l[b].yp)**2);k<u&&(u=k,h=b)}return h!==-1&&(s.data=l[h],s.index=h,u<5&&(s.hit=!0)),s}else if(p+r<n){if(g<d&&n<l[g+1].xp){const y=Math.abs(l[g].xp-n),C=Math.abs(l[g+1].xp-n);s.data=y>C?l[g+1]:l[g],s.index=y>C?g+1:g;const b=s.data;return Math.abs(i-b.yp)<10&&(s.hit=!0),s}c=g+1}else{if(g>0&&n>l[g-1].xp){const y=Math.abs(l[g-1].xp-n),C=Math.abs(l[g].xp-n);s.data=y>C?l[g]:l[g-1],s.index=y>C?g:g-1;const b=s.data;return Math.abs(i-b.yp)<10&&(s.hit=!0),s}d=g-1}}return s}findItems({xsp:t,width:n}){const i=t+n;return this.data.filter(s=>t-1<=s.xp&&s.xp<=i+1)}}class r1{constructor(t,n,i,s=!1){const l=Fo({},wi,n);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${i}`),["color","pointFill","fillColor","overflowColor"].forEach(a=>{this[a]===void 0&&(this[a]=Kt[i%Kt.length])}),this.sId=t,this.data=[],this.type="scatter",this.realTimeScatter=s,this._rtTotalCount=0,this._colorCache=new Map}getCachedColor(t,n){const i=`${t}_${n}`;if(this._colorCache.has(i))return this._colorCache.get(i);const s=A.colorStringToRgba(t,n);if(this._colorCache.size>100){const l=this._colorCache.keys().next().value;this._colorCache.delete(l)}return this._colorCache.set(i,s),s}draw(t){this.show&&(this.computeGeometry(t),this.realTimeScatter?this.realTimeScatterDraw(t):this.defaultScatterDraw(t))}computeGeometry(t){this.show&&(this.realTimeScatter?this.computeRealTimeGeometry(t):this.computeDefaultGeometry(t))}computeDefaultGeometry(t){const{duple:n,legendHitInfo:i,coordinateDedupe:s}=t,l=new Set,a=s!==!1;for(let r=0;r<this.data.length;r++){const c=this.data[r],d=A.coordinateKey(c.x,c.y);let h;i?h=i.sId===this.sId:a?h=n.get(d)===this.sId&&!l.has(d):h=!0,h&&(this.calcItem(c,t),c.xp!==null&&c.yp!==null&&a&&!i&&l.add(d))}}computeRealTimeGeometry(t){var r,c,d,h,u,m;const{duple:n,legendHitInfo:i,coordinateDedupe:s}=t,l=s!==!1;let a=0;for(let f=0;f<((c=(r=this.data[this.sId])==null?void 0:r.dataGroup)==null?void 0:c.length);f++)for(let g=0;g<((h=(d=this.data[this.sId])==null?void 0:d.dataGroup[f])==null?void 0:h.data.length);g++){const p=(m=(u=this.data[this.sId])==null?void 0:u.dataGroup[f])==null?void 0:m.data[g];a++;let y;i?y=i.sId===this.sId:l?y=n.get(A.coordinateKey(p.x,p.y))===this.sId:y=!0,y&&this.calcItem(p,t)}this._rtTotalCount=a}getOpacity(t,n,i){const s=n.includes("rgba")?A.getOpacity(n):1;let l=!1;const{selectInfo:a,legendHitInfo:r,unSelectedOpacity:c}=t;return r?l=r.sId!==this.sId:a&&(l=(a==null?void 0:a.seriesID)!==this.sId||(a==null?void 0:a.dataIndex)!==i),l?c:s}calcItem(t,n){const{chartRect:i,labelOffset:s,axesSteps:l,displayOverflow:a}=n,r=l.x[this.xAxisIndex],c=l.y[this.yAxisIndex],d=i.chartWidth-(s.left+s.right),h=i.chartHeight-(s.top+s.bottom),u=this.realTimeScatter?n.rtXOffsetCss??0:0,m=i.x1+s.left+u,f=i.y2-s.bottom;let g=te.calculateX(t.x,r.graphMin,r.graphMax,d,m);const p=te.calculateY(a&&t.y>c.graphMax?c.graphMax:t.y,c.graphMin,c.graphMax,h,f);g!==null&&!this.realTimeScatter&&(g+=A.aliasPixel(g)),t.xp=g,t.yp=p}defaultScatterDraw(t){const{ctx:n,axesSteps:i,duple:s,legendHitInfo:l,coordinateDedupe:a}=t,r=i.y[this.yAxisIndex],c=new Set,d=a!==!1,h=d&&!l,u=h?new Map:null;for(let m=0;m<this.data.length;m++){const f=this.data[m],g=m,p=A.coordinateKey(f.x,f.y);let y;if(l?y=l.sId===this.sId:d?y=s.get(p)===this.sId&&!c.has(p):y=!0,y&&f.xp!==null&&f.yp!==null){const b=f.y>r.graphMax&&this.overflowColor||f.dataColor||this.color,k=this.getOpacity(t,b,g),L=this.getCachedColor(b,k),w=f.dataColor||this.pointFill,M=this.getOpacity(t,w,g),V=this.getCachedColor(w,M);if(h){const S=`${L} ${V}`;let x=u.get(S);x||(x={strokeStyle:L,fillStyle:V,points:[]},u.set(S,x)),x.points.push(f),c.add(p)}else n.strokeStyle=L,n.fillStyle=V,te.drawPoint(n,this.pointStyle,this.pointSize,f.xp,f.yp)}}h&&u.forEach(m=>{n.strokeStyle=m.strokeStyle,n.fillStyle=m.fillStyle,te.drawPointBatch(n,this.pointStyle,this.pointSize,m.points)})}realTimeScatterDraw(t){var g,p,y,C,b,k;const{ctx:n,axesSteps:i,duple:s,legendHitInfo:l,coordinateDedupe:a}=t,r=i.y[this.yAxisIndex],c=typeof this.pointStyle=="string"?this.pointStyle:this.pointStyle.value,d=typeof this.pointSize=="number"?this.pointSize:this.pointSize.value;let h=0;const u=a!==!1,m=u&&!l,f=m?new Map:null;for(let L=0;L<((p=(g=this.data[this.sId])==null?void 0:g.dataGroup)==null?void 0:p.length);L++)for(let w=0;w<((C=(y=this.data[this.sId])==null?void 0:y.dataGroup[L])==null?void 0:C.data.length);w++){const M=(k=(b=this.data[this.sId])==null?void 0:b.dataGroup[L])==null?void 0:k.data[w];h++;let V;if(l?V=l.sId===this.sId:u?V=s.get(M.k??A.coordinateKey(M.x,M.y))===this.sId:V=!0,V&&M.xp!==null&&M.yp!==null){const S=M.y>r.graphMax&&this.overflowColor,x=S||M.color||this.color,I=S||M.color||this.pointFill||this.color,T=this.getOpacity(t,x,w),v=this.getOpacity(t,I,w),E=this.getCachedColor(x,T),Z=this.getCachedColor(I,v);if(m){const W=`${E} ${Z}`;let R=f.get(W);R||(R={strokeStyle:E,fillStyle:Z,points:[]},f.set(W,R)),R.points.push(M)}else n.strokeStyle=E,n.fillStyle=Z,te.drawPoint(n,c,d,M.xp,M.yp);t.markDrawn&&(M.drawn=!0)}}m&&f.forEach(L=>{n.strokeStyle=L.strokeStyle,n.fillStyle=L.fillStyle,te.drawPointBatch(n,c,d,L.points)}),this._rtTotalCount=h}realTimeScatterDrawStrip(t,n,i){var u;if(!this.show)return;const s=(u=this.data[this.sId])==null?void 0:u.dataGroup;if(!s)return;const{duple:l,coordinateDedupe:a}=i,r=a!==!1&&!!l,c=i.axesSteps.y[this.yAxisIndex],d=typeof this.pointStyle=="string"?this.pointStyle:this.pointStyle.value,h=typeof this.pointSize=="number"?this.pointSize:this.pointSize.value;for(let m=0;m<n.length;m++){const f=s[n[m]];if(f!=null&&f.data)for(let g=0;g<f.data.length;g++){const p=f.data[g];if(!p.drawn&&!(r&&l.get(p.k??A.coordinateKey(p.x,p.y))!==this.sId)&&(this.calcItem(p,i),p.xp!==null&&p.yp!==null)){const y=p.y>c.graphMax&&this.overflowColor,C=y||p.color||this.color,b=y||p.color||this.pointFill||this.color,k=this.getOpacity(i,C,g),L=this.getOpacity(i,b,g);t.strokeStyle=this.getCachedColor(C,k),t.fillStyle=this.getCachedColor(b,L),te.drawPoint(t,d,h,p.xp,p.yp),p.drawn=!0}}}}refreshRtHitCoords(t){var i,s;const n=(i=this.data[this.sId])==null?void 0:i.dataGroup;if(n)for(let l=0;l<n.length;l++){const a=(s=n[l])==null?void 0:s.data;if(a)for(let r=0;r<a.length;r++)this.calcItem(a[r],t)}}refreshRtTotalCount(){var i,s,l;let t=0;const n=(i=this.data[this.sId])==null?void 0:i.dataGroup;if(n)for(let a=0;a<n.length;a++)t+=((l=(s=n[a])==null?void 0:s.data)==null?void 0:l.length)??0;return this._rtTotalCount=t,t}findItemsInRange(t,n,i,s,l){return t.filter(a=>n-1<=a.xp&&a.xp<=s+1&&i-1<=a.yp&&a.yp<=l+1)}defaultScatterFindItems(t,n,i,s,l){return this.findItemsInRange(t,n,i,s,l)}realTimeScatterFindItems(t,n,i,s,l){const a=[];for(let r=0;r<t[this.sId].dataGroup.length;r++){const c=t[this.sId].dataGroup[r];a.push(...this.findItemsInRange(c.data,n,i,s,l))}return a}findItems({xsp:t,ysp:n,width:i,height:s}){const l=this.data,a=t+i,r=n+s;let c=[];return this.realTimeScatter?c=this.realTimeScatterFindItems(l,t,n,a,r):c=this.defaultScatterFindItems(l,t,n,a,r),c}itemHighlight(t,n){const i=t.data,s=n,l=i.xp,a=i.yp;if(s.save(),l!==null&&a!==null){const r=i.dataColor||this.color,c=i.dataColor||this.pointFill;s.strokeStyle=this.getCachedColor(r,0),s.fillStyle=this.getCachedColor(c,this.highlight.maxShadowOpacity),te.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=r,te.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",te.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)}s.restore()}findGraphData(t){var c;const n=t[0],i=t[1],s={data:null,hit:!1,color:this.color,index:null},l=this.pointSize;if(this.realTimeScatter){const d=(c=this.data[this.sId])==null?void 0:c.dataGroup;if(!d)return s;let u=this._rtTotalCount-1;for(let m=d.length-1;m>=0;m--){const f=d[m];if(f!=null&&f.data)for(let g=f.data.length-1;g>=0;g--){const p=f.data[g];if(p.xp!==null&&p.yp!==null){const y=p.xp,C=p.yp;if(y-l<=n&&n<=y+l&&C-l<=i&&i<=C+l)return s.data=p,s.index=u,s.hit=!0,s}u--}}return s}const a=this.data,r=a.findIndex(d=>{const h=d.xp,u=d.yp;return h-l<=n&&n<=h+l&&u-l<=i&&i<=u+l});return r>-1&&(s.data=a[r],s.index=r,s.hit=!0),s}}class kc{constructor(t,n,i,s){const l=Pe({},n,n1);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=Kt[i%Kt.length]),this.type="bar",this.sId=t,this.data=[],this.isHorizontal=s,this.size={cat:0,bar:0,cPad:0,bPad:0,w:0,h:0,ix:0}}computeGeometry(t){if(!this.show)return;const n=t.scaleVersion!=null&&t.dataEpoch!=null,i=t.showIndex??0,s=t.showSeriesCount??0;if(n&&this._lastDataEpoch===t.dataEpoch&&this._lastScaleVersion===t.scaleVersion&&this._lastShowIndex===i&&this._lastShowSeriesCount===s&&this._lastGeomData===this.data)return;const l=t.chartRect,a=t.labelOffset,r=t.axesSteps,c=t.showIndex,d=t.thickness,h=t.showSeriesCount;this.isHorizontal=t.isHorizontal;const{isHorizontal:u}=this;let m,f;const g=r.x[this.xAxisIndex],p=r.y[this.yAxisIndex];let y=this.data.length;const[C,b]=u?[p.minIndex,p.maxIndex]:[g.minIndex,g.maxIndex];Re(C)&&Re(b)&&(y=b-C+1);const k=l.chartWidth-(a.left+a.right),L=l.chartHeight-(a.top+a.bottom),w=l.x1+a.left,M=l.y2-a.bottom,V=te.calculateX(0,g.graphMin,g.graphMax,k),S=te.calculateY(0,p.graphMin,p.graphMax,L),x=u?w+V:w,I=u?M:M+S,T=u?L:k,v=T/(y||1);let E;t.cPadRatio>=1||t.cPadRatio<=0?E=2:E=Math.max(T*(t.cPadRatio/2)/y,2);let W,R,X;W=v>E*2?v-E*2:v,W=this.isExistGrp?W:W/h;const G=this.calculateBarSize(d,W);R=u?null:G,X=u?G:null;const N=u?(W-X)/2:(W-R)/2,P=this.isExistGrp?1:c+1;this.size.cat=v,this.size.bar=W,this.size.cPad=E,this.size.bPad=N,this.size.w=R,this.size.h=X,this.size.ix=P,this.chartRect=l,this.labelOffset=a,this.borderRadius=t.borderRadius,this.filteredCount=y;const B=Re(C)?C:0,H=Re(b)?b:this.data.length-1;this.visibleStartIndex=B;for(let D=B;D<=H;D++){const Y=D-B,F=this.data[D];if(F){const O=u?I-v*Y-E:x+v*Y+E;if(u?(m=x,f=Math.round(O-(W*P-(X+N)))):(m=Math.round(O+(W*P-(R+N))),f=I),u){const z=F.b?F.o:F.x,j=t.displayOverflow&&z>g.graphMax?g.graphMax:z;R=te.calculateX(j,g.graphMin,g.graphMax,k,-V),F.b&&(m=te.calculateX(F.b,g.graphMin,g.graphMax,k,x-V));const U=z>0?-1:1;R=z&&R!==null&&Math.abs(R)===0?U:R}else{const z=F.b?F.o:F.y,j=t.displayOverflow&&z>p.graphMax?p.graphMax:z;X=te.calculateY(j,p.graphMin,p.graphMax,L,-S),F.b&&(f=te.calculateY(F.b,p.graphMin,p.graphMax,L,I-S));const U=z>0?-1:1;X=z&&X!==null&&Math.abs(X)===0?U:X}F.xp=m,F.yp=f,F.w=R,F.h=u?-X:X,F.index=D}}n&&(this._lastDataEpoch=t.dataEpoch,this._lastScaleVersion=t.scaleVersion,this._lastShowIndex=i,this._lastShowSeriesCount=s,this._lastGeomData=this.data)}draw(t){var Y,F,O,z,j;if(!this.show)return;this.computeGeometry(t);const n=t.ctx,i=t.chartRect,s=t.labelOffset,l=t.axesSteps,a=t.showIndex,r=t.thickness,c=t.showSeriesCount,d=t.displayOverflow;this.isHorizontal=t.isHorizontal;const{isHorizontal:h,showValue:u}=this;let m,f;const g=l.x[this.xAxisIndex],p=l.y[this.yAxisIndex],[y,C]=h?[p.minIndex,p.maxIndex]:[g.minIndex,g.maxIndex],b=Re(y)&&Re(C),k=b?y:0,L=b?C:this.data.length-1,w=L-k+1,M=i.chartWidth-(s.left+s.right),V=i.chartHeight-(s.top+s.bottom),S=i.x1+s.left,x=i.y2-s.bottom,I=te.calculateX(0,g.graphMin,g.graphMax,M),T=te.calculateY(0,p.graphMin,p.graphMax,V),v=h?S+I:S,E=h?x:x+T,Z=h?V:M,W=Z/(w||1);let R;t.cPadRatio>=1||t.cPadRatio<=0?R=2:R=Math.max(Z*(t.cPadRatio/2)/w,2);let G,N,P;G=W>R*2?W-R*2:W,G=this.isExistGrp?G:G/c;const B=this.calculateBarSize(r,G);N=h?null:B,P=h?B:null;const H=h?(G-P)/2:(G-N)/2,D=this.isExistGrp?1:a+1;this.size.cat=W,this.size.bar=G,this.size.cPad=R,this.size.bPad=H,this.size.w=N,this.size.h=P,this.size.ix=D,this.chartRect=i,this.labelOffset=s,this.borderRadius=t.borderRadius,this.filteredCount=w,this.visibleStartIndex=k;for(let U=k;U<=L;U++){const Q=U-k,J=this.data[U];if(J){const ne=h?E-W*Q-R:v+W*Q+R;if(h?(m=v,f=Math.round(ne-(G*D-(P+H)))):(m=Math.round(ne+(G*D-(N+H))),f=E),h){const oe=J.b?J.o:J.x,re=d&&oe>g.graphMax?g.graphMax:oe;N=te.calculateX(re,g.graphMin,g.graphMax,M,-I),J.b&&(m=te.calculateX(J.b,g.graphMin,g.graphMax,M,v-I));const pe=oe>0?-1:1;N=oe&&N!==null&&Math.abs(N)===0?pe:N}else{const oe=J.b?J.o:J.y,re=d&&oe>p.graphMax?p.graphMax:oe;P=te.calculateY(re,p.graphMin,p.graphMax,V,-T),J.b&&(f=te.calculateY(J.b,p.graphMin,p.graphMax,V,E-T));const pe=oe>0?-1:1;P=oe&&P!==null&&Math.abs(P)===0?pe:P}const q=J.dataColor||this.color,ee=t==null?void 0:t.legendHitInfo,$=(Y=t==null?void 0:t.selectLabel)==null?void 0:Y.option,he=(F=t==null?void 0:t.selectItem)==null?void 0:F.option,fe=((z=(O=t==null?void 0:t.selectLabel)==null?void 0:O.selected)==null?void 0:z.dataIndex)??[],{dataIndex:ae,seriesID:Se}=((j=t==null?void 0:t.selectItem)==null?void 0:j.selected)??{};let ye=!1;if(ee?ye=(ee==null?void 0:ee.sId)!==this.sId:$!=null&&$.use&&($!=null&&$.useSeriesOpacity)?ye=fe.length&&!fe.includes(U):kt(ae)&&(he!=null&&he.useSeriesOpacity)&&(this.isExistGrp?ye=ae!==U:ye=ae!==U||Se!==this.sId),typeof q!="string")n.fillStyle=te.createGradient(n,h,{x:m,y:f,w:N,h:P},q,ye,t.unSelectedOpacity);else{const oe=q.includes("rgba")?A.getOpacity(q):1,re=ye?t.unSelectedOpacity:oe;n.fillStyle=A.colorStringToRgba(q,re)}this.drawBar({ctx:n,positions:{x:m,y:f,w:N,h:P}}),u.use&&this.drawValueLabels({context:n,data:J,positions:{x:m,y:f,h:P,w:N},isHighlight:!1,textColor:J.dataTextColor,index:U})}}}itemHighlight(t,n,i,s){const l=this.showValue,a=t.data,r=n,c=a.xp,d=a.yp,h=a.w,u=a.h;r.save(),r.shadowOffsetX=0,r.shadowOffsetY=0,r.shadowBlur=4;const m=t.data.dataColor||this.color;if(typeof m!="string"){const f=te.createGradient(r,this.isHorizontal,{x:c,y:d,w:h,h:u},m,!1,s);r.fillStyle=f,r.shadowColor=m[m.length-1][1]}else r.fillStyle=m,r.shadowColor=m;r.beginPath(),this.drawBar({ctx:r,positions:{x:c,y:d,w:h,h:this.isHorizontal?-u:u}}),l.use&&this.drawValueLabels({context:r,data:a,positions:{x:c,y:d,h:u,w:h},isHighlight:!0,textColor:t.data.dataTextColor||t.dataTextColor,index:i}),r.restore()}findGraphData(t,n,i,s){if(typeof i=="number"&&this.show&&s){const l=this.data,a={data:null,hit:!1,color:this.color},r=this.visibleStartIndex??0,c=r+(this.filteredCount??l.length)-1,d=Math.max(r,Math.min(i,c));return l[d]&&(a.data=l[d],a.index=d,a.hit=this.isPointInBar(t,l[d]),a.directHit=a.hit),a}return n?this.findGraphRangeCount(t):this.findGraphRange(t)}binarySearchBar(t,n){const[i,s]=t,l={data:null,hit:!1,color:this.color},a=this.data,r=this.visibleStartIndex??0,c=this.filteredCount??a.length;let d=r,h=Math.min(r+c-1,a.length-1);for(;d<=h;){const u=Math.floor((d+h)/2),m=a[u];if(!m){console.warn(`[EVUI][Bar] binarySearchBar: gdata[${u}] is falsy`);break}const{xp:f,yp:g,w:p,h:y}=m,C=f+p,b=g+y;if(n?b<=s&&s<=g:f<=i&&i<=C)return l.data=m,l.index=m.index,l.hit=this.isPointInBar(t,m),l.directHit=l.hit,l;(n?!(b<s):f+4<i)?d=u+1:h=u-1}return l}findGraphRange(t){return this.binarySearchBar(t,!1)}findGraphRangeCount(t){return this.binarySearchBar(t,!0)}drawValueLabels({context:t,data:n,positions:i,isHighlight:s,textColor:l,index:a}){const r=this.isHorizontal,{fontSize:c,textColor:d,align:h,formatter:u,decimalPoint:m}=this.showValue,{x:f,y:g,w:p,h:y}=i,C=t;C.save(),C.beginPath(),C.font=`normal normal normal ${c}px Roboto`,C.fillStyle=l||d,C.lineWidth=1,C.textBaseline="middle",C.textAlign=r&&h!=="center"?"left":"center";let b;const k=kt(this.stackIndex);k?b=n.o:b=(r?n.x:n.y)??"";let L;u&&(L=u(b,{label:r?n.y:n.x,index:a})),(!u||typeof L!="string")&&(L=A.labelSignFormat(b,m)??"");const w=b<0,M=Math.round(C.measureText(L).width),V=c,S=r&&h!=="end"?10:4,x=w?f-S:f+S,I=w?g+S:g-S,T=f+p/2,v=s?g+y/2:g-y/2,E=r?v+c*.1:v,Z=Math.abs(p),W=Math.abs(y),R=Z-S,X=W-S,G=M<=Z&&Z>=V;switch(h){case"start":{if(r){if(M<R&&V<W){const N=w?x-M:x;C.fillText(L,N,E)}}else if(G&&V+S<=W){const N=w?g+V/2+S:g-V/2-S;C.fillText(L,T,N)}break}case"center":{r?M<R&&V<W&&C.fillText(L,T,E):G&&V<X&&C.fillText(L,T,g+y/2);break}case"out":{if(k){console.warn("[EVUI][Bar Chart] In case of Stack Bar Chart, 'out' of 'showValue''s align is not supported.");return}if(r){const N=this.chartRect.x1+this.labelOffset.left,P=this.chartRect.x2-this.labelOffset.right;if(V<this.size.bar)if(w){const B=f-S+p-M;B>N&&C.fillText(L,B,E)}else{const B=f+S+p;B+M<P&&C.fillText(L,B,E)}}else{const N=this.chartRect.y1+this.labelOffset.top,P=this.chartRect.y2-this.labelOffset.bottom;if(M<=this.size.bar)if(w){const B=g+y+S+V/2;B+V/2<=P&&C.fillText(L,T,B)}else{const B=g+y-S-V/2;B-V/2>=N&&C.fillText(L,T,B)}}break}default:case"end":{if(r){if(M<R&&V<W){const N=w?f+p+S:f+p-M-S;C.fillText(L,N,E)}}else if(w){const N=g+y-V/2-S;N>I&&G&&V+S<=W&&C.fillText(L,T,N)}else G&&V+S<=W&&C.fillText(L,T,g+y+V/2+S);break}}C.restore()}calculateBarSize(t,n){return typeof t=="string"&&/[0-9]+px/.test(t)?Math.min(n,Number(t.replace("px",""))):typeof t=="number"&&t<=1&&t>=0?Math.ceil(n*t):n}drawBar({ctx:t,positions:n}){const{isHorizontal:i,borderRadius:s}=this,l="stackIndex"in this,a=s&&s>0,{x:r,y:c,w:d}=n,h=i?-n.h:n.h;if(!(d===0||h===0)){if(t.save(),a&&!l)try{this.drawRoundedRect(t,n)}catch{t.fillRect(r,c,d,h)}else t.fillRect(r,c,d,h);t.restore()}}isPointInBar(t,n){const[i,s]=t,{xp:l,yp:a,w:r,h:c}=n,d=l+r,h=a+c;return l<=i&&i<=d&&h<=s&&s<=a}drawRoundedRect(t,n){const{chartRect:i,labelOffset:s,isHorizontal:l,borderRadius:a}=this,{x:r,y:c}=n;let{w:d,h}=n,u=a;const m=new Path2D;m.rect(i.x1+s.left,i.y1,i.chartWidth-s.right,i.chartHeight-s.bottom),t.clip(m),t.beginPath(),t.moveTo(r,c),Math.abs(d)<u*2&&(u=Math.abs(d)/2),Math.abs(h)<u*2&&(u=Math.abs(h)/2),l?d<0?(d+=u,t.lineTo(r+d,c),t.arcTo(r+d-u,c,r+d-u,c-u,u),t.arcTo(r+d-u,c-h,r+d,c-h,u),t.lineTo(r,c-h),t.lineTo(r,c)):(d-=u,t.lineTo(r+d,c),t.arcTo(r+d+u,c,r+d+u,c-u,u),t.arcTo(r+d+u,c-h,r+d,c-h,u),t.lineTo(r,c-h),t.lineTo(r,c)):h>0?(h-=u,t.lineTo(r+d,c),t.lineTo(r+d,c+h),t.arcTo(r+d,c+h+u,r-d+u,c+h+u,u),t.arcTo(r,c+h+u,r,c+h,u),t.lineTo(r,c)):(h+=u,t.lineTo(r+d,c),t.lineTo(r+d,c+h),t.arcTo(r+d,c+h-u,r+d-u,c+h-u,u),t.arcTo(r,c+h-u,r,c+h,u),t.lineTo(r,c)),t.fill(),t.closePath()}findItems({xsp:t,width:n}){if(!this.show||this.isHorizontal)return[];const i=t+n,s=this.visibleStartIndex??0,l=this.filteredCount??this.data.length,a=Math.min(s+l-1,this.data.length-1);return this.data.slice(s,a+1).filter(({xp:r,w:c})=>r!=null&&r<=i&&r+c>=t)}}class c1 extends kc{computeGeometry(t){if(!this.show)return;const n=t.chartRect,i=t.labelOffset,s=t.axesSteps,l=t.showIndex,a=t.isHorizontal,r=t.thickness,c=t.showSeriesCount;let d,h;const u=s.x[this.xAxisIndex],m=s.y[this.yAxisIndex],f=n.chartWidth-(i.left+i.right),g=n.chartHeight-(i.top+i.bottom),p=n.x1+i.left,y=n.y2-i.bottom,C=n.x2-i.right,k=(a?g:f)/(this.data.length||1),L=2;let w;this.isExistGrp?w=k-L*2:w=(k-L*2)/c;const V=typeof r=="string"&&/[0-9]+px/.test(r)?Math.min(w,Number(r.replace("px",""))):typeof r=="number"&&r<=1&&r>=0?Math.ceil(w*r):w;let S=a?null:V,x=a?null:V,I=a?V:null;const T=a?(w-I)/2:(w-S)/2,v=this.isExistGrp?1:l+1;this.size.cat=k,this.size.bar=w,this.size.cPad=L,this.size.bPad=T,this.size.w=S,this.size.ix=v,this.chartRect=n,this.labelOffset=i,this.borderRadius=t.borderRadius,this.data.forEach(E=>{a?(d=p,h=te.calculateY(E.y,m.graphMin,m.graphMax,g,y)):(d=te.calculateSubX(E.x,u.graphMin,u.graphMax,f,p),d<p?(x-=p-d,d=d+S<p?null:p):d+S>C&&(x-=x-(C-d)),d>=C&&(d=null),d!==null&&(d+=Math.ceil(w*v)-Math.round(S+T)),h=y),a?E.b?(S=te.calculateX(E.x-E.b,u.graphMin,u.graphMax,f),d=te.calculateX(E.b,u.graphMin,u.graphMax,f,p)):S=te.calculateX(E.x,u.graphMin,u.graphMax,f):E.b?(I=te.calculateY(E.y-E.b,m.graphMin,m.graphMax,g),h=te.calculateY(E.b,m.graphMin,m.graphMax,g,y)):I=te.calculateY(E.y,m.graphMin,m.graphMax,g),d!==null&&h!==null&&typeof(E.dataColor||this.color)!="string"&&(S=S!==x?x:S),x=S,E.xp=d,E.yp=h,E.w=S,E.h=a?-I:I})}draw(t){if(!this.show)return;this.computeGeometry(t);const n=t.ctx,i=t.chartRect,s=t.labelOffset,l=t.axesSteps,a=t.showIndex,r=t.isHorizontal,c=t.thickness,d=t.showSeriesCount;let h,u;const m=l.x[this.xAxisIndex],f=l.y[this.yAxisIndex],g=i.chartWidth-(s.left+s.right),p=i.chartHeight-(s.top+s.bottom),y=i.x1+s.left,C=i.y2-s.bottom,b=i.x2-s.right,L=(r?p:g)/(this.data.length||1),w=2;let M;this.isExistGrp?M=L-w*2:M=(L-w*2)/d;const S=typeof c=="string"&&/[0-9]+px/.test(c)?Math.min(M,Number(c.replace("px",""))):typeof c=="number"&&c<=1&&c>=0?Math.ceil(M*c):M;let x=r?null:S,I=r?null:S,T=r?S:null;const v=r?(M-T)/2:(M-x)/2,E=this.isExistGrp?1:a+1;this.size.cat=L,this.size.bar=M,this.size.cPad=w,this.size.bPad=v,this.size.w=x,this.size.ix=E,this.chartRect=i,this.labelOffset=s,this.borderRadius=t.borderRadius,this.data.forEach((Z,W)=>{if(n.beginPath(),r?(h=y,u=te.calculateY(Z.y,f.graphMin,f.graphMax,p,C)):(h=te.calculateSubX(Z.x,m.graphMin,m.graphMax,g,y),h<y?(I-=y-h,h=h+x<y?null:y):h+x>b&&(I-=I-(b-h)),h>=b&&(h=null),h!==null&&(h+=Math.ceil(M*E)-Math.round(x+v)),u=C),r?Z.b?(x=te.calculateX(Z.x-Z.b,m.graphMin,m.graphMax,g),h=te.calculateX(Z.b,m.graphMin,m.graphMax,g,y)):x=te.calculateX(Z.x,m.graphMin,m.graphMax,g):Z.b?(T=te.calculateY(Z.y-Z.b,f.graphMin,f.graphMax,p),u=te.calculateY(Z.b,f.graphMin,f.graphMax,p,C)):T=te.calculateY(Z.y,f.graphMin,f.graphMax,p),h!==null&&u!==null){const R=Z.dataColor||this.color,X=R.includes("rgba")?A.getOpacity(R):1,G=this.state==="downplay"?t.unSelectedOpacity:X;typeof R!="string"?(x=x!==I?I:x,n.fillStyle=te.createGradient(n,r,{x:h,y:u,w:x,h:T},R,this.state==="downplay",t.unSelectedOpacity)):n.fillStyle=A.colorStringToRgba(R,G),this.drawBar({ctx:n,positions:{x:h,y:u,w:x,h:T}}),this.showValue.use&&this.drawValueLabels({context:n,data:Z,positions:{x:h,y:u,h:T,w:x},isHighlight:!1,index:W})}I=x})}}class d1{constructor(t,n,i){const s=Fo({},i1,n);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=Kt[i%Kt.length]),this.sId=t,this.show=!0,this.data=[],this.type="pie",this.centerX=0,this.centerY=0,this.radius=0,this.doughnutHoleSize=0,this.startAngle=0,this.endAngle=0,this.ctx=null,this.isSelect=!1}draw(t,n,i){var h;const s=t??this.ctx,l=new Path2D,a=this.isSelect?this.radius+5:this.radius,r=this.color,c=r.includes("rgba")?A.getOpacity(r):1,d=this.isDownplay?i:c;s.beginPath(),l.moveTo(this.centerX,this.centerY),l.arc(this.centerX,this.centerY,a,this.startAngle,this.endAngle),l.lineTo(this.centerX,this.centerY),s.fillStyle=A.colorStringToRgba(r,d),s.fill(l),n.use&&(s.lineCap="round",s.lineWidth=n==null?void 0:n.lineWidth,s.strokeStyle=n==null?void 0:n.color,s.stroke(l)),(h=this.showValue)!=null&&h.use&&this.drawValueLabels(s),s.closePath(),this.ctx=s}findGraphData([t,n]){const i={data:null,hit:!1,color:null,index:-1},{radius:s,startAngle:l,endAngle:a,centerX:r,centerY:c}=this,d=Math.sqrt((t-r)**2+(n-c)**2),h=2.5*Math.PI-Math.atan2(t-r,n-c),u=s>d&&h>=l&&h<=a;return this.show&&u&&(i.type=this.type,i.data=this.data,i.hit=!0,i.color=this.color,i.index=0),i}itemHighlight(t,n){var a,r;const i=n,s=this.isSelect?this.radius+5:this.radius;i.save(),i.shadowOffsetX=0,i.shadowOffsetY=0,i.shadowBlur=4;const l=((a=t==null?void 0:t.data)==null?void 0:a.dataColor)||this.color;i.fillStyle=l,i.shadowColor=l,i.beginPath(),i.moveTo(this.centerX,this.centerY),i.arc(this.centerX,this.centerY,s,this.startAngle,this.endAngle),i.lineTo(this.centerX,this.centerY),i.fill(),(r=this.showValue)!=null&&r.use&&this.drawValueLabels(i),i.closePath(),i.restore()}drawValueLabels(t){const n=t,i=this.data.o,{fontSize:s,textColor:l,formatter:a}=this.showValue;let r;a&&(r=a({value:i,percentage:this.data.percentage})),(!a||typeof r!="string")&&(r=A.labelSignFormat(i));const c=1.8,d=this.radius-this.doughnutHoleSize,h=(this.endAngle-this.startAngle)*180/Math.PI,u=s+4,m=Math.round(n.measureText(r).width);if(h>=m*c&&h>=u*c&&d>=m*c&&d>=u*c){n.save(),n.beginPath();const f=l.includes("rgba")?A.getOpacity(l):1,g=this.state==="downplay"?this.unSelectedOpacity:f;n.font=`normal normal normal ${s}px Roboto`,n.fillStyle=A.colorStringToRgba(l,g),n.lineWidth=1,n.textAlign="center",n.textBaseline="middle";const p=d/2+this.doughnutHoleSize,y=(this.endAngle-this.startAngle)/2+this.startAngle,C=p*Math.cos(y)+this.centerX,b=p*Math.sin(y)+this.centerY;n.fillText(r,C,b),n.restore()}}}class h1{constructor(t,n,i,s,l){const a=Fo({},s1,n);Object.keys(a).forEach(r=>{this[r]=a[r]}),this.isHorizontal=s,this.isGradient=l,this.createColorState(i),this.sId=t,this.data=[],this.labels={x:[],y:[]},this.valueOpt={},this.size={w:0,h:0},this.type="heatMap",this.currentLabelInfo={x:{steps:0,min:0,max:0},y:{steps:0,min:0,max:0}}}createColorState(t){const n=[],i=/[^0-9]&[^,]/g,{min:s,max:l,rangeCount:a,colorsByRange:r,error:c,stroke:d}=t,h=s.includes("#")?A.hexToRgb(s):s.replace(i,""),u=l.includes("#")?A.hexToRgb(l):l.replace(i,""),[m,f,g]=h.split(","),[p,y,C]=u.split(",");if(this.isGradient)n.push({minColor:{minR:m,minG:f,minB:g},maxColor:{maxR:p,maxG:y,maxB:C},rangeCount:a,start:0,end:100,selectedValue:null});else if(r.length)r.forEach(({color:b,label:k},L)=>{n.push({id:`color#${L}`,color:b,label:k,state:"normal",show:!0})});else{const b=Math.floor((m-p)/(a-1)),k=Math.floor((f-y)/(a-1)),L=Math.floor((g-C)/(a-1));for(let w=0;w<a;w++){const M=+m-b*w,V=+f-k*w,S=+g-L*w;n.push({id:`color#${w}`,color:`rgb(${M},${V},${S})`,state:"normal",show:!0})}}this.colorState=n,this.errorColor=c,this.stroke=d}getColorForGradient(t){const{minColor:n,maxColor:i}=this.colorState[0],{minR:s,minG:l,minB:a}=n,{maxR:r,maxG:c,maxB:d}=i,h=+s-Math.floor((s-r)*t/100),u=+l-Math.floor((l-c)*t/100),m=+a-Math.floor((a-d)*t/100);return`rgb(${h},${u},${m})`}getColorIndexByValue(t){const{existError:n,min:i,interval:s,decimalPoint:l}=this.valueOpt,a=this.colorState.length-1;if(n&&t<0)return a;const r=Math.floor(+(t-i).toFixed(l)/s);return r>=a?n?a-1:a:r}getItemInfo(t){const{min:n,max:i}=this.valueOpt,s={show:!1,opacity:1,dataColor:null,id:null,isHighlight:null};if(this.isGradient){const l=qe(t-n,i-n),{start:a,end:r,selectedValue:c}=this.colorState[0];(t<0||a<=l&&l<=r)&&(s.show=!0,s.isHighlight=c!==null&&Math.floor(t)===Math.floor(n+(i-n)*(c/100)),s.dataColor=t<0?this.errorColor:this.getColorForGradient(l))}else{const l=this.getColorIndexByValue(t),{show:a,state:r,color:c,id:d}=this.colorState[l];s.show=a,s.opacity=r==="downplay"?.1:1,s.dataColor=t<0?this.errorColor:c,s.id=d}return s}drawItem(t,n,i,s,l,a){if(t.beginPath(),!(s<0||l<0)){if(a.show){const{radius:r}=a;if(r>0){const c=Math.min(s,l);let d=r;d>c/2&&(d=Math.floor(c/2)),t.moveTo(n+d,i),t.arcTo(n+s,i,n+s,i+l,d),t.arcTo(n+s,i+l,n,i+l,d),t.arcTo(n,i+l,n,i,d),t.arcTo(n,i,n+s,i,d),t.stroke(),t.fill()}else t.strokeRect(n,i,s,l),t.fillRect(n,i,s,l)}else{const r=A.aliasPixel(1);t.fillRect(n,i-r,s+r,l+r)}t.closePath()}}calculateXY(t,n,i,s){let l=null;if(this.labels[t]&&this.labels[t].length){let a=this.labels[t].findIndex(m=>m===n);a===-1&&(a=this.labels[t].findIndex(m=>+m==+n));const{minIndex:r,maxIndex:c,graphMin:d,graphMax:h}=s;if(Re(c)&&a>c||Re(r)&&a<r||yo(r)&&yo(c)&&(n<d||n>h))return null;const u=r??this.labels[t].findIndex(m=>+m==+d);a>-1&&(a-=u>-1?u:0,l=t==="x"?i+this.size.w*a:i-this.size.h*(a+1))}return l}computeGeometry(t){if(!this.show)return;const{chartRect:n,labelOffset:i,selectItem:s,axesSteps:l}=t,a=n.chartWidth-(i.left+i.right),r=n.chartHeight-(i.top+i.bottom),c=n.x1+i.left,d=n.y2-i.bottom,h=l.x[this.xAxisIndex],u=l.y[this.yAxisIndex];this.size.w=a/h.oriSteps,this.size.h=r/u.oriSteps,this.currentLabelInfo={x:{steps:h.oriSteps,min:h.graphMin,max:h.graphMax},y:{steps:u.oriSteps,min:u.graphMin,max:u.graphMax}},this.data.forEach((m,f)=>{var L;let p=this.calculateXY("x",m.x,c,h),y=this.calculateXY("y",m.y,d,u),C=this.size.w,b=this.size.h;const k=m.o;if(p!==null&&y!==null&&k!==null&&k!==void 0){const{show:w,dataColor:M,id:V}=this.getItemInfo(k);if(m.dataColor||(m.dataColor=M),m.cId=V,w){let S=this.stroke;const x=s==null?void 0:s.option,I=(x==null?void 0:x.use)&&(x==null?void 0:x.showBorder),T=f===((L=s==null?void 0:s.selected)==null?void 0:L.dataIndex);if(I&&T&&(S={show:x==null?void 0:x.showBorder,...x==null?void 0:x.borderStyle}),S.show&&S.lineWidth>0){const{lineWidth:v}=S,E=v*2;E<Math.floor(C)&&E<Math.floor(b)&&(p+=v,y+=v,C-=E,b-=E)}p+=1,m.xp=p,m.yp=y,m.w=C,m.h=b}}})}draw(t){if(!this.show)return;this.computeGeometry(t);const{ctx:n,chartRect:i,labelOffset:s,selectLabel:l,legendHitInfo:a,selectItem:r,axesSteps:c}=t,d=i.chartWidth-(s.left+s.right),h=i.chartHeight-(s.top+s.bottom),u=i.x1+s.left,m=i.y2-s.bottom,f=c.x[this.xAxisIndex],g=c.y[this.yAxisIndex];this.size.w=d/f.oriSteps,this.size.h=h/g.oriSteps,this.currentLabelInfo={x:{steps:f.oriSteps,min:f.graphMin,max:f.graphMax},y:{steps:g.oriSteps,min:g.graphMin,max:g.graphMax}};const p=(y,C,b)=>{var k,L;if(!a){let w;const{option:M,selected:V}=r,{option:S,selected:x}=l,I=kt(V==null?void 0:V.dataIndex)&&(V==null?void 0:V.dataIndex)>-1,T=((k=x==null?void 0:x.label)==null?void 0:k.length)>0;return I?w=M.useSeriesOpacity?b!==(V==null?void 0:V.dataIndex):!1:T&&(w=S.useSeriesOpacity?!((L=x==null?void 0:x.label)!=null&&L.includes(this.getItemLabel(l,y))):!1),w?.1:C}return C};this.data.forEach((y,C)=>{var S;let k=this.calculateXY("x",y.x,u,f),L=this.calculateXY("y",y.y,m,g),w=this.size.w,M=this.size.h;const V=y.o;if(k!==null&&L!==null&&V!==null&&V!==void 0){const{show:x,opacity:I,dataColor:T,id:v}=this.getItemInfo(V);let E=I;I===1&&A.getColorStringType(y.dataColor)==="RGBA"&&(E=A.getOpacity(y.dataColor));const Z=p(y,E,C);if(y.dataColor||(y.dataColor=T),y.cId=v,n.save(),x){n.fillStyle=A.colorStringToRgba(y.dataColor,Z);let W=this.stroke;const R=r==null?void 0:r.option,X=(R==null?void 0:R.use)&&(R==null?void 0:R.showBorder),G=C===((S=r==null?void 0:r.selected)==null?void 0:S.dataIndex);X&&G&&(W={show:R==null?void 0:R.showBorder,...R==null?void 0:R.borderStyle});let N=!1;if(W.show&&W.lineWidth>0){const{color:P,lineWidth:B,opacity:H}=W,D=B*2;N=D<Math.floor(w)&&D<Math.floor(M),n.strokeStyle=N?A.colorStringToRgba(P,Z===1?H:Z):void 0,N?(n.lineWidth=B,k+=B,L+=B,w-=D,M-=D):n.lineWidth=0}k+=1,this.drawItem(n,k,L,w,M,{...W,show:N}),n.restore(),this.showValue.use&&this.drawValueLabels({context:n,data:y})}}})}drawOverlay(t){if(!this.show)return;const{overlayCtx:n,chartRect:i,labelOffset:s,axesSteps:l}=t;if(!n)return;const a=i.x1+s.left,r=i.y2-s.bottom,c=l.x[this.xAxisIndex],d=l.y[this.yAxisIndex];this.data.forEach(h=>{const u=this.calculateXY("x",h.x,a,c),m=this.calculateXY("y",h.y,r,d),f=h.o;if(u!==null&&m!==null&&f!==null&&f!==void 0){const{show:g,isHighlight:p}=this.getItemInfo(f);g&&p&&this.itemHighlight({data:h},n)}})}drawValueLabels({context:t,data:n}){const{fontSize:i,textColor:s,align:l,formatter:a,decimalPoint:r}=this.showValue,{xp:c,yp:d,w:h,h:u,o:m}=n,f=t;f.save(),f.beginPath(),f.font=`normal normal normal ${i}px Roboto`,f.fillStyle=s,f.lineWidth=1,f.textBaseline="middle",f.textAlign=l!=="center"?"left":"center";let g;a&&(g=a(m)),(!a||typeof g!="string")&&(g=A.labelSignFormat(m,r));const p=Math.round(f.measureText(g).width),y=i,C=c+h/2,b=d+u/2;if(!(p>=h||y>=u||g<0)){switch(l){case"top":{const k=C-p/2,L=b-y/2;f.fillText(g,k,L);break}case"right":{const k=c+h-p;f.fillText(g,k,b);break}case"bottom":{const k=C-p/2,L=b+y/2;f.fillText(g,k,L);break}case"left":f.fillText(g,c,b);break;default:{const k=C-p/2;f.fillText(g,k,b);break}}f.restore()}}getAdjustedBounds({xp:t,yp:n,width:i,height:s}){const a=Math.max(0,i),r=Math.max(0,s);return{xsp:Math.floor(t*100)/100,xep:Math.ceil((t+a)*100)/100,ysp:Math.floor(n*100)/100,yep:Math.ceil((n+r)*100)/100}}findItems(t){const n=this.data,{xsp:i,xep:s,ysp:l,yep:a}=this.getAdjustedBounds({xp:t.xsp,yp:t.ysp,width:t.width,height:t.height});return n.filter(({xp:r,yp:c,w:d,h})=>{const{xsp:u,xep:m,ysp:f,yep:g}=this.getAdjustedBounds({xp:r,yp:c,width:d,height:h});return u>=i&&m<=s&&f>=l&&g<=a})}itemHighlight(t,n){var p;const i=t.data,s=n,{stroke:l,shadow:a}=this.highlight,r=i.xp,c=i.yp,d=i.w,h=i.h,u=i.cId;let m;if(this.isGradient){const{min:y,max:C}=this.valueOpt,b=qe(i.o-y,C-y),{start:k,end:L}=this.colorState[0];m=k<=b&&b<=L||i.o===-1}else m=(p=this.colorState.find(({id:y})=>y===u))==null?void 0:p.show;if(r===null||c===null||!m)return;s.save();const f=A.getColorStringType(i.dataColor)==="RGBA"?t.dataColor:A.colorStringToRgba(i.dataColor,1);s.fillStyle=f,a.use&&(s.shadowOffsetX=a.offsetX,s.shadowOffsetY=a.offsetY,s.shadowBlur=a.blur,s.shadowColor=a.color);const g={color:"",lineWidth:1,opacity:1,radius:0,show:!0};if(l.use){const{color:y,width:C,radius:b}=l;g.show=!0,g.radius=b,s.lineWidth=C,g.lineWidth=C,s.strokeStyle=y||f,g.color=y||f}else g.show=!1,s.strokeStyle=f,g.color=f;this.drawItem(s,r-.5,c-.5,d+1,h+1,g),s.restore(),this.showValue.use&&this.drawValueLabels({context:s,data:i})}findGraphData(t){const n=t[0],i=t[1],s={data:null,hit:!1,color:null,dataColor:null,name:null},l=this.data,a=l.findIndex(r=>{const{xp:c,yp:d,w:h,h:u}=r;return c<=n&&n<=c+h&&d<=i&&i<=d+u});if(a>-1){const r=l[a];s.data=r,s.color=r.dataColor,s.dataColor=r.dataColor,s.index=a,s.hit=!0}return s}findBlockRange({xcp:t,xep:n,ycp:i,yep:s,range:l}){const a=this.labels,r=1,c={xsp:Math.min(t,n),ysp:Math.min(i,s),width:Math.ceil(Math.abs(n-t)),height:Math.ceil(Math.abs(s-i))};if(a.x.length&&a.y.length){const d=this.currentLabelInfo.x.steps||a.x.length,h=this.currentLabelInfo.y.steps||a.y.length,{x1:u,x2:m,y1:f,y2:g}=l,p=(m-u)/d,y=(g-f)/h,C={xsp:t,xep:n,ysp:i,yep:s},b=(k,L,w)=>{let M,V,S;k==="x"?(V=p,S=u+r):(V=y,S=f),a[k].findIndex((I,T)=>(M=S+V*T,M<=L&&L<=M+V))>-1?C[w]=["xsp","ysp"].includes(w)?M:M+V:L<S&&(C[w]=S)};b("x",Math.min(t,n),"xsp"),b("x",Math.max(t,n),"xep"),b("y",Math.min(i,s),"ysp"),b("y",Math.max(i,s),"yep"),c.xsp=Math.min(C.xsp,C.xep),c.ysp=Math.min(C.ysp,C.yep),c.width=Math.abs(C.xep-C.xsp),c.height=Math.abs(C.yep-C.ysp)}return c}getFilteredLabel(t,n,i,s){return t.length!==n?t.filter(l=>i<=l&&l<=s):t}findSelectionRange(t){const{xsp:n,ysp:i,width:s,height:l,range:a}=t;let r=null;const{x1:c,x2:d,y1:h,y2:u}=a,{x:m,y:f}=this.labels;if(m.length&&f.length){const{x:{steps:g,min:p,max:y},y:{steps:C,min:b,max:k}}=this.currentLabelInfo,L=g||m.length,w=C||f.length,M=(d-c)/L,V=(u-h)/w,S=n+s,x=i+l,I={min:Math.floor((n-c)/M),max:Math.floor((S-c-M)/M)},T=w-1,v={min:T-Math.round((x-h-V)/V),max:T-Math.round((i-h)/V)},E=this.getFilteredLabel(m,L,p,y),Z=this.getFilteredLabel(f,w,b,k);r={xMin:E[I.min],xMax:E[I.max],yMin:Z[v.min],yMax:Z[v.max]}}return r}getItemLabel(t,n){const{option:i,selected:s}=t;let l=this.isHorizontal?n.y:n.x;return i!=null&&i.useBothAxis&&(s!=null&&s.targetAxis)&&(l=(s==null?void 0:s.targetAxis)==="yAxis"?n.y:n.x),l}}const wc={Store:e1,Series:{createSeriesSet(e,t,n,i){let s=Object.keys(e);this.options.overlapping.use&&(s=this.getOverlappingSeriesKeys(e,t,i)),s.forEach((l,a)=>{const r=e[l].type||t;this.seriesList[l]=this.addSeries({type:r,id:l,opt:e[l],index:a,isHorizontal:n})})},reconcileSeriesSet(e,t,n,i,s){var d,h,u;let l=Object.keys(e);this.options.overlapping.use&&(l=this.getOverlappingSeriesKeys(e,t,i));const a=s||{},r={},c=this.prunedRealTimeScatterSeries;if(c!=null&&c.size){for(let m=0;m<l.length;m++){const f=l[m];c.has(f)&&((u=(h=(d=this.data)==null?void 0:d.data)==null?void 0:h[f])!=null&&u.length)&&c.delete(f)}l=l.filter(m=>!c.has(m))}for(let m=0;m<l.length;m++){const f=l[m],g=e[f],p=g.type||t,y=a[f];y&&this.canReuseSeries(y,p,g,n)?(this.seriesInfo.charts[p].push(f),y.show=y._freshShow,this.resetSeriesGroupMeta(y),r[f]=y):r[f]=this.addSeries({type:p,id:f,opt:g,index:m,isHorizontal:n})}this.seriesList=r},computeReconcileKey(e,t,n){var i,s;return{type:e,isHorizontal:n,timeMode:e==="bar"&&!!t.timeMode,realTime:e==="scatter"&&!!((i=this.options.realTimeScatter)!=null&&i.use),heatMapColor:e==="heatMap"?this.options.heatMapColor:null,isGradient:e==="heatMap"&&((s=this.options.legend)==null?void 0:s.type)==="gradient"}},canReuseSeries(e,t,n,i){const s=e._reconcileKey;if(!s||e._optSnapshot===void 0)return!1;const l=this.computeReconcileKey(t,n,i);return s.type!==l.type||s.isHorizontal!==l.isHorizontal||s.timeMode!==l.timeMode||s.realTime!==l.realTime||s.heatMapColor!==l.heatMapColor||s.isGradient!==l.isGradient?!1:Ae(e._optSnapshot,n)},resetSeriesGroupMeta(e){e.isExistGrp=!1,e.stackIndex=0,e.groupIndex=null,e.bsId=null,e.bsIds=[],e.isOverlapping=!1},getOverlappingSeriesKeys(e,t,n){const i=[],s=[],l=n.flat();return Object.keys(e).forEach(a=>{if((e[a].type||t)==="bar"&&l.length){const d=l.findIndex(h=>h===a);i.push({key:a,overlappingIdx:d})}else s.push({key:a})}),i.sort((a,r)=>r.overlappingIdx-a.overlappingIdx),[...i,...s].map(({key:a})=>a)},addSeries(e){var r;const{type:t,id:n,opt:i,index:s,isHorizontal:l}=e;let a=!1;if(t==="line")this.seriesInfo.charts.line.push(n),a=new a1(n,i,s);else if(t==="scatter")this.seriesInfo.charts.scatter.push(n),a=new r1(n,i,s,(r=this.options.realTimeScatter)==null?void 0:r.use);else if(t==="bar")this.seriesInfo.charts.bar.push(n),i.timeMode?a=new c1(n,i,s,l):a=new kc(n,i,s,l);else if(t==="pie")this.seriesInfo.charts.pie.push(n),a=new d1(n,i,s);else if(t==="heatMap"){this.seriesInfo.charts.heatMap.push(n);const{heatMapColor:c,legend:d}=this.options,h=d.type==="gradient";a=new h1(n,i,c,l,h)}return a&&(a._reconcileKey=this.computeReconcileKey(t,i,l),a._optSnapshot=i,a._freshShow=a.show),a},addGroupInfo(e){e.forEach((t,n)=>{let i=0;t.reduce((s,l,a)=>{const r=this.seriesList[l];return r.stackIndex=a+i,r.groupIndex=n,r.isExistGrp=!0,r.bsId=s,r.bsIds=t.filter((c,d)=>c!==l&&a>d),r.isOverlapping=this.options.overlapping.use,r.show||i--,r.show?l:s},t[0])})}}};class Ii{constructor(t,n,i,s){const l=Pe({},n,yc);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.type=t,this.ctx=i,this.units=t1[this.type],this.options=s,this.position||(this.position=t==="x"?"bottom":"left")}calculateLabelRange(t,n,i,s){let l,a,r;t==="x"?(l=n.chartWidth,r=Math.floor(s*1.2),a=[i.left,i.right]):(l=n.chartHeight,a=[i.top,i.bottom],r=s+Math.floor(l*.1));const c=l-(a[0]+a[1]),d=1,h=Math.max(Math.floor(c/r),1);return{min:d,max:h}}calculateScaleRange(t,n){var d;let i,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(i=a[1]>+t.max?+t.max:a[1],s=a[0]<+t.min?+t.min:a[0]):(i=a[1],s=a[0]):typeof a=="function"?[s,i]=a(t.min,t.max):(i=t.max,s=t.min),this.autoScaleRatio&&(i=Math.ceil(i*(this.autoScaleRatio+1))),this.startToZero&&(s=0),i===s&&(i+=1,l=!0);const r=this.getLabelFormat(s),c=this.getLabelFormat(i,{isMaxValueSameAsMin:l});return{min:s,max:i,minLabel:r,maxLabel:c,size:A.calcTextSizeCanvas(c,A.getLabelStyle(this.labelStyle),(d=this.labelStyle)==null?void 0:d.padding)}}getLabelWidthHasMaxLength(t,n,i=[]){const s=A.getLabelStyle(this.labelStyle);return[...(t??[]).map(r=>this.getLabelFormat(r)),...i].reduce((r,c)=>{var h;const d=((h=A.calcTextSizeCanvas(c,s))==null?void 0:h.width)??0;return Math.max(r,d)},0)}calculateSteps(t){const{maxValue:n,minValue:i}=t;let{maxSteps:s}=t,l=this.getInterval(t),a=i,r;for(;a<n;)a+=l;const c=a,d=i,h=c-d;if(r=Math.round(h/l),n===1&&(this.decimalPoint?s>2?(l=.2,r=5,s=5):(l=.5,r=2,s=2):(l=1,r=1,s=1)),this.fixedSteps)return{steps:r,interval:l,graphMin:d,graphMax:c};for(;r>s;)l*=2,r=Math.round(h/l),l=Math.ceil(h/r);return c-d>r*l&&(l=Math.ceil((c-d)/r)),{steps:r,interval:l,graphMin:d,graphMax:c}}drawAxisTitle(t,n){const i=this.title;if(!(i!=null&&i.use)||isNaN(i.fontSize))return;const s=this.ctx;s.save(),s.font=A.getLabelStyle(i),s.fillStyle=i.color,s.textAlign=i.textAlign;const l={xLeft:t.x1+n.left,xRight:t.x2-n.right,yTop:t.y1};let a,r;const c=10;this.type==="x"?(a=l.xRight,r=t.y2+i.fontSize+c):(r=l.yTop-i.fontSize-c,a=l.xLeft),a>0&&r>0&&s.fillText(i.text,a,r),s.restore()}draw(t,n,i,s,l,a){var L,w,M,V,S,x,I,T,v,E,Z,W,R,X,G,N,P,B;const r=this.ctx,c=this.options,d={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},h=i.steps,u=i.graphMin,m=i.graphMax,f=i.interval,g=d[this.units.rectStart],p=d[this.units.rectEnd],y=d[this.units.rectOffset(this.position)],C=d[this.units.rectOffsetCounter(this.position)],b=5;let k;if(this.drawAxisTitle(t,n),r.font=A.getLabelStyle(this.labelStyle),r.fillStyle=this.labelStyle.color,this.type==="x"?(r.textAlign="center",r.textBaseline=this.position==="top"?"bottom":"top"):(r.textAlign=this.position==="left"?"right":"left",r.textBaseline="middle"),this.showAxis&&(r.lineWidth=this.axisLineWidth,k=A.aliasPixel(r.lineWidth),r.beginPath(),r.strokeStyle=this.axisLineColor,this.type==="x"?(r.moveTo(g,y+k),r.lineTo(p,y+k)):(r.moveTo(y+k,g),r.lineTo(y+k,p)),r.stroke(),r.closePath()),!(h===0||u===null)){if((L=this.labelStyle)!=null&&L.show){const H=p-g,D=H/h,Y=[],F=i.interval;let O=null,z=null,j=g,U=u;if(this.type==="x"&&(c!=null&&c.axesX[0].flow)&&a.length!==h+1){const J=Math.floor(u/F)*F;J!==+u&&(U=J+F,j+=H/(m-u)*(U-u))}r.strokeStyle=this.gridLineColor,r.lineWidth=1,k=A.aliasPixel(r.lineWidth);let Q;for(let J=0;J<=h;J++)if(O=Math.round(j+D*J),O<=p||this.type!=="x"||!(c!=null&&c.axesX[0].flow)||a.length===h+1){r.beginPath(),Y[J]=U+J*f,Y[J]===0&&this.zeroLineColor?r.strokeStyle=this.zeroLineColor:r.strokeStyle=this.gridLineColor,z=O+k,Q=this.getLabelFormat(Math.min(m,Y[J]),{prev:Y[J-1]??""});const q=((M=(w=this.options)==null?void 0:w.selectLabel)==null?void 0:M.use)&&((S=(V=this.options)==null?void 0:V.selectLabel)==null?void 0:S.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((x=l==null?void 0:l.dataIndex)==null?void 0:x.length)&&!(l!=null&&l.label.map(fe=>this.getLabelFormat(Math.min(m,fe),{prev:Y[J-1]??""})).includes(Q));let ee;J===h&&this.lastLabelFontStyle?(r.font=A.getLabelStyle(this.lastLabelFontStyle),ee=this.lastLabelFontStyle.color):J===0&&this.firstLabelFontStyle?(r.font=A.getLabelStyle(this.firstLabelFontStyle),ee=this.firstLabelFontStyle.color):(r.font=A.getLabelStyle(this.labelStyle),ee=this.labelStyle.color);let $=1;A.getColorStringType(ee)==="RGBA"&&($=A.getOpacity(ee)),r.fillStyle=A.colorStringToRgba(ee,q?(I=this.options)==null?void 0:I.unSelectedOpacity:$);let he;if(this.type==="x"){if(he=this.position==="top"?y-10:y+10,((T=c==null?void 0:c.brush)!=null&&T.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(Q),O,he),!q&&((v=c==null?void 0:c.selectItem)!=null&&v.showLabelTip)&&(s!=null&&s.label)&&!((E=this.options)!=null&&E.horizontal)){const fe=this.getLabelFormat(Math.min(m,s.label+0*f));if(fe===Q){const ae=Math.round(r.measureText((Z=this.labelStyle)==null?void 0:Z.fontSize).width);A.showLabelTip({ctx:this.ctx,width:Math.round(r.measureText(fe).width)+10,height:ae,x:O,y:he+(ae-2),borderRadius:2,arrowSize:3,text:Q,backgroundColor:(R=(W=c==null?void 0:c.selectItem)==null?void 0:W.labelTipStyle)==null?void 0:R.backgroundColor,textColor:(G=(X=c==null?void 0:c.selectItem)==null?void 0:X.labelTipStyle)==null?void 0:G.textColor})}}this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(z,y),r.lineTo(z,y+b),r.stroke(),r.closePath()),(J!==0||c!=null&&c.axesX[0].flow)&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(z,y),r.lineTo(z,C),r.stroke(),r.closePath())}else he=this.position==="left"?y-10:y+10,((N=c==null?void 0:c.brush)!=null&&N.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(Q),he,O),J===h&&(z-=1),this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(y+(this.axisLineWidth??1),z),r.lineTo(y-b,z),r.stroke(),r.closePath()),J!==0&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(y,z),r.lineTo(C,z),r.stroke(),r.closePath())}}((P=this.plotBands)!=null&&P.length||(B=this.plotLines)!=null&&B.length)&&(this._plotGeom={aPos:d,axisMin:u,axisMax:m,aliasPixel:k,chartRect:t,labelOffset:n})}}drawPlots(){var p,y,C,b;if(!((p=this.plotBands)!=null&&p.length||(y=this.plotLines)!=null&&y.length)||!this._plotGeom)return;const{aPos:t,axisMin:n,axisMax:i,aliasPixel:s,chartRect:l,labelOffset:a}=this._plotGeom,r=l.chartWidth-(a.left+a.right),c=l.chartHeight-(a.top+a.bottom),d=s+1,h=t.x1,u=t.x2+d,m=t.y1-d,f=t.y2,g={minX:h,maxX:u,minY:m,maxY:f};this.plotLabelHitRegions=[],(C=this.plotBands)==null||C.forEach(k=>{const L=Pe({},k,ml),{from:w,to:M,label:V,border:S}=L,x=A.isNullOrUndefined(w)?n:Math.max(w,n),I=A.isNullOrUndefined(M)?i:Math.min(M,i);let T,v;if(this.type==="x"){if(T=te.calculateX(x,n,i,r,h),v=te.calculateX(I,n,i,r,h),T===null||v===null)return;this.setPlotBandStyle(L),this.drawXPlotBand(T,v,h,u,m,f,S)}else{if(T=te.calculateY(x,n,i,c,f),v=te.calculateY(I,n,i,c,f),T===null||v===null)return;this.setPlotBandStyle(L),this.drawYPlotBand(T,v,h,u,m,f,S)}this.drawPlotBandLabel(T,v,V,g,l,x,I)}),(b=this.plotLines)==null||b.forEach(k=>{if(!Number.isFinite(+k.value))return;const L=Pe({},k,fl),{value:w,label:M}=L;let V;if(this.type==="x"){if(V=te.calculateX(w,n,i,r,h),V===null)return;this.setPlotLineStyle(L),this.drawXPlotLine(V,h,u,m,f)}else{if(V=te.calculateY(w,n,i,c,f),V===null)return;this.setPlotLineStyle(L),this.drawYPlotLine(V,h,u,m,f)}this.drawPlotLineLabel(V,M,g,l,w)})}setPlotLineStyle(t){const n=this.ctx,{color:i,lineWidth:s}=t;n.beginPath(),n.save(),n.lineWidth=s,n.strokeStyle=i,n.setLineDash(t.segments??[])}setPlotBandStyle(t){const n=this.ctx,{color:i}=t;n.beginPath(),n.save(),n.fillStyle=i}drawXPlotBand(t,n,i,s,l,a,r){const c=this.ctx;if(!Number.isFinite(t)||!Number.isFinite(n)){c.closePath(),c.restore();return}c.moveTo(t,l),c.lineTo(t,a),c.lineTo(n,a),c.lineTo(n,l),c.lineTo(t,l),c.fill(),this.drawPlotBandBorder(r,[[t,l,t,a],[n,l,n,a]]),c.restore(),c.closePath()}drawXPlotLine(t,n,i,s,l){const a=this.ctx;if(!Number.isFinite(t)||t<n||t>i){a.closePath(),a.restore();return}let r=t;r+=A.aliasPixel(a.lineWidth),a.moveTo(r,l),a.lineTo(r,s),a.stroke(),a.restore(),a.closePath()}drawYPlotLine(t,n,i,s,l){const a=this.ctx;if(!Number.isFinite(t)||t>l||t<s){a.closePath(),a.restore();return}let r=t;r+=A.aliasPixel(a.lineWidth),a.moveTo(n,r),a.lineTo(i,r),a.stroke(),a.restore(),a.closePath()}drawYPlotBand(t,n,i,s,l,a,r){const c=this.ctx;if(!Number.isFinite(t)||!Number.isFinite(n)){c.closePath(),c.restore();return}c.moveTo(i,t),c.lineTo(i,n),c.lineTo(s,n),c.lineTo(s,t),c.lineTo(i,t),c.fill(),this.drawPlotBandBorder(r,[[i,t,s,t],[i,n,s,n]]),c.restore(),c.closePath()}drawPlotBandBorder(t,n){if(!t||!(t.width>0))return;const i=this.ctx;i.save(),i.beginPath(),i.strokeStyle=t.color??"#000000",i.lineWidth=t.width,i.setLineDash(t.segments??[]),n.forEach(([s,l,a,r])=>{i.moveTo(s,l),i.lineTo(a,r)}),i.stroke(),i.restore()}getNormalizedLabelOptions(t,n,i=null){const s=Pe({},n,xc),l=this.ctx,{maxWidth:a,responsive:r}=s,c=s.fontSize>20?20:s.fontSize,d=t.chartWidth,h=r==null?void 0:r.valueOnlyBelow,u=r==null?void 0:r.hideBelow,m=!A.isNullOrUndefined(u)&&d<u,f=!m&&!A.isNullOrUndefined(h)&&d<h,g=s.text!=null?String(s.text):"",p=!A.isNullOrUndefined(i)&&Number.isFinite(+i);let y="";if(s.showValue&&p)if(typeof s.valueFormatter=="function"){const T=s.valueFormatter(i);y=T==null?String(this.getLabelFormat(i)):String(T)}else y=String(this.getLabelFormat(i));let C;s.showValue?C=f?y:[g,y].filter(T=>T).join(" "):C=g,l.save(),l.font=A.getLabelStyle({...s,fontSize:c});let b=C,k=a??l.measureText(b).width;const L=this.type==="y"?t.width-t.chartWidth:a??t.width;s.position==="outside"&&L<l.measureText(b).width&&s.textOverflow==="ellipsis"&&(b=A.truncateLabelWithEllipsis(C,L,l),k=l.measureText(b).width),l.restore();const w=c/4,M=s.padding;let V=w,S=w,x=w,I=w;return typeof M=="number"?(V=M,S=M,x=M,I=M):M&&typeof M=="object"&&(V=M.top??w,S=M.right??w,x=M.bottom??w,I=M.left??w),{...s,label:b,fontSize:c,labelWidth:k,padTop:V,padRight:S,padBottom:x,padLeft:I,lineGap:s.gap!=null?s.gap:w+2,borderRadius:Math.max(0,s.borderRadius??0),hidden:m,valueOnly:f,hoverText:g}}getPlotBandLabelPosition(t,n,i,s){const{fontSize:l,labelWidth:a,padTop:r,padRight:c,padBottom:d,padLeft:h,position:u}=i,{maxX:m}=s;if(l<=0)return null;const f=(t+n)/2;if(this.type==="x")return this.computeTopLabelBox(f,i,s);if(u==="innerStart"||u==="innerEnd")return this.computeInnerLabelBox(f,i,s);const g=a+h+c,p=l+r+d,y=m+h,C=y+g;let b;switch(i.verticalAlign){case"top":b=n;break;case"bottom":b=t;break;case"middle":default:b=(t+n)/2;break}const k=b-p/2,L=b+p/2;return{textX:y+h+a/2,textY:k+r+l/2,textAlign:"center",textBaseline:"middle",box:{left:y,top:k,right:C,bottom:L},pointerEdge:"left"}}getPlotLineLabelPosition(t,n,i){const{fontSize:s,labelWidth:l,padTop:a,padRight:r,padBottom:c,padLeft:d,position:h}=n,{maxX:u}=i;if(s<=0)return null;if(this.type==="x")return this.computeTopLabelBox(t,n,i);if(h==="innerStart"||h==="innerEnd")return this.computeInnerLabelBox(t,n,i);const m=l+d+r,f=s+a+c,g=u+d,p=g+m;let y,C;switch(n.verticalAlign){case"top":C=t,y=C-f;break;case"bottom":y=t,C=y+f;break;case"middle":default:y=t-f/2,C=t+f/2;break}return{textX:g+d+l/2,textY:y+a+s/2,textAlign:"center",textBaseline:"middle",box:{left:g,top:y,right:p,bottom:C},pointerEdge:"left"}}computeTopLabelBox(t,n,i){const{labelWidth:s,fontSize:l,padTop:a,padRight:r,padBottom:c,padLeft:d,textAlign:h}=n,{minY:u}=i,m=s+d+r,f=l+a+c,g=n.gap!=null?n.gap:2,p=u-g,y=p-f,C=0;let b,k;switch(h){case"left":k=t-C,b=k-m;break;case"right":b=t+C,k=b+m;break;default:b=t-m/2,k=t+m/2;break}return{textX:b+d+s/2,textY:y+a+l/2,textAlign:"center",textBaseline:"middle",box:{left:b,top:y,right:k,bottom:p},pointerEdge:"bottom",pointerTipX:t}}computeInnerLabelBox(t,n,i){const{labelWidth:s,fontSize:l,padTop:a,padRight:r,padBottom:c,padLeft:d,lineGap:h,position:u,verticalAlign:m,textAlign:f}=n,{minX:g,maxX:p,minY:y,maxY:C}=i,b=s+d+r,k=l+a+c;let L,w,M,V;if(this.type==="x")switch(u==="innerEnd"?(V=C-h,w=V-k):(w=y+h,V=w+k),f){case"left":L=t+h,M=L+b;break;case"right":M=t-h,L=M-b;break;default:L=t-b/2,M=t+b/2;break}else switch(u==="innerEnd"?(M=p-h,L=M-b):(L=g+h,M=L+b),m){case"top":V=t-h,w=V-k;break;case"bottom":w=t+h,V=w+k;break;default:w=t-k/2,V=t+k/2;break}let S;return this.type==="x"?S=u==="innerEnd"?"top":"bottom":m==="top"?S="bottom":m==="bottom"?S="top":S=null,{textX:L+d+s/2,textY:w+a+l/2,textAlign:"center",textBaseline:"middle",box:{left:L,top:w,right:M,bottom:V},pointerEdge:S}}drawPlotLabel(t,n){var w,M;if(!n)return;const{textX:i,textY:s,textAlign:l="left",textBaseline:a="alphabetic",box:r}=n,{label:c,fontSize:d,fontColor:h,fillColor:u,lineColor:m,lineWidth:f,borderRadius:g=0}=t;if(d<=0||!r)return;const{left:p,top:y,right:C,bottom:b}=r,k=this.ctx;k.save(),k.beginPath(),k.font=A.getLabelStyle(t),k.setLineDash([]),k.fillStyle=u,k.strokeStyle=m,k.lineWidth=f;const L=Math.min(g,Math.abs(C-p)/2,Math.abs(b-y)/2);L>0?(k.moveTo(p+L,y),k.lineTo(C-L,y),k.arcTo(C,y,C,y+L,L),k.lineTo(C,b-L),k.arcTo(C,b,C-L,b,L),k.lineTo(p+L,b),k.arcTo(p,b,p,b-L,L),k.lineTo(p,y+L),k.arcTo(p,y,p+L,y,L),k.closePath()):(k.moveTo(p,b),k.lineTo(p,y),k.lineTo(C,y),k.lineTo(C,b),k.lineTo(p,b)),k.fill(),f>0&&k.stroke(),(w=t.pointer)!=null&&w.show&&n.pointerEdge&&this.drawLabelPointer(r,n.pointerEdge,t.pointer.color??u,m,f,n.pointerTipX,L),k.fillStyle=h,k.textAlign=l,k.textBaseline=a,k.fillText(c,i,s),k.closePath(),k.restore(),t.valueOnly&&((M=t.showTextOnHover)!=null&&M.use)&&t.hoverText&&(this.plotLabelHitRegions||(this.plotLabelHitRegions=[]),this.plotLabelHitRegions.push({x:Math.min(p,C),y:Math.min(y,b),width:Math.abs(C-p),height:Math.abs(b-y),text:t.hoverText,style:t.showTextOnHover}))}drawLabelPointer(t,n,i,s,l,a,r=0){const c=this.ctx,d=4,h=4,u=(t.left+t.right)/2,m=(t.top+t.bottom)/2,f=Math.min(r+h,(t.right-t.left)/2),g=Math.min(r+h,(t.bottom-t.top)/2),p=a??u,y=Math.max(t.left+f,Math.min(t.right-f,p)),C=Math.max(t.top+g,Math.min(t.bottom-g,m));let b,k,L,w,M,V;switch(n){case"top":b=y-h,k=t.top,L=y+h,w=t.top,M=p,V=t.top-d;break;case"left":b=t.left,k=C-h,L=t.left,w=C+h,M=t.left-d,V=C;break;case"right":b=t.right,k=C-h,L=t.right,w=C+h,M=t.right+d,V=C;break;case"bottom":default:b=y-h,k=t.bottom,L=y+h,w=t.bottom,M=p,V=t.bottom+d;break}c.beginPath(),c.moveTo(b,k),c.lineTo(M,V),c.lineTo(L,w),c.closePath(),c.fillStyle=i,c.fill(),l>0&&(c.beginPath(),c.moveTo(b,k),c.lineTo(M,V),c.lineTo(L,w),c.strokeStyle=s,c.lineWidth=l,c.stroke())}drawPlotLineLabel(t,n,i,s,l=null){if(!(n!=null&&n.show))return;const a=this.getNormalizedLabelOptions(s,n,l);if(a.hidden)return;const r=this.getPlotLineLabelPosition(t,a,i);this.drawPlotLabel(a,r)}drawPlotBandLabel(t,n,i,s,l,a,r){if(!(i!=null&&i.show))return;if(i.showValue){const h=a<=r,u=this.type==="x"?{textAlign:h?"left":"right"}:{verticalAlign:h?"bottom":"top"},m=this.type==="x"?{textAlign:h?"right":"left"}:{verticalAlign:h?"top":"bottom"};this.drawPlotLineLabel(t,{...i,...u},s,l,a),this.drawPlotLineLabel(n,{...i,...m},s,l,r);return}const c=this.getNormalizedLabelOptions(l,i,null);if(c.hidden)return;const d=this.getPlotBandLabelPosition(t,n,c,s);this.drawPlotLabel(c,d)}checkFixWidth(t){const{fixWidth:n,fitDir:i}=this.labelStyle;return Re(n)&&n>0?A.truncateLabelWithEllipsis(t,n,this.ctx,i):t}}function u1(e){if(typeof e=="string"&&Tt[e])return{ms:Tt[e].size,unit:e,time:1};if(typeof e=="object"&&e!==null&&e.unit&&e.time>0){const t=Tt[e.unit];return t?{ms:e.time*t.size,unit:e.unit,time:e.time}:null}return typeof e=="number"&&e>0&&Number.isFinite(e)?{ms:e,unit:null,time:null}:null}function Ic(e){return e.hour()===0&&e.minute()===0&&e.second()===0&&e.millisecond()===0?e:e.startOf("day")}function f1(e,t){if(!t.unit)return We(e.valueOf()+t.ms);const n=t.time||1;switch(t.unit){case"month":return e.add(n,"month");case"quarter":return e.add(n*3,"month");case"year":return e.add(n,"year");case"week":return Ic(e.add(n*7,"day"));case"day":return Ic(e.add(n,"day"));default:return We(e.valueOf()+t.ms)}}function m1(e,t){return t.unit?f1(We(e),t).valueOf():e+t.ms}function p1(e,t){if(!t.unit)return Math.ceil(e/t.ms)*t.ms;const n=t.time||1,i=We(e);if(["millisecond","second","minute","hour"].includes(t.unit)){const s=i.startOf("day").valueOf(),l=Tt[t.unit].size*n,a=e-s;return s+Math.ceil(a/l)*l}if(t.unit==="day"){const s=i.startOf("year"),l=i.startOf("day"),a=Math.round((l.valueOf()-s.valueOf())/Tt.day.size),r=l.valueOf()>=e?a:a+1,c=Math.ceil(r/n)*n;return s.add(c,"day").valueOf()}if(t.unit==="week"){const s=i.startOf("year"),l=s.subtract((s.day()+6)%7,"day"),a=i.subtract((i.day()+6)%7,"day").startOf("day"),r=Math.round((a.valueOf()-l.valueOf())/Tt.week.size),c=a.valueOf()>=e?r:r+1,d=Math.ceil(c/n)*n;return l.add(d*7,"day").valueOf()}if(t.unit==="month"){const s=i.startOf("year"),l=i.startOf("month"),a=i.month(),r=l.valueOf()>=e?a:a+1,c=Math.ceil(r/n)*n;return s.add(c,"month").valueOf()}if(t.unit==="quarter"){const s=i.startOf("year"),l=Math.floor(i.month()/3),r=i.month(l*3).startOf("month").valueOf()>=e?l:l+1,c=Math.ceil(r/n)*n;return s.add(c*3,"month").valueOf()}if(t.unit==="year"){const s=i.startOf("year"),l=2e3,a=s.valueOf()>=e?i.year()-l:i.year()+1-l,r=Math.ceil(a/n)*n;return We(`${l+r}-01-01`).startOf("day").valueOf()}return e}function g1(e,t,n){const i=[];let s=p1(e,n);const l=1e4;for(;s<=t&&i.length<l;)i.push(s),s=m1(s,n);return i}const pl=864e5,b1=["millisecond","second","minute","hour"],gl=new Map;function y1(e){if(gl.has(e))return gl.get(e);const t=[],n=[];for(let s=1;s*s<=e;s+=1)e%s===0&&(t.push(s),s!==e/s&&n.push(e/s));const i=t.concat(n.reverse());return gl.set(e,i),i}function Tc(e,t,n){const i=Math.ceil(t/e.ms);let s=i>n?Math.max(1,Math.floor(i/n)):1,l=e.ms*s;const a=s+1e4;for(;s<=a&&Math.floor(t/l)+1>n;)s+=1,l=e.ms*s;return e.unit?{ms:l,unit:e.unit,time:(e.time||1)*s}:{ms:l,unit:null,time:null}}function x1(e,t,n){const i=s=>Math.floor(t/s)+1<=n;if(i(e.ms))return e;if(e.unit&&b1.includes(e.unit)&&pl%e.ms===0){const s=y1(pl/e.ms);for(let l=0;l<s.length;l+=1){const a=e.ms*s[l];if(i(a))return{ms:a,unit:e.unit,time:(e.time||1)*s[l]}}return Tc({ms:pl,unit:"day",time:1},t,n)}return Tc(e,t,n)}function Lc(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=We(e).valueOf();return Number.isFinite(t)?t:null}class S1 extends Ii{normalizeTimeValue(t){return Lc(t)}calculateScaleRange(t,n){const i=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(i)||typeof i=="function")&&((t==null?void 0:t.min)==null||(t==null?void 0:t.max)==null))return{min:null,max:null,minLabel:"",maxLabel:"",size:A.calcTextSizeCanvas("",A.getLabelStyle(this.labelStyle))};let l=i;Array.isArray(i)&&i.length===2?l=[this.normalizeTimeValue(i[0]),this.normalizeTimeValue(i[1])]:typeof i=="function"&&(l=(...h)=>{const[u,m]=i(...h);return[this.normalizeTimeValue(u),this.normalizeTimeValue(m)]});const a=this.range,r=n!=null&&n.use?{...n,range:l}:n,c={...t,min:this.normalizeTimeValue(t==null?void 0:t.min),max:this.normalizeTimeValue(t==null?void 0:t.max)};let d;try{n!=null&&n.use||(this.range=l),d=super.calculateScaleRange(c,r)}finally{this.range=a}return{...d,min:this.normalizeTimeValue(d.min),max:this.normalizeTimeValue(d.max)}}getLabelFormat(t,n={}){if(this.formatter){const i=this.formatter(t,n);if(typeof i=="string")return i}return We(t).format(this.timeFormat)}getInterval(t){const n=this.normalizeTimeValue(t.maxValue),i=this.normalizeTimeValue(t.minValue),s=t.maxSteps;if(this.interval){let l;if(typeof this.interval=="string"?l=Tt[this.interval].size:typeof this.interval=="object"?l=this.interval.time*Tt[this.interval.unit].size:typeof this.interval=="number"&&(l=this.interval),l>0&&Number.isFinite(l))return l}return Math.ceil((n-i)/s)}calculateSteps(t){const n=this.normalizeTimeValue(t.minValue),i=this.normalizeTimeValue(t.maxValue),s=Math.max(1,t.maxSteps??1);if(n==null||i==null)return{steps:0,interval:0,baseInterval:0,graphMin:null,graphMax:null,ticks:[]};const l=+n,a=+i;if(l>=a)return{steps:0,interval:0,baseInterval:0,graphMin:l,graphMax:a,ticks:[]};const r=u1(this.interval);let c;r?c=r:c={ms:Math.max(1,Math.ceil((a-l)/Math.max(1,s))),unit:null,time:null};const d=a-l,h=this.fixedSteps?c:x1(c,d,s),u=h.ms,m=g1(l,a,h);return{steps:Math.max(0,m.length-1),interval:u,baseInterval:c.ms,graphMin:l,graphMax:a,ticks:m}}draw(t,n,i,s,l){var b,k,L,w,M,V,S,x,I,T,v,E,Z,W,R,X,G,N;const a=this.ctx,r=this.options,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=i.graphMin,h=i.graphMax,u=i.ticks,m=c[this.units.rectStart],f=c[this.units.rectEnd],g=c[this.units.rectOffset(this.position)],p=c[this.units.rectOffsetCounter(this.position)],y=5;let C=0;if(this.drawAxisTitle(t,n),a.font=A.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),this.showAxis&&(a.lineWidth=this.axisLineWidth,C=A.aliasPixel(a.lineWidth),a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(m,g+C),a.lineTo(f,g+C)):(a.moveTo(g+C,m),a.lineTo(g+C,f)),a.stroke(),a.closePath()),!(!(u!=null&&u.length)||d===null)){if((b=this.labelStyle)!=null&&b.show){const P=c.x2-c.x1,B=c.y2-c.y1;a.strokeStyle=this.gridLineColor,a.lineWidth=1,C=A.aliasPixel(a.lineWidth);let H;for(let D=0;D<u.length;D++){const Y=u[D];let F;if(this.type==="x"?F=te.calculateX(Y,d,h,P,c.x1):F=te.calculateY(Y,d,h,B,c.y2),F===null)continue;Y===0&&this.zeroLineColor?a.strokeStyle=this.zeroLineColor:a.strokeStyle=this.gridLineColor;const z=F+C;H=this.getLabelFormat(Y,{prev:u[D-1]??""});const j=((L=(k=this.options)==null?void 0:k.selectLabel)==null?void 0:L.use)&&((M=(w=this.options)==null?void 0:w.selectLabel)==null?void 0:M.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((V=l==null?void 0:l.dataIndex)==null?void 0:V.length)&&!(l!=null&&l.label.map(ne=>this.getLabelFormat(ne,{prev:u[D-1]??""})).includes(H));let U;D===u.length-1&&this.lastLabelFontStyle?(a.font=A.getLabelStyle(this.lastLabelFontStyle),U=this.lastLabelFontStyle.color):D===0&&this.firstLabelFontStyle?(a.font=A.getLabelStyle(this.firstLabelFontStyle),U=this.firstLabelFontStyle.color):(a.font=A.getLabelStyle(this.labelStyle),U=this.labelStyle.color);let Q=1;A.getColorStringType(U)==="RGBA"&&(Q=A.getOpacity(U)),a.fillStyle=A.colorStringToRgba(U,j?(S=this.options)==null?void 0:S.unSelectedOpacity:Q);let J;if(this.type==="x"){if(J=this.position==="top"?g-10:g+10,((x=r==null?void 0:r.brush)!=null&&x.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(H),F,J),!j&&((I=r==null?void 0:r.selectItem)!=null&&I.showLabelTip)&&(s!=null&&s.label)&&!((T=this.options)!=null&&T.horizontal)){const ne=this.getLabelFormat(s.label);if(ne===H){const q=Math.round(a.measureText((v=this.labelStyle)==null?void 0:v.fontSize).width);A.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(ne).width)+10,height:q,x:F,y:J+(q-2),borderRadius:2,arrowSize:3,text:H,backgroundColor:(Z=(E=r==null?void 0:r.selectItem)==null?void 0:E.labelTipStyle)==null?void 0:Z.backgroundColor,textColor:(R=(W=r==null?void 0:r.selectItem)==null?void 0:W.labelTipStyle)==null?void 0:R.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(z,g),a.lineTo(z,g+y),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(z,g),a.lineTo(z,p),a.stroke(),a.closePath())}else{J=this.position==="left"?g-10:g+10,((X=r==null?void 0:r.brush)!=null&&X.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(H),J,F);let ne=z;D===u.length-1&&(ne-=1),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),ne),a.lineTo(g-y,ne),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(g,ne),a.lineTo(p,ne),a.stroke(),a.closePath())}}}((G=this.plotBands)!=null&&G.length||(N=this.plotLines)!=null&&N.length)&&(this._plotGeom={aPos:c,axisMin:d,axisMax:h,aliasPixel:C,chartRect:t,labelOffset:n})}}drawPlots(){var p,y,C,b;if(!((p=this.plotBands)!=null&&p.length||(y=this.plotLines)!=null&&y.length)||!this._plotGeom)return;const{aPos:t,axisMin:n,axisMax:i,aliasPixel:s,chartRect:l,labelOffset:a}=this._plotGeom,r=l.chartWidth-(a.left+a.right),c=l.chartHeight-(a.top+a.bottom),d=s+1,h=t.x1,u=t.x2+d,m=t.y1-d,f=t.y2,g={minX:h,maxX:u,minY:m,maxY:f};this.plotLabelHitRegions=[],(C=this.plotBands)==null||C.forEach(k=>{const L=Pe({},k,ml),{from:w,to:M,label:V,border:S}=L,x=A.isNullOrUndefined(w)?n:Math.max(w,n),I=A.isNullOrUndefined(M)?i:Math.min(M,i);let T,v;if(this.type==="x"){if(T=te.calculateX(x,n,i,r,h),v=te.calculateX(I,n,i,r,h),T===null||v===null)return;this.setPlotBandStyle(L),this.drawXPlotBand(T,v,h,u,m,f,S)}else{if(T=te.calculateY(x,n,i,c,f),v=te.calculateY(I,n,i,c,f),T===null||v===null)return;this.setPlotBandStyle(L),this.drawYPlotBand(T,v,h,u,m,f,S)}this.drawPlotBandLabel(T,v,V,g,l,x,I)}),(b=this.plotLines)==null||b.forEach(k=>{if(!Number.isFinite(+k.value))return;const L=Pe({},k,fl),{value:w,label:M}=L;let V;if(this.type==="x"){if(V=te.calculateX(w,n,i,r,h),V===null)return;this.setPlotLineStyle(L),this.drawXPlotLine(V,h,u,m,f)}else{if(V=te.calculateY(w,n,i,c,f),V===null)return;this.setPlotLineStyle(L),this.drawYPlotLine(V,h,u,m,f)}this.drawPlotLineLabel(V,M,g,l,w)})}}class C1 extends Ii{getTruthyValue(t){const n=this.adjustedDecimalPoint??this.decimalPoint;return Re(t)?Number(t.toFixed(n)):t}getLabelFormat(t,n={}){if(this.formatter){const s=this.getTruthyValue(t),l=this.formatter(s,{...n,prevOriginalValue:n==null?void 0:n.prev,prevDecimalPointValue:this.getTruthyValue(n==null?void 0:n.prev),currentOriginalValue:t,currentDecimalPointValue:s});if(typeof l=="string")return l}const i=this.adjustedDecimalPoint??this.decimalPoint;return A.labelSignFormat(t,i)}getInterval(t){if(this.interval)return this.interval;let n=0;const i=t.maxValue,s=t.minValue,l=t.maxSteps;if(!l||l<=0)return 0;if(this.startToZero&&s<0){const a=Math.abs(s)+Math.abs(i),r=Math.abs(s)/a,c=Math.abs(i)/a;let d=Math.max(1,Math.round(r*l)),h=Math.max(1,l-d);d+h>l&&(r>c?d-=1:h-=1),n=Math.max(Math.abs(s)/(d||1),Math.abs(i)/(h||1))}else n=(i-s)/l;return this.decimalPoint?n:Math.ceil(n)}getExactInterval(t,n){if(!Number.isFinite(t)||t<=0)return{interval:1,steps:1};const i=Math.max(1,n);let s=null,l=0,a=1/0;for(let r=i;r>=1;r--){const c=t/r;let d=1;for(let h=0;h<=12;h++,d*=10){const u=c*d;if(Math.abs(u-Math.round(u))<1e-6){h<a&&c<t&&(a=h,s=Math.round(u)/d,l=r);break}}if(a===0)break}return l>0?{interval:s,steps:l}:{interval:parseFloat((t/i).toFixed(12)),steps:i}}getStepsWithNiceScale({max:t,min:n,maxSteps:i}){const s=t-n;if(!Number.isFinite(s)||s<=0)return{max:n+1,min:n,interval:1,steps:1};const l=s/i,a=Math.floor(Math.log10(l)),r=Math.ceil(Math.log10(s));let c=t,d=n,h=0,u=0,m=1/0;for(let f=a;f<=r;f++){const g=10**f;for(const p of o1){const y=p*g;if(y>=l){const C=y*1e-10,b=Math.floor((n+C)/y)*y,k=Math.ceil((t-b-C)/y),L=b+y*k;if(k<=i&&L>=t-C){const w=n-b+(L-t);w<m&&(c=L,d=b,h=y,u=k,m=w)}}}}if(!(h>0)||u<=0){const f=Math.max(1,i),g=s/f||1;return{max:t,min:n,interval:g,steps:f}}return{max:c,min:d,interval:h,steps:u}}getDecimalPointFromInterval(t){if(!Number.isFinite(t)||t===0)return 0;const n=Math.abs(t),i=10,s=1e-10,l=(c,d=0)=>{const h=10**d;return Math.round((c+Number.EPSILON)*h)/h},a=(c,d)=>{const h=l(c,d);return Math.abs(c-h)<s};if(n>=1&&a(n,0))return 0;const r=n>=1?0:Math.max(0,Math.ceil(-Math.log10(n)));for(let c=r;c<=i;c+=1)if(a(n,c))return c;return i}getLegacyOneMaxScale(t){return this.decimalPoint?t>2?{interval:.2,steps:5}:{interval:.5,steps:2}:{interval:1,steps:1}}calculateSteps(t){const{minValue:n,maxValue:i}=t,s=Math.max(1,t.maxSteps??1),l=Array.isArray(this.range)&&this.range.length===2,r=typeof this.interval=="number"||typeof this.interval=="object"&&this.interval!==null?this.getInterval(t):null,c=r!=null&&r>0&&Number.isFinite(r),d=l?+this.range[0]:null,h=l?+this.range[1]:null,u=1e-10,m=b=>{if(this.decimalPoint==="auto"){const k=this.getDecimalPointFromInterval(b);k!=null&&!Number.isNaN(k)?this.adjustedDecimalPoint=k:typeof this.getAutoDecimalPointFromInterval=="function"?this.adjustedDecimalPoint=this.getAutoDecimalPointFromInterval(b):this.adjustedDecimalPoint=0}else this.adjustedDecimalPoint=this.decimalPoint},f=(b,k)=>Math.max(1,Math.round(b/k+u)),g=({min:b,max:k,interval:L})=>{let w=0,M=0;return b>=0?(w=+b,M=Math.ceil(k/L)*L):k>=0?(w=Math.floor(b/L)*L,M=Math.ceil(k/L)*L):(M=+k,w=Math.floor(b/L)*L),{graphMin:w,graphMax:M}};if(l&&c){const b=d,k=h,L=r,M=(k-b)/L;if(Math.abs(M-Math.round(M))<u&&M<=s||this.fixedSteps){const S=Math.round(M);return m(L),{steps:S,interval:L,graphMin:b,graphMax:k}}}if(l){const b=d,k=h,L=k-b,{interval:w,steps:M}=this.getExactInterval(L,s);return m(w),{steps:M,interval:w,graphMin:b,graphMax:k}}if(c){let b=r,k=0,L=0,w=0,M=0;for({graphMin:k,graphMax:L}=g({min:n,max:i,interval:b}),w=L-k,M=f(w,b);M>s;)b+=r,{graphMin:k,graphMax:L}=g({min:n,max:i,interval:b}),w=L-k,M=f(w,b);return m(b),{steps:M,interval:b,graphMin:k,graphMax:L}}const p=this.startToZero&&n>=0?0:n,y=this.startToZero&&i<=0?0:i;if(p===0&&y===1){const b=this.getLegacyOneMaxScale(s);return m(b.interval),{steps:b.steps,interval:b.interval,graphMin:p,graphMax:y}}const C=this.getStepsWithNiceScale({min:p,max:y,maxSteps:s});return m(C.interval),{steps:C.steps,interval:C.interval,graphMin:C.min,graphMax:C.max}}calculateScaleRange(t,n){var u;let i,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(a)||typeof a=="function")&&((t==null?void 0:t.min)==null||(t==null?void 0:t.max)==null)){const m=this.getLabelFormat(0),f=this.getLabelFormat(1,{isMaxValueSameAsMin:!0});return{min:0,max:1,minLabel:m,maxLabel:f,size:A.calcTextSizeCanvas(f,A.getLabelStyle(this.labelStyle))}}Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(i=a[1]>+t.max?+t.max:a[1],s=a[0]<+t.min?+t.min:a[0]):(i=a[1],s=a[0]):typeof a=="function"?[s,i]=a(t.min,t.max):(i=t.max,s=t.min);const c=Array.isArray(this.range)&&this.range.length===2;if(this.autoScaleRatio&&!c){const m=i,f=i*(this.autoScaleRatio+1);if(i=this.decimalPoint?f:Math.ceil(f),i>0&&s<0){const g=m-i;s+=g}else if(i<0&&s<0){const g=s*(this.autoScaleRatio+1);s=this.decimalPoint?g:Math.ceil(g)}}this.startToZero&&!c&&(s>0&&(s=0),i<0&&(i=0)),i===s&&(i+=1,l=!0);const d=this.getLabelFormat(s),h=this.getLabelFormat(i,{isMaxValueSameAsMin:l});return{min:s,max:i,minLabel:d,maxLabel:h,size:A.calcTextSizeCanvas(h,A.getLabelStyle(this.labelStyle),(u=this.labelStyle)==null?void 0:u.padding)}}}class k1 extends Ii{calculateScaleRange(t){let n,i,s=!1;Array.isArray(this.range)&&this.range.length===2?(n=this.range[1],i=this.range[0]):typeof range=="function"?[i,n]=this.range(t.min,t.max):(n=t.max,i=t.min);const l=A.calculateMagnitude(n-i);n=Math.ceil(n/10**l)*10**l,this.startToZero&&(i=0),n===i&&(n+=1,s=!0);const a=this.getLabelFormat(i),r=this.getLabelFormat(n,{isMaxValueSameAsMin:s});return{min:i,max:n,minLabel:a,maxLabel:r,size:A.calcTextSizeCanvas(r,A.getLabelStyle(this.labelStyle))}}calculateSteps(t,n){const i=t.maxValue,s=t.minValue,l=t.maxSteps,a=A.calculateMagnitude(i-s);let r=this.getInterval(t),c;const d=i,h=s,u=d-h;for(c=Math.round(u/r),i===1&&(r=.2,c=5);(c>l||c*2<l)&&!n;)if(c>l)r*=2,c=Math.ceil(u/r);else if(a>=0)if(r/2%1===0)r/=2,c=Math.ceil(u/r);else break;else r/=2,c=Math.ceil(u/r);return{steps:c,interval:r,graphMin:h,graphMax:Math.ceil(h+c*r)}}getLabelFormat(t,n={}){if(this.formatter){const i=this.formatter(t,n);if(typeof i=="string")return i}return A.labelSignFormat(t,this.decimalPoint)}getInterval(t){const n=t.maxValue,i=t.minValue;return 10**A.calculateMagnitude(n-i)}}const bl=new WeakMap;class w1 extends Ii{constructor(t,n,i,s,l){super(t,n,i,l),this.labels=s}getMaxWidth(t,n){var s;const i=(s=this.labelStyle)==null?void 0:s.maxWidth;if(i==null)return n;if(typeof i=="string"){const l=i.trim();if(l.includes("%")){const r=Number.parseFloat(l.replace("%",""));return Number.isNaN(r)?n:t.chartWidth*(r/100)}const a=Number.parseFloat(l);return Number.isNaN(a)?n:a}return i}getStepMinMax(t,n){return this.labelStyle.alignToGridLine?t:n!=null&&n.use?(bl.has(this.labels)||bl.set(this.labels,A.getStringMinMax(this.labels)),bl.get(this.labels)):A.getStringMinMax(this.labels)}calculateScaleRange(t,n,i){const s=this.getStepMinMax(t,n);let l=s.max,a=s.min,r=0,c=this.labels.length-1,d=this.labels.length;const h=n!=null&&n.use?n==null?void 0:n.range:this.range;if(Array.isArray(h)&&(h!=null&&h.length)){const[m,f]=h;Re(m)&&Re(f)&&(r=m<r?r:m,c=f>c?c:f,l=this.labels[c],a=this.labels[r],d=c-r+1)}else if(typeof h=="function"){const[m,f]=h(a,l);r=m<r?r:m,c=f>c?c:f,l=this.labels[c],a=this.labels[r],d=c-r+1}const u=this.getMaxWidth(i,i.chartWidth/(d+2));return{min:a,max:l,minIndex:r,maxIndex:c,minLabel:this.getLabelFormat(a,u),maxLabel:this.getLabelFormat(l,u),size:A.calcTextSizeCanvas(this.getLabelFormat(l,u),A.getLabelStyle(this.labelStyle))}}getIndexInterval(t){const n=t.maxSteps;return this.interval?this.interval:Math.ceil(this.labels.length/n)}calculateSteps(t){const{minValue:n,maxValue:i,minIndex:s,maxIndex:l}=t,a=l-s+1;let r=1;const c=this.labels.every(d=>!isNaN(d));return this.labelStyle.alignToGridLine&&c&&(r=this.getIndexInterval(t)),{oriSteps:a,steps:a,indexInterval:r,graphMin:n,graphMax:i,minIndex:s,maxIndex:l}}draw(t,n,i,s,l){var b,k,L,w,M,V,S,x,I;const a=this.ctx,r=this.labels,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=i.steps,h=i.indexInterval,u=i.minIndex,m=c[this.units.rectStart],f=c[this.units.rectEnd],g=c[this.units.rectOffset(this.position)],p=c[this.units.rectOffsetCounter(this.position)],y=this.getMaxWidth(t,t.chartWidth/(d+2)),C=5;if(this.drawAxisTitle(t,n),(b=this.labelStyle)!=null&&b.show){a.font=A.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const T=A.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(m,g+T),a.lineTo(f,g+T)):(a.moveTo(g+T,m),a.lineTo(g+T,f)),a.stroke(),d===0)return;const v=(f-m)/d,E=this.labelStyle.alignToGridLine;let Z=null,W=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let R,X,G;for(G=0;G<d;G+=h){const N=u+G,P=this.labels[N];Z=Math.round(m+v*G),W=Z+T,R=this.getLabelFormat(P,y);const{selectLabel:B,selectItem:H,horizontal:D}=this.options;let Y;l!=null&&l.targetAxis?Y=(l==null?void 0:l.targetAxis)==="yAxis"?"y":"x":Y=D?"y":"x";const F=(B==null?void 0:B.use)&&(B==null?void 0:B.useLabelOpacity)&&Y===this.type&&((k=l==null?void 0:l.dataIndex)==null?void 0:k.length)&&!((L=l==null?void 0:l.dataIndex)!=null&&L.includes(N));let O;G===d-1&&this.lastLabelFontStyle?(a.font=A.getLabelStyle(this.lastLabelFontStyle),O=this.lastLabelFontStyle.color):G===0&&this.firstLabelFontStyle?(a.font=A.getLabelStyle(this.firstLabelFontStyle),O=this.firstLabelFontStyle.color):(a.font=A.getLabelStyle(this.labelStyle),O=this.labelStyle.color);let z=1;if(A.getColorStringType(O)==="RGBA"&&(z=A.getOpacity(O)),a.fillStyle=A.colorStringToRgba(O,F?(w=this.options)==null?void 0:w.unSelectedOpacity:z),this.type==="x"){X=this.position==="top"?g-10:g+10;const j=E?Z:Z+v/2;if(a.fillText(this.checkFixWidth(R),j,X),!F&&(H!=null&&H.showLabelTip)&&(s!=null&&s.label)&&!D){const U=s.label;if(U===R){const Q=Math.round(a.measureText((M=this.labelStyle)==null?void 0:M.fontSize).width);A.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(U).width)+10,height:Q,x:Z+v/2,y:X+(Q-2),borderRadius:2,arrowSize:3,text:R,backgroundColor:(V=H==null?void 0:H.labelTipStyle)==null?void 0:V.backgroundColor,textColor:(S=H==null?void 0:H.labelTipStyle)==null?void 0:S.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(Z+v/2,g),a.lineTo(Z+v/2,g+C),a.stroke(),a.closePath()),G>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(W,g),a.lineTo(W,p),a.stroke(),a.closePath())}else{X=this.position==="left"?g-10:g+10;const j=E?Z:Z+v/2;a.fillText(this.checkFixWidth(R),X,j),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),j),a.lineTo(g-C,j),a.stroke(),a.closePath()),G>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(g,W),a.lineTo(p,W),a.stroke(),a.closePath())}a.stroke()}if(this.showLastLabel){const N=u+d-1;if(u+Math.floor((d-1)/h)*h!==N){const B=Math.round(m+v*(d-1)),H=E?B:B+v/2,D=this.getLabelFormat(r[N],y);a.font=this.lastLabelFontStyle?A.getLabelStyle(this.lastLabelFontStyle):A.getLabelStyle(this.labelStyle),a.fillStyle=this.lastLabelFontStyle?this.lastLabelFontStyle.color:this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(D),H,X):a.fillText(this.checkFixWidth(D),X,H),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(H,g),a.lineTo(H,g+C)):(a.moveTo(g+(this.axisLineWidth??1),H),a.lineTo(g-C,H)),a.stroke(),a.closePath())}}if(E&&!this.showLastLabel){const N=lS(+r[1],+r[0]),P=nl(+r[r.length-1],N);if(isNaN(P))return;Z=Math.round(m+v*this.labels.length),W=Z+T;const B=this.getLabelFormat(`${P}`,y),H=Z+v/2;a.font=A.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(B),Z,X):a.fillText(this.checkFixWidth(B),X,Z),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(H,g),a.lineTo(H,g+C)):(a.moveTo(g+(this.axisLineWidth??1),W),a.lineTo(g-C,W)),a.stroke(),a.closePath())}a.closePath()}((x=this.plotBands)!=null&&x.length||(I=this.plotLines)!=null&&I.length)&&(this._plotGeom={aPos:c,startPoint:m,endPoint:f,chartRect:t,aliasPixel:A.aliasPixel(a.lineWidth)})}drawPlots(){var g,p,y,C;if(!((g=this.plotBands)!=null&&g.length||(p=this.plotLines)!=null&&p.length)||!this._plotGeom)return;const t=this.labels,{aPos:n,startPoint:i,endPoint:s,chartRect:l,aliasPixel:a}=this._plotGeom,r=a+1,c=n.x1+r,d=n.x2,h=n.y1+r,u=n.y2,m=(s-i)/(this.labelStyle.show?t.length:1),f={minX:c,maxX:d,minY:h,maxY:u};this.plotLabelHitRegions=[],(y=this.plotBands)==null||y.forEach(b=>{if(A.isNullOrUndefined(b.from)&&A.isNullOrUndefined(b.to))return;const k=Pe({},b,ml),{from:L=0,to:w=t.length,label:M,border:V}=k,S=Math.round(i+m*L),x=Math.round(i+m*w);this.setPlotBandStyle(k),this.type==="x"?this.drawXPlotBand(S,x,c,d,h,u,V):this.drawYPlotBand(S,x,c,d,h,u,V),this.drawPlotBandLabel(S,x,M,f,l,L,w)}),(C=this.plotLines)==null||C.forEach(b=>{if(A.isNullOrUndefined(b.value))return;const k=Pe({},b,fl),{value:L,label:w}=k,M=Math.round(i+m*L)+m/2;this.setPlotLineStyle(k),this.type==="x"?this.drawXPlotLine(M,c,d,h,u):this.drawYPlotLine(M,c,d,h,u),this.drawPlotLineLabel(M,w,f,l,L)})}getLabelFormat(t,n,i={}){if(this.formatter){const s=this.formatter(t,i);if(typeof s=="string")return s}return this.labelStyle.fitWidth?this.fittingString(t,n):t}fittingString(t,n){const i=this.ctx;i.save(),i.font=A.getLabelStyle(this.labelStyle);const s=this.labelStyle.fitDir;return A.truncateLabelWithEllipsis(t,n,i,s)}getLabelWidthHasMaxLength(t,n,i=[]){const s=A.getLabelStyle(this.labelStyle),l=(t==null?void 0:t.length)??0,a=this.getMaxWidth(n,(n==null?void 0:n.chartWidth)/(l+2));return[...(t??[]).map(d=>this.getLabelFormat(d,a)),...i].reduce((d,h)=>{var m;const u=((m=A.calcTextSizeCanvas(h,s))==null?void 0:m.width)??0;return Math.max(d,u)},0)}}class I1 extends Ii{constructor(t,n,i,s,l){super(t,n,i),this.labels=s,this.options=l}getLabelFormat(t,n={}){if(this.formatter){const i=this.formatter(t,n);if(typeof i=="string")return i}return We(t).format(this.timeFormat)}calculateScaleRange(t,n,i){const s=super.calculateScaleRange(t,n,i),l=this.labels;if(!(l!=null&&l.length))return{...s,minIndex:0,maxIndex:-1};let a=0,r=l.length-1;const{min:c,max:d}=s;if(Number.isFinite(c)&&Number.isFinite(d)){const h=l.findIndex(m=>m>=c);let u=-1;for(let m=l.length-1;m>=0;m-=1)if(l[m]<=d){u=m;break}h===-1||u===-1||u<h?(a=0,r=-1):(a=h,r=u)}else{const h=n!=null&&n.use?n==null?void 0:n.range:this.range;h!=null&&console.warn("[EVUI][TimeCategoryScale] axis range가 유효한 min/max 숫자로 해석되지 않아 전체 라벨 범위로 폴백합니다. range 설정을 확인하세요:",h)}return{...s,minIndex:a,maxIndex:r}}getInterval(t){const n=t.maxValue,i=t.minValue,s=t.maxSteps;if(this.interval){if(typeof this.interval=="string")return Tt[this.interval].size;if(typeof this.interval=="object")return this.interval.time*Tt[this.interval.unit].size;if(typeof this.interval=="number")return this.interval}return Math.ceil((n-i)/s)}calculateSteps(t){const{maxValue:n,minValue:i,maxSteps:s,minIndex:l,maxIndex:a}=t,r=this.getInterval(t);let c=r,d=i,h;for(;d<n;)d+=c;const u=d>n?n:d,m=i,f=u-m;h=Math.round(f/c)+1;const g=h;for(n===1&&(c=.2,h=5);h>s;)c*=2,h=Math.round(f/c),c=Math.ceil(f/h);return u-m>h*c&&(c=Math.ceil((u-m)/h)),{steps:h,oriSteps:g,interval:c,rawInterval:r,graphMin:m,graphMax:u,minIndex:l,maxIndex:a}}draw(t,n,i,s,l){var Z,W,R,X,G,N,P,B,H,D,Y,F,O,z,j,U;const a=this.ctx,r=this.labels,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=i.steps,h=i.graphMin,u=i.graphMax,m=i.rawInterval,f=i.oriSteps;let g=c[this.units.rectStart];const p=c[this.units.rectEnd],y=c[this.units.rectOffset(this.position)],C=c[this.units.rectOffsetCounter(this.position)],b=5;this.drawAxisTitle(t,n),a.font=A.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const k=A.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(g,y+k),a.lineTo(p,y+k)):(a.moveTo(y+k,g),a.lineTo(y+k,p)),a.stroke(),a.closePath(),d===0||h===null)return;const L=this.labelStyle.alignToGridLine,w=(p-g)/(f||1);this.categoryMode&&!L&&(g+=Math.ceil(w/2)-2);const M=[];let V=null,S=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let x,I,T;const v=d<=2?Math.max(1,f-1):Math.round(f/d),E=v===f?f:f-1;for(T=0;T<=E;T+=v){M[T]=We(h).valueOf()+T*m,V=Math.round(g+w*T),S=V+k;let Q;for(let ee=0;ee<M.length;ee++)M[ee]!==void 0&&ee!==T&&(Q=M[ee]);x=this.getLabelFormat(Math.min(u,M[T]),{prev:Q});const J=((W=(Z=this.options)==null?void 0:Z.selectLabel)==null?void 0:W.use)&&((X=(R=this.options)==null?void 0:R.selectLabel)==null?void 0:X.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((G=l==null?void 0:l.dataIndex)==null?void 0:G.length)&&!(l!=null&&l.label.map(ee=>this.getLabelFormat(Math.min(u,ee),{prev:Q})).includes(x)),ne=this.labelStyle.color;let q=1;if(A.getColorStringType(ne)==="RGBA"&&(q=A.getOpacity(ne)),a.fillStyle=A.colorStringToRgba(ne,J?(N=this.options)==null?void 0:N.unSelectedOpacity:q),this.type==="x"){if(I=this.position==="top"?y-10:y+10,a.fillText(this.checkFixWidth(x),V,I),!J&&((B=(P=this.options)==null?void 0:P.selectItem)!=null&&B.showLabelTip)&&(s!=null&&s.label)&&!((H=this.options)!=null&&H.horizontal)){const ee=this.getLabelFormat(Math.min(u,s.label+0*m));if(ee===x){const $=Math.round(a.measureText((D=this.labelStyle)==null?void 0:D.fontSize).width);A.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(ee).width)+10,height:$,x:V,y:I+($-2),borderRadius:2,arrowSize:3,text:x,backgroundColor:(O=(F=(Y=this.options)==null?void 0:Y.selectItem)==null?void 0:F.labelTipStyle)==null?void 0:O.backgroundColor,textColor:(U=(j=(z=this.options)==null?void 0:z.selectItem)==null?void 0:j.labelTipStyle)==null?void 0:U.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(S,y),a.lineTo(S,y+b),a.stroke(),a.closePath()),T<f&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(S,y),a.lineTo(S,C),a.stroke(),a.closePath())}else I=this.position==="left"?y-10:y+10,a.fillText(this.checkFixWidth(x),I,V),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(y+(this.axisLineWidth??1),S),a.lineTo(y-b,S),a.stroke(),a.closePath()),T<f&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(y,S),a.lineTo(C,S),a.stroke(),a.closePath());a.stroke()}if(this.categoryMode&&L&&T*v===f){const Q=We(r[1]).diff(We(r[0])),J=this.getLabelFormat(We(M[f-1]+Q));V=Math.round(g+w*f),S=V+k,this.type==="x"?(a.fillText(this.checkFixWidth(J),V,I),this.showGrid&&(a.moveTo(S,y),a.lineTo(S,C))):(a.fillText(this.checkFixWidth(J),I,V),this.showGrid&&(a.moveTo(y,S),a.lineTo(C,S))),a.stroke()}a.closePath()}}const T1={createTitle(){this.titleDOM=document.createElement("div"),this.titleDOM.className="ev-chart-title",this.wrapperDOM.appendChild(this.titleDOM)},initTitle(){this.isInitTitle||this.createTitle(),this.updateTitle(),this.isInitTitle=!0},showTitle(){this.titleDOM.style.display="block",this.wrapperDOM.style.paddingTop=`${this.options.title.height}px`},hideTitle(){this.titleDOM.style.display="none",this.wrapperDOM.style.paddingTop="0px"},updateTitle(){const e=this.options.title;Object.keys(e.style).forEach(t=>{this.titleDOM.style[t]=e.style[t]}),this.titleDOM.textContent=e.text,this.titleDOM.style.height=`${e.height}px`,this.titleDOM.style.lineHeight=`${e.height}px`}},L1={createLegendLayout(){var e,t;this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",(t=(e=this.options)==null?void 0:e.legend)!=null&&t.allowResize&&(this.resizeDOM=document.createElement("div"),this.resizeDOM.className="ev-chart-resize-bar",this.ghostDOM=document.createElement("div"),this.ghostDOM.className="ev-chart-resize-ghost",this.wrapperDOM.appendChild(this.resizeDOM)),this.useTable?(this.legendTableDOM=document.createElement("table"),this.legendTableDOM.className="ev-chart-legend--table",this.setLegendColumnHeader(),this.legendBoxDOM.appendChild(this.legendTableDOM),this.legendDOM.style.overflow="auto"):(this.legendBoxDOM.style.overflowX="hidden",this.legendBoxDOM.style.overflowY="auto",this.legendBoxDOM.style.height="100%"),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM),this.options.legend.virtualScroll&&!this.useTable&&(this.legendTopSpacer=document.createElement("div"),this.legendTopSpacer.className="ev-chart-legend--top-spacer",this.legendTopSpacer.style.clear="both",this.legendTopSpacer.style.opacity=0,this.legendBottomSpacer=document.createElement("div"),this.legendBottomSpacer.className="ev-chart-legend--bottom-spacer",this.legendBottomSpacer.style.clear="both",this.legendBottomSpacer.style.opacity=0,this.legendBoxDOM.appendChild(this.legendTopSpacer),this.legendBoxDOM.appendChild(this.legendBottomSpacer),this.updateVisibleRowCountFrameId=requestAnimationFrame(()=>{this.updateVisibleRowCount()}))},setLegendColumnHeader(){var i;const e=(i=this.options.legend)==null?void 0:i.table,t=e.columns;["color",...Object.keys(t)].forEach(s=>{var a,r;const l=document.createElement("th");if(l.className="ev-chart-legend--table__column-name",(a=t[s])!=null&&a.use||s==="color"||s==="name"){const c=t[s],d=(c==null?void 0:c.title)??"";l.textContent=d,l.setAttribute("title",d),l.dataset.type=d,A.setDOMStyle(l,(r=e==null?void 0:e.style)==null?void 0:r.header),this.legendTableDOM.append(l)}})},initLegend(){var e,t;this.isHeatMapType=this.options.type==="heatMap",this.useTable=!!((t=(e=this.options.legend)==null?void 0:e.table)!=null&&t.use)&&this.options.type!=="heatmap"&&this.options.type!=="scatter",this.legendItemHeight=18,this.isInitLegend||this.createLegendLayout(),this.isHeatMapType?(this.initEventForColorLegend(),this.addColorLegendList()):(this.initEvent(),this.addLegendList()),this.initResizeEvent(),this.isInitLegend=!0,this.isLegendMove=!1},updateVisibleRowCount(){const e=this.options.legend.position==="right"||this.options.legend.position==="left",t=this.legendBoxDOM.clientHeight,n=this.legendBoxDOM.clientWidth,i=Math.max(this.options.legend.width-8,1),s=Object.values(this.seriesList).filter(l=>l.showLegend!==!1).length;this.itemsPerRow=e?1:Math.floor(n/i),this.totalRowCount=Math.ceil(s/this.itemsPerRow),this.visibleRowCount=t>this.legendItemHeight?Math.round(t/this.legendItemHeight)+1:this.totalRowCount},updateStartEndRowIndex(){var t;const e=Math.max(Math.floor(((t=this.legendBoxDOM)==null?void 0:t.scrollTop)/this.legendItemHeight),0);this.startRowIndex=Math.min(e,Math.max(this.totalRowCount-this.visibleRowCount,0)),this.endRowIndex=this.startRowIndex+this.visibleRowCount+1},renderVisibleLegends(){this.updateStartEndRowIndex();const e=this.legendBoxDOM.querySelectorAll(".ev-chart-legend-container");if(e&&e.length)for(const c of e)c.remove();const t=this.totalRowCount*this.legendItemHeight,n=this.startRowIndex*this.legendItemHeight,i=Math.max(t-this.visibleRowCount*this.legendItemHeight-n,0);this.legendTopSpacer.style.height=`${n}px`,this.legendBottomSpacer.style.height=`${i}px`;const s=this.startRowIndex*this.itemsPerRow,l=this.endRowIndex*this.itemsPerRow,a=this.data.groups.at(0);let r=[];if(a?r=a.filter(c=>this.seriesList[c].showLegend).map(c=>[c,this.seriesList[c]]):r=Object.entries(this.seriesList).filter(([,c])=>c.showLegend),r&&r.length)for(let c=s;c<l&&c<r.length;c++){const[,d]=r[c];this.addLegend(d)}},addLegendList(){const{groups:e}=this.data,{seriesList:t}=this;this.options.legend.virtualScroll&&!this.useTable?this.renderVisibleLegendsFrameId=requestAnimationFrame(()=>{this.renderVisibleLegends()}):(this.addLegendForGroups(e,t,this.useTable),this.addStandaloneLegends(t,this.useTable))},addLegendForGroups(e,t,n){e==null||e.forEach(i=>{i==null||i.forEach(s=>{const l=t[s];l&&l.showLegend&&this.addLegendBasedOnType(l,n)})})},addStandaloneLegends(e,t){Object.values(e).forEach(n=>{!n.isExistGrp&&n.showLegend&&this.addLegendBasedOnType(n,t)})},addLegendBasedOnType(e,t){t?this.addLegendWithValues(e):this.addLegend(e)},addColorLegendList(){const e=this.seriesList;Object.values(e).forEach(t=>{if(!t.isExistGrp&&t.showLegend){const{colorState:n,valueOpt:i}=t,{min:s,max:l,interval:a,existError:r,decimalPoint:c}=i,d=n.length,h=r?d-2:d-1;for(let u=0;u<d;u++){const{id:m,color:f,label:g=""}=n[u],p=s+a*u;let y=p+a;u<h?y-=.1**c:y=l+.1**c;let C=g;if(!C)if(C=`${p.toFixed(c)} - ${y.toFixed(c)}`,s===void 0||l===void 0)if(u===0)C="0";else break;else{if(p>l)break;a<=1&&c===0&&(C=p)}this.addLegend({cId:m,color:f,name:C,show:!0})}}})},getContainerDOM(e){let t=null;const n=e.target.dataset.type;return n==="container"?t=e.target:["name","color","min","max","avg","total","last"].includes(n)&&(t=e.target.parentElement,t!=null&&t.series||(t=t.parentElement)),t},initEvent(){if(this.isInitLegend)return;const e={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`,value:`ev-chart-legend${this.useTable?"--table__value":"-value"}`},t=(l,a)=>{const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=l==null?void 0:l.getElementsByClassName(e.value),h=l==null?void 0:l.series;if(r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a,d&&d.length)for(const u of d)u.style.color=a;h.show=!1,l.dataset.inactive=!0},n=(l,a)=>{var m,f;let r;const c=l==null?void 0:l.getElementsByClassName(e.color)[0],d=l==null?void 0:l.getElementsByClassName(e.name)[0],h=l==null?void 0:l.getElementsByClassName(e.value),u=l==null?void 0:l.series;if(typeof u.color!="string"?r=u.color[u.color.length-1][1]:r=u.color,u.type==="line"&&u.fill?(c.style.height="8px",c.style.backgroundColor=A.rgbaAdjustHalfOpacity(r),c.style.border=`1px solid ${r}`):c.style.backgroundColor=r,d.style.color=a,h&&h.length)for(const g of h){const p=(f=(m=this.options.legend.table)==null?void 0:m.columns[g.dataset.type])==null?void 0:f.style;g.style.color=p!=null&&p.color?p.color:a}u.show=!0,l.dataset.inactive=!1},i=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!1})},s=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!0})};this.onLegendBoxClick=l=>{var y;const{legend:a}=this.options;if(a!=null&&a.stopClickEvt)return;const{chartIdx:r}=this.data,c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(e.color)[0],h=c==null?void 0:c.getElementsByClassName(e.name)[0],u=(c==null?void 0:c.dataset.inactive)==="false";if(!d||!h)return;if(a.clickMode==="active"){const C=Array.from(this.legendBoxDOM.getElementsByClassName(e.container));C.every(L=>L.dataset.inactive==="false")?(C.forEach(L=>{t(L,a.inactive)}),i(),n(c,a.color),this.seriesInfo.count=1):u?(t(c,a.inactive),this.seriesInfo.count--):u||(n(c,a.color),this.seriesInfo.count++),C.every(L=>L.dataset.inactive==="true")&&(C.forEach(L=>{n(L,a.color)}),s(),this.seriesInfo.count=C.length)}if(a.clickMode!=="active"){if(u&&this.seriesInfo.count===1)return;u?(t(c,a.inactive),this.seriesInfo.count--):(n(c,a.color),this.seriesInfo.count++)}if(this.brushSeries){const C=[...this.brushSeries.list];C[r]=this.seriesList,this.brushSeries.list=C,this.brushSeries.chartIdx=r}((y=this.options.eventBehavior)==null?void 0:y.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const f=Object.values(this.seriesList).filter(C=>C.show).map(C=>C.sId),g=f.length===Object.values(this.seriesList).length,p={e:l,data:{seriesIds:g?[]:f,isActiveAll:g}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](p)},this.onLegendBoxLeave=()=>{this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})},this.onLegendBoxOver=l=>{var d;const a=this.getContainerDOM(l);if(!a){this.onLegendBoxLeave();return}const c={sId:(d=a==null?void 0:a.series)==null?void 0:d.sId,type:this.options.type};this.legendHover=c,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:c},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.addEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.addEventListener("scroll",this.renderVisibleLegends.bind(this))),this.initResizeEvent()},initEventForColorLegend(){if(this.isInitLegend)return;const e={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`},t=(l,a)=>{var m;const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=Object.values(this.seriesList)[0],h=(m=l==null?void 0:l.series)==null?void 0:m.cId;r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a;const u=d.colorState.findIndex(f=>f.id===h);u>-1&&(d.colorState[u].show=!1),l.dataset.inactive=!0},n=(l,a)=>{var m,f;const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=Object.values(this.seriesList)[0],h=(m=l==null?void 0:l.series)==null?void 0:m.cId;r.style.backgroundColor=(f=l==null?void 0:l.series)==null?void 0:f.color,c.style.color=a;const u=d.colorState.findIndex(g=>g.id===h);u>-1&&(d.colorState[u].show=!0),l.dataset.inactive=!1},i=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!1})},s=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!0})};this.onLegendBoxClick=l=>{var C;const a=this.options.legend;if(a!=null&&a.stopClickEvt)return;const r=Object.values(this.seriesList)[0],c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(e.color)[0],h=c==null?void 0:c.getElementsByClassName(e.name)[0],u=(c==null?void 0:c.dataset.inactive)==="false",m=r.colorState.filter(b=>b.show).length;if(!d||!h)return;if(a.clickMode==="active"){const b=Array.from(this.legendBoxDOM.getElementsByClassName(e.container));b.every(w=>w.dataset.inactive==="false")?(b.forEach(w=>{t(w,a.inactive)}),i(),n(c,a.color)):u?t(c,a.inactive):u||n(c,a.color),b.every(w=>w.dataset.inactive==="true")&&(b.forEach(w=>{n(w,a.color)}),s())}if(a.clickMode!=="active"){if(u&&m===1)return;u?t(c,a.inactive):n(c,a.color)}((C=this.options.eventBehavior)==null?void 0:C.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const f=r.colorState.filter(b=>b.show),g=f.map(b=>+b.id.split("#")[1]),p=r.colorState.length===f.length,y={e:l,data:{seriesIndices:p?[]:g,isActiveAll:p}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](y)},this.onLegendBoxLeave=()=>{this.legendHover=null,Object.values(this.seriesList)[0].colorState.forEach(a=>{a.state="normal"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:!0})},this.onLegendBoxOver=l=>{var h,u;const a=(h=Object.values(this.seriesList))==null?void 0:h[0],r=this.getContainerDOM(l);if(!r){this.onLegendBoxLeave();return}const c=(u=r==null?void 0:r.series)==null?void 0:u.cId,d={sId:c,type:this.options.type};this.legendHover=d,a.colorState.forEach(m=>{m.state=m.id===c?"highlight":"downplay"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:d},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.initResizeEvent()},initResizeEvent(){this.onResizeMouseDown=e=>{e.stopPropagation(),e.preventDefault();const t=this.options,n=t.legend.position,i=t.title.show?t.title.height:0,s=this.ghostDOM;this.resizeDOM.style.display="none",this.wrapperDOM.appendChild(s),n==="left"||n==="right"?(s.style.top=`${i}px`,s.style.left=this.resizeDOM.style.left,s.style.right=this.resizeDOM.style.right,s.style.height=this.resizeDOM.style.height):(s.classList.add("horizontal"),n==="top"?s.style.top=this.resizeDOM.style.top:n==="bottom"&&(s.style.bottom=this.resizeDOM.style.bottom)),this.wrapperDOM.addEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.addEventListener("mouseup",this.mouseUp,!1)},this.resizeDOM&&(this.resizeDOM.addEventListener("mousedown",this.onResizeMouseDown),this.mouseMove=this.onMouseMove.bind(this),this.mouseUp=this.onMouseUp.bind(this))},updateLegend(){this.resetLegend(),this.isHeatMapType?this.addColorLegendList():this.addLegendList()},updateLegendTableValues(){var i,s,l,a,r;const e=(l=(s=(i=this.options)==null?void 0:i.legend)==null?void 0:s.table)==null?void 0:l.columns,t=this.getAggregations(),n=(a=this.legendBoxDOM)==null?void 0:a.getElementsByClassName("ev-chart-legend--table__row");if(n&&n.length)for(const c of n){const d=c==null?void 0:c.getElementsByClassName("ev-chart-legend--table__value");if(d&&d.length)for(const h of d){const u=h.dataset.type;if(u!=="name"){const m=c.series.sId,f=(r=t==null?void 0:t[m])==null?void 0:r[u];h.textContent=this.getFormattedValue(e[u],f)}}}},forceUpdateLegend(){this.destroyLegend(),this.initLegend()},resetLegend(){var t,n;const e=this.legendBoxDOM;if(e){if(this.useTable){const i=this.legendTableDOM;for(;i.hasChildNodes();)i.removeChild(i.firstChild);this.setLegendColumnHeader()}else if(this.options.legend.virtualScroll)((n=(t=this.legendDOM)==null?void 0:t.style)==null?void 0:n.display)==="none"?this.legendNeedsUpdate=!0:(this.updateVisibleRowCount(),this.renderVisibleLegends());else for(;e.hasChildNodes();)e.removeChild(e.firstChild);this.seriesInfo.count=0}},destroyLegend(){const e=this.legendDOM;this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),e&&(e.remove(),this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.isInitLegend=!1,this.seriesInfo.count=0)},addLegend(e){const t=this.options.legend,n=document.createElement("div"),i=document.createElement("span"),s=document.createElement("div");n.className="ev-chart-legend-container",n.dataset.inactive=!e.show,n.series=e,i.className="ev-chart-legend-color",e.type==="line"&&e.point&&!e.fill&&(i.className+=" ev-chart-legend-color--point-line"),s.className="ev-chart-legend-name";let l;e.show?typeof e.color!="string"?l=e.color[e.color.length-1][1]:l=e.color:l=t.inactive,e.type==="line"&&e.fill?(i.style.height="8px",i.style.backgroundColor=e.show?A.rgbaAdjustHalfOpacity(l):t.inactive,i.style.border=`1px solid ${l}`):i.style.backgroundColor=l,i.dataset.type="color",s.style.color=t.color,s.textContent=e.name,s.setAttribute("title",e.name),s.dataset.type="name",n.appendChild(i),n.appendChild(s),t.position==="top"||t.position==="bottom"?(n.style.width=`${t.width-8}px`,n.style.margin="0 4px"):n.style.width="100%",n.style.height=`${this.legendItemHeight}px`,n.style.display="inline-block",n.style.overflow="hidden",n.dataset.type="container",this.legendBoxDOM.insertBefore(n,this.legendBottomSpacer),e.show&&this.seriesInfo.count++},addLegendWithValues(e){var h,u,m,f,g;const t=this.options.legend,n=(h=t==null?void 0:t.table)==null?void 0:h.columns,i=(u=this.getAggregations())==null?void 0:u[e==null?void 0:e.sId];if(!i||!n)return;const s=document.createElement("tr");s.className="ev-chart-legend--table__row",s.dataset.inactive=!e.show,A.setDOMStyle(s,(f=(m=t.table)==null?void 0:m.style)==null?void 0:f.row),s.series=e,s.dataset.type="container";const l=document.createElement("td");l.className="ev-chart-legend--table__color-wrapper",l.dataset.type="color";const a=document.createElement("div");a.className="ev-chart-legend--table__color",a.dataset.type="color";let r;switch(e.show?typeof e.color!="string"?r=e.color[e.color.length-1][1]:r=e.color:r=t.inactive,e.type){case"line":{e.fill?(a.style.backgroundColor=A.rgbaAdjustHalfOpacity(r),a.style.border=`1px solid ${r}`):(e.point&&(a.className+=" ev-chart-legend--table__color--point-line"),a.className+=" ev-chart-legend--table__color--line",a.style.backgroundColor=r);break}case"bar":case"pie":default:{a.style.height="10px",a.style.backgroundColor=r;break}}e.type==="line"&&e.fill?(a.style.height="8px",a.style.backgroundColor=e.show?A.rgbaAdjustHalfOpacity(r):t.inactive,a.style.border=`1px solid ${r}`):a.style.backgroundColor=r,l.appendChild(a),s.appendChild(l);const c=document.createElement("td");c.className="ev-chart-legend--table__name",c.style.color=e.show?t.color:t.inactive,c.textContent=e.name,c.setAttribute("title",e.name),c.dataset.type="name",A.setDOMStyle(c,(g=n==null?void 0:n.name)==null?void 0:g.style),e.show||(c.style.color=t.inactive),s.appendChild(c);const d=Object.keys(n);d==null||d.forEach(p=>{var y;if(p!=="name"&&n[p].use){const C=this.getFormattedValue(n[p],i[p]),b=document.createElement("td");b.className="ev-chart-legend--table__value",b.style.color=e.show?t.color:t.inactive,b.textContent=C,b.dataset.type=p.toString(),A.setDOMStyle(b,(y=n[p])==null?void 0:y.style),e.show||(b.style.color=t.inactive),s.appendChild(b)}}),this.legendTableDOM.appendChild(s),e.show&&this.seriesInfo.count++},setLegendPosition(){var g,p,y,C,b,k,L,w,M;const e=this.options,t=(g=e==null?void 0:e.legend)==null?void 0:g.position,n=(p=this.wrapperDOM)==null?void 0:p.style,i=(y=this.legendDOM)==null?void 0:y.style,s=(C=this.legendBoxDOM)==null?void 0:C.style,l=(b=this.resizeDOM)==null?void 0:b.style;let a,r;const c=(k=e==null?void 0:e.title)!=null&&k.show?(L=e==null?void 0:e.title)==null?void 0:L.height:0,d=c+((w=e==null?void 0:e.legend)==null?void 0:w.height),{top:h=0,bottom:u=0,left:m=0,right:f=0}=((M=e==null?void 0:e.legend)==null?void 0:M.padding)??{};if(!(!n||!i))switch(s.padding=`${h}px ${f}px ${u}px ${m}px`,t){case"top":n.padding=`${d}px 0 0 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(i.paddingTop)+parseInt(i.paddingBottom),s.width="100%",s.height=`${e.legend.height-r}px`,i.top=`${c}px`,i.right="",i.bottom="",i.left="",i.width=`${a.width}px`,i.height=`${e.legend.height+(l?4:0)}px`,l&&(l.top=`${d}px`,l.right="",l.bottom="",l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"right":n.padding=`${c}px ${e.legend.width}px 0 0`,a=this.chartDOM.getBoundingClientRect(),s.width=`${e.legend.width-10}px`,s.maxHeight=`${a.height}px`,i.paddingLeft="10px",i.top=`${c}px`,i.right="0px",i.bottom="",i.left="",i.width=`${e.legend.width}px`,i.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right=`${e.legend.width}px`,l.bottom="",l.left="",l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break;case"bottom":n.padding=`${c}px 0 ${e.legend.height}px 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(i.paddingTop)+parseInt(i.paddingBottom),s.width="100%",s.height=`${e.legend.height-r}px`,i.top="",i.right="",i.bottom="0px",i.left="0px",i.width=`${a.width}px`,i.height=`${e.legend.height+(l?4:0)}px`,l&&(l.top="",l.right="",l.bottom=`${e.legend.height}px`,l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"left":n.padding=`${c}px 0 0 ${e.legend.width}px`,a=this.chartDOM.getBoundingClientRect(),s.width=`${e.legend.width}px`,s.maxHeight=`${a.height}px`,s.display="absolute",s.bottom="0px",i.top=`${c}px`,i.right="",i.bottom="",i.left="0px",i.width=`${e.legend.width}px`,i.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right="",l.bottom="",l.left=`${e.legend.width}px`,l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break}},updateLegendContainerSize(){var n;if(!this.options||!this.legendBoxDOM)return;const e=(n=this.options)==null?void 0:n.legend,t=this.legendBoxDOM.getElementsByClassName("ev-chart-legend-container");if(t)for(let i=0;i<t.length;i++)e.position==="top"||e.position==="bottom"?(t[i].style.width=`${e.width-8}px`,t[i].style.margin="0 4px"):t[i].style.width="100%"},onMouseMove(e){e.stopPropagation(),e.preventDefault();const t=this.wrapperDOM.getBoundingClientRect(),n=this.wrapperDOM.offsetWidth,i=this.wrapperDOM.offsetHeight,s=this.options.title.show?this.options.title.height:0,l=this.options.legend.position,a=150,r=70,c=120,d=20;let h;switch(l){case"left":h=e.clientX-t.left,h<c?h=c:h>n-a&&(h=n-a),this.ghostDOM.style.left=`${h}px`;break;case"right":h=e.clientX-t.left,h<a?h=a:h>n-c&&(h=n-c),this.ghostDOM.style.left=`${h}px`;break;case"top":h=e.clientY-t.top,h<d+s?h=d+s:h>i-r&&(h=i-r),this.ghostDOM.style.top=`${h}px`;break;case"bottom":h=e.clientY-t.top,h<r+s?h=r+s:h>i-d&&(h=i-d),this.ghostDOM.style.bottom=`${this.wrapperDOM.offsetHeight-h}px`;break}this.isLegendMove=!0},onMouseUp(e){e.stopPropagation(),e.preventDefault(),this.wrapperDOM.removeEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.removeEventListener("mouseup",this.mouseUp,!1);const t=this.options,n=t.legend.position,i=this.resizeDOM.style,s=this.legendDOM.style,l=this.legendBoxDOM.style,a=this.ghostDOM.style,r=this.wrapperDOM.style,c=t.title.show?t.title.height:0,d=+this.legendDOM.style.paddingLeft.replace("px","");let h;if(this.isLegendMove)switch(n){case"top":i.top=a.top,h=+a.top.replace("px",""),s.height=`${h-c}px`,l.height=`${h-c-4}px`,t.legend.height=h-c-4,r.padding=`${h}px 0 0 0`;break;case"right":i.left=a.left,h=+a.left.replace("px",""),s.width=`${this.wrapperDOM.offsetWidth-h-4}px`,l.width=`${this.wrapperDOM.offsetWidth-h-4-d}px`,t.legend.width=this.wrapperDOM.offsetWidth-h-4,r.padding=`${c}px ${this.wrapperDOM.offsetWidth-h}px 0 0`;break;case"bottom":i.bottom=a.bottom,h=this.wrapperDOM.offsetHeight-+a.bottom.replace("px",""),s.height=`${this.wrapperDOM.offsetHeight-h}px`,l.height=`${h-c-4}px`,t.legend.height=this.wrapperDOM.offsetHeight-h,r.padding=`${c}px 0 ${this.wrapperDOM.offsetHeight-h}px 0`;break;case"left":i.left=a.left,h=+a.left.replace("px",""),s.width=`${h}px`,l.width=`${h}px`,t.legend.width=h,r.padding=`${c}px 0 0 ${h-4}px`;break}i.display="block",this.ghostDOM.remove(),this.isLegendMove&&(this.render(),this.isLegendMove=!1)},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block"),this.legendNeedsUpdate&&this.options.legend.virtualScroll&&!this.useTable&&(this.legendNeedsUpdate=!1,this.updateVisibleRowCount(),this.renderVisibleLegends())},hideLegend(){var l,a,r,c,d;const e=this.options,t=(l=this.wrapperDOM)==null?void 0:l.style,n=(a=this.resizeDOM)==null?void 0:a.style,i=(r=this.legendDOM)==null?void 0:r.style,s=(c=e==null?void 0:e.title)!=null&&c.show?(d=e==null?void 0:e.title)==null?void 0:d.height:0;!i||!t||(n&&(n.display="none"),i.display="none",i.width="0",i.height="0",t.padding=`${s}px 0 0 0`)},getFormattedValue({formatter:e,decimalPoint:t},n){if(n==null)return"Null";let i;return e&&(i=e(+n)),(!e||typeof i!="string")&&(i=A.labelSignFormat(+n,t)),i}},Mc=28,M1={width:70,height:60},v1={createLegendLayout(){this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",this.containerDOM=document.createElement("div"),this.containerDOM.className="ev-chart-legend-container",this.legendBoxDOM.appendChild(this.containerDOM),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM)},initLegend(){this.isInitLegend||(this.createLegendLayout(),this.createLegend()),Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)}),this.initEvent(),this.isInitLegend=!0,this.legendDragInfo={dragging:!1,isStart:!0}},initEvent(){this.isInitLegend||(this.onLegendMouseDown=e=>{e.stopPropagation(),e.preventDefault();const t=e.target.dataset.type;let n;if(t==="handle")n=e.target;else if(t==="handle-btn")n=e.target.parentElement;else if(t==="handle-btn-color")n=e.target.parentElement.parentElement;else return;const i=Object.values(this.seriesList);if(!i.length)return;const{colorState:s}=i[0],{start:l,end:a}=s[0];s[0].selectedValue=null,this.clearOverlay(),this.legendDragInfo.dragging=!0,this.legendDragInfo.isStart=l!==a?n.className.includes("start"):this.legendDragInfo.isStart,n.classList.add("dragging"),this.legendBoxDOM.addEventListener("mousemove",this.onLegendMouseMove,!1),this.legendBoxDOM.addEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendMouseMove=e=>{e.stopPropagation(),e.preventDefault();const{dragging:t,isStart:n}=this.legendDragInfo;if(t){let i=this.getSelectedValue(e);i=this.isSide?100-i:i;const s=n?"start":"end",l=Object.values(this.seriesList);if(!l.length)return;const{colorState:a}=l[0],{start:r,end:c}=a[0];if(n&&i>c||!n&&i<r)return;a[0][s]=i,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})}},this.onLegendMouseUp=()=>{this.legendDragInfo.dragging=!1;const e=this.containerDOM.getElementsByClassName("ev-chart-legend-handle dragging")[0];e==null||e.classList.remove("dragging"),this.legendBoxDOM.removeEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendBoxOver=e=>{const t=e.target.dataset.type,n=Object.values(this.seriesList);if(!n.length)return;const{colorState:i,valueOpt:s}=n[0],l=i[0];let a=this.getSelectedValue(e);if(a=this.isSide?100-a:a,["line","thumb","layer","overlay","overlay-item"].includes(t))if(l.start<=a&&a<=l.end)l.selectedValue=a,this.createLegendOverlay(a,s);else return;else if(["handle","handle-btn","handle-btn-color"].includes(t)){const r=e.target.className.includes("start");l.selectedValue=r?l.start:l.end,this.clearOverlay()}else return;this.legendHover={sId:"gradient",type:this.options.type},this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.onLegendBoxLeave=()=>{this.legendDragInfo.dragging=!1,this.legendHover=null,this.clearOverlay();const e=Object.values(this.seriesList);if(!e.length)return;const{colorState:t}=e[0];t[0].selectedValue=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.legendBoxDOM.addEventListener("mousedown",this.onLegendMouseDown),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave))},getSelectedValue(e){const{x:t,y:n,width:i,height:s}=this.containerDOM.getBoundingClientRect(),l=!this.isSide,a=l?t:n,r=l?i:s;let c=l?e.clientX:e.clientY;c<a?c=a:c>a+r&&(c=a+r);const d=c-a;return+qe(d,r)},updateLegend(){this.resetLegend(),this.createLegend(),Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)})},resetLegend(){const e=this.containerDOM;if(e)for(;e.hasChildNodes();)e.removeChild(e.firstChild)},clearOverlay(){const e=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],t=e==null?void 0:e.getElementsByClassName("ev-chart-legend-overlay")[0];if(t){e.removeChild(t);const i=e.getElementsByClassName("ev-chart-legend-thumb")[0].children;if(i&&i.length)for(const s of i)s.style.opacity=1}},createLegendOverlay(e,t){this.clearOverlay();const n=this.legendHandleSize,{min:i,max:s}=t;if(i===void 0||s===void 0)return;const l=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],a=document.createElement("div");a.className="ev-chart-legend-overlay",a.dataset.type="overlay";const r=document.createElement("div");r.className="ev-chart-legend-overlay-tooltip",r.innerText=Math.floor(i+(s-i)*(e/100));const c=document.createElement("span");c.className="ev-chart-legend-overlay-item",c.dataset.type="overlay-item";let d,h;const u=Math.floor(n/2)+14;this.isSide?(h=`top:${100-e}%;left:${u}px;transform:translateY(-50%);`,d=`top:${100-e}%;transform:translateY(-50%);`):(h=`top:-${u}px;left:${e}%;transform:translateX(-50%);`,d=`left:${e}%;transform:translateX(-50%);`),d+=`width:${n-10}px;height:${n-10}px;`,r.style.cssText=h,c.style.cssText=d,a.appendChild(r),a.appendChild(c),l==null||l.appendChild(a);const m=l==null?void 0:l.getElementsByClassName("ev-chart-legend-thumb")[0];if(m){const f=m.children;if(f&&f.length)for(const g of f)g.style.opacity=.2}},createLegendHandle(e){const t=document.createElement("span");t.className=`ev-chart-legend-handle-btn-color ${e}`,t.dataset.type="handle-btn-color";const n=document.createElement("div");n.className=`ev-chart-legend-handle-btn ${e}`,n.dataset.type="handle-btn",n.appendChild(t);const i=document.createElement("div");return i.className=`ev-chart-legend-handle ${e}`,i.dataset.type="handle",i.appendChild(n),i},createLegendLabel(){const e=document.createElement("span");e.className="ev-chart-legend-label-text";const t=document.createElement("div");return t.className="ev-chart-legend-label",t},createLegend(){if(!Object.values(this.seriesList).length)return;const e=this.options.legend;this.isSide=!["top","bottom"].includes(e.position);const t=this.isSide?e.width:e.height;this.legendHandleSize=t>Mc?Mc:t;const n=this.legendHandleSize,i=this.createLegendHandle(this.isSide?"end":"start",n),s=this.createLegendHandle(this.isSide?"start":"end",n),l=document.createElement("div");l.className="ev-chart-legend-line-layer",l.dataset.type="line-layer";const a=document.createElement("div");a.className="ev-chart-legend-thumb",a.dataset.type="thumb",a.appendChild(this.createLegendLabel()),a.appendChild(this.createLegendLabel());const r=document.createElement("div");r.className="ev-chart-legend-line",r.dataset.type="line",r.appendChild(l),r.appendChild(a),this.containerDOM.appendChild(r),this.containerDOM.appendChild(i),this.containerDOM.appendChild(s)},setLegendStyle(e){const t=this.isSide?"top":"right",n=this.legendHandleSize,{valueOpt:i,colorState:s}=e,{min:l,max:a,decimalPoint:r}=i,{start:c,end:d}=s[0],h=e.getColorForGradient(c),u=e.getColorForGradient(d);let m=`linear-gradient(to ${t}, `;m+=`${h}, ${u})`;const f=Math.floor(n/2)+14;let g=`width:${n}px;height:${n}px;`,p,y,C,b=`background:${m};`;this.isSide?(g+=`margin-top:-${n/2}px;`,p=`left:${f}px;transform:translateY(-50%);top:`,y=`top:${100-d}%;`,C=`top:${100-c}%;`,b+=`top:${100-d}%;height:${d-c}%;`):(g+=`margin-left:-${n/2}px;`,p=`top:-${f}px;transform:translateX(-50%);left:`,y=`left:${c}%;`,C=`left:${d}%;`,b+=`left:${c}%;width:${d-c}%;`);const k=(l+(a-l)*(c/100)).toFixed(r),L=(l+(a-l)*(d/100)).toFixed(r),w=this.containerDOM.getElementsByClassName("ev-chart-legend-thumb")[0];w.style.cssText=b;const M=w.getElementsByClassName("ev-chart-legend-label");M[0].style.cssText=`${p}0%;`,M[1].style.cssText=`${p}100%;`,l!==void 0&&a!==void 0&&(M[0].innerText=this.isSide?L:k,M[1].innerText=this.isSide?k:L);const V=this.containerDOM.getElementsByClassName("ev-chart-legend-handle");V[0].style.cssText=g+y,V[1].style.cssText=g+C;const S=this.containerDOM.getElementsByClassName("ev-chart-legend-handle-btn-color");S[0].style.backgroundColor=this.isSide?u:h,S[1].style.backgroundColor=this.isSide?h:u},setLegendPosition(){var y,C,b,k;const e=this.options,t=(y=e==null?void 0:e.legend)==null?void 0:y.position,{width:n,height:i}=M1,s=this.legendHandleSize,l=(C=e==null?void 0:e.title)!=null&&C.show?(b=e==null?void 0:e.title)==null?void 0:b.height:0,a=l+i,{top:r=0,bottom:c=0,left:d=0,right:h=0}=((k=e==null?void 0:e.legend)==null?void 0:k.padding)??{},u=this.wrapperDOM.style;if(!u)return;let m,f,g,p;switch(t){case"top":u.padding=`${a}px 0 0 0`,p=this.chartDOM.getBoundingClientRect(),f=`padding:${s+7}px ${h}px ${c}px ${d}px;`,f+="width:100%",f+=`height${i}px;`,m=`width:${p.width}px;`,m+=`height:${i}px;`,m+=`top:${l}px;`;break;case"right":u.padding=`${l}px ${n}px 0 0`,p=this.chartDOM.getBoundingClientRect(),f=`padding:${r}px ${h}px ${c}px ${d}px;`,f+=`width:${n}px;`,f+="height:100%;",f+=`max-height:${p.height}px;`,m=`width:${n}px;`,m+=`height:${p.height}px;`,m+=`top:${l}px;right:0px;`;break;case"bottom":u.padding=`${l}px 0 ${i}px 0`,p=this.chartDOM.getBoundingClientRect(),f=`padding:${s+7}px ${h}px ${c}px ${d}px;`,f+="width:100%;",f+=`height:${i}px;`,m=`width:${p.width}px;`,m+=`height:${i}px;`,m+="bottom:0px;left:0px;";break;case"left":u.padding=`${l}px 0 0 ${n}px`,p=this.chartDOM.getBoundingClientRect(),f=`padding:${r}px ${h}px ${c}px ${d}px;`,f+="display:absolute;",f+="bottom:0px;",f+=`width:${n}px;`,f+="height:100%;",f+=`maxHeight:${p.height}px;`,m=`width:${n}px;`,m+=`height:${p.height}px;`,m+=`top:${l}px;left:0px`;break}if(["top","bottom"].includes(t)){const L=p.width/2;g=`left:${p.width/2-L/2}px;`,g+=`width:${L}px;`,g+=`height:${s}px;`,g+="padding:4px 0;",g+="margin:0 4px;"}else{const L=p.height/2;g=`top:${p.height/2-L/2}px;`,g+="left:5px;",g+=`width:${s}px;`,g+=`height:${L}px;`,g+="padding:0 4px;",g+="margin:4px 0;"}this.containerDOM.style.cssText=g,this.legendBoxDOM.style.cssText=f,this.legendDOM.style.cssText=m},updateLegendContainerSize(){Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)})},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block")},hideLegend(){var s,l,a,r;const e=this.options,t=(s=this.wrapperDOM)==null?void 0:s.style,n=(l=this.legendDOM)==null?void 0:l.style,i=(a=e==null?void 0:e.title)!=null&&a.show?(r=e==null?void 0:e.title)==null?void 0:r.height:0;!n||!t||(n.display="none",n.width="0",n.height="0",t.padding=`${i}px 0 0 0`)}},R1={initScrollbar(){var e,t,n,i,s,l;(n=(t=(e=this.options.axesX)==null?void 0:e[0])==null?void 0:t.scrollbar)!=null&&n.use&&this.initScrollbarInfo(this.options.axesX,"x"),(l=(s=(i=this.options.axesY)==null?void 0:i[0])==null?void 0:s.scrollbar)!=null&&l.use&&this.initScrollbarInfo(this.options.axesY,"y")},initScrollbarInfo(e,t){var s,l,a,r,c,d;const n=this.scrollbar[t],i=Pe({},(s=e==null?void 0:e[0])==null?void 0:s.scrollbar,yc.scrollbar);Object.keys(i).forEach(h=>{n[h]=i[h]}),n.resetPosition&&(n.range=(a=(l=e==null?void 0:e[0])==null?void 0:l.range)!=null&&a.length?[...e[0].range]:null,this.updateScrollbarAnchorEdge(t)),n.isInit||(n.type=(r=e==null?void 0:e[0])==null?void 0:r.type,n.range=(d=(c=e==null?void 0:e[0])==null?void 0:c.range)!=null&&d.length?[...e[0].range]:null,this.initScrollbarRange(t),this.updateScrollbarAnchorEdge(t),this.createScrollbarLayout(t),this.createScrollbar(t),this.createScrollEvent(t),n.isInit=!0)},initScrollbarRange(e){var i;const t=this.scrollbar[e],n=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels;if((i=t.range)!=null&&i.length&&n.length){const[s,l]=t.range;if(Re(s)&&Re(l)){const a=this.getScrollbarLimits(e);if(!a)return;const{limitMin:r,limitMax:c}=a,d=l-s,h=c-r;if(d>=h)t.range[0]=r,t.range[1]=c;else{let u=+s<r?r:+s,m=u+d;m>c&&(m=c,u=m-d,u<r&&(u=r)),t.range[0]=u,t.range[1]=m}}}},updateScrollbarInfo(e,t){var r,c,d,h,u,m,f,g,p,y,C,b,k,L,w;const{axesX:n,axesY:i}=this.options,s=e==="x"?n:i;if(!this.scrollbar[e].isInit&&((c=(r=s==null?void 0:s[0])==null?void 0:r.scrollbar)!=null&&c.use)&&((d=s==null?void 0:s[0])!=null&&d.range)){this.initScrollbarInfo(s,e);return}else if(!((h=s==null?void 0:s[0].scrollbar)!=null&&h.use)||yo((u=s==null?void 0:s[0])==null?void 0:u.range)){this.destroyScrollbar(e);return}const l=e==="x"?this.axesX:this.axesY,a=!Ae((m=s==null?void 0:s[0])==null?void 0:m.range,(f=l==null?void 0:l[0])==null?void 0:f.range);if(a||t){const M=e==="x"?(y=(p=(g=this.options.axesX)==null?void 0:g[0])==null?void 0:p.scrollbar)==null?void 0:y.resetPosition:(k=(b=(C=this.options.axesY)==null?void 0:C[0])==null?void 0:b.scrollbar)==null?void 0:k.resetPosition;if(a){const V=(L=s==null?void 0:s[0])==null?void 0:L.range,S=this.scrollbar[e].range;if(!M&&(V!=null&&V.length)&&(S!=null&&S.length)){const x=V[1]-V[0],I=this.scrollbar[e].anchorEdge,T=I?this.getScrollbarLimits(e):null;I==="start"&&T?this.scrollbar[e].range=[T.limitMin,T.limitMin+x]:I==="end"&&T?this.scrollbar[e].range=[T.limitMax-x,T.limitMax]:this.scrollbar[e].range=[S[0],S[0]+x]}else this.scrollbar[e].range=V!=null&&V.length?[...V]:null}this.initScrollbarRange(e),a&&this.updateScrollbarAnchorEdge(e)}this.scrollbar[e].use=!!((w=s==null?void 0:s[0].scrollbar)!=null&&w.use)},updateScrollbarPosition(e){var t,n,i,s;(t=this.scrollbar.x)!=null&&t.use&&((n=this.scrollbar.x)!=null&&n.isInit)&&this.setScrollbarPosition("x",e),(i=this.scrollbar.y)!=null&&i.use&&((s=this.scrollbar.y)!=null&&s.isInit)&&this.setScrollbarPosition("y",e)},createScrollbarLayout(e){const t=this.scrollbar[e];t.dom=document.createElement("div"),t.dom.className="ev-chart-scrollbar",t.dom.dataset.type="scrollbar";const n=document.createElement("div");n.className="ev-chart-scrollbar-container",n.dataset.type=e,t.dom.appendChild(n),this.wrapperDOM.appendChild(t.dom)},createScrollbar(e){const t=this.scrollbar[e],n=t.dom.children[0];this.createScrollbarTrack(n),this.createScrollbarThumb(n),t.showButton&&this.createScrollbarButton(n)},createScrollbarTrack(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-track",t.dataset.type="track",e.appendChild(t)},createScrollbarThumb(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-thumb",t.dataset.type="thumb",e.appendChild(t)},createScrollbarButton(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-up",t.dataset.type="button";const n=document.createElement("i");n.className="ev-icon ev-icon-triangle-up ev-chart-scrollbar-button-icon",n.dataset.type="button-icon",t.appendChild(n);const i=document.createElement("div");i.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-down",i.dataset.type="button";const s=document.createElement("i");s.className="ev-icon ev-icon-triangle-down ev-chart-scrollbar-button-icon",s.dataset.type="button-icon",i.appendChild(s),e.appendChild(t),e.appendChild(i)},setScrollbarPosition(e,t){var V,S;const n=this.scrollbar[e];if(!n.use||!n.range)return;const i=n.dom,s=this.chartRect,l=t??this.labelOffset,a={x1:s.x1+l.left,x2:s.x2-l.right,y1:s.y1+l.top,y2:s.y2-l.bottom},r=(V=this.options.title)!=null&&V.show?(S=this.options.title)==null?void 0:S.height:0,c=e==="x",d=c?n.height:n.width,h=c?a.x2-a.x1:a.y2-a.y1,u=n.showButton?d:0,m=h-u*2,f=this.getScrollbarThumbSize(e,m),g=Math.max(0,m-f.size);f.position=Math.min(Math.max(f.position,0),g);let p="display: block;",y,C,b,k,L=`width:${u}px;height:${u}px;`;c?(p=`top: ${s.y2+r+l.top}px;`,p+=`left: ${a.x1}px;`,p+=`width: ${h}px;`,p+=` height: ${d}px;`,y="top: 0;",y+=`left: ${u}px;`,y+=`width: ${m}px;`,y+="height: 100%;",C=`width: ${f.size}px;`,C+="height: 100%;",C+=`left: ${f.position+u}px`,L+="transform:rotate(90deg);top: 0;",b=`${L}right:0;`,k=`${L}left:0;`):(p=`top: ${a.y1+r}px;`,p+=`left: ${a.x2+10}px;`,p+=`width: ${d}px;`,p+=`height: ${h}px;`,y=`top: ${u}px;`,y+="left: 0;",y+="width: 100%;",y+=`height: ${m}px;`,C="width: 100%;",C+=`height: ${f.size}px;`,C+=`bottom: ${f.position+u}px`,L+="left:0;",b=`${L}top: 0;`,k=`${L}bottom: 0;`),i.style.cssText=p;const w=i.getElementsByClassName("ev-chart-scrollbar-track");w[0].style.cssText=y,w[0].style.backgroundColor=n.background;const M=i.getElementsByClassName("ev-chart-scrollbar-thumb");if(M[0].style.cssText=C,M[0].style.backgroundColor=n.thumbStyle.background,M[0].style.borderRadius=`${n.thumbStyle.radius}px`,n.showButton){const x=i.getElementsByClassName("ev-chart-scrollbar-button-up"),I=Math.floor(m-f.size),T=Math.floor(f.position)>I?.5:1;x[0].style.cssText=`background-color: ${n.background};${b}`,x[0].style.opacity=T,x[0].children[0].style.display="block";const v=i.getElementsByClassName("ev-chart-scrollbar-button-down");v[0].style.cssText=`background-color: ${n.background};${k}`,v[0].style.opacity=Math.floor(f.position)<0?.5:1,v[0].children[0].style.display="block"}},getScrollbarThumbSize(e,t){var u,m,f,g;const n=this.scrollbar[e],[i,s]=n.range,l=n.type;let a,r,c=1,d=0,h=0;if(l==="step"){const p=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels,y=s-i+1;r=p.length;const C=t/r;a=C*y,h=C*i}else{const p=e==="x"?this.axesX:this.axesY,y=(u=this.minMax[e])==null?void 0:u[0],C=+y.max-+y.min,b=+s-+i;l==="time"&&(c=(g=p==null?void 0:p[0])==null?void 0:g.getInterval({minValue:y.min,maxValue:y.max,maxSteps:(f=(m=this.labelRange[e])==null?void 0:m[0])==null?void 0:f.max})),r=Math.ceil(C/c)+1,d=+y.min;const k=t/r,L=b/c+1,w=+i-d;a=k*L,h=k*(w/c)}return n.startValue=d,n.steps=r,n.interval=c,{size:a,position:h}},getScrollbarContainerDOM(e){const t=["track","thumb","button"],n=e.dataset.type;return t.includes(n)?e.parentElement:n==="button-icon"?e.parentElement.parentElement:n==="scrollbar"?e.getElementsByClassName("ev-chart-scrollbar-container")[0]:e},updateScrollbarRange(e,t){const n=this.scrollbar[e],{startValue:i,range:s,interval:l,steps:a}=n,r=i+l*a,c=e==="x"?this.axesX[0]:this.axesY[0],[d,h]=s??[];(!Re(d)||!Re(h))&&(n.range=(c==null?void 0:c.range)||null);let u,m,f=!1;t?(u=d+l,m=h+l,f=m>=r):(u=d-l,m=h-l,f=u<i),f||(n.range=[u,m],this.updateScrollbarAnchorEdge(e),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:u>1,updateByScrollbar:!0}))},getScrollbarLimits(e){var l,a;const t=this.scrollbar[e];if((t==null?void 0:t.type)==="step"){const r=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels;return r!=null&&r.length?{limitMin:0,limitMax:r.length-1}:null}const n=(a=(l=this.minMax)==null?void 0:l[e])==null?void 0:a[0];if((n==null?void 0:n.min)==null||(n==null?void 0:n.max)==null)return null;const i=+n.min,s=+n.max;return!Number.isFinite(i)||!Number.isFinite(s)?null:{limitMin:i,limitMax:s}},updateScrollbarAnchorEdge(e){const t=this.scrollbar[e];if(!t)return;const n=t.range,i=this.getScrollbarLimits(e);if(!Array.isArray(n)||n.length!==2||!i){t.anchorEdge=null;return}n[0]<=i.limitMin?t.anchorEdge="start":n[1]>=i.limitMax?t.anchorEdge="end":t.anchorEdge=null},createScrollEvent(){var t,n,i;this.onScrollbarClick=s=>{s.preventDefault();const l=s.target.dataset.type,a=this.getScrollbarContainerDOM(s.target),r=["button","button-icon"],c=a.dataset.type;let d;if(r.includes(l)){let h;l==="button"?h=s.target:l==="button-icon"&&(h=s.target.parentElement),d=h.className.includes("up")}else if(l==="track"){const h=a.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:u,y:m}=h[0].getBoundingClientRect(),f=c==="x",g=f?s.clientX:-s.clientY,p=f?u:-m;d=g>p}else return;this.updateScrollbarRange(c,d)},this.onScrollbarDown=s=>{if(s.preventDefault(),s.target.dataset.type!=="thumb")return;const l=this.getScrollbarContainerDOM(s.target),a=l.dataset.type,r=l.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:c,y:d,height:h}=r[0].getBoundingClientRect(),u=this.scrollbar[a];u.scrolling=!0,a==="x"?u.pointInThumb=s.clientX-c:u.pointInThumb=d+h-s.clientY;const m=u.dom;m.addEventListener("mousemove",this.onScrollbarMove),m.addEventListener("mouseup",this.onScrollbarUp)};const e=s=>{this.scrolling(s)};if(this.onScrollbarMove=hs(e,5),this.onScrollbarUp=s=>{s.preventDefault(),this.stopScrolling(s)},this.onScrollbarLeave=s=>{s.preventDefault(),this.scrolling(s),this.stopScrolling(s)},this.onScrollbarWheel=s=>{var h,u,m,f,g,p,y,C;const l=((u=(h=this.tooltipDOM)==null?void 0:h.style)==null?void 0:u.display)==="block",a=this.tooltipBodyDOM||((m=this.tooltipDOM)==null?void 0:m.querySelector(this.options.tooltip.htmlScrollTarget));if(l&&a){const{scrollTop:b,scrollHeight:k,clientHeight:L}=a,w=b<=0,M=Math.ceil(b)+L>=k,V=s.deltaY<0,S=s.deltaY>0;if(!(w&&V||M&&S))return}s.preventDefault();const r=1;if((f=this.scrollbar.x)!=null&&f.use&&s.shiftKey&&Math.abs(s.deltaY)>r){this.updateScrollbarRange("x",s.deltaY>0);return}const c=Math.abs(s.deltaX),d=Math.abs(s.deltaY);if(c>r&&d>r){c>d&&((g=this.scrollbar.x)!=null&&g.use)?this.updateScrollbarRange("x",s.deltaX>0):d>c&&((p=this.scrollbar.y)!=null&&p.use)&&this.updateScrollbarRange("y",s.deltaY<0);return}if((y=this.scrollbar.x)!=null&&y.use&&c>r){this.updateScrollbarRange("x",s.deltaX>0);return}(C=this.scrollbar.y)!=null&&C.use&&d>r&&this.updateScrollbarRange("y",s.deltaY<0)},this.scrollbar.x.use&&!this.scrollbar.x.isInit){const s=this.scrollbar.x.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}if(this.scrollbar.y.use&&!this.scrollbar.y.isInit){const s=this.scrollbar.y.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}((t=this.scrollbar.x)!=null&&t.use||(n=this.scrollbar.y)!=null&&n.use)&&((i=this.overlayCanvas)==null||i.addEventListener("wheel",this.onScrollbarWheel,{passive:!1}))},scrolling(e){const t=this.getScrollbarContainerDOM(e.target),n=t.dataset.type;if(!this.scrollbar[n].scrolling)return;const{steps:i,range:s,pointInThumb:l,startValue:a,interval:r}=this.scrollbar[n],c=t.getElementsByClassName("ev-chart-scrollbar-track"),{x:d,y:h,width:u,height:m}=c[0].getBoundingClientRect(),f=n==="x",g=f?d:h,p=f?u:m,y=p/i,C=a+(i-1)*r;let b=f?e.clientX:e.clientY;b<g?b=g:b>g+p&&(b=g+p);let k;if(f?k=b-g-l:k=g+p-b-l,k<=0)return;let L,w;const M=Math.round(Math.abs(k)/y)*r,[V,S]=s;if(k>0){const x=a+(M-+V);L=+V+x,w=L+(+S-+V)}L<a||w>C||(this.scrollbar[n].range=[L,w],this.updateScrollbarAnchorEdge(n),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:L>1,updateByScrollbar:!0}))},stopScrolling(e){const n=this.getScrollbarContainerDOM(e.target).dataset.type,i=this.scrollbar[n];if(i.scrolling){i.scrolling=!1;const s=i.dom;s.removeEventListener("mousemove",this.onScrollbarMove,!1),s.removeEventListener("mouseup",this.onScrollbarUp,!1)}},hideScrollbar(e){const t=this.scrollbar[e].dom;if(!t)return;const n=t==null?void 0:t.style;n.display="none",n.width="0",n.height="0"},destroyScrollbar(e){var n,i,s;const t=this.scrollbar[e].dom;t&&(t.remove(),this.scrollbar[e]={isInit:!1},!((n=this.scrollbar.x)!=null&&n.use)&&!((i=this.scrollbar.y)!=null&&i.use)&&((s=this.overlayCanvas)==null||s.removeEventListener("wheel",this.onScrollbarWheel,{passive:!1})))}};function V1(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")}function vc(e,t,n){let i,s,l,a,r,c,d=0,h=!1,u=!1,m=!0;const f=!t&&t!==0&&typeof root.requestAnimationFrame=="function";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0,V1(n)&&(h=!!n.leading,u="maxWait"in n,l=u?Math.max(+n.maxWait||0,t):l,m="trailing"in n?!!n.trailing:m);function g(I){const T=i,v=s;return i=s=void 0,d=I,a=e.apply(v,T),a}function p(I,T){return f?(window.cancelAnimationFrame(r),window.requestAnimationFrame(I)):setTimeout(I,T)}function y(I){if(f)return window.cancelAnimationFrame(I);clearTimeout(I)}function C(I){return d=I,r=p(L,t),h?g(I):a}function b(I){const T=I-c,v=I-d,E=t-T;return u?Math.min(E,l-v):E}function k(I){const T=I-c,v=I-d;return c===void 0||T>=t||T<0||u&&v>=l}function L(){const I=Date.now();if(k(I))return w(I);r=p(L,b(I))}function w(I){return r=void 0,m&&i?g(I):(i=s=void 0,a)}function M(){r!==void 0&&y(r),d=0,i=c=s=r=void 0}function V(){return r===void 0?a:w(Date.now())}function S(){return r!==void 0}function x(...I){const T=Date.now(),v=k(T);if(i=I,s=this,c=T,v){if(r===void 0)return C(c);if(u)return r=p(L,t),g(c)}return r===void 0&&(r=p(L,t)),a}return x.cancel=M,x.flush=V,x.pending=S,x}const E1="Expected a function";function W1(e,t,n){let i=!0,s=!0;if(typeof e!="function")throw new TypeError(E1);return vc(e,t,{leading:i,maxWait:t,trailing:s})}const G1={createEventFunctions(){var s,l,a,r;this.onMouseMove=c=>{var w,M;if((w=this.dragInfo)!=null&&w.isMove||this.isMobile)return;const d={e:c},{indicator:h,tooltip:u,type:m}=this.options,f=this.getMousePosition(c),g=this.findHitItem(f),p=this.findPlotLabelHitRegion(f);p&&(g.items={},g.hitId=null),!p&&(u!=null&&u.showAllValueInRange)&&(g!=null&&g.items)&&this.addNotHitInfo(g);const y=this.overlayCtx,C=Object.keys(g.items),b=C.length>0;let k="";if(b){k=`h=${g.hitId}`;const V=C.slice().sort();for(let S=0;S<V.length;S++){const x=V[S];k+=`|${x}:${g.items[x].index}`}}const L=k!==""&&k===this._lastHoverSig&&this.tooltipDOM&&this.tooltipDOM.style.display!=="none";if(this.overlayClear(),b){if(u.use&&this.isInitTooltip)if(this.drawItemsHighlight(g,y),typeof(u==null?void 0:u.returnValue)=="function"){const S=[];for(let x=0;x<C.length;x++){const I=C[x],T=g.items[I];S.push({sId:I,data:T.data,color:T.color,name:T.name,dataId:T.id,index:T.index})}this.hideTooltipDOM(),u.returnValue(S,c)}else(M=u==null?void 0:u.formatter)!=null&&M.html?(L||this.drawCustomTooltip(g==null?void 0:g.items),this.setCustomTooltipLayoutPosition(g,c)):(this.setTooltipLayoutPosition(g,c),m==="scatter"?this.drawTooltipForScatter(g,this.tooltipCtx):m==="heatMap"?this.drawToolTipForHeatMap(g,this.tooltipCtx):this.drawTooltip(g,this.tooltipCtx));const V=Object.values(this.seriesList||{}).some(S=>S.type==="line");if(u.use&&(m==="line"||V)){const S=this.drawIndicatorForTooltip(g,h.color),x=S==null?void 0:S.labelValue,I=this.getTimeLabel(f);d.hoveredLabel={horizontal:this.options.horizontal,label:I,mousePosition:[c.clientX,c.clientY],dataLabel:x}}}else u.use&&this.isInitTooltip&&(typeof(u==null?void 0:u.returnValue)=="function"&&u.returnValue([],c),this.hideTooltipDOM());if(this.handlePlotLabelHover(p,c),this._lastHoverSig=k,this.dragInfoBackup&&!this.dragDisplayCanvas&&this.drawSelectionArea(this.dragInfoBackup),!d.hoveredLabel&&!this.isNotUseIndicator()){const V=Object.values(this.seriesList||{}).some(x=>x.type==="line");(m!=="line"&&!V||!u.use||!Object.keys(g.items).length)&&this.drawIndicator(f,h.color);const S=this.getTimeLabel(f);d.hoveredLabel={horizontal:this.options.horizontal,label:S,mousePosition:[c.clientX,c.clientY]}}else d.hoveredLabel||(d.hoveredLabel={label:""});typeof this.listeners["mouse-move"]=="function"&&(m!=="pie"&&(d.curMouseTargetVal=this.getCurMouseTargetVal(f,g)),this.listeners["mouse-move"](d))},this.onMouseLeave=c=>{var u;const{tooltip:d,dragSelection:h}=this.options;d.throttledMove&&this.onMouseMove.cancel(),(!h.use||!h.keepDisplay)&&this.overlayClear(),(u=this.hidePlotLabelTooltip)==null||u.call(this),d.use&&this.isInitTooltip&&(typeof(d==null?void 0:d.returnValue)=="function"&&d.returnValue([],c),this.tooltipClear()),this._lastHoverSig="",this.invalidateClientRectCache(),this.listeners["mouse-leave"]()},this.onDblClick=c=>{const d={e:c},h=this.getMousePosition(c),{type:u,selectItem:m,selectLabel:f,selectSeries:g}=this.options,p=(m==null?void 0:m.use)&&(m==null?void 0:m.useClick),y=(f==null?void 0:f.use)&&(f==null?void 0:f.useClick),C=(g==null?void 0:g.use)&&(g==null?void 0:g.useClick);p?d.eventTarget="item":y?d.eventTarget="label":C&&(d.eventTarget="series");const b=()=>{var S,x;const w=this.findHitItem(h,!0),M=w.hitId??Object.keys(w.items)[0],V=w.items[M];V&&(d.label=V.label,d.value=(S=V.data)==null?void 0:S.o,d.seriesId=M,d.dataIndex=V.index,d.acc=(x=V.data)==null?void 0:x.acc)},k=w=>{var T,v;const M=this.findHitItem(h,!0),V=M.hitId??Object.keys(M.items)[0],S=M.items[V],{labelIndex:x}=this.getLabelInfoByPosition(h,w),{dataIndex:I}=this.regulateSelectedLabelInfo(x,w);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(I,w),S&&(d.label=S.label,d.seriesId=V,d.value=(T=S.data)==null?void 0:T.o,d.acc=(v=S.data)==null?void 0:v.acc,d.dataIndex=S.index)},L=()=>{var S,x,I;const w=this.findHitItem(h,!0),M=w.hitId??Object.keys(w.items)[0],V=w.items[M];if(M!==null){const T=this.updateSelectedSeriesInfo(M,!0);V&&(d.label=V.label,d.value=(S=V.data)==null?void 0:S.o,d.seriesId=(x=T.seriesId)==null?void 0:x.at(0),d.acc=(I=V.data)==null?void 0:I.acc,d.dataIndex=V.index)}};switch(u){case"bar":{y?k(this.options.horizontal?"yAxis":"xAxis"):b();break}case"line":{p?b():y?k():C&&L();break}default:{b();break}}typeof this.listeners["dbl-click"]=="function"&&this.listeners["dbl-click"](d)},this.onClick=c=>{var w;if(this.isMouseMove){this.isMouseMove=!1;return}const d={e:c},h=this.getMousePosition(c),{type:u,selectItem:m,selectLabel:f,selectSeries:g}=this.options,p=(m==null?void 0:m.use)&&(m==null?void 0:m.useClick),y=(f==null?void 0:f.use)&&(f==null?void 0:f.useClick),C=(g==null?void 0:g.use)&&(g==null?void 0:g.useClick),b=()=>{const M=this.getHitItemByPosition(h,!1,void 0,!1,!0);({label:d.label,value:d.value,sId:d.seriesId,dataIndex:d.dataIndex,acc:d.acc}=M),M!=null&&M.sId&&(d.selected={eventTarget:"item",seriesId:this.isDeselectItem(M)?null:M.sId,dataIndex:this.isDeselectItem(M)?null:M.dataIndex})},k=M=>{var x,I,T,v;const{labelIndex:V}=this.getLabelInfoByPosition(h,M),{dataIndex:S}=this.regulateSelectedLabelInfo(V,M);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(S,M),M&&(this.defaultSelectInfo.targetAxis=S!=null&&S.length?M:null),d.selected={eventTarget:"label",...Ve(this.defaultSelectInfo)},d.label=(I=(x=this.defaultSelectInfo)==null?void 0:x.label)==null?void 0:I.at(0),d.dataIndex=(v=(T=this.defaultSelectInfo)==null?void 0:T.dataIndex)==null?void 0:v.at(0)},L=()=>{const M=this.findHitItem(h,!0),V=M.hitId??Object.keys(M.items)[0],S=M.items[V];if(!zt(V)){const x=this.updateSelectedSeriesInfo(V,!1);this.defaultSelectInfo.seriesId=x.seriesId,d.selected={eventTarget:"series",...Ve(this.defaultSelectInfo)},d.label=S.label,d.dataIndex=S.index}};switch(u){default:case"bar":{p?b():y&&k(this.options.horizontal?"yAxis":"xAxis");break}case"line":{p?b():y?k():C&&L();break}case"heatMap":{const M=!!this.options.horizontal;if(p&&y){const{useBothAxis:V}=f,S=this.getCurMouseLocation(h);if(S==="chartBackground")this.clearSelectedLabelInfo(),d.deselected={eventTarget:"label"},b();else if(S==="yAxis"||S==="xAxis"){if(this.clearSelectedItemInfo(),d.deselected={eventTarget:"item"},!V&&S!==(M?"yAxis":"xAxis"))return;k(S)}}else if(p)b();else if(y){const{useBothAxis:V}=f,S=this.getCurMouseLocation(h);if((S==="yAxis"||S==="xAxis")&&!V&&S!==(M?"yAxis":"xAxis"))return;S!=="canvas"&&k(V?S:null)}break}case"pie":{p&&b();break}case"scatter":{if(p&&b(),(w=this.options.dragSelection)!=null&&w.use&&this.isMobile){let M=this.setTouchInfo(c);this.overlayClear(),this.options.dragSelection.keepDisplay&&(c.layerX<M.range.x1||c.layerY<M.range.y1||c.layerX>M.range.x2||c.layerY>M.range.y2)?this.isTouchOverlay=!1:(M=this.setTouchBoxDimensions(M),this.isTouchOverlay=!0,this.drawSelectionArea(M)),this.options.dragSelection.keepDisplay||setTimeout(()=>{this.isTouchOverlay=!1,this.overlayClear()},100),d.e=c,d.touchInfo=M,d.data=this.findSelectedItems(M),d.range=this.getSelectionRange(M),typeof this.listeners["drag-select"]=="function"&&this.listeners["drag-select"](d)}break}}typeof this.listeners.click=="function"&&(this.dragInfoBackup||this.listeners.click(d))},this.onMouseDown=c=>{const{dragSelection:d,type:h,horizontal:u}=this.options,m=h==="bar"&&!u,f=!h&&!u;d.use&&(h==="scatter"||h==="line"||h==="heatMap"||m||f)&&(this.removeSelectionArea(),this.dragStart(c,h))},this.onWheel=c=>{var b,k,L,w;if(!(((k=(b=this.tooltipDOM)==null?void 0:b.style)==null?void 0:k.display)==="block"))return;const h=((L=this.vsState)==null?void 0:L.scrollEl)||(this.options.tooltip.htmlScrollTarget?(w=this.tooltipDOM)==null?void 0:w.querySelector(this.options.tooltip.htmlScrollTarget):null)||this.tooltipBodyDOM;if(!h||h.scrollHeight<=h.clientHeight){this.hideTooltipDOM();return}const{scrollTop:u,scrollHeight:m,clientHeight:f}=h,g=u<=0,p=Math.ceil(u)+f>=m,y=c.deltaY<0,C=c.deltaY>0;c.preventDefault(),!(g&&y)&&!(p&&C)&&(h.scrollTop+=c.deltaY)};const e=(s=this.options)==null?void 0:s.tooltip,t=!!((l=e==null?void 0:e.formatter)!=null&&l.html)&&!!(e!=null&&e.virtualScroll)&&e.virtualScroll.use!==!1;(e!=null&&e.useScrollbar||t)&&this.overlayCanvas.addEventListener("wheel",this.onWheel,{passive:!1}),(r=(a=this.options)==null?void 0:a.tooltip)!=null&&r.throttledMove&&(this.onMouseMove=W1(this.onMouseMove,30)),this.overlayCanvas.addEventListener("mousemove",this.onMouseMove),this.overlayCanvas.addEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.addEventListener("dblclick",this.onDblClick),this.overlayCanvas.addEventListener("click",this.onClick);const{startArea:n,displayFromStartArea:i}=this.options.dragSelection;this.dragStartTarget=n&&this.target.closest(n)||this.overlayCanvas,this.dragStartTarget.addEventListener("mousedown",this.onMouseDown),i&&this.options.type==="scatter"&&!this.isMobile&&this.dragStartTarget!==this.overlayCanvas&&this.createDragDisplayCanvas(),this.dragTouchSelectionEvent=c=>this.dragTouchSelectionDestroy(c),window.addEventListener("click",this.dragTouchSelectionEvent),this.invalidateRectOnScroll=()=>this.invalidateClientRectCache(),window.addEventListener("scroll",this.invalidateRectOnScroll,{capture:!0,passive:!0})},dragStart(e,t){this.dragDisplayCanvas&&this.refreshDragDisplayCanvas();let n;this.dragDisplayCanvas&&(n=this.dragStartTarget.style.userSelect,this.dragStartTarget.style.userSelect="none");const[i,s,l,a]=this.getMousePosition(e);let r=i,c=s;const d=this.chartRect,h=this.labelOffset,u={x1:d.x1+h.left,x2:d.x2-h.right,y1:d.y1+h.top,y2:d.y2-h.bottom};r<u.x1&&(r=u.x1),r>u.x2&&(r=u.x2),c<u.y1&&(c=u.y1),c>u.y2&&(c=u.y2),this.dragInfo={xcp:r,ycp:c,range:u};const m=(C,b)=>C>=0&&C<=l&&b>=0&&b<=a;let f=!1;const g=()=>{f||(f=!0,this.removeSelectionArea())};(m(i,s)||this.dragDisplayCanvas)&&g();const p=C=>{const[b,k]=this.getMousePosition(C);if(!f)if(m(b,k))g();else return;C.preventDefault();const L=this.dragInfo,{xcp:w,ycp:M,range:V}=L;let S,x;if(L.isMove=!0,this.isMouseMove=!0,b<V.x1?S=V.x1:b>V.x2?S=V.x2:S=b,k<V.y1?x=u.y1:k>V.y2?x=V.y2:x=k,t==="heatMap"){const I={xcp:w,xep:S,ycp:M,yep:x,range:V},{xsp:T,ysp:v,width:E,height:Z}=this.getDragInfoForHeatMap(I);L.xsp=T,L.ysp=v,L.width=E,L.height=Z}else L.xsp=Math.min(w,S),L.ysp=t==="scatter"?Math.min(M,x):V.y1,L.width=Math.ceil(Math.abs(S-w)),L.height=t==="scatter"?Math.ceil(Math.abs(x-M)):V.y2-V.y1;this.dragDisplayCanvas&&t==="scatter"&&(L.displayRect={xsp:Math.min(i,b),ysp:Math.min(s,k),width:Math.ceil(Math.abs(b-i)),height:Math.ceil(Math.abs(k-s)),range:V}),this.overlayClear(),this.drawSelectionArea(L)},y=C=>{var k,L,w,M;const b=this.dragInfo;if(f&&(b!=null&&b.isMove)&&(b==null?void 0:b.width)>1&&(b==null?void 0:b.height)>1){const V={e:C,data:this.findSelectedItems(b),range:t==="heatMap"?this.getSelectionRangeForHeatMap(b):this.getSelectionRange(b)};if(this.dragInfoBackup=Pe({},b),typeof this.listeners["drag-select"]=="function"&&!((L=(k=this.options)==null?void 0:k.zoom)!=null&&L.use))this.listeners["drag-select"](V);else if(V.range){const{xsp:S,range:x,width:I}=b,T=S-x.x1;V.range.dragSelectionInfo={dragXsp:T,dragXep:T+I,exceptAxesYChartWidth:x.x2-x.x1,exceptAxesXChartHeight:x.y2-x.y1,chartRange:x,chartTitle:this.options.title.text},(M=(w=this.options.zoom)==null?void 0:w.getRangeInfo)==null||M.call(w,V)}this.options.dragSelection.keepDisplay||this.removeSelectionArea()}this.dragInfo=null,n!==void 0&&(this.dragStartTarget.style.userSelect=n),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",y)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",y)},drawSelectionArea(e){var h,u;const t=!!this.dragDisplayCanvas,n=t?this.dragDisplayCtx:this.overlayCtx,{fillColor:i,opacity:s}=this.options.dragSelection;let l=0,a=0;t&&(this.dragDisplayClear(),l=((h=this.dragDisplayOffset)==null?void 0:h.x)??0,a=((u=this.dragDisplayOffset)==null?void 0:u.y)??0);const r=this.chartRect,c=this.labelOffset,d={x1:r.x1+c.left,x2:r.x2-c.right,y1:r.y1+c.top,y2:r.y2-c.bottom};if(n.fillStyle=i,n.globalAlpha=s,t&&e.displayRect){const m=e.displayRect,{xsp:f,ysp:g,width:p,height:y,range:C}=e;let b=f,k=g,L=p,w=y;if(!Ae(d,C)){const I=C.x2-C.x1,T=C.y2-C.y1,v=d.x2-d.x1,E=d.y2-d.y1;b=d.x1+v*((f-C.x1)/I),k=d.y1+E*((g-C.y1)/T),L=v*(p/I),w=E*(y/T)}const M=f-m.xsp,V=g-m.ysp,S=m.xsp+m.width-(f+p),x=m.ysp+m.height-(g+y);n.fillRect(b-M+l,k-V+a,L+M+S,w+V+x)}else{const{xsp:m,ysp:f,width:g,height:p,range:y}=e;if(Ae(d,y))n.fillRect(m+l,f+a,g,p);else{const C=y.x2-y.x1,b=y.y2-y.y1,k=d.x2-d.x1,L=d.y2-d.y1,w=(m-y.x1)/C,M=(f-y.y1)/b,V=d.x1+k*w,S=d.y1+L*M,x=g/C,I=p/b,T=k*x,v=L*I;n.fillRect(V+l,S+a,T,v)}}n.globalAlpha=1},createDragDisplayCanvas(){const e=this.dragStartTarget;if(!e||e===this.overlayCanvas)return;window.getComputedStyle(e).position==="static"&&(this.dragStartAreaPrevPosition=e.style.position,e.style.position="relative");const t=document.createElement("canvas");t.className="ev-chart-drag-display-canvas",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.zIndex="3",t.style.pointerEvents="none",e.appendChild(t),this.dragDisplayCanvas=t,this.dragDisplayCtx=t.getContext("2d"),this.refreshDragDisplayCanvas()},refreshDragDisplayCanvas(){if(!this.dragDisplayCanvas||!this.dragStartTarget)return;const{width:e,height:t}=this.dragStartTarget.getBoundingClientRect(),n=Math.max(1,Math.round(e)),i=Math.max(1,Math.round(t)),s=n*this.pixelRatio,l=i*this.pixelRatio;(this.dragDisplayCanvas.width!==s||this.dragDisplayCanvas.height!==l)&&(this.dragDisplayCanvas.width=s,this.dragDisplayCanvas.height=l,this.dragDisplayCanvas.style.width=`${n}px`,this.dragDisplayCanvas.style.height=`${i}px`),this.dragDisplayCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.dragDisplayClear();const a=this.overlayCanvas.getBoundingClientRect(),r=this.dragDisplayCanvas.getBoundingClientRect();this.dragDisplayOffset={x:a.left-r.left,y:a.top-r.top}},dragDisplayClear(){if(!this.dragDisplayCtx||!this.dragDisplayCanvas)return;const e=this.pixelRatio<1?this.pixelRatio:1;this.dragDisplayCtx.clearRect(0,0,this.dragDisplayCanvas.width/e,this.dragDisplayCanvas.height/e)},removeSelectionArea(){this.dragInfoBackup=null,this.overlayClear(),this.dragDisplayCanvas&&this.dragDisplayClear()},getMousePosition(e){const t=e.originalEvent||e,n=this.getOverlayClientRect();return[t.clientX-n.left,t.clientY-n.top,n.width,n.height]},findPlotLabelHitRegion(e){const t=this.plotLabelHitRegions;if(!(t!=null&&t.length))return null;const[n,i]=e;return t.find(s=>n>=s.x&&n<=s.x+s.width&&i>=s.y&&i<=s.y+s.height)??null},handlePlotLabelHover(e,t){var n;e?this.showPlotLabelTooltip(e,t.originalEvent||t):(n=this.hidePlotLabelTooltip)==null||n.call(this)},getCurMouseTargetVal(e,t){const n=this.getCurMouseLocation(e),i={location:n,labelIdx:-1,labelVal:"",dataIdx:-1,maxDataVal:"",originVal:""};if(n==="chartBackground"){const{maxHighlight:s,items:l}=t;if(s!=null&&s.length){const[a,r]=s;l[a]&&(i.dataIdx=l[a].index,i.maxDataVal=r,i.originVal=t)}}else if(n==="xAxis"||n==="yAxis"){const{axesX:s,axesY:l}=this.options,a=(c,d,h)=>{i.labelIdx=d,i.labelVal=c[0].type==="time"?We(h).format(c[0].timeFormat):h,i.originVal=c[0].type==="time"?We(h):h};(c=>{const{labelIndex:d}=this.getLabelInfoByPosition(e,n),{labelVal:h,labelIdx:u}=this.getCurMouseLabelVal(c,e,d);a(c==="xAxis"?s:l,u,h)})(n)}return i},setTouchInfo(e){let[t,n]=this.getMousePosition(e);const i=this.chartRect,s=this.labelOffset,l={x1:i.x1+s.left,x2:i.x2-s.right,y1:i.y1+s.top,y2:i.y2-s.bottom};return t=Math.max(l.x1,Math.min(t,l.x2)),n=Math.max(l.y1,Math.min(n,l.y2)),{xcp:t,ycp:n,range:l}},setTouchBoxDimensions(e){var h;const t=((h=this.options.dragSelection)==null?void 0:h.size)||50,n=t/2,{xcp:i,ycp:s,range:l}=e;let a=i-n,r=s-n,c=t,d=t;return this.boxOverflow={x1:!1,x2:!1,y1:!1,y2:!1},i<l.x1+n&&(a=l.x1,c=n-(l.x1-i),this.boxOverflow.x1=!0),i>l.x2-n&&(c=n-(i-l.x2),this.boxOverflow.x2=!0),s<l.y1+n&&(r=l.y1,d=n-(l.y1-s),this.boxOverflow.y1=!0),s>l.y2-n&&(d=n-(s-l.y2),this.boxOverflow.y2=!0),e.xsp=a,e.ysp=r,e.width=c,e.height=d,e},dragTouchSelectionDestroy(e){var t;(t=this.options.dragSelection)!=null&&t.use&&e.target!==this.overlayCanvas&&this.isTouchOverlay&&(this.isTouchOverlay=!1,this.overlayClear())},findHitItem(e,t=!1){var w,M,V,S;(w=this.ensureHitCoordsFresh)==null||w.call(this);const n=Object.keys(this.seriesList),i={},s=!!this.options.horizontal,l=this.tooltipCtx,[a,r]=e;let c=null,d="",h=0,u="",m=null,f=null,g=1/0,p=!1,y=null,C=1/0;const b=this.findClosestDataIndex(e,n,t);if(b===-1&&!this.isNotUseIndicator())return{items:i,hitId:c,maxTip:[d,u],maxHighlight:null};const k=n.every(x=>this.seriesList[x].type==="bar");for(let x=0;x<n.length;x++){const I=n[x],T=this.seriesList[I];if(T.findGraphData&&T.show){const v=T.findGraphData(e,s,b,!k);if(v!=null&&v.data){let E;if(v.data.o===null&&T.interpolation!=="zero"?T.isExistGrp||(E=s?v.data.x:v.data.y):isNaN(v.data.o)||(E=v.data.o),E!=null){const Z=this.getFormattedTooltipLabel({dataId:T.id,seriesId:I,seriesName:T.name,itemData:v.data}),W=l?l.measureText(Z).width:1;v.id=T.id,v.name=Z,v.axis={x:T.xAxisIndex,y:T.yAxisIndex},v.label=s?(M=v.data)==null?void 0:M.y:(V=v.data)==null?void 0:V.x,i[I]=v;const R=this.getFormattedTooltipValue({dataId:T.id,seriesId:I,seriesName:Z,value:E,itemData:v.data});if(v.data.formatted=R,h<W&&(d=Z,h=W),u.length<=`${R}`.length&&(u=`${R}`),(m===null||m<=E)&&(m=E,f=I),v.hit&&v.data.xp!==void 0&&v.data.yp!==void 0){const X=(v.data.xp-e[0])**2+(v.data.yp-e[1])**2;v.directHit?((!p||X<g)&&(g=X,c=I),p=!0):!p&&X<g&&(g=X,c=I)}if(c===null&&v.data.xp!==void 0&&v.data.yp!==void 0&&v.data.xp!==null&&v.data.yp!==null){const X=A.calcBoxDistance(v.data,a,r);X<C&&(C=X,y=I)}}}}}c===null&&(c=y!==null?y:Object.keys(i)[0]);const L=m!==null?[f,m]:null;if(t&&Object.keys(i).length===0&&b!==-1){const x=n.find(T=>{var E;const v=this.seriesList[T];return(v==null?void 0:v.show)&&((E=v==null?void 0:v.data)==null?void 0:E.length)>0}),I=x?(S=this.seriesList[x].data)==null?void 0:S[b]:null;I&&(i[""]={id:"",name:"",label:s?I.y:I.x,index:b,axis:{x:0,y:0},data:{o:void 0,x:I.x,y:I.y}},c="")}return{items:i,hitId:c,maxTip:[d,u],maxHighlight:L}},buildLabelValidMask(e){var s,l;const t=e??Object.keys(this.seriesList);let n=0;for(let a=0;a<t.length;a++){const r=this.seriesList[t[a]];r!=null&&r.show&&((s=r.data)==null?void 0:s.length)>n&&(n=r.data.length)}const i=new Uint8Array(n);for(let a=0;a<t.length;a++){const r=this.seriesList[t[a]];if(r!=null&&r.show&&r.data){const{data:c}=r;for(let d=0;d<c.length;d++){const h=(l=c[d])==null?void 0:l.o;h!=null&&(i[d]=1)}}}return this.labelValidMask=i,i},findClosestDataIndex(e,t,n=!1){var p;const[i,s]=e,l=!!this.options.horizontal,a=l?s:i,r=t.find(y=>{var b;const C=this.seriesList[y];return(C==null?void 0:C.show)&&((b=C==null?void 0:C.data)==null?void 0:b.length)>0});if(!r||!((p=this.seriesList[r])!=null&&p.data))return-1;const c=this.seriesList[r].data;let d=50;if(c.length>1){const y=[];for(let C=1;C<c.length;C++){const b=c[C-1],k=c[C];if(b&&k){let L,w;l?(L=b.h?b.yp+b.h/2:b.yp,w=k.h?k.yp+k.h/2:k.yp):(L=b.w?b.xp+b.w/2:b.xp,w=k.w?k.xp+k.w/2:k.xp),L!==null&&w!==null&&y.push(Math.abs(w-L))}}y.length>0&&(d=y.reduce((C,b)=>C+b,0)/y.length)}let h=1/0,u=-1,m=this.labelValidMask;!n&&(!m||m.length<c.length)&&(m=this.buildLabelValidMask(t));for(let y=0;y<c.length;y++)if(n||m[y]===1){const b=c[y];if(b){let k;if(l?k=b.h?b.yp+b.h/2:b.yp:k=b.w?b.xp+b.w/2:b.xp,k!==null){const L=Math.abs(a-k);L<h&&(h=L,u=y)}}}if(u===-1)return-1;const g=Math.max(d,6);return h>=g?t.some(C=>{const b=this.seriesList[C];if(b!=null&&b.show){const k=b.passingValue,L=b.interpolation,w=b.hasPassingValueInData;return L==="linear"||L==="none"&&!!k&&w}return!1})?u:-1:u},getFormattedTooltipLabel({dataId:e,seriesId:t,seriesName:n,itemData:i}){var c;const l=this.options.tooltip,a=(c=l==null?void 0:l.formatter)==null?void 0:c.label;let r=n;return a&&(r=a({dataId:e,seriesId:t,seriesName:n,itemData:i})),r},getFormattedTooltipValue({dataId:e,seriesId:t,seriesName:n,value:i,itemData:s}){var u;const l=this.options,a=!!l.horizontal,r=l.tooltip,c=typeof(r==null?void 0:r.formatter)=="function"?r==null?void 0:r.formatter:(u=r==null?void 0:r.formatter)==null?void 0:u.value,d=s!==null&&typeof s=="object"&&c&&this._dataEpoch!=null;if(d){this._tooltipValueCacheEpoch!==this._dataEpoch&&(this._tooltipValueCache=null,this._tooltipValueCacheEpoch=this._dataEpoch),this._tooltipValueCache||(this._tooltipValueCache=new WeakMap);const m=this._tooltipValueCache.get(s);if(m!==void 0){const f=m[t];if(f!==void 0)return f}}let h=i;if(c&&(l.type==="pie"?h=c({value:i,name:n,percentage:s==null?void 0:s.percentage,seriesId:t,dataId:e}):l.type==="heatMap"?h=c({x:s==null?void 0:s.x,y:s==null?void 0:s.y,value:i>-1?i:"error",seriesId:t,dataId:e}):h=c({x:a?i:s==null?void 0:s.x,y:a?s==null?void 0:s.y:i,o:s==null?void 0:s.o,name:n,seriesId:t,dataId:e})),i&&(!c||typeof h!="string")&&(l.type==="heatMap"?h=i<0?"error":sn(i):h=sn(i)),d){let m=this._tooltipValueCache.get(s);m||(m=Object.create(null),this._tooltipValueCache.set(s,m)),m[t]=h}return h},addNotHitInfo(e){var c,d,h,u,m,f;const t=this.tooltipCtx,n=!!this.options.horizontal,i=Object.keys(e.items)[0],s=n?(h=(d=(c=e.items)==null?void 0:c[i])==null?void 0:d.data)==null?void 0:h.y:(f=(m=(u=e.items)==null?void 0:u[i])==null?void 0:m.data)==null?void 0:f.x;let l="",a="";const r=Object.keys(this.seriesList);for(let g=0;g<r.length;g++){const p=r[g],y=this.seriesList[p];if(y!=null&&y.show){const C=y.data.find(S=>n?(S==null?void 0:S.y)===s:(S==null?void 0:S.x)===s),b=this.getFormattedTooltipLabel({dataId:y.id,seriesId:p,seriesName:y.name,itemData:C}),k=this.getFormattedTooltipValue({dataId:y.id,seriesId:p,seriesName:b,value:C==null?void 0:C.o,itemData:C});if(C&&C.o!==null&&C.o!==void 0&&!e.items[p]){const S={};S.color=y.color,S.hit=!1,S.name=b,S.axis={x:y.xAxisIndex,y:y.yAxisIndex},S.index=n?y.yAxisIndex:y.xAxisIndex,S.data=C,S.data.formatted=k,e.items[p]=S}const L=t?t.measureText(l).width:1,w=t?t.measureText(b).width:1;L<w&&(l=b);const M=t?t.measureText(a).width:1,V=t?t.measureText(`${k}`).width:1;M<V&&(a=`${k}`)}}e.maxTip=[l,a]},selectItemByData(e,t){this.defaultSelectItemInfo=e;let n;t==="pie"?n={type:"pie",sId:e.seriesID}:n=isNaN(e==null?void 0:e.dataIndex)?null:this.getItem(e,!1),this.render(n)},selectLabelByData(e,t){this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(e,t),this.render()},selectSeriesByData(e){const t=e??[],n=this._renderedSelectSeriesIds;n&&n.length===t.length&&n.every((i,s)=>i===t[s])||(this.defaultSelectInfo.seriesId=e,this._renderedSelectSeriesIds=[...t],this.render())},getSelectedLabelInfoWithLabelData(e,t){const{selectLabel:n,type:i,horizontal:s}=this.options,l=Ve(this.defaultSelectInfo);switch(l.dataIndex=e,i){default:case"bar":case"line":{l.dataIndex.splice(n.limit),l.label=l.dataIndex.map(r=>this.data.labels[r]);const a=Object.entries(this.data.data);l.data=l.dataIndex.map(r=>Object.fromEntries(a.map(([c,d])=>[c,d[r]])));break}case"heatMap":{const{limit:a,useBothAxis:r}=this.options.selectLabel;l.dataIndex.splice(a);let c;r?c=t==="yAxis"?"y":"x":c=s?"y":"x",l.label=l.dataIndex.map(h=>this.data.labels[c][h]);const d=Object.values(this.data.data)[0];l.data=d.filter(({x:h,y:u})=>l.label.includes(c==="y"?u:h));break}}return l},regulateSelectedLabelInfo(e,t){var l,a;const n=((l=this.options)==null?void 0:l.selectLabel)??{},i=t===null||((a=this.defaultSelectInfo)==null?void 0:a.targetAxis)===t?{...this.defaultSelectInfo,targetAxis:t}:{dataIndex:[],targetAxis:t},s=Ve(i);if(i.dataIndex.includes(e)){const r=i.dataIndex.indexOf(e);s.dataIndex.splice(r,1)}else e>-1&&(s.dataIndex.push(e),n.limit>0&&n.limit<s.dataIndex.length&&(n.useDeselectOverflow?s.dataIndex.splice(0,1):s.dataIndex.pop()));return s},updateSelectedSeriesInfo(e,t){var l;const n=((l=this.options)==null?void 0:l.selectSeries)??{},i=this.defaultSelectInfo??{seriesId:[]};typeof i.seriesId=="string"&&(i.seriesId=[i.seriesId]);const s=Ve(i);if(i.seriesId.includes(e)){if(!t){const a=i.seriesId.indexOf(e);s.seriesId.splice(a,1)}}else e&&(s.seriesId.push(e),n.limit>0&&n.limit<s.seriesId.length&&(n.useDeselectOverflow?s.seriesId.splice(0,1):s.seriesId.pop()));return s},drawIndicatorForTooltip(e,t){var d;if(!(e!=null&&e.items)||!Object.keys(e.items).length)return null;const n=this.overlayCtx,{horizontal:i}=this.options,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=Object.keys(e.items)[0],a=e.items[l];if(!(a!=null&&a.data))return null;const r=i?a.data.y:a.data.x;let c;if(i){const h=a.data.yp+(a.data.h?a.data.h/2:0);c=[s.x1,h]}else c=[a.data.xp+(a.data.w?a.data.w/2:0),s.y1];return n.beginPath(),n.save(),n.strokeStyle=t,n.lineWidth=1,(d=this.options.indicator)!=null&&d.segments&&n.setLineDash(this.options.indicator.segments),i?(n.moveTo(s.x1,c[1]+.5),n.lineTo(s.x2,c[1]+.5)):(n.moveTo(c[0]+.5,s.y1),n.lineTo(c[0]+.5,s.y2)),n.stroke(),n.restore(),n.closePath(),{labelValue:r,position:c}},findSelectedItems(e){var i;(i=this.ensureHitCoordsFresh)==null||i.call(this);const t=[],n=Object.keys(this.seriesList);for(let s=0;s<n.length;s++){const l=n[s],a=this.seriesList[l],r=a.findItems;if(r){const c=r.call(a,e);c&&c.length&&t.push({seriesName:a.name,seriesId:l,items:c})}}return t},getSelectionRange({xsp:e,ysp:t,width:n,height:i,range:s}){var k,L,w,M;const l=this.axesSteps.x.length?this.axesSteps.x[0]:null,a=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!l||!a)return null;const r=e+n,c=t+i,d=l.graphMax-l.graphMin,h=a.graphMax-a.graphMin,u=this.getRatioInRange(s.x1,s.x2,e),m=this.getRatioInRange(s.x1,s.x2,r),f=this.getRatioInRange(s.y1,s.y2,c),g=this.getRatioInRange(s.y1,s.y2,t),p=this.isMobile&&((k=this.boxOverflow)!=null&&k.x1)?Math.min(this.minMax.x[0].min,l.graphMin):Math.max(l.graphMin+d*u,l.graphMin),y=this.isMobile&&((L=this.boxOverflow)!=null&&L.x2)?Math.max(this.minMax.x[0].max,l.graphMax):Math.min(l.graphMin+d*m,l.graphMax),C=this.isMobile&&((w=this.boxOverflow)!=null&&w.y2)?Math.min(this.minMax.y[0].min,a.graphMin):Math.max(a.graphMin+h*(1-f),a.graphMin),b=this.isMobile&&((M=this.boxOverflow)!=null&&M.y1)?Math.max(this.minMax.y[0].max,a.graphMax):Math.min(a.graphMin+h*(1-g),a.graphMax);return{xMin:+p.toFixed(3),xMax:+y.toFixed(3),yMin:+C.toFixed(3),yMax:+b.toFixed(3)}},getRatioInRange(e,t,n){const i=t-e;return(n-e)/i},getDragInfoForHeatMap(e){const t=Object.keys(this.seriesList)[0];return this.seriesList[t].findBlockRange(e)},getSelectionRangeForHeatMap(e){const t=this.axesSteps.x.length?this.axesSteps.x[0]:null,n=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!t||!n)return null;const i=Object.keys(this.seriesList)[0],{xMin:s,xMax:l,yMin:a,yMax:r}=this.seriesList[i].findSelectionRange(e)??{};return{xMin:s??t.graphMin,xMax:l??t.graphMax,yMin:a??n.graphMin,yMax:r??n.graphMax}},isDeselectItem(e){var t,n;return this.options.selectItem.useDeselectItem&&(e==null?void 0:e.dataIndex)===((t=this.defaultSelectItemInfo)==null?void 0:t.dataIndex)&&(e==null?void 0:e.sId)===((n=this.defaultSelectItemInfo)==null?void 0:n.seriesID)&&!isNaN(e==null?void 0:e.dataIndex)},getCurMouseLocation(e){const[t,n]=e,i={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},s=i[this.axesX[0].units.rectStart],l=i[this.axesX[0].units.rectEnd],a=i[this.axesY[0].units.rectStart],r=i[this.axesY[0].units.rectEnd];return It(t,this.chartRect.x1,i.x1)&&It(n,a,r)?"yAxis":It(t,s,l)&&It(n,i.y2,this.chartRect.y2)?"xAxis":It(t,i.x1,i.x2)&&It(n,i.y1,i.y2)?"chartBackground":"canvas"},isNotUseIndicator(){return this.options.type==="pie"||this.options.type==="scatter"||this.options.type==="heatMap"},clearSelectedLabelInfo(){this.defaultSelectInfo={dataIndex:[]}},clearSelectedItemInfo(){this.defaultSelectItemInfo=null}},Z1=()=>{const e=document.documentElement,t=window.scrollX??0,n=window.scrollY??0;return{left:t,top:n,right:t+((e==null?void 0:e.clientWidth)||window.innerWidth||0),bottom:n+((e==null?void 0:e.clientHeight)||window.innerHeight||0)}},X1=e=>Math.floor(e/16)*16,Rc=e=>Number.isFinite(e)?Math.max(0,Math.min(1,e)):1,Vc=(e,t,n,i,s)=>{const l=(e==null?void 0:e.graphMax)-(e==null?void 0:e.graphMin);if(!t||!Number.isFinite(l)||l<=0)return null;const a=Rc((t.min-e.graphMin)/l),r=Rc((t.max-e.graphMin)/l),c=Math.min(a,r),d=Math.max(a,r);return s?[Math.floor(n-i*d),Math.ceil(n-i*c)]:[Math.floor(n+i*c),Math.ceil(n+i*d)]},yl=8,Rs=50,Ti=17,N1=8,Vs=15,P1={createTooltipDOM(){var e,t;this.tooltipDOM=document.createElement("div"),this.tooltipDOM.className="ev-chart-tooltip",this.tooltipHeaderDOM=document.createElement("div"),this.tooltipHeaderDOM.className="ev-chart-tooltip-header",this.tooltipBodyDOM=document.createElement("div"),this.tooltipBodyDOM.className="ev-chart-tooltip-body",this.tooltipCanvas=document.createElement("canvas"),this.tooltipCanvas.className="ev-chart-tooltip-canvas",this.tooltipCtx=this.tooltipCanvas.getContext("2d"),this.tooltipDOM.style.display="none",(t=(e=this.options.tooltip)==null?void 0:e.formatter)!=null&&t.html||this.setDefaultTooltipLayout(),document.body.appendChild(this.tooltipDOM),this.options.tooltip.debouncedHide?this.hideTooltipDOM=vc(()=>{this.tooltipDOM.style.display="none",this.resetTooltipPlacement()},200):this.hideTooltipDOM=()=>{this.tooltipDOM.style.display="none",this.resetTooltipPlacement()},this.isInitTooltip=!0},setDefaultTooltipLayout(){this.tooltipBodyDOM.appendChild(this.tooltipCanvas),this.tooltipDOM.appendChild(this.tooltipHeaderDOM),this.tooltipDOM.appendChild(this.tooltipBodyDOM)},createPlotLabelTooltipDOM(){this.plotLabelTooltipDOM=document.createElement("div"),this.plotLabelTooltipDOM.className="ev-chart-plot-label-tooltip",this.plotLabelTooltipDOM.style.position="fixed",this.plotLabelTooltipDOM.style.display="none",this.plotLabelTooltipDOM.style.pointerEvents="none",this.plotLabelTooltipDOM.style.zIndex="1000",this.plotLabelTooltipDOM.style.whiteSpace="nowrap",document.body.appendChild(this.plotLabelTooltipDOM)},showPlotLabelTooltip(e,t){this.plotLabelTooltipDOM||this.createPlotLabelTooltipDOM();const n=this.plotLabelTooltipDOM,i=e.style??{},s=i.padding??{top:4,right:8,bottom:4,left:8},l=i.backgroundColor??"#4C4C4C";n.textContent=e.text,n.style.backgroundColor=l,n.style.color=i.fontColor??"#FFFFFF",n.style.border=`1px solid ${i.borderColor??l}`,n.style.borderRadius=`${i.borderRadius??4}px`,n.style.fontSize=`${i.fontSize??12}px`,n.style.fontWeight=`${i.fontWeight??400}`,n.style.fontFamily=i.fontFamily??"Roboto",n.style.padding=`${s.top}px ${s.right}px ${s.bottom}px ${s.left}px`,n.style.boxShadow=i.useShadow?`2px 2px 4px rgba(0, 0, 0, ${i.shadowOpacity??.25})`:"none",n.style.left=`${t.clientX+10}px`,n.style.top=`${t.clientY+10}px`,n.style.display="block"},hidePlotLabelTooltip(){this.plotLabelTooltipDOM&&(this.plotLabelTooltipDOM.style.display="none")},getFontStyle(e){var s,l;const t=(s=this.options)==null?void 0:s.tooltip,n=((l=t==null?void 0:t.fontSize)==null?void 0:l[e])??14,i=(t==null?void 0:t.fontFamily)??"Roboto";return`normal normal lighter ${Math.max(n,0)}px ${i}`},getTextHeight(){var e,t,n;return(((n=(t=(e=this.options)==null?void 0:e.tooltip)==null?void 0:t.fontSize)==null?void 0:n.contents)??14)+6},getColorMargin(){var e,t,n;return(((n=(t=(e=this.options)==null?void 0:e.tooltip)==null?void 0:t.fontSize)==null?void 0:n.contents)??14)+2},getBoxPadding(){var s,l;const{top:e=0,right:t=20,bottom:n=3,left:i=16}=((l=(s=this.options)==null?void 0:s.tooltip)==null?void 0:l.rowPadding)??{};return{t:e,l:i,b:n,r:t}},setTooltipLayoutPosition(e,t){var E,Z,W,R,X,G,N,P;const n=this.tooltipCtx,i=t.pageX,s=t.pageY,l=e.items,[a,r]=e.maxTip,d=Object.keys(l).length,h=this.getBoxPadding(),u=this.options.tooltip,m=this.getColorMargin(),f=e.hitId,g=l[f].data,p=l[f].axis,y=(E=u.formatter)==null?void 0:E.title;this.axesX.length&&this.axesY.length&&u.showHeader&&(y?this.tooltipHeaderDOM.textContent=y({x:g.x,y:g.y}):this.tooltipHeaderDOM.textContent=this.options.horizontal?this.axesY[p.y].getLabelFormat(g.y):this.axesX[p.x].getLabelFormat(g.x)),u.textOverflow&&this.tooltipHeaderDOM.classList.add(`ev-chart-tooltip-header--${u.textOverflow}`),this.tooltipHeaderDOM.style.visibility="hidden",n.save(),n.font=this.getFontStyle("contents");const b=!!this.options.horizontal?(W=(Z=l[e.hitId])==null?void 0:Z.data)==null?void 0:W.y:(X=(R=l[e.hitId])==null?void 0:R.data)==null?void 0:X.x,k=(b==null?void 0:b.length)>a.length?b:a,L=Math.round(n.measureText(k).width),w=Math.round(n.measureText(r).width),M=L+w+h.l+h.r+m+Rs+Ti,V=M>u.maxWidth?u.maxWidth:M;let S=u.textOverflow==="wrap"?0:d;if(u.textOverflow==="wrap"){const B=u.maxWidth-(Math.round(n.measureText(r).width)+h.l+h.r+m+Rs+Ti);Object.values(l).map(D=>D.name).forEach(D=>{if(n.measureText(D).width>B){let Y="";for(let F=0;F<D.length;F++){const O=D[F],z=`${Y}${O}`;n.measureText(z).width>B?(Y=O,S+=1):Y=z}}S+=1}),n.restore()}const x=h.t+S*this.getTextHeight()+d*yl+h.b;let I;u.useScrollbar&&x>u.maxHeight?(this.tooltipBodyDOM.style.overflowY="auto",I=u.maxHeight):(this.tooltipBodyDOM.style.overflowY="hidden",I=x),this.tooltipCanvas.width=V*this.pixelRatio,this.tooltipCanvas.height=x*this.pixelRatio,this.tooltipCanvas.style.width=`${V}px`,this.tooltipCanvas.style.height=`${x}px`,this.tooltipHeaderDOM.style.width=`${V}px`,this.tooltipHeaderDOM.style.height="auto",this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${I+6}px`,this.tooltipDOM.style.maxWidth="",this.tooltipDOM.style.display="block";const T=((G=this.tooltipDOM)==null?void 0:G.offsetHeight)||((N=this.tooltipHeaderDOM)==null?void 0:N.offsetHeight)+I+N1,v=((P=this.tooltipDOM)==null?void 0:P.offsetWidth)||V;this.placeTooltipDOM(i,s,v,T)},drawSeriesColorShape(e,t,n){var a,r;const i=(r=(a=this.options.tooltip)==null?void 0:a.fontSize)==null?void 0:r.contents,{x:s,y:l}=n;if(t==="circle"){e.beginPath();const c=i/2;e.arc(s,l-c/2,c,0,2*Math.PI),e.fill()}else{const c=i;e.fillRect(s-c/3,l-c/1.2,c,c)}},drawTooltip(e,t){const n=t,i=e.items,[,s]=e.maxTip,l=this.alignSeriesList(Object.keys(i)),a=this.getBoxPadding(),r=this.options.horizontal,c=this.options.tooltip,d=this.getTextHeight(),h=this.getColorMargin();this.axesX.length&&this.axesY.length&&c.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let u=2,m=2;u+=A.aliasPixel(u),m+=A.aliasPixel(m),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=Ti),u+=a.l,m+=a.t,n.font=this.getFontStyle("contents");const f=[];l.forEach(y=>{f.push({id:y,data:i[y].data,color:i[y].color,name:i[y].name,dataId:i[y].id})}),c.sortByValue&&f.sort((y,C)=>{let b=y.data.o,k=C.data.o;return b==null&&(b=r?y.data.x:y.data.y),k==null&&(k=r?C.data.x:C.data.y),k-b}),this.setTooltipDOMStyle(c);const g=this.tooltipDOM.offsetWidth;let p=1;for(let y=0;y<f.length;y++){const C=f[y].data,b=f[y].color,k=f[y].name,L=C.formatted;let w=u+4,M=m+p*d;w+=A.aliasPixel(w),M+=A.aliasPixel(M),n.beginPath(),typeof b!="string"?n.fillStyle=te.createGradient(n,r,{x:w-4,y:M,w:12,h:-12},b):n.fillStyle=b;const V={id:f[y].id,name:f[y].name,value:L,dataId:f[y].dataId};this.drawSeriesColorShape(n,c.colorShape,{x:w,y:M}),n.fillStyle=typeof c.fontColor.label=="function"?c.fontColor.label(V):c.fontColor.label??c.fontColor;const S=c.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-h-Rs,x=w+h,I=M;if(S>n.measureText(k).width)n.fillText(k,x,I);else if(c.textOverflow==="wrap"){let T="",v=I;for(let E=0;E<k.length;E++){const Z=k[E],W=`${T}${Z}`;n.measureText(W).width>S?(n.fillText(T,x,v),T=Z,p+=1,v+=d):T=W}n.fillText(T,x,v)}else{const T=A.truncateLabelWithEllipsis(k,S,n);n.fillText(T,x,I)}n.save(),n.fillStyle=typeof c.fontColor.value=="function"?c.fontColor.value(V):c.fontColor.value??c.fontColor,n.textAlign="right",n.fillText(L,g-a.r,M),n.restore(),n.closePath(),m+=yl,p+=1}n.restore()},drawToolTipForHeatMap(e,t){const n=t,i=e.items,s=e.hitId,l=i[s].data,a=i[s].axis,r=i[s].color,c=this.getBoxPadding(),d=this.options.horizontal,h=this.options.tooltip,u=Object.values(this.seriesList)[0],m=this.getTextHeight(),f=this.getColorMargin();let g=!1,p=l.formatted;const{colorState:y,isGradient:C}=u;if(C){const{min:M,max:V}=u.valueOpt,S=qe(l.o-M,V-M),{start:x,end:I}=y[0];g=x<=S&&S<=I||l.o===-1}else{const M=y.find(({id:V})=>V===l.cId);g=M==null?void 0:M.show,p=(M==null?void 0:M.label)??p}if(!g){this.tooltipClear();return}this.axesX.length&&this.axesY.length&&h.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none",this.setTooltipDOMStyle(h);const b=this.tooltipDOM.offsetWidth;n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(c.r+=Ti);const k=c.l+2,L=c.t+m+2;n.font=this.getFontStyle("contents"),n.beginPath(),typeof r!="string"?n.fillStyle=te.createGradient(n,d,{x:k,y:L,w:12,h:-12},r):n.fillStyle=r;const w={id:e.hitId,name:l.y,value:p,dataId:i[s].id};this.drawSeriesColorShape(n,h.colorShape,{x:k,y:L}),n.fillStyle=typeof h.fontColor.label=="function"?h.fontColor.label(w):h.fontColor.label??h.fontColor,this.axesY.length&&n.fillText(this.axesY[a.y].getLabelFormat(l.y),k+f,L),n.textAlign="right",n.fillStyle=typeof h.fontColor.value=="function"?h.fontColor.value(w):h.fontColor.value??h.fontColor,n.fillText(p,b-c.r,L),n.closePath()},drawTooltipForScatter(e,t){const n=t,i=e.items,[,s]=e.maxTip,l=this.alignSeriesList(Object.keys(i)),a=this.getBoxPadding(),r=this.options.tooltip,c=this.getTextHeight(),d=this.getColorMargin();this.axesX.length&&this.axesY.length&&r.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let h=2,u=2;h+=A.aliasPixel(h),u+=A.aliasPixel(u),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=Ti),h+=a.l,u+=a.t,n.font=this.getFontStyle("contents");const m=[];l.forEach(p=>{m.push({data:i[p].data,color:i[p].color,name:i[p].name})}),r.sortByValue&&m.sort((p,y)=>{let C=p.data.o,b=y.data.o;return C==null&&(C=p.data.y),b==null&&(b=y.data.y),b-C}),this.setTooltipDOMStyle(r);const f=this.tooltipDOM.offsetWidth;let g=1;for(let p=0;p<m.length;p++){const y=m[p].data,C=m[p].color,b=m[p].name,k=y.formatted;let L=h+4,w=u+g*c;L+=A.aliasPixel(L),w+=A.aliasPixel(w),n.beginPath(),typeof C!="string"?n.fillStyle=te.createGradient(n,!1,{x:L-4,y:w,w:12,h:-12},C):n.fillStyle=C;const M={id:e.hitId,name:m[p].name,value:k,dataId:m[p].dataId};this.drawSeriesColorShape(n,r.colorShape,{x:L,y:w}),n.fillStyle=typeof r.fontColor.label=="function"?r.fontColor.label(M):r.fontColor.label??r.fontColor;const V=r.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-d-Rs,S=L+d,x=w;if(V>n.measureText(b).width)n.fillText(b,S,x);else if(r.textOverflow==="wrap"){let I="",T=x;for(let v=0;v<b.length;v++){const E=b[v],Z=`${I}${E}`;n.measureText(Z).width>V?(n.fillText(I,S,T),I=E,g+=1,T+=c):I=Z}n.fillText(I,S,T)}else{const I=A.truncateLabelWithEllipsis(b,V,n);n.fillText(I,S,x)}n.save(),n.textAlign="right",n.fillStyle=typeof r.fontColor.value=="function"?r.fontColor.value(M):r.fontColor.value??r.fontColor,n.fillText(k,f-a.r,w),n.restore(),n.closePath(),u+=yl,g+=1}n.restore()},setCustomTooltipLayoutPosition(e,t){var r;const n=t.pageX,i=t.pageY;if(!this.tooltipDOM)return;let s=this.tooltipDOM.firstElementChild;if(!s&&(e!=null&&e.items)&&Object.keys(e.items).length&&(this.drawCustomTooltip(e.items),s=this.tooltipDOM.firstElementChild),!s)return;this.tooltipDOM.style.maxWidth="",this.tooltipDOM.style.display="block";const l=s.offsetHeight;this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${l+6}px`;const a=(r=this.tooltipDOM)==null?void 0:r.getBoundingClientRect();this.placeTooltipDOM(n,i,a==null?void 0:a.width,a==null?void 0:a.height)},placeTooltipDOM(e,t,n,i){var L,w;(w=(L=this.hideTooltipDOM)==null?void 0:L.cancel)==null||w.call(L);const s=Z1(),l=20,a=e+l,r=e-l,c=s.right-a,d=r-s.left,h=n<=c,u=n<=d;let m;!h&&!u?m=d>c:m=this._tooltipFlipX?u:!h,this._tooltipFlipX=m;const f=m?r:a,g=t+l,p=s.bottom-g,y=t-l-s.top,b=i>p&&y>p?Math.max(s.top,t-i-l):g,k=m?d:c;this.tooltipDOM.style.maxWidth=`${n<=k?k:X1(k)}px`,this.tooltipDOM.style.transform=m?`translate3d(${f}px, ${b}px, 0) translateX(-100%)`:`translate3d(${f}px, ${b}px, 0)`},resetTooltipPlacement(){this._tooltipFlipX=!1},drawCustomTooltip(e){var l,a,r,c,d;const t=(l=this.options)==null?void 0:l.tooltip;if(!((a=t==null?void 0:t.formatter)!=null&&a.html))return;this.tooltipDOM.style.maxWidth="";const n=Object.keys(e).length;if((r=this._shouldVirtualizeCustomTooltip)!=null&&r.call(this,n)&&this.drawCustomTooltipVirtual(e))return;(c=this._teardownCustomTooltipVirtualScroll)==null||c.call(this),this.tooltipDOM.innerHTML="";const i=[];Object.keys(e).forEach(h=>{i.push({sId:h,data:e[h].data,color:e[h].color,name:e[h].name,dataId:e[h].id,index:e[h].index})});const s=A.htmlToElement(t.formatter.html(i));s&&this.tooltipDOM.appendChild(s),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=t.backgroundColor,this.tooltipDOM.style.border=`1px solid ${t.borderColor}`,this.tooltipDOM.style.color=((d=t.fontColor)==null?void 0:d.title)??t.fontColor},setTooltipDOMStyle(e){var t;if(this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=e.backgroundColor,this.tooltipDOM.style.border=`1px solid ${e.borderColor}`,this.tooltipDOM.style.color=((t=e.fontColor)==null?void 0:t.title)??e.fontColor,this.tooltipHeaderDOM.style.fontSize=`${e.fontSize.title}px`,this.tooltipHeaderDOM.style.fontFamily=this.getFontStyle("title"),e.useShadow){const n=`rgba(0, 0, 0, ${e.shadowOpacity})`;this.tooltipDOM.style.boxShadow=`2px 2px 2px ${n}`}this.tooltipDOM.style.display="block"},drawItemsHighlight(e,t){Object.keys(e.items).forEach(n=>{var s;const i=this.seriesList[n];i.itemHighlight(e.items[n],t,e.items[n].index,(s=this.options)==null?void 0:s.unSelectedOpacity),A.isDoughnutHole(i.type)&&this.drawDoughnutHole(t)})},getIndicatorHitBounds(){var h,u,m,f,g,p;const e=this.options,t=this.chartRect.x1+this.labelOffset.left,n=this.chartRect.x2-this.labelOffset.right,i=this.chartRect.y1+this.labelOffset.top,s=this.chartRect.y2-this.labelOffset.bottom;let l=1/0,a=-1/0,r=1/0,c=-1/0,d=!1;if(e.horizontal){const y=((h=this.axesSteps)==null?void 0:h.y)||[];for(let C=0;C<y.length;C+=1){const b=Vc(y[C],(m=(u=this.axesRange)==null?void 0:u.y)==null?void 0:m[C],s,s-i,!0);b?(r=Math.min(r,b[0]),c=Math.max(c,b[1])):d=!0}(d||!Number.isFinite(r))&&(r=i,c=s)}else{const y=((f=this.axesSteps)==null?void 0:f.x)||[];for(let C=0;C<y.length;C+=1){const b=Vc(y[C],(p=(g=this.axesRange)==null?void 0:g.x)==null?void 0:p[C],t,n-t,!1);b?(l=Math.min(l,b[0]),a=Math.max(a,b[1])):d=!0}(d||!Number.isFinite(l))&&(l=t,a=n)}return{x1:t,x2:n,y1:i,y2:s,hitXMin:e.horizontal?t-Vs:l,hitXMax:e.horizontal?n+Vs:a,hitYMin:e.horizontal?r:i-Vs,hitYMax:e.horizontal?c:s+Vs}},drawIndicator(e,t){var r;const n=this.overlayCtx,[i,s]=e,l=this.options,a=this.getIndicatorHitBounds();i>=a.hitXMin&&i<=a.hitXMax&&s>=a.hitYMin&&s<=a.hitYMax&&(n.beginPath(),n.save(),n.strokeStyle=t,n.lineWidth=1,(r=l.indicator)!=null&&r.segments&&n.setLineDash(l.indicator.segments),l.horizontal?(n.moveTo(a.x1,s+.5),n.lineTo(a.x2,s+.5)):(n.moveTo(i+.5,a.y1),n.lineTo(i+.5,a.y2)),n.stroke(),n.restore(),n.closePath())},getTimeLabel(e){var u,m,f,g;const t=this.options;if(t.syncHover===!1||!t.horizontal&&!t.axesX.every(({type:p})=>p==="time")||t.horizontal&&!t.axesY.every(({type:p})=>p==="time"))return null;const n=+((u=this.data.labels)==null?void 0:u[0]),i=+((m=this.data.labels)==null?void 0:m[this.data.labels.length-1]);if(n==null||i==null)return null;const[s,l]=e,a={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(t.horizontal?(f=t.axesY)==null?void 0:f.every(p=>p.categoryMode):(g=t.axesX)==null?void 0:g.every(p=>p.categoryMode)){const p=this.data.labels.length;if(!p)return null;let y;if(t.horizontal){const b=a.y2-a.y1;y=(l-a.y1)/b}else{const b=a.x2-a.x1;y=(s-a.x1)/b}const C=Math.min(Math.max(Math.floor(y*p),0),p-1);return+this.data.labels[C]}if(t.horizontal){const p=a.y2-a.y1,C=(l-a.y1)*(i-n)/p+n;return Math.round(C)}const c=a.x2-a.x1,h=(s-a.x1)*(i-n)/c+n;return Math.round(h)},drawSyncedIndicator({horizontal:e,label:t,mousePosition:n,dataLabel:i}){var g,p;if(!this._canDrawSyncedIndicator(e,n))return;if(i){this.drawSyncedIndicatorForTooltip({dataLabel:i,mousePosition:n});return}const s=+((g=this.data.labels)==null?void 0:g[0]),l=+((p=this.data.labels)==null?void 0:p[this.data.labels.length-1]),[a,r]=n,{top:c,bottom:d,left:h,right:u}=this.getChartDOMClientRect();if(It(a,h,u)&&It(r,d,c))return;this.overlayClear();const f={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(e){const C=(f.y2-f.y1)*(t-s)/(l-s)+f.y1;this.drawIndicator([f.x2,C],this.options.indicator.color)}else{const C=(f.x2-f.x1)*(t-s)/(l-s)+f.x1;this.drawIndicator([C,f.y2],this.options.indicator.color)}},_canDrawSyncedIndicator(e,t){return!t||!!e!=!!this.options.horizontal?!1:this._isTimeBasedSyncEnabled(e)&&this._hasValidTimeRange()},_isTimeBasedSyncEnabled(e){var n,i;return this.options.syncHover===!1||!((i=(n=this.data)==null?void 0:n.labels)!=null&&i.length)?!1:e?this.options.axesY.every(({type:s})=>s==="time"):this.options.axesX.every(({type:s})=>s==="time")},_hasValidTimeRange(){var n,i;const e=+((n=this.data.labels)==null?void 0:n[0]),t=+((i=this.data.labels)==null?void 0:i[this.data.labels.length-1]);return e!=null&&t!=null},drawSyncedIndicatorForTooltip({dataLabel:e,mousePosition:t}){var u,m,f,g,p,y,C,b,k,L,w,M,V;if(!((u=this.data)!=null&&u.labels)||!e)return;const n=this.data.labels.findIndex(S=>(S==null?void 0:S.valueOf())===(e==null?void 0:e.valueOf()));if(n===-1){this.overlayClear();return}const{horizontal:i}=this.options,s=this.getChartDOMClientRect(),[l,a]=t;if(It(l,s.left,s.right)&&It(a,s.bottom,s.top))return;this.overlayClear();const c={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},d=this.data.labels.length;let h;if(i){const S=c.y2-c.y1,x=(m=this.options.axesY)==null?void 0:m.some(v=>v.categoryMode),I=(f=this.options.axesY)==null?void 0:f.some(v=>v.type==="time");let T;if(x)T=c.y1+S*(n+.5)/d;else if(I){const v=(p=(g=this.axesSteps)==null?void 0:g.y)==null?void 0:p[0],E=(v==null?void 0:v.graphMin)??+((y=this.data.labels)==null?void 0:y[0]),Z=(v==null?void 0:v.graphMax)??+((C=this.data.labels)==null?void 0:C[this.data.labels.length-1]);T=c.y1+S*(+e-E)/(Z-E)}else T=c.y1+S*n/(d-1);h=[c.x2,T]}else{const S=c.x2-c.x1,x=(b=this.options.axesX)==null?void 0:b.some(v=>v.categoryMode),I=(k=this.options.axesX)==null?void 0:k.some(v=>v.type==="time");let T;if(x)T=c.x1+S*(n+.5)/d;else if(I){const v=(w=(L=this.axesSteps)==null?void 0:L.x)==null?void 0:w[0],E=(v==null?void 0:v.graphMin)??+((M=this.data.labels)==null?void 0:M[0]),Z=(v==null?void 0:v.graphMax)??+((V=this.data.labels)==null?void 0:V[this.data.labels.length-1]);T=c.x1+S*(+e-E)/(Z-E)}else T=c.x1+S*n/(d-1);h=[T,c.y2]}this.drawIndicator(h,this.options.indicator.color)},tooltipClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.tooltipCtx.clearRect(0,0,this.tooltipCanvas.width/this.clearRectRatio,this.tooltipCanvas.height/this.clearRectRatio),this.tooltipDOM.style.display="none",this.resetTooltipPlacement()},alignSeriesList(e){const t=this.data.groups,n=this.seriesList,i=[];return t.forEach(s=>{s.slice().reverse().forEach(l=>{const a=n[l];a&&a.showLegend&&e.includes(l)&&i.push(l)})}),Object.keys(n).forEach(s=>{const l=n[s];!l.isExistGrp&&l.showLegend&&e.includes(s)&&i.push(s)}),i},tooltipDestroy(){var e;(e=this._teardownCustomTooltipVirtualScroll)==null||e.call(this),this.tooltipDOM&&(this.tooltipDOM.remove(),this.tooltipDOM=null),this.plotLabelTooltipDOM&&(this.plotLabelTooltipDOM.remove(),this.plotLabelTooltipDOM=null),this.isInitTooltip=!1}},D1=480,B1=28,O1=5,Y1=50,F1={_shouldVirtualizeCustomTooltip(e){var i,s;if(this._vsDetectFailed)return!1;const t=(i=this.options)==null?void 0:i.tooltip;if(!((s=t==null?void 0:t.formatter)!=null&&s.html))return!1;const n=t.virtualScroll;return!n||n.use===!1?!1:n.use===!0?e>0:e>=(n.threshold??Y1)},_findCustomTooltipContainer(e,t){if(!e||!e.querySelectorAll)return null;const n=e.querySelectorAll("[data-evui-tooltip-row]");if(n.length===t&&n.length>0){const s=n[0].parentElement;let l=!!s;for(let a=1;a<n.length;a++)if(n[a].parentElement!==s){l=!1;break}if(l)return s}const i=[e];for(;i.length;){const s=i.shift();if(s.children&&s.children.length===t)return s;if(s.children)for(let l=0;l<s.children.length;l++)i.push(s.children[l])}return null},_createVirtualScrollAnatomy(){const e=document.createElement("div");e.className="ev-chart-tooltip-virtual__spacer",e.setAttribute("aria-hidden","true");const t=document.createElement("div");t.className="ev-chart-tooltip-virtual__viewport";const n=document.createElement("div");return n.className="ev-chart-tooltip-virtual__spacer",n.setAttribute("aria-hidden","true"),{topSpacer:e,viewport:t,bottomSpacer:n}},_recomputeCustomTooltipPrefixSums(){const e=this.vsState,t=e.heights.length;e.prefixSums.length!==t+1&&(e.prefixSums=new Array(t+1));let n=0;e.prefixSums[0]=0;for(let i=0;i<t;i++)n+=e.heights[i],e.prefixSums[i+1]=n;e.totalHeight=n},_computeCustomTooltipVisibleRange(){const e=this.vsState,t=e.heights.length;if(!t)return{start:0,end:-1};const n=e.scrollEl.clientHeight||e.maxHeight,i=e.scrollEl.scrollTop;let s=0,l=t;for(;s<l;){const d=s+l>>>1;e.prefixSums[d+1]>i?l=d:s=d+1}const a=Math.max(0,s-e.overscan),r=i+n;for(s=a,l=t;s<l;){const d=s+l>>>1;e.prefixSums[d]>=r?l=d:s=d+1}const c=Math.min(t-1,s+e.overscan);return{start:a,end:c}},_syncCustomTooltipSpacers(){const e=this.vsState,t=e.prefixSums[e.range.start]||0,n=Math.max(0,e.totalHeight-(e.prefixSums[e.range.end+1]||e.totalHeight)),i=`${t}px`,s=`${n}px`;e.topSpacer.style.height!==i&&(e.topSpacer.style.height=i),e.bottomSpacer.style.height!==s&&(e.bottomSpacer.style.height=s)},_renderVisibleCustomTooltipRows(){const e=this.vsState;if(!e||!e.items.length)return;const t=this._computeCustomTooltipVisibleRange();if(e.range.start===t.start&&e.range.end===t.end)e.range=t;else{for(;e.viewport.firstChild;)e.viewport.removeChild(e.viewport.firstChild);const s=document.createDocumentFragment();for(let l=t.start;l<=t.end;l++){const a=e.items[l];a&&s.appendChild(a)}e.viewport.appendChild(s),e.range=t}this._syncCustomTooltipSpacers();let i=!1;for(let s=t.start;s<=t.end;s++)if(!e.measured[s]){i=!0;break}if(i){const s=e.measureDepth||0;if(s<2){e.measureDepth=s+1;try{this._measureVisibleCustomTooltipRows()}finally{e.measureDepth=s}}}},_measureVisibleCustomTooltipRows(){const e=this.vsState;if(!e||!e.viewport)return;const t=e.viewport.children,n=t.length;if(!n)return;const i=e.range.start,s=e.prefixSums[i]||0;let l=!1,a=0,r=0;for(let c=0;c<n;c++){const d=e.range.start+c,h=t[c].offsetHeight;h>0&&(h!==e.heights[d]&&(e.heights[d]=h,l=!0),e.measured[d]=!0),e.isRow[d]&&h>0&&(a+=h,r+=1)}if(r>0){const c=a/r;if(e.learnedAverageHeight=c,c>0&&Math.abs(c-e.estimatedRowHeight)>.5){e.estimatedRowHeight=c;for(let d=0;d<e.heights.length;d++)e.isRow[d]&&!e.measured[d]&&e.heights[d]!==c&&(e.heights[d]=c,l=!0)}}if(l){this._recomputeCustomTooltipPrefixSums();const d=(e.prefixSums[i]||0)-s;d!==0&&(e.suppressScroll=!0,e.scrollEl.scrollTop+=d,requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.vsState&&(this.vsState.suppressScroll=!1)})})),this._renderVisibleCustomTooltipRows()}else this._syncCustomTooltipSpacers()},drawCustomTooltipVirtual(e){var b,k,L;const t=(b=this.options)==null?void 0:b.tooltip;if(!((k=t==null?void 0:t.formatter)!=null&&k.html))return!1;const n=[];Object.keys(e).forEach(w=>{n.push({sId:w,data:e[w].data,color:e[w].color,name:e[w].name,dataId:e[w].id,index:e[w].index})});let i;try{i=t.formatter.html(n)}catch(w){return console.warn("[evui] tooltip.formatter.html threw, falling back:",w),!1}const s=A.htmlToElement(i);if(!s||!s.children)return!1;const l=this._findCustomTooltipContainer(s,n.length);if(!l)return this._vsDetectFailed=!0,this._vsWarnedFallback||(this._vsWarnedFallback=!0,console.warn("[evui] tooltip.virtualScroll: formatter.html 반환 구조에서 row를 식별하지 못해 가상 스크롤을 건너뜁니다. 시리즈당 wrapper element에 `data-evui-tooltip-row` 속성을 추가하거나, row 컨테이너 직속 자식이 시리즈 수와 일치하도록 마크업을 정리하세요.")),!1;const a=Array.from(l.children);if(!a.length)return!1;const r=w=>!!(w.hasAttribute&&w.hasAttribute("data-evui-tooltip-row")),c=a.some(r),d=a.map(w=>c?r(w):!0);for(let w=0;w<a.length;w++){const M=a[w];M.parentNode&&M.parentNode.removeChild(M)}for(;l.firstChild;)l.removeChild(l.firstChild);const{topSpacer:h,viewport:u,bottomSpacer:m}=this._createVirtualScrollAnatomy();l.appendChild(h),l.appendChild(u),l.appendChild(m);const f=t.maxHeight||D1;l.style.maxHeight=`${f}px`,l.style.overflowY="auto",l.style.overflowX="hidden",l.style.overflowAnchor="none",this._teardownCustomTooltipVirtualScroll();const g=t.virtualScroll||{},p=this._vsLearnedAverageHeight,y=p??g.estimatedRowHeight??B1;this.vsState={scrollEl:l,topSpacer:h,viewport:u,bottomSpacer:m,items:a,isRow:d,heights:new Array(a.length).fill(y),measured:new Array(a.length).fill(!1),prefixSums:[],totalHeight:0,range:{start:0,end:-1},estimatedRowHeight:y,overscan:g.overscan??O1,maxHeight:f,rafPending:!1,suppressScroll:!1,learnedAverageHeight:p,resizeObserver:null,onScroll:null},this._recomputeCustomTooltipPrefixSums();const C=()=>{this.vsState&&(this.vsState.suppressScroll||this.vsState.rafPending||(this.vsState.rafPending=!0,requestAnimationFrame(()=>{this.vsState&&(this.vsState.rafPending=!1,this._renderVisibleCustomTooltipRows())})))};if(l.addEventListener("scroll",C,{passive:!0}),this.vsState.onScroll=C,typeof ResizeObserver<"u"){let w=l.clientWidth;const M=new ResizeObserver(()=>{if(!this.vsState)return;const V=l.clientWidth;V!==w&&(w=V,this.vsState.measured.fill(!1),this.vsState.heights.fill(this.vsState.estimatedRowHeight),this._recomputeCustomTooltipPrefixSums(),this._renderVisibleCustomTooltipRows())});M.observe(l),this.vsState.resizeObserver=M}for(;this.tooltipDOM.firstChild;)this.tooltipDOM.removeChild(this.tooltipDOM.firstChild);return this.tooltipDOM.appendChild(s),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=t.backgroundColor,this.tooltipDOM.style.border=`1px solid ${t.borderColor}`,this.tooltipDOM.style.color=((L=t.fontColor)==null?void 0:L.title)??t.fontColor,this._renderVisibleCustomTooltipRows(),!0},_teardownCustomTooltipVirtualScroll(){const e=this.vsState;e&&(e.scrollEl&&e.onScroll&&e.scrollEl.removeEventListener("scroll",e.onScroll),e.resizeObserver&&e.resizeObserver.disconnect(),e.learnedAverageHeight&&(this._vsLearnedAverageHeight=e.learnedAverageHeight),this.vsState=null)}},H1={pieDataSet:[],drawPie(e,t=this.bufferCtx){var L;const n=this.chartRect,i=this.pieDataSet,s=this.options,l=this.options.padding,a=!!s.doughnutHoleSize;let r,c,d,h=1.5*Math.PI,u,m,f;const g=n.width/2,p=n.height/2,y=g-(l.left+l.right),C=p-(l.bottom+l.top);if(typeof y=="number"&&y<0||typeof C=="number"&&C<0)return;const b=Math.min(y,C)*s.doughnutHoleSize,k=Math.min(y,C);for(let w=0;w<i.length;w++){const M=i[w];if(!M)return;let V=k-(k-b)/i.length*w;if((L=s==null?void 0:s.pieStroke)!=null&&L.use&&(V-=s.pieStroke.lineWidth),V<0)return;if(M.or=V,w<i.length-1?M.ir=k-(k-b)/i.length*(w+1):M.ir=1,M.total){for(let S=0;S<M.data.length;S++)if(r=M.data[S],c=r.value,f=c/M.total*100,d=2*Math.PI*(c/M.total),u=h+d,r.sa=h,r.ea=u,m=this.seriesList[r.id],c){const x={...s.pieStroke};M.data.length===1&&s.pieStroke.use&&(x.use=!1,t.lineWidth=s.pieStroke.lineWidth,t.strokeStyle=s.pieStroke.color,t.arc(g,p,V,0,2*Math.PI),t.stroke());const{selectInfo:I,legendHitInfo:T,unSelectedOpacity:v}=e;m.isSelect=(I==null?void 0:I.sId)===r.id,m.isDownplay=T&&T.sId!==r.id,m.type=a?"doughnut":"pie",m.centerX=g,m.centerY=p,m.radius=V,m.doughnutHoleSize=V*(s.doughnutHoleSize??0),m.startAngle=h,m.endAngle=u,m.data={o:c,percentage:f},m.draw(t,x,v),h+=d}}}},drawSunburst(e,t=this.bufferCtx){var p;const{width:n,height:i}=this.chartRect,s=this.pieDataSet,l=this.options,a=this.options.padding;this.calculateAngle();let r,c;const d=n/2,h=i/2,u=d-(a.left+a.right),m=h-(a.bottom+a.top);if(typeof u=="number"&&u<0||typeof m=="number"&&m<0)return;const f=Math.min(u,m)*l.doughnutHoleSize,g=Math.min(u,m);for(let y=0;y<s.length;y++){const C=s[y];if(!C)return;let b=g-(g-f)/s.length*y;if((p=l==null?void 0:l.pieStroke)!=null&&p.use&&(b-=l.pieStroke.lineWidth),b<0)return;C.or=b,y<s.length-1?C.ir=g-(g-f)/s.length*(y+1):C.ir=1;for(let k=0;k<C.data.length;k++)if(r=C.data[k],r.id==="dummy")t.save(),t.globalCompositeOperation="destination-out",t.beginPath(),t.fillStyle="#fff",t.lineWidth=2,t.strokeStyle="#fff",t.moveTo(d,h),t.arc(d,h,b,r.sa,r.ea),t.stroke(),t.fill(),t.closePath(),t.restore();else if(c=this.seriesList[r.id],r.value){const L={...l.pieStroke};C.data.length===1&&l.pieStroke.use&&(L.use=!1,t.lineWidth=l.pieStroke.lineWidth,t.strokeStyle=l.pieStroke.color,t.arc(d,h,b,0,2*Math.PI),t.stroke());const{selectInfo:w,legendHitInfo:M,unSelectedOpacity:V}=e;c.isSelect=(w==null?void 0:w.sId)===r.id,c.isDownplay=M&&M.sId!==r.id,c.type="sunburst",c.centerX=d,c.centerY=h,c.radius=b,c.doughnutHoleSize=b*(l.doughnutHoleSize??0),c.startAngle=r.sa,c.endAngle=r.ea,c.data={o:r.value},c.draw(t,L,V)}}},drawDoughnutHole(e=this.bufferCtx){var h;const t=this.options,{width:n,height:i}=this.chartRect,s=this.options.padding,l=n/2,a=i/2,r=l-(s.left+s.right),c=a-(s.bottom+s.top);if(typeof r=="number"&&r<0||typeof c=="number"&&c<0)return;const d=Math.min(r,c)*t.doughnutHoleSize;e.save(),e.globalCompositeOperation="destination-out",e.beginPath(),e.fillStyle="#fff",e.fillOpacity=0,e.arc(l,a,d,0,2*Math.PI),e.fill(),e.strokeStyle="#fff",e.stroke(),e.closePath(),e.restore(),(h=t==null?void 0:t.pieStroke)!=null&&h.use&&(e.beginPath(),e.strokeStyle=t.pieStroke.color,e.lineWidth=t.pieStroke.lineWidth,e.arc(l,a,d,0,Math.PI*2),e.stroke(),e.closePath()),this.pieDataSet[this.pieDataSet.length-1].ir=d}},z1={drawTips(e,t=this.bufferCtx){var u,m,f,g,p,y,C,b;const n=this.options;let i=null;const s=!!n.horizontal,l=n.maxTip,a=n.selectItem,r=n.selectLabel;let c,d;typeof((u=n.tooltip)==null?void 0:u.formatter)=="function"?i=(m=n.tooltip)==null?void 0:m.formatter:typeof((g=(f=n.tooltip)==null?void 0:f.formatter)==null?void 0:g.value)=="function"&&(i=(y=(p=n.tooltip)==null?void 0:p.formatter)==null?void 0:y.value),r.use&&r.showTip&&(d=n.type==="heatMap"?this.drawLabelTipForHeatMap(t):this.drawTipForSelectedLabel(t));const h=k=>{e.forEach(L=>{if(L){const w=this.seriesList[L==null?void 0:L.sId];if(!(w!=null&&w.show))return;const M=this.calculateTipInfo(w,"sel",L);if(M&&M.dp!==null){let V=!1;if(l.use&&(c==null?void 0:c.dp)===M.dp&&(V=!0),k.showTextTip||k.showTip){if(k.tipText==="label"){const S=s?n.axesY[0]:n.axesX[0],x=M.label;M.text=S.type==="time"?We(x).format(S.timeFormat):x}else M.text=sn(M.value);this.drawTextTip({opt:k,tipType:"sel",seriesOpt:w,isSamePos:V,ctx:t,...M})}k.showIndicator&&this.drawFixedIndicator({opt:k,seriesOpt:w,ctx:t,...M})}L&&(L!=null&&L.label)&&(L==null?void 0:L.label)===0&&(this.lastHitInfo=L)}})};if(e&&!d&&(a.use?h(a):r.use&&n.type==="line"&&h(r)),l.use&&!d){const k=s?this.axesSteps.y[0]:this.axesSteps.x[0],L=k==null?void 0:k.minIndex,w=k==null?void 0:k.maxIndex,M=(b=(C=s?this.axesY[0]:this.axesX[0])==null?void 0:C.labels)==null?void 0:b.length,V=Number.isFinite(M)?M-1:w,S=Number.isFinite(L)&&Number.isFinite(w),x=S&&w<L,I=S&&(L>0||w<V);let T,v=null;x?T=void 0:I?(v=this.getVisibleWindowMaxSeries(L,w),T=v==null?void 0:v.sId):T=this.minMax[s?"x":"y"][0].maxSID;const E=T?this.seriesList[T]:null;E&&(c=this.calculateTipInfo(E,"max",v),l.use&&c&&c.dp!==null&&(i?c.text=i({seriesId:E.sId,x:s?c.value:void 0,y:s?void 0:c.value}):c.text=sn(c.value),this.drawTextTip({opt:l,tipType:"max",seriesOpt:E,ctx:t,...c}),l.showIndicator&&this.drawFixedIndicator({opt:l,seriesOpt:E,ctx:t,...c})))}},calculateTipInfo(e,t,n){if(!e)return!1;const i=!!this.options.horizontal,s=this.lastTip,l=this.chartRect,a=this.labelOffset,r={x1:l.x1+a.left,x2:l.x2-a.right,y1:l.y1+a.top,y2:l.y2-a.bottom},c=l.chartHeight-(a.top+a.bottom),d=l.chartWidth-(a.left+a.right),h=this.axesSteps.x[e.xAxisIndex],u=this.axesSteps.y[e.yAxisIndex],m=r.x1,f=r.x2,g=r.y2,{type:p,size:y}=e,{maxDomain:C,maxDomainIndex:b}=e.minMax;if(C===null||b<0)return!1;const k=p==="bar"?n==null?void 0:n.index:n==null?void 0:n.domain,L=t==="max"&&n&&Number.isFinite(k)&&Number.isFinite(n.value);let w;L?w=k:w=p==="bar"?b:C,t==="sel"&&(n&&n.label!==null?(s.pos=p==="bar"?n.dataIndex:n.label,w=s.pos):s.pos!==null&&(w=s.pos));let M;L?M=n.value:M=i?e.minMax.maxX:e.minMax.maxY;let V;if(t==="sel"){if(n&&n.label!==null)V=n.label,n.value!==null?(M=n.useStack?n.acc:n.value,s.value=M):s.value!==null&&(M=s.value),s.label=V;else if(s.value!==null)M=s.value,V=s.label;else if(s.pos!==null){const Z=p==="bar"?"getItemByLabelIndex":"getItemByLabel";if(typeof this[Z]=="function"){const W=this[Z](s.pos);M=W.useStack?W.acc:W.value,V=W.label,s.value=M,s.label=V}}}const S=i?h.graphMax:u.graphMax;if((t==="max"||t==="sel")&&M>S&&!this.options.displayOverflow)return!1;let x,I,T;if(p==="bar"){const Z=i?this.scrollbar.y:this.scrollbar.x;if(Z!=null&&Z.use){const[W,R]=(Z==null?void 0:Z.range)??[];if(w>=W&&w<=R)w-=W??0;else return!1}else{const W=i?u:h,{minIndex:R,maxIndex:X}=W??{};if(Number.isFinite(R)&&Number.isFinite(X))if(w>=R&&w<=X)w-=R;else return!1}i?(I=Math.round(y.h/2),x=g-y.cat*w-y.cPad,T=x-(y.bar*y.ix-(y.h+y.bPad))-I):(I=Math.round(y.w/2),x=m+y.cat*w+y.cPad,T=x+(y.bar*y.ix-(y.w+y.bPad))+I)}else p==="line"?T=te.calculateX(w,h.graphMin,h.graphMax,d-y.comboOffset,m+y.comboOffset/2):p==="scatter"&&(T=te.calculateX(w,h.graphMin,h.graphMax,d,m));return{...{xArea:d,yArea:c,graphX:h,graphY:u,xsp:m,xep:f,ysp:g},...{dp:T,value:M,label:V,type:p}}},drawFixedIndicator(e){const t=!!this.options.horizontal,n=e.ctx??this.bufferCtx,{graphX:i,graphY:s,xArea:l,yArea:a,xsp:r,ysp:c,dp:d,type:h,value:u,opt:m,seriesOpt:f}=e;let g=0;h==="line"?g+=3:h==="scatter"&&(g+=(f==null?void 0:f.pointSize)??0);let p;if(m.fixedPosTop)t?p=te.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r):(p=te.calculateY(s.graphMax,s.graphMin,s.graphMax,a,c),p-=g);else if(t){const y=Math.min(Math.max(u,i.graphMin),i.graphMax);p=te.calculateX(y,i.graphMin,i.graphMax,l,r)}else{const y=Math.min(Math.max(u,s.graphMin),s.graphMax);p=te.calculateY(y,s.graphMin,s.graphMax,a,c),p-=g}d!==null&&(n.beginPath(),n.save(),n.strokeStyle=m.indicatorColor,n.lineWidth=2,t?(n.moveTo(r,d),n.lineTo(p,d)):(n.moveTo(d,c),n.lineTo(d,p)),n.stroke(),n.restore(),n.closePath())},drawTipForSelectedLabel(e=this.bufferCtx){var c,d;const t=this.options,n=!!t.horizontal,i=t.selectLabel,{dataIndex:s,data:l,label:a}=this.defaultSelectInfo;let r=!1;if(s.length){r=!0;const h=this.chartRect,u=this.labelOffset,m={x1:h.x1+u.left,x2:h.x2-u.right,y1:h.y1+u.top,y2:h.y2-u.bottom},f=n?this.axesY[0]:this.axesX[0],g=n?this.axesX[0]:this.axesY[0],p=n?this.axesSteps.x[0]:this.axesSteps.y[0],y=n?te.calculateX:te.calculateY,C=n?te.calculateY:te.calculateX,b=n?this.scrollbar.y:this.scrollbar.x,k=h.chartWidth-(u.left+u.right),L=h.chartHeight-(u.top+u.bottom),w=n?k:L,M=m[g.units.rectStart];let V=this.options.type==="bar"?4:6;V*=n?1:-1;const S=Object.keys(this.seriesList??{}),x=S.filter(D=>this.seriesList[D].show),I=S.some(D=>this.seriesList[D].isExistGrp&&!this.seriesList[D].isOverlapping),T=((c=this.data.groups)==null?void 0:c[0])??[];let v,E,Z,W,R,X,G,N,P,B=0,H=(d=f.labels)==null?void 0:d.length;if(f.labels){let D=f.labels.length;if(b!=null&&b.use){const{range:Y,interval:F,type:O}=b,[z,j]=Y??[];if(Re(z)&&Re(j))D=Math.floor((+j-+z)/F)+1,B=O==="step"?z:f.labels.findIndex(U=>U===+z),H=O==="step"?j:f.labels.findIndex(U=>U===+j);else{const U=n?this.axesSteps.y[0]:this.axesSteps.x[0];Number.isFinite(U==null?void 0:U.minIndex)&&Number.isFinite(U==null?void 0:U.maxIndex)&&U.minIndex<U.maxIndex&&(B=U.minIndex,H=U.maxIndex,D=H-B+1)}}W=m[f.units.rectStart],R=m[f.units.rectEnd],X=(R-W)/D}else G=this.axesSteps.x[0],N=S.find(D=>{var Y;return((Y=this.seriesList[D])==null?void 0:Y.type)==="line"}),P=this.seriesList[N].size;l.forEach((D,Y)=>{var F;if(Z=p.graphMax,!i.fixedPosTop){if(I){const O=x==null?void 0:x.reduce((U,Q)=>{var J,ne;return T.includes(Q)&&(((J=D[Q])==null?void 0:J.value)??D[Q])>0?U+(((ne=D[Q])==null?void 0:ne.value)??D[Q]):U},0),z=((F=x==null?void 0:x.filter(U=>!T.includes(U)))==null?void 0:F.map(U=>{var Q;return((Q=D[U])==null?void 0:Q.value)??D[U]}))??[],j=(z==null?void 0:z.length)>0?z.reduce((U,Q)=>Math.max(U,Q??-1/0),-1/0):-1/0;Z=O>0?Math.max(j,O):Math.max(j,0)}else if(x.length){const O=x.map(j=>{var U;return((U=D[j])==null?void 0:U.value)??D[j]}),z=O.length>0?O.reduce((j,U)=>Math.max(j,U??-1/0),-1/0):-1/0;Z=z>0||this.options.type!=="bar"?z:0}}if(f.labels){if(s[Y]<B||s[Y]>H)return;const O=s[Y]-B;v=Math.round(W+X*O)+X/2}else v=C(a[Y],G.graphMin,G.graphMax,k-P.comboOffset,m.x1+P.comboOffset/2);E=y(Z,p.graphMin,p.graphMax,w,M)+V,this.showTip({context:e,x:n?E:v,y:n?v:E,opt:i,isSamePos:!1})})}return r},drawLabelTipForHeatMap(e=this.bufferCtx){const t=this.options,n=!!t.horizontal,i=t.selectLabel,{dataIndex:s}=this.defaultSelectInfo;let l=!1;if(s){l=!0;const a=this.chartRect,r=this.labelOffset,c={x1:a.x1+r.left,x2:a.x2-r.right,y1:a.y1+r.top,y2:a.y2-r.bottom},d=n?this.axesY[0]:this.axesX[0],h=c[d.units.rectStart],m=(c[d.units.rectEnd]-h)/d.labels.length,f=n?this.axesX[0]:this.axesY[0],g=6*(n?1:-1),p=c[f.units.rectEnd]+g;s==null||s.forEach(y=>{const b=Math.round(h+m*y)+m/2;this.showTip({context:e,x:n?p:b,y:n?b:p,opt:i,isSamePos:!1})})}return l},drawTextTip(e){const t=!!this.options.horizontal,n=e.ctx??this.bufferCtx,{graphX:i,graphY:s,xArea:l,yArea:a,xsp:r,xep:c,ysp:d}=e,{dp:h,value:u,text:m,opt:f,type:g,tipType:p,isSamePos:y,seriesOpt:C}=e,b=4,k=4,{fontSize:L,fontFamily:w,fontWeight:M,height:V}=f.tipStyle,S=`normal normal ${M} ${L}px ${w}`;let x=1;g==="line"?x+=6:g==="scatter"?x+=C==null?void 0:C.pointSize:g==="bar"&&(x+=4);let I,T=h;if(f.fixedPosTop)t?(I=te.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r),I+=x):(I=te.calculateY(s.graphMax,s.graphMin,s.graphMax,a,d),I-=x);else if(t){const Z=Math.min(Math.max(u,i.graphMin),i.graphMax);I=te.calculateX(Z,i.graphMin,i.graphMax,l,r),I=u<0?I-x:I+x}else{const Z=g==="bar"&&u<0?0:u,W=Math.min(Math.max(Z,s.graphMin),s.graphMax);I=te.calculateY(W,s.graphMin,s.graphMax,a,d),I=Z<0?I+x:I-x}let v="center";n.save(),n.font=S;const E=Math.round(Math.max(n.measureText(m).width+12,40));t||(h+E/2>c-10?(v="right",T-=E/2-b*2):h-E/2<r+10&&(v="left",T+=E/2-b*2)),n.restore(),(f.showTextTip||p==="max")&&this.showTextTip({context:n,type:v,width:E,height:V,x:t?I+E/2:T,y:t?T+V/2:I,opt:f,arrowSize:b,borderRadius:k,text:m,textStyle:S,isNegative:u<0}),f.showTip&&p==="sel"&&this.showTip({context:n,x:t?I:h,y:t?h:I,opt:f,isSamePos:y})},showTextTip(e){const t=!!this.options.horizontal,{type:n,width:i,height:s,x:l,y:a,arrowSize:r,borderRadius:c,text:d,opt:h,textStyle:u,isNegative:m}=e,f=e.context;let g=l-i/2,p=l+i/2;const y=a-s,C=a;m&&t&&(g=l-i/2-i,p=l-i/2),f.save(),f.font=u,f.fillStyle=h.tipBackground??h.tipStyle.background,f.shadowBlur=0,f.beginPath(),f.moveTo(g+c,y),f.quadraticCurveTo(g,y,g,y+c),f.lineTo(g,C-c),f.quadraticCurveTo(g,C,g+c,C),f.lineTo(p-c,C),f.quadraticCurveTo(p,C,p,C-c),f.lineTo(p,y+c),f.quadraticCurveTo(p,y,p-c,y),f.lineTo(g+c,y),f.closePath(),f.fill(),f.beginPath(),t?(m?(f.moveTo(p,C),f.lineTo(p,y+c+r/2),f.lineTo(p+r,C-s/2),f.lineTo(p,C-c-r/2)):(f.moveTo(g,y),f.lineTo(g,y+c+r/2),f.lineTo(g-r,C-s/2),f.lineTo(g,C-c-r/2)),f.closePath(),f.fill()):(m?n==="left"?(f.lineTo(g+c+r,C+r),f.lineTo(g+c+r*2,C)):n==="right"?(f.lineTo(p-r*2-c,C),f.lineTo(p-r-c,C+r)):(f.lineTo(l-r,C),f.lineTo(l,C+r),f.lineTo(l+r,C)):m||(n==="left"?(f.moveTo(g,y),f.lineTo(g+c+r,C+r),f.lineTo(g+c+r*2,C)):n==="right"?(f.moveTo(p,y),f.lineTo(p-r*2-c,C),f.lineTo(p-r-c,C+r)):(f.lineTo(l-r,C),f.lineTo(l,C+r),f.lineTo(l+r,C))),f.closePath(),f.fill()),f.restore(),f.save(),f.font=u,f.fillStyle=h.tipTextColor??h.tipStyle.textColor,f.textBaseline="middle",f.textAlign="center",f.fillText(`${d}`,g+i/2,y+s/2),f.restore()},showTip(e){const t=!!this.options.horizontal,{x:n,y:i,opt:s,isSamePos:l}=e,a=e.context,c=i-(l?24:0);a.save(),a.fillStyle=s.tipBackground??s.tipStyle.background,a.beginPath(),a.moveTo(n,c),t?(a.lineTo(n+6,c-6),a.lineTo(n+6,c+6)):(a.lineTo(n+6,c-6),a.lineTo(n-6,c-6)),a.lineTo(n,c),a.closePath(),a.fill(),a.restore()}},A1={initBlitState(){var e;this._blitPrev=null,this._blitDiag=null,this.pointsLayers=new Map,this.pointsLayerValid=!1,this._blitCarry=0,this._framesSinceFullRedraw=0,this._pointsLayerStamp=null,this._pointsLayerOptionsRef=null,this._hitCoordsDirty=!1,(e=this.options.realTimeScatter)!=null&&e.use&&this.createPointsLayers()},createPointsLayers(){var l,a,r,c;const e=((a=(l=this.seriesInfo)==null?void 0:l.charts)==null?void 0:a.scatter)??[];if(this.pointsLayers.size===e.length&&e.every(d=>this.pointsLayers.has(d))&&this.pointsLayers.size)return;const n=((r=this.bufferCanvas)==null?void 0:r.width)??0,i=((c=this.bufferCanvas)==null?void 0:c.height)??0,s=new Map;for(let d=0;d<e.length;d++){const h=document.createElement("canvas"),u=document.createElement("canvas");n>1&&i>1&&(h.width=n,h.height=i,u.width=n,u.height=i),s.set(e[d],{a:h,b:u,actx:h.getContext("2d"),bctx:u.getContext("2d"),cur:"A"})}this.pointsLayers=s,this.pointsLayerValid=!1},getSeriesLayer(e){const t=this.pointsLayers.get(e);if(!t)return null;const n=t.cur==="A";return{src:n?t.a:t.b,srcCtx:n?t.actx:t.bctx,dst:n?t.b:t.a,dstCtx:n?t.bctx:t.actx,dstName:n?"B":"A",layer:t}},resizePointsLayers(e,t){let n=!1;return this.pointsLayers.forEach(i=>{(i.a.width!==e||i.a.height!==t)&&(i.a.width=e,i.a.height=t,i.b.width=e,i.b.height=t,n=!0)}),n},pointsLayersSized(){if(!this.pointsLayers.size||!this.bufferCanvas)return!1;const e=this.bufferCanvas.width,t=this.bufferCanvas.height;if(!(e>1)||!(t>1))return!1;let n=!0;return this.pointsLayers.forEach(i=>{(i.a.width!==e||i.a.height!==t)&&(n=!1)}),n},getBlitScatterSeriesList(){var n,i;const e=((i=(n=this.seriesInfo)==null?void 0:n.charts)==null?void 0:i.scatter)??[],t=[];for(let s=0;s<e.length;s++){const l=this.seriesList[e[s]];l!=null&&l.show&&t.push({sId:e[s],series:l,xi:l.xAxisIndex??0,yi:l.yAxisIndex??0})}return t},getBlitScatterSeries(){return this.getBlitScatterSeriesList()[0]??null},areBlitSeriesAligned(e){var n,i,s,l;if(!e||e.length<1)return!1;const t=(i=(n=this.dataSet)==null?void 0:n[e[0].sId])==null?void 0:i.lastTick;if(!t)return!1;for(let a=1;a<e.length;a++){const r=(l=(s=this.dataSet)==null?void 0:s[e[a].sId])==null?void 0:l.lastTick;if(!r||r.gapCount!==t.gapCount||r.toTime!==t.toTime||r.endIndex!==t.endIndex||r.length!==t.length)return!1}return!0},blitShiftDenominator(){const e=this.pixelRatio;if(!(e>0))return null;if(Number.isInteger(e))return 1;const t=4;for(let n=2;n<=t;n++)if(Math.abs(e*n-Math.round(e*n))<1e-6)return n;return null},evaluateBlitGate(e){var p,y,C,b,k,L,w,M,V,S,x,I,T,v,E;const t=this.options,n=this._blitPrev,i=this.isInit===!0&&((p=t.realTimeScatter)==null?void 0:p.use)===!0&&!t.brush&&this.updateSeries!==!0&&!e&&!((C=(y=this.scrollbar)==null?void 0:y.x)!=null&&C.use||(k=(b=this.scrollbar)==null?void 0:b.y)!=null&&k.use),s=this.getBlitScatterSeriesList(),l=this.areBlitSeriesAligned(s),a=!((L=t.selectItem)!=null&&L.use&&(((w=this.defaultSelectItemInfo)==null?void 0:w.dataIndex)!=null||((M=this.lastHitInfo)==null?void 0:M.dataIndex)!=null))&&!((V=t.selectSeries)!=null&&V.use&&this.defaultSelectInfo)&&!this.legendHover,r={modeOk:i,seriesAligned:l,selectionOk:a,scatterOnly:this.hasOnlyVisibleScatter(),deviceRatioBlittable:this.blitShiftDenominator()!==null,hasPrev:!!n,optionsStable:!!n&&n.optionsRef===this.options,yFixed:!1,xWidthStable:!1,xAreaStable:!1,labelOffsetStable:!1,xMonotonic:!1,deviceStable:!1,gapOk:!1};let c=0,d=0,h=0;const u=s[0]??null,m=u?(x=(S=this.axesSteps)==null?void 0:S.x)==null?void 0:x[u.xi]:null,f=u?(T=(I=this.axesSteps)==null?void 0:I.y)==null?void 0:T[u.yi]:null;if(u&&m&&f&&this.chartRect&&this.labelOffset){const Z=this.chartRect,W=Z.chartWidth-(this.labelOffset.left+this.labelOffset.right);n&&(r.yFixed=f.graphMin===n.graphMinY&&f.graphMax===n.graphMaxY,r.xWidthStable=m.graphMax-m.graphMin===n.graphMaxX-n.graphMinX,r.xAreaStable=W===n.xArea,r.labelOffsetStable=this.labelOffset.left===n.labelOffsetLeft&&this.labelOffset.right===n.labelOffsetRight,c=m.graphMin-n.graphMinX,r.xMonotonic=Number.isFinite(c)&&c>0,r.deviceStable=this.pixelRatio===n.pixelRatio&&Z.chartWidth===n.chartWidth&&Z.chartHeight===n.chartHeight&&Z.x1===n.x1&&Z.y2===n.y2);const R=(E=(v=this.dataSet)==null?void 0:v[u.sId])==null?void 0:E.lastTick;R&&(d=R.gapCount??0,h=R.length??0,r.gapOk=d>0&&d<h)}return{ok:r.modeOk&&r.seriesAligned&&r.selectionOk&&r.scatterOnly&&r.deviceRatioBlittable&&r.hasPrev&&r.optionsStable&&r.yFixed&&r.xWidthStable&&r.xAreaStable&&r.labelOffsetStable&&r.xMonotonic&&r.deviceStable&&r.gapOk,parts:r,shiftMs:c,gapCount:d,length:h,scatterList:s}},hasOnlyVisibleScatter(){var n,i;const e=((n=this.seriesInfo)==null?void 0:n.charts)??{},t=Object.keys(e);for(let s=0;s<t.length;s++){if(t[s]==="scatter")continue;const l=e[t[s]];for(let a=0;a<l.length;a++)if((i=this.seriesList[l[a]])!=null&&i.show)return!1}return!0},snapshotBlitState(){var s,l,a,r,c;if(!((s=this.options.realTimeScatter)!=null&&s.use))return null;const e=this.getBlitScatterSeries();if(!e)return null;const t=(a=(l=this.axesSteps)==null?void 0:l.x)==null?void 0:a[e.xi],n=(c=(r=this.axesSteps)==null?void 0:r.y)==null?void 0:c[e.yi];if(!t||!n||!this.chartRect||!this.labelOffset)return null;const i=this.chartRect;return{sId:e.sId,graphMinX:t.graphMin,graphMaxX:t.graphMax,graphMinY:n.graphMin,graphMaxY:n.graphMax,xArea:i.chartWidth-(this.labelOffset.left+this.labelOffset.right),labelOffsetLeft:this.labelOffset.left,labelOffsetRight:this.labelOffset.right,pixelRatio:this.pixelRatio,chartWidth:i.chartWidth,chartHeight:i.chartHeight,x1:i.x1,y2:i.y2,optionsRef:this.options}},recordBlitDiag(e,t,n){var s;if(typeof window>"u"||!window.__EVUI_BLIT_DEBUG__)return;(s=this.options.realTimeScatter)!=null&&s.use&&(window.__EVUI_BLIT_CHART__=this),this._blitDiag||(this._blitDiag={ticks:0,eligible:0,blitted:0,fail:{},rate:0,lastShiftMs:0,lastGap:0});const i=this._blitDiag;if(i.ticks++,i.lastShiftMs=e.shiftMs,i.lastGap=e.gapCount,e.ok)i.eligible++;else{const l=Object.keys(e.parts);for(let a=0;a<l.length;a++)e.parts[l[a]]||(i.fail[l[a]]=(i.fail[l[a]]||0)+1)}if(e.ok&&!t&&n){const l=Object.keys(n);for(let a=0;a<l.length;a++)n[l[a]]&&(i.fail[l[a]]=(i.fail[l[a]]||0)+1)}t&&i.blitted++,i.rate=i.blitted/i.ticks,window.__EVUI_BLIT_DIAG__=i},collectStripDuplicatePoints(e,t){var s,l,a;const n=((l=(s=this.seriesInfo)==null?void 0:s.charts)==null?void 0:l.scatter)??[],i=!!this.options.seriesReverse;for(let r=i?n.length-1:0;i?r>=0:r<n.length;i?r--:r++){const c=this.seriesList[n[r]];if(!(c!=null&&c.show))continue;const d=(a=c.data[c.sId])==null?void 0:a.dataGroup;if(d)for(let h=0;h<t.length;h++){const u=d[t[h]];if(u!=null&&u.data)for(let m=0;m<u.data.length;m++){const f=u.data[m];e.set(f.k??A.coordinateKey(f.x,f.y),c.sId)}}}},drawChartBlitFastPath(e,t){var v,E,Z,W;const n=t.scatterList??this.getBlitScatterSeriesList(),i=n[0]??null,s=(E=(v=this.dataSet)==null?void 0:v[i==null?void 0:i.sId])==null?void 0:E.lastTick;if(!i||!s)return!1;const l=this.pixelRatio,a=this.chartRect,r=this.labelOffset,c=this.axesSteps.x[i.xi],d=a.chartWidth-(r.left+r.right),h=c.graphMax-c.graphMin;if(!(h>0)||!(d>0))return!1;const u=this.blitShiftDenominator()??1,m=d/h*t.shiftMs,f=this._blitCarry+m,g=Math.round(f/u)*u;if(g<1)return!1;const p=Math.round(g*l);let y=s.maxDirtyAge,C=typeof i.series.pointSize=="number"?i.series.pointSize:i.series.pointSize.value;for(let R=1;R<n.length;R++){const X=(W=(Z=this.dataSet)==null?void 0:Z[n[R].sId])==null?void 0:W.lastTick;X&&X.maxDirtyAge>y&&(y=X.maxDirtyAge);const G=n[R].series.pointSize,N=typeof G=="number"?G:G.value;N>C&&(C=N)}if(y>s.gapCount+1)return!1;const b=this.bufferCanvas.width,k=this.bufferCanvas.height;if(p>=b)return!1;this._blitCarry=f-g;const{gapCount:L,endIndex:w,length:M}=s,V=Math.min(M,Math.max(L+1,y+1)),S=new Array(V);for(let R=0;R<V;R++){let X=(w-R)%M;X<0&&(X+=M),S[R]=X}const x=this.options.coordinateDedupe!==!1&&n.length>1,I=x?new Map:null;x&&this.collectStripDuplicatePoints(I,S);const T={chartRect:a,labelOffset:r,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity,duple:I,coordinateDedupe:x,rtXOffsetCss:this._blitCarry};for(let R=0;R<n.length;R++){const X=n[R],G=this.getSeriesLayer(X.sId);if(!G)return!1;G.dstCtx.setTransform(1,0,0,1,0,0),G.dstCtx.clearRect(0,0,b,k),G.dstCtx.drawImage(G.src,p,0,b-p,k,0,0,b-p,k),G.dstCtx.setTransform(l,0,0,l,0,0),X.series.realTimeScatterDrawStrip(G.dstCtx,S,T),G.dstCtx.setTransform(1,0,0,1,0,0),G.layer.cur=G.dstName,X.series.refreshRtTotalCount()}return this.drawStaticLayer(this.bufferCtx,e),this.compositePointsLayer(C),!0},compositePointsLayer(e){const t=this.pixelRatio,n=this.chartRect,i=this.labelOffset,s=n.chartWidth-(i.left+i.right),l=n.chartHeight-(i.top+i.bottom),a=n.x1+i.left,r=n.y2-i.bottom,c=r-l,d=a+s,h=(a-e)*t,u=(c-e)*t,m=this.blitShiftDenominator()??1,f=(Math.ceil(d)+e+Math.ceil(m/2)+1)*t,g=(r+e)*t,p=this.getBlitScatterSeriesList(),y=!!this.options.seriesReverse;this.bufferCtx.save(),this.bufferCtx.setTransform(1,0,0,1,0,0),this.bufferCtx.beginPath(),this.bufferCtx.rect(h,u,f-h,g-u),this.bufferCtx.clip();for(let C=0;C<p.length;C++){const b=y?p[p.length-1-C]:p[C],k=this.pointsLayers.get(b.sId);k&&this.bufferCtx.drawImage(k.cur==="A"?k.a:k.b,0,0)}this.bufferCtx.restore()},computePointsLayerStamp(){var s,l,a,r,c,d,h;if(!((s=this.options.realTimeScatter)!=null&&s.use))return null;const e=this.getBlitScatterSeriesList();if(!e.length||!this.chartRect||!this.labelOffset||!this.axesSteps)return null;const t=this.chartRect,n=this.labelOffset,i=[this.pixelRatio,(l=this.bufferCanvas)==null?void 0:l.width,(a=this.bufferCanvas)==null?void 0:a.height,t.chartWidth,t.chartHeight,t.x1,t.y2,n.left,n.right,n.top,n.bottom];for(let u=0;u<e.length;u++){const{sId:m,xi:f,yi:g}=e[u],p=(c=(r=this.dataSet)==null?void 0:r[m])==null?void 0:c.lastTick,y=(d=this.axesSteps.x)==null?void 0:d[f],C=(h=this.axesSteps.y)==null?void 0:h[g];if(!y||!C)return null;i.push(m,p?`${p.seq}/${p.toTime}/${p.endIndex}/${p.length}`:"nt",y.graphMin,y.graphMax,C.graphMin,C.graphMax)}return i.join("|")},maybeRebuildPointsLayer(e=!1){var n;if(!((n=this.options.realTimeScatter)!=null&&n.use))return!1;const t=this.computePointsLayerStamp();return!e&&t&&this.pointsLayerValid&&this._pointsLayerStamp===t&&this._pointsLayerOptionsRef===this.options?!1:(this.rebuildPointsLayer(),this._pointsLayerStamp=this.pointsLayerValid?t:null,this._pointsLayerOptionsRef=this.pointsLayerValid?this.options:null,this.pointsLayerValid)},canRouteFallbackViaLayer(e){var n,i,s,l,a;const t=this.options;return!((n=t.realTimeScatter)!=null&&n.use)||e||(i=t.selectItem)!=null&&i.use&&(((s=this.defaultSelectItemInfo)==null?void 0:s.dataIndex)!=null||((l=this.lastHitInfo)==null?void 0:l.dataIndex)!=null)||(a=t.selectSeries)!=null&&a.use&&this.defaultSelectInfo||!this.pointsLayersSized()||!this.hasOnlyVisibleScatter()?!1:this.getBlitScatterSeriesList().length>0},ensureHitCoordsFresh(){var n,i,s;if(!this._hitCoordsDirty||!((n=this.options.realTimeScatter)!=null&&n.use)||!this.chartRect||!this.labelOffset||!this.axesSteps)return;const e=this.getBlitScatterSeriesList(),t={chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,rtXOffsetCss:this._blitCarry};for(let l=0;l<e.length;l++)(s=(i=e[l].series).refreshRtHitCoords)==null||s.call(i,t);this._hitCoordsDirty=!1},getMaxVisibleScatterPointSize(){const e=this.getBlitScatterSeriesList();let t=0;for(let n=0;n<e.length;n++){const i=e[n].series.pointSize,s=typeof i=="number"?i:(i==null?void 0:i.value)??0;s>t&&(t=s)}return t},rebuildPointsLayer(){var l,a,r;if(!((l=this.options.realTimeScatter)!=null&&l.use)||!this.pointsLayersSized()){this.pointsLayerValid=!1;return}const e=this.getBlitScatterSeriesList();if(!e.length){this.pointsLayerValid=!1;return}const t=this.pixelRatio,n=((r=(a=this.seriesInfo)==null?void 0:a.charts)==null?void 0:r.scatter)??[],i=this.options.coordinateDedupe!==!1&&!this.canSkipRealtimeScatterDedupe(n),s=i?new Map:null;i&&this.collectDuplicatePoints(s,n);for(let c=0;c<e.length;c++){const d=e[c],h=this.pointsLayers.get(d.sId);if(!h){this.pointsLayerValid=!1;return}const u=h.cur==="A"?h.a:h.b,m=h.cur==="A"?h.actx:h.bctx;m.setTransform(1,0,0,1,0,0),m.clearRect(0,0,u.width,u.height),m.setTransform(t,0,0,t,0,0);const f={ctx:m,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,duple:s,coordinateDedupe:i,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity,rtXOffsetCss:this._blitCarry,markDrawn:!0};d.series.computeGeometry(f),d.series.realTimeScatterDraw(f),m.setTransform(1,0,0,1,0,0)}this.pointsLayerValid=!0}},_1={selectedSeriesAllLineSafe(){var t;const e=((t=this.defaultSelectInfo)==null?void 0:t.seriesId)??[];for(let n=0;n<e.length;n++){const i=this.seriesList[e[n]];if(!i||i.type!=="line"||i.fill||i.isExistGrp)return!1}return!0},shouldDrawSelectedOnTop(e){var n,i,s,l;const t=this.options;return!((n=t.selectSeries)!=null&&n.use)||t.brush||(i=t.realTimeScatter)!=null&&i.use||t.workerRender||e!=null&&e.legend||this.legendHover||!((l=(s=this.defaultSelectInfo)==null?void 0:s.seriesId)!=null&&l.length)?!1:this.selectedSeriesAllLineSafe()},drawSelectedSeriesOnly(){var d;const{maxTip:e,selectLabel:t,selectItem:n,selectSeries:i,brush:s,displayOverflow:l,unSelectedOpacity:a}=this.options,r={ctx:this.bufferCtx,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,maxTipOpt:{background:e.background,color:e.color},selectLabel:{option:t,selected:this.defaultSelectInfo},selectSeries:{option:i,selected:this.defaultSelectInfo},selectItem:{option:n,selected:this.defaultSelectItemInfo},isBrush:!!s,displayOverflow:l,unSelectedOpacity:a,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion},c=((d=this.defaultSelectInfo)==null?void 0:d.seriesId)??[];for(let h=0;h<c.length;h++){const u=this.seriesList[c[h]];u&&u.show&&u.draw({...r})}}},Ec=2,K1=["type","horizontal","sunburst","coordinateDedupe","unSelectedOpacity","displayOverflow","thickness","cPadRatio","borderRadius","seriesReverse","maxTip","padding","heatMapColor"],U1=["sId","type","name","show","color","fill","fillColor","fillOpacity","pointFill","point","lineWidth","thickness","pointSize","pointStyle","interpolation","passingValue","hasPassingValueInData","segments","combo","xAxisIndex","yAxisIndex","stackIndex","groupIndex","isExistGrp","showValue"];function rt(e){if(e===null)return null;const t=typeof e;if(t==="number"||t==="string"||t==="boolean")return e;if(t==="function"||t==="undefined"||t==="symbol"||t==="bigint")return;if(Array.isArray(e))return e.map(i=>rt(i)??null);const n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){const i={};return Object.keys(e).forEach(s=>{const l=rt(e[s]);l!==void 0&&(i[s]=l)}),i}}function Wc(e,t){const n={};return e&&t.forEach(i=>{const s=rt(e[i]);s!==void 0&&(n[i]=s)}),n}function Gc(e,t){if(t==="time")return Lc(e);if(typeof e=="number")return e;if(t==="step"){const n=Number(e);return Number.isFinite(n)?n:null}return null}function J1(e,t={}){const n=e.data??[];if(e.type==="pie")return{value:n.map(d=>typeof(d==null?void 0:d.value)=="number"?d.value:null)};const i=t.x??"linear",s=t.y??"linear",l=new Array(n.length),a=new Array(n.length),r=new Array(n.length),c=new Array(n.length);for(let d=0;d<n.length;d++){const h=n[d]??{};l[d]=Gc(h.x,i),a[d]=Gc(h.y,s),r[d]=typeof h.o=="number"?h.o:null,c[d]=typeof h.b=="number"?h.b:null}return{x:l,y:a,o:r,b:c}}function j1(e){var s,l,a,r,c,d,h,u;const t=e.options??{},n=e.defaultSelectInfo,i=e.defaultSelectItemInfo;return{selectSeries:{use:!!((s=t.selectSeries)!=null&&s.use),selected:{seriesId:rt(n==null?void 0:n.seriesId)??[]}},selectItem:{use:!!((l=t.selectItem)!=null&&l.use),useSeriesOpacity:!!((a=t.selectItem)!=null&&a.useSeriesOpacity),showBorder:!!((r=t.selectItem)!=null&&r.showBorder),borderStyle:rt((c=t.selectItem)==null?void 0:c.borderStyle)??null,selected:i?{dataIndex:i.dataIndex??null,seriesID:i.seriesID??null}:null},selectLabel:{use:!!((d=t.selectLabel)!=null&&d.use),useSeriesOpacity:!!((h=t.selectLabel)!=null&&h.useSeriesOpacity),useBothAxis:!!((u=t.selectLabel)!=null&&u.useBothAxis),selected:{dataIndex:rt(n==null?void 0:n.dataIndex)??[],label:rt(n==null?void 0:n.label)??[],targetAxis:(n==null?void 0:n.targetAxis)??null}}}}function Q1(e,t=0){var a,r,c,d,h;const n={},i=e.seriesList??{};Object.keys(i).forEach(u=>{var p,y,C,b,k,L;const m=i[u];if(!m||typeof m.hasRenderableValue=="function"&&!m.isExistGrp&&!m.hasRenderableValue())return;const f=((C=(y=(p=e.options)==null?void 0:p.axesX)==null?void 0:y[m.xAxisIndex??0])==null?void 0:C.type)??"linear",g=((L=(k=(b=e.options)==null?void 0:b.axesY)==null?void 0:k[m.yAxisIndex??0])==null?void 0:L.type)??"linear";n[u]={...Wc(m,U1),data:J1(m,{x:f,y:g})},m.type==="heatMap"&&m.labels&&(n[u].labels=rt(m.labels)??{})});const s={},l=((a=e.seriesInfo)==null?void 0:a.charts)??{};return Object.keys(l).forEach(u=>{s[u]=(l[u]??[]).filter(m=>n[m])}),{version:Ec,epoch:t,pixelRatio:e.pixelRatio??1,chartRect:rt(e.chartRect)??{},labelOffset:rt(e.labelOffset)??{},axesSteps:{x:rt((r=e.axesSteps)==null?void 0:r.x)??[],y:rt((c=e.axesSteps)==null?void 0:c.y)??[]},options:{...Wc(e.options,K1),isGradient:((h=(d=e.options)==null?void 0:d.legend)==null?void 0:h.type)==="gradient"},selection:j1(e),seriesOrder:s,series:n}}function $1(e){const t={},n=[],i=e.series??{};return Object.keys(i).forEach(s=>{const l=i[s].data??{},a={};let r=0;Object.keys(l).forEach(c=>{const d=l[c]??[];r=d.length;const h=new Float64Array(d.length);for(let u=0;u<d.length;u++)h[u]=typeof d[u]=="number"?d[u]:NaN;a[c]=h,n.push(h.buffer)}),a.length=r,t[s]=a}),{columns:t,transferList:n}}const Zc="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBxdD10eXBlb2YgZ2xvYmFsPT0ib2JqZWN0IiYmZ2xvYmFsJiZnbG9iYWwuT2JqZWN0PT09T2JqZWN0JiZnbG9iYWwsQWU9dHlwZW9mIHNlbGY9PSJvYmplY3QiJiZzZWxmJiZzZWxmLk9iamVjdD09PU9iamVjdCYmc2VsZix5dD1xdHx8QWV8fEZ1bmN0aW9uKCJyZXR1cm4gdGhpcyIpKCksT3Q9eXQuU3ltYm9sLFp0PU9iamVjdC5wcm90b3R5cGUsRGU9WnQuaGFzT3duUHJvcGVydH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NzKG4sZixIdCk7Y29uc3QgcD1wZXJmb3JtYW5jZS5ub3coKS1oLGQ9cGVyZm9ybWFuY2Uubm93KCksdT13dC50cmFuc2ZlclRvSW1hZ2VCaXRtYXAoKSx4PXBlcmZvcm1hbmNlLm5vdygpLWQ7c2VsZi5wb3N0TWVzc2FnZSh7dHlwZToicmVuZGVyZWQiLGVwb2NoOnQsYml0bWFwOnUsZHJhd01zOnAsYml0bWFwTXM6eH0sW3VdKX1zZWxmLm9ubWVzc2FnZT1lPT57Y29uc3QgdD1lLmRhdGE7aWYodCl7aWYodC50eXBlPT09ImluaXQiKXtsZXQgbj10eXBlb2YgT2Zmc2NyZWVuQ2FudmFzPCJ1IjtpZihuKXRyeXtuPSEhbmV3IE9mZnNjcmVlbkNhbnZhcygxLDEpLmdldENvbnRleHQoIjJkIil9Y2F0Y2h7bj0hMX1zZWxmLnBvc3RNZXNzYWdlKHt0eXBlOm4/InJlYWR5IjoidW5zdXBwb3J0ZWQiLHZlcnNpb246Z3N9KTtyZXR1cm59aWYodC50eXBlPT09InJlbmRlciIpdHJ5e0lzKHQpfWNhdGNoKG4pe3NlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6InJlbmRlci1lcnJvciIsZXBvY2g6dC5lcG9jaCxtZXNzYWdlOlN0cmluZyhuJiZuLm1lc3NhZ2V8fG4pLG5hbWU6biYmbi5uYW1lLHN0YWNrOm4mJm4uc3RhY2t9KX19fX0pKCk7Cg==",q1=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Xc=typeof self<"u"&&self.Blob&&new Blob([q1(Zc)],{type:"text/javascript;charset=utf-8"});function ek(e){let t;try{if(t=Xc&&(self.URL||self.webkitURL).createObjectURL(Xc),!t)throw"";const n=new Worker(t,{name:e==null?void 0:e.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker("data:text/javascript;base64,"+Zc,{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const yt={IDLE:"idle",INITIALIZING:"initializing",READY:"ready",FAILED:"failed"},tk=3e3,nk=2,ik=3,Ut=()=>{},sk={onInitFailure:Ut,onTimeout:Ut,onRenderException:Ut,onFallback:Ut};function ok(){return typeof Worker<"u"&&typeof OffscreenCanvas<"u"&&typeof OffscreenCanvas.prototype.transferToImageBitmap=="function"}function lk(e){if(typeof structuredClone!="function")return!1;try{return structuredClone(e),!0}catch{return!1}}function ak(){return new ek}class rk{constructor(t={}){this.state=yt.IDLE,this.worker=null,this.version=t.version??Ec,this.initTimeoutMs=t.initTimeoutMs??tk,this.maxInFlight=t.maxInFlight??nk,this.maxRenderErrors=t.maxRenderErrors??ik,this.hooks={...sk,...t.hooks||{}},this._timer=null,this._frameHandler=Ut,this._errorHandler=Ut,this._inFlight=0,this._renderErrorStreak=0,this._isEnabled=t.isEnabled||(()=>!1),this._isSupported=t.isSupported||ok,this._createWorker=t.createWorker||ak}start(){if(this.state!==yt.IDLE)return this.state;if(!this._isEnabled())return this.hooks.onFallback("opt-in-off"),this.state;if(!this._isSupported())return this.hooks.onFallback("unsupported"),this.state;let t;try{t=this._createWorker()}catch(n){return this.state=yt.FAILED,this.hooks.onInitFailure(n),this.hooks.onFallback("worker-create-failed"),this.state}return t?(this.worker=t,this.state=yt.INITIALIZING,t.onmessage=n=>this._handleMessage(n),t.onerror=()=>this._fail("worker-error"),this._timer=setTimeout(()=>this._handleTimeout(),this.initTimeoutMs),t.postMessage({type:"init",version:this.version}),this.state):(this.state=yt.FAILED,this.hooks.onInitFailure("worker-create-failed"),this.hooks.onFallback("worker-create-failed"),this.state)}isReady(){return this.state===yt.READY}shouldRenderOnWorker(t){return this.isReady()&&lk(t)}setFrameHandler(t){this._frameHandler=t||Ut}setErrorHandler(t){this._errorHandler=t||Ut}canAcceptRender(){return this.isReady()&&this._inFlight<this.maxInFlight}render(t,n,i){if(!this.canAcceptRender()||!this.worker)return!1;this._inFlight+=1;try{this.worker.postMessage({type:"render",epoch:t.epoch,snapshot:t,columns:n},i||[])}catch(s){return this._inFlight=0,this.hooks.onRenderException(s),this._fail("post-message-failed"),!1}return!0}destroy(){this._clearTimer(),this.worker&&(this.worker.terminate(),this.worker=null),this.state=yt.IDLE}_handleMessage(t){const n=t&&t.data;if(n)if(n.type==="ready"&&this.state===yt.INITIALIZING){if(n.version!==this.version){this._fail("version-mismatch");return}this._clearTimer(),this.state=yt.READY}else n.type==="unsupported"?this._fail("worker-unsupported"):n.type==="rendered"?(this._inFlight=Math.max(0,this._inFlight-1),this._renderErrorStreak=0,this._frameHandler(n)):n.type==="render-error"&&(this._inFlight=Math.max(0,this._inFlight-1),this.hooks.onRenderException(n),this._errorHandler(n),this._renderErrorStreak+=1,this._renderErrorStreak>=this.maxRenderErrors&&(this._inFlight=0,this._fail("render-error-threshold")))}_handleTimeout(){this.state===yt.INITIALIZING&&(this.hooks.onTimeout("init-timeout"),this._fail("init-timeout"))}_fail(t){this._clearTimer(),this.state=yt.FAILED,this.worker&&(this.worker.terminate(),this.worker=null);const n=this._inFlight>0;this._inFlight=0,this.hooks.onInitFailure(t),this.hooks.onFallback(t),n&&this._errorHandler()}_clearTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}}const ck=["text","badge","callout","circle"],dk=["axis","pixel","series"],hk=["straight","elbow"],uk=["top","bottom","left","right","auto"],fk=["start","end"],mk={type:"pixel",xAxisIndex:0,yAxisIndex:0,xValue:null,yValue:null,x:0,y:0,seriesId:null,location:"end",offsetX:0,offsetY:0},pk={enabled:!1,type:"straight",style:{stroke:"#9E9E9E",strokeWidth:1,dashStyle:"solid"}},Nc={text:{style:{color:"#212121",backgroundColor:"transparent",borderColor:"transparent",borderWidth:0,borderRadius:0,padding:[0,0],fontSize:"11px",fontWeight:"normal",textAlign:"center"}},badge:{style:{color:"#8B2323",backgroundColor:"#FDF0F0",borderColor:"#B24C4C",borderWidth:1,borderRadius:6,padding:[6,10],fontSize:"11px",fontWeight:"normal",textAlign:"center"}},callout:{style:{anchor:"auto",arrowSize:4,color:"#212121",backgroundColor:"#FFFFFF",borderColor:"#B0B0B0",borderWidth:1,borderRadius:4,padding:[4,8],fontSize:"11px",fontWeight:"normal",textAlign:"center"}},circle:{style:{radius:10,backgroundColor:"rgba(178, 76, 76, 0.15)",borderColor:"#B24C4C",borderWidth:1}}};function gk(e){const t=n=>Number.isFinite(n)&&n>0?n:0;if(typeof e=="number"){const n=t(e);return[n,n,n,n]}if(Array.isArray(e)){const n=e.map(t);if(n.length===1)return[n[0],n[0],n[0],n[0]];if(n.length===2)return[n[0],n[1],n[0],n[1]];if(n.length===3)return[n[0],n[1],n[2],n[1]];if(n.length>=4)return[n[0],n[1],n[2],n[3]]}return[0,0,0,0]}function bk(e,t,n){if(dk.includes(e.type)||(n.push(`[annotation:${t}] unknown position.type "${e.type}" — fallback to "pixel".`),e.type="pixel"),e.type==="axis")(e.xValue==null||e.yValue==null)&&n.push(`[annotation:${t}] position.type "axis" requires both xValue and yValue.`);else if(e.type==="series"){e.seriesId==null&&n.push(`[annotation:${t}] position.type "series" requires seriesId.`);const i=e.location;fk.includes(i)||typeof i=="number"&&Number.isInteger(i)||(n.push(`[annotation:${t}] invalid location "${i}" — fallback to "end".`),e.location="end")}}function yk(e,t,n){const i=e.id!=null?String(e.id):`annotation-${t}`;let s=e.type;ck.includes(s)||(n.push(`[annotation:${i}] unknown type "${s}" — fallback to "text".`),s="text");const l=Ve(e.style)||{},a=Pe({},l,Nc[s].style);if("padding"in a){const h="padding"in l?l.padding:Nc[s].style.padding;a.padding=gk(h)}s==="circle"&&typeof a.radius=="number"&&a.radius<0&&(n.push(`[annotation:${i}] style.radius must be >= 0 — clamped to 0.`),a.radius=0),s==="callout"&&!uk.includes(a.anchor)&&(n.push(`[annotation:${i}] invalid style.anchor "${a.anchor}" — fallback to "auto".`),a.anchor="auto");const r=Pe({},Ve(e.position)||{},mk);bk(r,i,n);const c=Pe({},Ve(e.connector)||{},pk);hk.includes(c.type)||(n.push(`[annotation:${i}] invalid connector.type "${c.type}" — fallback to "straight".`),c.type="straight"),s==="callout"&&c.enabled&&(n.push(`[annotation:${i}] connector is ignored for type "callout" (the arrow acts as the connector).`),c.enabled=!1);let d=e.content;return s==="circle"?d="":!jn(d)&&typeof d!="string"&&(d=d==null?"":String(d)),{id:i,type:s,content:d,position:r,connector:c,style:a}}function xk(e){const t=[];if(!Array.isArray(e))return{annotations:[],warnings:t};const n=new Set,i=e.filter(s=>s&&typeof s=="object").map((s,l)=>yk(s,l,t));return i.forEach(s=>{n.has(s.id)&&t.push(`[annotation:${s.id}] duplicate id — annotations should have unique ids.`),n.add(s.id)}),{annotations:i,warnings:t}}function Sk(e,t){if(e==null)return null;if(((t==null?void 0:t.type)||"linear")==="time"){if(typeof e=="number")return Number.isFinite(e)?e:null;const s=We(e).valueOf();return Number.isFinite(s)?s:null}const i=typeof e=="number"?e:Number(e);return Number.isFinite(i)?i:null}function Ck(e,t=[]){const i=(Array.isArray(t)?t:[]).indexOf(e);return i!==-1?i:typeof e=="number"&&Number.isInteger(e)?e:-1}function kk(e,t,n,i,s){const l=Array.isArray(t.labels)?t.labels:[],a=t.minIndex??0,r=t.maxIndex??l.length-1,c=r-a+1;if(c<=0)return null;const d=Ck(e,l);if(d<a||d>r)return null;const h=n/c,u=h*(d-a)+h/2;return Math.round(s?i+u:i-u)}function Pc(e,t,n,i,s){if(!t)return null;if((t.type||"linear")==="step")return kk(e,t,n,i,s);const l=Sk(e,t);return l===null?null:s?te.calculateX(l,t.graphMin,t.graphMax,n,i):te.calculateY(l,t.graphMin,t.graphMax,n,i)}function Dc(e,t,n=!1){const i=Array.isArray(t);let s=0;if(i?s=t.length:typeof t=="number"&&(s=t),s<=0)return-1;if(typeof e=="number"&&Number.isInteger(e))return Math.min(Math.max(e,0),s-1);const l=a=>a&&(n?a.x!=null:a.y!=null);if(e==="start"){if(!i)return 0;for(let a=0;a<s;a++)if(l(t[a]))return a;return-1}if(!i)return s-1;for(let a=s-1;a>=0;a--)if(l(t[a]))return a;return-1}function wk(e,t){var a,r,c,d,h,u,m,f,g;const n={x:0,y:0,anchorX:0,anchorY:0,isVisible:!1},{position:i}=e;if(!i)return n;const s=i.offsetX||0,l=i.offsetY||0;if(i.type==="pixel"){const p=i.x||0,y=i.y||0;return{x:p+s,y:y+l,anchorX:p,anchorY:y,isVisible:!0}}if(i.type==="axis"){const{chartRect:p,labelOffset:y}=t||{},C=((r=(a=t==null?void 0:t.axes)==null?void 0:a.x)==null?void 0:r[i.xAxisIndex])??((d=(c=t==null?void 0:t.axesSteps)==null?void 0:c.x)==null?void 0:d[i.xAxisIndex]),b=((u=(h=t==null?void 0:t.axes)==null?void 0:h.y)==null?void 0:u[i.yAxisIndex])??((f=(m=t==null?void 0:t.axesSteps)==null?void 0:m.y)==null?void 0:f[i.yAxisIndex]);if(!C||!b||!p||!y)return n;const k=p.chartWidth-(y.left+y.right),L=p.chartHeight-(y.top+y.bottom),w=p.x1+y.left,M=p.y2-y.bottom,V=Pc(i.xValue,C,k,w,!0),S=Pc(i.yValue,b,L,M,!1);return V===null||S===null?n:{x:V+s,y:S+l,anchorX:V,anchorY:S,isVisible:!0}}if(i.type==="series"){const p=(g=t==null?void 0:t.seriesList)==null?void 0:g[i.seriesId];if(!p||p.show===!1)return n;if(p.type==="pie"){const{centerX:M,centerY:V,radius:S,startAngle:x,endAngle:I}=p;if(M==null||V==null||S==null||x==null||I==null)return n;let T=(x+I)/2;Math.abs(I-x)>=Math.PI*2-1e-6&&(T=0);const E=M+Math.cos(T)*S,Z=V+Math.sin(T)*S;return{x:E+s,y:Z+l,anchorX:E,anchorY:Z,isVisible:!0}}const y=p.data;if(!Array.isArray(y))return n;const C=Dc(i.location,y,!!p.isHorizontal),b=C>=0?y[C]:null;if(!b||b.xp==null||b.yp==null)return n;let k=b.xp,L=b.yp;const w=typeof b.w=="number"&&typeof b.h=="number";return p.type==="bar"&&w?p.isHorizontal?(k=b.xp+b.w,L=b.yp+b.h/2):(k=b.xp+b.w/2,L=b.yp+b.h):w&&(k=b.xp+b.w/2,L=b.yp+b.h/2),{x:k+s,y:L+l,anchorX:k,anchorY:L,isVisible:!0}}return n}function Ik(e,t){var s,l,a;const{position:n}=e,i={xValue:null,yValue:null,seriesId:null,seriesName:null,dataIndex:-1,percentage:null};if(!n)return i;if(n.type==="axis")i.xValue=n.xValue,i.yValue=n.yValue;else if(n.type==="series"){const r=(s=t==null?void 0:t.seriesList)==null?void 0:s[n.seriesId],c=r==null?void 0:r.data;if(i.seriesId=n.seriesId,i.seriesName=(r==null?void 0:r.name)??null,(r==null?void 0:r.type)==="pie")i.yValue=((l=r.data)==null?void 0:l.o)??null,i.percentage=((a=r.data)==null?void 0:a.percentage)??null,i.dataIndex=0;else if(Array.isArray(c)){const d=Dc(n.location,c,!!r.isHorizontal);i.dataIndex=d,d>=0&&c[d]&&(i.xValue=c[d].x,i.yValue=c[d].y)}}return i}function Tk(e,t={}){if(jn(e))try{const n=e(t);return n==null?"":String(n)}catch{return""}return typeof e!="string"?e==null?"":String(e):e.replace(/\{(\w+)\}/g,(n,i)=>i in t&&t[i]!=null?String(t[i]):n)}function Bc(e={}){const t=e.fontWeight||"normal",n=typeof e.fontSize=="number"?`${e.fontSize}px`:e.fontSize||"11px",i=e.fontFamily||"sans-serif";return`${t} ${n} ${i}`}function Lk(e,t,n=A.calcTextSizeCanvas){const s=(e==null?"":String(e)).split(`
18
+ `);let l=0,a=0;const r=s.map(c=>{const d=n(c,t);return l=Math.max(l,d.width),a=Math.max(a,d.height),{text:c,width:d.width}});return{lines:r,width:l,height:a*r.length,lineHeight:a}}function Mk(e,t,n=A.calcTextSizeCanvas){const{type:i,style:s}=e;if(i==="circle"){const m=s.radius||0;return{w:m*2,h:m*2,content:null}}const l=Bc(s),a=`${l}|${t}`;let r;e._measure&&e._measure.key===a?r=e._measure.value:(r=Lk(t,l,n),e._measure={key:a,value:r});const[c,d,h,u]=s.padding||[0,0,0,0];return{w:r.width+u+d,h:r.height+c+h,content:r}}function vk(e,t,n){if(e&&e!=="auto")return e;const i=n.x-t.x,s=n.y-t.y;return i===0&&s===0?"bottom":Math.abs(s)>=Math.abs(i)?s>=0?"bottom":"top":i>=0?"right":"left"}function Rk(e,t,n,i){const s=Math.max(i,1);let l,a;return n==="bottom"||n==="top"?(l=n==="bottom"?e.y+e.h:e.y,a=Math.min(Math.max(t.x,e.x+s),e.x+e.w-s),{side:n,tipX:t.x,tipY:t.y,baseAX:a-s,baseAY:l,baseBX:a+s,baseBY:l}):(l=n==="right"?e.x+e.w:e.x,a=Math.min(Math.max(t.y,e.y+s),e.y+e.h-s),{side:n,tipX:t.x,tipY:t.y,baseAX:l,baseAY:a-s,baseBX:l,baseBY:a+s})}function Vk(e,t,n,i=A.calcTextSizeCanvas){const{type:s,style:l}=e,a=Mk(e,n,i);if(s==="circle"){const d=l.radius||0,h={cx:t.x,cy:t.y,r:d},u={x:t.x-d,y:t.y-d,w:d*2,h:d*2};return{type:s,box:u,shape:h,content:null,tail:null}}const r={x:Math.round(t.x-a.w/2),y:Math.round(t.y-a.h/2),w:a.w,h:a.h};let c=null;if(s==="callout"){const d={x:r.x+r.w/2,y:r.y+r.h/2},h={x:t.anchorX,y:t.anchorY},u=vk(l.anchor,d,h);c=Rk(r,h,u,l.arrowSize||8)}return{type:s,box:r,content:a.content,shape:null,tail:c}}const Oc={solid:[],dash:[4,4],dot:[1,3]};function Ek(e,t){return{x:Math.min(Math.max(t.x,e.x),e.x+e.w),y:Math.min(Math.max(t.y,e.y),e.y+e.h)}}function Wk(e,t,n,i){if(!(i!=null&&i.enabled))return;const s=Ek(n,t),l=i.style||{};e.save();try{e.beginPath(),e.strokeStyle=l.stroke||"#9E9E9E",e.lineWidth=l.strokeWidth||1,e.setLineDash(Oc[l.dashStyle]||Oc.solid),e.moveTo(t.x,t.y),i.type==="elbow"&&e.lineTo(s.x,t.y),e.lineTo(s.x,s.y),e.stroke()}finally{e.restore()}}function Gk(e,t,n){const i=n.backgroundColor&&n.backgroundColor!=="transparent",s=n.borderWidth>0&&n.borderColor&&n.borderColor!=="transparent";if(!(!i&&!s)){e.save();try{e.beginPath(),te.roundedRect(e,t.x,t.y,t.w,t.h,n.borderRadius||0),i&&(e.fillStyle=n.backgroundColor,e.fill()),s&&(e.lineWidth=n.borderWidth,e.strokeStyle=n.borderColor,e.stroke())}finally{e.restore()}}}function Zk(e,t,n,i){const{x:s,y:l,w:a,h:r}=t,c=s,d=s+a,h=l,u=l+r,m=Math.min(i.borderRadius||0,a/2,r/2),f=n==null?void 0:n.side;e.save();try{e.beginPath(),e.moveTo(c+m,h),f==="top"&&(e.lineTo(Math.min(n.baseAX,n.baseBX),h),e.lineTo(n.tipX,n.tipY),e.lineTo(Math.max(n.baseAX,n.baseBX),h)),e.lineTo(d-m,h),e.quadraticCurveTo(d,h,d,h+m),f==="right"&&(e.lineTo(d,Math.min(n.baseAY,n.baseBY)),e.lineTo(n.tipX,n.tipY),e.lineTo(d,Math.max(n.baseAY,n.baseBY))),e.lineTo(d,u-m),e.quadraticCurveTo(d,u,d-m,u),f==="bottom"&&(e.lineTo(Math.max(n.baseAX,n.baseBX),u),e.lineTo(n.tipX,n.tipY),e.lineTo(Math.min(n.baseAX,n.baseBX),u)),e.lineTo(c+m,u),e.quadraticCurveTo(c,u,c,u-m),f==="left"&&(e.lineTo(c,Math.max(n.baseAY,n.baseBY)),e.lineTo(n.tipX,n.tipY),e.lineTo(c,Math.min(n.baseAY,n.baseBY))),e.lineTo(c,h+m),e.quadraticCurveTo(c,h,c+m,h),e.closePath(),i.backgroundColor&&i.backgroundColor!=="transparent"&&(e.fillStyle=i.backgroundColor,e.fill()),i.borderWidth>0&&i.borderColor&&i.borderColor!=="transparent"&&(e.lineWidth=i.borderWidth,e.strokeStyle=i.borderColor,e.stroke())}finally{e.restore()}}function Xk(e,t,n){e.save();try{e.beginPath(),e.arc(t.cx,t.cy,t.r,0,Math.PI*2),n.backgroundColor&&n.backgroundColor!=="transparent"&&(e.fillStyle=n.backgroundColor,e.fill()),n.borderWidth>0&&n.borderColor&&n.borderColor!=="transparent"&&(e.lineWidth=n.borderWidth,e.strokeStyle=n.borderColor,e.stroke())}finally{e.restore()}}function Nk(e,t,n,i){var s;if(!(!n||!((s=n.lines)!=null&&s.length))){e.save();try{e.fillStyle=i.color||"#212121",e.font=Bc(i);const l=["left","right"].includes(i.textAlign)?i.textAlign:"center";e.textAlign=l,e.textBaseline="middle";const[,a,,r]=i.padding||[0,0,0,0];let c;l==="left"?c=t.x+r:l==="right"?c=t.x+t.w-a:c=t.x+t.w/2;const{lineHeight:d}=n,h=d*n.lines.length,u=t.y+t.h/2-h/2+d/2;n.lines.forEach((m,f)=>{e.fillText(m.text,c,u+f*d)})}finally{e.restore()}}}function Pk(e,t,n,i){var a;const{type:s,style:l}=t;if(s==="circle"){Xk(e,n.shape,l);return}(a=t.connector)!=null&&a.enabled&&s!=="callout"&&Wk(e,{x:i.anchorX,y:i.anchorY},n.box,t.connector),s==="callout"?Zk(e,n.box,n.tail,l):Gk(e,n.box,l),Nk(e,n.box,n.content,l)}function Dk(e,t,n,i=A.calcTextSizeCanvas){!e||!Array.isArray(t)||!t.length||t.forEach(s=>{try{const l=wk(s,n);if(!l.isVisible)return;const a=Ik(s,n),r=s.type==="circle"?"":Tk(s.content,a),c=Vk(s,l,r,i);Pk(e,s,c,l)}catch(l){be.warn(`[EvChart] annotation render failed (id: ${s&&s.id}):`,l)}})}const Bk=300;let Es=class{constructor(t,n,i,s,l,a,r){Object.keys(wc).forEach(d=>Object.assign(this,wc[d])),i.brush||(Object.assign(this,P1),Object.assign(this,F1),Object.assign(this,G1),Object.assign(this,z1),Object.assign(this,L1),Object.assign(this,H1),Object.assign(this,T1),Object.assign(this,R1)),i.type==="heatMap"&&i.legend.type==="gradient"&&Object.assign(this,v1),this.isMobile=ku(),this.brushSeries=r,this.target=t,this.data=n,this.options=i,this.listeners=s,this.wrapperDOM=document.createElement("div"),this.wrapperDOM.className=i.brush?"ev-chart-brush-wrapper":"ev-chart-wrapper",this.chartDOM=document.createElement("div"),this.chartDOM.className=i.brush?"ev-chart-brush-container":"ev-chart-container",this.wrapperDOM.appendChild(this.chartDOM),this.target.appendChild(this.wrapperDOM);const c=i.type==="pie";this.displayCanvas=document.createElement("canvas"),this.displayCanvas.setAttribute("style","display: block;"),this.displayCtx=this.displayCanvas.getContext("2d",{willReadFrequently:c}),this.bufferCanvas=document.createElement("canvas"),this.bufferCanvas.setAttribute("style","display: block;"),this.bufferCtx=this.bufferCanvas.getContext("2d",{willReadFrequently:c}),this.pixelRatio=window.devicePixelRatio||1,this.oldPixelRatio=this.pixelRatio,this.chartDOM.appendChild(this.displayCanvas),i.brush||(this.overlayCanvas=document.createElement("canvas"),this.overlayCanvas.setAttribute("style","display: block; z-index: 2;"),this.overlayCanvas.setAttribute("class","overlay-canvas"),this.overlayCtx=this.overlayCanvas.getContext("2d",{willReadFrequently:c}),this.chartDOM.appendChild(this.overlayCanvas),this.overlayCanvas.style.position="absolute",this.overlayCanvas.style.top="0px",this.overlayCanvas.style.left="0px"),this.isInitLegend=!1,this.isInitTitle=!1,this.isInit=!1,this.scrollbar={x:{isInit:!1},y:{isInit:!1}},this.seriesList={},this.lastTip={pos:null,value:null},this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.defaultSelectItemInfo=l,this.defaultSelectInfo=a,this.legendHover=null,this.initBlitState(),this.renderWorkerGate=new rk({isEnabled:()=>!!this.options.workerRender,hooks:{onInitFailure:d=>be.warn("[EvChart] workerRender 비활성화 — main 렌더로 fallback:",d),onRenderException:d=>be.warn("[EvChart] workerRender 렌더 예외 — main 렌더로 fallback:",d),onFallback:d=>{d==="unsupported"&&be.warn("[EvChart] workerRender 미지원 환경 — main 렌더 사용")}}}),this.renderEpoch=0,this.renderWorkerGate.setFrameHandler(d=>this.commitWorkerFrame(d)),this.renderWorkerGate.setErrorHandler(d=>this.drawSeriesLayerFallback(d)),this.renderWorkerGate.start()}init(){var u,m,f,g,p;const{series:t,data:n,labels:i,groups:s}=this.data,{type:l,axesX:a,axesY:r,tooltip:c,horizontal:d,realTimeScatter:h}=this.options;this.createSeriesSet(t,l,d,s),s.length&&this.addGroupInfo(s),h!=null&&h.use?(this.dataSet={},this.createRealTimeScatterDataSet(n)):this.createDataSet(n,i),this.minMax=this.getStoreMinMax(),this.initRect(),this.axesX=this.createAxes("x",a),this.axesY=this.createAxes("y",r),((m=(u=a==null?void 0:a[0])==null?void 0:u.scrollbar)!=null&&m.use||(g=(f=r==null?void 0:r[0])==null?void 0:f.scrollbar)!=null&&g.use)&&this.initScrollbar(),this.initDefaultSelectInfo(),this.drawChart(),c.use&&!this.isInitTooltip&&this.createTooltipDOM(),(p=this.createEventFunctions)==null||p.call(this),this.isInit=!0}_updateSeriesCount(){this.seriesInfo.count=Object.values(this.seriesList).filter(t=>t.show).length}initRect(){const t=this.options;t.title.show&&(this.isInitTitle||this.initTitle(),this.showTitle()),t.legend.show&&!t.legend.external?(this.isInitLegend||this.initLegend(),this.setLegendPosition()):t.legend.show&&t.legend.external&&this._updateSeriesCount(),this.chartRect=this.getChartRect()}drawSyncedIndicator({horizontal:t,label:n,mousePosition:i}){this.drawSyncedIndicator({horizontal:t,label:n,mousePosition:i})}adjustXAndYAxisWidth(){var i,s,l,a;const t=(r,c,d)=>{const{interval:h,graphMin:u,graphMax:m,steps:f=0,minIndex:g,maxIndex:p,indexInterval:y}=r??{};let C=[];if((d==null?void 0:d.type)==="step"&&g!==void 0&&p!==void 0&&y!==void 0){const{labels:b}=this.data,k=c==="x"?(b==null?void 0:b.x)??b??[]:(b==null?void 0:b.y)??b??[];C=[];for(let L=g;L<=p;L+=y)k[L]!==void 0&&C.push(k[L])}else if(h)C=Array.from({length:f},(b,k)=>u+k*h),C.push(m);else{const{labels:b}=this.data;C=c==="x"?(b==null?void 0:b.x)??b??[]:(b==null?void 0:b.y)??b??[]}return C},n={x:(s=(i=this.axesRange)==null?void 0:i.x)==null?void 0:s.map((r,c)=>{var y,C,b,k;const d=this.axesX[c],h=(y=this.axesSteps)==null?void 0:y.x[c],u=t(h,"x",d),m=Re((C=d==null?void 0:d.labelStyle)==null?void 0:C.fixWidth)?d.labelStyle.fixWidth:0;let f=[];const g=(b=this.axesSteps)==null?void 0:b.x[c];if((d==null?void 0:d.type)==="linear"&&g!=null){const{graphMin:L,graphMax:w}=g;if(typeof L=="number"&&typeof w=="number"){const M=Math.abs(L)>=Math.abs(w)?L:w;f=[TC(M)]}}const p=((k=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:k.call(d,u,this.chartRect,f))??0;return{...r,size:{width:m||Math.max(p,r.size.width),height:r.size.height}}}),y:(a=(l=this.axesRange)==null?void 0:l.y)==null?void 0:a.map((r,c)=>{var g,p,y;const d=this.axesY[c],h=(g=this.axesSteps)==null?void 0:g.y[c],u=t(h,"y",d),m=Re((p=d==null?void 0:d.labelStyle)==null?void 0:p.fixWidth)?d.labelStyle.fixWidth:0,f=((y=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:y.call(d,u,this.chartRect))??0;return{...r,size:{width:m||Math.max(f,r.size.width),height:r.size.height}}})};this.axesRange=n,this.labelOffset=this.getLabelOffset(n),this.labelRange=this.getAxesLabelRange(),this.axesSteps=this.calculateSteps()}computeAxesScaleChange(){var r;if(typeof((r=this.listeners)==null?void 0:r["axes-scale-change"])!="function")return null;const t=this._lastEmittedAxesRange,n=this.labelRange,i=(c,d)=>(c==null?void 0:c.min)===(d==null?void 0:d.min)&&(c==null?void 0:c.max)===(d==null?void 0:d.max),s=({min:c,max:d})=>({minSteps:c,maxSteps:d}),l=n.x.every((c,d)=>{var u;return!!!((u=this.options.axesX[d])!=null&&u.scaleChange)||!!t&&i(c,t.x[d])}),a=n.y.every((c,d)=>{var u;return!!!((u=this.options.axesY[d])!=null&&u.scaleChange)||!!t&&i(c,t.y[d])});return l&&a?null:(this._lastEmittedAxesRange=n,{x:n.x.map(s),y:n.y.map(s)})}emitDataMaxChange(){var i;const t=(i=this.listeners)==null?void 0:i["axes-data-max-change"];if(typeof t!="function")return;let n=-1/0;Object.values(this.seriesList).forEach(s=>{if(!(s!=null&&s.show)||!s.minMax)return;const l=s.minMax.maxY;Number.isFinite(l)&&l>n&&(n=l)}),t(Number.isFinite(n)?n:null)}prepareScale(){this.axesRange=this.getAxesRange(),this.labelOffset=this.getLabelOffset(),this.labelRange=this.getAxesLabelRange();const t=this.labelOffset;return this.axesSteps=this.calculateSteps(),this.adjustXAndYAxisWidth(),{scaleChange:this.computeAxesScaleChange(),scrollbarLabelOffset:t}}drawChart(t,n){var l,a,r,c,d,h;this.renderEpoch+=1,this.initScale();const{scaleChange:i,scrollbarLabelOffset:s}=this.prepareScale();this.computeScaleVersion(),((a=(l=this.scrollbar)==null?void 0:l.x)!=null&&a.use||(c=(r=this.scrollbar)==null?void 0:r.y)!=null&&c.use)&&this.updateScrollbarPosition(s),i&&typeof((d=this.listeners)==null?void 0:d["axes-scale-change"])=="function"&&this.listeners["axes-scale-change"](i),this.emitDataMaxChange(),!(!n&&this.tryDrawSeriesOnWorker(t))&&((h=this.options.realTimeScatter)!=null&&h.use?this.drawAxisAndSeries(t):(this.drawStaticLayer(this.bufferCtx,t),this.drawSeriesLayer(this.bufferCtx,t),this.shouldDrawSelectedOnTop(t)&&this.drawSelectedSeriesOnly()),this.drawSeriesOverlay(),this.drawForeground(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas),this.drawAnnotationLayer())}tryDrawSeriesOnWorker(t){var r;if(!((r=this.renderWorkerGate)!=null&&r.canAcceptRender())||!this.canRenderSeriesOnWorker(t).ok)return!1;const n=this.renderEpoch,i=Q1(this,n),{columns:s,transferList:l}=$1(i);return this.drawStaticLayer(this.bufferCtx,t),this.computeSeriesGeometry(),this.renderWorkerGate.render(i,s,l)?this.drawSeriesOverlay():(this.drawSeriesLayer(this.bufferCtx,t),this.drawSeriesOverlay(),this.drawForeground(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas)),this.drawAnnotationLayer(),!0}canRenderSeriesOnWorker(t){var a;if(t||this.lastHitInfo)return{ok:!1,reason:"hit-info"};const n=((a=this.seriesInfo)==null?void 0:a.charts)??{},i={line:!0,bar:!0,heatMap:!0},s=Object.keys(n).find(r=>!i[r]&&(n[r]??[]).some(c=>{var d;return((d=this.seriesList[c])==null?void 0:d.show)!==!1}));return s?{ok:!1,reason:`unsupported-type:${s}`}:(n.bar??[]).some(r=>{const c=this.seriesList[r];return(c==null?void 0:c.show)!==!1&&(c==null?void 0:c.timeMode)})?{ok:!1,reason:"time-bar"}:{ok:!0}}commitWorkerFrame(t){const n=t==null?void 0:t.bitmap;if(!n)return;if(t.epoch!==this.renderEpoch){n.close();return}const i=this.displayCtx;this.commitToDisplay(i,this.bufferCanvas),i.drawImage(n,0,0),n.close(),i.save(),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.drawForeground(i),i.restore()}drawSeriesLayerFallback(t){var n;t&&t.epoch!==this.renderEpoch||(this.drawSeriesLayer(this.bufferCtx,void 0),((n=this.options.plot)==null?void 0:n.aboveSeries)!==!1&&this.drawPlotsFront(this.bufferCtx),this.commitToDisplay(this.displayCtx,this.bufferCanvas))}commitToDisplay(t,n){if(this.displayCanvas){const i=this.pixelRatio<1?this.pixelRatio:1;t.clearRect(0,0,this.displayCanvas.width/i,this.displayCanvas.height/i)}n&&(n==null?void 0:n.width)>1&&(n==null?void 0:n.height)>1&&t.drawImage(n,0,0),this._blitPrev=this.snapshotBlitState()}drawAxisAndSeries(t){var d;(d=this.options.realTimeScatter)!=null&&d.use&&this.createPointsLayers();const n=this.evaluateBlitGate(t),i=typeof window<"u"&&window.__EVUI_BLIT_FORCE_OFF__===!0,s=typeof window<"u"?window.__EVUI_BLIT_REFRESH_INTERVAL__:void 0,l=Number.isFinite(s)?s:this._blitRefreshInterval||Bk,a=n.ok&&!i&&this.pointsLayerValid&&this.pointsLayersSized()&&this._framesSinceFullRedraw<l,r={blockedByForceOff:i,blockedByLayerInvalid:!this.pointsLayerValid,blockedByLayerUnsized:!this.pointsLayersSized(),blockedByRefreshDue:this._framesSinceFullRedraw>=l};let c=!1;if(a&&(c=this.drawChartBlitFastPath(t,n)),this.recordBlitDiag(n,c,r),c)this._lastFrameMode="blit",this._framesSinceFullRedraw++,this._pointsLayerStamp=this.computePointsLayerStamp(),this._pointsLayerOptionsRef=this.options,this._hitCoordsDirty=!0;else{this.drawStaticLayer(this.bufferCtx,t);let h=!1,u=!1,m="direct";!i&&this.canRouteFallbackViaLayer(t)?(h=this.maybeRebuildPointsLayer(r.blockedByRefreshDue),this.pointsLayerValid?(this.compositePointsLayer(this.getMaxVisibleScatterPointSize()),m=h?"rebuild":"layer"):(this.drawSeriesLayer(this.bufferCtx,t),u=!0)):(this.drawSeriesLayer(this.bufferCtx,t),h=this.maybeRebuildPointsLayer(!1),u=!(t!=null&&t.legend)),(h||u)&&(this._hitCoordsDirty=!1),h&&(this._framesSinceFullRedraw=0),this._lastFrameMode=m,m!=="layer"&&(this._lastRasterAt=Date.now())}}collectDuplicatePoints(t,n){var s,l,a;const i=!!this.options.seriesReverse;for(let r=i?n.length-1:0;i?r>=0:r<n.length;i?r--:r++){const c=this.seriesList[n[r]];if(!!(c!=null&&c.show))if((s=this.options.realTimeScatter)!=null&&s.use){const h=(l=c.data[c.sId])==null?void 0:l.dataGroup;for(let u=0;u<h.length;u++){const m=((a=h[u])==null?void 0:a.data)||[];for(let f=0;f<m.length;f++){const g=m[f];t.set(g.k??A.coordinateKey(g.x,g.y),c.sId)}}}else{const h=this.data.data[n[r]]??[];for(let u=0;u<h.length;u++){const m=h[u];t.set(A.coordinateKey(m.x,m.y),c.sId)}}}}canSkipRealtimeScatterDedupe(t){var i,s;if(!((i=this.options.realTimeScatter)!=null&&i.use))return!1;let n=0;for(let l=0;l<t.length;l++)if((s=this.seriesList[t[l]])!=null&&s.show&&(n++,n>1))return!1;return n===1}computeScaleVersion(){var r,c;const t=this.chartRect??{},n=this.labelOffset??{},i=this.options??{},s=((r=this.axesSteps)==null?void 0:r.x)??[],l=((c=this.axesSteps)==null?void 0:c.y)??[];let a=`${t.x1},${t.x2},${t.y1},${t.y2},${t.chartWidth},${t.chartHeight}|${n.left},${n.right},${n.top},${n.bottom}|${this.pixelRatio}|${i.horizontal?1:0}|${i.thickness},${i.cPadRatio},${i.borderRadius}|`;for(let d=0;d<s.length;d++){const h=s[d];a+=`${h==null?void 0:h.graphMin}:${h==null?void 0:h.graphMax}:${h==null?void 0:h.minIndex}:${h==null?void 0:h.maxIndex}:${h==null?void 0:h.oriSteps};`}a+="|";for(let d=0;d<l.length;d++){const h=l[d];a+=`${h==null?void 0:h.graphMin}:${h==null?void 0:h.graphMax}:${h==null?void 0:h.minIndex}:${h==null?void 0:h.maxIndex}:${h==null?void 0:h.oriSteps};`}a!==this._scaleKey&&(this._scaleKey=a,this._scaleVersion=(this._scaleVersion??0)+1)}computeSeriesGeometry(){const t={chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion};let n=0;this.seriesInfo.charts.bar.forEach(r=>{var c;(c=this.seriesList[r])!=null&&c.show&&n++}),["line","heatMap"].forEach(r=>{this.seriesInfo.charts[r].forEach(c=>{var d,h;(h=(d=this.seriesList[c])==null?void 0:d.computeGeometry)==null||h.call(d,t)})});const{thickness:i,cPadRatio:s,borderRadius:l}=this.options;let a=0;this.seriesInfo.charts.bar.forEach(r=>{var d;const c=this.seriesList[r];c&&((d=c.computeGeometry)==null||d.call(c,{...t,thickness:i,cPadRatio:s,borderRadius:l,showSeriesCount:n,showIndex:a}),c.show&&a++)})}drawSeriesLayer(t,n){var p;const{maxTip:i,selectLabel:s,selectItem:l,selectSeries:a,brush:r,displayOverflow:c,unSelectedOpacity:d}=this.options,h={ctx:t,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,maxTipOpt:{background:i.background,color:i.color},selectLabel:{option:s,selected:this.defaultSelectInfo},selectSeries:{option:a,selected:this.defaultSelectInfo},selectItem:{option:l,selected:this.defaultSelectItemInfo},isBrush:!!r,displayOverflow:c,unSelectedOpacity:d,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion,rtXOffsetCss:this._blitCarry};let u=0,m=0;this.seriesInfo.charts.bar.forEach(y=>{this.seriesList[y].show&&m++});const f=new Map,g=Object.keys(this.seriesInfo.charts);for(let y=0;y<g.length;y++){const C=g[y],b=this.seriesInfo.charts[C];let k=!1;C==="scatter"&&(k=this.options.coordinateDedupe!==!1&&!this.canSkipRealtimeScatterDedupe(b),k&&this.collectDuplicatePoints(f,b));for(let L=0;L<b.length;L++){let w=this.seriesList[b[L]];switch(C){case"line":{const M=n==null?void 0:n.legend;w.draw({legendHitInfo:M,...h});break}case"heatMap":{const M=n==null?void 0:n.legend;w.draw({legendHitInfo:M,...h});break}case"bar":{const M=n==null?void 0:n.legend,{thickness:V,cPadRatio:S,borderRadius:x}=this.options;w.draw({thickness:V,cPadRatio:S,borderRadius:x,showSeriesCount:m,showIndex:u,legendHitInfo:M,...h}),w.show&&u++;break}case"pie":{const M=this.lastHitInfo??{sId:(p=this.defaultSelectItemInfo)==null?void 0:p.seriesID},V=n==null?void 0:n.legend;this.options.sunburst?this.drawSunburst({selectInfo:M,legendHitInfo:V,unSelectedOpacity:h.unSelectedOpacity},t):this.drawPie({selectInfo:M,legendHitInfo:V,unSelectedOpacity:h.unSelectedOpacity},t),this.options.doughnutHoleSize>0&&this.drawDoughnutHole(t);break}case"scatter":{const M=n==null?void 0:n.legend;let V;if(l.use&&l.useSeriesOpacity){const S=this.lastHitInfo,x=this.defaultSelectItemInfo;S!=null&&S.dataIndex||(S==null?void 0:S.dataIndex)===0?V={seriesID:S.sId,dataIndex:S.dataIndex}:x!=null&&x.dataIndex||(x==null?void 0:x.dataIndex)===0?V={...x}:V=null}this.options.seriesReverse&&(w=this.seriesList[b.at(-1-L)]),w.draw({legendHitInfo:M,selectInfo:V,duple:f,coordinateDedupe:k,...h});break}}}}}drawSeriesOverlay(){var s,l;const t=this.overlayCtx;if(!t)return;const n={overlayCtx:t,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps},i=this.seriesInfo.charts.heatMap;for(let a=0;a<i.length;a++)(l=(s=this.seriesList[i[a]])==null?void 0:s.drawOverlay)==null||l.call(s,n)}ensureAnnotationCanvas(){if(this.annotationCtx)return!0;if(this.options.brush||!this.chartDOM||!this.displayCanvas)return!1;const t=this.options.type==="pie";return this.annotationCanvas=document.createElement("canvas"),this.annotationCanvas.setAttribute("style","display: block; z-index: 3;"),this.annotationCanvas.setAttribute("class","annotation-canvas"),this.annotationCtx=this.annotationCanvas.getContext("2d",{willReadFrequently:t}),this.chartDOM.appendChild(this.annotationCanvas),this.annotationCanvas.style.position="absolute",this.annotationCanvas.style.top="0px",this.annotationCanvas.style.left="0px",this.annotationCanvas.style.pointerEvents="none",this.annotationCanvas.width=this.displayCanvas.width,this.annotationCanvas.style.width=this.displayCanvas.style.width,this.annotationCanvas.height=this.displayCanvas.height,this.annotationCanvas.style.height=this.displayCanvas.style.height,this.annotationCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),!0}drawAnnotationLayer(){var l;const t=(l=this.options)==null?void 0:l.annotations;if(!(Array.isArray(t)&&t.length>0)){if(this._hadAnnotations&&this.annotationCtx){const a=this.pixelRatio<1?this.pixelRatio:1;this.annotationCtx.clearRect(0,0,this.annotationCanvas.width/a,this.annotationCanvas.height/a),this._hadAnnotations=!1}return}if(!this.ensureAnnotationCanvas())return;const i=this.annotationCtx,s=this.pixelRatio<1?this.pixelRatio:1;if(i.clearRect(0,0,this.annotationCanvas.width/s,this.annotationCanvas.height/s),this._hadAnnotations=!0,this._annotationSource!==t){const{annotations:a,warnings:r}=xk(t);this._normalizedAnnotations=a,this._annotationSource=t,r.forEach(c=>be.warn(c))}Dk(i,this._normalizedAnnotations,this.buildAnnotationViewport())}buildAnnotationViewport(){var a,r,c,d,h;const t=(a=this.data)==null?void 0:a.labels,n=t&&!Array.isArray(t)&&typeof t=="object",i=n?t.x:t,s=n?t.y:t,l=(u,m,f)=>(u??[]).map((g,p)=>{var y;return{...g,type:((y=m==null?void 0:m[p])==null?void 0:y.type)||"linear",labels:f}});return{chartRect:this.chartRect,labelOffset:this.labelOffset,axes:{x:l((r=this.axesSteps)==null?void 0:r.x,(c=this.options)==null?void 0:c.axesX,i),y:l((d=this.axesSteps)==null?void 0:d.y,(h=this.options)==null?void 0:h.axesY,s)},seriesList:this.seriesList}}drawTip(t){var i;let n;this.lastHitInfo?n=this.lastHitInfo:this.defaultSelectItemInfo?n=this.getItem(this.defaultSelectItemInfo,!1):this.defaultSelectInfo&&this.options.selectLabel.use?n=this.getItem(this.defaultSelectInfo,!1):n=null,(i=this.drawTips)==null||i.call(this,n,t)}createAxes(t,n=[]){const i=this.bufferCtx,l=this.options.type==="heatMap"?this.data.labels[t]:this.data.labels,a=this.options;return n.map(r=>{switch(r.type){case"linear":return new C1(t,r,i,a);case"time":return r.categoryMode?new I1(t,r,i,l,a):new S1(t,r,i,a);case"log":return new k1(t,r,i);case"step":return new w1(t,r,i,l,a);default:return!1}})}getAxesRange(){const t=this.axesX.map((i,s)=>i.calculateScaleRange(this.minMax.x[s],this.scrollbar.x,this.chartRect)),n=this.axesY.map((i,s)=>i.calculateScaleRange(this.minMax.y[s],this.scrollbar.y,this.chartRect));return{x:t,y:n}}drawStaticLayer(t,n){var i;this.axesX.forEach((s,l)=>{s.ctx=t,s.draw(this.chartRect,this.labelOffset,this.axesSteps.x[l],n,this.defaultSelectInfo,this.data.labels)}),this.axesY.forEach((s,l)=>{s.ctx=t,s.draw(this.chartRect,this.labelOffset,this.axesSteps.y[l],n,this.defaultSelectInfo)}),((i=this.options.plot)==null?void 0:i.aboveSeries)===!1&&this.drawPlotsFront(t)}drawPlotsFront(t=this.bufferCtx){this.plotLabelHitRegions=[],[...this.axesX??[],...this.axesY??[]].forEach(n=>{var i,s;n.ctx=t,(i=n.drawPlots)==null||i.call(n),(s=n.plotLabelHitRegions)!=null&&s.length&&this.plotLabelHitRegions.push(...n.plotLabelHitRegions)})}drawForeground(t=this.bufferCtx){var n;((n=this.options.plot)==null?void 0:n.aboveSeries)!==!1&&this.drawPlotsFront(t),this.drawTip(t)}calculateSteps(){const t=this.axesX.map((i,s)=>{const l={minValue:this.axesRange.x[s].min,maxValue:this.axesRange.x[s].max,minIndex:this.axesRange.x[s].minIndex,maxIndex:this.axesRange.x[s].maxIndex,minSteps:this.labelRange.x[s].min,maxSteps:this.labelRange.x[s].max};return i.calculateSteps(l)}),n=this.axesY.map((i,s)=>{const l={minValue:this.axesRange.y[s].min,maxValue:this.axesRange.y[s].max,minIndex:this.axesRange.y[s].minIndex,maxIndex:this.axesRange.y[s].maxIndex,minSteps:this.labelRange.y[s].min,maxSteps:this.labelRange.y[s].max};return i.calculateSteps(l)});return{x:t,y:n}}getAxesLabelRange(){const t=this.axesX.map((i,s)=>{const l=this.axesRange.x[s].size;return i.calculateLabelRange("x",this.chartRect,this.labelOffset,l.width)}),n=this.axesY.map((i,s)=>{const l=this.axesRange.y[s].size;return i.calculateLabelRange("y",this.chartRect,this.labelOffset,l.height)});return{x:t,y:n}}computePixelRatio(){const t=window.devicePixelRatio||1,n=this.displayCtx.webkitBackingStorePixelRatio||this.displayCtx.mozBackingStorePixelRatio||this.displayCtx.msBackingStorePixelRatio||this.displayCtx.oBackingStorePixelRatio||this.displayCtx.backingStorePixelRatio||1;return t/n}prepareLayout(t){this.pixelRatio=t,this.oldPixelRatio!==this.pixelRatio&&(this.oldPixelRatio=this.pixelRatio),this.bufferCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}initScale(){const t=this.computePixelRatio();this.prepareLayout(t),this.overlayCtx&&this.overlayCtx.setTransform(t,0,0,t,0,0),this.annotationCtx&&this.annotationCtx.setTransform(t,0,0,t,0,0)}getChartDOMRect(){var s;const t=(s=this.chartDOM)==null?void 0:s.getBoundingClientRect(),n=(t==null?void 0:t.width)||10,i=(t==null?void 0:t.height)||10;return this.setWidth(n),this.setHeight(i),{width:n,height:i}}getOverlayClientRect(){return!this.cachedOverlayRect&&this.overlayCanvas&&(this.cachedOverlayRect=this.overlayCanvas.getBoundingClientRect()),this.cachedOverlayRect}getChartDOMClientRect(){return!this.cachedChartDOMRect&&this.chartDOM&&(this.cachedChartDOMRect=this.chartDOM.getBoundingClientRect()),this.cachedChartDOMRect}invalidateClientRectCache(){this.cachedOverlayRect=null,this.cachedChartDOMRect=null}getChartRect(){var w,M,V,S;const{width:t,height:n}=this.getChartDOMRect(),i=this.options.padding,s=(M=(w=this.options.axesX)==null?void 0:w[0])==null?void 0:M.title,l=(S=(V=this.options.axesY)==null?void 0:V[0])==null?void 0:S.title,a=10;let r=0;s!=null&&s.use&&(s!=null&&s.text)&&(r=(isNaN(s==null?void 0:s.fontSize)?12:s==null?void 0:s.fontSize)+a);let c=0;l!=null&&l.use&&(l!=null&&l.text)&&(c=(isNaN(l==null?void 0:l.fontSize)?12:l==null?void 0:l.fontSize)+a);const d=this.scrollbar.x,h=this.scrollbar.y;let u=0;d!=null&&d.use&&(u=d==null?void 0:d.height);let m=0;h!=null&&h.use&&(m=h==null?void 0:h.width);const f=i.left+i.right+m,g=i.top+i.bottom+r+c+u,p=t>f?t-f:t,y=n>g?n-g:n,C=i.left,b=Math.max(t-i.right-m,C+2),k=i.top+c,L=Math.max(n-i.bottom-r-u,k+2);return{x1:C,x2:b,y1:k,y2:L,chartWidth:p,chartHeight:y,width:t,height:n}}setWidth(t){var i;if(!this.displayCanvas)return;const n=t*this.pixelRatio;this._deviceWidth!==n&&(this._deviceWidth=n,this.displayCanvas.width=n,this.displayCanvas.style.width=`${t}px`,this.bufferCanvas.width=n,this.bufferCanvas.style.width=`${t}px`,this.overlayCanvas&&(this.overlayCanvas.width=n,this.overlayCanvas.style.width=`${t}px`),this.annotationCanvas&&(this.annotationCanvas.width=n,this.annotationCanvas.style.width=`${t}px`),(i=this.pointsLayers)!=null&&i.size&&this.resizePointsLayers(this.bufferCanvas.width,this.bufferCanvas.height)&&(this.pointsLayerValid=!1))}setHeight(t){var i;if(!this.displayCanvas)return;const n=t*this.pixelRatio;this._deviceHeight!==n&&(this._deviceHeight=n,this.displayCanvas.height=n,this.displayCanvas.style.height=`${t}px`,this.bufferCanvas.height=n,this.bufferCanvas.style.height=`${t}px`,this.overlayCanvas&&(this.overlayCanvas.height=n,this.overlayCanvas.style.height=`${t}px`),this.annotationCanvas&&(this.annotationCanvas.height=n,this.annotationCanvas.style.height=`${t}px`),(i=this.pointsLayers)!=null&&i.size&&this.resizePointsLayers(this.bufferCanvas.width,this.bufferCanvas.height)&&(this.pointsLayerValid=!1))}getLabelOffset(t=null){const n=this.axesX,i=this.axesY,s=t??this.axesRange,l={top:2,left:2,right:2,bottom:2},a={width:14,height:4};let r=0,c=0;return n.forEach((d,h)=>{var u;(u=d.labelStyle)!=null&&u.show&&(r=s.x[h].size.width+a.width,c=s.x[h].size.height+a.height,d.position==="bottom"?c>l.bottom&&(l.bottom=c):d.position==="top"&&c>l.top&&(l.top=c),l.left=r/2>l.left?r/2:l.left,l.right=r/2>l.right?r/2:l.right)}),i.forEach((d,h)=>{var u;(u=d.labelStyle)!=null&&u.show&&(r=s.y[h].size.width+a.width,d.position==="left"?r>l.left&&(l.left=r):d.position==="right"&&r>l.right&&(l.right=r),l.top=c/2>l.top?c/2:l.top,l.bottom=c/2>l.bottom?c/2:l.bottom)}),l}updateScrollbar(t,n){var c,d,h,u,m,f,g,p,y,C;const i=n||t,s=((h=(d=(c=this.options.axesX)==null?void 0:c[0])==null?void 0:d.scrollbar)==null?void 0:h.use)??!1,l=((f=(m=(u=this.options.axesY)==null?void 0:u[0])==null?void 0:m.scrollbar)==null?void 0:f.use)??!1,a=((p=(g=this.scrollbar)==null?void 0:g.x)==null?void 0:p.use)??!1,r=((C=(y=this.scrollbar)==null?void 0:y.y)==null?void 0:C.use)??!1;(s!==a||s||i&&s)&&this.updateScrollbarInfo("x",t),(l!==r||l||i&&l)&&this.updateScrollbarInfo("y",t)}update(t){var y,C,b,k,L,w,M;const n=this.options,i=this.data.data,s=this.data.labels,l=this.data.groups,a=this.data.series,{updateSeries:r,updateSelTip:c,updateLegend:d,updateData:h,updateTooltip:u,lightUpdate:m,updateByScrollbar:f}=t;if(!this.isInit)return;if((h||r)&&(this._lastHoverSig=""),this.updateScrollbar(h,f),this.resetProps(),this.updateSeries=r,r&&(this.pointsLayerValid=!1),(y=this.options.realTimeScatter)!=null&&y.use&&this.createPointsLayers(),r){const V=this.seriesList;this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.lastTip={pos:null,value:null},this.reconcileSeriesSet(a,n.type,n.horizontal,l,V),this.legendDOM&&!n.legend.external&&this.updateLegend()}if(c.update&&(this.lastTip.value=null,c.keepDomain||(this.lastTip.pos=null,this.lastHitInfo=null)),!m)if(l.length&&this.addGroupInfo(l),(C=this.options.realTimeScatter)!=null&&C.use?(this.dataSet||(this.dataSet={}),this.createRealTimeScatterDataSet(i)):this.createDataSet(i,s),n.title.show?(this.isInitTitle?this.updateTitle():this.initTitle(),this.showTitle()):this.isInitTitle&&this.hideTitle(),n.legend.show&&!n.legend.external){const V=!!((k=(b=n.legend)==null?void 0:b.table)!=null&&k.use)&&n.type!=="heatMap"&&n.type!=="scatter";this.isInitLegend?r?this.updateLegend():d?this.forceUpdateLegend():V&&h&&this.updateLegendTableValues():this.initLegend(),this.setLegendPosition(),this.updateLegendContainerSize(),this.showLegend()}else n.legend.show&&n.legend.external?(r||h)&&(this._updateSeriesCount(),this.emitLegendData()):this.isInitLegend&&this.hideLegend();u&&(this.isInitTooltip||this.createTooltipDOM(),this.tooltipDOM.innerHTML="",(w=(L=n.tooltip)==null?void 0:L.formatter)!=null&&w.html||this.setDefaultTooltipLayout()),this.minMax=this.getStoreMinMax(),this.axesX=this.createAxes("x",n.axesX),this.axesY=this.createAxes("y",n.axesY),this.initDefaultSelectInfo();let g=t==null?void 0:t.hitInfo;!(g!=null&&g.legend)&&((M=this.legendHover)!=null&&M.sId)&&(g={...g||{},legend:this.legendHover}),this.render(g),this.dragDisplayCanvas&&this.refreshDragDisplayCanvas(),this.dragInfo&&this.drawSelectionArea?this.drawSelectionArea(this.dragInfo):this.dragInfoBackup&&(m?this.drawSelectionArea(this.dragInfoBackup):this.dragInfoBackup=null)}resetProps(){this.axesX[0]=null,this.axesY[0]=null,this.axesX=null,this.axesY=null,this.minMax=null,this.axesRange=null,this.labelOffset=null,this.chartRect=null}overlayClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}clear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.bufferCanvas&&this.bufferCtx.clearRect(0,0,this.bufferCanvas.width/this.clearRectRatio,this.bufferCanvas.height/this.clearRectRatio),this.overlayCanvas&&this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}resize(t){var n,i,s,l,a,r,c;this.invalidateClientRectCache(),this.clear(),this.bufferCtx.restore(),this.bufferCtx.save(),this.pointsLayerValid=!1,((s=(i=(n=this.options.axesX)==null?void 0:n[0])==null?void 0:i.scrollbar)!=null&&s.use||(r=(a=(l=this.options.axesY)==null?void 0:l[0])==null?void 0:a.scrollbar)!=null&&r.use)&&this.initScrollbar(),this.initRect(),this.initScale(),this.chartRect=this.getChartRect(),this.drawChart(void 0,!0),this.dragDisplayCanvas&&this.refreshDragDisplayCanvas(),this.dragInfoBackup&&((c=this.drawSelectionArea)==null||c.call(this,this.dragInfoBackup)),t&&t(!0)}render(t){this.isInit&&(this.invalidateClientRectCache(),this._vsDetectFailed=!1,this.clear(),this.chartRect=this.getChartRect(),this.drawChart(t))}_getLegendSeries(){var n;const t=(n=this.data.groups)==null?void 0:n.at(0);return t?t.filter(i=>{var s;return(s=this.seriesList[i])==null?void 0:s.showLegend}).map(i=>[i,this.seriesList[i]]):Object.entries(this.seriesList).filter(([,i])=>i.showLegend)}_seriesToLegendItem(t){const n=typeof t.color!="string"?t.color[t.color.length-1][1]:t.color;return{sId:t.sId,name:t.name,color:n,type:t.type,show:t.show,fill:t.fill,fillColor:t.fillColor}}buildLegendData(){return this._getLegendSeries().map(([,t])=>this._seriesToLegendItem(t))}emitLegendData(){typeof this.listeners["update:legendData"]=="function"&&this.listeners["update:legendData"](this.buildLegendData())}toggleSeries(t){var d;const n=this.seriesList[t];if(!n)return;const i=this.options.legend,s=this._getLegendSeries();if(i.clickMode==="active")s.every(([,m])=>m.show)?(s.forEach(([,m])=>{m.show=!1}),n.show=!0,this.seriesInfo.count=1):n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++),s.every(([,m])=>!m.show)&&(s.forEach(([,m])=>{m.show=!0}),this.seriesInfo.count=s.length);else{if(n.show&&this.seriesInfo.count===1)return;n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++)}if(this.brushSeries){const{chartIdx:h}=this.data,u=[...this.brushSeries.list];u[h]=this.seriesList,this.brushSeries.list=u,this.brushSeries.chartIdx=h}((d=this.options.eventBehavior)==null?void 0:d.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const a=Object.values(this.seriesList).filter(h=>h.show).map(h=>h.sId),r=a.length===Object.values(this.seriesList).length,c={data:{seriesIds:r?[]:a,isActiveAll:r}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](c),this.options.legend.show&&this.options.legend.external&&this.emitLegendData()}highlightSeries(t){const n={sId:t,type:this.options.type};this.legendHover=n,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:n},lightUpdate:!0})}unhighlightSeries(){this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})}destroy(){var n,i;if(!this.isInit)return;const t=this.target;for(this.options.legend.show&&!this.options.legend.external&&(this.legendBoxDOM&&(this.legendBoxDOM.removeEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.removeEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.removeEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.type==="gradient"&&this.legendBoxDOM.removeEventListener("mousedown",this.onLegendMouseDown),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.removeEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.removeEventListener("scroll",this.renderVisibleLegends))),this.resizeDOM&&this.resizeDOM.removeEventListener("mousedown",this.onResizeMouseDown)),this.overlayCanvas&&(this.overlayCanvas.removeEventListener("mousemove",this.onMouseMove),this.overlayCanvas.removeEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.removeEventListener("dblclick",this.onDblClick),this.overlayCanvas.removeEventListener("click",this.onClick),(n=this.dragStartTarget)==null||n.removeEventListener("mousedown",this.onMouseDown),this.overlayCanvas.removeEventListener("wheel",this.onWheel),window.removeEventListener("click",this.dragTouchSelectionEvent),this.invalidateRectOnScroll&&window.removeEventListener("scroll",this.invalidateRectOnScroll,{capture:!0}),this.dragDisplayCanvas&&((i=this.dragDisplayCanvas.parentNode)==null||i.removeChild(this.dragDisplayCanvas),this.dragDisplayCanvas=null,this.dragDisplayCtx=null,this.dragDisplayOffset=null),this.dragStartTarget&&this.dragStartAreaPrevPosition!==void 0&&(this.dragStartTarget.style.position=this.dragStartAreaPrevPosition,this.dragStartAreaPrevPosition=void 0)),this.isInitTooltip&&this.tooltipDestroy(),this.renderWorkerGate&&this.renderWorkerGate.destroy(),this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),this.wrapperDOM=null,this.chartDOM=null,this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.ghostDOM=null,this.titleDOM=null,this.displayCanvas=null,this.bufferCanvas=null,this.overlayCanvas=null,this.annotationCanvas=null,this.annotationCtx=null,this._normalizedAnnotations=null,this._annotationSource=null,this._hadAnnotations=!1;t.hasChildNodes();)t.removeChild(t.firstChild)}hideTooltip(){var t;this.options.tooltip.use&&((t=this.tooltipDOM)!=null&&t.style)&&(this.tooltipDOM.style.display="none")}initDefaultSelectInfo(){var s,l;const{type:t,selectLabel:n,selectSeries:i}=this.options;if(n.use){let a=null;t==="heatMap"&&(n!=null&&n.useBothAxis)&&(a=(s=this.defaultSelectInfo)==null?void 0:s.targetAxis),this.defaultSelectInfo=(l=this.defaultSelectInfo)!=null&&l.dataIndex?this.getSelectedLabelInfoWithLabelData(this.defaultSelectInfo.dataIndex,a):{dataIndex:[],label:[],data:[]}}i.use&&!this.defaultSelectInfo&&(this.defaultSelectInfo={seriesId:[]})}};Object.assign(Es.prototype,A1),Object.assign(Es.prototype,_1);const Ok={name:"EvChartToolbar",props:{toolbar:{type:Object,default:()=>({})}},emits:["onClickToolbar"]},Yk={class:"ev-chart-toolbar"},Fk={class:"ev-chart-toolbar__icon"};function Hk(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",Yk,[o.createElementVNode("div",Fk,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.$props.toolbar.items,(r,c)=>(o.openBlock(),o.createBlock(a,{key:`${c}-${r.icon}`,class:o.normalizeClass(c),icon:r.icon,size:r.size,title:r.title,onClick:d=>e.$emit("onClickToolbar",d,c)},null,8,["class","icon","size","title","onClick"]))),128))])])}const Yc=ce(Ok,[["render",Hk],["__scopeId","data-v-dfbffbab"]]);class zk{constructor(t,n,i,s,l,a,r){this.isExecuteZoom=l,this.evChartProps=t.props,this.evChartCloneData=n.data,this.brushIdx=a;const c=i.zoom;this.setEvChartZoomOptions(c),this.setIcon(s);const d=n.data[0].labels.length-1;this.cloneLabelsLastIdx=d,this.isAnimationFinish=!0,this.zoomAreaMemory={previous:[],current:[[0,d]],latest:[]},r&&(this.emitFunc=r,r.updateZoomStartIdx(0),r.updateZoomEndIdx(d)),c.useWheelMove&&(this.wrapWheelMoveZoomArea=this.wheelMoveZoomArea.bind(this)),this.evChartDomContainers=c.useAnimation?this.drawAnimationCanvas(t.dom):t.dom}setEvChartZoomOptions(t){this.evChartZoomOptions=t}setIcon(t){if(!t)return;const n=t.querySelector(".dragZoom");this.resetIcon=t.querySelector(".reset"),this.previousIcon=t.querySelector(".previous"),this.latestIcon=t.querySelector(".latest"),this.dragZoomIcon=n,this.iconStyle(n,"enable")}drawAnimationCanvas(t){return t.forEach(n=>{const i=document.createElement("canvas");i.setAttribute("style","display: block;"),i.setAttribute("class","animation-canvas"),i.style.position="absolute",n.appendChild(i)}),t}setEventListener(t){const n=t?"addEventListener":"removeEventListener";this.isUseZoomMode=t,this.evChartDomContainers.forEach(i=>{i[n]("wheel",this.wrapWheelMoveZoomArea)})}wheelMoveZoomArea(t){t.preventDefault();const[n,i]=this.zoomAreaMemory.current[0];if(n===i)return;let s,l;if(t.deltaY>0){if(!n)return;s=n-1,l=i-1}else{if(i===this.cloneLabelsLastIdx)return;s=n+1,l=i+1}this.isUseToolbar=!0,this.executeZoom(s,l),this.zoomAreaMemory.current[0]=[s,l]}clickMoveZoomArea(t){if(!this.zoomAreaMemory[t].length)return;const[n,i]=this.zoomAreaMemory[t].pop();this.isUseToolbar=!0,this.executeZoom(n,i),this.setZoomAreaMemory(n,i,t==="previous"?"latest":"previous")}dragZoom({data:t,range:{dragSelectionInfo:n}}){const{dragXsp:i,dragXep:s,exceptAxesYChartWidth:l,chartTitle:a}=n,{options:r,data:c}=this.evChartProps,d=r.length>1?r.findIndex(h=>{var u;return(((u=h==null?void 0:h.title)==null?void 0:u.text)??"")===a}):0;if(r[d].axesX[0].type==="time"){const h=t[0].items,u=h[0].x,m=h[h.length-1].x,f=c[d].labels,g=this.evChartCloneData[d].labels,[p,y]=this.zoomAreaMemory.current[0];let C=g.findIndex(M=>+M.$d==+u.$d),b=g.findLastIndex(M=>+M.$d==+m.$d);const k=M=>l/(f.length-1)*(M-p);let L=k(C);if(C===b&&(L-i>=s-L?C-=1:b+=1),C===p&&b===y)return;C-b===-1&&(L=k(C));const w=k(b);this.evChartZoomOptions.useAnimation?this.dragZoomAnimation(n,C,b,L,w):(this.executeZoom(C,b),this.setZoomAreaMemory(C,b))}}dragZoomAnimation(t,n,i,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=t,d=window.devicePixelRatio||1,h=Array.from(this.evChartDomContainers).map(u=>{const m=u.querySelector(".animation-canvas");return[u.children[0],m]});for(let u=0;u<h.length;u++){const[m,f]=h[u],g=f.getContext("2d");f.style.top=`${a.y1}px`,f.style.left=`${a.x1}px`,f.width=r*d,f.style.width=`${r}px`,f.height=c*d,f.style.height=`${c}px`,f.style.display==="none"&&(f.style.display="block"),this.isAnimationFinish=!1,this.isUseToolbar=!0,this.executeDragZoomAnimation(m,g,t,s,l).then(p=>{f.style.display="none",p&&u===h.length-1&&(this.isAnimationFinish=p,this.executeZoom(n,i),this.setZoomAreaMemory(n,i))})}}executeZoom(t,n){this.isExecuteZoom&&(this.isExecuteZoom.value=!0);for(let i=0;i<this.evChartCloneData.length;i++){const{data:s,labels:l,series:a}=this.evChartCloneData[i],r=this.evChartProps.data[i],c=Object.keys(a);for(let d=0;d<c.length;d++){const h=c[d];r.data[h]=s[h].filter((u,m)=>t<=m&&n>=m)}r.labels=l.filter((d,h)=>t<=h&&n>=h)}!this.brushIdx.isUseButton&&!this.brushIdx.isUseScroll&&(this.brushIdx.start=t,this.brushIdx.end=n),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(t),this.emitFunc.updateZoomEndIdx(n))}setBrushIdx(t,n){this.brushIdx.end=-1;for(let i=0;i<n.value.length;i++){const s=t.data[n.value[i]];s.labels.length&&(this.brushIdx.start=0,this.brushIdx.end=s.labels.length-1)}}updateEvChartCloneData(t,n,i,s){const l=t.data[0].labels.length-1;if(this.cloneLabelsLastIdx=l,this.evChartCloneData=t.data,s){const a=this.zoomAreaMemory.current[0];let r=a[0],c=a[1];r===0&&c===-1&&(r=0,c=l,this.zoomAreaMemory={previous:[],current:[[r,c]],latest:[]}),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(r),this.emitFunc.updateZoomEndIdx(c)),this.executeZoom(r,c)}else this.dragZoomIcon&&this.dragZoomIcon.classList.remove("active"),this.zoomAreaMemory={previous:[],current:[[0,l]],latest:[]},this.emitFunc&&(this.emitFunc.updateZoomStartIdx(0),this.emitFunc.updateZoomEndIdx(l)),this.setIconStyle(i),this.setBrushIdx(t,n)}setZoomAreaMemory(t,n,i){if(t<0||n<=0)return;const{previous:s,current:l,latest:a}=this.zoomAreaMemory,r=l.pop(),{bufferMemoryCnt:c}=this.evChartZoomOptions;i?(s.length>=c&&s.splice(0,s.length-c+1),this.zoomAreaMemory[i].push(r)):(t!==r[0]||n!==r[1])&&(r[0]===0&&r[1]===-1?s.push([0,this.cloneLabelsLastIdx]):s.push(r),a.length=0),l.push([t,n]),this.setIconStyle(this.isUseZoomMode)}executeDragZoomAnimation(t,n,i,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=i;let d=0,h=s,u=l-s,m=l,f=1;const g=.0015;let p=.5;const y=.1,C=.05,b=50,k=Math.ceil(b*(s/r)),L=Math.ceil(b*((r-l)/r)),w=M=>(n.clearRect(0,0,r,c),h<=0&&u>=r?(t.style.opacity="initial",M(!0)):(p>=y&&(t.style.opacity=p,p-=C),n.globalAlpha=f,n.drawImage(t,a.x1,a.y1,s,c,d,0,s,c),n.drawImage(t,a.x1+s,a.y1,l-s,c,h,0,u,c),n.drawImage(t,a.x1+l,a.y1,r,c,m,0,r,c),f-=g,d-=k,h-=k,u+=k+L,m+=L,requestAnimationFrame(()=>w(M))));return new Promise(M=>w(M))}setIconStyle(t){const n=(i,s)=>{s?this.iconStyle(i,"enable"):this.iconStyle(i,"disable")};if(t&&this.dragZoomIcon.classList.contains("active")){const{previous:i,latest:s}=this.zoomAreaMemory;n(this.previousIcon,i.length),n(this.latestIcon,s.length),this.iconStyle(this.resetIcon,"enable")}else n(this.resetIcon),n(this.previousIcon),n(this.latestIcon)}iconStyle(t,n){if(!t)return;const[i,s]=n==="enable"?[1,"initial"]:[.5,"none"];t.style.opacity=i,t.style.pointerEvents=s}initZoom(){if(!this.isAnimationFinish)return;const[t,n]=this.zoomAreaMemory.current[0],i=this.cloneLabelsLastIdx;(t!==0||n!==i)&&(this.isUseToolbar=!0,this.executeZoom(0,i),this.setZoomAreaMemory(0,i))}}const Ak={padding:{top:20,right:2,left:2,bottom:4},border:2,title:{show:!1,height:40,text:"",style:{fontSize:15,color:"#000",fontFamily:"Roboto"}},legend:{show:!0,type:"icon",position:"right",color:"#353740",inactive:"#aaa",width:140,height:24,allowResize:!1,virtualScroll:!1,clickMode:"active",external:!1,table:{use:!1,columns:{name:{title:"Name"},min:{title:"MIN",use:!1},max:{title:"MAX",use:!1},avg:{title:"AVG",use:!1},total:{title:"TOTAL",use:!1},last:{title:"LAST",use:!1}}}},itemHighlight:!0,seriesHighlight:!0,unSelectedOpacity:.3,useSelect:!1,doughnutHoleSize:0,pieStroke:{use:!0,lineWidth:2,color:"#FFFFFF"},reverse:!1,horizontal:!1,displayOverflow:!1,overlapping:{use:!1},width:"100%",height:"100%",thickness:1,cPadRatio:0,borderRadius:0,combo:!1,tooltip:{use:!0,sortByValue:!0,backgroundColor:"#4C4C4C",fontColor:"#FFFFFF",borderColor:"#666666",shadowOpacity:.25,useShadow:!1,throttledMove:!0,debouncedHide:!1,useScrollbar:!1,textOverflow:"wrap",fontFamily:"Roboto",colorShape:"rect",fontSize:{title:16,contents:14},rowPadding:{top:0,bottom:3,right:20,left:16},showHeader:!0,virtualScroll:{use:"auto",threshold:50,estimatedRowHeight:28,overscan:5}},indicator:{use:!0,color:"#EE7F44",segments:null},plot:{aboveSeries:!0},maxTip:{use:!1,fixedPosTop:!1,showIndicator:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400}},selectItem:{use:!1,useClick:!0,showTextTip:!1,tipText:"value",showTip:!1,showIndicator:!1,fixedPosTop:!1,useApproximateValue:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},useSeriesOpacity:!1,useDeselectItem:!1,showBorder:!1,borderStyle:{color:"#FFFFFF",lineWidth:1,opacity:1,radius:0}},selectLabel:{use:!1,useClick:!0,tipText:"value",limit:1,useDeselectOverflow:!1,showTip:!1,useSeriesOpacity:!0,useLabelOpacity:!0,fixedPosTop:!1,useApproximateValue:!1,tipBackground:"#000000",indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},showTextTip:!1,showIndicator:!1,useBothAxis:!1},selectSeries:{use:!1,useClick:!0,limit:1,useDeselectOverflow:!1},dragSelection:{use:!1,keepDisplay:!0,size:50,fillColor:"#38ACEC",opacity:.65,startArea:"",displayFromStartArea:!1},zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}},heatMapColor:{min:"#FFFFFF",max:"#0052FF",rangeCount:1,colorsByRange:[],stroke:{show:!1,color:"#FFFFFF",lineWidth:1,opacity:1,radius:0},error:"#FF0000",decimalPoint:0},seriesReverse:!1,coordinateDedupe:!0,eventBehavior:{legendClick:"update"},workerRender:!1,shallowDataWatch:!1,shallowOptionsWatch:!1},_k={series:{},groups:[],labels:[],data:{}},Kk=e=>Xb({...e},_k),Uk=e=>e instanceof Date||e!==null&&typeof e=="object"&&typeof e.toDate=="function"&&typeof e.format=="function",xl=e=>Er(e,function t(n){if(Uk(n))return n;if(o.isReactive(n))return Er(o.toRaw(n),t)}),Jk=(e,t)=>{if(!e)return t.data;const n=t.data??{},i={};return Object.keys(n).forEach(s=>{var l;i[s]=(l=e[s])!=null&&l.length?e[s].concat(n[s]??[]):n[s]}),Object.keys(e).forEach(s=>{var l;!(s in i)&&((l=t.series)!=null&&l[s])&&(i[s]=e[s])}),i},jk=()=>{let e=null;const t=200;return{clickEventCallback:s=>{e&&(clearTimeout(e),e=null),e=setTimeout(()=>{s(),e=null},t)},dblClickEventCallback:s=>{e&&(clearTimeout(e),e=null),s()}}},Fc=(e,t)=>{var f;const n=o.getCurrentInstance(),{props:i,emit:s}=n,l=g=>{const p=Pe({},g,Ak);return(g.type==="scatter"||g.type==="heatMap")&&!(g!=null&&g.tooltip)&&(p.tooltip.use=!1),g.type==="pie"&&!(g!=null&&g.padding)&&(p.padding={top:2,right:2,left:2,bottom:4}),p},a=Kk,r=Ve(i.selectedItem),c=Ve(i.selectedLabel??(e==null?void 0:e.value)),d=Ve(i.selectedSeries),{clickEventCallback:h,dblClickEventCallback:u}=jk(),m={click:async g=>{await o.nextTick(),h(()=>{const{seriesId:p,dataIndex:y,eventTarget:C,targetAxis:b}=(g==null?void 0:g.selected)??{},{eventTarget:k}=(g==null?void 0:g.deselected)??{};switch(C){case"item":{p!==null?(s("update:selectedItem",{seriesID:p,dataIndex:y}),k==="label"&&s("update:selectedLabel",{dataIndex:[]})):s("update:selectedItem",null);break}case"label":{e!=null&&e.value?e.value.dataIndex=y:(s("update:selectedLabel",{dataIndex:y,targetAxis:b}),k==="item"&&s("update:selectedItem",null));break}case"series":{s("update:selectedSeries",{seriesId:p});break}}s("click",g)})},"dbl-click":async g=>{await o.nextTick(),u(()=>{const{eventTarget:p}=g;switch(p){case"series":{s("update:selectedSeries",{seriesId:g.seriesId?[g.seriesId]:[]});break}}s("dbl-click",g)})},"drag-select":async g=>{await o.nextTick(),s("drag-select",g)},"mouse-move":async g=>{t!=null&&t.value&&(t.value=g.hoveredLabel),await o.nextTick(),s("mouse-move",g)},"mouse-leave":()=>{t!=null&&t.value&&(t.value.label=null)},"click-legend":async g=>{await o.nextTick(),s("click-legend",g)},"update:legendData":async g=>{await o.nextTick(),s("update:legendData",g)},"axes-scale-change":g=>{s("axes-scale-change",g)}};return(f=n.vnode.props)!=null&&f.onAxesDataMaxChange&&(m["axes-data-max-change"]=g=>{s("axes-data-max-change",g)}),{eventListeners:m,selectItemInfo:r,selectLabelInfo:c,selectSeriesInfo:d,getNormalizedData:a,getNormalizedOptions:l}},Hc=e=>{const t=o.ref(),n=o.computed(()=>{const i=s=>{let l;return s?l=s.unit?s.value+s.unit:`${s.value}px`:l=void 0,l};return{width:i(Za(e.width)),height:i(Za(e.height))}});return{wrapper:t,wrapperStyle:n}},zc=(e,{wrapper:t,evChartGroupRef:n},i,s)=>{const{props:l,emit:a}=o.getCurrentInstance(),r=o.ref(!1),c=o.ref(!1),d=o.ref(!0),h=o.ref(),u=o.reactive({zoom:e.zoom}),m=o.reactive({start:0,end:-1,isUseButton:!1,isUseScroll:!1});let f=null;const g=o.reactive({dom:[],props:{data:[],options:[]}}),p=o.reactive({data:null,options:null}),y=o.ref([]),C=x=>{x.data.length&&x.range&&c.value&&f.dragZoom(x)},b=()=>{g.props.options.forEach((x,I)=>{if(x.zoom={...x.zoom,use:c.value,getRangeInfo:C},c.value)x.dragSelection={...x.dragSelection,use:!0,keepDisplay:!1};else{const{use:T,keepDisplay:v}=p.options[I].dragSelection??{};x.dragSelection={use:!!T,keepDisplay:!!v}}})},k=()=>{if(n!=null&&n.value?(g.dom=n.value.querySelectorAll(".ev-chart-container"),g.dom.length&&s.value.forEach(({data:x,options:I},T)=>{x.chartIdx=T,g.props.data.push(x),g.props.options.push(I),y.value.push(T)})):(g.dom=[t.value.querySelector(".ev-chart-container")],g.props.data.push(l.data),g.props.options.push(l.options)),g.props.data.length){p.data=Ve(g.props.data),p.options=Ve(g.props.options);const x={updateZoomStartIdx:I=>a("update:zoomStartIdx",I),updateZoomEndIdx:I=>a("update:zoomEndIdx",I)};f=new zk(g,p,u,h.value,r,m,x)}},L=x=>{p.data[0].labels.length<=1||(c.value=!c.value,x?x.classList.toggle("active"):h.value.querySelector(".dragZoom").classList.toggle("active"),b(),f.setIconStyle(c.value),f.setEventListener(c.value))},w=(x,I)=>{if(f.isAnimationFinish)switch(I){case"dragZoom":L(x.target);break;case"reset":f.initZoom();break;case"previous":case"latest":f.clickMoveZoomArea(I);break}};o.onUpdated(()=>{f&&h.value&&f.setIcon(h.value)});const M=x=>{!Ae(x.zoom,u.zoom)&&(u.zoom=x.zoom,f?(!u.zoom.toolbar.show&&c.value&&L(),f.setEvChartZoomOptions(u.zoom)):u.zoom.toolbar.show&&!n&&k())},V=x=>{d.value?(r.value||(p.data=n?xl(x):[xl(x)],u.zoom.keepZoomStatus?d.value=!1:(c.value=!1,b()),f&&f.updateEvChartCloneData(p,y,c.value,u.zoom.keepZoomStatus)),r.value=!1):d.value=!0},S=(x,I)=>{if(f.isUseToolbar){f.isUseToolbar=!1;return}c.value&&(f.executeZoom(x,I),f.setZoomAreaMemory(x,I))};return o.watch(()=>[m.start,m.end],([x,I],[T])=>{if(i!=null&&i.value)if(typeof i.value.dataIndex=="number")x>=(T??0)?i.value.dataIndex-=x-(T??0):i.value.dataIndex+=T-x;else for(let v=0;v<i.value.dataIndex.length;v++)x>=(T??0)?i.value.dataIndex[v]-=x-(T??0):i.value.dataIndex[v]+=T-x;(m.isUseButton||m.isUseScroll)&&f.executeZoom(x,I)}),o.watch(()=>[m.isUseButton,m.isUseScroll],([x,I],[T,v])=>{T&&!x?f.setZoomAreaMemory(m.start,m.end):v&&!I&&(f.zoomAreaMemory.current[0]=[m.start,m.end])}),{evChartZoomOptions:u,evChartInfo:g,evChartToolbarRef:h,evChartClone:p,brushIdx:m,createEvChartZoom:k,setOptionsForUseZoom:M,setDataForUseZoom:V,controlZoomIdx:S,onClickToolbar:w}},Qk={name:"EvChart",components:{EvChartToolbar:Yc},directives:{resize:Pn},props:{selectedItem:{type:Object,default:null},selectedLabel:{type:Object,default:null},selectedSeries:{type:Object,default:null},options:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})},resizeTimeout:{type:Number,default:0},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},realTimeScatterReset:{type:Boolean,default:!1},legendData:{type:Array,default:()=>[]}},emits:["click","dbl-click","drag-select","mouse-move","update:selectedItem","update:selectedLabel","update:selectedSeries","update:zoomStartIdx","update:zoomEndIdx","update:realTimeScatterReset","click-legend","update:legendData","axes-scale-change","axes-data-max-change"],setup(e,{emit:t}){let n=null;const i=o.ref(!1),s=o.inject("isChartGroup",!1),l=o.inject("brushSeries",{list:[],chartIdx:null}),a=o.inject("groupSelectedLabel",null),r=o.inject("groupHoveredLabel",null),c=o.inject("brushIdx",{start:0,end:-1}),d=o.inject("evChartPropsInGroup",[]),h=o.inject("groupInteraction",null),{eventListeners:u,selectItemInfo:m,selectLabelInfo:f,selectSeriesInfo:g,getNormalizedData:p,getNormalizedOptions:y}=Fc(a,r),C=p(e.data),b=y(e.options),k=o.computed(()=>e.selectedLabel),L=o.computed(()=>e.selectedItem),{wrapper:w,wrapperStyle:M}=Hc(b),{evChartZoomOptions:V,evChartToolbarRef:S,createEvChartZoom:x,setOptionsForUseZoom:I,setDataForUseZoom:T,controlZoomIdx:v,onClickToolbar:E}=s?{}:zc(b,{wrapper:w,evChartGroupRef:null},e.selectedLabel?k:L,d),Z=()=>typeof performance<"u"?performance.now():Date.now();let W=null,R=null,X=null;const G=O=>{var J;W?(O.updateSeries&&(W.updateSeries=!0),O.updateData&&(W.updateData=!0),O.updateLegend&&(W.updateLegend=!0),O.updateTooltip&&(W.updateTooltip=!0),(J=O.updateSelTip)!=null&&J.update&&(W.updateSelTip??(W.updateSelTip={}),W.updateSelTip.update=!0)):W={...O};const z=()=>{const q=((h==null?void 0:h.deferUntil)??0)-Z();if(q>0){R=setTimeout(z,q);return}W&&n&&n.update(W),W=null,R=null,X=null};clearTimeout(R);const j=Z(),U=(h==null?void 0:h.deferUntil)??0,Q=U>j?U-j:0;R=setTimeout(z,Q)},N=()=>{var j;let O;b.selectLabel.use?O=f:b.selectSeries.use&&(O=g);const z=(j=e.options.realTimeScatter)!=null&&j.use?{...e.data,groups:[],labels:[]}:C;n=new Es(w.value,z,b,u,m,O,l)},P=()=>{n&&(n.init(),!s&&b.zoom.toolbar.show&&x(),b.legend.show&&b.legend.external&&n.emitLegendData())};o.watch(()=>e.options,O=>{var J,ne;const z=y(O),j=((ne=(J=n.options)==null?void 0:J.legend)==null?void 0:ne.show)??!1,U=!Ae(z.legend.table,n.options.legend.table),Q=z.tooltip.use&&!Ae(z.tooltip,n.options.tooltip);n.options=z,G({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},updateLegend:U,updateTooltip:Q}),z.legend.show&&z.legend.external&&!j&&n.emitLegendData(),s||I(z)},{deep:!b.shallowOptionsWatch,flush:"post"}),o.watch(()=>e.data,O=>{var ee,$;const z=(ee=e.options.realTimeScatter)!=null&&ee.use?{...O,groups:[],labels:[]}:p(O),j=!Ae(z.series,n.data.series),U=!Ae(z.groups,n.data.groups),Q=n.prunedRealTimeScatterSeries,J=!!(Q!=null&&Q.size)&&Object.keys(z.data??{}).some(he=>{var fe;return Q.has(he)&&((fe=z.data[he])==null?void 0:fe.length)}),ne=j||U||J||e.options.type==="heatMap",q=j||U||!Ae(z.labels,n.data.labels)||!Ae(z.data,n.data.data);($=e.options.realTimeScatter)!=null&&$.use?(X=Jk(X,z),n.data={...z,data:X}):n.data=xl(z),G({updateSeries:ne,updateSelTip:{update:!0,keepDomain:!1},updateData:q}),!s&&q&&T(z)},{deep:!b.shallowDataWatch,flush:"post"}),s&&!(a!=null&&a.value)&&o.watch(()=>c.start,(O,z)=>{if(k!=null&&k.value)for(let j=0;j<k.value.dataIndex.length;j++)O>=(z??0)?k.value.dataIndex[j]-=O-(z??0):k.value.dataIndex[j]+=z-O;else L!=null&&L.value&&(O>=(z??0)?L.value.dataIndex-=O-(z??0):L.value.dataIndex+=z-O)}),o.watch(()=>L.value,O=>{const z=e.options.type;n.selectItemByData(O,z)},{deep:!0,flush:"post"}),o.watch(()=>(a==null?void 0:a.value)??k.value,O=>{O!=null&&O.dataIndex&&n.selectLabelByData(O.dataIndex,O==null?void 0:O.targetAxis)},{deep:!0,flush:"post"}),o.watch(()=>e.selectedSeries,O=>{var z;(z=b.selectSeries)!=null&&z.use?O.seriesId&&n.selectSeriesByData(O.seriesId):console.warn("[EVUI][Chart] selectSeries.use is false, so selectedSeries is not working")},{deep:!0,flush:"post"}),s||o.watch(()=>[e.zoomStartIdx,e.zoomEndIdx],([O,z])=>{v(O,z)}),o.watch(()=>e.realTimeScatterReset,O=>{var z,j;O&&(n.resetRealTimeScatterDataSet(),(z=e.options.realTimeScatter)!=null&&z.use&&(X=null,n.data={...n.data,data:{}},n.pointsLayerValid=!1),(j=n.prunedRealTimeScatterSeries)==null||j.clear(),t("update:realTimeScatterReset",!1))}),o.watch(()=>{var O;return(O=e.options.realTimeScatter)==null?void 0:O.use},O=>{n.options.realTimeScatter.use=O??!1,n.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}),o.watch(()=>r==null?void 0:r.value,O=>{O&&e.options.syncHover!==!1&&(O.label==null?n.overlayClear():n.drawSyncedIndicator(O))},{deep:!0,flush:"post"}),o.onMounted(async()=>{d!=null&&d.value&&d.value.push(e),await N(),$C(w.value,()=>n),await P(),i.value=!0}),o.onBeforeUnmount(()=>{var O;qC(w.value),clearTimeout(R),W=null,R=null,X=null,n&&"destroy"in n&&n.destroy(),(O=d==null?void 0:d.value)!=null&&O.length&&(d.value.length=0),i.value=!1}),o.onDeactivated(()=>{n&&"hideTooltip"in n&&n.hideTooltip()});const B=O=>{n==null||n.toggleSeries(O)},H=O=>{n==null||n.highlightSeries(O)},D=()=>{n==null||n.unhighlightSeries()},Y=()=>{n&&"update"in n&&n.update({updateSeries:!0,updateSelTip:{update:!0,keepDomain:!1}})},F=cs(()=>{n&&"resize"in n&&n.resize()},e.resizeTimeout);return o.onActivated(()=>{i.value&&F()}),{wrapper:w,wrapperStyle:M,onResize:F,redraw:Y,toggleSeries:B,highlightSeries:H,unhighlightSeries:D,evChartToolbarRef:S,injectIsChartGroup:s,onClickToolbar:E,normalizedOptions:b,zoomOptions:o.toRef(V??{zoom:{}},"zoom")}}},$k={key:0,ref:"evChartToolbarRef"};function qk(e,t,n,i,s,l){var c;const a=o.resolveComponent("ev-chart-toolbar"),r=o.resolveDirective("resize");return o.openBlock(),o.createElementBlock(o.Fragment,null,[(c=i.zoomOptions.toolbar)!=null&&c.show&&!i.injectIsChartGroup?(o.openBlock(),o.createElementBlock("div",$k,[o.createVNode(a,{toolbar:i.zoomOptions.toolbar,onOnClickToolbar:i.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{ref:"wrapper",style:o.normalizeStyle(i.wrapperStyle),class:"ev-chart"},null,4),[[r,i.onResize]])],64)}const Li=ce(Qk,[["render",qk]]);Li.install=e=>{e.component(Li.name,Li)};const ew={zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}}},tw=()=>{const e=o.ref(!1),t=o.ref(),n=o.ref([]),i=o.reactive({list:[],chartIdx:null});return{getNormalizedOptions:a=>Pe({},a,ew),isExecuteZoom:e,brushSeries:i,evChartGroupRef:t,evChartPropsInGroup:n,groupInteraction:{deferUntil:0}}},nw={name:"EvChartGroup",components:{evChartToolbar:Yc},props:{options:{type:Object,default:()=>({})},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},groupSelectedLabel:{type:Object,default:null}},emits:["update:groupSelectedLabel","update:zoomStartIdx","update:zoomEndIdx","update:groupHoveredLabel"],setup(e,{emit:t}){const{getNormalizedOptions:n,isExecuteZoom:i,brushSeries:s,evChartGroupRef:l,evChartPropsInGroup:a,groupInteraction:r}=tw(),c=n(e.options);o.provide("isExecuteZoom",i),o.provide("isChartGroup",!0),o.provide("brushSeries",s),o.provide("evChartPropsInGroup",a),o.provide("groupInteraction",r);const d=2e3,h=800,u=()=>typeof performance<"u"?performance.now():Date.now(),m=(x=h)=>{const I=Number.isFinite(x)?Math.min(Math.max(x,0),d):h,T=u();r.deferUntil=Math.min(Math.max(r.deferUntil,T+I),T+d)};o.provide("deferPollingRedraw",m);const f=o.computed({get:()=>e.groupSelectedLabel,set:x=>t("update:groupSelectedLabel",x)});o.provide("groupSelectedLabel",f);const g=o.ref(null);o.provide("groupHoveredLabel",g),o.watch(()=>e.options.syncHover,x=>{x?g.value={label:"",horizontal:!1}:g.value=null},{immediate:!0});const{evChartZoomOptions:p,evChartInfo:y,evChartToolbarRef:C,evChartClone:b,brushIdx:k,createEvChartZoom:L,setOptionsForUseZoom:w,setDataForUseZoom:M,controlZoomIdx:V,onClickToolbar:S}=zc(c,{wrapper:null,evChartGroupRef:l},f,a);return o.provide("evChartClone",b),o.provide("evChartInfo",y),o.provide("brushIdx",k),o.onMounted(()=>{L()}),o.watch(()=>y.props.data,x=>{M(x)},{deep:!0}),o.watch(()=>e.options,x=>{const I=n(x);w(I)},{deep:!0}),o.watch(()=>[e.zoomStartIdx,e.zoomEndIdx],([x,I])=>{k.isUseButton||k.isUseScroll||V(x,I)}),{evChartGroupRef:l,evChartToolbarRef:C,zoomOptions:o.toRef(p,"zoom"),onClickToolbar:S,deferPollingRedraw:m}}},iw={key:0,ref:"evChartToolbarRef"},sw={ref:"evChartGroupRef",class:"ev-chart-group__wrapper"};function ow(e,t,n,i,s,l){const a=o.resolveComponent("ev-chart-toolbar");return o.openBlock(),o.createElementBlock(o.Fragment,null,[i.zoomOptions.toolbar.show?(o.openBlock(),o.createElementBlock("div",iw,[o.createVNode(a,{toolbar:i.zoomOptions.toolbar,onOnClickToolbar:i.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):o.createCommentVNode("",!0),o.createElementVNode("div",sw,[o.renderSlot(e.$slots,"default",{},void 0,!0)],512)],64)}const Mi=ce(nw,[["render",ow],["__scopeId","data-v-dda98b9e"]]);Mi.install=e=>{e.component(Mi.name,Mi)};const ve={WHEEL:{UP:"MOVEUP_WHEEL",DOWN:"MOVEDOWN_WHEEL"},GRAB:{UP:"MOVEUP_GRAB",DOWN:"MOVEDOWN_GRAB"},BUTTON:{INCREASE:"INCREASE",DECREASE:"DECREASE"}},Ye={LEFT:"leftX",RIGHT:"rightX"};let lw=class{constructor(t,n,i,s,l){this.evChart=t,this.evChartBrushOptions=i,this.evChartBrushRef=l,this.evChartData=n,this.brushIdx=s,i.value.useDebounce&&(this.debounceBrushIdx={start:s.start,end:s.end})}init(t){var n;if(this.brushIdx.start>this.brushIdx.end){this.removeBrushCanvas();return}if((n=this.evChartBrushRef)!=null&&n.value){const i=this.evChartBrushRef.value.querySelector(".brush-canvas");if(i)this.drawBrushRect({brushCanvas:i,isResize:t});else{const s=document.createElement("canvas");s.setAttribute("class","brush-canvas"),s.setAttribute("style","display: block; z-index: 1;");const l=this.evChartBrushRef.value.querySelector(".ev-chart-brush-container");l&&(this.brushCanvas=s,l.appendChild(s),this.evChartBrushContainer=l,this.drawBrushRect({brushCanvas:s}),this.addEvent(s))}}}drawBrushRect({brushCanvas:t,isResize:n,isDebounce:i,mode:s,offsetX:l}){const{chartRect:a,labelOffset:r}=this.evChart;if(!a&&!r)return;const c=this.evChartData.value.labels.length-1;this.labelEndIdx=c;const d={x1:a.x1+r.left,x2:a.x2-r.right,y1:a.y1+r.top,y2:a.y2-r.bottom},h=this.setCanvasWidthHeight(d,t);if(!(n&&this.isEqualWidth)&&c>=0){const u=this.setBrushXAndWidth(h,l,i,s);h&&u&&this.drawBrush(h,u,d,t)}}setCanvasWidthHeight(t,n){const s=t.x2-t.x1+6,l=t.y2-t.y1,a=(t.x2-t.x1)/this.labelEndIdx,r=window.devicePixelRatio||1;return this.isEqualWidth=n.width===Math.floor(s*r),{brushButtonWidth:6,brushCanvasHeight:l,brushCanvasWidth:s,axesXInterval:a,pixelRatio:r}}setBrushXAndWidth(t,n=0,i,s){const{brushButtonWidth:l,brushCanvasWidth:a,axesXInterval:r,pixelRatio:c}=t;!i&&this.debounceBrushIdx&&(this.debounceBrushIdx.start=this.brushIdx.start,this.debounceBrushIdx.end=this.brushIdx.end);const d=this.debounceBrushIdx??this.brushIdx;switch(s){case ve.BUTTON.INCREASE:case ve.BUTTON.DECREASE:this.brushRectWidth=a*c,this.curBrushButtonType===Ye.LEFT?(this.brushRectWidth=this.beforeBrushRectWidth?this.beforeBrushRectWidth-n:this.brushRectWidth-n,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=n*c,this.beforeBrushRectX=this.brushRectX)):this.curBrushButtonType===Ye.RIGHT&&(this.brushRectWidth=n-this.beforeBrushRectX,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=this.beforeBrushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX));break;case ve.GRAB.UP:case ve.GRAB.DOWN:this.brushRectX<=0&&s===ve.GRAB.DOWN||this.brushRectX+this.brushRectWidth>=a&&s===ve.GRAB.UP?this.offsetXAndRectXInterval=null:(this.offsetXAndRectXInterval||(this.offsetXAndRectXInterval=n-this.brushRectX),this.brushRectX=n-this.offsetXAndRectXInterval);break;default:n||(this.brushRectX=d.start*r*c,this.brushRectWidth=(a-(this.labelEndIdx-(d.end-d.start))*r)*c,this.beforeBrushRectX=this.brushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX);break}const h=a*c;return s===ve.BUTTON.INCREASE||s===ve.BUTTON.DECREASE?(this.brushRectX<0&&(this.brushRectWidth+=this.brushRectX,this.brushRectX=0),this.brushRectX+this.brushRectWidth>h&&(this.brushRectWidth=h-this.brushRectX)):this.brushRectX<0?this.brushRectX=0:this.brushRectX+this.brushRectWidth>h&&(this.brushRectX=h-this.brushRectWidth),this.brushRectWidth>h&&(this.brushRectWidth=h),{brushRectX:this.brushRectX,brushRectWidth:this.brushRectWidth}}drawBrush(t,n,i,s){const{brushButtonWidth:l,brushCanvasHeight:a,brushCanvasWidth:r,axesXInterval:c,pixelRatio:d}=t,{brushRectX:h,brushRectWidth:u}=n,{height:m,selection:{fillColor:f,opacity:g}}=this.evChartBrushOptions.value,p=m-i.y1,y=h,C=h+u;s.style.position||(s.style.position="absolute",s.style.top=`${i.y1}px`,s.style.left=`${i.x1-l/2}px`),this.isEqualWidth||(s.width=r*d,s.style.width=`${r}px`,s.height=a*d,s.style.height=`${a}px`);const b=s.getContext("2d");b.clearRect(0,0,r*d,a*d),b.fillStyle=f,b.globalAlpha=g,b.fillRect(h,0,u,p),b.fillRect(y,0,l,p),b.fillRect(C-l,0,l,p),this.brushPosInfo={leftX:y/d,rightX:C/d,buttonWidth:l,axesXInterval:c,...t,...n}}getCanvasOffsetX(t){const n=this.brushCanvas.getBoundingClientRect();return t.clientX-n.left}addEvent(){let t;const n=l=>{if(this.isDragMode){const a=this.getCanvasOffsetX(l);this.mouseDownAndMove({offsetX:a})}};this.onDocumentMouseMove=hs(n,5),this.onDocumentMouseUp=()=>{document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),this.initEventState()},this.onMouseDown=l=>{l.preventDefault(),t.isInsideButton?this.isDragMode="button":t.isInsideBrush?(this.clickBrushInsideX=l.offsetX,this.isDragMode="grab"):t.isOutsideBrush&&this.teleportBrush(l),this.isDragMode&&(document.addEventListener("mousemove",this.onDocumentMouseMove),document.addEventListener("mouseup",this.onDocumentMouseUp))};const i=l=>{this.isDragMode||(t=this.getMousePosition(l),this.changeCursor(t))};this.onMouseMove=hs(i,5),this.onWheel=l=>{l.preventDefault();const a=l.deltaY>0?ve.WHEEL.DOWN:ve.WHEEL.UP;this.updateBrushIdx(a),this.debounceBrushIdx&&this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:a}),this.brushIdx.isUseScroll=!0},this.onMouseUp=()=>{this.initEventState()};const s=()=>{this.initEventState()};this.onWheelDebounce=cs(s,100),this.setEventListener("addEventListener")}getMousePosition(t){const n=d=>Math.abs(this.brushPosInfo[d]-t.offsetX),i=n(Ye.RIGHT)>n(Ye.LEFT)?Ye.LEFT:Ye.RIGHT,s=d=>t.offsetX>this.brushPosInfo[d],l=d=>t.offsetX<this.brushPosInfo[d],a=l(Ye.LEFT)||s(Ye.RIGHT),r=s(Ye.LEFT)&&l(Ye.RIGHT),c=t.offsetX+this.brushPosInfo.buttonWidth>=this.brushPosInfo[i]&&t.offsetX-this.brushPosInfo.buttonWidth<=this.brushPosInfo[i];return this.curBrushButtonType=c&&i,{isInsideButton:c,isInsideBrush:r,isOutsideBrush:a}}destroy(){if(this.brushCanvas&&(this.setEventListener("removeEventListener"),document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),this.brushCanvas=null),this.evChartBrushContainer){const t=this.evChartBrushContainer;for(;t.hasChildNodes();)t.removeChild(t.firstChild)}}setEventListener(t){this.brushCanvas[t]("mousemove",this.onMouseMove),this.brushCanvas[t]("mousedown",this.onMouseDown),this.brushCanvas[t]("mouseup",this.onMouseUp),this.evChartBrushOptions.value.useWheelMove&&(this.brushCanvas[t]("wheel",this.onWheel),this.brushCanvas[t]("wheel",this.onWheelDebounce))}removeBrushWrapper(){if(this.evChartBrushRef.value){const t=this.evChartBrushRef.value.querySelector(".ev-chart-brush-wrapper");t&&this.evChartBrushRef.value.removeChild(t)}}removeBrushCanvas(){if(this.evChartBrushContainer){const t=this.evChartBrushContainer.querySelector(".brush-canvas");t&&this.evChartBrushContainer.removeChild(t)}}teleportBrush(t){const n=this.debounceBrushIdx??this.brushIdx,i=(n.end-n.start)/2;let s,l,a;i>.5?(n.end-n.start)%2===0?(a=Math.round(t.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(i),l=Math.floor(i)):(a=Math.ceil(t.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(i),l=Math.floor(i)):(a=Math.floor(t.offsetX/this.brushPosInfo.axesXInterval),t.offsetX-a*this.brushPosInfo.axesXInterval>this.brushPosInfo.axesXInterval/2?(s=Math.floor(i),l=Math.ceil(i)):(s=Math.ceil(i),l=Math.floor(i),i<1&&(a+=1))),a-s<=0?(n.start=0,n.end=l+s):a+l>=this.labelEndIdx?(n.start=this.labelEndIdx-l-s,n.end=this.labelEndIdx):(n.start=a-s,n.end=a+l),this.brushIdx.isUseScroll=!0}changeCursor(t){t.isOutsideBrush?this.brushCanvas.style.cursor="pointer":t.isInsideBrush&&(t.isInsideButton?this.brushCanvas.style.cursor="ew-resize":this.brushCanvas.style.cursor="grab")}mouseDownAndMove(t){const n=this.debounceBrushIdx?0:this.brushPosInfo.axesXInterval/3;let i;t.offsetX>this.beforeMouseXPos?this.isDragMode==="grab"?this.clickBrushInsideX<t.offsetX-n&&(i=ve.GRAB.UP,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX+n):t.offsetX-this.brushPosInfo[this.curBrushButtonType]>n&&(i=this.curBrushButtonType===Ye.LEFT?ve.BUTTON.DECREASE:ve.BUTTON.INCREASE,this.brushIdx.isUseButton=!0):t.offsetX<this.beforeMouseXPos&&(this.isDragMode==="grab"?this.clickBrushInsideX>t.offsetX+n&&(i=ve.GRAB.DOWN,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX-n):this.brushPosInfo[this.curBrushButtonType]-t.offsetX>n&&(i=this.curBrushButtonType===Ye.LEFT?ve.BUTTON.INCREASE:ve.BUTTON.DECREASE,this.brushIdx.isUseButton=!0)),this.debounceBrushIdx?this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:i,offsetX:t.offsetX}):this.updateBrushIdx(i),this.beforeMouseXPos=t.offsetX}updateBrushIdx(t){const n=this.debounceBrushIdx??this.brushIdx;switch(t){case ve.WHEEL.UP:case ve.GRAB.UP:if(n.end>=this.labelEndIdx)return;n.start+=1,n.end+=1;break;case ve.WHEEL.DOWN:case ve.GRAB.DOWN:if(n.start<=0)return;n.start-=1,n.end-=1;break;case ve.BUTTON.INCREASE:if(this.curBrushButtonType===Ye.LEFT){if(!n.start)return;n.start-=1}else{if(n.end===this.labelEndIdx)return;n.end+=1}break;case ve.BUTTON.DECREASE:if(n.start===n.end-1)return;this.curBrushButtonType===Ye.LEFT?n.start+=1:n.end-=1;break}}updateBrushIdxUseXPos(){if(!this.debounceBrushIdx)return;const t=()=>{let s,l;if(this.brushPosInfo){const{brushRectX:a,brushRectWidth:r,brushCanvasWidth:c,axesXInterval:d}=this.brushPosInfo;if(this.brushIdx.isUseButton||this.isUseBrushGrab){if(s=a/d,l=this.labelEndIdx-(c-(a+r))/d,this.curBrushButtonType===Ye.LEFT?(s=Math.round(s),l=this.brushIdx.end,s===l&&(s-=1)):this.curBrushButtonType===Ye.RIGHT?(s=this.brushIdx.start,l=Math.round(l),s===l&&(l+=1)):(s=Math.round(s),l=Math.round(l)),l>this.labelEndIdx){const h=l-this.labelEndIdx;s-=h,l-=h}if(s<0){const h=Math.abs(s);s=0,l+=h}}}return{brushStartIdx:s,brushEndIdx:l}},{brushStartIdx:n,brushEndIdx:i}=t();this.brushIdx.start===n&&this.brushIdx.end===i&&this.drawBrushRect({brushCanvas:this.brushCanvas}),this.brushIdx.start=n??this.debounceBrushIdx.start,this.brushIdx.end=i??this.debounceBrushIdx.end}initEventState(){if(this.isCleaningUp)return;this.isCleaningUp=!0,new Promise(n=>{this.updateBrushIdxUseXPos(),n(!0)}).then(n=>{n&&(this.clickBrushInsideX=null,this.isDragMode=null,this.beforeMouseXPos=null,this.curBrushButtonType=null,this.isUseBrushGrab=!1,this.offsetXAndRectXInterval=null,this.brushIdx.isUseButton=!1,this.brushIdx.isUseScroll=!1),this.isCleaningUp=!1})}};const aw={show:!0,useDebounce:!0,chartIdx:0,height:100,showLabel:!1,selection:{fillColor:"#38ACEC",opacity:.65},useWheelMove:!0},rw=()=>({getNormalizedBrushOptions:t=>Pe({},t,aw)}),cw={name:"EvChartBrush",directives:{resize:Pn},props:{options:{type:Object,default:()=>({})}},setup(e){let t=null,n=null;const i=o.ref(!1),s=o.inject("evChartClone",{data:[]}),l=o.inject("evChartInfo",{props:{options:[]}}),a=o.inject("brushIdx",{start:0,end:-1,isUseButton:!1,isUseScroll:!1}),r=o.inject("brushSeries",{list:[],chartIdx:null}),{getNormalizedBrushOptions:c}=rw(),d=o.computed(()=>c(e.options)),{eventListeners:h,selectItemInfo:u,selectLabelInfo:m,selectSeriesInfo:f,getNormalizedData:g,getNormalizedOptions:p}=Fc(),y=o.computed(()=>g((s.data??[])[d.value.chartIdx])),C=o.computed(()=>{var T,v;const x=l.props.options[d.value.chartIdx],I={...x,brush:{use:!0,...d.value},height:d.value.height,zoom:{use:!1},dragSelection:{use:!1},title:{show:!1},tooltip:{use:!1},legend:{show:!1},selectLabel:{use:!1},selectSeries:{use:!1},axesX:[{...(T=x==null?void 0:x.axesX)==null?void 0:T[0],title:{use:!1}}],axesY:[{...(v=x==null?void 0:x.axesY)==null?void 0:v[0],title:{use:!1}}]};return p(I)}),{wrapper:b,wrapperStyle:k}=Hc(C.value);o.watch(()=>r.list,()=>{b.value&&r.chartIdx===d.value.chartIdx&&(t.seriesList=r.list[d.value.chartIdx],t.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}}))}),o.watch(C,(x,I)=>{var T;x.brush.chartIdx<=((T=s.data)==null?void 0:T.length)-1?n&&!Ae(I.brush,x.brush)?n.removeBrushWrapper():t&&!Ae(x,I)&&(t.options=Ve(x),t.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})):(t.data=Ve(y.value),t.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1}),n.removeBrushCanvas())}),o.watch(()=>s.data,x=>{if(t){const I=x[d.value.chartIdx];if(I){const T=!Ae(I.series,t.data.series),v=r.list[d.value.chartIdx];typeof v=="object"&&Object.keys(v).length&&Object.keys(I.series).forEach(E=>{var Z;"show"in I.series[E]||(I.series[E].show=((Z=v[E])==null?void 0:Z.show)??!0)}),t.data=Ve(g(I)),t.update({updateSeries:T,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}}});const L=()=>{let x;C.value.selectLabel.use?x=m:C.value.selectSeries.use&&(x=f),t=new Es(b.value,y.value,C.value,h,u,x)},w=()=>{n=new lw(t,y,d,a,b)},M=()=>{t&&t.init()},V=x=>{n&&n.init(x)};o.watch(()=>[a.start,a.end],()=>{var x;b.value&&d.value.chartIdx<=((x=s.data)==null?void 0:x.length)-1&&V()}),o.onMounted(async()=>{d.value.show&&(await L(),await M(),w(),V()),i.value=!0}),o.onUpdated(async()=>{var x;if(d.value.show&&d.value.chartIdx<=((x=s.data)==null?void 0:x.length)-1){const I=r.list[d.value.chartIdx];typeof I=="object"&&Object.keys(I).length&&Object.keys(y.value.series).forEach(T=>{var v;"show"in y.value.series[T]||(y.value.series[T].show=((v=I[T])==null?void 0:v.show)??!0)}),await L(),await M(),w(),V()}}),o.onBeforeUnmount(()=>{t&&"destroy"in t&&t.destroy(),n&&n.destroy(),i.value=!1}),o.onDeactivated(()=>{t&&"hideTooltip"in t&&t.hideTooltip()});const S=cs(()=>{t&&"resize"in t&&new Promise(I=>t.resize(I)).then(I=>{I&&V(I)})},0);return o.onActivated(()=>{i.value&&S()}),{evChartBrushOptions:d,evChartBrushRef:b,evChartBrushStyle:k,onResize:S}}};function dw(e,t,n,i,s,l){const a=o.resolveDirective("resize");return i.evChartBrushOptions.show?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,ref:"evChartBrushRef",style:o.normalizeStyle(i.evChartBrushStyle),class:"ev-chart-brush"},null,4)),[[a,i.onResize]]):o.createCommentVNode("",!0)}const vi=ce(cw,[["render",dw]]);vi.install=e=>{e.component(vi.name,vi)};const hw={name:"TreeGridNode",components:{GridOptionButton:il},props:{dataIndex:{type:Number,default:0},nodeData:{type:Object,default:()=>({})},selectedData:{type:Object,default:()=>({})},useCheckbox:{type:Object,default:()=>({})},orderedColumns:{type:[Array],default:()=>[]},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},parentIcon:{type:String,default:""},childIcon:{type:String,default:""},customContextMenu:{type:[Array],default:()=>[]},menuRef:{type:Object,default:null},rowHeight:{type:Number,default:35},minWidth:{type:Number,default:40},borderStyle:{type:String,default:""},highlightIndex:{type:Number,default:-1}},emits:{"check-tree-data":null,"expand-tree-data":null,"click-tree-data":null,"dbl-click-tree-data":null,"context-menu":null},setup(e,{emit:t}){const n=(b,k)=>{t("check-tree-data",b,k)},i=b=>{t("expand-tree-data",b)},s=(b,k)=>{t("click-tree-data",b,k)},l=(b,k)=>{t("dbl-click-tree-data",b,k)},a=b=>{t("context-menu",b)},r=b=>{const k=e.expandIcon?e.expandIcon:"",L=e.expandIcon?e.collapseIcon:"";return b.expand?L:k},c=o.computed(()=>e.nodeData||{}),d=o.computed(()=>e.parentIcon||"tree-parent-icon"),h=o.computed(()=>e.childIcon||"tree-child-icon"),u=o.computed(()=>d.value!=="none"||h.value!=="none"),m=o.computed(()=>{const b=e.orderedColumns||[],k=b.findIndex(w=>w.expandColumn&&!w.hide&&!w.hiddenDisplay);if(k!==-1)return k;const L=b.findIndex(w=>!w.hide&&!w.hiddenDisplay);return L!==-1?L:0}),f=b=>({row:!0,"tree-row":!0,[`tree-row--level-${b==null?void 0:b.level}`]:!0,highlight:(b==null?void 0:b.index)===e.highlightIndex,selected:b.selected,"non-border":!!e.borderStyle&&e.borderStyle!=="rows"}),g=o.computed(()=>({cell:!0,"row-checkbox":!0,"non-border":!!e.borderStyle}));return{parentIconMV:d,childIconMV:h,node:c,isDataIcon:u,checkboxClass:g,expandColumnIdx:m,onCheck:n,onExpand:i,onClick:s,onDblClick:l,onContextMenu:a,expandIconClasses:r,getRowClass:f,getColumnClass:(b,k)=>({cell:!0,"tree-td":k===0,[b.type]:b.type,[b.align]:b.align,[b.field]:b.field,"non-border":!!e.borderStyle}),getColumnStyle:(b,k)=>({width:`${b.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${e.minWidth}px`,"border-right":e.orderedColumns.length-1===k?"none":"1px solid #CFCFCF"}),getDepthStyle:b=>({"margin-left":`${b*13}px`})}}},uw=["data-index"],fw=["data-name","data-index"],mw={class:"td-content__wrapper"},pw=["title"],gw={class:"td-content"};function bw(e,t,n,i,s,l){var d;const a=o.resolveComponent("ev-checkbox"),r=o.resolveComponent("ev-icon"),c=o.resolveComponent("grid-option-button");return o.openBlock(),o.createElementBlock("tr",{"data-index":i.node.index,class:o.normalizeClass(i.getRowClass(i.node)),onClick:t[7]||(t[7]=h=>i.onClick(h,i.node)),onDblclick:t[8]||(t[8]=h=>i.onDblClick(h,i.node))},[n.useCheckbox.use?(o.openBlock(),o.createElementBlock("td",{key:0,class:o.normalizeClass(i.checkboxClass),style:o.normalizeStyle({width:`${n.minWidth}px`,height:`${n.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(a,{modelValue:i.node.checked,"onUpdate:modelValue":t[0]||(t[0]=h=>i.node.checked=h),disabled:i.node.uncheckable,indeterminate:i.node.indeterminate,class:"row-checkbox-input",onChange:t[1]||(t[1]=h=>i.onCheck(h,i.node))},null,8,["modelValue","disabled","indeterminate"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.orderedColumns,(h,u)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:u},[!h.hide&&!h.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":h.field,"data-index":i.node.index,class:o.normalizeClass(i.getColumnClass(h,u)),style:o.normalizeStyle(i.getColumnStyle(h,u))},[o.createElementVNode("div",mw,[u===i.expandColumnIdx?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(i.getDepthStyle(i.node.level))},null,4)):o.createCommentVNode("",!0),u===i.expandColumnIdx?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass({expand:i.node.expand,"ev-tree-toggle":!0})},[i.node.hasChild?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[i.expandIconClasses(i.node)?(o.openBlock(),o.createBlock(r,{key:0,icon:i.expandIconClasses(i.node),style:{display:"block"},onClick:t[2]||(t[2]=m=>i.onExpand(i.node))},null,8,["icon"])):(o.openBlock(),o.createElementBlock("button",{key:1,class:"tree-expand-icon",onClick:t[3]||(t[3]=o.withModifiers(m=>i.onExpand(i.node),["stop"]))},[...t[9]||(t[9]=[o.createElementVNode("i",null,null,-1)])]))],64)):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),u===i.expandColumnIdx&&i.isDataIcon?(o.openBlock(),o.createElementBlock("span",{key:2,title:i.node[h.field],class:o.normalizeClass({expand:i.node.expand,"ev-tree-toggle":!0})},[o.createElementVNode("span",{class:o.normalizeClass(i.node.hasChild?i.parentIconMV:i.childIconMV)},[...t[10]||(t[10]=[o.createElementVNode("i",null,null,-1)])],2)],10,pw)):o.createCommentVNode("",!0),o.createElementVNode("div",gw,[e.$slots[h.field+"Node"]?o.renderSlot(e.$slots,h.field+"Node",{key:0,item:{data:i.node.data}},void 0,!0):o.createCommentVNode("",!0)])])],14,fw)):o.createCommentVNode("",!0)],64))),128)),(d=n.customContextMenu)!=null&&d.length?(o.openBlock(),o.createElementBlock("td",{key:1,class:o.normalizeClass({"row-contextmenu":!0,"non-border":!!n.borderStyle}),style:o.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${n.rowHeight}px`,"min-width":"30px","line-height":`${n.rowHeight}px`})},[e.$slots.contextmenuIconNode?(o.openBlock(),o.createElementBlock("span",{key:0,class:"row-contextmenu__btn",onClick:[t[4]||(t[4]=h=>i.onContextMenu(h)),t[5]||(t[5]=o.withModifiers((...h)=>n.menuRef.show&&n.menuRef.show(...h),["prevent"]))]},[o.renderSlot(e.$slots,"contextmenuIconNode",{},void 0,!0)])):(o.openBlock(),o.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",onClick:[t[6]||(t[6]=h=>i.onContextMenu(h)),o.withModifiers(n.menuRef.show,["prevent"])]},null,8,["onClick"]))],6)):o.createCommentVNode("",!0)],42,uw)}const yw=ce(hw,[["render",bw],["__scopeId","data-v-faab3696"]]),xw={name:"EvTreeGridToolbar"},Sw={class:"tree-grid-toolbar"};function Cw(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Sw,[o.renderSlot(e.$slots,"toolbarWrapper")])}const kw=ce(xw,[["render",Cw]]),ww=e=>{const{props:t}=o.getCurrentInstance(),{checkInfo:n}=e;return{isRenderer:(d={})=>{var h;return!!((h=d==null?void 0:d.render)!=null&&h.use)},getComponentName:(d="")=>{const h=f=>f.charAt(0).toUpperCase()+f.slice(1),u="Renderer";let m="";if(d.indexOf("_")!==-1){const f=d.split("_");for(let g=0;g<f.length;g++)m+=h(f[g])}else m=h(d);return m+u},getConvertValue:(d,h)=>{let u=d.type==="number"||d.type==="float"?Number(h):h;return d.type==="number"?(u=sn(h),u=u===!1?h:u):d.type==="float"&&(u=u.toFixed(d.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),u},getColumnIndex:d=>t.columns.findIndex(h=>h.field===d),setPixelUnit:d=>{let h=d;const u=h.toString().indexOf("px")>=0,m=h.toString().indexOf("%")>=0;return!u&&!m&&(h=`${h}px`),h},checkHeader:d=>{n.isHeaderChecked=!!d.length&&d.every(u=>u.checked);const h=d.filter(u=>u.uncheckable);if(h.length){const u=d.filter(f=>f.checked),m=d.every(f=>h.includes(f));n.isHeaderChecked=!m&&h.length+u.length===d.length,n.isHeaderUncheckable=m}n.isHeaderIndeterminate=!!d.length&&d.some(u=>u.checked||u.indeterminate)&&!n.isHeaderChecked}}},Ws=e=>{const{originColumns:t,filteredColumns:n}=e;return t.map(i=>{const s=n.find(l=>l.index===i.index)??{};return{...i,...s}})},Iw=e=>{const{scrollInfo:t,stores:n,elementInfo:i,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c}=e,d=m=>{let f=n.showTreeStore;l.isClientPaging&&(f=r());const g=i.body;if(g){const p=s.rowHeight,y=g.clientHeight>p?Math.ceil(g.clientHeight/p):f.length,C=f.length*p;let b=Math.floor(g.scrollTop/p);b>f.length-1&&(b=0);const k=b+y+1,L=Math.max(b,0),w=k,M=i.table;n.viewStore=f.slice(L,w),t.hasVerticalScrollBar=y<f.length||g.clientHeight<M.clientHeight,t.vScrollTopHeight=L*p,t.vScrollBottomHeight=C-n.viewStore.length*p-t.vScrollTopHeight,m&&l.isInfinite&&t.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(w/l.perPage)+1,l.startIndex=w,c({onScrollEnd:!0}))}},h=()=>{const m=i.header,f=i.body,g=i.table;m.scrollLeft=f.scrollLeft,a.value=f.scrollLeft,t.hasHorizontalScrollBar=f.clientWidth<g.clientWidth};return{updateVScroll:d,updateHScroll:h,onScroll:()=>{const m=i.body,f=m.scrollTop,g=m.scrollLeft,p=t.lastScroll.top,y=t.lastScroll.left,C=g!==y;f!==p&&m.clientHeight&&d(!0),C&&h(),t.lastScroll.top=f,t.lastScroll.left=g}}},Tw=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{resizeInfo:i,elementInfo:s,checkInfo:l,stores:a,isRenderer:r,updateVScroll:c,updateHScroll:d,contextInfo:h}=e,u=()=>{a.viewStore=a.showTreeStore;const p=a.viewStore;let y=i.columnWidth;i.columnWidth>0&&(y=i.columnWidth),y=i.columnWidth;let C=0;if(i.adjust&&s.body){const b=s.body;let k=b.offsetWidth;const L=b.offsetHeight,w=a.orderedColumns.reduce((M,V)=>(V.hide||V.hiddenDisplay||(V.width?M.totalWidth+=V.width:M.emptyCount++),M),{totalWidth:h.customContextMenu.length?30:0,emptyCount:0});if(i.rowHeight*p.length>L-i.scrollWidth&&(k-=i.scrollWidth),l.useCheckbox.use&&(k-=i.minWidth),y=k-w.totalWidth,y>0){const M=w.emptyCount===0?0:Math.floor(y/w.emptyCount);C=y-M*w.emptyCount,y=w.emptyCount!==0?M:y}else y=i.columnWidth;y=y<i.minWidth?i.minWidth:y,i.columnWidth=y}if(a.orderedColumns.forEach(b=>{const k=r(b)?i.rendererMinWidth:i.minWidth;b.width&&b.width<k&&(b.width=k),!b.width&&!b.hide&&(b.width=y)}),C&&a.orderedColumns.length){let b=a.orderedColumns.length-1,k=a.orderedColumns[b];for(;b>0&&k&&(k.hide||k.hiddenDisplay);)b-=1,k=a.orderedColumns[b];k&&(k.width+=C)}i.isResize=!i.isResize},m=()=>{o.nextTick(()=>{var p,y;i.adjust&&a.orderedColumns.forEach(C=>{var k;const b=C;return!((k=t.columns[C.index])!=null&&k.width)&&!b.resized&&(b.width=0),b},void 0),u(),(p=s.body)!=null&&p.clientHeight&&c(),(y=s.body)!=null&&y.clientWidth&&d()})};return{calculatedColumn:u,onResize:m,onShow:p=>{p&&m()},onColumnResize:(p,y)=>{const C=s.header,b=s.body,k=C.getBoundingClientRect().left,L=C.querySelector(`li[data-index="${p}"]`),w=r(a.orderedColumns[p])?i.rendererMinWidth:i.minWidth,M=L.getBoundingClientRect(),V=b.getBoundingClientRect().right-k,S=s.resizeLine,x=M.left-k+w,I=M.right-k,T=y.clientX,v=M.left-k;b.style.overflow="auto",S.style.left=`${I}px`,i.showResizeLine=!0;const E=W=>{const R=W.clientX-T,X=I+R;let G=Math.max(x,X);G=Math.min(V,G),S.style.left=`${G}px`},Z=()=>{const R=parseInt(S.style.left,10)-v;a.orderedColumns[p]&&(a.orderedColumns[p].width=R,a.orderedColumns[p].resized=!0),i.showResizeLine=!1,document.removeEventListener("mousemove",E),m();const X=Ws(a);n("resize-column",{column:a.orderedColumns[p],columns:X}),n("change-column-info",{type:"resize",columns:X})};document.addEventListener("mousemove",E),document.addEventListener("mouseup",Z,{once:!0})}}},Lw=e=>{const{emit:t}=o.getCurrentInstance(),n=e,i=(r,c)=>{var u;const d=r.target.tagName.toLowerCase();let h={};return r.target.offsetParent&&(d==="td"?h=r.target.dataset:h=((u=r.target.closest("td"))==null?void 0:u.dataset)??{}),{event:r,rowData:c,rowIndex:c.index,cellName:h.name,cellIndex:h.index}};let s=null;return{onRowClick:(r,c)=>{var d,h;return r.target&&r.target.parentElement&&(r.target.parentElement.classList.contains("row-checkbox-input")||(h=(d=r.target.closest("td"))==null?void 0:d.classList)!=null&&h.contains("row-contextmenu"))?!1:(clearTimeout(s),s=setTimeout(()=>{n.useSelect&&(c.selected?(c.selected=!1,n.multiple?r.ctrlKey?n.selectedRow=n.selectedRow.filter(u=>u.index!==c.index):n.selectedRow=[c]:n.selectedRow=[]):(c.selected=!0,r.ctrlKey&&n.multiple&&(!n.limitCount||n.limitCount>n.selectedRow.length)?n.selectedRow.push(c):n.selectedRow=[c]),t("update:selected",n.selectedRow),t("click-row",i(r,c)))},100),!0)},onRowDblClick:(r,c)=>{clearTimeout(s),t("dblclick-row",i(r,c))}}},Mw=e=>{const{checkInfo:t,stores:n,checkHeader:i,pageInfo:s,getPagingData:l}=e,{emit:a}=o.getCurrentInstance(),r=()=>t.useCheckbox.mode==="each",c=f=>{const g=n.treeStore.findIndex(p=>p.index===f.index);g!==-1&&(n.treeStore[g].checked=f.checked)},d=f=>{r()||f.hasChild&&f.children.forEach(g=>{const p=g;f.checked&&!p.checked&&!p.uncheckable&&t.checkedRows.push(p),f.checked||(t.checkedRows=t.checkedRows.filter(y=>y.index!==p.index)),p.checked=f.checked&&!p.uncheckable,p.hasChild&&d(p)})},h=f=>{if(r())return;const g=f.parent;if(g){const p=g.children.every(C=>C.checked);g.checked=p&&!g.uncheckable;const y=g.children.filter(C=>C.uncheckable);if(y.length){const C=g.children.filter(b=>b.checked);y.length+C.length===g.children.length&&(g.checked=!0)}g.indeterminate=!p&&g.children.some(C=>C.checked||C.indeterminate),g.checked?t.checkedRows.push(g):t.checkedRows=t.checkedRows.filter(C=>C.index!==g.index),g.parent&&h(g)}};return{onCheck:(f,g)=>{let p=n.store;s.isClientPaging&&(p=l());const y=()=>t.useCheckbox.mode==="single",C=()=>{t.isHeaderChecked&&(t.isHeaderChecked=!1)},b=()=>{y()&&t.checkedRows.length>0&&(t.prevCheckedRow.checked=!1,c(t.prevCheckedRow))},k=w=>{if(y()){t.checkedRows=[w];return}d(w),h(w),t.checkedRows.push(w),w.indeterminate=!1},L=w=>{if(y()){t.checkedRows=[];return}t.checkedRows=t.checkedRows.filter(M=>M.index!==w.index)};b(),g.checked?(k(g),i(p)):(C(),L(g),d(g),h(g)),t.prevCheckedRow=g,a("update:checked",t.checkedRows),a("check-row",f,g.index,g)},onCheckAll:f=>{var y;const g=t.isHeaderChecked;let p=(y=n.store)==null?void 0:y.filter(C=>C.isFilter);s.isClientPaging&&(p=l()),p.forEach(C=>{C.checked=g&&!C.uncheckable,C.checked?t.checkedRows.find(b=>b.index===C.index)||t.checkedRows.push(C):t.checkedRows=t.checkedRows.filter(b=>b.index!==C.index),C.indeterminate=!1}),t.isHeaderIndeterminate=!1,a("update:checked",t.checkedRows),a("check-all",f,t.checkedRows)}}},vw=e=>{const{emit:t}=o.getCurrentInstance(),{contextInfo:n,stores:i,selectInfo:s,useGridSetting:l,columnSettingInfo:a,setColumnHidden:r,onSort:c}=e,d=(f=!0)=>{const g=[];if(f&&n.customContextMenu.length){const p=s.selectedRow,y=n.customContextMenu.map(C=>{const b=C;return b.validate&&(b.disabled=!b.validate(b.itemId,p)),b.selectedRow=p??[],b});g.push(...y)}n.contextMenuItems=g};return{setContextMenu:d,onContextMenu:f=>{var y,C;const p=(C=(y=f.target.closest(".row"))==null?void 0:y.dataset)==null?void 0:C.index;if(p){const b=i.viewStore.findIndex(L=>L.index===Number(p)),k=i.viewStore[b];s.selectedRow=[k],d(),t("update:selected",s.selectedRow)}else s.selectedRow=[],d(!1),t("update:selected",[])},onColumnContextMenu:(f,g)=>{var p,y,C,b,k,L;if(f.target.className.includes("column-name")){const w=!!g.sortable;n.columnMenuItems=[{text:((p=n.columnMenuTextInfo)==null?void 0:p.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!l.value||i.orderedColumns.length===1||!!g.fixed,hidden:((y=n.hiddenColumnMenuItem)==null?void 0:y.hide)||!l.value,click:()=>{r(g.field),t("change-column-status",{columns:i.updatedColumns}),t("change-column-info",{type:"display",columns:i.updatedColumns})}},{text:((C=n.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!w,hidden:(b=n.hiddenColumnMenuItem)==null?void 0:b.ascending,click:()=>c(g,"asc")},{text:((k=n.columnMenuTextInfo)==null?void 0:k.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!w,hidden:(L=n.hiddenColumnMenuItem)==null?void 0:L.descending,click:()=>c(g,"desc")}]}else n.columnMenuItems.length=0},onGridSettingContextMenu:f=>{const{useDefaultColumnSetting:g,columnSettingTextInfo:p}=a,y={text:(p==null?void 0:p.title)??"Column List",isShowMenu:!0,click:()=>{a.isShowColumnSetting=!0,n.isShowMenuOnClick=!0}};n.customGridSettingContextMenu.length&&(n.gridSettingContextMenuItems=[...n.customGridSettingContextMenu]),g&&n.gridSettingContextMenuItems.push(y),n.gridSettingMenu.show(f)}}},Rw=e=>{const{emit:t}=o.getCurrentInstance(),{stores:n,onResize:i}=e,s=()=>{let r=0;const c=[];function d(u){const m={};return Object.keys(u).forEach(f=>{f!=="children"&&(m[f]=u[f])}),m}function h(u){const{node:m,level:f,isShow:g,parent:p,uncheckable:y}=u;m!==null&&typeof m=="object"&&(m.index=r++,m.level=f,Object.hasOwnProperty.call(m,"checked")||(m.checked=!1),Object.hasOwnProperty.call(m,"selected")||(m.selected=!1),Object.hasOwnProperty.call(m,"show")||(m.show=g),Object.hasOwnProperty.call(m,"expand")||(m.expand=!0),Object.hasOwnProperty.call(m,"isFilter")||(m.isFilter=!1),Object.hasOwnProperty.call(m,"uncheckable")||(m.uncheckable=y),Object.hasOwnProperty.call(m,"indeterminate")||(m.indeterminate=!1),Object.hasOwnProperty.call(m,"data")||(m.data=d(m)),c.push(m),Object.hasOwnProperty.call(m,"parent")||(m.parent=p),m.children&&(m.hasChild=!0,m.children.forEach(C=>h({node:C,level:f+1,isShow:m.show&&m.expand,parent:m,uncheckable:m.uncheckable}))))}return n.treeRows.forEach(u=>{h({node:u,level:0,isShow:!0,parent:void 0,uncheckable:!1})}),c},l=(r,c,d)=>{r.forEach(h=>{const u=h;u.show=d&&c?u.isFilter:c,u.hasChild&&l(u.children,u.show&&u.expand,u.isFilter)})};return{setTreeNodeStore:s,handleExpand:r=>{const c=!r.expand,d=r;d.expand=!d.expand,l(d.children,d.expand,d.isFilter),t("toggle-row",{row:d,isExpand:c}),i()}}},Vw=e=>{const{stores:t,filterInfo:n,pageInfo:i,getConvertValue:s,onResize:l,checkHeader:a,getPagingData:r,updatePagingInfo:c}=e,d=f=>{if(!(f!=null&&f.parent))return;const{parent:g}=f;g.show=!0,g.isFilter=!0,d(g)},h=f=>{if(!(f!=null&&f.children))return;const{children:g}=f;g.forEach(p=>{const y=p;y.parent.show&&y.parent.expand?y.show=!0:y.show=!1,y.isFilter=!0,y.hasChild&&h(y)})};let u=null;return{onSearch:f=>{u&&clearTimeout(u),u=setTimeout(()=>{n.isSearch=!1,n.searchWord=f;const g=t.treeStore;g.forEach(p=>{p.show=!1,p.isFilter=!1}),f?(g.filter(y=>{let C=!1;for(let b=0;b<t.orderedColumns.length;b++){const k=t.orderedColumns[b]||{};let L=y[k.field]??null;if(k.type=k.type||"string",L!==null&&!k.hide&&((k==null?void 0:k.searchable)===void 0||k!=null&&k.searchable)&&(L=s(k,L).toString(),C=L.toLowerCase().includes(f.toString().toLowerCase()),C))break}return C}).forEach(y=>{y.show=!0,y.parent&&!y.parent.expand&&(y.show=!1),y.isFilter=!0,d(y),h(y)}),n.isSearch=!0):(g.forEach(p=>{p.show=!0,p.isFilter=!1}),g.forEach(p=>{d(p),h(p)})),!f&&i.isClientPaging&&i.prevPage&&(i.currentPage=1,t.pagingStore=r()),c({onSearch:!0}),a(t.store),l()},500)}}},Ew=e=>{const{emit:t}=o.getCurrentInstance(),{stores:n,pageInfo:i,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=e,c=()=>{const u=(i.currentPage-1)*i.perPage,m=parseInt(u,10)+parseInt(i.perPage,10);return n.showTreeStore.slice(u,m)},d=u=>{t("page-change",{eventName:u,pageInfo:{currentPage:i.currentPage,prevPage:i.prevPage,startIndex:i.startIndex,total:i.pageTotal,perPage:i.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(m=>!m.hide&&((m==null?void 0:m.searchable)===void 0||(m==null?void 0:m.searchable))).map(m=>m.field)}}),i.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(i.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(i.isClientPaging)if(i.prevPage=u,n.showTreeStore.length<=i.perPage)n.pagingStore=n.showTreeStore;else{const m=(i.currentPage-1)*i.perPage,f=parseInt(m,10)+parseInt(i.perPage,10);n.pagingStore=n.showTreeStore.slice(m,f),a.body.scrollTop=0,i.startIndex=m}d({onChangePage:!0})}}},Ww=({sortInfo:e,stores:t})=>{const{emit:n}=o.getCurrentInstance(),i=(u=!0)=>u?["asc","desc","init"]:["asc","desc"];function s(){this.orders=i(),this.dequeue=()=>this.orders.shift(),this.enqueue=u=>this.orders.push(u)}const l=(u,m="init")=>{t.orderedColumns.forEach(f=>{f.index===(u==null?void 0:u.index)&&m?f.sortOption={sortType:m}:f.sortOption={sortType:"init"}})},a=()=>{const u=t.originColumns.filter(m=>m.hiddenDisplay||m.hide);u.length&&u.forEach(m=>{m.sortOption={sortType:"init"}})},r=new s;return{onSort:(u,m)=>{if(u.sortable===void 0?!0:u.sortable){e.sortColumn=u,e.sortField!==(u==null?void 0:u.field)&&(r.orders=i(),e.sortField=u==null?void 0:u.field),m&&(r.orders=i(),m==="desc"&&(e.sortOrder=r.dequeue(),r.enqueue(e.sortOrder))),e.sortOrder=r.dequeue(),r.enqueue(e.sortOrder),a(),l(u,e.sortOrder);const g=Ws(t);n("sort-column",{field:e.sortField,order:e.sortOrder,column:e.sortColumn,columns:g}),n("change-column-info",{type:"sort",columns:g})}},setSortInfo:(u,m=!0)=>{const f=u==null?void 0:u.findIndex(y=>{var C;return(y==null?void 0:y.sortable)&&((C=y==null?void 0:y.sortOption)==null?void 0:C.sortType)&&y.sortOption.sortType!=="init"}),g=u[f];f>-1&&(g.index=f);const{sortType:p}=(g==null?void 0:g.sortOption)||{};e.sortColumn=g,e.sortField=g==null?void 0:g.field,e.isSorting=!!p,e.sortOrder=p,l(g,p),m&&n("change-column-info",{type:"sort",columns:Ws(t)})},initSortInfo:u=>{e.isSorting=!1,e.sortOrder="init",u.forEach(m=>{var f;(f=m==null?void 0:m.sortOption)!=null&&f.sortType&&m.sortOption.sortType!=="init"&&(m.sortOption.sortType="init")})}}},Gw={name:"EvTreeGrid",components:{TreeGridNode:yw,Toolbar:kw,GridPagination:ec,GridSummary:oc,ColumnSetting:lc,GridSortButton:ac,GridOptionButton:il},directives:{observeVisibility:po,resize:Pn},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array,Object],default:()=>null},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""}},emits:{"update:selected":null,"update:checked":null,"click-row":null,"dblclick-row":null,"check-row":null,"check-all":null,"page-change":null,"sort-column":null,"toggle-row":null,"resize-column":({column:e,columns:t})=>({column:e,columns:t}),"change-column-status":({columns:e})=>({columns:e}),"change-column-info":({type:e,columns:t})=>({type:e,columns:t})},setup(e){var Gs,Zs,Xs,Ns,Ps,Ds,Bs,hn,Vn;const t=o.ref(null),n=o.computed(()=>{var K,se;return((se=(K=e.option)==null?void 0:K.useGridSetting)==null?void 0:se.use)||!1}),i=o.computed(()=>{var K;return((K=e.option)==null?void 0:K.useSummary)||!1}),s=o.computed(()=>e.option.emptyText??"No records"),l=o.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),a=o.reactive({isSearch:!1,searchWord:""}),r=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var K,se;return((se=(K=e.option)==null?void 0:K.useGridSetting)==null?void 0:se.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((Zs=(Gs=e.option)==null?void 0:Gs.useGridSetting)==null?void 0:Zs.columnMenuText)??"Column List",search:((Ns=(Xs=e.option)==null?void 0:Xs.useGridSetting)==null?void 0:Ns.searchText)??"Search",empty:((Ds=(Ps=e.option)==null?void 0:Ps.useGridSetting)==null?void 0:Ds.emptyText)??"No records",ok:((hn=(Bs=e.option)==null?void 0:Bs.useGridSetting)==null?void 0:hn.okBtnText)??"OK"}}),c=o.reactive({treeStore:[],viewStore:[],filterStore:[],pagingStore:[],originStore:[],showTreeStore:o.computed(()=>c.treeStore.filter(K=>K.show)),searchStore:o.computed(()=>c.treeStore.filter(K=>K.isFilter)),store:o.computed(()=>a.isSearch?c.searchStore:c.treeStore),treeRows:e.rows,filteredColumns:[],originColumns:o.computed(()=>e.columns.map((K,se)=>{var me;return{index:se,hiddenDisplay:!1,...K,width:isFinite(K.width)?K.width:void 0,sortOption:{sortType:((me=K==null?void 0:K.sortOption)==null?void 0:me.sortType)||"init"}}})),orderedColumns:o.computed(()=>c.filteredColumns.length?c.filteredColumns:c.originColumns),updatedColumns:o.computed(()=>Ws(c))}),d=o.reactive({usePage:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.use)||!1}),useClient:((Vn=e.option.page)==null?void 0:Vn.useClient)||!1,isInfinite:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.total)||0}),perPage:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.perPage)||20}),visiblePage:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.visiblePage)||8}),order:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.order)||"center"}),showPageInfo:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.showPageInfo)||!1}),isClientPaging:o.computed(()=>d.useClient&&d.usePage&&!d.isInfinite),isHighlight:!1,highlightPage:0}),h=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:e.checked,useCheckbox:o.computed(()=>e.option.useCheckbox||{})}),{isRenderer:u,getComponentName:m,getConvertValue:f,getColumnIndex:g,setPixelUnit:p,checkHeader:y}=ww({checkInfo:h}),C=o.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),b=o.reactive({selectedRow:e.selected,useSelect:o.computed(()=>{var K,se;return((se=(K=e.option)==null?void 0:K.useSelection)==null?void 0:se.use)??!0}),limitCount:o.computed(()=>{var se,me;let K=(me=(se=e.option)==null?void 0:se.useSelection)==null?void 0:me.limitCount;return K=K&&K>=2?K:0,K}),multiple:o.computed(()=>{var K,se;return((se=(K=e.option)==null?void 0:K.useSelection)==null?void 0:se.multiple)??!1})}),k=o.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:e.option.customAscFunction??{}}),L=o.reactive({menu:null,contextMenuItems:[],contextMenuClass:e.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:e.option.columnMenuText||{},hiddenColumnMenuItem:e.option.hiddenColumnMenuItem||{},customContextMenu:e.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:o.computed(()=>{var K,se;return((se=(K=e.option)==null?void 0:K.useGridSetting)==null?void 0:se.customContextMenu)||[]}),isShowMenuOnClick:!1}),w=o.reactive({minWidth:40,rendererMinWidth:80,showResizeLine:!1,adjust:e.option.adjust||!1,columnWidth:e.option.columnWidth||80,scrollWidth:e.option.scrollWidth||17,rowHeight:o.computed(()=>e.option.rowHeight||35),gridWidth:o.computed(()=>e.width?p(e.width):"100%"),gridHeight:o.computed(()=>e.height?p(e.height):"100%"),isResize:!1}),M=o.reactive({showHeader:o.computed(()=>e.option.showHeader===void 0?!0:e.option.showHeader),stripeStyle:o.computed(()=>{var K;return((K=e.option.style)==null?void 0:K.stripe)||!1}),borderStyle:o.computed(()=>{var K;return((K=e.option.style)==null?void 0:K.border)||""}),highlightIdx:o.computed(()=>{var K;return((K=e.option.style)==null?void 0:K.highlight)??-1})}),V=()=>{b.selectedRow.length=0,c.store.forEach(K=>{K.selected=!1})},S=()=>{h.isHeaderChecked=!1,h.isHeaderIndeterminate=!1,h.checkedRows.length=0,c.store.forEach(K=>{K.checked=!1,K.indeterminate=!1})},{getPagingData:x,updatePagingInfo:I,changePage:T}=Ew({stores:c,pageInfo:d,sortInfo:k,filterInfo:a,elementInfo:l,clearCheckInfo:S}),v=o.ref(0),{updateVScroll:E,updateHScroll:Z,onScroll:W}=Iw({scrollInfo:C,stores:c,elementInfo:l,resizeInfo:w,pageInfo:d,summaryScroll:v,getPagingData:x,updatePagingInfo:I}),{onRowClick:R,onRowDblClick:X}=Lw(b),{onCheck:G,onCheckAll:N}=Mw({checkInfo:h,stores:c,checkHeader:y,pageInfo:d,getPagingData:x}),{calculatedColumn:P,onResize:B,onShow:H,onColumnResize:D}=Tw({resizeInfo:w,elementInfo:l,checkInfo:h,stores:c,isRenderer:u,updateVScroll:E,updateHScroll:Z,contextInfo:L}),{setTreeNodeStore:Y,handleExpand:F}=Rw({stores:c,onResize:B}),{onSort:O,initSortInfo:z,setSortInfo:j}=Ww({sortInfo:k,stores:c}),{onSearch:U}=Vw({stores:c,filterInfo:a,pageInfo:d,getConvertValue:f,onResize:B,checkHeader:y,getPagingData:x,updatePagingInfo:I}),{setPositionColumnSetting:Q,initColumnSettingInfo:J,onApplyColumn:ne,setColumnHidden:q}=rc({stores:c,columnSettingInfo:r,contextInfo:L,onSearch:U,onResize:B}),{setContextMenu:ee,onContextMenu:$,onColumnContextMenu:he,onGridSettingContextMenu:fe}=vw({contextInfo:L,stores:c,selectInfo:b,useGridSetting:n,columnSettingInfo:r,setColumnHidden:q,onSort:O}),ae=K=>{L.gridSettingContextMenuItems.length=0,L.customGridSettingContextMenu.length?fe(K):r.isShowColumnSetting=!0},Se=K=>{var se,me,we,Ee,Ke,tt;K.type==="wheel"&&((se=L.menu)==null||se.hide(K)),K.type==="scroll"&&!((me=K.target.classList)!=null&&me.contains("table-body"))&&!((Ee=(we=K.target.offsetParent)==null?void 0:we.classList)!=null&&Ee.contains("ev-grid-column-setting"))&&(r.isShowColumnSetting=!1,L.isShowMenuOnClick=!1,(Ke=L.columnMenu)==null||Ke.hide(K),(tt=L.gridSettingMenu)==null||tt.hide())};o.onMounted(()=>{var K;if(c.treeStore=Y(),c.originStore=Ve(c.treeStore),(K=e.option)!=null&&K.useSort)j(e.columns,!1);else{const se=L.hiddenColumnMenuItem;se.ascending=!0,se.descending=!0}document.addEventListener("wheel",Se,{capture:!1}),document.addEventListener("scroll",Se,{capture:!0})}),o.onUnmounted(()=>{document.removeEventListener("wheel",Se,{capture:!1}),document.removeEventListener("scroll",Se,{capture:!0})}),o.onActivated(()=>{B()}),o.watch(()=>{var K;return(K=e.option)==null?void 0:K.useSort},K=>{const se=e.option.hiddenColumnMenuItem,me=L.hiddenColumnMenuItem;K?(me.ascending=(se==null?void 0:se.ascending)??!1,me.descending=(se==null?void 0:se.descending)??!1,j(e.columns,!1)):(me.ascending=!0,me.descending=!0,z(e.columns))}),o.watch(()=>r.isShowColumnSetting,K=>{var se;if(!K){(se=L.gridSettingMenu)==null||se.hide();return}Q(t.value)}),o.watch(()=>e.columns,()=>{J()},{deep:!0,immediate:!0}),o.watch(()=>e.checked,K=>{h.checkedRows=K}),o.watch(()=>h.checkedRows,K=>{h.isHeaderChecked=!1;let se=c.store;d.isClientPaging&&(se=x()),se.length&&(se.forEach(me=>{me.checked=!!K.find(we=>we.index===me.index)}),y(se)),E()}),o.watch(()=>e.selected,K=>{b.useSelect&&(b.selectedRow=K)}),o.watch(()=>b.selectedRow,K=>{b.useSelect&&(c.store.forEach(se=>{se.selected=!!K.find(me=>me.index===se.index)}),E())},{deep:!0}),o.watch(()=>M.highlightIdx,async K=>{await o.nextTick();const se=we=>{if(!(we!=null&&we.children))return;const{children:Ee}=we;Ee.forEach(Ke=>{const tt=Ke;tt.parent.show&&tt.parent.expand?tt.show=!0:tt.show=!1,tt.isFilter=!0,tt.hasChild&&se(tt)})},me=we=>{if(!(we!=null&&we.parent)){se(we);return}const{parent:Ee}=we;Ee.show=!0,Ee.isFilter=!0,Ee.expand=!0,se(Ee),me(Ee)};if(K>=0){const we=c.store.find(Ke=>Ke.index===K);if(!we)return;we.show=!0,we.isFilter=!0,me(we);const Ee=c.showTreeStore.map(Ke=>Ke.index).indexOf(we.index);if(d.usePage&&!d.isInfinite){const Ke=Math.ceil(Ee/d.perPage);if(d.highlightPage=Ee===d.perPage?Ke+1:Ke||1,d.highlightPage!==d.currentPage){d.currentPage=d.highlightPage,d.isHighlight=!0;return}}l.body.scrollTop=w.rowHeight*Ee}}),o.watch(()=>h.useCheckbox.mode,()=>{h.checkedRows=[],h.isHeaderChecked=!1}),o.watch(()=>b.useSelect,()=>{V()}),o.watch(()=>b.multiple,()=>{V()}),o.watch(()=>e.rows,K=>{c.treeRows=K,c.treeStore=Y(),B()},{deep:!0}),o.watch(()=>c.treeStore.length,()=>{y(c.store)}),o.watch(()=>[e.width,e.height,e.option.columnWidth],()=>{e.option.columnWidth!=null&&(w.columnWidth=e.option.columnWidth),c.orderedColumns.map(K=>{var me;const se=K;return!((me=e.columns[K.index])!=null&&me.width)&&!se.resized&&(se.width=0),se}),B()}),o.watch(()=>e.option.searchValue,K=>{o.nextTick(()=>{K!==void 0&&(U((K==null?void 0:K.value)??K),d.isClientPaging&&(S(),V()))})},{immediate:!0}),o.watch(()=>{var K;return(K=e.option.page)==null?void 0:K.currentPage},K=>{var me;const se=K||1;d.currentPage=(me=e.option.page)!=null&&me.isInfinite?1:se},{immediate:!0}),o.watch(()=>d.currentPage,(K,se)=>{o.nextTick(()=>{if(T(se),d.isClientPaging&&K!==se&&(S(),V()),E(),K===d.highlightPage&&d.isHighlight){const me=c.pagingStore.map(we=>we.index).indexOf(M.highlightIdx);l.body.scrollTop=w.rowHeight*me,d.isHighlight=!d.isHighlight}})});const ye=()=>({"column-sort__icon":!0,"column-sort__icon--asc":k.sortOrder==="asc","column-sort__icon--desc":k.sortOrder==="desc"}),oe=o.computed(()=>({width:w.gridWidth,height:w.gridHeight})),re=o.computed(()=>({"table-body":!0,stripe:M.stripeStyle,"bottom-border":!!c.viewStore.length,"non-border":!!M.borderStyle})),pe=o.computed(()=>({table:!0,"ev-grid":!0,"ev-tree-grid":!0,adjust:w.adjust,"non-header":!M.showHeader,"ev-tree-grid--empty":!c.viewStore.length})),Te=o.computed(()=>({"table-header":!0,"non-border":!!M.borderStyle})),Ge=o.computed(()=>({column:!0,"checkbox-all":!0,"non-border":!!M.borderStyle})),Lt=o.computed(()=>h.useCheckbox.use&&h.useCheckbox.headerCheck&&h.useCheckbox.mode!=="single"),Zt=K=>({column:!0,render:u(K),"non-border":!!M.borderStyle,[K.field]:K.field}),Sl=(K,se)=>{const me=u(K);return{width:`${K.width}px`,"min-width":me?`${w.rendererMinWidth}px;`:`${w.minWidth}px`,"margin-right":c.orderedColumns.length-1===se&&C.hasVerticalScrollBar&&C.hasHorizontalScrollBar?`${w.scrollWidth}px`:"0px","border-right":c.orderedColumns.length-1===se?"none":"1px solid #CFCFCF"}},Cl=K=>`${K}Node`;return{summaryScroll:v,gridStyle:oe,gridClass:pe,headerClass:Te,headerCheckboxClass:Ge,isHeaderCheckbox:Lt,bodyStyle:re,useSummary:i,useGridSetting:n,toolbarRef:t,stores:c,emptyText:s,...o.toRefs(M),...o.toRefs(l),...o.toRefs(c),...o.toRefs(a),...o.toRefs(C),...o.toRefs(w),...o.toRefs(b),...o.toRefs(h),...o.toRefs(k),...o.toRefs(L),...o.toRefs(d),...o.toRefs(r),isRenderer:u,getComponentName:m,getConvertValue:f,getColumnIndex:g,setPixelUnit:p,updateVScroll:E,updateHScroll:Z,onScroll:W,calculatedColumn:P,onResize:B,onShow:H,onColumnResize:D,onRowClick:R,onRowDblClick:X,onCheck:G,onCheckAll:N,setContextMenu:ee,onContextMenu:$,onSearch:U,handleExpand:F,getColumnClass:Zt,getColumnStyle:Sl,getSlotName:Cl,setGridSetting:ae,onApplyColumn:ne,onColumnContextMenu:he,onSort:O,sortIconClass:ye}}},Zw={class:"column-list"},Xw=["data-index"],Nw=["title","onClick"],Pw=["onClick"],Dw=["onMousedown"],Bw={ref:"table"},Ow=["title"],Yw={key:0},Fw={class:"is-empty"},Hw={ref:"resizeLine",class:"table-resize-line"};function zw(e,t,n,i,s,l){var C;const a=o.resolveComponent("grid-option-button"),r=o.resolveComponent("toolbar"),c=o.resolveComponent("ev-checkbox"),d=o.resolveComponent("grid-sort-button"),h=o.resolveComponent("tree-grid-node"),u=o.resolveComponent("ev-context-menu"),m=o.resolveComponent("grid-summary"),f=o.resolveComponent("grid-pagination"),g=o.resolveComponent("column-setting"),p=o.resolveDirective("resize"),y=o.resolveDirective("observe-visibility");return o.openBlock(),o.createElementBlock(o.Fragment,null,[e.$slots.toolbar||i.useGridSetting?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:o.normalizeStyle(`width: ${e.gridWidth};`)},[o.createVNode(r,null,{toolbarWrapper:o.withCtx(()=>[i.useGridSetting?(o.openBlock(),o.createBlock(a,{key:0,class:"grid-setting__icon",onClick:i.setGridSetting},null,8,["onClick"])):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"toolbar",{item:{onSearch:i.onSearch}},void 0,!0)]),_:3})],4)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"grid-wrapper",style:o.normalizeStyle(i.gridStyle)},[o.createElementVNode("div",{ref:"grid",class:o.normalizeClass(i.gridClass)},[o.withDirectives(o.createElementVNode("div",{ref:"header",class:o.normalizeClass(i.headerClass)},[o.createElementVNode("ul",Zw,[e.useCheckbox.use?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(i.headerCheckboxClass),style:o.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[i.isHeaderCheckbox?(o.openBlock(),o.createBlock(c,{key:0,modelValue:e.isHeaderChecked,"onUpdate:modelValue":t[0]||(t[0]=b=>e.isHeaderChecked=b),disabled:e.isHeaderUncheckable,indeterminate:e.isHeaderIndeterminate,onChange:i.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):o.createCommentVNode("",!0)],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.orderedColumns,(b,k)=>{var L,w;return o.openBlock(),o.createElementBlock(o.Fragment,{key:k},[!b.hide&&!b.hiddenDisplay?(o.openBlock(),o.createElementBlock("li",{key:0,"data-index":k,class:o.normalizeClass(i.getColumnClass(b)),style:o.normalizeStyle(i.getColumnStyle(b,k))},[b.customHeader&&e.$slots.customHeader?o.renderSlot(e.$slots,"customHeader",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:b.caption,class:o.normalizeClass(["column-name",{"column-name--click":i.useGridSetting}]),onClick:[M=>i.onColumnContextMenu(M,b),t[1]||(t[1]=o.withModifiers((...M)=>e.columnMenu.show&&e.columnMenu.show(...M),["prevent"]))]},[o.createTextVNode(o.toDisplayString(b.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(M=>i.onSort(b),["stop"])},[e.$slots.sortIcon?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(L=e.$props.option)!=null&&L.useSort&&(b!=null&&b.sortable)?(o.openBlock(),o.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,"sortIcon",{},void 0,!0)],4)):o.createCommentVNode("",!0),e.sortField===b.field?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(i.sortIconClass(b)),style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,`sortIcon_${e.sortOrder}`,{},void 0,!0)],6)):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[(w=e.$props.option)!=null&&w.useSort&&(b!=null&&b.sortable)?(o.openBlock(),o.createBlock(d,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},null,8,["style"])):o.createCommentVNode("",!0),e.sortField===b.field?(o.openBlock(),o.createBlock(d,{key:1,class:o.normalizeClass(i.sortIconClass(b)),icon:e.sortOrder,style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,visibility:e.sortOrder?b.hidden:!0})},null,8,["class","icon","style"])):o.createCommentVNode("",!0)],64))],8,Pw)],10,Nw)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(M=>i.onColumnResize(k,M),["stop","left"])},null,40,Dw)],14,Xw)):o.createCommentVNode("",!0)],64)}),128)),(C=e.$props.option.customContextMenu)!=null&&C.length?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({column:!0,"non-border":!!e.borderStyle}),style:o.normalizeStyle({width:"30px","min-width":"30px","margin-right":e.hasVerticalScrollBar||e.hasHorizontalScrollBar?`${e.scrollWidth}px`:"0px"})},null,6)):o.createCommentVNode("",!0)])],2),[[o.vShow,e.showHeader]]),o.createElementVNode("div",{ref:"body",class:o.normalizeClass(i.bodyStyle),onScroll:t[2]||(t[2]=(...b)=>i.onScroll&&i.onScroll(...b)),onContextmenu:[t[3]||(t[3]=b=>i.onContextMenu(b)),t[4]||(t[4]=o.withModifiers((...b)=>e.menu.show&&e.menu.show(...b),["prevent"]))]},[o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),o.createElementVNode("table",Bw,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.viewStore,(b,k)=>(o.openBlock(),o.createBlock(h,{key:k,"selected-data":e.selectedRow,"node-data":b,"use-checkbox":e.useCheckbox,"ordered-columns":e.orderedColumns,"expand-icon":n.option.expandIcon,"collapse-icon":n.option.collapseIcon,"parent-icon":n.option.parentIcon,"child-icon":n.option.childIcon,"custom-context-menu":e.customContextMenu,"menu-ref":e.menu,"is-resize":e.isResize,"row-height":e.rowHeight,"min-width":e.minWidth,"highlight-index":e.highlightIdx,"border-style":e.borderStyle,onCheckTreeData:i.onCheck,onExpandTreeData:i.handleExpand,onClickTreeData:i.onRowClick,onDblClickTreeData:i.onRowDblClick,onContextMenu:i.onContextMenu},o.createSlots({_:2},[o.renderList(e.orderedColumns,(L,w)=>({name:i.getSlotName(L.field),fn:o.withCtx(({item:M})=>[e.$slots[L.field]?o.renderSlot(e.$slots,L.field,{key:0,item:{data:M.data,fieldName:L.field}},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:i.getConvertValue(L,b[L.field])},o.toDisplayString(i.getConvertValue(L,b[L.field])),9,Ow))])})),e.$slots.contextmenuIcon?{name:"contextmenuIconNode",fn:o.withCtx(()=>[o.renderSlot(e.$slots,"contextmenuIcon",{},void 0,!0)]),key:"0"}:void 0]),1032,["selected-data","node-data","use-checkbox","ordered-columns","expand-icon","collapse-icon","parent-icon","child-icon","custom-context-menu","menu-ref","is-resize","row-height","min-width","highlight-index","border-style","onCheckTreeData","onExpandTreeData","onClickTreeData","onDblClickTreeData","onContextMenu"]))),128)),e.viewStore.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",Yw,[o.createElementVNode("td",Fw,o.toDisplayString(i.emptyText),1)]))])],512),o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),o.createVNode(u,{ref:"menu","custom-class":e.contextMenuClass,items:e.contextMenuItems},null,8,["custom-class","items"]),o.createVNode(u,{ref:"columnMenu",items:e.columnMenuItems},null,8,["items"]),o.createVNode(u,{ref:"gridSettingMenu",items:e.gridSettingContextMenuItems,"is-show-menu-on-click":e.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),o.withDirectives(o.createElementVNode("div",Hw,null,512),[[o.vShow,e.showResizeLine]])],2)],4)),[[p,i.onResize],[y,{callback:i.onShow,once:!0}]]),i.useSummary?(o.openBlock(),o.createBlock(m,{key:1,"is-tree":!0,"ordered-columns":e.orderedColumns,stores:i.stores,"use-checkbox":e.useCheckbox.use,"style-option":{borderStyle:e.borderStyle,minWidth:e.minWidth,rowHeight:e.rowHeight},"scroll-left":i.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):o.createCommentVNode("",!0),e.usePage&&!e.isInfinite?(o.openBlock(),o.createBlock(f,{key:2,modelValue:e.currentPage,"onUpdate:modelValue":t[5]||(t[5]=b=>e.currentPage=b),total:e.showTreeStore.length,"per-page":e.perPage,"visible-page":e.visiblePage,"show-page-info":e.showPageInfo,order:e.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):o.createCommentVNode("",!0),o.createVNode(g,{"is-show":e.isShowColumnSetting,"onUpdate:isShow":t[6]||(t[6]=b=>e.isShowColumnSetting=b),"is-show-menu-on-click":e.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":t[7]||(t[7]=b=>e.isShowMenuOnClick=b),columns:e.updatedColumns,"hidden-column":e.hiddenColumn,position:e.columnSettingPosition,"text-info":e.columnSettingTextInfo,onApplyColumn:i.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const Ri=ce(Gw,[["render",zw],["__scopeId","data-v-9ed705b7"]]);Ri.install=e=>{e.component(Ri.name,Ri)};const Aw={name:"PageButton",props:{page:{type:Object,required:!0},disabled:{type:Boolean,default:!1}}},_w=["aria-current"];function Kw(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("span",o.mergeProps({class:{"is-current":n.page.isCurrent,"is-disabled":n.disabled||n.page.disabled,[n.page.class]:!0}},e.$attrs,{"aria-current":n.page.isCurrent,onClick:t[0]||(t[0]=o.withModifiers((...a)=>n.page.click&&n.page.click(...a),["stop"]))}),[o.renderSlot(e.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(n.page.number),1)])],16,_w)}const Uw={name:"EvPagination",components:{EvIcon:Ln,pageButton:ce(Aw,[["render",Kw]])},props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:e=>["left","right","center"].includes(e)},pagePerJump:{type:[Number,void 0],default:void 0}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=o.computed(()=>e.visiblePage>7?e.visiblePage:7),i=o.computed(()=>e.modelValue),s=o.computed(()=>e.total===0?1:Math.ceil(e.total/e.perPage)),l=o.computed(()=>i.value>1),a=o.computed(()=>i.value<s.value),r=o.computed(()=>Math.max(i.value-e.pagePerJump,1)),c=o.computed(()=>Math.min(i.value+e.pagePerJump,s.value)),d=o.computed(()=>{const p=i.value*e.perPage-e.perPage+1;return p>=0?p:0}),h=(p,y)=>{i.value===p||p<1||p>s.value||(t("update:modelValue",p),t("change",p),y&&y.target&&o.nextTick(()=>y.target.focus()))},u=(p,y={})=>({number:p,isCurrent:y.isCurrent??i.value===p,click:C=>h(p,C),input:(C,b)=>h(+b,C),disabled:y.disabled||!1,class:y.class||""}),m=(p,y)=>{const C=[],b=p>0?p:1;for(let k=b;k<=y;k++)C.push(u(k));return C},f=o.computed(()=>{const p=parseInt(n.value,10);if(p===0)return[];const y=Math.min(Math.max(0,p)||s.value,s.value);if(s.value<=y)return m(1,s.value);const C=y%2===0?1:0,b=Math.floor(y/2),k=s.value-b+1+C;if(i.value>b&&i.value<k){const w=s.value,M=i.value-b+2,V=i.value+b-2-C,S=M-1===2?2:-1,x=V+1===w-1?V+1:-1;return[u(1),u(S),...m(M,V),u(x),u(s.value)]}else if(i.value===b){const L=i.value+b-1-C;return[...m(1,L),u(-1),u(s.value)]}else if(i.value===k){const L=i.value-b+1;return[u(1),u(-1),...m(L,s.value)]}return[...m(1,b),u(-1),...m(k,s.value)]}),g=o.computed(()=>({"justify-content":e.order,flex:"3 1 0%"}));return o.watch(()=>s.value,p=>{i.value>p&&h(p)}),o.watch(()=>i.value,(p,y)=>{s.value<p&&h(y)}),{pageCount:s,pagesInRange:f,hasPrev:l,hasNext:a,listClasses:g,firstData:d,current:i,changePage:h,getPage:u,prevJumpPage:r,nextJumpPage:c}}},Jw={class:"pagination"},jw={key:0,class:"pagination-info"},Qw={key:0,class:"pagination-ellipsis"},$w=["onClick"];function qw(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("page-button");return o.openBlock(),o.createElementBlock("nav",Jw,[n.showPageInfo?(o.openBlock(),o.createElementBlock("small",jw,[n.perPage===1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(i.firstData)+" / "+o.toDisplayString(n.total),1)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(i.firstData)+" - "+o.toDisplayString(Math.min(i.current*n.perPage,n.total))+" / "+o.toDisplayString(n.total),1)],64))])):o.createCommentVNode("",!0),o.createElementVNode("ul",{class:"pagination-list",style:o.normalizeStyle(i.listClasses)},[e.$props.pagePerJump?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(["step-button",{"is-disabled":!i.hasPrev}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasPrev,page:i.getPage(i.prevJumpPage,{isCurrent:!1})},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-double-left"})]),_:1},8,["disabled","page"])],2)):o.createCommentVNode("",!0),o.createElementVNode("li",{class:o.normalizeClass(["step-button",{"is-disabled":!i.hasPrev}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasPrev,page:i.getPage(i.current-1)},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-arrow-left"})]),_:1},8,["disabled","page"])],2),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.pagesInRange,(c,d)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:d},[c.number===-1?(o.openBlock(),o.createElementBlock("li",Qw,[...t[0]||(t[0]=[o.createElementVNode("span",null,"…",-1)])])):(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({"is-current":c.isCurrent,"is-page":!0}),onClick:c.click},[o.createVNode(r,{page:c},null,8,["page"])],10,$w))],64))),128)),o.createElementVNode("li",{class:o.normalizeClass(["step-button",{"is-disabled":!i.hasNext}])},[o.createVNode(r,{class:"pagination-next",disabled:!i.hasNext,page:i.getPage(i.current+1)},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-arrow-right"})]),_:1},8,["disabled","page"])],2),e.$props.pagePerJump?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass(["step-button",{"is-disabled":!i.hasNext}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasNext,page:i.getPage(i.nextJumpPage,{isCurrent:!1})},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-double-right"})]),_:1},8,["disabled","page"])],2)):o.createCommentVNode("",!0)],4)])}const Vi=ce(Uw,[["render",qw]]);Vi.install=e=>{e.component(Vi.name,Vi)};const eI=[Dn,Bn,xn,On,Sn,Cn,Yn,Fn,zn,An,_n,Un,ii,Ln,li,ai,ri,ci,di,hi,ui,fi,mi,pi,bi,Li,Mi,vi,ps,bs,ys,Ri,Vi],tI={version:Si,install:e=>{e&&eI.forEach(t=>{e.use(t)})}};le.EvButton=xn,le.EvButtonGroup=On,le.EvCalendar=li,le.EvChart=Li,le.EvChartBrush=vi,le.EvChartGroup=Mi,le.EvCheckbox=Sn,le.EvCheckboxGroup=Cn,le.EvContextMenu=ci,le.EvDatePicker=ai,le.EvGrid=bi,le.EvIcon=Ln,le.EvInputNumber=Un,le.EvLoading=hi,le.EvMenu=fi,le.EvMessage=ps,le.EvMessageBox=ys,le.EvNotification=bs,le.EvPagination=Vi,le.EvProgress=ui,le.EvRadio=Yn,le.EvRadioGroup=Fn,le.EvScheduler=ri,le.EvSelect=zn,le.EvSlider=ii,le.EvTabPanel=Bn,le.EvTabs=Dn,le.EvTextField=_n,le.EvTimePicker=pi,le.EvToggle=An,le.EvTree=mi,le.EvTreeGrid=Ri,le.EvWindow=di,le.default=tI,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});