@carbon/charts-react 1.23.3 → 1.23.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +14 -7
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.cjs +4 -4
- package/dist/index.umd.cjs.map +1 -1
- package/dist/index.umd.js +4 -4
- package/package.json +3 -3
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(V,ft){typeof exports=="object"&&typeof module<"u"?ft(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ft):(V=typeof globalThis<"u"?globalThis:V||self,ft(V.ChartsReact={},V.React))})(this,function(V,ft){"use strict";var uU=Object.defineProperty;var hU=(V,ft,Rn)=>ft in V?uU(V,ft,{enumerable:!0,configurable:!0,writable:!0,value:Rn}):V[ft]=Rn;var Pu=(V,ft,Rn)=>hU(V,typeof ft!="symbol"?ft+"":ft,Rn);var Rn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Rn||{}),Oo=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(Oo||{}),So=(e=>(e.UPDATE="model-update",e))(So||{}),Bu=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e.SHOW_TOOLTIP="toolbar-show-tooltip",e.HIDE_TOOLTIP="toolbar-hide-tooltip",e))(Bu||{}),To=(e=>(e.UPDATE="zoom-bar-update",e.SELECTION_START="zoom-bar-selection-start",e.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",e.SELECTION_END="zoom-bar-selection-end",e))(To||{}),wo=(e=>(e.CHANGE="zoom-domain-change",e))(wo||{}),$o=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))($o||{}),Mo=(e=>(e.LABEL_MOUSEOVER="axis-label-mouseover",e.LABEL_MOUSEMOVE="axis-label-mousemove",e.LABEL_CLICK="axis-label-click",e.LABEL_MOUSEOUT="axis-label-mouseout",e.LABEL_FOCUS="axis-label-focus",e.LABEL_BLUR="axis-label-blur",e.RENDER_COMPLETE="axis-render-complete",e))(Mo||{}),Co=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Co||{}),Ao=(e=>(e.WORD_MOUSEOVER="wordcloud-word-mouseover",e.WORD_MOUSEMOVE="wordcloud-word-mousemove",e.WORD_CLICK="wordcloud-word-click",e.WORD_MOUSEOUT="wordcloud-word-mouseout",e))(Ao||{}),Lo=(e=>(e.SLICE_MOUSEOVER="pie-slice-mouseover",e.SLICE_MOUSEMOVE="pie-slice-mousemove",e.SLICE_CLICK="pie-slice-click",e.SLICE_MOUSEOUT="pie-slice-mouseout",e))(Lo||{}),ko=(e=>(e.ARC_MOUSEOVER="gauge-arc-mouseover",e.ARC_MOUSEMOVE="gauge-arc-mousemove",e.ARC_CLICK="gauge-arc-click",e.ARC_MOUSEOUT="gauge-arc-mouseout",e))(ko||{}),Do=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Do||{}),Ro=(e=>(e.BOX_MOUSEOVER="box-mouseover",e.BOX_MOUSEMOVE="box-mousemove",e.BOX_CLICK="box-click",e.BOX_MOUSEOUT="box-mouseout",e.OUTLIER_MOUSEOVER="outlier-mouseover",e.OUTLIER_MOUSEMOVE="outlier-mousemove",e.OUTLIER_CLICK="outlier-click",e.OUTLIER_MOUSEOUT="outlier-mouseout",e))(Ro||{}),Io=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Io||{}),No=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(No||{}),Po=(e=>(e.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",e.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",e.X_AXIS_CLICK="radar-x-axis-click",e.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",e))(Po||{}),Uo=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Uo||{}),Bo=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Bo||{}),Or=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Or||{}),Ho=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Ho||{}),Hu=(e=>(e.ITEM_HOVER="legend-item-onhover",e.ITEM_CLICK="legend-item-onclick",e.ITEM_MOUSEOUT="legend-item-onmouseout",e.ITEMS_UPDATE="legend-items-update",e))(Hu||{}),Vu=(e=>(e.CIRCLE_MOUSEOVER="circle-leaf-mouseover",e.CIRCLE_CLICK="circle-leaf-click",e.CIRCLE_MOUSEOUT="circle-leaf-mouseout",e.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",e))(Vu||{}),Gu=(e=>(e.NODE_MOUSEOVER="alluvial-node-mouseover",e.NODE_CLICK="alluvial-node-click",e.NODE_MOUSEOUT="alluvial-node-mouseout",e.NODE_MOUSEMOVE="alluvial-node-mousemove",e.LINE_MOUSEOVER="alluvial-line-mouseover",e.LINE_CLICK="alluvial-line-click",e.LINE_MOUSEOUT="alluvial-line-mouseout",e.LINE_MOUSEMOVE="alluvial-line-mousemove",e))(Gu||{}),zu=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(zu||{}),Fu=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Fu||{}),Sr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Sr||{});const r0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Gu,Area:Co,Axis:Mo,Bar:Do,Boxplot:Ro,CanvasZoom:$o,Chart:Rn,Choropleth:Sr,CirclePack:Vu,Gauge:ko,Heatmap:Fu,Legend:Hu,Line:No,Meter:zu,Modal:Oo,Model:So,Pie:Lo,Radar:Po,Scatter:Io,Threshold:Ho,Toolbar:Bu,Tooltip:Or,Tree:Uo,Treemap:Bo,WordCloud:Ao,ZoomBar:To,ZoomDomain:wo},Symbol.toStringTag,{value:"Module"})),T=r0;var it=(e=>(e.HTML="html",e.SVG="svg",e))(it||{}),Vo=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Vo||{}),st=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(st||{}),z=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(z||{}),Ue=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ue||{}),we=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(we||{}),Gt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Gt||{}),nt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(nt||{}),Tr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Tr||{}),zt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(zt||{}),wr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(wr||{}),$s=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))($s||{}),Mt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Mt||{}),lt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(lt||{}),jn=(e=>(e.CENTER="center",e))(jn||{}),di=(e=>(e.LEFT="left",e.RIGHT="right",e))(di||{}),Ft=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Ft||{}),Ke=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Ke||{}),Qe=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Qe||{}),Wn=(e=>(e.SEMI="semi",e.FULL="full",e))(Wn||{}),Ms=(e=>(e.UP="up",e.DOWN="down",e))(Ms||{}),pi=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(pi||{}),fi=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(fi||{}),ve=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))(ve||{}),bt=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.EXIT_FULLSCREEN="Exit fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(bt||{}),Cs=(e=>(e.LEFT="left",e.RIGHT="right",e))(Cs||{}),jt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(jt||{}),mi=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(mi||{}),$r=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))($r||{}),gi=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(gi||{}),Je=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(Je||{}),ju=(e=>(e["15seconds"]="15seconds",e.minute="minute",e["30minutes"]="30minutes",e.hourly="hourly",e.daily="daily",e.weekly="weekly",e.monthly="monthly",e.quarterly="quarterly",e.yearly="yearly",e))(ju||{});function Go(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function vi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}function yi(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?s0(o,d=>d.test(a)):i0(o,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function i0(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function s0(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function a0(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}const Wu=6048e5,o0=864e5,qu=6e4,Yu=36e5,Xu=Symbol.for("constructDateFrom");function $e(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Xu in e?e[Xu](t):e instanceof Date?new e.constructor(t):new Date(t)}function qn(e,...t){const n=$e.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}let l0={};function As(){return l0}function Pt(e,t){return $e(t||e,e)}function xi(e,t){var n,r,i,s;const a=As(),o=(t==null?void 0:t.weekStartsOn)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??a.weekStartsOn??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.weekStartsOn)??0,l=Pt(e,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}const c0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},u0=(e,t,n)=>{let r;const i=c0[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},h0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},d0=(e,t,n,r)=>h0[e],p0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},f0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},m0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},g0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},v0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},y0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},x0=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},b0={ordinalNumber:x0,era:vi({values:p0,defaultWidth:"wide"}),quarter:vi({values:f0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:vi({values:m0,defaultWidth:"wide"}),day:vi({values:g0,defaultWidth:"wide"}),dayPeriod:vi({values:v0,defaultWidth:"wide",formattingValues:y0,defaultFormattingWidth:"wide"})},_0=/^(\d+)(th|st|nd|rd)?/i,E0=/\d+/i,O0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},S0={any:[/^b/i,/^(a|c)/i]},T0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},w0={any:[/1/i,/2/i,/3/i,/4/i]},$0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},M0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},C0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},A0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},L0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},k0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},D0={ordinalNumber:a0({matchPattern:_0,parsePattern:E0,valueCallback:e=>parseInt(e,10)}),era:yi({matchPatterns:O0,defaultMatchWidth:"wide",parsePatterns:S0,defaultParseWidth:"any"}),quarter:yi({matchPatterns:T0,defaultMatchWidth:"wide",parsePatterns:w0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:yi({matchPatterns:$0,defaultMatchWidth:"wide",parsePatterns:M0,defaultParseWidth:"any"}),day:yi({matchPatterns:C0,defaultMatchWidth:"wide",parsePatterns:A0,defaultParseWidth:"any"}),dayPeriod:yi({matchPatterns:L0,defaultMatchWidth:"any",parsePatterns:k0,defaultParseWidth:"any"})},R0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},I0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},N0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},P0={date:Go({formats:R0,defaultWidth:"full"}),time:Go({formats:I0,defaultWidth:"full"}),dateTime:Go({formats:N0,defaultWidth:"full"})},Zu={code:"en-US",formatDistance:u0,formatLong:P0,formatRelative:d0,localize:b0,match:D0,options:{weekStartsOn:0,firstWeekContainsDate:1}};var Ku=typeof global=="object"&&global&&global.Object===Object&&global,U0=typeof self=="object"&&self&&self.Object===Object&&self,Be=Ku||U0||Function("return this")(),Me=Be.Symbol,Qu=Object.prototype,B0=Qu.hasOwnProperty,H0=Qu.toString,bi=Me?Me.toStringTag:void 0;function V0(e){var t=B0.call(e,bi),n=e[bi];try{e[bi]=void 0;var r=!0}catch{}var i=H0.call(e);return r&&(t?e[bi]=n:delete e[bi]),i}var G0=Object.prototype,z0=G0.toString;function F0(e){return z0.call(e)}var j0="[object Null]",W0="[object Undefined]",Ju=Me?Me.toStringTag:void 0;function Yn(e){return e==null?e===void 0?W0:j0:Ju&&Ju in Object(e)?V0(e):F0(e)}function tn(e){return e!=null&&typeof e=="object"}var q0="[object Symbol]";function Ls(e){return typeof e=="symbol"||tn(e)&&Yn(e)==q0}function zo(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Zt=Array.isArray,th=Me?Me.prototype:void 0,eh=th?th.toString:void 0;function nh(e){if(typeof e=="string")return e;if(Zt(e))return zo(e,nh)+"";if(Ls(e))return eh?eh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ce(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Fo(e){return e}var Y0="[object AsyncFunction]",X0="[object Function]",Z0="[object GeneratorFunction]",K0="[object Proxy]";function jo(e){if(!Ce(e))return!1;var t=Yn(e);return t==X0||t==Z0||t==Y0||t==K0}var Wo=Be["__core-js_shared__"],rh=function(){var e=/[^.]+$/.exec(Wo&&Wo.keys&&Wo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Q0(e){return!!rh&&rh in e}var J0=Function.prototype,t1=J0.toString;function Xn(e){if(e!=null){try{return t1.call(e)}catch{}try{return e+""}catch{}}return""}var e1=/[\\^$.*+?()[\]{}|]/g,n1=/^\[object .+?Constructor\]$/,r1=Function.prototype,i1=Object.prototype,s1=r1.toString,a1=i1.hasOwnProperty,o1=RegExp("^"+s1.call(a1).replace(e1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l1(e){if(!Ce(e)||Q0(e))return!1;var t=jo(e)?o1:n1;return t.test(Xn(e))}function c1(e,t){return e==null?void 0:e[t]}function Zn(e,t){var n=c1(e,t);return l1(n)?n:void 0}var qo=Zn(Be,"WeakMap"),ih=Object.create,u1=function(){function e(){}return function(t){if(!Ce(t))return{};if(ih)return ih(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function h1(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function d1(){}function sh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var p1=800,f1=16,m1=Date.now;function g1(e){var t=0,n=0;return function(){var r=m1(),i=f1-(r-n);if(n=r,i>0){if(++t>=p1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function v1(e){return function(){return e}}var ks=function(){try{var e=Zn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),y1=ks?function(e,t){return ks(e,"toString",{configurable:!0,enumerable:!1,value:v1(t),writable:!0})}:Fo,ah=g1(y1);function x1(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function b1(e,t,n,r){for(var i=e.length,s=n+-1;++s<i;)if(t(e[s],s,e))return s;return-1}function _1(e){return e!==e}function E1(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function O1(e,t,n){return t===t?E1(e,t,n):b1(e,_1,n)}function S1(e,t){var n=e==null?0:e.length;return!!n&&O1(e,t,0)>-1}var T1=9007199254740991,w1=/^(?:0|[1-9]\d*)$/;function Yo(e,t){var n=typeof e;return t=t??T1,!!t&&(n=="number"||n!="symbol"&&w1.test(e))&&e>-1&&e%1==0&&e<t}function Ds(e,t,n){t=="__proto__"&&ks?ks(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function _i(e,t){return e===t||e!==e&&t!==t}var $1=Object.prototype,M1=$1.hasOwnProperty;function oh(e,t,n){var r=e[t];(!(M1.call(e,t)&&_i(r,n))||n===void 0&&!(t in e))&&Ds(e,t,n)}function Mr(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),i?Ds(n,o,l):oh(n,o,l)}return n}var lh=Math.max;function ch(e,t,n){return t=lh(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=lh(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),h1(e,this,o)}}function Xo(e,t){return ah(ch(e,t,Fo),e+"")}var C1=9007199254740991;function Zo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=C1}function Kn(e){return e!=null&&Zo(e.length)&&!jo(e)}function A1(e,t,n){if(!Ce(n))return!1;var r=typeof t;return(r=="number"?Kn(n)&&Yo(t,n.length):r=="string"&&t in n)?_i(n[t],e):!1}function L1(e){return Xo(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&A1(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var k1=Object.prototype;function Rs(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||k1;return e===n}function D1(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var R1="[object Arguments]";function uh(e){return tn(e)&&Yn(e)==R1}var hh=Object.prototype,I1=hh.hasOwnProperty,N1=hh.propertyIsEnumerable,Cr=uh(function(){return arguments}())?uh:function(e){return tn(e)&&I1.call(e,"callee")&&!N1.call(e,"callee")};function P1(){return!1}var dh=typeof V=="object"&&V&&!V.nodeType&&V,ph=dh&&typeof module=="object"&&module&&!module.nodeType&&module,U1=ph&&ph.exports===dh,fh=U1?Be.Buffer:void 0,B1=fh?fh.isBuffer:void 0,Ar=B1||P1,H1="[object Arguments]",V1="[object Array]",G1="[object Boolean]",z1="[object Date]",F1="[object Error]",j1="[object Function]",W1="[object Map]",q1="[object Number]",Y1="[object Object]",X1="[object RegExp]",Z1="[object Set]",K1="[object String]",Q1="[object WeakMap]",J1="[object ArrayBuffer]",ty="[object DataView]",ey="[object Float32Array]",ny="[object Float64Array]",ry="[object Int8Array]",iy="[object Int16Array]",sy="[object Int32Array]",ay="[object Uint8Array]",oy="[object Uint8ClampedArray]",ly="[object Uint16Array]",cy="[object Uint32Array]",kt={};kt[ey]=kt[ny]=kt[ry]=kt[iy]=kt[sy]=kt[ay]=kt[oy]=kt[ly]=kt[cy]=!0,kt[H1]=kt[V1]=kt[J1]=kt[G1]=kt[ty]=kt[z1]=kt[F1]=kt[j1]=kt[W1]=kt[q1]=kt[Y1]=kt[X1]=kt[Z1]=kt[K1]=kt[Q1]=!1;function uy(e){return tn(e)&&Zo(e.length)&&!!kt[Yn(e)]}function Ko(e){return function(t){return e(t)}}var mh=typeof V=="object"&&V&&!V.nodeType&&V,Ei=mh&&typeof module=="object"&&module&&!module.nodeType&&module,hy=Ei&&Ei.exports===mh,Qo=hy&&Ku.process,Lr=function(){try{var e=Ei&&Ei.require&&Ei.require("util").types;return e||Qo&&Qo.binding&&Qo.binding("util")}catch{}}(),gh=Lr&&Lr.isTypedArray,Is=gh?Ko(gh):uy,dy=Object.prototype,py=dy.hasOwnProperty;function vh(e,t){var n=Zt(e),r=!n&&Cr(e),i=!n&&!r&&Ar(e),s=!n&&!r&&!i&&Is(e),a=n||r||i||s,o=a?D1(e.length,String):[],l=o.length;for(var c in e)(t||py.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Yo(c,l)))&&o.push(c);return o}function yh(e,t){return function(n){return e(t(n))}}var fy=yh(Object.keys,Object),my=Object.prototype,gy=my.hasOwnProperty;function xh(e){if(!Rs(e))return fy(e);var t=[];for(var n in Object(e))gy.call(e,n)&&n!="constructor"&&t.push(n);return t}function Oi(e){return Kn(e)?vh(e):xh(e)}function vy(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var yy=Object.prototype,xy=yy.hasOwnProperty;function by(e){if(!Ce(e))return vy(e);var t=Rs(e),n=[];for(var r in e)r=="constructor"&&(t||!xy.call(e,r))||n.push(r);return n}function Si(e){return Kn(e)?vh(e,!0):by(e)}var _y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ey=/^\w*$/;function Jo(e,t){if(Zt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ls(e)?!0:Ey.test(e)||!_y.test(e)||t!=null&&e in Object(t)}var Ti=Zn(Object,"create");function Oy(){this.__data__=Ti?Ti(null):{},this.size=0}function Sy(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ty="__lodash_hash_undefined__",wy=Object.prototype,$y=wy.hasOwnProperty;function My(e){var t=this.__data__;if(Ti){var n=t[e];return n===Ty?void 0:n}return $y.call(t,e)?t[e]:void 0}var Cy=Object.prototype,Ay=Cy.hasOwnProperty;function Ly(e){var t=this.__data__;return Ti?t[e]!==void 0:Ay.call(t,e)}var ky="__lodash_hash_undefined__";function Dy(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ti&&t===void 0?ky:t,this}function Qn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Qn.prototype.clear=Oy,Qn.prototype.delete=Sy,Qn.prototype.get=My,Qn.prototype.has=Ly,Qn.prototype.set=Dy;function Ry(){this.__data__=[],this.size=0}function Ns(e,t){for(var n=e.length;n--;)if(_i(e[n][0],t))return n;return-1}var Iy=Array.prototype,Ny=Iy.splice;function Py(e){var t=this.__data__,n=Ns(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Ny.call(t,n,1),--this.size,!0}function Uy(e){var t=this.__data__,n=Ns(t,e);return n<0?void 0:t[n][1]}function By(e){return Ns(this.__data__,e)>-1}function Hy(e,t){var n=this.__data__,r=Ns(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function hn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hn.prototype.clear=Ry,hn.prototype.delete=Py,hn.prototype.get=Uy,hn.prototype.has=By,hn.prototype.set=Hy;var wi=Zn(Be,"Map");function Vy(){this.size=0,this.__data__={hash:new Qn,map:new(wi||hn),string:new Qn}}function Gy(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ps(e,t){var n=e.__data__;return Gy(t)?n[typeof t=="string"?"string":"hash"]:n.map}function zy(e){var t=Ps(this,e).delete(e);return this.size-=t?1:0,t}function Fy(e){return Ps(this,e).get(e)}function jy(e){return Ps(this,e).has(e)}function Wy(e,t){var n=Ps(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function dn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=Vy,dn.prototype.delete=zy,dn.prototype.get=Fy,dn.prototype.has=jy,dn.prototype.set=Wy;var qy="Expected a function";function tl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(qy);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(tl.Cache||dn),n}tl.Cache=dn;var Yy=500;function Xy(e){var t=tl(e,function(r){return n.size===Yy&&n.clear(),r}),n=t.cache;return t}var Zy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ky=/\\(\\)?/g,Qy=Xy(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Zy,function(n,r,i,s){t.push(i?s.replace(Ky,"$1"):r||n)}),t});function $i(e){return e==null?"":nh(e)}function Us(e,t){return Zt(e)?e:Jo(e,t)?[e]:Qy($i(e))}function Mi(e){if(typeof e=="string"||Ls(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function el(e,t){t=Us(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Mi(t[n++])];return n&&n==r?e:void 0}function yt(e,t,n){var r=e==null?void 0:el(e,t);return r===void 0?n:r}function nl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var bh=Me?Me.isConcatSpreadable:void 0;function Jy(e){return Zt(e)||Cr(e)||!!(bh&&e&&e[bh])}function Bs(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=Jy),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Bs(o,t-1,n,r,i):nl(i,o):r||(i[i.length]=o)}return i}var rl=yh(Object.getPrototypeOf,Object),tx="[object Object]",ex=Function.prototype,nx=Object.prototype,_h=ex.toString,rx=nx.hasOwnProperty,ix=_h.call(Object);function Eh(e){if(!tn(e)||Yn(e)!=tx)return!1;var t=rl(e);if(t===null)return!0;var n=rx.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&_h.call(n)==ix}function sx(){this.__data__=new hn,this.size=0}function ax(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ox(e){return this.__data__.get(e)}function lx(e){return this.__data__.has(e)}var cx=200;function ux(e,t){var n=this.__data__;if(n instanceof hn){var r=n.__data__;if(!wi||r.length<cx-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new dn(r)}return n.set(e,t),this.size=n.size,this}function He(e){var t=this.__data__=new hn(e);this.size=t.size}He.prototype.clear=sx,He.prototype.delete=ax,He.prototype.get=ox,He.prototype.has=lx,He.prototype.set=ux;function hx(e,t){return e&&Mr(t,Oi(t),e)}function dx(e,t){return e&&Mr(t,Si(t),e)}var Oh=typeof V=="object"&&V&&!V.nodeType&&V,Sh=Oh&&typeof module=="object"&&module&&!module.nodeType&&module,px=Sh&&Sh.exports===Oh,Th=px?Be.Buffer:void 0,wh=Th?Th.allocUnsafe:void 0;function $h(e,t){if(t)return e.slice();var n=e.length,r=wh?wh(n):new e.constructor(n);return e.copy(r),r}function fx(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function Mh(){return[]}var mx=Object.prototype,gx=mx.propertyIsEnumerable,Ch=Object.getOwnPropertySymbols,il=Ch?function(e){return e==null?[]:(e=Object(e),fx(Ch(e),function(t){return gx.call(e,t)}))}:Mh;function vx(e,t){return Mr(e,il(e),t)}var yx=Object.getOwnPropertySymbols,Ah=yx?function(e){for(var t=[];e;)nl(t,il(e)),e=rl(e);return t}:Mh;function xx(e,t){return Mr(e,Ah(e),t)}function Lh(e,t,n){var r=t(e);return Zt(e)?r:nl(r,n(e))}function sl(e){return Lh(e,Oi,il)}function kh(e){return Lh(e,Si,Ah)}var al=Zn(Be,"DataView"),ol=Zn(Be,"Promise"),kr=Zn(Be,"Set"),Dh="[object Map]",bx="[object Object]",Rh="[object Promise]",Ih="[object Set]",Nh="[object WeakMap]",Ph="[object DataView]",_x=Xn(al),Ex=Xn(wi),Ox=Xn(ol),Sx=Xn(kr),Tx=Xn(qo),Ae=Yn;(al&&Ae(new al(new ArrayBuffer(1)))!=Ph||wi&&Ae(new wi)!=Dh||ol&&Ae(ol.resolve())!=Rh||kr&&Ae(new kr)!=Ih||qo&&Ae(new qo)!=Nh)&&(Ae=function(e){var t=Yn(e),n=t==bx?e.constructor:void 0,r=n?Xn(n):"";if(r)switch(r){case _x:return Ph;case Ex:return Dh;case Ox:return Rh;case Sx:return Ih;case Tx:return Nh}return t});var wx=Object.prototype,$x=wx.hasOwnProperty;function Mx(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&$x.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Hs=Be.Uint8Array;function ll(e){var t=new e.constructor(e.byteLength);return new Hs(t).set(new Hs(e)),t}function Cx(e,t){var n=t?ll(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Ax=/\w*$/;function Lx(e){var t=new e.constructor(e.source,Ax.exec(e));return t.lastIndex=e.lastIndex,t}var Uh=Me?Me.prototype:void 0,Bh=Uh?Uh.valueOf:void 0;function kx(e){return Bh?Object(Bh.call(e)):{}}function Hh(e,t){var n=t?ll(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Dx="[object Boolean]",Rx="[object Date]",Ix="[object Map]",Nx="[object Number]",Px="[object RegExp]",Ux="[object Set]",Bx="[object String]",Hx="[object Symbol]",Vx="[object ArrayBuffer]",Gx="[object DataView]",zx="[object Float32Array]",Fx="[object Float64Array]",jx="[object Int8Array]",Wx="[object Int16Array]",qx="[object Int32Array]",Yx="[object Uint8Array]",Xx="[object Uint8ClampedArray]",Zx="[object Uint16Array]",Kx="[object Uint32Array]";function Qx(e,t,n){var r=e.constructor;switch(t){case Vx:return ll(e);case Dx:case Rx:return new r(+e);case Gx:return Cx(e,n);case zx:case Fx:case jx:case Wx:case qx:case Yx:case Xx:case Zx:case Kx:return Hh(e,n);case Ix:return new r;case Nx:case Bx:return new r(e);case Px:return Lx(e);case Ux:return new r;case Hx:return kx(e)}}function Vh(e){return typeof e.constructor=="function"&&!Rs(e)?u1(rl(e)):{}}var Jx="[object Map]";function tb(e){return tn(e)&&Ae(e)==Jx}var Gh=Lr&&Lr.isMap,eb=Gh?Ko(Gh):tb,nb="[object Set]";function rb(e){return tn(e)&&Ae(e)==nb}var zh=Lr&&Lr.isSet,ib=zh?Ko(zh):rb,sb=1,ab=2,ob=4,Fh="[object Arguments]",lb="[object Array]",cb="[object Boolean]",ub="[object Date]",hb="[object Error]",jh="[object Function]",db="[object GeneratorFunction]",pb="[object Map]",fb="[object Number]",Wh="[object Object]",mb="[object RegExp]",gb="[object Set]",vb="[object String]",yb="[object Symbol]",xb="[object WeakMap]",bb="[object ArrayBuffer]",_b="[object DataView]",Eb="[object Float32Array]",Ob="[object Float64Array]",Sb="[object Int8Array]",Tb="[object Int16Array]",wb="[object Int32Array]",$b="[object Uint8Array]",Mb="[object Uint8ClampedArray]",Cb="[object Uint16Array]",Ab="[object Uint32Array]",At={};At[Fh]=At[lb]=At[bb]=At[_b]=At[cb]=At[ub]=At[Eb]=At[Ob]=At[Sb]=At[Tb]=At[wb]=At[pb]=At[fb]=At[Wh]=At[mb]=At[gb]=At[vb]=At[yb]=At[$b]=At[Mb]=At[Cb]=At[Ab]=!0,At[hb]=At[jh]=At[xb]=!1;function Ci(e,t,n,r,i,s){var a,o=t&sb,l=t&ab,c=t&ob;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ce(e))return e;var u=Zt(e);if(u){if(a=Mx(e),!o)return sh(e,a)}else{var d=Ae(e),h=d==jh||d==db;if(Ar(e))return $h(e,o);if(d==Wh||d==Fh||h&&!i){if(a=l||h?{}:Vh(e),!o)return l?xx(e,dx(a,e)):vx(e,hx(a,e))}else{if(!At[d])return i?e:{};a=Qx(e,d,o)}}s||(s=new He);var p=s.get(e);if(p)return p;s.set(e,a),ib(e)?e.forEach(function(m){a.add(Ci(m,t,n,m,e,s))}):eb(e)&&e.forEach(function(m,v){a.set(v,Ci(m,t,n,v,e,s))});var f=c?l?kh:sl:l?Si:Oi,g=u?void 0:f(e);return x1(g||e,function(m,v){g&&(v=m,m=e[v]),oh(a,v,Ci(m,t,n,v,e,s))}),a}var Lb=1,kb=4;function pn(e){return Ci(e,Lb|kb)}var Db="__lodash_hash_undefined__";function Rb(e){return this.__data__.set(e,Db),this}function Ib(e){return this.__data__.has(e)}function Ai(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new dn;++t<n;)this.add(e[t])}Ai.prototype.add=Ai.prototype.push=Rb,Ai.prototype.has=Ib;function qh(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Yh(e,t){return e.has(t)}var Nb=1,Pb=2;function Xh(e,t,n,r,i,s){var a=n&Nb,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,p=n&Pb?new Ai:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var f=e[d],g=t[d];if(r)var m=a?r(g,f,d,t,e,s):r(f,g,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(p){if(!qh(t,function(v,x){if(!Yh(p,x)&&(f===v||i(f,v,n,r,s)))return p.push(x)})){h=!1;break}}else if(!(f===g||i(f,g,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function Ub(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function cl(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Bb=1,Hb=2,Vb="[object Boolean]",Gb="[object Date]",zb="[object Error]",Fb="[object Map]",jb="[object Number]",Wb="[object RegExp]",qb="[object Set]",Yb="[object String]",Xb="[object Symbol]",Zb="[object ArrayBuffer]",Kb="[object DataView]",Zh=Me?Me.prototype:void 0,ul=Zh?Zh.valueOf:void 0;function Qb(e,t,n,r,i,s,a){switch(n){case Kb:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Zb:return!(e.byteLength!=t.byteLength||!s(new Hs(e),new Hs(t)));case Vb:case Gb:case jb:return _i(+e,+t);case zb:return e.name==t.name&&e.message==t.message;case Wb:case Yb:return e==t+"";case Fb:var o=Ub;case qb:var l=r&Bb;if(o||(o=cl),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=Hb,a.set(e,t);var u=Xh(o(e),o(t),r,i,s,a);return a.delete(e),u;case Xb:if(ul)return ul.call(e)==ul.call(t)}return!1}var Jb=1,t_=Object.prototype,e_=t_.hasOwnProperty;function n_(e,t,n,r,i,s){var a=n&Jb,o=sl(e),l=o.length,c=sl(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:e_.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=a;++d<l;){h=o[d];var v=e[h],x=t[h];if(r)var _=a?r(x,v,h,t,e,s):r(v,x,h,e,t,s);if(!(_===void 0?v===x||i(v,x,n,r,s):_)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){var E=e.constructor,b=t.constructor;E!=b&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof b=="function"&&b instanceof b)&&(g=!1)}return s.delete(e),s.delete(t),g}var r_=1,Kh="[object Arguments]",Qh="[object Array]",Vs="[object Object]",i_=Object.prototype,Jh=i_.hasOwnProperty;function s_(e,t,n,r,i,s){var a=Zt(e),o=Zt(t),l=a?Qh:Ae(e),c=o?Qh:Ae(t);l=l==Kh?Vs:l,c=c==Kh?Vs:c;var u=l==Vs,d=c==Vs,h=l==c;if(h&&Ar(e)){if(!Ar(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new He),a||Is(e)?Xh(e,t,n,r,i,s):Qb(e,t,l,n,r,i,s);if(!(n&r_)){var p=u&&Jh.call(e,"__wrapped__"),f=d&&Jh.call(t,"__wrapped__");if(p||f){var g=p?e.value():e,m=f?t.value():t;return s||(s=new He),i(g,m,n,r,s)}}return h?(s||(s=new He),n_(e,t,n,r,i,s)):!1}function Gs(e,t,n,r,i){return e===t?!0:e==null||t==null||!tn(e)&&!tn(t)?e!==e&&t!==t:s_(e,t,n,r,Gs,i)}var a_=1,o_=2;function l_(e,t,n,r){var i=n.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=n[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=n[i];var o=a[0],l=e[o],c=a[1];if(a[2]){if(l===void 0&&!(o in e))return!1}else{var u=new He,d;if(!(d===void 0?Gs(c,l,a_|o_,r,u):d))return!1}}return!0}function td(e){return e===e&&!Ce(e)}function c_(e){for(var t=Oi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,td(i)]}return t}function ed(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function u_(e){var t=c_(e);return t.length==1&&t[0][2]?ed(t[0][0],t[0][1]):function(n){return n===e||l_(n,e,t)}}function h_(e,t){return e!=null&&t in Object(e)}function d_(e,t,n){t=Us(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=Mi(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&Zo(i)&&Yo(a,i)&&(Zt(e)||Cr(e)))}function p_(e,t){return e!=null&&d_(e,t,h_)}var f_=1,m_=2;function g_(e,t){return Jo(e)&&td(t)?ed(Mi(e),t):function(n){var r=yt(n,e);return r===void 0&&r===t?p_(n,e):Gs(t,r,f_|m_)}}function v_(e){return function(t){return t==null?void 0:t[e]}}function y_(e){return function(t){return el(t,e)}}function x_(e){return Jo(e)?v_(Mi(e)):y_(e)}function zs(e){return typeof e=="function"?e:e==null?Fo:typeof e=="object"?Zt(e)?g_(e[0],e[1]):u_(e):x_(e)}function b_(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return t}}var nd=b_();function hl(e,t,n){(n!==void 0&&!_i(e[t],n)||n===void 0&&!(t in e))&&Ds(e,t,n)}function dl(e){return tn(e)&&Kn(e)}function pl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function __(e){return Mr(e,Si(e))}function E_(e,t,n,r,i,s,a){var o=pl(e,n),l=pl(t,n),c=a.get(l);if(c){hl(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=Zt(l),p=!h&&Ar(l),f=!h&&!p&&Is(l);u=l,h||p||f?Zt(o)?u=o:dl(o)?u=sh(o):p?(d=!1,u=$h(l,!0)):f?(d=!1,u=Hh(l,!0)):u=[]:Eh(l)||Cr(l)?(u=o,Cr(o)?u=__(o):(!Ce(o)||jo(o))&&(u=Vh(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),hl(e,n,u)}function rd(e,t,n,r,i){e!==t&&nd(t,function(s,a){if(i||(i=new He),Ce(s))E_(e,t,a,n,rd,r,i);else{var o=r?r(pl(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),hl(e,a,o)}},Si)}function id(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var O_="[object Map]",S_="[object Set]",T_=Object.prototype,w_=T_.hasOwnProperty;function Ve(e){if(e==null)return!0;if(Kn(e)&&(Zt(e)||typeof e=="string"||typeof e.splice=="function"||Ar(e)||Is(e)||Cr(e)))return!e.length;var t=Ae(e);if(t==O_||t==S_)return!e.size;if(Rs(e))return!xh(e).length;for(var n in e)if(w_.call(e,n))return!1;return!0}var at=L1(function(e,t,n){rd(e,t,n)}),$_=1/0,M_=kr&&1/cl(new kr([,-0]))[1]==$_?function(e){return new kr(e)}:d1,C_=200;function sd(e,t,n){var r=-1,i=S1,s=e.length,a=!0,o=[],l=o;if(s>=C_){var c=t?null:M_(e);if(c)return cl(c);a=!1,i=Yh,l=new Ai}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var A_=Xo(function(e){var t=id(e);return dl(t)&&(t=void 0),sd(Bs(e,1,dl,!0),zs(t))});function Li(e){return e&&e.length?sd(e):[]}function Jn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function L_(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function fl(e){let t,n,r;e.length!==2?(t=Jn,n=(o,l)=>Jn(e(o),l),r=(o,l)=>e(o)-l):(t=e===Jn||e===L_?e:k_,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function k_(){return 0}function D_(e){return e===null?NaN:+e}function*R_(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const I_=fl(Jn),ml=I_.right;fl(D_).center;function Ge(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let s of e)(s=t(s,++i,e))!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}let ad=class extends Map{constructor(t,n=U_){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(od(this,t))}has(t){return super.has(od(this,t))}set(t,n){return super.set(N_(this,t),n)}delete(t){return super.delete(P_(this,t))}};function od({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function N_({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function P_({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function U_(e){return e!==null&&typeof e=="object"?e.valueOf():e}const B_=Math.sqrt(50),H_=Math.sqrt(10),V_=Math.sqrt(2);function Fs(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=B_?10:s>=H_?5:s>=V_?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?Fs(e,t,n*2):[o,l,c]}function js(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?Fs(t,e,n):Fs(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function Dr(e,t,n){return t=+t,e=+e,n=+n,Fs(e,t,n)[2]}function gl(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Dr(t,e,n):Dr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function tr(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function In(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}var G_={value:()=>{}};function vl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ws(n)}function Ws(e){this._=e}function z_(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ws.prototype=vl.prototype={constructor:Ws,on:function(e,t){var n=this._,r=z_(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=F_(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=ld(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ld(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ws(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function F_(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ld(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=G_,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var yl="http://www.w3.org/1999/xhtml";const cd={svg:"http://www.w3.org/2000/svg",xhtml:yl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function qs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),cd.hasOwnProperty(t)?{space:cd[t],local:e}:e}function j_(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===yl&&t.documentElement.namespaceURI===yl?t.createElement(e):t.createElementNS(n,e)}}function W_(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ud(e){var t=qs(e);return(t.local?W_:j_)(t)}function q_(){}function xl(e){return e==null?q_:function(){return this.querySelector(e)}}function Y_(e){typeof e!="function"&&(e=xl(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new ye(r,this._parents)}function X_(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Z_(){return[]}function hd(e){return e==null?Z_:function(){return this.querySelectorAll(e)}}function K_(e){return function(){return X_(e.apply(this,arguments))}}function Q_(e){typeof e=="function"?e=K_(e):e=hd(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new ye(r,i)}function dd(e){return function(){return this.matches(e)}}function pd(e){return function(t){return t.matches(e)}}var J_=Array.prototype.find;function tE(e){return function(){return J_.call(this.children,e)}}function eE(){return this.firstElementChild}function nE(e){return this.select(e==null?eE:tE(typeof e=="function"?e:pd(e)))}var rE=Array.prototype.filter;function iE(){return Array.from(this.children)}function sE(e){return function(){return rE.call(this.children,e)}}function aE(e){return this.selectAll(e==null?iE:sE(typeof e=="function"?e:pd(e)))}function oE(e){typeof e!="function"&&(e=dd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new ye(r,this._parents)}function fd(e){return new Array(e.length)}function lE(){return new ye(this._enter||this._groups.map(fd),this._parents)}function Ys(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ys.prototype={constructor:Ys,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function cE(e){return function(){return e}}function uE(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new Ys(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function hE(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),p;for(o=0;o<u;++o)(l=t[o])&&(h[o]=p=a.call(l,l.__data__,o,t)+"",c.has(p)?i[o]=l:c.set(p,l));for(o=0;o<d;++o)p=a.call(e,s[o],o,s)+"",(l=c.get(p))?(r[o]=l,l.__data__=s[o],c.delete(p)):n[o]=new Ys(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function dE(e){return e.__data__}function pE(e,t){if(!arguments.length)return Array.from(this,dE);var n=t?hE:uE,r=this._parents,i=this._groups;typeof e!="function"&&(e=cE(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],d=i[c],h=d.length,p=fE(e.call(u,u&&u.__data__,c,r)),f=p.length,g=o[c]=new Array(f),m=a[c]=new Array(f),v=l[c]=new Array(h);n(u,d,g,m,v,p,t);for(var x=0,_=0,E,b;x<f;++x)if(E=g[x]){for(x>=_&&(_=x+1);!(b=m[_])&&++_<f;);E._next=b||null}}return a=new ye(a,r),a._enter=o,a._exit=l,a}function fE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function mE(){return new ye(this._exit||this._groups.map(fd),this._parents)}function gE(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function vE(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),p,f=0;f<d;++f)(p=c[f]||u[f])&&(h[f]=p);for(;l<i;++l)o[l]=n[l];return new ye(o,this._parents)}function yE(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function xE(e){e||(e=bE);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new ye(i,this._parents).order()}function bE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _E(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function EE(){return Array.from(this)}function OE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function SE(){let e=0;for(const t of this)++e;return e}function TE(){return!this.node()}function wE(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function $E(e){return function(){this.removeAttribute(e)}}function ME(e){return function(){this.removeAttributeNS(e.space,e.local)}}function CE(e,t){return function(){this.setAttribute(e,t)}}function AE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function LE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function kE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function DE(e,t){var n=qs(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?ME:$E:typeof t=="function"?n.local?kE:LE:n.local?AE:CE)(n,t))}function md(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function RE(e){return function(){this.style.removeProperty(e)}}function IE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function NE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function PE(e,t,n){return arguments.length>1?this.each((t==null?RE:typeof t=="function"?NE:IE)(e,t,n??"")):Rr(this.node(),e)}function Rr(e,t){return e.style.getPropertyValue(t)||md(e).getComputedStyle(e,null).getPropertyValue(t)}function UE(e){return function(){delete this[e]}}function BE(e,t){return function(){this[e]=t}}function HE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function VE(e,t){return arguments.length>1?this.each((t==null?UE:typeof t=="function"?HE:BE)(e,t)):this.node()[e]}function gd(e){return e.trim().split(/^|\s+/)}function bl(e){return e.classList||new vd(e)}function vd(e){this._node=e,this._names=gd(e.getAttribute("class")||"")}vd.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function yd(e,t){for(var n=bl(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function xd(e,t){for(var n=bl(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function GE(e){return function(){yd(this,e)}}function zE(e){return function(){xd(this,e)}}function FE(e,t){return function(){(t.apply(this,arguments)?yd:xd)(this,e)}}function jE(e,t){var n=gd(e+"");if(arguments.length<2){for(var r=bl(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?FE:t?GE:zE)(n,t))}function WE(){this.textContent=""}function qE(e){return function(){this.textContent=e}}function YE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function XE(e){return arguments.length?this.each(e==null?WE:(typeof e=="function"?YE:qE)(e)):this.node().textContent}function ZE(){this.innerHTML=""}function KE(e){return function(){this.innerHTML=e}}function QE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function JE(e){return arguments.length?this.each(e==null?ZE:(typeof e=="function"?QE:KE)(e)):this.node().innerHTML}function tO(){this.nextSibling&&this.parentNode.appendChild(this)}function eO(){return this.each(tO)}function nO(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rO(){return this.each(nO)}function iO(e){var t=typeof e=="function"?e:ud(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function sO(){return null}function aO(e,t){var n=typeof e=="function"?e:ud(e),r=t==null?sO:typeof t=="function"?t:xl(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function oO(){var e=this.parentNode;e&&e.removeChild(this)}function lO(){return this.each(oO)}function cO(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function uO(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hO(e){return this.select(e?uO:cO)}function dO(e){return arguments.length?this.property("__data__",e):this.node().__data__}function pO(e){return function(t){e.call(this,t,this.__data__)}}function fO(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function mO(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function gO(e,t,n){return function(){var r=this.__on,i,s=pO(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function vO(e,t,n){var r=fO(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<s;++i)if((a=r[i]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?gO:mO,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function bd(e,t,n){var r=md(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function yO(e,t){return function(){return bd(this,e,t)}}function xO(e,t){return function(){return bd(this,e,t.apply(this,arguments))}}function bO(e,t){return this.each((typeof t=="function"?xO:yO)(e,t))}function*_O(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var _d=[null];function ye(e,t){this._groups=e,this._parents=t}function ki(){return new ye([[document.documentElement]],_d)}function EO(){return this}ye.prototype=ki.prototype={constructor:ye,select:Y_,selectAll:Q_,selectChild:nE,selectChildren:aE,filter:oE,data:pE,enter:lE,exit:mE,join:gE,merge:vE,selection:EO,order:yE,sort:xE,call:_E,nodes:EE,node:OE,size:SE,empty:TE,each:wE,attr:DE,style:PE,property:VE,classed:jE,text:XE,html:JE,raise:eO,lower:rO,append:iO,insert:aO,remove:lO,clone:hO,datum:dO,on:vO,dispatch:bO,[Symbol.iterator]:_O};function OO(e){let t;for(;t=e.sourceEvent;)e=t;return e}function er(e,t){if(e=OO(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}function _l(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ed(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Di(){}var Ri=.7,Xs=1/Ri,Ir="\\s*([+-]?\\d+)\\s*",Ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",en="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",SO=/^#([0-9a-f]{3,8})$/,TO=new RegExp(`^rgb\\(${Ir},${Ir},${Ir}\\)$`),wO=new RegExp(`^rgb\\(${en},${en},${en}\\)$`),$O=new RegExp(`^rgba\\(${Ir},${Ir},${Ir},${Ii}\\)$`),MO=new RegExp(`^rgba\\(${en},${en},${en},${Ii}\\)$`),CO=new RegExp(`^hsl\\(${Ii},${en},${en}\\)$`),AO=new RegExp(`^hsla\\(${Ii},${en},${en},${Ii}\\)$`),Od={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};_l(Di,fn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Sd,formatHex:Sd,formatHex8:LO,formatHsl:kO,formatRgb:Td,toString:Td});function Sd(){return this.rgb().formatHex()}function LO(){return this.rgb().formatHex8()}function kO(){return Ad(this).formatHsl()}function Td(){return this.rgb().formatRgb()}function fn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=SO.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?wd(t):n===3?new he(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Zs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Zs(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=TO.exec(e))?new he(t[1],t[2],t[3],1):(t=wO.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$O.exec(e))?Zs(t[1],t[2],t[3],t[4]):(t=MO.exec(e))?Zs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=CO.exec(e))?Cd(t[1],t[2]/100,t[3]/100,1):(t=AO.exec(e))?Cd(t[1],t[2]/100,t[3]/100,t[4]):Od.hasOwnProperty(e)?wd(Od[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function wd(e){return new he(e>>16&255,e>>8&255,e&255,1)}function Zs(e,t,n,r){return r<=0&&(e=t=n=NaN),new he(e,t,n,r)}function DO(e){return e instanceof Di||(e=fn(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function El(e,t,n,r){return arguments.length===1?DO(e):new he(e,t,n,r??1)}function he(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}_l(he,El,Ed(Di,{brighter(e){return e=e==null?Xs:Math.pow(Xs,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(nr(this.r),nr(this.g),nr(this.b),Ks(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$d,formatHex:$d,formatHex8:RO,formatRgb:Md,toString:Md}));function $d(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}`}function RO(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}${rr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Md(){const e=Ks(this.opacity);return`${e===1?"rgb(":"rgba("}${nr(this.r)}, ${nr(this.g)}, ${nr(this.b)}${e===1?")":`, ${e})`}`}function Ks(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rr(e){return e=nr(e),(e<16?"0":"")+e.toString(16)}function Cd(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ze(e,t,n,r)}function Ad(e){if(e instanceof ze)return new ze(e.h,e.s,e.l,e.opacity);if(e instanceof Di||(e=fn(e)),!e)return new ze;if(e instanceof ze)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new ze(a,o,l,e.opacity)}function Ld(e,t,n,r){return arguments.length===1?Ad(e):new ze(e,t,n,r??1)}function ze(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}_l(ze,Ld,Ed(Di,{brighter(e){return e=e==null?Xs:Math.pow(Xs,e),new ze(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new ze(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new he(Ol(e>=240?e-240:e+120,i,r),Ol(e,i,r),Ol(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ze(kd(this.h),Qs(this.s),Qs(this.l),Ks(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ks(this.opacity);return`${e===1?"hsl(":"hsla("}${kd(this.h)}, ${Qs(this.s)*100}%, ${Qs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kd(e){return e=(e||0)%360,e<0?e+360:e}function Qs(e){return Math.max(0,Math.min(1,e||0))}function Ol(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Sl=e=>()=>e;function IO(e,t){return function(n){return e+n*t}}function NO(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function PO(e){return(e=+e)==1?Dd:function(t,n){return n-t?NO(t,n,e):Sl(isNaN(t)?n:t)}}function Dd(e,t){var n=t-e;return n?IO(e,n):Sl(isNaN(e)?t:e)}const Js=function e(t){var n=PO(t);function r(i,s){var a=n((i=El(i)).r,(s=El(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Dd(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function UO(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function BO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function HO(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=Ni(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function VO(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function GO(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Ni(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Tl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wl=new RegExp(Tl.source,"g");function zO(e){return function(){return e}}function FO(e){return function(t){return e(t)+""}}function Rd(e,t){var n=Tl.lastIndex=wl.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Tl.exec(e))&&(i=wl.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:xe(r,i)})),n=wl.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?FO(l[0].x):zO(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function Ni(e,t){var n=typeof t,r;return t==null||n==="boolean"?Sl(t):(n==="number"?xe:n==="string"?(r=fn(t))?(t=r,Js):Rd:t instanceof fn?Js:t instanceof Date?VO:BO(t)?UO:Array.isArray(t)?HO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?GO:xe)(e,t)}function Id(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Nd=180/Math.PI,Pd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ud(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Nd,skewX:Math.atan(l)*Nd,scaleX:a,scaleY:o}}var ta;function jO(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Pd:Ud(t.a,t.b,t.c,t.d,t.e,t.f)}function WO(e){return e==null||(ta||(ta=document.createElementNS("http://www.w3.org/2000/svg","g")),ta.setAttribute("transform",e),!(e=ta.transform.baseVal.consolidate()))?Pd:(e=e.matrix,Ud(e.a,e.b,e.c,e.d,e.e,e.f))}function Bd(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,p,f){if(c!==d||u!==h){var g=p.push("translate(",null,t,null,n);f.push({i:g-4,x:xe(c,d)},{i:g-2,x:xe(u,h)})}else(d||h)&&p.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:xe(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:xe(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,p,f){if(c!==d||u!==h){var g=p.push(i(p)+"scale(",null,",",null,")");f.push({i:g-4,x:xe(c,d)},{i:g-2,x:xe(u,h)})}else(d!==1||h!==1)&&p.push(i(p)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(p){for(var f=-1,g=h.length,m;++f<g;)d[(m=h[f]).i]=m.x(p);return d.join("")}}}var qO=Bd(jO,"px, ","px)","deg)"),YO=Bd(WO,", ",")",")"),Nr=0,Pi=0,Ui=0,Hd=1e3,ea,Bi,na=0,ir=0,ra=0,Hi=typeof performance=="object"&&performance.now?performance:Date,Vd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $l(){return ir||(Vd(XO),ir=Hi.now()+ra)}function XO(){ir=0}function ia(){this._call=this._time=this._next=null}ia.prototype=Gd.prototype={constructor:ia,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?$l():+n)+(t==null?0:+t),!this._next&&Bi!==this&&(Bi?Bi._next=this:ea=this,Bi=this),this._call=e,this._time=n,Ml()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ml())}};function Gd(e,t,n){var r=new ia;return r.restart(e,t,n),r}function ZO(){$l(),++Nr;for(var e=ea,t;e;)(t=ir-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Nr}function zd(){ir=(na=Hi.now())+ra,Nr=Pi=0;try{ZO()}finally{Nr=0,QO(),ir=0}}function KO(){var e=Hi.now(),t=e-na;t>Hd&&(ra-=t,na=e)}function QO(){for(var e,t=ea,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ea=n);Bi=e,Ml(r)}function Ml(e){if(!Nr){Pi&&(Pi=clearTimeout(Pi));var t=e-ir;t>24?(e<1/0&&(Pi=setTimeout(zd,e-Hi.now()-ra)),Ui&&(Ui=clearInterval(Ui))):(Ui||(na=Hi.now(),Ui=setInterval(KO,Hd)),Nr=1,Vd(zd))}}function Fd(e,t,n){var r=new ia;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var JO=vl("start","end","cancel","interrupt"),tS=[],jd=0,Wd=1,Cl=2,sa=3,qd=4,Al=5,aa=6;function oa(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;eS(e,n,{name:t,index:r,group:i,on:JO,tween:tS,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:jd})}function Ll(e,t){var n=Fe(e,t);if(n.state>jd)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=Fe(e,t);if(n.state>sa)throw new Error("too late; already running");return n}function Fe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function eS(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Gd(s,0,n.time);function s(c){n.state=Wd,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,p;if(n.state!==Wd)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===sa)return Fd(a);p.state===qd?(p.state=aa,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=aa,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(Fd(function(){n.state===sa&&(n.state=qd,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Cl,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Cl){for(n.state=sa,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=p);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Al,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===Al&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=aa,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function kl(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Cl&&r.state<Al,r.state=aa,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function nS(e){return this.each(function(){kl(this,e)})}function rS(e,t){var n,r;return function(){var i=nn(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function iS(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=nn(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function sS(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Fe(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?rS:iS)(n,e,t))}function Dl(e,t,n){var r=e._id;return e.each(function(){var i=nn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Fe(i,r).value[t]}}function Yd(e,t){var n;return(typeof t=="number"?xe:t instanceof fn?Js:(n=fn(t))?(t=n,Js):Rd)(e,t)}function aS(e){return function(){this.removeAttribute(e)}}function oS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lS(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function cS(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function uS(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function hS(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function dS(e,t){var n=qs(e),r=n==="transform"?YO:Yd;return this.attrTween(e,typeof t=="function"?(n.local?hS:uS)(n,r,Dl(this,"attr."+e,t)):t==null?(n.local?oS:aS)(n):(n.local?cS:lS)(n,r,t))}function pS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function fS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function mS(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&fS(e,s)),n}return i._value=t,i}function gS(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&pS(e,s)),n}return i._value=t,i}function vS(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=qs(e);return this.tween(n,(r.local?mS:gS)(r,t))}function yS(e,t){return function(){Ll(this,e).delay=+t.apply(this,arguments)}}function xS(e,t){return t=+t,function(){Ll(this,e).delay=t}}function bS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yS:xS)(t,e)):Fe(this.node(),t).delay}function _S(e,t){return function(){nn(this,e).duration=+t.apply(this,arguments)}}function ES(e,t){return t=+t,function(){nn(this,e).duration=t}}function OS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_S:ES)(t,e)):Fe(this.node(),t).duration}function SS(e,t){if(typeof t!="function")throw new Error;return function(){nn(this,e).ease=t}}function TS(e){var t=this._id;return arguments.length?this.each(SS(t,e)):Fe(this.node(),t).ease}function wS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nn(this,e).ease=n}}function $S(e){if(typeof e!="function")throw new Error;return this.each(wS(this._id,e))}function MS(e){typeof e!="function"&&(e=dd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new mn(r,this._parents,this._name,this._id)}function CS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,p=0;p<u;++p)(h=l[p]||c[p])&&(d[p]=h);for(;o<r;++o)a[o]=t[o];return new mn(a,this._parents,this._name,this._id)}function AS(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function LS(e,t,n){var r,i,s=AS(t)?Ll:nn;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function kS(e,t){var n=this._id;return arguments.length<2?Fe(this.node(),n).on.on(e):this.each(LS(n,e,t))}function DS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function RS(){return this.on("end.remove",DS(this._id))}function IS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xl(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,oa(c[h],t,n,h,c,Fe(u,n)));return new mn(s,this._parents,t,n)}function NS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=hd(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),p,f=Fe(u,n),g=0,m=h.length;g<m;++g)(p=h[g])&&oa(p,t,n,g,h,f);s.push(h),a.push(u)}return new mn(s,a,t,n)}var PS=ki.prototype.constructor;function US(){return new PS(this._groups,this._parents)}function BS(e,t){var n,r,i;return function(){var s=Rr(this,e),a=(this.style.removeProperty(e),Rr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Xd(e){return function(){this.style.removeProperty(e)}}function HS(e,t,n){var r,i=n+"",s;return function(){var a=Rr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function VS(e,t,n){var r,i,s;return function(){var a=Rr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Rr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function GS(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=nn(this,e),c=l.on,u=l.value[s]==null?o||(o=Xd(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function zS(e,t,n){var r=(e+="")=="transform"?qO:Yd;return t==null?this.styleTween(e,BS(e,r)).on("end.style."+e,Xd(e)):typeof t=="function"?this.styleTween(e,VS(e,r,Dl(this,"style."+e,t))).each(GS(this._id,e)):this.styleTween(e,HS(e,r,t),n).on("end.style."+e,null)}function FS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function jS(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&FS(e,a,n)),r}return s._value=t,s}function WS(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,jS(e,t,n??""))}function qS(e){return function(){this.textContent=e}}function YS(e){return function(){var t=e(this);this.textContent=t??""}}function XS(e){return this.tween("text",typeof e=="function"?YS(Dl(this,"text",e)):qS(e==null?"":e+""))}function ZS(e){return function(t){this.textContent=e.call(this,t)}}function KS(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&ZS(i)),t}return r._value=e,r}function QS(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,KS(e))}function JS(){for(var e=this._name,t=this._id,n=Zd(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Fe(l,t);oa(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new mn(r,this._parents,e,n)}function tT(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=nn(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var eT=0;function mn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Zd(){return++eT}var gn=ki.prototype;mn.prototype={constructor:mn,select:IS,selectAll:NS,selectChild:gn.selectChild,selectChildren:gn.selectChildren,filter:MS,merge:CS,selection:US,transition:JS,call:gn.call,nodes:gn.nodes,node:gn.node,size:gn.size,empty:gn.empty,each:gn.each,on:kS,attr:dS,attrTween:vS,style:zS,styleTween:WS,text:XS,textTween:QS,remove:RS,tween:sS,delay:bS,duration:OS,ease:TS,easeVarying:$S,end:tT,[Symbol.iterator]:gn[Symbol.iterator]};function Kd(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nT={time:null,delay:0,duration:250,ease:Kd};function rT(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function iT(e){var t,n;e instanceof mn?(t=e._id,e=e._name):(t=Zd(),(n=nT).time=$l(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&oa(l,e,t,c,a,n||rT(l,t));return new mn(r,this._parents,e,t)}ki.prototype.interrupt=nS,ki.prototype.transition=iT;function sT(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function la(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Pr(e){return e=la(Math.abs(e)),e?e[1]:NaN}function aT(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function oT(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var lT=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vi(e){if(!(t=lT.exec(e)))throw new Error("invalid format: "+e);var t;return new Rl({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Vi.prototype=Rl.prototype;function Rl(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Rl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function cT(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Qd;function uT(e,t){var n=la(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Qd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+la(e,Math.max(0,t+s-1))[0]}function Jd(e,t){var n=la(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const tp={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:sT,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Jd(e*100,t),r:Jd,s:uT,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ep(e){return e}var np=Array.prototype.map,rp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function hT(e){var t=e.grouping===void 0||e.thousands===void 0?ep:aT(np.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?ep:oT(np.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=Vi(d);var h=d.fill,p=d.align,f=d.sign,g=d.symbol,m=d.zero,v=d.width,x=d.comma,_=d.precision,E=d.trim,b=d.type;b==="n"?(x=!0,b="g"):tp[b]||(_===void 0&&(_=12),E=!0,b="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var S=g==="$"?n:g==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",M=g==="$"?r:/[%p]/.test(b)?a:"",D=tp[b],A=/[defgprs%]/.test(b);_=_===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function R($){var H=S,P=M,B,O,w;if(b==="c")P=D($)+P,$="";else{$=+$;var L=$<0||1/$<0;if($=isNaN($)?l:D(Math.abs($),_),E&&($=cT($)),L&&+$==0&&f!=="+"&&(L=!1),H=(L?f==="("?f:o:f==="-"||f==="("?"":f)+H,P=(b==="s"?rp[8+Qd/3]:"")+P+(L&&f==="("?")":""),A){for(B=-1,O=$.length;++B<O;)if(w=$.charCodeAt(B),48>w||w>57){P=(w===46?i+$.slice(B+1):$.slice(B))+P,$=$.slice(0,B);break}}}x&&!m&&($=t($,1/0));var k=H.length+$.length+P.length,U=k<v?new Array(v-k+1).join(h):"";switch(x&&m&&($=t(U+$,U.length?v-P.length:1/0),U=""),p){case"<":$=H+$+P+U;break;case"=":$=H+U+$+P;break;case"^":$=U.slice(0,k=U.length>>1)+H+$+P+U.slice(k);break;default:$=U+H+$+P;break}return s($)}return R.toString=function(){return d+""},R}function u(d,h){var p=c((d=Vi(d),d.type="f",d)),f=Math.max(-8,Math.min(8,Math.floor(Pr(h)/3)))*3,g=Math.pow(10,-f),m=rp[8+f/3];return function(v){return p(g*v)+m}}return{format:c,formatPrefix:u}}var ca,Il,ip;dT({thousands:",",grouping:[3],currency:["$",""]});function dT(e){return ca=hT(e),Il=ca.format,ip=ca.formatPrefix,ca}function pT(e){return Math.max(0,-Pr(Math.abs(e)))}function fT(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Pr(t)/3)))*3-Pr(Math.abs(e)))}function mT(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pr(t)-Pr(e))+1}function Ur(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const sp=Symbol("implicit");function ua(){var e=new ad,t=[],n=[],r=sp;function i(s){let a=e.get(s);if(a===void 0){if(r!==sp)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new ad;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return ua(t,n).unknown(r)},Ur.apply(i,arguments),i}function gT(e){return function(){return e}}function vT(e){return+e}var ap=[0,1];function Br(e){return e}function Nl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:gT(isNaN(t)?NaN:.5)}function yT(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function xT(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Nl(i,r),s=n(a,s)):(r=Nl(r,i),s=n(s,a)),function(o){return s(r(o))}}function bT(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Nl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=ml(e,o,1,r)-1;return s[l](i[l](o))}}function Pl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function op(){var e=ap,t=ap,n=Ni,r,i,s,a=Br,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Br&&(a=yT(e[0],e[h-1])),o=h>2?bT:xT,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return d.invert=function(h){return a(i((c||(c=o(t,e.map(r),xe)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,vT),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=Id,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Br,u()):a!==Br},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,p){return r=h,i=p,u()}}function lp(){return op()(Br,Br)}function _T(e,t,n,r){var i=gl(e,t,n),s;switch(r=Vi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=fT(i,a))&&(r.precision=s),ip(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=mT(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=pT(i))&&(r.precision=s-(r.type==="%")*2);break}}return Il(r)}function cp(e){var t=e.domain;return e.ticks=function(n){var r=t();return js(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return _T(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);u-- >0;){if(c=Dr(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function je(){var e=lp();return e.copy=function(){return Pl(e,je())},Ur.apply(e,arguments),cp(e)}function Ul(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[ml(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Ul().domain([e,t]).range(i).unknown(s)},Ur.apply(cp(a),arguments)}function Gi(e,t,n){this.k=e,this.x=t,this.y=n}Gi.prototype={constructor:Gi,scale:function(e){return e===1?this:new Gi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Gi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Gi.prototype;const de="cds",vn={opacity:{unselected:.05,selected:.4}},Nn={ticks:{number:7,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Hr={duration:1e3,ease:Kd,zoomLevel:3},Vr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},up={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Le={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},ET={defaultBins:10},Nt={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},yn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Kt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Lt={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},sr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},We={nodeWidth:4,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},hp={minCellDividerDimension:16},dp={default:{size:24}},pp={defaultOffset:4,horizontalOffset:10},fp={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},be={height:{[Ue.GRAPH_VIEW]:32,[Ue.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},OT=[{type:jt.RADIUS,name:"Radius"},{type:jt.AREA,name:"Poor area"},{type:jt.AREA,name:"Satisfactory area"},{type:jt.AREA,name:"Great area"},{type:jt.QUARTILE,name:"Quartiles"}],Gr={type:we.END_LINE,threshold:16,numCharacter:14},ST={code:typeof navigator<"u"&&(navigator==null?void 0:navigator.language)||"en-US",number:(e,t=(navigator==null?void 0:navigator.language)||"en-US")=>e.toLocaleString(t),date:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},TT={enabled:!0,position:Tr.BOTTOM,clickable:!0,truncation:Gr,alignment:zt.LEFT,order:null,additionalItems:[]},wT={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},$T={enabled:!0},mp={enabled:!0,showTotal:!0,truncation:Gr,groupLabel:"Group"},gp={top:{visible:!0,includeZero:!0,truncation:Gr},bottom:{visible:!0,includeZero:!0,truncation:Gr},left:{visible:!0,includeZero:!0,truncation:Gr},right:{visible:!0,includeZero:!0,truncation:Gr}},ha={addSpaceOnEdges:1,showDayName:!1,localeObject:Zu,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}};let vp=!1;try{vp=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const Jt={width:null,height:null,resizable:!0,theme:Vo.WHITE,tooltip:mp,legend:TT,locale:ST,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:bt.SHOW_AS_DATATABLE},...vp?[{type:bt.MAKE_FULLSCREEN}]:[],{type:bt.EXPORT_CSV},{type:bt.EXPORT_PNG},{type:bt.EXPORT_JPG}]}},yp=at({},Jt,{thematic:{projection:Je.geoNaturalEarth1}}),zi=at({},Jt,{axes:gp,timeScale:ha,grid:wT,ruler:$T,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ue.GRAPH_VIEW}}}),ar=at({},zi,{bars:{maxWidth:16,spacingFactor:.25},timeScale:at(ha,{addSpaceOnEdges:1})}),MT=at({},ar,{}),CT=at({},ar,{}),AT=at({},ar,{bars:at({},ar.bars,{dividerSize:1.5})}),LT=at({},ar,{}),Bl=at({},zi,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),kT=Bl,xp=at({},Bl,{points:{radius:3,filled:!1,enabled:!0}}),bp=at({},xp,{timeScale:at(ha,{addSpaceOnEdges:0})}),DT=bp,RT=at({},zi,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{const t=Math.min(e.width,e.height);return[t*3/400,t*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:jt.RADIUS,name:"Radius"}]}}),IT=at({},zi,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:jt.AREA,name:"Poor area"},{type:jt.AREA,name:"Satisfactory area"},{type:jt.AREA,name:"Great area"},{type:jt.QUARTILE,name:"Quartiles"}]}}),NT=at({},ar,{bars:{dividerSize:1.5},timeScale:at(ha,{addSpaceOnEdges:0})}),PT=at({},Jt,{tooltip:at({},mp,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{const t=Math.min(e.width,e.height);return[t*20/400,t*75/400]},wordMapsTo:"word"}}),_p=at({},Jt,{pie:{labels:{formatter:null,enabled:!0},alignment:zt.LEFT,sortFunction:null,valueMapsTo:"value"}}),UT=at({},Jt,{legend:{enabled:!1},gauge:{type:Wn.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,alignment:zt.LEFT}}),BT=at({},_p,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20)},alignment:zt.LEFT}}),Ep=at({},Jt,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),HT=at({},Ep,{legend:{enabled:!0}}),VT=at({},Jt,{radar:{axes:{angle:"key",value:"value"},alignment:zt.LEFT},tooltip:{gridline:{enabled:!0}}}),GT=at({},ar,{comboChartTypes:[]}),zT=at({tree:{type:$s.TREE}},Jt,{}),FT=at({},Jt,{data:at(Jt.data,{groupMapsTo:"name"})}),jT=at({},Jt,Vr,{data:at(Jt.data,{groupMapsTo:"name"})}),WT=at({},Jt,{alluvial:{data:at(Jt.data,{groupMapsTo:"source"}),nodeAlignment:zt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),qT=at({},Jt,{axes:gp,heatmap:{divider:{state:$r.AUTO},colorLegend:{type:"linear"}}}),YT=at({},yp,{choropleth:{colorLegend:{type:"linear"}}}),Ct={alluvialChart:WT,areaChart:bp,axisChart:zi,boxplotChart:LT,bubbleChart:RT,bulletChart:IT,chart:Jt,circlePackChart:jT,choroplethChart:YT,comboChart:GT,donutChart:BT,gaugeChart:UT,groupedBarChart:CT,heatmapChart:qT,histogramChart:NT,lineChart:xp,lollipopChart:kT,meterChart:Ep,pieChart:_p,proportionalMeterChart:HT,radarChart:VT,scatterChart:Bl,simpleBarChart:MT,stackedAreaChart:DT,stackedBarChart:AT,thematicChart:yp,treeChart:zT,treemapChart:FT,wordCloudChart:PT};function XT(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=er(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Rt(e,t){var n;const r=pn(e),i=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete r.toolbar.controls,i.length===0&&delete r.axes;for(const s in r.axes)if(i.includes(s)){const a=t.axes[s];if((a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),a.mapsTo==null){const l=a.scaleType;l==null?a.mapsTo="value":l===nt.TIME?a.mapsTo="date":l===nt.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return Vl(r,t),at(r,t)}function xn(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function Fi(e){const t=/\(([^)]+)\)/.exec(e);if(t&&t.length>1){const n=t[1].split(",");if(n.length>1)return{x:parseFloat(n[0]),y:parseFloat(n[1])}}return{x:0,y:0}}function Hl(e,t,n="value",r=!1){const i=e/t.reduce((s,a)=>s+a[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function ji(e,t,n){if(n>e.length)return e;if(t===we.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===we.FRONT_LINE)return"..."+e.substr(-n);if(t===we.END_LINE)return e.substr(0,n)+"..."}function Vl(e,t){const n=y(e,"legend","additionalItems"),r=y(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=OT.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=A_(a,r,"name")}}const y=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},Op=(e,t)=>t===Gt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ie=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=Op(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function bn(e,t,n){return n===Gt.VERTICAL?[e,t]:[t,e]}function Sp(e){const t=Pt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Tp(e,t){const n=Pt(e,void 0);return n.setHours(0,0,0,0),n}function wp(e,t,n){const[r,i]=qn(void 0,e,t),s=Tp(r),a=Tp(i),o=+s-Sp(s),l=+a-Sp(a);return Math.round((o-l)/o0)}function ZT(e,t){const n=Pt(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function KT(e,t){const n=Pt(e,void 0);return wp(n,ZT(n))+1}function da(e,t){return xi(e,{...t,weekStartsOn:1})}function $p(e,t){const n=Pt(e,void 0),r=n.getFullYear(),i=$e(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=da(i),a=$e(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=da(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function QT(e,t){const n=$p(e),r=$e(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),da(r)}function JT(e,t){const n=Pt(e,void 0),r=+da(n)-+QT(n);return Math.round(r/Wu)+1}function Mp(e,t){var n,r,i,s;const a=Pt(e,t==null?void 0:t.in),o=a.getFullYear(),l=As(),c=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??l.firstWeekContainsDate??((s=(i=l.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,u=$e((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=xi(u,t),h=$e((t==null?void 0:t.in)||e,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const p=xi(h,t);return+a>=+d?o+1:+a>=+p?o:o-1}function tw(e,t){var n,r,i,s;const a=As(),o=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??a.firstWeekContainsDate??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,l=Mp(e,t),c=$e((t==null?void 0:t.in)||e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),xi(c,t)}function ew(e,t){const n=Pt(e,t==null?void 0:t.in),r=+xi(n,t)-+tw(n,t);return Math.round(r/Wu)+1}function Ot(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Pn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ot(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ot(n+1,2)},d(e,t){return Ot(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ot(e.getHours()%12||12,t.length)},H(e,t){return Ot(e.getHours(),t.length)},m(e,t){return Ot(e.getMinutes(),t.length)},s(e,t){return Ot(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ot(i,t.length)}},zr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cp={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Pn.y(e,t)},Y:function(e,t,n,r){const i=Mp(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return Ot(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ot(s,t.length)},R:function(e,t){const n=$p(e);return Ot(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ot(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ot(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ot(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Pn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ot(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=ew(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ot(i,t.length)},I:function(e,t,n){const r=JT(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ot(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Pn.d(e,t)},D:function(e,t,n){const r=KT(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ot(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ot(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ot(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Ot(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=zr.noon:r===0?i=zr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=zr.evening:r>=12?i=zr.afternoon:r>=4?i=zr.morning:i=zr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Pn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Pn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Pn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Pn.s(e,t)},S:function(e,t){return Pn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Lp(r);case"XXXX":case"XX":return or(r);case"XXXXX":case"XXX":default:return or(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Lp(r);case"xxxx":case"xx":return or(r);case"xxxxx":case"xxx":default:return or(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ap(r,":");case"OOOO":default:return"GMT"+or(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ap(r,":");case"zzzz":default:return"GMT"+or(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ot(r,t.length)},T:function(e,t,n){return Ot(+e,t.length)}};function Ap(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Ot(s,2)}function Lp(e,t){return e%60===0?(e>0?"-":"+")+Ot(Math.abs(e)/60,2):or(e,t)}function or(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Ot(Math.trunc(r/60),2),s=Ot(r%60,2);return n+i+t+s}const kp=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Dp=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},nw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return kp(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",kp(r,t)).replace("{{time}}",Dp(i,t))},rw={p:Dp,P:nw},iw=/^D+$/,sw=/^Y+$/,aw=["D","DD","YY","YYYY"];function ow(e){return iw.test(e)}function lw(e){return sw.test(e)}function cw(e,t,n){const r=uw(e,t,n);if(console.warn(r),aw.includes(e))throw new RangeError(r)}function uw(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function hw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function dw(e){return!(!hw(e)&&typeof e!="number"||isNaN(+Pt(e)))}const pw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,fw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mw=/^'([^]*?)'?$/,gw=/''/g,vw=/[a-zA-Z]/;function Gl(e,t,n){var r,i,s,a,o,l,c,u;const d=As(),h=(n==null?void 0:n.locale)??d.locale??Zu,p=(n==null?void 0:n.firstWeekContainsDate)??((i=(r=n==null?void 0:n.locale)==null?void 0:r.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((a=(s=d.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,f=(n==null?void 0:n.weekStartsOn)??((l=(o=n==null?void 0:n.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,g=Pt(e,n==null?void 0:n.in);if(!dw(g))throw new RangeError("Invalid time value");let m=t.match(fw).map(x=>{const _=x[0];if(_==="p"||_==="P"){const E=rw[_];return E(x,h.formatLong)}return x}).join("").match(pw).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const _=x[0];if(_==="'")return{isToken:!1,value:yw(x)};if(Cp[_])return{isToken:!0,value:x};if(_.match(vw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:x}});h.localize.preprocessor&&(m=h.localize.preprocessor(g,m));const v={firstWeekContainsDate:p,weekStartsOn:f,locale:h};return m.map(x=>{if(!x.isToken)return x.value;const _=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&lw(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&ow(_))&&cw(_,t,String(e));const E=Cp[_[0]];return E(g,_,h.localize,v)}).join("")}function yw(e){const t=e.match(mw);return t?t[1].replace(gw,"'"):e}const zl=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function Rp(e,t,n,r,i){const s=t===0,a=Number(Gl(new Date(e),"c"))===2,o=Number(Gl(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||fa(e)||Wi(e,l)||Un(e);case"minute":return s||fa(e)||Wi(e,l)||Un(e);case"30minutes":return s||fa(e)||Wi(e,l)||Un(e);case"hourly":return s||fa(e)||Wi(e,l)||Un(e);case"daily":return i?s||a||Un(e):s||Wi(e,l)||Un(e);case"weekly":return s||a||Un(e);case"monthly":return s||Un(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function Fl(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=y(i,"timeIntervalFormats")[o],u=y(c,"primary"),d=y(c,"secondary"),h=Rp(e,t,n,r,a);let p=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(p=p.replace("pp","h:mm:ss.SSS a"));const f=i.localeObject,{code:g,optionsObject:m}=s,v=m[r].type,x=m[r][h?"primary":"secondary"][p];if(r==="quarterly"||!x){const _=Gl(l,p,{locale:f}).split("").map(E=>{const b=Number(E);return E!==" "&&!Number.isNaN(b)?b.toLocaleString(g):E});return s[v](l,g,{},_.join(""))}else return s[v](l,g,x)}function pa(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function xw(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function bw(e){const t=zl.reduce((n,[,r],i)=>{const s=zl[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return zl[t][0]}function jl(e,t){if(ju[t])return t;if(e.length===1)return"15seconds";const n=xw(e),r=In(n);return bw(r)}function fa(e){const{s:t,m:n,H:r}=pa(e);return r===0&&n===0&&t===0}function Wi(e,t){const n=pa(e).M,r=pa(t).M;return n!==r}function Un(e){const{M:t,d:n,s:r,m:i,H:s}=pa(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Ip(e){return e===void 0?"":e.toISOString()}function Np(e){const t=Ge(e,r=>r.value),n=je().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function Pp(e,t){const n=y(t,"gradient","colors"),r=!Ve(n);let i=y(t,"pairing","option");const s=Np(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${i}-${c}`)}return Ul().domain(s).range(o)}var ht=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(ht||{});function _w(e,t){return e&&nd(e,t,Oi)}function Ew(e,t){return function(n,r){if(n==null)return n;if(!Kn(n))return e(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var Wl=Ew(_w);function pt(e){return function(){return e}}var Ow=Array.prototype.slice;function ma(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Sw(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function Tw(e,t,n,r){return Wl(e,function(i,s,a){t(r,i,n(i),a)}),r}function ww(e,t){return function(n,r){var i=Zt(n)?Sw:Tw,s={};return i(n,e,zs(r),s)}}function $w(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var Mw=Object.prototype,Cw=Mw.hasOwnProperty,Aw=ww(function(e,t,n){Cw.call(e,n)?e[n].push(t):Ds(e,n,[t])});function Lw(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function kw(e){return e}function Dw(e=Jn){if(e===Jn)return Up;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Up(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Rw=Array.prototype,Iw=Rw.slice;function ql(e){return()=>e}function Nw(e,t,n){let r;for(;;){const i=Dr(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function Pw(e){return Math.max(1,Math.ceil(Math.log(Lw(e))/Math.LN2)+1)}function Uw(){var e=kw,t=Ge,n=Pw;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],p=n(c,d,h);if(!Array.isArray(p)){const _=h,E=+p;if(t===Ge&&([d,h]=Nw(d,h,E)),p=js(d,h,E),p[0]<=d&&(l=Dr(d,h,E)),p[p.length-1]>=h)if(_>=h&&t===Ge){const b=Dr(d,h,E);isFinite(b)&&(b>0?h=(Math.floor(h/b)+1)*b:b<0&&(h=(Math.ceil(h*-b)+1)/-b))}else p.pop()}for(var f=p.length,g=0,m=f;p[g]<=d;)++g;for(;p[m-1]>h;)--m;(g||m<f)&&(p=p.slice(g,m),f=m-g);var v=new Array(f+1),x;for(s=0;s<=f;++s)x=v[s]=[],x.x0=s>0?p[s-1]:d,x.x1=s<f?p[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[Math.min(f,Math.floor((o-d)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const _=Math.floor((d-o)*l);v[Math.min(f,_+(p[_]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[ml(p,o,0,f)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:ql(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:ql([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:ql(Array.isArray(i)?Iw.call(i):i),r):n},r}function Bp(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Up:Dw(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(t-c*d/l+h)),f=Math.min(r,Math.floor(t+(l-c)*d/l+h));Bp(e,t,p,f,i)}const s=e[t];let a=n,o=r;for(qi(e,n,t),i(e[r],s)>0&&qi(e,n,r);a<o;){for(qi(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?qi(e,n,o):(++o,qi(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function qi(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Yl(e,t,n){if(e=Float64Array.from(R_(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return In(e);if(t>=1)return tr(e);var r,i=(r-1)*t,s=Math.floor(i),a=tr(Bp(e,s).subarray(0,s+1)),o=In(e.subarray(s+1));return a+(o-a)*(i-s)}}function Hp(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Vp(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Bw(e,t){return e[t]}function Hw(e){const t=[];return t.key=e,t}function Xl(){var e=pt([]),t=Vp,n=Hp,r=Bw;function i(s){var a=Array.from(e.apply(this,arguments),Hw),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(d,a[o].key,c,s)]).data=d;for(o=0,u=ma(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:pt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:pt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Vp:typeof s=="function"?s:pt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Hp,i):n},i}function Vw(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function Gw(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class rn{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:s,number:a}=y(r,"locale"),o=y(r,"tabularRepModal","tableHeadingFormatter"),l=y(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===nt.TIME&&(d=h=>s(h,i,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(h=>{d&&(h[1]=d(h[1]));for(const p in h){const f=h[p];typeof f=="number"&&(h[p]=a(f,i))}return h})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=y(n,"data"),a=y(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===nt.LINEAR||c===nt.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===nt.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Nt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>r.find(a=>a.name===s[i]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(pn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return y(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Nt.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(n=>n.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(n=>n.name)}aggregateBinDataByGroup(t){return Aw(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=ET.defaultBins}=s,l=Array.isArray(o),c=Uw().value(p=>p[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const p=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+p}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],d=Array.from(new Set(t.map(p=>p[a]))),h=[];return c.forEach(p=>{const f=`${p.x0}-${p.x1}`,g=this.aggregateBinDataByGroup(p);d.forEach(m=>{h.push({group:m,key:f,value:g[m]||0,bin:p.x0})})}),{bins:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return Xl().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=Li(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Ip(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===nt.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===nt.LOG||o===nt.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(p=>p.x0.toString()===c.toString());return a.forEach(p=>{d[p]=h.filter(f=>f[i]===p).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(p=>{const f=this.services.cartesianScales.getDomainIdentifier(p);return p[i]===u&&Object.prototype.hasOwnProperty.call(p,f)&&(p[f]instanceof Date?Ip(p[f])===l:p[f].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=$w(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const d=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/d*100:c[u]=0})})}return(r?Xl().offset(Vw):Xl()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const d=l[u];return d[s]=a[c],d}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();Vl(n,t),this.set({options:at(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(T.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Nt.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(T.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=y(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=y(s,"label");if(c===null){const d=y(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(s=>s.map(a=>`"${(a==="–"?"–":a).split(/[,;'"`]/).map(o=>Gw(o)).join("")}"`)).map(s=>s.join(",")).join(`
|
|
1
|
+
(function(V,ft){typeof exports=="object"&&typeof module<"u"?ft(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ft):(V=typeof globalThis<"u"?globalThis:V||self,ft(V.ChartsReact={},V.React))})(this,function(V,ft){"use strict";var uU=Object.defineProperty;var hU=(V,ft,Rn)=>ft in V?uU(V,ft,{enumerable:!0,configurable:!0,writable:!0,value:Rn}):V[ft]=Rn;var Pu=(V,ft,Rn)=>hU(V,typeof ft!="symbol"?ft+"":ft,Rn);var Rn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Rn||{}),Oo=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(Oo||{}),So=(e=>(e.UPDATE="model-update",e))(So||{}),Bu=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e.SHOW_TOOLTIP="toolbar-show-tooltip",e.HIDE_TOOLTIP="toolbar-hide-tooltip",e))(Bu||{}),To=(e=>(e.UPDATE="zoom-bar-update",e.SELECTION_START="zoom-bar-selection-start",e.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",e.SELECTION_END="zoom-bar-selection-end",e))(To||{}),wo=(e=>(e.CHANGE="zoom-domain-change",e))(wo||{}),$o=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))($o||{}),Mo=(e=>(e.LABEL_MOUSEOVER="axis-label-mouseover",e.LABEL_MOUSEMOVE="axis-label-mousemove",e.LABEL_CLICK="axis-label-click",e.LABEL_MOUSEOUT="axis-label-mouseout",e.LABEL_FOCUS="axis-label-focus",e.LABEL_BLUR="axis-label-blur",e.RENDER_COMPLETE="axis-render-complete",e))(Mo||{}),Co=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Co||{}),Ao=(e=>(e.WORD_MOUSEOVER="wordcloud-word-mouseover",e.WORD_MOUSEMOVE="wordcloud-word-mousemove",e.WORD_CLICK="wordcloud-word-click",e.WORD_MOUSEOUT="wordcloud-word-mouseout",e))(Ao||{}),Lo=(e=>(e.SLICE_MOUSEOVER="pie-slice-mouseover",e.SLICE_MOUSEMOVE="pie-slice-mousemove",e.SLICE_CLICK="pie-slice-click",e.SLICE_MOUSEOUT="pie-slice-mouseout",e))(Lo||{}),ko=(e=>(e.ARC_MOUSEOVER="gauge-arc-mouseover",e.ARC_MOUSEMOVE="gauge-arc-mousemove",e.ARC_CLICK="gauge-arc-click",e.ARC_MOUSEOUT="gauge-arc-mouseout",e))(ko||{}),Do=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Do||{}),Ro=(e=>(e.BOX_MOUSEOVER="box-mouseover",e.BOX_MOUSEMOVE="box-mousemove",e.BOX_CLICK="box-click",e.BOX_MOUSEOUT="box-mouseout",e.OUTLIER_MOUSEOVER="outlier-mouseover",e.OUTLIER_MOUSEMOVE="outlier-mousemove",e.OUTLIER_CLICK="outlier-click",e.OUTLIER_MOUSEOUT="outlier-mouseout",e))(Ro||{}),Io=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Io||{}),No=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(No||{}),Po=(e=>(e.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",e.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",e.X_AXIS_CLICK="radar-x-axis-click",e.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",e))(Po||{}),Uo=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Uo||{}),Bo=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Bo||{}),Or=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Or||{}),Ho=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Ho||{}),Hu=(e=>(e.ITEM_HOVER="legend-item-onhover",e.ITEM_CLICK="legend-item-onclick",e.ITEM_MOUSEOUT="legend-item-onmouseout",e.ITEMS_UPDATE="legend-items-update",e))(Hu||{}),Vu=(e=>(e.CIRCLE_MOUSEOVER="circle-leaf-mouseover",e.CIRCLE_CLICK="circle-leaf-click",e.CIRCLE_MOUSEOUT="circle-leaf-mouseout",e.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",e))(Vu||{}),Gu=(e=>(e.NODE_MOUSEOVER="alluvial-node-mouseover",e.NODE_CLICK="alluvial-node-click",e.NODE_MOUSEOUT="alluvial-node-mouseout",e.NODE_MOUSEMOVE="alluvial-node-mousemove",e.LINE_MOUSEOVER="alluvial-line-mouseover",e.LINE_CLICK="alluvial-line-click",e.LINE_MOUSEOUT="alluvial-line-mouseout",e.LINE_MOUSEMOVE="alluvial-line-mousemove",e))(Gu||{}),zu=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(zu||{}),Fu=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Fu||{}),Sr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Sr||{});const r0=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Gu,Area:Co,Axis:Mo,Bar:Do,Boxplot:Ro,CanvasZoom:$o,Chart:Rn,Choropleth:Sr,CirclePack:Vu,Gauge:ko,Heatmap:Fu,Legend:Hu,Line:No,Meter:zu,Modal:Oo,Model:So,Pie:Lo,Radar:Po,Scatter:Io,Threshold:Ho,Toolbar:Bu,Tooltip:Or,Tree:Uo,Treemap:Bo,WordCloud:Ao,ZoomBar:To,ZoomDomain:wo},Symbol.toStringTag,{value:"Module"})),T=r0;var it=(e=>(e.HTML="html",e.SVG="svg",e))(it||{}),Vo=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Vo||{}),st=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(st||{}),z=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(z||{}),Ue=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ue||{}),we=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(we||{}),Gt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Gt||{}),nt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(nt||{}),Tr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Tr||{}),zt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(zt||{}),wr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(wr||{}),$s=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))($s||{}),Mt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Mt||{}),lt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(lt||{}),jn=(e=>(e.CENTER="center",e))(jn||{}),di=(e=>(e.LEFT="left",e.RIGHT="right",e))(di||{}),Ft=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Ft||{}),Ke=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Ke||{}),Qe=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Qe||{}),Wn=(e=>(e.SEMI="semi",e.FULL="full",e))(Wn||{}),Ms=(e=>(e.UP="up",e.DOWN="down",e))(Ms||{}),pi=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(pi||{}),fi=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(fi||{}),ve=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))(ve||{}),bt=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.EXIT_FULLSCREEN="Exit fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(bt||{}),Cs=(e=>(e.LEFT="left",e.RIGHT="right",e))(Cs||{}),jt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(jt||{}),mi=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(mi||{}),$r=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))($r||{}),gi=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(gi||{}),Je=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(Je||{}),ju=(e=>(e["15seconds"]="15seconds",e.minute="minute",e["30minutes"]="30minutes",e.hourly="hourly",e.daily="daily",e.weekly="weekly",e.monthly="monthly",e.quarterly="quarterly",e.yearly="yearly",e))(ju||{});function Go(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function vi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}function yi(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?s0(o,d=>d.test(a)):i0(o,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function i0(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function s0(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function a0(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}const Wu=6048e5,o0=864e5,qu=6e4,Yu=36e5,Xu=Symbol.for("constructDateFrom");function $e(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Xu in e?e[Xu](t):e instanceof Date?new e.constructor(t):new Date(t)}function qn(e,...t){const n=$e.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}let l0={};function As(){return l0}function Pt(e,t){return $e(t||e,e)}function xi(e,t){var n,r,i,s;const a=As(),o=(t==null?void 0:t.weekStartsOn)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??a.weekStartsOn??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.weekStartsOn)??0,l=Pt(e,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}const c0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},u0=(e,t,n)=>{let r;const i=c0[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},h0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},d0=(e,t,n,r)=>h0[e],p0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},f0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},m0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},g0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},v0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},y0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},x0=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},b0={ordinalNumber:x0,era:vi({values:p0,defaultWidth:"wide"}),quarter:vi({values:f0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:vi({values:m0,defaultWidth:"wide"}),day:vi({values:g0,defaultWidth:"wide"}),dayPeriod:vi({values:v0,defaultWidth:"wide",formattingValues:y0,defaultFormattingWidth:"wide"})},_0=/^(\d+)(th|st|nd|rd)?/i,E0=/\d+/i,O0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},S0={any:[/^b/i,/^(a|c)/i]},T0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},w0={any:[/1/i,/2/i,/3/i,/4/i]},$0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},M0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},C0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},A0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},L0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},k0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},D0={ordinalNumber:a0({matchPattern:_0,parsePattern:E0,valueCallback:e=>parseInt(e,10)}),era:yi({matchPatterns:O0,defaultMatchWidth:"wide",parsePatterns:S0,defaultParseWidth:"any"}),quarter:yi({matchPatterns:T0,defaultMatchWidth:"wide",parsePatterns:w0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:yi({matchPatterns:$0,defaultMatchWidth:"wide",parsePatterns:M0,defaultParseWidth:"any"}),day:yi({matchPatterns:C0,defaultMatchWidth:"wide",parsePatterns:A0,defaultParseWidth:"any"}),dayPeriod:yi({matchPatterns:L0,defaultMatchWidth:"any",parsePatterns:k0,defaultParseWidth:"any"})},R0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},I0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},N0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},P0={date:Go({formats:R0,defaultWidth:"full"}),time:Go({formats:I0,defaultWidth:"full"}),dateTime:Go({formats:N0,defaultWidth:"full"})},Zu={code:"en-US",formatDistance:u0,formatLong:P0,formatRelative:d0,localize:b0,match:D0,options:{weekStartsOn:0,firstWeekContainsDate:1}};var Ku=typeof global=="object"&&global&&global.Object===Object&&global,U0=typeof self=="object"&&self&&self.Object===Object&&self,Be=Ku||U0||Function("return this")(),Me=Be.Symbol,Qu=Object.prototype,B0=Qu.hasOwnProperty,H0=Qu.toString,bi=Me?Me.toStringTag:void 0;function V0(e){var t=B0.call(e,bi),n=e[bi];try{e[bi]=void 0;var r=!0}catch{}var i=H0.call(e);return r&&(t?e[bi]=n:delete e[bi]),i}var G0=Object.prototype,z0=G0.toString;function F0(e){return z0.call(e)}var j0="[object Null]",W0="[object Undefined]",Ju=Me?Me.toStringTag:void 0;function Yn(e){return e==null?e===void 0?W0:j0:Ju&&Ju in Object(e)?V0(e):F0(e)}function tn(e){return e!=null&&typeof e=="object"}var q0="[object Symbol]";function Ls(e){return typeof e=="symbol"||tn(e)&&Yn(e)==q0}function zo(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Zt=Array.isArray,th=Me?Me.prototype:void 0,eh=th?th.toString:void 0;function nh(e){if(typeof e=="string")return e;if(Zt(e))return zo(e,nh)+"";if(Ls(e))return eh?eh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ce(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Fo(e){return e}var Y0="[object AsyncFunction]",X0="[object Function]",Z0="[object GeneratorFunction]",K0="[object Proxy]";function jo(e){if(!Ce(e))return!1;var t=Yn(e);return t==X0||t==Z0||t==Y0||t==K0}var Wo=Be["__core-js_shared__"],rh=function(){var e=/[^.]+$/.exec(Wo&&Wo.keys&&Wo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Q0(e){return!!rh&&rh in e}var J0=Function.prototype,t1=J0.toString;function Xn(e){if(e!=null){try{return t1.call(e)}catch{}try{return e+""}catch{}}return""}var e1=/[\\^$.*+?()[\]{}|]/g,n1=/^\[object .+?Constructor\]$/,r1=Function.prototype,i1=Object.prototype,s1=r1.toString,a1=i1.hasOwnProperty,o1=RegExp("^"+s1.call(a1).replace(e1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l1(e){if(!Ce(e)||Q0(e))return!1;var t=jo(e)?o1:n1;return t.test(Xn(e))}function c1(e,t){return e==null?void 0:e[t]}function Zn(e,t){var n=c1(e,t);return l1(n)?n:void 0}var qo=Zn(Be,"WeakMap"),ih=Object.create,u1=function(){function e(){}return function(t){if(!Ce(t))return{};if(ih)return ih(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function h1(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function d1(){}function sh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var p1=800,f1=16,m1=Date.now;function g1(e){var t=0,n=0;return function(){var r=m1(),i=f1-(r-n);if(n=r,i>0){if(++t>=p1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function v1(e){return function(){return e}}var ks=function(){try{var e=Zn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),y1=ks?function(e,t){return ks(e,"toString",{configurable:!0,enumerable:!1,value:v1(t),writable:!0})}:Fo,ah=g1(y1);function x1(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function b1(e,t,n,r){for(var i=e.length,s=n+-1;++s<i;)if(t(e[s],s,e))return s;return-1}function _1(e){return e!==e}function E1(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function O1(e,t,n){return t===t?E1(e,t,n):b1(e,_1,n)}function S1(e,t){var n=e==null?0:e.length;return!!n&&O1(e,t,0)>-1}var T1=9007199254740991,w1=/^(?:0|[1-9]\d*)$/;function Yo(e,t){var n=typeof e;return t=t??T1,!!t&&(n=="number"||n!="symbol"&&w1.test(e))&&e>-1&&e%1==0&&e<t}function Ds(e,t,n){t=="__proto__"&&ks?ks(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function _i(e,t){return e===t||e!==e&&t!==t}var $1=Object.prototype,M1=$1.hasOwnProperty;function oh(e,t,n){var r=e[t];(!(M1.call(e,t)&&_i(r,n))||n===void 0&&!(t in e))&&Ds(e,t,n)}function Mr(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),i?Ds(n,o,l):oh(n,o,l)}return n}var lh=Math.max;function ch(e,t,n){return t=lh(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=lh(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),h1(e,this,o)}}function Xo(e,t){return ah(ch(e,t,Fo),e+"")}var C1=9007199254740991;function Zo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=C1}function Kn(e){return e!=null&&Zo(e.length)&&!jo(e)}function A1(e,t,n){if(!Ce(n))return!1;var r=typeof t;return(r=="number"?Kn(n)&&Yo(t,n.length):r=="string"&&t in n)?_i(n[t],e):!1}function L1(e){return Xo(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&A1(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var k1=Object.prototype;function Rs(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||k1;return e===n}function D1(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var R1="[object Arguments]";function uh(e){return tn(e)&&Yn(e)==R1}var hh=Object.prototype,I1=hh.hasOwnProperty,N1=hh.propertyIsEnumerable,Cr=uh(function(){return arguments}())?uh:function(e){return tn(e)&&I1.call(e,"callee")&&!N1.call(e,"callee")};function P1(){return!1}var dh=typeof V=="object"&&V&&!V.nodeType&&V,ph=dh&&typeof module=="object"&&module&&!module.nodeType&&module,U1=ph&&ph.exports===dh,fh=U1?Be.Buffer:void 0,B1=fh?fh.isBuffer:void 0,Ar=B1||P1,H1="[object Arguments]",V1="[object Array]",G1="[object Boolean]",z1="[object Date]",F1="[object Error]",j1="[object Function]",W1="[object Map]",q1="[object Number]",Y1="[object Object]",X1="[object RegExp]",Z1="[object Set]",K1="[object String]",Q1="[object WeakMap]",J1="[object ArrayBuffer]",ty="[object DataView]",ey="[object Float32Array]",ny="[object Float64Array]",ry="[object Int8Array]",iy="[object Int16Array]",sy="[object Int32Array]",ay="[object Uint8Array]",oy="[object Uint8ClampedArray]",ly="[object Uint16Array]",cy="[object Uint32Array]",kt={};kt[ey]=kt[ny]=kt[ry]=kt[iy]=kt[sy]=kt[ay]=kt[oy]=kt[ly]=kt[cy]=!0,kt[H1]=kt[V1]=kt[J1]=kt[G1]=kt[ty]=kt[z1]=kt[F1]=kt[j1]=kt[W1]=kt[q1]=kt[Y1]=kt[X1]=kt[Z1]=kt[K1]=kt[Q1]=!1;function uy(e){return tn(e)&&Zo(e.length)&&!!kt[Yn(e)]}function Ko(e){return function(t){return e(t)}}var mh=typeof V=="object"&&V&&!V.nodeType&&V,Ei=mh&&typeof module=="object"&&module&&!module.nodeType&&module,hy=Ei&&Ei.exports===mh,Qo=hy&&Ku.process,Lr=function(){try{var e=Ei&&Ei.require&&Ei.require("util").types;return e||Qo&&Qo.binding&&Qo.binding("util")}catch{}}(),gh=Lr&&Lr.isTypedArray,Is=gh?Ko(gh):uy,dy=Object.prototype,py=dy.hasOwnProperty;function vh(e,t){var n=Zt(e),r=!n&&Cr(e),i=!n&&!r&&Ar(e),s=!n&&!r&&!i&&Is(e),a=n||r||i||s,o=a?D1(e.length,String):[],l=o.length;for(var c in e)(t||py.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Yo(c,l)))&&o.push(c);return o}function yh(e,t){return function(n){return e(t(n))}}var fy=yh(Object.keys,Object),my=Object.prototype,gy=my.hasOwnProperty;function xh(e){if(!Rs(e))return fy(e);var t=[];for(var n in Object(e))gy.call(e,n)&&n!="constructor"&&t.push(n);return t}function Oi(e){return Kn(e)?vh(e):xh(e)}function vy(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var yy=Object.prototype,xy=yy.hasOwnProperty;function by(e){if(!Ce(e))return vy(e);var t=Rs(e),n=[];for(var r in e)r=="constructor"&&(t||!xy.call(e,r))||n.push(r);return n}function Si(e){return Kn(e)?vh(e,!0):by(e)}var _y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ey=/^\w*$/;function Jo(e,t){if(Zt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ls(e)?!0:Ey.test(e)||!_y.test(e)||t!=null&&e in Object(t)}var Ti=Zn(Object,"create");function Oy(){this.__data__=Ti?Ti(null):{},this.size=0}function Sy(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ty="__lodash_hash_undefined__",wy=Object.prototype,$y=wy.hasOwnProperty;function My(e){var t=this.__data__;if(Ti){var n=t[e];return n===Ty?void 0:n}return $y.call(t,e)?t[e]:void 0}var Cy=Object.prototype,Ay=Cy.hasOwnProperty;function Ly(e){var t=this.__data__;return Ti?t[e]!==void 0:Ay.call(t,e)}var ky="__lodash_hash_undefined__";function Dy(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ti&&t===void 0?ky:t,this}function Qn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Qn.prototype.clear=Oy,Qn.prototype.delete=Sy,Qn.prototype.get=My,Qn.prototype.has=Ly,Qn.prototype.set=Dy;function Ry(){this.__data__=[],this.size=0}function Ns(e,t){for(var n=e.length;n--;)if(_i(e[n][0],t))return n;return-1}var Iy=Array.prototype,Ny=Iy.splice;function Py(e){var t=this.__data__,n=Ns(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Ny.call(t,n,1),--this.size,!0}function Uy(e){var t=this.__data__,n=Ns(t,e);return n<0?void 0:t[n][1]}function By(e){return Ns(this.__data__,e)>-1}function Hy(e,t){var n=this.__data__,r=Ns(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function hn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hn.prototype.clear=Ry,hn.prototype.delete=Py,hn.prototype.get=Uy,hn.prototype.has=By,hn.prototype.set=Hy;var wi=Zn(Be,"Map");function Vy(){this.size=0,this.__data__={hash:new Qn,map:new(wi||hn),string:new Qn}}function Gy(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ps(e,t){var n=e.__data__;return Gy(t)?n[typeof t=="string"?"string":"hash"]:n.map}function zy(e){var t=Ps(this,e).delete(e);return this.size-=t?1:0,t}function Fy(e){return Ps(this,e).get(e)}function jy(e){return Ps(this,e).has(e)}function Wy(e,t){var n=Ps(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function dn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=Vy,dn.prototype.delete=zy,dn.prototype.get=Fy,dn.prototype.has=jy,dn.prototype.set=Wy;var qy="Expected a function";function tl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(qy);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(tl.Cache||dn),n}tl.Cache=dn;var Yy=500;function Xy(e){var t=tl(e,function(r){return n.size===Yy&&n.clear(),r}),n=t.cache;return t}var Zy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ky=/\\(\\)?/g,Qy=Xy(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Zy,function(n,r,i,s){t.push(i?s.replace(Ky,"$1"):r||n)}),t});function $i(e){return e==null?"":nh(e)}function Us(e,t){return Zt(e)?e:Jo(e,t)?[e]:Qy($i(e))}function Mi(e){if(typeof e=="string"||Ls(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function el(e,t){t=Us(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Mi(t[n++])];return n&&n==r?e:void 0}function yt(e,t,n){var r=e==null?void 0:el(e,t);return r===void 0?n:r}function nl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var bh=Me?Me.isConcatSpreadable:void 0;function Jy(e){return Zt(e)||Cr(e)||!!(bh&&e&&e[bh])}function Bs(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=Jy),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Bs(o,t-1,n,r,i):nl(i,o):r||(i[i.length]=o)}return i}var rl=yh(Object.getPrototypeOf,Object),tx="[object Object]",ex=Function.prototype,nx=Object.prototype,_h=ex.toString,rx=nx.hasOwnProperty,ix=_h.call(Object);function Eh(e){if(!tn(e)||Yn(e)!=tx)return!1;var t=rl(e);if(t===null)return!0;var n=rx.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&_h.call(n)==ix}function sx(){this.__data__=new hn,this.size=0}function ax(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ox(e){return this.__data__.get(e)}function lx(e){return this.__data__.has(e)}var cx=200;function ux(e,t){var n=this.__data__;if(n instanceof hn){var r=n.__data__;if(!wi||r.length<cx-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new dn(r)}return n.set(e,t),this.size=n.size,this}function He(e){var t=this.__data__=new hn(e);this.size=t.size}He.prototype.clear=sx,He.prototype.delete=ax,He.prototype.get=ox,He.prototype.has=lx,He.prototype.set=ux;function hx(e,t){return e&&Mr(t,Oi(t),e)}function dx(e,t){return e&&Mr(t,Si(t),e)}var Oh=typeof V=="object"&&V&&!V.nodeType&&V,Sh=Oh&&typeof module=="object"&&module&&!module.nodeType&&module,px=Sh&&Sh.exports===Oh,Th=px?Be.Buffer:void 0,wh=Th?Th.allocUnsafe:void 0;function $h(e,t){if(t)return e.slice();var n=e.length,r=wh?wh(n):new e.constructor(n);return e.copy(r),r}function fx(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function Mh(){return[]}var mx=Object.prototype,gx=mx.propertyIsEnumerable,Ch=Object.getOwnPropertySymbols,il=Ch?function(e){return e==null?[]:(e=Object(e),fx(Ch(e),function(t){return gx.call(e,t)}))}:Mh;function vx(e,t){return Mr(e,il(e),t)}var yx=Object.getOwnPropertySymbols,Ah=yx?function(e){for(var t=[];e;)nl(t,il(e)),e=rl(e);return t}:Mh;function xx(e,t){return Mr(e,Ah(e),t)}function Lh(e,t,n){var r=t(e);return Zt(e)?r:nl(r,n(e))}function sl(e){return Lh(e,Oi,il)}function kh(e){return Lh(e,Si,Ah)}var al=Zn(Be,"DataView"),ol=Zn(Be,"Promise"),kr=Zn(Be,"Set"),Dh="[object Map]",bx="[object Object]",Rh="[object Promise]",Ih="[object Set]",Nh="[object WeakMap]",Ph="[object DataView]",_x=Xn(al),Ex=Xn(wi),Ox=Xn(ol),Sx=Xn(kr),Tx=Xn(qo),Ae=Yn;(al&&Ae(new al(new ArrayBuffer(1)))!=Ph||wi&&Ae(new wi)!=Dh||ol&&Ae(ol.resolve())!=Rh||kr&&Ae(new kr)!=Ih||qo&&Ae(new qo)!=Nh)&&(Ae=function(e){var t=Yn(e),n=t==bx?e.constructor:void 0,r=n?Xn(n):"";if(r)switch(r){case _x:return Ph;case Ex:return Dh;case Ox:return Rh;case Sx:return Ih;case Tx:return Nh}return t});var wx=Object.prototype,$x=wx.hasOwnProperty;function Mx(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&$x.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Hs=Be.Uint8Array;function ll(e){var t=new e.constructor(e.byteLength);return new Hs(t).set(new Hs(e)),t}function Cx(e,t){var n=t?ll(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Ax=/\w*$/;function Lx(e){var t=new e.constructor(e.source,Ax.exec(e));return t.lastIndex=e.lastIndex,t}var Uh=Me?Me.prototype:void 0,Bh=Uh?Uh.valueOf:void 0;function kx(e){return Bh?Object(Bh.call(e)):{}}function Hh(e,t){var n=t?ll(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Dx="[object Boolean]",Rx="[object Date]",Ix="[object Map]",Nx="[object Number]",Px="[object RegExp]",Ux="[object Set]",Bx="[object String]",Hx="[object Symbol]",Vx="[object ArrayBuffer]",Gx="[object DataView]",zx="[object Float32Array]",Fx="[object Float64Array]",jx="[object Int8Array]",Wx="[object Int16Array]",qx="[object Int32Array]",Yx="[object Uint8Array]",Xx="[object Uint8ClampedArray]",Zx="[object Uint16Array]",Kx="[object Uint32Array]";function Qx(e,t,n){var r=e.constructor;switch(t){case Vx:return ll(e);case Dx:case Rx:return new r(+e);case Gx:return Cx(e,n);case zx:case Fx:case jx:case Wx:case qx:case Yx:case Xx:case Zx:case Kx:return Hh(e,n);case Ix:return new r;case Nx:case Bx:return new r(e);case Px:return Lx(e);case Ux:return new r;case Hx:return kx(e)}}function Vh(e){return typeof e.constructor=="function"&&!Rs(e)?u1(rl(e)):{}}var Jx="[object Map]";function tb(e){return tn(e)&&Ae(e)==Jx}var Gh=Lr&&Lr.isMap,eb=Gh?Ko(Gh):tb,nb="[object Set]";function rb(e){return tn(e)&&Ae(e)==nb}var zh=Lr&&Lr.isSet,ib=zh?Ko(zh):rb,sb=1,ab=2,ob=4,Fh="[object Arguments]",lb="[object Array]",cb="[object Boolean]",ub="[object Date]",hb="[object Error]",jh="[object Function]",db="[object GeneratorFunction]",pb="[object Map]",fb="[object Number]",Wh="[object Object]",mb="[object RegExp]",gb="[object Set]",vb="[object String]",yb="[object Symbol]",xb="[object WeakMap]",bb="[object ArrayBuffer]",_b="[object DataView]",Eb="[object Float32Array]",Ob="[object Float64Array]",Sb="[object Int8Array]",Tb="[object Int16Array]",wb="[object Int32Array]",$b="[object Uint8Array]",Mb="[object Uint8ClampedArray]",Cb="[object Uint16Array]",Ab="[object Uint32Array]",At={};At[Fh]=At[lb]=At[bb]=At[_b]=At[cb]=At[ub]=At[Eb]=At[Ob]=At[Sb]=At[Tb]=At[wb]=At[pb]=At[fb]=At[Wh]=At[mb]=At[gb]=At[vb]=At[yb]=At[$b]=At[Mb]=At[Cb]=At[Ab]=!0,At[hb]=At[jh]=At[xb]=!1;function Ci(e,t,n,r,i,s){var a,o=t&sb,l=t&ab,c=t&ob;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ce(e))return e;var u=Zt(e);if(u){if(a=Mx(e),!o)return sh(e,a)}else{var d=Ae(e),h=d==jh||d==db;if(Ar(e))return $h(e,o);if(d==Wh||d==Fh||h&&!i){if(a=l||h?{}:Vh(e),!o)return l?xx(e,dx(a,e)):vx(e,hx(a,e))}else{if(!At[d])return i?e:{};a=Qx(e,d,o)}}s||(s=new He);var p=s.get(e);if(p)return p;s.set(e,a),ib(e)?e.forEach(function(m){a.add(Ci(m,t,n,m,e,s))}):eb(e)&&e.forEach(function(m,v){a.set(v,Ci(m,t,n,v,e,s))});var f=c?l?kh:sl:l?Si:Oi,g=u?void 0:f(e);return x1(g||e,function(m,v){g&&(v=m,m=e[v]),oh(a,v,Ci(m,t,n,v,e,s))}),a}var Lb=1,kb=4;function pn(e){return Ci(e,Lb|kb)}var Db="__lodash_hash_undefined__";function Rb(e){return this.__data__.set(e,Db),this}function Ib(e){return this.__data__.has(e)}function Ai(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new dn;++t<n;)this.add(e[t])}Ai.prototype.add=Ai.prototype.push=Rb,Ai.prototype.has=Ib;function qh(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Yh(e,t){return e.has(t)}var Nb=1,Pb=2;function Xh(e,t,n,r,i,s){var a=n&Nb,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,p=n&Pb?new Ai:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var f=e[d],g=t[d];if(r)var m=a?r(g,f,d,t,e,s):r(f,g,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(p){if(!qh(t,function(v,x){if(!Yh(p,x)&&(f===v||i(f,v,n,r,s)))return p.push(x)})){h=!1;break}}else if(!(f===g||i(f,g,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function Ub(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function cl(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Bb=1,Hb=2,Vb="[object Boolean]",Gb="[object Date]",zb="[object Error]",Fb="[object Map]",jb="[object Number]",Wb="[object RegExp]",qb="[object Set]",Yb="[object String]",Xb="[object Symbol]",Zb="[object ArrayBuffer]",Kb="[object DataView]",Zh=Me?Me.prototype:void 0,ul=Zh?Zh.valueOf:void 0;function Qb(e,t,n,r,i,s,a){switch(n){case Kb:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Zb:return!(e.byteLength!=t.byteLength||!s(new Hs(e),new Hs(t)));case Vb:case Gb:case jb:return _i(+e,+t);case zb:return e.name==t.name&&e.message==t.message;case Wb:case Yb:return e==t+"";case Fb:var o=Ub;case qb:var l=r&Bb;if(o||(o=cl),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=Hb,a.set(e,t);var u=Xh(o(e),o(t),r,i,s,a);return a.delete(e),u;case Xb:if(ul)return ul.call(e)==ul.call(t)}return!1}var Jb=1,t_=Object.prototype,e_=t_.hasOwnProperty;function n_(e,t,n,r,i,s){var a=n&Jb,o=sl(e),l=o.length,c=sl(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:e_.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=a;++d<l;){h=o[d];var v=e[h],x=t[h];if(r)var _=a?r(x,v,h,t,e,s):r(v,x,h,e,t,s);if(!(_===void 0?v===x||i(v,x,n,r,s):_)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){var E=e.constructor,b=t.constructor;E!=b&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof b=="function"&&b instanceof b)&&(g=!1)}return s.delete(e),s.delete(t),g}var r_=1,Kh="[object Arguments]",Qh="[object Array]",Vs="[object Object]",i_=Object.prototype,Jh=i_.hasOwnProperty;function s_(e,t,n,r,i,s){var a=Zt(e),o=Zt(t),l=a?Qh:Ae(e),c=o?Qh:Ae(t);l=l==Kh?Vs:l,c=c==Kh?Vs:c;var u=l==Vs,d=c==Vs,h=l==c;if(h&&Ar(e)){if(!Ar(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new He),a||Is(e)?Xh(e,t,n,r,i,s):Qb(e,t,l,n,r,i,s);if(!(n&r_)){var p=u&&Jh.call(e,"__wrapped__"),f=d&&Jh.call(t,"__wrapped__");if(p||f){var g=p?e.value():e,m=f?t.value():t;return s||(s=new He),i(g,m,n,r,s)}}return h?(s||(s=new He),n_(e,t,n,r,i,s)):!1}function Gs(e,t,n,r,i){return e===t?!0:e==null||t==null||!tn(e)&&!tn(t)?e!==e&&t!==t:s_(e,t,n,r,Gs,i)}var a_=1,o_=2;function l_(e,t,n,r){var i=n.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=n[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=n[i];var o=a[0],l=e[o],c=a[1];if(a[2]){if(l===void 0&&!(o in e))return!1}else{var u=new He,d;if(!(d===void 0?Gs(c,l,a_|o_,r,u):d))return!1}}return!0}function td(e){return e===e&&!Ce(e)}function c_(e){for(var t=Oi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,td(i)]}return t}function ed(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function u_(e){var t=c_(e);return t.length==1&&t[0][2]?ed(t[0][0],t[0][1]):function(n){return n===e||l_(n,e,t)}}function h_(e,t){return e!=null&&t in Object(e)}function d_(e,t,n){t=Us(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=Mi(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&Zo(i)&&Yo(a,i)&&(Zt(e)||Cr(e)))}function p_(e,t){return e!=null&&d_(e,t,h_)}var f_=1,m_=2;function g_(e,t){return Jo(e)&&td(t)?ed(Mi(e),t):function(n){var r=yt(n,e);return r===void 0&&r===t?p_(n,e):Gs(t,r,f_|m_)}}function v_(e){return function(t){return t==null?void 0:t[e]}}function y_(e){return function(t){return el(t,e)}}function x_(e){return Jo(e)?v_(Mi(e)):y_(e)}function zs(e){return typeof e=="function"?e:e==null?Fo:typeof e=="object"?Zt(e)?g_(e[0],e[1]):u_(e):x_(e)}function b_(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return t}}var nd=b_();function hl(e,t,n){(n!==void 0&&!_i(e[t],n)||n===void 0&&!(t in e))&&Ds(e,t,n)}function dl(e){return tn(e)&&Kn(e)}function pl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function __(e){return Mr(e,Si(e))}function E_(e,t,n,r,i,s,a){var o=pl(e,n),l=pl(t,n),c=a.get(l);if(c){hl(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=Zt(l),p=!h&&Ar(l),f=!h&&!p&&Is(l);u=l,h||p||f?Zt(o)?u=o:dl(o)?u=sh(o):p?(d=!1,u=$h(l,!0)):f?(d=!1,u=Hh(l,!0)):u=[]:Eh(l)||Cr(l)?(u=o,Cr(o)?u=__(o):(!Ce(o)||jo(o))&&(u=Vh(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),hl(e,n,u)}function rd(e,t,n,r,i){e!==t&&nd(t,function(s,a){if(i||(i=new He),Ce(s))E_(e,t,a,n,rd,r,i);else{var o=r?r(pl(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),hl(e,a,o)}},Si)}function id(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var O_="[object Map]",S_="[object Set]",T_=Object.prototype,w_=T_.hasOwnProperty;function Ve(e){if(e==null)return!0;if(Kn(e)&&(Zt(e)||typeof e=="string"||typeof e.splice=="function"||Ar(e)||Is(e)||Cr(e)))return!e.length;var t=Ae(e);if(t==O_||t==S_)return!e.size;if(Rs(e))return!xh(e).length;for(var n in e)if(w_.call(e,n))return!1;return!0}var at=L1(function(e,t,n){rd(e,t,n)}),$_=1/0,M_=kr&&1/cl(new kr([,-0]))[1]==$_?function(e){return new kr(e)}:d1,C_=200;function sd(e,t,n){var r=-1,i=S1,s=e.length,a=!0,o=[],l=o;if(s>=C_){var c=t?null:M_(e);if(c)return cl(c);a=!1,i=Yh,l=new Ai}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var A_=Xo(function(e){var t=id(e);return dl(t)&&(t=void 0),sd(Bs(e,1,dl,!0),zs(t))});function Li(e){return e&&e.length?sd(e):[]}function Jn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function L_(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function fl(e){let t,n,r;e.length!==2?(t=Jn,n=(o,l)=>Jn(e(o),l),r=(o,l)=>e(o)-l):(t=e===Jn||e===L_?e:k_,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function k_(){return 0}function D_(e){return e===null?NaN:+e}function*R_(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const I_=fl(Jn),ml=I_.right;fl(D_).center;function Ge(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let s of e)(s=t(s,++i,e))!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}let ad=class extends Map{constructor(t,n=U_){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(od(this,t))}has(t){return super.has(od(this,t))}set(t,n){return super.set(N_(this,t),n)}delete(t){return super.delete(P_(this,t))}};function od({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function N_({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function P_({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function U_(e){return e!==null&&typeof e=="object"?e.valueOf():e}const B_=Math.sqrt(50),H_=Math.sqrt(10),V_=Math.sqrt(2);function Fs(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=B_?10:s>=H_?5:s>=V_?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?Fs(e,t,n*2):[o,l,c]}function js(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?Fs(t,e,n):Fs(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function Dr(e,t,n){return t=+t,e=+e,n=+n,Fs(e,t,n)[2]}function gl(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Dr(t,e,n):Dr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function tr(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function In(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}var G_={value:()=>{}};function vl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ws(n)}function Ws(e){this._=e}function z_(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ws.prototype=vl.prototype={constructor:Ws,on:function(e,t){var n=this._,r=z_(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=F_(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=ld(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ld(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ws(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function F_(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ld(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=G_,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var yl="http://www.w3.org/1999/xhtml";const cd={svg:"http://www.w3.org/2000/svg",xhtml:yl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function qs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),cd.hasOwnProperty(t)?{space:cd[t],local:e}:e}function j_(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===yl&&t.documentElement.namespaceURI===yl?t.createElement(e):t.createElementNS(n,e)}}function W_(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ud(e){var t=qs(e);return(t.local?W_:j_)(t)}function q_(){}function xl(e){return e==null?q_:function(){return this.querySelector(e)}}function Y_(e){typeof e!="function"&&(e=xl(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new ye(r,this._parents)}function X_(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Z_(){return[]}function hd(e){return e==null?Z_:function(){return this.querySelectorAll(e)}}function K_(e){return function(){return X_(e.apply(this,arguments))}}function Q_(e){typeof e=="function"?e=K_(e):e=hd(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new ye(r,i)}function dd(e){return function(){return this.matches(e)}}function pd(e){return function(t){return t.matches(e)}}var J_=Array.prototype.find;function tE(e){return function(){return J_.call(this.children,e)}}function eE(){return this.firstElementChild}function nE(e){return this.select(e==null?eE:tE(typeof e=="function"?e:pd(e)))}var rE=Array.prototype.filter;function iE(){return Array.from(this.children)}function sE(e){return function(){return rE.call(this.children,e)}}function aE(e){return this.selectAll(e==null?iE:sE(typeof e=="function"?e:pd(e)))}function oE(e){typeof e!="function"&&(e=dd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new ye(r,this._parents)}function fd(e){return new Array(e.length)}function lE(){return new ye(this._enter||this._groups.map(fd),this._parents)}function Ys(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ys.prototype={constructor:Ys,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function cE(e){return function(){return e}}function uE(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new Ys(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function hE(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),p;for(o=0;o<u;++o)(l=t[o])&&(h[o]=p=a.call(l,l.__data__,o,t)+"",c.has(p)?i[o]=l:c.set(p,l));for(o=0;o<d;++o)p=a.call(e,s[o],o,s)+"",(l=c.get(p))?(r[o]=l,l.__data__=s[o],c.delete(p)):n[o]=new Ys(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function dE(e){return e.__data__}function pE(e,t){if(!arguments.length)return Array.from(this,dE);var n=t?hE:uE,r=this._parents,i=this._groups;typeof e!="function"&&(e=cE(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],d=i[c],h=d.length,p=fE(e.call(u,u&&u.__data__,c,r)),f=p.length,g=o[c]=new Array(f),m=a[c]=new Array(f),v=l[c]=new Array(h);n(u,d,g,m,v,p,t);for(var x=0,_=0,E,b;x<f;++x)if(E=g[x]){for(x>=_&&(_=x+1);!(b=m[_])&&++_<f;);E._next=b||null}}return a=new ye(a,r),a._enter=o,a._exit=l,a}function fE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function mE(){return new ye(this._exit||this._groups.map(fd),this._parents)}function gE(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function vE(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),p,f=0;f<d;++f)(p=c[f]||u[f])&&(h[f]=p);for(;l<i;++l)o[l]=n[l];return new ye(o,this._parents)}function yE(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function xE(e){e||(e=bE);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new ye(i,this._parents).order()}function bE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _E(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function EE(){return Array.from(this)}function OE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function SE(){let e=0;for(const t of this)++e;return e}function TE(){return!this.node()}function wE(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function $E(e){return function(){this.removeAttribute(e)}}function ME(e){return function(){this.removeAttributeNS(e.space,e.local)}}function CE(e,t){return function(){this.setAttribute(e,t)}}function AE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function LE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function kE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function DE(e,t){var n=qs(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?ME:$E:typeof t=="function"?n.local?kE:LE:n.local?AE:CE)(n,t))}function md(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function RE(e){return function(){this.style.removeProperty(e)}}function IE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function NE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function PE(e,t,n){return arguments.length>1?this.each((t==null?RE:typeof t=="function"?NE:IE)(e,t,n??"")):Rr(this.node(),e)}function Rr(e,t){return e.style.getPropertyValue(t)||md(e).getComputedStyle(e,null).getPropertyValue(t)}function UE(e){return function(){delete this[e]}}function BE(e,t){return function(){this[e]=t}}function HE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function VE(e,t){return arguments.length>1?this.each((t==null?UE:typeof t=="function"?HE:BE)(e,t)):this.node()[e]}function gd(e){return e.trim().split(/^|\s+/)}function bl(e){return e.classList||new vd(e)}function vd(e){this._node=e,this._names=gd(e.getAttribute("class")||"")}vd.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function yd(e,t){for(var n=bl(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function xd(e,t){for(var n=bl(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function GE(e){return function(){yd(this,e)}}function zE(e){return function(){xd(this,e)}}function FE(e,t){return function(){(t.apply(this,arguments)?yd:xd)(this,e)}}function jE(e,t){var n=gd(e+"");if(arguments.length<2){for(var r=bl(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?FE:t?GE:zE)(n,t))}function WE(){this.textContent=""}function qE(e){return function(){this.textContent=e}}function YE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function XE(e){return arguments.length?this.each(e==null?WE:(typeof e=="function"?YE:qE)(e)):this.node().textContent}function ZE(){this.innerHTML=""}function KE(e){return function(){this.innerHTML=e}}function QE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function JE(e){return arguments.length?this.each(e==null?ZE:(typeof e=="function"?QE:KE)(e)):this.node().innerHTML}function tO(){this.nextSibling&&this.parentNode.appendChild(this)}function eO(){return this.each(tO)}function nO(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rO(){return this.each(nO)}function iO(e){var t=typeof e=="function"?e:ud(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function sO(){return null}function aO(e,t){var n=typeof e=="function"?e:ud(e),r=t==null?sO:typeof t=="function"?t:xl(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function oO(){var e=this.parentNode;e&&e.removeChild(this)}function lO(){return this.each(oO)}function cO(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function uO(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hO(e){return this.select(e?uO:cO)}function dO(e){return arguments.length?this.property("__data__",e):this.node().__data__}function pO(e){return function(t){e.call(this,t,this.__data__)}}function fO(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function mO(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function gO(e,t,n){return function(){var r=this.__on,i,s=pO(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function vO(e,t,n){var r=fO(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<s;++i)if((a=r[i]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?gO:mO,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function bd(e,t,n){var r=md(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function yO(e,t){return function(){return bd(this,e,t)}}function xO(e,t){return function(){return bd(this,e,t.apply(this,arguments))}}function bO(e,t){return this.each((typeof t=="function"?xO:yO)(e,t))}function*_O(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var _d=[null];function ye(e,t){this._groups=e,this._parents=t}function ki(){return new ye([[document.documentElement]],_d)}function EO(){return this}ye.prototype=ki.prototype={constructor:ye,select:Y_,selectAll:Q_,selectChild:nE,selectChildren:aE,filter:oE,data:pE,enter:lE,exit:mE,join:gE,merge:vE,selection:EO,order:yE,sort:xE,call:_E,nodes:EE,node:OE,size:SE,empty:TE,each:wE,attr:DE,style:PE,property:VE,classed:jE,text:XE,html:JE,raise:eO,lower:rO,append:iO,insert:aO,remove:lO,clone:hO,datum:dO,on:vO,dispatch:bO,[Symbol.iterator]:_O};function OO(e){let t;for(;t=e.sourceEvent;)e=t;return e}function er(e,t){if(e=OO(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}function _l(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ed(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Di(){}var Ri=.7,Xs=1/Ri,Ir="\\s*([+-]?\\d+)\\s*",Ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",en="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",SO=/^#([0-9a-f]{3,8})$/,TO=new RegExp(`^rgb\\(${Ir},${Ir},${Ir}\\)$`),wO=new RegExp(`^rgb\\(${en},${en},${en}\\)$`),$O=new RegExp(`^rgba\\(${Ir},${Ir},${Ir},${Ii}\\)$`),MO=new RegExp(`^rgba\\(${en},${en},${en},${Ii}\\)$`),CO=new RegExp(`^hsl\\(${Ii},${en},${en}\\)$`),AO=new RegExp(`^hsla\\(${Ii},${en},${en},${Ii}\\)$`),Od={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};_l(Di,fn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Sd,formatHex:Sd,formatHex8:LO,formatHsl:kO,formatRgb:Td,toString:Td});function Sd(){return this.rgb().formatHex()}function LO(){return this.rgb().formatHex8()}function kO(){return Ad(this).formatHsl()}function Td(){return this.rgb().formatRgb()}function fn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=SO.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?wd(t):n===3?new he(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Zs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Zs(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=TO.exec(e))?new he(t[1],t[2],t[3],1):(t=wO.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$O.exec(e))?Zs(t[1],t[2],t[3],t[4]):(t=MO.exec(e))?Zs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=CO.exec(e))?Cd(t[1],t[2]/100,t[3]/100,1):(t=AO.exec(e))?Cd(t[1],t[2]/100,t[3]/100,t[4]):Od.hasOwnProperty(e)?wd(Od[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function wd(e){return new he(e>>16&255,e>>8&255,e&255,1)}function Zs(e,t,n,r){return r<=0&&(e=t=n=NaN),new he(e,t,n,r)}function DO(e){return e instanceof Di||(e=fn(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function El(e,t,n,r){return arguments.length===1?DO(e):new he(e,t,n,r??1)}function he(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}_l(he,El,Ed(Di,{brighter(e){return e=e==null?Xs:Math.pow(Xs,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(nr(this.r),nr(this.g),nr(this.b),Ks(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$d,formatHex:$d,formatHex8:RO,formatRgb:Md,toString:Md}));function $d(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}`}function RO(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}${rr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Md(){const e=Ks(this.opacity);return`${e===1?"rgb(":"rgba("}${nr(this.r)}, ${nr(this.g)}, ${nr(this.b)}${e===1?")":`, ${e})`}`}function Ks(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rr(e){return e=nr(e),(e<16?"0":"")+e.toString(16)}function Cd(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ze(e,t,n,r)}function Ad(e){if(e instanceof ze)return new ze(e.h,e.s,e.l,e.opacity);if(e instanceof Di||(e=fn(e)),!e)return new ze;if(e instanceof ze)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new ze(a,o,l,e.opacity)}function Ld(e,t,n,r){return arguments.length===1?Ad(e):new ze(e,t,n,r??1)}function ze(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}_l(ze,Ld,Ed(Di,{brighter(e){return e=e==null?Xs:Math.pow(Xs,e),new ze(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new ze(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new he(Ol(e>=240?e-240:e+120,i,r),Ol(e,i,r),Ol(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ze(kd(this.h),Qs(this.s),Qs(this.l),Ks(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ks(this.opacity);return`${e===1?"hsl(":"hsla("}${kd(this.h)}, ${Qs(this.s)*100}%, ${Qs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kd(e){return e=(e||0)%360,e<0?e+360:e}function Qs(e){return Math.max(0,Math.min(1,e||0))}function Ol(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Sl=e=>()=>e;function IO(e,t){return function(n){return e+n*t}}function NO(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function PO(e){return(e=+e)==1?Dd:function(t,n){return n-t?NO(t,n,e):Sl(isNaN(t)?n:t)}}function Dd(e,t){var n=t-e;return n?IO(e,n):Sl(isNaN(e)?t:e)}const Js=function e(t){var n=PO(t);function r(i,s){var a=n((i=El(i)).r,(s=El(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Dd(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function UO(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function BO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function HO(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=Ni(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function VO(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function GO(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Ni(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Tl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wl=new RegExp(Tl.source,"g");function zO(e){return function(){return e}}function FO(e){return function(t){return e(t)+""}}function Rd(e,t){var n=Tl.lastIndex=wl.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Tl.exec(e))&&(i=wl.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:xe(r,i)})),n=wl.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?FO(l[0].x):zO(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function Ni(e,t){var n=typeof t,r;return t==null||n==="boolean"?Sl(t):(n==="number"?xe:n==="string"?(r=fn(t))?(t=r,Js):Rd:t instanceof fn?Js:t instanceof Date?VO:BO(t)?UO:Array.isArray(t)?HO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?GO:xe)(e,t)}function Id(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Nd=180/Math.PI,Pd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ud(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Nd,skewX:Math.atan(l)*Nd,scaleX:a,scaleY:o}}var ta;function jO(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Pd:Ud(t.a,t.b,t.c,t.d,t.e,t.f)}function WO(e){return e==null||(ta||(ta=document.createElementNS("http://www.w3.org/2000/svg","g")),ta.setAttribute("transform",e),!(e=ta.transform.baseVal.consolidate()))?Pd:(e=e.matrix,Ud(e.a,e.b,e.c,e.d,e.e,e.f))}function Bd(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,p,f){if(c!==d||u!==h){var g=p.push("translate(",null,t,null,n);f.push({i:g-4,x:xe(c,d)},{i:g-2,x:xe(u,h)})}else(d||h)&&p.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:xe(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:xe(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,p,f){if(c!==d||u!==h){var g=p.push(i(p)+"scale(",null,",",null,")");f.push({i:g-4,x:xe(c,d)},{i:g-2,x:xe(u,h)})}else(d!==1||h!==1)&&p.push(i(p)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(p){for(var f=-1,g=h.length,m;++f<g;)d[(m=h[f]).i]=m.x(p);return d.join("")}}}var qO=Bd(jO,"px, ","px)","deg)"),YO=Bd(WO,", ",")",")"),Nr=0,Pi=0,Ui=0,Hd=1e3,ea,Bi,na=0,ir=0,ra=0,Hi=typeof performance=="object"&&performance.now?performance:Date,Vd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $l(){return ir||(Vd(XO),ir=Hi.now()+ra)}function XO(){ir=0}function ia(){this._call=this._time=this._next=null}ia.prototype=Gd.prototype={constructor:ia,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?$l():+n)+(t==null?0:+t),!this._next&&Bi!==this&&(Bi?Bi._next=this:ea=this,Bi=this),this._call=e,this._time=n,Ml()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ml())}};function Gd(e,t,n){var r=new ia;return r.restart(e,t,n),r}function ZO(){$l(),++Nr;for(var e=ea,t;e;)(t=ir-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Nr}function zd(){ir=(na=Hi.now())+ra,Nr=Pi=0;try{ZO()}finally{Nr=0,QO(),ir=0}}function KO(){var e=Hi.now(),t=e-na;t>Hd&&(ra-=t,na=e)}function QO(){for(var e,t=ea,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ea=n);Bi=e,Ml(r)}function Ml(e){if(!Nr){Pi&&(Pi=clearTimeout(Pi));var t=e-ir;t>24?(e<1/0&&(Pi=setTimeout(zd,e-Hi.now()-ra)),Ui&&(Ui=clearInterval(Ui))):(Ui||(na=Hi.now(),Ui=setInterval(KO,Hd)),Nr=1,Vd(zd))}}function Fd(e,t,n){var r=new ia;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var JO=vl("start","end","cancel","interrupt"),tS=[],jd=0,Wd=1,Cl=2,sa=3,qd=4,Al=5,aa=6;function oa(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;eS(e,n,{name:t,index:r,group:i,on:JO,tween:tS,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:jd})}function Ll(e,t){var n=Fe(e,t);if(n.state>jd)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=Fe(e,t);if(n.state>sa)throw new Error("too late; already running");return n}function Fe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function eS(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Gd(s,0,n.time);function s(c){n.state=Wd,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,p;if(n.state!==Wd)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===sa)return Fd(a);p.state===qd?(p.state=aa,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=aa,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(Fd(function(){n.state===sa&&(n.state=qd,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Cl,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Cl){for(n.state=sa,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=p);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Al,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===Al&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=aa,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function kl(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Cl&&r.state<Al,r.state=aa,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function nS(e){return this.each(function(){kl(this,e)})}function rS(e,t){var n,r;return function(){var i=nn(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function iS(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=nn(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function sS(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Fe(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?rS:iS)(n,e,t))}function Dl(e,t,n){var r=e._id;return e.each(function(){var i=nn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Fe(i,r).value[t]}}function Yd(e,t){var n;return(typeof t=="number"?xe:t instanceof fn?Js:(n=fn(t))?(t=n,Js):Rd)(e,t)}function aS(e){return function(){this.removeAttribute(e)}}function oS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lS(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function cS(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function uS(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function hS(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function dS(e,t){var n=qs(e),r=n==="transform"?YO:Yd;return this.attrTween(e,typeof t=="function"?(n.local?hS:uS)(n,r,Dl(this,"attr."+e,t)):t==null?(n.local?oS:aS)(n):(n.local?cS:lS)(n,r,t))}function pS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function fS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function mS(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&fS(e,s)),n}return i._value=t,i}function gS(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&pS(e,s)),n}return i._value=t,i}function vS(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=qs(e);return this.tween(n,(r.local?mS:gS)(r,t))}function yS(e,t){return function(){Ll(this,e).delay=+t.apply(this,arguments)}}function xS(e,t){return t=+t,function(){Ll(this,e).delay=t}}function bS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yS:xS)(t,e)):Fe(this.node(),t).delay}function _S(e,t){return function(){nn(this,e).duration=+t.apply(this,arguments)}}function ES(e,t){return t=+t,function(){nn(this,e).duration=t}}function OS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_S:ES)(t,e)):Fe(this.node(),t).duration}function SS(e,t){if(typeof t!="function")throw new Error;return function(){nn(this,e).ease=t}}function TS(e){var t=this._id;return arguments.length?this.each(SS(t,e)):Fe(this.node(),t).ease}function wS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nn(this,e).ease=n}}function $S(e){if(typeof e!="function")throw new Error;return this.each(wS(this._id,e))}function MS(e){typeof e!="function"&&(e=dd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new mn(r,this._parents,this._name,this._id)}function CS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,p=0;p<u;++p)(h=l[p]||c[p])&&(d[p]=h);for(;o<r;++o)a[o]=t[o];return new mn(a,this._parents,this._name,this._id)}function AS(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function LS(e,t,n){var r,i,s=AS(t)?Ll:nn;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function kS(e,t){var n=this._id;return arguments.length<2?Fe(this.node(),n).on.on(e):this.each(LS(n,e,t))}function DS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function RS(){return this.on("end.remove",DS(this._id))}function IS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xl(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,oa(c[h],t,n,h,c,Fe(u,n)));return new mn(s,this._parents,t,n)}function NS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=hd(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),p,f=Fe(u,n),g=0,m=h.length;g<m;++g)(p=h[g])&&oa(p,t,n,g,h,f);s.push(h),a.push(u)}return new mn(s,a,t,n)}var PS=ki.prototype.constructor;function US(){return new PS(this._groups,this._parents)}function BS(e,t){var n,r,i;return function(){var s=Rr(this,e),a=(this.style.removeProperty(e),Rr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Xd(e){return function(){this.style.removeProperty(e)}}function HS(e,t,n){var r,i=n+"",s;return function(){var a=Rr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function VS(e,t,n){var r,i,s;return function(){var a=Rr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Rr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function GS(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=nn(this,e),c=l.on,u=l.value[s]==null?o||(o=Xd(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function zS(e,t,n){var r=(e+="")=="transform"?qO:Yd;return t==null?this.styleTween(e,BS(e,r)).on("end.style."+e,Xd(e)):typeof t=="function"?this.styleTween(e,VS(e,r,Dl(this,"style."+e,t))).each(GS(this._id,e)):this.styleTween(e,HS(e,r,t),n).on("end.style."+e,null)}function FS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function jS(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&FS(e,a,n)),r}return s._value=t,s}function WS(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,jS(e,t,n??""))}function qS(e){return function(){this.textContent=e}}function YS(e){return function(){var t=e(this);this.textContent=t??""}}function XS(e){return this.tween("text",typeof e=="function"?YS(Dl(this,"text",e)):qS(e==null?"":e+""))}function ZS(e){return function(t){this.textContent=e.call(this,t)}}function KS(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&ZS(i)),t}return r._value=e,r}function QS(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,KS(e))}function JS(){for(var e=this._name,t=this._id,n=Zd(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Fe(l,t);oa(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new mn(r,this._parents,e,n)}function tT(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=nn(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var eT=0;function mn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Zd(){return++eT}var gn=ki.prototype;mn.prototype={constructor:mn,select:IS,selectAll:NS,selectChild:gn.selectChild,selectChildren:gn.selectChildren,filter:MS,merge:CS,selection:US,transition:JS,call:gn.call,nodes:gn.nodes,node:gn.node,size:gn.size,empty:gn.empty,each:gn.each,on:kS,attr:dS,attrTween:vS,style:zS,styleTween:WS,text:XS,textTween:QS,remove:RS,tween:sS,delay:bS,duration:OS,ease:TS,easeVarying:$S,end:tT,[Symbol.iterator]:gn[Symbol.iterator]};function Kd(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nT={time:null,delay:0,duration:250,ease:Kd};function rT(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function iT(e){var t,n;e instanceof mn?(t=e._id,e=e._name):(t=Zd(),(n=nT).time=$l(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&oa(l,e,t,c,a,n||rT(l,t));return new mn(r,this._parents,e,t)}ki.prototype.interrupt=nS,ki.prototype.transition=iT;function sT(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function la(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Pr(e){return e=la(Math.abs(e)),e?e[1]:NaN}function aT(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function oT(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var lT=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vi(e){if(!(t=lT.exec(e)))throw new Error("invalid format: "+e);var t;return new Rl({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Vi.prototype=Rl.prototype;function Rl(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Rl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function cT(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Qd;function uT(e,t){var n=la(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Qd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+la(e,Math.max(0,t+s-1))[0]}function Jd(e,t){var n=la(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const tp={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:sT,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Jd(e*100,t),r:Jd,s:uT,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ep(e){return e}var np=Array.prototype.map,rp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function hT(e){var t=e.grouping===void 0||e.thousands===void 0?ep:aT(np.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?ep:oT(np.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=Vi(d);var h=d.fill,p=d.align,f=d.sign,g=d.symbol,m=d.zero,v=d.width,x=d.comma,_=d.precision,E=d.trim,b=d.type;b==="n"?(x=!0,b="g"):tp[b]||(_===void 0&&(_=12),E=!0,b="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var S=g==="$"?n:g==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",M=g==="$"?r:/[%p]/.test(b)?a:"",D=tp[b],A=/[defgprs%]/.test(b);_=_===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function R($){var H=S,P=M,B,O,w;if(b==="c")P=D($)+P,$="";else{$=+$;var L=$<0||1/$<0;if($=isNaN($)?l:D(Math.abs($),_),E&&($=cT($)),L&&+$==0&&f!=="+"&&(L=!1),H=(L?f==="("?f:o:f==="-"||f==="("?"":f)+H,P=(b==="s"?rp[8+Qd/3]:"")+P+(L&&f==="("?")":""),A){for(B=-1,O=$.length;++B<O;)if(w=$.charCodeAt(B),48>w||w>57){P=(w===46?i+$.slice(B+1):$.slice(B))+P,$=$.slice(0,B);break}}}x&&!m&&($=t($,1/0));var k=H.length+$.length+P.length,U=k<v?new Array(v-k+1).join(h):"";switch(x&&m&&($=t(U+$,U.length?v-P.length:1/0),U=""),p){case"<":$=H+$+P+U;break;case"=":$=H+U+$+P;break;case"^":$=U.slice(0,k=U.length>>1)+H+$+P+U.slice(k);break;default:$=U+H+$+P;break}return s($)}return R.toString=function(){return d+""},R}function u(d,h){var p=c((d=Vi(d),d.type="f",d)),f=Math.max(-8,Math.min(8,Math.floor(Pr(h)/3)))*3,g=Math.pow(10,-f),m=rp[8+f/3];return function(v){return p(g*v)+m}}return{format:c,formatPrefix:u}}var ca,Il,ip;dT({thousands:",",grouping:[3],currency:["$",""]});function dT(e){return ca=hT(e),Il=ca.format,ip=ca.formatPrefix,ca}function pT(e){return Math.max(0,-Pr(Math.abs(e)))}function fT(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Pr(t)/3)))*3-Pr(Math.abs(e)))}function mT(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pr(t)-Pr(e))+1}function Ur(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const sp=Symbol("implicit");function ua(){var e=new ad,t=[],n=[],r=sp;function i(s){let a=e.get(s);if(a===void 0){if(r!==sp)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new ad;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return ua(t,n).unknown(r)},Ur.apply(i,arguments),i}function gT(e){return function(){return e}}function vT(e){return+e}var ap=[0,1];function Br(e){return e}function Nl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:gT(isNaN(t)?NaN:.5)}function yT(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function xT(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Nl(i,r),s=n(a,s)):(r=Nl(r,i),s=n(s,a)),function(o){return s(r(o))}}function bT(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Nl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=ml(e,o,1,r)-1;return s[l](i[l](o))}}function Pl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function op(){var e=ap,t=ap,n=Ni,r,i,s,a=Br,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Br&&(a=yT(e[0],e[h-1])),o=h>2?bT:xT,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return d.invert=function(h){return a(i((c||(c=o(t,e.map(r),xe)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,vT),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=Id,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Br,u()):a!==Br},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,p){return r=h,i=p,u()}}function lp(){return op()(Br,Br)}function _T(e,t,n,r){var i=gl(e,t,n),s;switch(r=Vi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=fT(i,a))&&(r.precision=s),ip(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=mT(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=pT(i))&&(r.precision=s-(r.type==="%")*2);break}}return Il(r)}function cp(e){var t=e.domain;return e.ticks=function(n){var r=t();return js(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return _T(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);u-- >0;){if(c=Dr(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function je(){var e=lp();return e.copy=function(){return Pl(e,je())},Ur.apply(e,arguments),cp(e)}function Ul(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[ml(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Ul().domain([e,t]).range(i).unknown(s)},Ur.apply(cp(a),arguments)}function Gi(e,t,n){this.k=e,this.x=t,this.y=n}Gi.prototype={constructor:Gi,scale:function(e){return e===1?this:new Gi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Gi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Gi.prototype;const de="cds",vn={opacity:{unselected:.05,selected:.4}},Nn={ticks:{number:7,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Hr={duration:1e3,ease:Kd,zoomLevel:3},Vr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},up={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Le={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},ET={defaultBins:10},Nt={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},yn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Kt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Lt={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},sr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},We={nodeWidth:4,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},hp={minCellDividerDimension:16},dp={default:{size:24}},pp={defaultOffset:4,horizontalOffset:10},fp={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},be={height:{[Ue.GRAPH_VIEW]:32,[Ue.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},OT=[{type:jt.RADIUS,name:"Radius"},{type:jt.AREA,name:"Poor area"},{type:jt.AREA,name:"Satisfactory area"},{type:jt.AREA,name:"Great area"},{type:jt.QUARTILE,name:"Quartiles"}],Gr={type:we.END_LINE,threshold:16,numCharacter:14},ST={code:typeof navigator<"u"&&(navigator==null?void 0:navigator.language)||"en-US",number:(e,t=(navigator==null?void 0:navigator.language)||"en-US")=>{var n;return(n=e==null?void 0:e.toLocaleString)==null?void 0:n.call(e,t)},date:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},TT={enabled:!0,position:Tr.BOTTOM,clickable:!0,truncation:Gr,alignment:zt.LEFT,order:null,additionalItems:[]},wT={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},$T={enabled:!0},mp={enabled:!0,showTotal:!0,truncation:Gr,groupLabel:"Group"},gp={top:{visible:!0,includeZero:!0,truncation:Gr},bottom:{visible:!0,includeZero:!0,truncation:Gr},left:{visible:!0,includeZero:!0,truncation:Gr},right:{visible:!0,includeZero:!0,truncation:Gr}},ha={addSpaceOnEdges:1,showDayName:!1,localeObject:Zu,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}};let vp=!1;try{vp=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const Jt={width:null,height:null,resizable:!0,theme:Vo.WHITE,tooltip:mp,legend:TT,locale:ST,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:bt.SHOW_AS_DATATABLE},...vp?[{type:bt.MAKE_FULLSCREEN}]:[],{type:bt.EXPORT_CSV},{type:bt.EXPORT_PNG},{type:bt.EXPORT_JPG}]}},yp=at({},Jt,{thematic:{projection:Je.geoNaturalEarth1}}),zi=at({},Jt,{axes:gp,timeScale:ha,grid:wT,ruler:$T,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ue.GRAPH_VIEW}}}),ar=at({},zi,{bars:{maxWidth:16,spacingFactor:.25},timeScale:at(ha,{addSpaceOnEdges:1})}),MT=at({},ar,{}),CT=at({},ar,{}),AT=at({},ar,{bars:at({},ar.bars,{dividerSize:1.5})}),LT=at({},ar,{}),Bl=at({},zi,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),kT=Bl,xp=at({},Bl,{points:{radius:3,filled:!1,enabled:!0}}),bp=at({},xp,{timeScale:at(ha,{addSpaceOnEdges:0})}),DT=bp,RT=at({},zi,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{const t=Math.min(e.width,e.height);return[t*3/400,t*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:jt.RADIUS,name:"Radius"}]}}),IT=at({},zi,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:jt.AREA,name:"Poor area"},{type:jt.AREA,name:"Satisfactory area"},{type:jt.AREA,name:"Great area"},{type:jt.QUARTILE,name:"Quartiles"}]}}),NT=at({},ar,{bars:{dividerSize:1.5},timeScale:at(ha,{addSpaceOnEdges:0})}),PT=at({},Jt,{tooltip:at({},mp,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{const t=Math.min(e.width,e.height);return[t*20/400,t*75/400]},wordMapsTo:"word"}}),_p=at({},Jt,{pie:{labels:{formatter:null,enabled:!0},alignment:zt.LEFT,sortFunction:null,valueMapsTo:"value"}}),UT=at({},Jt,{legend:{enabled:!1},gauge:{type:Wn.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,alignment:zt.LEFT}}),BT=at({},_p,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20)},alignment:zt.LEFT}}),Ep=at({},Jt,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),HT=at({},Ep,{legend:{enabled:!0}}),VT=at({},Jt,{radar:{axes:{angle:"key",value:"value"},alignment:zt.LEFT},tooltip:{gridline:{enabled:!0}}}),GT=at({},ar,{comboChartTypes:[]}),zT=at({tree:{type:$s.TREE}},Jt,{}),FT=at({},Jt,{data:at(Jt.data,{groupMapsTo:"name"})}),jT=at({},Jt,Vr,{data:at(Jt.data,{groupMapsTo:"name"})}),WT=at({},Jt,{alluvial:{data:at(Jt.data,{groupMapsTo:"source"}),nodeAlignment:zt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),qT=at({},Jt,{axes:gp,heatmap:{divider:{state:$r.AUTO},colorLegend:{type:"linear"}}}),YT=at({},yp,{choropleth:{colorLegend:{type:"linear"}}}),Ct={alluvialChart:WT,areaChart:bp,axisChart:zi,boxplotChart:LT,bubbleChart:RT,bulletChart:IT,chart:Jt,circlePackChart:jT,choroplethChart:YT,comboChart:GT,donutChart:BT,gaugeChart:UT,groupedBarChart:CT,heatmapChart:qT,histogramChart:NT,lineChart:xp,lollipopChart:kT,meterChart:Ep,pieChart:_p,proportionalMeterChart:HT,radarChart:VT,scatterChart:Bl,simpleBarChart:MT,stackedAreaChart:DT,stackedBarChart:AT,thematicChart:yp,treeChart:zT,treemapChart:FT,wordCloudChart:PT};function XT(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=er(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Rt(e,t){var n;const r=pn(e),i=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete r.toolbar.controls,i.length===0&&delete r.axes;for(const s in r.axes)if(i.includes(s)){const a=t.axes[s];if((a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),a.mapsTo==null){const l=a.scaleType;l==null?a.mapsTo="value":l===nt.TIME?a.mapsTo="date":l===nt.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return Vl(r,t),at(r,t)}function xn(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function Fi(e){const t=/\(([^)]+)\)/.exec(e);if(t&&t.length>1){const n=t[1].split(",");if(n.length>1)return{x:parseFloat(n[0]),y:parseFloat(n[1])}}return{x:0,y:0}}function Hl(e,t,n="value",r=!1){const i=e/t.reduce((s,a)=>s+a[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function ji(e,t,n){if(n>e.length)return e;if(t===we.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===we.FRONT_LINE)return"..."+e.substr(-n);if(t===we.END_LINE)return e.substr(0,n)+"..."}function Vl(e,t){const n=y(e,"legend","additionalItems"),r=y(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=OT.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=A_(a,r,"name")}}const y=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},Op=(e,t)=>t===Gt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ie=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=Op(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function bn(e,t,n){return n===Gt.VERTICAL?[e,t]:[t,e]}function Sp(e){const t=Pt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Tp(e,t){const n=Pt(e,void 0);return n.setHours(0,0,0,0),n}function wp(e,t,n){const[r,i]=qn(void 0,e,t),s=Tp(r),a=Tp(i),o=+s-Sp(s),l=+a-Sp(a);return Math.round((o-l)/o0)}function ZT(e,t){const n=Pt(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function KT(e,t){const n=Pt(e,void 0);return wp(n,ZT(n))+1}function da(e,t){return xi(e,{...t,weekStartsOn:1})}function $p(e,t){const n=Pt(e,void 0),r=n.getFullYear(),i=$e(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=da(i),a=$e(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=da(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function QT(e,t){const n=$p(e),r=$e(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),da(r)}function JT(e,t){const n=Pt(e,void 0),r=+da(n)-+QT(n);return Math.round(r/Wu)+1}function Mp(e,t){var n,r,i,s;const a=Pt(e,t==null?void 0:t.in),o=a.getFullYear(),l=As(),c=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??l.firstWeekContainsDate??((s=(i=l.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,u=$e((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const d=xi(u,t),h=$e((t==null?void 0:t.in)||e,0);h.setFullYear(o,0,c),h.setHours(0,0,0,0);const p=xi(h,t);return+a>=+d?o+1:+a>=+p?o:o-1}function tw(e,t){var n,r,i,s;const a=As(),o=(t==null?void 0:t.firstWeekContainsDate)??((r=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??a.firstWeekContainsDate??((s=(i=a.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??1,l=Mp(e,t),c=$e((t==null?void 0:t.in)||e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),xi(c,t)}function ew(e,t){const n=Pt(e,t==null?void 0:t.in),r=+xi(n,t)-+tw(n,t);return Math.round(r/Wu)+1}function Ot(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Pn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ot(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ot(n+1,2)},d(e,t){return Ot(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ot(e.getHours()%12||12,t.length)},H(e,t){return Ot(e.getHours(),t.length)},m(e,t){return Ot(e.getMinutes(),t.length)},s(e,t){return Ot(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ot(i,t.length)}},zr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cp={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Pn.y(e,t)},Y:function(e,t,n,r){const i=Mp(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return Ot(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ot(s,t.length)},R:function(e,t){const n=$p(e);return Ot(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ot(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ot(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ot(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Pn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ot(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=ew(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ot(i,t.length)},I:function(e,t,n){const r=JT(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ot(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Pn.d(e,t)},D:function(e,t,n){const r=KT(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ot(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ot(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ot(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Ot(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=zr.noon:r===0?i=zr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=zr.evening:r>=12?i=zr.afternoon:r>=4?i=zr.morning:i=zr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Pn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Pn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Pn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Pn.s(e,t)},S:function(e,t){return Pn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Lp(r);case"XXXX":case"XX":return or(r);case"XXXXX":case"XXX":default:return or(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Lp(r);case"xxxx":case"xx":return or(r);case"xxxxx":case"xxx":default:return or(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ap(r,":");case"OOOO":default:return"GMT"+or(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ap(r,":");case"zzzz":default:return"GMT"+or(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ot(r,t.length)},T:function(e,t,n){return Ot(+e,t.length)}};function Ap(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Ot(s,2)}function Lp(e,t){return e%60===0?(e>0?"-":"+")+Ot(Math.abs(e)/60,2):or(e,t)}function or(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Ot(Math.trunc(r/60),2),s=Ot(r%60,2);return n+i+t+s}const kp=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Dp=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},nw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return kp(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",kp(r,t)).replace("{{time}}",Dp(i,t))},rw={p:Dp,P:nw},iw=/^D+$/,sw=/^Y+$/,aw=["D","DD","YY","YYYY"];function ow(e){return iw.test(e)}function lw(e){return sw.test(e)}function cw(e,t,n){const r=uw(e,t,n);if(console.warn(r),aw.includes(e))throw new RangeError(r)}function uw(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function hw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function dw(e){return!(!hw(e)&&typeof e!="number"||isNaN(+Pt(e)))}const pw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,fw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mw=/^'([^]*?)'?$/,gw=/''/g,vw=/[a-zA-Z]/;function Gl(e,t,n){var r,i,s,a,o,l,c,u;const d=As(),h=(n==null?void 0:n.locale)??d.locale??Zu,p=(n==null?void 0:n.firstWeekContainsDate)??((i=(r=n==null?void 0:n.locale)==null?void 0:r.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((a=(s=d.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,f=(n==null?void 0:n.weekStartsOn)??((l=(o=n==null?void 0:n.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,g=Pt(e,n==null?void 0:n.in);if(!dw(g))throw new RangeError("Invalid time value");let m=t.match(fw).map(x=>{const _=x[0];if(_==="p"||_==="P"){const E=rw[_];return E(x,h.formatLong)}return x}).join("").match(pw).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const _=x[0];if(_==="'")return{isToken:!1,value:yw(x)};if(Cp[_])return{isToken:!0,value:x};if(_.match(vw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:x}});h.localize.preprocessor&&(m=h.localize.preprocessor(g,m));const v={firstWeekContainsDate:p,weekStartsOn:f,locale:h};return m.map(x=>{if(!x.isToken)return x.value;const _=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&lw(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&ow(_))&&cw(_,t,String(e));const E=Cp[_[0]];return E(g,_,h.localize,v)}).join("")}function yw(e){const t=e.match(mw);return t?t[1].replace(gw,"'"):e}const zl=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function Rp(e,t,n,r,i){const s=t===0,a=Number(Gl(new Date(e),"c"))===2,o=Number(Gl(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||fa(e)||Wi(e,l)||Un(e);case"minute":return s||fa(e)||Wi(e,l)||Un(e);case"30minutes":return s||fa(e)||Wi(e,l)||Un(e);case"hourly":return s||fa(e)||Wi(e,l)||Un(e);case"daily":return i?s||a||Un(e):s||Wi(e,l)||Un(e);case"weekly":return s||a||Un(e);case"monthly":return s||Un(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function Fl(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=y(i,"timeIntervalFormats")[o],u=y(c,"primary"),d=y(c,"secondary"),h=Rp(e,t,n,r,a);let p=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(p=p.replace("pp","h:mm:ss.SSS a"));const f=i.localeObject,{code:g,optionsObject:m}=s,v=m[r].type,x=m[r][h?"primary":"secondary"][p];if(r==="quarterly"||!x){const _=Gl(l,p,{locale:f}).split("").map(E=>{var b;const S=Number(E);return E!==" "&&!Number.isNaN(S)?(b=S==null?void 0:S.toLocaleString)==null?void 0:b.call(S,g):E});return s[v](l,g,{},_.join(""))}else return s[v](l,g,x)}function pa(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function xw(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function bw(e){const t=zl.reduce((n,[,r],i)=>{const s=zl[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return zl[t][0]}function jl(e,t){if(ju[t])return t;if(e.length===1)return"15seconds";const n=xw(e),r=In(n);return bw(r)}function fa(e){const{s:t,m:n,H:r}=pa(e);return r===0&&n===0&&t===0}function Wi(e,t){const n=pa(e).M,r=pa(t).M;return n!==r}function Un(e){const{M:t,d:n,s:r,m:i,H:s}=pa(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Ip(e){return e===void 0?"":e.toISOString()}function Np(e){const t=Ge(e,r=>r.value),n=je().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function Pp(e,t){const n=y(t,"gradient","colors"),r=!Ve(n);let i=y(t,"pairing","option");const s=Np(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${i}-${c}`)}return Ul().domain(s).range(o)}var ht=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(ht||{});function _w(e,t){return e&&nd(e,t,Oi)}function Ew(e,t){return function(n,r){if(n==null)return n;if(!Kn(n))return e(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var Wl=Ew(_w);function pt(e){return function(){return e}}var Ow=Array.prototype.slice;function ma(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Sw(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function Tw(e,t,n,r){return Wl(e,function(i,s,a){t(r,i,n(i),a)}),r}function ww(e,t){return function(n,r){var i=Zt(n)?Sw:Tw,s={};return i(n,e,zs(r),s)}}function $w(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var Mw=Object.prototype,Cw=Mw.hasOwnProperty,Aw=ww(function(e,t,n){Cw.call(e,n)?e[n].push(t):Ds(e,n,[t])});function Lw(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function kw(e){return e}function Dw(e=Jn){if(e===Jn)return Up;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Up(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Rw=Array.prototype,Iw=Rw.slice;function ql(e){return()=>e}function Nw(e,t,n){let r;for(;;){const i=Dr(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function Pw(e){return Math.max(1,Math.ceil(Math.log(Lw(e))/Math.LN2)+1)}function Uw(){var e=kw,t=Ge,n=Pw;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],p=n(c,d,h);if(!Array.isArray(p)){const _=h,E=+p;if(t===Ge&&([d,h]=Nw(d,h,E)),p=js(d,h,E),p[0]<=d&&(l=Dr(d,h,E)),p[p.length-1]>=h)if(_>=h&&t===Ge){const b=Dr(d,h,E);isFinite(b)&&(b>0?h=(Math.floor(h/b)+1)*b:b<0&&(h=(Math.ceil(h*-b)+1)/-b))}else p.pop()}for(var f=p.length,g=0,m=f;p[g]<=d;)++g;for(;p[m-1]>h;)--m;(g||m<f)&&(p=p.slice(g,m),f=m-g);var v=new Array(f+1),x;for(s=0;s<=f;++s)x=v[s]=[],x.x0=s>0?p[s-1]:d,x.x1=s<f?p[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[Math.min(f,Math.floor((o-d)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const _=Math.floor((d-o)*l);v[Math.min(f,_+(p[_]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[ml(p,o,0,f)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:ql(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:ql([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:ql(Array.isArray(i)?Iw.call(i):i),r):n},r}function Bp(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Up:Dw(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(t-c*d/l+h)),f=Math.min(r,Math.floor(t+(l-c)*d/l+h));Bp(e,t,p,f,i)}const s=e[t];let a=n,o=r;for(qi(e,n,t),i(e[r],s)>0&&qi(e,n,r);a<o;){for(qi(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?qi(e,n,o):(++o,qi(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function qi(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Yl(e,t,n){if(e=Float64Array.from(R_(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return In(e);if(t>=1)return tr(e);var r,i=(r-1)*t,s=Math.floor(i),a=tr(Bp(e,s).subarray(0,s+1)),o=In(e.subarray(s+1));return a+(o-a)*(i-s)}}function Hp(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Vp(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Bw(e,t){return e[t]}function Hw(e){const t=[];return t.key=e,t}function Xl(){var e=pt([]),t=Vp,n=Hp,r=Bw;function i(s){var a=Array.from(e.apply(this,arguments),Hw),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(d,a[o].key,c,s)]).data=d;for(o=0,u=ma(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:pt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:pt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Vp:typeof s=="function"?s:pt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Hp,i):n},i}function Vw(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function Gw(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class rn{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:s,number:a}=y(r,"locale"),o=y(r,"tabularRepModal","tableHeadingFormatter"),l=y(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===nt.TIME&&(d=h=>s(h,i,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(h=>{d&&(h[1]=d(h[1]));for(const p in h){const f=h[p];typeof f=="number"&&(h[p]=a(f,i))}return h})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=y(n,"data"),a=y(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===nt.LINEAR||c===nt.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===nt.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Nt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>r.find(a=>a.name===s[i]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(pn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return y(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Nt.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(n=>n.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(n=>n.name)}aggregateBinDataByGroup(t){return Aw(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=ET.defaultBins}=s,l=Array.isArray(o),c=Uw().value(p=>p[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const p=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+p}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],d=Array.from(new Set(t.map(p=>p[a]))),h=[];return c.forEach(p=>{const f=`${p.x0}-${p.x1}`,g=this.aggregateBinDataByGroup(p);d.forEach(m=>{h.push({group:m,key:f,value:g[m]||0,bin:p.x0})})}),{bins:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return Xl().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=Li(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Ip(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===nt.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===nt.LOG||o===nt.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(p=>p.x0.toString()===c.toString());return a.forEach(p=>{d[p]=h.filter(f=>f[i]===p).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(p=>{const f=this.services.cartesianScales.getDomainIdentifier(p);return p[i]===u&&Object.prototype.hasOwnProperty.call(p,f)&&(p[f]instanceof Date?Ip(p[f])===l:p[f].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=$w(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const d=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/d*100:c[u]=0})})}return(r?Xl().offset(Vw):Xl()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const d=l[u];return d[s]=a[c],d}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();Vl(n,t),this.set({options:at(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(T.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Nt.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(T.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=y(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=y(s,"label");if(c===null){const d=y(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(s=>s.map(a=>`"${(a==="–"?"–":a).split(/[,;'"`]/).map(o=>Gw(o)).join("")}"`)).map(s=>s.join(",")).join(`
|
|
2
2
|
`),n=this.getOptions();let r="myChart";const i=y(n,"fileDownload","fileName");typeof i=="function"?r=i("csv"):typeof i=="string"&&(r=i),this.services.files.downloadCSV(t,`${r}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:r,DISABLED:i}=Nt.items.status,s=this.getOptions(),a=Li(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(l=>a.includes(l))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?r:i;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=y(t,"color","scale");Object.keys(n).forEach(r=>{this.allDataGroups.includes(r)||console.warn(`"${r}" does not exist in data groups.`)}),this.allDataGroups.filter(r=>n[r]).forEach(r=>this.colorScale[r]=n[r])}setColorClassNames(){const t=y(this.getOptions(),"color","pairing");let n=y(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=y(t,"option");const i=up.pairingOptions,s=n>5?14:n,a=`${s}-color`;r=r<=i[a]?r:1;const o=this.allDataGroups.map((l,c)=>`${s}-${r}-${c%14+1}`);this.colorClassNames=ua().range(o).domain(this.allDataGroups)}}class lr extends rn{constructor(t){super(t),this.axisFlavor=gi.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),r=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return r&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach(s=>{const a=i[s];t.scales[a]?i[s]={position:a,label:t.getScaleLabel(a),identifier:y(n,"axes",a,"mapsTo")}:i[s]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{primaryDomain:i,primaryRange:s,secondaryDomain:a,secondaryRange:o}=this.assignRangeAndDomains(),{number:l,code:c}=y(this.getOptions(),"locale"),u=["Group",i.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[r],h[i.identifier]===null?"–":h[i.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"–":l(h[s.identifier],c),...a?[h[a.identifier]===null?"–":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"–":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),y(this.getOptions(),"zoomBar",z.TOP,"enabled"))){const r=y(this.getOptions(),"zoomBar",z.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(pn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=Li(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[s].getTime()===l&&(c+=d[a])}),u[s]=new Date(l),u[a]=c,u})}this.set({zoomBarData:r})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const r=[];return Object.keys(z).forEach(i=>{const s=z[i],a=n.axes[s];if(a&&a.scaleType===nt.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{y(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}let zw=class extends lr{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale");t.sort((a,o)=>a.source.localeCompare(o.source));const i=["Source","Target","Value"],s=[...t.map(a=>[a.source,a.target,a.value===null?"–":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}},Fw=class extends lr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Yl(t,.25),q_50:Yl(t,.5),q_75:Yl(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:s,data:a}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(_=>_[o]).sort(Jn),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,d=c.quartiles.q_75,h=(d-u)*1.5,p=u-h,f=d+h,g=[],m=[];for(const _ of l)_<p||_>f?g.push(_):m.push(_);c.outliers=g;const v=In(m),x=tr(m);c.whiskers={min:v||In([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:x||tr([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},i.push(c)}return i}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBoxplotData(),{number:i,code:s}=y(t,"locale"),a=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=y(l,"outliers");return(c===null||c.length===0)&&(c=["–"]),[l[n],y(l,"whiskers","min")!==null?i(y(l,"whiskers","min"),s):"–",y(l,"quartiles","q_25")!==null?i(y(l,"quartiles","q_25"),s):"–",y(l,"quartiles","q_50")!==null?i(y(l,"quartiles","q_50"),s):"–",y(l,"quartiles","q_75")!==null?i(y(l,"quartiles","q_75"),s):"–",y(l,"whiskers","max")!==null?i(y(l,"whiskers","max"),s):"–",y(l,"quartiles","q_75")!==null&&y(l,"quartiles","q_25")!==null?(i(y(l,"quartiles","q_75")-y(l,"quartiles","q_25")),s):"–",c.map(u=>i(u,s)).join(",")]})];return super.formatTable({headers:a,cells:o})}setColorClassNames(){const t=y(this.getOptions(),"color","pairing");let n=y(t,"option");const r=up.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=ua().range(i).domain(this.allDataGroups)}},jw=class extends lr{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let r=t.ranges.length-1;r>0;r--){const i=t.ranges[r];if(t.value>=i)return n=r,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{number:s,code:a}=y(n,"locale"),o=y(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"–":s(u.value,a),y(u,"marker")===null?"–":s(u.marker,a),y(u,"marker")===null?"–":`${s(Math.floor(u[i]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}},Ww=class extends rn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ve(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ve(n)&&!Ve(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(r=>{this._matrix[r.properties.NAME]=r}),n.forEach(r=>{this._matrix[r.name]?this._matrix[r.name].value=r.value||null:console.warn(`Data point ${r} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],s=[...t.map(a=>[a.id===null?"–":a.id,a.name,a.value===null?"–":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}getColorClassName(t){return`${t.originalClassName||""} ${this._colorScale(t.value)}`}setColorClassNames(){const t=y(this.getOptions(),"color");this._colorScale=Pp(this.getDisplayData(),t)}},qw=class extends rn{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=at({},t,this.getZoomOptions(t));Vl(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:at(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:jt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["–",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}},Yw=class extends rn{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"–":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},Xw=class extends rn{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}},Zw=class extends lr{constructor(t){super(t),this.axisFlavor=gi.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==nt.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==nt.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==nt.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==nt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ge(this.getDisplayData(),r=>r.value),n=je().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(Ve(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(Ve(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(Ve(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=pn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(pn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ve(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=y(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[r.identifier]===null?"–":l[r.identifier],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),r=!Ve(n);let i=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Ul().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=Pp(this.getDisplayData(),l)}},Kw=class extends lr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}};class Qw extends rn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=y(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=y(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=y(t,"meter","proportional")?r:r>100?100:r,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"–":a(d.value,o),...i?[i]:[]]]}else u=y(s,"total")||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let p;h.value!==null&&h.value!==void 0?p=Number(h.value):p=0;const f=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"–":a(p,o),a(f,o)+" %"]})];return super.formatTable({headers:l,cells:c})}}class Jw extends lr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,i)!==null?s(y(u,"data",h,i),a):"–")])];return super.formatTable({headers:l,cells:c})}}let t$=class extends rn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"–"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}};class e$ extends rn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"–":n(o.value,r)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}let n$=class extends rn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}};var r$=/\s/;function i$(e){for(var t=e.length;t--&&r$.test(e.charAt(t)););return t}var s$=/^\s+/;function a$(e){return e&&e.slice(0,i$(e)+1).replace(s$,"")}var Gp=NaN,o$=/^[-+]0x[0-9a-f]+$/i,l$=/^0b[01]+$/i,c$=/^0o[0-7]+$/i,u$=parseInt;function Fr(e){if(typeof e=="number")return e;if(Ls(e))return Gp;if(Ce(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ce(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=a$(e);var n=l$.test(e);return n||c$.test(e)?u$(e.slice(2),n?2:8):o$.test(e)?Gp:+e}var Zl=function(){return Be.Date.now()},h$="Expected a function",d$=Math.max,p$=Math.min;function ga(e,t,n){var r,i,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(h$);t=Fr(t)||0,Ce(n)&&(u=!!n.leading,d="maxWait"in n,s=d?d$(Fr(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function p(S){var M=r,D=i;return r=i=void 0,c=S,a=e.apply(D,M),a}function f(S){return c=S,o=setTimeout(v,t),u?p(S):a}function g(S){var M=S-l,D=S-c,A=t-M;return d?p$(A,s-D):A}function m(S){var M=S-l,D=S-c;return l===void 0||M>=t||M<0||d&&D>=s}function v(){var S=Zl();if(m(S))return x(S);o=setTimeout(v,g(S))}function x(S){return o=void 0,h&&r?p(S):(r=i=void 0,a)}function _(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function E(){return o===void 0?a:x(Zl())}function b(){var S=Zl(),M=m(S);if(r=arguments,i=this,l=S,M){if(o===void 0)return f(l);if(d)return clearTimeout(o),o=setTimeout(v,t),p(l)}return o===void 0&&(o=setTimeout(v,t)),a}return b.cancel=_,b.flush=E,b}function f$(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function I(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],_d)}function Yi(){var e=ua().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var h=t().length,p=i<r,f=p?i:r,g=p?r:i;s=(g-f)/Math.max(1,h-l+c*2),o&&(s=Math.floor(s)),f+=(g-f-s*(h-l))*u,a=s*(1-l),o&&(f=Math.round(f),a=Math.round(a));var m=f$(h).map(function(v){return f+s*v});return n(p?m.reverse():m)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return Yi(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Ur.apply(d(),arguments)}function zp(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}const Kl=new Date,Ql=new Date;function qt(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>qt(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(Kl.setTime(+s),Ql.setTime(+a),e(Kl),e(Ql),Math.floor(n(Kl,Ql))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const va=qt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);va.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):va),va.range;const _n=1e3,ke=_n*60,En=ke*60,On=En*24,Jl=On*7,Fp=On*30,tc=On*365,jr=qt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*_n)},(e,t)=>(t-e)/_n,e=>e.getUTCSeconds());jr.range;const ec=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_n)},(e,t)=>{e.setTime(+e+t*ke)},(e,t)=>(t-e)/ke,e=>e.getMinutes());ec.range,qt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ke)},(e,t)=>(t-e)/ke,e=>e.getUTCMinutes()).range;const nc=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_n-e.getMinutes()*ke)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getHours());nc.range,qt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getUTCHours()).range;const Xi=qt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ke)/On,e=>e.getDate()-1);Xi.range;const rc=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/On,e=>e.getUTCDate()-1);rc.range,qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/On,e=>Math.floor(e/On)).range;function cr(e){return qt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ke)/Jl)}const ya=cr(0),xa=cr(1),m$=cr(2),g$=cr(3),Wr=cr(4),v$=cr(5),y$=cr(6);ya.range,xa.range,m$.range,g$.range,Wr.range,v$.range,y$.range;function ur(e){return qt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Jl)}const jp=ur(0),ba=ur(1),x$=ur(2),b$=ur(3),qr=ur(4),_$=ur(5),E$=ur(6);jp.range,ba.range,x$.range,b$.range,qr.range,_$.range,E$.range;const ic=qt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ic.range,qt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const Sn=qt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Sn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Sn.range;const hr=qt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());hr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),hr.range;function O$(e,t,n,r,i,s){const a=[[jr,1,_n],[jr,5,5*_n],[jr,15,15*_n],[jr,30,30*_n],[s,1,ke],[s,5,5*ke],[s,15,15*ke],[s,30,30*ke],[i,1,En],[i,3,3*En],[i,6,6*En],[i,12,12*En],[r,1,On],[r,2,2*On],[n,1,Jl],[t,1,Fp],[t,3,3*Fp],[e,1,tc]];function o(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const p=d&&typeof d.range=="function"?d:l(c,u,d),f=p?p.range(c,+u+1):[];return h?f.reverse():f}function l(c,u,d){const h=Math.abs(u-c)/d,p=fl(([,,m])=>m).right(a,h);if(p===a.length)return e.every(gl(c/tc,u/tc,d));if(p===0)return va.every(Math.max(gl(c,u,d),1));const[f,g]=a[h/a[p-1][2]<a[p][2]/h?p-1:p];return f.every(g)}return[o,l]}const[S$,T$]=O$(Sn,ic,ya,Xi,nc,ec);function sc(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ac(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Zi(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function w$(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=Ki(i),u=Qi(i),d=Ki(s),h=Qi(s),p=Ki(a),f=Qi(a),g=Ki(o),m=Qi(o),v=Ki(l),x=Qi(l),_={a:L,A:k,b:U,B:K,c:null,d:Kp,e:Kp,f:X$,g:sM,G:oM,H:W$,I:q$,j:Y$,L:Qp,m:Z$,M:K$,p:W,q:j,Q:sf,s:af,S:Q$,u:J$,U:tM,V:eM,w:nM,W:rM,x:null,X:null,y:iM,Y:aM,Z:lM,"%":rf},E={a:X,A:ct,b:J,B:Y,c:null,d:tf,e:tf,f:dM,g:EM,G:SM,H:cM,I:uM,j:hM,L:ef,m:pM,M:fM,p:et,q:ut,Q:sf,s:af,S:mM,u:gM,U:vM,V:yM,w:xM,W:bM,x:null,X:null,y:_M,Y:OM,Z:TM,"%":rf},b={a:R,A:$,b:H,B:P,c:B,d:Xp,e:Xp,f:G$,g:Yp,G:qp,H:Zp,I:Zp,j:U$,L:V$,m:P$,M:B$,p:A,q:N$,Q:F$,s:j$,S:H$,u:L$,U:k$,V:D$,w:A$,W:R$,x:O,X:w,y:Yp,Y:qp,Z:I$,"%":z$};_.x=S(n,_),_.X=S(r,_),_.c=S(t,_),E.x=S(n,E),E.X=S(r,E),E.c=S(t,E);function S(F,q){return function(Z){var G=[],dt=-1,ot=0,It=F.length,Ht,rt,Et;for(Z instanceof Date||(Z=new Date(+Z));++dt<It;)F.charCodeAt(dt)===37&&(G.push(F.slice(ot,dt)),(rt=Wp[Ht=F.charAt(++dt)])!=null?Ht=F.charAt(++dt):rt=Ht==="e"?" ":"0",(Et=q[Ht])&&(Ht=Et(Z,rt)),G.push(Ht),ot=dt+1);return G.push(F.slice(ot,dt)),G.join("")}}function M(F,q){return function(Z){var G=Zi(1900,void 0,1),dt=D(G,F,Z+="",0),ot,It;if(dt!=Z.length)return null;if("Q"in G)return new Date(G.Q);if("s"in G)return new Date(G.s*1e3+("L"in G?G.L:0));if(q&&!("Z"in G)&&(G.Z=0),"p"in G&&(G.H=G.H%12+G.p*12),G.m===void 0&&(G.m="q"in G?G.q:0),"V"in G){if(G.V<1||G.V>53)return null;"w"in G||(G.w=1),"Z"in G?(ot=ac(Zi(G.y,0,1)),It=ot.getUTCDay(),ot=It>4||It===0?ba.ceil(ot):ba(ot),ot=rc.offset(ot,(G.V-1)*7),G.y=ot.getUTCFullYear(),G.m=ot.getUTCMonth(),G.d=ot.getUTCDate()+(G.w+6)%7):(ot=sc(Zi(G.y,0,1)),It=ot.getDay(),ot=It>4||It===0?xa.ceil(ot):xa(ot),ot=Xi.offset(ot,(G.V-1)*7),G.y=ot.getFullYear(),G.m=ot.getMonth(),G.d=ot.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),It="Z"in G?ac(Zi(G.y,0,1)).getUTCDay():sc(Zi(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(It+5)%7:G.w+G.U*7-(It+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,ac(G)):sc(G)}}function D(F,q,Z,G){for(var dt=0,ot=q.length,It=Z.length,Ht,rt;dt<ot;){if(G>=It)return-1;if(Ht=q.charCodeAt(dt++),Ht===37){if(Ht=q.charAt(dt++),rt=b[Ht in Wp?q.charAt(dt++):Ht],!rt||(G=rt(F,Z,G))<0)return-1}else if(Ht!=Z.charCodeAt(G++))return-1}return G}function A(F,q,Z){var G=c.exec(q.slice(Z));return G?(F.p=u.get(G[0].toLowerCase()),Z+G[0].length):-1}function R(F,q,Z){var G=p.exec(q.slice(Z));return G?(F.w=f.get(G[0].toLowerCase()),Z+G[0].length):-1}function $(F,q,Z){var G=d.exec(q.slice(Z));return G?(F.w=h.get(G[0].toLowerCase()),Z+G[0].length):-1}function H(F,q,Z){var G=v.exec(q.slice(Z));return G?(F.m=x.get(G[0].toLowerCase()),Z+G[0].length):-1}function P(F,q,Z){var G=g.exec(q.slice(Z));return G?(F.m=m.get(G[0].toLowerCase()),Z+G[0].length):-1}function B(F,q,Z){return D(F,t,q,Z)}function O(F,q,Z){return D(F,n,q,Z)}function w(F,q,Z){return D(F,r,q,Z)}function L(F){return a[F.getDay()]}function k(F){return s[F.getDay()]}function U(F){return l[F.getMonth()]}function K(F){return o[F.getMonth()]}function W(F){return i[+(F.getHours()>=12)]}function j(F){return 1+~~(F.getMonth()/3)}function X(F){return a[F.getUTCDay()]}function ct(F){return s[F.getUTCDay()]}function J(F){return l[F.getUTCMonth()]}function Y(F){return o[F.getUTCMonth()]}function et(F){return i[+(F.getUTCHours()>=12)]}function ut(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var q=S(F+="",_);return q.toString=function(){return F},q},parse:function(F){var q=M(F+="",!1);return q.toString=function(){return F},q},utcFormat:function(F){var q=S(F+="",E);return q.toString=function(){return F},q},utcParse:function(F){var q=M(F+="",!0);return q.toString=function(){return F},q}}}var Wp={"-":"",_:" ",0:"0"},Yt=/^\s*\d+/,$$=/^%/,M$=/[\\^$*+?|[\]().{}]/g;function xt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function C$(e){return e.replace(M$,"\\$&")}function Ki(e){return new RegExp("^(?:"+e.map(C$).join("|")+")","i")}function Qi(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function A$(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function L$(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function k$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function D$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function R$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function qp(e,t,n){var r=Yt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Yp(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function I$(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function N$(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function P$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Xp(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function U$(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Zp(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function B$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function H$(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function V$(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function G$(e,t,n){var r=Yt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function z$(e,t,n){var r=$$.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function F$(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function j$(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Kp(e,t){return xt(e.getDate(),t,2)}function W$(e,t){return xt(e.getHours(),t,2)}function q$(e,t){return xt(e.getHours()%12||12,t,2)}function Y$(e,t){return xt(1+Xi.count(Sn(e),e),t,3)}function Qp(e,t){return xt(e.getMilliseconds(),t,3)}function X$(e,t){return Qp(e,t)+"000"}function Z$(e,t){return xt(e.getMonth()+1,t,2)}function K$(e,t){return xt(e.getMinutes(),t,2)}function Q$(e,t){return xt(e.getSeconds(),t,2)}function J$(e){var t=e.getDay();return t===0?7:t}function tM(e,t){return xt(ya.count(Sn(e)-1,e),t,2)}function Jp(e){var t=e.getDay();return t>=4||t===0?Wr(e):Wr.ceil(e)}function eM(e,t){return e=Jp(e),xt(Wr.count(Sn(e),e)+(Sn(e).getDay()===4),t,2)}function nM(e){return e.getDay()}function rM(e,t){return xt(xa.count(Sn(e)-1,e),t,2)}function iM(e,t){return xt(e.getFullYear()%100,t,2)}function sM(e,t){return e=Jp(e),xt(e.getFullYear()%100,t,2)}function aM(e,t){return xt(e.getFullYear()%1e4,t,4)}function oM(e,t){var n=e.getDay();return e=n>=4||n===0?Wr(e):Wr.ceil(e),xt(e.getFullYear()%1e4,t,4)}function lM(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+xt(t/60|0,"0",2)+xt(t%60,"0",2)}function tf(e,t){return xt(e.getUTCDate(),t,2)}function cM(e,t){return xt(e.getUTCHours(),t,2)}function uM(e,t){return xt(e.getUTCHours()%12||12,t,2)}function hM(e,t){return xt(1+rc.count(hr(e),e),t,3)}function ef(e,t){return xt(e.getUTCMilliseconds(),t,3)}function dM(e,t){return ef(e,t)+"000"}function pM(e,t){return xt(e.getUTCMonth()+1,t,2)}function fM(e,t){return xt(e.getUTCMinutes(),t,2)}function mM(e,t){return xt(e.getUTCSeconds(),t,2)}function gM(e){var t=e.getUTCDay();return t===0?7:t}function vM(e,t){return xt(jp.count(hr(e)-1,e),t,2)}function nf(e){var t=e.getUTCDay();return t>=4||t===0?qr(e):qr.ceil(e)}function yM(e,t){return e=nf(e),xt(qr.count(hr(e),e)+(hr(e).getUTCDay()===4),t,2)}function xM(e){return e.getUTCDay()}function bM(e,t){return xt(ba.count(hr(e)-1,e),t,2)}function _M(e,t){return xt(e.getUTCFullYear()%100,t,2)}function EM(e,t){return e=nf(e),xt(e.getUTCFullYear()%100,t,2)}function OM(e,t){return xt(e.getUTCFullYear()%1e4,t,4)}function SM(e,t){var n=e.getUTCDay();return e=n>=4||n===0?qr(e):qr.ceil(e),xt(e.getUTCFullYear()%1e4,t,4)}function TM(){return"+0000"}function rf(){return"%"}function sf(e){return+e}function af(e){return Math.floor(+e/1e3)}var Yr,of;wM({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function wM(e){return Yr=w$(e),of=Yr.format,Yr.parse,Yr.utcFormat,Yr.utcParse,Yr}function $M(e){return new Date(e)}function MM(e){return e instanceof Date?+e:+new Date(+e)}function lf(e,t,n,r,i,s,a,o,l,c){var u=lp(),d=u.invert,h=u.domain,p=c(".%L"),f=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),x=c("%b %d"),_=c("%B"),E=c("%Y");function b(S){return(l(S)<S?p:o(S)<S?f:a(S)<S?g:s(S)<S?m:r(S)<S?i(S)<S?v:x:n(S)<S?_:E)(S)}return u.invert=function(S){return new Date(d(S))},u.domain=function(S){return arguments.length?h(Array.from(S,MM)):h().map($M)},u.ticks=function(S){var M=h();return e(M[0],M[M.length-1],S??10)},u.tickFormat=function(S,M){return M==null?b:c(M)},u.nice=function(S){var M=h();return(!S||typeof S.range!="function")&&(S=t(M[0],M[M.length-1],S??10)),S?h(zp(M,S)):u},u.copy=function(){return Pl(u,lf(e,t,n,r,i,s,a,o,l,c))},u}function cf(){return Ur.apply(lf(S$,T$,Sn,ic,ya,Xi,nc,ec,jr,of).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}const uf=Math.abs,te=Math.atan2,dr=Math.cos,CM=Math.max,oc=Math.min,sn=Math.sin,Xr=Math.sqrt,ee=1e-12,Ji=Math.PI,_a=Ji/2,Ea=2*Ji;function AM(e){return e>1?0:e<-1?Ji:Math.acos(e)}function hf(e){return e>=1?_a:e<=-1?-_a:Math.asin(e)}function df(e){this._context=e}df.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Oa(e){return new df(e)}function Bn(){}function pf(e){this._context=e}pf.prototype={areaStart:Bn,areaEnd:Bn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ff(e){return new pf(e)}function LM(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const kM=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Tn(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Sa(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function DM(e){const t=Sa(e,"border-left-width"),n=Sa(e,"border-right-width");return e.clientWidth+t+n}function RM(e){const t=Sa(e,"border-top-width"),n=Sa(e,"border-bottom-width");return e.clientHeight+t+n}function mf(e,t={}){const n=t.width||DM(e),r=t.height||RM(e);return{width:n,height:r}}function IM(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const _e=16384;function NM(e){(e.width>_e||e.height>_e)&&(e.width>_e&&e.height>_e?e.width>e.height?(e.height*=_e/e.width,e.width=_e):(e.width*=_e/e.height,e.height=_e):e.width>_e?(e.height*=_e/e.width,e.width=_e):(e.width*=_e/e.height,e.height=_e))}function Ta(e){return new Promise((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function PM(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function UM(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(e),PM(i)}const pe=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||pe(n,t)};function BM(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function HM(e){return Tn(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function VM(e,t,n){const r=`.${e}:${t}`,i=n.cssText?BM(n):HM(n);return document.createTextNode(`${r}{${i}}`)}function gf(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=kM();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(VM(s,n,r)),t.appendChild(a)}function GM(e,t){gf(e,t,":before"),gf(e,t,":after")}const vf="application/font-woff",yf="image/jpeg",zM={woff:vf,woff2:vf,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:yf,jpeg:yf,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function FM(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function lc(e){const t=FM(e).toLowerCase();return zM[t]||""}function jM(e){return e.split(/,/)[1]}function cc(e){return e.search(/^(data:)/)!==-1}function WM(e,t){return`data:${t};base64,${e}`}async function xf(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:r,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const uc={};function qM(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function hc(e,t,n){const r=qM(e,t,n.includeQueryParams);if(uc[r]!=null)return uc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await xf(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),jM(o)));i=WM(s,t)}catch(s){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return uc[r]=i,i}async function YM(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ta(t)}async function XM(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a==null||a.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return Ta(o)}const n=e.poster,r=lc(n),i=await hc(n,r,t);return Ta(i)}async function ZM(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await wa(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function KM(e,t){return pe(e,HTMLCanvasElement)?YM(e):pe(e,HTMLVideoElement)?XM(e,t):pe(e,HTMLIFrameElement)?ZM(e):e.cloneNode(!1)}const QM=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function JM(e,t,n){var r,i;let s=[];return QM(e)&&e.assignedNodes?s=Tn(e.assignedNodes()):pe(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=Tn(e.contentDocument.body.childNodes):s=Tn(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||pe(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>wa(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function t2(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Tn(r).forEach(i=>{let s=r.getPropertyValue(i);i==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),pe(e,HTMLIFrameElement)&&i==="display"&&s==="inline"&&(s="block"),i==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),n.setProperty(i,s,r.getPropertyPriority(i))})}function e2(e,t){pe(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),pe(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function n2(e,t){if(pe(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function r2(e,t){return pe(t,Element)&&(t2(e,t),GM(e,t),e2(e,t),n2(e,t)),t}async function i2(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const a=n[s].getAttribute("xlink:href");if(a){const o=e.querySelector(a),l=document.querySelector(a);!o&&l&&!r[a]&&(r[a]=await wa(l,t,!0))}}const i=Object.values(r);if(i.length){const s="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg");a.setAttribute("xmlns",s),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const o=document.createElementNS(s,"defs");a.appendChild(o);for(let l=0;l<i.length;l++)o.appendChild(i[l]);e.appendChild(a)}return e}async function wa(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>KM(r,t)).then(r=>JM(e,r,t)).then(r=>r2(e,r)).then(r=>i2(r,t))}const bf=/url\((['"]?)([^'"]+?)\1\)/g,s2=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,a2=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function o2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function l2(e){const t=[];return e.replace(bf,(n,r,i)=>(t.push(i),n)),t.filter(n=>!cc(n))}async function c2(e,t,n,r,i){try{const s=n?LM(t,n):t,a=lc(t);let o;return i||(o=await hc(s,a,r)),e.replace(o2(t),`$1${o}$3`)}catch{}return e}function u2(e,{preferredFontFormat:t}){return t?e.replace(a2,n=>{for(;;){const[r,,i]=s2.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function _f(e){return e.search(bf)!==-1}async function Ef(e,t,n){if(!_f(e))return e;const r=u2(e,n);return l2(r).reduce((i,s)=>i.then(a=>c2(a,s,t,n)),Promise.resolve(r))}async function $a(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Ef(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function h2(e,t){await $a("background",e,t)||await $a("background-image",e,t),await $a("mask",e,t)||await $a("mask-image",e,t)}async function d2(e,t){const n=pe(e,HTMLImageElement);if(!(n&&!cc(e.src))&&!(pe(e,SVGImageElement)&&!cc(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await hc(r,lc(r),t);await new Promise((s,a)=>{e.onload=s,e.onerror=a;const o=e;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function p2(e,t){const n=Tn(e.childNodes).map(r=>Of(r,t));await Promise.all(n).then(()=>e)}async function Of(e,t){pe(e,Element)&&(await h2(e,t),await d2(e,t),await p2(e,t))}function f2(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const Sf={};async function Tf(e){let t=Sf[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Sf[e]=t,t}async function wf(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),xf(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function $f(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(r);if(l===null){if(l=o.exec(r),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function m2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Tn(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Tf(l).then(u=>wf(u,t)).then(u=>$f(u).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:d,error:h})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(Tf(i.href).then(o=>wf(o,t)).then(o=>$f(o).forEach(l=>{a.insertRule(l,i.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{Tn(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function g2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>_f(t.style.getPropertyValue("src")))}async function v2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Tn(e.ownerDocument.styleSheets),r=await m2(n,t);return g2(r)}async function y2(e,t){const n=await v2(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return Ef(r.cssText,i,t)}))).join(`
|
|
3
3
|
`)}async function x2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await y2(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function b2(e,t={}){const{width:n,height:r}=mf(e,t),i=await wa(e,t,!0);return await x2(i,t),await Of(i,t),f2(i,t),await UM(i,n,r)}async function Mf(e,t={}){const{width:n,height:r}=mf(e,t),i=await b2(e,t),s=await Ta(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||IM(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||NM(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function _2(e,t={}){return(await Mf(e,t)).toDataURL()}async function E2(e,t={}){return(await Mf(e,t)).toDataURL("image/jpeg",t.quality||1)}let wn=class{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}};const O2="DONT_STYLE_ME_css_styles_verifier";let N=class Uu extends wn{constructor(t,n){super(t,n)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=I(t));const r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(p=>{if(h[p]){const f=h[p],g=parseFloat(f);f&&g>r[p]&&(""+f).indexOf("%")===-1&&(r[p]=g)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(d),r.width>0&&r.height>0))return d;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const h={width:y(t.node(),"width","baseVal","value"),height:y(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=y(t,"style","prefix"),r=I(this.getHolder()).append("div").classed(`${de}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",O2),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),I(this.getHolder()).classed(`${de}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),E2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=y(n,"fileDownload","fileName");typeof l=="function"?o=l("jpg"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),_2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var a;let o="myChart";const l=y(n,"fileDownload","fileName");typeof l=="function"?o=l("png"):typeof l=="string"&&(o=l),(a=t.services.files)==null||a.downloadImage(s,`${o}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return I(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();I(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=I(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=Uu.getSVGElementSize(I(this.mainContainer),{useBBox:!0}),n=I(this.mainContainer).attr("class"),r=I(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(Uu.getSVGElementSize(I(s),{useBBox:!0}).height)}),i<=t?I(this.mainContainer).attr("height",i):I(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&I(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=ga(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(T.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},dc=class t0 extends wn{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:t0.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function Cf(e){const t=S2(Af(e),360);return Hn(t,[0,10])||Hn(t,[350,0])?{textAnchor:Ke.START,dominantBaseline:Qe.MIDDLE}:Hn(t,[10,80])?{textAnchor:Ke.START,dominantBaseline:Qe.HANGING}:Hn(t,[80,100])?{textAnchor:Ke.MIDDLE,dominantBaseline:Qe.HANGING}:Hn(t,[100,170])?{textAnchor:Ke.END,dominantBaseline:Qe.HANGING}:Hn(t,[170,190])?{textAnchor:Ke.END,dominantBaseline:Qe.MIDDLE}:Hn(t,[190,260])?{textAnchor:Ke.END,dominantBaseline:Qe.BASELINE}:Hn(t,[260,280])?{textAnchor:Ke.MIDDLE,dominantBaseline:Qe.BASELINE}:{textAnchor:Ke.START,dominantBaseline:Qe.BASELINE}}function S2(e,t){return(e%t+t)%t}function Hn(e,[t,n]){return e>=t&&e<=n}function Af(e){return e*(180/Math.PI)}function Ut(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function T2(e,t){return t*Math.sin(e-Math.PI/2)}function w2(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;)n=t(n,e[i],i,e);return n}function $2(e){return function(t){return e==null?void 0:e[t]}}var M2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},C2=$2(M2),A2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,L2="\\u0300-\\u036f",k2="\\ufe20-\\ufe2f",D2="\\u20d0-\\u20ff",R2=L2+k2+D2,I2="["+R2+"]",N2=RegExp(I2,"g");function P2(e){return e=$i(e),e&&e.replace(A2,C2).replace(N2,"")}var U2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function B2(e){return e.match(U2)||[]}var H2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function V2(e){return H2.test(e)}var Lf="\\ud800-\\udfff",G2="\\u0300-\\u036f",z2="\\ufe20-\\ufe2f",F2="\\u20d0-\\u20ff",j2=G2+z2+F2,kf="\\u2700-\\u27bf",Df="a-z\\xdf-\\xf6\\xf8-\\xff",W2="\\xac\\xb1\\xd7\\xf7",q2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Y2="\\u2000-\\u206f",X2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rf="A-Z\\xc0-\\xd6\\xd8-\\xde",Z2="\\ufe0e\\ufe0f",If=W2+q2+Y2+X2,Nf="['’]",Pf="["+If+"]",K2="["+j2+"]",Uf="\\d+",Q2="["+kf+"]",Bf="["+Df+"]",Hf="[^"+Lf+If+Uf+kf+Df+Rf+"]",J2="\\ud83c[\\udffb-\\udfff]",tC="(?:"+K2+"|"+J2+")",eC="[^"+Lf+"]",Vf="(?:\\ud83c[\\udde6-\\uddff]){2}",Gf="[\\ud800-\\udbff][\\udc00-\\udfff]",Zr="["+Rf+"]",nC="\\u200d",zf="(?:"+Bf+"|"+Hf+")",rC="(?:"+Zr+"|"+Hf+")",Ff="(?:"+Nf+"(?:d|ll|m|re|s|t|ve))?",jf="(?:"+Nf+"(?:D|LL|M|RE|S|T|VE))?",Wf=tC+"?",qf="["+Z2+"]?",iC="(?:"+nC+"(?:"+[eC,Vf,Gf].join("|")+")"+qf+Wf+")*",sC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",aC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",oC=qf+Wf+iC,lC="(?:"+[Q2,Vf,Gf].join("|")+")"+oC,cC=RegExp([Zr+"?"+Bf+"+"+Ff+"(?="+[Pf,Zr,"$"].join("|")+")",rC+"+"+jf+"(?="+[Pf,Zr+zf,"$"].join("|")+")",Zr+"?"+zf+"+"+Ff,Zr+"+"+jf,aC,sC,Uf,lC].join("|"),"g");function uC(e){return e.match(cC)||[]}function hC(e,t,n){return e=$i(e),t=t,t===void 0?V2(e)?uC(e):B2(e):e.match(t)||[]}var dC="['’]",pC=RegExp(dC,"g");function Yf(e){return function(t){return w2(hC(P2(t).replace(pC,"")),e,"")}}function fC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Xf(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Fr(n),n=n===n?n:0),t!==void 0&&(t=Fr(t),t=t===t?t:0),fC(Fr(e),t,n)}var mC="Expected a function";function gC(e,t,n){if(typeof e!="function")throw new TypeError(mC);return setTimeout(function(){e.apply(void 0,n)},t)}var vC=Xo(function(e,t,n){return gC(e,Fr(t)||0,n)});function yC(e,t){var n=-1,r=Kn(e)?Array(e.length):[];return Wl(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function xC(e,t){var n=Zt(e)?zo:yC;return n(e,zs(t))}var bC=1/0;function _C(e,t){return Bs(xC(e,t),bC)}function Zf(e,t){return Gs(e,t)}var Kr=Yf(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function EC(e,t){var n;return Wl(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function OC(e,t,n){var r=Zt(e)?qh:EC;return r(e,zs(t))}class pr{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=n[i],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[r++]=o),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,s,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}function*SC(e){for(const t of e)yield*t}function Kf(e){return Array.from(SC(e))}function TC(e){return e}var Ma=1,Ca=2,pc=3,ts=4,Qf=1e-6;function wC(e){return"translate("+e+",0)"}function $C(e){return"translate(0,"+e+")"}function MC(e){return t=>+e(t)}function CC(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function AC(){return!this.__axis}function Aa(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Ma||e===ts?-1:1,u=e===ts||e===Ca?"x":"y",d=e===Ma||e===pc?wC:$C;function h(p){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):TC),m=Math.max(s,0)+o,v=t.range(),x=+v[0]+l,_=+v[v.length-1]+l,E=(t.bandwidth?CC:MC)(t.copy(),l),b=p.selection?p.selection():p,S=b.selectAll(".domain").data([null]),M=b.selectAll(".tick").data(f,t).order(),D=M.exit(),A=M.enter().append("g").attr("class","tick"),R=M.select("line"),$=M.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge(A),R=R.merge(A.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),$=$.merge(A.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ma?"0em":e===pc?"0.71em":"0.32em")),p!==b&&(S=S.transition(p),M=M.transition(p),R=R.transition(p),$=$.transition(p),D=D.transition(p).attr("opacity",Qf).attr("transform",function(H){return isFinite(H=E(H))?d(H+l):this.getAttribute("transform")}),A.attr("opacity",Qf).attr("transform",function(H){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(H))?P:E(H))+l)})),D.remove(),S.attr("d",e===ts||e===Ca?a?"M"+c*a+","+x+"H"+l+"V"+_+"H"+c*a:"M"+l+","+x+"V"+_:a?"M"+x+","+c*a+"V"+l+"H"+_+"V"+c*a:"M"+x+","+l+"H"+_),M.attr("opacity",1).attr("transform",function(H){return d(E(H)+l)}),R.attr(u+"2",c*s),$.attr(u,c*m).text(g),b.filter(AC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Ca?"start":e===ts?"end":"middle"),b.each(function(){this.__axis=E})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(s=a=+p,h):s},h.tickSizeInner=function(p){return arguments.length?(s=+p,h):s},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(o=+p,h):o},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function LC(e){return Aa(Ma,e)}function kC(e){return Aa(Ca,e)}function fc(e){return Aa(pc,e)}function Jf(e){return Aa(ts,e)}const mc={capture:!0,passive:!1};function gc(e){e.preventDefault(),e.stopImmediatePropagation()}function DC(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",gc,mc);"onselectstart"in t?n.on("selectstart.drag",gc,mc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function RC(e,t){var n=e.document.documentElement,r=I(e).on("dragstart.drag",null);t&&(r.on("click.drag",gc,mc),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function IC(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const NC=e=>+e,vc=e=>()=>e;function PC(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function UC(e){e.stopImmediatePropagation()}function yc(e){e.preventDefault(),e.stopImmediatePropagation()}var tm={name:"drag"},xc={name:"space"},Qr={name:"handle"},Jr={name:"center"};const{abs:em,max:ne,min:re}=Math;function nm(e){return[+e[0],+e[1]]}function rm(e){return[nm(e[0]),nm(e[1])]}var La={name:"x",handles:["w","e"].map(_c),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},bc={},$n={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},im={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},sm={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},BC={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},HC={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function _c(e){return{type:e}}function VC(e){return!e.ctrlKey&&!e.button}function GC(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function zC(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ec(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function FC(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function am(){return jC(La)}function jC(e){var t=GC,n=VC,r=zC,i=!0,s=vl("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([_c("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",$n.overlay).merge(v).each(function(){var _=Ec(this).extent;I(this).attr("x",_[0][0]).attr("y",_[0][1]).attr("width",_[1][0]-_[0][0]).attr("height",_[1][1]-_[0][1])}),m.selectAll(".selection").data([_c("selection")]).enter().append("rect").attr("class","selection").attr("cursor",$n.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var x=m.selectAll(".handle").data(e.handles,function(_){return _.type});x.exit().remove(),x.enter().append("rect").attr("class",function(_){return"handle handle--"+_.type}).attr("cursor",function(_){return $n[_.type]}),m.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",f).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,v,x){m.tween?m.on("start.brush",function(_){u(this,arguments).beforestart().start(_)}).on("interrupt.brush end.brush",function(_){u(this,arguments).end(_)}).tween("brush",function(){var _=this,E=_.__brush,b=u(_,arguments),S=E.selection,M=e.input(typeof v=="function"?v.apply(this,arguments):v,E.extent),D=Ni(S,M);function A(R){E.selection=R===1&&M===null?null:D(R),c.call(_),b.brush()}return S!==null&&M!==null?A:A(1)}):m.each(function(){var _=this,E=arguments,b=_.__brush,S=e.input(typeof v=="function"?v.apply(_,E):v,b.extent),M=u(_,E).beforestart();kl(_),b.selection=S===null?null:S,c.call(_),M.start(x).brush(x).end(x)})},l.clear=function(m,v){l.move(m,null,v)};function c(){var m=I(this),v=Ec(this).selection;v?(m.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(x){return x.type[x.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(x){return x.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(x){return x.type==="n"||x.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(x){return x.type==="e"||x.type==="w"?v[1][1]-v[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,v,x){var _=m.__brush.emitter;return _&&(!x||!_.clean)?_:new d(m,v,x)}function d(m,v,x){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=x}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,x){var _=I(this.that).datum();s.call(m,this.that,new PC(m,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:x,dispatch:s}),_)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,x=m.target.__data__.type,_=(i&&m.metaKey?x="overlay":x)==="selection"?tm:i&&m.altKey?Jr:Qr,E=e===bc?null:BC[x],b=e===La?null:HC[x],S=Ec(v),M=S.extent,D=S.selection,A=M[0][0],R,$,H=M[0][1],P,B,O=M[1][0],w,L,k=M[1][1],U,K,W=0,j=0,X,ct=E&&b&&i&&m.shiftKey,J,Y,et=Array.from(m.touches||[m],rt=>{const Et=rt.identifier;return rt=er(rt,v),rt.point0=rt.slice(),rt.identifier=Et,rt});kl(v);var ut=u(v,arguments,!0).beforestart();if(x==="overlay"){D&&(X=!0);const rt=[et[0],et[1]||et[0]];S.selection=D=[[R=e===bc?A:re(rt[0][0],rt[1][0]),P=e===La?H:re(rt[0][1],rt[1][1])],[w=e===bc?O:ne(rt[0][0],rt[1][0]),U=e===La?k:ne(rt[0][1],rt[1][1])]],et.length>1&&dt(m)}else R=D[0][0],P=D[0][1],w=D[1][0],U=D[1][1];$=R,B=P,L=w,K=U;var F=I(v).attr("pointer-events","none"),q=F.selectAll(".overlay").attr("cursor",$n[x]);if(m.touches)ut.moved=G,ut.ended=ot;else{var Z=I(m.view).on("mousemove.brush",G,!0).on("mouseup.brush",ot,!0);i&&Z.on("keydown.brush",It,!0).on("keyup.brush",Ht,!0),DC(m.view)}c.call(v),ut.start(m,_.name);function G(rt){for(const Et of rt.changedTouches||[rt])for(const Ne of et)Ne.identifier===Et.identifier&&(Ne.cur=er(Et,v));if(ct&&!J&&!Y&&et.length===1){const Et=et[0];em(Et.cur[0]-Et[0])>em(Et.cur[1]-Et[1])?Y=!0:J=!0}for(const Et of et)Et.cur&&(Et[0]=Et.cur[0],Et[1]=Et.cur[1]);X=!0,yc(rt),dt(rt)}function dt(rt){const Et=et[0],Ne=Et.point0;var Te;switch(W=Et[0]-Ne[0],j=Et[1]-Ne[1],_){case xc:case tm:{E&&(W=ne(A-R,re(O-w,W)),$=R+W,L=w+W),b&&(j=ne(H-P,re(k-U,j)),B=P+j,K=U+j);break}case Qr:{et[1]?(E&&($=ne(A,re(O,et[0][0])),L=ne(A,re(O,et[1][0])),E=1),b&&(B=ne(H,re(k,et[0][1])),K=ne(H,re(k,et[1][1])),b=1)):(E<0?(W=ne(A-R,re(O-R,W)),$=R+W,L=w):E>0&&(W=ne(A-w,re(O-w,W)),$=R,L=w+W),b<0?(j=ne(H-P,re(k-P,j)),B=P+j,K=U):b>0&&(j=ne(H-U,re(k-U,j)),B=P,K=U+j));break}case Jr:{E&&($=ne(A,re(O,R-W*E)),L=ne(A,re(O,w+W*E))),b&&(B=ne(H,re(k,P-j*b)),K=ne(H,re(k,U+j*b)));break}}L<$&&(E*=-1,Te=R,R=w,w=Te,Te=$,$=L,L=Te,x in im&&q.attr("cursor",$n[x=im[x]])),K<B&&(b*=-1,Te=P,P=U,U=Te,Te=B,B=K,K=Te,x in sm&&q.attr("cursor",$n[x=sm[x]])),S.selection&&(D=S.selection),J&&($=D[0][0],L=D[1][0]),Y&&(B=D[0][1],K=D[1][1]),(D[0][0]!==$||D[0][1]!==B||D[1][0]!==L||D[1][1]!==K)&&(S.selection=[[$,B],[L,K]],c.call(v),ut.brush(rt,_.name))}function ot(rt){if(UC(rt),rt.touches){if(rt.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else RC(rt.view,X),Z.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);F.attr("pointer-events","all"),q.attr("cursor",$n.overlay),S.selection&&(D=S.selection),FC(D)&&(S.selection=null,c.call(v)),ut.end(rt,_.name)}function It(rt){switch(rt.keyCode){case 16:{ct=E&&b;break}case 18:{_===Qr&&(E&&(w=L-W*E,R=$+W*E),b&&(U=K-j*b,P=B+j*b),_=Jr,dt(rt));break}case 32:{(_===Qr||_===Jr)&&(E<0?w=L-W:E>0&&(R=$-W),b<0?U=K-j:b>0&&(P=B-j),_=xc,q.attr("cursor",$n.selection),dt(rt));break}default:return}yc(rt)}function Ht(rt){switch(rt.keyCode){case 16:{ct&&(J=Y=ct=!1,dt(rt));break}case 18:{_===Jr&&(E<0?w=L:E>0&&(R=$),b<0?U=K:b>0&&(P=B),_=Qr,dt(rt));break}case 32:{_===xc&&(rt.altKey?(E&&(w=L-W*E,R=$+W*E),b&&(U=K-j*b,P=B+j*b),_=Jr):(E<0?w=L:E>0&&(R=$),b<0?U=K:b>0&&(P=B),_=Qr),q.attr("cursor",$n[x]),dt(rt));break}default:return}yc(rt)}}function p(m){u(this,arguments).moved(m)}function f(m){u(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=rm(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:vc(rm(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:vc(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:vc(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const Oc=Math.PI,Sc=2*Oc,fr=1e-6,WC=Sc-fr;function om(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function qC(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return om;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let Tc=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?om:qC(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,u=a-t,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>fr)if(!(Math.abs(d*l-c*u)>fr)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,f=i-o,g=l*l+c*c,m=p*p+f*f,v=Math.sqrt(g),x=Math.sqrt(h),_=s*Math.tan((Oc-Math.acos((g+h-m)/(2*v*x)))/2),E=_/x,b=_/v;Math.abs(E-1)>fr&&this._append`L${t+E*u},${n+E*d}`,this._append`A${s},${s},0,0,${+(d*p>u*f)},${this._x1=t+b*l},${this._y1=n+b*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,d=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>fr||Math.abs(this._y1-u)>fr)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%Sc+Sc),h>WC?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>fr&&this._append`A${r},${r},0,${+(h>=Oc)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function lm(){return new Tc}lm.prototype=Tc.prototype;var wt=1e-6,YC=1e-12,mt=Math.PI,fe=mt/2,cm=mt/4,Ee=mt*2,se=180/mt,Bt=mt/180,St=Math.abs,um=Math.atan,mr=Math.atan2,$t=Math.cos,XC=Math.exp,ZC=Math.log,_t=Math.sin,Vn=Math.sign||function(e){return e>0?1:e<0?-1:0},qe=Math.sqrt,KC=Math.tan;function QC(e){return e>1?0:e<-1?mt:Math.acos(e)}function Mn(e){return e>1?fe:e<-1?-fe:Math.asin(e)}function De(){}function ka(e,t){e&&dm.hasOwnProperty(e.type)&&dm[e.type](e,t)}var hm={Feature:function(e,t){ka(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)ka(n[r].geometry,t)}},dm={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){wc(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)wc(n[r],t,0)},Polygon:function(e,t){pm(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)pm(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)ka(n[r],t)}};function wc(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function pm(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)wc(e[n],t,1);t.polygonEnd()}function ti(e,t){e&&hm.hasOwnProperty(e.type)?hm[e.type](e,t):ka(e,t)}function $c(e){return[mr(e[1],e[0]),Mn(e[2])]}function ei(e){var t=e[0],n=e[1],r=$t(n);return[r*$t(t),r*_t(t),_t(n)]}function Da(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ra(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Mc(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ia(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Cc(e){var t=qe(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Ac(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function Lc(e,t){return St(e)>mt&&(e-=Math.round(e/Ee)*Ee),[e,t]}Lc.invert=Lc;function fm(e,t,n){return(e%=Ee)?t||n?Ac(gm(e),vm(t,n)):gm(e):t||n?vm(t,n):Lc}function mm(e){return function(t,n){return t+=e,St(t)>mt&&(t-=Math.round(t/Ee)*Ee),[t,n]}}function gm(e){var t=mm(e);return t.invert=mm(-e),t}function vm(e,t){var n=$t(e),r=_t(e),i=$t(t),s=_t(t);function a(o,l){var c=$t(l),u=$t(o)*c,d=_t(o)*c,h=_t(l),p=h*n+u*r;return[mr(d*i-p*s,u*n-h*r),Mn(p*i+d*s)]}return a.invert=function(o,l){var c=$t(l),u=$t(o)*c,d=_t(o)*c,h=_t(l),p=h*i-d*s;return[mr(d*i+h*s,u*n+p*r),Mn(p*n-u*r)]},a}function JC(e){e=fm(e[0]*Bt,e[1]*Bt,e.length>2?e[2]*Bt:0);function t(n){return n=e(n[0]*Bt,n[1]*Bt),n[0]*=se,n[1]*=se,n}return t.invert=function(n){return n=e.invert(n[0]*Bt,n[1]*Bt),n[0]*=se,n[1]*=se,n},t}function tA(e,t,n,r,i,s){if(n){var a=$t(t),o=_t(t),l=r*n;i==null?(i=t+r*Ee,s=t-l/2):(i=ym(a,i),s=ym(a,s),(r>0?i<s:i>s)&&(i+=r*Ee));for(var c,u=i;r>0?u>s:u<s;u-=l)c=$c([a,-o*$t(u),-o*_t(u)]),e.point(c[0],c[1])}}function ym(e,t){t=ei(t),t[0]-=e,Cc(t);var n=QC(-t[1]);return((-t[2]<0?-n:n)+Ee-wt)%Ee}function xm(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:De,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Na(e,t){return St(e[0]-t[0])<wt&&St(e[1]-t[1])<wt}function Pa(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function bm(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(f){if(!((g=f.length-1)<=0)){var g,m=f[0],v=f[g],x;if(Na(m,v)){if(!m[2]&&!v[2]){for(i.lineStart(),o=0;o<g;++o)i.point((m=f[o])[0],m[1]);i.lineEnd();return}v[0]+=2*wt}s.push(x=new Pa(m,f,null,!0)),a.push(x.o=new Pa(m,null,x,!1)),s.push(x=new Pa(v,f,null,!1)),a.push(x.o=new Pa(v,null,x,!0))}}),!!s.length){for(a.sort(t),_m(s),_m(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,p=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(u=h.p.z,o=u.length-1;o>=0;--o)i.point((d=u[o])[0],d[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);i.lineEnd()}}}function _m(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function kc(e){return St(e[0])<=mt?e[0]:Vn(e[0])*((St(e[0])+mt)%Ee-mt)}function eA(e,t){var n=kc(t),r=t[1],i=_t(r),s=[_t(n),-$t(n),0],a=0,o=0,l=new pr;i===1?r=fe+wt:i===-1&&(r=-fe-wt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,p=d[h-1],f=kc(p),g=p[1]/2+cm,m=_t(g),v=$t(g),x=0;x<h;++x,f=E,m=S,v=M,p=_){var _=d[x],E=kc(_),b=_[1]/2+cm,S=_t(b),M=$t(b),D=E-f,A=D>=0?1:-1,R=A*D,$=R>mt,H=m*S;if(l.add(mr(H*A*_t(R),v*M+H*$t(R))),a+=$?D+A*Ee:D,$^f>=n^E>=n){var P=Ra(ei(p),ei(_));Cc(P);var B=Ra(s,P);Cc(B);var O=($^D>=0?-1:1)*Mn(B[2]);(r>O||r===O&&(P[0]||P[1]))&&(o+=$^D>=0?1:-1)}}return(a<-1e-6||a<wt&&l<-1e-12)^o&1}function Em(e,t,n,r){return function(i){var s=t(i),a=xm(),o=t(a),l=!1,c,u,d,h={point:p,lineStart:g,lineEnd:m,polygonStart:function(){h.point=v,h.lineStart=x,h.lineEnd=_,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=g,h.lineEnd=m,u=Kf(u);var E=eA(c,r);u.length?(l||(i.polygonStart(),l=!0),bm(u,rA,E,n,i)):E&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(E,b){e(E,b)&&i.point(E,b)}function f(E,b){s.point(E,b)}function g(){h.point=f,s.lineStart()}function m(){h.point=p,s.lineEnd()}function v(E,b){d.push([E,b]),o.point(E,b)}function x(){o.lineStart(),d=[]}function _(){v(d[0][0],d[0][1]),o.lineEnd();var E=o.clean(),b=a.result(),S,M=b.length,D,A,R;if(d.pop(),c.push(d),d=null,!!M){if(E&1){if(A=b[0],(D=A.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<D;++S)i.point((R=A[S])[0],R[1]);i.lineEnd()}return}M>1&&E&2&&b.push(b.pop().concat(b.shift())),u.push(b.filter(nA))}}return h}}function nA(e){return e.length>1}function rA(e,t){return((e=e.x)[0]<0?e[1]-fe-wt:fe-e[1])-((t=t.x)[0]<0?t[1]-fe-wt:fe-t[1])}const Om=Em(function(){return!0},iA,aA,[-mt,-fe]);function iA(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?mt:-mt,l=St(s-t);St(l-mt)<wt?(e.point(t,n=(n+a)/2>0?fe:-fe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=mt&&(St(t-r)<wt&&(t-=r*wt),St(s-o)<wt&&(s-=o*wt),n=sA(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=s,n=a),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function sA(e,t,n,r){var i,s,a=_t(e-n);return St(a)>wt?um((_t(t)*(s=$t(r))*_t(n)-_t(r)*(i=$t(t))*_t(e))/(i*s*a)):(t+r)/2}function aA(e,t,n,r){var i;if(e==null)i=n*fe,r.point(-mt,i),r.point(0,i),r.point(mt,i),r.point(mt,0),r.point(mt,-i),r.point(0,-i),r.point(-mt,-i),r.point(-mt,0),r.point(-mt,i);else if(St(e[0]-t[0])>wt){var s=e[0]<t[0]?mt:-mt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function oA(e){var t=$t(e),n=2*Bt,r=t>0,i=St(t)>wt;function s(u,d,h,p){tA(p,e,n,h,u,d)}function a(u,d){return $t(u)*$t(d)>t}function o(u){var d,h,p,f,g;return{lineStart:function(){f=p=!1,g=1},point:function(m,v){var x=[m,v],_,E=a(m,v),b=r?E?0:c(m,v):E?c(m+(m<0?mt:-mt),v):0;if(!d&&(f=p=E)&&u.lineStart(),E!==p&&(_=l(d,x),(!_||Na(d,_)||Na(x,_))&&(x[2]=1)),E!==p)g=0,E?(u.lineStart(),_=l(x,d),u.point(_[0],_[1])):(_=l(d,x),u.point(_[0],_[1],2),u.lineEnd()),d=_;else if(i&&d&&r^E){var S;!(b&h)&&(S=l(x,d,!0))&&(g=0,r?(u.lineStart(),u.point(S[0][0],S[0][1]),u.point(S[1][0],S[1][1]),u.lineEnd()):(u.point(S[1][0],S[1][1]),u.lineEnd(),u.lineStart(),u.point(S[0][0],S[0][1],3)))}E&&(!d||!Na(d,x))&&u.point(x[0],x[1]),d=x,p=E,h=b},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return g|(f&&p)<<1}}}function l(u,d,h){var p=ei(u),f=ei(d),g=[1,0,0],m=Ra(p,f),v=Da(m,m),x=m[0],_=v-x*x;if(!_)return!h&&u;var E=t*v/_,b=-t*x/_,S=Ra(g,m),M=Ia(g,E),D=Ia(m,b);Mc(M,D);var A=S,R=Da(M,A),$=Da(A,A),H=R*R-$*(Da(M,M)-1);if(!(H<0)){var P=qe(H),B=Ia(A,(-R-P)/$);if(Mc(B,M),B=$c(B),!h)return B;var O=u[0],w=d[0],L=u[1],k=d[1],U;w<O&&(U=O,O=w,w=U);var K=w-O,W=St(K-mt)<wt,j=W||K<wt;if(!W&&k<L&&(U=L,L=k,k=U),j?W?L+k>0^B[1]<(St(B[0]-O)<wt?L:k):L<=B[1]&&B[1]<=k:K>mt^(O<=B[0]&&B[0]<=w)){var X=Ia(A,(-R+P)/$);return Mc(X,M),[B,$c(X)]}}}function c(u,d){var h=r?e:mt-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return Em(a,o,s,r?[0,-e]:[-mt,e-mt])}function lA(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,p=c-o,f;if(f=n-a,!(!h&&f>0)){if(f/=h,h<0){if(f<u)return;f<d&&(d=f)}else if(h>0){if(f>d)return;f>u&&(u=f)}if(f=i-a,!(!h&&f<0)){if(f/=h,h<0){if(f>d)return;f>u&&(u=f)}else if(h>0){if(f<u)return;f<d&&(d=f)}if(f=r-o,!(!p&&f>0)){if(f/=p,p<0){if(f<u)return;f<d&&(d=f)}else if(p>0){if(f>d)return;f>u&&(u=f)}if(f=s-o,!(!p&&f<0)){if(f/=p,p<0){if(f>d)return;f>u&&(u=f)}else if(p>0){if(f<u)return;f<d&&(d=f)}return u>0&&(e[0]=a+u*h,e[1]=o+u*p),d<1&&(t[0]=a+d*h,t[1]=o+d*p),!0}}}}}var Ua=1e9,Ba=-1e9;function cA(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,d,h){var p=0,f=0;if(c==null||(p=a(c,d))!==(f=a(u,d))||l(c,u)<0^d>0)do h.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+d+4)%4)!==f);else h.point(u[0],u[1])}function a(c,u){return St(c[0]-e)<wt?u>0?0:3:St(c[0]-n)<wt?u>0?2:1:St(c[1]-t)<wt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=xm(),h,p,f,g,m,v,x,_,E,b,S,M={point:D,lineStart:H,lineEnd:P,polygonStart:R,polygonEnd:$};function D(O,w){i(O,w)&&u.point(O,w)}function A(){for(var O=0,w=0,L=p.length;w<L;++w)for(var k=p[w],U=1,K=k.length,W=k[0],j,X,ct=W[0],J=W[1];U<K;++U)j=ct,X=J,W=k[U],ct=W[0],J=W[1],X<=r?J>r&&(ct-j)*(r-X)>(J-X)*(e-j)&&++O:J<=r&&(ct-j)*(r-X)<(J-X)*(e-j)&&--O;return O}function R(){u=d,h=[],p=[],S=!0}function $(){var O=A(),w=S&&O,L=(h=Kf(h)).length;(w||L)&&(c.polygonStart(),w&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),L&&bm(h,o,O,s,c),c.polygonEnd()),u=c,h=p=f=null}function H(){M.point=B,p&&p.push(f=[]),b=!0,E=!1,x=_=NaN}function P(){h&&(B(g,m),v&&E&&d.rejoin(),h.push(d.result())),M.point=D,E&&u.lineEnd()}function B(O,w){var L=i(O,w);if(p&&f.push([O,w]),b)g=O,m=w,v=L,b=!1,L&&(u.lineStart(),u.point(O,w));else if(L&&E)u.point(O,w);else{var k=[x=Math.max(Ba,Math.min(Ua,x)),_=Math.max(Ba,Math.min(Ua,_))],U=[O=Math.max(Ba,Math.min(Ua,O)),w=Math.max(Ba,Math.min(Ua,w))];lA(k,U,e,t,n,r)?(E||(u.lineStart(),u.point(k[0],k[1])),u.point(U[0],U[1]),L||u.lineEnd(),S=!1):L&&(u.lineStart(),u.point(O,w),S=!1)}x=O,_=w,E=L}return M}}const Dc=e=>e;var Rc=new pr,Ic=new pr,Sm,Tm,Nc,Pc,Cn={point:De,lineStart:De,lineEnd:De,polygonStart:function(){Cn.lineStart=uA,Cn.lineEnd=dA},polygonEnd:function(){Cn.lineStart=Cn.lineEnd=Cn.point=De,Rc.add(St(Ic)),Ic=new pr},result:function(){var e=Rc/2;return Rc=new pr,e}};function uA(){Cn.point=hA}function hA(e,t){Cn.point=wm,Sm=Nc=e,Tm=Pc=t}function wm(e,t){Ic.add(Pc*e-Nc*t),Nc=e,Pc=t}function dA(){wm(Sm,Tm)}var ni=1/0,Ha=ni,es=-ni,Va=es,Ga={point:pA,lineStart:De,lineEnd:De,polygonStart:De,polygonEnd:De,result:function(){var e=[[ni,Ha],[es,Va]];return es=Va=-(Ha=ni=1/0),e}};function pA(e,t){e<ni&&(ni=e),e>es&&(es=e),t<Ha&&(Ha=t),t>Va&&(Va=t)}var Uc=0,Bc=0,ns=0,za=0,Fa=0,ri=0,Hc=0,Vc=0,rs=0,$m,Mm,an,on,Re={point:gr,lineStart:Cm,lineEnd:Am,polygonStart:function(){Re.lineStart=gA,Re.lineEnd=vA},polygonEnd:function(){Re.point=gr,Re.lineStart=Cm,Re.lineEnd=Am},result:function(){var e=rs?[Hc/rs,Vc/rs]:ri?[za/ri,Fa/ri]:ns?[Uc/ns,Bc/ns]:[NaN,NaN];return Uc=Bc=ns=za=Fa=ri=Hc=Vc=rs=0,e}};function gr(e,t){Uc+=e,Bc+=t,++ns}function Cm(){Re.point=fA}function fA(e,t){Re.point=mA,gr(an=e,on=t)}function mA(e,t){var n=e-an,r=t-on,i=qe(n*n+r*r);za+=i*(an+e)/2,Fa+=i*(on+t)/2,ri+=i,gr(an=e,on=t)}function Am(){Re.point=gr}function gA(){Re.point=yA}function vA(){Lm($m,Mm)}function yA(e,t){Re.point=Lm,gr($m=an=e,Mm=on=t)}function Lm(e,t){var n=e-an,r=t-on,i=qe(n*n+r*r);za+=i*(an+e)/2,Fa+=i*(on+t)/2,ri+=i,i=on*e-an*t,Hc+=i*(an+e),Vc+=i*(on+t),rs+=i*3,gr(an=e,on=t)}function km(e){this._context=e}km.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Ee);break}}},result:De};var Gc=new pr,zc,Dm,Rm,is,ss,as={point:De,lineStart:function(){as.point=xA},lineEnd:function(){zc&&Im(Dm,Rm),as.point=De},polygonStart:function(){zc=!0},polygonEnd:function(){zc=null},result:function(){var e=+Gc;return Gc=new pr,e}};function xA(e,t){as.point=Im,Dm=is=e,Rm=ss=t}function Im(e,t){is-=e,ss-=t,Gc.add(qe(is*is+ss*ss)),is=e,ss=t}let Nm,ja,Pm,Um;class Bm{constructor(t){this._append=t==null?Hm:bA(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==Pm||this._append!==ja){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,Pm=r,ja=this._append,Um=this._,this._=i}this._+=Um;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Hm(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function bA(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Hm;if(t!==Nm){const n=10**t;Nm=t,ja=function(r){let i=1;this._+=r[0];for(const s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}return ja}function _A(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),ti(o,i(s))),s.result()}return a.area=function(o){return ti(o,i(Cn)),Cn.result()},a.measure=function(o){return ti(o,i(as)),as.result()},a.bounds=function(o){return ti(o,i(Ga)),Ga.result()},a.centroid=function(o){return ti(o,i(Re)),Re.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Dc):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Bm(n)):new km(t=o),typeof r!="function"&&s.pointRadius(r),a):t},a.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(s.pointRadius(+o),+o),a):r},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new Bm(n)),a},a.projection(e).digits(n).context(t)}function Fc(e){return function(t){var n=new jc;for(var r in e)n[r]=e[r];return n.stream=t,n}}function jc(){}jc.prototype={constructor:jc,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Wc(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),ti(n,e.stream(Ga)),t(Ga.result()),r!=null&&e.clipExtent(r),e}function Vm(e,t,n){return Wc(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function EA(e,t,n){return Vm(e,[[0,0],t],n)}function OA(e,t,n){return Wc(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function SA(e,t,n){return Wc(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Gm=16,TA=$t(30*Bt);function zm(e,t){return+t?$A(e,t):wA(e)}function wA(e){return Fc({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function $A(e,t){function n(r,i,s,a,o,l,c,u,d,h,p,f,g,m){var v=c-r,x=u-i,_=v*v+x*x;if(_>4*t&&g--){var E=a+h,b=o+p,S=l+f,M=qe(E*E+b*b+S*S),D=Mn(S/=M),A=St(St(S)-1)<wt||St(s-d)<wt?(s+d)/2:mr(b,E),R=e(A,D),$=R[0],H=R[1],P=$-r,B=H-i,O=x*P-v*B;(O*O/_>t||St((v*P+x*B)/_-.5)>.3||a*h+o*p+l*f<TA)&&(n(r,i,s,a,o,l,$,H,A,E/=M,b/=M,S,g,m),m.point($,H),n($,H,A,E,b,S,c,u,d,h,p,f,g,m))}}return function(r){var i,s,a,o,l,c,u,d,h,p,f,g,m={point:v,lineStart:x,lineEnd:E,polygonStart:function(){r.polygonStart(),m.lineStart=b},polygonEnd:function(){r.polygonEnd(),m.lineStart=x}};function v(D,A){D=e(D,A),r.point(D[0],D[1])}function x(){d=NaN,m.point=_,r.lineStart()}function _(D,A){var R=ei([D,A]),$=e(D,A);n(d,h,u,p,f,g,d=$[0],h=$[1],u=D,p=R[0],f=R[1],g=R[2],Gm,r),r.point(d,h)}function E(){m.point=v,r.lineEnd()}function b(){x(),m.point=S,m.lineEnd=M}function S(D,A){_(i=D,A),s=d,a=h,o=p,l=f,c=g,m.point=_}function M(){n(d,h,u,p,f,g,s,a,i,o,l,c,Gm,r),m.lineEnd=E,E()}return m}}var MA=Fc({point:function(e,t){this.stream.point(e*Bt,t*Bt)}});function CA(e){return Fc({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function AA(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function Fm(e,t,n,r,i,s){if(!s)return AA(e,t,n,r,i);var a=$t(s),o=_t(s),l=a*e,c=o*e,u=a/e,d=o/e,h=(o*n-a*t)/e,p=(o*t+a*n)/e;function f(g,m){return g*=r,m*=i,[l*g-c*m+t,n-c*g-l*m]}return f.invert=function(g,m){return[r*(u*g-d*m+h),i*(p-d*g-u*m)]},f}function Wa(e){return jm(function(){return e})()}function jm(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,p=1,f=null,g=Om,m=null,v,x,_,E=Dc,b=.5,S,M,D,A,R;function $(O){return D(O[0]*Bt,O[1]*Bt)}function H(O){return O=D.invert(O[0],O[1]),O&&[O[0]*se,O[1]*se]}$.stream=function(O){return A&&R===O?A:A=MA(CA(u)(g(S(E(R=O)))))},$.preclip=function(O){return arguments.length?(g=O,f=void 0,B()):g},$.postclip=function(O){return arguments.length?(E=O,m=v=x=_=null,B()):E},$.clipAngle=function(O){return arguments.length?(g=+O?oA(f=O*Bt):(f=null,Om),B()):f*se},$.clipExtent=function(O){return arguments.length?(E=O==null?(m=v=x=_=null,Dc):cA(m=+O[0][0],v=+O[0][1],x=+O[1][0],_=+O[1][1]),B()):m==null?null:[[m,v],[x,_]]},$.scale=function(O){return arguments.length?(n=+O,P()):n},$.translate=function(O){return arguments.length?(r=+O[0],i=+O[1],P()):[r,i]},$.center=function(O){return arguments.length?(s=O[0]%360*Bt,a=O[1]%360*Bt,P()):[s*se,a*se]},$.rotate=function(O){return arguments.length?(o=O[0]%360*Bt,l=O[1]%360*Bt,c=O.length>2?O[2]%360*Bt:0,P()):[o*se,l*se,c*se]},$.angle=function(O){return arguments.length?(d=O%360*Bt,P()):d*se},$.reflectX=function(O){return arguments.length?(h=O?-1:1,P()):h<0},$.reflectY=function(O){return arguments.length?(p=O?-1:1,P()):p<0},$.precision=function(O){return arguments.length?(S=zm(M,b=O*O),B()):qe(b)},$.fitExtent=function(O,w){return Vm($,O,w)},$.fitSize=function(O,w){return EA($,O,w)},$.fitWidth=function(O,w){return OA($,O,w)},$.fitHeight=function(O,w){return SA($,O,w)};function P(){var O=Fm(n,0,0,h,p,d).apply(null,t(s,a)),w=Fm(n,r-O[0],i-O[1],h,p,d);return u=fm(o,l,c),M=Ac(t,w),D=Ac(u,M),S=zm(M,b),B()}function B(){return A=R=null,$}return function(){return t=e.apply(this,arguments),$.invert=t.invert&&H,P()}}function Wm(e){var t=0,n=mt/3,r=jm(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Bt,n=s[1]*Bt):[t*se,n*se]},i}function LA(e){var t=$t(e);function n(r,i){return[r*t,_t(i)/t]}return n.invert=function(r,i){return[r/t,Mn(i*t)]},n}function kA(e,t){var n=_t(e),r=(n+_t(t))/2;if(St(r)<wt)return LA(e);var i=1+n*(2*r-n),s=qe(i)/r;function a(o,l){var c=qe(i-2*r*_t(l))/r;return[c*_t(o*=r),s-c*$t(o)]}return a.invert=function(o,l){var c=s-l,u=mr(o,St(c))*Vn(c);return c*r<0&&(u-=mt*Vn(o)*Vn(c)),[u/r,Mn((i-(o*o+c*c)*r*r)/(2*r))]},a}function qm(){return Wm(kA).scale(155.424).center([0,33.6442])}function DA(){return qm().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function qc(e,t){return[e,ZC(KC((fe+t)/2))]}qc.invert=function(e,t){return[e,2*um(XC(t))-fe]};function RA(){return IA(qc).scale(961/Ee)}function IA(e){var t=Wa(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=mt*r(),h=t(JC(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===qc?[[Math.max(h[0]-d,a),o],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function qa(e,t){return[e,t]}qa.invert=qa;function NA(){return Wa(qa).scale(152.63)}function PA(e,t){var n=$t(e),r=e===t?_t(e):(n-$t(t))/(t-e),i=n/r+e;if(St(r)<wt)return qa;function s(a,o){var l=i-o,c=r*a;return[l*_t(c),i-l*$t(c)]}return s.invert=function(a,o){var l=i-o,c=mr(a,St(l))*Vn(l);return l*r<0&&(c-=mt*Vn(a)*Vn(l)),[c/r,i-Vn(r)*qe(a*a+l*l)]},s}function UA(){return Wm(PA).scale(131.154).center([0,13.9389])}var os=1.340264,ls=-.081106,cs=893e-6,us=.003796,Ya=qe(3)/2,BA=12;function Ym(e,t){var n=Mn(Ya*_t(t)),r=n*n,i=r*r*r;return[e*$t(n)/(Ya*(os+3*ls*r+i*(7*cs+9*us*r))),n*(os+ls*r+i*(cs+us*r))]}Ym.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<BA&&(o=n*(os+ls*r+i*(cs+us*r))-t,l=os+3*ls*r+i*(7*cs+9*us*r),n-=a=o/l,r=n*n,i=r*r*r,!(St(a)<YC));++s);return[Ya*e*(os+3*ls*r+i*(7*cs+9*us*r))/$t(n),Mn(_t(n)/Ya)]};function HA(){return Wa(Ym).scale(177.158)}function Xm(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Xm.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(St(i)>wt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function VA(){return Wa(Xm).scale(175.295)}function GA(e,t){return e.parent===t.parent?1:2}function zA(e){return e.reduce(FA,0)/e.length}function FA(e,t){return e+t.x}function jA(e){return 1+e.reduce(WA,0)}function WA(e,t){return Math.max(e,t.y)}function qA(e){for(var t;t=e.children;)e=t[0];return e}function YA(e){for(var t;t=e.children;)e=t[t.length-1];return e}function XA(){var e=GA,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var p=h.children;p?(h.x=zA(p),h.y=jA(p)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=qA(s),c=YA(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(r?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.y/s.y:1))*n})}return i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function ZA(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function KA(){return this.eachAfter(ZA)}function QA(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function JA(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function tL(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function eL(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function nL(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function rL(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function iL(e){for(var t=this,n=sL(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function sL(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function aL(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function oL(){return Array.from(this)}function lL(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function cL(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*uL(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function hs(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=pL)):t===void 0&&(t=dL);for(var n=new ds(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new ds(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(mL)}function hL(){return hs(this).eachBefore(fL)}function dL(e){return e.children}function pL(e){return Array.isArray(e)?e[1]:null}function fL(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function mL(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function ds(e){this.data=e,this.depth=this.height=0,this.parent=null}ds.prototype=hs.prototype={constructor:ds,count:KA,each:QA,eachAfter:tL,eachBefore:JA,find:eL,sum:nL,sort:rL,path:iL,ancestors:aL,descendants:oL,leaves:lL,links:cL,copy:hL,[Symbol.iterator]:uL};function gL(e){return e==null?null:Zm(e)}function Zm(e){if(typeof e!="function")throw new Error;return e}function vr(){return 0}function ii(e){return function(){return e}}const vL=1664525,yL=1013904223,Km=4294967296;function xL(){let e=1;return()=>(e=(vL*e+yL)%Km)/Km}function bL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _L(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function EL(e,t){for(var n=0,r=(e=_L(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&Qm(a,s)?++n:(a=SL(i=OL(i,s)),n=0);return a}function OL(e,t){var n,r;if(Yc(t,e))return[t];for(n=0;n<e.length;++n)if(Xa(t,e[n])&&Yc(ps(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Xa(ps(e[n],e[r]),t)&&Xa(ps(e[n],t),e[r])&&Xa(ps(e[r],t),e[n])&&Yc(Jm(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Xa(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function Qm(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Yc(e,t){for(var n=0;n<t.length;++n)if(!Qm(e,t[n]))return!1;return!0}function SL(e){switch(e.length){case 1:return TL(e[0]);case 2:return ps(e[0],e[1]);case 3:return Jm(e[0],e[1],e[2])}}function TL(e){return{x:e.x,y:e.y,r:e.r}}function ps(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(r+a+c/d*u)/2,r:(d+i+o)/2}}function Jm(e,t,n){var r=e.x,i=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=r-a,p=r-c,f=i-o,g=i-u,m=l-s,v=d-s,x=r*r+i*i-s*s,_=x-a*a-o*o+l*l,E=x-c*c-u*u+d*d,b=p*f-h*g,S=(f*E-g*_)/(b*2)-r,M=(g*m-f*v)/b,D=(p*_-h*E)/(b*2)-i,A=(h*v-p*m)/b,R=M*M+A*A-1,$=2*(s+S*M+D*A),H=S*S+D*D-s*s,P=-(Math.abs(R)>1e-6?($+Math.sqrt($*$-4*R*H))/(2*R):H/$);return{x:r+S+M*P,y:i+D+A*P,r:P}}function tg(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function eg(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function ng(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function Za(e){this._=e,this.next=null,this.previous=null}function wL(e,t){if(!(s=(e=bL(e)).length))return 0;var n,r,i,s,a,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;tg(r,n,i=e[2]),n=new Za(n),r=new Za(r),i=new Za(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){tg(n._,r._,i=e[l]),i=new Za(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(eg(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(eg(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=ng(n);(i=i.next)!==r;)(o=ng(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=EL(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function $L(e){return Math.sqrt(e.value)}function ML(){var e=null,t=1,n=1,r=vr;function i(s){const a=xL();return s.x=t/2,s.y=n/2,e?s.eachBefore(rg(e)).eachAfter(Xc(r,.5,a)).eachBefore(ig(1)):s.eachBefore(rg($L)).eachAfter(Xc(vr,1,a)).eachAfter(Xc(r,s.r/Math.min(t,n),a)).eachBefore(ig(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=gL(s),i):e},i.size=function(s){return arguments.length?(t=+s[0],n=+s[1],i):[t,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:ii(+s),i):r},i}function rg(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Xc(e,t,n){return function(r){if(i=r.children){var i,s,a=i.length,o=e(r)*t||0,l;if(o)for(s=0;s<a;++s)i[s].r+=o;if(l=wL(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function ig(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function CL(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function AL(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function LL(e,t){return e.parent===t.parent?1:2}function Zc(e){var t=e.children;return t?t[0]:e.t}function Kc(e){var t=e.children;return t?t[t.length-1]:e.t}function kL(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function DL(e){for(var t=0,n=0,r=e.children,i=r.length,s;--i>=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function RL(e,t,n){return e.a.parent===t.parent?e.a:n}function Ka(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Ka.prototype=Object.create(ds.prototype);function IL(e){for(var t=new Ka(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new Ka(s[a],a)),i.parent=n;return(t.parent=new Ka(null,0)).children=[t],t}function NL(){var e=LL,t=1,n=1,r=null;function i(c){var u=IL(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var d=c,h=c,p=c;c.eachBefore(function(x){x.x<d.x&&(d=x),x.x>h.x&&(h=x),x.depth>p.depth&&(p=x)});var f=d===h?1:e(d,h)/2,g=f-d.x,m=t/(h.x+f+g),v=n/(p.depth||1);c.eachBefore(function(x){x.x=(x.x+g)*m,x.y=x.depth*v})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){DL(c);var p=(u[0].z+u[u.length-1].z)/2;h?(c.z=h.z+e(c._,h._),c.m=c.z-p):c.z=p}else h&&(c.z=h.z+e(c._,h._));c.parent.A=o(c,h,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,d){if(u){for(var h=c,p=c,f=u,g=h.parent.children[0],m=h.m,v=p.m,x=f.m,_=g.m,E;f=Kc(f),h=Zc(h),f&&h;)g=Zc(g),p=Kc(p),p.a=c,E=f.z+x-h.z-m+e(f._,h._),E>0&&(kL(RL(f,c,d),c,E),m+=E,v+=E),x+=f.m,m+=h.m,_+=g.m,v+=p.m;f&&!Kc(p)&&(p.t=f,p.m+=x-v),h&&!Zc(g)&&(g.t=h,g.m+=m-_,d=c)}return d}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function PL(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var UL=(1+Math.sqrt(5))/2;function BL(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,d=0,h=o.length,p,f,g=t.value,m,v,x,_,E,b,S;u<h;){p=i-n,f=s-r;do m=o[d++].value;while(!m&&d<h);for(v=x=m,b=Math.max(f/p,p/f)/(g*e),S=m*m*b,E=Math.max(x/S,S/v);d<h;++d){if(m+=c=o[d].value,c<v&&(v=c),c>x&&(x=c),S=m*m*b,_=Math.max(x/S,S/v),_>E){m-=c;break}E=_}a.push(l={value:m,dice:p<f,children:o.slice(u,d)}),l.dice?AL(l,n,r,i,g?r+=f*m/g:s):PL(l,n,r,g?n+=p*m/g:i,s),g-=m,u=d}return a}const HL=function e(t){function n(r,i,s,a,o){BL(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(UL);function VL(){var e=HL,t=!1,n=1,r=1,i=[0],s=vr,a=vr,o=vr,l=vr,c=vr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(CL),h}function d(h){var p=i[h.depth],f=h.x0+p,g=h.y0+p,m=h.x1-p,v=h.y1-p;m<f&&(f=m=(f+m)/2),v<g&&(g=v=(g+v)/2),h.x0=f,h.y0=g,h.x1=m,h.y1=v,h.children&&(p=i[h.depth+1]=s(h)/2,f+=c(h)-p,g+=a(h)-p,m-=o(h)-p,v-=l(h)-p,m<f&&(f=m=(f+m)/2),v<g&&(g=v=(g+v)/2),e(h,f,g,m,v))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=Zm(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(s=typeof h=="function"?h:ii(+h),u):s},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:ii(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:ii(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:ii(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:ii(+h),u):c},u}function Qa(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Tc(t)}function GL(e){return e.innerRadius}function zL(e){return e.outerRadius}function FL(e){return e.startAngle}function jL(e){return e.endAngle}function WL(e){return e&&e.padAngle}function qL(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,d=o-s,h=d*l-u*c;if(!(h*h<ee))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function Ja(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Xr(o*o+l*l),u=c*l,d=-c*o,h=e+u,p=t+d,f=n+u,g=r+d,m=(h+f)/2,v=(p+g)/2,x=f-h,_=g-p,E=x*x+_*_,b=i-s,S=h*g-f*p,M=(_<0?-1:1)*Xr(CM(0,b*b*E-S*S)),D=(S*_-x*M)/E,A=(-S*x-_*M)/E,R=(S*_+x*M)/E,$=(-S*x+_*M)/E,H=D-m,P=A-v,B=R-m,O=$-v;return H*H+P*P>B*B+O*O&&(D=R,A=$),{cx:D,cy:A,x01:-u,y01:-d,x11:D*(i/b-1),y11:A*(i/b-1)}}function fs(){var e=GL,t=zL,n=pt(0),r=null,i=FL,s=jL,a=WL,o=null,l=Qa(c);function c(){var u,d,h=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-_a,g=s.apply(this,arguments)-_a,m=uf(g-f),v=g>f;if(o||(o=u=l()),p<h&&(d=p,p=h,h=d),!(p>ee))o.moveTo(0,0);else if(m>Ea-ee)o.moveTo(p*dr(f),p*sn(f)),o.arc(0,0,p,f,g,!v),h>ee&&(o.moveTo(h*dr(g),h*sn(g)),o.arc(0,0,h,g,f,v));else{var x=f,_=g,E=f,b=g,S=m,M=m,D=a.apply(this,arguments)/2,A=D>ee&&(r?+r.apply(this,arguments):Xr(h*h+p*p)),R=oc(uf(p-h)/2,+n.apply(this,arguments)),$=R,H=R,P,B;if(A>ee){var O=hf(A/h*sn(D)),w=hf(A/p*sn(D));(S-=O*2)>ee?(O*=v?1:-1,E+=O,b-=O):(S=0,E=b=(f+g)/2),(M-=w*2)>ee?(w*=v?1:-1,x+=w,_-=w):(M=0,x=_=(f+g)/2)}var L=p*dr(x),k=p*sn(x),U=h*dr(b),K=h*sn(b);if(R>ee){var W=p*dr(_),j=p*sn(_),X=h*dr(E),ct=h*sn(E),J;if(m<Ji)if(J=qL(L,k,X,ct,W,j,U,K)){var Y=L-J[0],et=k-J[1],ut=W-J[0],F=j-J[1],q=1/sn(AM((Y*ut+et*F)/(Xr(Y*Y+et*et)*Xr(ut*ut+F*F)))/2),Z=Xr(J[0]*J[0]+J[1]*J[1]);$=oc(R,(h-Z)/(q-1)),H=oc(R,(p-Z)/(q+1))}else $=H=0}M>ee?H>ee?(P=Ja(X,ct,L,k,p,H,v),B=Ja(W,j,U,K,p,H,v),o.moveTo(P.cx+P.x01,P.cy+P.y01),H<R?o.arc(P.cx,P.cy,H,te(P.y01,P.x01),te(B.y01,B.x01),!v):(o.arc(P.cx,P.cy,H,te(P.y01,P.x01),te(P.y11,P.x11),!v),o.arc(0,0,p,te(P.cy+P.y11,P.cx+P.x11),te(B.cy+B.y11,B.cx+B.x11),!v),o.arc(B.cx,B.cy,H,te(B.y11,B.x11),te(B.y01,B.x01),!v))):(o.moveTo(L,k),o.arc(0,0,p,x,_,!v)):o.moveTo(L,k),!(h>ee)||!(S>ee)?o.lineTo(U,K):$>ee?(P=Ja(U,K,W,j,h,-$,v),B=Ja(L,k,X,ct,h,-$,v),o.lineTo(P.cx+P.x01,P.cy+P.y01),$<R?o.arc(P.cx,P.cy,$,te(P.y01,P.x01),te(B.y01,B.x01),!v):(o.arc(P.cx,P.cy,$,te(P.y01,P.x01),te(P.y11,P.x11),!v),o.arc(0,0,h,te(P.cy+P.y11,P.cx+P.x11),te(B.cy+B.y11,B.cx+B.x11),v),o.arc(B.cx,B.cy,$,te(B.y11,B.x11),te(B.y01,B.x01),!v))):o.arc(0,0,h,b,E,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Ji/2;return[dr(d)*u,sn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:pt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:pt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:pt(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:pt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:pt(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:pt(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:pt(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}function Qc(e){return e[0]}function Jc(e){return e[1]}function ms(e,t){var n=pt(!0),r=null,i=Oa,s=null,a=Qa(o);e=typeof e=="function"?e:e===void 0?Qc:pt(e),t=typeof t=="function"?t:t===void 0?Jc:pt(t);function o(l){var c,u=(l=ma(l)).length,d,h=!1,p;for(r==null&&(s=i(p=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(p)return s=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:pt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:pt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:pt(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function tu(e,t,n){var r=null,i=pt(!0),s=null,a=Oa,o=null,l=Qa(c);e=typeof e=="function"?e:e===void 0?Qc:pt(+e),t=typeof t=="function"?t:pt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Jc:pt(+n);function c(d){var h,p,f,g=(d=ma(d)).length,m,v=!1,x,_=new Array(g),E=new Array(g);for(s==null&&(o=a(x=l())),h=0;h<=g;++h){if(!(h<g&&i(m=d[h],h,d))===v)if(v=!v)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),f=h-1;f>=p;--f)o.point(_[f],E[f]);o.lineEnd(),o.areaEnd()}v&&(_[h]=+e(m,h,d),E[h]=+t(m,h,d),o.point(r?+r(m,h,d):_[h],n?+n(m,h,d):E[h]))}if(x)return o=null,x+""||null}function u(){return ms().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:pt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:pt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:pt(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function YL(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function XL(e){return e}function ZL(){var e=XL,t=YL,n=null,r=pt(0),i=pt(Ea),s=pt(0);function a(o){var l,c=(o=ma(o)).length,u,d,h=0,p=new Array(c),f=new Array(c),g=+r.apply(this,arguments),m=Math.min(Ea,Math.max(-Ea,i.apply(this,arguments)-g)),v,x=Math.min(Math.abs(m)/c,s.apply(this,arguments)),_=x*(m<0?-1:1),E;for(l=0;l<c;++l)(E=f[p[l]=l]=+e(o[l],l,o))>0&&(h+=E);for(t!=null?p.sort(function(b,S){return t(f[b],f[S])}):n!=null&&p.sort(function(b,S){return n(o[b],o[S])}),l=0,d=h?(m-c*_)/h:0;l<c;++l,g=v)u=p[l],E=f[u],v=g+(E>0?E*d:0)+_,f[u]={data:o[u],index:l,value:E,startAngle:g,endAngle:v,padAngle:x};return f}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:pt(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:pt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:pt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:pt(+o),a):s},a}var KL=ag(Oa);function sg(e){this._curve=e}sg.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function ag(e){function t(n){return new sg(e(n))}return t._curve=e,t}function QL(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(ag(n)):t()._curve},e}function JL(){return QL(ms().curve(KL))}class tk{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function ek(e){return new tk(e,!0)}function nk(e){return e.source}function rk(e){return e.target}function ik(e){let t=nk,n=rk,r=Qc,i=Jc,s=null,a=null,o=Qa(l);function l(){let c;const u=Ow.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:pt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:pt(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function sk(){return ik(ek)}let gt=class{constructor(t,n,r){if(this.type="",this.renderType=it.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=y(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(I(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=y(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${de}--${i}--${this.type}`,!0),r&&r.classed(`${de}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const n=y(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=N.appendOrSelect(this.parent,`${this.renderType===it.SVG?"svg":"div"}${r}.${de}--${n}--${this.type}`);if(t.ariaLabel&&i.attr("aria-label",t.ariaLabel),t.isPresentational&&i.attr("role","presentation"),t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=I(`#${s}`).select("rect");a.size()!==0&&parseFloat(a.attr("height"))>0&&i.attr("clip-path",`url(#${s})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?at({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */const{entries:og,setPrototypeOf:lg,isFrozen:ak,getPrototypeOf:ok,getOwnPropertyDescriptor:lk}=Object;let{freeze:ae,seal:Ie,create:cg}=Object,{apply:eu,construct:nu}=typeof Reflect<"u"&&Reflect;ae||(ae=function(e){return e}),Ie||(Ie=function(e){return e}),eu||(eu=function(e,t,n){return e.apply(t,n)}),nu||(nu=function(e,t){return new e(...t)});const to=le(Array.prototype.forEach),ck=le(Array.prototype.lastIndexOf),ug=le(Array.prototype.pop),gs=le(Array.prototype.push),uk=le(Array.prototype.splice),eo=le(String.prototype.toLowerCase),ru=le(String.prototype.toString),hg=le(String.prototype.match),vs=le(String.prototype.replace),hk=le(String.prototype.indexOf),dk=le(String.prototype.trim),Ye=le(Object.prototype.hasOwnProperty),oe=le(RegExp.prototype.test),ys=pk(TypeError);function le(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return eu(e,t,r)}}function pk(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return nu(e,n)}}function vt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:eo;lg&&lg(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(ak(t)||(t[r]=s),i=s)}e[i]=!0}return e}function fk(e){for(let t=0;t<e.length;t++)Ye(e,t)||(e[t]=null);return e}function yr(e){const t=cg(null);for(const[n,r]of og(e))Ye(e,n)&&(Array.isArray(r)?t[n]=fk(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=yr(r):t[n]=r);return t}function xs(e,t){for(;e!==null;){const r=lk(e,t);if(r){if(r.get)return le(r.get);if(typeof r.value=="function")return le(r.value)}e=ok(e)}function n(){return null}return n}const dg=ae(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),iu=ae(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),su=ae(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),mk=ae(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),au=ae(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),gk=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pg=ae(["#text"]),fg=ae(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ou=ae(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mg=ae(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),no=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),vk=Ie(/\{\{[\w\W]*|[\w\W]*\}\}/gm),yk=Ie(/<%[\w\W]*|[\w\W]*%>/gm),xk=Ie(/\$\{[\w\W]*/gm),bk=Ie(/^data-[\-\w.\u00B7-\uFFFF]+$/),_k=Ie(/^aria-[\-\w]+$/),gg=Ie(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ek=Ie(/^(?:\w+script|data):/i),Ok=Ie(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vg=Ie(/^html$/i),Sk=Ie(/^[a-z][.\w]*(-[.\w]+)+$/i);var yg=Object.freeze({__proto__:null,ARIA_ATTR:_k,ATTR_WHITESPACE:Ok,CUSTOM_ELEMENT:Sk,DATA_ATTR:bk,DOCTYPE_NAME:vg,ERB_EXPR:yk,IS_ALLOWED_URI:gg,IS_SCRIPT_OR_DATA:Ek,MUSTACHE_EXPR:vk,TMPLIT_EXPR:xk});const bs={element:1,text:3,progressingInstruction:7,comment:8,document:9},Tk=function(){return typeof window>"u"?null:window},wk=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},xg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function bg(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Tk();const t=C=>bg(C);if(t.version="3.2.5",t.removed=[],!e||!e.document||e.document.nodeType!==bs.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,f=l.prototype,g=xs(f,"cloneNode"),m=xs(f,"remove"),v=xs(f,"nextSibling"),x=xs(f,"childNodes"),_=xs(f,"parentNode");if(typeof a=="function"){const C=n.createElement("template");C.content&&C.content.ownerDocument&&(n=C.content.ownerDocument)}let E,b="";const{implementation:S,createNodeIterator:M,createDocumentFragment:D,getElementsByTagName:A}=n,{importNode:R}=r;let $=xg();t.isSupported=typeof og=="function"&&typeof _=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:P,TMPLIT_EXPR:B,DATA_ATTR:O,ARIA_ATTR:w,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:U}=yg;let{IS_ALLOWED_URI:K}=yg,W=null;const j=vt({},[...dg,...iu,...su,...au,...pg]);let X=null;const ct=vt({},[...fg,...ou,...mg,...no]);let J=Object.seal(cg(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Y=null,et=null,ut=!0,F=!0,q=!1,Z=!0,G=!1,dt=!0,ot=!1,It=!1,Ht=!1,rt=!1,Et=!1,Ne=!1,Te=!0,Ss=!1;const Ts="user-content-";let _r=!0,Ze=!1,li={},ci=null;const Bv=vt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Hv=null;const Vv=vt({},["audio","video","img","source","image","track"]);let ku=null;const Gv=vt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vo="http://www.w3.org/1998/Math/MathML",yo="http://www.w3.org/2000/svg",Ln="http://www.w3.org/1999/xhtml";let ui=Ln,Du=!1,Ru=null;const nU=vt({},[vo,yo,Ln],ru);let xo=vt({},["mi","mo","mn","ms","mtext"]),bo=vt({},["annotation-xml"]);const rU=vt({},["title","style","font","a","script"]);let ws=null;const iU=["application/xhtml+xml","text/html"],sU="text/html";let Xt=null,hi=null;const aU=n.createElement("form"),zv=function(C){return C instanceof RegExp||C instanceof Function},Iu=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(hi&&hi===C)){if((!C||typeof C!="object")&&(C={}),C=yr(C),ws=iU.indexOf(C.PARSER_MEDIA_TYPE)===-1?sU:C.PARSER_MEDIA_TYPE,Xt=ws==="application/xhtml+xml"?ru:eo,W=Ye(C,"ALLOWED_TAGS")?vt({},C.ALLOWED_TAGS,Xt):j,X=Ye(C,"ALLOWED_ATTR")?vt({},C.ALLOWED_ATTR,Xt):ct,Ru=Ye(C,"ALLOWED_NAMESPACES")?vt({},C.ALLOWED_NAMESPACES,ru):nU,ku=Ye(C,"ADD_URI_SAFE_ATTR")?vt(yr(Gv),C.ADD_URI_SAFE_ATTR,Xt):Gv,Hv=Ye(C,"ADD_DATA_URI_TAGS")?vt(yr(Vv),C.ADD_DATA_URI_TAGS,Xt):Vv,ci=Ye(C,"FORBID_CONTENTS")?vt({},C.FORBID_CONTENTS,Xt):Bv,Y=Ye(C,"FORBID_TAGS")?vt({},C.FORBID_TAGS,Xt):{},et=Ye(C,"FORBID_ATTR")?vt({},C.FORBID_ATTR,Xt):{},li=Ye(C,"USE_PROFILES")?C.USE_PROFILES:!1,ut=C.ALLOW_ARIA_ATTR!==!1,F=C.ALLOW_DATA_ATTR!==!1,q=C.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=C.SAFE_FOR_TEMPLATES||!1,dt=C.SAFE_FOR_XML!==!1,ot=C.WHOLE_DOCUMENT||!1,rt=C.RETURN_DOM||!1,Et=C.RETURN_DOM_FRAGMENT||!1,Ne=C.RETURN_TRUSTED_TYPE||!1,Ht=C.FORCE_BODY||!1,Te=C.SANITIZE_DOM!==!1,Ss=C.SANITIZE_NAMED_PROPS||!1,_r=C.KEEP_CONTENT!==!1,Ze=C.IN_PLACE||!1,K=C.ALLOWED_URI_REGEXP||gg,ui=C.NAMESPACE||Ln,xo=C.MATHML_TEXT_INTEGRATION_POINTS||xo,bo=C.HTML_INTEGRATION_POINTS||bo,J=C.CUSTOM_ELEMENT_HANDLING||{},C.CUSTOM_ELEMENT_HANDLING&&zv(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=C.CUSTOM_ELEMENT_HANDLING.tagNameCheck),C.CUSTOM_ELEMENT_HANDLING&&zv(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(F=!1),Et&&(rt=!0),li&&(W=vt({},pg),X=[],li.html===!0&&(vt(W,dg),vt(X,fg)),li.svg===!0&&(vt(W,iu),vt(X,ou),vt(X,no)),li.svgFilters===!0&&(vt(W,su),vt(X,ou),vt(X,no)),li.mathMl===!0&&(vt(W,au),vt(X,mg),vt(X,no))),C.ADD_TAGS&&(W===j&&(W=yr(W)),vt(W,C.ADD_TAGS,Xt)),C.ADD_ATTR&&(X===ct&&(X=yr(X)),vt(X,C.ADD_ATTR,Xt)),C.ADD_URI_SAFE_ATTR&&vt(ku,C.ADD_URI_SAFE_ATTR,Xt),C.FORBID_CONTENTS&&(ci===Bv&&(ci=yr(ci)),vt(ci,C.FORBID_CONTENTS,Xt)),_r&&(W["#text"]=!0),ot&&vt(W,["html","head","body"]),W.table&&(vt(W,["tbody"]),delete Y.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw ys('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ys('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=C.TRUSTED_TYPES_POLICY,b=E.createHTML("")}else E===void 0&&(E=wk(p,i)),E!==null&&typeof b=="string"&&(b=E.createHTML(""));ae&&ae(C),hi=C}},Fv=vt({},[...iu,...su,...mk]),jv=vt({},[...au,...gk]),oU=function(C){let tt=_(C);(!tt||!tt.tagName)&&(tt={namespaceURI:ui,tagName:"template"});const Q=eo(C.tagName),Tt=eo(tt.tagName);return Ru[C.namespaceURI]?C.namespaceURI===yo?tt.namespaceURI===Ln?Q==="svg":tt.namespaceURI===vo?Q==="svg"&&(Tt==="annotation-xml"||xo[Tt]):!!Fv[Q]:C.namespaceURI===vo?tt.namespaceURI===Ln?Q==="math":tt.namespaceURI===yo?Q==="math"&&bo[Tt]:!!jv[Q]:C.namespaceURI===Ln?tt.namespaceURI===yo&&!bo[Tt]||tt.namespaceURI===vo&&!xo[Tt]?!1:!jv[Q]&&(rU[Q]||!Fv[Q]):!!(ws==="application/xhtml+xml"&&Ru[C.namespaceURI]):!1},Er=function(C){gs(t.removed,{element:C});try{_(C).removeChild(C)}catch{m(C)}},_o=function(C,tt){try{gs(t.removed,{attribute:tt.getAttributeNode(C),from:tt})}catch{gs(t.removed,{attribute:null,from:tt})}if(tt.removeAttribute(C),C==="is")if(rt||Et)try{Er(tt)}catch{}else try{tt.setAttribute(C,"")}catch{}},Wv=function(C){let tt=null,Q=null;if(Ht)C="<remove></remove>"+C;else{const Wt=hg(C,/^[\r\n\t ]+/);Q=Wt&&Wt[0]}ws==="application/xhtml+xml"&&ui===Ln&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");const Tt=E?E.createHTML(C):C;if(ui===Ln)try{tt=new h().parseFromString(Tt,ws)}catch{}if(!tt||!tt.documentElement){tt=S.createDocument(ui,"template",null);try{tt.documentElement.innerHTML=Du?b:Tt}catch{}}const Qt=tt.body||tt.documentElement;return C&&Q&&Qt.insertBefore(n.createTextNode(Q),Qt.childNodes[0]||null),ui===Ln?A.call(tt,ot?"html":"body")[0]:ot?tt.documentElement:Qt},qv=function(C){return M.call(C.ownerDocument||C,C,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Nu=function(C){return C instanceof d&&(typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||!(C.attributes instanceof u)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function")},Yv=function(C){return typeof o=="function"&&C instanceof o};function kn(C,tt,Q){to(C,Tt=>{Tt.call(t,tt,Q,hi)})}const Xv=function(C){let tt=null;if(kn($.beforeSanitizeElements,C,null),Nu(C))return Er(C),!0;const Q=Xt(C.nodeName);if(kn($.uponSanitizeElement,C,{tagName:Q,allowedTags:W}),C.hasChildNodes()&&!Yv(C.firstElementChild)&&oe(/<[/\w!]/g,C.innerHTML)&&oe(/<[/\w!]/g,C.textContent)||C.nodeType===bs.progressingInstruction||dt&&C.nodeType===bs.comment&&oe(/<[/\w]/g,C.data))return Er(C),!0;if(!W[Q]||Y[Q]){if(!Y[Q]&&Kv(Q)&&(J.tagNameCheck instanceof RegExp&&oe(J.tagNameCheck,Q)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Q)))return!1;if(_r&&!ci[Q]){const Tt=_(C)||C.parentNode,Qt=x(C)||C.childNodes;if(Qt&&Tt){const Wt=Qt.length;for(let Dn=Wt-1;Dn>=0;--Dn){const Pe=g(Qt[Dn],!0);Pe.__removalCount=(C.__removalCount||0)+1,Tt.insertBefore(Pe,v(C))}}}return Er(C),!0}return C instanceof l&&!oU(C)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&oe(/<\/no(script|embed|frames)/i,C.innerHTML)?(Er(C),!0):(G&&C.nodeType===bs.text&&(tt=C.textContent,to([H,P,B],Tt=>{tt=vs(tt,Tt," ")}),C.textContent!==tt&&(gs(t.removed,{element:C.cloneNode()}),C.textContent=tt)),kn($.afterSanitizeElements,C,null),!1)},Zv=function(C,tt,Q){if(Te&&(tt==="id"||tt==="name")&&(Q in n||Q in aU))return!1;if(!(F&&!et[tt]&&oe(O,tt))&&!(ut&&oe(w,tt))){if(!X[tt]||et[tt]){if(!(Kv(C)&&(J.tagNameCheck instanceof RegExp&&oe(J.tagNameCheck,C)||J.tagNameCheck instanceof Function&&J.tagNameCheck(C))&&(J.attributeNameCheck instanceof RegExp&&oe(J.attributeNameCheck,tt)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(tt))||tt==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&oe(J.tagNameCheck,Q)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Q))))return!1}else if(!ku[tt]&&!oe(K,vs(Q,k,""))&&!((tt==="src"||tt==="xlink:href"||tt==="href")&&C!=="script"&&hk(Q,"data:")===0&&Hv[C])&&!(q&&!oe(L,vs(Q,k,"")))&&Q)return!1}return!0},Kv=function(C){return C!=="annotation-xml"&&hg(C,U)},Qv=function(C){kn($.beforeSanitizeAttributes,C,null);const{attributes:tt}=C;if(!tt||Nu(C))return;const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Tt=tt.length;for(;Tt--;){const Qt=tt[Tt],{name:Wt,namespaceURI:Dn,value:Pe}=Qt,un=Xt(Wt);let ue=Wt==="value"?Pe:dk(Pe);if(Q.attrName=un,Q.attrValue=ue,Q.keepAttr=!0,Q.forceKeepAttr=void 0,kn($.uponSanitizeAttribute,C,Q),ue=Q.attrValue,Ss&&(un==="id"||un==="name")&&(_o(Wt,C),ue=Ts+ue),dt&&oe(/((--!?|])>)|<\/(style|title)/i,ue)){_o(Wt,C);continue}if(Q.forceKeepAttr||(_o(Wt,C),!Q.keepAttr))continue;if(!Z&&oe(/\/>/i,ue)){_o(Wt,C);continue}G&&to([H,P,B],cU=>{ue=vs(ue,cU," ")});const Jv=Xt(C.nodeName);if(Zv(Jv,un,ue)){if(E&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Dn)switch(p.getAttributeType(Jv,un)){case"TrustedHTML":{ue=E.createHTML(ue);break}case"TrustedScriptURL":{ue=E.createScriptURL(ue);break}}try{Dn?C.setAttributeNS(Dn,Wt,ue):C.setAttribute(Wt,ue),Nu(C)?Er(C):ug(t.removed)}catch{}}}kn($.afterSanitizeAttributes,C,null)},lU=function C(tt){let Q=null;const Tt=qv(tt);for(kn($.beforeSanitizeShadowDOM,tt,null);Q=Tt.nextNode();)kn($.uponSanitizeShadowNode,Q,null),Xv(Q),Qv(Q),Q.content instanceof s&&C(Q.content);kn($.afterSanitizeShadowDOM,tt,null)};return t.sanitize=function(C){let tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,Tt=null,Qt=null,Wt=null;if(Du=!C,Du&&(C="<!-->"),typeof C!="string"&&!Yv(C))if(typeof C.toString=="function"){if(C=C.toString(),typeof C!="string")throw ys("dirty is not a string, aborting")}else throw ys("toString is not a function");if(!t.isSupported)return C;if(It||Iu(tt),t.removed=[],typeof C=="string"&&(Ze=!1),Ze){if(C.nodeName){const un=Xt(C.nodeName);if(!W[un]||Y[un])throw ys("root node is forbidden and cannot be sanitized in-place")}}else if(C instanceof o)Q=Wv("<!---->"),Tt=Q.ownerDocument.importNode(C,!0),Tt.nodeType===bs.element&&Tt.nodeName==="BODY"||Tt.nodeName==="HTML"?Q=Tt:Q.appendChild(Tt);else{if(!rt&&!G&&!ot&&C.indexOf("<")===-1)return E&&Ne?E.createHTML(C):C;if(Q=Wv(C),!Q)return rt?null:Ne?b:""}Q&&Ht&&Er(Q.firstChild);const Dn=qv(Ze?C:Q);for(;Qt=Dn.nextNode();)Xv(Qt),Qv(Qt),Qt.content instanceof s&&lU(Qt.content);if(Ze)return C;if(rt){if(Et)for(Wt=D.call(Q.ownerDocument);Q.firstChild;)Wt.appendChild(Q.firstChild);else Wt=Q;return(X.shadowroot||X.shadowrootmode)&&(Wt=R.call(r,Wt,!0)),Wt}let Pe=ot?Q.outerHTML:Q.innerHTML;return ot&&W["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&oe(vg,Q.ownerDocument.doctype.name)&&(Pe="<!DOCTYPE "+Q.ownerDocument.doctype.name+`>
|
|
4
4
|
`+Pe),G&&to([H,P,B],un=>{Pe=vs(Pe,un," ")}),E&&Ne?E.createHTML(Pe):Pe},t.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Iu(C),It=!0},t.clearConfig=function(){hi=null,It=!1},t.isValidAttribute=function(C,tt,Q){hi||Iu({});const Tt=Xt(C),Qt=Xt(tt);return Zv(Tt,Qt,Q)},t.addHook=function(C,tt){typeof tt=="function"&&gs($[C],tt)},t.removeHook=function(C,tt){if(tt!==void 0){const Q=ck($[C],tt);return Q===-1?void 0:uk($[C],Q,1)[0]}return ug($[C])},t.removeHooks=function(C){$[C]=[]},t.removeAllHooks=function(){$=xg()},t}var lu=bg();const ro=e=>lu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),$k=e=>lu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),ln=e=>lu.sanitize(e,{ALLOWED_TAGS:[]}),_g=class e0 extends gt{constructor(){super(...arguments),this.type="toolbar",this.renderType=it.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(T.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(T.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer({ariaLabel:"toolbar"}).attr("role","group");if(y(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;a.merge(s).classed("disabled",l=>l.shouldBeDisabled()).attr("role","button").attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
<div class="${de}--${s}-modal-footer-spacer"></div>
|
|
50
50
|
<button class="cds--btn cds--btn--primary" type="button" data-modal-primary-focus>${i}</button>
|
|
51
51
|
</div>
|
|
52
|
-
</div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=I(this.services.domUtils.getHolder()),i=y(n,"style","prefix");this.modal=N.appendOrSelect(r,`div.${de}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class _s extends gt{constructor(){super(...arguments),this.type="title",this.renderType=it.HTML}render(t=!1){const n=this.getComponentContainer(),r=y(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>ln(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(T.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=N.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(T.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(T.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(T.Tooltip.HIDE)})}}getMaxTitleWidth(){return N.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)<i?t.getSubStringLength(0,s+1)>i?s:this.getSubstringIndex(t,s,r,i):s}}class cu extends gt{constructor(){super(...arguments),this.type="legend",this.renderType=it.HTML}render(t=!1){const n=this.getOptions(),r=y(n,"legend"),i=y(r,"alignment"),s=y(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Nt.items.status,l=a.some(x=>x.status===o),c=y(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===zt.CENTER).classed("right-aligned",i===zt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ht.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,x=>x.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(x){return x.status===Nt.items.status.ACTIVE});const p=y(this.getOptions(),"legend","clickable");u.classed("clickable",p&&a.length>1);const f=Nt.checkbox.radius,g=h.append("div").classed("checkbox",!0),m=g.merge(d.select("div.checkbox")).attr("role",ht.CHECKBOX).attr("tabindex",p?0:-1).attr("aria-labelledby",(x,_)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${_}-title`)).attr("aria-checked",({status:x})=>x===Nt.items.status.ACTIVE).attr("width",f*2).attr("height",f*2).attr("class",x=>this.model.getColorClassName({classNameTypes:[st.BACKGROUND],dataGroupName:x.name,originalClassName:"checkbox"})).style("background",x=>x.status===Nt.items.status.ACTIVE?this.model.getFillColor(x.name)||this.model.getStrokeColor(x.name):null).classed("active",function(x){return x.status===Nt.items.status.ACTIVE});g.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),h.append("p").merge(d.select("p"));const v=y(n,"legend","additionalItems");if(v&&a.length){const x=this,_=u.selectAll("div.additional-item").data(v);_.exit().remove();const E=_.enter().append("div").merge(_).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(M,D)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+D}-title`));E.selectAll("*").remove();let b,S=1;E.append("svg").classed("icon",!0).each(function(M){const D=I(this);!b||b!=M.type?(b=M.type,S=1):S++,x.addAdditionalItem(D,M,S)}),E.append("p").merge(E.select("p")),this.truncateLegendText()}d.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),p&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:s}=Nt.area;if(n.type===jt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===jt.RADIUS){const{iconData:a,fill:o,stroke:l}=Nt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",ht.IMG).attr("aria-label","radius").attr("cx",c=>c.cx).attr("cy",c=>c.cy).attr("r",c=>c.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===jt.LINE){const a=Nt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",ht.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===jt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ht.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Nt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===jt.SIZE){const{iconData:a,fill:o,stroke:l}=Nt.size;t.attr("fill","none").attr("role",ht.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",c=>c.width).attr("height",c=>c.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===jt.QUARTILE){const{iconData:a}=Nt.quartile;t.selectAll("rect").attr("role",ht.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,l)=>`quartile-${l===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===jt.ZOOM){const{iconData:a,color:o}=y(Nt,"zoom"),l=t.attr("role",ht.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),l.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=y(this.getOptions(),"legend","truncation"),r=y(n,"type"),i=y(n,"threshold"),s=y(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==we.NONE?a.html(function(o){const l=ln(o.name);return l.length>i&&l.length!==s?ji(l,r,s):l}):a.html(o=>ln(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=y(r,"legend"),s=y(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(T.Legend.ITEM_HOVER,{hoveredElement:I(this)});const o=I(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==we.NONE&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){I(this).datum().name.length>s.threshold&&s.type!==we.NONE&&t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(T.Legend.ITEM_CLICK,{clickedElement:I(this)});const a=I(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=I(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==we.NONE&&t.services.events.dispatchEvent(T.Tooltip.HIDE),t.services.events.dispatchEvent(T.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(T.Legend.ITEM_HOVER,{hoveredElement:I(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(T.Legend.ITEM_MOUSEOUT,{hoveredElement:I(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=I(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class Og extends gt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=it.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class Mk extends Og{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:r}=N.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var si,Vt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Vt||(Vt={}));var Sg=(si={},si[Vt.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},si[Vt.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},si[Vt.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},si[Vt.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},si),Tg=typeof window<"u"?window:{innerHeight:0,innerWidth:0},ao=function(){function e(t){t===void 0&&(t={}),this.positions=Sg,this.positions=Object.assign({},Sg,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),d=0,h=0,p=i();u.top<p.top?d=p.top-u.top:u.bottom>p.height&&(d=u.bottom-p.height),u.left<p.left?h=p.left-u.left:u.right>p.width&&(h=u.right-p.width),d&&!h?h=1:h&&!d&&(d=1);var f=n.offsetHeight*n.offsetWidth,g=d*h,m=f-g,v=m/f;return{placement:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Tg.innerHeight,width:Tg.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new ao;class uu extends gt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=it.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new ao,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items,a=I(i.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(i));i.detail.content?o=`<div class="title-tooltip"><p>${ro(i.detail.content)}</p></div>`:o=ro(this.getTooltipHTML(l));const c=N.appendOrSelect(this.tooltip,"div.content-box");if(y(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const u=`<div class="title-tooltip"><p>${ro(i.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${ro(this.model.getOptions().tooltip.customHTML(s,o,a))}</p></div>`);else c.html(o);c.selectAll(".datapoint-tooltip").each(function(u,d){const h=l[d];l[d]&&l[d].color&&I(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(i),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=i.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(T.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==T.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(T.Tooltip.MOVE,null),this.services.events.removeEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=y(n,"tooltip","truncation","type"),i=y(n,"tooltip","truncation","threshold"),s=y(n,"tooltip","truncation","numCharacter");return r!==we.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a.label&&a.label.length+o>i&&(a.label=ji(a.label,r,s)),a.value&&a.value.length>i&&(a.value=ji(a.value,r,s)),a}):t.map(a=>(a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
|
|
52
|
+
</div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=I(this.services.domUtils.getHolder()),i=y(n,"style","prefix");this.modal=N.appendOrSelect(r,`div.${de}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class _s extends gt{constructor(){super(...arguments),this.type="title",this.renderType=it.HTML}render(t=!1){const n=this.getComponentContainer(),r=y(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>ln(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(T.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=N.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(T.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(T.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(T.Tooltip.HIDE)})}}getMaxTitleWidth(){return N.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)<i?t.getSubStringLength(0,s+1)>i?s:this.getSubstringIndex(t,s,r,i):s}}class cu extends gt{constructor(){super(...arguments),this.type="legend",this.renderType=it.HTML}render(t=!1){const n=this.getOptions(),r=y(n,"legend"),i=y(r,"alignment"),s=y(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Nt.items.status,l=a.some(x=>x.status===o),c=y(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===zt.CENTER).classed("right-aligned",i===zt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ht.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,x=>x.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(x){return x.status===Nt.items.status.ACTIVE});const p=y(this.getOptions(),"legend","clickable");u.classed("clickable",p&&a.length>1);const f=Nt.checkbox.radius,g=h.append("div").classed("checkbox",!0),m=g.merge(d.select("div.checkbox")).attr("role",ht.CHECKBOX).attr("tabindex",p?0:-1).attr("aria-labelledby",(x,_)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${_}-title`)).attr("aria-checked",({status:x})=>x===Nt.items.status.ACTIVE).attr("width",f*2).attr("height",f*2).attr("class",x=>this.model.getColorClassName({classNameTypes:[st.BACKGROUND],dataGroupName:x.name,originalClassName:"checkbox"})).style("background",x=>x.status===Nt.items.status.ACTIVE?this.model.getFillColor(x.name)||this.model.getStrokeColor(x.name):null).classed("active",function(x){return x.status===Nt.items.status.ACTIVE});g.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),h.append("p").merge(d.select("p"));const v=y(n,"legend","additionalItems");if(v&&a.length){const x=this,_=u.selectAll("div.additional-item").data(v);_.exit().remove();const E=_.enter().append("div").merge(_).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(M,D)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+D}-title`));E.selectAll("*").remove();let b,S=1;E.append("svg").classed("icon",!0).each(function(M){const D=I(this);!b||b!=M.type?(b=M.type,S=1):S++,x.addAdditionalItem(D,M,S)}),E.append("p").merge(E.select("p")),this.truncateLegendText()}d.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),p&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:s}=Nt.area;if(n.type===jt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===jt.RADIUS){const{iconData:a,fill:o,stroke:l}=Nt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",ht.IMG).attr("aria-label","radius").attr("cx",c=>c.cx).attr("cy",c=>c.cy).attr("r",c=>c.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===jt.LINE){const a=Nt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",ht.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===jt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ht.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Nt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===jt.SIZE){const{iconData:a,fill:o,stroke:l}=Nt.size;t.attr("fill","none").attr("role",ht.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",c=>c.width).attr("height",c=>c.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===jt.QUARTILE){const{iconData:a}=Nt.quartile;t.selectAll("rect").attr("role",ht.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,l)=>`quartile-${l===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===jt.ZOOM){const{iconData:a,color:o}=y(Nt,"zoom"),l=t.attr("role",ht.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),l.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=y(this.getOptions(),"legend","truncation"),r=y(n,"type"),i=y(n,"threshold"),s=y(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==we.NONE?a.html(function(o){const l=ln(o.name);return l.length>i&&l.length!==s?ji(l,r,s):l}):a.html(o=>ln(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=y(r,"legend"),s=y(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(T.Legend.ITEM_HOVER,{hoveredElement:I(this)});const o=I(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==we.NONE&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){I(this).datum().name.length>s.threshold&&s.type!==we.NONE&&t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(T.Legend.ITEM_CLICK,{clickedElement:I(this)});const a=I(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=I(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==we.NONE&&t.services.events.dispatchEvent(T.Tooltip.HIDE),t.services.events.dispatchEvent(T.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(T.Legend.ITEM_HOVER,{hoveredElement:I(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(T.Legend.ITEM_MOUSEOUT,{hoveredElement:I(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=I(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class Og extends gt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=it.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class Mk extends Og{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:r}=N.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=N.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=N.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var si,Vt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Vt||(Vt={}));var Sg=(si={},si[Vt.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},si[Vt.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},si[Vt.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},si[Vt.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},si),Tg=typeof window<"u"?window:{innerHeight:0,innerWidth:0},ao=function(){function e(t){t===void 0&&(t={}),this.positions=Sg,this.positions=Object.assign({},Sg,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),d=0,h=0,p=i();u.top<p.top?d=p.top-u.top:u.bottom>p.height&&(d=u.bottom-p.height),u.left<p.left?h=p.left-u.left:u.right>p.width&&(h=u.right-p.width),d&&!h?h=1:h&&!d&&(d=1);var f=n.offsetHeight*n.offsetWidth,g=d*h,m=f-g,v=m/f;return{placement:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Tg.innerHeight,width:Tg.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new ao;class uu extends gt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=it.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new ao,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items,a=I(i.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(i));i.detail.content?o=`<div class="title-tooltip"><p>${ro(i.detail.content)}</p></div>`:o=ro(this.getTooltipHTML(l));const c=N.appendOrSelect(this.tooltip,"div.content-box");if(y(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const u=`<div class="title-tooltip"><p>${ro(i.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${ro(this.model.getOptions().tooltip.customHTML(s,o,a))}</p></div>`);else c.html(o);c.selectAll(".datapoint-tooltip").each(function(u,d){const h=l[d];l[d]&&l[d].color&&I(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(i),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=i.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(T.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==T.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(T.Tooltip.MOVE,null),this.services.events.removeEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=y(n,"tooltip","truncation","type"),i=y(n,"tooltip","truncation","threshold"),s=y(n,"tooltip","truncation","numCharacter");return r!==we.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=this.valueFormatter(a.value,a.label),a.label&&a.label.length+o>i&&(a.label=ji(a.label,r,s)),a.value&&a.value.length>i&&(a.value=ji(a.value,r,s)),a}):t.map(a=>(a.value=this.valueFormatter(a.value,a.label),a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
|
|
53
53
|
<div class="datapoint-tooltip${n.bold?" bold":""}">
|
|
54
54
|
${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
|
|
55
55
|
<div class="label">
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
|
|
63
63
|
<polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
|
|
64
64
|
<rect width="32" height="32"/>
|
|
65
|
-
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Se extends gt{constructor(){super(...arguments),this.type="grid",this.renderType=it.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),r=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(N.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(N.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=fc(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=y(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=Jf(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=y(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(xn(u).tx)-Number(xn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+xn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+xn(o).tx;else if(o)l=+xn(o).tx-+xn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=N.getSVGElementSize(u).width-+xn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=xn(this),s={min:Number(i.tx)-r,max:Number(i.tx)+r};return s.min<=t[0]&&t[0]<=s.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=N.appendOrSelect(r,"svg.chart-grid-backdrop").attr("role","presentation");const u=N.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class Ng extends gt{constructor(){super(...arguments),this.type="area",this.renderType=it.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?vn.opacity.unselected:vn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",vn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=tu().curve(this.services.curves.getD3Curve()).defined(b=>{const S=s.getRangeIdentifier();return b[S]!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(b,S)=>{y(r,"axes",b,"includeZero")===!1&&S[0]>0&&S[1]>0&&(d=S[0])},p=b=>u?s.getBoundedScaledValues(b)[0]:s.getRangeValue(d),f=b=>u?s.getBoundedScaledValues(b)[1]:s.getRangeValue(b);a===Gt.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(b=>s.getDomainValue(b)).y0(b=>p(b)).y1(b=>f(b))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(b=>p(b)).x1(b=>f(b)).y(b=>s.getDomainValue(b)));const g=y(r,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,b=>b.name),x=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const b=x.select(`path.${this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:l[0].name})}`).node();let S;if(b)S=getComputedStyle(b,null).getPropertyValue("stroke");else{const M=y(this.model.getOptions(),"color","scale");if(M!==null){const D=Object.keys(M);S=M[D[0]]}}dc.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:dc.getStops(i,S)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const _=this,E=v.enter().append("path");m?E.merge(v).style("fill",b=>`url(#${this.services.domUtils.generateElementIDString(`${b.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",b=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:b.name,originalClassName:"area"})).attr("d",b=>{const{data:S}=b;return o(S)}):(E.attr("opacity",0).merge(v).attr("class","area").attr("class",b=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:b.name,originalClassName:"area"})).style("fill",b=>_.model.getFillColor(b.name,null,b.data)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"area-update-enter",animate:t})).attr("opacity",u?1:vn.opacity.selected).attr("d",b=>{const{data:S}=b;return o(S)}),u&&E.attr("fill-opacity",vn.opacity.selected).style("stroke",b=>_.model.getStrokeColor(b.name,null,b.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ai extends gt{constructor(){super(...arguments),this.type="line",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?yn.opacity.unselected:yn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",yn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=bn(s,a,r.getOrientation()),c=this.getOptions(),u=ms().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const f=r.getRangeIdentifier(p);return p[f]!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(g=>c.axes[g].percentage),{groupMapsTo:f}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(g=>{const m=this.services.cartesianScales.getDomainIdentifier(g),v=this.services.cartesianScales.getRangeIdentifier(g);return{name:y(g,0,f),data:g.map(x=>({[m]:x.data.sharedStackKey,[f]:x[f],[v]:x[1]})),hidden:!OC(g,x=>x[0]!==x[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:f}=p;return f.map(g=>{const m=this.services.cartesianScales.getRangeIdentifier(g);return g[m]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:f}=p;return u(f)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Pg=5;function Jk(e,t){return e>t-Pg&&e<t+Pg}class Gn extends gt{constructor(){super(...arguments),this.type="ruler",this.renderType=it.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Gt.HORIZONTAL?r:n,d=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=N.appendOrSelect(d,"line.ruler-line"),p=i.selectAll("[role=graphics-symbol]"),f=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>Jk(m.domainValue,u));if(this.pointsWithinLine&&f.length===this.pointsWithinLine.length&&f.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=f,this.services.events.dispatchEvent(T.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=f;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const x=m[0].domainValue,_=Math.abs(u-v.domainValue),E=Math.abs(u-x);return _>E||(_<E?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(E=>E.originalData).filter(E=>{const b=this.services.cartesianScales.getRangeIdentifier(E);return E[b]!=null}),v=g.map(E=>E.domainValue),x=p.filter(E=>{const b=this.services.cartesianScales.getDomainValue(E);return v.includes(b)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Zf(this.elementsToHighlight,x)&&this.hideRuler(),x.dispatch("mouseover"),this.elementsToHighlight=x,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const _=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",_.domainValue).attr("y2",_.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",_.domainValue).attr("x2",_.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=N.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(T.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=er(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=XT(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-grid-backdrop")}}let cn=class extends gt{constructor(){super(...arguments),this.type="scatter",this.renderType=it.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=bn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=bn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=p=>a.getDomainValue(p),c=p=>a.getRangeValue(p),[u,d]=bn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",p=>{const f=a.getDomainIdentifier(p),g=this.model.getIsFilled(p[o],p[f],p,i)?[st.FILL,st.STROKE]:[st.STROKE];return this.model.getColorClassName({classNameTypes:g,dataGroupName:p[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",p=>this.isDatapointThresholdAnomaly(p)).classed("filled",p=>{const f=a.getDomainIdentifier(p);return this.model.getIsFilled(p[o],p[f],p,i)}).classed("unfilled",p=>{const f=a.getDomainIdentifier(p);return!this.model.getIsFilled(p[o],p[f],p,i)}).transition().call(p=>{var f;return(f=this.services.transitions)==null?void 0:f.setupTransition({transition:p,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",d).attr("r",r.points.radius).style("fill",p=>{const f=a.getDomainIdentifier(p);if(this.model.getIsFilled(p[o],p[f],p,i))return this.model.getFillColor(p[o],p[f],p)}).style("stroke",p=>{const f=a.getDomainIdentifier(p);return this.model.getStrokeColor(p[o],p[f],p)}).attr("fill-opacity",i?s:1).attr("opacity",h?0:1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",p=>{const f=a.getRangeIdentifier(p);return p[f]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var s,a;const o=I(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{var c;const u=(c=t.services.cartesianScales)==null?void 0:c.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[u],l)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var s,a;const o=I(this);(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(a=t.services.events)==null||a.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=I(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:l})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}};class Ug extends gt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=it.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=y(r,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=N.getSVGElementSize(s,{useAttrs:!0}),l=N.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===nt.LABELS||this.scaleType===nt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Jf;break;case z.BOTTOM:h=fc;break;case z.RIGHT:h=kC;break;case z.TOP:h=LC;break}l.attr("aria-label",`${n} axis`);const p=!l.select("g.ticks").empty();let f=N.appendOrSelect(l,"g.ticks");p||(f.attr("role",`${ht.GRAPHICS_OBJECT} ${ht.GROUP}`),f.attr("aria-label",`${n} ticks`));const g=N.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(r,"axes",n),v=this.scaleType===nt.TIME||m.scaleType===nt.TIME,x=n===z.LEFT||n===z.RIGHT,_=this.model.get("zoomDomain");if(_&&v&&!x&&d.domain(_),!i){f.attr("aria-hidden",!0);return}const E=y(m,"scaleType"),b=y(r,"data","loading"),S=y(m,"ticks","number"),M=y(m,"ticks","values"),D=y(m,"truncation","type"),A=y(m,"truncation","threshold"),R=y(m,"truncation","numCharacter"),$=S!==null,H=y(r,"timeScale"),P=N.appendOrSelect(g,"g.tick"),B=N.appendOrSelect(P,"text").text("0"),O=N.getSVGElementSize(B.node(),{useBBox:!0}).height;P.remove();const w=this.scaleType||m.scaleType||nt.LINEAR,L=h(d).tickSizeOuter(0);if(d.ticks){let Y;if($?Y=S:(Y=Nn.ticks.number,x&&(Y=this.getNumberOfFittingTicks(o,O,Nn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(Y=0),L.ticks(Y),v)if(!d.ticks(Y).length)L.tickValues([]);else{const et=y(r,"timeScale","addSpaceOnEdges"),ut=y(r,"axes",n,"domain"),F=d.copy();et&&!ut&&F.nice(Y);const q=F.ticks(Y);et&&q.length>2&&!ut&&(q.splice(q.length-1,1),q.splice(0,1)),L.tickValues(q)}}let k;const U=y(m,"ticks","formatter"),{code:K,number:W}=y(r,"locale");if(v){const Y=jl(L.tickValues(),y(r,"timeScale","timeInterval"));U===null?k=(et,ut)=>Fl(et,ut,L.tickValues(),Y,H,r.locale):k=(et,ut)=>{const F=Fl(et,ut,L.tickValues(),Y,H,r.locale);return U(et,ut,F)}}else U===null?w===nt.LINEAR&&(k=Y=>W(Y,K)):k=U;L.tickFormat(k);const[j,X]=this.services.cartesianScales.getScaleByPosition(n).domain();let ct;if(M){if(v)M.forEach((Y,et)=>{Y.getTime===void 0&&(M[et]=new Date(Y))}),ct=M.filter(Y=>{const et=Y.getTime();return et>=new Date(j).getTime()&&et<=new Date(X).getTime()});else if(E===nt.LABELS){const Y=this.services.cartesianScales.getScaleByPosition(n).domain();ct=M.filter(et=>Y.includes(et))}else ct=M.filter(Y=>Y>=j&&Y<=X);L.tickValues(ct)}switch(n){case z.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:f.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:f.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:f.attr("transform",`translate(0, ${this.margins.top})`);break}const J=this.model.isDataEmpty();if(m.title){const Y=N.appendOrSelect(l,"text.axis-title").html(J||b?"":ln(m.title)),et=y(m,"titleOrientation");let ut;switch(n){case z.LEFT:et===Cs.RIGHT?Y.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):Y.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:et===Cs.LEFT?Y.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):Y.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:ut=N.getSVGElementSize(Y,{useBBox:!0}).height,Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ut/2})`).style("text-anchor","middle");break}}if(v){const Y=jl(L.tickValues(),y(r,"timeScale","timeInterval")),et=H.showDayName,ut=f;t&&(f=f.transition().call(F=>this.services.transitions.setupTransition({transition:F,name:"axis-update",animate:t}))),f=f.call(L),ut.selectAll(".tick").data(L.tickValues(),d).order().select("text").attr("class",(F,q)=>Rp(F,q,L.tickValues(),Y,et)?"tick-label--primary":"tick-label")}else!t||!p?f=f.call(L):f=f.transition().call(Y=>this.services.transitions.setupTransition({transition:Y,name:"axis-update",animate:t})).call(L);if(g.call(L),n===z.BOTTOM||n===z.TOP){let Y=!1;const et=y(m,"ticks","rotation");if(et===fi.ALWAYS)Y=!0;else if(et===fi.NEVER)Y=!1;else if(!et||et===fi.AUTO)if(d.step)Y=g.selectAll("g.tick text").nodes().some(ut=>N.getSVGElementSize(ut,{useBBox:!0}).width>=d.step());else{Y=!1;const ut=g.append("text").text("A"),F=N.getSVGElementSize(ut.node(),{useBBox:!0}).width;let q;g.selectAll("g.tick").each(function(){const Z=I(this),G=parseFloat(y(xn(this),"tx"));G!==null&&q+Z.text().length*F*.8>=G&&(Y=!0),q=G}),ut.remove()}Y?($||(L.ticks(this.getNumberOfFittingTicks(a,O,Nn.ticks.horizontalSpaceRatio)),g.call(L),f.call(L)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(b?l.attr("opacity",0):l.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",Y=>Y),g.selectAll("g.tick").attr("aria-label",Y=>Y),D!==we.NONE&&E===nt.LABELS&&!M){const Y=this.services.cartesianScales.getScaleDomain(n);if(Y.length>0){const et=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(et);const ut=this;l.selectAll("g.tick text").data(Y).text(function(F){return F.length>A?(ut.truncation[n]=!0,ji(F,D,R)):F}),this.getInvisibleAxisRef().selectAll("g.tick text").data(Y).text(function(F){return F.length>A?ji(F,D,R):F}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(Y)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===nt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===nt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===nt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,r){const i=Math.floor(t/(n*r));return Xf(i,2,Nn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;N.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class tD extends Ug{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer({ariaLabel:"axes"}),i=N.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0}),h=N.appendOrSelect(l,"rect.axis-holder");let p=0,f=0;switch(n){case z.LEFT:p=-u+Number(c.attr("x")),f=-(d/2);break;case z.RIGHT:p=Math.abs(Number(c.attr("x"))),f=-(d/2);break;case z.TOP:p=-(u/2),f=-d+Number(c.attr("y"))/2,s.truncation[n]&&(p=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:p=-(u/2),f=d/2-2,s.truncation[n]&&(p=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",p-Nn.hover.rectanglePadding).attr("y",f).attr("width",u+Nn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===nt.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===nt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(T.Tooltip.HIDE),l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;N.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class me extends gt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=it.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(z),i=y(this.getOptions(),"axes");r.forEach(a=>{i[z[a]]&&(n[z[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=z[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===gi.DEFAULT?new Ug(this.model,this.services,l):new tD(this.model,this.services,l);c.setModel(this.model),c.setServices(this.services),c.setParent(this.parent),this.children[o]=c}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0});let h;switch(o.getTitleRef().empty()?h=0:(h=N.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===z.LEFT||l===z.RIGHT)&&(h+=5)),l){case z.TOP:s.top=d+h;break;case z.BOTTOM:s.bottom=d+h;break;case z.LEFT:s.left=u+h;break;case z.RIGHT:s.right=u+h;break}}),this.services.events.dispatchEvent(T.Axis.RENDER_COMPLETE),Object.keys(s).some(a=>this.margins[a]!==s[a])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(T.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class ce extends gt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Ft.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Ft.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Ft.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Ft.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Gt.VERTICAL&&this.drawYGrid(t),n===Gt.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=je().domain([0,1]).range(t),this.yScale=je().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});this.backdrop=N.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=y(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=N.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=N.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=N.getSVGElementSize(i,{useAttrs:!0}),o=N.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");N.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=fs().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,p=N.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let f=t+Lt.xOffset;c===zt.CENTER?f=s/2:c===zt.RIGHT&&(f=s-t-Lt.xOffset);const g=t+Lt.yOffset;p.attr("transform",`translate(${f}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:s}=N.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=N.appendOrSelect(i,"defs").lower(),c=N.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",a-3*.2*s).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
|
|
65
|
+
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Se extends gt{constructor(){super(...arguments),this.type="grid",this.renderType=it.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),r=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(N.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(N.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=fc(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=y(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=Jf(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=y(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(xn(u).tx)-Number(xn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+xn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+xn(o).tx;else if(o)l=+xn(o).tx-+xn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=N.getSVGElementSize(u).width-+xn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=xn(this),s={min:Number(i.tx)-r,max:Number(i.tx)+r};return s.min<=t[0]&&t[0]<=s.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=N.appendOrSelect(r,"svg.chart-grid-backdrop").attr("role","presentation");const u=N.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class Ng extends gt{constructor(){super(...arguments),this.type="area",this.renderType=it.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?vn.opacity.unselected:vn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",vn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=tu().curve(this.services.curves.getD3Curve()).defined(b=>{const S=s.getRangeIdentifier();return b[S]!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(b,S)=>{y(r,"axes",b,"includeZero")===!1&&S[0]>0&&S[1]>0&&(d=S[0])},p=b=>u?s.getBoundedScaledValues(b)[0]:s.getRangeValue(d),f=b=>u?s.getBoundedScaledValues(b)[1]:s.getRangeValue(b);a===Gt.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(b=>s.getDomainValue(b)).y0(b=>p(b)).y1(b=>f(b))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(b=>p(b)).x1(b=>f(b)).y(b=>s.getDomainValue(b)));const g=y(r,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,b=>b.name),x=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const b=x.select(`path.${this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:l[0].name})}`).node();let S;if(b)S=getComputedStyle(b,null).getPropertyValue("stroke");else{const M=y(this.model.getOptions(),"color","scale");if(M!==null){const D=Object.keys(M);S=M[D[0]]}}dc.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:dc.getStops(i,S)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const _=this,E=v.enter().append("path");m?E.merge(v).style("fill",b=>`url(#${this.services.domUtils.generateElementIDString(`${b.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",b=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:b.name,originalClassName:"area"})).attr("d",b=>{const{data:S}=b;return o(S)}):(E.attr("opacity",0).merge(v).attr("class","area").attr("class",b=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:b.name,originalClassName:"area"})).style("fill",b=>_.model.getFillColor(b.name,null,b.data)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"area-update-enter",animate:t})).attr("opacity",u?1:vn.opacity.selected).attr("d",b=>{const{data:S}=b;return o(S)}),u&&E.attr("fill-opacity",vn.opacity.selected).style("stroke",b=>_.model.getStrokeColor(b.name,null,b.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ai extends gt{constructor(){super(...arguments),this.type="line",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?yn.opacity.unselected:yn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",yn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=bn(s,a,r.getOrientation()),c=this.getOptions(),u=ms().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const f=r.getRangeIdentifier(p);return p[f]!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(g=>c.axes[g].percentage),{groupMapsTo:f}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(g=>{const m=this.services.cartesianScales.getDomainIdentifier(g),v=this.services.cartesianScales.getRangeIdentifier(g);return{name:y(g,0,f),data:g.map(x=>({[m]:x.data.sharedStackKey,[f]:x[f],[v]:x[1]})),hidden:!OC(g,x=>x[0]!==x[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:f}=p;return f.map(g=>{const m=this.services.cartesianScales.getRangeIdentifier(g);return g[m]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:f}=p;return u(f)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Pg=5;function Jk(e,t){return e>t-Pg&&e<t+Pg}class Gn extends gt{constructor(){super(...arguments),this.type="ruler",this.renderType=it.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Gt.HORIZONTAL?r:n,d=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=N.appendOrSelect(d,"line.ruler-line"),p=i.selectAll("[role=graphics-symbol]"),f=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>Jk(m.domainValue,u));if(this.pointsWithinLine&&f.length===this.pointsWithinLine.length&&f.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=f,this.services.events.dispatchEvent(T.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=f;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const x=m[0].domainValue,_=Math.abs(u-v.domainValue),E=Math.abs(u-x);return _>E||(_<E?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(E=>E.originalData).filter(E=>{const b=this.services.cartesianScales.getRangeIdentifier(E);return E[b]!=null}),v=g.map(E=>E.domainValue),x=p.filter(E=>{const b=this.services.cartesianScales.getDomainValue(E);return v.includes(b)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Zf(this.elementsToHighlight,x)&&this.hideRuler(),x.dispatch("mouseover"),this.elementsToHighlight=x,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const _=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",_.domainValue).attr("y2",_.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",_.domainValue).attr("x2",_.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=N.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(T.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=er(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=XT(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-grid-backdrop")}}let cn=class extends gt{constructor(){super(...arguments),this.type="scatter",this.renderType=it.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=bn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=bn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=p=>a.getDomainValue(p),c=p=>a.getRangeValue(p),[u,d]=bn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",p=>{const f=a.getDomainIdentifier(p),g=this.model.getIsFilled(p[o],p[f],p,i)?[st.FILL,st.STROKE]:[st.STROKE];return this.model.getColorClassName({classNameTypes:g,dataGroupName:p[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",p=>this.isDatapointThresholdAnomaly(p)).classed("filled",p=>{const f=a.getDomainIdentifier(p);return this.model.getIsFilled(p[o],p[f],p,i)}).classed("unfilled",p=>{const f=a.getDomainIdentifier(p);return!this.model.getIsFilled(p[o],p[f],p,i)}).transition().call(p=>{var f;return(f=this.services.transitions)==null?void 0:f.setupTransition({transition:p,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",d).attr("r",r.points.radius).style("fill",p=>{const f=a.getDomainIdentifier(p);if(this.model.getIsFilled(p[o],p[f],p,i))return this.model.getFillColor(p[o],p[f],p)}).style("stroke",p=>{const f=a.getDomainIdentifier(p);return this.model.getStrokeColor(p[o],p[f],p)}).attr("fill-opacity",i?s:1).attr("opacity",h?0:1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",p=>{const f=a.getRangeIdentifier(p);return p[f]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var s,a;const o=I(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{var c;const u=(c=t.services.cartesianScales)==null?void 0:c.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[u],l)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var s,a;const o=I(this);(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(a=t.services.events)==null||a.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=I(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:l})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}};class Ug extends gt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=it.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=y(r,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=N.getSVGElementSize(s,{useAttrs:!0}),l=N.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===nt.LABELS||this.scaleType===nt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Jf;break;case z.BOTTOM:h=fc;break;case z.RIGHT:h=kC;break;case z.TOP:h=LC;break}l.attr("aria-label",`${n} axis`);const p=!l.select("g.ticks").empty();let f=N.appendOrSelect(l,"g.ticks");p||(f.attr("role",`${ht.GRAPHICS_OBJECT} ${ht.GROUP}`),f.attr("aria-label",`${n} ticks`));const g=N.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(r,"axes",n),v=this.scaleType===nt.TIME||m.scaleType===nt.TIME,x=n===z.LEFT||n===z.RIGHT,_=this.model.get("zoomDomain");if(_&&v&&!x&&d.domain(_),!i){f.attr("aria-hidden",!0);return}const E=y(m,"scaleType"),b=y(r,"data","loading"),S=y(m,"ticks","number"),M=y(m,"ticks","values"),D=y(m,"truncation","type"),A=y(m,"truncation","threshold"),R=y(m,"truncation","numCharacter"),$=S!==null,H=y(r,"timeScale"),P=N.appendOrSelect(g,"g.tick"),B=N.appendOrSelect(P,"text").text("0"),O=N.getSVGElementSize(B.node(),{useBBox:!0}).height;P.remove();const w=this.scaleType||m.scaleType||nt.LINEAR,L=h(d).tickSizeOuter(0);if(d.ticks){let Y;if($?Y=S:(Y=Nn.ticks.number,x&&(Y=this.getNumberOfFittingTicks(o,O,Nn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(Y=0),L.ticks(Y),v)if(!d.ticks(Y).length)L.tickValues([]);else{const et=y(r,"timeScale","addSpaceOnEdges"),ut=y(r,"axes",n,"domain"),F=d.copy();et&&!ut&&F.nice(Y);const q=F.ticks(Y);et&&q.length>2&&!ut&&(q.splice(q.length-1,1),q.splice(0,1)),L.tickValues(q)}}let k;const U=y(m,"ticks","formatter"),{code:K,number:W}=y(r,"locale");if(v){const Y=jl(L.tickValues(),y(r,"timeScale","timeInterval"));U===null?k=(et,ut)=>Fl(et,ut,L.tickValues(),Y,H,r.locale):k=(et,ut)=>{const F=Fl(et,ut,L.tickValues(),Y,H,r.locale);return U(et,ut,F)}}else U===null?w===nt.LINEAR&&(k=Y=>W(Y,K)):k=U;L.tickFormat(k);const[j,X]=this.services.cartesianScales.getScaleByPosition(n).domain();let ct;if(M){if(v)M.forEach((Y,et)=>{Y.getTime===void 0&&(M[et]=new Date(Y))}),ct=M.filter(Y=>{const et=Y.getTime();return et>=new Date(j).getTime()&&et<=new Date(X).getTime()});else if(E===nt.LABELS){const Y=this.services.cartesianScales.getScaleByPosition(n).domain();ct=M.filter(et=>Y.includes(et))}else ct=M.filter(Y=>Y>=j&&Y<=X);L.tickValues(ct)}switch(n){case z.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:f.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:f.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:f.attr("transform",`translate(0, ${this.margins.top})`);break}const J=this.model.isDataEmpty();if(m.title){const Y=N.appendOrSelect(l,"text.axis-title").html(J||b?"":ln(m.title)),et=y(m,"titleOrientation");let ut;switch(n){case z.LEFT:et===Cs.RIGHT?Y.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):Y.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:et===Cs.LEFT?Y.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):Y.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:ut=N.getSVGElementSize(Y,{useBBox:!0}).height,Y.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ut/2})`).style("text-anchor","middle");break}}if(v){const Y=jl(L.tickValues(),y(r,"timeScale","timeInterval")),et=H.showDayName,ut=f;t&&(f=f.transition().call(F=>this.services.transitions.setupTransition({transition:F,name:"axis-update",animate:t}))),f=f.call(L),ut.selectAll(".tick").data(L.tickValues(),d).order().select("text").attr("class",(F,q)=>Rp(F,q,L.tickValues(),Y,et)?"tick-label--primary":"tick-label")}else!t||!p?f=f.call(L):f=f.transition().call(Y=>this.services.transitions.setupTransition({transition:Y,name:"axis-update",animate:t})).call(L);if(g.call(L),n===z.BOTTOM||n===z.TOP){let Y=!1;const et=y(m,"ticks","rotation");if(et===fi.ALWAYS)Y=!0;else if(et===fi.NEVER)Y=!1;else if(!et||et===fi.AUTO)if(d.step)Y=g.selectAll("g.tick text").nodes().some(ut=>N.getSVGElementSize(ut,{useBBox:!0}).width>=d.step());else{Y=!1;const ut=g.append("text").text("A"),F=N.getSVGElementSize(ut.node(),{useBBox:!0}).width;let q;g.selectAll("g.tick").each(function(){const Z=I(this),G=parseFloat(y(xn(this),"tx"));G!==null&&q+Z.text().length*F*.8>=G&&(Y=!0),q=G}),ut.remove()}Y?($||(L.ticks(this.getNumberOfFittingTicks(a,O,Nn.ticks.horizontalSpaceRatio)),g.call(L),f.call(L)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(b?l.attr("opacity",0):l.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",Y=>Y),g.selectAll("g.tick").attr("aria-label",Y=>Y),D!==we.NONE&&E===nt.LABELS&&!M){const Y=this.services.cartesianScales.getScaleDomain(n);if(Y.length>0){const et=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(et);const ut=this;l.selectAll("g.tick text").data(Y).text(function(F){return F.length>A?(ut.truncation[n]=!0,ji(F,D,R)):F}),this.getInvisibleAxisRef().selectAll("g.tick text").data(Y).text(function(F){return F.length>A?ji(F,D,R):F}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(Y)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===nt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===nt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===nt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,r){const i=Math.floor(t/(n*r));return Xf(i,2,Nn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;N.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class tD extends Ug{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer({ariaLabel:"axes"}),i=N.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0}),h=N.appendOrSelect(l,"rect.axis-holder");let p=0,f=0;switch(n){case z.LEFT:p=-u+Number(c.attr("x")),f=-(d/2);break;case z.RIGHT:p=Math.abs(Number(c.attr("x"))),f=-(d/2);break;case z.TOP:p=-(u/2),f=-d+Number(c.attr("y"))/2,s.truncation[n]&&(p=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:p=-(u/2),f=d/2-2,s.truncation[n]&&(p=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",p-Nn.hover.rectanglePadding).attr("y",f).attr("width",u+Nn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=N.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===nt.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===nt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(T.Tooltip.HIDE),l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;N.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class me extends gt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=it.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(z),i=y(this.getOptions(),"axes");r.forEach(a=>{i[z[a]]&&(n[z[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=z[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===gi.DEFAULT?new Ug(this.model,this.services,l):new tD(this.model,this.services,l);c.setModel(this.model),c.setServices(this.services),c.setParent(this.parent),this.children[o]=c}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:d}=N.getSVGElementSize(c,{useBBox:!0});let h;switch(o.getTitleRef().empty()?h=0:(h=N.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===z.LEFT||l===z.RIGHT)&&(h+=5)),l){case z.TOP:s.top=d+h;break;case z.BOTTOM:s.bottom=d+h;break;case z.LEFT:s.left=u+h;break;case z.RIGHT:s.right=u+h;break}}),this.services.events.dispatchEvent(T.Axis.RENDER_COMPLETE),Object.keys(s).some(a=>this.margins[a]!==s[a])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(T.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class ce extends gt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Ft.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Ft.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Ft.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Ft.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Gt.VERTICAL&&this.drawYGrid(t),n===Gt.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=je().domain([0,1]).range(t),this.yScale=je().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});this.backdrop=N.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",r).attr("height",i);const s=N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=y(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=N.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=N.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=N.getSVGElementSize(i,{useAttrs:!0}),o=N.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");N.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=fs().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,p=N.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let f=t+Lt.xOffset;c===zt.CENTER?f=s/2:c===zt.RIGHT&&(f=s-t-Lt.xOffset);const g=t+Lt.yOffset;p.attr("transform",`translate(${f}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:s}=N.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=N.appendOrSelect(i,"defs").lower(),c=N.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",a-3*.2*s).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
|
|
66
66
|
<stop class="${n}" offset="${a}"></stop>
|
|
67
67
|
<stop class="${r}" offset="${a+.2}"></stop>
|
|
68
68
|
<stop class="${n}" offset="${a+2*.2}"></stop>
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
|
|
71
71
|
<polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
|
|
72
72
|
<path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
|
|
73
|
-
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(f=>{if(f!==null)return typeof f.data.value=="number"?{label:f.data.name,value:f.data.value}:{label:f.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:f.value}});const p=t.model.getOptions();u=[{label:yt(p,"locale.translations.total")||yt(p,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=I(this),s=i.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Hr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Hr),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function ED(e,t){const n=Ni(this._current,e);return r=>(this._current=n(r),t(this._current))}class Vg extends gt{constructor(){super(...arguments),this.type="pie",this.renderType=it.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(A=>A[a]>0),l=this.computeRadius();this.arc=fs().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=fs().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const c=ZL().value(A=>A[a]).sort(y(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",ht.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,A=>A.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",A=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:A.data[s],originalClassName:"slice"})).style("fill",A=>n.model.getFillColor(A.data[s],null,A.data)).attr("d",this.arc).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",A=>`${A[a]}, ${Hl(A.data[a],o,a)+"%"}`).attrTween("d",function(A){return ED.bind(this)(A,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=y(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(A=>A.data[a]>0):[],g=N.appendOrSelect(r,"g.labels").attr("role",ht.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,A=>A.data[s]);g.exit().attr("opacity",0).remove();const m=g.enter().append("text").classed("pie-label",!0),v=[];m.merge(g).style("text-anchor","middle").text(A=>i.pie.labels.formatter?i.pie.labels.formatter({...A,percentageValue:Hl(A.data[a],o,a,!0)}):h(Hl(A.data[a],o,a),d)+"%").datum(function(A){const R=l+7,$=(A.endAngle-A.startAngle)/2+A.startAngle,H=$/Math.PI*180,P=this.getComputedTextLength();return A.textOffsetX=P/2,A.textOffsetY=H>90&&H<270?10:0,A.xPosition=(A.textOffsetX+R)*Math.sin($),A.yPosition=(A.textOffsetY+R)*-Math.cos($),A}).attr("transform",function(A,R){const $=f.length,H=(A.endAngle-A.startAngle)*(180/Math.PI);if(R>=$-2&&H<Lt.callout.minSliceDegree){let P,B;return A.index===$-1?(P=A.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+A.textOffsetX,B=A.yPosition-Lt.callout.offsetY,A.direction=di.RIGHT,v.push(A)):(P=A.xPosition-Lt.callout.offsetX-A.textOffsetX-Lt.callout.textMargin,B=A.yPosition-Lt.callout.offsetY,A.direction=di.LEFT,v.push(A)),`translate(${P}, ${B})`}return`translate(${A.xPosition}, ${A.yPosition})`}),this.renderCallouts(v);const x=y(i,"donut")?"donut":"pie",_=y(i,x,"alignment"),{width:E}=N.getSVGElementSize(this.getParent(),{useAttrs:!0}),b=p?Lt.xOffset:0,S=p?Lt.yOffset:0;let M=l+b;_===zt.CENTER?M=E/2:_===zt.RIGHT&&(M=E-l-Lt.xOffset);let D=l+S;v.length>0&&(D+=Lt.yOffsetCallout),r.attr("x",M+7).attr("y",D),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ht.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ht.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===di.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Lt.callout.offsetX,y:o-Lt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Lt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Lt.callout.offsetX,y:o-Lt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Lt.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=I(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);vC(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class OD extends Vg{constructor(){super(...arguments),this.type="donut",this.renderType=it.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=N.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");N.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&N.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=y(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=Id:s=xe;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const Gg="4,10 8,6 12,10",zg="12,6 8,10 4,6";class SD extends gt{constructor(){super(...arguments),this.type="gauge",this.renderType=it.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return Xf(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===Wn.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(y(n,"gauge","deltaArrow","direction")){case Ms.UP:return Gg;case Ms.DOWN:return zg;default:return t>0?Gg:zg}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=fs().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=fs().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),N.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const p=n.selectAll("path.arc-foreground").data([i]);p.enter().append("path").merge(p).attr("class",this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),p.exit().remove();const f=y(r,"gauge","alignment"),{width:g}=N.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;f===zt.CENTER?m=g/2:f===zt.RIGHT&&(m=g-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;r===Wn.FULL&&!s?d=l(a):r===Wn.SEMI&&s&&(d=-(l(a)+c));const h=N.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),p=o(a),f=N.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),x=f.selectAll("text.gauge-value-number").data([i]);x.enter().append("text").attr("class","gauge-value-number").merge(x).style("font-size",`${p}px`).attr("text-anchor","middle").text(A=>{let R;return A!=null?R=Number(A.toFixed(2))%1!==0?A.toFixed(2):A.toFixed():R=0,v?v(R):m(Number(R),g)});const{width:_}=N.getSVGElementSize(N.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),E=p/2,b=u?"%":"",S=N.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${E}px`).attr("x",_/2).text(b),{width:M,height:D}=N.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${D/2}px`),f.attr("transform",`translate(-${M/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=y(r,"locale");if(i){const o=this.computeRadius(),l=i?y(r,"gauge","deltaFontSize"):()=>0,c=i?y(r,"gauge","numberFormatter"):()=>null,u=y(r,"gauge","deltaArrow","size"),d=y(r,"gauge","numberSpacing"),h=y(r,"gauge","showPercentageSymbol"),p=N.appendOrSelect(n,"g.gauge-numbers"),f=N.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=N.appendOrSelect(f,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(E=>{let b;return E!=null?b=Number(E.toFixed(2))%1!==0?E.toFixed(2):E.toFixed():b=0,c?`${c(b)}${m}`:`${a(Number(b),s)}${m}`});const{width:v}=N.getSVGElementSize(N.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),x=y(r,"gauge","deltaArrow","enabled"),_=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&x?[i]:[]);_.enter().append("svg").merge(_).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const E=I(this);N.appendOrSelect(E,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=y(r,"gauge","status");N.appendOrSelect(E,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),_.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});return n===Wn.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Fg extends vu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=it.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=Li(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars").merge(o);l.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const d=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Gt.VERTICAL?`translate(${d}, 0)`:`translate(0, ${d})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return this.model.getFillColor(u[i],u[d],u)}).attr("d",u=>{const d=this.groupScale(u[i]),h=this.getBarWidth(),p=d,f=d+h,g=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(g),v=this.services.cartesianScales.getValueThroughAxisPosition(g,m),x=this.services.cartesianScales.getRangeValue(u),_=this.services.cartesianScales.getDomainValue(u)-h/2,E=_+h;if(!this.isOutsideZoomedDomain(_,E))return ie({x0:p,x1:f,y0:v,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),r=y(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Yi().domain(t).rangeRound([0,this.getGroupWidth()])}}class TD extends gt{constructor(){super(...arguments),this.type="heatmap",this.renderType=it.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,p=null;this.matrix[r]!==void 0?(u=a,i.forEach(f=>{if(typeof this.matrix[r][f].value=="number"){const g=this.matrix[r][f].value;if(d===null){d=g,h=g,p=g;return}d+=g,h=g<h?g:h,p=g>p?g:p}})):(u=o,s.forEach(f=>{if(typeof this.matrix[f][r].value=="number"){const g=this.matrix[f][r].value;if(d===null){d=g,h=g,p=g;return}d+=g,h=g<h?g:h,p=g>p?g:p}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${In(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${In(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:p!==null?p:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const p=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",p).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const f=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${p})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(f.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=N.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);N.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),N.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),N.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),N.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==$r.OFF&&(t===$r.AUTO&&hp.minCellDividerDimension<=this.xBandwidth&&hp.minCellDividerDimension<=this.yBandwidth||t===$r.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=Fi(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const d=I(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{event:c,hoveredElement:d}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class wD extends gt{constructor(){super(...arguments),this.type="histogram",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ht.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,p=this.services.cartesianScales.getDomainValue(d.x0),f=p+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Gt.VERTICAL?m+=1:m-=1),ie({x0:p,x1:f,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class $D extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=it.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?yn.weight.unselected:yn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",yn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?yn.opacity.unselected:yn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",yn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,p]=bn(c,u,d),f=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);f.exit().attr("opacity",0).remove();const g=f.enter().append("line").attr("opacity",0).merge(f).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Gt.HORIZONTAL?g.attr("y1",p).attr("y2",p).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):g.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>p(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class MD extends gt{constructor(){super(...arguments),this.type="meter",this.renderType=it.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-Kt.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-Kt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=y(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=N.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;y(i,"meter","proportional")===null?u=100:u=y(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=je().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),p=y(i,"meter","height");N.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(s?Kt.height.proportional:Kt.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(s?Kt.height.proportional:Kt.height.default));const f=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";f.enter().append("rect").classed("value",!0).merge(f).attr("x",_=>_.x).attr("y",0).attr("height",()=>p||(s?Kt.height.proportional:Kt.height.default)).attr("class",_=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:_[c],originalClassName:g})).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"meter-bar-update",animate:t})).attr("width",_=>_.value>u?d(u):Math.max(_.width,2)).style("fill",_=>n.model.getFillColor(_[c],null,_)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",_=>_.value),f.exit().remove();const m=y(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const x=r.selectAll("line.peak").data(v==null?[]:[v]);x.enter().append("line").classed("peak",!0).merge(x).attr("y1",0).attr("y2",()=>p||(s?Kt.height.proportional:Kt.height.default)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"peak-line-update",animate:t})).attr("x1",_=>d(_)).attr("x2",_=>d(_)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",_=>_),x.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class CD extends gt{constructor(){super(...arguments),this.type="radar",this.renderType=it.SVG,this.getLabelDimensions=t=>{const n=N.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=N.appendOrSelect(n,"text").text(t),{width:i,height:s}=N.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=_C(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return at(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:at(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?sr.opacity.unselected:sr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?sr.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",sr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:p,yTicksNumber:f,minRange:g,xAxisRectHeight:m}=sr;this.uniqueKeys=Array.from(new Set(s.map(O=>O[u]))),this.uniqueGroups=Array.from(new Set(s.map(O=>O[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),x=(Math.min(r,i)-v)/2;if(x<=0)return;const _=Yi().domain(this.fullDataNormalized.map(O=>O[u])).range([0,2*Math.PI].map(O=>O-Math.PI/2)),E=In(this.fullDataNormalized.map(O=>O[d])),b=je().domain([E>=0?0:E,tr(this.fullDataNormalized.map(O=>O[d]))]).range([g,x]).nice(f),S=b.ticks(f),M=(O,w,L)=>this.model.getFillColor(O,w,L),D=JL().angle(O=>_(O[u])+Math.PI/2).radius(O=>b(O[d])).curve(ff),A=this.uniqueKeys.map(O=>{const w=this.getLabelDimensions(O).width,L=T2(_(O),x);return w+L}),R={x:tr(A)+h,y:i/2},$=N.appendOrSelect(n,"g.y-axes").attr("role",ht.GROUP).selectAll("path").data(S,O=>O),H=O=>this.uniqueKeys.map(w=>({[u]:w,[d]:O}));$.join(O=>O.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",L=>D(H(L)))),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",L=>D(H(L)))),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_exit",animate:t})).attr("d",L=>D(H(L))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",ht.GROUP).selectAll("line").data(this.uniqueKeys,O=>O).join(O=>O.append("line").attr("opacity",0).attr("class",w=>`x-axis-${Kr(w)}`).attr("stroke-dasharray","0").attr("x1",w=>Ut(_(w),0,R).x).attr("y1",w=>Ut(_(w),0,R).y).attr("x2",w=>Ut(_(w),0,R).x).attr("y2",w=>Ut(_(w),0,R).y).call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",L=>Ut(_(L),b.range()[0],R).x).attr("y1",L=>Ut(_(L),b.range()[0],R).y).attr("x2",L=>Ut(_(L),b.range()[1],R).x).attr("y2",L=>Ut(_(L),b.range()[1],R).y)),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",L=>Ut(_(L),b.range()[0],R).x).attr("y1",L=>Ut(_(L),b.range()[0],R).y).attr("x2",L=>Ut(_(L),b.range()[1],R).x).attr("y2",L=>Ut(_(L),b.range()[1],R).y)),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-labels").attr("role",ht.GROUP).selectAll("text").data(this.uniqueKeys).join(O=>O.append("text").text(w=>w).attr("opacity",0).attr("x",w=>Ut(_(w),b.range()[1]+h,R).x).attr("y",w=>Ut(_(w),b.range()[1]+h,R).y).style("text-anchor",w=>Cf(_(w)).textAnchor).style("dominant-baseline",w=>Cf(_(w)).dominantBaseline).call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",L=>Ut(_(L),b.range()[1]+h,R).x).attr("y",L=>Ut(_(L),b.range()[1]+h,R).y).end().finally(()=>{const L=y(o,"radar","alignment"),k=this.getAlignmentXOffset(L,n,this.getParent());n.attr("x",k)})),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.blobs").attr("role",ht.GROUP).selectAll("path").data(this.groupedDataNormalized,O=>O.name).join(O=>O.append("path").attr("class",w=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:w.name,originalClassName:"blob"})).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",w=>w.name).attr("opacity",0).attr("transform",t?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",w=>M(w.name,null,w.data)).style("fill-opacity",sr.opacity.selected).style("stroke",w=>M(w.name,null,w.data)).call(w=>{const L=w.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_enter",animate:t}));t&&L.delay(()=>Math.random()*30).attr("transform",`translate(${R.x}, ${R.y})`),L.attr("opacity",1).attr("d",k=>D(k.data))}),O=>(O.attr("class",w=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:w.name,originalClassName:"blob"})).style("fill",w=>M(w.name,null,w.data)).style("stroke",w=>M(w.name,null,w.data)),O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",L=>D(L.data))),O),O=>O.call(w=>{const L=w.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_exit",animate:t}));t&&L.delay(()=>Math.random()*30).attr("transform",()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`),L.attr("opacity",0).remove()})),N.appendOrSelect(n,"g.dots").attr("role",ht.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(O=>y(O,d)!==null)).join(O=>O.append("circle").attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",w=>w[c]),O=>O,O=>O.remove()).attr("class",O=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:O[l],originalClassName:Kr(O[u])})).attr("cx",O=>Ut(_(O[u]),b(O[d]),R).x).attr("cy",O=>Ut(_(O[u]),b(O[d]),R).y).attr("r",0).attr("opacity",0).style("fill",O=>M(O[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",ht.GROUP).selectAll("rect").data(this.uniqueKeys).join(O=>O.append("rect"),O=>O,O=>O.remove()).attr("x",R.x).attr("y",R.y-m/2).attr("width",b.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",O=>`rotate(${Af(_(O))}, ${R.x}, ${R.y})`);const{code:P,number:B}=y(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",ht.GROUP).selectAll("text").data(Ge(S)).join(O=>O.append("text").attr("opacity",0).text(w=>B(w,P)).attr("x",w=>Ut(-Math.PI/2,b(w),R).x+p).attr("y",w=>Ut(-Math.PI/2,b(w),R).y).style("text-anchor","start").style("dominant-baseline","middle").call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_update",animate:t})).text(L=>L).attr("opacity",1).attr("x",L=>Ut(-Math.PI/2,b(L),R).x+p).attr("y",L=>Ut(-Math.PI/2,b(L),R).y)),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=N.getSVGElementSize(n,{useBBox:!0}),{width:s}=N.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===zt.CENTER?a=Math.floor((s-i.width)/2):t===zt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Kr(i)}`),o=t.parent.selectAll(`.dots circle.${Kr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",p=>l.indexOf(p[u])!==-1?1:0).attr("r",sr.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(p=>typeof p[d]=="number").map(p=>({label:p[u],value:p[d],color:t.model.getFillColor(p[u],null,p),class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:p[u]})}))})}).on("mousemove",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Kr(i)}`),o=t.parent.selectAll(`.dots circle.${Kr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class jg extends vu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return this.model.getFillColor(l[r],l[c],l)}).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),d=l[c],h=this.services.cartesianScales.getDomainValue(l)-u/2,p=h+u;let f,g;if(Array.isArray(d)&&d.length===2)f=this.services.cartesianScales.getRangeValue(d[0]),g=this.services.cartesianScales.getRangeValue(d[1]);else{const v=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,v)),g=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(g-f);if(m!==0&&m<2&&(d>0&&a===Gt.VERTICAL||d<0&&a===Gt.HORIZONTAL?g=f-2:g=f+2),!this.isOutsideZoomedDomain(h,p))return ie({x0:h,x1:p,y0:f,y1:g},a)}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:I(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class AD extends ce{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),r=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=N.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-skeleton.DAII"),N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Wg extends gt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,i)!==n.datum().name?vn.opacity.unselected:vn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",vn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=tu().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(y(p,0,s),null,p)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",vn.opacity.selected).attr("d",this.areaGenerator)}}class qg extends vu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,p=h+d,f=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,p)){if(Math.abs(g-f)>0&&Math.abs(g-f)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Gt.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Gt.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:p,y0:f,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=I(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=N.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Yg extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=it.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>y(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",ht.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const d=u[i],h=this.services.cartesianScales.getDomainIdentifier(u),p=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:d,[h]:u.data.sharedStackKey,[p]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],p=u.data.sharedStackKey;let f=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);f!=null&&t===this.services.cartesianScales.getDomainValue(p)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(f=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),f!==null&&o.push({[i]:h,[m]:p,[v]:f}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const Es=6;class LD extends gt{constructor(){super(...arguments),this.type="tree",this.renderType=it.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=N.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+Es:30-Es},h=hs({name:o,children:a}),p=10,f=r/6,g=S=>{const M=h.descendants().reverse(),D=h.links();let A=h,R=h;h.eachBefore(k=>{k.x<A.x&&(A=k),k.x>R.x&&(R=k)});const $=R.x-A.x,H=n.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,A.x,r,$].join(" ")),P=b.selectAll("g").data(M,k=>k.id),B=this,O=P.enter().append("g").attr("transform",()=>`translate(${S.y0},${S.x0})`).attr("class",k=>k.depth!==0&&k.children&&k.children.length>0?"clickable":null).on("mouseover",function(k,U){B.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:k,element:I(this),datum:U})}).on("click",function(k,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),B.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:k,element:I(this),datum:U})}).on("mouseout",function(k,U){B.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:k,element:I(this),datum:U})});O.append("circle").attr("r",2.5).attr("class",k=>k._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",k=>k._children?-6:Es).attr("text-anchor",k=>k._children?"end":"start").text(k=>k.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(O).transition(H).attr("transform",k=>`translate(${k.y},${k.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(H).remove().attr("transform",()=>`translate(${S.y},${S.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const w=E.selectAll("path").data(D,k=>k.target.id),L=w.enter().append("path").attr("d",()=>{const k={x:S.x0,y:S.y0};return _({source:k,target:k})});w.merge(L).transition(H).attr("d",_),w.exit().transition(H).remove().attr("d",()=>{const k={x:S.x,y:S.y};return _({source:k,target:k})}),h.eachBefore(k=>{k.x0=k.x,k.y0=k.y})},m=h.descendants(),v=m[m.length-1].depth,x=y(s,"tree","type")===$s.DENDROGRAM?XA().size([i,r-u-v*Es-l]):NL().nodeSize([p,f]).size([i,r-u-v*Es-l]),_=sk().x(S=>S.y).y(S=>S.x);h.x0=f/2,h.y0=0,h.descendants().forEach((S,M)=>{S.id=M,S._children=S.children}),x(h),n.attr("viewBox",[-d.left,-0,r,p]).style("user-select","none");const E=n.append("g").attr("class","links"),b=n.append("g").attr("class","nodes");g(h)}}var kD="#000000",DD="#ffffff",RD="#fcf4d6",ID="#fddc69",ND="#f1c21b",PD="#d2a106",UD="#b28600",BD="#8e6a00",HD="#684e00",VD="#483700",GD="#302400",zD="#1c1500",FD={10:RD,20:ID,30:ND,40:PD,50:UD,60:BD,70:HD,80:VD,90:GD,100:zD},jD="#fff2e8",WD="#ffd9be",qD="#ffb784",YD="#ff832b",XD="#eb6200",ZD="#ba4e00",KD="#8a3800",QD="#5e2900",JD="#3e1a00",tR="#231000",eR={10:jD,20:WD,30:qD,40:YD,50:XD,60:ZD,70:KD,80:QD,90:JD,100:tR},nR="#fff1f1",rR="#ffd7d9",iR="#ffb3b8",sR="#ff8389",aR="#fa4d56",oR="#da1e28",lR="#a2191f",cR="#750e13",uR="#520408",hR="#2d0709",dR={10:nR,20:rR,30:iR,40:sR,50:aR,60:oR,70:lR,80:cR,90:uR,100:hR},pR="#fff0f7",fR="#ffd6e8",mR="#ffafd2",gR="#ff7eb6",vR="#ee5396",yR="#d02670",xR="#9f1853",bR="#740937",_R="#510224",ER="#2a0a18",OR={10:pR,20:fR,30:mR,40:gR,50:vR,60:yR,70:xR,80:bR,90:_R,100:ER},SR="#f6f2ff",TR="#e8daff",wR="#d4bbff",$R="#be95ff",MR="#a56eff",CR="#8a3ffc",AR="#6929c4",LR="#491d8b",kR="#31135e",DR="#1c0f30",RR={10:SR,20:TR,30:wR,40:$R,50:MR,60:CR,70:AR,80:LR,90:kR,100:DR},IR="#edf5ff",NR="#d0e2ff",PR="#a6c8ff",UR="#78a9ff",BR="#4589ff",HR="#0f62fe",VR="#0043ce",GR="#002d9c",zR="#001d6c",FR="#001141",jR={10:IR,20:NR,30:PR,40:UR,50:BR,60:HR,70:VR,80:GR,90:zR,100:FR},WR="#e5f6ff",qR="#bae6ff",YR="#82cfff",XR="#33b1ff",ZR="#1192e8",KR="#0072c3",QR="#00539a",JR="#003a6d",tI="#012749",eI="#061727",nI={10:WR,20:qR,30:YR,40:XR,50:ZR,60:KR,70:QR,80:JR,90:tI,100:eI},rI="#d9fbfb",iI="#9ef0f0",sI="#3ddbd9",aI="#08bdba",oI="#009d9a",lI="#007d79",cI="#005d5d",uI="#004144",hI="#022b30",dI="#081a1c",pI={10:rI,20:iI,30:sI,40:aI,50:oI,60:lI,70:cI,80:uI,90:hI,100:dI},fI="#defbe6",mI="#a7f0ba",gI="#6fdc8c",vI="#42be65",yI="#24a148",xI="#198038",bI="#0e6027",_I="#044317",EI="#022d0d",OI="#071908",SI={10:fI,20:mI,30:gI,40:vI,50:yI,60:xI,70:bI,80:_I,90:EI,100:OI},TI="#f2f4f8",wI="#dde1e6",$I="#c1c7cd",MI="#a2a9b0",CI="#878d96",AI="#697077",LI="#4d5358",kI="#343a3f",DI="#21272a",RI="#121619",II={10:TI,20:wI,30:$I,40:MI,50:CI,60:AI,70:LI,80:kI,90:DI,100:RI},NI="#f4f4f4",PI="#e0e0e0",UI="#c6c6c6",BI="#a8a8a8",HI="#8d8d8d",VI="#6f6f6f",GI="#525252",zI="#393939",FI="#262626",jI="#161616",WI={10:NI,20:PI,30:UI,40:BI,50:HI,60:VI,70:GI,80:zI,90:FI,100:jI},qI="#f7f3f2",YI="#e5e0df",XI="#cac5c4",ZI="#ada8a8",KI="#8f8b8b",QI="#726e6e",JI="#565151",tN="#3c3838",eN="#272525",nN="#171414",rN={10:qI,20:YI,30:XI,40:ZI,50:KI,60:QI,70:JI,80:tN,90:eN,100:nN},Xg={black:{100:kD},blue:jR,coolGray:II,cyan:nI,gray:WI,green:SI,magenta:OR,orange:eR,purple:RR,red:dR,teal:pI,warmGray:rN,white:{0:DD},yellow:FD};const iN=e=>{if(!e)return null;for(const t of Object.keys(Xg)){const n=Xg[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Zg=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=fn(n);let i;if(r&&(i=iN(r?r.hex():null)),i==null){const s=Ld(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let sN=0;class aN extends gt{constructor(){super(...arguments),this.type="treemap",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=N.getSVGElementSize(n,{useAttrs:!0}),l=hs({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=VL().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),p=>p.data.name);u.exit().attr("opacity",0).remove();const d=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>sN++).merge(u);d.attr("data-name","leaf").transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-group-update",animate:t})).attr("transform",p=>`translate(${p.x0},${p.y0})`);const h=d.selectAll("rect.leaf").data(p=>[p]);h.exit().attr("width",0).attr("height",0).remove(),h.enter().append("rect").classed("leaf",!0).merge(h).attr("width",0).attr("height",0).attr("id",function(){const p=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${p}`}).attr("class",p=>{for(;p.depth>1;)p=p.parent;return this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:p.data.name,originalClassName:"leaf"})}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-leaf-update-enter",animate:t})).attr("width",p=>p.x1-p.x0).attr("height",p=>p.y1-p.y0).style("fill",p=>{for(;p.depth>1;)p=p.parent;return this.model.getFillColor(p.data.name,null,p.data)}),d.selectAll("clipPath").data(p=>p.data.showLabel!==!0?[]:[1],p=>p).join(p=>p.append("clipPath").attr("id",function(){const f=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=I(this.parentNode.parentNode).attr("data-uid"),g=`${i.style.prefix}-leaf-${f}`;return new URL(`#${g}`,s)+""}),p=>null,p=>p.remove()),d.selectAll("text").data(p=>{if(p.data.showLabel!==!0)return[];let f=p;for(;f.depth>1;)f=f.parent;return[{text:p.data.name,backgroundColor:this.model.getFillColor(f.data.name)}]},p=>p).join(p=>{const f=p.append("text").text(g=>g.text).style("fill",Zg).attr("x",7).attr("y",18);return s&&f.attr("clip-path",function(){const g=I(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${g}`;return`url(${new URL(`#${m}`,s)+""})`}),f},p=>p.text(f=>f.text).style("fill",Zg),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),fn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}function oN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lN(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var cN={value:function(){}};function Kg(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new uo(n)}function uo(e){this._=e}function uN(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}uo.prototype=Kg.prototype={constructor:uo,on:function(e,t){var n=this._,r=uN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=hN(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Qg(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Qg(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new uo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function hN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Qg(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=cN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const dN=Object.freeze(Object.defineProperty({__proto__:null,dispatch:Kg},Symbol.toStringTag,{value:"Module"})),pN=lN(dN);var yu,Jg;function fN(){if(Jg)return yu;Jg=1;const e=pN.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;yu=function(){var E=[256,256],b=s,S=a,M=l,D=o,A=o,R=c,$=u,H=g,P=[],B=1/0,O=e("word","end"),w=null,L=Math.random,k={},U=x;k.canvas=function(j){return arguments.length?(U=_(j),k):U},k.start=function(){var j=K(U()),X=v((E[0]>>5)*E[1]),ct=null,J=P.length,Y=-1,et=[],ut=P.map(function(q,Z){return q.text=b.call(this,q,Z),q.font=S.call(this,q,Z),q.style=D.call(this,q,Z),q.weight=A.call(this,q,Z),q.rotate=R.call(this,q,Z),q.size=~~M.call(this,q,Z),q.padding=$.call(this,q,Z),q}).sort(function(q,Z){return Z.size-q.size});return w&&clearInterval(w),w=setInterval(F,0),F(),k;function F(){for(var q=Date.now();Date.now()-q<B&&++Y<J&&w;){var Z=ut[Y];Z.x=E[0]*(L()+.5)>>1,Z.y=E[1]*(L()+.5)>>1,d(j,Z,ut,Y),Z.hasText&&W(X,Z,ct)&&(et.push(Z),O.call("word",k,Z),ct?p(ct,Z):ct=[{x:Z.x+Z.x0,y:Z.y+Z.y0},{x:Z.x+Z.x1,y:Z.y+Z.y1}],Z.x-=E[0]>>1,Z.y-=E[1]>>1)}Y>=J&&(k.stop(),O.call("end",k,et,ct))}},k.stop=function(){w&&(clearInterval(w),w=null);for(const j of P)delete j.sprite;return k};function K(j){const X=j.getContext("2d",{willReadFrequently:!0});j.width=j.height=1;const ct=Math.sqrt(X.getImageData(0,0,1,1).data.length>>2);return j.width=(r<<5)/ct,j.height=i/ct,X.fillStyle=X.strokeStyle="red",{context:X,ratio:ct}}function W(j,X,ct){E[0],E[1];for(var J=X.x,Y=X.y,et=Math.sqrt(E[0]*E[0]+E[1]*E[1]),ut=H(E),F=L()<.5?1:-1,q=-F,Z,G,dt;(Z=ut(q+=F))&&(G=~~Z[0],dt=~~Z[1],!(Math.min(Math.abs(G),Math.abs(dt))>=et));)if(X.x=J+G,X.y=Y+dt,!(X.x+X.x0<0||X.y+X.y0<0||X.x+X.x1>E[0]||X.y+X.y1>E[1])&&(!ct||f(X,ct))&&!h(X,j,E[0])){for(var ot=X.sprite,It=X.width>>5,Ht=E[0]>>5,rt=X.x-(It<<4),Et=rt&127,Ne=32-Et,Te=X.y1-X.y0,Ss=(X.y+X.y0)*Ht+(rt>>5),Ts,_r=0;_r<Te;_r++){Ts=0;for(var Ze=0;Ze<=It;Ze++)j[Ss+Ze]|=Ts<<Ne|(Ze<It?(Ts=ot[_r*It+Ze])>>>Et:0);Ss+=Ht}return!0}return!1}return k.timeInterval=function(j){return arguments.length?(B=j??1/0,k):B},k.words=function(j){return arguments.length?(P=j,k):P},k.size=function(j){return arguments.length?(E=[+j[0],+j[1]],k):E},k.font=function(j){return arguments.length?(S=_(j),k):S},k.fontStyle=function(j){return arguments.length?(D=_(j),k):D},k.fontWeight=function(j){return arguments.length?(A=_(j),k):A},k.rotate=function(j){return arguments.length?(R=_(j),k):R},k.text=function(j){return arguments.length?(b=_(j),k):b},k.spiral=function(j){return arguments.length?(H=n[j]||j,k):H},k.fontSize=function(j){return arguments.length?(M=_(j),k):M},k.padding=function(j){return arguments.length?($=_(j),k):$},k.random=function(j){return arguments.length?(L=j,k):L},k.on=function(){var j=O.on.apply(O,arguments);return j===O?k:j},k};function s(E){return E.text}function a(){return"serif"}function o(){return"normal"}function l(E){return Math.sqrt(E.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(E,b,S,M){if(!b.sprite){var D=E.context,A=E.ratio;D.clearRect(0,0,(r<<5)/A,i/A);var R=0,$=0,H=0,P=S.length;for(--M;++M<P;){b=S[M],D.save(),D.font=b.style+" "+b.weight+" "+~~((b.size+1)/A)+"px "+b.font;const Z=D.measureText(b.text),G=-Math.floor(Z.width/2);let dt=(Z.width+1)*A,ot=b.size<<1;if(b.rotate){var B=Math.sin(b.rotate*t),O=Math.cos(b.rotate*t),w=dt*O,L=dt*B,k=ot*O,U=ot*B;dt=Math.max(Math.abs(w+U),Math.abs(w-U))+31>>5<<5,ot=~~Math.max(Math.abs(L+k),Math.abs(L-k))}else dt=dt+31>>5<<5;if(ot>H&&(H=ot),R+dt>=r<<5&&(R=0,$+=H,H=0),$+ot>=i)break;D.translate((R+(dt>>1))/A,($+(ot>>1))/A),b.rotate&&D.rotate(b.rotate*t),D.fillText(b.text,G,0),b.padding&&(D.lineWidth=2*b.padding,D.strokeText(b.text,G,0)),D.restore(),b.width=dt,b.height=ot,b.xoff=R,b.yoff=$,b.x1=dt>>1,b.y1=ot>>1,b.x0=-b.x1,b.y0=-b.y1,b.hasText=!0,R+=dt}for(var K=D.getImageData(0,0,(r<<5)/A,i/A).data,W=[];--M>=0;)if(b=S[M],!!b.hasText){for(var j=b.width,X=j>>5,ct=b.y1-b.y0,J=0;J<ct*X;J++)W[J]=0;if(R=b.xoff,R==null)return;$=b.yoff;for(var Y=0,et=-1,ut=0;ut<ct;ut++){for(var J=0;J<j;J++){var F=X*ut+(J>>5),q=K[($+ut)*(r<<5)+(R+J)<<2]?1<<31-J%32:0;W[F]|=q,Y|=q}Y?et=ut:(b.y0++,ct--,ut--,$++)}b.y1=b.y0+et,b.sprite=W.slice(0,(b.y1-b.y0)*X)}}}function h(E,b,S){S>>=5;for(var M=E.sprite,D=E.width>>5,A=E.x-(D<<4),R=A&127,$=32-R,H=E.y1-E.y0,P=(E.y+E.y0)*S+(A>>5),B,O=0;O<H;O++){B=0;for(var w=0;w<=D;w++)if((B<<$|(w<D?(B=M[O*D+w])>>>R:0))&b[P+w])return!0;P+=S}return!1}function p(E,b){var S=E[0],M=E[1];b.x+b.x0<S.x&&(S.x=b.x+b.x0),b.y+b.y0<S.y&&(S.y=b.y+b.y0),b.x+b.x1>M.x&&(M.x=b.x+b.x1),b.y+b.y1>M.y&&(M.y=b.y+b.y1)}function f(E,b){return E.x+E.x1>b[0].x&&E.x+E.x0<b[1].x&&E.y+E.y1>b[0].y&&E.y+E.y0<b[1].y}function g(E){var b=E[0]/E[1];return function(S){return[b*(S*=.1)*Math.cos(S),S*Math.sin(S)]}}function m(E){var b=4,S=b*E[0]/E[1],M=0,D=0;return function(A){var R=A<0?-1:1;switch(Math.sqrt(1+4*R*A)-R&3){case 0:M+=S;break;case 1:D+=b;break;case 2:M-=S;break;default:D-=b;break}return[M,D]}}function v(E){for(var b=[],S=-1;++S<E;)b[S]=0;return b}function x(){return document.createElement("canvas")}function _(E){return typeof E=="function"?E:function(){return E}}return yu}var mN=fN();const gN=oN(mN);class vN extends gt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=N.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=gN().size([u,d]).words(i.map(function(f){const g=f[o];if(typeof f[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:f[c],text:f[l],size:g,value:g}})).padding(5).rotate(0).fontSize(f=>s(f.size)).on("end",p);h.start();function p(f){const g=N.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(f,v=>`${v[c]}-${v.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",v=>`${v.size}px`).text(function(v){return v.text}).attr("class",v=>n.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:v[c],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[c],v.text,v)).attr("text-anchor","middle").transition().call(v=>n.services.transitions.setupTransition({transition:v,name:"wordcloud-text-update-enter",animate:t})).attr("transform",v=>`translate(${v.x}, ${v.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Ge(i):[1,1];return je().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=ga(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class yN extends gt{constructor(){super(...arguments),this.type="geo",this.renderType=it.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=N.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=uD(s,Object.values(l)),u=oD(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=_A().projection(d);N.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=N.appendOrSelect(t,"defs");N.appendOrSelect(f,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",ms()([[0,0],[0,10]]));const g=N.appendOrSelect(t,"g.missing-data");N.appendOrSelect(g,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case Je.geoEqualEarth:t=HA();break;case Je.geoAlbers:t=DA();break;case Je.geoConicEqualArea:t=qm();break;case Je.geoConicEquidistant:t=UA();break;case Je.geoEquirectangular:t=NA();break;case Je.geoMercator:t=RA();break;case Je.geoNaturalEarth1:t=VA();break;default:throw new Error("Projection is not supported.")}return t}}class xN extends yN{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),r=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),i=y(this.getOptions(),"color"),s=y(i,"gradient","colors");r.select("g.geo").selectAll("path").classed("border",!0).attr("class",a=>this.model.getColorClassName({value:n[a.properties.NAME].value,originalClassName:"border"})).attr("style",a=>s?`fill: ${this.model.getColorClassName({value:n[a.properties.NAME].value})}`:null),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(Sr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Or.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Sr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Or.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Sr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Sr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Or.HIDE,{event:r,hoveredElement:s})})}}function xu(e){var t=e==null?0:e.length;return t?Bs(e,1):[]}function bN(e){return ah(ch(e,void 0,xu),e+"")}function tv(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function _N(e,t){return t.length<2?e:el(e,tv(t,0,-1))}function EN(e,t){return t=Us(t,e),e=_N(e,t),e==null||delete e[Mi(id(t))]}function ON(e){return Eh(e)?void 0:e}var SN=1,TN=2,wN=4,$N=bN(function(e,t){var n={};if(e==null)return n;var r=!1;t=zo(t,function(s){return s=Us(s,e),r||(r=s.length>1),s}),Mr(e,kh(e),n),r&&(n=Ci(n,SN|TN|wN,ON));for(var i=t.length;i--;)EN(n,t[i]);return n});function ev(e){return Math.log(e)}function nv(e){return Math.exp(e)}function MN(e){return-Math.log(-e)}function CN(e){return-Math.exp(-e)}function AN(e){return isFinite(e)?+("1e"+e):e<0?0:e}function LN(e){return e===10?AN:e===Math.E?Math.exp:t=>Math.pow(e,t)}function kN(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function rv(e){return(t,n)=>-e(-t,n)}function DN(e){const t=e(ev,nv),n=t.domain;let r=10,i,s;function a(){return i=kN(r),s=LN(r),n()[0]<0?(i=rv(i),s=rv(s),e(MN,CN)):e(ev,nv),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),p=i(u),f,g;const m=o==null?10:+o;let v=[];if(!(r%1)&&p-h<m){if(h=Math.floor(h),p=Math.ceil(p),c>0){for(;h<=p;++h)for(f=1;f<r;++f)if(g=h<0?f/s(-h):f*s(h),!(g<c)){if(g>u)break;v.push(g)}}else for(;h<=p;++h)for(f=r-1;f>=1;--f)if(g=h>0?f/s(-h):f*s(h),!(g<c)){if(g>u)break;v.push(g)}v.length*2<m&&(v=js(c,u,m))}else v=js(h,p,Math.min(p-h,m)).map(s);return d?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Vi(l)).precision==null&&(l.trim=!0),l=Il(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(zp(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function iv(){const e=DN(op()).domain([1,10]);return e.copy=()=>Pl(e,iv()).base(e.base()),Ur.apply(e,arguments),e}function ho(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function po(e){this._context=e}po.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ho(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ho(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function RN(e){return new po(e)}function sv(e){this._context=e}sv.prototype={areaStart:Bn,areaEnd:Bn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ho(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function IN(e){return new sv(e)}function av(e){this._context=e}av.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ho(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function NN(e){return new av(e)}function ov(e,t){this._basis=new po(e),this._beta=t}ov.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const PN=function e(t){function n(r){return t===1?new po(r):new ov(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function fo(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function bu(e,t){this._context=e,this._k=(1-t)/6}bu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:fo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:fo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const UN=function e(t){function n(r){return new bu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function _u(e,t){this._context=e,this._k=(1-t)/6}_u.prototype={areaStart:Bn,areaEnd:Bn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:fo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const BN=function e(t){function n(r){return new _u(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Eu(e,t){this._context=e,this._k=(1-t)/6}Eu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:fo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const HN=function e(t){function n(r){return new Eu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ou(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>ee){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ee){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function lv(e,t){this._context=e,this._alpha=t}lv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Ou(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const VN=function e(t){function n(r){return t?new lv(r,t):new bu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function cv(e,t){this._context=e,this._alpha=t}cv.prototype={areaStart:Bn,areaEnd:Bn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ou(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const GN=function e(t){function n(r){return t?new cv(r,t):new _u(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function uv(e,t){this._context=e,this._alpha=t}uv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ou(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const zN=function e(t){function n(r){return t?new uv(r,t):new Eu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function hv(e){return e<0?-1:1}function dv(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(hv(s)+hv(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function pv(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Su(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function mo(e){this._context=e}mo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Su(this,this._t0,pv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Su(this,pv(this,n=dv(this,e,t)),n);break;default:Su(this,this._t0,n=dv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function fv(e){this._context=new mv(e)}(fv.prototype=Object.create(mo.prototype)).point=function(e,t){mo.prototype.point.call(this,t,e)};function mv(e){this._context=e}mv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function FN(e){return new mo(e)}function jN(e){return new fv(e)}function gv(e){this._context=e}gv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=vv(e),i=vv(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function vv(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function WN(e){return new gv(e)}function go(e,t){this._context=e,this._t=t}go.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function qN(e){return new go(e,.5)}function YN(e){return new go(e,0)}function XN(e){return new go(e,1)}class ZN extends wn{zoomIn(t,n,r){let i,s,a;const o=r||Hr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=N.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_IN,{element:I(t)})}zoomOut(t,n){const r=n||Hr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_OUT)}}class KN extends wn{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class QN extends wn{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class JN extends wn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(T.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(y(fp,n,"duration")||fp.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Os(e,t){const n=+Pt(e)-+Pt(t);return n<0?-1:n>0?1:n}function tP(e,t,n){const[r,i]=qn(void 0,e,t);return r.getFullYear()-i.getFullYear()}function eP(e,t,n){const[r,i]=qn(void 0,e,t),s=Os(r,i),a=Math.abs(tP(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Os(r,i)===-s,l=s*(a-+o);return l===0?0:l}function Tu(e,t,n){const r=Pt(e,void 0);if(isNaN(t))return $e(e,NaN);if(!t)return r;const i=r.getDate(),s=$e(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function yv(e,t,n){return Tu(e,t*12)}function nP(e,t,n){return yv(e,-t)}function rP(e,t,n){const[r,i]=qn(void 0,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function iP(e,t){const n=Pt(e,void 0);return n.setHours(23,59,59,999),n}function sP(e,t){const n=Pt(e,void 0),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function aP(e,t){const n=Pt(e,void 0);return+iP(n)==+sP(n)}function oP(e,t,n){const[r,i,s]=qn(void 0,e,e,t),a=Os(i,s),o=Math.abs(rP(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Os(i,s)===-a;aP(r)&&o===1&&Os(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function lP(e,t,n){return Tu(e,-t)}function cP(e,t,n){const[r,i]=qn(void 0,e,t),s=xv(r,i),a=Math.abs(wp(r,i));r.setDate(r.getDate()-s*a);const o=+(xv(r,i)===-s),l=s*(a-o);return l===0?0:l}function xv(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function bv(e,t,n){const r=Pt(e,void 0);return isNaN(t)?$e(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function uP(e,t,n){return bv(e,-t)}function wu(e){return t=>{const n=(0,Math.trunc)(t);return n===0?0:n}}function hP(e,t,n){const[r,i]=qn(void 0,e,t),s=(+r-+i)/Yu;return wu()(s)}function _v(e,t,n){return $e(e,+Pt(e)+t)}function Ev(e,t,n){return _v(e,t*Yu)}function dP(e,t,n){return Ev(e,-t)}function Ov(e,t){return+Pt(e)-+Pt(t)}function Sv(e,t,n){const r=Ov(e,t)/qu;return wu()(r)}function $u(e,t,n){const r=Pt(e,void 0);return r.setTime(r.getTime()+t*qu),r}function Tv(e,t,n){return $u(e,-t)}function wv(e,t,n){const r=Ov(e,t)/1e3;return wu()(r)}function Mu(e,t,n){return _v(e,t*1e3)}function $v(e,t,n){return Mu(e,-t)}class pP extends wn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=y(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=y(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(t=>z[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Gt.VERTICAL:this.orientation=Gt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=y(s,"axes");((t=a[z.LEFT])!=null&&t.correspondingDatasets&&a[z.RIGHT]||(n=a[z.RIGHT])!=null&&n.correspondingDatasets&&a[z.LEFT]||(r=a[z.TOP])!=null&&r.correspondingDatasets&&a[z.BOTTOM]||(i=a[z.BOTTOM])!=null&&i.correspondingDatasets&&a[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===nt.LINEAR||this.scaleTypes[t]===nt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),a=y(s,"axes")[r],{mapsTo:o}=a,l=y(i,o)!==null?i[o]:i;let c;switch(n){case nt.LABELS:c=t(l)+t.step()/2;break;case nt.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=y(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=y(r,"axes",t);if(i.scaleType===nt.TIME){const s=y(r,"timeScale","addSpaceOnEdges");return fP(n,s)}else return mP(n,Nn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||r&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||r&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=y(r,"axes",t.primary),s=y(r,"axes",n.primary),a=i.scaleType||nt.LINEAR,o=s.scaleType||nt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===nt.LABELS||o===nt.TIME)&&a===nt.LABELS||a===nt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=y(n,"axes",t),i=y(n,"bounds"),{includeZero:s}=r,a=y(r,"scaleType")||nt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,tr(v,x=>x.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),x=this.model.getStackKeys({bins:v});return[x[0].split(":")[0],x[x.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:p}=Nn.ratio;if(r.domain)return a===nt.LABELS?r.domain:(a===nt.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===nt.LABELS)return Li(o.map(v=>v[c]));let f,g;const m=this.model.getDataGroupNames();if(a===nt.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[p]}`);if(a===nt.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,x=this.model.getDataValuesGroupedByKeys({groups:m}),_=o.filter(b=>!m.includes(b[v])),E=[];x.forEach(b=>{const{...S}=b;let M=0,D=0;Object.values($N(S,"sharedStackKey")).forEach(A=>{isNaN(A)||(A<0?D+=A:M+=A)}),E.push([D,M])}),g=[...xu(E),..._.map(b=>b[c])]}else g=[],o.forEach(v=>{const x=v[c];Array.isArray(x)&&x.length===2?(g.push(x[0]),g.push(x[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(x))});return a!==nt.TIME&&a!==nt.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const x=y(v,"value");x!==null&&g.push(x)}),f=Ge(g),f=this.extendsDomain(t,f),f}createScale(t){const n=this.model.getOptions(),r=y(n,"axes",t);if(!r)return null;const i=y(r,"scaleType")||nt.LINEAR;this.scaleTypes[t]=i;let s;return i===nt.TIME?s=cf():i===nt.LOG?s=iv().base(r.base||10):i===nt.LABELS||i===nt.LABELS_RATIO?s=Yi():s=je(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Gt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===nt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function fP(e,t){const n=new Date(e[0]),r=new Date(e[1]);return eP(r,n)>1?[nP(n,t),yv(r,t)]:oP(r,n)>1?[lP(n,t),Tu(r,t)]:cP(r,n)>1?[uP(n,t),bv(r,t)]:hP(r,n)>1?[dP(n,t),Ev(r,t)]:Sv(r,n)>30?[Tv(n,t*30),$u(r,t*30)]:Sv(r,n)>1?[Tv(n,t),$u(r,t)]:wv(r,n)>15?[$v(n,t*15),Mu(r,t*15)]:wv(r,n)>1?[$v(n,t),Mu(r,t)]:[n,r]}function mP([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===nt.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}class gP extends wn{constructor(){super(...arguments),this.curveTypes={curveLinear:Oa,curveLinearClosed:ff,curveBasis:RN,curveBasisClosed:IN,curveBasisOpen:NN,curveBundle:PN,curveCardinal:UN,curveCardinalClosed:BN,curveCardinalOpen:HN,curveCatmullRom:VN,curveCatmullRomClosed:GN,curveCatmullRomOpen:zN,curveMonotoneX:FN,curveMonotoneY:jN,curveNatural:WN,curveStep:qN,curveStepAfter:XN,curveStepBefore:YN}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class vP extends wn{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===nt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Ge(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=be.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let d=a+u,h=o-u;d>=h&&(d=a+c/2-i/2,h=o-c/2+i/2);const p=[s.invert(d),s.invert(h)];(r[0].valueOf()!==p[0].valueOf()||r[1].valueOf()!==p[1].valueOf())&&this.handleDomainChange(p)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}function yP(e,t,n){var r=e.length;return n=n===void 0?r:n,tv(e,t,n)}var xP="\\ud800-\\udfff",bP="\\u0300-\\u036f",_P="\\ufe20-\\ufe2f",EP="\\u20d0-\\u20ff",OP=bP+_P+EP,SP="\\ufe0e\\ufe0f",TP="\\u200d",wP=RegExp("["+TP+xP+OP+SP+"]");function Mv(e){return wP.test(e)}function $P(e){return e.split("")}var Cv="\\ud800-\\udfff",MP="\\u0300-\\u036f",CP="\\ufe20-\\ufe2f",AP="\\u20d0-\\u20ff",LP=MP+CP+AP,kP="\\ufe0e\\ufe0f",DP="["+Cv+"]",Cu="["+LP+"]",Au="\\ud83c[\\udffb-\\udfff]",RP="(?:"+Cu+"|"+Au+")",Av="[^"+Cv+"]",Lv="(?:\\ud83c[\\udde6-\\uddff]){2}",kv="[\\ud800-\\udbff][\\udc00-\\udfff]",IP="\\u200d",Dv=RP+"?",Rv="["+kP+"]?",NP="(?:"+IP+"(?:"+[Av,Lv,kv].join("|")+")"+Rv+Dv+")*",PP=Rv+Dv+NP,UP="(?:"+[Av+Cu+"?",Cu,Lv,kv,DP].join("|")+")",BP=RegExp(Au+"(?="+Au+")|"+UP+PP,"g");function HP(e){return e.match(BP)||[]}function VP(e){return Mv(e)?HP(e):$P(e)}function GP(e){return function(t){t=$i(t);var n=Mv(t)?VP(t):void 0,r=n?n[0]:t.charAt(0),i=n?yP(n,1).join(""):t.slice(1);return r[e]()+i}}var zP=GP("toUpperCase");function FP(e){return zP($i(e).toLowerCase())}var jP=Yf(function(e,t,n){return t=t.toLowerCase(),e+(n?FP(t):t)});class Xe{constructor(t,n){this.components=[],this.services={canvasZoom:ZN,domUtils:N,events:KN,files:QN,gradientUtils:dc,transitions:JN},this.model=new rn(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(T.Model.UPDATE,r=>{const i=!!y(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(T.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(T.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s={id:"legend",components:[new cu(this.model,this.services)],growth:lt.PREFERRED},a=y(r,"canvasZoom","enabled");a&&a===!0&&t.push(new Mk(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new _s(this.model,this.services)],growth:lt.STRETCH},c={id:"toolbar",components:[new io(this.model,this.services)],growth:lt.PREFERRED},u={id:"header",components:[new Oe(this.model,this.services,[l,...i?[c]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},d={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:y(n,"graphFrameRenderType")||it.SVG},h=y(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=Mt.COLUMN;if(h){const v=y(r,"legend","position");v==="left"?(p=Mt.ROW,r.legend.orientation||(r.legend.orientation=wr.VERTICAL)):v==="right"?(p=Mt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=wr.VERTICAL)):v==="bottom"&&(p=Mt.COLUMN_REVERSE)}const f={id:"spacer",components:[new An(this.model,this.services)],growth:lt.PREFERRED},g={id:"full-frame",components:[new Oe(this.model,this.services,[...h?[s]:[],...h?[f]:[],d],{direction:p})],growth:lt.STRETCH},m=[];if(o||i){m.push(u);const v={id:"spacer",components:[new An(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};m.push(v)}return m.push(g),[new uu(this.model,this.services),new so(this.model,this.services),new Oe(this.model,this.services,m,{direction:Mt.COLUMN})]}}class ge extends Xe{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:pP,curves:gP,zoom:vP}),this.model=new lr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",z.TOP,"enabled"),s=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(r,"axes",a,"scaleType"),l=i&&a===z.BOTTOM&&o===nt.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new _s(this.model,this.services)],growth:lt.STRETCH},h={id:"toolbar",components:[new io(this.model,this.services)],growth:lt.PREFERRED},p={id:"header",components:[new Oe(this.model,this.services,[d,...s?[h]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},f={id:"legend",components:[new cu(this.model,this.services)],growth:lt.PREFERRED};l&&!c&&t.push(new Og(this.model,this.services),new Ck(this.model,this.services)),t.push(new Lk(this.model,this.services)),t.push(new kk(this.model,this.services));const g={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Mt.COLUMN;if(m){const S=y(this.model.getOptions(),"legend","position");S===Tr.LEFT?(v=Mt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=wr.VERTICAL)):S===Tr.RIGHT?(v=Mt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=wr.VERTICAL)):S===Tr.BOTTOM&&(v=Mt.COLUMN_REVERSE)}const x={id:"spacer",components:[new An(this.model,this.services)],growth:lt.PREFERRED},_={id:"full-frame",components:[new Oe(this.model,this.services,[...m?[f]:[],...m?[x]:[],g],{direction:v})],growth:lt.STRETCH},E={id:"zoom-bar",components:[new Ak(this.model,this.services)],growth:lt.PREFERRED,renderType:it.SVG},b=[];if(u||s){b.push(p);const S={id:"spacer",components:[new An(this.model,this.services,s?{size:15}:void 0)],growth:lt.PREFERRED};b.push(S)}return l&&b.push(E),b.push(_),[new $g(this.model,this.services),new so(this.model,this.services),new Oe(this.model,this.services,b,{direction:Mt.COLUMN})]}}class WP extends Xe{constructor(t,n){super(t,n),this.model=new zw(this.services),this.model.setOptions(Rt(Ct.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new Qk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class qP extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(pn(Ct.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Gn(this.model,this.services),new ai(this.model,this.services),new Ng(this.model,this.services),new cn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class YP extends ge{constructor(t,n){super(t,n),this.model=new Fw(this.services),this.model.setOptions(Rt(Ct.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new eD(this.model,this.services),new oi(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class XP extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Gn(this.model,this.services),new nD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class ZP extends ge{constructor(t,n){super(t,n),this.model=new jw(this.services),this.model.setOptions(Rt(Ct.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new rD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class KP extends Xe{constructor(t,n){super(t,n),this.model=new Ww(this.services),this.model.setOptions(Rt(Ct.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new _s(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new io(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new Oe(this.model,this.services,[a,...i?[o]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Hg(this.model,this.services,{chartType:"choropleth"})],growth:lt.PREFERRED,renderType:it.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Mt.COLUMN_REVERSE,p={id:"spacer",components:[new An(this.model,this.services,{size:15})],growth:lt.PREFERRED},f={id:"full-frame",components:[new Oe(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new An(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(m)}return g.push(f),[new uu(this.model,this.services),new so(this.model,this.services),new Oe(this.model,this.services,g,{direction:Mt.COLUMN})]}getComponents(){const t=[new xN(this.model,this.services)];return this.getChartComponents(t)}}class QP extends Xe{constructor(t,n){super(t,n),this.model=new qw(this.services),this.model.setOptions(Rt(Ct.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new _D(this.model,this.services)];return this.getChartComponents(t)}}const Iv={[ve.LINE]:[ai,cn],[ve.SCATTER]:[cn],[ve.AREA]:[Ng,ai,cn],[ve.STACKED_AREA]:[Wg,ai,Yg,co],[ve.SIMPLE_BAR]:[jg],[ve.GROUPED_BAR]:[Fg,oi],[ve.STACKED_BAR]:[qg,co]};class JP extends ge{constructor(t,n){super(t,n);const r=Rt(Ct.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:ve.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Iv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${jP(i.type)}Chart`;return a=at({},Ct[l],this.model.getOptions(),i.options),i.type===ve.STACKED_AREA&&(o=!0),Iv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=at({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return xu(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===ve.STACKED_BAR||i.type===ve.STACKED_AREA),r=[new me(this.model,this.services),new Se(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID}),...n?[]:[new Gn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class Nv extends Xe{constructor(t,n,r=!1){super(t,n),this.model=new Yw(this.services),!r&&(this.model.setOptions(Rt(Ct.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Vg(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.PIE})];return this.getChartComponents(t)}}class t3 extends Nv{constructor(t,n){super(t,n,!0),this.model.setOptions(Rt(Ct.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new OD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.DONUT})];return this.getChartComponents(t)}}class e3 extends Xe{constructor(t,n){super(t,n),this.model=new Xw(this.services),this.model.setOptions(Rt(Ct.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new SD(this.model,this.services)];return this.getChartComponents(t)}}class n3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Fg(this.model,this.services),new oi(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class r3 extends ge{constructor(t,n){super(t,n),this.model=new Zw(this.services),this.model.setOptions(Rt(Ct.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new _s(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new io(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new Oe(this.model,this.services,[a,...i?[o]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Hg(this.model,this.services,{chartType:"heatmap"})],growth:lt.PREFERRED,renderType:it.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Mt.COLUMN_REVERSE,p={id:"spacer",components:[new An(this.model,this.services,{size:15})],growth:lt.PREFERRED},f={id:"full-frame",components:[new Oe(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new An(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(m)}return g.push(f),[new $g(this.model,this.services),new so(this.model,this.services),new Oe(this.model,this.services,g,{direction:Mt.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new TD(this.model,this.services)];return this.getAxisChartComponents(t)}}class i3 extends ge{constructor(t,n){super(t,n),this.model=new Kw(this.services),this.model.setOptions(Rt(Ct.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new dD(this.model,this.services),new wD(this.model,this.services)];return this.getAxisChartComponents(t)}}class s3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Gn(this.model,this.services),new ai(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new AD(this.model,this.services),new oi(this.model,this.services)];return this.getAxisChartComponents(t)}}class a3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Gn(this.model,this.services),new $D(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class o3 extends Xe{constructor(t,n){var r;super(t,n),this.model=new Qw(this.services);const i=(r=n.options.meter)!=null&&r.proportional?at(pn(Ct.proportionalMeterChart),n.options):at(pn(Ct.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new bD(this.model,this.services)],growth:lt.STRETCH,renderType:it.SVG},{id:"spacer",components:[new An(this.model,this.services,{size:8})],growth:lt.STRETCH}]:[],{id:"meter-graph",components:[new MD(this.model,this.services)],growth:lt.STRETCH,renderType:it.SVG}],n=[new Oe(this.model,this.services,t,{direction:Mt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:it.HTML})}}class l3 extends Xe{constructor(t,n){super(t,n),this.model=new Jw(this.services),this.model.setOptions(Rt(Ct.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new CD(this.model,this.services)];return this.getChartComponents(t)}}class c3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Gn(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class u3 extends Xe{constructor(t,n){super(t,n),this.model=new t$(this.services),this.model.setOptions(Rt(Ct.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new LD(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class h3 extends Xe{constructor(t,n){super(t,n),this.model=new e$(this.services),this.model.setOptions(Rt(Ct.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new aN(this.model,this.services)];return this.getChartComponents(t)}}class d3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new jg(this.model,this.services),new oi(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class p3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new co(this.model,this.services),new Wg(this.model,this.services),new ai(this.model,this.services,{stacked:!0}),new Yg(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class f3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new co(this.model,this.services),new qg(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ}),new oi(this.model,this.services)];return this.getAxisChartComponents(t)}}class m3 extends Xe{constructor(t,n){super(t,n),this.model=new n$(this.services),this.model.setOptions(Rt(Ct.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new vN(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.PIE})];return this.getChartComponents(t)}}class Dt extends ft.PureComponent{constructor(){super(...arguments);Pu(this,"chart");Pu(this,"chartRef",ft.createRef())}createChart(n,r,i){throw new Error("Method not implemented.")}componentDidMount(){this.chartRef.current&&!this.chart&&(this.chart=this.createChart(this.chartRef.current,this.props.data,this.props.options))}componentDidUpdate(n){var r,i;this.props.data!==n.data&&((r=this.chart)==null||r.model.setData(this.props.data)),this.props.options!==n.options&&((i=this.chart)==null||i.model.setOptions(this.props.options))}render(){return ft.createElement("div",{ref:this.chartRef,className:"chart-holder"})}}class g3 extends Dt{createChart(t,n,r){return new WP(t,{data:n,options:r})}}class v3 extends Dt{createChart(t,n,r){return new qP(t,{data:n,options:r})}}class y3 extends Dt{createChart(t,n,r){return new YP(t,{data:n,options:r})}}class x3 extends Dt{createChart(t,n,r){return new XP(t,{data:n,options:r})}}class b3 extends Dt{createChart(t,n,r){return new ZP(t,{data:n,options:r})}}class Pv extends Dt{createChart(t,n,r){return new KP(t,{data:n,options:r})}}class _3 extends Dt{createChart(t,n,r){return new QP(t,{data:n,options:r})}}class E3 extends Dt{createChart(t,n,r){return new JP(t,{data:n,options:r})}}class O3 extends Dt{createChart(t,n,r){return new t3(t,{data:n,options:r})}}class S3 extends Dt{createChart(t,n,r){return new e3(t,{data:n,options:r})}}class T3 extends Dt{createChart(t,n,r){return new n3(t,{data:n,options:r})}}class w3 extends Dt{createChart(t,n,r){return new r3(t,{data:n,options:r})}}class $3 extends Dt{createChart(t,n,r){return new i3(t,{data:n,options:r})}}class M3 extends Dt{createChart(t,n,r){return new s3(t,{data:n,options:r})}}class C3 extends Dt{createChart(t,n,r){return new a3(t,{data:n,options:r})}}class A3 extends Dt{createChart(t,n,r){return new o3(t,{data:n,options:r})}}class L3 extends Dt{createChart(t,n,r){return new Nv(t,{data:n,options:r})}}class k3 extends Dt{createChart(t,n,r){return new l3(t,{data:n,options:r})}}class D3 extends Dt{createChart(t,n,r){return new c3(t,{data:n,options:r})}}class R3 extends Dt{createChart(t,n,r){return new d3(t,{data:n,options:r})}}class I3 extends Dt{createChart(t,n,r){return new p3(t,{data:n,options:r})}}class N3 extends Dt{createChart(t,n,r){return new f3(t,{data:n,options:r})}}class P3 extends Dt{createChart(t,n,r){return new u3(t,{data:n,options:r})}}class U3 extends Dt{createChart(t,n,r){return new h3(t,{data:n,options:r})}}class B3 extends Dt{createChart(t,n,r){return new m3(t,{data:n,options:r})}}function H3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lu={exports:{}};/*!
|
|
73
|
+
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(f=>{if(f!==null)return typeof f.data.value=="number"?{label:f.data.name,value:f.data.value}:{label:f.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:f.value}});const p=t.model.getOptions();u=[{label:yt(p,"locale.translations.total")||yt(p,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=I(this),s=i.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Hr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Hr),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function ED(e,t){const n=Ni(this._current,e);return r=>(this._current=n(r),t(this._current))}class Vg extends gt{constructor(){super(...arguments),this.type="pie",this.renderType=it.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(A=>A[a]>0),l=this.computeRadius();this.arc=fs().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=fs().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const c=ZL().value(A=>A[a]).sort(y(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",ht.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,A=>A.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",A=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:A.data[s],originalClassName:"slice"})).style("fill",A=>n.model.getFillColor(A.data[s],null,A.data)).attr("d",this.arc).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",A=>`${A[a]}, ${Hl(A.data[a],o,a)+"%"}`).attrTween("d",function(A){return ED.bind(this)(A,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=y(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(A=>A.data[a]>0):[],g=N.appendOrSelect(r,"g.labels").attr("role",ht.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,A=>A.data[s]);g.exit().attr("opacity",0).remove();const m=g.enter().append("text").classed("pie-label",!0),v=[];m.merge(g).style("text-anchor","middle").text(A=>i.pie.labels.formatter?i.pie.labels.formatter({...A,percentageValue:Hl(A.data[a],o,a,!0)}):h(Hl(A.data[a],o,a),d)+"%").datum(function(A){const R=l+7,$=(A.endAngle-A.startAngle)/2+A.startAngle,H=$/Math.PI*180,P=this.getComputedTextLength();return A.textOffsetX=P/2,A.textOffsetY=H>90&&H<270?10:0,A.xPosition=(A.textOffsetX+R)*Math.sin($),A.yPosition=(A.textOffsetY+R)*-Math.cos($),A}).attr("transform",function(A,R){const $=f.length,H=(A.endAngle-A.startAngle)*(180/Math.PI);if(R>=$-2&&H<Lt.callout.minSliceDegree){let P,B;return A.index===$-1?(P=A.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+A.textOffsetX,B=A.yPosition-Lt.callout.offsetY,A.direction=di.RIGHT,v.push(A)):(P=A.xPosition-Lt.callout.offsetX-A.textOffsetX-Lt.callout.textMargin,B=A.yPosition-Lt.callout.offsetY,A.direction=di.LEFT,v.push(A)),`translate(${P}, ${B})`}return`translate(${A.xPosition}, ${A.yPosition})`}),this.renderCallouts(v);const x=y(i,"donut")?"donut":"pie",_=y(i,x,"alignment"),{width:E}=N.getSVGElementSize(this.getParent(),{useAttrs:!0}),b=p?Lt.xOffset:0,S=p?Lt.yOffset:0;let M=l+b;_===zt.CENTER?M=E/2:_===zt.RIGHT&&(M=E-l-Lt.xOffset);let D=l+S;v.length>0&&(D+=Lt.yOffsetCallout),r.attr("x",M+7).attr("y",D),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ht.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ht.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===di.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Lt.callout.offsetX,y:o-Lt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Lt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Lt.callout.offsetX,y:o-Lt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Lt.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=I(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);vC(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class OD extends Vg{constructor(){super(...arguments),this.type="donut",this.renderType=it.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=N.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");N.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&N.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=y(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=Id:s=xe;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const Gg="4,10 8,6 12,10",zg="12,6 8,10 4,6";class SD extends gt{constructor(){super(...arguments),this.type="gauge",this.renderType=it.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return Xf(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===Wn.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(y(n,"gauge","deltaArrow","direction")){case Ms.UP:return Gg;case Ms.DOWN:return zg;default:return t>0?Gg:zg}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=fs().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=fs().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),N.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const p=n.selectAll("path.arc-foreground").data([i]);p.enter().append("path").merge(p).attr("class",this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),p.exit().remove();const f=y(r,"gauge","alignment"),{width:g}=N.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;f===zt.CENTER?m=g/2:f===zt.RIGHT&&(m=g-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;r===Wn.FULL&&!s?d=l(a):r===Wn.SEMI&&s&&(d=-(l(a)+c));const h=N.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),p=o(a),f=N.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),x=f.selectAll("text.gauge-value-number").data([i]);x.enter().append("text").attr("class","gauge-value-number").merge(x).style("font-size",`${p}px`).attr("text-anchor","middle").text(A=>{let R;return A!=null?R=Number(A.toFixed(2))%1!==0?A.toFixed(2):A.toFixed():R=0,v?v(R):m(Number(R),g)});const{width:_}=N.getSVGElementSize(N.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),E=p/2,b=u?"%":"",S=N.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${E}px`).attr("x",_/2).text(b),{width:M,height:D}=N.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${D/2}px`),f.attr("transform",`translate(-${M/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=y(r,"locale");if(i){const o=this.computeRadius(),l=i?y(r,"gauge","deltaFontSize"):()=>0,c=i?y(r,"gauge","numberFormatter"):()=>null,u=y(r,"gauge","deltaArrow","size"),d=y(r,"gauge","numberSpacing"),h=y(r,"gauge","showPercentageSymbol"),p=N.appendOrSelect(n,"g.gauge-numbers"),f=N.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=N.appendOrSelect(f,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(E=>{let b;return E!=null?b=Number(E.toFixed(2))%1!==0?E.toFixed(2):E.toFixed():b=0,c?`${c(b)}${m}`:`${a(Number(b),s)}${m}`});const{width:v}=N.getSVGElementSize(N.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),x=y(r,"gauge","deltaArrow","enabled"),_=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&x?[i]:[]);_.enter().append("svg").merge(_).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const E=I(this);N.appendOrSelect(E,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=y(r,"gauge","status");N.appendOrSelect(E,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),_.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});return n===Wn.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Fg extends vu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=it.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=Li(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars").merge(o);l.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const d=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Gt.VERTICAL?`translate(${d}, 0)`:`translate(0, ${d})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return this.model.getFillColor(u[i],u[d],u)}).attr("d",u=>{const d=this.groupScale(u[i]),h=this.getBarWidth(),p=d,f=d+h,g=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(g),v=this.services.cartesianScales.getValueThroughAxisPosition(g,m),x=this.services.cartesianScales.getRangeValue(u),_=this.services.cartesianScales.getDomainValue(u)-h/2,E=_+h;if(!this.isOutsideZoomedDomain(_,E))return ie({x0:p,x1:f,y0:v,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),r=y(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Yi().domain(t).rangeRound([0,this.getGroupWidth()])}}class TD extends gt{constructor(){super(...arguments),this.type="heatmap",this.renderType=it.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,p=null;this.matrix[r]!==void 0?(u=a,i.forEach(f=>{if(typeof this.matrix[r][f].value=="number"){const g=this.matrix[r][f].value;if(d===null){d=g,h=g,p=g;return}d+=g,h=g<h?g:h,p=g>p?g:p}})):(u=o,s.forEach(f=>{if(typeof this.matrix[f][r].value=="number"){const g=this.matrix[f][r].value;if(d===null){d=g,h=g,p=g;return}d+=g,h=g<h?g:h,p=g>p?g:p}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${In(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${In(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:p!==null?p:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const p=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",p).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const f=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${p})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(f.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=N.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);N.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),N.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),N.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),N.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==$r.OFF&&(t===$r.AUTO&&hp.minCellDividerDimension<=this.xBandwidth&&hp.minCellDividerDimension<=this.yBandwidth||t===$r.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=Fi(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const d=I(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{event:c,hoveredElement:d}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class wD extends gt{constructor(){super(...arguments),this.type="histogram",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ht.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,p=this.services.cartesianScales.getDomainValue(d.x0),f=p+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Gt.VERTICAL?m+=1:m-=1),ie({x0:p,x1:f,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class $D extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=it.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?yn.weight.unselected:yn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",yn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?yn.opacity.unselected:yn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",yn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,p]=bn(c,u,d),f=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);f.exit().attr("opacity",0).remove();const g=f.enter().append("line").attr("opacity",0).merge(f).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Gt.HORIZONTAL?g.attr("y1",p).attr("y2",p).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):g.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>p(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class MD extends gt{constructor(){super(...arguments),this.type="meter",this.renderType=it.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-Kt.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-Kt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=y(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=N.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;y(i,"meter","proportional")===null?u=100:u=y(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=je().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),p=y(i,"meter","height");N.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(s?Kt.height.proportional:Kt.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(s?Kt.height.proportional:Kt.height.default));const f=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";f.enter().append("rect").classed("value",!0).merge(f).attr("x",_=>_.x).attr("y",0).attr("height",()=>p||(s?Kt.height.proportional:Kt.height.default)).attr("class",_=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:_[c],originalClassName:g})).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"meter-bar-update",animate:t})).attr("width",_=>_.value>u?d(u):Math.max(_.width,2)).style("fill",_=>n.model.getFillColor(_[c],null,_)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",_=>_.value),f.exit().remove();const m=y(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const x=r.selectAll("line.peak").data(v==null?[]:[v]);x.enter().append("line").classed("peak",!0).merge(x).attr("y1",0).attr("y2",()=>p||(s?Kt.height.proportional:Kt.height.default)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"peak-line-update",animate:t})).attr("x1",_=>d(_)).attr("x2",_=>d(_)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",_=>_),x.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class CD extends gt{constructor(){super(...arguments),this.type="radar",this.renderType=it.SVG,this.getLabelDimensions=t=>{const n=N.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=N.appendOrSelect(n,"text").text(t),{width:i,height:s}=N.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=_C(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return at(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:at(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?sr.opacity.unselected:sr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?sr.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",sr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:p,yTicksNumber:f,minRange:g,xAxisRectHeight:m}=sr;this.uniqueKeys=Array.from(new Set(s.map(O=>O[u]))),this.uniqueGroups=Array.from(new Set(s.map(O=>O[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),x=(Math.min(r,i)-v)/2;if(x<=0)return;const _=Yi().domain(this.fullDataNormalized.map(O=>O[u])).range([0,2*Math.PI].map(O=>O-Math.PI/2)),E=In(this.fullDataNormalized.map(O=>O[d])),b=je().domain([E>=0?0:E,tr(this.fullDataNormalized.map(O=>O[d]))]).range([g,x]).nice(f),S=b.ticks(f),M=(O,w,L)=>this.model.getFillColor(O,w,L),D=JL().angle(O=>_(O[u])+Math.PI/2).radius(O=>b(O[d])).curve(ff),A=this.uniqueKeys.map(O=>{const w=this.getLabelDimensions(O).width,L=T2(_(O),x);return w+L}),R={x:tr(A)+h,y:i/2},$=N.appendOrSelect(n,"g.y-axes").attr("role",ht.GROUP).selectAll("path").data(S,O=>O),H=O=>this.uniqueKeys.map(w=>({[u]:w,[d]:O}));$.join(O=>O.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",L=>D(H(L)))),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",L=>D(H(L)))),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_exit",animate:t})).attr("d",L=>D(H(L))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",ht.GROUP).selectAll("line").data(this.uniqueKeys,O=>O).join(O=>O.append("line").attr("opacity",0).attr("class",w=>`x-axis-${Kr(w)}`).attr("stroke-dasharray","0").attr("x1",w=>Ut(_(w),0,R).x).attr("y1",w=>Ut(_(w),0,R).y).attr("x2",w=>Ut(_(w),0,R).x).attr("y2",w=>Ut(_(w),0,R).y).call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",L=>Ut(_(L),b.range()[0],R).x).attr("y1",L=>Ut(_(L),b.range()[0],R).y).attr("x2",L=>Ut(_(L),b.range()[1],R).x).attr("y2",L=>Ut(_(L),b.range()[1],R).y)),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",L=>Ut(_(L),b.range()[0],R).x).attr("y1",L=>Ut(_(L),b.range()[0],R).y).attr("x2",L=>Ut(_(L),b.range()[1],R).x).attr("y2",L=>Ut(_(L),b.range()[1],R).y)),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-labels").attr("role",ht.GROUP).selectAll("text").data(this.uniqueKeys).join(O=>O.append("text").text(w=>w).attr("opacity",0).attr("x",w=>Ut(_(w),b.range()[1]+h,R).x).attr("y",w=>Ut(_(w),b.range()[1]+h,R).y).style("text-anchor",w=>Cf(_(w)).textAnchor).style("dominant-baseline",w=>Cf(_(w)).dominantBaseline).call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",L=>Ut(_(L),b.range()[1]+h,R).x).attr("y",L=>Ut(_(L),b.range()[1]+h,R).y).end().finally(()=>{const L=y(o,"radar","alignment"),k=this.getAlignmentXOffset(L,n,this.getParent());n.attr("x",k)})),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.blobs").attr("role",ht.GROUP).selectAll("path").data(this.groupedDataNormalized,O=>O.name).join(O=>O.append("path").attr("class",w=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:w.name,originalClassName:"blob"})).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",w=>w.name).attr("opacity",0).attr("transform",t?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",w=>M(w.name,null,w.data)).style("fill-opacity",sr.opacity.selected).style("stroke",w=>M(w.name,null,w.data)).call(w=>{const L=w.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_enter",animate:t}));t&&L.delay(()=>Math.random()*30).attr("transform",`translate(${R.x}, ${R.y})`),L.attr("opacity",1).attr("d",k=>D(k.data))}),O=>(O.attr("class",w=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:w.name,originalClassName:"blob"})).style("fill",w=>M(w.name,null,w.data)).style("stroke",w=>M(w.name,null,w.data)),O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",L=>D(L.data))),O),O=>O.call(w=>{const L=w.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_exit",animate:t}));t&&L.delay(()=>Math.random()*30).attr("transform",()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`),L.attr("opacity",0).remove()})),N.appendOrSelect(n,"g.dots").attr("role",ht.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(O=>y(O,d)!==null)).join(O=>O.append("circle").attr("role",ht.GRAPHICS_SYMBOL).attr("aria-label",w=>w[c]),O=>O,O=>O.remove()).attr("class",O=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:O[l],originalClassName:Kr(O[u])})).attr("cx",O=>Ut(_(O[u]),b(O[d]),R).x).attr("cy",O=>Ut(_(O[u]),b(O[d]),R).y).attr("r",0).attr("opacity",0).style("fill",O=>M(O[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",ht.GROUP).selectAll("rect").data(this.uniqueKeys).join(O=>O.append("rect"),O=>O,O=>O.remove()).attr("x",R.x).attr("y",R.y-m/2).attr("width",b.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",O=>`rotate(${Af(_(O))}, ${R.x}, ${R.y})`);const{code:P,number:B}=y(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",ht.GROUP).selectAll("text").data(Ge(S)).join(O=>O.append("text").attr("opacity",0).text(w=>B(w,P)).attr("x",w=>Ut(-Math.PI/2,b(w),R).x+p).attr("y",w=>Ut(-Math.PI/2,b(w),R).y).style("text-anchor","start").style("dominant-baseline","middle").call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_update",animate:t})).text(L=>L).attr("opacity",1).attr("x",L=>Ut(-Math.PI/2,b(L),R).x+p).attr("y",L=>Ut(-Math.PI/2,b(L),R).y)),O=>O.call(w=>w.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=N.getSVGElementSize(n,{useBBox:!0}),{width:s}=N.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===zt.CENTER?a=Math.floor((s-i.width)/2):t===zt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Kr(i)}`),o=t.parent.selectAll(`.dots circle.${Kr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",p=>l.indexOf(p[u])!==-1?1:0).attr("r",sr.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(p=>typeof p[d]=="number").map(p=>({label:p[u],value:p[d],color:t.model.getFillColor(p[u],null,p),class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:p[u]})}))})}).on("mousemove",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Kr(i)}`),o=t.parent.selectAll(`.dots circle.${Kr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class jg extends vu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return this.model.getFillColor(l[r],l[c],l)}).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),d=l[c],h=this.services.cartesianScales.getDomainValue(l)-u/2,p=h+u;let f,g;if(Array.isArray(d)&&d.length===2)f=this.services.cartesianScales.getRangeValue(d[0]),g=this.services.cartesianScales.getRangeValue(d[1]);else{const v=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,v)),g=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(g-f);if(m!==0&&m<2&&(d>0&&a===Gt.VERTICAL||d<0&&a===Gt.HORIZONTAL?g=f-2:g=f+2),!this.isOutsideZoomedDomain(h,p))return ie({x0:h,x1:p,y0:f,y1:g},a)}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:I(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class AD extends ce{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),r=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=N.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("role","presentation"),N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Wg extends gt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,i)!==n.datum().name?vn.opacity.unselected:vn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",vn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=tu().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(y(p,0,s),null,p)).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",vn.opacity.selected).attr("d",this.areaGenerator)}}class qg extends vu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ht.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,p=h+d,f=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,p)){if(Math.abs(g-f)>0&&Math.abs(g-f)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Gt.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Gt.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:p,y0:f,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ht.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=I(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=N.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Yg extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=it.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>y(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",ht.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const d=u[i],h=this.services.cartesianScales.getDomainIdentifier(u),p=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:d,[h]:u.data.sharedStackKey,[p]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],p=u.data.sharedStackKey;let f=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);f!=null&&t===this.services.cartesianScales.getDomainValue(p)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(f=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),f!==null&&o.push({[i]:h,[m]:p,[v]:f}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const Es=6;class LD extends gt{constructor(){super(...arguments),this.type="tree",this.renderType=it.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=N.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+Es:30-Es},h=hs({name:o,children:a}),p=10,f=r/6,g=S=>{const M=h.descendants().reverse(),D=h.links();let A=h,R=h;h.eachBefore(k=>{k.x<A.x&&(A=k),k.x>R.x&&(R=k)});const $=R.x-A.x,H=n.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,A.x,r,$].join(" ")),P=b.selectAll("g").data(M,k=>k.id),B=this,O=P.enter().append("g").attr("transform",()=>`translate(${S.y0},${S.x0})`).attr("class",k=>k.depth!==0&&k.children&&k.children.length>0?"clickable":null).on("mouseover",function(k,U){B.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:k,element:I(this),datum:U})}).on("click",function(k,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),B.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:k,element:I(this),datum:U})}).on("mouseout",function(k,U){B.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:k,element:I(this),datum:U})});O.append("circle").attr("r",2.5).attr("class",k=>k._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",k=>k._children?-6:Es).attr("text-anchor",k=>k._children?"end":"start").text(k=>k.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(O).transition(H).attr("transform",k=>`translate(${k.y},${k.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(H).remove().attr("transform",()=>`translate(${S.y},${S.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const w=E.selectAll("path").data(D,k=>k.target.id),L=w.enter().append("path").attr("d",()=>{const k={x:S.x0,y:S.y0};return _({source:k,target:k})});w.merge(L).transition(H).attr("d",_),w.exit().transition(H).remove().attr("d",()=>{const k={x:S.x,y:S.y};return _({source:k,target:k})}),h.eachBefore(k=>{k.x0=k.x,k.y0=k.y})},m=h.descendants(),v=m[m.length-1].depth,x=y(s,"tree","type")===$s.DENDROGRAM?XA().size([i,r-u-v*Es-l]):NL().nodeSize([p,f]).size([i,r-u-v*Es-l]),_=sk().x(S=>S.y).y(S=>S.x);h.x0=f/2,h.y0=0,h.descendants().forEach((S,M)=>{S.id=M,S._children=S.children}),x(h),n.attr("viewBox",[-d.left,-0,r,p]).style("user-select","none");const E=n.append("g").attr("class","links"),b=n.append("g").attr("class","nodes");g(h)}}var kD="#000000",DD="#ffffff",RD="#fcf4d6",ID="#fddc69",ND="#f1c21b",PD="#d2a106",UD="#b28600",BD="#8e6a00",HD="#684e00",VD="#483700",GD="#302400",zD="#1c1500",FD={10:RD,20:ID,30:ND,40:PD,50:UD,60:BD,70:HD,80:VD,90:GD,100:zD},jD="#fff2e8",WD="#ffd9be",qD="#ffb784",YD="#ff832b",XD="#eb6200",ZD="#ba4e00",KD="#8a3800",QD="#5e2900",JD="#3e1a00",tR="#231000",eR={10:jD,20:WD,30:qD,40:YD,50:XD,60:ZD,70:KD,80:QD,90:JD,100:tR},nR="#fff1f1",rR="#ffd7d9",iR="#ffb3b8",sR="#ff8389",aR="#fa4d56",oR="#da1e28",lR="#a2191f",cR="#750e13",uR="#520408",hR="#2d0709",dR={10:nR,20:rR,30:iR,40:sR,50:aR,60:oR,70:lR,80:cR,90:uR,100:hR},pR="#fff0f7",fR="#ffd6e8",mR="#ffafd2",gR="#ff7eb6",vR="#ee5396",yR="#d02670",xR="#9f1853",bR="#740937",_R="#510224",ER="#2a0a18",OR={10:pR,20:fR,30:mR,40:gR,50:vR,60:yR,70:xR,80:bR,90:_R,100:ER},SR="#f6f2ff",TR="#e8daff",wR="#d4bbff",$R="#be95ff",MR="#a56eff",CR="#8a3ffc",AR="#6929c4",LR="#491d8b",kR="#31135e",DR="#1c0f30",RR={10:SR,20:TR,30:wR,40:$R,50:MR,60:CR,70:AR,80:LR,90:kR,100:DR},IR="#edf5ff",NR="#d0e2ff",PR="#a6c8ff",UR="#78a9ff",BR="#4589ff",HR="#0f62fe",VR="#0043ce",GR="#002d9c",zR="#001d6c",FR="#001141",jR={10:IR,20:NR,30:PR,40:UR,50:BR,60:HR,70:VR,80:GR,90:zR,100:FR},WR="#e5f6ff",qR="#bae6ff",YR="#82cfff",XR="#33b1ff",ZR="#1192e8",KR="#0072c3",QR="#00539a",JR="#003a6d",tI="#012749",eI="#061727",nI={10:WR,20:qR,30:YR,40:XR,50:ZR,60:KR,70:QR,80:JR,90:tI,100:eI},rI="#d9fbfb",iI="#9ef0f0",sI="#3ddbd9",aI="#08bdba",oI="#009d9a",lI="#007d79",cI="#005d5d",uI="#004144",hI="#022b30",dI="#081a1c",pI={10:rI,20:iI,30:sI,40:aI,50:oI,60:lI,70:cI,80:uI,90:hI,100:dI},fI="#defbe6",mI="#a7f0ba",gI="#6fdc8c",vI="#42be65",yI="#24a148",xI="#198038",bI="#0e6027",_I="#044317",EI="#022d0d",OI="#071908",SI={10:fI,20:mI,30:gI,40:vI,50:yI,60:xI,70:bI,80:_I,90:EI,100:OI},TI="#f2f4f8",wI="#dde1e6",$I="#c1c7cd",MI="#a2a9b0",CI="#878d96",AI="#697077",LI="#4d5358",kI="#343a3f",DI="#21272a",RI="#121619",II={10:TI,20:wI,30:$I,40:MI,50:CI,60:AI,70:LI,80:kI,90:DI,100:RI},NI="#f4f4f4",PI="#e0e0e0",UI="#c6c6c6",BI="#a8a8a8",HI="#8d8d8d",VI="#6f6f6f",GI="#525252",zI="#393939",FI="#262626",jI="#161616",WI={10:NI,20:PI,30:UI,40:BI,50:HI,60:VI,70:GI,80:zI,90:FI,100:jI},qI="#f7f3f2",YI="#e5e0df",XI="#cac5c4",ZI="#ada8a8",KI="#8f8b8b",QI="#726e6e",JI="#565151",tN="#3c3838",eN="#272525",nN="#171414",rN={10:qI,20:YI,30:XI,40:ZI,50:KI,60:QI,70:JI,80:tN,90:eN,100:nN},Xg={black:{100:kD},blue:jR,coolGray:II,cyan:nI,gray:WI,green:SI,magenta:OR,orange:eR,purple:RR,red:dR,teal:pI,warmGray:rN,white:{0:DD},yellow:FD};const iN=e=>{if(!e)return null;for(const t of Object.keys(Xg)){const n=Xg[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Zg=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=fn(n);let i;if(r&&(i=iN(r?r.hex():null)),i==null){const s=Ld(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let sN=0;class aN extends gt{constructor(){super(...arguments),this.type="treemap",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=N.getSVGElementSize(n,{useAttrs:!0}),l=hs({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=VL().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),p=>p.data.name);u.exit().attr("opacity",0).remove();const d=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>sN++).merge(u);d.attr("data-name","leaf").transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-group-update",animate:t})).attr("transform",p=>`translate(${p.x0},${p.y0})`);const h=d.selectAll("rect.leaf").data(p=>[p]);h.exit().attr("width",0).attr("height",0).remove(),h.enter().append("rect").classed("leaf",!0).merge(h).attr("width",0).attr("height",0).attr("id",function(){const p=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${p}`}).attr("class",p=>{for(;p.depth>1;)p=p.parent;return this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:p.data.name,originalClassName:"leaf"})}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-leaf-update-enter",animate:t})).attr("width",p=>p.x1-p.x0).attr("height",p=>p.y1-p.y0).style("fill",p=>{for(;p.depth>1;)p=p.parent;return this.model.getFillColor(p.data.name,null,p.data)}),d.selectAll("clipPath").data(p=>p.data.showLabel!==!0?[]:[1],p=>p).join(p=>p.append("clipPath").attr("id",function(){const f=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=I(this.parentNode.parentNode).attr("data-uid"),g=`${i.style.prefix}-leaf-${f}`;return new URL(`#${g}`,s)+""}),p=>null,p=>p.remove()),d.selectAll("text").data(p=>{if(p.data.showLabel!==!0)return[];let f=p;for(;f.depth>1;)f=f.parent;return[{text:p.data.name,backgroundColor:this.model.getFillColor(f.data.name)}]},p=>p).join(p=>{const f=p.append("text").text(g=>g.text).style("fill",Zg).attr("x",7).attr("y",18);return s&&f.attr("clip-path",function(){const g=I(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${g}`;return`url(${new URL(`#${m}`,s)+""})`}),f},p=>p.text(f=>f.text).style("fill",Zg),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),fn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}function oN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lN(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var cN={value:function(){}};function Kg(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new uo(n)}function uo(e){this._=e}function uN(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}uo.prototype=Kg.prototype={constructor:uo,on:function(e,t){var n=this._,r=uN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=hN(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Qg(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Qg(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new uo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function hN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Qg(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=cN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const dN=Object.freeze(Object.defineProperty({__proto__:null,dispatch:Kg},Symbol.toStringTag,{value:"Module"})),pN=lN(dN);var yu,Jg;function fN(){if(Jg)return yu;Jg=1;const e=pN.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;yu=function(){var E=[256,256],b=s,S=a,M=l,D=o,A=o,R=c,$=u,H=g,P=[],B=1/0,O=e("word","end"),w=null,L=Math.random,k={},U=x;k.canvas=function(j){return arguments.length?(U=_(j),k):U},k.start=function(){var j=K(U()),X=v((E[0]>>5)*E[1]),ct=null,J=P.length,Y=-1,et=[],ut=P.map(function(q,Z){return q.text=b.call(this,q,Z),q.font=S.call(this,q,Z),q.style=D.call(this,q,Z),q.weight=A.call(this,q,Z),q.rotate=R.call(this,q,Z),q.size=~~M.call(this,q,Z),q.padding=$.call(this,q,Z),q}).sort(function(q,Z){return Z.size-q.size});return w&&clearInterval(w),w=setInterval(F,0),F(),k;function F(){for(var q=Date.now();Date.now()-q<B&&++Y<J&&w;){var Z=ut[Y];Z.x=E[0]*(L()+.5)>>1,Z.y=E[1]*(L()+.5)>>1,d(j,Z,ut,Y),Z.hasText&&W(X,Z,ct)&&(et.push(Z),O.call("word",k,Z),ct?p(ct,Z):ct=[{x:Z.x+Z.x0,y:Z.y+Z.y0},{x:Z.x+Z.x1,y:Z.y+Z.y1}],Z.x-=E[0]>>1,Z.y-=E[1]>>1)}Y>=J&&(k.stop(),O.call("end",k,et,ct))}},k.stop=function(){w&&(clearInterval(w),w=null);for(const j of P)delete j.sprite;return k};function K(j){const X=j.getContext("2d",{willReadFrequently:!0});j.width=j.height=1;const ct=Math.sqrt(X.getImageData(0,0,1,1).data.length>>2);return j.width=(r<<5)/ct,j.height=i/ct,X.fillStyle=X.strokeStyle="red",{context:X,ratio:ct}}function W(j,X,ct){E[0],E[1];for(var J=X.x,Y=X.y,et=Math.sqrt(E[0]*E[0]+E[1]*E[1]),ut=H(E),F=L()<.5?1:-1,q=-F,Z,G,dt;(Z=ut(q+=F))&&(G=~~Z[0],dt=~~Z[1],!(Math.min(Math.abs(G),Math.abs(dt))>=et));)if(X.x=J+G,X.y=Y+dt,!(X.x+X.x0<0||X.y+X.y0<0||X.x+X.x1>E[0]||X.y+X.y1>E[1])&&(!ct||f(X,ct))&&!h(X,j,E[0])){for(var ot=X.sprite,It=X.width>>5,Ht=E[0]>>5,rt=X.x-(It<<4),Et=rt&127,Ne=32-Et,Te=X.y1-X.y0,Ss=(X.y+X.y0)*Ht+(rt>>5),Ts,_r=0;_r<Te;_r++){Ts=0;for(var Ze=0;Ze<=It;Ze++)j[Ss+Ze]|=Ts<<Ne|(Ze<It?(Ts=ot[_r*It+Ze])>>>Et:0);Ss+=Ht}return!0}return!1}return k.timeInterval=function(j){return arguments.length?(B=j??1/0,k):B},k.words=function(j){return arguments.length?(P=j,k):P},k.size=function(j){return arguments.length?(E=[+j[0],+j[1]],k):E},k.font=function(j){return arguments.length?(S=_(j),k):S},k.fontStyle=function(j){return arguments.length?(D=_(j),k):D},k.fontWeight=function(j){return arguments.length?(A=_(j),k):A},k.rotate=function(j){return arguments.length?(R=_(j),k):R},k.text=function(j){return arguments.length?(b=_(j),k):b},k.spiral=function(j){return arguments.length?(H=n[j]||j,k):H},k.fontSize=function(j){return arguments.length?(M=_(j),k):M},k.padding=function(j){return arguments.length?($=_(j),k):$},k.random=function(j){return arguments.length?(L=j,k):L},k.on=function(){var j=O.on.apply(O,arguments);return j===O?k:j},k};function s(E){return E.text}function a(){return"serif"}function o(){return"normal"}function l(E){return Math.sqrt(E.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(E,b,S,M){if(!b.sprite){var D=E.context,A=E.ratio;D.clearRect(0,0,(r<<5)/A,i/A);var R=0,$=0,H=0,P=S.length;for(--M;++M<P;){b=S[M],D.save(),D.font=b.style+" "+b.weight+" "+~~((b.size+1)/A)+"px "+b.font;const Z=D.measureText(b.text),G=-Math.floor(Z.width/2);let dt=(Z.width+1)*A,ot=b.size<<1;if(b.rotate){var B=Math.sin(b.rotate*t),O=Math.cos(b.rotate*t),w=dt*O,L=dt*B,k=ot*O,U=ot*B;dt=Math.max(Math.abs(w+U),Math.abs(w-U))+31>>5<<5,ot=~~Math.max(Math.abs(L+k),Math.abs(L-k))}else dt=dt+31>>5<<5;if(ot>H&&(H=ot),R+dt>=r<<5&&(R=0,$+=H,H=0),$+ot>=i)break;D.translate((R+(dt>>1))/A,($+(ot>>1))/A),b.rotate&&D.rotate(b.rotate*t),D.fillText(b.text,G,0),b.padding&&(D.lineWidth=2*b.padding,D.strokeText(b.text,G,0)),D.restore(),b.width=dt,b.height=ot,b.xoff=R,b.yoff=$,b.x1=dt>>1,b.y1=ot>>1,b.x0=-b.x1,b.y0=-b.y1,b.hasText=!0,R+=dt}for(var K=D.getImageData(0,0,(r<<5)/A,i/A).data,W=[];--M>=0;)if(b=S[M],!!b.hasText){for(var j=b.width,X=j>>5,ct=b.y1-b.y0,J=0;J<ct*X;J++)W[J]=0;if(R=b.xoff,R==null)return;$=b.yoff;for(var Y=0,et=-1,ut=0;ut<ct;ut++){for(var J=0;J<j;J++){var F=X*ut+(J>>5),q=K[($+ut)*(r<<5)+(R+J)<<2]?1<<31-J%32:0;W[F]|=q,Y|=q}Y?et=ut:(b.y0++,ct--,ut--,$++)}b.y1=b.y0+et,b.sprite=W.slice(0,(b.y1-b.y0)*X)}}}function h(E,b,S){S>>=5;for(var M=E.sprite,D=E.width>>5,A=E.x-(D<<4),R=A&127,$=32-R,H=E.y1-E.y0,P=(E.y+E.y0)*S+(A>>5),B,O=0;O<H;O++){B=0;for(var w=0;w<=D;w++)if((B<<$|(w<D?(B=M[O*D+w])>>>R:0))&b[P+w])return!0;P+=S}return!1}function p(E,b){var S=E[0],M=E[1];b.x+b.x0<S.x&&(S.x=b.x+b.x0),b.y+b.y0<S.y&&(S.y=b.y+b.y0),b.x+b.x1>M.x&&(M.x=b.x+b.x1),b.y+b.y1>M.y&&(M.y=b.y+b.y1)}function f(E,b){return E.x+E.x1>b[0].x&&E.x+E.x0<b[1].x&&E.y+E.y1>b[0].y&&E.y+E.y0<b[1].y}function g(E){var b=E[0]/E[1];return function(S){return[b*(S*=.1)*Math.cos(S),S*Math.sin(S)]}}function m(E){var b=4,S=b*E[0]/E[1],M=0,D=0;return function(A){var R=A<0?-1:1;switch(Math.sqrt(1+4*R*A)-R&3){case 0:M+=S;break;case 1:D+=b;break;case 2:M-=S;break;default:D-=b;break}return[M,D]}}function v(E){for(var b=[],S=-1;++S<E;)b[S]=0;return b}function x(){return document.createElement("canvas")}function _(E){return typeof E=="function"?E:function(){return E}}return yu}var mN=fN();const gN=oN(mN);class vN extends gt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=it.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=N.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=gN().size([u,d]).words(i.map(function(f){const g=f[o];if(typeof f[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:f[c],text:f[l],size:g,value:g}})).padding(5).rotate(0).fontSize(f=>s(f.size)).on("end",p);h.start();function p(f){const g=N.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(f,v=>`${v[c]}-${v.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",v=>`${v.size}px`).text(function(v){return v.text}).attr("class",v=>n.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:v[c],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[c],v.text,v)).attr("text-anchor","middle").transition().call(v=>n.services.transitions.setupTransition({transition:v,name:"wordcloud-text-update-enter",animate:t})).attr("transform",v=>`translate(${v.x}, ${v.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Ge(i):[1,1];return je().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=ga(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class yN extends gt{constructor(){super(...arguments),this.type="geo",this.renderType=it.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=N.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=uD(s,Object.values(l)),u=oD(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=_A().projection(d);N.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=N.appendOrSelect(t,"defs");N.appendOrSelect(f,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",ms()([[0,0],[0,10]]));const g=N.appendOrSelect(t,"g.missing-data");N.appendOrSelect(g,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case Je.geoEqualEarth:t=HA();break;case Je.geoAlbers:t=DA();break;case Je.geoConicEqualArea:t=qm();break;case Je.geoConicEquidistant:t=UA();break;case Je.geoEquirectangular:t=NA();break;case Je.geoMercator:t=RA();break;case Je.geoNaturalEarth1:t=VA();break;default:throw new Error("Projection is not supported.")}return t}}class xN extends yN{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),r=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),i=y(this.getOptions(),"color"),s=y(i,"gradient","colors");r.select("g.geo").selectAll("path").classed("border",!0).attr("class",a=>this.model.getColorClassName({value:n[a.properties.NAME].value,originalClassName:"border"})).attr("style",a=>s?`fill: ${this.model.getColorClassName({value:n[a.properties.NAME].value})}`:null),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(Sr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Or.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Sr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Or.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Sr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Sr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Or.HIDE,{event:r,hoveredElement:s})})}}function xu(e){var t=e==null?0:e.length;return t?Bs(e,1):[]}function bN(e){return ah(ch(e,void 0,xu),e+"")}function tv(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function _N(e,t){return t.length<2?e:el(e,tv(t,0,-1))}function EN(e,t){return t=Us(t,e),e=_N(e,t),e==null||delete e[Mi(id(t))]}function ON(e){return Eh(e)?void 0:e}var SN=1,TN=2,wN=4,$N=bN(function(e,t){var n={};if(e==null)return n;var r=!1;t=zo(t,function(s){return s=Us(s,e),r||(r=s.length>1),s}),Mr(e,kh(e),n),r&&(n=Ci(n,SN|TN|wN,ON));for(var i=t.length;i--;)EN(n,t[i]);return n});function ev(e){return Math.log(e)}function nv(e){return Math.exp(e)}function MN(e){return-Math.log(-e)}function CN(e){return-Math.exp(-e)}function AN(e){return isFinite(e)?+("1e"+e):e<0?0:e}function LN(e){return e===10?AN:e===Math.E?Math.exp:t=>Math.pow(e,t)}function kN(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function rv(e){return(t,n)=>-e(-t,n)}function DN(e){const t=e(ev,nv),n=t.domain;let r=10,i,s;function a(){return i=kN(r),s=LN(r),n()[0]<0?(i=rv(i),s=rv(s),e(MN,CN)):e(ev,nv),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),p=i(u),f,g;const m=o==null?10:+o;let v=[];if(!(r%1)&&p-h<m){if(h=Math.floor(h),p=Math.ceil(p),c>0){for(;h<=p;++h)for(f=1;f<r;++f)if(g=h<0?f/s(-h):f*s(h),!(g<c)){if(g>u)break;v.push(g)}}else for(;h<=p;++h)for(f=r-1;f>=1;--f)if(g=h>0?f/s(-h):f*s(h),!(g<c)){if(g>u)break;v.push(g)}v.length*2<m&&(v=js(c,u,m))}else v=js(h,p,Math.min(p-h,m)).map(s);return d?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Vi(l)).precision==null&&(l.trim=!0),l=Il(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(zp(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function iv(){const e=DN(op()).domain([1,10]);return e.copy=()=>Pl(e,iv()).base(e.base()),Ur.apply(e,arguments),e}function ho(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function po(e){this._context=e}po.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ho(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ho(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function RN(e){return new po(e)}function sv(e){this._context=e}sv.prototype={areaStart:Bn,areaEnd:Bn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ho(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function IN(e){return new sv(e)}function av(e){this._context=e}av.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ho(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function NN(e){return new av(e)}function ov(e,t){this._basis=new po(e),this._beta=t}ov.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const PN=function e(t){function n(r){return t===1?new po(r):new ov(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function fo(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function bu(e,t){this._context=e,this._k=(1-t)/6}bu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:fo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:fo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const UN=function e(t){function n(r){return new bu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function _u(e,t){this._context=e,this._k=(1-t)/6}_u.prototype={areaStart:Bn,areaEnd:Bn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:fo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const BN=function e(t){function n(r){return new _u(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Eu(e,t){this._context=e,this._k=(1-t)/6}Eu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:fo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const HN=function e(t){function n(r){return new Eu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ou(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>ee){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ee){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function lv(e,t){this._context=e,this._alpha=t}lv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Ou(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const VN=function e(t){function n(r){return t?new lv(r,t):new bu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function cv(e,t){this._context=e,this._alpha=t}cv.prototype={areaStart:Bn,areaEnd:Bn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ou(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const GN=function e(t){function n(r){return t?new cv(r,t):new _u(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function uv(e,t){this._context=e,this._alpha=t}uv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ou(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const zN=function e(t){function n(r){return t?new uv(r,t):new Eu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function hv(e){return e<0?-1:1}function dv(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(hv(s)+hv(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function pv(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Su(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function mo(e){this._context=e}mo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Su(this,this._t0,pv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Su(this,pv(this,n=dv(this,e,t)),n);break;default:Su(this,this._t0,n=dv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function fv(e){this._context=new mv(e)}(fv.prototype=Object.create(mo.prototype)).point=function(e,t){mo.prototype.point.call(this,t,e)};function mv(e){this._context=e}mv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function FN(e){return new mo(e)}function jN(e){return new fv(e)}function gv(e){this._context=e}gv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=vv(e),i=vv(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function vv(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function WN(e){return new gv(e)}function go(e,t){this._context=e,this._t=t}go.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function qN(e){return new go(e,.5)}function YN(e){return new go(e,0)}function XN(e){return new go(e,1)}class ZN extends wn{zoomIn(t,n,r){let i,s,a;const o=r||Hr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=N.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_IN,{element:I(t)})}zoomOut(t,n){const r=n||Hr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_OUT)}}class KN extends wn{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class QN extends wn{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class JN extends wn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(T.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(y(fp,n,"duration")||fp.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Os(e,t){const n=+Pt(e)-+Pt(t);return n<0?-1:n>0?1:n}function tP(e,t,n){const[r,i]=qn(void 0,e,t);return r.getFullYear()-i.getFullYear()}function eP(e,t,n){const[r,i]=qn(void 0,e,t),s=Os(r,i),a=Math.abs(tP(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Os(r,i)===-s,l=s*(a-+o);return l===0?0:l}function Tu(e,t,n){const r=Pt(e,void 0);if(isNaN(t))return $e(e,NaN);if(!t)return r;const i=r.getDate(),s=$e(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function yv(e,t,n){return Tu(e,t*12)}function nP(e,t,n){return yv(e,-t)}function rP(e,t,n){const[r,i]=qn(void 0,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function iP(e,t){const n=Pt(e,void 0);return n.setHours(23,59,59,999),n}function sP(e,t){const n=Pt(e,void 0),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function aP(e,t){const n=Pt(e,void 0);return+iP(n)==+sP(n)}function oP(e,t,n){const[r,i,s]=qn(void 0,e,e,t),a=Os(i,s),o=Math.abs(rP(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Os(i,s)===-a;aP(r)&&o===1&&Os(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function lP(e,t,n){return Tu(e,-t)}function cP(e,t,n){const[r,i]=qn(void 0,e,t),s=xv(r,i),a=Math.abs(wp(r,i));r.setDate(r.getDate()-s*a);const o=+(xv(r,i)===-s),l=s*(a-o);return l===0?0:l}function xv(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function bv(e,t,n){const r=Pt(e,void 0);return isNaN(t)?$e(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function uP(e,t,n){return bv(e,-t)}function wu(e){return t=>{const n=(0,Math.trunc)(t);return n===0?0:n}}function hP(e,t,n){const[r,i]=qn(void 0,e,t),s=(+r-+i)/Yu;return wu()(s)}function _v(e,t,n){return $e(e,+Pt(e)+t)}function Ev(e,t,n){return _v(e,t*Yu)}function dP(e,t,n){return Ev(e,-t)}function Ov(e,t){return+Pt(e)-+Pt(t)}function Sv(e,t,n){const r=Ov(e,t)/qu;return wu()(r)}function $u(e,t,n){const r=Pt(e,void 0);return r.setTime(r.getTime()+t*qu),r}function Tv(e,t,n){return $u(e,-t)}function wv(e,t,n){const r=Ov(e,t)/1e3;return wu()(r)}function Mu(e,t,n){return _v(e,t*1e3)}function $v(e,t,n){return Mu(e,-t)}class pP extends wn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=y(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=y(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(t=>z[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Gt.VERTICAL:this.orientation=Gt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=y(s,"axes");((t=a[z.LEFT])!=null&&t.correspondingDatasets&&a[z.RIGHT]||(n=a[z.RIGHT])!=null&&n.correspondingDatasets&&a[z.LEFT]||(r=a[z.TOP])!=null&&r.correspondingDatasets&&a[z.BOTTOM]||(i=a[z.BOTTOM])!=null&&i.correspondingDatasets&&a[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===nt.LINEAR||this.scaleTypes[t]===nt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),a=y(s,"axes")[r],{mapsTo:o}=a,l=y(i,o)!==null?i[o]:i;let c;switch(n){case nt.LABELS:c=t(l)+t.step()/2;break;case nt.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=y(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=y(r,"axes",t);if(i.scaleType===nt.TIME){const s=y(r,"timeScale","addSpaceOnEdges");return fP(n,s)}else return mP(n,Nn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||r&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||r&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=y(r,"axes",t.primary),s=y(r,"axes",n.primary),a=i.scaleType||nt.LINEAR,o=s.scaleType||nt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===nt.LABELS||o===nt.TIME)&&a===nt.LABELS||a===nt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=y(n,"axes",t),i=y(n,"bounds"),{includeZero:s}=r,a=y(r,"scaleType")||nt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,tr(v,x=>x.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),x=this.model.getStackKeys({bins:v});return[x[0].split(":")[0],x[x.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:p}=Nn.ratio;if(r.domain)return a===nt.LABELS?r.domain:(a===nt.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===nt.LABELS)return Li(o.map(v=>v[c]));let f,g;const m=this.model.getDataGroupNames();if(a===nt.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[p]}`);if(a===nt.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,x=this.model.getDataValuesGroupedByKeys({groups:m}),_=o.filter(b=>!m.includes(b[v])),E=[];x.forEach(b=>{const{...S}=b;let M=0,D=0;Object.values($N(S,"sharedStackKey")).forEach(A=>{isNaN(A)||(A<0?D+=A:M+=A)}),E.push([D,M])}),g=[...xu(E),..._.map(b=>b[c])]}else g=[],o.forEach(v=>{const x=v[c];Array.isArray(x)&&x.length===2?(g.push(x[0]),g.push(x[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(x))});return a!==nt.TIME&&a!==nt.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const x=y(v,"value");x!==null&&g.push(x)}),f=Ge(g),f=this.extendsDomain(t,f),f}createScale(t){const n=this.model.getOptions(),r=y(n,"axes",t);if(!r)return null;const i=y(r,"scaleType")||nt.LINEAR;this.scaleTypes[t]=i;let s;return i===nt.TIME?s=cf():i===nt.LOG?s=iv().base(r.base||10):i===nt.LABELS||i===nt.LABELS_RATIO?s=Yi():s=je(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Gt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===nt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function fP(e,t){const n=new Date(e[0]),r=new Date(e[1]);return eP(r,n)>1?[nP(n,t),yv(r,t)]:oP(r,n)>1?[lP(n,t),Tu(r,t)]:cP(r,n)>1?[uP(n,t),bv(r,t)]:hP(r,n)>1?[dP(n,t),Ev(r,t)]:Sv(r,n)>30?[Tv(n,t*30),$u(r,t*30)]:Sv(r,n)>1?[Tv(n,t),$u(r,t)]:wv(r,n)>15?[$v(n,t*15),Mu(r,t*15)]:wv(r,n)>1?[$v(n,t),Mu(r,t)]:[n,r]}function mP([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===nt.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}class gP extends wn{constructor(){super(...arguments),this.curveTypes={curveLinear:Oa,curveLinearClosed:ff,curveBasis:RN,curveBasisClosed:IN,curveBasisOpen:NN,curveBundle:PN,curveCardinal:UN,curveCardinalClosed:BN,curveCardinalOpen:HN,curveCatmullRom:VN,curveCatmullRomClosed:GN,curveCatmullRomOpen:zN,curveMonotoneX:FN,curveMonotoneY:jN,curveNatural:WN,curveStep:qN,curveStepAfter:XN,curveStepBefore:YN}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class vP extends wn{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===nt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Ge(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=be.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let d=a+u,h=o-u;d>=h&&(d=a+c/2-i/2,h=o-c/2+i/2);const p=[s.invert(d),s.invert(h)];(r[0].valueOf()!==p[0].valueOf()||r[1].valueOf()!==p[1].valueOf())&&this.handleDomainChange(p)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}function yP(e,t,n){var r=e.length;return n=n===void 0?r:n,tv(e,t,n)}var xP="\\ud800-\\udfff",bP="\\u0300-\\u036f",_P="\\ufe20-\\ufe2f",EP="\\u20d0-\\u20ff",OP=bP+_P+EP,SP="\\ufe0e\\ufe0f",TP="\\u200d",wP=RegExp("["+TP+xP+OP+SP+"]");function Mv(e){return wP.test(e)}function $P(e){return e.split("")}var Cv="\\ud800-\\udfff",MP="\\u0300-\\u036f",CP="\\ufe20-\\ufe2f",AP="\\u20d0-\\u20ff",LP=MP+CP+AP,kP="\\ufe0e\\ufe0f",DP="["+Cv+"]",Cu="["+LP+"]",Au="\\ud83c[\\udffb-\\udfff]",RP="(?:"+Cu+"|"+Au+")",Av="[^"+Cv+"]",Lv="(?:\\ud83c[\\udde6-\\uddff]){2}",kv="[\\ud800-\\udbff][\\udc00-\\udfff]",IP="\\u200d",Dv=RP+"?",Rv="["+kP+"]?",NP="(?:"+IP+"(?:"+[Av,Lv,kv].join("|")+")"+Rv+Dv+")*",PP=Rv+Dv+NP,UP="(?:"+[Av+Cu+"?",Cu,Lv,kv,DP].join("|")+")",BP=RegExp(Au+"(?="+Au+")|"+UP+PP,"g");function HP(e){return e.match(BP)||[]}function VP(e){return Mv(e)?HP(e):$P(e)}function GP(e){return function(t){t=$i(t);var n=Mv(t)?VP(t):void 0,r=n?n[0]:t.charAt(0),i=n?yP(n,1).join(""):t.slice(1);return r[e]()+i}}var zP=GP("toUpperCase");function FP(e){return zP($i(e).toLowerCase())}var jP=Yf(function(e,t,n){return t=t.toLowerCase(),e+(n?FP(t):t)});class Xe{constructor(t,n){this.components=[],this.services={canvasZoom:ZN,domUtils:N,events:KN,files:QN,gradientUtils:dc,transitions:JN},this.model=new rn(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(T.Model.UPDATE,r=>{const i=!!y(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(T.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(T.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s={id:"legend",components:[new cu(this.model,this.services)],growth:lt.PREFERRED},a=y(r,"canvasZoom","enabled");a&&a===!0&&t.push(new Mk(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new _s(this.model,this.services)],growth:lt.STRETCH},c={id:"toolbar",components:[new io(this.model,this.services)],growth:lt.PREFERRED},u={id:"header",components:[new Oe(this.model,this.services,[l,...i?[c]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},d={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:y(n,"graphFrameRenderType")||it.SVG},h=y(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=Mt.COLUMN;if(h){const v=y(r,"legend","position");v==="left"?(p=Mt.ROW,r.legend.orientation||(r.legend.orientation=wr.VERTICAL)):v==="right"?(p=Mt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=wr.VERTICAL)):v==="bottom"&&(p=Mt.COLUMN_REVERSE)}const f={id:"spacer",components:[new An(this.model,this.services)],growth:lt.PREFERRED},g={id:"full-frame",components:[new Oe(this.model,this.services,[...h?[s]:[],...h?[f]:[],d],{direction:p})],growth:lt.STRETCH},m=[];if(o||i){m.push(u);const v={id:"spacer",components:[new An(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};m.push(v)}return m.push(g),[new uu(this.model,this.services),new so(this.model,this.services),new Oe(this.model,this.services,m,{direction:Mt.COLUMN})]}}class ge extends Xe{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:pP,curves:gP,zoom:vP}),this.model=new lr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",z.TOP,"enabled"),s=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(r,"axes",a,"scaleType"),l=i&&a===z.BOTTOM&&o===nt.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new _s(this.model,this.services)],growth:lt.STRETCH},h={id:"toolbar",components:[new io(this.model,this.services)],growth:lt.PREFERRED},p={id:"header",components:[new Oe(this.model,this.services,[d,...s?[h]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},f={id:"legend",components:[new cu(this.model,this.services)],growth:lt.PREFERRED};l&&!c&&t.push(new Og(this.model,this.services),new Ck(this.model,this.services)),t.push(new Lk(this.model,this.services)),t.push(new kk(this.model,this.services));const g={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Mt.COLUMN;if(m){const S=y(this.model.getOptions(),"legend","position");S===Tr.LEFT?(v=Mt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=wr.VERTICAL)):S===Tr.RIGHT?(v=Mt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=wr.VERTICAL)):S===Tr.BOTTOM&&(v=Mt.COLUMN_REVERSE)}const x={id:"spacer",components:[new An(this.model,this.services)],growth:lt.PREFERRED},_={id:"full-frame",components:[new Oe(this.model,this.services,[...m?[f]:[],...m?[x]:[],g],{direction:v})],growth:lt.STRETCH},E={id:"zoom-bar",components:[new Ak(this.model,this.services)],growth:lt.PREFERRED,renderType:it.SVG},b=[];if(u||s){b.push(p);const S={id:"spacer",components:[new An(this.model,this.services,s?{size:15}:void 0)],growth:lt.PREFERRED};b.push(S)}return l&&b.push(E),b.push(_),[new $g(this.model,this.services),new so(this.model,this.services),new Oe(this.model,this.services,b,{direction:Mt.COLUMN})]}}class WP extends Xe{constructor(t,n){super(t,n),this.model=new zw(this.services),this.model.setOptions(Rt(Ct.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new Qk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class qP extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(pn(Ct.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Gn(this.model,this.services),new ai(this.model,this.services),new Ng(this.model,this.services),new cn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class YP extends ge{constructor(t,n){super(t,n),this.model=new Fw(this.services),this.model.setOptions(Rt(Ct.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new eD(this.model,this.services),new oi(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class XP extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Gn(this.model,this.services),new nD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class ZP extends ge{constructor(t,n){super(t,n),this.model=new jw(this.services),this.model.setOptions(Rt(Ct.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new rD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class KP extends Xe{constructor(t,n){super(t,n),this.model=new Ww(this.services),this.model.setOptions(Rt(Ct.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new _s(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new io(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new Oe(this.model,this.services,[a,...i?[o]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Hg(this.model,this.services,{chartType:"choropleth"})],growth:lt.PREFERRED,renderType:it.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Mt.COLUMN_REVERSE,p={id:"spacer",components:[new An(this.model,this.services,{size:15})],growth:lt.PREFERRED},f={id:"full-frame",components:[new Oe(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new An(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(m)}return g.push(f),[new uu(this.model,this.services),new so(this.model,this.services),new Oe(this.model,this.services,g,{direction:Mt.COLUMN})]}getComponents(){const t=[new xN(this.model,this.services)];return this.getChartComponents(t)}}class QP extends Xe{constructor(t,n){super(t,n),this.model=new qw(this.services),this.model.setOptions(Rt(Ct.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new _D(this.model,this.services)];return this.getChartComponents(t)}}const Iv={[ve.LINE]:[ai,cn],[ve.SCATTER]:[cn],[ve.AREA]:[Ng,ai,cn],[ve.STACKED_AREA]:[Wg,ai,Yg,co],[ve.SIMPLE_BAR]:[jg],[ve.GROUPED_BAR]:[Fg,oi],[ve.STACKED_BAR]:[qg,co]};class JP extends ge{constructor(t,n){super(t,n);const r=Rt(Ct.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:ve.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Iv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${jP(i.type)}Chart`;return a=at({},Ct[l],this.model.getOptions(),i.options),i.type===ve.STACKED_AREA&&(o=!0),Iv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=at({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return xu(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===ve.STACKED_BAR||i.type===ve.STACKED_AREA),r=[new me(this.model,this.services),new Se(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID}),...n?[]:[new Gn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class Nv extends Xe{constructor(t,n,r=!1){super(t,n),this.model=new Yw(this.services),!r&&(this.model.setOptions(Rt(Ct.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Vg(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.PIE})];return this.getChartComponents(t)}}class t3 extends Nv{constructor(t,n){super(t,n,!0),this.model.setOptions(Rt(Ct.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new OD(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.DONUT})];return this.getChartComponents(t)}}class e3 extends Xe{constructor(t,n){super(t,n),this.model=new Xw(this.services),this.model.setOptions(Rt(Ct.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new SD(this.model,this.services)];return this.getChartComponents(t)}}class n3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Fg(this.model,this.services),new oi(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class r3 extends ge{constructor(t,n){super(t,n),this.model=new Zw(this.services),this.model.setOptions(Rt(Ct.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new _s(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new io(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new Oe(this.model,this.services,[a,...i?[o]:[]],{direction:Mt.ROW,alignItems:jn.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Hg(this.model,this.services,{chartType:"heatmap"})],growth:lt.PREFERRED,renderType:it.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:it.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Mt.COLUMN_REVERSE,p={id:"spacer",components:[new An(this.model,this.services,{size:15})],growth:lt.PREFERRED},f={id:"full-frame",components:[new Oe(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new An(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(m)}return g.push(f),[new $g(this.model,this.services),new so(this.model,this.services),new Oe(this.model,this.services,g,{direction:Mt.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new TD(this.model,this.services)];return this.getAxisChartComponents(t)}}class i3 extends ge{constructor(t,n){super(t,n),this.model=new Kw(this.services),this.model.setOptions(Rt(Ct.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new dD(this.model,this.services),new wD(this.model,this.services)];return this.getAxisChartComponents(t)}}class s3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Gn(this.model,this.services),new ai(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new AD(this.model,this.services),new oi(this.model,this.services)];return this.getAxisChartComponents(t)}}class a3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Gn(this.model,this.services),new $D(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class o3 extends Xe{constructor(t,n){var r;super(t,n),this.model=new Qw(this.services);const i=(r=n.options.meter)!=null&&r.proportional?at(pn(Ct.proportionalMeterChart),n.options):at(pn(Ct.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new bD(this.model,this.services)],growth:lt.STRETCH,renderType:it.SVG},{id:"spacer",components:[new An(this.model,this.services,{size:8})],growth:lt.STRETCH}]:[],{id:"meter-graph",components:[new MD(this.model,this.services)],growth:lt.STRETCH,renderType:it.SVG}],n=[new Oe(this.model,this.services,t,{direction:Mt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:it.HTML})}}class l3 extends Xe{constructor(t,n){super(t,n),this.model=new Jw(this.services),this.model.setOptions(Rt(Ct.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new CD(this.model,this.services)];return this.getChartComponents(t)}}class c3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new Gn(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class u3 extends Xe{constructor(t,n){super(t,n),this.model=new t$(this.services),this.model.setOptions(Rt(Ct.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new LD(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class h3 extends Xe{constructor(t,n){super(t,n),this.model=new e$(this.services),this.model.setOptions(Rt(Ct.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new aN(this.model,this.services)];return this.getChartComponents(t)}}class d3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new jg(this.model,this.services),new oi(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class p3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new co(this.model,this.services),new Wg(this.model,this.services),new ai(this.model,this.services,{stacked:!0}),new Yg(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ce(this.model,this.services,{skeleton:Ft.GRID})];return this.getAxisChartComponents(t)}}class f3 extends ge{constructor(t,n){super(t,n),this.model.setOptions(Rt(Ct.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Se(this.model,this.services),new co(this.model,this.services),new qg(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.VERT_OR_HORIZ}),new oi(this.model,this.services)];return this.getAxisChartComponents(t)}}class m3 extends Xe{constructor(t,n){super(t,n),this.model=new n$(this.services),this.model.setOptions(Rt(Ct.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new vN(this.model,this.services),new ce(this.model,this.services,{skeleton:Ft.PIE})];return this.getChartComponents(t)}}class Dt extends ft.PureComponent{constructor(){super(...arguments);Pu(this,"chart");Pu(this,"chartRef",ft.createRef())}createChart(n,r,i){throw new Error("Method not implemented.")}componentDidMount(){this.chartRef.current&&!this.chart&&(this.chart=this.createChart(this.chartRef.current,this.props.data,this.props.options))}componentDidUpdate(n){var r,i;this.props.data!==n.data&&((r=this.chart)==null||r.model.setData(this.props.data)),this.props.options!==n.options&&((i=this.chart)==null||i.model.setOptions(this.props.options))}render(){return ft.createElement("div",{ref:this.chartRef,className:"chart-holder"})}}class g3 extends Dt{createChart(t,n,r){return new WP(t,{data:n,options:r})}}class v3 extends Dt{createChart(t,n,r){return new qP(t,{data:n,options:r})}}class y3 extends Dt{createChart(t,n,r){return new YP(t,{data:n,options:r})}}class x3 extends Dt{createChart(t,n,r){return new XP(t,{data:n,options:r})}}class b3 extends Dt{createChart(t,n,r){return new ZP(t,{data:n,options:r})}}class Pv extends Dt{createChart(t,n,r){return new KP(t,{data:n,options:r})}}class _3 extends Dt{createChart(t,n,r){return new QP(t,{data:n,options:r})}}class E3 extends Dt{createChart(t,n,r){return new JP(t,{data:n,options:r})}}class O3 extends Dt{createChart(t,n,r){return new t3(t,{data:n,options:r})}}class S3 extends Dt{createChart(t,n,r){return new e3(t,{data:n,options:r})}}class T3 extends Dt{createChart(t,n,r){return new n3(t,{data:n,options:r})}}class w3 extends Dt{createChart(t,n,r){return new r3(t,{data:n,options:r})}}class $3 extends Dt{createChart(t,n,r){return new i3(t,{data:n,options:r})}}class M3 extends Dt{createChart(t,n,r){return new s3(t,{data:n,options:r})}}class C3 extends Dt{createChart(t,n,r){return new a3(t,{data:n,options:r})}}class A3 extends Dt{createChart(t,n,r){return new o3(t,{data:n,options:r})}}class L3 extends Dt{createChart(t,n,r){return new Nv(t,{data:n,options:r})}}class k3 extends Dt{createChart(t,n,r){return new l3(t,{data:n,options:r})}}class D3 extends Dt{createChart(t,n,r){return new c3(t,{data:n,options:r})}}class R3 extends Dt{createChart(t,n,r){return new d3(t,{data:n,options:r})}}class I3 extends Dt{createChart(t,n,r){return new p3(t,{data:n,options:r})}}class N3 extends Dt{createChart(t,n,r){return new f3(t,{data:n,options:r})}}class P3 extends Dt{createChart(t,n,r){return new u3(t,{data:n,options:r})}}class U3 extends Dt{createChart(t,n,r){return new h3(t,{data:n,options:r})}}class B3 extends Dt{createChart(t,n,r){return new m3(t,{data:n,options:r})}}function H3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lu={exports:{}};/*!
|
|
74
74
|
Copyright (c) 2018 Jed Watson.
|
|
75
75
|
Licensed under the MIT License (MIT), see
|
|
76
76
|
http://jedwatson.github.io/classnames
|