@perses-dev/gauge-chart-plugin 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/GaugeChart.0b56a463.js +5 -0
- package/__mf/js/async/109.38fe9d18.js +73 -0
- package/__mf/js/async/116.577ccfb6.js +29 -0
- package/__mf/js/async/119.be08efba.js +111 -0
- package/__mf/js/async/288.6d46d8e7.js +7 -0
- package/__mf/js/async/__federation_expose_GaugeChart.4c068ee6.js +1 -0
- package/__mf/js/main.6a2260a5.js +5 -0
- package/lib/GaugeChartOptionsEditorSettings.d.ts.map +1 -1
- package/lib/GaugeChartOptionsEditorSettings.js +25 -6
- package/lib/GaugeChartOptionsEditorSettings.js.map +1 -1
- package/lib/GaugeChartPanel.d.ts.map +1 -1
- package/lib/GaugeChartPanel.js +18 -18
- package/lib/GaugeChartPanel.js.map +1 -1
- package/lib/cjs/GaugeChartOptionsEditorSettings.js +24 -5
- package/lib/cjs/GaugeChartPanel.js +18 -18
- package/lib/gauge-chart-model.d.ts +3 -0
- package/lib/gauge-chart-model.d.ts.map +1 -1
- package/lib/gauge-chart-model.js.map +1 -1
- package/mf-manifest.json +12 -12
- package/mf-stats.json +12 -12
- package/package.json +5 -5
- package/__mf/js/GaugeChart.4ee4077a.js +0 -5
- package/__mf/js/async/109.c54aa48f.js +0 -73
- package/__mf/js/async/232.93bf9384.js +0 -102
- package/__mf/js/async/241.e1a3a6f9.js +0 -38
- package/__mf/js/async/358.93952ec3.js +0 -7
- package/__mf/js/async/__federation_expose_GaugeChart.45323ba4.js +0 -1
- package/__mf/js/main.317a98e5.js +0 -5
- /package/__mf/js/async/{109.c54aa48f.js.LICENSE.txt → 109.38fe9d18.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{241.e1a3a6f9.js.LICENSE.txt → 119.be08efba.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{358.93952ec3.js.LICENSE.txt → 288.6d46d8e7.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.chunk_GaugeChart=self.chunk_GaugeChart||[]).push([["225"],{14046:function(e,t,n){"use strict";n.d(t,{Dc:()=>o,FB:()=>a,K2:()=>r,c7:()=>i,gO:()=>l});let r="last",i={first:function(e){return a(e,"first")},last:function(e){return a(e,"last")},"first-number":function(e){return a(e,"first-number")},"last-number":function(e){return a(e,"last-number")},mean:function(e){return a(e,"mean")},sum:function(e){return a(e,"sum")},min:function(e){return a(e,"min")},max:function(e){return a(e,"max")}},l={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 o(e,t){let n=t.reduce((e,t)=>(e[t]=void 0,e),{}),r=0,i=0;return e.forEach((t,l)=>{let o=t[1];0===l&&"first"in n&&(n.first=o),l===e.length-1&&"last"in n&&(n.last=o),"number"==typeof o&&(r+=1,i+=o,"first-number"in n&&void 0===n["first-number"]&&(n["first-number"]=o),"last-number"in n&&(n["last-number"]=o),"min"in n&&("number"!=typeof n.min?n.min=o:n.min=Math.min(n.min,o)),"max"in n&&("number"!=typeof n.max?n.max=o:n.max=Math.max(n.max,o)))}),r>0&&"sum"in n&&(n.sum=i),r>0&&"mean"in n&&(n.mean=i/r),n}function a(e,t){return o(e,[t])[t]}},28900:function(e,t,n){"use strict";n.d(t,{t:()=>o,v:()=>a});var r=n(54538),i=n(56141),l=n.n(i);function o(e,t){let n=(0,r.useRef)(),i=!0;for(let e=0;e<t.length;e++)if(n.current?.deps[e]!==t[e]){i=!1;break}return(void 0===n.current||!1===i)&&(n.current={value:e(),deps:t}),n.current.value}function a(e,t){let n=(0,r.useRef)();return(void 0===n.current||!1===l()(t,n.current.deps))&&(n.current={value:e(),deps:t}),n.current.value}},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),l=n(50517),o=n(24701),a=n(36468),u=Math.max;e.exports=function(e){if(!(e&&e.length))return[];var t=0;return e=r(e,function(e){if(a(e))return t=u(e.length,t),!0}),o(t,function(t){return i(e,l(t))})}},75940:function(e,t,n){e.exports=n(1197)(n(46560))},3766:function(e,t,n){"use strict";n.r(t),n.d(t,{GaugeChart:()=>k});let r={unit:"percent-decimal"};var i=n(24246),l=n(8695),o=n(87895),a=n(64010),u=n(87570),s=n(96494),c=n(15409),h=n.n(c),d=n(25283),m=n(36372),f=n(66224),p=n(14046),v=n(54538),g=n(75940),x=n.n(g);let w={steps:[{value:0}]};var b=n(28900),C=n(1148),j=n(36232),y=n(78846),L=n(65201),S=n(23709),M=n(67745),E=n(50378);function O(e){let{width:t,height:n,data:r,format:l,axisLine:o,max:u}=e,s=(0,a.useChartsTheme)(),c=(0,b.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,C.Bw)(e,t):`${e}`).length??2)*.7;return`clamp(3px, ${i}px, 24px)`}(r.value,l,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,C.Bw)(e,l)},data:[{value:r.value,name:r.label,title:{show:!0,color:(null==(e=s.echartsTheme.textStyle)?void 0:e.color)??"inherit",offsetCenter:[0,"55%"],overflow:"truncate",fontSize:12,width:.8*t}}]}]}},[r,t,n,s,l,o,u]);return(0,i.jsx)(a.EChart,{sx:{width:t,height:n,padding:`${s.container.padding.default}px`},option:c,theme:s.echartsTheme})}(0,j.D)([y.N,L.N,S.N,M.N,E.N]);let T={label:"",value:void 0},k={PanelComponent:function(e){let{spec:t,contentDimensions:n,queryResults:l}=e,{calculation:o,max:u,legend:s}=t,{thresholds:c}=(0,a.useChartsTheme)(),f=(null==s?void 0:s.show)??!0,g=h()({},r,t.format),b=t.thresholds??w,C=(0,v.useMemo)(()=>{var e,t,n;let r=[];if(!(null==(n=l[0])||null==(t=n.data)||null==(e=t.series)?void 0:e.length))return r;p.c7[o]||console.warn(`Invalid GaugeChart panel calculation ${o}, fallback to ${p.K2}`);let i=p.c7[o]??p.c7[p.K2];for(let e of l[0].data.series)r.push({value:i(e.values),label:f?e.formattedName??"":""});return r},[l,o,f]);if(!n)return null;let j=u;void 0===j&&(j="percent"===g.unit?100:1);let y={show:!0,lineStyle:{width:5,color:function(e,t,n,r){let i=e.defaultColor??r.defaultColor,l=[[0,i]];if(void 0===e.steps)return l;{let t=e.steps.map(t=>"percent"===e.mode?t.value/100:t.value/n);t.push(1);let l=e.steps.map((e,t)=>e.color??r.palette[t]);return l.unshift(i),x()(t,l).map(e=>[e[0]??1,e[1]??i])}}(b,0,j,c)}};if(!C.length)return(0,i.jsx)(O,{width:n.width,height:n.height,data:T,format:g,axisLine:y,max:j});let L=n.width/C.length-20;L<90&&C.length>1&&(L=90);let S=C.length>1;return(0,i.jsx)(d.Z,{direction:"row",spacing:2*!!S,justifyContent:S?"left":"center",alignItems:"center",sx:{overflowX:C.length>1?"scroll":"auto"},children:C.map((e,t)=>(0,i.jsx)(m.Z,{children:(0,i.jsx)(O,{width:L,height:n.height,data:e,format:g,axisLine:y,max:j})},`gauge-series-${t}`))})},LoadingComponent:function(e){let{contentDimensions:t}=e;return t?(0,i.jsx)(f.Z,{sx:{margin:"0 auto"},variant:"circular",width:t.width>t.height?t.height:t.width,height:t.height}):null},supportedQueryTypes:["TimeSeriesQuery"],panelOptionsEditorComponents:[{label:"Settings",content:function(e){var t;let{onChange:n,value:c}=e,d=(null==c||null==(t=c.legend)?void 0:t.show)??!0,m=h()({},r,c.format),f="Enter value";return"percent"===m.unit?f="100":"percent-decimal"===m.unit&&(f="1"),(0,i.jsxs)(a.OptionsEditorGrid,{children:[(0,i.jsx)(a.OptionsEditorColumn,{children:(0,i.jsxs)(a.OptionsEditorGroup,{title:"Misc",children:[(0,i.jsx)(a.FormatControls,{value:m,onChange:e=>{n((0,s.produce)(c,t=>{t.format=e}))}}),(0,i.jsx)(u.CalculationSelector,{value:c.calculation,onChange:e=>{n((0,s.produce)(c,t=>{t.calculation=e}))}}),(0,i.jsx)(a.OptionsEditorControl,{label:"Max",control:(0,i.jsx)(l.Z,{type:"number",value:c.max??"",onChange:e=>{let t=e.target.value?Number(e.target.value):void 0;n((0,s.produce)(c,e=>{e.max=t}))},placeholder:f})})]})}),(0,i.jsxs)(a.OptionsEditorColumn,{children:[(0,i.jsx)(a.ThresholdsEditor,{thresholds:c.thresholds,onChange:e=>{n((0,s.produce)(c,t=>{t.thresholds=e}))}}),(0,i.jsx)(a.OptionsEditorControl,{label:"Show legend",control:(0,i.jsx)(o.Z,{onChange:()=>{n((0,s.produce)(c,e=>{e.legend={...e.legend,show:!d}}))},checked:d})})]})]})}}],createInitialOptions:function(){return{calculation:"last-number",format:r,thresholds:{steps:[{value:.8},{value:.9}]}}}}}}]);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(()=>{var __webpack_modules__={51623:function(e,t){"use strict";let r="RUNTIME-001",n="RUNTIME-002",o="RUNTIME-003",i="RUNTIME-004",a="RUNTIME-005",s="RUNTIME-006",l="RUNTIME-007",c="RUNTIME-008",u="RUNTIME-009",h="TYPE-001",f="BUILD-001",d="BUILD-002",p=e=>{let t=e.split("-")[0].toLowerCase();return`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${t}/${e}`},m=(e,t,r,n)=>{let o=[`${[t[e]]} #${e}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(p(e)),n&&o.push(`Original Error Message:
|
|
2
|
+
${n}`),o.join("\n")};function g(){return(g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let y={[r]:"Failed to get remoteEntry exports.",[n]:'The remote entry interface does not contain "init"',[o]:"Failed to get manifest.",[i]:"Failed to locate remote.",[a]:"Invalid loadShareSync function call from bundler runtime",[s]:"Invalid loadShareSync function call from runtime",[l]:"Failed to get remote snapshot.",[c]:"Failed to load script resources.",[u]:"Please call createInstance first."},_={[h]:"Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."},E={[f]:"Failed to find expose module.",[d]:"PublicPath is required in prod mode."},b=g({},y,_,E);t.BUILD_001=f,t.BUILD_002=d,t.RUNTIME_001=r,t.RUNTIME_002=n,t.RUNTIME_003=o,t.RUNTIME_004=i,t.RUNTIME_005=a,t.RUNTIME_006=s,t.RUNTIME_007=l,t.RUNTIME_008=c,t.RUNTIME_009=u,t.TYPE_001=h,t.buildDescMap=E,t.errorDescMap=b,t.getShortErrorMsg=m,t.runtimeDescMap=y,t.typeDescMap=_},6023:function(e,t,r){Promise.all([r.e("677"),r.e("179"),r.e("863")]).then(r.bind(r,87102))},45628:function(e,t,r){"use strict";var n=r(13364),o=r(75365),i=r(51623);let a="[ Federation Runtime ]",s=o.createLogger(a);function l(e,t){e||c(t)}function c(e){if(e instanceof Error)throw e.message.startsWith(a)||(e.message=`${a}: ${e.message}`),e;throw Error(`${a}: ${e}`)}function u(e){e instanceof Error&&(e.message.startsWith(a)||(e.message=`${a}: ${e.message}`)),s.warn(e)}function h(e,t){return -1===e.findIndex(e=>e===t)&&e.push(t),e}function f(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function d(e){return void 0!==e.entry}function p(e){return!e.entry.includes(".json")}async function m(e,t){try{return await e()}catch(e){t||u(e);return}}function g(e){return e&&"object"==typeof e}let y=Object.prototype.toString;function _(e){return"[object Object]"===y.call(e)}function E(e,t){let r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function b(e){return Array.isArray(e)?e:[e]}function v(e){let t={url:"",type:"global",globalName:""};return o.isBrowserEnv()||o.isReactNativeEnv()?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}let S=(e,t)=>{let r;return r=e.endsWith("/")?e.slice(0,-1):e,t.startsWith(".")&&(t=t.slice(1)),r+=t},R="object"==typeof globalThis?globalThis:window,I=(()=>{try{return document.defaultView}catch(e){return R}})(),N=I;function $(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function M(e,t){return Object.hasOwnProperty.call(e,t)}M(R,"__GLOBAL_LOADING_REMOTE_ENTRY__")||$(R,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});let T=R.__GLOBAL_LOADING_REMOTE_ENTRY__;function A(e){var t,r,n,o,i,a,s,l,c,u,h,f;M(e,"__VMOK__")&&!M(e,"__FEDERATION__")&&$(e,"__FEDERATION__",e.__VMOK__),M(e,"__FEDERATION__")||($(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),$(e,"__VMOK__",e.__FEDERATION__)),null!=(s=(t=e.__FEDERATION__).__GLOBAL_PLUGIN__)||(t.__GLOBAL_PLUGIN__=[]),null!=(l=(r=e.__FEDERATION__).__INSTANCES__)||(r.__INSTANCES__=[]),null!=(c=(n=e.__FEDERATION__).moduleInfo)||(n.moduleInfo={}),null!=(u=(o=e.__FEDERATION__).__SHARE__)||(o.__SHARE__={}),null!=(h=(i=e.__FEDERATION__).__MANIFEST_LOADING__)||(i.__MANIFEST_LOADING__={}),null!=(f=(a=e.__FEDERATION__).__PRELOADED_MAP__)||(a.__PRELOADED_MAP__=new Map)}function O(){R.__FEDERATION__.__GLOBAL_PLUGIN__=[],R.__FEDERATION__.__INSTANCES__=[],R.__FEDERATION__.moduleInfo={},R.__FEDERATION__.__SHARE__={},R.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(T).forEach(e=>{delete T[e]})}function w(e){R.__FEDERATION__.__INSTANCES__.push(e)}function k(){return R.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function P(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.isDebugMode();t&&(R.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,R.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.19.1")}function D(e,t){if("string"==typeof t){if(e[t])return{value:e[t],key:t};for(let r of Object.keys(e)){let[n,o]=r.split(":"),i=`${n}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}throw Error("key must be string")}A(R),A(I);let x=()=>I.__FEDERATION__.moduleInfo,L=(e,t)=>{let r=D(t,f(e)).value;if(r&&!r.version&&"version"in e&&e.version&&(r.version=e.version),r)return r;if("version"in e&&e.version){let{version:t}=e,r=f(n._object_without_properties_loose(e,["version"])),o=D(I.__FEDERATION__.moduleInfo,r).value;if((null==o?void 0:o.version)===t)return o}},F=e=>L(e,I.__FEDERATION__.moduleInfo),j=(e,t)=>{let r=f(e);return I.__FEDERATION__.moduleInfo[r]=t,I.__FEDERATION__.moduleInfo},H=e=>(I.__FEDERATION__.moduleInfo=n._extends({},I.__FEDERATION__.moduleInfo,e),()=>{for(let t of Object.keys(e))delete I.__FEDERATION__.moduleInfo[t]}),C=(e,t)=>{let r=t||`__FEDERATION_${e}:custom__`,n=R[r];return{remoteEntryKey:r,entryExports:n}},V=e=>{let{__GLOBAL_PLUGIN__:t}=I.__FEDERATION__;e.forEach(e=>{-1===t.findIndex(t=>t.name===e.name)?t.push(e):u(`The plugin ${e.name} has been registered.`)})},U=()=>I.__FEDERATION__.__GLOBAL_PLUGIN__,G=e=>R.__FEDERATION__.__PRELOADED_MAP__.get(e),q=e=>R.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),B="default",K="global",W="[0-9A-Za-z-]+",z=`(?:\\+(${W}(?:\\.${W})*))`,Y="0|[1-9]\\d*",X="[0-9]+",J="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Z=`(?:${X}|${J})`,Q=`(?:-?(${Z}(?:\\.${Z})*))`,ee=`(?:${Y}|${J})`,et=`(?:-(${ee}(?:\\.${ee})*))`,er=`${Y}|x|X|\\*`,en=`[v=\\s]*(${er})(?:\\.(${er})(?:\\.(${er})(?:${et})?${z}?)?)?`,eo=`^\\s*(${en})\\s+-\\s+(${en})\\s*$`,ei=`(${X})\\.(${X})\\.(${X})`,ea=`[v=\\s]*${ei}${Q}?${z}?`,es="((?:<|>)?=?)",el=`(\\s*)${es}\\s*(${ea}|${en})`,ec="(?:~>?)",eu=`(\\s*)${ec}\\s+`,eh="(?:\\^)",ef=`(\\s*)${eh}\\s+`,ed="(<|>)?=?\\s*\\*",ep=`^${eh}${en}$`,em=`(${Y})\\.(${Y})\\.(${Y})`,eg=`v?${em}${et}?${z}?`,ey=`^${ec}${en}$`,e_=`^${es}\\s*${en}$`,eE=`^${es}\\s*(${eg})$|^$`,eb="^\\s*>=\\s*0.0.0\\s*$";function ev(e){return new RegExp(e)}function eS(e){return!e||"x"===e.toLowerCase()||"*"===e}function eR(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce((e,t)=>t(e),e)}function eI(e){return e.match(ev(eE))}function eN(e,t,r,n){let o=`${e}.${t}.${r}`;return n?`${o}-${n}`:o}function e$(e){return e.replace(ev(eo),(e,t,r,n,o,i,a,s,l,c,u,h)=>(t=eS(r)?"":eS(n)?`>=${r}.0.0`:eS(o)?`>=${r}.${n}.0`:`>=${t}`,s=eS(l)?"":eS(c)?`<${Number(l)+1}.0.0-0`:eS(u)?`<${l}.${Number(c)+1}.0-0`:h?`<=${l}.${c}.${u}-${h}`:`<=${s}`,`${t} ${s}`.trim()))}function eM(e){return e.replace(ev(el),"$1$2$3")}function eT(e){return e.replace(ev(eu),"$1~")}function eA(e){return e.replace(ev(ef),"$1^")}function eO(e){return e.trim().split(/\s+/).map(e=>e.replace(ev(ep),(e,t,r,n,o)=>{if(eS(t))return"";if(eS(r))return`>=${t}.0.0 <${Number(t)+1}.0.0-0`;if(eS(n))if("0"===t)return`>=${t}.${r}.0 <${t}.${Number(r)+1}.0-0`;else return`>=${t}.${r}.0 <${Number(t)+1}.0.0-0`;if(o)if("0"!==t)return`>=${t}.${r}.${n}-${o} <${Number(t)+1}.0.0-0`;else if("0"===r)return`>=${t}.${r}.${n}-${o} <${t}.${r}.${Number(n)+1}-0`;else return`>=${t}.${r}.${n}-${o} <${t}.${Number(r)+1}.0-0`;if("0"===t)if("0"===r)return`>=${t}.${r}.${n} <${t}.${r}.${Number(n)+1}-0`;else return`>=${t}.${r}.${n} <${t}.${Number(r)+1}.0-0`;return`>=${t}.${r}.${n} <${Number(t)+1}.0.0-0`})).join(" ")}function ew(e){return e.trim().split(/\s+/).map(e=>e.replace(ev(ey),(e,t,r,n,o)=>eS(t)?"":eS(r)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:eS(n)?`>=${t}.${r}.0 <${t}.${Number(r)+1}.0-0`:o?`>=${t}.${r}.${n}-${o} <${t}.${Number(r)+1}.0-0`:`>=${t}.${r}.${n} <${t}.${Number(r)+1}.0-0`)).join(" ")}function ek(e){return e.split(/\s+/).map(e=>e.trim().replace(ev(e_),(e,t,r,n,o,i)=>{let a=eS(r),s=a||eS(n),l=s||eS(o);if("="===t&&l&&(t=""),i="",a)if(">"===t||"<"===t)return"<0.0.0-0";else return"*";return t&&l?(s&&(n=0),o=0,">"===t?(t=">=",s?(r=Number(r)+1,n=0):n=Number(n)+1,o=0):"<="===t&&(t="<",s?r=Number(r)+1:n=Number(n)+1),"<"===t&&(i="-0"),`${t+r}.${n}.${o}${i}`):s?`>=${r}.0.0${i} <${Number(r)+1}.0.0-0`:l?`>=${r}.${n}.0${i} <${r}.${Number(n)+1}.0-0`:e})).join(" ")}function eP(e){return e.trim().replace(ev(ed),"")}function eD(e){return e.trim().replace(ev(eb),"")}function ex(e,t){return(e=Number(e)||e)>(t=Number(t)||t)?1:e===t?0:-1}function eL(e,t){let{preRelease:r}=e,{preRelease:n}=t;if(void 0===r&&n)return 1;if(r&&void 0===n)return -1;if(void 0===r&&void 0===n)return 0;for(let e=0,t=r.length;e<=t;e++){let t=r[e],o=n[e];if(t!==o){if(void 0===t&&void 0===o)return 0;if(!t)return 1;if(!o)return -1;return ex(t,o)}}return 0}function eF(e,t){return ex(e.major,t.major)||ex(e.minor,t.minor)||ex(e.patch,t.patch)||eL(e,t)}function ej(e,t){return e.version===t.version}function eH(e,t){switch(e.operator){case"":case"=":return ej(e,t);case">":return 0>eF(e,t);case">=":return ej(e,t)||0>eF(e,t);case"<":return eF(e,t)>0;case"<=":return ej(e,t)||eF(e,t)>0;case void 0:return!0;default:return!1}}function eC(e){return eR(eO,ew,ek,eP)(e)}function eV(e){return eR(e$,eM,eT,eA)(e.trim()).split(/\s+/).join(" ")}function eU(e,t){if(!e)return!1;let r=eI(e);if(!r)return!1;let[,n,,o,i,a,s]=r,l={operator:n,version:eN(o,i,a,s),major:o,minor:i,patch:a,preRelease:null==s?void 0:s.split(".")};for(let e of t.split("||")){let t=e.trim();if(!t||"*"===t||"x"===t)return!0;try{let e=eV(t);if(!e.trim())return!0;let r=e.split(" ").map(e=>eC(e)).join(" ");if(!r.trim())return!0;let n=r.split(/\s+/).map(e=>eD(e)).filter(Boolean);if(0===n.length)continue;let o=!0;for(let e of n){let t=eI(e);if(!t){o=!1;break}let[,r,,n,i,a,s]=t,c={operator:r,version:eN(n,i,a,s),major:n,minor:i,patch:a,preRelease:null==s?void 0:s.split(".")};if(!eH(c,l)){o=!1;break}}if(o)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}function eG(e,t,r,o){var i,a,s;let l;return l="get"in e?e.get:"lib"in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{throw Error(`Can not get shared '${r}'!`)}),n._extends({deps:[],useIn:[],from:t,loading:null},e,{shareConfig:n._extends({requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1},e.shareConfig),get:l,loaded:null!=e&&!!e.loaded||"lib"in e||void 0,version:null!=(i=e.version)?i:"0",scope:Array.isArray(e.scope)?e.scope:[null!=(a=e.scope)?a:"default"],strategy:(null!=(s=e.strategy)?s:o)||"version-first"})}function eq(e,t){let r=t.shared||{},o=t.name,i=Object.keys(r).reduce((e,n)=>{let i=b(r[n]);return e[n]=e[n]||[],i.forEach(r=>{e[n].push(eG(r,o,n,t.shareStrategy))}),e},{}),a=n._extends({},e.shared);return Object.keys(i).forEach(e=>{a[e]?i[e].forEach(t=>{a[e].find(e=>e.version===t.version)||a[e].push(t)}):a[e]=i[e]}),{shared:a,shareInfos:i}}function eB(e,t){let r=e=>{if(!Number.isNaN(Number(e))){let t=e.split("."),r=e;for(let e=0;e<3-t.length;e++)r+=".0";return r}return e};return!!eU(r(e),`<=${r(t)}`)}let eK=(e,t)=>{let r=t||function(e,t){return eB(e,t)};return Object.keys(e).reduce((e,t)=>!e||r(e,t)||"0"===e?t:e,0)},eW=e=>!!e.loaded||"function"==typeof e.lib,ez=e=>!!e.loading;function eY(e,t,r){let n=e[t][r],o=function(e,t){return!eW(n[e])&&eB(e,t)};return eK(e[t][r],o)}function eX(e,t,r){let n=e[t][r],o=function(e,t){let r=e=>eW(e)||ez(e);if(r(n[t]))if(r(n[e]))return!!eB(e,t);else return!0;return!r(n[e])&&eB(e,t)};return eK(e[t][r],o)}function eJ(e){return"loaded-first"===e?eX:eY}function eZ(e,t,r,n){if(!e)return;let{shareConfig:o,scope:i=B,strategy:a}=r;for(let s of Array.isArray(i)?i:[i])if(o&&e[s]&&e[s][t]){let{requiredVersion:i}=o,l=eJ(a)(e,s,t),h=()=>{if(o.singleton){if("string"==typeof i&&!eU(l,i)){let n=`Version ${l} from ${l&&e[s][t][l].from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${i})`;o.strictVersion?c(n):u(n)}return e[s][t][l]}if(!1===i||"*"===i||eU(l,i))return e[s][t][l];for(let[r,n]of Object.entries(e[s][t]))if(eU(r,i))return n},f={shareScopeMap:e,scope:s,pkgName:t,version:l,GlobalFederation:N.__FEDERATION__,resolver:h};return(n.emit(f)||f).resolver()}}function eQ(){return N.__FEDERATION__.__SHARE__}function e0(e){var t;let{pkgName:r,extraOptions:n,shareInfos:o}=e,i=e=>{if(!e)return;let t={};e.forEach(e=>{t[e.version]=e});let r=function(e,r){return!eW(t[e])&&eB(e,r)},n=eK(t,r);return t[n]};return Object.assign({},(null!=(t=null==n?void 0:n.resolver)?t:i)(o[r]),null==n?void 0:n.customShareInfo)}function e1(){return"GaugeChart:0.9.1"}function e2(e,t){for(let r of e){let e=t.startsWith(r.name),n=t.replace(r.name,"");if(e){if(n.startsWith("/"))return{pkgNameOrAlias:r.name,expose:n=`.${n}`,remote:r};else if(""===n)return{pkgNameOrAlias:r.name,expose:".",remote:r}}let o=r.alias&&t.startsWith(r.alias),i=r.alias&&t.replace(r.alias,"");if(r.alias&&o){if(i&&i.startsWith("/"))return{pkgNameOrAlias:r.alias,expose:i=`.${i}`,remote:r};else if(""===i)return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function e7(e,t){for(let r of e)if(t===r.name||r.alias&&t===r.alias)return r}function e9(e,t){let r=U(),n=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return r.length>0&&r.forEach(t=>{(null==e?void 0:e.find(e=>e.name!==t.name))&&e.push(t)}),e&&e.length>0&&e.forEach(e=>{n.forEach(r=>{r.applyPlugin(e,t)})}),e}let e5=".then(callbacks[0]).catch(callbacks[1])";async function e4(e){let{entry:t,remoteEntryExports:r}=e;return new Promise((e,n)=>{try{r?e(r):"undefined"!=typeof FEDERATION_ALLOW_NEW_FUNCTION?Function("callbacks",`import("${t}")${e5}`)([e,n]):import(t).then(e).catch(n)}catch(e){n(e)}})}async function e8(e){let{entry:t,remoteEntryExports:r}=e;return new Promise((e,n)=>{try{r?e(r):Function("callbacks",`System.import("${t}")${e5}`)([e,n])}catch(e){n(e)}})}function e6(e,t,r){let{remoteEntryKey:n,entryExports:o}=C(e,t);return l(o,i.getShortErrorMsg(i.RUNTIME_001,i.runtimeDescMap,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:n})),o}async function e3(e){let{name:t,globalName:r,entry:n,loaderHook:a,getEntryUrl:s}=e,{entryExports:c}=C(t,r);if(c)return c;let u=s?s(n):n;return o.loadScript(u,{attrs:{},createScriptHook:(e,t)=>{let r=a.lifecycle.createScript.emit({url:e,attrs:t});if(r&&(r instanceof HTMLScriptElement||"script"in r||"timeout"in r))return r}}).then(()=>e6(t,r,n)).catch(e=>{throw l(void 0,i.getShortErrorMsg(i.RUNTIME_008,i.runtimeDescMap,{remoteName:t,resourceUrl:n})),e})}async function te(e){let{remoteInfo:t,remoteEntryExports:r,loaderHook:n,getEntryUrl:o}=e,{entry:i,entryGlobalName:a,name:s,type:l}=t;switch(l){case"esm":case"module":return e4({entry:i,remoteEntryExports:r});case"system":return e8({entry:i,remoteEntryExports:r});default:return e3({entry:i,globalName:a,name:s,loaderHook:n,getEntryUrl:o})}}async function tt(e){let{remoteInfo:t,loaderHook:r}=e,{entry:n,entryGlobalName:i,name:a,type:s}=t,{entryExports:l}=C(a,i);return l||o.loadScriptNode(n,{attrs:{name:a,globalName:i,type:s},loaderHook:{createScriptHook:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.lifecycle.createScript.emit({url:e,attrs:t});if(n&&"url"in n)return n}}}).then(()=>e6(a,i,n)).catch(e=>{throw e})}function tr(e){let{entry:t,name:r}=e;return o.composeKeyWithSeparator(r,t)}async function tn(e){let{origin:t,remoteEntryExports:r,remoteInfo:n,getEntryUrl:i}=e,a=tr(n);if(r)return r;if(!T[a]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,s=t.loaderHook;T[a]=e.emit({loaderHook:s,remoteInfo:n,remoteEntryExports:r}).then(e=>e||(("undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:o.isBrowserEnv())?te({remoteInfo:n,remoteEntryExports:r,loaderHook:s,getEntryUrl:i}):tt({remoteInfo:n,loaderHook:s})))}return T[a]}function to(e){return n._extends({},e,{entry:"entry"in e?e.entry:"",type:e.type||K,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||B})}function ti(e){return n._extends({resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1},e)}function ta(e,t){return t.map(t=>{let r=e7(e,t.nameOrAlias);return l(r,`Unable to preload ${t.nameOrAlias} as it is not included in ${!r&&o.safeToString({remoteInfo:r,remotes:e})}`),{remote:r,preloadConfig:ti(t)}})}function ts(e){return e?e.map(e=>"."===e?e:e.startsWith("./")?e.replace("./",""):e):[]}function tl(e,t,r){let n=!(arguments.length>3)||void 0===arguments[3]||arguments[3],{cssAssets:i,jsAssetsWithoutEntry:a,entryAssets:s}=r;if(t.options.inBrowser){if(s.forEach(r=>{let{moduleInfo:n}=r,o=t.moduleCache.get(e.name);o?tn({origin:t,remoteInfo:n,remoteEntryExports:o.remoteEntryExports}):tn({origin:t,remoteInfo:n,remoteEntryExports:void 0})}),n){let e={rel:"preload",as:"style"};i.forEach(r=>{let{link:n,needAttach:i}=o.createLink({url:r,cb:()=>{},attrs:e,createLinkHook:(e,r)=>{let n=t.loaderHook.lifecycle.createLink.emit({url:e,attrs:r});if(n instanceof HTMLLinkElement)return n}});i&&document.head.appendChild(n)})}else{let e={rel:"stylesheet",type:"text/css"};i.forEach(r=>{let{link:n,needAttach:i}=o.createLink({url:r,cb:()=>{},attrs:e,createLinkHook:(e,r)=>{let n=t.loaderHook.lifecycle.createLink.emit({url:e,attrs:r});if(n instanceof HTMLLinkElement)return n},needDeleteLink:!1});i&&document.head.appendChild(n)})}if(n){let e={rel:"preload",as:"script"};a.forEach(r=>{let{link:n,needAttach:i}=o.createLink({url:r,cb:()=>{},attrs:e,createLinkHook:(e,r)=>{let n=t.loaderHook.lifecycle.createLink.emit({url:e,attrs:r});if(n instanceof HTMLLinkElement)return n}});i&&document.head.appendChild(n)})}else{let r={fetchpriority:"high",type:(null==e?void 0:e.type)==="module"?"module":"text/javascript"};a.forEach(e=>{let{script:n,needAttach:i}=o.createScript({url:e,cb:()=>{},attrs:r,createScriptHook:(e,r)=>{let n=t.loaderHook.lifecycle.createScript.emit({url:e,attrs:r});if(n instanceof HTMLScriptElement)return n},needDeleteScript:!0});i&&document.head.appendChild(n)})}}}var tc={global:{Global:N,nativeGlobal:I,resetFederationGlobalInfo:O,setGlobalFederationInstance:w,getGlobalFederationConstructor:k,setGlobalFederationConstructor:P,getInfoWithoutType:D,getGlobalSnapshot:x,getTargetSnapshotInfoByModuleInfo:L,getGlobalSnapshotInfoByModuleInfo:F,setGlobalSnapshotInfoByModuleInfo:j,addGlobalSnapshot:H,getRemoteEntryExports:C,registerGlobalPlugins:V,getGlobalHostPlugins:U,getPreloaded:G,setPreloaded:q},share:{getRegisteredShare:eZ,getGlobalShareScope:eQ},utils:{matchRemoteWithNameAndExpose:e2,preloadAssets:tl,getRemoteInfo:to}};let tu=class{async getEntry(){let e;if(this.remoteEntryExports)return this.remoteEntryExports;try{e=await tn({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports})}catch(r){let t=tr(this.remoteInfo);r instanceof Error&&r.message.includes(i.RUNTIME_008)&&(e=await this.host.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:tn,origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,globalLoading:T,uniqueKey:t}))}return l(e,`remoteEntryExports is undefined
|
|
3
|
+
${o.safeToString(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async get(e,t,r,o){let a,{loadFactory:s=!0}=r||{loadFactory:!0},u=await this.getEntry();if(!this.inited){let t=this.host.shareScopeMap,r=Array.isArray(this.remoteInfo.shareScope)?this.remoteInfo.shareScope:[this.remoteInfo.shareScope];r.length||r.push("default"),r.forEach(e=>{t[e]||(t[e]={})});let a=t[r[0]],s=[],l={version:this.remoteInfo.version||"",shareScopeKeys:Array.isArray(this.remoteInfo.shareScope)?r:this.remoteInfo.shareScope||"default"};Object.defineProperty(l,"shareScopeMap",{value:t,enumerable:!1});let h=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:a,remoteEntryInitOptions:l,initScope:s,remoteInfo:this.remoteInfo,origin:this.host});void 0===(null==u?void 0:u.init)&&c(i.getShortErrorMsg(i.RUNTIME_002,i.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await u.init(h.shareScope,h.initScope,h.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit(n._extends({},h,{id:e,remoteSnapshot:o,remoteEntryExports:u}))}this.lib=u,this.inited=!0,(a=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:u,expose:t,moduleInfo:this.remoteInfo}))||(a=await u.get(t)),l(a,`${f(this.remoteInfo)} remote don't export ${t}.`);let h=S(this.remoteInfo.name,t),d=this.wraperFactory(a,h);return s?await d():d}wraperFactory(e,t){function r(e,t){e&&"object"==typeof e&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for("mf_module_id"))&&Object.defineProperty(e,Symbol.for("mf_module_id"),{value:t,enumerable:!1})}return e instanceof Promise?async()=>{let n=await e();return r(n,t),n}:()=>{let n=e();return r(n,t),n}}constructor({remoteInfo:e,host:t}){this.inited=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}};class th{on(e){"function"==typeof e&&this.listeners.add(e)}once(e){let t=this;this.on(function r(){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];return t.remove(r),e.apply(null,o)})}emit(){let e;for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.listeners.size>0&&this.listeners.forEach(t=>{e=t(...r)}),e}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}}class tf extends th{emit(){let e;for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];let o=Array.from(this.listeners);if(o.length>0){let t=0,n=e=>!1!==e&&(t<o.length?Promise.resolve(o[t++].apply(null,r)).then(n):e);e=n()}return Promise.resolve(e)}}function td(e,t){if(!g(t))return!1;if(e!==t){for(let r in e)if(!(r in t))return!1}return!0}class tp extends th{emit(e){for(let t of(g(e)||c(`The data for the "${this.type}" hook should be an object.`),this.listeners))try{let r=t(e);if(td(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){u(e),this.onerror(e)}return e}constructor(e){super(),this.onerror=c,this.type=e}}class tm extends th{emit(e){g(e)||c(`The response data for the "${this.type}" hook must be an object.`);let t=Array.from(this.listeners);if(t.length>0){let r=0,n=t=>(u(t),this.onerror(t),e),o=i=>{if(td(e,i)){if(e=i,r<t.length)try{return Promise.resolve(t[r++](e)).then(o,n)}catch(e){return n(e)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(o(e))}return Promise.resolve(e)}constructor(e){super(),this.onerror=c,this.type=e}}class tg{applyPlugin(e,t){l(_(e),"Plugin configuration is invalid.");let r=e.name;l(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,null==e.apply||e.apply.call(e,t),Object.keys(this.lifecycle).forEach(t=>{let r=e[t];r&&this.lifecycle[t].on(r)}))}removePlugin(e){l(e,"A name is required.");let t=this.registerPlugins[e];l(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(e=>{"name"!==e&&this.lifecycle[e].remove(t[e])})}constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}}function ty(e,t){let r=v(t);r.url||c(`The attribute remoteEntry of ${e.name} must not be undefined.`);let n=o.getResourceUrl(t,r.url);o.isBrowserEnv()||n.startsWith("http")||(n=`https:${n}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=n,e.version=t.version,e.buildVersion=t.buildVersion}function t_(){return{name:"snapshot-plugin",async afterResolve(e){let{remote:t,pkgNameOrAlias:r,expose:o,origin:i,remoteInfo:a,id:s}=e;if(!d(t)||!p(t)){let{remoteSnapshot:l,globalSnapshot:c}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:s});ty(a,l);let u={remote:t,preloadConfig:{nameOrAlias:r,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1}},h=await i.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:u,remoteInfo:a,remote:t,remoteSnapshot:l,globalSnapshot:c});return h&&tl(a,i,h,!1),n._extends({},e,{remoteSnapshot:l})}return e}}}function tE(e){let t=e.split(":");return 1===t.length?{name:t[0],version:void 0}:2===t.length?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function tb(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5?arguments[5]:void 0,{value:s}=D(e,f(t)),l=a||s;if(l&&!o.isManifestProvider(l)&&(r(l,t,n),l.remotesInfo))for(let t of Object.keys(l.remotesInfo)){if(i[t])continue;i[t]=!0;let n=tE(t),o=l.remotesInfo[t];tb(e,{name:n.name,version:o.matchedVersion},r,!1,i,void 0)}}let tv=(e,t)=>document.querySelector(`${e}[${"link"===e?"href":"src"}="${t}"]`);function tS(e,t,r,n,i){let a=[],s=[],l=[],c=new Set,u=new Set,{options:h}=e,{preloadConfig:f}=t,{depsRemote:d}=f;if(tb(n,r,(t,r,n)=>{let i;if(n)i=f;else if(Array.isArray(d)){let e=d.find(e=>e.nameOrAlias===r.name||e.nameOrAlias===r.alias);if(!e)return;i=ti(e)}else{if(!0!==d)return;i=f}let c=o.getResourceUrl(t,v(t).url);c&&l.push({name:r.name,moduleInfo:{name:r.name,entry:c,type:"remoteEntryType"in t?t.remoteEntryType:"global",entryGlobalName:"globalName"in t?t.globalName:r.name,shareScope:"",version:"version"in t?t.version:void 0},url:c});let u="modules"in t?t.modules:[],h=ts(i.exposes);if(h.length&&"modules"in t){var p;u=null==t||null==(p=t.modules)?void 0:p.reduce((e,t)=>((null==h?void 0:h.indexOf(t.moduleName))!==-1&&e.push(t),e),[])}function m(e){let r=e.map(e=>o.getResourceUrl(t,e));return i.filter?r.filter(i.filter):r}if(u){let n=u.length;for(let o=0;o<n;o++){let n=u[o],l=`${r.name}/${n.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:"."===n.moduleName?r.name:l,name:r.name,remoteSnapshot:t,preloadConfig:i,remote:r,origin:e}),G(l)||("all"===i.resourceCategory?(a.push(...m(n.assets.css.async)),a.push(...m(n.assets.css.sync)),s.push(...m(n.assets.js.async))):(i.resourceCategory="sync",a.push(...m(n.assets.css.sync))),s.push(...m(n.assets.js.sync)),q(l))}}},!0,{},i),i.shared&&i.shared.length>0){let t=(t,r)=>{let n=eZ(e.shareScopeMap,r.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare);n&&"function"==typeof n.lib&&(r.assets.js.sync.forEach(e=>{c.add(e)}),r.assets.css.sync.forEach(e=>{u.add(e)}))};i.shared.forEach(e=>{var r;let n=null==(r=h.shared)?void 0:r[e.sharedName];if(!n)return;let o=e.version?n.find(t=>t.version===e.version):n;o&&b(o).forEach(r=>{t(r,e)})})}let p=s.filter(e=>!c.has(e)&&!tv("script",e));return{cssAssets:a.filter(e=>!u.has(e)&&!tv("link",e)),jsAssetsWithoutEntry:p,entryAssets:l.filter(e=>!tv("script",e.url))}}let tR=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){let{origin:t,preloadOptions:r,remoteInfo:n,remote:i,globalSnapshot:a,remoteSnapshot:s}=e;return o.isBrowserEnv()?d(i)&&p(i)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:i.name,url:i.entry,moduleInfo:{name:n.name,entry:i.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(ty(n,s),tS(t,r,n,a,s)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function tI(e,t){let r=F({name:t.name,version:t.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&D(r.remotesInfo,e.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:x(),remoteSnapshot:F({name:e.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:x(),remoteSnapshot:F({name:e.name,version:"version"in e?e.version:void 0})}}class tN{async loadRemoteSnapshotInfo(e){let t,r,{moduleInfo:a,id:s,expose:l}=e,{options:u}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:u,moduleInfo:a});let h=F({name:this.HostInstance.options.name,version:this.HostInstance.options.version});h||(h={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},H({[this.HostInstance.options.name]:h})),h&&"remotesInfo"in h&&!D(h.remotesInfo,a.name).value&&("version"in a||"entry"in a)&&(h.remotesInfo=n._extends({},null==h?void 0:h.remotesInfo,{[a.name]:{matchedVersion:"version"in a?a.version:a.entry}}));let{hostGlobalSnapshot:f,remoteSnapshot:p,globalSnapshot:m}=this.getGlobalRemoteInfo(a),{remoteSnapshot:g,globalSnapshot:y}=await this.hooks.lifecycle.loadSnapshot.emit({options:u,moduleInfo:a,hostGlobalSnapshot:f,remoteSnapshot:p,globalSnapshot:m});if(g)if(o.isManifestProvider(g)){let e=o.isBrowserEnv()?g.remoteEntry:g.ssrRemoteEntry||g.remoteEntry||"",i=await this.getManifestJson(e,a,{}),s=j(n._extends({},a,{entry:e}),i);t=i,r=s}else{let{remoteSnapshot:e}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:a,remoteSnapshot:g,from:"global"});t=e,r=y}else if(d(a)){let e=await this.getManifestJson(a.entry,a,{}),n=j(a,e),{remoteSnapshot:o}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:a,remoteSnapshot:e,from:"global"});t=o,r=n}else c(i.getShortErrorMsg(i.RUNTIME_007,i.runtimeDescMap,{hostName:a.name,hostVersion:a.version,globalSnapshot:JSON.stringify(y)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:s,host:this.HostInstance,options:u,moduleInfo:a,remoteSnapshot:t}),{remoteSnapshot:t,globalSnapshot:r}}getGlobalRemoteInfo(e){return tI(e,this.HostInstance)}async getManifestJson(e,t,r){let n=async()=>{let r=this.manifestCache.get(e);if(r)return r;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{});t&&t instanceof Response||(t=await fetch(e,{})),r=await t.json()}catch(n){(r=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}))||(delete this.manifestLoading[e],c(i.getShortErrorMsg(i.RUNTIME_003,i.runtimeDescMap,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${n}`)))}return l(r.metaData&&r.exposes&&r.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,r),r},a=async()=>{let r=await n(),i=o.generateSnapshotFromManifest(r,{version:e}),{remoteSnapshot:a}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:r,remoteSnapshot:i,manifestUrl:e,from:"manifest"});return a};return this.manifestLoading[e]||(this.manifestLoading[e]=a().then(e=>e)),this.manifestLoading[e]}constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new tg({beforeLoadRemoteSnapshot:new tf("beforeLoadRemoteSnapshot"),loadSnapshot:new tm("loadGlobalSnapshot"),loadRemoteSnapshot:new tm("loadRemoteSnapshot"),afterLoadSnapshot:new tm("afterLoadSnapshot")}),this.manifestLoading=N.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}}class t${registerShared(e,t){let{shareInfos:r,shared:n}=eq(e,t);return Object.keys(r).forEach(e=>{r[e].forEach(r=>{!eZ(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)&&r&&r.lib&&this.setShared({pkgName:e,lib:r.lib,get:r.get,loaded:!0,shared:r,from:t.name})})}),{shareInfos:r,shared:n}}async loadShare(e,t){let{host:r}=this,n=e0({pkgName:e,extraOptions:t,shareInfos:r.options.shared});(null==n?void 0:n.scope)&&await Promise.all(n.scope.map(async e=>{await Promise.all(this.initializeSharing(e,{strategy:n.strategy}))}));let{shareInfo:o}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r});l(o,`Cannot find ${e} Share in the ${r.options.name}. Please ensure that the ${e} Share parameters have been injected`);let i=eZ(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare),a=e=>{e.useIn||(e.useIn=[]),h(e.useIn,r.options.name)};if(i&&i.lib)return a(i),i.lib;if(i&&i.loading&&!i.loaded){let e=await i.loading;return i.loaded=!0,i.lib||(i.lib=e),a(i),e}if(i){let t=(async()=>{let e=await i.get();return a(i),i.loaded=!0,i.lib=e,e})();return this.setShared({pkgName:e,loaded:!1,shared:i,from:r.options.name,lib:null,loading:t}),t}{if(null==t?void 0:t.customShareInfo)return!1;let n=(async()=>{let t=await o.get();o.lib=t,o.loaded=!0,a(o);let r=eZ(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare);return r&&(r.lib=t,r.loaded=!0,r.from=o.from),t})();return this.setShared({pkgName:e,loaded:!1,shared:o,from:r.options.name,lib:null,loading:n}),n}}initializeSharing(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:B,t=arguments.length>1?arguments[1]:void 0,{host:r}=this,n=null==t?void 0:t.from,o=null==t?void 0:t.strategy,i=null==t?void 0:t.initScope,a=[];if("build"!==n){let{initTokens:t}=this;i||(i=[]);let r=t[e];if(r||(r=t[e]={from:this.host.name}),i.indexOf(r)>=0)return a;i.push(r)}let s=this.shareScopeMap,l=r.options.name;s[e]||(s[e]={});let c=s[e],u=(e,t)=>{var r;let{version:n,eager:o}=t;c[e]=c[e]||{};let i=c[e],a=i[n],s=!!(a&&(a.eager||(null==(r=a.shareConfig)?void 0:r.eager)));(!a||"loaded-first"!==a.strategy&&!a.loaded&&(!o!=!s?o:l>a.from))&&(i[n]=t)},h=t=>t&&t.init&&t.init(s[e],i),f=async e=>{let{module:t}=await r.remoteHandler.getRemoteModuleAndOptions({id:e});if(t.getEntry){let n;try{n=await t.getEntry()}catch(t){n=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:t,from:"runtime",lifecycle:"beforeLoadShare",origin:r})}t.inited||(await h(n),t.inited=!0)}};return Object.keys(r.options.shared).forEach(t=>{r.options.shared[t].forEach(r=>{r.scope.includes(e)&&u(t,r)})}),("version-first"===r.options.shareStrategy||"version-first"===o)&&r.options.remotes.forEach(t=>{t.shareScope===e&&a.push(f(t.name))}),a}loadShareSync(e,t){let{host:r}=this,n=e0({pkgName:e,extraOptions:t,shareInfos:r.options.shared});(null==n?void 0:n.scope)&&n.scope.forEach(e=>{this.initializeSharing(e,{strategy:n.strategy})});let o=eZ(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare),a=e=>{e.useIn||(e.useIn=[]),h(e.useIn,r.options.name)};if(o){if("function"==typeof o.lib)return a(o),o.loaded||(o.loaded=!0,o.from===r.options.name&&(n.loaded=!0)),o.lib;if("function"==typeof o.get){let t=o.get();if(!(t instanceof Promise))return a(o),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:t,shared:o}),t}}if(n.lib)return n.loaded||(n.loaded=!0),n.lib;if(n.get){let o=n.get();if(o instanceof Promise){let n=(null==t?void 0:t.from)==="build"?i.RUNTIME_005:i.RUNTIME_006;throw Error(i.getShortErrorMsg(n,i.runtimeDescMap,{hostName:r.options.name,sharedPkgName:e}))}return n.lib=o,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),n.lib}throw Error(i.getShortErrorMsg(i.RUNTIME_006,i.runtimeDescMap,{hostName:r.options.name,sharedPkgName:e}))}initShareScopeMap(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{host:n}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:n.options,origin:n,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared(e){let{pkgName:t,shared:r,from:o,lib:i,loading:a,loaded:s,get:l}=e,{version:c,scope:u="default"}=r,h=n._object_without_properties_loose(r,["version","scope"]);(Array.isArray(u)?u:[u]).forEach(e=>{if(this.shareScopeMap[e]||(this.shareScopeMap[e]={}),this.shareScopeMap[e][t]||(this.shareScopeMap[e][t]={}),!this.shareScopeMap[e][t][c]){this.shareScopeMap[e][t][c]=n._extends({version:c,scope:["default"]},h,{lib:i,loaded:s,loading:a}),l&&(this.shareScopeMap[e][t][c].get=l);return}let r=this.shareScopeMap[e][t][c];a&&!r.loading&&(r.loading=a),s&&!r.loaded&&(r.loaded=s),o&&r.from!==o&&(r.from=o)})}_setGlobalShareScopeMap(e){let t=eQ(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}constructor(e){this.hooks=new tg({afterResolve:new tm("afterResolve"),beforeLoadShare:new tm("beforeLoadShare"),loadShare:new tf,resolveShare:new tp("resolveShare"),initContainerShareScopeMap:new tp("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}}class tM{formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((e,t)=>(this.registerRemote(t,e,{force:!1}),e),e.remotes)}setIdToRemoteMap(e,t){let{remote:r,expose:n}=t,{name:o,alias:i}=r;if(this.idToRemoteMap[e]={name:r.name,expose:n},i&&e.startsWith(o)){let t=e.replace(o,i);this.idToRemoteMap[t]={name:r.name,expose:n};return}if(i&&e.startsWith(i)){let t=e.replace(i,o);this.idToRemoteMap[t]={name:r.name,expose:n}}}async loadRemote(e,t){let{host:r}=this;try{let{loadFactory:n=!0}=t||{loadFactory:!0},{module:o,moduleOptions:i,remoteMatchInfo:a}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:s,remote:l,expose:c,id:u,remoteSnapshot:h}=a,f=await o.get(u,c,t,h),d=await this.hooks.lifecycle.onLoad.emit({id:u,pkgNameOrAlias:s,expose:c,exposeModule:n?f:void 0,exposeModuleFactory:n?void 0:f,remote:l,options:i,moduleInstance:o,origin:r});if(this.setIdToRemoteMap(e,a),"function"==typeof d)return d;return f}catch(i){let{from:n="runtime"}=t||{from:"runtime"},o=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:n,lifecycle:"onLoad",origin:r});if(!o)throw i;return o}}async preloadRemote(e){let{host:t}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});let r=ta(t.options.remotes,e);await Promise.all(r.map(async e=>{let{remote:r}=e,n=to(r),{globalSnapshot:o,remoteSnapshot:i}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:r}),a=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:e,remote:r,remoteInfo:n,globalSnapshot:o,remoteSnapshot:i});a&&tl(n,t,a)}))}registerRemotes(e,t){let{host:r}=this;e.forEach(e=>{this.registerRemote(e,r.options.remotes,{force:null==t?void 0:t.force})})}async getRemoteModuleAndOptions(e){let t,{host:r}=this,{id:o}=e;try{t=await this.hooks.lifecycle.beforeRequest.emit({id:o,options:r.options,origin:r})}catch(e){if(!(t=await this.hooks.lifecycle.errorLoadRemote.emit({id:o,options:r.options,origin:r,from:"runtime",error:e,lifecycle:"beforeRequest"})))throw e}let{id:a}=t,s=e2(r.options.remotes,a);l(s,i.getShortErrorMsg(i.RUNTIME_004,i.runtimeDescMap,{hostName:r.options.name,requestId:a}));let{remote:c}=s,u=to(c),h=await r.sharedHandler.hooks.lifecycle.afterResolve.emit(n._extends({id:a},s,{options:r.options,origin:r,remoteInfo:u})),{remote:f,expose:d}=h;l(f&&d,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);let p=r.moduleCache.get(f.name),m={host:r,remoteInfo:u};return p||(p=new tu(m),r.moduleCache.set(f.name,p)),{module:p,moduleOptions:m,remoteMatchInfo:h}}registerRemote(e,t,r){let{host:n}=this,i=()=>{if(e.alias){let r=t.find(t=>{var r;return e.alias&&(t.name.startsWith(e.alias)||(null==(r=t.alias)?void 0:r.startsWith(e.alias)))});l(!r,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${r&&r.name} name or alias`)}"entry"in e&&o.isBrowserEnv()&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=B),e.type||(e.type=K)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:n});let a=t.find(t=>t.name===e.name);if(a){let s=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];(null==r?void 0:r.force)&&(this.removeRemote(a),i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n}),o.warn(s.join(" ")))}else i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n})}removeRemote(e){try{let{host:r}=this,{name:n}=e,i=r.options.remotes.findIndex(e=>e.name===n);-1!==i&&r.options.remotes.splice(i,1);let a=r.moduleCache.get(e.name);if(a){let n=a.remoteInfo,i=n.entryGlobalName;if(R[i]){var t;(null==(t=Object.getOwnPropertyDescriptor(R,i))?void 0:t.configurable)?delete R[i]:R[i]=void 0}let s=tr(a.remoteInfo);T[s]&&delete T[s],r.snapshotHandler.manifestCache.delete(n.entry);let l=n.buildVersion?o.composeKeyWithSeparator(n.name,n.buildVersion):n.name,c=R.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===l:e.name===l);if(-1!==c){let e=R.__FEDERATION__.__INSTANCES__[c];l=e.options.id||l;let t=eQ(),r=!0,o=[];Object.keys(t).forEach(e=>{let i=t[e];i&&Object.keys(i).forEach(t=>{let a=i[t];a&&Object.keys(a).forEach(i=>{let s=a[i];s&&Object.keys(s).forEach(a=>{let l=s[a];l&&"object"==typeof l&&l.from===n.name&&(l.loaded||l.loading?(l.useIn=l.useIn.filter(e=>e!==n.name),l.useIn.length?r=!1:o.push([e,t,i,a])):o.push([e,t,i,a]))})})})}),r&&(e.shareScopeMap={},delete t[l]),o.forEach(e=>{var r,n,o;let[i,a,s,l]=e;null==(o=t[i])||null==(n=o[a])||null==(r=n[s])||delete r[l]}),R.__FEDERATION__.__INSTANCES__.splice(c,1)}let{hostGlobalSnapshot:u}=tI(e,r);if(u){let t=u&&"remotesInfo"in u&&u.remotesInfo&&D(u.remotesInfo,e.name).key;t&&(delete u.remotesInfo[t],N.__FEDERATION__.__MANIFEST_LOADING__[t]&&delete N.__FEDERATION__.__MANIFEST_LOADING__[t])}r.moduleCache.delete(e.name)}}catch(e){s.log("removeRemote fail: ",e)}}constructor(e){this.hooks=new tg({beforeRegisterRemote:new tp("beforeRegisterRemote"),registerRemote:new tp("registerRemote"),beforeRequest:new tm("beforeRequest"),onLoad:new tf("onLoad"),handlePreloadModule:new th("handlePreloadModule"),errorLoadRemote:new tf("errorLoadRemote"),beforePreloadRemote:new tf("beforePreloadRemote"),generatePreloadAssets:new tf("generatePreloadAssets"),afterPreloadRemote:new tf,loadEntry:new tf}),this.host=e,this.idToRemoteMap={}}}let tT=!0;class tA{initOptions(e){this.registerPlugins(e.plugins);let t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:B,t=arguments.length>1?arguments[1]:void 0;return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){let n=new tu({host:this,remoteInfo:to({name:e,entry:t})});return n.remoteEntryExports=r,this.moduleCache.set(e,n),n}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.sharedHandler.initShareScopeMap(e,t,r)}formatOptions(e,t){let{shared:r}=eq(e,t),{userOptions:o,options:i}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),a=this.remoteHandler.formatAndRegisterRemote(i,o),{shared:s}=this.sharedHandler.registerShared(i,o),l=[...i.plugins];o.plugins&&o.plugins.forEach(e=>{l.includes(e)||l.push(e)});let c=n._extends({},e,t,{plugins:l,remotes:a,shared:s});return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){let t=e9(e,this);this.options.plugins=this.options.plugins.reduce((e,t)=>(t&&e&&!e.find(e=>e.name===t.name)&&e.push(t),e),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,n._extends({},this.options,{shared:e}))}constructor(e){this.hooks=new tg({beforeInit:new tp("beforeInit"),init:new th,beforeInitContainer:new tm("beforeInitContainer"),initContainer:new tm("initContainer")}),this.version="0.19.1",this.moduleCache=new Map,this.loaderHook=new tg({getModuleInfo:new th,createScript:new th,createLink:new th,fetch:new tf,loadEntryError:new tf,getModuleFactory:new tf}),this.bridgeHook=new tg({beforeBridgeRender:new th,afterBridgeRender:new th,beforeBridgeDestroy:new th,afterBridgeDestroy:new th});let t=tT?[t_(),tR()]:[],r={id:e1(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:o.isBrowserEnv()};this.name=e.name,this.options=r,this.snapshotHandler=new tN(this),this.sharedHandler=new t$(this),this.remoteHandler=new tM(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...r.plugins,...e.plugins||[]]),this.options=this.formatOptions(r,e)}}var tO=Object.freeze({__proto__:null});t.loadScript=o.loadScript,t.loadScriptNode=o.loadScriptNode,t.CurrentGlobal=R,t.Global=N,t.Module=tu,t.ModuleFederation=tA,t.addGlobalSnapshot=H,t.assert=l,t.getGlobalFederationConstructor=k,t.getGlobalSnapshot=x,t.getInfoWithoutType=D,t.getRegisteredShare=eZ,t.getRemoteEntry=tn,t.getRemoteInfo=to,t.helpers=tc,t.isStaticResourcesEqual=E,t.matchRemoteWithNameAndExpose=e2,t.registerGlobalPlugins=V,t.resetFederationGlobalInfo=O,t.safeWrapper=m,t.satisfy=eU,t.setGlobalFederationConstructor=P,t.setGlobalFederationInstance=w,t.types=tO},13364:function(e,t){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function n(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}t._extends=r,t._object_without_properties_loose=n},10121:function(e,t,r){"use strict";var n=r(45628),o=r(51623),i=r(11765);function a(e){let t=new(n.getGlobalFederationConstructor()||n.ModuleFederation)(e);return n.setGlobalFederationInstance(t),t}let s=null;function l(e){let t=i.getGlobalFederationInstance(e.name,e.version);return t?(t.initOptions(e),s||(s=t),t):s=a(e)}function c(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.loadRemote.apply(s,t)}function u(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.loadShare.apply(s,t)}function h(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.loadShareSync.apply(s,t)}function f(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.preloadRemote.apply(s,t)}function d(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.registerRemotes.apply(s,t)}function p(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.registerPlugins.apply(s,t)}function m(){return s}function g(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.registerShared.apply(s,t)}n.setGlobalFederationConstructor(n.ModuleFederation),t.Module=n.Module,t.ModuleFederation=n.ModuleFederation,t.getRemoteEntry=n.getRemoteEntry,t.getRemoteInfo=n.getRemoteInfo,t.loadScript=n.loadScript,t.loadScriptNode=n.loadScriptNode,t.registerGlobalPlugins=n.registerGlobalPlugins,t.createInstance=a,t.getInstance=m,t.init=l,t.loadRemote=c,t.loadShare=u,t.loadShareSync=h,t.preloadRemote=f,t.registerPlugins=p,t.registerRemotes=d,t.registerShared=g},11765:function(e,t,r){"use strict";var n=r(45628);function o(){return"GaugeChart:0.9.1"}t.getGlobalFederationInstance=function(e,t){let r=o();return n.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(n=>!!r&&n.options.id===r||n.options.name===e&&!n.options.version&&!t||n.options.name===e&&!!t&&n.options.version===t)}},75365:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var polyfills=__webpack_require__(58867);let FederationModuleManifest="federation-manifest.json",MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"},EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH},SEPARATOR=":",ManifestFileName="mf-manifest.json",StatsFileName="mf-stats.json",MFModuleType={NPM:"npm",APP:"app"},MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__",ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX",TEMP_DIR=".federation",MFPrefetchCommon={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var ContainerPlugin=Object.freeze({__proto__:null}),ContainerReferencePlugin=Object.freeze({__proto__:null}),ModuleFederationPlugin=Object.freeze({__proto__:null}),SharePlugin=Object.freeze({__proto__:null});function isBrowserEnv(){return"undefined"!=typeof window&&void 0!==window.document}function isReactNativeEnv(){var e;return"undefined"!=typeof navigator&&(null==(e=navigator)?void 0:e.product)==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return!!localStorage.getItem(BROWSER_LOG_KEY)}catch(e){}return!1}function isDebugMode(){return"undefined"!=typeof process&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:!!("undefined"!=typeof FEDERATION_DEBUG&&FEDERATION_DEBUG)||isBrowserDebug()}let getProcessEnv=function(){return"undefined"!=typeof process&&process.env?process.env:{}},LOG_CATEGORY="[ Federation Runtime ]",parseEntry=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:SEPARATOR,n=e.split(r),o="development"===getProcessEnv().NODE_ENV&&t,i="*",a=e=>e.startsWith("http")||e.includes(MANIFEST_EXT);if(n.length>=2){let[t,...s]=n;e.startsWith(r)&&(t=n.slice(0,2).join(r),s=[o||n.slice(2).join(r)]);let l=o||s.join(r);return a(l)?{name:t,entry:l}:{name:t,version:l||i}}if(1===n.length){let[e]=n;return o&&a(o)?{name:e,entry:o}:{name:e,version:o||i}}throw`Invalid entry value: ${e}`},composeKeyWithSeparator=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length?t.reduce((e,t)=>t?e?`${e}${SEPARATOR}${t}`:t:e,""):""},encodeName=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let n=r?".js":"";return`${t}${e.replace(RegExp(`${NameTransformSymbol.AT}`,"g"),NameTransformMap[NameTransformSymbol.AT]).replace(RegExp(`${NameTransformSymbol.HYPHEN}`,"g"),NameTransformMap[NameTransformSymbol.HYPHEN]).replace(RegExp(`${NameTransformSymbol.SLASH}`,"g"),NameTransformMap[NameTransformSymbol.SLASH])}${n}`}catch(e){throw e}},decodeName=function(e,t,r){try{let n=e;if(t){if(!n.startsWith(t))return n;n=n.replace(RegExp(t,"g"),"")}return n=n.replace(RegExp(`${NameTransformMap[NameTransformSymbol.AT]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.AT]]).replace(RegExp(`${NameTransformMap[NameTransformSymbol.SLASH]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.SLASH]]).replace(RegExp(`${NameTransformMap[NameTransformSymbol.HYPHEN]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.HYPHEN]]),r&&(n=n.replace(".js","")),n}catch(e){throw e}},generateExposeFilename=(e,t)=>{if(!e)return"";let r=e;return"."===r&&(r="default_export"),r.startsWith("./")&&(r=r.replace("./","")),encodeName(r,"__federation_expose_",t)},generateShareFilename=(e,t)=>e?encodeName(e,"__federation_shared_",t):"",getResourceUrl=(e,t)=>{if("getPublicPath"in e){let r;return r=e.getPublicPath.startsWith("function")?Function("return "+e.getPublicPath)()():Function(e.getPublicPath)(),`${r}${t}`}return"publicPath"in e?!isBrowserEnv()&&!isReactNativeEnv()&&"ssrPublicPath"in e?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")},assert=(e,t)=>{e||error(t)},error=e=>{throw Error(`${LOG_CATEGORY}: ${e}`)},warn=e=>{console.warn(`${LOG_CATEGORY}: ${e}`)};function safeToString(e){try{return JSON.stringify(e,null,2)}catch(e){return""}}let VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(e){return VERSION_PATTERN_REGEXP.test(e)}let simpleJoinRemoteEntry=(e,t)=>{if(!e)return t;let r=(e=>{if("."===e)return"";if(e.startsWith("./"))return e.replace("./","");if(e.startsWith("/")){let t=e.slice(1);return t.endsWith("/")?t.slice(0,-1):t}return e})(e);return r?r.endsWith("/")?`${r}${t}`:`${r}/${t}`:t};function inferAutoPublicPath(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(e){var t,r,n;let o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{remotes:a={},overrides:s={},version:l}=i,c=()=>"publicPath"in e.metaData?"auto"===e.metaData.publicPath&&l?inferAutoPublicPath(l):e.metaData.publicPath:e.metaData.getPublicPath,u=Object.keys(s),h={};Object.keys(a).length||(h=(null==(n=e.remotes)?void 0:n.reduce((e,t)=>{let r,n=t.federationContainerName;return r=u.includes(n)?s[n]:"version"in t?t.version:t.entry,e[n]={matchedVersion:r},e},{}))||{}),Object.keys(a).forEach(e=>h[e]={matchedVersion:u.includes(e)?s[e]:a[e]});let{remoteEntry:{path:f,name:d,type:p},types:m,buildInfo:{buildVersion:g},globalName:y,ssrRemoteEntry:_}=e.metaData,{exposes:E}=e,b={version:l||"",buildVersion:g,globalName:y,remoteEntry:simpleJoinRemoteEntry(f,d),remoteEntryType:p,remoteTypes:simpleJoinRemoteEntry(m.path,m.name),remoteTypesZip:m.zip||"",remoteTypesAPI:m.api||"",remotesInfo:h,shared:null==e?void 0:e.shared.map(e=>({assets:e.assets,sharedName:e.name,version:e.version})),modules:null==E?void 0:E.map(e=>({moduleName:e.name,modulePath:e.path,assets:e.assets}))};if(null==(t=e.metaData)?void 0:t.prefetchInterface){let t=e.metaData.prefetchInterface;b=polyfills._({},b,{prefetchInterface:t})}if(null==(r=e.metaData)?void 0:r.prefetchEntry){let{path:t,name:r,type:n}=e.metaData.prefetchEntry;b=polyfills._({},b,{prefetchEntry:simpleJoinRemoteEntry(t,r),prefetchEntryType:n})}return o="publicPath"in e.metaData?polyfills._({},b,{publicPath:c(),ssrPublicPath:e.metaData.ssrPublicPath}):polyfills._({},b,{getPublicPath:c()}),_&&(o.ssrRemoteEntry=simpleJoinRemoteEntry(_.path,_.name),o.ssrRemoteEntryType=_.type||"commonjs-module"),o}function isManifestProvider(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(MANIFEST_EXT))}let PREFIX="[ Module Federation ]",Logger=class{setPrefix(e){this.prefix=e}log(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}warn(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}error(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}success(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}info(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}ready(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}debug(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];isDebugMode()&&console.log(this.prefix,...t)}constructor(e){this.prefix=e}};function createLogger(e){return new Logger(e)}let logger=createLogger(PREFIX);async function safeWrapper(e,t){try{return await e()}catch(e){t||warn(e);return}}function isStaticResourcesEqual(e,t){let r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function createScript(e){let t,r=null,n=!0,o=2e4,i=document.getElementsByTagName("script");for(let t=0;t<i.length;t++){let o=i[t],a=o.getAttribute("src");if(a&&isStaticResourcesEqual(a,e.url)){r=o,n=!1;break}}if(!r){let t,n=e.attrs;(r=document.createElement("script")).type=(null==n?void 0:n.type)==="module"?"module":"text/javascript",e.createScriptHook&&((t=e.createScriptHook(e.url,e.attrs))instanceof HTMLScriptElement?r=t:"object"==typeof t&&("script"in t&&t.script&&(r=t.script),"timeout"in t&&t.timeout&&(o=t.timeout))),r.src||(r.src=e.url),n&&!t&&Object.keys(n).forEach(e=>{r&&("async"===e||"defer"===e?r[e]=n[e]:r.getAttribute(e)||r.setAttribute(e,n[e]))})}let a=async(n,o)=>{clearTimeout(t);let i=()=>{(null==o?void 0:o.type)==="error"?(null==e?void 0:e.onErrorCallback)&&(null==e||e.onErrorCallback(o)):(null==e?void 0:e.cb)&&(null==e||e.cb())};if(r&&(r.onerror=null,r.onload=null,safeWrapper(()=>{let{needDeleteScript:t=!0}=e;t&&(null==r?void 0:r.parentNode)&&r.parentNode.removeChild(r)}),n&&"function"==typeof n)){let e=n(o);if(e instanceof Promise){let t=await e;return i(),t}return i(),e}i()};return r.onerror=a.bind(null,r.onerror),r.onload=a.bind(null,r.onload),t=setTimeout(()=>{a(null,Error(`Remote script "${e.url}" time-outed.`))},o),{script:r,needAttach:n}}function createLink(e){let t=null,r=!0,n=document.getElementsByTagName("link");for(let o=0;o<n.length;o++){let i=n[o],a=i.getAttribute("href"),s=i.getAttribute("rel");if(a&&isStaticResourcesEqual(a,e.url)&&s===e.attrs.rel){t=i,r=!1;break}}if(!t){let r;(t=document.createElement("link")).setAttribute("href",e.url);let n=e.attrs;e.createLinkHook&&(r=e.createLinkHook(e.url,n))instanceof HTMLLinkElement&&(t=r),n&&!r&&Object.keys(n).forEach(e=>{t&&!t.getAttribute(e)&&t.setAttribute(e,n[e])})}let o=(r,n)=>{let o=()=>{(null==n?void 0:n.type)==="error"?(null==e?void 0:e.onErrorCallback)&&(null==e||e.onErrorCallback(n)):(null==e?void 0:e.cb)&&(null==e||e.cb())};if(t&&(t.onerror=null,t.onload=null,safeWrapper(()=>{let{needDeleteLink:r=!0}=e;r&&(null==t?void 0:t.parentNode)&&t.parentNode.removeChild(t)}),r)){let e=r(n);return o(),e}o()};return t.onerror=o.bind(null,t.onerror),t.onload=o.bind(null,t.onload),{link:t,needAttach:r}}function loadScript(e,t){let{attrs:r={},createScriptHook:n}=t;return new Promise((t,o)=>{let{script:i,needAttach:a}=createScript({url:e,cb:t,onErrorCallback:o,attrs:polyfills._({fetchpriority:"high"},r),createScriptHook:n,needDeleteScript:!0});a&&document.head.appendChild(i)})}let sdkImportCache=new Map;function importNodeModule(e){if(!e)throw Error("import specifier is required");if(sdkImportCache.has(e))return sdkImportCache.get(e);let t=Function("name","return import(name)")(e).then(e=>e).catch(t=>{throw console.error(`Error importing module ${e}:`,t),sdkImportCache.delete(e),t});return sdkImportCache.set(e,t),t}let loadNodeFetch=async()=>{let e=await importNodeModule("node-fetch");return e.default||e},lazyLoaderHookFetch=async(e,t,r)=>{let n=(e,t)=>r.lifecycle.fetch.emit(e,t),o=await n(e,t||{});return o&&o instanceof Response?o:("undefined"==typeof fetch?await loadNodeFetch():fetch)(e,t||{})},createScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(url,cb,attrs,loaderHook)=>{let urlObj;if(null==loaderHook?void 0:loaderHook.createScriptHook){let hookResult=loaderHook.createScriptHook(url);hookResult&&"object"==typeof hookResult&&"url"in hookResult&&(url=hookResult.url)}try{urlObj=new URL(url)}catch(e){console.error("Error constructing URL:",e),cb(Error(`Invalid URL: ${e}`));return}let getFetch=async()=>(null==loaderHook?void 0:loaderHook.fetch)?(e,t)=>lazyLoaderHookFetch(e,t,loaderHook):"undefined"==typeof fetch?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{try{var _vm_constants,_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER;let res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname),script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
|
|
4
|
+
})`,{filename,importModuleDynamically:null!=(_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER=null==(_vm_constants=vm.constants)?void 0:_vm_constants.USE_MAIN_CONTEXT_DEFAULT_LOADER)?_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER:importNodeModule});script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename);let exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs.globalName){let container=exportedInterface[attrs.globalName]||exportedInterface;cb(void 0,container);return}cb(void 0,exportedInterface)}catch(e){cb(e instanceof Error?e:Error(`Script execution error: ${e}`))}};getFetch().then(async e=>{if((null==attrs?void 0:attrs.type)==="esm"||(null==attrs?void 0:attrs.type)==="module")return loadModule(urlObj.href,{fetch:e,vm:await importNodeModule("vm")}).then(async e=>{await e.evaluate(),cb(void 0,e.namespace)}).catch(e=>{cb(e instanceof Error?e:Error(`Script execution error: ${e}`))});handleScriptFetch(e,urlObj)}).catch(e=>{cb(e)})}:(e,t,r,n)=>{t(Error("createScriptNode is disabled in non-Node.js environment"))},loadScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t)=>new Promise((r,n)=>{createScriptNode(e,(e,o)=>{if(e)n(e);else{var i,a;let e=(null==t||null==(i=t.attrs)?void 0:i.globalName)||`__FEDERATION_${null==t||null==(a=t.attrs)?void 0:a.name}:custom__`;r(globalThis[e]=o)}},t.attrs,t.loaderHook)}):(e,t)=>{throw Error("loadScriptNode is disabled in non-Node.js environment")},esmModuleCache=new Map;async function loadModule(e,t){if(esmModuleCache.has(e))return esmModuleCache.get(e);let{fetch:r,vm:n}=t,o=await r(e),i=await o.text(),a=new n.SourceTextModule(i,{importModuleDynamically:async(r,n)=>loadModule(new URL(r,e).href,t)});return esmModuleCache.set(e,a),await a.link(async r=>{let n=new URL(r,e).href;return await loadModule(n,t)}),a}function normalizeOptions(e,t,r){return function(n){if(!1===n)return!1;if(void 0===n)if(e)return t;else return!1;if(!0===n)return t;if(n&&"object"==typeof n)return polyfills._({},t,n);throw Error(`Unexpected type for \`${r}\`, expect boolean/undefined/object, got: ${typeof n}`)}}let createModuleFederationConfig=e=>e;exports.BROWSER_LOG_KEY=BROWSER_LOG_KEY,exports.ENCODE_NAME_PREFIX=ENCODE_NAME_PREFIX,exports.EncodedNameTransformMap=EncodedNameTransformMap,exports.FederationModuleManifest=FederationModuleManifest,exports.MANIFEST_EXT=MANIFEST_EXT,exports.MFModuleType=MFModuleType,exports.MFPrefetchCommon=MFPrefetchCommon,exports.MODULE_DEVTOOL_IDENTIFIER=MODULE_DEVTOOL_IDENTIFIER,exports.ManifestFileName=ManifestFileName,exports.NameTransformMap=NameTransformMap,exports.NameTransformSymbol=NameTransformSymbol,exports.SEPARATOR=SEPARATOR,exports.StatsFileName=StatsFileName,exports.TEMP_DIR=TEMP_DIR,exports.assert=assert,exports.composeKeyWithSeparator=composeKeyWithSeparator,exports.containerPlugin=ContainerPlugin,exports.containerReferencePlugin=ContainerReferencePlugin,exports.createLink=createLink,exports.createLogger=createLogger,exports.createModuleFederationConfig=createModuleFederationConfig,exports.createScript=createScript,exports.createScriptNode=createScriptNode,exports.decodeName=decodeName,exports.encodeName=encodeName,exports.error=error,exports.generateExposeFilename=generateExposeFilename,exports.generateShareFilename=generateShareFilename,exports.generateSnapshotFromManifest=generateSnapshotFromManifest,exports.getProcessEnv=getProcessEnv,exports.getResourceUrl=getResourceUrl,exports.inferAutoPublicPath=inferAutoPublicPath,exports.isBrowserEnv=isBrowserEnv,exports.isDebugMode=isDebugMode,exports.isManifestProvider=isManifestProvider,exports.isReactNativeEnv=isReactNativeEnv,exports.isRequiredVersion=isRequiredVersion,exports.isStaticResourcesEqual=isStaticResourcesEqual,exports.loadScript=loadScript,exports.loadScriptNode=loadScriptNode,exports.logger=logger,exports.moduleFederationPlugin=ModuleFederationPlugin,exports.normalizeOptions=normalizeOptions,exports.parseEntry=parseEntry,exports.safeToString=safeToString,exports.safeWrapper=safeWrapper,exports.sharePlugin=SharePlugin,exports.simpleJoinRemoteEntry=simpleJoinRemoteEntry,exports.warn=warn},58867:function(e,t){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}t._=r},2721:function(e,t){"use strict";t.FEDERATION_SUPPORTED_TYPES=["script"]},51490:function(e,t,r){"use strict";var n=r(10121),o=r(2721),i=r(75365);function a(e){e.S&&!e.federation.hasAttachShareScopeMap&&e.federation.instance&&e.federation.instance.shareScopeMap&&(e.S=e.federation.instance.shareScopeMap,e.federation.hasAttachShareScopeMap=!0)}function s(e){let{chunkId:t,promises:r,chunkMapping:n,idToExternalAndNameMapping:s,webpackRequire:l,idToRemoteMap:c}=e;a(l),l.o(n,t)&&n[t].forEach(e=>{let t=l.R;t||(t=[]);let n=s[e],a=c[e];if(t.indexOf(n)>=0)return;if(t.push(n),n.p)return r.push(n.p);let u=t=>{t||(t=Error("Container missing")),"string"==typeof t.message&&(t.message+=`
|
|
5
|
+
while loading "${n[1]}" from ${n[2]}`),l.m[e]=()=>{throw t},n.p=0},h=(e,t,o,i,a,s)=>{try{let l=e(t,o);if(!l||!l.then)return a(l,i,s);{let e=l.then(e=>a(e,i),u);if(!s)return e;r.push(n.p=e)}}catch(e){u(e)}},f=(e,t,r)=>e?h(l.I,n[0],0,e,d,r):u();var d=(e,r,o)=>h(r.get,n[1],t,0,p,o),p=t=>{n.p=1,l.m[e]=e=>{e.exports=t()}};let m=()=>{try{let e=i.decodeName(a[0].name,i.ENCODE_NAME_PREFIX)+n[1].slice(1),t=l.federation.instance,r=()=>l.federation.instance.loadRemote(e,{loadFactory:!1,from:"build"});if("version-first"===t.options.shareStrategy)return Promise.all(t.sharedHandler.initializeSharing(n[0])).then(()=>r());return r()}catch(e){u(e)}};1===a.length&&o.FEDERATION_SUPPORTED_TYPES.includes(a[0].externalType)&&a[0].name?h(m,n[2],0,0,p,1):h(l,n[2],0,0,f,1)})}function l(e){let{chunkId:t,promises:r,chunkMapping:n,installedModules:o,moduleToHandlerMapping:i,webpackRequire:s}=e;a(s),s.o(n,t)&&n[t].forEach(e=>{if(s.o(o,e))return r.push(o[e]);let t=t=>{o[e]=0,s.m[e]=r=>{var n;delete s.c[e];let o=t(),{shareInfo:a}=i[e];if((null==a||null==(n=a.shareConfig)?void 0:n.layer)&&o&&"object"==typeof o)try{o.hasOwnProperty("layer")&&void 0!==o.layer||(o.layer=a.shareConfig.layer)}catch(e){}r.exports=o}},n=t=>{delete o[e],s.m[e]=r=>{throw delete s.c[e],t}};try{let a=s.federation.instance;if(!a)throw Error("Federation instance not found!");let{shareKey:l,getter:c,shareInfo:u}=i[e],h=a.loadShare(l,{customShareInfo:u}).then(e=>!1===e?c():e);h.then?r.push(o[e]=h.then(t).catch(n)):t(h)}catch(e){n(e)}})}function c(e){let{shareScopeName:t,webpackRequire:r,initPromises:n,initTokens:i,initScope:s}=e,l=Array.isArray(t)?t:[t];var c=[],u=function(e){s||(s=[]);let l=r.federation.instance;var c=i[e];if(c||(c=i[e]={from:l.name}),s.indexOf(c)>=0)return;s.push(c);let u=n[e];if(u)return u;var h=e=>"undefined"!=typeof console&&console.warn&&console.warn(e),f=n=>{var o=e=>h("Initialization of sharing external failed: "+e);try{var i=r(n);if(!i)return;var a=n=>n&&n.init&&n.init(r.S[e],s,{shareScopeMap:r.S||{},shareScopeKeys:t});if(i.then)return d.push(i.then(a,o));var l=a(i);if(l&&"boolean"!=typeof l&&l.then)return d.push(l.catch(o))}catch(e){o(e)}};let d=l.initializeSharing(e,{strategy:l.options.shareStrategy,initScope:s,from:"build"});a(r);let p=r.federation.bundlerRuntimeOptions.remotes;return(p&&Object.keys(p.idToRemoteMap).forEach(e=>{let t=p.idToRemoteMap[e],r=p.idToExternalAndNameMapping[e][2];if(t.length>1)f(r);else if(1===t.length){let e=t[0];o.FEDERATION_SUPPORTED_TYPES.includes(e.externalType)||f(r)}}),d.length)?n[e]=Promise.all(d).then(()=>n[e]=!0):n[e]=!0};return l.forEach(e=>{c.push(u(e))}),Promise.all(c).then(()=>!0)}function u(e){let{moduleId:t,moduleToHandlerMapping:r,webpackRequire:n}=e,o=n.federation.instance;if(!o)throw Error("Federation instance not found!");let{shareKey:i,shareInfo:a}=r[t];try{return o.loadShareSync(i,{customShareInfo:a})}catch(e){throw console.error('loadShareSync failed! The function should not be called unless you set "eager:true". If you do not set it, and encounter this issue, you can check whether an async boundary is implemented.'),console.error("The original error message is as follows: "),e}}function h(e){let{moduleToHandlerMapping:t,webpackRequire:r,installedModules:n,initialConsumes:o}=e;o.forEach(e=>{r.m[e]=o=>{var i;n[e]=0,delete r.c[e];let a=u({moduleId:e,moduleToHandlerMapping:t,webpackRequire:r});if("function"!=typeof a)throw Error(`Shared module is not available for eager consumption: ${e}`);let s=a(),{shareInfo:l}=t[e];if((null==l||null==(i=l.shareConfig)?void 0:i.layer)&&s&&"object"==typeof s)try{s.hasOwnProperty("layer")&&void 0!==s.layer||(s.layer=l.shareConfig.layer)}catch(e){}o.exports=s}})}function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function d(e){let{webpackRequire:t,shareScope:r,initScope:n,shareScopeKey:o,remoteEntryInitOptions:i}=e;if(!t.S||!t.federation||!t.federation.instance||!t.federation.initOptions)return;let a=t.federation.instance;a.initOptions(f({name:t.federation.initOptions.name,remotes:[]},i));let s=null==i?void 0:i.shareScopeKeys,l=null==i?void 0:i.shareScopeMap;if(o&&"string"!=typeof o)o.forEach(e=>{if(!s||!l)return void a.initShareScopeMap(e,r,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}});l[e]||(l[e]={});let t=l[e];a.initShareScopeMap(e,t,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}})});else{let e=o||"default";Array.isArray(s)?s.forEach(e=>{l[e]||(l[e]={});let t=l[e];a.initShareScopeMap(e,t,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}})}):a.initShareScopeMap(e,r,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}})}return(t.federation.attachShareScopeMap&&t.federation.attachShareScopeMap(t),"function"==typeof t.federation.prefetch&&t.federation.prefetch(),Array.isArray(o))?t.federation.initOptions.shared?t.I(o,n):Promise.all(o.map(e=>t.I(e,n))).then(()=>!0):t.I(o||"default",n)}e.exports={runtime:function(e){var t=Object.create(null);if(e)for(var r in e)t[r]=e[r];return t.default=e,Object.freeze(t)}(n),instance:void 0,initOptions:void 0,bundlerRuntime:{remotes:s,consumes:l,I:c,S:{},installInitialConsumes:h,initContainerEntry:d},attachShareScopeMap:a,bundlerRuntimeOptions:{}}},34469:function(e,t,r){"use strict";var n,o,i,a,s,l,c,u,h,f,d,p,m=r(51490),g=r.n(m);let y=[],_={},E="GaugeChart",b="version-first";if((r.initializeSharingData||r.initializeExposesData)&&r.federation){let e=(e,t,r)=>{e&&e[t]&&(e[t]=r)},t=(e,t,r)=>{var n,o,i,a,s,l;let c=r();Array.isArray(c)?(null!=(i=(n=e)[o=t])||(n[o]=[]),e[t].push(...c)):"object"==typeof c&&null!==c&&(null!=(l=(a=e)[s=t])||(a[s]={}),Object.assign(e[t],c))},m=(e,t,r)=>{var n,o,i;null!=(i=(n=e)[o=t])||(n[o]=r())},v=null!=(u=null==(n=r.remotesLoadingData)?void 0:n.chunkMapping)?u:{},S=null!=(h=null==(o=r.remotesLoadingData)?void 0:o.moduleIdToRemoteDataMapping)?h:{},R=null!=(f=null==(i=r.initializeSharingData)?void 0:i.scopeToSharingDataMapping)?f:{},I=null!=(d=null==(a=r.consumesLoadingData)?void 0:a.chunkMapping)?d:{},N=null!=(p=null==(s=r.consumesLoadingData)?void 0:s.moduleIdToConsumeDataMapping)?p:{},$={},M=[],T={},A=null==(l=r.initializeExposesData)?void 0:l.shareScope;for(let e in g())r.federation[e]=g()[e];m(r.federation,"consumesLoadingModuleToHandlerMapping",()=>{let e={};for(let[t,r]of Object.entries(N))e[t]={getter:r.fallback,shareInfo:{shareConfig:{fixedDependencies:!1,requiredVersion:r.requiredVersion,strictVersion:r.strictVersion,singleton:r.singleton,eager:r.eager},scope:[r.shareScope]},shareKey:r.shareKey};return e}),m(r.federation,"initOptions",()=>({})),m(r.federation.initOptions,"name",()=>E),m(r.federation.initOptions,"shareStrategy",()=>b),m(r.federation.initOptions,"shared",()=>{let e={};for(let[t,r]of Object.entries(R))for(let n of r)if("object"==typeof n&&null!==n){let{name:r,version:o,factory:i,eager:a,singleton:s,requiredVersion:l,strictVersion:c}=n,u={},h=function(e){return void 0!==e};h(s)&&(u.singleton=s),h(l)&&(u.requiredVersion=l),h(a)&&(u.eager=a),h(c)&&(u.strictVersion=c);let f={version:o,scope:[t],shareConfig:u,get:i};e[r]?e[r].push(f):e[r]=[f]}return e}),t(r.federation.initOptions,"remotes",()=>Object.values(_).flat().filter(e=>"script"===e.externalType)),t(r.federation.initOptions,"plugins",()=>y),m(r.federation,"bundlerRuntimeOptions",()=>({})),m(r.federation.bundlerRuntimeOptions,"remotes",()=>({})),m(r.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>v),m(r.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{let e={};for(let[t,r]of Object.entries(S))e[t]=[r.shareScope,r.name,r.externalModuleId,r.remoteName];return e}),m(r.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>r),t(r.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{let e={};for(let[t,r]of Object.entries(S)){let n=_[r.remoteName];n&&(e[t]=n)}return e}),e(r,"S",r.federation.bundlerRuntime.S),r.federation.attachShareScopeMap&&r.federation.attachShareScopeMap(r),e(r.f,"remotes",(e,t)=>r.federation.bundlerRuntime.remotes({chunkId:e,promises:t,chunkMapping:v,idToExternalAndNameMapping:r.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:r.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:r})),e(r.f,"consumes",(e,t)=>r.federation.bundlerRuntime.consumes({chunkId:e,promises:t,chunkMapping:I,moduleToHandlerMapping:r.federation.consumesLoadingModuleToHandlerMapping,installedModules:$,webpackRequire:r})),e(r,"I",(e,t)=>r.federation.bundlerRuntime.I({shareScopeName:e,initScope:t,initPromises:M,initTokens:T,webpackRequire:r})),e(r,"initContainer",(e,t,n)=>r.federation.bundlerRuntime.initContainerEntry({shareScope:e,initScope:t,remoteEntryInitOptions:n,shareScopeKey:A,webpackRequire:r})),e(r,"getContainer",(e,t)=>{var n=r.initializeExposesData.moduleMap;return r.R=t,t=Object.prototype.hasOwnProperty.call(n,e)?n[e]():Promise.resolve().then(()=>{throw Error('Module "'+e+'" does not exist in container.')}),r.R=void 0,t}),r.federation.instance=r.federation.runtime.init(r.federation.initOptions),(null==(c=r.consumesLoadingData)?void 0:c.initialConsumes)&&r.federation.bundlerRuntime.installInitialConsumes({webpackRequire:r,installedModules:$,initialConsumes:r.consumesLoadingData.initialConsumes,moduleToHandlerMapping:r.federation.consumesLoadingModuleToHandlerMapping})}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.c=__webpack_module_cache__,__webpack_require__.x=()=>__webpack_require__(6023),(()=>{__webpack_require__.federation||(__webpack_require__.federation={chunkMatcher:function(e){return!/^([89]46|(17|75|87)9|157|263|315|494|677)$/.test(e)},rootOutputDir:"../../"})})(),(()=>{__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t}})(),(()=>{__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{var e=__webpack_require__.x,t=!1;__webpack_require__.x=function(){if(t||(t=!0,__webpack_require__(34469)),"function"==typeof e)return e();console.warn("[MF] Invalid prevStartup")}})(),(()=>{__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce((t,r)=>(__webpack_require__.f[r](e,t),t),[]))})(),(()=>{__webpack_require__.u=e=>"__mf/js/async/"+("118"===e?"lib-router":e)+"."+({109:"38fe9d18",116:"577ccfb6",118:"34d74652",119:"be08efba",173:"9d9aaec5",214:"a5a27e07",224:"b7775059",238:"16f121d4",288:"6d46d8e7",292:"149a1005",296:"bdf413a6",298:"bad26699",308:"b768a783",409:"b3df73a9",413:"1b99956f",422:"088d32ca",553:"ac447ad8",623:"7ff5fe72",694:"dd75606a",738:"24d6cefe",740:"87850b80",75:"b72fd8c7",770:"ac5776da",774:"fffc4f90",790:"1575a3f0",863:"a5e334d8",929:"904de1f6",930:"1937c2c4",960:"f1e14dae",964:"eba21d42",981:"55bd66db"})[e]+".js"})(),(()=>{__webpack_require__.miniCssF=e=>"__mf/css/async/"+e+"."+({263:"683bd428",759:"683bd428"})[e]+".css"})(),(()=>{__webpack_require__.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e={},t="GaugeChart:";__webpack_require__.l=function(r,n,o,i){if(e[r])return void e[r].push(n);if(void 0!==o)for(var a,s,l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==r||u.getAttribute("data-webpack")==t+o){a=u;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,__webpack_require__.nc&&a.setAttribute("nonce",__webpack_require__.nc),a.setAttribute("data-webpack",t+o),a.src=r),e[r]=[n];var h=function(t,n){a.onerror=a.onload=null,clearTimeout(f);var o=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),s&&document.head.appendChild(a)}})(),(()=>{__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e)})(),(()=>{__webpack_require__.nc=void 0})(),(()=>{__webpack_require__.p="/plugins/GaugeChart/"})(),(()=>{__webpack_require__.S={},__webpack_require__.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@emotion/react",version:"11.14.0",factory:()=>Promise.all([__webpack_require__.e("960"),__webpack_require__.e("677"),__webpack_require__.e("930")]).then(()=>()=>__webpack_require__(96434)),eager:0,singleton:1,requiredVersion:"^11.11.3"},{name:"@emotion/styled",version:"11.14.0",factory:()=>Promise.all([__webpack_require__.e("677"),__webpack_require__.e("157"),__webpack_require__.e("694")]).then(()=>()=>__webpack_require__(51958)),eager:0,singleton:1},{name:"@hookform/resolvers",version:"3.10.0",factory:()=>Promise.all([__webpack_require__.e("292"),__webpack_require__.e("677"),__webpack_require__.e("214")]).then(()=>()=>__webpack_require__(81228)),eager:0,singleton:1},{name:"@perses-dev/components",version:"0.52.0",factory:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("292"),__webpack_require__.e("413"),__webpack_require__.e("422"),__webpack_require__.e("116"),__webpack_require__.e("929"),__webpack_require__.e("288"),__webpack_require__.e("119"),__webpack_require__.e("298"),__webpack_require__.e("677"),__webpack_require__.e("157"),__webpack_require__.e("879"),__webpack_require__.e("179"),__webpack_require__.e("946"),__webpack_require__.e("846"),__webpack_require__.e("759")]).then(()=>()=>__webpack_require__(68003)),eager:0,singleton:1},{name:"@perses-dev/plugin-system",version:"0.52.0",factory:()=>Promise.all([__webpack_require__.e("118"),__webpack_require__.e("292"),__webpack_require__.e("116"),__webpack_require__.e("929"),__webpack_require__.e("119"),__webpack_require__.e("109"),__webpack_require__.e("677"),__webpack_require__.e("157"),__webpack_require__.e("879"),__webpack_require__.e("179"),__webpack_require__.e("946"),__webpack_require__.e("846"),__webpack_require__.e("315"),__webpack_require__.e("740")]).then(()=>()=>__webpack_require__(82323)),eager:0,singleton:1},{name:"date-fns",version:"4.1.0",factory:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("75")]).then(()=>()=>__webpack_require__(99657)),eager:0,singleton:1},{name:"echarts",version:"5.5.0",factory:()=>Promise.all([__webpack_require__.e("413"),__webpack_require__.e("422"),__webpack_require__.e("409")]).then(()=>()=>__webpack_require__(71932)),eager:0,singleton:1},{name:"immer",version:"10.1.1",factory:()=>__webpack_require__.e("774").then(()=>()=>__webpack_require__(75586)),eager:0,singleton:1},{name:"lodash",version:"4.17.21",factory:()=>__webpack_require__.e("981").then(()=>()=>__webpack_require__(98784)),eager:0,singleton:1},{name:"mdi-material-ui",version:"7.9.3",factory:()=>Promise.all([__webpack_require__.e("929"),__webpack_require__.e("296"),__webpack_require__.e("677"),__webpack_require__.e("157"),__webpack_require__.e("946")]).then(()=>()=>__webpack_require__(61157)),eager:0,singleton:1,requiredVersion:"7.4.0"},{name:"react-dom",version:"18.3.1",factory:()=>Promise.all([__webpack_require__.e("173"),__webpack_require__.e("677")]).then(()=>()=>__webpack_require__(31542)),eager:0,singleton:1,requiredVersion:"18.2.0"},{name:"react",version:"18.3.1",factory:()=>__webpack_require__.e("964").then(()=>()=>__webpack_require__(27378)),eager:0,singleton:1,requiredVersion:"18.2.0"},{name:"use-resize-observer",version:"9.1.0",factory:()=>Promise.all([__webpack_require__.e("677"),__webpack_require__.e("553")]).then(()=>()=>__webpack_require__(75276)),eager:0,singleton:1,requiredVersion:"9.1.0"}]},uniqueName:"GaugeChart"},__webpack_require__.I=__webpack_require__.I||function(){throw Error("should have __webpack_require__.I")}})(),(()=>{__webpack_require__.consumesLoadingData={chunkMapping:{179:["6085"],677:["54538"],946:["45913"],846:["96494","93098"],494:["57871"],879:["10223","4665","20461"],157:["72116"],315:["55922","58118","84275","72103","59862","30156","74614","57751","27901","55352"]},moduleIdToConsumeDataMapping:{20461:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^4.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("75")]).then(()=>()=>__webpack_require__(99657))},59862:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"0.52.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>__webpack_require__(82323)},58118:{shareScope:"default",shareKey:"immer",import:"immer",requiredVersion:">=9.0.6",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("774").then(()=>()=>__webpack_require__(75586))},54538:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("964").then(()=>()=>__webpack_require__(27378))},93098:{shareScope:"default",shareKey:"lodash",import:"lodash",requiredVersion:"^4.17.21",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("981").then(()=>()=>__webpack_require__(98784))},10223:{shareScope:"default",shareKey:"use-resize-observer",import:"use-resize-observer",requiredVersion:"9.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("623").then(()=>()=>__webpack_require__(75276))},4665:{shareScope:"default",shareKey:"date-fns-tz",import:"date-fns-tz",requiredVersion:"^3.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("224"),__webpack_require__.e("308"),__webpack_require__.e("494")]).then(()=>()=>__webpack_require__(48872))},96494:{shareScope:"default",shareKey:"immer",import:"immer",requiredVersion:"^10.1.1",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("774").then(()=>()=>__webpack_require__(75586))},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([__webpack_require__.e("238"),__webpack_require__.e("75")]).then(()=>()=>__webpack_require__(99657))},74614:{shareScope:"default",shareKey:"lodash",import:"lodash",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("981").then(()=>()=>__webpack_require__(98784))},6085:{shareScope:"default",shareKey:"react-dom",import:"react-dom",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("173").then(()=>()=>__webpack_require__(31542))},27901:{shareScope:"default",shareKey:"@perses-dev/components",import:"@perses-dev/components",requiredVersion:"0.52.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("413"),__webpack_require__.e("422"),__webpack_require__.e("288"),__webpack_require__.e("298"),__webpack_require__.e("263")]).then(()=>()=>__webpack_require__(68003))},30156:{shareScope:"default",shareKey:"echarts",import:"echarts",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("413"),__webpack_require__.e("422"),__webpack_require__.e("409")]).then(()=>()=>__webpack_require__(71932))},55922:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("770").then(()=>()=>__webpack_require__(51958))},72103:{shareScope:"default",shareKey:"mdi-material-ui",import:"mdi-material-ui",requiredVersion:"7.4.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("296").then(()=>()=>__webpack_require__(61157))},84275:{shareScope:"default",shareKey:"@hookform/resolvers",import:"@hookform/resolvers",requiredVersion:"^2.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("738").then(()=>()=>__webpack_require__(81228))},45913:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"^11.3.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("790").then(()=>()=>__webpack_require__(51958))},55352:{shareScope:"default",shareKey:"immer",import:"immer",requiredVersion:">=8.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("774").then(()=>()=>__webpack_require__(75586))},57751:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>__webpack_require__(82323)},72116:{shareScope:"default",shareKey:"@emotion/react",import:"@emotion/react",requiredVersion:"^11.11.3",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("960").then(()=>()=>__webpack_require__(96434))}},initialConsumes:[]},__webpack_require__.f.consumes=__webpack_require__.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")}})(),(()=>{if("undefined"!=typeof document){var e=function(e,t,r,n,o){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",__webpack_require__.nc&&(i.nonce=__webpack_require__.nc);var a=function(r){if(i.onerror=i.onload=null,"load"===r.type)n();else{var a=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.href||t,l=Error("Loading CSS chunk "+e+" failed.\\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=a,l.request=s,i.parentNode&&i.parentNode.removeChild(i),o(l)}};return i.onerror=i.onload=a,i.href=t,r?r.parentNode.insertBefore(i,r.nextSibling):document.head.appendChild(i),i},t=function(e,t){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=r[n],i=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(i===e||i===t))return o}for(var a=document.getElementsByTagName("style"),n=0;n<a.length;n++){var o=a[n],i=o.getAttribute("data-href");if(i===e||i===t)return o}},r=function(r){return new Promise(function(n,o){var i=__webpack_require__.miniCssF(r),a=__webpack_require__.p+i;if(t(i,a))return n();e(r,a,null,n,o)})},n={909:0};__webpack_require__.f.miniCss=function(e,t){var o={759:1,263:1};n[e]?t.push(n[e]):0!==n[e]&&o[e]&&t.push(n[e]=r(e).then(function(){n[e]=0},function(t){throw delete n[e],t}))}}})(),(()=>{var e={909:0};__webpack_require__.f.j=function(t,r){var n=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(/^([89]46|(17|75|87)9|157|263|315|494|677)$/.test(t))e[t]=0;else{var o=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=o);var i=__webpack_require__.p+__webpack_require__.u(t),a=Error(),s=function(r){if(__webpack_require__.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}};__webpack_require__.l(i,s,"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[i,a,s]=r,l=0;if(i.some(t=>0!==e[t])){for(n in a)__webpack_require__.o(a,n)&&(__webpack_require__.m[n]=a[n]);s&&s(__webpack_require__)}for(t&&t(r);l<i.length;l++)o=i[l],__webpack_require__.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=self.chunk_GaugeChart=self.chunk_GaugeChart||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var __webpack_exports__=__webpack_require__.x()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GaugeChartOptionsEditorSettings.d.ts","sourceRoot":"","sources":["../../src/GaugeChartOptionsEditorSettings.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAKL,4BAA4B,EAC7B,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"GaugeChartOptionsEditorSettings.d.ts","sourceRoot":"","sources":["../../src/GaugeChartOptionsEditorSettings.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAKL,4BAA4B,EAC7B,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,4BAA4B,GAAG,YAAY,CAyFjG"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { TextField } from '@mui/material';
|
|
14
|
+
import { Switch, TextField } from '@mui/material';
|
|
15
15
|
import { FormatControls, OptionsEditorColumn, OptionsEditorControl, OptionsEditorGrid, OptionsEditorGroup, ThresholdsEditor } from '@perses-dev/components';
|
|
16
16
|
import { CalculationSelector } from '@perses-dev/plugin-system';
|
|
17
17
|
import { produce } from 'immer';
|
|
@@ -19,6 +19,9 @@ import merge from 'lodash/merge';
|
|
|
19
19
|
import { DEFAULT_FORMAT, DEFAULT_MAX_PERCENT, DEFAULT_MAX_PERCENT_DECIMAL } from './gauge-chart-model';
|
|
20
20
|
export function GaugeChartOptionsEditorSettings(props) {
|
|
21
21
|
const { onChange, value } = props;
|
|
22
|
+
/* If legend setting doesn't exist (because it is optional), the legend should show by default
|
|
23
|
+
This is for the records before the legend option was added
|
|
24
|
+
*/ const showLegend = value?.legend?.show ?? true;
|
|
22
25
|
const handleCalculationChange = (newCalculation)=>{
|
|
23
26
|
onChange(produce(value, (draft)=>{
|
|
24
27
|
draft.calculation = newCalculation;
|
|
@@ -75,11 +78,27 @@ export function GaugeChartOptionsEditorSettings(props) {
|
|
|
75
78
|
]
|
|
76
79
|
})
|
|
77
80
|
}),
|
|
78
|
-
/*#__PURE__*/
|
|
79
|
-
children:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
/*#__PURE__*/ _jsxs(OptionsEditorColumn, {
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ _jsx(ThresholdsEditor, {
|
|
84
|
+
thresholds: value.thresholds,
|
|
85
|
+
onChange: handleThresholdsChange
|
|
86
|
+
}),
|
|
87
|
+
/*#__PURE__*/ _jsx(OptionsEditorControl, {
|
|
88
|
+
label: "Show legend",
|
|
89
|
+
control: /*#__PURE__*/ _jsx(Switch, {
|
|
90
|
+
onChange: ()=>{
|
|
91
|
+
onChange(produce(value, (draft)=>{
|
|
92
|
+
draft.legend = {
|
|
93
|
+
...draft.legend,
|
|
94
|
+
show: !showLegend
|
|
95
|
+
};
|
|
96
|
+
}));
|
|
97
|
+
},
|
|
98
|
+
checked: showLegend
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
]
|
|
83
102
|
})
|
|
84
103
|
]
|
|
85
104
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/GaugeChartOptionsEditorSettings.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 { TextField } from '@mui/material';\nimport {\n FormatControls,\n FormatControlsProps,\n OptionsEditorColumn,\n OptionsEditorControl,\n OptionsEditorGrid,\n OptionsEditorGroup,\n ThresholdsEditor,\n} from '@perses-dev/components';\nimport { ThresholdOptions } from '@perses-dev/core';\nimport { CalculationSelector, CalculationSelectorProps } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport merge from 'lodash/merge';\nimport { ReactElement } from 'react';\nimport {\n DEFAULT_FORMAT,\n DEFAULT_MAX_PERCENT,\n DEFAULT_MAX_PERCENT_DECIMAL,\n GaugeChartOptions,\n GaugeChartOptionsEditorProps,\n} from './gauge-chart-model';\n\nexport function GaugeChartOptionsEditorSettings(props: GaugeChartOptionsEditorProps): ReactElement {\n const { onChange, value } = props;\n\n const handleCalculationChange: CalculationSelectorProps['onChange'] = (newCalculation) => {\n onChange(\n produce(value, (draft: GaugeChartOptions) => {\n draft.calculation = newCalculation;\n })\n );\n };\n\n const handleUnitChange: FormatControlsProps['onChange'] = (newFormat) => {\n onChange(\n produce(value, (draft: GaugeChartOptions) => {\n draft.format = newFormat;\n })\n );\n };\n\n // ensures decimalPlaces defaults to correct value\n const format = merge({}, DEFAULT_FORMAT, value.format);\n\n // max only needs to be set explicitly for units other than percent and percent-decimal\n let maxPlaceholder = 'Enter value';\n if (format.unit === 'percent') {\n maxPlaceholder = DEFAULT_MAX_PERCENT.toString();\n } else if (format.unit === 'percent-decimal') {\n maxPlaceholder = DEFAULT_MAX_PERCENT_DECIMAL.toString();\n }\n\n const handleThresholdsChange = (thresholds: ThresholdOptions): void => {\n onChange(\n produce(value, (draft: GaugeChartOptions) => {\n draft.thresholds = thresholds;\n })\n );\n };\n\n return (\n <OptionsEditorGrid>\n <OptionsEditorColumn>\n <OptionsEditorGroup title=\"Misc\">\n <FormatControls value={format} onChange={handleUnitChange} />\n <CalculationSelector value={value.calculation} onChange={handleCalculationChange} />\n <OptionsEditorControl\n label=\"Max\"\n control={\n <TextField\n type=\"number\"\n value={value.max ?? ''}\n onChange={(e) => {\n // ensure empty value resets to undef to allow chart to calculate max\n const newValue = e.target.value ? Number(e.target.value) : undefined;\n onChange(\n produce(value, (draft: GaugeChartOptions) => {\n draft.max = newValue;\n })\n );\n }}\n placeholder={maxPlaceholder}\n />\n }\n />\n </OptionsEditorGroup>\n </OptionsEditorColumn>\n <OptionsEditorColumn>\n <ThresholdsEditor thresholds={value.thresholds} onChange={handleThresholdsChange} />\n </OptionsEditorColumn>\n </OptionsEditorGrid>\n );\n}\n"],"names":["TextField","FormatControls","OptionsEditorColumn","OptionsEditorControl","OptionsEditorGrid","OptionsEditorGroup","ThresholdsEditor","CalculationSelector","produce","merge","DEFAULT_FORMAT","DEFAULT_MAX_PERCENT","DEFAULT_MAX_PERCENT_DECIMAL","GaugeChartOptionsEditorSettings","props","onChange","value","handleCalculationChange","newCalculation","draft","calculation","handleUnitChange","newFormat","format","maxPlaceholder","unit","toString","handleThresholdsChange","thresholds","title","label","control","type","max","e","newValue","target","Number","undefined","placeholder"],"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,SAAS,QAAQ,gBAAgB;
|
|
1
|
+
{"version":3,"sources":["../../src/GaugeChartOptionsEditorSettings.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 { Switch, TextField } from '@mui/material';\nimport {\n FormatControls,\n FormatControlsProps,\n OptionsEditorColumn,\n OptionsEditorControl,\n OptionsEditorGrid,\n OptionsEditorGroup,\n ThresholdsEditor,\n} from '@perses-dev/components';\nimport { ThresholdOptions } from '@perses-dev/core';\nimport { CalculationSelector, CalculationSelectorProps } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport merge from 'lodash/merge';\nimport { ReactElement } from 'react';\nimport {\n DEFAULT_FORMAT,\n DEFAULT_MAX_PERCENT,\n DEFAULT_MAX_PERCENT_DECIMAL,\n GaugeChartOptions,\n GaugeChartOptionsEditorProps,\n} from './gauge-chart-model';\n\nexport function GaugeChartOptionsEditorSettings(props: GaugeChartOptionsEditorProps): ReactElement {\n const { onChange, value } = props;\n /* If legend setting doesn't exist (because it is optional), the legend should show by default \n This is for the records before the legend option was added\n */\n const showLegend = value?.legend?.show ?? true;\n\n const handleCalculationChange: CalculationSelectorProps['onChange'] = (newCalculation) => {\n onChange(\n produce(value, (draft: GaugeChartOptions) => {\n draft.calculation = newCalculation;\n })\n );\n };\n\n const handleUnitChange: FormatControlsProps['onChange'] = (newFormat) => {\n onChange(\n produce(value, (draft: GaugeChartOptions) => {\n draft.format = newFormat;\n })\n );\n };\n\n // ensures decimalPlaces defaults to correct value\n const format = merge({}, DEFAULT_FORMAT, value.format);\n\n // max only needs to be set explicitly for units other than percent and percent-decimal\n let maxPlaceholder = 'Enter value';\n if (format.unit === 'percent') {\n maxPlaceholder = DEFAULT_MAX_PERCENT.toString();\n } else if (format.unit === 'percent-decimal') {\n maxPlaceholder = DEFAULT_MAX_PERCENT_DECIMAL.toString();\n }\n\n const handleThresholdsChange = (thresholds: ThresholdOptions): void => {\n onChange(\n produce(value, (draft: GaugeChartOptions) => {\n draft.thresholds = thresholds;\n })\n );\n };\n\n return (\n <OptionsEditorGrid>\n <OptionsEditorColumn>\n <OptionsEditorGroup title=\"Misc\">\n <FormatControls value={format} onChange={handleUnitChange} />\n <CalculationSelector value={value.calculation} onChange={handleCalculationChange} />\n <OptionsEditorControl\n label=\"Max\"\n control={\n <TextField\n type=\"number\"\n value={value.max ?? ''}\n onChange={(e) => {\n // ensure empty value resets to undef to allow chart to calculate max\n const newValue = e.target.value ? Number(e.target.value) : undefined;\n onChange(\n produce(value, (draft: GaugeChartOptions) => {\n draft.max = newValue;\n })\n );\n }}\n placeholder={maxPlaceholder}\n />\n }\n />\n </OptionsEditorGroup>\n </OptionsEditorColumn>\n <OptionsEditorColumn>\n <ThresholdsEditor thresholds={value.thresholds} onChange={handleThresholdsChange} />\n <OptionsEditorControl\n label=\"Show legend\"\n control={\n <Switch\n onChange={(): void => {\n onChange(\n produce(value, (draft: GaugeChartOptions) => {\n draft.legend = { ...draft.legend, show: !showLegend };\n })\n );\n }}\n checked={showLegend}\n />\n }\n />\n </OptionsEditorColumn>\n </OptionsEditorGrid>\n );\n}\n"],"names":["Switch","TextField","FormatControls","OptionsEditorColumn","OptionsEditorControl","OptionsEditorGrid","OptionsEditorGroup","ThresholdsEditor","CalculationSelector","produce","merge","DEFAULT_FORMAT","DEFAULT_MAX_PERCENT","DEFAULT_MAX_PERCENT_DECIMAL","GaugeChartOptionsEditorSettings","props","onChange","value","showLegend","legend","show","handleCalculationChange","newCalculation","draft","calculation","handleUnitChange","newFormat","format","maxPlaceholder","unit","toString","handleThresholdsChange","thresholds","title","label","control","type","max","e","newValue","target","Number","undefined","placeholder","checked"],"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,SAAS,QAAQ,gBAAgB;AAClD,SACEC,cAAc,EAEdC,mBAAmB,EACnBC,oBAAoB,EACpBC,iBAAiB,EACjBC,kBAAkB,EAClBC,gBAAgB,QACX,yBAAyB;AAEhC,SAASC,mBAAmB,QAAkC,4BAA4B;AAC1F,SAASC,OAAO,QAAQ,QAAQ;AAChC,OAAOC,WAAW,eAAe;AAEjC,SACEC,cAAc,EACdC,mBAAmB,EACnBC,2BAA2B,QAGtB,sBAAsB;AAE7B,OAAO,SAASC,gCAAgCC,KAAmC;IACjF,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B;;EAEA,GACA,MAAMG,aAAaD,OAAOE,QAAQC,QAAQ;IAE1C,MAAMC,0BAAgE,CAACC;QACrEN,SACEP,QAAQQ,OAAO,CAACM;YACdA,MAAMC,WAAW,GAAGF;QACtB;IAEJ;IAEA,MAAMG,mBAAoD,CAACC;QACzDV,SACEP,QAAQQ,OAAO,CAACM;YACdA,MAAMI,MAAM,GAAGD;QACjB;IAEJ;IAEA,kDAAkD;IAClD,MAAMC,SAASjB,MAAM,CAAC,GAAGC,gBAAgBM,MAAMU,MAAM;IAErD,uFAAuF;IACvF,IAAIC,iBAAiB;IACrB,IAAID,OAAOE,IAAI,KAAK,WAAW;QAC7BD,iBAAiBhB,oBAAoBkB,QAAQ;IAC/C,OAAO,IAAIH,OAAOE,IAAI,KAAK,mBAAmB;QAC5CD,iBAAiBf,4BAA4BiB,QAAQ;IACvD;IAEA,MAAMC,yBAAyB,CAACC;QAC9BhB,SACEP,QAAQQ,OAAO,CAACM;YACdA,MAAMS,UAAU,GAAGA;QACrB;IAEJ;IAEA,qBACE,MAAC3B;;0BACC,KAACF;0BACC,cAAA,MAACG;oBAAmB2B,OAAM;;sCACxB,KAAC/B;4BAAee,OAAOU;4BAAQX,UAAUS;;sCACzC,KAACjB;4BAAoBS,OAAOA,MAAMO,WAAW;4BAAER,UAAUK;;sCACzD,KAACjB;4BACC8B,OAAM;4BACNC,uBACE,KAAClC;gCACCmC,MAAK;gCACLnB,OAAOA,MAAMoB,GAAG,IAAI;gCACpBrB,UAAU,CAACsB;oCACT,qEAAqE;oCACrE,MAAMC,WAAWD,EAAEE,MAAM,CAACvB,KAAK,GAAGwB,OAAOH,EAAEE,MAAM,CAACvB,KAAK,IAAIyB;oCAC3D1B,SACEP,QAAQQ,OAAO,CAACM;wCACdA,MAAMc,GAAG,GAAGE;oCACd;gCAEJ;gCACAI,aAAaf;;;;;;0BAMvB,MAACzB;;kCACC,KAACI;wBAAiByB,YAAYf,MAAMe,UAAU;wBAAEhB,UAAUe;;kCAC1D,KAAC3B;wBACC8B,OAAM;wBACNC,uBACE,KAACnC;4BACCgB,UAAU;gCACRA,SACEP,QAAQQ,OAAO,CAACM;oCACdA,MAAMJ,MAAM,GAAG;wCAAE,GAAGI,MAAMJ,MAAM;wCAAEC,MAAM,CAACF;oCAAW;gCACtD;4BAEJ;4BACA0B,SAAS1B;;;;;;;AAOvB"}
|
|
@@ -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;AAQ7B,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAEjF,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,GAAG,IAAI,
|
|
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,CA0GhF;AAED,wBAAgB,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAUxG"}
|
package/lib/GaugeChartPanel.js
CHANGED
|
@@ -27,41 +27,41 @@ const GAUGE_MIN_WIDTH = 90;
|
|
|
27
27
|
const PANEL_PADDING_OFFSET = 20;
|
|
28
28
|
export function GaugeChartPanel(props) {
|
|
29
29
|
const { spec: pluginSpec, contentDimensions, queryResults } = props;
|
|
30
|
-
const { calculation, max } = pluginSpec;
|
|
30
|
+
const { calculation, max, legend } = pluginSpec;
|
|
31
31
|
const { thresholds: thresholdsColors } = useChartsTheme();
|
|
32
|
+
/* Legend setting just added to the cue schema
|
|
33
|
+
This line assures that if legend setting doesn't exist (for old gauge setting records),
|
|
34
|
+
The legend shows normally as before. If it exists, then it checks the show property.
|
|
35
|
+
*/ const showLegend = legend?.show ?? true;
|
|
32
36
|
// ensures all default format properties set if undef
|
|
33
37
|
const format = merge({}, DEFAULT_FORMAT, pluginSpec.format);
|
|
34
38
|
const thresholds = pluginSpec.thresholds ?? defaultThresholdInput;
|
|
35
39
|
const gaugeData = useMemo(()=>{
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
const seriesData = [];
|
|
41
|
+
if (!queryResults[0]?.data?.series?.length) {
|
|
42
|
+
return seriesData;
|
|
38
43
|
}
|
|
39
|
-
if (CalculationsMap[calculation]
|
|
44
|
+
if (!CalculationsMap[calculation]) {
|
|
40
45
|
console.warn(`Invalid GaugeChart panel calculation ${calculation}, fallback to ${DEFAULT_CALCULATION}`);
|
|
41
46
|
}
|
|
42
47
|
const calculate = CalculationsMap[calculation] ?? CalculationsMap[DEFAULT_CALCULATION];
|
|
43
|
-
const seriesData = [];
|
|
44
48
|
for (const timeSeries of queryResults[0].data.series){
|
|
45
|
-
|
|
49
|
+
seriesData.push({
|
|
46
50
|
value: calculate(timeSeries.values),
|
|
47
|
-
label: timeSeries.formattedName ?? ''
|
|
48
|
-
};
|
|
49
|
-
seriesData.push(series);
|
|
51
|
+
label: showLegend ? timeSeries.formattedName ?? '' : ''
|
|
52
|
+
});
|
|
50
53
|
}
|
|
51
54
|
return seriesData;
|
|
52
55
|
}, [
|
|
53
56
|
queryResults,
|
|
54
|
-
calculation
|
|
57
|
+
calculation,
|
|
58
|
+
showLegend
|
|
55
59
|
]);
|
|
56
|
-
if (contentDimensions
|
|
60
|
+
if (!contentDimensions) return null;
|
|
57
61
|
// needed for end value of last threshold color segment
|
|
58
62
|
let thresholdMax = max;
|
|
59
63
|
if (thresholdMax === undefined) {
|
|
60
|
-
|
|
61
|
-
thresholdMax = DEFAULT_MAX_PERCENT;
|
|
62
|
-
} else {
|
|
63
|
-
thresholdMax = DEFAULT_MAX_PERCENT_DECIMAL;
|
|
64
|
-
}
|
|
64
|
+
thresholdMax = format.unit === 'percent' ? DEFAULT_MAX_PERCENT : DEFAULT_MAX_PERCENT_DECIMAL;
|
|
65
65
|
}
|
|
66
66
|
const axisLineColors = convertThresholds(thresholds, format, thresholdMax, thresholdsColors);
|
|
67
67
|
const axisLine = {
|
|
@@ -72,7 +72,7 @@ export function GaugeChartPanel(props) {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
// no data message handled inside chart component
|
|
75
|
-
if (gaugeData.length
|
|
75
|
+
if (!gaugeData.length) {
|
|
76
76
|
return /*#__PURE__*/ _jsx(GaugeChartBase, {
|
|
77
77
|
width: contentDimensions.width,
|
|
78
78
|
height: contentDimensions.height,
|
|
@@ -113,7 +113,7 @@ export function GaugeChartPanel(props) {
|
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
export function GaugeChartLoading({ contentDimensions }) {
|
|
116
|
-
if (contentDimensions
|
|
116
|
+
if (!contentDimensions) return null;
|
|
117
117
|
return /*#__PURE__*/ _jsx(Skeleton, {
|
|
118
118
|
sx: {
|
|
119
119
|
margin: '0 auto'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/GaugeChartPanel.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 { Box, Skeleton, Stack } from '@mui/material';\nimport { useChartsTheme } from '@perses-dev/components';\nimport { CalculationsMap, DEFAULT_CALCULATION, TimeSeriesData } from '@perses-dev/core';\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport type { GaugeSeriesOption } from 'echarts';\nimport merge from 'lodash/merge';\nimport { ReactElement, useMemo } from 'react';\nimport {\n DEFAULT_FORMAT,\n DEFAULT_MAX_PERCENT,\n DEFAULT_MAX_PERCENT_DECIMAL,\n GaugeChartOptions,\n} from './gauge-chart-model';\nimport { convertThresholds, defaultThresholdInput } from './thresholds';\nimport { GaugeChartBase, GaugeSeries } from './GaugeChartBase';\n\nconst EMPTY_GAUGE_SERIES: GaugeSeries = { label: '', value: undefined };\nconst GAUGE_MIN_WIDTH = 90;\nconst PANEL_PADDING_OFFSET = 20;\n\nexport type GaugeChartPanelProps = PanelProps<GaugeChartOptions, TimeSeriesData>;\n\nexport function GaugeChartPanel(props: GaugeChartPanelProps): ReactElement | null {\n const { spec: pluginSpec, contentDimensions, queryResults } = props;\n const { calculation, max } = pluginSpec;\n\n const { thresholds: thresholdsColors } = useChartsTheme();\n\n // ensures all default format properties set if undef\n const format = merge({}, DEFAULT_FORMAT, pluginSpec.format);\n\n const thresholds = pluginSpec.thresholds ?? defaultThresholdInput;\n\n const gaugeData
|
|
1
|
+
{"version":3,"sources":["../../src/GaugeChartPanel.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 { Box, Skeleton, Stack } from '@mui/material';\nimport { useChartsTheme } from '@perses-dev/components';\nimport { CalculationsMap, DEFAULT_CALCULATION, TimeSeriesData } from '@perses-dev/core';\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport type { GaugeSeriesOption } from 'echarts';\nimport merge from 'lodash/merge';\nimport { ReactElement, useMemo } from 'react';\nimport {\n DEFAULT_FORMAT,\n DEFAULT_MAX_PERCENT,\n DEFAULT_MAX_PERCENT_DECIMAL,\n GaugeChartOptions,\n} from './gauge-chart-model';\nimport { convertThresholds, defaultThresholdInput } from './thresholds';\nimport { GaugeChartBase, GaugeSeries } from './GaugeChartBase';\n\nconst EMPTY_GAUGE_SERIES: GaugeSeries = { label: '', value: undefined };\nconst GAUGE_MIN_WIDTH = 90;\nconst PANEL_PADDING_OFFSET = 20;\n\nexport type GaugeChartPanelProps = PanelProps<GaugeChartOptions, TimeSeriesData>;\n\nexport function GaugeChartPanel(props: GaugeChartPanelProps): ReactElement | null {\n const { spec: pluginSpec, contentDimensions, queryResults } = props;\n const { calculation, max, legend } = pluginSpec;\n\n const { thresholds: thresholdsColors } = useChartsTheme();\n\n /* Legend setting just added to the cue schema\n This line assures that if legend setting doesn't exist (for old gauge setting records),\n The legend shows normally as before. If it exists, then it checks the show property.\n */\n const showLegend = legend?.show ?? true;\n\n // ensures all default format properties set if undef\n const format = merge({}, DEFAULT_FORMAT, pluginSpec.format);\n\n const thresholds = pluginSpec.thresholds ?? defaultThresholdInput;\n\n const gaugeData = useMemo((): GaugeSeries[] => {\n const seriesData: GaugeSeries[] = [];\n\n if (!queryResults[0]?.data?.series?.length) {\n return seriesData;\n }\n\n if (!CalculationsMap[calculation]) {\n console.warn(`Invalid GaugeChart panel calculation ${calculation}, fallback to ${DEFAULT_CALCULATION}`);\n }\n\n const calculate = CalculationsMap[calculation] ?? CalculationsMap[DEFAULT_CALCULATION];\n\n for (const timeSeries of queryResults[0].data.series) {\n seriesData.push({\n value: calculate(timeSeries.values),\n label: showLegend ? (timeSeries.formattedName ?? '') : '',\n });\n }\n return seriesData;\n }, [queryResults, calculation, showLegend]);\n\n if (!contentDimensions) return null;\n\n // needed for end value of last threshold color segment\n let thresholdMax = max;\n if (thresholdMax === undefined) {\n thresholdMax = format.unit === 'percent' ? DEFAULT_MAX_PERCENT : DEFAULT_MAX_PERCENT_DECIMAL;\n }\n const axisLineColors = convertThresholds(thresholds, format, thresholdMax, thresholdsColors);\n\n const axisLine: GaugeSeriesOption['axisLine'] = {\n show: true,\n lineStyle: {\n width: 5,\n color: axisLineColors,\n },\n };\n\n // no data message handled inside chart component\n if (!gaugeData.length) {\n return (\n <GaugeChartBase\n width={contentDimensions.width}\n height={contentDimensions.height}\n data={EMPTY_GAUGE_SERIES}\n format={format}\n axisLine={axisLine}\n max={thresholdMax}\n />\n );\n }\n\n // accounts for showing a separate chart for each time series\n let chartWidth = contentDimensions.width / gaugeData.length - PANEL_PADDING_OFFSET;\n if (chartWidth < GAUGE_MIN_WIDTH && gaugeData.length > 1) {\n // enables horizontal scroll when charts overflow outside of panel\n chartWidth = GAUGE_MIN_WIDTH;\n }\n\n const hasMultipleCharts = gaugeData.length > 1;\n\n return (\n <Stack\n direction=\"row\"\n spacing={hasMultipleCharts ? 2 : 0}\n justifyContent={hasMultipleCharts ? 'left' : 'center'}\n alignItems=\"center\"\n sx={{\n // so scrollbar only shows when necessary\n overflowX: gaugeData.length > 1 ? 'scroll' : 'auto',\n }}\n >\n {gaugeData.map((series, seriesIndex) => {\n return (\n <Box key={`gauge-series-${seriesIndex}`}>\n <GaugeChartBase\n width={chartWidth}\n height={contentDimensions.height}\n data={series}\n format={format}\n axisLine={axisLine}\n max={thresholdMax}\n />\n </Box>\n );\n })}\n </Stack>\n );\n}\n\nexport function GaugeChartLoading({ contentDimensions }: GaugeChartPanelProps): React.ReactElement | null {\n if (!contentDimensions) return null;\n return (\n <Skeleton\n sx={{ margin: '0 auto' }}\n variant=\"circular\"\n width={contentDimensions.width > contentDimensions.height ? contentDimensions.height : contentDimensions.width}\n height={contentDimensions.height}\n />\n );\n}\n"],"names":["Box","Skeleton","Stack","useChartsTheme","CalculationsMap","DEFAULT_CALCULATION","merge","useMemo","DEFAULT_FORMAT","DEFAULT_MAX_PERCENT","DEFAULT_MAX_PERCENT_DECIMAL","convertThresholds","defaultThresholdInput","GaugeChartBase","EMPTY_GAUGE_SERIES","label","value","undefined","GAUGE_MIN_WIDTH","PANEL_PADDING_OFFSET","GaugeChartPanel","props","spec","pluginSpec","contentDimensions","queryResults","calculation","max","legend","thresholds","thresholdsColors","showLegend","show","format","gaugeData","seriesData","data","series","length","console","warn","calculate","timeSeries","push","values","formattedName","thresholdMax","unit","axisLineColors","axisLine","lineStyle","width","color","height","chartWidth","hasMultipleCharts","direction","spacing","justifyContent","alignItems","sx","overflowX","map","seriesIndex","GaugeChartLoading","margin","variant"],"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,GAAG,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,gBAAgB;AACrD,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,eAAe,EAAEC,mBAAmB,QAAwB,mBAAmB;AAGxF,OAAOC,WAAW,eAAe;AACjC,SAAuBC,OAAO,QAAQ,QAAQ;AAC9C,SACEC,cAAc,EACdC,mBAAmB,EACnBC,2BAA2B,QAEtB,sBAAsB;AAC7B,SAASC,iBAAiB,EAAEC,qBAAqB,QAAQ,eAAe;AACxE,SAASC,cAAc,QAAqB,mBAAmB;AAE/D,MAAMC,qBAAkC;IAAEC,OAAO;IAAIC,OAAOC;AAAU;AACtE,MAAMC,kBAAkB;AACxB,MAAMC,uBAAuB;AAI7B,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,MAAMC,UAAU,EAAEC,iBAAiB,EAAEC,YAAY,EAAE,GAAGJ;IAC9D,MAAM,EAAEK,WAAW,EAAEC,GAAG,EAAEC,MAAM,EAAE,GAAGL;IAErC,MAAM,EAAEM,YAAYC,gBAAgB,EAAE,GAAG3B;IAEzC;;;EAGA,GACA,MAAM4B,aAAaH,QAAQI,QAAQ;IAEnC,qDAAqD;IACrD,MAAMC,SAAS3B,MAAM,CAAC,GAAGE,gBAAgBe,WAAWU,MAAM;IAE1D,MAAMJ,aAAaN,WAAWM,UAAU,IAAIjB;IAE5C,MAAMsB,YAAY3B,QAAQ;QACxB,MAAM4B,aAA4B,EAAE;QAEpC,IAAI,CAACV,YAAY,CAAC,EAAE,EAAEW,MAAMC,QAAQC,QAAQ;YAC1C,OAAOH;QACT;QAEA,IAAI,CAAC/B,eAAe,CAACsB,YAAY,EAAE;YACjCa,QAAQC,IAAI,CAAC,CAAC,qCAAqC,EAAEd,YAAY,cAAc,EAAErB,qBAAqB;QACxG;QAEA,MAAMoC,YAAYrC,eAAe,CAACsB,YAAY,IAAItB,eAAe,CAACC,oBAAoB;QAEtF,KAAK,MAAMqC,cAAcjB,YAAY,CAAC,EAAE,CAACW,IAAI,CAACC,MAAM,CAAE;YACpDF,WAAWQ,IAAI,CAAC;gBACd3B,OAAOyB,UAAUC,WAAWE,MAAM;gBAClC7B,OAAOgB,aAAcW,WAAWG,aAAa,IAAI,KAAM;YACzD;QACF;QACA,OAAOV;IACT,GAAG;QAACV;QAAcC;QAAaK;KAAW;IAE1C,IAAI,CAACP,mBAAmB,OAAO;IAE/B,uDAAuD;IACvD,IAAIsB,eAAenB;IACnB,IAAImB,iBAAiB7B,WAAW;QAC9B6B,eAAeb,OAAOc,IAAI,KAAK,YAAYtC,sBAAsBC;IACnE;IACA,MAAMsC,iBAAiBrC,kBAAkBkB,YAAYI,QAAQa,cAAchB;IAE3E,MAAMmB,WAA0C;QAC9CjB,MAAM;QACNkB,WAAW;YACTC,OAAO;YACPC,OAAOJ;QACT;IACF;IAEA,iDAAiD;IACjD,IAAI,CAACd,UAAUI,MAAM,EAAE;QACrB,qBACE,KAACzB;YACCsC,OAAO3B,kBAAkB2B,KAAK;YAC9BE,QAAQ7B,kBAAkB6B,MAAM;YAChCjB,MAAMtB;YACNmB,QAAQA;YACRgB,UAAUA;YACVtB,KAAKmB;;IAGX;IAEA,6DAA6D;IAC7D,IAAIQ,aAAa9B,kBAAkB2B,KAAK,GAAGjB,UAAUI,MAAM,GAAGnB;IAC9D,IAAImC,aAAapC,mBAAmBgB,UAAUI,MAAM,GAAG,GAAG;QACxD,kEAAkE;QAClEgB,aAAapC;IACf;IAEA,MAAMqC,oBAAoBrB,UAAUI,MAAM,GAAG;IAE7C,qBACE,KAACpC;QACCsD,WAAU;QACVC,SAASF,oBAAoB,IAAI;QACjCG,gBAAgBH,oBAAoB,SAAS;QAC7CI,YAAW;QACXC,IAAI;YACF,yCAAyC;YACzCC,WAAW3B,UAAUI,MAAM,GAAG,IAAI,WAAW;QAC/C;kBAECJ,UAAU4B,GAAG,CAAC,CAACzB,QAAQ0B;YACtB,qBACE,KAAC/D;0BACC,cAAA,KAACa;oBACCsC,OAAOG;oBACPD,QAAQ7B,kBAAkB6B,MAAM;oBAChCjB,MAAMC;oBACNJ,QAAQA;oBACRgB,UAAUA;oBACVtB,KAAKmB;;eAPC,CAAC,aAAa,EAAEiB,aAAa;QAW3C;;AAGN;AAEA,OAAO,SAASC,kBAAkB,EAAExC,iBAAiB,EAAwB;IAC3E,IAAI,CAACA,mBAAmB,OAAO;IAC/B,qBACE,KAACvB;QACC2D,IAAI;YAAEK,QAAQ;QAAS;QACvBC,SAAQ;QACRf,OAAO3B,kBAAkB2B,KAAK,GAAG3B,kBAAkB6B,MAAM,GAAG7B,kBAAkB6B,MAAM,GAAG7B,kBAAkB2B,KAAK;QAC9GE,QAAQ7B,kBAAkB6B,MAAM;;AAGtC"}
|
|
@@ -34,6 +34,9 @@ function _interop_require_default(obj) {
|
|
|
34
34
|
}
|
|
35
35
|
function GaugeChartOptionsEditorSettings(props) {
|
|
36
36
|
const { onChange, value } = props;
|
|
37
|
+
/* If legend setting doesn't exist (because it is optional), the legend should show by default
|
|
38
|
+
This is for the records before the legend option was added
|
|
39
|
+
*/ const showLegend = value?.legend?.show ?? true;
|
|
37
40
|
const handleCalculationChange = (newCalculation)=>{
|
|
38
41
|
onChange((0, _immer.produce)(value, (draft)=>{
|
|
39
42
|
draft.calculation = newCalculation;
|
|
@@ -90,11 +93,27 @@ function GaugeChartOptionsEditorSettings(props) {
|
|
|
90
93
|
]
|
|
91
94
|
})
|
|
92
95
|
}),
|
|
93
|
-
/*#__PURE__*/ (0, _jsxruntime.
|
|
94
|
-
children:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.OptionsEditorColumn, {
|
|
97
|
+
children: [
|
|
98
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ThresholdsEditor, {
|
|
99
|
+
thresholds: value.thresholds,
|
|
100
|
+
onChange: handleThresholdsChange
|
|
101
|
+
}),
|
|
102
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
103
|
+
label: "Show legend",
|
|
104
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
105
|
+
onChange: ()=>{
|
|
106
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
107
|
+
draft.legend = {
|
|
108
|
+
...draft.legend,
|
|
109
|
+
show: !showLegend
|
|
110
|
+
};
|
|
111
|
+
}));
|
|
112
|
+
},
|
|
113
|
+
checked: showLegend
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
]
|
|
98
117
|
})
|
|
99
118
|
]
|
|
100
119
|
});
|
|
@@ -50,41 +50,41 @@ const GAUGE_MIN_WIDTH = 90;
|
|
|
50
50
|
const PANEL_PADDING_OFFSET = 20;
|
|
51
51
|
function GaugeChartPanel(props) {
|
|
52
52
|
const { spec: pluginSpec, contentDimensions, queryResults } = props;
|
|
53
|
-
const { calculation, max } = pluginSpec;
|
|
53
|
+
const { calculation, max, legend } = pluginSpec;
|
|
54
54
|
const { thresholds: thresholdsColors } = (0, _components.useChartsTheme)();
|
|
55
|
+
/* Legend setting just added to the cue schema
|
|
56
|
+
This line assures that if legend setting doesn't exist (for old gauge setting records),
|
|
57
|
+
The legend shows normally as before. If it exists, then it checks the show property.
|
|
58
|
+
*/ const showLegend = legend?.show ?? true;
|
|
55
59
|
// ensures all default format properties set if undef
|
|
56
60
|
const format = (0, _merge.default)({}, _gaugechartmodel.DEFAULT_FORMAT, pluginSpec.format);
|
|
57
61
|
const thresholds = pluginSpec.thresholds ?? _thresholds.defaultThresholdInput;
|
|
58
62
|
const gaugeData = (0, _react.useMemo)(()=>{
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
const seriesData = [];
|
|
64
|
+
if (!queryResults[0]?.data?.series?.length) {
|
|
65
|
+
return seriesData;
|
|
61
66
|
}
|
|
62
|
-
if (_core.CalculationsMap[calculation]
|
|
67
|
+
if (!_core.CalculationsMap[calculation]) {
|
|
63
68
|
console.warn(`Invalid GaugeChart panel calculation ${calculation}, fallback to ${_core.DEFAULT_CALCULATION}`);
|
|
64
69
|
}
|
|
65
70
|
const calculate = _core.CalculationsMap[calculation] ?? _core.CalculationsMap[_core.DEFAULT_CALCULATION];
|
|
66
|
-
const seriesData = [];
|
|
67
71
|
for (const timeSeries of queryResults[0].data.series){
|
|
68
|
-
|
|
72
|
+
seriesData.push({
|
|
69
73
|
value: calculate(timeSeries.values),
|
|
70
|
-
label: timeSeries.formattedName ?? ''
|
|
71
|
-
};
|
|
72
|
-
seriesData.push(series);
|
|
74
|
+
label: showLegend ? timeSeries.formattedName ?? '' : ''
|
|
75
|
+
});
|
|
73
76
|
}
|
|
74
77
|
return seriesData;
|
|
75
78
|
}, [
|
|
76
79
|
queryResults,
|
|
77
|
-
calculation
|
|
80
|
+
calculation,
|
|
81
|
+
showLegend
|
|
78
82
|
]);
|
|
79
|
-
if (contentDimensions
|
|
83
|
+
if (!contentDimensions) return null;
|
|
80
84
|
// needed for end value of last threshold color segment
|
|
81
85
|
let thresholdMax = max;
|
|
82
86
|
if (thresholdMax === undefined) {
|
|
83
|
-
|
|
84
|
-
thresholdMax = _gaugechartmodel.DEFAULT_MAX_PERCENT;
|
|
85
|
-
} else {
|
|
86
|
-
thresholdMax = _gaugechartmodel.DEFAULT_MAX_PERCENT_DECIMAL;
|
|
87
|
-
}
|
|
87
|
+
thresholdMax = format.unit === 'percent' ? _gaugechartmodel.DEFAULT_MAX_PERCENT : _gaugechartmodel.DEFAULT_MAX_PERCENT_DECIMAL;
|
|
88
88
|
}
|
|
89
89
|
const axisLineColors = (0, _thresholds.convertThresholds)(thresholds, format, thresholdMax, thresholdsColors);
|
|
90
90
|
const axisLine = {
|
|
@@ -95,7 +95,7 @@ function GaugeChartPanel(props) {
|
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
// no data message handled inside chart component
|
|
98
|
-
if (gaugeData.length
|
|
98
|
+
if (!gaugeData.length) {
|
|
99
99
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_GaugeChartBase.GaugeChartBase, {
|
|
100
100
|
width: contentDimensions.width,
|
|
101
101
|
height: contentDimensions.height,
|
|
@@ -136,7 +136,7 @@ function GaugeChartPanel(props) {
|
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
function GaugeChartLoading({ contentDimensions }) {
|
|
139
|
-
if (contentDimensions
|
|
139
|
+
if (!contentDimensions) return null;
|
|
140
140
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Skeleton, {
|
|
141
141
|
sx: {
|
|
142
142
|
margin: '0 auto'
|