@ecan-bi/tools 1.0.51 → 1.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.es.js CHANGED
@@ -1 +1 @@
1
- function e(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function t(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((o=o.apply(e,t||[])).next())}))}const n=()=>{},o=Object.assign,r=Array.isArray,i=e=>"function"==typeof e,a=e=>"symbol"==typeof e;let l;const s=()=>l||(l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});const c=e=>{const t=new Set(e);return t.w=0,t.n=0,t},u=e=>(e.w&p)>0,d=e=>(e.n&p)>0;let f=0,p=1;let h;class y{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,function(e,t){t&&t.active&&t.effects.push(e)}(this,n)}run(){if(!this.active)return this.fn();let e=h,t=b;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=h,h=this,b=!0,p=1<<++f,f<=30?(({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=p})(this):m(this),this.fn()}finally{f<=30&&(e=>{const{deps:t}=e;if(t.length){let n=0;for(let o=0;o<t.length;o++){const r=t[o];u(r)&&!d(r)?r.delete(e):t[n++]=r,r.w&=~p,r.n&=~p}t.length=n}})(this),p=1<<--f,h=this.parent,b=t,this.parent=void 0,this.deferStop&&this.stop()}}stop(){h===this?this.deferStop=!0:this.active&&(m(this),this.onStop&&this.onStop(),this.active=!1)}}function m(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let b=!0;const g=[];function v(e,t){let n=!1;f<=30?d(e)||(e.n|=p,n=!u(e)):n=!e.has(h),n&&(e.add(h),h.deps.push(e),"production"!==process.env.NODE_ENV&&h.onTrack&&h.onTrack(o({effect:h},t)))}function x(e,t){const n=r(e)?e:[...e];for(const e of n)e.computed&&w(e,t);for(const e of n)e.computed||w(e,t)}function w(e,t){(e!==h||e.allowRecurse)&&("production"!==process.env.NODE_ENV&&e.onTrigger&&e.onTrigger(o({effect:e},t)),e.scheduler?e.scheduler():e.run())}function S(e){const t=e&&e.__v_raw;return t?S(t):e}function A(e){return!(!e||!0!==e.__v_isRef)}function _(e){return A(e)?e.value:e}new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(a));class j{constructor(e,t,n,o){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new y(e,(()=>{this._dirty||(this._dirty=!0,function(e,t){const n=(e=S(e)).dep;n&&("production"!==process.env.NODE_ENV?x(n,{target:e,type:"set",key:"value",newValue:t}):x(n))}(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=S(this);var t;return t=e,b&&h&&(t=S(t),"production"!==process.env.NODE_ENV?v(t.dep||(t.dep=c()),{target:t,type:"get",key:"value"}):v(t.dep||(t.dep=c()))),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}const O=[];function C(e,...t){if("production"===process.env.NODE_ENV)return;g.push(b),b=!1;const n=O.length?O[O.length-1].component:null,o=n&&n.appContext.config.warnHandler,r=function(){let e=O[O.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const o=e.component&&e.component.parent;e=o&&o.vnode}return t}();if(o)$(o,n,11,[e+t.join(""),n&&n.proxy,r.map((({vnode:e})=>`at <${oe(n,e.type)}>`)).join("\n"),r]);else{const n=[`[Vue warn]: ${e}`,...t];r.length&&n.push("\n",...function(e){const t=[];return e.forEach(((e,n)=>{t.push(...0===n?[]:["\n"],...function({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",o=!!e.component&&null==e.component.parent,r=` at <${oe(e.component,e.type,o)}`,i=">"+n;return e.props?[r,...L(e.props),i]:[r+i]}(e))})),t}(r)),console.warn(...n)}!function(){const e=g.pop();b=void 0===e||e}()}function L(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach((n=>{t.push(...T(n,e[n]))})),n.length>3&&t.push(" ..."),t}function T(e,t,n){return"string"==typeof t?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):"number"==typeof t||"boolean"==typeof t||null==t?n?t:[`${e}=${t}`]:A(t)?(t=T(e,S(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):i(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=S(t),n?t:[`${e}=`,t])}const N={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 $(e,t,n,o){let r;try{r=o?e(...o):e()}catch(e){!function(e,t,n,o=!0){const r=t?t.vnode:null;if(t){let o=t.parent;const r=t.proxy,i="production"!==process.env.NODE_ENV?N[n]:n;for(;o;){const t=o.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,r,i))return;o=o.parent}const a=t.appContext.config.errorHandler;if(a)return void $(a,null,10,[e,r,i])}!function(e,t,n,o=!0){if("production"!==process.env.NODE_ENV){const i=N[t];if(n&&(r=n,O.push(r)),C("Unhandled error"+(i?` during execution of ${i}`:"")),n&&O.pop(),o)throw e;console.error(e)}else console.error(e);var r}(e,n,r,o)}(e,t,n)}return r}let k=!1,D=!1;const M=[];let E=0;const I=[];let V=null,F=0;const z=Promise.resolve();function R(e){M.length&&M.includes(e,k&&e.allowRecurse?E+1:E)||(null==e.id?M.push(e):M.splice(function(e){let t=E+1,n=M.length;for(;t<n;){const o=t+n>>>1,r=M[o],i=P(r);i<e||i===e&&r.pre?t=o+1:n=o}return t}(e.id),0,e),U())}function U(){k||D||(D=!0,z.then(Y))}const P=e=>null==e.id?1/0:e.id,G=(e,t)=>{const n=P(e)-P(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Y(e){D=!1,k=!0,"production"!==process.env.NODE_ENV&&(e=e||new Map),M.sort(G);const t="production"!==process.env.NODE_ENV?t=>W(e,t):n;try{for(E=0;E<M.length;E++){const e=M[E];if(e&&!1!==e.active){if("production"!==process.env.NODE_ENV&&t(e))continue;$(e,null,14)}}}finally{E=0,M.length=0,function(e){if(I.length){const t=[...new Set(I)];if(I.length=0,V)return void V.push(...t);for(V=t,"production"!==process.env.NODE_ENV&&(e=e||new Map),V.sort(((e,t)=>P(e)-P(t))),F=0;F<V.length;F++)"production"!==process.env.NODE_ENV&&W(e,V[F])||V[F]();V=null,F=0}}(e),k=!1,(M.length||I.length)&&Y(e)}}function W(e,t){if(e.has(t)){const n=e.get(t);if(n>100){const e=t.ownerInstance,n=e&&ne(e.type);return C(`Maximum recursive updates exceeded${n?` in component <${n}>`:""}. 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 H=new Set;"production"!==process.env.NODE_ENV&&(s().__VUE_HMR_RUNTIME__={createRecord:Q((function(e,t){if(B.has(e))return!1;return B.set(e,{initialDef:K(t),instances:new Set}),!0})),rerender:Q((function(e,t){const n=B.get(e);if(!n)return;n.initialDef.render=t,[...n.instances].forEach((e=>{t&&(e.render=t,K(e.type).render=t),e.renderCache=[],e.update()}))})),reload:Q((function(e,t){const n=B.get(e);if(!n)return;t=K(t),q(n.initialDef,t);const o=[...n.instances];for(const e of o){const o=K(e.type);H.has(o)||(o!==n.initialDef&&q(o,t),H.add(o)),e.appContext.propsCache.delete(e.type),e.appContext.emitsCache.delete(e.type),e.appContext.optionsCache.delete(e.type),e.ceReload?(H.add(o),e.ceReload(t.styles),H.delete(o)):e.parent?R(e.parent.update):e.appContext.reload?e.appContext.reload():"undefined"!=typeof window?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}i=()=>{for(const e of o)H.delete(K(e.type))},r(i)?I.push(...i):V&&V.includes(i,i.allowRecurse?F+1:F)||I.push(i),U();var i}))});const B=new Map;function K(e){return i(t=e)&&"__vccOpts"in t?e.__vccOpts:e;var t}function q(e,t){o(e,t);for(const n in e)"__file"===n||n in t||delete e[n]}function Q(e){return(t,n)=>{try{return e(t,n)}catch(e){console.error(e),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}const J={};let X;"production"!==process.env.NODE_ENV&&(J.ownKeys=e=>(C("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));let Z="__VUE_INSTANCE_SETTERS__";(X=s()[Z])||(X=s()[Z]=[]),X.push((e=>e));const ee=/(?:^|[-_])(\w)/g,te=e=>e.replace(ee,(e=>e.toUpperCase())).replace(/[-_]/g,"");function ne(e,t=!0){return i(e)?e.displayName||e.name:e.name||t&&e.__name}function oe(e,t,n=!1){let o=ne(t);if(!o&&t.__file){const e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(o=e[1])}if(!o&&e&&e.parent){const n=e=>{for(const n in e)if(e[n]===t)return n};o=n(e.components||e.parent.type.components)||n(e.appContext.components)}return o?te(o):n?"App":"Anonymous"}const re=(e,t)=>function(e,t,o=!1){let r,a;const l=i(e);return l?(r=e,a="production"!==process.env.NODE_ENV?()=>{console.warn("Write operation failed: computed value is readonly")}:n):(r=e.get,a=e.set),new j(r,a,l||!a,o)}(e,0,false);function ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ae,le={exports:{}};function se(){return ae||(ae=1,le.exports=function(){var e=1e3,t=6e4,n=36e5,o="millisecond",r="second",i="minute",a="hour",l="day",s="week",c="month",u="quarter",d="year",f="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},b=function(e,t,n){var o=String(e);return!o||o.length>=t?e:""+Array(t+1-o.length).join(n)+e},g={s:b,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),o=Math.floor(n/60),r=n%60;return(t<=0?"+":"-")+b(o,2,"0")+":"+b(r,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var o=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(o,c),i=n-r<0,a=t.clone().add(o+(i?-1:1),c);return+(-(o+(n-r)/(i?r-a:a-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:s,d:l,D:f,h:a,m:i,s:r,ms:o,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",x={};x[v]=m;var w="$isDayjsObject",S=function(e){return e instanceof O||!(!e||!e[w])},A=function e(t,n,o){var r;if(!t)return v;if("string"==typeof t){var i=t.toLowerCase();x[i]&&(r=i),n&&(x[i]=n,r=i);var a=t.split("-");if(!r&&a.length>1)return e(a[0])}else{var l=t.name;x[l]=t,r=l}return!o&&r&&(v=r),r||!o&&v},_=function(e,t){if(S(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new O(n)},j=g;j.l=A,j.i=S,j.w=function(e,t){return _(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var O=function(){function m(e){this.$L=A(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[w]=!0}var b=m.prototype;return b.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(j.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var o=t.match(h);if(o){var r=o[2]-1||0,i=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],r,o[3]||1,o[4]||0,o[5]||0,o[6]||0,i)):new Date(o[1],r,o[3]||1,o[4]||0,o[5]||0,o[6]||0,i)}}return new Date(t)}(e),this.init()},b.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},b.$utils=function(){return j},b.isValid=function(){return!(this.$d.toString()===p)},b.isSame=function(e,t){var n=_(e);return this.startOf(t)<=n&&n<=this.endOf(t)},b.isAfter=function(e,t){return _(e)<this.startOf(t)},b.isBefore=function(e,t){return this.endOf(t)<_(e)},b.$g=function(e,t,n){return j.u(e)?this[t]:this.set(n,e)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(e,t){var n=this,o=!!j.u(t)||t,u=j.p(e),p=function(e,t){var r=j.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return o?r:r.endOf(l)},h=function(e,t){return j.w(n.toDate()[e].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},y=this.$W,m=this.$M,b=this.$D,g="set"+(this.$u?"UTC":"");switch(u){case d:return o?p(1,0):p(31,11);case c:return o?p(1,m):p(0,m+1);case s:var v=this.$locale().weekStart||0,x=(y<v?y+7:y)-v;return p(o?b-x:b+(6-x),m);case l:case f:return h(g+"Hours",0);case a:return h(g+"Minutes",1);case i:return h(g+"Seconds",2);case r:return h(g+"Milliseconds",3);default:return this.clone()}},b.endOf=function(e){return this.startOf(e,!1)},b.$set=function(e,t){var n,s=j.p(e),u="set"+(this.$u?"UTC":""),p=(n={},n[l]=u+"Date",n[f]=u+"Date",n[c]=u+"Month",n[d]=u+"FullYear",n[a]=u+"Hours",n[i]=u+"Minutes",n[r]=u+"Seconds",n[o]=u+"Milliseconds",n)[s],h=s===l?this.$D+(t-this.$W):t;if(s===c||s===d){var y=this.clone().set(f,1);y.$d[p](h),y.init(),this.$d=y.set(f,Math.min(this.$D,y.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},b.set=function(e,t){return this.clone().$set(e,t)},b.get=function(e){return this[j.p(e)]()},b.add=function(o,u){var f,p=this;o=Number(o);var h=j.p(u),y=function(e){var t=_(p);return j.w(t.date(t.date()+Math.round(e*o)),p)};if(h===c)return this.set(c,this.$M+o);if(h===d)return this.set(d,this.$y+o);if(h===l)return y(1);if(h===s)return y(7);var m=(f={},f[i]=t,f[a]=n,f[r]=e,f)[h]||1,b=this.$d.getTime()+o*m;return j.w(b,this)},b.subtract=function(e,t){return this.add(-1*e,t)},b.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var o=e||"YYYY-MM-DDTHH:mm:ssZ",r=j.z(this),i=this.$H,a=this.$m,l=this.$M,s=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,r,i){return e&&(e[n]||e(t,o))||r[n].slice(0,i)},f=function(e){return j.s(i%12||12,e,"0")},h=u||function(e,t,n){var o=e<12?"AM":"PM";return n?o.toLowerCase():o};return o.replace(y,(function(e,o){return o||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return j.s(t.$y,4,"0");case"M":return l+1;case"MM":return j.s(l+1,2,"0");case"MMM":return d(n.monthsShort,l,c,3);case"MMMM":return d(c,l);case"D":return t.$D;case"DD":return j.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,s,2);case"ddd":return d(n.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(i);case"HH":return j.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return j.s(a,2,"0");case"s":return String(t.$s);case"ss":return j.s(t.$s,2,"0");case"SSS":return j.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(o,f,p){var h,y=this,m=j.p(f),b=_(o),g=(b.utcOffset()-this.utcOffset())*t,v=this-b,x=function(){return j.m(y,b)};switch(m){case d:h=x()/12;break;case c:h=x();break;case u:h=x()/3;break;case s:h=(v-g)/6048e5;break;case l:h=(v-g)/864e5;break;case a:h=v/n;break;case i:h=v/t;break;case r:h=v/e;break;default:h=v}return p?h:j.a(h)},b.daysInMonth=function(){return this.endOf(c).$D},b.$locale=function(){return x[this.$L]},b.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),o=A(e,t,!0);return o&&(n.$L=o),n},b.clone=function(){return j.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},m}(),C=O.prototype;return _.prototype=C,[["$ms",o],["$s",r],["$m",i],["$H",a],["$W",l],["$M",c],["$y",d],["$D",f]].forEach((function(e){C[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),_.extend=function(e,t){return e.$i||(e(t,O,_),e.$i=!0),_},_.locale=A,_.isDayjs=S,_.unix=function(e){return _(1e3*e)},_.en=x[v],_.Ls=x,_.p={},_}()),le.exports}var ce=ie(se()),ue="object"==typeof global&&global&&global.Object===Object&&global,de="object"==typeof self&&self&&self.Object===Object&&self,fe=ue||de||Function("return this")(),pe=fe.Symbol,he=Object.prototype,ye=he.hasOwnProperty,me=he.toString,be=pe?pe.toStringTag:void 0;var ge=Object.prototype.toString;var ve=pe?pe.toStringTag:void 0;function xe(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ve&&ve in Object(e)?function(e){var t=ye.call(e,be),n=e[be];try{e[be]=void 0;var o=!0}catch(e){}var r=me.call(e);return o&&(t?e[be]=n:delete e[be]),r}(e):function(e){return ge.call(e)}(e)}function we(e){return null!=e&&"object"==typeof e}var Se=Array.isArray;function Ae(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function _e(e){if(!Ae(e))return!1;var t=xe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var je,Oe=fe["__core-js_shared__"],Ce=(je=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+je:"";var Le=Function.prototype.toString;function Te(e){if(null!=e){try{return Le.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Ne=/^\[object .+?Constructor\]$/,$e=Function.prototype,ke=Object.prototype,De=$e.toString,Me=ke.hasOwnProperty,Ee=RegExp("^"+De.call(Me).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ie(e){return!(!Ae(e)||(t=e,Ce&&Ce in t))&&(_e(e)?Ee:Ne).test(Te(e));var t}function Ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ie(n)?n:void 0}var Fe=Ve(fe,"WeakMap"),ze=Object.create,Re=function(){function e(){}return function(t){if(!Ae(t))return{};if(ze)return ze(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Ue=function(){try{var e=Ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Pe=/^(?:0|[1-9]\d*)$/;function Ge(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Pe.test(e))&&e>-1&&e%1==0&&e<t}function Ye(e,t){return e===t||e!=e&&t!=t}var We=Object.prototype.hasOwnProperty;function He(e,t,n){var o=e[t];We.call(e,t)&&Ye(o,n)&&(void 0!==n||t in e)||function(e,t,n){"__proto__"==t&&Ue?Ue(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}(e,t,n)}function Be(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Ke=Object.prototype;function qe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ke)}function Qe(e){return we(e)&&"[object Arguments]"==xe(e)}var Je=Object.prototype,Xe=Je.hasOwnProperty,Ze=Je.propertyIsEnumerable,et=Qe(function(){return arguments}())?Qe:function(e){return we(e)&&Xe.call(e,"callee")&&!Ze.call(e,"callee")};var tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,nt=tt&&"object"==typeof module&&module&&!module.nodeType&&module,ot=nt&&nt.exports===tt?fe.Buffer:void 0,rt=(ot?ot.isBuffer:void 0)||function(){return!1},it={};function at(e){return function(t){return e(t)}}it["[object Float32Array]"]=it["[object Float64Array]"]=it["[object Int8Array]"]=it["[object Int16Array]"]=it["[object Int32Array]"]=it["[object Uint8Array]"]=it["[object Uint8ClampedArray]"]=it["[object Uint16Array]"]=it["[object Uint32Array]"]=!0,it["[object Arguments]"]=it["[object Array]"]=it["[object ArrayBuffer]"]=it["[object Boolean]"]=it["[object DataView]"]=it["[object Date]"]=it["[object Error]"]=it["[object Function]"]=it["[object Map]"]=it["[object Number]"]=it["[object Object]"]=it["[object RegExp]"]=it["[object Set]"]=it["[object String]"]=it["[object WeakMap]"]=!1;var lt="object"==typeof exports&&exports&&!exports.nodeType&&exports,st=lt&&"object"==typeof module&&module&&!module.nodeType&&module,ct=st&&st.exports===lt&&ue.process,ut=function(){try{var e=st&&st.require&&st.require("util").types;return e||ct&&ct.binding&&ct.binding("util")}catch(e){}}(),dt=ut&&ut.isTypedArray,ft=dt?at(dt):function(e){return we(e)&&Be(e.length)&&!!it[xe(e)]},pt=Object.prototype.hasOwnProperty;function ht(e,t){var n=Se(e),o=!n&&et(e),r=!n&&!o&&rt(e),i=!n&&!o&&!r&&ft(e),a=n||o||r||i,l=a?function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}(e.length,String):[],s=l.length;for(var c in e)!pt.call(e,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ge(c,s))||l.push(c);return l}function yt(e,t){return function(n){return e(t(n))}}var mt=yt(Object.keys,Object),bt=Object.prototype.hasOwnProperty;function gt(e){return null!=(t=e)&&Be(t.length)&&!_e(t)?ht(e):function(e){if(!qe(e))return mt(e);var t=[];for(var n in Object(e))bt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e);var t}var vt=Ve(Object,"create");var xt=Object.prototype.hasOwnProperty;var wt=Object.prototype.hasOwnProperty;function St(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function At(e,t){for(var n=e.length;n--;)if(Ye(e[n][0],t))return n;return-1}St.prototype.clear=function(){this.__data__=vt?vt(null):{},this.size=0},St.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},St.prototype.get=function(e){var t=this.__data__;if(vt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return xt.call(t,e)?t[e]:void 0},St.prototype.has=function(e){var t=this.__data__;return vt?void 0!==t[e]:wt.call(t,e)},St.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=vt&&void 0===t?"__lodash_hash_undefined__":t,this};var _t=Array.prototype.splice;function jt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}jt.prototype.clear=function(){this.__data__=[],this.size=0},jt.prototype.delete=function(e){var t=this.__data__,n=At(t,e);return!(n<0)&&(n==t.length-1?t.pop():_t.call(t,n,1),--this.size,!0)},jt.prototype.get=function(e){var t=this.__data__,n=At(t,e);return n<0?void 0:t[n][1]},jt.prototype.has=function(e){return At(this.__data__,e)>-1},jt.prototype.set=function(e,t){var n=this.__data__,o=At(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};var Ot=Ve(fe,"Map");function Ct(e,t){var n,o,r=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Lt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Lt.prototype.clear=function(){this.size=0,this.__data__={hash:new St,map:new(Ot||jt),string:new St}},Lt.prototype.delete=function(e){var t=Ct(this,e).delete(e);return this.size-=t?1:0,t},Lt.prototype.get=function(e){return Ct(this,e).get(e)},Lt.prototype.has=function(e){return Ct(this,e).has(e)},Lt.prototype.set=function(e,t){var n=Ct(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this};var Tt=yt(Object.getPrototypeOf,Object);function Nt(e){var t=this.__data__=new jt(e);this.size=t.size}Nt.prototype.clear=function(){this.__data__=new jt,this.size=0},Nt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Nt.prototype.get=function(e){return this.__data__.get(e)},Nt.prototype.has=function(e){return this.__data__.has(e)},Nt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof jt){var o=n.__data__;if(!Ot||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Lt(o)}return n.set(e,t),this.size=n.size,this};var $t=Object.prototype.propertyIsEnumerable,kt=Object.getOwnPropertySymbols,Dt=kt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,o=null==e?0:e.length,r=0,i=[];++n<o;){var a=e[n];t(a,n,e)&&(i[r++]=a)}return i}(kt(e),(function(t){return $t.call(e,t)})))}:function(){return[]};function Mt(e){return function(e,t,n){var o=t(e);return Se(e)?o:function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}(o,n(e))}(e,gt,Dt)}var Et=Ve(fe,"DataView"),It=Ve(fe,"Promise"),Vt=Ve(fe,"Set"),Ft="[object Map]",zt="[object Promise]",Rt="[object Set]",Ut="[object WeakMap]",Pt="[object DataView]",Gt=Te(Et),Yt=Te(Ot),Wt=Te(It),Ht=Te(Vt),Bt=Te(Fe),Kt=xe;(Et&&Kt(new Et(new ArrayBuffer(1)))!=Pt||Ot&&Kt(new Ot)!=Ft||It&&Kt(It.resolve())!=zt||Vt&&Kt(new Vt)!=Rt||Fe&&Kt(new Fe)!=Ut)&&(Kt=function(e){var t=xe(e),n="[object Object]"==t?e.constructor:void 0,o=n?Te(n):"";if(o)switch(o){case Gt:return Pt;case Yt:return Ft;case Wt:return zt;case Ht:return Rt;case Bt:return Ut}return t});var qt=Object.prototype.hasOwnProperty;var Qt=fe.Uint8Array;function Jt(e){var t=new e.constructor(e.byteLength);return new Qt(t).set(new Qt(e)),t}var Xt=/\w*$/;var Zt=pe?pe.prototype:void 0,en=Zt?Zt.valueOf:void 0;function tn(e,t,n){var o,r,i,a,l,s=e.constructor;switch(t){case"[object ArrayBuffer]":return Jt(e);case"[object Boolean]":case"[object Date]":return new s(+e);case"[object DataView]":return l=Jt((a=e).buffer),new a.constructor(l,a.byteOffset,a.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=Jt(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(e);case"[object RegExp]":return(i=new(r=e).constructor(r.source,Xt.exec(r))).lastIndex=r.lastIndex,i;case"[object Symbol]":return o=e,en?Object(en.call(o)):{}}}var nn=ut&&ut.isMap,on=nn?at(nn):function(e){return we(e)&&"[object Map]"==Kt(e)};var rn=ut&&ut.isSet,an=rn?at(rn):function(e){return we(e)&&"[object Set]"==Kt(e)},ln="[object Arguments]",sn="[object Function]",cn="[object Object]",un={};function dn(e,t,n,o,r,i){var a;if(void 0!==a)return a;if(!Ae(e))return e;var l=Se(e);if(l)a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&qt.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var s=Kt(e),c=s==sn||"[object GeneratorFunction]"==s;if(rt(e))return e.slice();if(s==cn||s==ln||c&&!r)a=c?{}:function(e){return"function"!=typeof e.constructor||qe(e)?{}:Re(Tt(e))}(e);else{if(!un[s])return r?e:{};a=tn(e,s)}}i||(i=new Nt);var u=i.get(e);if(u)return u;i.set(e,a),an(e)?e.forEach((function(o){a.add(dn(o,t,n,o,e,i))})):on(e)&&e.forEach((function(o,r){a.set(r,dn(o,t,n,r,e,i))}));var d=l?void 0:Mt(e);return function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o&&!1!==t(e[n],n,e););}(d||e,(function(o,r){d&&(o=e[r=o]),He(a,r,dn(o,t,n,r,e,i))})),a}un[ln]=un["[object Array]"]=un["[object ArrayBuffer]"]=un["[object DataView]"]=un["[object Boolean]"]=un["[object Date]"]=un["[object Float32Array]"]=un["[object Float64Array]"]=un["[object Int8Array]"]=un["[object Int16Array]"]=un["[object Int32Array]"]=un["[object Map]"]=un["[object Number]"]=un[cn]=un["[object RegExp]"]=un["[object Set]"]=un["[object String]"]=un["[object Symbol]"]=un["[object Uint8Array]"]=un["[object Uint8ClampedArray]"]=un["[object Uint16Array]"]=un["[object Uint32Array]"]=!0,un["[object Error]"]=un[sn]=un["[object WeakMap]"]=!1;function fn(e){return dn(e,5)}const pn=(e,t)=>{const n=Object.assign({dayjs:ce},t);let o="";const r=[];for(const e in n)o+=`${e},`,r.push(n[e]);o=o.replace(/,$/,"");const i=`function (${o}){return ${e}}`;let a;try{a=Function(`"use strict";return (${i})`)()(...r)}catch(t){return e}return a},hn=(e="",{textData:t,codeData:n}={},{useNewline:o=!1,useSpace:r=!1}={})=>{const i=window.config||{},a=Object.assign(Object.assign({},i),t),l=(e||"").match(/\{(.+?)\}/g);if(null==l||0===l.length)return e;for(let t=0;t<l.length;t++){const o=l[t];let r=o.slice(1,-1).trim();const i=/[\u4e00-\u9fa5a-z-_A-Z0-9]*/g,s=r.match(i);for(let e=0;e<s.length;e++){const t=s[e],n=a[t];null!=n&&"function"!=typeof n&&(r=r.replace(t,n))}(/\(.*\)/g.test(r)||/[+/\\*]/g.test(r))&&(r=pn(r,n)),e=e.replace(o,r)}return o&&(e=null==e?void 0:e.replace(/\n|\\n/g,"<br/>")),r&&(e=null==e?void 0:e.replace(/\s{2,}?/g,"&nbsp;&nbsp;")),e=e.replace(/Qfw\((.*?)\)/,((e,n)=>(null==t?void 0:t.Qfw)?null==t?void 0:t.Qfw(n):n))},yn=(e,t)=>{if("string"==typeof e&&"string"==typeof t)return e.toLocaleLowerCase().includes(t.toLocaleLowerCase());if("string"==typeof e&&Array.isArray(t)){const n=t.length;for(let o=0;o<n;o++){const n=t[o];if("string"==typeof n&&e.toLocaleLowerCase().includes(n.toLocaleLowerCase()))return!0}}return!1},mn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),bn=e=>{const t=[];for(const n of e)n.conditions?t.push(...bn(n.conditions)):"component"===(null==n?void 0:n.dataType)&&t.push(n);return t};function gn(e){let t="",n="",o="",r="";e.indexOf(".")>-1?(n=e.split(".")[0],o=e.split(".")[1]):n=e;let i=0,a=0;for(a=n.length-1;a>=0;)i%3==0&&0!==i?"-"===n[a]?t+=n[a]:t+=","+n[a]:t+=n[a],a--,i++;return t=t.split("").reverse().join(""),r=e.indexOf(".")>-1?t+"."+o:t,r}function vn(e){return t(this,arguments,void 0,(function*({graphicConfig:e,request:t,INDICATOR_URL:n="",PAGE_ID:o,dataSourceId:r}){var i;try{const{leftAxisList:a=[],rightAxisList:l=[],queryColumnList:s=[],indicators:c=[]}=_(e),u=[...a,...l,...s,...c],d={};for(const e of u){const{indexCode:t="",parentId:n=""}=e;!n||mn(e,"calcType")||d[n]||(d[n]=t)}if(null===(i=Object.keys(d))||void 0===i?void 0:i.length){const e=[];for(const i in d)e.push(new Promise(((e,a)=>{t.post(`${n}/diagram/hrpIndexWithComplex`,{pageId:o,indexGuid:i,indexCode:d[i],dataSourceId:r}).then((t=>{var n;const{success:o,data:r=[]}=t.data;o&&(null===(n=null==r?void 0:r.dataViewColumns)||void 0===n?void 0:n.length)?e(r.dataViewColumns):a(r)})).catch((e=>{console.error(e),a(e)}))})));const i=yield Promise.all(e);return i.reduce(((e,t)=>e.filter((e=>t.find((t=>t.typeGuid===e.typeGuid)))))).filter((e=>e.typeGuid))}}catch(e){console.error(e)}return[]}))}const xn=["table","bar","combograph","line","pie","radar","scatter","list","circulate"];let wn=new Map;const Sn=["keyValue","conditionKey","conditionLabel","conditionName","conditionValueType","customValue","id","keyName"],An=e=>wn.get(e),_n=(e,t)=>{if(t)mn(e,"indexCode")&&(e.hrpIndexCode=e.indexCode,delete e.indexCode),mn(e,"indexCodeNum")&&(e.hrpIndexCodeNum=e.indexCodeNum,delete e.indexCodeNum),mn(e,"dataType")&&delete e.dataType,e.fieldValue||delete e.fieldValue;else{const{calcWays:t=[],dateCalcTypes:n=[],activeKey:o,componentId:r=""}=e;if(5===o&&(null==t?void 0:t.length)&&(null==n?void 0:n.length)&&r){const o=t[0].split("-");(null==o?void 0:o.length)>1&&"rangeValue"===o[0]&&(e.calcWays=((e,t={})=>{const{around:n,unit:o,id:r}=e;let i="";const{pageMode:a="",componentList:l=[]}=(null==t?void 0:t.graphicConfig)||{};let s=null,c=null;if("design"===a){const e=null==l?void 0:l.find((e=>e.id===r));if(!e)return[];const{interval:t,intervalUnit:n,startTime:o,endTime:i,operate:a,useCurrentTime:u}=e||{};if(u&&(s=ce().subtract(t,n),c=ce()),o&&(s=ce(o)),i&&(c=ce(i)),a){const{type:e,value:t,mode:n}=a;switch(e){case"add":s=s?s.add(t,n):s,c=c?c.add(t,n):c;break;case"minus":s=s?s.subtract(t,n):s,c=c?c.subtract(t,n):c}}}else{const e=An(r)||{};_(e.startTime)&&(s=ce(_(e.startTime))),_(e.endTime)&&(c=ce(_(e.endTime)))}s&&c&&(i=`${"before"===n?"-":""}${c.diff(s,o.toLowerCase())+1}`);return i?[i]:[]})({around:o[1],unit:n[0],id:r})),delete e.radioValue}if(mn(e,"dataType")){if("DATE"===e.fieldType&&(e.label=e.fieldName),"component"===e.dataType)if("PARENT"===e.fieldValue){let t=e.modelKey;t&&e.prop&&(t+=`-${e.prop}`),e.fieldValue="${"+t+"}"}else e.fieldValue="${"+e.fieldValue+"}";delete e.dataType}mn(e,"activeKey")&&delete e.activeKey,mn(e,"radioValue")&&delete e.radioValue,mn(e,"indexCode")&&(e.hrpIndexCode=e.indexCode,delete e.indexCode),mn(e,"indexCodeNum")&&(e.hrpIndexCodeNum=e.indexCodeNum,delete e.indexCodeNum),"component"!==e.dataType&&e.useCurrentTime&&(e.fieldValue=ce().format(e.dateFormat)),mn(e,"modelKey")&&delete e.modelKey,mn(e,"prop")&&delete e.prop,delete e.useCurrentTime}},jn=(e,t)=>{const n=[];return(null==e?void 0:e.length)&&fn(e).forEach((e=>{if(e.join&&e.conditions){const o=!e.conditions.some((e=>e.join&&e.conditions));e.conditions.forEach(((r,i)=>{_n(r,t);const a={};if(i<e.conditions.length-1&&(a.join=e.join),o)n.push(Object.assign(Object.assign({},a),r));else if(r.join&&r.conditions){const e=t?"sqlConditions":"conditions";n.push(Object.assign({[e]:jn([r],t)},a))}else n.push(Object.assign(Object.assign({},a),r))}))}else _n(e,t),n.push(e)})),n},On=(e={},t)=>{if((null==e?void 0:e.sortCpnts)&&t){const n=kn(e);n&&(t.sort=n)}const{label:n,name:o,location:r,show:i,indexCode:a,indexCodeNum:l,calcType:s="COLUMN",builtInFormula:c,builtInValueSource:u,builtInCalcWay:d,formula:f,conditions:p,aggregate:h,distinct:y,dimByCount:m,dataTo:b}=e;let g;if(p&&(g=jn(p)),"COMPONENT"===s){const e={};return Nn(e,u),{label:n.trim(),columnName:o,show:i,calcType:s,componentAlias:d,componentValue:e.fieldValue||null}}const v={label:n.trim(),columnName:o,location:r,show:i,calcType:"1"===b?"VIEW":s,hrpIndexCode:a,hrpIndexCodeNum:l,aggregate:h,builtInFormula:c,builtInValueSource:u,formula:f,conditions:g};if("DATE_OFFSET"!==c)return"the_count"===o&&(v.calcType="AGGREGATE",v.distinct=!!y,v.typeGuid=m),Object.assign(Object.assign({},v),{builtInCalcWay:d});{const e=d.split("-");if(3===(null==e?void 0:e.length)){let t=e[0];return"before"===e[2]&&"0"!==e[0]&&(t=`-${e[0]}`),Object.assign(Object.assign({},v),{calcWays:[t],dateCalcTypes:[e[1]]})}}},Cn=e=>{if(!e)return[];const t=fn((null==e?void 0:e.controlList)||[]).filter((e=>"parentCode"!==e.conditionKey)),{classificationList:n=[],rowHeaderList:o=[],dimensionList:r=[],seriesList:i=[],leftAxisList:a=[],rightAxisList:l=[],queryColumnList:s=[],indexLibColumns:c=[],indicators:u=[]}=e;Tn(t);const d=[...n,...o,...r,...i,...a,...l,...s,...c,...u],f=[];for(const e of d){const t=bn((null==e?void 0:e.conditions)||[]);if(null==t?void 0:t.length){const e=t.filter((e=>"component"===(null==e?void 0:e.dataType))).map((e=>{const t={};return(null==e?void 0:e.dateFormat)&&(t.format=e.dateFormat),"PARENT"===e.fieldValue&&(t.id="PARENT",t.keyName=e.modelKey,t.modelKey=e.modelKey,t.prop=e.prop),Object.assign({conditionKey:e.fieldName,conditionLabel:e.fieldName,conditionName:e.fieldName,conditionValueType:e.fieldType,id:e.componentId,keyName:e.fieldValue,rule:e.rule,notGlobal:!0,indexCode:e.indexCode,typeGuid:e.typeGuid,indexCodeNum:e.indexCodeNum},t)}));if(null==e?void 0:e.length)for(const t of e)f.find((e=>e.keyName===t.keyName))||f.push(t)}}const p=f.length,h=t;for(let e=0;e<p;e++){const t=f[e];if("parentCode"===(null==t?void 0:t.conditionKey))continue;const{id:n,keyName:o,prop:r,format:i,modelKey:a,dataType:l="component",customValue:s}=t,c=Ln(t);Nn(c,n,{prop:r,dateFormat:i,modelKey:a,keyName:o}),""===l&&(c.fieldValue=s||""),h.push(c)}for(let e=h.length-1;e>=0;e--){const t=h[e];if(!t.globalCondition){bn(h).find((e=>e.alias===t.alias&&e.globalCondition))&&h.splice(e,1)}}return h};function Ln(e){const{id:t,keyName:n,conditionLabel:o,conditionKey:r,conditionValueType:i,prop:a,rule:l="NONE",notGlobal:s=!1,indexCode:c,typeGuid:u,indexCodeNum:d,dataType:f="component"}=e;let p=n||t;p&&a&&(p+=`-${a}`);let h=l;return"NONE"===h&&(h=["startTime","endTime"].includes(a)?"startTime"===a?"GREATER_EQUAL":"LESS_EQUAL":(null==n?void 0:n.includes("startTime"))?"GREATER_EQUAL"===a:(null==n?void 0:n.includes("endTime"))?"LESS_EQUAL"===a:"EQUAL"),"PARENT"===t&&(p=e.modelKey,p&&a&&(p+=`-${a}`),h=l),{rule:h,label:o,fieldName:r,fieldValue:"",valueType:i,alias:p,globalCondition:!s,indexCode:c,typeGuid:u,indexCodeNum:d,dataType:f}}function Tn(e){if(null==e?void 0:e.length)for(const t of e)if(null==t?void 0:t.conditions)Tn(t.conditions);else{const{id:e,keyName:n,prop:o,modelKey:r,format:i,dataType:a="component",customValue:l}=t,s=Ln(t);Nn(s,e,{prop:o,dateFormat:i,modelKey:r,keyName:n}),""===a&&(s.fieldValue=l||"");for(const e in s)t[e]=s[e];for(const e of Sn)delete t[e]}}function Nn(e,t,n){const{prop:o="",dateFormat:r="",modelKey:i="",keyName:a="",operateValue:l,operateMode:s,operateType:c}=n||{},u=i||a;if("PARENT"===t&&u&&o){const t=window.config.record;let n=o,i=r;const a=o.match(/\{(.+?)\}/g);if(null==a?void 0:a.length){const t=a[0].slice(1,-1).trim();n=o.replace(a[0],""),i=t,e.dateFormat=i}if(t&&t[u]){const o=_(t[u][n]);ce.isDayjs(o)?e.fieldValue=o.format(i||"YYYY-MM-DD"):e.fieldValue=o}return}const d=An(t)||{},{value:f,format:p="YYYY-MM-DD",type:h="",useCurrentTime:y,RECORD:m}=d||{},b=r||p;if(yn(h,"date")){let t;if(t=y?f?_(f):ce():_(f),"string"==typeof t&&(t=ce(t)),l&&s&&c)switch(c){case"add":t=t.add(l,s);break;case"minus":t=t.subtract(l,s)}e.fieldValue=null==t?void 0:t.format(b),e.dateFormat=b}else if(yn(h,"rangepicker")){let t=o;if(!o){const e=a&&a.split("-");(null==e?void 0:e.length)&&(t=e[e.length-1])}if(!t)return;let n=null;if(_(d[t])&&(n=ce(_(d[t]))),l&&s&&c)if("rangeValue"===l){if(d.startTime&&d.endTime){const e=_(d.endTime).diff(_(d.startTime),s)+1;switch(c){case"add":n=n?n.add(e,s):n;break;case"minus":n=n?n.subtract(e,s):n}}}else if(!isNaN(+l))switch(c){case"add":n=n?n.add(l,s):n;break;case"minus":n=n?n.subtract(l,s):n}if(n&&(e.fieldValue=null==n?void 0:n.format(b)),"rangeValue"===t&&d.startTime&&d.endTime){const t=function(e){const t=e.split("-");let n="";if(null==t?void 0:t.length)switch(t[t.length-1]){case"YYYY":n="year";break;case"MM":n="month";break;case"DD":n="day"}return n}(b);t&&(e.fieldValue=_(d.endTime).diff(_(d.startTime),t)+1)}e.dateFormat=b}else yn(h,xn)?e.fieldValue=i&&m?m[i]:!i&&m?m.value:_(f):yn(h,"select")&&Array.isArray(_(f))?e.fieldValue=_(f).join(","):e.fieldValue=_(f)}const $n=e=>{var t;if(e){const n=Array.isArray(e)?fn(e):[fn(e)];let o="",r=[];const i=[],a=[],l=[];for(const e of n){if(e.defaultCode&&(e.label=e.columnName,delete e.defaultCode),"CUSTOM"===e.type&&(r=e.customOrderColumns),o=e.type,i.push(e.label),null===(t=e.columnName)||void 0===t?void 0:t.includes("_ecanrepeat_")){const t=e.columnName.split("_ecanrepeat_");a.push(t[0])}else a.push(e.columnName);l.push(e.order)}return"CUSTOM"!==o&&(null==i?void 0:i.length)>1&&(o="COMBINATION"),"CUSTOM"===o?{label:i.join(","),columnName:a.join(","),type:o,customOrderColumns:r}:{label:i.join(","),columnName:a.join(","),order:l.join(","),type:o}}return e},kn=e=>{const{sortCpnts:t=[]}=e;let n,o="";for(const e of t){const t=An(e)||{},{type:n,RECORD:r}=t;if(yn(n,"image")&&yn(null==r?void 0:r.value,["asc","desc"])){o=r.value.toUpperCase();break}}return o&&(n={label:e.label,columnName:e.name,order:o,type:"NORMAL"}),n},Dn=(t,n={})=>{var o,r,i,a,l,s,c,u;const{graphicConfig:d,type:f,globalModel:p,isGroupTable:h=!1}=t;p&&(wn=p);const y=yn(f,"pivottable");let m,{source:b,dataViewId:g,plugin:v="1",layer:x,chartType:w,classificationList:S=[],rowHeaderList:A=[],dimensionList:_=[],seriesList:j=[],leftAxisList:O=[],rightAxisList:C=[],queryColumnList:L=[],indexLibColumns:T=[],indicators:N=[],controlList:$=[],formFields:k={},variableList:D=[],variableConditions:M=[],dataSourceId:E="",idxLibMode:I,preview:V=!1,edvDataSetId:F,compositeIndicator:z}=d||{},R=[];if("design"===(null==d?void 0:d.pageMode)?(R=(null!==(o=d.sqlConditions)&&void 0!==o?o:[]).map((e=>{const t={};if(mn(e,"globalCondition")||e.join||(t.globalCondition=!0),!e.join){const n=e.rule||"EQUAL";t.rule="NONE"===n?"EQUAL":n}return Object.assign(Object.assign({},e),t)})),(null==M?void 0:M.length)&&(R=R.concat(M))):(R=Cn(d),(null==D?void 0:D.length)&&(R=R.concat(function(e){const t=[];if(null==e?void 0:e.length)for(const n of e)if(n.variableName){const e={variateName:n.variableName,globalCondition:!1,valueType:n.variableType,alias:n.keyName||""};Nn(e,n.id,{dateFormat:n.format,prop:n.dateTypeValue,keyName:n.keyName,operateType:n.operateType,operateMode:n.operateMode,operateValue:n.operateValue}),""===n.dataType&&(e.fieldValue=n.variableValue),n.format&&(e.dateFormat=n.format),n.label&&(e.label=n.label),t.push(e)}return t}(D)))),null==R?void 0:R.length){const e=R.filter((e=>e.globalCondition)),t=R.filter((e=>!e.globalCondition));(null==e?void 0:e.length)>1&&(R=[{join:"&&",conditions:e},...t])}(null==R?void 0:R.length)&&(R=jn(R,"1")),null==x&&(x=yn(f,["table","card"])||yn(f,["list","circulate"])&&(null==S?void 0:S.length)>1?"1":yn(f,["select","checkbox","radio"])?"3":yn(f,["indexPanel"])?"4":"2"),yn(f,["indexPanel"])&&(v="3");const U=[];let P,G="";if(Array.isArray(S)&&S.length>0&&(!["ecanList","ecanCirculate"].includes(f)||1===(null==S?void 0:S.length))){const e=S.length;for(let t=0;t<e;t++){const n=S[t]||{},{label:o="",name:i="",show:a=!1,sort:l,customGroup:s,conditions:c,dateFormat:u,typeGuid:d="",truncations:p=[]}=n;if(a||1===e){G=d,m={label:o.trim(),columnName:i,show:a,sort:kn(n)||$n(l)||l,customGroup:s,conditions:jn(c),typeGuid:d},u&&(m.dateFormat=u),"the_date"!==i||m.dateFormat||(m.dateFormat="YYYY-MM-DD");const e={};if(Array.isArray(p)&&p.length>0){const t=p.length;for(let n=0;n<t;n++){const t=p[n]||{},{rule:o="",num:r=0,name:i=""}=t;o&&r&&(e.num=r,e.rule=o,i&&(e.otherGroupName=i))}}if((null===(r=Object.keys(e))||void 0===r?void 0:r.length)&&(m.truncation=e),!yn(f,["scatter","valueline"]))break;U.push(m)}}}if(Array.isArray(j)&&j.length>0){const e=j.length;for(let t=0;t<e;t++){const n=j[t]||{},{label:o="",name:r="",show:i=!1,sort:a,customGroup:l,conditions:s,typeGuid:c,dateFormat:u=""}=n;if(i||1===e){P={label:o.trim(),columnName:r,show:i,sort:$n(a),customGroup:l,conditions:jn(s),typeGuid:c},u?P.dateFormat=u:"the_date"===r&&(P.dateFormat="YYYY-MM-DD");break}}}const Y=[];null==O||O.forEach((e=>{e.location="LEFT",Y.push(On(e,m))})),null==C||C.forEach((e=>{e.location="RIGHT",Y.push(On(e,m))}));let W=N;(null==n?void 0:n.pivotTableCal)&&(W=(null===(i=n.pivotTableCal)||void 0===i?void 0:i.indicators)||[]),null==W||W.forEach((e=>{e.location="LEFT",Y.push(On(e,m))}));const H=[];["ecanList","ecanCirculate"].includes(f)&&(null==S?void 0:S.length)>1&&(L=S),(null==n?void 0:n.pivotTableCal)&&(L=(null===(a=n.pivotTableCal)||void 0===a?void 0:a.dimensions)||[]),null==L||L.forEach((e=>{const{label:t,name:o,location:r,show:i,indexCode:a,sort:l,typeGuid:s,indexCodeNum:c,dateFormat:u,conditions:d}=e;let f=$n(l);if(n.sort){const{field:o,order:r}=n.sort;let i=Y.find((e=>e.label===o));i||t!==o||(i=e),i&&(f={columnName:i.columnName,label:n.sort.field,order:r.toUpperCase(),type:"NORMAL"})}const p={label:t,columnName:o,location:r,show:i,sort:f,calcType:"COLUMN",hrpIndexCode:a,hrpIndexCodeNum:c,conditions:jn(d),typeGuid:s};u&&(p.dateFormat=u),"the_date"!==o||p.dateFormat||(p.dateFormat="YYYY-MM-DD"),H.push(p)}));const B=[];["ecanTable"].includes(f)&&d.isIndexSet&&T.forEach((e=>{const t={label:e.label,calcType:e.calcType,show:e.show};e.formula&&(t.formula=e.formula),B.push(t)}));let K=[],q=[];if(Array.isArray(A)&&A.length>0?q=A:Array.isArray(_)&&_.length>0&&(q=_),null==q?void 0:q.length){const e=q.length;for(let t=0;t<e;t++){const e=q[t]||{},{label:o="",name:r="",show:i=!1,sort:a,customGroup:s,conditions:c,truncations:u,typeGuid:d="",dateFormat:f}=e;let p=$n(a);if(n.sort){const{field:t,order:o}=n.sort;let r=Y.find((e=>e.label===t));r||e.label!==t||(r=e),r&&(p={columnName:r.columnName,label:n.sort.field,order:o.toUpperCase(),type:"NORMAL"})}const h={label:o.trim(),columnName:r,show:i,sort:p,customGroup:s,conditions:jn(c),typeGuid:d};f&&(h.dateFormat=f),"the_date"!==r||h.dateFormat||(h.dateFormat="YYYY-MM-DD");const y={};if(Array.isArray(u)&&u.length>0){const e=u.length;for(let t=0;t<e;t++){const e=u[t]||{},{rule:n="",num:o=0,name:r=""}=e;n&&o&&(y.num=o,y.rule=n,r&&(y.otherGroupName=r))}}(null===(l=Object.keys(y))||void 0===l?void 0:l.length)&&(h.truncation=y),K.push(h)}}let Q,J=[];const X=[];if(null==n?void 0:n.pivotTableCal){let t=[];const{calc:o=[],filter:r=[],truncations:i=[],sorts:a=[],aggregateMethod:l=[],rowDimensionKeys:u=[],colDimensionKeys:d=[]}=n.pivotTableCal;if(Y.push(...o),null==r?void 0:r.length){const n=function e(t){const n=[];for(const o of t)o.conditions?n.push(...e(o.conditions)):"the_date"===o.conditionKey&&n.push(o);return n}($);for(const o of r){const{type:r}=o,i=e(o,["type"]);"indicators"===r?t=Y:"dimension"===r&&(t=H);const a=t.find((e=>e.columnName===o.fieldName&&e.label===o.label));if(a)if("indicators"===r)a.filter={rule:i.rule,fieldValue:i.fieldValue};else if("dimension"===r){let e=!0;"the_date"===i.fieldName&&2===(null==n?void 0:n.length)&&(e=!1,X.push(i)),e&&(a.conditions||(a.conditions=[]),a.conditions.push(i))}}}if(null==i?void 0:i.length)for(const e of i){const t=H.find((t=>t.label===e.key));t&&(t.truncation={num:e.num,rule:e.rule})}if(null==a?void 0:a.length)for(const n of a){const{fieldType:o,columnData:r}=n,i=e(n,["fieldType","columnData"]);"indicators"===o?(t=Y,Q=r):"dimension"===o&&(t=H);const a=t.find((e=>e.label===i.label));a&&(a.sort=Object.assign(Object.assign({},i),{columnName:a.columnName}))}if(null===(s=Object.keys(l))||void 0===s?void 0:s.length)for(const e in l){const t=H.find((t=>t.label===e));t&&(null===(c=l[e])||void 0===c?void 0:c.length)&&(t.aggregateMethod=l[e])}K=[],J=[];for(const e of H)u.includes(e.columnName)?K.push(e):d.includes(e.columnName)&&J.push(e)}if(yn(f,["text","proportion","counter"])?w="zb":yn(f,["valueline"])?w="valueline":yn(f,["indexPanel"])&&(w="indexPanel"),h||"card"===f){if(0===K.length||0===Y.length)return;w="grouptable"}else{if("1"===x&&!H.length&&!B.length)return;if(["2","4"].includes(x)&&0===Y.length)return;if(!("3"!==x||(G||"EDV_DATA_SET"===b)&&k.labelField&&k.valueField))return;if("3"===x&&"ecanDataSelect"===f&&0===Y.length)return}let Z;if((null==_?void 0:_.length)&&(x="1",w="grouptable"),!yn(f,["scatter","valueline"])&&(null===(u=Object.keys(k))||void 0===u?void 0:u.length)){const e=bn($).find((e=>"parentCode"===e.conditionKey)),n={};if(e){const t=An(e.id)||{};if(!(null==t?void 0:t.itemCodes))return;n.parentItemCodes=t.itemCodes}"ecanDataSelect"===f&&(n.indicatorList=Y.filter((e=>e.show))),"EDV_DATA_SET"===b&&(n.edvDataSetId=F),m.sort&&(n.sort=m.sort),Z=Object.assign({url:"/diagram/formData",source:b,dataViewId:g,plugin:"4",layer:x,chartType:"normalSelect",rangeIndexTypeGuid:G,type:"ecanDataSelect"===f?"normalSelectData":"normalSelect",labelField:k.labelField,valueField:k.valueField,sqlConditions:R,idxLibMode:"WITH_DATE_DIM_TABLE",dataSourceId:E,keyName:t.keyName},n)}else{let e={};e=yn(f,["scatter","valueline"])?{classifications:U}:{classification:m},(null==B?void 0:B.length)&&(e.indexLibColumns=B,e.isIndexSet=!0),yn(f,"table")&&d.isIndexSet&&(e.compositeIndicator=z);const n=R.map((e=>{const{fieldValue:t}=e,n={};return t&&Array.isArray(t)&&(n.fieldValue=JSON.stringify(t)),Object.assign(Object.assign({},e),n)}));(null==X?void 0:X.length)&&function e(t){for(const n of t)if(n.sqlConditions)e(n.sqlConditions);else if("the_date"===n.fieldName){const e=X.find((e=>e.prop===n.prop));e&&(n.fieldValue=e.fieldValue)}}(n),Z=Object.assign({url:"/diagram",source:b,dataViewId:g,plugin:y?"5":v,layer:x,chartType:y?"pivot-table":w,series:P,indicatorList:Y,queryColumns:h?[]:H,pageFlag:!0,edvDataSetId:F||"",sqlConditions:n,idxLibMode:I,dataSourceId:E,preview:V,rowHeaders:K,keyName:t.keyName,columnData:Q,columnHeaders:J},e)}return Z},Mn=(e=[],t,n=!1)=>{let{name:o="name",types:r=[]}=t||{};o=(null==o?void 0:o.trim())||o;const i=new Set,a=new Map,l=e.length,s=r.length;if(1!==l||n)for(let t=0;t<l;t++){const n=e[t],l=n[o];i.add(l);for(let e=0;e<s;e++){const t=r[e],{label:o,value:i}=t,l=Object.assign(Object.assign({},n),{value:n[i]});if(a.has(o)){const e=a.get(o);e.push(l),a.set(o,e)}else a.set(o,[l])}}else{const t=[];for(let n=0;n<s;n++){const o=r[n],{label:a,value:l}=o,s=Object.assign(Object.assign({},e[0]),{value:e[0][l]});i.add(a),t.push(s)}const n=e[0][o]||"";a.set(n,t)}const c=Array.from(i),u=[];for(const[e,t]of a)u.push({name:e,data:t});return{dimensions:c,dataset:u}},En=(e,t)=>{let{name:n="name",value:o="value",type:r="type"}=t||{};n=null==n?void 0:n.trim(),o=null==o?void 0:o.trim(),r=null==r?void 0:r.trim();const i=new Map,a=e.length;for(let t=0;t<a;t++){const a=e[t],l=a[n]||"",s=a[o]||"",c=a[r]||"";if(i.has(c)){const e=i.get(c);e.push(Object.assign({name:l,value:s},a)),i.set(c,e)}else i.set(c,[Object.assign({name:l,value:s},a)])}const l=[],s=[];for(const[e,t]of i)if(s.push({name:e,data:t}),null==t?void 0:t.length)if(l.length)for(const e of t)l.includes(e.name)||l.push(e.name);else l.push(...t.map((e=>e.name)));return{dimensions:l,dataset:s}},In=(e,t)=>{var n;if(null==e)return t;const o=e.match(/\{.*\}/g);if(null==o||0===o.length)return t;const r=o.length;for(let i=0;i<r;i++){const r=o[i];if(null==r||""===r)break;let a=null===(n=r.slice(1,-1))||void 0===n?void 0:n.trim();a=null==a?void 0:a.replace(/value/g,t);try{let t=a;(/\(.*\)/g.test(a)||/[+/\\*]/g.test(a))&&(t=pn(a)),e=e.replace(r,t)}catch(t){e=e.replace(r,a)}}return e};function Vn(e){return e.isShowMarkLine?{markLine:{data:[{type:e.markLineType}]}}:{}}const Fn=(e,t,n)=>{const o=e.yAxisLabelFormatter,r=e.xAxisLabelFormatter,{dimensions:i=[],dataset:a=[]}=t,l=re((()=>{const{gradientShow:t,gradientColors:n,gradientOffset:o,barBorderRadius:r}=e,i=a,l=i.length,s=[];for(let a=0;a<l;a++){const l=Object.assign(Object.assign({},i[a]),{type:"bar",barWidth:e.barWidth,showBackground:e.showBarBackground}),{isStack:c,stackColumns:u}=e;if(c&&u.includes(i[a].name||!u)&&(l.stack="stack"),l.label={show:e.labelShow,fontSize:e.labelFontSize,position:e.labelPosition,color:e.labelColor,width:e.labelWidth,overflow:e.labelOverflow,formatter:t=>{let n="",o=e.labelFormatter;""===o&&(o="{c}");const{seriesName:r,name:i,value:a,data:l}=t||{};return n+=hn(o,{textData:Object.assign({name:i,value:a,a:r,b:i,c:a||0},l)},{useNewline:!0,useSpace:!0}),n}},l.itemStyle={},t&&(l.itemStyle={color:{x:e.isUseHorizontalAxis?1:0,y:0,x2:0,y2:e.isUseHorizontalAxis?0:1,colorStops:[{offset:0,color:e.colors[a]},{offset:o,color:n[a]},{offset:1,color:n[a]}]}}),r){const e=r.split(",");if(null==e?void 0:e.length){const t=[];for(const n of e){const e=parseFloat(n);isNaN(e)||t.push(e)}l.itemStyle.barBorderRadius=t}}e.isShowMarkLine&&(l.markLine={data:[{type:e.markLineType}]}),s.push(l)}return s})),s=re((()=>i.map((e=>{let t={};return t=e&&"object"==typeof e?Object.assign(Object.assign({},e),{textStyle:{fontSize:n}}):{value:e,textStyle:{fontSize:n}},t}))));return{tooltip:{trigger:"axis",show:e.tooltipShow,formatter:t=>{const n=t.length;let o="",i=e.tooltipFormatter;""===i&&(i="{marker} {a} {c}");for(let e=0;e<n;e++){const{marker:n,seriesName:a,name:l,value:s,data:c}=t[e]||{};if(0===e){let e=l;"string"!=typeof l||"0"!==l[0]||isNaN(+l)||(e=(+l).toString()),o+=`${In(r,e)}<br/>`}o+=hn(i,{textData:Object.assign({marker:n,name:l,value:s,Qfw:gn,a:a,b:l,c:s||0},c)},{useNewline:!0,useSpace:!0}),o+="<br/>"}return o},textStyle:{color:e.tooltipTextStyleColor,fontSize:n},position:e.tooltipPosition||void 0,backgroundColor:e.tooltipBackgroundColor||"#fff"},legend:{type:e.legendScroll?"scroll":"plain",width:e.legendWidth,height:e.legendHeight,show:e.legendShow,orient:e.legendOrient,top:e.legendTop,left:e.legendLeft,textStyle:{rich:{text:{width:e.legendTextWidth,color:e.legendTextStyleColor,fontSize:e.legendFontSize}}},itemHeight:e.legendItemHeight,itemWidth:e.legendItemWidth,itemGap:e.legendItemGap,data:a.map(((t,n)=>({name:t.name,itemStyle:{color:e.colors[n]},icon:e.legendType}))),formatter:t=>((e="",t)=>{var n;const o=e.match(/\{(.+?)\}/g),r=(null===(n=e.split("\n"))||void 0===n?void 0:n.length)-1;let i="";if(r)for(let e=0;e<r;e++)i+="\n";let a=e;if(null==o?void 0:o.length){for(const e of o){const n=hn(e,{textData:t},{useNewline:!1,useSpace:!1});n&&(a=a.replace(e,n))}return`${i}{text|${a}}`}return e})(e.legendFormatter,{name:t})},xAxis:{type:e.isUseHorizontalAxis?"value":"category",data:e.isUseHorizontalAxis?null:_(s),inverse:e.isUseHorizontalAxis?e.xAxisInverse:e.axisInverse,minInterval:e.xAxisMinInterval,splitLine:{show:e.xAxisSplitLineShow,lineStyle:{color:e.xAxisSplitLineStyleColor,type:e.xAxisSplitLineType},interval:e.xAxisSplitLineInterval},splitArea:{show:e.xAxisSplitAreaShow},axisLabel:{color:e.xAxisLabelColor,interval:e.xAxisLabelInterval||0,rotate:e.xAxisLabelRotate,width:e.xAxisLabelWidth,overflow:e.xAxisLabelOverflow,fontSize:e.xAxisLabelFontSize,formatter:e=>("string"!=typeof e||"0"!==e[0]||isNaN(+e)||(e=(+e).toString()),In(r,e))},axisLine:{show:e.xAxisLineShow,lineStyle:{color:e.xAxisLineStyleColor}},axisTick:{show:e.xAxisTickShow},name:e.xAxisName,nameTextStyle:{fontSize:e.xAxisLabelFontSize,color:e.xAxisLabelColor,align:"left"},max:e.xAxisMaxValue||null},yAxis:{type:e.isUseHorizontalAxis?"category":"value",data:e.isUseHorizontalAxis?_(i):null,inverse:e.isUseHorizontalAxis?e.axisInverse:e.yAxisInverse,minInterval:e.yAxisMinInterval,splitLine:{show:e.yAxisSplitLineShow,lineStyle:{color:e.yAxisSplitLineStyleColor,type:e.yAxisSplitLineType}},splitArea:{show:e.yAxisSplitAreaShow},axisLabel:{show:e.yAxisLabelShow,fontSize:e.yAxisLabelFontSize,color:e.yAxisLabelColor,rotate:e.yAxisLabelRotate,width:e.yAxisLabelWidth,overflow:e.yAxisLabelOverflow,formatter:e=>In(o,e)},axisLine:{show:e.yAxisLineAlwaysDisplay,lineStyle:{color:e.yAxisLineStyleColor}},name:e.yAxisName,nameTextStyle:{fontSize:e.yAxisLabelFontSize,color:e.yAxisLabelColor,align:"right"},max:e.yAxisMaxValue||null},series:_(l)}},zn=(e,t,n)=>{const o=e.yAxisLabelFormatter,r=e.xAxisLabelFormatter,{dimensions:i=[],dataset:a=[]}=t,l=re((()=>i.map((e=>{let t={};return t=e&&"object"==typeof e?Object.assign(Object.assign({},e),{textStyle:{fontSize:n}}):{value:e,textStyle:{fontSize:n}},t})))),s=re((()=>{const t=[],n=a.length;for(let o=0;o<n;o++){const n={};e.shadowColor&&(n.shadowColor=e.shadowColor,n.shadowBlur=e.shadowBlur,n.shadowOffsetY=e.shadowOffsetY,n.shadowOffsetX=e.shadowOffsetX),t.push(Object.assign(Object.assign(Object.assign({type:"line"},a[o]),{symbolSize:e.symbolSize,smooth:e.smooth,areaStyle:{color:e.areaGradientShow?{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:e.colors[o]},{offset:1,color:e.areaGradientColor||"transparent"}],global:!1}:e.colors[o],opacity:e.areaStyleOpacity},lineStyle:Object.assign({width:e.lineStyleWidth},n)}),Vn(e)))}return t}));return{tooltip:{trigger:"axis",show:e.tooltipShow,formatter:t=>{const n=t.length;let o="",r=e.tooltipFormatter;""===r&&(r="{marker} {a} {c}");for(let e=0;e<n;e++){const{marker:n,seriesName:i,name:a,value:l,data:s}=t[e]||{};0===e&&(o+=`${a}<br/>`),o+=hn(r,{textData:Object.assign({marker:n,name:a,value:l,a:i,b:a,c:l},s)},{useNewline:!0,useSpace:!0}),o+="<br/>"}return o},textStyle:{color:e.tooltipTextStyleColor,fontSize:n.value},position:e.tooltipPosition||void 0,backgroundColor:e.tooltipBackgroundColor||"#fff"},xAxis:{name:e.xAxisName,type:"category",data:_(l),minInterval:e.xAxisMinInterval,splitLine:{show:e.xAxisSplitLineShow,lineStyle:{color:e.xAxisSplitLineStyleColor}},axisLabel:{color:e.xAxisLabelColor,interval:e.xAxisLabelInterval||0,rotate:e.xAxisLabelRotate,width:e.xAxisLabelWidth,overflow:e.xAxisLabelOverflow,formatter:e=>In(r,e)},axisLine:{lineStyle:{color:e.xAxisLineStyleColor}},axisTick:{show:e.xAxisTickShow}},yAxis:{type:"value",name:e.yAxisName,minInterval:e.yAxisMinInterval,splitLine:{show:e.yAxisSplitLineShow,lineStyle:{color:e.yAxisSplitLineStyleColor}},axisLabel:{fontSize:n,color:e.yAxisLabelColor,formatter:e=>In(o,e)},axisLine:{show:e.yAxisLineAlwaysDisplay,lineStyle:{color:e.yAxisLineStyleColor}}},legend:{show:e.legendShow,orient:e.legendOrient,top:e.legendTop,left:e.legendLeft,textStyle:{fontSize:n}},series:_(s)}},Rn=(e,t,n)=>{const{dataset:o=[]}=t;let{data:r=[]}=o[0]||{};if(Array.isArray(e.colors)){const t=e.isUseLabelColors,n=e.colors;r=r.map(((e,o)=>Object.assign({label:t?{color:n[o]}:{}},e)))}return{title:{text:e.titleText,subtext:e.titleSubtext,textStyle:{fontSize:e.titleFontSize,fontWeight:e.fontWeight,color:e.titleColor},left:e.textAlign||"center"},tooltip:{show:e.tooltipShow,trigger:e.tooltipTrigger,formatter:t=>{const{marker:n,seriesName:o,name:r,value:i,percent:a,data:l}=t||{};return hn(e.tooltipFormatter,{textData:Object.assign({marker:n,name:r,value:i,percent:a,a:o,b:r,c:i,d:a},l)},{useNewline:!0,useSpace:!0})},textStyle:{color:e.tooltipTextStyleColor||"#333"},backgroundColor:e.tooltipBackgroundColor||"#fff",borderColor:e.tooltipBorderColor||"#eee"},legend:{show:e.legendShow,orient:e.legendOrient,top:e.legendTop,left:e.legendLeft,textStyle:{color:e.legendTextStyleColor,fontSize:18===n?n:e.labelFontSize}},series:[{data:r,type:"pie",radius:[e.innerRadius,e.outerRadius],center:[e.centerLeft,e.centerTop],roseType:e.roseType,avoidLabelOverlap:!1,minAngle:e.minAngle,label:{show:"center"!==e.labelPosition&&e.labelShow,color:e.labelColor,fontSize:18===n?n:e.labelFontSize,position:e.labelPosition,formatter:(i=e.labelFormatter,i.replace(/\\n/g,"\n"))},labelLine:{show:e.labelLineShow,length:e.labelLineLength,length2:e.labelLineLength2},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"},label:{}}}]};var i},Un=(e,t,n)=>{const{dimensions:o=[],dataset:r=[]}=t,i=re((()=>o.map((e=>{let t={};return t=e&&"object"==typeof e?Object.assign(Object.assign({},e),{textStyle:{fontSize:n}}):{value:e,textStyle:{fontSize:n}},t})))),a=re((()=>{const t=[],n=r.length,o=e.seriesTypes;for(let i=0;i<n;i++){const n=o[i],{type:a,axisIndex:l}=n||{};let s=Object.assign({type:a,yAxisIndex:l},r[i]);if("line"===a){const t={};e.shadowColor&&(t.shadowColor=e.shadowColor,t.shadowBlur=e.shadowBlur,t.shadowOffsetY=e.shadowOffsetY,t.shadowOffsetX=e.shadowOffsetX),s=Object.assign(Object.assign({},s),{symbolSize:e.symbolSize,smooth:e.smooth,itemStyle:{color:e.colors[i]},areaStyle:{color:e.areaGradientShow?{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:e.colors[i]},{offset:1,color:e.areaGradientColor||"transparent"}],global:!1}:e.colors[i],opacity:e.areaStyleOpacity},lineStyle:Object.assign({width:e.lineStyleWidth},t)})}if("bar"===a){const{gradientShow:t,gradientColors:n,gradientOffset:o}=e,r={};if(e.barBorderRadius){const t=e.barBorderRadius.split(",");if(null==t?void 0:t.length){const e=[];for(const n of t){const t=parseFloat(n);isNaN(t)||e.push(t)}r.borderRadius=e}}t&&(r.color={x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:e.colors[i]},{offset:o,color:n[i]},{offset:1,color:n[i]}]}),s=Object.assign(Object.assign({},s),{barWidth:e.barWidth,itemStyle:r})}e.isShowMarkLine&&(s.markLine={data:[{type:e.markLineType}]}),t.push(s)}return t})),l=re((()=>{const t=e.yAxis;return null==t?void 0:t.map(((t,o)=>({type:"value",minInterval:e.yAxisMinInterval,splitLine:{show:0===o?e.yAxisLeftSplitLineShow:e.yAxisRightSplitLineShow,lineStyle:{color:e.yAxisSplitLineStyleColor,type:0===o?e.yAxisLeftSplitLineType:e.yAxisRightSplitLineType}},splitArea:{show:e.yAxisSplitAreaShow},axisLabel:{fontSize:n,show:e.yAxisLabelShow,color:e.yAxisLabelColor,formatter:e=>In(t.axisLabelFormatter,e)},axisLine:{show:e.yAxisLineAlwaysDisplay,lineStyle:{color:e.yAxisLineStyleColor}},name:0===o?e.yAxisLeftName:e.yAxisRightName,nameTextStyle:{fontSize:e.yAxisLabelFontSize,color:e.yAxisLabelColor,align:0===o?"right":"left"},max:e.yAxisMaxValue||null})))}));return{legend:{show:e.legendShow,orient:e.legendOrient,top:e.legendTop,left:e.legendLeft,textStyle:{color:e.legendTextStyleColor,fontSize:n}},tooltip:{trigger:"axis",show:e.tooltipShow,formatter:t=>{const n=t.length;let o="",r=e.tooltipFormatter;""===r&&(r="{marker} {a} {c}");const i=e.seriesTypes;for(let e=0;e<n;e++){const n=i[e],{tooltipFormatter:a}=n||{},{marker:l,seriesName:s,name:c,value:u,data:d}=t[e]||{};0===e&&(o+=`${c}<br/>`),o+=hn(a||r,{textData:Object.assign({marker:l,name:c,value:u,seriesName:s,a:s,b:c,c:u},d)},{useNewline:!0,useSpace:!0}),o+="<br/>"}return o},textStyle:{color:e.tooltipTextStyleColor||"#333",fontSize:n},backgroundColor:e.tooltipBackgroundColor||"#fff",borderColor:e.tooltipBorderColor||"#eee"},xAxis:{name:e.xAxisName,minInterval:e.xAxisMinInterval,type:"category",data:_(i),splitLine:{show:e.xAxisSplitLineShow,lineStyle:{color:e.xAxisSplitLineStyleColor}},axisLabel:{color:e.xAxisLabelColor,interval:e.xAxisLabelInterval||0,rotate:e.xAxisLabelRotate,width:e.xAxisLabelWidth,overflow:e.xAxisLabelOverflow},axisLine:{lineStyle:{color:e.xAxisLineStyleColor}},axisTick:{show:e.xAxisTickShow}},yAxis:_(l),series:_(a)}},Pn=(e,t,n=12)=>Object.assign(Object.assign({},(e=>({title:{text:e.titleText,subtext:e.titleSubtext,textStyle:{fontSize:e.titleFontSize,fontWeight:e.fontWeight,color:e.titleColor},left:e.textAlign||"center"},grid:{top:e.gridTop,bottom:e.gridBottom,left:e.gridLeft,right:e.gridRight,containLabel:e.gridContainLabel},color:e.colors}))(e)),((e,t,n)=>{switch(e.type){case"bar":return Fn(e,t,n);case"line":return zn(e,t,n);case"pie":return Rn(e,t,n);case"comboGraph":return Un(e,t,n);default:return{}}})(e,t,n));export{Dn as formatIndicatorParams,vn as getIndicatorParams,mn as hasOwn,yn as lowerCaseIncludes,pn as runCode,Pn as transformProps,Mn as useTransformChartDataByAttrKey,En as useTransformChartDataByAttrValue,In as useValueFormatter,hn as useVariablesInText};
1
+ function e(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function t(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((o=o.apply(e,t||[])).next())}))}const n=()=>{},o=Object.assign,r=Array.isArray,i=e=>"function"==typeof e,a=e=>"symbol"==typeof e;let l;const s=()=>l||(l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});const c=e=>{const t=new Set(e);return t.w=0,t.n=0,t},u=e=>(e.w&p)>0,d=e=>(e.n&p)>0;let f=0,p=1;let h;class y{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,function(e,t){t&&t.active&&t.effects.push(e)}(this,n)}run(){if(!this.active)return this.fn();let e=h,t=b;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=h,h=this,b=!0,p=1<<++f,f<=30?(({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=p})(this):m(this),this.fn()}finally{f<=30&&(e=>{const{deps:t}=e;if(t.length){let n=0;for(let o=0;o<t.length;o++){const r=t[o];u(r)&&!d(r)?r.delete(e):t[n++]=r,r.w&=~p,r.n&=~p}t.length=n}})(this),p=1<<--f,h=this.parent,b=t,this.parent=void 0,this.deferStop&&this.stop()}}stop(){h===this?this.deferStop=!0:this.active&&(m(this),this.onStop&&this.onStop(),this.active=!1)}}function m(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let b=!0;const g=[];function v(e,t){let n=!1;f<=30?d(e)||(e.n|=p,n=!u(e)):n=!e.has(h),n&&(e.add(h),h.deps.push(e),"production"!==process.env.NODE_ENV&&h.onTrack&&h.onTrack(o({effect:h},t)))}function x(e,t){const n=r(e)?e:[...e];for(const e of n)e.computed&&w(e,t);for(const e of n)e.computed||w(e,t)}function w(e,t){(e!==h||e.allowRecurse)&&("production"!==process.env.NODE_ENV&&e.onTrigger&&e.onTrigger(o({effect:e},t)),e.scheduler?e.scheduler():e.run())}function S(e){const t=e&&e.__v_raw;return t?S(t):e}function A(e){return!(!e||!0!==e.__v_isRef)}function _(e){return A(e)?e.value:e}new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(a));class j{constructor(e,t,n,o){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new y(e,(()=>{this._dirty||(this._dirty=!0,function(e,t){const n=(e=S(e)).dep;n&&("production"!==process.env.NODE_ENV?x(n,{target:e,type:"set",key:"value",newValue:t}):x(n))}(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=S(this);var t;return t=e,b&&h&&(t=S(t),"production"!==process.env.NODE_ENV?v(t.dep||(t.dep=c()),{target:t,type:"get",key:"value"}):v(t.dep||(t.dep=c()))),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}const O=[];function C(e,...t){if("production"===process.env.NODE_ENV)return;g.push(b),b=!1;const n=O.length?O[O.length-1].component:null,o=n&&n.appContext.config.warnHandler,r=function(){let e=O[O.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const o=e.component&&e.component.parent;e=o&&o.vnode}return t}();if(o)$(o,n,11,[e+t.join(""),n&&n.proxy,r.map((({vnode:e})=>`at <${oe(n,e.type)}>`)).join("\n"),r]);else{const n=[`[Vue warn]: ${e}`,...t];r.length&&n.push("\n",...function(e){const t=[];return e.forEach(((e,n)=>{t.push(...0===n?[]:["\n"],...function({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",o=!!e.component&&null==e.component.parent,r=` at <${oe(e.component,e.type,o)}`,i=">"+n;return e.props?[r,...L(e.props),i]:[r+i]}(e))})),t}(r)),console.warn(...n)}!function(){const e=g.pop();b=void 0===e||e}()}function L(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach((n=>{t.push(...T(n,e[n]))})),n.length>3&&t.push(" ..."),t}function T(e,t,n){return"string"==typeof t?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):"number"==typeof t||"boolean"==typeof t||null==t?n?t:[`${e}=${t}`]:A(t)?(t=T(e,S(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):i(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=S(t),n?t:[`${e}=`,t])}const N={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 $(e,t,n,o){let r;try{r=o?e(...o):e()}catch(e){!function(e,t,n,o=!0){const r=t?t.vnode:null;if(t){let o=t.parent;const r=t.proxy,i="production"!==process.env.NODE_ENV?N[n]:n;for(;o;){const t=o.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,r,i))return;o=o.parent}const a=t.appContext.config.errorHandler;if(a)return void $(a,null,10,[e,r,i])}!function(e,t,n,o=!0){if("production"!==process.env.NODE_ENV){const i=N[t];if(n&&(r=n,O.push(r)),C("Unhandled error"+(i?` during execution of ${i}`:"")),n&&O.pop(),o)throw e;console.error(e)}else console.error(e);var r}(e,n,r,o)}(e,t,n)}return r}let k=!1,D=!1;const M=[];let E=0;const I=[];let V=null,F=0;const z=Promise.resolve();function R(e){M.length&&M.includes(e,k&&e.allowRecurse?E+1:E)||(null==e.id?M.push(e):M.splice(function(e){let t=E+1,n=M.length;for(;t<n;){const o=t+n>>>1,r=M[o],i=P(r);i<e||i===e&&r.pre?t=o+1:n=o}return t}(e.id),0,e),U())}function U(){k||D||(D=!0,z.then(Y))}const P=e=>null==e.id?1/0:e.id,G=(e,t)=>{const n=P(e)-P(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Y(e){D=!1,k=!0,"production"!==process.env.NODE_ENV&&(e=e||new Map),M.sort(G);const t="production"!==process.env.NODE_ENV?t=>W(e,t):n;try{for(E=0;E<M.length;E++){const e=M[E];if(e&&!1!==e.active){if("production"!==process.env.NODE_ENV&&t(e))continue;$(e,null,14)}}}finally{E=0,M.length=0,function(e){if(I.length){const t=[...new Set(I)];if(I.length=0,V)return void V.push(...t);for(V=t,"production"!==process.env.NODE_ENV&&(e=e||new Map),V.sort(((e,t)=>P(e)-P(t))),F=0;F<V.length;F++)"production"!==process.env.NODE_ENV&&W(e,V[F])||V[F]();V=null,F=0}}(e),k=!1,(M.length||I.length)&&Y(e)}}function W(e,t){if(e.has(t)){const n=e.get(t);if(n>100){const e=t.ownerInstance,n=e&&ne(e.type);return C(`Maximum recursive updates exceeded${n?` in component <${n}>`:""}. 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 H=new Set;"production"!==process.env.NODE_ENV&&(s().__VUE_HMR_RUNTIME__={createRecord:Q((function(e,t){if(B.has(e))return!1;return B.set(e,{initialDef:K(t),instances:new Set}),!0})),rerender:Q((function(e,t){const n=B.get(e);if(!n)return;n.initialDef.render=t,[...n.instances].forEach((e=>{t&&(e.render=t,K(e.type).render=t),e.renderCache=[],e.update()}))})),reload:Q((function(e,t){const n=B.get(e);if(!n)return;t=K(t),q(n.initialDef,t);const o=[...n.instances];for(const e of o){const o=K(e.type);H.has(o)||(o!==n.initialDef&&q(o,t),H.add(o)),e.appContext.propsCache.delete(e.type),e.appContext.emitsCache.delete(e.type),e.appContext.optionsCache.delete(e.type),e.ceReload?(H.add(o),e.ceReload(t.styles),H.delete(o)):e.parent?R(e.parent.update):e.appContext.reload?e.appContext.reload():"undefined"!=typeof window?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}i=()=>{for(const e of o)H.delete(K(e.type))},r(i)?I.push(...i):V&&V.includes(i,i.allowRecurse?F+1:F)||I.push(i),U();var i}))});const B=new Map;function K(e){return i(t=e)&&"__vccOpts"in t?e.__vccOpts:e;var t}function q(e,t){o(e,t);for(const n in e)"__file"===n||n in t||delete e[n]}function Q(e){return(t,n)=>{try{return e(t,n)}catch(e){console.error(e),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}const J={};let X;"production"!==process.env.NODE_ENV&&(J.ownKeys=e=>(C("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));let Z="__VUE_INSTANCE_SETTERS__";(X=s()[Z])||(X=s()[Z]=[]),X.push((e=>e));const ee=/(?:^|[-_])(\w)/g,te=e=>e.replace(ee,(e=>e.toUpperCase())).replace(/[-_]/g,"");function ne(e,t=!0){return i(e)?e.displayName||e.name:e.name||t&&e.__name}function oe(e,t,n=!1){let o=ne(t);if(!o&&t.__file){const e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(o=e[1])}if(!o&&e&&e.parent){const n=e=>{for(const n in e)if(e[n]===t)return n};o=n(e.components||e.parent.type.components)||n(e.appContext.components)}return o?te(o):n?"App":"Anonymous"}const re=(e,t)=>function(e,t,o=!1){let r,a;const l=i(e);return l?(r=e,a="production"!==process.env.NODE_ENV?()=>{console.warn("Write operation failed: computed value is readonly")}:n):(r=e.get,a=e.set),new j(r,a,l||!a,o)}(e,0,false);function ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ae,le={exports:{}};function se(){return ae||(ae=1,le.exports=function(){var e=1e3,t=6e4,n=36e5,o="millisecond",r="second",i="minute",a="hour",l="day",s="week",c="month",u="quarter",d="year",f="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},b=function(e,t,n){var o=String(e);return!o||o.length>=t?e:""+Array(t+1-o.length).join(n)+e},g={s:b,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),o=Math.floor(n/60),r=n%60;return(t<=0?"+":"-")+b(o,2,"0")+":"+b(r,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var o=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(o,c),i=n-r<0,a=t.clone().add(o+(i?-1:1),c);return+(-(o+(n-r)/(i?r-a:a-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:s,d:l,D:f,h:a,m:i,s:r,ms:o,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",x={};x[v]=m;var w="$isDayjsObject",S=function(e){return e instanceof O||!(!e||!e[w])},A=function e(t,n,o){var r;if(!t)return v;if("string"==typeof t){var i=t.toLowerCase();x[i]&&(r=i),n&&(x[i]=n,r=i);var a=t.split("-");if(!r&&a.length>1)return e(a[0])}else{var l=t.name;x[l]=t,r=l}return!o&&r&&(v=r),r||!o&&v},_=function(e,t){if(S(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new O(n)},j=g;j.l=A,j.i=S,j.w=function(e,t){return _(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var O=function(){function m(e){this.$L=A(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[w]=!0}var b=m.prototype;return b.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(j.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var o=t.match(h);if(o){var r=o[2]-1||0,i=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],r,o[3]||1,o[4]||0,o[5]||0,o[6]||0,i)):new Date(o[1],r,o[3]||1,o[4]||0,o[5]||0,o[6]||0,i)}}return new Date(t)}(e),this.init()},b.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},b.$utils=function(){return j},b.isValid=function(){return!(this.$d.toString()===p)},b.isSame=function(e,t){var n=_(e);return this.startOf(t)<=n&&n<=this.endOf(t)},b.isAfter=function(e,t){return _(e)<this.startOf(t)},b.isBefore=function(e,t){return this.endOf(t)<_(e)},b.$g=function(e,t,n){return j.u(e)?this[t]:this.set(n,e)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(e,t){var n=this,o=!!j.u(t)||t,u=j.p(e),p=function(e,t){var r=j.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return o?r:r.endOf(l)},h=function(e,t){return j.w(n.toDate()[e].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},y=this.$W,m=this.$M,b=this.$D,g="set"+(this.$u?"UTC":"");switch(u){case d:return o?p(1,0):p(31,11);case c:return o?p(1,m):p(0,m+1);case s:var v=this.$locale().weekStart||0,x=(y<v?y+7:y)-v;return p(o?b-x:b+(6-x),m);case l:case f:return h(g+"Hours",0);case a:return h(g+"Minutes",1);case i:return h(g+"Seconds",2);case r:return h(g+"Milliseconds",3);default:return this.clone()}},b.endOf=function(e){return this.startOf(e,!1)},b.$set=function(e,t){var n,s=j.p(e),u="set"+(this.$u?"UTC":""),p=(n={},n[l]=u+"Date",n[f]=u+"Date",n[c]=u+"Month",n[d]=u+"FullYear",n[a]=u+"Hours",n[i]=u+"Minutes",n[r]=u+"Seconds",n[o]=u+"Milliseconds",n)[s],h=s===l?this.$D+(t-this.$W):t;if(s===c||s===d){var y=this.clone().set(f,1);y.$d[p](h),y.init(),this.$d=y.set(f,Math.min(this.$D,y.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},b.set=function(e,t){return this.clone().$set(e,t)},b.get=function(e){return this[j.p(e)]()},b.add=function(o,u){var f,p=this;o=Number(o);var h=j.p(u),y=function(e){var t=_(p);return j.w(t.date(t.date()+Math.round(e*o)),p)};if(h===c)return this.set(c,this.$M+o);if(h===d)return this.set(d,this.$y+o);if(h===l)return y(1);if(h===s)return y(7);var m=(f={},f[i]=t,f[a]=n,f[r]=e,f)[h]||1,b=this.$d.getTime()+o*m;return j.w(b,this)},b.subtract=function(e,t){return this.add(-1*e,t)},b.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var o=e||"YYYY-MM-DDTHH:mm:ssZ",r=j.z(this),i=this.$H,a=this.$m,l=this.$M,s=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,r,i){return e&&(e[n]||e(t,o))||r[n].slice(0,i)},f=function(e){return j.s(i%12||12,e,"0")},h=u||function(e,t,n){var o=e<12?"AM":"PM";return n?o.toLowerCase():o};return o.replace(y,(function(e,o){return o||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return j.s(t.$y,4,"0");case"M":return l+1;case"MM":return j.s(l+1,2,"0");case"MMM":return d(n.monthsShort,l,c,3);case"MMMM":return d(c,l);case"D":return t.$D;case"DD":return j.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,s,2);case"ddd":return d(n.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(i);case"HH":return j.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return j.s(a,2,"0");case"s":return String(t.$s);case"ss":return j.s(t.$s,2,"0");case"SSS":return j.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(o,f,p){var h,y=this,m=j.p(f),b=_(o),g=(b.utcOffset()-this.utcOffset())*t,v=this-b,x=function(){return j.m(y,b)};switch(m){case d:h=x()/12;break;case c:h=x();break;case u:h=x()/3;break;case s:h=(v-g)/6048e5;break;case l:h=(v-g)/864e5;break;case a:h=v/n;break;case i:h=v/t;break;case r:h=v/e;break;default:h=v}return p?h:j.a(h)},b.daysInMonth=function(){return this.endOf(c).$D},b.$locale=function(){return x[this.$L]},b.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),o=A(e,t,!0);return o&&(n.$L=o),n},b.clone=function(){return j.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},m}(),C=O.prototype;return _.prototype=C,[["$ms",o],["$s",r],["$m",i],["$H",a],["$W",l],["$M",c],["$y",d],["$D",f]].forEach((function(e){C[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),_.extend=function(e,t){return e.$i||(e(t,O,_),e.$i=!0),_},_.locale=A,_.isDayjs=S,_.unix=function(e){return _(1e3*e)},_.en=x[v],_.Ls=x,_.p={},_}()),le.exports}var ce=ie(se()),ue="object"==typeof global&&global&&global.Object===Object&&global,de="object"==typeof self&&self&&self.Object===Object&&self,fe=ue||de||Function("return this")(),pe=fe.Symbol,he=Object.prototype,ye=he.hasOwnProperty,me=he.toString,be=pe?pe.toStringTag:void 0;var ge=Object.prototype.toString;var ve=pe?pe.toStringTag:void 0;function xe(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ve&&ve in Object(e)?function(e){var t=ye.call(e,be),n=e[be];try{e[be]=void 0;var o=!0}catch(e){}var r=me.call(e);return o&&(t?e[be]=n:delete e[be]),r}(e):function(e){return ge.call(e)}(e)}function we(e){return null!=e&&"object"==typeof e}var Se=Array.isArray;function Ae(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function _e(e){if(!Ae(e))return!1;var t=xe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var je,Oe=fe["__core-js_shared__"],Ce=(je=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+je:"";var Le=Function.prototype.toString;function Te(e){if(null!=e){try{return Le.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Ne=/^\[object .+?Constructor\]$/,$e=Function.prototype,ke=Object.prototype,De=$e.toString,Me=ke.hasOwnProperty,Ee=RegExp("^"+De.call(Me).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ie(e){return!(!Ae(e)||(t=e,Ce&&Ce in t))&&(_e(e)?Ee:Ne).test(Te(e));var t}function Ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ie(n)?n:void 0}var Fe=Ve(fe,"WeakMap"),ze=Object.create,Re=function(){function e(){}return function(t){if(!Ae(t))return{};if(ze)return ze(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Ue=function(){try{var e=Ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Pe=/^(?:0|[1-9]\d*)$/;function Ge(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Pe.test(e))&&e>-1&&e%1==0&&e<t}function Ye(e,t){return e===t||e!=e&&t!=t}var We=Object.prototype.hasOwnProperty;function He(e,t,n){var o=e[t];We.call(e,t)&&Ye(o,n)&&(void 0!==n||t in e)||function(e,t,n){"__proto__"==t&&Ue?Ue(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}(e,t,n)}function Be(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Ke=Object.prototype;function qe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ke)}function Qe(e){return we(e)&&"[object Arguments]"==xe(e)}var Je=Object.prototype,Xe=Je.hasOwnProperty,Ze=Je.propertyIsEnumerable,et=Qe(function(){return arguments}())?Qe:function(e){return we(e)&&Xe.call(e,"callee")&&!Ze.call(e,"callee")};var tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,nt=tt&&"object"==typeof module&&module&&!module.nodeType&&module,ot=nt&&nt.exports===tt?fe.Buffer:void 0,rt=(ot?ot.isBuffer:void 0)||function(){return!1},it={};function at(e){return function(t){return e(t)}}it["[object Float32Array]"]=it["[object Float64Array]"]=it["[object Int8Array]"]=it["[object Int16Array]"]=it["[object Int32Array]"]=it["[object Uint8Array]"]=it["[object Uint8ClampedArray]"]=it["[object Uint16Array]"]=it["[object Uint32Array]"]=!0,it["[object Arguments]"]=it["[object Array]"]=it["[object ArrayBuffer]"]=it["[object Boolean]"]=it["[object DataView]"]=it["[object Date]"]=it["[object Error]"]=it["[object Function]"]=it["[object Map]"]=it["[object Number]"]=it["[object Object]"]=it["[object RegExp]"]=it["[object Set]"]=it["[object String]"]=it["[object WeakMap]"]=!1;var lt="object"==typeof exports&&exports&&!exports.nodeType&&exports,st=lt&&"object"==typeof module&&module&&!module.nodeType&&module,ct=st&&st.exports===lt&&ue.process,ut=function(){try{var e=st&&st.require&&st.require("util").types;return e||ct&&ct.binding&&ct.binding("util")}catch(e){}}(),dt=ut&&ut.isTypedArray,ft=dt?at(dt):function(e){return we(e)&&Be(e.length)&&!!it[xe(e)]},pt=Object.prototype.hasOwnProperty;function ht(e,t){var n=Se(e),o=!n&&et(e),r=!n&&!o&&rt(e),i=!n&&!o&&!r&&ft(e),a=n||o||r||i,l=a?function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}(e.length,String):[],s=l.length;for(var c in e)!pt.call(e,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ge(c,s))||l.push(c);return l}function yt(e,t){return function(n){return e(t(n))}}var mt=yt(Object.keys,Object),bt=Object.prototype.hasOwnProperty;function gt(e){return null!=(t=e)&&Be(t.length)&&!_e(t)?ht(e):function(e){if(!qe(e))return mt(e);var t=[];for(var n in Object(e))bt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e);var t}var vt=Ve(Object,"create");var xt=Object.prototype.hasOwnProperty;var wt=Object.prototype.hasOwnProperty;function St(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function At(e,t){for(var n=e.length;n--;)if(Ye(e[n][0],t))return n;return-1}St.prototype.clear=function(){this.__data__=vt?vt(null):{},this.size=0},St.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},St.prototype.get=function(e){var t=this.__data__;if(vt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return xt.call(t,e)?t[e]:void 0},St.prototype.has=function(e){var t=this.__data__;return vt?void 0!==t[e]:wt.call(t,e)},St.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=vt&&void 0===t?"__lodash_hash_undefined__":t,this};var _t=Array.prototype.splice;function jt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}jt.prototype.clear=function(){this.__data__=[],this.size=0},jt.prototype.delete=function(e){var t=this.__data__,n=At(t,e);return!(n<0)&&(n==t.length-1?t.pop():_t.call(t,n,1),--this.size,!0)},jt.prototype.get=function(e){var t=this.__data__,n=At(t,e);return n<0?void 0:t[n][1]},jt.prototype.has=function(e){return At(this.__data__,e)>-1},jt.prototype.set=function(e,t){var n=this.__data__,o=At(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};var Ot=Ve(fe,"Map");function Ct(e,t){var n,o,r=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Lt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Lt.prototype.clear=function(){this.size=0,this.__data__={hash:new St,map:new(Ot||jt),string:new St}},Lt.prototype.delete=function(e){var t=Ct(this,e).delete(e);return this.size-=t?1:0,t},Lt.prototype.get=function(e){return Ct(this,e).get(e)},Lt.prototype.has=function(e){return Ct(this,e).has(e)},Lt.prototype.set=function(e,t){var n=Ct(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this};var Tt=yt(Object.getPrototypeOf,Object);function Nt(e){var t=this.__data__=new jt(e);this.size=t.size}Nt.prototype.clear=function(){this.__data__=new jt,this.size=0},Nt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Nt.prototype.get=function(e){return this.__data__.get(e)},Nt.prototype.has=function(e){return this.__data__.has(e)},Nt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof jt){var o=n.__data__;if(!Ot||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Lt(o)}return n.set(e,t),this.size=n.size,this};var $t=Object.prototype.propertyIsEnumerable,kt=Object.getOwnPropertySymbols,Dt=kt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,o=null==e?0:e.length,r=0,i=[];++n<o;){var a=e[n];t(a,n,e)&&(i[r++]=a)}return i}(kt(e),(function(t){return $t.call(e,t)})))}:function(){return[]};function Mt(e){return function(e,t,n){var o=t(e);return Se(e)?o:function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}(o,n(e))}(e,gt,Dt)}var Et=Ve(fe,"DataView"),It=Ve(fe,"Promise"),Vt=Ve(fe,"Set"),Ft="[object Map]",zt="[object Promise]",Rt="[object Set]",Ut="[object WeakMap]",Pt="[object DataView]",Gt=Te(Et),Yt=Te(Ot),Wt=Te(It),Ht=Te(Vt),Bt=Te(Fe),Kt=xe;(Et&&Kt(new Et(new ArrayBuffer(1)))!=Pt||Ot&&Kt(new Ot)!=Ft||It&&Kt(It.resolve())!=zt||Vt&&Kt(new Vt)!=Rt||Fe&&Kt(new Fe)!=Ut)&&(Kt=function(e){var t=xe(e),n="[object Object]"==t?e.constructor:void 0,o=n?Te(n):"";if(o)switch(o){case Gt:return Pt;case Yt:return Ft;case Wt:return zt;case Ht:return Rt;case Bt:return Ut}return t});var qt=Object.prototype.hasOwnProperty;var Qt=fe.Uint8Array;function Jt(e){var t=new e.constructor(e.byteLength);return new Qt(t).set(new Qt(e)),t}var Xt=/\w*$/;var Zt=pe?pe.prototype:void 0,en=Zt?Zt.valueOf:void 0;function tn(e,t,n){var o,r,i,a,l,s=e.constructor;switch(t){case"[object ArrayBuffer]":return Jt(e);case"[object Boolean]":case"[object Date]":return new s(+e);case"[object DataView]":return l=Jt((a=e).buffer),new a.constructor(l,a.byteOffset,a.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=Jt(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(e);case"[object RegExp]":return(i=new(r=e).constructor(r.source,Xt.exec(r))).lastIndex=r.lastIndex,i;case"[object Symbol]":return o=e,en?Object(en.call(o)):{}}}var nn=ut&&ut.isMap,on=nn?at(nn):function(e){return we(e)&&"[object Map]"==Kt(e)};var rn=ut&&ut.isSet,an=rn?at(rn):function(e){return we(e)&&"[object Set]"==Kt(e)},ln="[object Arguments]",sn="[object Function]",cn="[object Object]",un={};function dn(e,t,n,o,r,i){var a;if(void 0!==a)return a;if(!Ae(e))return e;var l=Se(e);if(l)a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&qt.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var s=Kt(e),c=s==sn||"[object GeneratorFunction]"==s;if(rt(e))return e.slice();if(s==cn||s==ln||c&&!r)a=c?{}:function(e){return"function"!=typeof e.constructor||qe(e)?{}:Re(Tt(e))}(e);else{if(!un[s])return r?e:{};a=tn(e,s)}}i||(i=new Nt);var u=i.get(e);if(u)return u;i.set(e,a),an(e)?e.forEach((function(o){a.add(dn(o,t,n,o,e,i))})):on(e)&&e.forEach((function(o,r){a.set(r,dn(o,t,n,r,e,i))}));var d=l?void 0:Mt(e);return function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o&&!1!==t(e[n],n,e););}(d||e,(function(o,r){d&&(o=e[r=o]),He(a,r,dn(o,t,n,r,e,i))})),a}un[ln]=un["[object Array]"]=un["[object ArrayBuffer]"]=un["[object DataView]"]=un["[object Boolean]"]=un["[object Date]"]=un["[object Float32Array]"]=un["[object Float64Array]"]=un["[object Int8Array]"]=un["[object Int16Array]"]=un["[object Int32Array]"]=un["[object Map]"]=un["[object Number]"]=un[cn]=un["[object RegExp]"]=un["[object Set]"]=un["[object String]"]=un["[object Symbol]"]=un["[object Uint8Array]"]=un["[object Uint8ClampedArray]"]=un["[object Uint16Array]"]=un["[object Uint32Array]"]=!0,un["[object Error]"]=un[sn]=un["[object WeakMap]"]=!1;function fn(e){return dn(e,5)}const pn=(e,t)=>{const n=Object.assign({dayjs:ce},t);let o="";const r=[];for(const e in n)o+=`${e},`,r.push(n[e]);o=o.replace(/,$/,"");const i=`function (${o}){return ${e}}`;let a;try{a=Function(`"use strict";return (${i})`)()(...r)}catch(t){return e}return a},hn=(e="",{textData:t,codeData:n}={},{useNewline:o=!1,useSpace:r=!1}={})=>{const i=window.config||{},a=Object.assign(Object.assign({},i),t),l=String(e||"").match(/\{(.+?)\}/g);if(null==l||0===l.length)return e;for(let t=0;t<l.length;t++){const o=l[t];let r=o.slice(1,-1).trim();const i=/[\u4e00-\u9fa5a-z-_A-Z0-9]*/g,s=r.match(i);for(let e=0;e<s.length;e++){const t=s[e],n=a[t];null!=n&&"function"!=typeof n&&(r=r.replace(t,n))}(/\(.*\)/g.test(r)||/[+/\\*]/g.test(r))&&(r=pn(r,n)),e=e.replace(o,r)}return o&&(e=null==e?void 0:e.replace(/\n|\\n/g,"<br/>")),r&&(e=null==e?void 0:e.replace(/\s{2,}?/g,"&nbsp;&nbsp;")),e=e.replace(/Qfw\((.*?)\)/,((e,n)=>(null==t?void 0:t.Qfw)?null==t?void 0:t.Qfw(n):n))},yn=(e,t)=>{if("string"==typeof e&&"string"==typeof t)return e.toLocaleLowerCase().includes(t.toLocaleLowerCase());if("string"==typeof e&&Array.isArray(t)){const n=t.length;for(let o=0;o<n;o++){const n=t[o];if("string"==typeof n&&e.toLocaleLowerCase().includes(n.toLocaleLowerCase()))return!0}}return!1},mn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),bn=e=>{const t=[];for(const n of e)n.conditions?t.push(...bn(n.conditions)):"component"===(null==n?void 0:n.dataType)&&t.push(n);return t};function gn(e){let t="",n="",o="",r="";e.indexOf(".")>-1?(n=e.split(".")[0],o=e.split(".")[1]):n=e;let i=0,a=0;for(a=n.length-1;a>=0;)i%3==0&&0!==i?"-"===n[a]?t+=n[a]:t+=","+n[a]:t+=n[a],a--,i++;return t=t.split("").reverse().join(""),r=e.indexOf(".")>-1?t+"."+o:t,r}function vn(e){return t(this,arguments,void 0,(function*({graphicConfig:e,request:t,INDICATOR_URL:n="",PAGE_ID:o,dataSourceId:r}){var i;try{const{leftAxisList:a=[],rightAxisList:l=[],queryColumnList:s=[],indicators:c=[]}=_(e),u=[...a,...l,...s,...c],d={};for(const e of u){const{indexCode:t="",parentId:n=""}=e;!n||mn(e,"calcType")||d[n]||(d[n]=t)}if(null===(i=Object.keys(d))||void 0===i?void 0:i.length){const e=[];for(const i in d)e.push(new Promise(((e,a)=>{t.post(`${n}/diagram/hrpIndexWithComplex`,{pageId:o,indexGuid:i,indexCode:d[i],dataSourceId:r}).then((t=>{var n;const{success:o,data:r=[]}=t.data;o&&(null===(n=null==r?void 0:r.dataViewColumns)||void 0===n?void 0:n.length)?e(r.dataViewColumns):a(r)})).catch((e=>{console.error(e),a(e)}))})));const i=yield Promise.all(e);return i.reduce(((e,t)=>e.filter((e=>t.find((t=>t.typeGuid===e.typeGuid)))))).filter((e=>e.typeGuid))}}catch(e){console.error(e)}return[]}))}const xn=["table","bar","combograph","line","pie","radar","scatter","list","circulate"];let wn=new Map;const Sn=["keyValue","conditionKey","conditionLabel","conditionName","conditionValueType","customValue","id","keyName"],An=e=>wn.get(e),_n=(e,t)=>{if(t)mn(e,"indexCode")&&(e.hrpIndexCode=e.indexCode,delete e.indexCode),mn(e,"indexCodeNum")&&(e.hrpIndexCodeNum=e.indexCodeNum,delete e.indexCodeNum),mn(e,"dataType")&&delete e.dataType,e.fieldValue||delete e.fieldValue;else{const{calcWays:t=[],dateCalcTypes:n=[],activeKey:o,componentId:r=""}=e;if(5===o&&(null==t?void 0:t.length)&&(null==n?void 0:n.length)&&r){const o=t[0].split("-");(null==o?void 0:o.length)>1&&"rangeValue"===o[0]&&(e.calcWays=((e,t={})=>{const{around:n,unit:o,id:r}=e;let i="";const{pageMode:a="",componentList:l=[]}=(null==t?void 0:t.graphicConfig)||{};let s=null,c=null;if("design"===a){const e=null==l?void 0:l.find((e=>e.id===r));if(!e)return[];const{interval:t,intervalUnit:n,startTime:o,endTime:i,operate:a,useCurrentTime:u}=e||{};if(u&&(s=ce().subtract(t,n),c=ce()),o&&(s=ce(o)),i&&(c=ce(i)),a){const{type:e,value:t,mode:n}=a;switch(e){case"add":s=s?s.add(t,n):s,c=c?c.add(t,n):c;break;case"minus":s=s?s.subtract(t,n):s,c=c?c.subtract(t,n):c}}}else{const e=An(r)||{};_(e.startTime)&&(s=ce(_(e.startTime))),_(e.endTime)&&(c=ce(_(e.endTime)))}s&&c&&(i=`${"before"===n?"-":""}${c.diff(s,o.toLowerCase())+1}`);return i?[i]:[]})({around:o[1],unit:n[0],id:r})),delete e.radioValue}if(mn(e,"dataType")){if("DATE"===e.fieldType&&(e.label=e.fieldName),"component"===e.dataType)if("PARENT"===e.fieldValue){let t=e.modelKey;t&&e.prop&&(t+=`-${e.prop}`),e.fieldValue="${"+t+"}"}else e.fieldValue="${"+e.fieldValue+"}";delete e.dataType}mn(e,"activeKey")&&delete e.activeKey,mn(e,"radioValue")&&delete e.radioValue,mn(e,"indexCode")&&(e.hrpIndexCode=e.indexCode,delete e.indexCode),mn(e,"indexCodeNum")&&(e.hrpIndexCodeNum=e.indexCodeNum,delete e.indexCodeNum),"component"!==e.dataType&&e.useCurrentTime&&(e.fieldValue=ce().format(e.dateFormat)),mn(e,"modelKey")&&delete e.modelKey,mn(e,"prop")&&delete e.prop,delete e.useCurrentTime}},jn=(e,t)=>{const n=[];return(null==e?void 0:e.length)&&fn(e).forEach((e=>{if(e.join&&e.conditions){const o=!e.conditions.some((e=>e.join&&e.conditions));e.conditions.forEach(((r,i)=>{_n(r,t);const a={};if(i<e.conditions.length-1&&(a.join=e.join),o)n.push(Object.assign(Object.assign({},a),r));else if(r.join&&r.conditions){const e=t?"sqlConditions":"conditions";n.push(Object.assign({[e]:jn([r],t)},a))}else n.push(Object.assign(Object.assign({},a),r))}))}else _n(e,t),n.push(e)})),n},On=(e={},t)=>{if((null==e?void 0:e.sortCpnts)&&t){const n=kn(e);n&&(t.sort=n)}const{label:n,name:o,location:r,show:i,indexCode:a,indexCodeNum:l,calcType:s="COLUMN",builtInFormula:c,builtInValueSource:u,builtInCalcWay:d,formula:f,conditions:p,aggregate:h,distinct:y,dimByCount:m,dataTo:b,sort:g}=e;let v;if(p&&(v=jn(p)),"COMPONENT"===s){const e={};return Nn(e,u),{label:n.trim(),columnName:o,show:i,calcType:s,componentAlias:d,componentValue:e.fieldValue||null}}const x={label:n.trim(),columnName:o,location:r,show:i,calcType:"1"===b?"VIEW":s,hrpIndexCode:a,hrpIndexCodeNum:l,aggregate:h,builtInFormula:c,builtInValueSource:u,formula:f,conditions:v};if(g&&(x.sort={columnName:o,label:x.label,order:g,type:"NORMAL"}),"DATE_OFFSET"!==c)return"the_count"===o&&(x.calcType="AGGREGATE",x.distinct=!!y,x.typeGuid=m),Object.assign(Object.assign({},x),{builtInCalcWay:d});{const e=d.split("-");if(3===(null==e?void 0:e.length)){let t=e[0];return"before"===e[2]&&"0"!==e[0]&&(t=`-${e[0]}`),Object.assign(Object.assign({},x),{calcWays:[t],dateCalcTypes:[e[1]]})}}},Cn=e=>{if(!e)return[];const t=fn((null==e?void 0:e.controlList)||[]).filter((e=>"parentCode"!==e.conditionKey)),{classificationList:n=[],rowHeaderList:o=[],dimensionList:r=[],seriesList:i=[],leftAxisList:a=[],rightAxisList:l=[],queryColumnList:s=[],indexLibColumns:c=[],indicators:u=[]}=e;Tn(t);const d=[...n,...o,...r,...i,...a,...l,...s,...c,...u],f=[];for(const e of d){const t=bn((null==e?void 0:e.conditions)||[]);if(null==t?void 0:t.length){const e=t.filter((e=>"component"===(null==e?void 0:e.dataType))).map((e=>{const t={};return(null==e?void 0:e.dateFormat)&&(t.format=e.dateFormat),"PARENT"===e.fieldValue&&(t.id="PARENT",t.keyName=e.modelKey,t.modelKey=e.modelKey,t.prop=e.prop),Object.assign({conditionKey:e.fieldName,conditionLabel:e.fieldName,conditionName:e.fieldName,conditionValueType:e.fieldType,id:e.componentId,keyName:e.fieldValue,rule:e.rule,notGlobal:!0,indexCode:e.indexCode,typeGuid:e.typeGuid,indexCodeNum:e.indexCodeNum},t)}));if(null==e?void 0:e.length)for(const t of e)f.find((e=>e.keyName===t.keyName))||f.push(t)}}const p=f.length,h=t;for(let e=0;e<p;e++){const t=f[e];if("parentCode"===(null==t?void 0:t.conditionKey))continue;const{id:n,keyName:o,prop:r,format:i,modelKey:a,dataType:l="component",customValue:s}=t,c=Ln(t);Nn(c,n,{prop:r,dateFormat:i,modelKey:a,keyName:o}),""===l&&(c.fieldValue=s||""),h.push(c)}for(let e=h.length-1;e>=0;e--){const t=h[e];if(!t.globalCondition){bn(h).find((e=>e.alias===t.alias&&e.globalCondition))&&h.splice(e,1)}}return h};function Ln(e){const{id:t,keyName:n,conditionLabel:o,conditionKey:r,conditionValueType:i,prop:a,rule:l="NONE",notGlobal:s=!1,indexCode:c,typeGuid:u,indexCodeNum:d,dataType:f="component"}=e;let p=n||t;p&&a&&(p+=`-${a}`);let h=l;return"NONE"===h&&(h=["startTime","endTime"].includes(a)?"startTime"===a?"GREATER_EQUAL":"LESS_EQUAL":(null==n?void 0:n.includes("startTime"))?"GREATER_EQUAL"===a:(null==n?void 0:n.includes("endTime"))?"LESS_EQUAL"===a:"EQUAL"),"PARENT"===t&&(p=e.modelKey,p&&a&&(p+=`-${a}`),h=l),{rule:h,label:o,fieldName:r,fieldValue:"",valueType:i,alias:p,globalCondition:!s,indexCode:c,typeGuid:u,indexCodeNum:d,dataType:f}}function Tn(e){if(null==e?void 0:e.length)for(const t of e)if(null==t?void 0:t.conditions)Tn(t.conditions);else{const{id:e,keyName:n,prop:o,modelKey:r,format:i,dataType:a="component",customValue:l}=t,s=Ln(t);Nn(s,e,{prop:o,dateFormat:i,modelKey:r,keyName:n}),""===a&&(s.fieldValue=l||"");for(const e in s)t[e]=s[e];for(const e of Sn)delete t[e]}}function Nn(e,t,n){const{prop:o="",dateFormat:r="",modelKey:i="",keyName:a="",operateValue:l,operateMode:s,operateType:c}=n||{},u=i||a;if("PARENT"===t&&u&&o){const t=window.config.record;let n=o,i=r;const a=o.match(/\{(.+?)\}/g);if(null==a?void 0:a.length){const t=a[0].slice(1,-1).trim();n=o.replace(a[0],""),i=t,e.dateFormat=i}if(t&&t[u]){const o=_(t[u][n]);ce.isDayjs(o)?e.fieldValue=o.format(i||"YYYY-MM-DD"):e.fieldValue=o}return}const d=An(t)||{},{value:f,format:p="YYYY-MM-DD",type:h="",useCurrentTime:y,RECORD:m}=d||{},b=r||p;if(yn(h,"date")){let t;if(t=y?f?_(f):ce():_(f),"string"==typeof t&&(t=ce(t)),l&&s&&c)switch(c){case"add":t=t.add(l,s);break;case"minus":t=t.subtract(l,s)}e.fieldValue=null==t?void 0:t.format(b),e.dateFormat=b}else if(yn(h,"rangepicker")){let t=o;if(!o){const e=a&&a.split("-");(null==e?void 0:e.length)&&(t=e[e.length-1])}if(!t)return;let n=null;if(_(d[t])&&(n=ce(_(d[t]))),l&&s&&c)if("rangeValue"===l){if(d.startTime&&d.endTime){const e=_(d.endTime).diff(_(d.startTime),s)+1;switch(c){case"add":n=n?n.add(e,s):n;break;case"minus":n=n?n.subtract(e,s):n}}}else if(!isNaN(+l))switch(c){case"add":n=n?n.add(l,s):n;break;case"minus":n=n?n.subtract(l,s):n}if(n&&(e.fieldValue=null==n?void 0:n.format(b)),"rangeValue"===t&&d.startTime&&d.endTime){const t=function(e){const t=e.split("-");let n="";if(null==t?void 0:t.length)switch(t[t.length-1]){case"YYYY":n="year";break;case"MM":n="month";break;case"DD":n="day"}return n}(b);t&&(e.fieldValue=_(d.endTime).diff(_(d.startTime),t)+1)}e.dateFormat=b}else yn(h,xn)?e.fieldValue=i&&m?m[i]:!i&&m?m.value:_(f):yn(h,"select")&&Array.isArray(_(f))?e.fieldValue=_(f).join(","):e.fieldValue=_(f)}const $n=e=>{var t;if(e){const n=Array.isArray(e)?fn(e):[fn(e)];let o="",r=[];const i=[],a=[],l=[];for(const e of n){if(e.defaultCode&&(e.label=e.columnName,delete e.defaultCode),"CUSTOM"===e.type&&(r=e.customOrderColumns),o=e.type,i.push(e.label),null===(t=e.columnName)||void 0===t?void 0:t.includes("_ecanrepeat_")){const t=e.columnName.split("_ecanrepeat_");a.push(t[0])}else a.push(e.columnName);l.push(e.order)}return"CUSTOM"!==o&&(null==i?void 0:i.length)>1&&(o="COMBINATION"),"CUSTOM"===o?{label:i.join(","),columnName:a.join(","),type:o,customOrderColumns:r}:{label:i.join(","),columnName:a.join(","),order:l.join(","),type:o}}return e},kn=e=>{const{sortCpnts:t=[]}=e;let n,o="";for(const e of t){const t=An(e)||{},{type:n,RECORD:r}=t;if(yn(n,"image")&&yn(null==r?void 0:r.value,["asc","desc"])){o=r.value.toUpperCase();break}}return o&&(n={label:e.label,columnName:e.name,order:o,type:"NORMAL"}),n},Dn=(t,n={})=>{var o,r,i,a,l,s,c,u;const{graphicConfig:d,type:f,globalModel:p,isGroupTable:h=!1}=t;p&&(wn=p);const y=yn(f,"pivottable");let m,{source:b,dataViewId:g,plugin:v="1",layer:x,chartType:w,classificationList:S=[],rowHeaderList:A=[],dimensionList:_=[],seriesList:j=[],leftAxisList:O=[],rightAxisList:C=[],queryColumnList:L=[],indexLibColumns:T=[],indicators:N=[],controlList:$=[],formFields:k={},variableList:D=[],variableConditions:M=[],dataSourceId:E="",idxLibMode:I,preview:V=!1,edvDataSetId:F,compositeIndicator:z}=d||{},R=[];if("design"===(null==d?void 0:d.pageMode)?(R=(null!==(o=d.sqlConditions)&&void 0!==o?o:[]).map((e=>{const t={};if(mn(e,"globalCondition")||e.join||(t.globalCondition=!0),!e.join){const n=e.rule||"EQUAL";t.rule="NONE"===n?"EQUAL":n}return Object.assign(Object.assign({},e),t)})),(null==M?void 0:M.length)&&(R=R.concat(M))):(R=Cn(d),(null==D?void 0:D.length)&&(R=R.concat(function(e){const t=[];if(null==e?void 0:e.length)for(const n of e)if(n.variableName){const e={variateName:n.variableName,globalCondition:!1,valueType:n.variableType,alias:n.keyName||""};Nn(e,n.id,{dateFormat:n.format,prop:n.dateTypeValue,keyName:n.keyName,operateType:n.operateType,operateMode:n.operateMode,operateValue:n.operateValue}),""===n.dataType&&(e.fieldValue=n.variableValue),n.format&&(e.dateFormat=n.format),n.label&&(e.label=n.label),t.push(e)}return t}(D)))),null==R?void 0:R.length){const e=R.filter((e=>e.globalCondition)),t=R.filter((e=>!e.globalCondition));(null==e?void 0:e.length)>1&&(R=[{join:"&&",conditions:e},...t])}(null==R?void 0:R.length)&&(R=jn(R,"1")),null==x&&(x=yn(f,["table","card"])||yn(f,["list","circulate"])&&(null==S?void 0:S.length)>1?"1":yn(f,["select","checkbox","radio"])?"3":yn(f,["indexPanel"])?"4":"2"),yn(f,["indexPanel"])&&(v="3");const U=[];let P,G="";if(Array.isArray(S)&&S.length>0&&(!["ecanList","ecanCirculate"].includes(f)||1===(null==S?void 0:S.length))){const e=S.length;for(let t=0;t<e;t++){const n=S[t]||{},{label:o="",name:i="",show:a=!1,sort:l,customGroup:s,conditions:c,dateFormat:u,typeGuid:d="",truncations:p=[]}=n;if(a||1===e){G=d,m={label:o.trim(),columnName:i,show:a,sort:kn(n)||$n(l)||l,customGroup:s,conditions:jn(c),typeGuid:d},u&&(m.dateFormat=u),"the_date"!==i||m.dateFormat||(m.dateFormat="YYYY-MM-DD");const e={};if(Array.isArray(p)&&p.length>0){const t=p.length;for(let n=0;n<t;n++){const t=p[n]||{},{rule:o="",num:r=0,name:i=""}=t;o&&r&&(e.num=r,e.rule=o,i&&(e.otherGroupName=i))}}if((null===(r=Object.keys(e))||void 0===r?void 0:r.length)&&(m.truncation=e),!yn(f,["scatter","valueline"]))break;U.push(m)}}}if(Array.isArray(j)&&j.length>0){const e=j.length;for(let t=0;t<e;t++){const n=j[t]||{},{label:o="",name:r="",show:i=!1,sort:a,customGroup:l,conditions:s,typeGuid:c,dateFormat:u=""}=n;if(i||1===e){P={label:o.trim(),columnName:r,show:i,sort:$n(a),customGroup:l,conditions:jn(s),typeGuid:c},u?P.dateFormat=u:"the_date"===r&&(P.dateFormat="YYYY-MM-DD");break}}}const Y=[];null==O||O.forEach((e=>{e.location="LEFT",Y.push(On(e,m))})),null==C||C.forEach((e=>{e.location="RIGHT",Y.push(On(e,m))}));let W=N;(null==n?void 0:n.pivotTableCal)&&(W=(null===(i=n.pivotTableCal)||void 0===i?void 0:i.indicators)||[]),null==W||W.forEach((e=>{e.location="LEFT",Y.push(On(e,m))}));const H=[];["ecanList","ecanCirculate"].includes(f)&&(null==S?void 0:S.length)>1&&(L=S),(null==n?void 0:n.pivotTableCal)&&(L=(null===(a=n.pivotTableCal)||void 0===a?void 0:a.dimensions)||[]),null==L||L.forEach((e=>{const{label:t,name:o,location:r,show:i,indexCode:a,sort:l,typeGuid:s,indexCodeNum:c,dateFormat:u,conditions:d}=e;let f=$n(l);if(n.sort){const{field:o,order:r}=n.sort;let i=Y.find((e=>e.label===o));i||t!==o||(i=e),i&&(f={columnName:i.columnName,label:n.sort.field,order:r.toUpperCase(),type:"NORMAL"})}const p={label:t,columnName:o,location:r,show:i,sort:f,calcType:"COLUMN",hrpIndexCode:a,hrpIndexCodeNum:c,conditions:jn(d),typeGuid:s};u&&(p.dateFormat=u),"the_date"!==o||p.dateFormat||(p.dateFormat="YYYY-MM-DD"),H.push(p)}));const B=[];["ecanTable"].includes(f)&&d.isIndexSet&&T.forEach((e=>{const t={label:e.label,calcType:e.calcType,show:e.show};e.formula&&(t.formula=e.formula),B.push(t)}));let K=[],q=[];if(Array.isArray(A)&&A.length>0?q=A:Array.isArray(_)&&_.length>0&&(q=_),null==q?void 0:q.length){const e=q.length;for(let t=0;t<e;t++){const e=q[t]||{},{label:o="",name:r="",show:i=!1,sort:a,customGroup:s,conditions:c,truncations:u,typeGuid:d="",dateFormat:f}=e;let p=$n(a);if(n.sort){const{field:t,order:o}=n.sort;let r=Y.find((e=>e.label===t));r||e.label!==t||(r=e),r&&(p={columnName:r.columnName,label:n.sort.field,order:o.toUpperCase(),type:"NORMAL"})}const h={label:o.trim(),columnName:r,show:i,sort:p,customGroup:s,conditions:jn(c),typeGuid:d};f&&(h.dateFormat=f),"the_date"!==r||h.dateFormat||(h.dateFormat="YYYY-MM-DD");const y={};if(Array.isArray(u)&&u.length>0){const e=u.length;for(let t=0;t<e;t++){const e=u[t]||{},{rule:n="",num:o=0,name:r=""}=e;n&&o&&(y.num=o,y.rule=n,r&&(y.otherGroupName=r))}}(null===(l=Object.keys(y))||void 0===l?void 0:l.length)&&(h.truncation=y),K.push(h)}}let Q,J=[];const X=[];if(null==n?void 0:n.pivotTableCal){let t=[];const{calc:o=[],filter:r=[],truncations:i=[],sorts:a=[],aggregateMethod:l=[],rowDimensionKeys:u=[],colDimensionKeys:d=[]}=n.pivotTableCal;if(Y.push(...o),null==r?void 0:r.length){const n=function e(t){const n=[];for(const o of t)o.conditions?n.push(...e(o.conditions)):"the_date"===o.conditionKey&&n.push(o);return n}($);for(const o of r){const{type:r}=o,i=e(o,["type"]);"indicators"===r?t=Y:"dimension"===r&&(t=H);const a=t.find((e=>e.columnName===o.fieldName&&e.label===o.label));if(a)if("indicators"===r)a.filter={rule:i.rule,fieldValue:i.fieldValue};else if("dimension"===r){let e=!0;"the_date"===i.fieldName&&2===(null==n?void 0:n.length)&&(e=!1,X.push(i)),e&&(a.conditions||(a.conditions=[]),a.conditions.push(i))}}}if(null==i?void 0:i.length)for(const e of i){const t=H.find((t=>t.label===e.key));t&&(t.truncation={num:e.num,rule:e.rule})}if(null==a?void 0:a.length)for(const n of a){const{fieldType:o,columnData:r}=n,i=e(n,["fieldType","columnData"]);"indicators"===o?(t=Y,Q=r):"dimension"===o&&(t=H);const a=t.find((e=>e.label===i.label));a&&(a.sort=Object.assign(Object.assign({},i),{columnName:a.columnName}))}if(null===(s=Object.keys(l))||void 0===s?void 0:s.length)for(const e in l){const t=H.find((t=>t.label===e));t&&(null===(c=l[e])||void 0===c?void 0:c.length)&&(t.aggregateMethod=l[e])}K=[],J=[];for(const e of H)u.includes(e.columnName)?K.push(e):d.includes(e.columnName)&&J.push(e)}if(yn(f,["text","proportion","counter"])?w="zb":yn(f,["valueline"])?w="valueline":yn(f,["indexPanel"])&&(w="indexPanel"),h||"card"===f){if(0===K.length||0===Y.length)return;w="grouptable"}else{if("1"===x&&!H.length&&!B.length)return;if(["2","4"].includes(x)&&0===Y.length)return;if(!("3"!==x||(G||"EDV_DATA_SET"===b)&&k.labelField&&k.valueField))return;if("3"===x&&"ecanDataSelect"===f&&0===Y.length)return}let Z;if((null==_?void 0:_.length)&&(x="1",w="grouptable"),!yn(f,["scatter","valueline"])&&(null===(u=Object.keys(k))||void 0===u?void 0:u.length)){const e=bn($).find((e=>"parentCode"===e.conditionKey)),n={};if(e){const t=An(e.id)||{};if(!(null==t?void 0:t.itemCodes))return;n.parentItemCodes=t.itemCodes}"ecanDataSelect"===f&&(n.indicatorList=Y.filter((e=>e.show))),"EDV_DATA_SET"===b&&(n.edvDataSetId=F),m.sort&&(n.sort=m.sort),Z=Object.assign({url:"/diagram/formData",source:b,dataViewId:g,plugin:"4",layer:x,chartType:"normalSelect",rangeIndexTypeGuid:G,type:"ecanDataSelect"===f?"normalSelectData":"normalSelect",labelField:k.labelField,valueField:k.valueField,sqlConditions:R,idxLibMode:"WITH_DATE_DIM_TABLE",dataSourceId:E,keyName:t.keyName},n)}else{let e={};e=yn(f,["scatter","valueline"])?{classifications:U}:{classification:m},(null==B?void 0:B.length)&&(e.indexLibColumns=B,e.isIndexSet=!0),yn(f,"table")&&d.isIndexSet&&(e.compositeIndicator=z);const n=R.map((e=>{const{fieldValue:t}=e,n={};return t&&Array.isArray(t)&&(n.fieldValue=JSON.stringify(t)),Object.assign(Object.assign({},e),n)}));(null==X?void 0:X.length)&&function e(t){for(const n of t)if(n.sqlConditions)e(n.sqlConditions);else if("the_date"===n.fieldName){const e=X.find((e=>e.prop===n.prop));e&&(n.fieldValue=e.fieldValue)}}(n),Z=Object.assign({url:"/diagram",source:b,dataViewId:g,plugin:y?"5":v,layer:x,chartType:y?"pivot-table":w,series:P,indicatorList:Y,queryColumns:h?[]:H,pageFlag:!0,edvDataSetId:F||"",sqlConditions:n,idxLibMode:I,dataSourceId:E,preview:V,rowHeaders:K,keyName:t.keyName,columnData:Q,columnHeaders:J},e)}return Z},Mn=(e=[],t,n=!1)=>{let{name:o="name",types:r=[]}=t||{};o=(null==o?void 0:o.trim())||o;const i=new Set,a=new Map,l=e.length,s=r.length;if(1!==l||n)for(let t=0;t<l;t++){const n=e[t],l=n[o];i.add(l);for(let e=0;e<s;e++){const t=r[e],{label:o,value:i}=t,l=Object.assign(Object.assign({},n),{value:n[i]});if(a.has(o)){const e=a.get(o);e.push(l),a.set(o,e)}else a.set(o,[l])}}else{const t=[];for(let n=0;n<s;n++){const o=r[n],{label:a,value:l}=o,s=Object.assign(Object.assign({},e[0]),{value:e[0][l]});i.add(a),t.push(s)}const n=e[0][o]||"";a.set(n,t)}const c=Array.from(i),u=[];for(const[e,t]of a)u.push({name:e,data:t});return{dimensions:c,dataset:u}},En=(e,t)=>{let{name:n="name",value:o="value",type:r="type"}=t||{};n=null==n?void 0:n.trim(),o=null==o?void 0:o.trim(),r=null==r?void 0:r.trim();const i=new Map,a=e.length;for(let t=0;t<a;t++){const a=e[t],l=a[n]||"",s=a[o]||"",c=a[r]||"";if(i.has(c)){const e=i.get(c);e.push(Object.assign({name:l,value:s},a)),i.set(c,e)}else i.set(c,[Object.assign({name:l,value:s},a)])}const l=[],s=[];for(const[e,t]of i)if(s.push({name:e,data:t}),null==t?void 0:t.length)if(l.length)for(const e of t)l.includes(e.name)||l.push(e.name);else l.push(...t.map((e=>e.name)));return{dimensions:l,dataset:s}},In=(e,t)=>{var n;if(null==e)return t;const o=e.match(/\{.*\}/g);if(null==o||0===o.length)return t;const r=o.length;for(let i=0;i<r;i++){const r=o[i];if(null==r||""===r)break;let a=null===(n=r.slice(1,-1))||void 0===n?void 0:n.trim();a=null==a?void 0:a.replace(/value/g,t);try{let t=a;(/\(.*\)/g.test(a)||/[+/\\*]/g.test(a))&&(t=pn(a)),e=e.replace(r,t)}catch(t){e=e.replace(r,a)}}return e};function Vn(e){return e.isShowMarkLine?{markLine:{data:[{type:e.markLineType}]}}:{}}const Fn=(e,t,n)=>{const o=e.yAxisLabelFormatter,r=e.xAxisLabelFormatter,{dimensions:i=[],dataset:a=[]}=t,l=re((()=>{const{gradientShow:t,gradientColors:n,gradientOffset:o,barBorderRadius:r}=e,i=a,l=i.length,s=[];for(let a=0;a<l;a++){const l=Object.assign(Object.assign({},i[a]),{type:"bar",barWidth:e.barWidth,showBackground:e.showBarBackground}),{isStack:c,stackColumns:u}=e;if(c&&u.includes(i[a].name||!u)&&(l.stack="stack"),l.label={show:e.labelShow,fontSize:e.labelFontSize,position:e.labelPosition,color:e.labelColor,width:e.labelWidth,overflow:e.labelOverflow,formatter:t=>{let n="",o=e.labelFormatter;""===o&&(o="{c}");const{seriesName:r,name:i,value:a,data:l}=t||{};return n+=hn(o,{textData:Object.assign({name:i,value:a,a:r,b:i,c:a||0},l)},{useNewline:!0,useSpace:!0}),n}},l.itemStyle={},t&&(l.itemStyle={color:{x:e.isUseHorizontalAxis?1:0,y:0,x2:0,y2:e.isUseHorizontalAxis?0:1,colorStops:[{offset:0,color:e.colors[a]},{offset:o,color:n[a]},{offset:1,color:n[a]}]}}),r){const e=r.split(",");if(null==e?void 0:e.length){const t=[];for(const n of e){const e=parseFloat(n);isNaN(e)||t.push(e)}l.itemStyle.barBorderRadius=t}}e.isShowMarkLine&&(l.markLine={data:[{type:e.markLineType}]}),s.push(l)}return s})),s=re((()=>i.map((e=>{let t={};return t=e&&"object"==typeof e?Object.assign(Object.assign({},e),{textStyle:{fontSize:n}}):{value:e,textStyle:{fontSize:n}},t}))));return{tooltip:{trigger:"axis",show:e.tooltipShow,formatter:t=>{const n=t.length;let o="",i=e.tooltipFormatter;""===i&&(i="{marker} {a} {c}");for(let e=0;e<n;e++){const{marker:n,seriesName:a,name:l,value:s,data:c}=t[e]||{};if(0===e){let e=l;"string"!=typeof l||"0"!==l[0]||isNaN(+l)||(e=(+l).toString()),o+=`${In(r,e)}<br/>`}o+=hn(i,{textData:Object.assign({marker:n,name:l,value:s,Qfw:gn,a:a,b:l,c:s||0},c)},{useNewline:!0,useSpace:!0}),o+="<br/>"}return o},textStyle:{color:e.tooltipTextStyleColor,fontSize:n},position:e.tooltipPosition||void 0,backgroundColor:e.tooltipBackgroundColor||"#fff"},legend:{type:e.legendScroll?"scroll":"plain",width:e.legendWidth,height:e.legendHeight,show:e.legendShow,orient:e.legendOrient,top:e.legendTop,left:e.legendLeft,textStyle:{rich:{text:{width:e.legendTextWidth,color:e.legendTextStyleColor,fontSize:e.legendFontSize}}},itemHeight:e.legendItemHeight,itemWidth:e.legendItemWidth,itemGap:e.legendItemGap,data:a.map(((t,n)=>({name:t.name,itemStyle:{color:e.colors[n]},icon:e.legendType}))),formatter:t=>((e="",t)=>{var n;const o=e.match(/\{(.+?)\}/g),r=(null===(n=e.split("\n"))||void 0===n?void 0:n.length)-1;let i="";if(r)for(let e=0;e<r;e++)i+="\n";let a=e;if(null==o?void 0:o.length){for(const e of o){const n=hn(e,{textData:t},{useNewline:!1,useSpace:!1});n&&(a=a.replace(e,n))}return`${i}{text|${a}}`}return e})(e.legendFormatter,{name:t})},xAxis:{type:e.isUseHorizontalAxis?"value":"category",data:e.isUseHorizontalAxis?null:_(s),inverse:e.isUseHorizontalAxis?e.xAxisInverse:e.axisInverse,minInterval:e.xAxisMinInterval,splitLine:{show:e.xAxisSplitLineShow,lineStyle:{color:e.xAxisSplitLineStyleColor,type:e.xAxisSplitLineType},interval:e.xAxisSplitLineInterval},splitArea:{show:e.xAxisSplitAreaShow},axisLabel:{color:e.xAxisLabelColor,interval:e.xAxisLabelInterval||0,rotate:e.xAxisLabelRotate,width:e.xAxisLabelWidth,overflow:e.xAxisLabelOverflow,fontSize:e.xAxisLabelFontSize,formatter:e=>("string"!=typeof e||"0"!==e[0]||isNaN(+e)||(e=(+e).toString()),In(r,e))},axisLine:{show:e.xAxisLineShow,lineStyle:{color:e.xAxisLineStyleColor}},axisTick:{show:e.xAxisTickShow},name:e.xAxisName,nameTextStyle:{fontSize:e.xAxisLabelFontSize,color:e.xAxisLabelColor,align:"left"},max:e.xAxisMaxValue||null},yAxis:{type:e.isUseHorizontalAxis?"category":"value",data:e.isUseHorizontalAxis?_(i):null,inverse:e.isUseHorizontalAxis?e.axisInverse:e.yAxisInverse,minInterval:e.yAxisMinInterval,splitLine:{show:e.yAxisSplitLineShow,lineStyle:{color:e.yAxisSplitLineStyleColor,type:e.yAxisSplitLineType}},splitArea:{show:e.yAxisSplitAreaShow},axisLabel:{show:e.yAxisLabelShow,fontSize:e.yAxisLabelFontSize,color:e.yAxisLabelColor,rotate:e.yAxisLabelRotate,width:e.yAxisLabelWidth,overflow:e.yAxisLabelOverflow,formatter:e=>In(o,e)},axisLine:{show:e.yAxisLineAlwaysDisplay,lineStyle:{color:e.yAxisLineStyleColor}},name:e.yAxisName,nameTextStyle:{fontSize:e.yAxisLabelFontSize,color:e.yAxisLabelColor,align:"right"},max:e.yAxisMaxValue||null},series:_(l)}},zn=(e,t,n)=>{const o=e.yAxisLabelFormatter,r=e.xAxisLabelFormatter,{dimensions:i=[],dataset:a=[]}=t,l=re((()=>i.map((e=>{let t={};return t=e&&"object"==typeof e?Object.assign(Object.assign({},e),{textStyle:{fontSize:n}}):{value:e,textStyle:{fontSize:n}},t})))),s=re((()=>{const t=[],n=a.length;for(let o=0;o<n;o++){const n={};e.shadowColor&&(n.shadowColor=e.shadowColor,n.shadowBlur=e.shadowBlur,n.shadowOffsetY=e.shadowOffsetY,n.shadowOffsetX=e.shadowOffsetX),t.push(Object.assign(Object.assign(Object.assign({type:"line"},a[o]),{symbolSize:e.symbolSize,smooth:e.smooth,areaStyle:{color:e.areaGradientShow?{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:e.colors[o]},{offset:1,color:e.areaGradientColor||"transparent"}],global:!1}:e.colors[o],opacity:e.areaStyleOpacity},lineStyle:Object.assign({width:e.lineStyleWidth},n)}),Vn(e)))}return t}));return{tooltip:{trigger:"axis",show:e.tooltipShow,formatter:t=>{const n=t.length;let o="",r=e.tooltipFormatter;""===r&&(r="{marker} {a} {c}");for(let e=0;e<n;e++){const{marker:n,seriesName:i,name:a,value:l,data:s}=t[e]||{};0===e&&(o+=`${a}<br/>`),o+=hn(r,{textData:Object.assign({marker:n,name:a,value:l,a:i,b:a,c:l},s)},{useNewline:!0,useSpace:!0}),o+="<br/>"}return o},textStyle:{color:e.tooltipTextStyleColor,fontSize:n.value},position:e.tooltipPosition||void 0,backgroundColor:e.tooltipBackgroundColor||"#fff"},xAxis:{name:e.xAxisName,type:"category",data:_(l),minInterval:e.xAxisMinInterval,splitLine:{show:e.xAxisSplitLineShow,lineStyle:{color:e.xAxisSplitLineStyleColor}},axisLabel:{color:e.xAxisLabelColor,interval:e.xAxisLabelInterval||0,rotate:e.xAxisLabelRotate,width:e.xAxisLabelWidth,overflow:e.xAxisLabelOverflow,formatter:e=>In(r,e)},axisLine:{lineStyle:{color:e.xAxisLineStyleColor}},axisTick:{show:e.xAxisTickShow}},yAxis:{type:"value",name:e.yAxisName,minInterval:e.yAxisMinInterval,splitLine:{show:e.yAxisSplitLineShow,lineStyle:{color:e.yAxisSplitLineStyleColor}},axisLabel:{fontSize:n,color:e.yAxisLabelColor,formatter:e=>In(o,e)},axisLine:{show:e.yAxisLineAlwaysDisplay,lineStyle:{color:e.yAxisLineStyleColor}}},legend:{show:e.legendShow,orient:e.legendOrient,top:e.legendTop,left:e.legendLeft,textStyle:{fontSize:n}},series:_(s)}},Rn=(e,t,n)=>{const{dataset:o=[]}=t;let{data:r=[]}=o[0]||{};if(Array.isArray(e.colors)){const t=e.isUseLabelColors,n=e.colors;r=r.map(((e,o)=>Object.assign({label:t?{color:n[o]}:{}},e)))}return{title:{text:e.titleText,subtext:e.titleSubtext,textStyle:{fontSize:e.titleFontSize,fontWeight:e.fontWeight,color:e.titleColor},left:e.textAlign||"center"},tooltip:{show:e.tooltipShow,trigger:e.tooltipTrigger,formatter:t=>{const{marker:n,seriesName:o,name:r,value:i,percent:a,data:l}=t||{};return hn(e.tooltipFormatter,{textData:Object.assign({marker:n,name:r,value:i,percent:a,a:o,b:r,c:i,d:a},l)},{useNewline:!0,useSpace:!0})},textStyle:{color:e.tooltipTextStyleColor||"#333"},backgroundColor:e.tooltipBackgroundColor||"#fff",borderColor:e.tooltipBorderColor||"#eee"},legend:{show:e.legendShow,orient:e.legendOrient,top:e.legendTop,left:e.legendLeft,textStyle:{color:e.legendTextStyleColor,fontSize:18===n?n:e.labelFontSize}},series:[{data:r,type:"pie",radius:[e.innerRadius,e.outerRadius],center:[e.centerLeft,e.centerTop],roseType:e.roseType,avoidLabelOverlap:!1,minAngle:e.minAngle,label:{show:"center"!==e.labelPosition&&e.labelShow,color:e.labelColor,fontSize:18===n?n:e.labelFontSize,position:e.labelPosition,formatter:(i=e.labelFormatter,i.replace(/\\n/g,"\n"))},labelLine:{show:e.labelLineShow,length:e.labelLineLength,length2:e.labelLineLength2},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"},label:{}}}]};var i},Un=(e,t,n)=>{const{dimensions:o=[],dataset:r=[]}=t,i=re((()=>o.map((e=>{let t={};return t=e&&"object"==typeof e?Object.assign(Object.assign({},e),{textStyle:{fontSize:n}}):{value:e,textStyle:{fontSize:n}},t})))),a=re((()=>{const t=[],n=r.length,o=e.seriesTypes;for(let i=0;i<n;i++){const n=o[i],{type:a,axisIndex:l}=n||{};let s=Object.assign({type:a,yAxisIndex:l},r[i]);if("line"===a){const t={};e.shadowColor&&(t.shadowColor=e.shadowColor,t.shadowBlur=e.shadowBlur,t.shadowOffsetY=e.shadowOffsetY,t.shadowOffsetX=e.shadowOffsetX),s=Object.assign(Object.assign({},s),{symbolSize:e.symbolSize,smooth:e.smooth,itemStyle:{color:e.colors[i]},areaStyle:{color:e.areaGradientShow?{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:e.colors[i]},{offset:1,color:e.areaGradientColor||"transparent"}],global:!1}:e.colors[i],opacity:e.areaStyleOpacity},lineStyle:Object.assign({width:e.lineStyleWidth},t)})}if("bar"===a){const{gradientShow:t,gradientColors:n,gradientOffset:o}=e,r={};if(e.barBorderRadius){const t=e.barBorderRadius.split(",");if(null==t?void 0:t.length){const e=[];for(const n of t){const t=parseFloat(n);isNaN(t)||e.push(t)}r.borderRadius=e}}t&&(r.color={x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:e.colors[i]},{offset:o,color:n[i]},{offset:1,color:n[i]}]}),s=Object.assign(Object.assign({},s),{barWidth:e.barWidth,itemStyle:r})}e.isShowMarkLine&&(s.markLine={data:[{type:e.markLineType}]}),t.push(s)}return t})),l=re((()=>{const t=e.yAxis;return null==t?void 0:t.map(((t,o)=>({type:"value",minInterval:e.yAxisMinInterval,splitLine:{show:0===o?e.yAxisLeftSplitLineShow:e.yAxisRightSplitLineShow,lineStyle:{color:e.yAxisSplitLineStyleColor,type:0===o?e.yAxisLeftSplitLineType:e.yAxisRightSplitLineType}},splitArea:{show:e.yAxisSplitAreaShow},axisLabel:{fontSize:n,show:e.yAxisLabelShow,color:e.yAxisLabelColor,formatter:e=>In(t.axisLabelFormatter,e)},axisLine:{show:e.yAxisLineAlwaysDisplay,lineStyle:{color:e.yAxisLineStyleColor}},name:0===o?e.yAxisLeftName:e.yAxisRightName,nameTextStyle:{fontSize:e.yAxisLabelFontSize,color:e.yAxisLabelColor,align:0===o?"right":"left"},max:e.yAxisMaxValue||null})))}));return{legend:{show:e.legendShow,orient:e.legendOrient,top:e.legendTop,left:e.legendLeft,textStyle:{color:e.legendTextStyleColor,fontSize:n}},tooltip:{trigger:"axis",show:e.tooltipShow,formatter:t=>{const n=t.length;let o="",r=e.tooltipFormatter;""===r&&(r="{marker} {a} {c}");const i=e.seriesTypes;for(let e=0;e<n;e++){const n=i[e],{tooltipFormatter:a}=n||{},{marker:l,seriesName:s,name:c,value:u,data:d}=t[e]||{};0===e&&(o+=`${c}<br/>`),o+=hn(a||r,{textData:Object.assign({marker:l,name:c,value:u,seriesName:s,a:s,b:c,c:u},d)},{useNewline:!0,useSpace:!0}),o+="<br/>"}return o},textStyle:{color:e.tooltipTextStyleColor||"#333",fontSize:n},backgroundColor:e.tooltipBackgroundColor||"#fff",borderColor:e.tooltipBorderColor||"#eee"},xAxis:{name:e.xAxisName,minInterval:e.xAxisMinInterval,type:"category",data:_(i),splitLine:{show:e.xAxisSplitLineShow,lineStyle:{color:e.xAxisSplitLineStyleColor}},axisLabel:{color:e.xAxisLabelColor,interval:e.xAxisLabelInterval||0,rotate:e.xAxisLabelRotate,width:e.xAxisLabelWidth,overflow:e.xAxisLabelOverflow},axisLine:{lineStyle:{color:e.xAxisLineStyleColor}},axisTick:{show:e.xAxisTickShow}},yAxis:_(l),series:_(a)}},Pn=(e,t,n=12)=>Object.assign(Object.assign({},(e=>({title:{text:e.titleText,subtext:e.titleSubtext,textStyle:{fontSize:e.titleFontSize,fontWeight:e.fontWeight,color:e.titleColor},left:e.textAlign||"center"},grid:{top:e.gridTop,bottom:e.gridBottom,left:e.gridLeft,right:e.gridRight,containLabel:e.gridContainLabel},color:e.colors}))(e)),((e,t,n)=>{switch(e.type){case"bar":return Fn(e,t,n);case"line":return zn(e,t,n);case"pie":return Rn(e,t,n);case"comboGraph":return Un(e,t,n);default:return{}}})(e,t,n));export{Dn as formatIndicatorParams,vn as getIndicatorParams,mn as hasOwn,yn as lowerCaseIncludes,pn as runCode,Pn as transformProps,Mn as useTransformChartDataByAttrKey,En as useTransformChartDataByAttrValue,In as useValueFormatter,hn as useVariablesInText};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecan-bi/tools",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "General tools",
5
5
  "main": "lib/index.es.js",
6
6
  "module": "lib/index.es.js",
@@ -8,7 +8,7 @@ export const useVariablesInText = (
8
8
  // @ts-ignore
9
9
  const config = window.config || {}
10
10
  const data = { ...config, ...textData }
11
- const variables = (formatter || '').match(/\{(.+?)\}/g)
11
+ const variables = String(formatter || '').match(/\{(.+?)\}/g)
12
12
  if (variables == null || variables.length === 0) {
13
13
  return formatter
14
14
  }
package/src/indicator.ts CHANGED
@@ -214,7 +214,8 @@ const handleIndicator = (indicator: { [key:string]: any } = {}, classification:
214
214
  aggregate,
215
215
  distinct,
216
216
  dimByCount,
217
- dataTo
217
+ dataTo,
218
+ sort
218
219
  } = indicator
219
220
  let conditionData
220
221
  if (conditions) {
@@ -246,6 +247,14 @@ const handleIndicator = (indicator: { [key:string]: any } = {}, classification:
246
247
  formula,
247
248
  conditions: conditionData
248
249
  }
250
+ if (sort) {
251
+ itemObj.sort = {
252
+ columnName: name,
253
+ label: itemObj.label,
254
+ order: sort,
255
+ type: 'NORMAL'
256
+ }
257
+ }
249
258
  if (builtInFormula === 'DATE_OFFSET') {
250
259
  const list = builtInCalcWay.split('-')
251
260
  if (list?.length === 3) {