@perses-dev/gauge-chart-plugin 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 957.3c868e35.js.LICENSE.txt */
2
+ (self.webpackChunkGaugeChart=self.webpackChunkGaugeChart||[]).push([["957"],{74664:function(e,t,r){"use strict";r.d(t,{Fp:()=>ep,Bl:()=>eu,Bw:()=>es,__:()=>ef});var n,i,o,a,u,s,c,l,f,p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function h(){if(u)return a;u=1;let e=[{key:"ZiB",factor:11805916207174113e5},{key:"ZB",factor:1e21},{key:"YiB",factor:12089258196146292e8},{key:"YB",factor:1e24},{key:"TiB",factor:0x10000000000},{key:"TB",factor:1e12},{key:"PiB",factor:0x4000000000000},{key:"PB",factor:1e15},{key:"MiB",factor:1048576},{key:"MB",factor:1e6},{key:"KiB",factor:1024},{key:"KB",factor:1e3},{key:"GiB",factor:0x40000000},{key:"GB",factor:1e9},{key:"EiB",factor:0x1000000000000000},{key:"EB",factor:1e18},{key:"B",factor:1}];function t(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}return a={unformat:function(r,n){let i;let o=v(),a=o.currentDelimiters(),u=o.currentCurrency().symbol,s=o.currentOrdinal(),c=o.getZeroFormat(),l=o.currentAbbreviations();if("string"==typeof r){if(function(e,t){if(!(e.indexOf(":")&&":"!==t.thousands))return!1;let r=e.split(":");if(3!==r.length)return!1;let n=+r[0],i=+r[1],o=+r[2];return!isNaN(n)&&!isNaN(i)&&!isNaN(o)}(r,a)){let e,t,n;t=+(e=r.split(":"))[0],n=+e[1],i=+e[2]+60*n+3600*t}else i=function(r,n,i="",o,a,u,s){let c;if(""!==r)return r===a?0:function r(n,i,o,a,u,s,c){if(!isNaN(+n))return+n;let l="",f=n.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(f!==n)return -1*r(f,i,o,a,u,s);for(let t=0;t<e.length;t++){let c=e[t];if((l=n.replace(RegExp(`([0-9 ])(${c.key})$`),"$1"))!==n)return r(l,i,o,a,u,s)*c.factor}if((l=n.replace("%",""))!==n)return r(l,i,o,a,u,s)/100;let p=parseFloat(n);if(isNaN(p))return;let h=a(p);if(h&&"."!==h&&(l=n.replace(RegExp(`${t(h)}$`),""))!==n)return r(l,i,o,a,u,s);let g={};Object.keys(s).forEach(e=>{g[s[e]]=e});let d=Object.keys(g).sort().reverse(),v=d.length;for(let e=0;e<v;e++){let t=d[e],c=g[t];if((l=n.replace(t,""))!==n){let e;switch(c){case"thousand":e=1e3;break;case"million":e=1e6;break;case"billion":e=1e9;break;case"trillion":e=1e12}return r(l,i,o,a,u,s)*e}}}(r.replace(i,"").replace(RegExp(`([0-9])${t(n.thousands)}([0-9])`,"g"),"$1$2").replace(n.decimal,"."),n,i,o,a,u)}(r,a,u,s,c,l)}else{if("number"!=typeof r)return;i=r}if(void 0!==i)return i}}}function g(){if(c)return s;c=1;let e=h(),t=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,r={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:(e,t)=>"byte"===t.output,message:"`base` must be provided only when the output is `byte`",mandatory:e=>"byte"===e.output},characteristic:{type:"number",restriction:e=>e>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",lowPrecision:{type:"boolean",restriction:(e,t)=>!0===t.average,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:e=>e>=0,message:"value must be positive"},{restriction:(e,t)=>!t.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:e=>e>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(e,t)=>"percent"===t.output,message:"`prefixSymbol` can be provided only when the output is `percent`"}},n={languageTag:{type:"string",mandatory:!0,restriction:e=>e.match(t),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function i(t){return void 0!==e.unformat(t)}function o(e,t,n,i=!1){let a=Object.keys(e).map(i=>{if(!t[i])return console.error(`${n} Invalid key: ${i}`),!1;let a=e[i],u=t[i];if("string"==typeof u&&(u={type:u}),"format"===u.type){if(!o(a,r,`[Validate ${i}]`,!0))return!1}else if(typeof a!==u.type)return console.error(`${n} ${i} type mismatched: "${u.type}" expected, "${typeof a}" provided`),!1;if(u.restrictions&&u.restrictions.length){let t=u.restrictions.length;for(let r=0;r<t;r++){let{restriction:t,message:o}=u.restrictions[r];if(!t(a,e))return console.error(`${n} ${i} invalid value: ${o}`),!1}}return u.restriction&&!u.restriction(a,e)?(console.error(`${n} ${i} invalid value: ${u.message}`),!1):u.validValues&&-1===u.validValues.indexOf(a)?(console.error(`${n} ${i} invalid value: must be among ${JSON.stringify(u.validValues)}, "${a}" provided`),!1):!u.children||!!o(a,u.children,`[Validate ${i}]`)});return i||a.push(...Object.keys(t).map(r=>{let i=t[r];if("string"==typeof i&&(i={type:i}),i.mandatory){let t=i.mandatory;if("function"==typeof t&&(t=t(e)),t&&void 0===e[r])return console.error(`${n} Missing mandatory key "${r}"`),!1}return!0})),a.reduce((e,t)=>e&&t,!0)}function a(e){return o(e,r,"[Validate format]")}return s={validate:function(e,t){let r=i(e),n=a(t);return r&&n},validateFormat:a,validateInput:i,validateLanguage:function(e){return o(e,n,"[Validate language]")}}}var d={parseFormat:function(e,t={}){var r,n,i,o,a;let u,s,c,l;return"string"!=typeof e?e:(!function(e,t){if(-1!==e.indexOf("$")){t.output="currency";return}if(-1!==e.indexOf("%")){t.output="percent";return}if(-1!==e.indexOf("bd")){t.output="byte",t.base="general";return}if(-1!==e.indexOf("b")){t.output="byte",t.base="binary";return}if(-1!==e.indexOf("d")){t.output="byte",t.base="decimal";return}if(-1!==e.indexOf(":")){t.output="time";return}-1!==e.indexOf("o")&&(t.output="ordinal")}(e=(s=(n=e=(u=(r=e).match(/^{([^}]*)}/))?(t.prefix=u[1],r.slice(u[0].length)):r).match(/{([^}]*)}$/))?(t.postfix=s[1],n.slice(0,-s[0].length)):n,t),(c=e.match(/[1-9]+[0-9]*/))&&(t.totalLength=+c[0]),(l=e.split(".")[0].match(/0+/))&&(t.characteristic=l[0].length),!function(e,t){if(-1!==e.indexOf(".")){let r=e.split(".")[0];t.optionalCharacteristic=-1===r.indexOf("0")}}(e,t),-1!==e.indexOf("a")&&(t.average=!0),-1!==(i=e).indexOf("K")?t.forceAverage="thousand":-1!==i.indexOf("M")?t.forceAverage="million":-1!==i.indexOf("B")?t.forceAverage="billion":-1!==i.indexOf("T")&&(t.forceAverage="trillion"),!function(e,t){let r=e.split(".")[1];if(r){let e=r.match(/0+/);e&&(t.mantissa=e[0].length)}}(e,t),(o=e).match(/\[\.]/)?t.optionalMantissa=!0:o.match(/\./)&&(t.optionalMantissa=!1),!function(e,t){let r=e.split(".")[1];r&&(t.trimMantissa=-1!==r.indexOf("["))}(e,t),-1!==e.indexOf(",")&&(t.thousandSeparated=!0),-1!==e.indexOf(" ")&&(t.spaceSeparated=!0,t.spaceSeparatedCurrency=!0,(t.average||t.forceAverage)&&(t.spaceSeparatedAbbreviation=!0)),(a=e).match(/^\+?\([^)]*\)$/)&&(t.negative="parenthesis"),a.match(/^\+?-/)&&(t.negative="sign"),e.match(/^\+/)&&(t.forceSign=!0),t)}};function v(){let e;if(f)return l;f=1;let t=o?i:(o=1,i={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){let t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),r=g(),n={},a={},u=null,s={};function c(){return a[e]}return n.languages=()=>Object.assign({},a),n.currentLanguage=()=>e,n.currentBytes=()=>c().bytes||{},n.currentCurrency=()=>c().currency,n.currentAbbreviations=()=>c().abbreviations,n.currentDelimiters=()=>c().delimiters,n.currentOrdinal=()=>c().ordinal,n.currentDefaults=()=>Object.assign({},c().defaults,s),n.currentOrdinalDefaultFormat=()=>Object.assign({},n.currentDefaults(),c().ordinalFormat),n.currentByteDefaultFormat=()=>Object.assign({},n.currentDefaults(),c().byteFormat),n.currentPercentageDefaultFormat=()=>Object.assign({},n.currentDefaults(),c().percentageFormat),n.currentCurrencyDefaultFormat=()=>Object.assign({},n.currentDefaults(),c().currencyFormat),n.currentTimeDefaultFormat=()=>Object.assign({},n.currentDefaults(),c().timeFormat),n.setDefaults=e=>{e=d.parseFormat(e),r.validateFormat(e)&&(s=e)},n.getZeroFormat=()=>u,n.setZeroFormat=e=>u="string"==typeof e?e:null,n.hasZeroFormat=()=>null!==u,n.languageData=e=>{if(e){if(a[e])return a[e];throw Error(`Unknown tag "${e}"`)}return c()},n.registerLanguage=(t,n=!1)=>{if(!r.validateLanguage(t))throw Error("Invalid language data");a[t.languageTag]=t,n&&(e=t.languageTag)},n.setLanguage=(r,n=t.languageTag)=>{if(!a[r]){let t=r.split("-")[0],i=Object.keys(a).find(e=>e.split("-")[0]===t);if(!a[i]){e=n;return}e=i;return}e=r},n.registerLanguage(t),e=t.languageTag,l=n}var m={exports:{}};!function(e){var t,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,o="[BigNumber Error] ",a=o+"Number primitive has more than 15 significant digits: ",u=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13];function s(e){var t=0|e;return e>0||e===t?t:t-1}function c(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(r=14-(t=e[n++]+"").length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function l(e,t){var r,n,i=e.c,o=t.c,a=e.s,u=t.s,s=e.e,c=t.e;if(!a||!u)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-u:a;if(a!=u)return a;if(r=a<0,n=s==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return s>c^r?1:-1;for(a=0,u=(s=i.length)<(c=o.length)?s:c;a<u;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return s==c?0:s>c^r?1:-1}function f(e,t,r,n){if(e<t||e>r||e!==i(e))throw Error(o+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function p(e){var t=e.c.length-1;return s(e.e/14)==t&&e.c[t]%2!=0}function h(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function g(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(n=e.length,++t>n){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(t=function e(t){var d,v,m,b,y,x,_,w,O,j=C.prototype={constructor:C,toString:null,valueOf:null},S=new C(1),N=20,$=4,D=-7,B=21,A=-1e7,k=1e7,F=!1,E=1,P=0,M={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz",L=!0;function C(e,t){var n,o,u,s,c,l,p,h,g=this;if(!(g instanceof C))return new C(e,t);if(null==t){if(e&&!0===e._isBigNumber){g.s=e.s,!e.c||e.e>k?g.c=g.e=null:e.e<A?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice());return}if((l="number"==typeof e)&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);s>k?g.c=g.e=null:(g.e=s,g.c=[e]);return}h=String(e)}else{if(!r.test(h=String(e)))return O(g,h,l);g.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}(s=h.indexOf("."))>-1&&(h=h.replace(".","")),(c=h.search(/e/i))>0?(s<0&&(s=c),s+=+h.slice(c+1),h=h.substring(0,c)):s<0&&(s=h.length)}else{if(f(t,2,T.length,"Base"),10==t&&L)return z(g=new C(e),N+g.e+1,$);if(h=String(e),l="number"==typeof e){if(0*e!=0)return O(g,h,l,t);if(g.s=1/e<0?(h=h.slice(1),-1):1,C.DEBUG&&h.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else g.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(n=T.slice(0,t),s=c=0,p=h.length;c<p;c++)if(0>n.indexOf(o=h.charAt(c))){if("."==o){if(c>s){s=p;continue}}else if(!u&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){u=!0,c=-1,s=0;continue}return O(g,String(e),l,t)}l=!1,(s=(h=w(h,t,10,g.s)).indexOf("."))>-1?h=h.replace(".",""):s=h.length}for(c=0;48===h.charCodeAt(c);c++);for(p=h.length;48===h.charCodeAt(--p););if(h=h.slice(c,++p)){if(p-=c,l&&C.DEBUG&&p>15&&(e>0x1fffffffffffff||e!==i(e)))throw Error(a+g.s*e);if((s=s-c-1)>k)g.c=g.e=null;else if(s<A)g.c=[g.e=0];else{if(g.e=s,g.c=[],c=(s+1)%14,s<0&&(c+=14),c<p){for(c&&g.c.push(+h.slice(0,c)),p-=14;c<p;)g.c.push(+h.slice(c,c+=14));c=14-(h=h.slice(c)).length}else c-=p;for(;c--;h+="0");g.c.push(+h)}}else g.c=[g.e=0]}function R(e,t,r,n){var i,o,a,u,s;if(null==r?r=$:f(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)s=c(e.c),s=1==n||2==n&&(a<=D||a>=B)?h(s,a):g(s,a,"0");else if(o=(e=z(new C(e),t,r)).e,u=(s=c(e.c)).length,1==n||2==n&&(t<=o||o<=D)){for(;u<t;s+="0",u++);s=h(s,o)}else if(t-=a,s=g(s,o,"0"),o+1>u){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=o-u)>0)for(o+1==u&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function U(e,t){for(var r,n,i=1,o=new C(e[0]);i<e.length;i++)(n=new C(e[i])).s&&(r=l(o,n))!==t&&(0!==r||o.s!==t)||(o=n);return o}function G(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+14*r-1)>k?e.c=e.e=null:r<A?e.c=[e.e=0]:(e.e=r,e.c=t),e}function z(e,t,r,o){var a,s,c,l,f,p,h,g=e.c;if(g){e:{for(a=1,l=g[0];l>=10;l/=10,a++);if((s=t-a)<0)s+=14,c=t,h=i((f=g[p=0])/u[a-c-1]%10);else if((p=n((s+1)/14))>=g.length){if(o){for(;g.length<=p;g.push(0));f=h=0,a=1,s%=14,c=s-14+1}else break e}else{for(a=1,f=l=g[p];l>=10;l/=10,a++);s%=14,h=(c=s-14+a)<0?0:i(f/u[a-c-1]%10)}if(o=o||t<0||null!=g[p+1]||(c<0?f:f%u[a-c-1]),o=r<4?(h||o)&&(0==r||r==(e.s<0?3:2)):h>5||5==h&&(4==r||o||6==r&&(s>0?c>0?f/u[a-c]:0:g[p-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,o?(t-=e.e+1,g[0]=u[(14-t%14)%14],e.e=-t||0):g[0]=e.e=0,e;if(0==s?(g.length=p,l=1,p--):(g.length=p+1,l=u[14-s],g[p]=c>0?i(f/u[a-c]%u[c])*l:0),o)for(;;){if(0==p){for(s=1,c=g[0];c>=10;c/=10,s++);for(c=g[0]+=l,l=1;c>=10;c/=10,l++);s!=l&&(e.e++,1e14==g[0]&&(g[0]=1));break}if(g[p]+=l,1e14!=g[p])break;g[p--]=0,l=1}for(s=g.length;0===g[--s];g.pop());}e.e>k?e.c=e.e=null:e.e<A&&(e.c=[e.e=0])}return e}function I(e){var t,r=e.e;return null===r?e.toString():(t=c(e.c),t=r<=D||r>=B?h(t,r):g(t,r,"0"),e.s<0?"-"+t:t)}return C.clone=e,C.ROUND_UP=0,C.ROUND_DOWN=1,C.ROUND_CEIL=2,C.ROUND_FLOOR=3,C.ROUND_HALF_UP=4,C.ROUND_HALF_DOWN=5,C.ROUND_HALF_EVEN=6,C.ROUND_HALF_CEIL=7,C.ROUND_HALF_FLOOR=8,C.EUCLID=9,C.config=C.set=function(e){var t,r;if(null!=e){if("object"==typeof e){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(f(r=e[t],0,1e9,t),N=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(f(r=e[t],0,8,t),$=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(f(r[0],-1e9,0,t),f(r[1],0,1e9,t),D=r[0],B=r[1]):(f(r,-1e9,1e9,t),D=-(B=r<0?-r:r))),e.hasOwnProperty(t="RANGE")){if((r=e[t])&&r.pop)f(r[0],-1e9,-1,t),f(r[1],1,1e9,t),A=r[0],k=r[1];else if(f(r,-1e9,1e9,t),r)A=-(k=r<0?-r:r);else throw Error(o+t+" cannot be zero: "+r)}if(e.hasOwnProperty(t="CRYPTO")){if(!!(r=e[t])===r){if(r){if("undefined"!=typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))F=r;else throw F=!r,Error(o+"crypto unavailable")}else F=r}else throw Error(o+t+" not true or false: "+r)}if(e.hasOwnProperty(t="MODULO_MODE")&&(f(r=e[t],0,9,t),E=r),e.hasOwnProperty(t="POW_PRECISION")&&(f(r=e[t],0,1e9,t),P=r),e.hasOwnProperty(t="FORMAT")){if("object"==typeof(r=e[t]))M=r;else throw Error(o+t+" not an object: "+r)}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(o+t+" invalid: "+r);L="0123456789"==r.slice(0,10),T=r}}else throw Error(o+"Object expected: "+e)}return{DECIMAL_PLACES:N,ROUNDING_MODE:$,EXPONENTIAL_AT:[D,B],RANGE:[A,k],CRYPTO:F,MODULO_MODE:E,POW_PRECISION:P,FORMAT:M,ALPHABET:T}},C.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!C.DEBUG)return!0;var t,r,n=e.c,a=e.e,u=e.s;e:if("[object Array]"==({}).toString.call(n)){if((1===u||-1===u)&&a>=-1e9&&a<=1e9&&a===i(a)){if(0===n[0]){if(0===a&&1===n.length)return!0;break e}if((t=(a+1)%14)<1&&(t+=14),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=1e14||r!==i(r))break e;if(0!==r)return!0}}}else if(null===n&&null===a&&(null===u||1===u||-1===u))return!0;throw Error(o+"Invalid BigNumber: "+e)},C.maximum=C.max=function(){return U(arguments,-1)},C.minimum=C.min=function(){return U(arguments,1)},C.random=(d=0x20000000000000*Math.random()&2097151?function(){return i(0x20000000000000*Math.random())}:function(){return(0x40000000*Math.random()|0)*8388608+(8388608*Math.random()|0)},function(e){var t,r,a,s,c,l=0,p=[],h=new C(S);if(null==e?e=N:f(e,0,1e9),s=n(e/14),F){if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(s*=2));l<s;)(c=131072*t[l]+(t[l+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(p.push(c%1e14),l+=2);l=s/2}else if(crypto.randomBytes){for(t=crypto.randomBytes(s*=7);l<s;)(c=(31&t[l])*0x1000000000000+0x10000000000*t[l+1]+0x100000000*t[l+2]+0x1000000*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(p.push(c%1e14),l+=7);l=s/7}else throw F=!1,Error(o+"crypto unavailable")}if(!F)for(;l<s;)(c=d())<9e15&&(p[l++]=c%1e14);for(s=p[--l],e%=14,s&&e&&(c=u[14-e],p[l]=i(s/c)*c);0===p[l];p.pop(),l--);if(l<0)p=[a=0];else{for(a=-1;0===p[0];p.splice(0,1),a-=14);for(l=1,c=p[0];c>=10;c/=10,l++);l<14&&(a-=14-l)}return h.e=a,h.c=p,h}),C.sum=function(){for(var e=1,t=arguments,r=new C(t[0]);e<t.length;)r=r.plus(t[e++]);return r},w=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,a=[0],u=0,s=e.length;u<s;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(u++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(r,n,i,o,a){var u,s,l,f,p,h,d,v,m=r.indexOf("."),b=N,y=$;for(m>=0&&(f=P,P=0,r=r.replace(".",""),h=(v=new C(n)).pow(r.length-m),P=f,v.c=t(g(c(h.c),h.e,"0"),10,i,e),v.e=v.c.length),l=f=(d=t(r,n,i,a?(u=T,e):(u=e,T))).length;0==d[--f];d.pop());if(!d[0])return u.charAt(0);if(m<0?--l:(h.c=d,h.e=l,h.s=o,d=(h=_(h,v,b,y,i)).c,p=h.r,l=h.e),m=d[s=l+b+1],f=i/2,p=p||s<0||null!=d[s+1],p=y<4?(null!=m||p)&&(0==y||y==(h.s<0?3:2)):m>f||m==f&&(4==y||p||6==y&&1&d[s-1]||y==(h.s<0?8:7)),s<1||!d[0])r=p?g(u.charAt(1),-b,u.charAt(0)):u.charAt(0);else{if(d.length=s,p)for(--i;++d[--s]>i;)d[s]=0,s||(++l,d=[1].concat(d));for(f=d.length;!d[--f];);for(m=0,r="";m<=f;r+=u.charAt(d[m++]));r=g(r,l,u.charAt(0))}return r}}(),_=function(){function e(e,t,r){var n,i,o,a,u=0,s=e.length,c=t%1e7,l=t/1e7|0;for(e=e.slice();s--;)n=l*(o=e[s]%1e7)+(a=e[s]/1e7|0)*c,u=((i=c*o+n%1e7*1e7+u)/r|0)+(n/1e7|0)+l*a,e[s]=i%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=+(e[r]<t[r]),e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,a,u,c){var l,f,p,h,g,d,v,m,b,y,x,_,w,O,j,S,N,$=n.s==o.s?1:-1,D=n.c,B=o.c;if(!D||!D[0]||!B||!B[0])return new C(n.s&&o.s&&(D?!B||D[0]!=B[0]:B)?D&&0==D[0]||!B?0*$:$/0:NaN);for(b=(m=new C($)).c=[],$=a+(f=n.e-o.e)+1,c||(c=1e14,f=s(n.e/14)-s(o.e/14),$=$/14|0),p=0;B[p]==(D[p]||0);p++);if(B[p]>(D[p]||0)&&f--,$<0)b.push(1),h=!0;else{for(O=D.length,S=B.length,p=0,$+=2,(g=i(c/(B[0]+1)))>1&&(B=e(B,g,c),D=e(D,g,c),S=B.length,O=D.length),w=S,x=(y=D.slice(0,S)).length;x<S;y[x++]=0);N=[0].concat(N=B.slice()),j=B[0],B[1]>=c/2&&j++;do{if(g=0,(l=t(B,y,S,x))<0){if(_=y[0],S!=x&&(_=_*c+(y[1]||0)),(g=i(_/j))>1)for(g>=c&&(g=c-1),v=(d=e(B,g,c)).length,x=y.length;1==t(d,y,v,x);)g--,r(d,S<v?N:B,v,c),v=d.length,l=1;else 0==g&&(l=g=1),v=(d=B.slice()).length;if(v<x&&(d=[0].concat(d)),r(y,d,x,c),x=y.length,-1==l)for(;1>t(B,y,S,x);)g++,r(y,S<x?N:B,x,c),x=y.length}else 0===l&&(g++,y=[0]);b[p++]=g,y[0]?y[x++]=D[w]||0:(y=[D[w]],x=1)}while((w++<O||null!=y[0])&&$--);h=null!=y[0],b[0]||b.splice(0,1)}if(1e14==c){for(p=1,$=b[0];$>=10;$/=10,p++);z(m,a+(m.e=p+14*f-1)+1,u,h)}else m.e=f,m.r=+h;return m}}(),v=/^(-?)0([xbo])(?=\w[\w.]*$)/i,m=/^([^.]+)\.$/,b=/^\.([^.]+)$/,y=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,O=function(e,t,r,n){var i,a=r?t:t.replace(x,"");if(y.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(v,function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t}),n&&(i=n,a=a.replace(m,"$1").replace(b,"0.$1")),t!=a))return new C(a,i);if(C.DEBUG)throw Error(o+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},j.absoluteValue=j.abs=function(){var e=new C(this);return e.s<0&&(e.s=1),e},j.comparedTo=function(e,t){return l(this,new C(e,t))},j.decimalPlaces=j.dp=function(e,t){var r,n,i;if(null!=e)return f(e,0,1e9),null==t?t=$:f(t,0,8),z(new C(this),e+this.e+1,t);if(!(r=this.c))return null;if(n=((i=r.length-1)-s(this.e/14))*14,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},j.dividedBy=j.div=function(e,t){return _(this,new C(e,t),N,$)},j.dividedToIntegerBy=j.idiv=function(e,t){return _(this,new C(e,t),0,1)},j.exponentiatedBy=j.pow=function(e,t){var r,a,u,s,c,l,f,h,g,d=this;if((e=new C(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+I(e));if(null!=t&&(t=new C(t)),l=e.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!e.c||!e.c[0])return g=new C(Math.pow(+I(d),l?e.s*(2-p(e)):+I(e))),t?g.mod(t):g;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new C(NaN);(a=!f&&d.isInteger()&&t.isInteger())&&(d=d.mod(t))}else{if(e.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||l&&d.c[1]>=24e7:d.c[0]<8e13||l&&d.c[0]<=9999975e7)))return s=d.s<0&&p(e)?-0:0,d.e>-1&&(s=1/s),new C(f?1/s:s);P&&(s=n(P/14+2))}for(l?(r=new C(.5),f&&(e.s=1),h=p(e)):h=(u=Math.abs(+I(e)))%2,g=new C(S);;){if(h){if(!(g=g.times(d)).c)break;s?g.c.length>s&&(g.c.length=s):a&&(g=g.mod(t))}if(u){if(0===(u=i(u/2)))break;h=u%2}else if(z(e=e.times(r),e.e+1,1),e.e>14)h=p(e);else{if(0==(u=+I(e)))break;h=u%2}d=d.times(d),s?d.c&&d.c.length>s&&(d.c.length=s):a&&(d=d.mod(t))}return a?g:(f&&(g=S.div(g)),t?g.mod(t):s?z(g,P,$,c):g)},j.integerValue=function(e){var t=new C(this);return null==e?e=$:f(e,0,8),z(t,t.e+1,e)},j.isEqualTo=j.eq=function(e,t){return 0===l(this,new C(e,t))},j.isFinite=function(){return!!this.c},j.isGreaterThan=j.gt=function(e,t){return l(this,new C(e,t))>0},j.isGreaterThanOrEqualTo=j.gte=function(e,t){return 1===(t=l(this,new C(e,t)))||0===t},j.isInteger=function(){return!!this.c&&s(this.e/14)>this.c.length-2},j.isLessThan=j.lt=function(e,t){return 0>l(this,new C(e,t))},j.isLessThanOrEqualTo=j.lte=function(e,t){return -1===(t=l(this,new C(e,t)))||0===t},j.isNaN=function(){return!this.s},j.isNegative=function(){return this.s<0},j.isPositive=function(){return this.s>0},j.isZero=function(){return!!this.c&&0==this.c[0]},j.minus=function(e,t){var r,n,i,o,a=this.s;if(t=(e=new C(e,t)).s,!a||!t)return new C(NaN);if(a!=t)return e.s=-t,this.plus(e);var u=this.e/14,c=e.e/14,l=this.c,f=e.c;if(!u||!c){if(!l||!f)return l?(e.s=-t,e):new C(f?this:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new C(l[0]?this:3==$?-0:0)}if(u=s(u),c=s(c),l=l.slice(),a=u-c){for((o=a<0)?(a=-a,i=l):(c=u,i=f),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=l.length)<(t=f.length))?a:t,a=t=0;t<n;t++)if(l[t]!=f[t]){o=l[t]<f[t];break}if(o&&(i=l,l=f,f=i,e.s=-e.s),(t=(n=f.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=1e14-1;n>a;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=1e14}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?G(e,l,c):(e.s=3==$?-1:1,e.c=[e.e=0],e)},j.modulo=j.mod=function(e,t){var r,n;return(e=new C(e,t),this.c&&e.s&&(!e.c||e.c[0]))?e.c&&(!this.c||this.c[0])?(9==E?(n=e.s,e.s=1,r=_(this,e,0,3),e.s=n,r.s*=n):r=_(this,e,0,E),(e=this.minus(r.times(e))).c[0]||1!=E||(e.s=this.s),e):new C(this):new C(NaN)},j.multipliedBy=j.times=function(e,t){var r,n,i,o,a,u,c,l,f,p,h,g,d,v=this.c,m=(e=new C(e,t)).c;if(!v||!m||!v[0]||!m[0])return this.s&&e.s&&(!v||v[0]||m)&&(!m||m[0]||v)?(e.s*=this.s,v&&m?(e.c=[0],e.e=0):e.c=e.e=null):e.c=e.e=e.s=null,e;for(n=s(this.e/14)+s(e.e/14),e.s*=this.s,(c=v.length)<(p=m.length)&&(d=v,v=m,m=d,i=c,c=p,p=i),i=c+p,d=[];i--;d.push(0));for(i=p;--i>=0;){for(r=0,h=m[i]%1e7,g=m[i]/1e7|0,o=i+(a=c);o>i;)u=g*(l=v[--a]%1e7)+(f=v[a]/1e7|0)*h,r=((l=h*l+u%1e7*1e7+d[o]+r)/1e14|0)+(u/1e7|0)+g*f,d[o--]=l%1e14;d[o]=r}return r?++n:d.splice(0,1),G(e,d,n)},j.negated=function(){var e=new C(this);return e.s=-e.s||null,e},j.plus=function(e,t){var r,n=this.s;if(t=(e=new C(e,t)).s,!n||!t)return new C(NaN);if(n!=t)return e.s=-t,this.minus(e);var i=this.e/14,o=e.e/14,a=this.c,u=e.c;if(!i||!o){if(!a||!u)return new C(n/0);if(!a[0]||!u[0])return u[0]?e:new C(a[0]?this:0*n)}if(i=s(i),o=s(o),a=a.slice(),n=i-o){for(n>0?(o=i,r=u):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=n),n=0;t;)n=(a[--t]=a[t]+u[t]+n)/1e14|0,a[t]=1e14===a[t]?0:a[t]%1e14;return n&&(a=[n].concat(a),++o),G(e,a,o)},j.precision=j.sd=function(e,t){var r,n,i;if(null!=e&&!!e!==e)return f(e,1,1e9),null==t?t=$:f(t,0,8),z(new C(this),e,t);if(!(r=this.c))return null;if(n=14*(i=r.length-1)+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&this.e+1>n&&(n=this.e+1),n},j.shiftedBy=function(e){return f(e,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+e)},j.squareRoot=j.sqrt=function(){var e,t,r,n,i,o=this.c,a=this.s,u=this.e,l=N+4,f=new C("0.5");if(1!==a||!o||!o[0])return new C(!a||a<0&&(!o||o[0])?NaN:o?this:1/0);if(0==(a=Math.sqrt(+I(this)))||a==1/0?(((t=c(o)).length+u)%2==0&&(t+="0"),a=Math.sqrt(+t),u=s((u+1)/2)-(u<0||u%2),r=new C(t=a==1/0?"5e"+u:(t=a.toExponential()).slice(0,t.indexOf("e")+1)+u)):r=new C(a+""),r.c[0]){for((a=(u=r.e)+l)<3&&(a=0);;)if(i=r,r=f.times(i.plus(_(this,i,l,1))),c(i.c).slice(0,a)===(t=c(r.c)).slice(0,a)){if(r.e<u&&--a,"9999"!=(t=t.slice(a-3,a+1))&&(n||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(z(r,r.e+N+2,1),e=!r.times(r).eq(this));break}if(!n&&(z(i,i.e+N+2,0),i.times(i).eq(this))){r=i;break}l+=4,a+=4,n=1}}return z(r,r.e+N+1,$,e)},j.toExponential=function(e,t){return null!=e&&(f(e,0,1e9),e++),R(this,e,t,1)},j.toFixed=function(e,t){return null!=e&&(f(e,0,1e9),e=e+this.e+1),R(this,e,t)},j.toFormat=function(e,t,r){var n;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=M;else if("object"!=typeof r)throw Error(o+"Argument not an object: "+r);if(n=this.toFixed(e,t),this.c){var i,a=n.split("."),u=+r.groupSize,s=+r.secondaryGroupSize,c=r.groupSeparator||"",l=a[0],f=a[1],p=this.s<0,h=p?l.slice(1):l,g=h.length;if(s&&(i=u,u=s,s=i,g-=i),u>0&&g>0){for(i=g%u||u,l=h.substr(0,i);i<g;i+=u)l+=c+h.substr(i,u);s>0&&(l+=c+h.slice(i)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((s=+r.fractionGroupSize)?f.replace(RegExp("\\d{"+s+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},j.toFraction=function(e){var t,r,n,i,a,s,l,f,p,h,g,d,v=this.c;if(null!=e&&(!(l=new C(e)).isInteger()&&(l.c||1!==l.s)||l.lt(S)))throw Error(o+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+I(l));if(!v)return new C(this);for(t=new C(S),p=r=new C(S),n=f=new C(S),d=c(v),a=t.e=d.length-this.e-1,t.c[0]=u[(s=a%14)<0?14+s:s],e=!e||l.comparedTo(t)>0?a>0?t:p:l,s=k,k=1/0,l=new C(d),f.c[0]=0;h=_(l,t,0,1),1!=(i=r.plus(h.times(n))).comparedTo(e);)r=n,n=i,p=f.plus(h.times(i=p)),f=i,t=l.minus(h.times(i=t)),l=i;return i=_(e.minus(r),n,0,1),f=f.plus(i.times(p)),r=r.plus(i.times(n)),f.s=p.s=this.s,a*=2,g=1>_(p,n,a,$).minus(this).abs().comparedTo(_(f,r,a,$).minus(this).abs())?[p,n]:[f,r],k=s,g},j.toNumber=function(){return+I(this)},j.toPrecision=function(e,t){return null!=e&&f(e,1,1e9),R(this,e,t,2)},j.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=D||i>=B?h(c(r.c),i):g(c(r.c),i,"0"):10===e&&L?t=g(c((r=z(new C(r),N+i+1,$)).c),r.e,"0"):(f(e,2,T.length,"Base"),t=w(g(c(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},j.valueOf=j.toJSON=function(){return I(this)},j._isBigNumber=!0,null!=t&&C.set(t),C}()).default=t.BigNumber=t,m.exports?m.exports=t:(e||(e="undefined"!=typeof self&&self?self:window),e.BigNumber=t)}(p);var b=m.exports;let y=v(),x=g(),_={trillion:1e12,billion:1e9,million:1e6,thousand:1e3},w={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:O,decimalSuffixes:j}=y.currentBytes(),S={scale:1024,suffixes:j,marker:"bd"},N={scale:1024,suffixes:O,marker:"b"},$={scale:1e3,suffixes:j,marker:"d"};function D(e,t,r){let n=t[0],i=Math.abs(e);if(i>=r){for(let o=1;o<t.length;++o){let a=Math.pow(r,o),u=Math.pow(r,o+1);if(i>=a&&i<u){n=t[o],e/=a;break}}n===t[0]&&(e/=Math.pow(r,t.length-1),n=t[t.length-1])}return{value:e,suffix:n}}function B(e){let t="";for(let r=0;r<e;r++)t+="0";return t}function A({instance:e,providedFormat:t,state:r=y,decimalSeparator:n,defaults:i=r.currentDefaults()}){let o=e._value;if(0===o&&r.hasZeroFormat())return r.getZeroFormat();if(!isFinite(o))return o.toString();let a=Object.assign({},w,i,t),u=a.totalLength,s=u?0:a.characteristic,c=a.optionalCharacteristic,l=a.forceAverage,f=a.lowPrecision,p=!!u||!!l||a.average,h=u?-1:p&&void 0===t.mantissa?0:a.mantissa,g=!u&&(void 0===t.optionalMantissa?-1===h:a.optionalMantissa),d=a.trimMantissa,v=a.thousandSeparated,m=a.spaceSeparated,x=a.negative,O=a.forceSign,j=a.exponential,S=a.roundingFunction,N="";if(p){let e=function({value:e,forceAverage:t,lowPrecision:r=!0,abbreviations:n,spaceSeparated:i=!1,totalLength:o=0,roundingFunction:a=Math.round}){let u="",s=Math.abs(e),c=-1;if(t&&n[t]&&_[t]?(u=n[t],e/=_[t]):s>=_.trillion||r&&1===a(s/_.trillion)?(u=n.trillion,e/=_.trillion):s<_.trillion&&s>=_.billion||r&&1===a(s/_.billion)?(u=n.billion,e/=_.billion):s<_.billion&&s>=_.million||r&&1===a(s/_.million)?(u=n.million,e/=_.million):(s<_.million&&s>=_.thousand||r&&1===a(s/_.thousand))&&(u=n.thousand,e/=_.thousand),u&&(u=(i?" ":"")+u),o){let t=e<0,r=e.toString().split(".")[0];c=Math.max(o-(t?r.length-1:r.length),0)}return{value:e,abbreviation:u,mantissaPrecision:c}}({value:o,forceAverage:l,lowPrecision:f,abbreviations:r.currentAbbreviations(),spaceSeparated:m,roundingFunction:S,totalLength:u});o=e.value,N+=e.abbreviation,u&&(h=e.mantissaPrecision)}if(j){let e=function({value:e,characteristicPrecision:t}){let[r,n]=e.toExponential().split("e"),i=+r;return t&&1<t&&(i*=Math.pow(10,t-1),n=(n=+n-(t-1))>=0?`+${n}`:n),{value:i,abbreviation:`e${n}`}}({value:o,characteristicPrecision:s});o=e.value,N=e.abbreviation+N}let $=function(e,t,r,n,i,o){if(-1===n)return e;let a=function(e,t,r=Math.round){return -1!==e.toString().indexOf("e")?function(e,t){let r=e.toString(),[n,i]=r.split("e"),[o,a=""]=n.split(".");if(+i>0)r=o+a+B(i-a.length);else{let e=".";e=0>+o?`-0${e}`:`0${e}`;let n=(B(-i-1)+Math.abs(o)+a).substr(0,t);n.length<t&&(n+=B(t-n.length)),r=e+n}return+i>0&&t>0&&(r+=`.${B(t)}`),r}(e,t):new b(r(+`${e}e+${t}`)/Math.pow(10,t)).toFixed(t)}(t,n,o),[u,s=""]=a.toString().split(".");if(s.match(/^0+$/)&&(r||i))return u;let c=s.match(/0+$/);return i&&c?`${u}.${s.toString().slice(0,c.index)}`:a.toString()}(o.toString(),o,g,h,d,S);if($=function(e,t,r,n,i){let o=n.currentDelimiters(),a=o.thousands;i=i||o.decimal;let u=o.thousandsSize||3,s=e.toString(),c=s.split(".")[0],l=s.split(".")[1],f=t<0&&0===c.indexOf("-");return r&&(f&&(c=c.slice(1)),(function(e,t){let r=[],n=0;for(let i=e;i>0;i--)n===t&&(r.unshift(i),n=0),n++;return r})(c.length,u).forEach((e,t)=>{c=c.slice(0,e+t)+a+c.slice(e+t)}),f&&(c=`-${c}`)),s=l?c+i+l:c}($=function(e,t,r,n){let i=e,[o,a]=i.toString().split(".");if(o.match(/^-?0$/)&&r)return a?`${o.replace("0","")}.${a}`:o.replace("0","");let u=t<0&&0===o.indexOf("-");if(u&&(o=o.slice(1),i=i.slice(1)),o.length<n){let e=n-o.length;for(let t=0;t<e;t++)i=`0${i}`}return u&&(i=`-${i}`),i.toString()}($,o,c,s),o,v,r,n),(p||j)&&($+=N),O||o<0){var D,A;D=$,$=0===(A=o)?D:0==+D?D.replace("-",""):A>0?`+${D}`:"sign"===x?D:`(${D.replace("-","")})`}return $}function k(e,t){if(!e)return t;let r=Object.keys(e);return 1===r.length&&"output"===r[0]?t:e}function F(e,t,r){let n=new b(e._value),i=t;return r.isNumbro(t)&&(i=t._value),i=new b(i),e._value=n.minus(i).toNumber(),e}let E=v(),P=g(),M=h(),T=(...e)=>(function(e,t={},r){if("string"==typeof t&&(t=d.parseFormat(t)),!x.validateFormat(t))return"ERROR: invalid format";let n=t.prefix||"",i=t.postfix||"",o=function(e,t,r){var n,i;switch(t.output){case"currency":return function(e,t,r){let n;let i=r.currentCurrency(),o=Object.assign({},t),a=Object.assign({},w,o),u="",s=!!a.totalLength||!!a.forceAverage||a.average,c=o.currencyPosition||i.position,l=o.currencySymbol||i.symbol,f=void 0!==a.spaceSeparatedCurrency?a.spaceSeparatedCurrency:a.spaceSeparated;void 0===o.lowPrecision&&(o.lowPrecision=!1),f&&(u=" "),"infix"===c&&(n=u+l+u);let p=A({instance:e,providedFormat:o,state:r,decimalSeparator:n});return"prefix"===c&&(p=e._value<0&&"sign"===a.negative?`-${u}${l}${p.slice(1)}`:e._value>0&&a.forceSign?`+${u}${l}${p.slice(1)}`:l+u+p),c&&"postfix"!==c||(p=p+(u=!a.spaceSeparatedAbbreviation&&s?"":u)+l),p}(e,t=k(t,y.currentCurrencyDefaultFormat()),y);case"percent":let o,a,u;return o=(n=t=k(t,y.currentPercentageDefaultFormat())).prefixSymbol,a=A({instance:r(100*e._value),providedFormat:n,state:y}),u=Object.assign({},w,n),o?`%${u.spaceSeparated?" ":""}${a}`:`${a}${u.spaceSeparated?" ":""}%`;case"byte":return function(e,t,r,n){let i=t.base||"binary",o=Object.assign({},w,t),{binarySuffixes:a,decimalSuffixes:u}=r.currentBytes(),s={general:{scale:1024,suffixes:u||j,marker:"bd"},binary:{scale:1024,suffixes:a||O,marker:"b"},decimal:{scale:1e3,suffixes:u||j,marker:"d"}}[i],{value:c,suffix:l}=D(e._value,s.suffixes,s.scale),f=A({instance:n(c),providedFormat:t,state:r,defaults:r.currentByteDefaultFormat()});return`${f}${o.spaceSeparated?" ":""}${l}`}(e,t=k(t,y.currentByteDefaultFormat()),y,r);case"time":let s,c,l;return t=k(t,y.currentTimeDefaultFormat()),s=Math.floor(e._value/60/60),c=Math.floor((e._value-3600*s)/60),l=Math.round(e._value-3600*s-60*c),`${s}:${c<10?"0":""}${c}:${l<10?"0":""}${l}`;case"ordinal":let f,p,h,g;return i=t=k(t,y.currentOrdinalDefaultFormat()),f=y.currentOrdinal(),p=Object.assign({},w,i),h=A({instance:e,providedFormat:i,state:y}),g=f(e._value),`${h}${p.spaceSeparated?" ":""}${g}`;default:return A({instance:e,providedFormat:t,numbro:r})}}(e,t,r);return(o=n+o)+i})(...e,K),L=(...e)=>(function(e){return D(e._value,S.suffixes,S.scale).suffix})(...e,K),C=(...e)=>(function(e){return D(e._value,N.suffixes,N.scale).suffix})(...e,K),R=(...e)=>(function(e){return D(e._value,$.suffixes,$.scale).suffix})(...e,K),U=k,G=(e,t)=>{let r,n;return r=new b(e._value),n=t,K.isNumbro(t)&&(n=t._value),n=new b(n),e._value=r.plus(n).toNumber(),e},z=(e,t)=>F(e,t,K),I=(e,t)=>{let r,n;return r=new b(e._value),n=t,K.isNumbro(t)&&(n=t._value),n=new b(n),e._value=r.times(n).toNumber(),e},V=(e,t)=>{let r,n;return r=new b(e._value),n=t,K.isNumbro(t)&&(n=t._value),n=new b(n),e._value=r.dividedBy(n).toNumber(),e},q=(e,t)=>{let r;return r=t,K.isNumbro(t)&&(r=t._value),e._value=r,e},W=(e,t)=>{let r;return F(r=K(e._value),t,K),Math.abs(r._value)},Z=b;class H{constructor(e){this._value=e}clone(){return K(this._value)}format(e={}){return T(this,e)}formatCurrency(e){return"string"==typeof e&&(e=d.parseFormat(e)),(e=U(e,E.currentCurrencyDefaultFormat())).output="currency",T(this,e)}formatTime(e={}){return e.output="time",T(this,e)}binaryByteUnits(){return C(this)}decimalByteUnits(){return R(this)}byteUnits(){return L(this)}difference(e){return W(this,e)}add(e){return G(this,e)}subtract(e){return z(this,e)}multiply(e){return I(this,e)}divide(e){return V(this,e)}set(e){return q(this,Y(e))}value(){return this._value}valueOf(){return this._value}}function Y(e){let t=e;return K.isNumbro(e)?t=e._value:"string"==typeof e?t=K.unformat(e):isNaN(e)&&(t=NaN),t}function K(e){return new H(Y(e))}K.version="2.5.0",K.isNumbro=function(e){return e instanceof H},K.language=E.currentLanguage,K.registerLanguage=E.registerLanguage,K.setLanguage=E.setLanguage,K.languages=E.languages,K.languageData=E.languageData,K.zeroFormat=E.setZeroFormat,K.defaultFormat=E.currentDefaults,K.setDefaults=E.setDefaults,K.defaultCurrencyFormat=E.currentCurrencyDefaultFormat,K.validate=P.validate,K.loadLanguagesInNode=e=>(function(e,t){e.forEach(e=>{let r;try{r=function(e){throw Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(`../languages/${e}`)}catch(t){console.error(`Unable to load "${e}". No matching language file found.`)}r&&t.registerLanguage(r)})})(e,K),K.unformat=M.unformat,K.BigNumber=Z;var J=K&&K.__esModule&&Object.prototype.hasOwnProperty.call(K,"default")?K.default:K,X=r(15418);function Q(e,{shortValues:t,decimalPlaces:r}){if(!(0,X.lk)(t)||1e3>Math.abs(e)){let n={style:"unit",unit:"byte",unitDisplay:"long",useGrouping:!0};return(0,X.ej)(r)?(n.minimumFractionDigits=(0,X.Gs)(r),n.maximumFractionDigits=(0,X.Gs)(r)):(0,X.lk)(t)&&(n.maximumSignificantDigits=3),Intl.NumberFormat("en-US",n).format(e)}return J(e).format({output:"byte",base:"decimal",spaceSeparated:!0,mantissa:(0,X.ej)(r)?r:2,trimMantissa:!(0,X.ej)(r),optionalMantissa:!(0,X.ej)(r)})}let ee="Percent",et="Time";var er=((n={}).milliseconds="millisecond",n.seconds="second",n.minutes="minute",n.hours="hour",n.days="day",n.weeks="week",n.months="month",n.years="year",n);let en={years:31536e3,months:2592e3,weeks:604800,days:86400,hours:3600,minutes:60,seconds:1,milliseconds:.001},ei=["years","months","weeks","days","hours","minutes","seconds","milliseconds"],eo="Throughput",ea={Time:{label:"Time",decimalPlaces:!0},Percent:{label:"percent",decimalPlaces:!0},Decimal:{label:"Decimal",decimalPlaces:!0,shortValues:!0},Bytes:{label:"Bytes",decimalPlaces:!0,shortValues:!0},Throughput:{label:"Throughput",decimalPlaces:!0}},eu={milliseconds:{group:et,label:"Milliseconds"},seconds:{group:et,label:"Seconds"},minutes:{group:et,label:"Minutes"},hours:{group:et,label:"Hours"},days:{group:et,label:"Days"},weeks:{group:et,label:"Weeks"},months:{group:et,label:"Months"},years:{group:et,label:"Years"},percent:{group:ee,label:"Percent (0-100)"},"percent-decimal":{group:ee,label:"Percent (0.0-1.0)"},"%":{disableSelectorOption:!0,group:ee,label:"%"},decimal:{group:"Decimal",label:"Decimal"},bytes:{group:"Bytes",label:"Bytes"},"bits/sec":{group:eo,label:"Bits/sec"},"bytes/sec":{group:eo,label:"Bytes/sec"},"counts/sec":{group:eo,label:"Counts/sec"},"events/sec":{group:eo,label:"Events/sec"},"messages/sec":{group:eo,label:"Messages/sec"},"ops/sec":{group:eo,label:"Ops/sec"},"packets/sec":{group:eo,label:"Packets/sec"},"reads/sec":{group:eo,label:"Reads/sec"},"requests/sec":{group:eo,label:"Requests/sec"},"records/sec":{group:eo,label:"Records/sec"},"rows/sec":{group:eo,label:"Rows/sec"},"writes/sec":{group:eo,label:"Writes/sec"}};function es(e,t){if(void 0===t)return e.toString();if("Bytes"===ec(t))return Q(e,t);if("Decimal"===ec(t))return function(e,{shortValues:t,decimalPlaces:r}){let n={style:"decimal",useGrouping:!0};return(0,X.lk)(t)&&(n.notation="compact"),(0,X.ej)(r)?(n.minimumFractionDigits=(0,X.Gs)(r),n.maximumFractionDigits=(0,X.Gs)(r)):(0,X.lk)(t)&&(n.maximumSignificantDigits=3),Intl.NumberFormat("en-US",n).format(e)}(e,t);if("Percent"===ec(t))return function(e,{unit:t,decimalPlaces:r}){let n={style:"percent",useGrouping:!0};return(0,X.ej)(r)?(n.minimumFractionDigits=(0,X.Gs)(r),n.maximumFractionDigits=(0,X.Gs)(r)):n.maximumSignificantDigits=3,"percent"===t&&(e/=100),Intl.NumberFormat("en-US",n).format(e)}(e,t);if("Time"===ec(t))return function(e,{unit:t,decimalPlaces:r}){var n;if(0===e)return"0s";let i=function(e,t){let r=e*en[t],n=ei[0]||"years",i=n,o=r/en[n];for(i of ei)if((o=r/en[i])>=1)break;return{value:o,unit:i}}(e,t),o={style:"unit",unit:er[i.unit],unitDisplay:"months"===(n=i.unit)||"years"===n?"long":"narrow"};return(0,X.ej)(r)?(o.minimumFractionDigits=(0,X.Gs)(r),o.maximumFractionDigits=(0,X.Gs)(r)):o.maximumSignificantDigits=3,Intl.NumberFormat("en-US",o).format(i.value)}(e,t);if("Throughput"===ec(t))return function(e,{unit:t,shortValues:r,decimalPlaces:n}){if("bytes/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return Q(e,{unit:"bytes",shortValues:r,decimalPlaces:n})+"/"+t}let i={style:"decimal",useGrouping:!0};return(0,X.lk)(r)&&(i.notation="compact"),(0,X.ej)(n)?(i.minimumFractionDigits=(0,X.Gs)(n),i.maximumFractionDigits=(0,X.Gs)(n)):(0,X.lk)(r)&&(i.maximumSignificantDigits=3),Intl.NumberFormat("en-US",i).format(e)+" "+t}(e,t);throw Error(`Unknown unit options ${t}`)}function ec(e){return eu[e.unit].group}function el(e){return ea[eu[e.unit].group]}function ef(e){return!!el(e).decimalPlaces}function ep(e){return!!el(e).shortValues}},15418:function(e,t,r){"use strict";function n(e){return!1!==e}function i(e){return"number"==typeof e}function o(e){return e&&(e<0?e=0:e>20&&(e=20)),e}r.d(t,{Gs:()=>o,ej:()=>i,lk:()=>n})},28900:function(e,t,r){"use strict";r.d(t,{v:()=>a});var n=r(54538),i=r(56141),o=r.n(i);function a(e,t){let r=(0,n.useRef)();return(void 0===r.current||!1===o()(t,r.current.deps))&&(r.current={value:e(),deps:t}),r.current.value}},82545:function(e,t,r){var n=r(81822)(r(77400),"DataView");e.exports=n},96586:function(e,t,r){var n=r(57753),i=r(82452),o=r(22115),a=r(38256),u=r(67426);function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s.prototype.clear=n,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=u,e.exports=s},36301:function(e,t,r){var n=r(63663),i=r(72470),o=r(66165),a=r(71873),u=r(52556);function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s.prototype.clear=n,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=u,e.exports=s},44538:function(e,t,r){var n=r(81822)(r(77400),"Map");e.exports=n},74554:function(e,t,r){var n=r(39448),i=r(7738),o=r(66575),a=r(7238),u=r(38738);function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s.prototype.clear=n,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=u,e.exports=s},64825:function(e,t,r){var n=r(81822)(r(77400),"Promise");e.exports=n},46151:function(e,t,r){var n=r(81822)(r(77400),"Set");e.exports=n},52485:function(e,t,r){var n=r(74554),i=r(38639),o=r(88379);function a(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},23694:function(e,t,r){var n=r(36301),i=r(7354),o=r(5863),a=r(12367),u=r(90748),s=r(97569);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=u,c.prototype.set=s,e.exports=c},96539:function(e,t,r){var n=r(77400).Symbol;e.exports=n},59942:function(e,t,r){var n=r(77400).Uint8Array;e.exports=n},66902:function(e,t,r){var n=r(81822)(r(77400),"WeakMap");e.exports=n},79349:function(e){e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},10263:function(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}},98213:function(e,t,r){var n=r(24701),i=r(2900),o=r(19785),a=r(43854),u=r(42383),s=r(48519),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=o(e),l=!r&&i(e),f=!r&&!l&&a(e),p=!r&&!l&&!f&&s(e),h=r||l||f||p,g=h?n(e.length,String):[],d=g.length;for(var v in e)(t||c.call(e,v))&&!(h&&("length"==v||f&&("offset"==v||"parent"==v)||p&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||u(v,d)))&&g.push(v);return g}},97141:function(e){e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},90756:function(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},73140:function(e,t,r){var n=r(88799),i=r(85638);e.exports=function(e,t,r){(void 0===r||i(e[t],r))&&(void 0!==r||t in e)||n(e,t,r)}},71928:function(e,t,r){var n=r(88799),i=r(85638),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];o.call(e,t)&&i(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},93382:function(e,t,r){var n=r(85638);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return -1}},88799:function(e,t,r){var n=r(42630);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},80158:function(e,t,r){var n=r(11611),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},49819:function(e,t,r){var n=r(18911)();e.exports=n},11324:function(e,t,r){var n=r(97141),i=r(19785);e.exports=function(e,t,r){var o=t(e);return i(e)?o:n(o,r(e))}},99736:function(e,t,r){var n=r(96539),i=r(34840),o=r(21258),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},55829:function(e,t,r){var n=r(99736),i=r(92360);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},32866:function(e,t,r){var n=r(12772),i=r(92360);e.exports=function e(t,r,o,a,u){return t===r||(null!=t&&null!=r&&(i(t)||i(r))?n(t,r,o,a,e,u):t!=t&&r!=r)}},12772:function(e,t,r){var n=r(23694),i=r(27042),o=r(370),a=r(39584),u=r(3533),s=r(19785),c=r(43854),l=r(48519),f="[object Arguments]",p="[object Array]",h="[object Object]",g=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,d,v,m){var b=s(e),y=s(t),x=b?p:u(e),_=y?p:u(t);x=x==f?h:x,_=_==f?h:_;var w=x==h,O=_==h,j=x==_;if(j&&c(e)){if(!c(t))return!1;b=!0,w=!1}if(j&&!w)return m||(m=new n),b||l(e)?i(e,t,r,d,v,m):o(e,t,x,r,d,v,m);if(!(1&r)){var S=w&&g.call(e,"__wrapped__"),N=O&&g.call(t,"__wrapped__");if(S||N){var $=S?e.value():e,D=N?t.value():t;return m||(m=new n),v($,D,r,d,m)}}return!!j&&(m||(m=new n),a(e,t,r,d,v,m))}},46729:function(e,t,r){var n=r(28338),i=r(99678),o=r(11611),a=r(76532),u=/^\[object .+?Constructor\]$/,s=Object.prototype,c=Function.prototype.toString,l=s.hasOwnProperty,f=RegExp("^"+c.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?f:u).test(a(e))}},26972:function(e,t,r){var n=r(99736),i=r(84194),o=r(92360),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[n(e)]}},20186:function(e,t,r){var n=r(56016),i=r(50962),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}},59464:function(e,t,r){var n=r(11611),i=r(56016),o=r(21586),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=i(e),r=[];for(var u in e)"constructor"==u&&(t||!a.call(e,u))||r.push(u);return r}},40015:function(e,t,r){var n=r(23694),i=r(73140),o=r(49819),a=r(68867),u=r(11611),s=r(53893),c=r(97494);e.exports=function e(t,r,l,f,p){t!==r&&o(r,function(o,s){if(p||(p=new n),u(o))a(t,r,s,l,e,f,p);else{var h=f?f(c(t,s),o,s+"",t,r,p):void 0;void 0===h&&(h=o),i(t,s,h)}},s)}},68867:function(e,t,r){var n=r(73140),i=r(2734),o=r(63428),a=r(37561),u=r(97635),s=r(2900),c=r(19785),l=r(36468),f=r(43854),p=r(28338),h=r(11611),g=r(40861),d=r(48519),v=r(97494),m=r(89328);e.exports=function(e,t,r,b,y,x,_){var w=v(e,r),O=v(t,r),j=_.get(O);if(j){n(e,r,j);return}var S=x?x(w,O,r+"",e,t,_):void 0,N=void 0===S;if(N){var $=c(O),D=!$&&f(O),B=!$&&!D&&d(O);S=O,$||D||B?c(w)?S=w:l(w)?S=a(w):D?(N=!1,S=i(O,!0)):B?(N=!1,S=o(O,!0)):S=[]:g(O)||s(O)?(S=w,s(w)?S=m(w):(!h(w)||p(w))&&(S=u(O))):N=!1}N&&(_.set(O,S),y(S,O,b,x,_),_.delete(O)),n(e,r,S)}},1197:function(e,t,r){var n=r(31137),i=r(11871),o=r(63132);e.exports=function(e,t){return o(i(e,t,n),e+"")}},54459:function(e,t,r){var n=r(551),i=r(42630),o=r(31137),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=a},24701:function(e){e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},39334:function(e){e.exports=function(e){return function(t){return e(t)}}},65581:function(e){e.exports=function(e,t){return e.has(t)}},95825:function(e,t,r){var n=r(59942);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},2734:function(e,t,r){e=r.nmd(e);var n=r(77400),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?n.Buffer:void 0,u=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=u?u(r):new e.constructor(r);return e.copy(n),n}},63428:function(e,t,r){var n=r(95825);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},37561:function(e){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},35159:function(e,t,r){var n=r(71928),i=r(88799);e.exports=function(e,t,r,o){var a=!r;r||(r={});for(var u=-1,s=t.length;++u<s;){var c=t[u],l=o?o(r[c],e[c],c,r,e):void 0;void 0===l&&(l=e[c]),a?i(r,c,l):n(r,c,l)}return r}},64937:function(e,t,r){var n=r(77400)["__core-js_shared__"];e.exports=n},7270:function(e,t,r){var n=r(1197),i=r(57535);e.exports=function(e){return n(function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,u=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,u&&i(r[0],r[1],u)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,a)}return t})}},18911:function(e){e.exports=function(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),u=a.length;u--;){var s=a[e?u:++i];if(!1===r(o[s],s,o))break}return t}}},42630:function(e,t,r){var n=r(81822),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},27042:function(e,t,r){var n=r(52485),i=r(90756),o=r(65581);e.exports=function(e,t,r,a,u,s){var c=1&r,l=e.length,f=t.length;if(l!=f&&!(c&&f>l))return!1;var p=s.get(e),h=s.get(t);if(p&&h)return p==t&&h==e;var g=-1,d=!0,v=2&r?new n:void 0;for(s.set(e,t),s.set(t,e);++g<l;){var m=e[g],b=t[g];if(a)var y=c?a(b,m,g,t,e,s):a(m,b,g,e,t,s);if(void 0!==y){if(y)continue;d=!1;break}if(v){if(!i(t,function(e,t){if(!o(v,t)&&(m===e||u(m,e,r,a,s)))return v.push(t)})){d=!1;break}}else if(!(m===b||u(m,b,r,a,s))){d=!1;break}}return s.delete(e),s.delete(t),d}},370:function(e,t,r){var n=r(96539),i=r(59942),o=r(85638),a=r(27042),u=r(19383),s=r(43735),c=n?n.prototype:void 0,l=c?c.valueOf:void 0;e.exports=function(e,t,r,n,c,f,p){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!f(new i(e),new i(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var h=u;case"[object Set]":var g=1&n;if(h||(h=s),e.size!=t.size&&!g)break;var d=p.get(e);if(d)return d==t;n|=2,p.set(e,t);var v=a(h(e),h(t),n,c,f,p);return p.delete(e),v;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},39584:function(e,t,r){var n=r(51385),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,o,a,u){var s=1&r,c=n(e),l=c.length;if(l!=n(t).length&&!s)return!1;for(var f=l;f--;){var p=c[f];if(!(s?p in t:i.call(t,p)))return!1}var h=u.get(e),g=u.get(t);if(h&&g)return h==t&&g==e;var d=!0;u.set(e,t),u.set(t,e);for(var v=s;++f<l;){var m=e[p=c[f]],b=t[p];if(o)var y=s?o(b,m,p,t,e,u):o(m,b,p,e,t,u);if(!(void 0===y?m===b||a(m,b,r,o,u):y)){d=!1;break}v||(v="constructor"==p)}if(d&&!v){var x=e.constructor,_=t.constructor;x!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof _&&_ instanceof _)&&(d=!1)}return u.delete(e),u.delete(t),d}},39120:function(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},51385:function(e,t,r){var n=r(11324),i=r(83080),o=r(50098);e.exports=function(e){return n(e,o,i)}},95899:function(e,t,r){var n=r(54479);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},81822:function(e,t,r){var n=r(46729),i=r(15371);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},2173:function(e,t,r){var n=r(58023)(Object.getPrototypeOf,Object);e.exports=n},34840:function(e,t,r){var n=r(96539),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,u=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,u),r=e[u];try{e[u]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[u]=r:delete e[u]),i}},83080:function(e,t,r){var n=r(10263),i=r(15937),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,u=a?function(e){return null==e?[]:n(a(e=Object(e)),function(t){return o.call(e,t)})}:i;e.exports=u},3533:function(e,t,r){var n=r(82545),i=r(44538),o=r(64825),a=r(46151),u=r(66902),s=r(99736),c=r(76532),l="[object Map]",f="[object Promise]",p="[object Set]",h="[object WeakMap]",g="[object DataView]",d=c(n),v=c(i),m=c(o),b=c(a),y=c(u),x=s;(n&&x(new n(new ArrayBuffer(1)))!=g||i&&x(new i)!=l||o&&x(o.resolve())!=f||a&&x(new a)!=p||u&&x(new u)!=h)&&(x=function(e){var t=s(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case d:return g;case v:return l;case m:return f;case b:return p;case y:return h}return t}),e.exports=x},15371:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},57753:function(e,t,r){var n=r(35718);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},82452:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}},22115:function(e,t,r){var n=r(35718),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},38256:function(e,t,r){var n=r(35718),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},67426:function(e,t,r){var n=r(35718);e.exports=function(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},97635:function(e,t,r){var n=r(80158),i=r(2173),o=r(56016);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:n(i(e))}},42383:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?0x1fffffffffffff:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},57535:function(e,t,r){var n=r(85638),i=r(80068),o=r(42383),a=r(11611);e.exports=function(e,t,r){if(!a(r))return!1;var u=typeof t;return("number"==u?!!(i(r)&&o(t,r.length)):"string"==u&&t in r)&&n(r[t],e)}},54479:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},99678:function(e,t,r){var n,i=r(64937),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},56016:function(e){var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},63663:function(e){e.exports=function(){this.__data__=[],this.size=0}},72470:function(e,t,r){var n=r(93382),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():i.call(t,r,1),--this.size,!0)}},66165:function(e,t,r){var n=r(93382);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},71873:function(e,t,r){var n=r(93382);e.exports=function(e){return n(this.__data__,e)>-1}},52556:function(e,t,r){var n=r(93382);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},39448:function(e,t,r){var n=r(96586),i=r(36301),o=r(44538);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},7738:function(e,t,r){var n=r(95899);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}},66575:function(e,t,r){var n=r(95899);e.exports=function(e){return n(this,e).get(e)}},7238:function(e,t,r){var n=r(95899);e.exports=function(e){return n(this,e).has(e)}},38738:function(e,t,r){var n=r(95899);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=+(r.size!=i),this}},19383:function(e){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}},35718:function(e,t,r){var n=r(81822)(Object,"create");e.exports=n},50962:function(e,t,r){var n=r(58023)(Object.keys,Object);e.exports=n},21586:function(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},18125:function(e,t,r){e=r.nmd(e);var n=r(39120),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&n.process,u=function(){try{var e=o&&o.require&&o.require("util").types;if(e)return e;return a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=u},21258:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},58023:function(e){e.exports=function(e,t){return function(r){return e(t(r))}}},11871:function(e,t,r){var n=r(79349),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,u=i(o.length-t,0),s=Array(u);++a<u;)s[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=r(s),n(e,this,c)}}},77400:function(e,t,r){var n=r(39120),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},97494:function(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},38639:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},88379:function(e){e.exports=function(e){return this.__data__.has(e)}},43735:function(e){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}},63132:function(e,t,r){var n=r(54459),i=r(49591)(n);e.exports=i},49591:function(e){var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7354:function(e,t,r){var n=r(36301);e.exports=function(){this.__data__=new n,this.size=0}},5863:function(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},12367:function(e){e.exports=function(e){return this.__data__.get(e)}},90748:function(e){e.exports=function(e){return this.__data__.has(e)}},97569:function(e,t,r){var n=r(36301),i=r(44538),o=r(74554);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(e,t),this.size=r.size,this}},76532:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},551:function(e){e.exports=function(e){return function(){return e}}},85638:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},31137:function(e){e.exports=function(e){return e}},2900:function(e,t,r){var n=r(55829),i=r(92360),o=Object.prototype,a=o.hasOwnProperty,u=o.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,"callee")&&!u.call(e,"callee")};e.exports=s},19785:function(e){var t=Array.isArray;e.exports=t},80068:function(e,t,r){var n=r(28338),i=r(84194);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},36468:function(e,t,r){var n=r(80068),i=r(92360);e.exports=function(e){return i(e)&&n(e)}},43854:function(e,t,r){e=r.nmd(e);var n=r(77400),i=r(57714),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,u=a&&a.exports===o?n.Buffer:void 0,s=u?u.isBuffer:void 0;e.exports=s||i},56141:function(e,t,r){var n=r(32866);e.exports=function(e,t){return n(e,t)}},28338:function(e,t,r){var n=r(99736),i=r(11611);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},84194:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},11611:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},92360:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},40861:function(e,t,r){var n=r(99736),i=r(2173),o=r(92360),a=Object.prototype,u=Function.prototype.toString,s=a.hasOwnProperty,c=u.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=s.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==c}},48519:function(e,t,r){var n=r(26972),i=r(39334),o=r(18125),a=o&&o.isTypedArray,u=a?i(a):n;e.exports=u},50098:function(e,t,r){var n=r(98213),i=r(20186),o=r(80068);e.exports=function(e){return o(e)?n(e):i(e)}},53893:function(e,t,r){var n=r(98213),i=r(59464),o=r(80068);e.exports=function(e){return o(e)?n(e,!0):i(e)}},15409:function(e,t,r){var n=r(40015),i=r(7270)(function(e,t,r){n(e,t,r)});e.exports=i},15937:function(e){e.exports=function(){return[]}},57714:function(e){e.exports=function(){return!1}},89328:function(e,t,r){var n=r(35159),i=r(53893);e.exports=function(e){return n(e,i(e))}}}]);
@@ -18,42 +18,4 @@
18
18
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
19
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
20
  * SOFTWARE.
21
- */
22
-
23
- /*!
24
- * decimal.js v10.5.0
25
- * An arbitrary-precision Decimal type for JavaScript.
26
- * https://github.com/MikeMcl/decimal.js
27
- * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
28
- * MIT Licence
29
- */
30
-
31
- /**
32
- * react-table
33
- *
34
- * Copyright (c) TanStack
35
- *
36
- * This source code is licensed under the MIT license found in the
37
- * LICENSE.md file in the root directory of this source tree.
38
- *
39
- * @license MIT
40
- */
41
-
42
- /**
43
- * table-core
44
- *
45
- * Copyright (c) TanStack
46
- *
47
- * This source code is licensed under the MIT license found in the
48
- * LICENSE.md file in the root directory of this source tree.
49
- *
50
- * @license MIT
51
- */
52
-
53
- /**
54
- * @license Fraction.js v4.3.7 31/08/2023
55
- * https://www.xarg.org/2014/03/rational-numbers-in-javascript/
56
- *
57
- * Copyright (c) 2023, Robert Eisele (robert@raw.org)
58
- * Dual licensed under the MIT or GPL Version 2 licenses.
59
- **/
21
+ */
@@ -0,0 +1 @@
1
+ (self.webpackChunkGaugeChart=self.webpackChunkGaugeChart||[]).push([["225"],{14046:function(e,t,n){"use strict";n.d(t,{K2:()=>r,c7:()=>i,gO:()=>a});let r="last",i={first:function(e){return l(e,"first")},last:function(e){return l(e,"last")},"first-number":function(e){return l(e,"first-number")},"last-number":function(e){return l(e,"last-number")},mean:function(e){return l(e,"mean")},sum:function(e){return l(e,"sum")},min:function(e){return l(e,"min")},max:function(e){return l(e,"max")}},a={first:{label:"First",description:"First value"},last:{label:"Last",description:"Last value"},"first-number":{label:"First *",description:"First numeric value"},"last-number":{label:"Last *",description:"Last numeric value"},mean:{label:"Avg",description:"Average value excluding nulls"},sum:{label:"Sum",description:"The sum of all values"},min:{label:"Min",description:"Minimum value"},max:{label:"Max",description:"Maximum value"}};function l(e,t){return function(e,t){let n=t.reduce((e,t)=>(e[t]=void 0,e),{}),r=0,i=0;return e.forEach((t,a)=>{let l=t[1];0===a&&"first"in n&&(n.first=l),a===e.length-1&&"last"in n&&(n.last=l),"number"==typeof l&&(r+=1,i+=l,"first-number"in n&&void 0===n["first-number"]&&(n["first-number"]=l),"last-number"in n&&(n["last-number"]=l),"min"in n&&("number"!=typeof n.min?n.min=l:n.min=Math.min(n.min,l)),"max"in n&&("number"!=typeof n.max?n.max=l:n.max=Math.max(n.max,l)))}),r>0&&"sum"in n&&(n.sum=i),r>0&&"mean"in n&&(n.mean=i/r),n}(e,[t])[t]}},66070:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},50517:function(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},46560:function(e,t,n){var r=n(10263),i=n(66070),a=n(50517),l=n(24701),o=n(36468),u=Math.max;e.exports=function(e){if(!(e&&e.length))return[];var t=0;return e=r(e,function(e){if(o(e))return t=u(e.length,t),!0}),l(t,function(t){return i(e,a(t))})}},75940:function(e,t,n){var r=n(1197)(n(46560));e.exports=r},59689:function(e,t,n){"use strict";n.r(t),n.d(t,{GaugeChart:()=>O});let r={unit:"percent-decimal"};var i=n(24246),a=n(8695),l=n(83941),o=n(27463),u=n(96494),s=n(15409),h=n.n(s),c=n(25283),d=n(36372),m=n(66224),f=n(14046),p=n(54538),v=n(75940),g=n.n(v);let x={steps:[{value:0}]};var w=n(28900),b=n(74664),C=n(36232),y=n(78846),j=n(65201),L=n(23709),M=n(67745),S=n(50378);function E(e){let{width:t,height:n,data:r,format:a,axisLine:o,max:u}=e,s=(0,l.useChartsTheme)(),h=(0,w.v)(()=>{var e;if(void 0===r.value)return s.noDataOption;let i=function(e,t,n,r){let i=Math.min(n,r)/(("number"==typeof e?(0,b.Bw)(e,t):`${e}`).length??2)*.7;return`clamp(3px, ${i}px, 24px)`}(r.value,a,t,n);return{title:{show:!1},tooltip:{show:!1},series:[{type:"gauge",center:["50%","65%"],radius:"86%",startAngle:200,endAngle:-20,min:0,max:u,silent:!0,progress:{show:!0,width:16,itemStyle:{color:"auto"}},pointer:{show:!1},axisLine:{lineStyle:{color:[[1,"rgba(127,127,127,0.35)"]],width:16}},axisTick:{show:!1,distance:0},splitLine:{show:!1},axisLabel:{show:!1,distance:-18,color:"#999",fontSize:12},anchor:{show:!1},title:{show:!1},detail:{show:!1},data:[{value:r.value}]},{type:"gauge",center:["50%","65%"],radius:"100%",startAngle:200,endAngle:-20,min:0,max:u,pointer:{show:!0,icon:t>170?"path://M12.8,0.7l12,40.1H0.7L12.8,0.7z":"none",length:10,width:5,offsetCenter:[0,"-49%"],itemStyle:{color:"auto"}},axisLine:o,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},detail:{show:!0,width:"60%",borderRadius:8,offsetCenter:[0,"-9%"],color:"inherit",fontSize:i,formatter:null===r.value?()=>"null":e=>(0,b.Bw)(e,a)},data:[{value:r.value,name:r.label,title:{show:!0,color:(null===(e=s.echartsTheme.textStyle)||void 0===e?void 0:e.color)??"inherit",offsetCenter:[0,"55%"],overflow:"truncate",fontSize:12,width:.8*t}}]}]}},[r,t,n,s,a,o,u]);return(0,i.jsx)(l.EChart,{sx:{width:t,height:n,padding:`${s.container.padding.default}px`},option:h,theme:s.echartsTheme})}(0,C.D)([y.N,j.N,L.N,M.N,S.N]);let T={label:"",value:void 0},O={PanelComponent:function(e){let{spec:t,contentDimensions:n,queryResults:a}=e,{calculation:o,max:u}=t,{thresholds:s}=(0,l.useChartsTheme)(),m=h()({},r,t.format),v=t.thresholds??x,w=(0,p.useMemo)(()=>{var e;if((null===(e=a[0])||void 0===e?void 0:e.data)===void 0)return[];void 0===f.c7[o]&&console.warn(`Invalid GaugeChart panel calculation ${o}, fallback to ${f.K2}`);let t=f.c7[o]??f.c7[f.K2],n=[];for(let e of a[0].data.series){let r={value:t(e.values),label:e.formattedName??""};n.push(r)}return n},[a,o]);if(void 0===n)return null;let b=u;void 0===b&&(b="percent"===m.unit?100:1);let C={show:!0,lineStyle:{width:5,color:function(e,t,n,r){let i=e.defaultColor??r.defaultColor,a=[[0,i]];if(void 0===e.steps)return a;{let t=e.steps.map(t=>"percent"===e.mode?t.value/100:t.value/n);t.push(1);let a=e.steps.map((e,t)=>e.color??r.palette[t]);return a.unshift(i),g()(t,a).map(e=>[e[0]??1,e[1]??i])}}(v,0,b,s)}};if(0===w.length)return(0,i.jsx)(E,{width:n.width,height:n.height,data:T,format:m,axisLine:C,max:b});let y=n.width/w.length-20;y<90&&w.length>1&&(y=90);let j=w.length>1;return(0,i.jsx)(c.Z,{direction:"row",spacing:2*!!j,justifyContent:j?"left":"center",alignItems:"center",sx:{overflowX:w.length>1?"scroll":"auto"},children:w.map((e,t)=>(0,i.jsx)(d.Z,{children:(0,i.jsx)(E,{width:y,height:n.height,data:e,format:m,axisLine:C,max:b})},`gauge-series-${t}`))})},LoadingComponent:function(e){let{contentDimensions:t}=e;return void 0===t?null:(0,i.jsx)(m.Z,{sx:{margin:"0 auto"},variant:"circular",width:t.width>t.height?t.height:t.width,height:t.height})},supportedQueryTypes:["TimeSeriesQuery"],panelOptionsEditorComponents:[{label:"Settings",content:function(e){let{onChange:t,value:n}=e,s=h()({},r,n.format),c="Enter value";return"percent"===s.unit?c="100":"percent-decimal"===s.unit&&(c="1"),(0,i.jsxs)(l.OptionsEditorGrid,{children:[(0,i.jsx)(l.OptionsEditorColumn,{children:(0,i.jsxs)(l.OptionsEditorGroup,{title:"Misc",children:[(0,i.jsx)(l.FormatControls,{value:s,onChange:e=>{t((0,u.produce)(n,t=>{t.format=e}))}}),(0,i.jsx)(o.CalculationSelector,{value:n.calculation,onChange:e=>{t((0,u.produce)(n,t=>{t.calculation=e}))}}),(0,i.jsx)(l.OptionsEditorControl,{label:"Max",control:(0,i.jsx)(a.Z,{type:"number",value:n.max??"",onChange:e=>{let r=e.target.value?Number(e.target.value):void 0;t((0,u.produce)(n,e=>{e.max=r}))},placeholder:c})})]})}),(0,i.jsx)(l.OptionsEditorColumn,{children:(0,i.jsx)(l.ThresholdsEditor,{thresholds:n.thresholds,onChange:e=>{t((0,u.produce)(n,t=>{t.thresholds=e}))}})})]})}}],createInitialOptions:function(){return{calculation:"last-number",format:r,thresholds:{steps:[{value:.8},{value:.9}]}}}}}}]);
@@ -0,0 +1 @@
1
+ (()=>{var e={5311:function(e,r,t){Promise.all([t.e("677"),t.e("179"),t.e("620")]).then(t.bind(t,29161))}},r={};function t(n){var a=r[n];if(void 0!==a)return a.exports;var o=r[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}t.m=e,t.c=r,t.federation||(t.federation={chunkMatcher:function(e){return!/^(1(26|57|79)|263|494|54|667|677|759|879|946)$/.test(e)}}),t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((r,n)=>(t.f[n](e,r),r),[])),t.u=e=>"__mf/js/async/"+("118"===e?"lib-router":e)+"."+({118:"c799dfc6",162:"e82ae267",173:"5bfb1682",214:"6d1beb4f",224:"dd9ee618",238:"3b90e0d1",292:"d6d07d9c",296:"6e15d7c1",413:"8c98e66f",553:"db3ebdeb",610:"73ae67bf",620:"eb985bf1",623:"afdd0af8",656:"75485b0e",694:"8b956cd7",738:"e2de8ee4",740:"a7a03e99",75:"4ebd94ad",770:"1ddcdb57",774:"db64c396",790:"4aa856ac",808:"4e339e11",82:"d6d76c84",885:"6fe431cc",9:"a35c8e86",929:"fde3d617",930:"dbd05e3e",957:"3c868e35",960:"fb84169e",964:"80d5e8c0",981:"6ecc2fa1"})[e]+".js",t.miniCssF=e=>"__mf/css/async/"+e+"."+({263:"683bd428",759:"683bd428"})[e]+".css",t.h=()=>"82f8ad6ae2039327",(()=>{t.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={},r="GaugeChart:";t.l=function(n,a,o,i){if(e[n]){e[n].push(a);return}if(void 0!==o)for(var s,l,c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==r+o){s=u;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,t.nc&&s.setAttribute("nonce",t.nc),s.setAttribute("data-webpack",r+o),s.src=n),e[n]=[a];var f=function(r,t){s.onerror=s.onload=null,clearTimeout(h);var a=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach(function(e){return e(t)}),r)return r(t)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),l&&document.head.appendChild(s)}})(),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.nc=void 0,(()=>{var e=[];t.O=(r,n,a,o)=>{if(n){o=o||0;for(var i=e.length;i>0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[n,a,o];return}for(var s=1/0,i=0;i<e.length;i++){for(var[n,a,o]=e[i],l=!0,c=0;c<n.length;c++)(!1&o||s>=o)&&Object.keys(t.O).every(e=>t.O[e](n[c]))?n.splice(c--,1):(l=!1,o<s&&(s=o));if(l){e.splice(i--,1);var d=a();void 0!==d&&(r=d)}}return r}})(),t.p="/plugins/GaugeChart/",t.rv=()=>"1.2.8",t.j="909",t.S={},t.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@emotion/react",version:"11.14.0",factory:()=>Promise.all([t.e("960"),t.e("677"),t.e("930")]).then(()=>()=>t(96434)),eager:0,singleton:1,requiredVersion:"^11.11.3"},{name:"@emotion/styled",version:"11.14.0",factory:()=>Promise.all([t.e("677"),t.e("157"),t.e("694")]).then(()=>()=>t(51958)),eager:0,singleton:1},{name:"@hookform/resolvers",version:"3.10.0",factory:()=>Promise.all([t.e("292"),t.e("677"),t.e("214")]).then(()=>()=>t(81228)),eager:0,singleton:1},{name:"@perses-dev/components",version:"0.51.0-beta.1",factory:()=>Promise.all([t.e("238"),t.e("224"),t.e("292"),t.e("413"),t.e("9"),t.e("885"),t.e("929"),t.e("82"),t.e("808"),t.e("957"),t.e("677"),t.e("157"),t.e("879"),t.e("179"),t.e("946"),t.e("126"),t.e("759")]).then(()=>()=>t(84056)),eager:0,singleton:1},{name:"@perses-dev/plugin-system",version:"0.51.0-beta.1",factory:()=>Promise.all([t.e("118"),t.e("292"),t.e("885"),t.e("929"),t.e("808"),t.e("162"),t.e("677"),t.e("157"),t.e("879"),t.e("179"),t.e("946"),t.e("54"),t.e("667"),t.e("656")]).then(()=>()=>t(57910)),eager:0,singleton:1},{name:"date-fns",version:"4.1.0",factory:()=>Promise.all([t.e("238"),t.e("224"),t.e("75")]).then(()=>()=>t(99657)),eager:0,singleton:1},{name:"echarts",version:"5.5.0",factory:()=>Promise.all([t.e("413"),t.e("9"),t.e("610")]).then(()=>()=>t(2138)),eager:0,singleton:1},{name:"immer",version:"10.1.1",factory:()=>t.e("774").then(()=>()=>t(75586)),eager:0,singleton:1},{name:"lodash",version:"4.17.21",factory:()=>t.e("981").then(()=>()=>t(98784)),eager:0,singleton:1},{name:"mdi-material-ui",version:"7.9.3",factory:()=>Promise.all([t.e("929"),t.e("296"),t.e("677"),t.e("157"),t.e("946")]).then(()=>()=>t(61157)),eager:0,singleton:1,requiredVersion:"7.4.0"},{name:"react-dom",version:"18.3.1",factory:()=>Promise.all([t.e("173"),t.e("677")]).then(()=>()=>t(31542)),eager:0,singleton:1,requiredVersion:"18.2.0"},{name:"react",version:"18.3.1",factory:()=>t.e("964").then(()=>()=>t(27378)),eager:0,singleton:1,requiredVersion:"18.2.0"},{name:"use-resize-observer",version:"9.1.0",factory:()=>Promise.all([t.e("677"),t.e("553")]).then(()=>()=>t(75276)),eager:0,singleton:1,requiredVersion:"9.1.0"}]},uniqueName:"GaugeChart"},t.I=t.I||function(){throw Error("should have __webpack_require__.I")},t.consumesLoadingData={chunkMapping:{667:["96494"],126:["99010"],494:["57871"],946:["45913"],179:["6085"],54:["68393","74614","72103","55352","58118","57751","30156","55922","84275","3553"],157:["72116"],879:["4665","20461","10223"],677:["54538"]},moduleIdToConsumeDataMapping:{57751:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>t(57910)},30156:{shareScope:"default",shareKey:"echarts",import:"echarts",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("413"),t.e("9"),t.e("610")]).then(()=>()=>t(2138))},99010:{shareScope:"default",shareKey:"immer",import:"immer",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("774").then(()=>()=>t(75586))},96494:{shareScope:"default",shareKey:"immer",import:"immer",requiredVersion:"^10.1.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("774").then(()=>()=>t(75586))},72116:{shareScope:"default",shareKey:"@emotion/react",import:"@emotion/react",requiredVersion:"^11.11.3",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("960").then(()=>()=>t(96434))},68393:{shareScope:"default",shareKey:"@perses-dev/components",import:"@perses-dev/components",requiredVersion:"0.51.0-beta.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("238"),t.e("224"),t.e("413"),t.e("9"),t.e("82"),t.e("957"),t.e("126"),t.e("263")]).then(()=>()=>t(84056))},74614:{shareScope:"default",shareKey:"lodash",import:"lodash",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("981").then(()=>()=>t(98784))},72103:{shareScope:"default",shareKey:"mdi-material-ui",import:"mdi-material-ui",requiredVersion:"7.4.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("296").then(()=>()=>t(61157))},4665:{shareScope:"default",shareKey:"date-fns-tz",import:"date-fns-tz",requiredVersion:"^3.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("224"),t.e("740"),t.e("494")]).then(()=>()=>t(48872))},54538:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("964").then(()=>()=>t(27378))},55922:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("770").then(()=>()=>t(51958))},84275:{shareScope:"default",shareKey:"@hookform/resolvers",import:"@hookform/resolvers",requiredVersion:"^2.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("738").then(()=>()=>t(81228))},20461:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^4.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("238"),t.e("224"),t.e("75")]).then(()=>()=>t(99657))},10223:{shareScope:"default",shareKey:"use-resize-observer",import:"use-resize-observer",requiredVersion:"9.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("623").then(()=>()=>t(75276))},3553:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"0.51.0-beta.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>t(57910)},6085:{shareScope:"default",shareKey:"react-dom",import:"react-dom",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("173").then(()=>()=>t(31542))},57871:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^3.0.0 || ^4.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("238"),t.e("75")]).then(()=>()=>t(99657))},55352:{shareScope:"default",shareKey:"immer",import:"immer",requiredVersion:">=8.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("774").then(()=>()=>t(75586))},58118:{shareScope:"default",shareKey:"immer",import:"immer",requiredVersion:">=9.0.6",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("774").then(()=>()=>t(75586))},45913:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"^11.3.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("790").then(()=>()=>t(51958))}},initialConsumes:[]},t.f.consumes=t.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")},(()=>{if("undefined"!=typeof document){var e=function(e,r,n,a,o){var i=document.createElement("link");return i.rel="stylesheet",i.type="text/css",t.nc&&(i.nonce=t.nc),i.onerror=i.onload=function(t){if(i.onerror=i.onload=null,"load"===t.type)a();else{var n=t&&("load"===t.type?"missing":t.type),s=t&&t.target&&t.target.href||r,l=Error("Loading CSS chunk "+e+" failed.\\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=n,l.request=s,i.parentNode&&i.parentNode.removeChild(i),o(l)}},i.href=r,n?n.parentNode.insertBefore(i,n.nextSibling):document.head.appendChild(i),i},r=function(e,r){for(var t=document.getElementsByTagName("link"),n=0;n<t.length;n++){var a=t[n],o=a.getAttribute("data-href")||a.getAttribute("href");if("stylesheet"===a.rel&&(o===e||o===r))return a}for(var i=document.getElementsByTagName("style"),n=0;n<i.length;n++){var a=i[n],o=a.getAttribute("data-href");if(o===e||o===r)return a}},n={909:0};t.f.miniCss=function(a,o){if(n[a])o.push(n[a]);else if(0!==n[a]&&({263:1,759:1})[a])o.push(n[a]=new Promise(function(n,o){var i=t.miniCssF(a),s=t.p+i;if(r(i,s))return n();e(a,s,null,n,o)}).then(function(){n[a]=0},function(e){throw delete n[a],e}))}}})(),(()=>{var e={909:0};t.f.j=function(r,n){var a=t.o(e,r)?e[r]:void 0;if(0!==a){if(a)n.push(a[2]);else if(/^(1(26|57|79)|263|494|54|667|677|759|879|946)$/.test(r))e[r]=0;else{var o=new Promise((t,n)=>a=e[r]=[t,n]);n.push(a[2]=o);var i=t.p+t.u(r),s=Error();t.l(i,function(n){if(t.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,a[1](s)}},"chunk-"+r,r)}}},t.O.j=r=>0===e[r];var r=(r,n)=>{var a,o,[i,s,l]=n,c=0;if(i.some(r=>0!==e[r])){for(a in s)t.o(s,a)&&(t.m[a]=s[a]);if(l)var d=l(t)}for(r&&r(n);c<i.length;c++)o=i[c],t.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return t.O(d)},n=self.webpackChunkGaugeChart=self.webpackChunkGaugeChart||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))})(),t.ruid="bundler=rspack@1.2.8",t.O(void 0,["481"],function(){return t(8705)});var n=t.O(void 0,["481"],function(){return t(5311)});n=t.O(n)})();
@@ -0,0 +1,23 @@
1
+ import { FormatOptions } from '@perses-dev/core';
2
+ import { GaugeSeriesOption } from 'echarts/charts';
3
+ import { ReactElement } from 'react';
4
+ export type GaugeChartValue = number | null | undefined;
5
+ export type GaugeSeries = {
6
+ value: GaugeChartValue;
7
+ label: string;
8
+ };
9
+ export interface GaugeChartBaseProps {
10
+ width: number;
11
+ height: number;
12
+ data: GaugeSeries;
13
+ format: FormatOptions;
14
+ axisLine: GaugeSeriesOption['axisLine'];
15
+ max?: number;
16
+ }
17
+ export declare function GaugeChartBase(props: GaugeChartBaseProps): ReactElement;
18
+ /**
19
+ * Responsive font size depending on number of characters, clamp used
20
+ * to ensure size stays within given range
21
+ */
22
+ export declare function getResponsiveValueSize(value: number | null, format: FormatOptions, width: number, height: number): string;
23
+ //# sourceMappingURL=GaugeChartBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GaugeChartBase.d.ts","sourceRoot":"","sources":["../../src/GaugeChartBase.tsx"],"names":[],"mappings":"AAcA,OAAO,EAA4B,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAmC,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGpF,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AASrC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAuJvE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,MAAM,CAQR"}
@@ -0,0 +1,213 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { EChart, useChartsTheme } from '@perses-dev/components';
15
+ import { formatValue, useDeepMemo } from '@perses-dev/core';
16
+ import { use } from 'echarts/core';
17
+ import { GaugeChart as EChartsGaugeChart } from 'echarts/charts';
18
+ import { GridComponent, TitleComponent, TooltipComponent } from 'echarts/components';
19
+ import { CanvasRenderer } from 'echarts/renderers';
20
+ use([
21
+ EChartsGaugeChart,
22
+ GridComponent,
23
+ TitleComponent,
24
+ TooltipComponent,
25
+ CanvasRenderer
26
+ ]);
27
+ const PROGRESS_WIDTH = 16;
28
+ // adjusts when to show pointer icon
29
+ const GAUGE_SMALL_BREAKPOINT = 170;
30
+ export function GaugeChartBase(props) {
31
+ const { width, height, data, format, axisLine, max } = props;
32
+ const chartsTheme = useChartsTheme();
33
+ // useDeepMemo ensures value size util does not rerun everytime you hover on the chart
34
+ const option = useDeepMemo(()=>{
35
+ if (data.value === undefined) return chartsTheme.noDataOption;
36
+ // adjusts fontSize depending on number of characters
37
+ const valueSizeClamp = getResponsiveValueSize(data.value, format, width, height);
38
+ return {
39
+ title: {
40
+ show: false
41
+ },
42
+ tooltip: {
43
+ show: false
44
+ },
45
+ series: [
46
+ {
47
+ type: 'gauge',
48
+ center: [
49
+ '50%',
50
+ '65%'
51
+ ],
52
+ radius: '86%',
53
+ startAngle: 200,
54
+ endAngle: -20,
55
+ min: 0,
56
+ max,
57
+ silent: true,
58
+ progress: {
59
+ show: true,
60
+ width: PROGRESS_WIDTH,
61
+ itemStyle: {
62
+ color: 'auto'
63
+ }
64
+ },
65
+ pointer: {
66
+ show: false
67
+ },
68
+ axisLine: {
69
+ lineStyle: {
70
+ color: [
71
+ [
72
+ 1,
73
+ 'rgba(127,127,127,0.35)'
74
+ ]
75
+ ],
76
+ width: PROGRESS_WIDTH
77
+ }
78
+ },
79
+ axisTick: {
80
+ show: false,
81
+ distance: 0
82
+ },
83
+ splitLine: {
84
+ show: false
85
+ },
86
+ axisLabel: {
87
+ show: false,
88
+ distance: -18,
89
+ color: '#999',
90
+ fontSize: 12
91
+ },
92
+ anchor: {
93
+ show: false
94
+ },
95
+ title: {
96
+ show: false
97
+ },
98
+ detail: {
99
+ show: false
100
+ },
101
+ data: [
102
+ {
103
+ value: data.value
104
+ }
105
+ ]
106
+ },
107
+ {
108
+ type: 'gauge',
109
+ center: [
110
+ '50%',
111
+ '65%'
112
+ ],
113
+ radius: '100%',
114
+ startAngle: 200,
115
+ endAngle: -20,
116
+ min: 0,
117
+ max,
118
+ pointer: {
119
+ show: true,
120
+ // pointer hidden for small panels, path taken from ex: https://echarts.apache.org/examples/en/editor.html?c=gauge-grade
121
+ icon: width > GAUGE_SMALL_BREAKPOINT ? 'path://M12.8,0.7l12,40.1H0.7L12.8,0.7z' : 'none',
122
+ length: 10,
123
+ width: 5,
124
+ offsetCenter: [
125
+ 0,
126
+ '-49%'
127
+ ],
128
+ itemStyle: {
129
+ color: 'auto'
130
+ }
131
+ },
132
+ axisLine,
133
+ axisTick: {
134
+ show: false
135
+ },
136
+ splitLine: {
137
+ show: false
138
+ },
139
+ axisLabel: {
140
+ show: false
141
+ },
142
+ detail: {
143
+ show: true,
144
+ width: '60%',
145
+ borderRadius: 8,
146
+ offsetCenter: [
147
+ 0,
148
+ '-9%'
149
+ ],
150
+ color: 'inherit',
151
+ fontSize: valueSizeClamp,
152
+ formatter: data.value === null ? // at this level because the `formatter` function argument is `NaN`
153
+ // when the value is `null`, making it difficult to differentiate
154
+ // `null` from a true `NaN` case.
155
+ ()=>'null' : (value)=>{
156
+ return formatValue(value, format);
157
+ }
158
+ },
159
+ data: [
160
+ {
161
+ value: data.value,
162
+ name: data.label,
163
+ // TODO: new UX for series names, create separate React component or reuse ListLegendItem
164
+ // https://echarts.apache.org/en/option.html#series-gauge.data.title
165
+ title: {
166
+ show: true,
167
+ color: chartsTheme.echartsTheme.textStyle?.color ?? 'inherit',
168
+ offsetCenter: [
169
+ 0,
170
+ '55%'
171
+ ],
172
+ overflow: 'truncate',
173
+ fontSize: 12,
174
+ width: width * 0.8
175
+ }
176
+ }
177
+ ]
178
+ }
179
+ ]
180
+ };
181
+ }, [
182
+ data,
183
+ width,
184
+ height,
185
+ chartsTheme,
186
+ format,
187
+ axisLine,
188
+ max
189
+ ]);
190
+ return /*#__PURE__*/ _jsx(EChart, {
191
+ sx: {
192
+ width: width,
193
+ height: height,
194
+ padding: `${chartsTheme.container.padding.default}px`
195
+ },
196
+ option: option,
197
+ theme: chartsTheme.echartsTheme
198
+ });
199
+ }
200
+ /**
201
+ * Responsive font size depending on number of characters, clamp used
202
+ * to ensure size stays within given range
203
+ */ export function getResponsiveValueSize(value, format, width, height) {
204
+ const MIN_SIZE = 3;
205
+ const MAX_SIZE = 24;
206
+ const SIZE_MULTIPLIER = 0.7;
207
+ const formattedValue = typeof value === 'number' ? formatValue(value, format) : `${value}`;
208
+ const valueCharacters = formattedValue.length ?? 2;
209
+ const valueSize = Math.min(width, height) / valueCharacters * SIZE_MULTIPLIER;
210
+ return `clamp(${MIN_SIZE}px, ${valueSize}px, ${MAX_SIZE}px)`;
211
+ }
212
+
213
+ //# sourceMappingURL=GaugeChartBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/GaugeChartBase.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { EChart, useChartsTheme } from '@perses-dev/components';\nimport { formatValue, useDeepMemo, FormatOptions } from '@perses-dev/core';\nimport { use, EChartsCoreOption } from 'echarts/core';\nimport { GaugeChart as EChartsGaugeChart, GaugeSeriesOption } from 'echarts/charts';\nimport { GridComponent, TitleComponent, TooltipComponent } from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { ReactElement } from 'react';\n\nuse([EChartsGaugeChart, GridComponent, TitleComponent, TooltipComponent, CanvasRenderer]);\n\nconst PROGRESS_WIDTH = 16;\n\n// adjusts when to show pointer icon\nconst GAUGE_SMALL_BREAKPOINT = 170;\n\nexport type GaugeChartValue = number | null | undefined;\n\nexport type GaugeSeries = {\n value: GaugeChartValue;\n label: string;\n};\n\nexport interface GaugeChartBaseProps {\n width: number;\n height: number;\n data: GaugeSeries;\n format: FormatOptions;\n axisLine: GaugeSeriesOption['axisLine'];\n max?: number;\n}\n\nexport function GaugeChartBase(props: GaugeChartBaseProps): ReactElement {\n const { width, height, data, format, axisLine, max } = props;\n const chartsTheme = useChartsTheme();\n\n // useDeepMemo ensures value size util does not rerun everytime you hover on the chart\n const option: EChartsCoreOption = useDeepMemo(() => {\n if (data.value === undefined) return chartsTheme.noDataOption;\n\n // adjusts fontSize depending on number of characters\n const valueSizeClamp = getResponsiveValueSize(data.value, format, width, height);\n\n return {\n title: {\n show: false,\n },\n tooltip: {\n show: false,\n },\n series: [\n {\n type: 'gauge',\n center: ['50%', '65%'],\n radius: '86%',\n startAngle: 200,\n endAngle: -20,\n min: 0,\n max,\n silent: true,\n progress: {\n show: true,\n width: PROGRESS_WIDTH,\n itemStyle: {\n color: 'auto',\n },\n },\n pointer: {\n show: false,\n },\n axisLine: {\n lineStyle: {\n color: [[1, 'rgba(127,127,127,0.35)']], // TODO (sjcobb): use future chart theme colors\n width: PROGRESS_WIDTH,\n },\n },\n axisTick: {\n show: false,\n distance: 0,\n },\n splitLine: {\n show: false,\n },\n axisLabel: {\n show: false,\n distance: -18,\n color: '#999',\n fontSize: 12,\n },\n anchor: {\n show: false,\n },\n title: {\n show: false,\n },\n detail: {\n show: false,\n },\n data: [\n {\n value: data.value,\n },\n ],\n },\n {\n type: 'gauge',\n center: ['50%', '65%'],\n radius: '100%',\n startAngle: 200,\n endAngle: -20,\n min: 0,\n max,\n pointer: {\n show: true,\n // pointer hidden for small panels, path taken from ex: https://echarts.apache.org/examples/en/editor.html?c=gauge-grade\n icon: width > GAUGE_SMALL_BREAKPOINT ? 'path://M12.8,0.7l12,40.1H0.7L12.8,0.7z' : 'none',\n length: 10,\n width: 5,\n offsetCenter: [0, '-49%'],\n itemStyle: {\n color: 'auto',\n },\n },\n axisLine,\n axisTick: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n axisLabel: {\n show: false,\n },\n detail: {\n show: true,\n width: '60%',\n borderRadius: 8,\n offsetCenter: [0, '-9%'],\n color: 'inherit', // allows value color to match active threshold color\n fontSize: valueSizeClamp,\n formatter:\n data.value === null\n ? // We use a different function when we *know* the value is null\n // at this level because the `formatter` function argument is `NaN`\n // when the value is `null`, making it difficult to differentiate\n // `null` from a true `NaN` case.\n (): string => 'null'\n : (value: number): string | undefined => {\n return formatValue(value, format);\n },\n },\n data: [\n {\n value: data.value,\n name: data.label,\n // TODO: new UX for series names, create separate React component or reuse ListLegendItem\n // https://echarts.apache.org/en/option.html#series-gauge.data.title\n title: {\n show: true,\n color: chartsTheme.echartsTheme.textStyle?.color ?? 'inherit', // series name font color\n offsetCenter: [0, '55%'],\n overflow: 'truncate',\n fontSize: 12,\n width: width * 0.8,\n },\n },\n ],\n },\n ],\n };\n }, [data, width, height, chartsTheme, format, axisLine, max]);\n\n return (\n <EChart\n sx={{\n width: width,\n height: height,\n padding: `${chartsTheme.container.padding.default}px`,\n }}\n option={option}\n theme={chartsTheme.echartsTheme}\n />\n );\n}\n\n/**\n * Responsive font size depending on number of characters, clamp used\n * to ensure size stays within given range\n */\nexport function getResponsiveValueSize(\n value: number | null,\n format: FormatOptions,\n width: number,\n height: number\n): string {\n const MIN_SIZE = 3;\n const MAX_SIZE = 24;\n const SIZE_MULTIPLIER = 0.7;\n const formattedValue = typeof value === 'number' ? formatValue(value, format) : `${value}`;\n const valueCharacters = formattedValue.length ?? 2;\n const valueSize = (Math.min(width, height) / valueCharacters) * SIZE_MULTIPLIER;\n return `clamp(${MIN_SIZE}px, ${valueSize}px, ${MAX_SIZE}px)`;\n}\n"],"names":["EChart","useChartsTheme","formatValue","useDeepMemo","use","GaugeChart","EChartsGaugeChart","GridComponent","TitleComponent","TooltipComponent","CanvasRenderer","PROGRESS_WIDTH","GAUGE_SMALL_BREAKPOINT","GaugeChartBase","props","width","height","data","format","axisLine","max","chartsTheme","option","value","undefined","noDataOption","valueSizeClamp","getResponsiveValueSize","title","show","tooltip","series","type","center","radius","startAngle","endAngle","min","silent","progress","itemStyle","color","pointer","lineStyle","axisTick","distance","splitLine","axisLabel","fontSize","anchor","detail","icon","length","offsetCenter","borderRadius","formatter","name","label","echartsTheme","textStyle","overflow","sx","padding","container","default","theme","MIN_SIZE","MAX_SIZE","SIZE_MULTIPLIER","formattedValue","valueCharacters","valueSize","Math"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,MAAM,EAAEC,cAAc,QAAQ,yBAAyB;AAChE,SAASC,WAAW,EAAEC,WAAW,QAAuB,mBAAmB;AAC3E,SAASC,GAAG,QAA2B,eAAe;AACtD,SAASC,cAAcC,iBAAiB,QAA2B,iBAAiB;AACpF,SAASC,aAAa,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ,qBAAqB;AACrF,SAASC,cAAc,QAAQ,oBAAoB;AAGnDN,IAAI;IAACE;IAAmBC;IAAeC;IAAgBC;IAAkBC;CAAe;AAExF,MAAMC,iBAAiB;AAEvB,oCAAoC;AACpC,MAAMC,yBAAyB;AAkB/B,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,GAAG,EAAE,GAAGN;IACvD,MAAMO,cAAcpB;IAEpB,sFAAsF;IACtF,MAAMqB,SAA4BnB,YAAY;QAC5C,IAAIc,KAAKM,KAAK,KAAKC,WAAW,OAAOH,YAAYI,YAAY;QAE7D,qDAAqD;QACrD,MAAMC,iBAAiBC,uBAAuBV,KAAKM,KAAK,EAAEL,QAAQH,OAAOC;QAEzE,OAAO;YACLY,OAAO;gBACLC,MAAM;YACR;YACAC,SAAS;gBACPD,MAAM;YACR;YACAE,QAAQ;gBACN;oBACEC,MAAM;oBACNC,QAAQ;wBAAC;wBAAO;qBAAM;oBACtBC,QAAQ;oBACRC,YAAY;oBACZC,UAAU,CAAC;oBACXC,KAAK;oBACLjB;oBACAkB,QAAQ;oBACRC,UAAU;wBACRV,MAAM;wBACNd,OAAOJ;wBACP6B,WAAW;4BACTC,OAAO;wBACT;oBACF;oBACAC,SAAS;wBACPb,MAAM;oBACR;oBACAV,UAAU;wBACRwB,WAAW;4BACTF,OAAO;gCAAC;oCAAC;oCAAG;iCAAyB;6BAAC;4BACtC1B,OAAOJ;wBACT;oBACF;oBACAiC,UAAU;wBACRf,MAAM;wBACNgB,UAAU;oBACZ;oBACAC,WAAW;wBACTjB,MAAM;oBACR;oBACAkB,WAAW;wBACTlB,MAAM;wBACNgB,UAAU,CAAC;wBACXJ,OAAO;wBACPO,UAAU;oBACZ;oBACAC,QAAQ;wBACNpB,MAAM;oBACR;oBACAD,OAAO;wBACLC,MAAM;oBACR;oBACAqB,QAAQ;wBACNrB,MAAM;oBACR;oBACAZ,MAAM;wBACJ;4BACEM,OAAON,KAAKM,KAAK;wBACnB;qBACD;gBACH;gBACA;oBACES,MAAM;oBACNC,QAAQ;wBAAC;wBAAO;qBAAM;oBACtBC,QAAQ;oBACRC,YAAY;oBACZC,UAAU,CAAC;oBACXC,KAAK;oBACLjB;oBACAsB,SAAS;wBACPb,MAAM;wBACN,wHAAwH;wBACxHsB,MAAMpC,QAAQH,yBAAyB,2CAA2C;wBAClFwC,QAAQ;wBACRrC,OAAO;wBACPsC,cAAc;4BAAC;4BAAG;yBAAO;wBACzBb,WAAW;4BACTC,OAAO;wBACT;oBACF;oBACAtB;oBACAyB,UAAU;wBACRf,MAAM;oBACR;oBACAiB,WAAW;wBACTjB,MAAM;oBACR;oBACAkB,WAAW;wBACTlB,MAAM;oBACR;oBACAqB,QAAQ;wBACNrB,MAAM;wBACNd,OAAO;wBACPuC,cAAc;wBACdD,cAAc;4BAAC;4BAAG;yBAAM;wBACxBZ,OAAO;wBACPO,UAAUtB;wBACV6B,WACEtC,KAAKM,KAAK,KAAK,OAEX,mEAAmE;wBACnE,iEAAiE;wBACjE,iCAAiC;wBACjC,IAAc,SACd,CAACA;4BACC,OAAOrB,YAAYqB,OAAOL;wBAC5B;oBACR;oBACAD,MAAM;wBACJ;4BACEM,OAAON,KAAKM,KAAK;4BACjBiC,MAAMvC,KAAKwC,KAAK;4BAChB,yFAAyF;4BACzF,oEAAoE;4BACpE7B,OAAO;gCACLC,MAAM;gCACNY,OAAOpB,YAAYqC,YAAY,CAACC,SAAS,EAAElB,SAAS;gCACpDY,cAAc;oCAAC;oCAAG;iCAAM;gCACxBO,UAAU;gCACVZ,UAAU;gCACVjC,OAAOA,QAAQ;4BACjB;wBACF;qBACD;gBACH;aACD;QACH;IACF,GAAG;QAACE;QAAMF;QAAOC;QAAQK;QAAaH;QAAQC;QAAUC;KAAI;IAE5D,qBACE,KAACpB;QACC6D,IAAI;YACF9C,OAAOA;YACPC,QAAQA;YACR8C,SAAS,GAAGzC,YAAY0C,SAAS,CAACD,OAAO,CAACE,OAAO,CAAC,EAAE,CAAC;QACvD;QACA1C,QAAQA;QACR2C,OAAO5C,YAAYqC,YAAY;;AAGrC;AAEA;;;CAGC,GACD,OAAO,SAAS/B,uBACdJ,KAAoB,EACpBL,MAAqB,EACrBH,KAAa,EACbC,MAAc;IAEd,MAAMkD,WAAW;IACjB,MAAMC,WAAW;IACjB,MAAMC,kBAAkB;IACxB,MAAMC,iBAAiB,OAAO9C,UAAU,WAAWrB,YAAYqB,OAAOL,UAAU,GAAGK,OAAO;IAC1F,MAAM+C,kBAAkBD,eAAejB,MAAM,IAAI;IACjD,MAAMmB,YAAY,AAACC,KAAKnC,GAAG,CAACtB,OAAOC,UAAUsD,kBAAmBF;IAChE,OAAO,CAAC,MAAM,EAAEF,SAAS,IAAI,EAAEK,UAAU,IAAI,EAAEJ,SAAS,GAAG,CAAC;AAC9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"GaugeChartPanel.d.ts","sourceRoot":"","sources":["../../src/GaugeChartPanel.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAwC,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAC9C,OAAO,EAIL,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAO7B,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAEjF,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,GAAG,IAAI,CAwGhF;AAED,wBAAgB,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAUxG"}
1
+ {"version":3,"file":"GaugeChartPanel.d.ts","sourceRoot":"","sources":["../../src/GaugeChartPanel.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAwC,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAC9C,OAAO,EAIL,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAQ7B,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAEjF,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,GAAG,IAAI,CAwGhF;AAED,wBAAgB,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAUxG"}
@@ -12,12 +12,13 @@
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { Box, Skeleton, Stack } from '@mui/material';
15
- import { GaugeChart, useChartsTheme } from '@perses-dev/components';
15
+ import { useChartsTheme } from '@perses-dev/components';
16
16
  import { CalculationsMap, DEFAULT_CALCULATION } from '@perses-dev/core';
17
17
  import merge from 'lodash/merge';
18
18
  import { useMemo } from 'react';
19
19
  import { DEFAULT_FORMAT, DEFAULT_MAX_PERCENT, DEFAULT_MAX_PERCENT_DECIMAL } from './gauge-chart-model';
20
20
  import { convertThresholds, defaultThresholdInput } from './thresholds';
21
+ import { GaugeChartBase } from './GaugeChartBase';
21
22
  const EMPTY_GAUGE_SERIES = {
22
23
  label: '',
23
24
  value: undefined
@@ -72,7 +73,7 @@ export function GaugeChartPanel(props) {
72
73
  };
73
74
  // no data message handled inside chart component
74
75
  if (gaugeData.length === 0) {
75
- return /*#__PURE__*/ _jsx(GaugeChart, {
76
+ return /*#__PURE__*/ _jsx(GaugeChartBase, {
76
77
  width: contentDimensions.width,
77
78
  height: contentDimensions.height,
78
79
  data: EMPTY_GAUGE_SERIES,
@@ -99,7 +100,7 @@ export function GaugeChartPanel(props) {
99
100
  },
100
101
  children: gaugeData.map((series, seriesIndex)=>{
101
102
  return /*#__PURE__*/ _jsx(Box, {
102
- children: /*#__PURE__*/ _jsx(GaugeChart, {
103
+ children: /*#__PURE__*/ _jsx(GaugeChartBase, {
103
104
  width: chartWidth,
104
105
  height: contentDimensions.height,
105
106
  data: series,