@carbon/charts-react 1.27.14 → 1.27.16

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.umd.js CHANGED
@@ -1,19 +1,19 @@
1
- (function(G,xt){typeof exports=="object"&&typeof module<"u"?xt(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],xt):(G=typeof globalThis<"u"?globalThis:G||self,xt(G.ChartsReact={},G.React))})(this,function(G,xt){"use strict";var So=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(So||{}),wo=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(wo||{}),$o=(e=>(e.UPDATE="model-update",e))($o||{}),ju=(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))(ju||{}),Mo=(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))(Mo||{}),Co=(e=>(e.CHANGE="zoom-domain-change",e))(Co||{}),Ao=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Ao||{}),Lo=(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))(Lo||{}),ko=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(ko||{}),Do=(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))(Do||{}),Ro=(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))(Ro||{}),Io=(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))(Io||{}),No=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(No||{}),Po=(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))(Po||{}),Bo=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Bo||{}),Uo=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Uo||{}),Ho=(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))(Ho||{}),Vo=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Vo||{}),Go=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Go||{}),Sr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Sr||{}),Fo=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Fo||{}),Wu=(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))(Wu||{}),qu=(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))(qu||{}),Yu=(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))(Yu||{}),Xu=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Xu||{}),Zu=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Zu||{}),wr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(wr||{});const d1=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Yu,Area:ko,Axis:Lo,Bar:No,Boxplot:Po,CanvasZoom:Ao,Chart:So,Choropleth:wr,CirclePack:qu,Gauge:Io,Heatmap:Zu,Legend:Wu,Line:Uo,Meter:Xu,Modal:wo,Model:$o,Pie:Ro,Radar:Ho,Scatter:Bo,Threshold:Fo,Toolbar:ju,Tooltip:Sr,Tree:Vo,Treemap:Go,WordCloud:Do,ZoomBar:Mo,ZoomDomain:Co},Symbol.toStringTag,{value:"Module"})),S=d1;var rt=(e=>(e.HTML="html",e.SVG="svg",e))(rt||{}),zo=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(zo||{}),st=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(st||{}),V=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(V||{}),Ve=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ve||{}),Ae=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Ae||{}),zt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(zt||{}),nt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(nt||{}),$r=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))($r||{}),jt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(jt||{}),Mr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Mr||{}),Is=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Is||{}),Ct=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Ct||{}),ct=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ct||{}),Yn=(e=>(e.CENTER="center",e))(Yn||{}),_i=(e=>(e.LEFT="left",e.RIGHT="right",e))(_i||{}),Wt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Wt||{}),Qe=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Qe||{}),Je=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Je||{}),Xn=(e=>(e.SEMI="semi",e.FULL="full",e))(Xn||{}),Ns=(e=>(e.UP="up",e.DOWN="down",e))(Ns||{}),Ei=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Ei||{}),Ti=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Ti||{}),Ee=(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))(Ee||{}),_t=(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))(_t||{}),Ps=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ps||{}),qt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(qt||{}),Oi=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Oi||{}),Cr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Cr||{}),Si=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Si||{}),tn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(tn||{}),Ku=(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))(Ku||{});function jo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function wi(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=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 $i(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)?f1(o,d=>d.test(a)):p1(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 p1(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function f1(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function m1(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 Qu=6048e5,g1=864e5,Ju=6e4,th=36e5,eh=Symbol.for("constructDateFrom");function Le(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&eh in e?e[eh](t):e instanceof Date?new e.constructor(t):new Date(t)}function Zn(e,...t){const n=Le.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}let v1={};function Bs(){return v1}function Bt(e,t){return Le(t||e,e)}function Mi(e,t){const n=Bs(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Bt(e,t?.in),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}const y1={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"}},b1=(e,t,n)=>{let r;const i=y1[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},x1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_1=(e,t,n,r)=>x1[e],E1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},T1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},O1={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"]},S1={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"]},w1={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"}},$1={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"}},M1=(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"},C1={ordinalNumber:M1,era:wi({values:E1,defaultWidth:"wide"}),quarter:wi({values:T1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:wi({values:O1,defaultWidth:"wide"}),day:wi({values:S1,defaultWidth:"wide"}),dayPeriod:wi({values:w1,defaultWidth:"wide",formattingValues:$1,defaultFormattingWidth:"wide"})},A1=/^(\d+)(th|st|nd|rd)?/i,L1=/\d+/i,k1={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},D1={any:[/^b/i,/^(a|c)/i]},R1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},I1={any:[/1/i,/2/i,/3/i,/4/i]},N1={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},P1={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]},B1={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},U1={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]},H1={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},V1={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}},G1={ordinalNumber:m1({matchPattern:A1,parsePattern:L1,valueCallback:e=>parseInt(e,10)}),era:$i({matchPatterns:k1,defaultMatchWidth:"wide",parsePatterns:D1,defaultParseWidth:"any"}),quarter:$i({matchPatterns:R1,defaultMatchWidth:"wide",parsePatterns:I1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:$i({matchPatterns:N1,defaultMatchWidth:"wide",parsePatterns:P1,defaultParseWidth:"any"}),day:$i({matchPatterns:B1,defaultMatchWidth:"wide",parsePatterns:U1,defaultParseWidth:"any"}),dayPeriod:$i({matchPatterns:H1,defaultMatchWidth:"any",parsePatterns:V1,defaultParseWidth:"any"})},F1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},z1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},j1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},W1={date:jo({formats:F1,defaultWidth:"full"}),time:jo({formats:z1,defaultWidth:"full"}),dateTime:jo({formats:j1,defaultWidth:"full"})},nh={code:"en-US",formatDistance:b1,formatLong:W1,formatRelative:_1,localize:C1,match:G1,options:{weekStartsOn:0,firstWeekContainsDate:1}};var rh=typeof global=="object"&&global&&global.Object===Object&&global,q1=typeof self=="object"&&self&&self.Object===Object&&self,Ge=rh||q1||Function("return this")(),ke=Ge.Symbol,ih=Object.prototype,Y1=ih.hasOwnProperty,X1=ih.toString,Ci=ke?ke.toStringTag:void 0;function Z1(e){var t=Y1.call(e,Ci),n=e[Ci];try{e[Ci]=void 0;var r=!0}catch{}var i=X1.call(e);return r&&(t?e[Ci]=n:delete e[Ci]),i}var K1=Object.prototype,Q1=K1.toString;function J1(e){return Q1.call(e)}var t0="[object Null]",e0="[object Undefined]",sh=ke?ke.toStringTag:void 0;function Kn(e){return e==null?e===void 0?e0:t0:sh&&sh in Object(e)?Z1(e):J1(e)}function en(e){return e!=null&&typeof e=="object"}var n0="[object Symbol]";function Us(e){return typeof e=="symbol"||en(e)&&Kn(e)==n0}function Wo(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 Jt=Array.isArray,ah=ke?ke.prototype:void 0,oh=ah?ah.toString:void 0;function lh(e){if(typeof e=="string")return e;if(Jt(e))return Wo(e,lh)+"";if(Us(e))return oh?oh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function De(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function qo(e){return e}var r0="[object AsyncFunction]",i0="[object Function]",s0="[object GeneratorFunction]",a0="[object Proxy]";function Yo(e){if(!De(e))return!1;var t=Kn(e);return t==i0||t==s0||t==r0||t==a0}var Xo=Ge["__core-js_shared__"],ch=function(){var e=/[^.]+$/.exec(Xo&&Xo.keys&&Xo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function o0(e){return!!ch&&ch in e}var l0=Function.prototype,c0=l0.toString;function Qn(e){if(e!=null){try{return c0.call(e)}catch{}try{return e+""}catch{}}return""}var u0=/[\\^$.*+?()[\]{}|]/g,h0=/^\[object .+?Constructor\]$/,d0=Function.prototype,p0=Object.prototype,f0=d0.toString,m0=p0.hasOwnProperty,g0=RegExp("^"+f0.call(m0).replace(u0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v0(e){if(!De(e)||o0(e))return!1;var t=Yo(e)?g0:h0;return t.test(Qn(e))}function y0(e,t){return e?.[t]}function Jn(e,t){var n=y0(e,t);return v0(n)?n:void 0}var Zo=Jn(Ge,"WeakMap"),uh=Object.create,b0=function(){function e(){}return function(t){if(!De(t))return{};if(uh)return uh(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function x0(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 _0(){}function hh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var E0=800,T0=16,O0=Date.now;function S0(e){var t=0,n=0;return function(){var r=O0(),i=T0-(r-n);if(n=r,i>0){if(++t>=E0)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function w0(e){return function(){return e}}var Hs=function(){try{var e=Jn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),$0=Hs?function(e,t){return Hs(e,"toString",{configurable:!0,enumerable:!1,value:w0(t),writable:!0})}:qo,dh=S0($0);function M0(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function C0(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 A0(e){return e!==e}function L0(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function k0(e,t,n){return t===t?L0(e,t,n):C0(e,A0,n)}function D0(e,t){var n=e==null?0:e.length;return!!n&&k0(e,t,0)>-1}var R0=9007199254740991,I0=/^(?:0|[1-9]\d*)$/;function Ko(e,t){var n=typeof e;return t=t??R0,!!t&&(n=="number"||n!="symbol"&&I0.test(e))&&e>-1&&e%1==0&&e<t}function Ai(e,t,n){t=="__proto__"&&Hs?Hs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Li(e,t){return e===t||e!==e&&t!==t}var N0=Object.prototype,P0=N0.hasOwnProperty;function ph(e,t,n){var r=e[t];(!(P0.call(e,t)&&Li(r,n))||n===void 0&&!(t in e))&&Ai(e,t,n)}function Ar(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?Ai(n,o,l):ph(n,o,l)}return n}var fh=Math.max;function mh(e,t,n){return t=fh(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=fh(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),x0(e,this,o)}}function Qo(e,t){return dh(mh(e,t,qo),e+"")}var B0=9007199254740991;function Jo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=B0}function tr(e){return e!=null&&Jo(e.length)&&!Yo(e)}function U0(e,t,n){if(!De(n))return!1;var r=typeof t;return(r=="number"?tr(n)&&Ko(t,n.length):r=="string"&&t in n)?Li(n[t],e):!1}function H0(e){return Qo(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&&U0(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 V0=Object.prototype;function Vs(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||V0;return e===n}function G0(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var F0="[object Arguments]";function gh(e){return en(e)&&Kn(e)==F0}var vh=Object.prototype,z0=vh.hasOwnProperty,j0=vh.propertyIsEnumerable,Lr=gh(function(){return arguments}())?gh:function(e){return en(e)&&z0.call(e,"callee")&&!j0.call(e,"callee")};function W0(){return!1}var yh=typeof G=="object"&&G&&!G.nodeType&&G,bh=yh&&typeof module=="object"&&module&&!module.nodeType&&module,q0=bh&&bh.exports===yh,xh=q0?Ge.Buffer:void 0,Y0=xh?xh.isBuffer:void 0,kr=Y0||W0,X0="[object Arguments]",Z0="[object Array]",K0="[object Boolean]",Q0="[object Date]",J0="[object Error]",ty="[object Function]",ey="[object Map]",ny="[object Number]",ry="[object Object]",iy="[object RegExp]",sy="[object Set]",ay="[object String]",oy="[object WeakMap]",ly="[object ArrayBuffer]",cy="[object DataView]",uy="[object Float32Array]",hy="[object Float64Array]",dy="[object Int8Array]",py="[object Int16Array]",fy="[object Int32Array]",my="[object Uint8Array]",gy="[object Uint8ClampedArray]",vy="[object Uint16Array]",yy="[object Uint32Array]",Dt={};Dt[uy]=Dt[hy]=Dt[dy]=Dt[py]=Dt[fy]=Dt[my]=Dt[gy]=Dt[vy]=Dt[yy]=!0,Dt[X0]=Dt[Z0]=Dt[ly]=Dt[K0]=Dt[cy]=Dt[Q0]=Dt[J0]=Dt[ty]=Dt[ey]=Dt[ny]=Dt[ry]=Dt[iy]=Dt[sy]=Dt[ay]=Dt[oy]=!1;function by(e){return en(e)&&Jo(e.length)&&!!Dt[Kn(e)]}function tl(e){return function(t){return e(t)}}var _h=typeof G=="object"&&G&&!G.nodeType&&G,ki=_h&&typeof module=="object"&&module&&!module.nodeType&&module,xy=ki&&ki.exports===_h,el=xy&&rh.process,Dr=function(){try{var e=ki&&ki.require&&ki.require("util").types;return e||el&&el.binding&&el.binding("util")}catch{}}(),Eh=Dr&&Dr.isTypedArray,Gs=Eh?tl(Eh):by,_y=Object.prototype,Ey=_y.hasOwnProperty;function Th(e,t){var n=Jt(e),r=!n&&Lr(e),i=!n&&!r&&kr(e),s=!n&&!r&&!i&&Gs(e),a=n||r||i||s,o=a?G0(e.length,String):[],l=o.length;for(var c in e)(t||Ey.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ko(c,l)))&&o.push(c);return o}function Oh(e,t){return function(n){return e(t(n))}}var Ty=Oh(Object.keys,Object),Oy=Object.prototype,Sy=Oy.hasOwnProperty;function Sh(e){if(!Vs(e))return Ty(e);var t=[];for(var n in Object(e))Sy.call(e,n)&&n!="constructor"&&t.push(n);return t}function Di(e){return tr(e)?Th(e):Sh(e)}function wy(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var $y=Object.prototype,My=$y.hasOwnProperty;function Cy(e){if(!De(e))return wy(e);var t=Vs(e),n=[];for(var r in e)r=="constructor"&&(t||!My.call(e,r))||n.push(r);return n}function Ri(e){return tr(e)?Th(e,!0):Cy(e)}var Ay=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ly=/^\w*$/;function nl(e,t){if(Jt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Us(e)?!0:Ly.test(e)||!Ay.test(e)||t!=null&&e in Object(t)}var Ii=Jn(Object,"create");function ky(){this.__data__=Ii?Ii(null):{},this.size=0}function Dy(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ry="__lodash_hash_undefined__",Iy=Object.prototype,Ny=Iy.hasOwnProperty;function Py(e){var t=this.__data__;if(Ii){var n=t[e];return n===Ry?void 0:n}return Ny.call(t,e)?t[e]:void 0}var By=Object.prototype,Uy=By.hasOwnProperty;function Hy(e){var t=this.__data__;return Ii?t[e]!==void 0:Uy.call(t,e)}var Vy="__lodash_hash_undefined__";function Gy(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ii&&t===void 0?Vy:t,this}function er(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])}}er.prototype.clear=ky,er.prototype.delete=Dy,er.prototype.get=Py,er.prototype.has=Hy,er.prototype.set=Gy;function Fy(){this.__data__=[],this.size=0}function Fs(e,t){for(var n=e.length;n--;)if(Li(e[n][0],t))return n;return-1}var zy=Array.prototype,jy=zy.splice;function Wy(e){var t=this.__data__,n=Fs(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():jy.call(t,n,1),--this.size,!0}function qy(e){var t=this.__data__,n=Fs(t,e);return n<0?void 0:t[n][1]}function Yy(e){return Fs(this.__data__,e)>-1}function Xy(e,t){var n=this.__data__,r=Fs(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function fn(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])}}fn.prototype.clear=Fy,fn.prototype.delete=Wy,fn.prototype.get=qy,fn.prototype.has=Yy,fn.prototype.set=Xy;var Ni=Jn(Ge,"Map");function Zy(){this.size=0,this.__data__={hash:new er,map:new(Ni||fn),string:new er}}function Ky(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function zs(e,t){var n=e.__data__;return Ky(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Qy(e){var t=zs(this,e).delete(e);return this.size-=t?1:0,t}function Jy(e){return zs(this,e).get(e)}function tb(e){return zs(this,e).has(e)}function eb(e,t){var n=zs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function mn(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])}}mn.prototype.clear=Zy,mn.prototype.delete=Qy,mn.prototype.get=Jy,mn.prototype.has=tb,mn.prototype.set=eb;var nb="Expected a function";function rl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(nb);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(rl.Cache||mn),n}rl.Cache=mn;var rb=500;function ib(e){var t=rl(e,function(r){return n.size===rb&&n.clear(),r}),n=t.cache;return t}var sb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ab=/\\(\\)?/g,ob=ib(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(sb,function(n,r,i,s){t.push(i?s.replace(ab,"$1"):r||n)}),t});function Pi(e){return e==null?"":lh(e)}function js(e,t){return Jt(e)?e:nl(e,t)?[e]:ob(Pi(e))}function Rr(e){if(typeof e=="string"||Us(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function il(e,t){t=js(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Rr(t[n++])];return n&&n==r?e:void 0}function vt(e,t,n){var r=e==null?void 0:il(e,t);return r===void 0?n:r}function sl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var wh=ke?ke.isConcatSpreadable:void 0;function lb(e){return Jt(e)||Lr(e)||!!(wh&&e&&e[wh])}function Ws(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=lb),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Ws(o,t-1,n,r,i):sl(i,o):r||(i[i.length]=o)}return i}var al=Oh(Object.getPrototypeOf,Object),cb="[object Object]",ub=Function.prototype,hb=Object.prototype,$h=ub.toString,db=hb.hasOwnProperty,pb=$h.call(Object);function Mh(e){if(!en(e)||Kn(e)!=cb)return!1;var t=al(e);if(t===null)return!0;var n=db.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&$h.call(n)==pb}function fb(){this.__data__=new fn,this.size=0}function mb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function gb(e){return this.__data__.get(e)}function vb(e){return this.__data__.has(e)}var yb=200;function bb(e,t){var n=this.__data__;if(n instanceof fn){var r=n.__data__;if(!Ni||r.length<yb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new mn(r)}return n.set(e,t),this.size=n.size,this}function Fe(e){var t=this.__data__=new fn(e);this.size=t.size}Fe.prototype.clear=fb,Fe.prototype.delete=mb,Fe.prototype.get=gb,Fe.prototype.has=vb,Fe.prototype.set=bb;function xb(e,t){return e&&Ar(t,Di(t),e)}function _b(e,t){return e&&Ar(t,Ri(t),e)}var Ch=typeof G=="object"&&G&&!G.nodeType&&G,Ah=Ch&&typeof module=="object"&&module&&!module.nodeType&&module,Eb=Ah&&Ah.exports===Ch,Lh=Eb?Ge.Buffer:void 0,kh=Lh?Lh.allocUnsafe:void 0;function Dh(e,t){if(t)return e.slice();var n=e.length,r=kh?kh(n):new e.constructor(n);return e.copy(r),r}function Tb(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 Rh(){return[]}var Ob=Object.prototype,Sb=Ob.propertyIsEnumerable,Ih=Object.getOwnPropertySymbols,ol=Ih?function(e){return e==null?[]:(e=Object(e),Tb(Ih(e),function(t){return Sb.call(e,t)}))}:Rh;function wb(e,t){return Ar(e,ol(e),t)}var $b=Object.getOwnPropertySymbols,Nh=$b?function(e){for(var t=[];e;)sl(t,ol(e)),e=al(e);return t}:Rh;function Mb(e,t){return Ar(e,Nh(e),t)}function Ph(e,t,n){var r=t(e);return Jt(e)?r:sl(r,n(e))}function ll(e){return Ph(e,Di,ol)}function Bh(e){return Ph(e,Ri,Nh)}var cl=Jn(Ge,"DataView"),ul=Jn(Ge,"Promise"),Ir=Jn(Ge,"Set"),Uh="[object Map]",Cb="[object Object]",Hh="[object Promise]",Vh="[object Set]",Gh="[object WeakMap]",Fh="[object DataView]",Ab=Qn(cl),Lb=Qn(Ni),kb=Qn(ul),Db=Qn(Ir),Rb=Qn(Zo),Re=Kn;(cl&&Re(new cl(new ArrayBuffer(1)))!=Fh||Ni&&Re(new Ni)!=Uh||ul&&Re(ul.resolve())!=Hh||Ir&&Re(new Ir)!=Vh||Zo&&Re(new Zo)!=Gh)&&(Re=function(e){var t=Kn(e),n=t==Cb?e.constructor:void 0,r=n?Qn(n):"";if(r)switch(r){case Ab:return Fh;case Lb:return Uh;case kb:return Hh;case Db:return Vh;case Rb:return Gh}return t});var Ib=Object.prototype,Nb=Ib.hasOwnProperty;function Pb(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Nb.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var qs=Ge.Uint8Array;function hl(e){var t=new e.constructor(e.byteLength);return new qs(t).set(new qs(e)),t}function Bb(e,t){var n=t?hl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Ub=/\w*$/;function Hb(e){var t=new e.constructor(e.source,Ub.exec(e));return t.lastIndex=e.lastIndex,t}var zh=ke?ke.prototype:void 0,jh=zh?zh.valueOf:void 0;function Vb(e){return jh?Object(jh.call(e)):{}}function Wh(e,t){var n=t?hl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Gb="[object Boolean]",Fb="[object Date]",zb="[object Map]",jb="[object Number]",Wb="[object RegExp]",qb="[object Set]",Yb="[object String]",Xb="[object Symbol]",Zb="[object ArrayBuffer]",Kb="[object DataView]",Qb="[object Float32Array]",Jb="[object Float64Array]",tx="[object Int8Array]",ex="[object Int16Array]",nx="[object Int32Array]",rx="[object Uint8Array]",ix="[object Uint8ClampedArray]",sx="[object Uint16Array]",ax="[object Uint32Array]";function ox(e,t,n){var r=e.constructor;switch(t){case Zb:return hl(e);case Gb:case Fb:return new r(+e);case Kb:return Bb(e,n);case Qb:case Jb:case tx:case ex:case nx:case rx:case ix:case sx:case ax:return Wh(e,n);case zb:return new r;case jb:case Yb:return new r(e);case Wb:return Hb(e);case qb:return new r;case Xb:return Vb(e)}}function qh(e){return typeof e.constructor=="function"&&!Vs(e)?b0(al(e)):{}}var lx="[object Map]";function cx(e){return en(e)&&Re(e)==lx}var Yh=Dr&&Dr.isMap,ux=Yh?tl(Yh):cx,hx="[object Set]";function dx(e){return en(e)&&Re(e)==hx}var Xh=Dr&&Dr.isSet,px=Xh?tl(Xh):dx,fx=1,mx=2,gx=4,Zh="[object Arguments]",vx="[object Array]",yx="[object Boolean]",bx="[object Date]",xx="[object Error]",Kh="[object Function]",_x="[object GeneratorFunction]",Ex="[object Map]",Tx="[object Number]",Qh="[object Object]",Ox="[object RegExp]",Sx="[object Set]",wx="[object String]",$x="[object Symbol]",Mx="[object WeakMap]",Cx="[object ArrayBuffer]",Ax="[object DataView]",Lx="[object Float32Array]",kx="[object Float64Array]",Dx="[object Int8Array]",Rx="[object Int16Array]",Ix="[object Int32Array]",Nx="[object Uint8Array]",Px="[object Uint8ClampedArray]",Bx="[object Uint16Array]",Ux="[object Uint32Array]",Lt={};Lt[Zh]=Lt[vx]=Lt[Cx]=Lt[Ax]=Lt[yx]=Lt[bx]=Lt[Lx]=Lt[kx]=Lt[Dx]=Lt[Rx]=Lt[Ix]=Lt[Ex]=Lt[Tx]=Lt[Qh]=Lt[Ox]=Lt[Sx]=Lt[wx]=Lt[$x]=Lt[Nx]=Lt[Px]=Lt[Bx]=Lt[Ux]=!0,Lt[xx]=Lt[Kh]=Lt[Mx]=!1;function Bi(e,t,n,r,i,s){var a,o=t&fx,l=t&mx,c=t&gx;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!De(e))return e;var u=Jt(e);if(u){if(a=Pb(e),!o)return hh(e,a)}else{var d=Re(e),h=d==Kh||d==_x;if(kr(e))return Dh(e,o);if(d==Qh||d==Zh||h&&!i){if(a=l||h?{}:qh(e),!o)return l?Mb(e,_b(a,e)):wb(e,xb(a,e))}else{if(!Lt[d])return i?e:{};a=ox(e,d,o)}}s||(s=new Fe);var p=s.get(e);if(p)return p;s.set(e,a),px(e)?e.forEach(function(m){a.add(Bi(m,t,n,m,e,s))}):ux(e)&&e.forEach(function(m,v){a.set(v,Bi(m,t,n,v,e,s))});var f=c?l?Bh:ll:l?Ri:Di,g=u?void 0:f(e);return M0(g||e,function(m,v){g&&(v=m,m=e[v]),ph(a,v,Bi(m,t,n,v,e,s))}),a}var Hx=1,Vx=4;function gn(e){return Bi(e,Hx|Vx)}var Gx="__lodash_hash_undefined__";function Fx(e){return this.__data__.set(e,Gx),this}function zx(e){return this.__data__.has(e)}function Ui(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new mn;++t<n;)this.add(e[t])}Ui.prototype.add=Ui.prototype.push=Fx,Ui.prototype.has=zx;function Jh(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 td(e,t){return e.has(t)}var jx=1,Wx=2;function ed(e,t,n,r,i,s){var a=n&jx,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&Wx?new Ui: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(!Jh(t,function(v,x){if(!td(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 qx(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function dl(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Yx=1,Xx=2,Zx="[object Boolean]",Kx="[object Date]",Qx="[object Error]",Jx="[object Map]",t_="[object Number]",e_="[object RegExp]",n_="[object Set]",r_="[object String]",i_="[object Symbol]",s_="[object ArrayBuffer]",a_="[object DataView]",nd=ke?ke.prototype:void 0,pl=nd?nd.valueOf:void 0;function o_(e,t,n,r,i,s,a){switch(n){case a_:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case s_:return!(e.byteLength!=t.byteLength||!s(new qs(e),new qs(t)));case Zx:case Kx:case t_:return Li(+e,+t);case Qx:return e.name==t.name&&e.message==t.message;case e_:case r_:return e==t+"";case Jx:var o=qx;case n_:var l=r&Yx;if(o||(o=dl),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=Xx,a.set(e,t);var u=ed(o(e),o(t),r,i,s,a);return a.delete(e),u;case i_:if(pl)return pl.call(e)==pl.call(t)}return!1}var l_=1,c_=Object.prototype,u_=c_.hasOwnProperty;function h_(e,t,n,r,i,s){var a=n&l_,o=ll(e),l=o.length,c=ll(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:u_.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 d_=1,rd="[object Arguments]",id="[object Array]",Ys="[object Object]",p_=Object.prototype,sd=p_.hasOwnProperty;function f_(e,t,n,r,i,s){var a=Jt(e),o=Jt(t),l=a?id:Re(e),c=o?id:Re(t);l=l==rd?Ys:l,c=c==rd?Ys:c;var u=l==Ys,d=c==Ys,h=l==c;if(h&&kr(e)){if(!kr(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Fe),a||Gs(e)?ed(e,t,n,r,i,s):o_(e,t,l,n,r,i,s);if(!(n&d_)){var p=u&&sd.call(e,"__wrapped__"),f=d&&sd.call(t,"__wrapped__");if(p||f){var g=p?e.value():e,m=f?t.value():t;return s||(s=new Fe),i(g,m,n,r,s)}}return h?(s||(s=new Fe),h_(e,t,n,r,i,s)):!1}function Xs(e,t,n,r,i){return e===t?!0:e==null||t==null||!en(e)&&!en(t)?e!==e&&t!==t:f_(e,t,n,r,Xs,i)}var m_=1,g_=2;function v_(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 Fe,d;if(!(d===void 0?Xs(c,l,m_|g_,r,u):d))return!1}}return!0}function ad(e){return e===e&&!De(e)}function y_(e){for(var t=Di(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ad(i)]}return t}function od(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function b_(e){var t=y_(e);return t.length==1&&t[0][2]?od(t[0][0],t[0][1]):function(n){return n===e||v_(n,e,t)}}function x_(e,t){return e!=null&&t in Object(e)}function __(e,t,n){t=js(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=Rr(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&&Jo(i)&&Ko(a,i)&&(Jt(e)||Lr(e)))}function E_(e,t){return e!=null&&__(e,t,x_)}var T_=1,O_=2;function S_(e,t){return nl(e)&&ad(t)?od(Rr(e),t):function(n){var r=vt(n,e);return r===void 0&&r===t?E_(n,e):Xs(t,r,T_|O_)}}function w_(e){return function(t){return t?.[e]}}function $_(e){return function(t){return il(t,e)}}function M_(e){return nl(e)?w_(Rr(e)):$_(e)}function Zs(e){return typeof e=="function"?e:e==null?qo:typeof e=="object"?Jt(e)?S_(e[0],e[1]):b_(e):M_(e)}function C_(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 ld=C_();function fl(e,t,n){(n!==void 0&&!Li(e[t],n)||n===void 0&&!(t in e))&&Ai(e,t,n)}function ml(e){return en(e)&&tr(e)}function gl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function A_(e){return Ar(e,Ri(e))}function L_(e,t,n,r,i,s,a){var o=gl(e,n),l=gl(t,n),c=a.get(l);if(c){fl(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=Jt(l),p=!h&&kr(l),f=!h&&!p&&Gs(l);u=l,h||p||f?Jt(o)?u=o:ml(o)?u=hh(o):p?(d=!1,u=Dh(l,!0)):f?(d=!1,u=Wh(l,!0)):u=[]:Mh(l)||Lr(l)?(u=o,Lr(o)?u=A_(o):(!De(o)||Yo(o))&&(u=qh(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),fl(e,n,u)}function cd(e,t,n,r,i){e!==t&&ld(t,function(s,a){if(i||(i=new Fe),De(s))L_(e,t,a,n,cd,r,i);else{var o=r?r(gl(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),fl(e,a,o)}},Ri)}function ud(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var k_="[object Map]",D_="[object Set]",R_=Object.prototype,I_=R_.hasOwnProperty;function ze(e){if(e==null)return!0;if(tr(e)&&(Jt(e)||typeof e=="string"||typeof e.splice=="function"||kr(e)||Gs(e)||Lr(e)))return!e.length;var t=Re(e);if(t==k_||t==D_)return!e.size;if(Vs(e))return!Sh(e).length;for(var n in e)if(I_.call(e,n))return!1;return!0}var ot=H0(function(e,t,n){cd(e,t,n)}),N_=1/0,P_=Ir&&1/dl(new Ir([,-0]))[1]==N_?function(e){return new Ir(e)}:_0,B_=200;function hd(e,t,n){var r=-1,i=D0,s=e.length,a=!0,o=[],l=o;if(s>=B_){var c=t?null:P_(e);if(c)return dl(c);a=!1,i=td,l=new Ui}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 U_=Qo(function(e){var t=ud(e);return ml(t)&&(t=void 0),hd(Ws(e,1,ml,!0),Zs(t))});function Hi(e){return e&&e.length?hd(e):[]}function nr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function H_(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function vl(e){let t,n,r;e.length!==2?(t=nr,n=(o,l)=>nr(e(o),l),r=(o,l)=>e(o)-l):(t=e===nr||e===H_?e:V_,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 V_(){return 0}function G_(e){return e===null?NaN:+e}function*F_(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const z_=vl(nr),yl=z_.right;vl(G_).center;function je(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 dd=class extends Map{constructor(t,n=q_){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(pd(this,t))}has(t){return super.has(pd(this,t))}set(t,n){return super.set(j_(this,t),n)}delete(t){return super.delete(W_(this,t))}};function pd({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function j_({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function W_({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function q_(e){return e!==null&&typeof e=="object"?e.valueOf():e}const Y_=Math.sqrt(50),X_=Math.sqrt(10),Z_=Math.sqrt(2);function Ks(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>=Y_?10:s>=X_?5:s>=Z_?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?Ks(e,t,n*2):[o,l,c]}function Qs(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?Ks(t,e,n):Ks(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 Nr(e,t,n){return t=+t,e=+e,n=+n,Ks(e,t,n)[2]}function bl(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Nr(t,e,n):Nr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function rr(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 Pn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}var K_={value:()=>{}};function xl(){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 Js(n)}function Js(e){this._=e}function Q_(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}})}Js.prototype=xl.prototype={constructor:Js,on:function(e,t){var n=this._,r=Q_(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=J_(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]=fd(n[i],e.name,t);else if(t==null)for(i in n)n[i]=fd(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 Js(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 J_(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function fd(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=K_,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var _l="http://www.w3.org/1999/xhtml";const md={svg:"http://www.w3.org/2000/svg",xhtml:_l,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ta(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),md.hasOwnProperty(t)?{space:md[t],local:e}:e}function tE(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===_l&&t.documentElement.namespaceURI===_l?t.createElement(e):t.createElementNS(n,e)}}function eE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gd(e){var t=ta(e);return(t.local?eE:tE)(t)}function nE(){}function El(e){return e==null?nE:function(){return this.querySelector(e)}}function rE(e){typeof e!="function"&&(e=El(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 Te(r,this._parents)}function iE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function sE(){return[]}function vd(e){return e==null?sE:function(){return this.querySelectorAll(e)}}function aE(e){return function(){return iE(e.apply(this,arguments))}}function oE(e){typeof e=="function"?e=aE(e):e=vd(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 Te(r,i)}function yd(e){return function(){return this.matches(e)}}function bd(e){return function(t){return t.matches(e)}}var lE=Array.prototype.find;function cE(e){return function(){return lE.call(this.children,e)}}function uE(){return this.firstElementChild}function hE(e){return this.select(e==null?uE:cE(typeof e=="function"?e:bd(e)))}var dE=Array.prototype.filter;function pE(){return Array.from(this.children)}function fE(e){return function(){return dE.call(this.children,e)}}function mE(e){return this.selectAll(e==null?pE:fE(typeof e=="function"?e:bd(e)))}function gE(e){typeof e!="function"&&(e=yd(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 Te(r,this._parents)}function xd(e){return new Array(e.length)}function vE(){return new Te(this._enter||this._groups.map(xd),this._parents)}function ea(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ea.prototype={constructor:ea,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 yE(e){return function(){return e}}function bE(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 ea(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function xE(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 ea(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function _E(e){return e.__data__}function EE(e,t){if(!arguments.length)return Array.from(this,_E);var n=t?xE:bE,r=this._parents,i=this._groups;typeof e!="function"&&(e=yE(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=TE(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 Te(a,r),a._enter=o,a._exit=l,a}function TE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function OE(){return new Te(this._exit||this._groups.map(xd),this._parents)}function SE(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 wE(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 Te(o,this._parents)}function $E(){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 ME(e){e||(e=CE);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 Te(i,this._parents).order()}function CE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function AE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function LE(){return Array.from(this)}function kE(){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 DE(){let e=0;for(const t of this)++e;return e}function RE(){return!this.node()}function IE(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 NE(e){return function(){this.removeAttribute(e)}}function PE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function BE(e,t){return function(){this.setAttribute(e,t)}}function UE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function HE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function VE(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 GE(e,t){var n=ta(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?PE:NE:typeof t=="function"?n.local?VE:HE:n.local?UE:BE)(n,t))}function _d(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function FE(e){return function(){this.style.removeProperty(e)}}function zE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function jE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function WE(e,t,n){return arguments.length>1?this.each((t==null?FE:typeof t=="function"?jE:zE)(e,t,n??"")):Pr(this.node(),e)}function Pr(e,t){return e.style.getPropertyValue(t)||_d(e).getComputedStyle(e,null).getPropertyValue(t)}function qE(e){return function(){delete this[e]}}function YE(e,t){return function(){this[e]=t}}function XE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ZE(e,t){return arguments.length>1?this.each((t==null?qE:typeof t=="function"?XE:YE)(e,t)):this.node()[e]}function Ed(e){return e.trim().split(/^|\s+/)}function Tl(e){return e.classList||new Td(e)}function Td(e){this._node=e,this._names=Ed(e.getAttribute("class")||"")}Td.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 Od(e,t){for(var n=Tl(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Sd(e,t){for(var n=Tl(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function KE(e){return function(){Od(this,e)}}function QE(e){return function(){Sd(this,e)}}function JE(e,t){return function(){(t.apply(this,arguments)?Od:Sd)(this,e)}}function tT(e,t){var n=Ed(e+"");if(arguments.length<2){for(var r=Tl(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?JE:t?KE:QE)(n,t))}function eT(){this.textContent=""}function nT(e){return function(){this.textContent=e}}function rT(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function iT(e){return arguments.length?this.each(e==null?eT:(typeof e=="function"?rT:nT)(e)):this.node().textContent}function sT(){this.innerHTML=""}function aT(e){return function(){this.innerHTML=e}}function oT(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function lT(e){return arguments.length?this.each(e==null?sT:(typeof e=="function"?oT:aT)(e)):this.node().innerHTML}function cT(){this.nextSibling&&this.parentNode.appendChild(this)}function uT(){return this.each(cT)}function hT(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function dT(){return this.each(hT)}function pT(e){var t=typeof e=="function"?e:gd(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function fT(){return null}function mT(e,t){var n=typeof e=="function"?e:gd(e),r=t==null?fT:typeof t=="function"?t:El(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function gT(){var e=this.parentNode;e&&e.removeChild(this)}function vT(){return this.each(gT)}function yT(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bT(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xT(e){return this.select(e?bT:yT)}function _T(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ET(e){return function(t){e.call(this,t,this.__data__)}}function TT(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 OT(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 ST(e,t,n){return function(){var r=this.__on,i,s=ET(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 wT(e,t,n){var r=TT(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?ST:OT,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function wd(e,t,n){var r=_d(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 $T(e,t){return function(){return wd(this,e,t)}}function MT(e,t){return function(){return wd(this,e,t.apply(this,arguments))}}function CT(e,t){return this.each((typeof t=="function"?MT:$T)(e,t))}function*AT(){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 Te(e,t){this._groups=e,this._parents=t}function Vi(){return new Te([[document.documentElement]],$d)}function LT(){return this}Te.prototype=Vi.prototype={constructor:Te,select:rE,selectAll:oE,selectChild:hE,selectChildren:mE,filter:gE,data:EE,enter:vE,exit:OE,join:SE,merge:wE,selection:LT,order:$E,sort:ME,call:AE,nodes:LE,node:kE,size:DE,empty:RE,each:IE,attr:GE,style:WE,property:ZE,classed:tT,text:iT,html:lT,raise:uT,lower:dT,append:pT,insert:mT,remove:vT,clone:xT,datum:_T,on:wT,dispatch:CT,[Symbol.iterator]:AT};function kT(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ir(e,t){if(e=kT(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 Ol(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Md(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Gi(){}var Fi=.7,na=1/Fi,Br="\\s*([+-]?\\d+)\\s*",zi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",DT=/^#([0-9a-f]{3,8})$/,RT=new RegExp(`^rgb\\(${Br},${Br},${Br}\\)$`),IT=new RegExp(`^rgb\\(${nn},${nn},${nn}\\)$`),NT=new RegExp(`^rgba\\(${Br},${Br},${Br},${zi}\\)$`),PT=new RegExp(`^rgba\\(${nn},${nn},${nn},${zi}\\)$`),BT=new RegExp(`^hsl\\(${zi},${nn},${nn}\\)$`),UT=new RegExp(`^hsla\\(${zi},${nn},${nn},${zi}\\)$`),Cd={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};Ol(Gi,vn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ad,formatHex:Ad,formatHex8:HT,formatHsl:VT,formatRgb:Ld,toString:Ld});function Ad(){return this.rgb().formatHex()}function HT(){return this.rgb().formatHex8()}function VT(){return Nd(this).formatHsl()}function Ld(){return this.rgb().formatRgb()}function vn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=DT.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?kd(t):n===3?new me(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ra(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ra(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=RT.exec(e))?new me(t[1],t[2],t[3],1):(t=IT.exec(e))?new me(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=NT.exec(e))?ra(t[1],t[2],t[3],t[4]):(t=PT.exec(e))?ra(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=BT.exec(e))?Id(t[1],t[2]/100,t[3]/100,1):(t=UT.exec(e))?Id(t[1],t[2]/100,t[3]/100,t[4]):Cd.hasOwnProperty(e)?kd(Cd[e]):e==="transparent"?new me(NaN,NaN,NaN,0):null}function kd(e){return new me(e>>16&255,e>>8&255,e&255,1)}function ra(e,t,n,r){return r<=0&&(e=t=n=NaN),new me(e,t,n,r)}function GT(e){return e instanceof Gi||(e=vn(e)),e?(e=e.rgb(),new me(e.r,e.g,e.b,e.opacity)):new me}function Sl(e,t,n,r){return arguments.length===1?GT(e):new me(e,t,n,r??1)}function me(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ol(me,Sl,Md(Gi,{brighter(e){return e=e==null?na:Math.pow(na,e),new me(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Fi:Math.pow(Fi,e),new me(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new me(sr(this.r),sr(this.g),sr(this.b),ia(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:Dd,formatHex:Dd,formatHex8:FT,formatRgb:Rd,toString:Rd}));function Dd(){return`#${ar(this.r)}${ar(this.g)}${ar(this.b)}`}function FT(){return`#${ar(this.r)}${ar(this.g)}${ar(this.b)}${ar((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rd(){const e=ia(this.opacity);return`${e===1?"rgb(":"rgba("}${sr(this.r)}, ${sr(this.g)}, ${sr(this.b)}${e===1?")":`, ${e})`}`}function ia(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function sr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ar(e){return e=sr(e),(e<16?"0":"")+e.toString(16)}function Id(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new We(e,t,n,r)}function Nd(e){if(e instanceof We)return new We(e.h,e.s,e.l,e.opacity);if(e instanceof Gi||(e=vn(e)),!e)return new We;if(e instanceof We)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 We(a,o,l,e.opacity)}function Pd(e,t,n,r){return arguments.length===1?Nd(e):new We(e,t,n,r??1)}function We(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ol(We,Pd,Md(Gi,{brighter(e){return e=e==null?na:Math.pow(na,e),new We(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Fi:Math.pow(Fi,e),new We(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 me(wl(e>=240?e-240:e+120,i,r),wl(e,i,r),wl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new We(Bd(this.h),sa(this.s),sa(this.l),ia(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=ia(this.opacity);return`${e===1?"hsl(":"hsla("}${Bd(this.h)}, ${sa(this.s)*100}%, ${sa(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bd(e){return e=(e||0)%360,e<0?e+360:e}function sa(e){return Math.max(0,Math.min(1,e||0))}function wl(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 $l=e=>()=>e;function zT(e,t){return function(n){return e+n*t}}function jT(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 WT(e){return(e=+e)==1?Ud:function(t,n){return n-t?jT(t,n,e):$l(isNaN(t)?n:t)}}function Ud(e,t){var n=t-e;return n?zT(e,n):$l(isNaN(e)?t:e)}const aa=function e(t){var n=WT(t);function r(i,s){var a=n((i=Sl(i)).r,(s=Sl(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Ud(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 qT(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 YT(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function XT(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]=ji(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 ZT(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Oe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function KT(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]=ji(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Ml=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cl=new RegExp(Ml.source,"g");function QT(e){return function(){return e}}function JT(e){return function(t){return e(t)+""}}function Hd(e,t){var n=Ml.lastIndex=Cl.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Ml.exec(e))&&(i=Cl.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:Oe(r,i)})),n=Cl.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?JT(l[0].x):QT(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 ji(e,t){var n=typeof t,r;return t==null||n==="boolean"?$l(t):(n==="number"?Oe:n==="string"?(r=vn(t))?(t=r,aa):Hd:t instanceof vn?aa:t instanceof Date?ZT:YT(t)?qT:Array.isArray(t)?XT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?KT:Oe)(e,t)}function Vd(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Gd=180/Math.PI,Fd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zd(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)*Gd,skewX:Math.atan(l)*Gd,scaleX:a,scaleY:o}}var oa;function tO(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Fd:zd(t.a,t.b,t.c,t.d,t.e,t.f)}function eO(e){return e==null||(oa||(oa=document.createElementNS("http://www.w3.org/2000/svg","g")),oa.setAttribute("transform",e),!(e=oa.transform.baseVal.consolidate()))?Fd:(e=e.matrix,zd(e.a,e.b,e.c,e.d,e.e,e.f))}function jd(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:Oe(c,d)},{i:g-2,x:Oe(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:Oe(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:Oe(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:Oe(c,d)},{i:g-2,x:Oe(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 nO=jd(tO,"px, ","px)","deg)"),rO=jd(eO,", ",")",")"),Ur=0,Wi=0,qi=0,Wd=1e3,la,Yi,ca=0,or=0,ua=0,Xi=typeof performance=="object"&&performance.now?performance:Date,qd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Al(){return or||(qd(iO),or=Xi.now()+ua)}function iO(){or=0}function ha(){this._call=this._time=this._next=null}ha.prototype=Yd.prototype={constructor:ha,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Al():+n)+(t==null?0:+t),!this._next&&Yi!==this&&(Yi?Yi._next=this:la=this,Yi=this),this._call=e,this._time=n,Ll()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ll())}};function Yd(e,t,n){var r=new ha;return r.restart(e,t,n),r}function sO(){Al(),++Ur;for(var e=la,t;e;)(t=or-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ur}function Xd(){or=(ca=Xi.now())+ua,Ur=Wi=0;try{sO()}finally{Ur=0,oO(),or=0}}function aO(){var e=Xi.now(),t=e-ca;t>Wd&&(ua-=t,ca=e)}function oO(){for(var e,t=la,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:la=n);Yi=e,Ll(r)}function Ll(e){if(!Ur){Wi&&(Wi=clearTimeout(Wi));var t=e-or;t>24?(e<1/0&&(Wi=setTimeout(Xd,e-Xi.now()-ua)),qi&&(qi=clearInterval(qi))):(qi||(ca=Xi.now(),qi=setInterval(aO,Wd)),Ur=1,qd(Xd))}}function Zd(e,t,n){var r=new ha;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var lO=xl("start","end","cancel","interrupt"),cO=[],Kd=0,Qd=1,kl=2,da=3,Jd=4,Dl=5,pa=6;function fa(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;uO(e,n,{name:t,index:r,group:i,on:lO,tween:cO,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Kd})}function Rl(e,t){var n=qe(e,t);if(n.state>Kd)throw new Error("too late; already scheduled");return n}function rn(e,t){var n=qe(e,t);if(n.state>da)throw new Error("too late; already running");return n}function qe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function uO(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Yd(s,0,n.time);function s(c){n.state=Qd,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!==Qd)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===da)return Zd(a);p.state===Jd?(p.state=pa,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=pa,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(Zd(function(){n.state===da&&(n.state=Jd,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=kl,n.on.call("start",e,e.__data__,n.index,n.group),n.state===kl){for(n.state=da,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=Dl,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===Dl&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=pa,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Il(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>kl&&r.state<Dl,r.state=pa,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function hO(e){return this.each(function(){Il(this,e)})}function dO(e,t){var n,r;return function(){var i=rn(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 pO(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=rn(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 fO(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=qe(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?dO:pO)(n,e,t))}function Nl(e,t,n){var r=e._id;return e.each(function(){var i=rn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return qe(i,r).value[t]}}function tp(e,t){var n;return(typeof t=="number"?Oe:t instanceof vn?aa:(n=vn(t))?(t=n,aa):Hd)(e,t)}function mO(e){return function(){this.removeAttribute(e)}}function gO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function vO(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 yO(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 bO(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 xO(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 _O(e,t){var n=ta(e),r=n==="transform"?rO:tp;return this.attrTween(e,typeof t=="function"?(n.local?xO:bO)(n,r,Nl(this,"attr."+e,t)):t==null?(n.local?gO:mO)(n):(n.local?yO:vO)(n,r,t))}function EO(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function TO(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function OO(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&TO(e,s)),n}return i._value=t,i}function SO(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&EO(e,s)),n}return i._value=t,i}function wO(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=ta(e);return this.tween(n,(r.local?OO:SO)(r,t))}function $O(e,t){return function(){Rl(this,e).delay=+t.apply(this,arguments)}}function MO(e,t){return t=+t,function(){Rl(this,e).delay=t}}function CO(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$O:MO)(t,e)):qe(this.node(),t).delay}function AO(e,t){return function(){rn(this,e).duration=+t.apply(this,arguments)}}function LO(e,t){return t=+t,function(){rn(this,e).duration=t}}function kO(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?AO:LO)(t,e)):qe(this.node(),t).duration}function DO(e,t){if(typeof t!="function")throw new Error;return function(){rn(this,e).ease=t}}function RO(e){var t=this._id;return arguments.length?this.each(DO(t,e)):qe(this.node(),t).ease}function IO(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;rn(this,e).ease=n}}function NO(e){if(typeof e!="function")throw new Error;return this.each(IO(this._id,e))}function PO(e){typeof e!="function"&&(e=yd(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 yn(r,this._parents,this._name,this._id)}function BO(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 yn(a,this._parents,this._name,this._id)}function UO(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 HO(e,t,n){var r,i,s=UO(t)?Rl:rn;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function VO(e,t){var n=this._id;return arguments.length<2?qe(this.node(),n).on.on(e):this.each(HO(n,e,t))}function GO(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function FO(){return this.on("end.remove",GO(this._id))}function zO(e){var t=this._name,n=this._id;typeof e!="function"&&(e=El(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,fa(c[h],t,n,h,c,qe(u,n)));return new yn(s,this._parents,t,n)}function jO(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vd(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=qe(u,n),g=0,m=h.length;g<m;++g)(p=h[g])&&fa(p,t,n,g,h,f);s.push(h),a.push(u)}return new yn(s,a,t,n)}var WO=Vi.prototype.constructor;function qO(){return new WO(this._groups,this._parents)}function YO(e,t){var n,r,i;return function(){var s=Pr(this,e),a=(this.style.removeProperty(e),Pr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function ep(e){return function(){this.style.removeProperty(e)}}function XO(e,t,n){var r,i=n+"",s;return function(){var a=Pr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function ZO(e,t,n){var r,i,s;return function(){var a=Pr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Pr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function KO(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=rn(this,e),c=l.on,u=l.value[s]==null?o||(o=ep(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function QO(e,t,n){var r=(e+="")=="transform"?nO:tp;return t==null?this.styleTween(e,YO(e,r)).on("end.style."+e,ep(e)):typeof t=="function"?this.styleTween(e,ZO(e,r,Nl(this,"style."+e,t))).each(KO(this._id,e)):this.styleTween(e,XO(e,r,t),n).on("end.style."+e,null)}function JO(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function tS(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&JO(e,a,n)),r}return s._value=t,s}function eS(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,tS(e,t,n??""))}function nS(e){return function(){this.textContent=e}}function rS(e){return function(){var t=e(this);this.textContent=t??""}}function iS(e){return this.tween("text",typeof e=="function"?rS(Nl(this,"text",e)):nS(e==null?"":e+""))}function sS(e){return function(t){this.textContent=e.call(this,t)}}function aS(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&sS(i)),t}return r._value=e,r}function oS(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,aS(e))}function lS(){for(var e=this._name,t=this._id,n=np(),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=qe(l,t);fa(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new yn(r,this._parents,e,n)}function cS(){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=rn(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 uS=0;function yn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function np(){return++uS}var bn=Vi.prototype;yn.prototype={constructor:yn,select:zO,selectAll:jO,selectChild:bn.selectChild,selectChildren:bn.selectChildren,filter:PO,merge:BO,selection:qO,transition:lS,call:bn.call,nodes:bn.nodes,node:bn.node,size:bn.size,empty:bn.empty,each:bn.each,on:VO,attr:_O,attrTween:wO,style:QO,styleTween:eS,text:iS,textTween:oS,remove:FO,tween:fO,delay:CO,duration:kO,ease:RO,easeVarying:NO,end:cS,[Symbol.iterator]:bn[Symbol.iterator]};function rp(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var hS={time:null,delay:0,duration:250,ease:rp};function dS(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 pS(e){var t,n;e instanceof yn?(t=e._id,e=e._name):(t=np(),(n=hS).time=Al(),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])&&fa(l,e,t,c,a,n||dS(l,t));return new yn(r,this._parents,e,t)}Vi.prototype.interrupt=hO,Vi.prototype.transition=pS;function fS(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ma(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 Hr(e){return e=ma(Math.abs(e)),e?e[1]:NaN}function mS(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 gS(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var vS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Zi(e){if(!(t=vS.exec(e)))throw new Error("invalid format: "+e);var t;return new Pl({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]})}Zi.prototype=Pl.prototype;function Pl(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+""}Pl.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 yS(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 ip;function bS(e,t){var n=ma(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(ip=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")+ma(e,Math.max(0,t+s-1))[0]}function sp(e,t){var n=ma(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 ap={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:fS,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)=>sp(e*100,t),r:sp,s:bS,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function op(e){return e}var lp=Array.prototype.map,cp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function xS(e){var t=e.grouping===void 0||e.thousands===void 0?op:mS(lp.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?op:gS(lp.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=Zi(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"):ap[b]||(_===void 0&&(_=12),E=!0,b="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var O=g==="$"?n:g==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",M=g==="$"?r:/[%p]/.test(b)?a:"",k=ap[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(C){var H=O,P=M,U,T,$;if(b==="c")P=k(C)+P,C="";else{C=+C;var L=C<0||1/C<0;if(C=isNaN(C)?l:k(Math.abs(C),_),E&&(C=yS(C)),L&&+C==0&&f!=="+"&&(L=!1),H=(L?f==="("?f:o:f==="-"||f==="("?"":f)+H,P=(b==="s"?cp[8+ip/3]:"")+P+(L&&f==="("?")":""),A){for(U=-1,T=C.length;++U<T;)if($=C.charCodeAt(U),48>$||$>57){P=($===46?i+C.slice(U+1):C.slice(U))+P,C=C.slice(0,U);break}}}x&&!m&&(C=t(C,1/0));var D=H.length+C.length+P.length,B=D<v?new Array(v-D+1).join(h):"";switch(x&&m&&(C=t(B+C,B.length?v-P.length:1/0),B=""),p){case"<":C=H+C+P+B;break;case"=":C=H+B+C+P;break;case"^":C=B.slice(0,D=B.length>>1)+H+C+P+B.slice(D);break;default:C=B+H+C+P;break}return s(C)}return R.toString=function(){return d+""},R}function u(d,h){var p=c((d=Zi(d),d.type="f",d)),f=Math.max(-8,Math.min(8,Math.floor(Hr(h)/3)))*3,g=Math.pow(10,-f),m=cp[8+f/3];return function(v){return p(g*v)+m}}return{format:c,formatPrefix:u}}var ga,Bl,up;_S({thousands:",",grouping:[3],currency:["$",""]});function _S(e){return ga=xS(e),Bl=ga.format,up=ga.formatPrefix,ga}function ES(e){return Math.max(0,-Hr(Math.abs(e)))}function TS(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Hr(t)/3)))*3-Hr(Math.abs(e)))}function OS(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Hr(t)-Hr(e))+1}function Vr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const hp=Symbol("implicit");function va(){var e=new dd,t=[],n=[],r=hp;function i(s){let a=e.get(s);if(a===void 0){if(r!==hp)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 dd;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 va(t,n).unknown(r)},Vr.apply(i,arguments),i}function SS(e){return function(){return e}}function wS(e){return+e}var dp=[0,1];function Gr(e){return e}function Ul(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:SS(isNaN(t)?NaN:.5)}function $S(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function MS(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Ul(i,r),s=n(a,s)):(r=Ul(r,i),s=n(s,a)),function(o){return s(r(o))}}function CS(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]=Ul(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=yl(e,o,1,r)-1;return s[l](i[l](o))}}function Hl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function pp(){var e=dp,t=dp,n=ji,r,i,s,a=Gr,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Gr&&(a=$S(e[0],e[h-1])),o=h>2?CS:MS,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),Oe)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,wS),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=Vd,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Gr,u()):a!==Gr},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 fp(){return pp()(Gr,Gr)}function AS(e,t,n,r){var i=bl(e,t,n),s;switch(r=Zi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=TS(i,a))&&(r.precision=s),up(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=OS(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=ES(i))&&(r.precision=s-(r.type==="%")*2);break}}return Bl(r)}function mp(e){var t=e.domain;return e.ticks=function(n){var r=t();return Qs(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return AS(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=Nr(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 Ye(){var e=fp();return e.copy=function(){return Hl(e,Ye())},Vr.apply(e,arguments),mp(e)}function Vl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[yl(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 Vl().domain([e,t]).range(i).unknown(s)},Vr.apply(mp(a),arguments)}function Ki(e,t,n){this.k=e,this.x=t,this.y=n}Ki.prototype={constructor:Ki,scale:function(e){return e===1?this:new Ki(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ki(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+")"}},Ki.prototype;const ge="cds",xn={opacity:{unselected:.05,selected:.4}},Bn={ticks:{number:7,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Fr={duration:1e3,ease:rp,zoomLevel:3},zr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},gp={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ie={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},LS={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}},_n={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},te={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},kt={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}},lr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},Xe={nodeWidth:4,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},vp={minCellDividerDimension:16},yp={default:{size:24}},bp={defaultOffset:4,horizontalOffset:10},xp={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}},Se={height:{[Ve.GRAPH_VIEW]:32,[Ve.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},kS=[{type:qt.RADIUS,name:"Radius"},{type:qt.AREA,name:"Poor area"},{type:qt.AREA,name:"Satisfactory area"},{type:qt.AREA,name:"Great area"},{type:qt.QUARTILE,name:"Quartiles"}],jr={type:Ae.END_LINE,threshold:16,numCharacter:14},_p=4,DS={code:typeof navigator<"u"&&navigator?.language||"en-US",number:(e,t=navigator?.language||"en-US")=>e?.toLocaleString?.(t),date:(e,t=navigator?.language||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=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"}}},RS={enabled:!0,position:$r.BOTTOM,clickable:!0,truncation:jr,alignment:jt.LEFT,order:null,additionalItems:[]},IS={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},NS={enabled:!0},Ep={enabled:!0,showTotal:!0,truncation:jr,groupLabel:"Group"},Tp={top:{visible:!0,includeZero:!0,truncation:jr},bottom:{visible:!0,includeZero:!0,truncation:jr},left:{visible:!0,includeZero:!0,truncation:jr},right:{visible:!0,includeZero:!0,truncation:jr}},ya={addSpaceOnEdges:1,showDayName:!1,localeObject:nh,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 Op=!1;try{Op=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const re={width:null,height:null,resizable:!0,theme:zo.WHITE,tooltip:Ep,legend:RS,locale:DS,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:_t.SHOW_AS_DATATABLE},...Op?[{type:_t.MAKE_FULLSCREEN}]:[],{type:_t.EXPORT_CSV},{type:_t.EXPORT_PNG},{type:_t.EXPORT_JPG}]}},Sp=ot({},re,{thematic:{projection:tn.geoNaturalEarth1}}),Qi=ot({},re,{axes:Tp,timeScale:ya,grid:IS,ruler:NS,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ve.GRAPH_VIEW}}}),cr=ot({},Qi,{bars:{maxWidth:16,spacingFactor:.25,preserveSpaceForMissingBars:!0},timeScale:ot(ya,{addSpaceOnEdges:1})}),PS=ot({},cr,{}),BS=ot({},cr,{}),US=ot({},cr,{bars:ot({},cr.bars,{dividerSize:1.5})}),HS=ot({},cr,{}),Gl=ot({},Qi,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),VS=Gl,wp=ot({},Gl,{points:{radius:3,filled:!1,enabled:!0}}),$p=ot({},wp,{timeScale:ot(ya,{addSpaceOnEdges:0})}),GS=$p,FS=ot({},Qi,{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:qt.RADIUS,name:"Radius"}]}}),zS=ot({},Qi,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:qt.AREA,name:"Poor area"},{type:qt.AREA,name:"Satisfactory area"},{type:qt.AREA,name:"Great area"},{type:qt.QUARTILE,name:"Quartiles"}]}}),jS=ot({},cr,{bars:{dividerSize:1.5},timeScale:ot(ya,{addSpaceOnEdges:0})}),WS=ot({},re,{tooltip:ot({},Ep,{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"}}),Mp=ot({},re,{pie:{labels:{formatter:null,enabled:!0},alignment:jt.LEFT,sortFunction:null,valueMapsTo:"value"}}),qS=ot({},re,{legend:{enabled:!1},gauge:{type:Xn.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:jt.LEFT}}),YS=ot({},Mp,{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:jt.LEFT}}),Cp=ot({},re,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),XS=ot({},Cp,{legend:{enabled:!0}}),ZS=ot({},re,{radar:{axes:{angle:"key",value:"value"},alignment:jt.LEFT},tooltip:{gridline:{enabled:!0}}}),KS=ot({},cr,{comboChartTypes:[]}),QS=ot({tree:{type:Is.TREE}},re,{}),JS=ot({},re,{data:ot(re.data,{groupMapsTo:"name"})}),tw=ot({},re,zr,{data:ot(re.data,{groupMapsTo:"name"})}),ew=ot({},re,{alluvial:{data:ot(re.data,{groupMapsTo:"source"}),nodeAlignment:jt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),nw=ot({},re,{axes:Tp,heatmap:{divider:{state:Cr.AUTO},colorLegend:{type:"linear"}}}),rw=ot({},Sp,{choropleth:{colorLegend:{type:"linear"}}}),At={alluvialChart:ew,areaChart:$p,axisChart:Qi,boxplotChart:HS,bubbleChart:FS,bulletChart:zS,chart:re,circlePackChart:tw,choroplethChart:rw,comboChart:KS,donutChart:YS,gaugeChart:qS,groupedBarChart:BS,heatmapChart:nw,histogramChart:jS,lineChart:wp,lollipopChart:VS,meterChart:Cp,pieChart:Mp,proportionalMeterChart:XS,radarChart:ZS,scatterChart:Gl,simpleBarChart:PS,stackedAreaChart:GS,stackedBarChart:US,thematicChart:Sp,treeChart:QS,treemapChart:JS,wordCloudChart:WS};function iw(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=ir(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function It(e,t){const n=gn(e),r=Object.keys(t.axes||{});t?.toolbar?.controls&&delete n.toolbar.controls,r.length===0&&delete n.axes;for(const i in n.axes)if(r.includes(i)){const s=t.axes[i];if((s.primary||s.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),s.mapsTo==null){const o=s.scaleType;o==null?s.mapsTo="value":o===nt.TIME?s.mapsTo="date":o===nt.LABELS&&(s.mapsTo="key")}}else delete n.axes[i];return zl(n,t),ot(n,t)}function En(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 Ji(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 Fl(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 ts(e,t,n){if(n>e.length)return e;if(t===Ae.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Ae.FRONT_LINE)return"..."+e.substr(-n);if(t===Ae.END_LINE)return e.substr(0,n)+"..."}function zl(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=kS.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=U_(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},Ap=(e,t)=>t===zt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,le=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=Ap(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function Tn(e,t,n){return n===zt.VERTICAL?[e,t]:[t,e]}function Lp(e){const t=Bt(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 kp(e,t){const n=Bt(e,t?.in);return n.setHours(0,0,0,0),n}function Dp(e,t,n){const[r,i]=Zn(n?.in,e,t),s=kp(r),a=kp(i),o=+s-Lp(s),l=+a-Lp(a);return Math.round((o-l)/g1)}function sw(e,t){const n=Bt(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function aw(e,t){const n=Bt(e,t?.in);return Dp(n,sw(n))+1}function ba(e,t){return Mi(e,{...t,weekStartsOn:1})}function Rp(e,t){const n=Bt(e,t?.in),r=n.getFullYear(),i=Le(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=ba(i),a=Le(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=ba(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function ow(e,t){const n=Rp(e,t),r=Le(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ba(r)}function lw(e,t){const n=Bt(e,t?.in),r=+ba(n)-+ow(n);return Math.round(r/Qu)+1}function Ip(e,t){const n=Bt(e,t?.in),r=n.getFullYear(),i=Bs(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=Le(t?.in||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const o=Mi(a,t),l=Le(t?.in||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=Mi(l,t);return+n>=+o?r+1:+n>=+c?r:r-1}function cw(e,t){const n=Bs(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Ip(e,t),s=Le(t?.in||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),Mi(s,t)}function uw(e,t){const n=Bt(e,t?.in),r=+Mi(n,t)-+cw(n,t);return Math.round(r/Qu)+1}function Tt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Un={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Tt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Tt(n+1,2)},d(e,t){return Tt(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 Tt(e.getHours()%12||12,t.length)},H(e,t){return Tt(e.getHours(),t.length)},m(e,t){return Tt(e.getMinutes(),t.length)},s(e,t){return Tt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Tt(i,t.length)}},Wr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Np={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 Un.y(e,t)},Y:function(e,t,n,r){const i=Ip(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return Tt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Tt(s,t.length)},R:function(e,t){const n=Rp(e);return Tt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Tt(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 Tt(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 Tt(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 Un.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 Tt(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=uw(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},I:function(e,t,n){const r=lw(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Tt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Un.d(e,t)},D:function(e,t,n){const r=aw(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Tt(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 Tt(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 Tt(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 Tt(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=Wr.noon:r===0?i=Wr.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=Wr.evening:r>=12?i=Wr.afternoon:r>=4?i=Wr.morning:i=Wr.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 Un.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Un.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Tt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Tt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Un.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Un.s(e,t)},S:function(e,t){return Un.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Bp(r);case"XXXX":case"XX":return ur(r);case"XXXXX":case"XXX":default:return ur(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Bp(r);case"xxxx":case"xx":return ur(r);case"xxxxx":case"xxx":default:return ur(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Pp(r,":");case"OOOO":default:return"GMT"+ur(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Pp(r,":");case"zzzz":default:return"GMT"+ur(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Tt(r,t.length)},T:function(e,t,n){return Tt(+e,t.length)}};function Pp(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+Tt(s,2)}function Bp(e,t){return e%60===0?(e>0?"-":"+")+Tt(Math.abs(e)/60,2):ur(e,t)}function ur(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Tt(Math.trunc(r/60),2),s=Tt(r%60,2);return n+i+t+s}const Up=(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"})}},Hp=(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"})}},hw=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Up(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}}",Up(r,t)).replace("{{time}}",Hp(i,t))},dw={p:Hp,P:hw},pw=/^D+$/,fw=/^Y+$/,mw=["D","DD","YY","YYYY"];function gw(e){return pw.test(e)}function vw(e){return fw.test(e)}function yw(e,t,n){const r=bw(e,t,n);if(console.warn(r),mw.includes(e))throw new RangeError(r)}function bw(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 xw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _w(e){return!(!xw(e)&&typeof e!="number"||isNaN(+Bt(e)))}const Ew=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Tw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ow=/^'([^]*?)'?$/,Sw=/''/g,ww=/[a-zA-Z]/;function jl(e,t,n){const r=Bs(),i=n?.locale??r.locale??nh,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=Bt(e,n?.in);if(!_w(o))throw new RangeError("Invalid time value");let l=t.match(Tw).map(u=>{const d=u[0];if(d==="p"||d==="P"){const h=dw[d];return h(u,i.formatLong)}return u}).join("").match(Ew).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const d=u[0];if(d==="'")return{isToken:!1,value:$w(u)};if(Np[d])return{isToken:!0,value:u};if(d.match(ww))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const c={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return l.map(u=>{if(!u.isToken)return u.value;const d=u.value;(!n?.useAdditionalWeekYearTokens&&vw(d)||!n?.useAdditionalDayOfYearTokens&&gw(d))&&yw(d,t,String(e));const h=Np[d[0]];return h(o,d,i.localize,c)}).join("")}function $w(e){const t=e.match(Ow);return t?t[1].replace(Sw,"'"):e}const Wl=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",1800*1e3],["hourly",3600*1e3],["daily",1440*60*1e3],["monthly",720*60*60*1e3],["quarterly",2160*60*60*1e3],["yearly",360*24*60*60*1e3]];function Vp(e,t,n,r,i){const s=t===0,a=Number(jl(new Date(e),"c"))===2,o=Number(jl(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||_a(e)||es(e,l)||Hn(e);case"minute":return s||_a(e)||es(e,l)||Hn(e);case"30minutes":return s||_a(e)||es(e,l)||Hn(e);case"hourly":return s||_a(e)||es(e,l)||Hn(e);case"daily":return i?s||a||Hn(e):s||es(e,l)||Hn(e);case"weekly":return s||a||Hn(e);case"monthly":return s||Hn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function ql(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=Vp(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 _=jl(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 xa(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function Mw(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function Cw(e){const t=Wl.reduce((n,[,r],i)=>{const s=Wl[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return Wl[t][0]}function Yl(e,t){if(Ku[t])return t;if(e.length===1)return"15seconds";const n=Mw(e),r=Pn(n);return Cw(r)}function _a(e){const{s:t,m:n,H:r}=xa(e);return r===0&&n===0&&t===0}function es(e,t){const n=xa(e).M,r=xa(t).M;return n!==r}function Hn(e){const{M:t,d:n,s:r,m:i,H:s}=xa(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Gp(e){return e===void 0?"":e.toISOString()}function Fp(e){const t=je(e,r=>r.value),n=Ye().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 zp(e,t){const n=y(t,"gradient","colors"),r=!ze(n);let i=y(t,"pairing","option");const s=Fp(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 Vl().domain(s).range(o)}var dt=(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))(dt||{});function Aw(e,t){return e&&ld(e,t,Di)}function Lw(e,t){return function(n,r){if(n==null)return n;if(!tr(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 Xl=Lw(Aw);function ft(e){return function(){return e}}var kw=Array.prototype.slice;function Ea(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Dw(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 Rw(e,t,n,r){return Xl(e,function(i,s,a){t(r,i,n(i),a)}),r}function Iw(e,t){return function(n,r){var i=Jt(n)?Dw:Rw,s={};return i(n,e,Zs(r),s)}}function Nw(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];Ai(r,i[0],i[1])}return r}var Pw=Object.prototype,Bw=Pw.hasOwnProperty,Uw=Iw(function(e,t,n){Bw.call(e,n)?e[n].push(t):Ai(e,n,[t])});function Hw(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function Vw(e){return e}function Gw(e=nr){if(e===nr)return jp;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 jp(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Fw=Array.prototype,zw=Fw.slice;function Zl(e){return()=>e}function jw(e,t,n){let r;for(;;){const i=Nr(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 Ww(e){return Math.max(1,Math.ceil(Math.log(Hw(e))/Math.LN2)+1)}function qw(){var e=Vw,t=je,n=Ww;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===je&&([d,h]=jw(d,h,E)),p=Qs(d,h,E),p[0]<=d&&(l=Nr(d,h,E)),p[p.length-1]>=h)if(_>=h&&t===je){const b=Nr(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[yl(p,o,0,f)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Zl(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Zl([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Zl(Array.isArray(i)?zw.call(i):i),r):n},r}function Wp(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?jp:Gw(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));Wp(e,t,p,f,i)}const s=e[t];let a=n,o=r;for(ns(e,n,t),i(e[r],s)>0&&ns(e,n,r);a<o;){for(ns(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?ns(e,n,o):(++o,ns(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function ns(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Kl(e,t,n){if(e=Float64Array.from(F_(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Pn(e);if(t>=1)return rr(e);var r,i=(r-1)*t,s=Math.floor(i),a=rr(Wp(e,s).subarray(0,s+1)),o=Pn(e.subarray(s+1));return a+(o-a)*(i-s)}}function qp(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 Yp(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Yw(e,t){return e[t]}function Xw(e){const t=[];return t.key=e,t}function Ql(){var e=ft([]),t=Yp,n=qp,r=Yw;function i(s){var a=Array.from(e.apply(this,arguments),Xw),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=Ea(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:ft(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:ft(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Yp:typeof s=="function"?s:ft(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??qp,i):n},i}function Zw(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 Kw(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class sn{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?.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(gn(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 Uw(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=LS.defaultBins}=s,l=Array.isArray(o),c=qw().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 Ql().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=Hi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Gp(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?Gp(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=Nw(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?Ql().offset(Zw):Ql()).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();zl(n,t),this.set({options:ot(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(S.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(S.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==="&ndash;"?"–":a).split(/[,;'"`]/).map(o=>Kw(o)).join("")}"`)).map(s=>s.join(",")).join(`
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=Hi(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=gp.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=va().range(o).domain(this.allDataGroups)}}class hr extends sn{constructor(t){super(t),this.axisFlavor=Si.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?"&ndash;":h[i.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"&ndash;":l(h[s.identifier],c),...a?[h[a.identifier]===null?"&ndash;":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"&ndash;":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),y(this.getOptions(),"zoomBar",V.TOP,"enabled"))){const r=y(this.getOptions(),"zoomBar",V.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(gn(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=Hi(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(V).forEach(i=>{const s=V[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 Qw=class extends hr{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?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}},Jw=class extends hr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Kl(t,.25),q_50:Kl(t,.5),q_75:Kl(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(nr),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=Pn(m),x=rr(m);c.whiskers={min:v||Pn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:x||rr([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=["&ndash;"]),[l[n],y(l,"whiskers","min")!==null?i(y(l,"whiskers","min"),s):"&ndash;",y(l,"quartiles","q_25")!==null?i(y(l,"quartiles","q_25"),s):"&ndash;",y(l,"quartiles","q_50")!==null?i(y(l,"quartiles","q_50"),s):"&ndash;",y(l,"quartiles","q_75")!==null?i(y(l,"quartiles","q_75"),s):"&ndash;",y(l,"whiskers","max")!==null?i(y(l,"whiskers","max"),s):"&ndash;",y(l,"quartiles","q_75")!==null&&y(l,"quartiles","q_25")!==null?(i(y(l,"quartiles","q_75")-y(l,"quartiles","q_25")),s):"&ndash;",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=gp.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=va().range(i).domain(this.allDataGroups)}},t$=class extends hr{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?"&ndash;":s(u.value,a),y(u,"marker")===null?"&ndash;":s(u.marker,a),y(u,"marker")===null?"&ndash;":`${s(Math.floor(u[i]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}};class e$ extends sn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(ze(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!ze(n)&&!ze(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?"&ndash;":a.id,a.name,a.value===null?"&ndash;":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=zp(this.getDisplayData(),t)}}let n$=class extends sn{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=ot({},t,this.getZoomOptions(t));zl(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ot(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:qt.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(["&ndash;",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}},r$=class extends sn{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?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}};class i$ extends sn{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?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}let s$=class extends hr{constructor(t){super(t),this.axisFlavor=Si.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=je(this.getDisplayData(),r=>r.value),n=Ye().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(ze(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(ze(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(ze(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]=gn(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(gn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){ze(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?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":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=!ze(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=Vl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=zp(this.getDisplayData(),l)}},a$=class extends hr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[vt(t,"bins.rangeLabel")||"Range",...s.map(l=>vt(l,`0.${n}`))],o=[...vt(s,0).map((l,c)=>[`${r(Number(vt(l,"data.x0")),i)} – ${r(Number(vt(l,"data.x1")),i)}`,...s.map(u=>r(vt(u[c],`data.${vt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}},o$=class extends sn{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())?.reduce((s,a)=>s+a.value,0)??0,r=y(t,"meter","proportional")?n:n>100?100:n,i=y(t,"meter","status","ranges");if(i){const s=i.filter(a=>a.range[0]<=r&&r<=a.range[1]);if(s.length>0)return s[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?"&ndash;":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?"&ndash;":a(p,o),a(f,o)+" %"]})];return super.formatTable({headers:l,cells:c})}};class l$ extends hr{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):"&ndash;")])];return super.formatTable({headers:l,cells:c})}}let c$=class extends sn{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,"&ndash;"])}),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])})}},u$=class extends sn{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?"&ndash;":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})}},h$=class extends sn{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 d$=/\s/;function p$(e){for(var t=e.length;t--&&d$.test(e.charAt(t)););return t}var f$=/^\s+/;function m$(e){return e&&e.slice(0,p$(e)+1).replace(f$,"")}var Xp=NaN,g$=/^[-+]0x[0-9a-f]+$/i,v$=/^0b[01]+$/i,y$=/^0o[0-7]+$/i,b$=parseInt;function qr(e){if(typeof e=="number")return e;if(Us(e))return Xp;if(De(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=De(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=m$(e);var n=v$.test(e);return n||y$.test(e)?b$(e.slice(2),n?2:8):g$.test(e)?Xp:+e}var Jl=function(){return Ge.Date.now()},x$="Expected a function",_$=Math.max,E$=Math.min;function Ta(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(x$);t=qr(t)||0,De(n)&&(u=!!n.leading,d="maxWait"in n,s=d?_$(qr(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function p(O){var M=r,k=i;return r=i=void 0,c=O,a=e.apply(k,M),a}function f(O){return c=O,o=setTimeout(v,t),u?p(O):a}function g(O){var M=O-l,k=O-c,A=t-M;return d?E$(A,s-k):A}function m(O){var M=O-l,k=O-c;return l===void 0||M>=t||M<0||d&&k>=s}function v(){var O=Jl();if(m(O))return x(O);o=setTimeout(v,g(O))}function x(O){return o=void 0,h&&r?p(O):(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(Jl())}function b(){var O=Jl(),M=m(O);if(r=arguments,i=this,l=O,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 T$(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 Te([[document.querySelector(e)]],[document.documentElement]):new Te([[e]],$d)}function Yr(){var e=va().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=T$(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 Yr(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Vr.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 tc=new Date,ec=new Date;function Xt(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=>Xt(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)=>(tc.setTime(+s),ec.setTime(+a),e(tc),e(ec),Math.floor(n(tc,ec))),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 Oa=Xt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Oa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Xt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Oa),Oa.range;const On=1e3,Ne=On*60,Sn=Ne*60,wn=Sn*24,nc=wn*7,Kp=wn*30,rc=wn*365,Xr=Xt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*On)},(e,t)=>(t-e)/On,e=>e.getUTCSeconds());Xr.range;const ic=Xt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*On)},(e,t)=>{e.setTime(+e+t*Ne)},(e,t)=>(t-e)/Ne,e=>e.getMinutes());ic.range,Xt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ne)},(e,t)=>(t-e)/Ne,e=>e.getUTCMinutes()).range;const sc=Xt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*On-e.getMinutes()*Ne)},(e,t)=>{e.setTime(+e+t*Sn)},(e,t)=>(t-e)/Sn,e=>e.getHours());sc.range,Xt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Sn)},(e,t)=>(t-e)/Sn,e=>e.getUTCHours()).range;const rs=Xt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ne)/wn,e=>e.getDate()-1);rs.range;const ac=Xt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wn,e=>e.getUTCDate()-1);ac.range,Xt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wn,e=>Math.floor(e/wn)).range;function dr(e){return Xt(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())*Ne)/nc)}const Sa=dr(0),wa=dr(1),O$=dr(2),S$=dr(3),Zr=dr(4),w$=dr(5),$$=dr(6);Sa.range,wa.range,O$.range,S$.range,Zr.range,w$.range,$$.range;function pr(e){return Xt(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)/nc)}const Qp=pr(0),$a=pr(1),M$=pr(2),C$=pr(3),Kr=pr(4),A$=pr(5),L$=pr(6);Qp.range,$a.range,M$.range,C$.range,Kr.range,A$.range,L$.range;const oc=Xt(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());oc.range,Xt(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 $n=Xt(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());$n.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xt(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)}),$n.range;const fr=Xt(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());fr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xt(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)}),fr.range;function k$(e,t,n,r,i,s){const a=[[Xr,1,On],[Xr,5,5*On],[Xr,15,15*On],[Xr,30,30*On],[s,1,Ne],[s,5,5*Ne],[s,15,15*Ne],[s,30,30*Ne],[i,1,Sn],[i,3,3*Sn],[i,6,6*Sn],[i,12,12*Sn],[r,1,wn],[r,2,2*wn],[n,1,nc],[t,1,Kp],[t,3,3*Kp],[e,1,rc]];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=vl(([,,m])=>m).right(a,h);if(p===a.length)return e.every(bl(c/rc,u/rc,d));if(p===0)return Oa.every(Math.max(bl(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[D$,R$]=k$($n,oc,Sa,rs,sc,ic);function lc(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 cc(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 is(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function I$(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=ss(i),u=as(i),d=ss(s),h=as(s),p=ss(a),f=as(a),g=ss(o),m=as(o),v=ss(l),x=as(l),_={a:L,A:D,b:B,B:Q,c:null,d:sf,e:sf,f:iM,g:fM,G:gM,H:eM,I:nM,j:rM,L:af,m:sM,M:aM,p:W,q:j,Q:df,s:pf,S:oM,u:lM,U:cM,V:uM,w:hM,W:dM,x:null,X:null,y:pM,Y:mM,Z:vM,"%":hf},E={a:Z,A:ut,b:tt,B:X,c:null,d:lf,e:lf,f:_M,g:LM,G:DM,H:yM,I:bM,j:xM,L:cf,m:EM,M:TM,p:et,q:at,Q:df,s:pf,S:OM,u:SM,U:wM,V:$M,w:MM,W:CM,x:null,X:null,y:AM,Y:kM,Z:RM,"%":hf},b={a:R,A:C,b:H,B:P,c:U,d:nf,e:nf,f:K$,g:ef,G:tf,H:rf,I:rf,j:q$,L:Z$,m:W$,M:Y$,p:A,q:j$,Q:J$,s:tM,S:X$,u:H$,U:V$,V:G$,w:U$,W:F$,x:T,X:$,y:ef,Y:tf,Z:z$,"%":Q$};_.x=O(n,_),_.X=O(r,_),_.c=O(t,_),E.x=O(n,E),E.X=O(r,E),E.c=O(t,E);function O(z,q){return function(K){var F=[],ht=-1,lt=0,Mt=z.length,Gt,it,bt;for(K instanceof Date||(K=new Date(+K));++ht<Mt;)z.charCodeAt(ht)===37&&(F.push(z.slice(lt,ht)),(it=Jp[Gt=z.charAt(++ht)])!=null?Gt=z.charAt(++ht):it=Gt==="e"?" ":"0",(bt=q[Gt])&&(Gt=bt(K,it)),F.push(Gt),lt=ht+1);return F.push(z.slice(lt,ht)),F.join("")}}function M(z,q){return function(K){var F=is(1900,void 0,1),ht=k(F,z,K+="",0),lt,Mt;if(ht!=K.length)return null;if("Q"in F)return new Date(F.Q);if("s"in F)return new Date(F.s*1e3+("L"in F?F.L:0));if(q&&!("Z"in F)&&(F.Z=0),"p"in F&&(F.H=F.H%12+F.p*12),F.m===void 0&&(F.m="q"in F?F.q:0),"V"in F){if(F.V<1||F.V>53)return null;"w"in F||(F.w=1),"Z"in F?(lt=cc(is(F.y,0,1)),Mt=lt.getUTCDay(),lt=Mt>4||Mt===0?$a.ceil(lt):$a(lt),lt=ac.offset(lt,(F.V-1)*7),F.y=lt.getUTCFullYear(),F.m=lt.getUTCMonth(),F.d=lt.getUTCDate()+(F.w+6)%7):(lt=lc(is(F.y,0,1)),Mt=lt.getDay(),lt=Mt>4||Mt===0?wa.ceil(lt):wa(lt),lt=rs.offset(lt,(F.V-1)*7),F.y=lt.getFullYear(),F.m=lt.getMonth(),F.d=lt.getDate()+(F.w+6)%7)}else("W"in F||"U"in F)&&("w"in F||(F.w="u"in F?F.u%7:"W"in F?1:0),Mt="Z"in F?cc(is(F.y,0,1)).getUTCDay():lc(is(F.y,0,1)).getDay(),F.m=0,F.d="W"in F?(F.w+6)%7+F.W*7-(Mt+5)%7:F.w+F.U*7-(Mt+6)%7);return"Z"in F?(F.H+=F.Z/100|0,F.M+=F.Z%100,cc(F)):lc(F)}}function k(z,q,K,F){for(var ht=0,lt=q.length,Mt=K.length,Gt,it;ht<lt;){if(F>=Mt)return-1;if(Gt=q.charCodeAt(ht++),Gt===37){if(Gt=q.charAt(ht++),it=b[Gt in Jp?q.charAt(ht++):Gt],!it||(F=it(z,K,F))<0)return-1}else if(Gt!=K.charCodeAt(F++))return-1}return F}function A(z,q,K){var F=c.exec(q.slice(K));return F?(z.p=u.get(F[0].toLowerCase()),K+F[0].length):-1}function R(z,q,K){var F=p.exec(q.slice(K));return F?(z.w=f.get(F[0].toLowerCase()),K+F[0].length):-1}function C(z,q,K){var F=d.exec(q.slice(K));return F?(z.w=h.get(F[0].toLowerCase()),K+F[0].length):-1}function H(z,q,K){var F=v.exec(q.slice(K));return F?(z.m=x.get(F[0].toLowerCase()),K+F[0].length):-1}function P(z,q,K){var F=g.exec(q.slice(K));return F?(z.m=m.get(F[0].toLowerCase()),K+F[0].length):-1}function U(z,q,K){return k(z,t,q,K)}function T(z,q,K){return k(z,n,q,K)}function $(z,q,K){return k(z,r,q,K)}function L(z){return a[z.getDay()]}function D(z){return s[z.getDay()]}function B(z){return l[z.getMonth()]}function Q(z){return o[z.getMonth()]}function W(z){return i[+(z.getHours()>=12)]}function j(z){return 1+~~(z.getMonth()/3)}function Z(z){return a[z.getUTCDay()]}function ut(z){return s[z.getUTCDay()]}function tt(z){return l[z.getUTCMonth()]}function X(z){return o[z.getUTCMonth()]}function et(z){return i[+(z.getUTCHours()>=12)]}function at(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var q=O(z+="",_);return q.toString=function(){return z},q},parse:function(z){var q=M(z+="",!1);return q.toString=function(){return z},q},utcFormat:function(z){var q=O(z+="",E);return q.toString=function(){return z},q},utcParse:function(z){var q=M(z+="",!0);return q.toString=function(){return z},q}}}var Jp={"-":"",_:" ",0:"0"},Kt=/^\s*\d+/,N$=/^%/,P$=/[\\^$*+?|[\]().{}]/g;function yt(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 B$(e){return e.replace(P$,"\\$&")}function ss(e){return new RegExp("^(?:"+e.map(B$).join("|")+")","i")}function as(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function U$(e,t,n){var r=Kt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function H$(e,t,n){var r=Kt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function V$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function G$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function F$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function tf(e,t,n){var r=Kt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ef(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function z$(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 j$(e,t,n){var r=Kt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function W$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function nf(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function q$(e,t,n){var r=Kt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function rf(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Y$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function X$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Z$(e,t,n){var r=Kt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function K$(e,t,n){var r=Kt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Q$(e,t,n){var r=N$.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function J$(e,t,n){var r=Kt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function tM(e,t,n){var r=Kt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function sf(e,t){return yt(e.getDate(),t,2)}function eM(e,t){return yt(e.getHours(),t,2)}function nM(e,t){return yt(e.getHours()%12||12,t,2)}function rM(e,t){return yt(1+rs.count($n(e),e),t,3)}function af(e,t){return yt(e.getMilliseconds(),t,3)}function iM(e,t){return af(e,t)+"000"}function sM(e,t){return yt(e.getMonth()+1,t,2)}function aM(e,t){return yt(e.getMinutes(),t,2)}function oM(e,t){return yt(e.getSeconds(),t,2)}function lM(e){var t=e.getDay();return t===0?7:t}function cM(e,t){return yt(Sa.count($n(e)-1,e),t,2)}function of(e){var t=e.getDay();return t>=4||t===0?Zr(e):Zr.ceil(e)}function uM(e,t){return e=of(e),yt(Zr.count($n(e),e)+($n(e).getDay()===4),t,2)}function hM(e){return e.getDay()}function dM(e,t){return yt(wa.count($n(e)-1,e),t,2)}function pM(e,t){return yt(e.getFullYear()%100,t,2)}function fM(e,t){return e=of(e),yt(e.getFullYear()%100,t,2)}function mM(e,t){return yt(e.getFullYear()%1e4,t,4)}function gM(e,t){var n=e.getDay();return e=n>=4||n===0?Zr(e):Zr.ceil(e),yt(e.getFullYear()%1e4,t,4)}function vM(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+yt(t/60|0,"0",2)+yt(t%60,"0",2)}function lf(e,t){return yt(e.getUTCDate(),t,2)}function yM(e,t){return yt(e.getUTCHours(),t,2)}function bM(e,t){return yt(e.getUTCHours()%12||12,t,2)}function xM(e,t){return yt(1+ac.count(fr(e),e),t,3)}function cf(e,t){return yt(e.getUTCMilliseconds(),t,3)}function _M(e,t){return cf(e,t)+"000"}function EM(e,t){return yt(e.getUTCMonth()+1,t,2)}function TM(e,t){return yt(e.getUTCMinutes(),t,2)}function OM(e,t){return yt(e.getUTCSeconds(),t,2)}function SM(e){var t=e.getUTCDay();return t===0?7:t}function wM(e,t){return yt(Qp.count(fr(e)-1,e),t,2)}function uf(e){var t=e.getUTCDay();return t>=4||t===0?Kr(e):Kr.ceil(e)}function $M(e,t){return e=uf(e),yt(Kr.count(fr(e),e)+(fr(e).getUTCDay()===4),t,2)}function MM(e){return e.getUTCDay()}function CM(e,t){return yt($a.count(fr(e)-1,e),t,2)}function AM(e,t){return yt(e.getUTCFullYear()%100,t,2)}function LM(e,t){return e=uf(e),yt(e.getUTCFullYear()%100,t,2)}function kM(e,t){return yt(e.getUTCFullYear()%1e4,t,4)}function DM(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Kr(e):Kr.ceil(e),yt(e.getUTCFullYear()%1e4,t,4)}function RM(){return"+0000"}function hf(){return"%"}function df(e){return+e}function pf(e){return Math.floor(+e/1e3)}var Qr,ff;IM({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 IM(e){return Qr=I$(e),ff=Qr.format,Qr.parse,Qr.utcFormat,Qr.utcParse,Qr}function NM(e){return new Date(e)}function PM(e){return e instanceof Date?+e:+new Date(+e)}function mf(e,t,n,r,i,s,a,o,l,c){var u=fp(),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(O){return(l(O)<O?p:o(O)<O?f:a(O)<O?g:s(O)<O?m:r(O)<O?i(O)<O?v:x:n(O)<O?_:E)(O)}return u.invert=function(O){return new Date(d(O))},u.domain=function(O){return arguments.length?h(Array.from(O,PM)):h().map(NM)},u.ticks=function(O){var M=h();return e(M[0],M[M.length-1],O??10)},u.tickFormat=function(O,M){return M==null?b:c(M)},u.nice=function(O){var M=h();return(!O||typeof O.range!="function")&&(O=t(M[0],M[M.length-1],O??10)),O?h(Zp(M,O)):u},u.copy=function(){return Hl(u,mf(e,t,n,r,i,s,a,o,l,c))},u}function gf(){return Vr.apply(mf(D$,R$,$n,oc,Sa,rs,sc,ic,Xr,ff).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}const vf=Math.abs,ie=Math.atan2,mr=Math.cos,BM=Math.max,uc=Math.min,an=Math.sin,Jr=Math.sqrt,se=1e-12,os=Math.PI,Ma=os/2,Ca=2*os;function UM(e){return e>1?0:e<-1?os:Math.acos(e)}function yf(e){return e>=1?Ma:e<=-1?-Ma:Math.asin(e)}function bf(e){this._context=e}bf.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 Aa(e){return new bf(e)}function Vn(){}function xf(e){this._context=e}xf.prototype={areaStart:Vn,areaEnd:Vn,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 _f(e){return new xf(e)}function HM(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 VM=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Mn(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function La(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function GM(e){const t=La(e,"border-left-width"),n=La(e,"border-right-width");return e.clientWidth+t+n}function FM(e){const t=La(e,"border-top-width"),n=La(e,"border-bottom-width");return e.clientHeight+t+n}function Ef(e,t={}){const n=t.width||GM(e),r=t.height||FM(e);return{width:n,height:r}}function zM(){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 we=16384;function jM(e){(e.width>we||e.height>we)&&(e.width>we&&e.height>we?e.width>e.height?(e.height*=we/e.width,e.width=we):(e.width*=we/e.height,e.height=we):e.width>we?(e.height*=we/e.width,e.width=we):(e.width*=we/e.height,e.height=we))}function ka(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 WM(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qM(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),WM(i)}const ve=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ve(n,t)};function YM(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function XM(e){return Mn(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function ZM(e,t,n){const r=`.${e}:${t}`,i=n.cssText?YM(n):XM(n);return document.createTextNode(`${r}{${i}}`)}function Tf(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=VM();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(ZM(s,n,r)),t.appendChild(a)}function KM(e,t){Tf(e,t,":before"),Tf(e,t,":after")}const Of="application/font-woff",Sf="image/jpeg",QM={woff:Of,woff2:Of,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Sf,jpeg:Sf,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function JM(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function hc(e){const t=JM(e).toLowerCase();return QM[t]||""}function t2(e){return e.split(/,/)[1]}function dc(e){return e.search(/^(data:)/)!==-1}function e2(e,t){return`data:${t};base64,${e}`}async function wf(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 pc={};function n2(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 fc(e,t,n){const r=n2(e,t,n.includeQueryParams);if(pc[r]!=null)return pc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await wf(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),t2(o)));i=e2(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 pc[r]=i,i}async function r2(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ka(t)}async function i2(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a?.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return ka(o)}const n=e.poster,r=hc(n),i=await fc(n,r,t);return ka(i)}async function s2(e){var t;try{if(!((t=e?.contentDocument)===null||t===void 0)&&t.body)return await Da(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function a2(e,t){return ve(e,HTMLCanvasElement)?r2(e):ve(e,HTMLVideoElement)?i2(e,t):ve(e,HTMLIFrameElement)?s2(e):e.cloneNode(!1)}const o2=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function l2(e,t,n){var r,i;let s=[];return o2(e)&&e.assignedNodes?s=Mn(e.assignedNodes()):ve(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=Mn(e.contentDocument.body.childNodes):s=Mn(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||ve(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>Da(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function c2(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Mn(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`),ve(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 u2(e,t){ve(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ve(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function h2(e,t){if(ve(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function d2(e,t){return ve(t,Element)&&(c2(e,t),KM(e,t),u2(e,t),h2(e,t)),t}async function p2(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 Da(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 Da(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>a2(r,t)).then(r=>l2(e,r,t)).then(r=>d2(e,r)).then(r=>p2(r,t))}const $f=/url\((['"]?)([^'"]+?)\1\)/g,f2=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,m2=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function g2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function v2(e){const t=[];return e.replace($f,(n,r,i)=>(t.push(i),n)),t.filter(n=>!dc(n))}async function y2(e,t,n,r,i){try{const s=n?HM(t,n):t,a=hc(t);let o;return i||(o=await fc(s,a,r)),e.replace(g2(t),`$1${o}$3`)}catch{}return e}function b2(e,{preferredFontFormat:t}){return t?e.replace(m2,n=>{for(;;){const[r,,i]=f2.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Mf(e){return e.search($f)!==-1}async function Cf(e,t,n){if(!Mf(e))return e;const r=b2(e,n);return v2(r).reduce((i,s)=>i.then(a=>y2(a,s,t,n)),Promise.resolve(r))}async function Ra(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Cf(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function x2(e,t){await Ra("background",e,t)||await Ra("background-image",e,t),await Ra("mask",e,t)||await Ra("mask-image",e,t)}async function _2(e,t){const n=ve(e,HTMLImageElement);if(!(n&&!dc(e.src))&&!(ve(e,SVGImageElement)&&!dc(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await fc(r,hc(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 E2(e,t){const n=Mn(e.childNodes).map(r=>Af(r,t));await Promise.all(n).then(()=>e)}async function Af(e,t){ve(e,Element)&&(await x2(e,t),await _2(e,t),await E2(e,t))}function T2(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 Lf={};async function kf(e){let t=Lf[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Lf[e]=t,t}async function Df(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),wf(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function Rf(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 O2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Mn(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=kf(l).then(u=>Df(u,t)).then(u=>Rf(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(kf(i.href).then(o=>Df(o,t)).then(o=>Rf(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{Mn(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function S2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Mf(t.style.getPropertyValue("src")))}async function w2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Mn(e.ownerDocument.styleSheets),r=await O2(n,t);return S2(r)}async function $2(e,t){const n=await w2(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return Cf(r.cssText,i,t)}))).join(`
3
- `)}async function M2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await $2(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 C2(e,t={}){const{width:n,height:r}=Ef(e,t),i=await Da(e,t,!0);return await M2(i,t),await Af(i,t),T2(i,t),await qM(i,n,r)}async function If(e,t={}){const{width:n,height:r}=Ef(e,t),i=await C2(e,t),s=await ka(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||zM(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||jM(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 A2(e,t={}){return(await If(e,t)).toDataURL()}async function L2(e,t={}){return(await If(e,t)).toDataURL("image/jpeg",t.quality||1)}let Cn=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 k2="DONT_STYLE_ME_css_styles_verifier";let N=class zu extends Cn{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?.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(){const t=this.model.getOptions().chartId;t?this.chartID=t: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(`${ge}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",k2),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(`${ge}--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),L2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("jpg"):typeof o=="string"&&(a=o),t.services.files?.downloadImage(s,`${a}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),A2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("png"):typeof o=="string"&&(a=o),t.services.files?.downloadImage(s,`${a}.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}=zu.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(zu.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",()=>{this.services.events?.dispatchEvent(S.Chart.MOUSEOVER)}).on("mouseout",()=>{this.services.events?.dispatchEvent(S.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Ta(()=>{t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,this.services.events?.dispatchEvent(S.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},mc=class c1 extends Cn{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:c1.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function Nf(e){const t=D2(Pf(e),360);return Gn(t,[0,10])||Gn(t,[350,0])?{textAnchor:Qe.START,dominantBaseline:Je.MIDDLE}:Gn(t,[10,80])?{textAnchor:Qe.START,dominantBaseline:Je.HANGING}:Gn(t,[80,100])?{textAnchor:Qe.MIDDLE,dominantBaseline:Je.HANGING}:Gn(t,[100,170])?{textAnchor:Qe.END,dominantBaseline:Je.HANGING}:Gn(t,[170,190])?{textAnchor:Qe.END,dominantBaseline:Je.MIDDLE}:Gn(t,[190,260])?{textAnchor:Qe.END,dominantBaseline:Je.BASELINE}:Gn(t,[260,280])?{textAnchor:Qe.MIDDLE,dominantBaseline:Je.BASELINE}:{textAnchor:Qe.START,dominantBaseline:Je.BASELINE}}function D2(e,t){return(e%t+t)%t}function Gn(e,[t,n]){return e>=t&&e<=n}function Pf(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 R2(e,t){return t*Math.sin(e-Math.PI/2)}function I2(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 N2(e){return function(t){return e?.[t]}}var P2={À:"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"},B2=N2(P2),U2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,H2="\\u0300-\\u036f",V2="\\ufe20-\\ufe2f",G2="\\u20d0-\\u20ff",F2=H2+V2+G2,z2="["+F2+"]",j2=RegExp(z2,"g");function W2(e){return e=Pi(e),e&&e.replace(U2,B2).replace(j2,"")}var q2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Y2(e){return e.match(q2)||[]}var X2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Z2(e){return X2.test(e)}var Bf="\\ud800-\\udfff",K2="\\u0300-\\u036f",Q2="\\ufe20-\\ufe2f",J2="\\u20d0-\\u20ff",tC=K2+Q2+J2,Uf="\\u2700-\\u27bf",Hf="a-z\\xdf-\\xf6\\xf8-\\xff",eC="\\xac\\xb1\\xd7\\xf7",nC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rC="\\u2000-\\u206f",iC=" \\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",Vf="A-Z\\xc0-\\xd6\\xd8-\\xde",sC="\\ufe0e\\ufe0f",Gf=eC+nC+rC+iC,Ff="['’]",zf="["+Gf+"]",aC="["+tC+"]",jf="\\d+",oC="["+Uf+"]",Wf="["+Hf+"]",qf="[^"+Bf+Gf+jf+Uf+Hf+Vf+"]",lC="\\ud83c[\\udffb-\\udfff]",cC="(?:"+aC+"|"+lC+")",uC="[^"+Bf+"]",Yf="(?:\\ud83c[\\udde6-\\uddff]){2}",Xf="[\\ud800-\\udbff][\\udc00-\\udfff]",ti="["+Vf+"]",hC="\\u200d",Zf="(?:"+Wf+"|"+qf+")",dC="(?:"+ti+"|"+qf+")",Kf="(?:"+Ff+"(?:d|ll|m|re|s|t|ve))?",Qf="(?:"+Ff+"(?:D|LL|M|RE|S|T|VE))?",Jf=cC+"?",tm="["+sC+"]?",pC="(?:"+hC+"(?:"+[uC,Yf,Xf].join("|")+")"+tm+Jf+")*",fC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gC=tm+Jf+pC,vC="(?:"+[oC,Yf,Xf].join("|")+")"+gC,yC=RegExp([ti+"?"+Wf+"+"+Kf+"(?="+[zf,ti,"$"].join("|")+")",dC+"+"+Qf+"(?="+[zf,ti+Zf,"$"].join("|")+")",ti+"?"+Zf+"+"+Kf,ti+"+"+Qf,mC,fC,jf,vC].join("|"),"g");function bC(e){return e.match(yC)||[]}function xC(e,t,n){return e=Pi(e),t=t,t===void 0?Z2(e)?bC(e):Y2(e):e.match(t)||[]}var _C="['’]",EC=RegExp(_C,"g");function em(e){return function(t){return I2(xC(W2(t).replace(EC,"")),e,"")}}function TC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function nm(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=qr(n),n=n===n?n:0),t!==void 0&&(t=qr(t),t=t===t?t:0),TC(qr(e),t,n)}var OC="Expected a function";function SC(e,t,n){if(typeof e!="function")throw new TypeError(OC);return setTimeout(function(){e.apply(void 0,n)},t)}var wC=Qo(function(e,t,n){return SC(e,qr(t)||0,n)});function $C(e,t){var n=-1,r=tr(e)?Array(e.length):[];return Xl(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function MC(e,t){var n=Jt(e)?Wo:$C;return n(e,Zs(t))}var CC=1/0;function AC(e,t){return Ws(MC(e,t),CC)}function rm(e,t){return Xs(e,t)}var ei=em(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function LC(e,t){var n;return Xl(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function kC(e,t,n){var r=Jt(e)?Jh:LC;return r(e,Zs(t))}class gr{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*DC(e){for(const t of e)yield*t}function im(e){return Array.from(DC(e))}function RC(e){return e}var Ia=1,Na=2,gc=3,ls=4,sm=1e-6;function IC(e){return"translate("+e+",0)"}function NC(e){return"translate(0,"+e+")"}function PC(e){return t=>+e(t)}function BC(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function UC(){return!this.__axis}function Pa(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===Ia||e===ls?-1:1,u=e===ls||e===Na?"x":"y",d=e===Ia||e===gc?IC:NC;function h(p){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):RC),m=Math.max(s,0)+o,v=t.range(),x=+v[0]+l,_=+v[v.length-1]+l,E=(t.bandwidth?BC:PC)(t.copy(),l),b=p.selection?p.selection():p,O=b.selectAll(".domain").data([null]),M=b.selectAll(".tick").data(f,t).order(),k=M.exit(),A=M.enter().append("g").attr("class","tick"),R=M.select("line"),C=M.select("text");O=O.merge(O.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)),C=C.merge(A.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ia?"0em":e===gc?"0.71em":"0.32em")),p!==b&&(O=O.transition(p),M=M.transition(p),R=R.transition(p),C=C.transition(p),k=k.transition(p).attr("opacity",sm).attr("transform",function(H){return isFinite(H=E(H))?d(H+l):this.getAttribute("transform")}),A.attr("opacity",sm).attr("transform",function(H){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(H))?P:E(H))+l)})),k.remove(),O.attr("d",e===ls||e===Na?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),C.attr(u,c*m).text(g),b.filter(UC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Na?"start":e===ls?"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 HC(e){return Pa(Ia,e)}function VC(e){return Pa(Na,e)}function vc(e){return Pa(gc,e)}function am(e){return Pa(ls,e)}const yc={capture:!0,passive:!1};function bc(e){e.preventDefault(),e.stopImmediatePropagation()}function GC(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",bc,yc);"onselectstart"in t?n.on("selectstart.drag",bc,yc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function FC(e,t){var n=e.document.documentElement,r=I(e).on("dragstart.drag",null);t&&(r.on("click.drag",bc,yc),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 zC(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const jC=e=>+e,xc=e=>()=>e;function WC(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 qC(e){e.stopImmediatePropagation()}function _c(e){e.preventDefault(),e.stopImmediatePropagation()}var om={name:"drag"},Ec={name:"space"},ni={name:"handle"},ri={name:"center"};const{abs:lm,max:ae,min:oe}=Math;function cm(e){return[+e[0],+e[1]]}function um(e){return[cm(e[0]),cm(e[1])]}var Ba={name:"x",handles:["w","e"].map(Oc),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]]}},Tc={},An={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"},hm={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},dm={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},YC={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},XC={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Oc(e){return{type:e}}function ZC(e){return!e.ctrlKey&&!e.button}function KC(){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 QC(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sc(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function JC(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function pm(){return tA(Ba)}function tA(e){var t=KC,n=ZC,r=QC,i=!0,s=xl("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([Oc("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",An.overlay).merge(v).each(function(){var _=Sc(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([Oc("selection")]).enter().append("rect").attr("class","selection").attr("cursor",An.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 An[_.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),O=E.selection,M=e.input(typeof v=="function"?v.apply(this,arguments):v,E.extent),k=ji(O,M);function A(R){E.selection=R===1&&M===null?null:k(R),c.call(_),b.brush()}return O!==null&&M!==null?A:A(1)}):m.each(function(){var _=this,E=arguments,b=_.__brush,O=e.input(typeof v=="function"?v.apply(_,E):v,b.extent),M=u(_,E).beforestart();Il(_),b.selection=O===null?null:O,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=Sc(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 WC(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"?om:i&&m.altKey?ri:ni,E=e===Tc?null:YC[x],b=e===Ba?null:XC[x],O=Sc(v),M=O.extent,k=O.selection,A=M[0][0],R,C,H=M[0][1],P,U,T=M[1][0],$,L,D=M[1][1],B,Q,W=0,j=0,Z,ut=E&&b&&i&&m.shiftKey,tt,X,et=Array.from(m.touches||[m],it=>{const bt=it.identifier;return it=ir(it,v),it.point0=it.slice(),it.identifier=bt,it});Il(v);var at=u(v,arguments,!0).beforestart();if(x==="overlay"){k&&(Z=!0);const it=[et[0],et[1]||et[0]];O.selection=k=[[R=e===Tc?A:oe(it[0][0],it[1][0]),P=e===Ba?H:oe(it[0][1],it[1][1])],[$=e===Tc?T:ae(it[0][0],it[1][0]),B=e===Ba?D:ae(it[0][1],it[1][1])]],et.length>1&&ht(m)}else R=k[0][0],P=k[0][1],$=k[1][0],B=k[1][1];C=R,U=P,L=$,Q=B;var z=I(v).attr("pointer-events","none"),q=z.selectAll(".overlay").attr("cursor",An[x]);if(m.touches)at.moved=F,at.ended=lt;else{var K=I(m.view).on("mousemove.brush",F,!0).on("mouseup.brush",lt,!0);i&&K.on("keydown.brush",Mt,!0).on("keyup.brush",Gt,!0),GC(m.view)}c.call(v),at.start(m,_.name);function F(it){for(const bt of it.changedTouches||[it])for(const He of et)He.identifier===bt.identifier&&(He.cur=ir(bt,v));if(ut&&!tt&&!X&&et.length===1){const bt=et[0];lm(bt.cur[0]-bt[0])>lm(bt.cur[1]-bt[1])?X=!0:tt=!0}for(const bt of et)bt.cur&&(bt[0]=bt.cur[0],bt[1]=bt.cur[1]);Z=!0,_c(it),ht(it)}function ht(it){const bt=et[0],He=bt.point0;var pe;switch(W=bt[0]-He[0],j=bt[1]-He[1],_){case Ec:case om:{E&&(W=ae(A-R,oe(T-$,W)),C=R+W,L=$+W),b&&(j=ae(H-P,oe(D-B,j)),U=P+j,Q=B+j);break}case ni:{et[1]?(E&&(C=ae(A,oe(T,et[0][0])),L=ae(A,oe(T,et[1][0])),E=1),b&&(U=ae(H,oe(D,et[0][1])),Q=ae(H,oe(D,et[1][1])),b=1)):(E<0?(W=ae(A-R,oe(T-R,W)),C=R+W,L=$):E>0&&(W=ae(A-$,oe(T-$,W)),C=R,L=$+W),b<0?(j=ae(H-P,oe(D-P,j)),U=P+j,Q=B):b>0&&(j=ae(H-B,oe(D-B,j)),U=P,Q=B+j));break}case ri:{E&&(C=ae(A,oe(T,R-W*E)),L=ae(A,oe(T,$+W*E))),b&&(U=ae(H,oe(D,P-j*b)),Q=ae(H,oe(D,B+j*b)));break}}L<C&&(E*=-1,pe=R,R=$,$=pe,pe=C,C=L,L=pe,x in hm&&q.attr("cursor",An[x=hm[x]])),Q<U&&(b*=-1,pe=P,P=B,B=pe,pe=U,U=Q,Q=pe,x in dm&&q.attr("cursor",An[x=dm[x]])),O.selection&&(k=O.selection),tt&&(C=k[0][0],L=k[1][0]),X&&(U=k[0][1],Q=k[1][1]),(k[0][0]!==C||k[0][1]!==U||k[1][0]!==L||k[1][1]!==Q)&&(O.selection=[[C,U],[L,Q]],c.call(v),at.brush(it,_.name))}function lt(it){if(qC(it),it.touches){if(it.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else FC(it.view,Z),K.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);z.attr("pointer-events","all"),q.attr("cursor",An.overlay),O.selection&&(k=O.selection),JC(k)&&(O.selection=null,c.call(v)),at.end(it,_.name)}function Mt(it){switch(it.keyCode){case 16:{ut=E&&b;break}case 18:{_===ni&&(E&&($=L-W*E,R=C+W*E),b&&(B=Q-j*b,P=U+j*b),_=ri,ht(it));break}case 32:{(_===ni||_===ri)&&(E<0?$=L-W:E>0&&(R=C-W),b<0?B=Q-j:b>0&&(P=U-j),_=Ec,q.attr("cursor",An.selection),ht(it));break}default:return}_c(it)}function Gt(it){switch(it.keyCode){case 16:{ut&&(tt=X=ut=!1,ht(it));break}case 18:{_===ri&&(E<0?$=L:E>0&&(R=C),b<0?B=Q:b>0&&(P=U),_=ni,ht(it));break}case 32:{_===Ec&&(it.altKey?(E&&($=L-W*E,R=C+W*E),b&&(B=Q-j*b,P=U+j*b),_=ri):(E<0?$=L:E>0&&(R=C),b<0?B=Q:b>0&&(P=U),_=ni),q.attr("cursor",An[x]),ht(it));break}default:return}_c(it)}}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=um(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:xc(um(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:xc(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:xc(!!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 wc=Math.PI,$c=2*wc,vr=1e-6,eA=$c-vr;function fm(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function nA(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return fm;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 Mc=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?fm:nA(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>vr)if(!(Math.abs(d*l-c*u)>vr)||!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((wc-Math.acos((g+h-m)/(2*v*x)))/2),E=_/x,b=_/v;Math.abs(E-1)>vr&&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)>vr||Math.abs(this._y1-u)>vr)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%$c+$c),h>eA?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>vr&&this._append`A${r},${r},0,${+(h>=wc)},${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 mm(){return new Mc}mm.prototype=Mc.prototype;var Ot=1e-6,gm=1e-12,mt=Math.PI,ye=mt/2,vm=mt/4,$e=mt*2,ce=180/mt,Ht=mt/180,St=Math.abs,ym=Math.atan,yr=Math.atan2,$t=Math.cos,rA=Math.exp,iA=Math.log,Et=Math.sin,Fn=Math.sign||function(e){return e>0?1:e<0?-1:0},Ze=Math.sqrt,sA=Math.tan;function aA(e){return e>1?0:e<-1?mt:Math.acos(e)}function Ln(e){return e>1?ye:e<-1?-ye:Math.asin(e)}function Pe(){}function Ua(e,t){e&&xm.hasOwnProperty(e.type)&&xm[e.type](e,t)}var bm={Feature:function(e,t){Ua(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Ua(n[r].geometry,t)}},xm={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){Cc(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Cc(n[r],t,0)},Polygon:function(e,t){_m(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)_m(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Ua(n[r],t)}};function Cc(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 _m(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Cc(e[n],t,1);t.polygonEnd()}function ii(e,t){e&&bm.hasOwnProperty(e.type)?bm[e.type](e,t):Ua(e,t)}function Ac(e){return[yr(e[1],e[0]),Ln(e[2])]}function si(e){var t=e[0],n=e[1],r=$t(n);return[r*$t(t),r*Et(t),Et(n)]}function Ha(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Va(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 Lc(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ga(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function kc(e){var t=Ze(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Dc(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 Rc(e,t){return St(e)>mt&&(e-=Math.round(e/$e)*$e),[e,t]}Rc.invert=Rc;function Em(e,t,n){return(e%=$e)?t||n?Dc(Om(e),Sm(t,n)):Om(e):t||n?Sm(t,n):Rc}function Tm(e){return function(t,n){return t+=e,St(t)>mt&&(t-=Math.round(t/$e)*$e),[t,n]}}function Om(e){var t=Tm(e);return t.invert=Tm(-e),t}function Sm(e,t){var n=$t(e),r=Et(e),i=$t(t),s=Et(t);function a(o,l){var c=$t(l),u=$t(o)*c,d=Et(o)*c,h=Et(l),p=h*n+u*r;return[yr(d*i-p*s,u*n-h*r),Ln(p*i+d*s)]}return a.invert=function(o,l){var c=$t(l),u=$t(o)*c,d=Et(o)*c,h=Et(l),p=h*i-d*s;return[yr(d*i+h*s,u*n+p*r),Ln(p*n-u*r)]},a}function oA(e){e=Em(e[0]*Ht,e[1]*Ht,e.length>2?e[2]*Ht:0);function t(n){return n=e(n[0]*Ht,n[1]*Ht),n[0]*=ce,n[1]*=ce,n}return t.invert=function(n){return n=e.invert(n[0]*Ht,n[1]*Ht),n[0]*=ce,n[1]*=ce,n},t}function lA(e,t,n,r,i,s){if(n){var a=$t(t),o=Et(t),l=r*n;i==null?(i=t+r*$e,s=t-l/2):(i=wm(a,i),s=wm(a,s),(r>0?i<s:i>s)&&(i+=r*$e));for(var c,u=i;r>0?u>s:u<s;u-=l)c=Ac([a,-o*$t(u),-o*Et(u)]),e.point(c[0],c[1])}}function wm(e,t){t=si(t),t[0]-=e,kc(t);var n=aA(-t[1]);return((-t[2]<0?-n:n)+$e-Ot)%$e}function $m(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Pe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Fa(e,t){return St(e[0]-t[0])<Ot&&St(e[1]-t[1])<Ot}function za(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 Mm(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(Fa(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*Ot}s.push(x=new za(m,f,null,!0)),a.push(x.o=new za(m,null,x,!1)),s.push(x=new za(v,f,null,!1)),a.push(x.o=new za(v,null,x,!0))}}),!!s.length){for(a.sort(t),Cm(s),Cm(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 Cm(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 Ic(e){return St(e[0])<=mt?e[0]:Fn(e[0])*((St(e[0])+mt)%$e-mt)}function cA(e,t){var n=Ic(t),r=t[1],i=Et(r),s=[Et(n),-$t(n),0],a=0,o=0,l=new gr;i===1?r=ye+Ot:i===-1&&(r=-ye-Ot);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=Ic(p),g=p[1]/2+vm,m=Et(g),v=$t(g),x=0;x<h;++x,f=E,m=O,v=M,p=_){var _=d[x],E=Ic(_),b=_[1]/2+vm,O=Et(b),M=$t(b),k=E-f,A=k>=0?1:-1,R=A*k,C=R>mt,H=m*O;if(l.add(yr(H*A*Et(R),v*M+H*$t(R))),a+=C?k+A*$e:k,C^f>=n^E>=n){var P=Va(si(p),si(_));kc(P);var U=Va(s,P);kc(U);var T=(C^k>=0?-1:1)*Ln(U[2]);(r>T||r===T&&(P[0]||P[1]))&&(o+=C^k>=0?1:-1)}}return(a<-Ot||a<Ot&&l<-gm)^o&1}function Am(e,t,n,r){return function(i){var s=t(i),a=$m(),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=im(u);var E=cA(c,r);u.length?(l||(i.polygonStart(),l=!0),Mm(u,hA,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(),O,M=b.length,k,A,R;if(d.pop(),c.push(d),d=null,!!M){if(E&1){if(A=b[0],(k=A.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),O=0;O<k;++O)i.point((R=A[O])[0],R[1]);i.lineEnd()}return}M>1&&E&2&&b.push(b.pop().concat(b.shift())),u.push(b.filter(uA))}}return h}}function uA(e){return e.length>1}function hA(e,t){return((e=e.x)[0]<0?e[1]-ye-Ot:ye-e[1])-((t=t.x)[0]<0?t[1]-ye-Ot:ye-t[1])}const Lm=Am(function(){return!0},dA,fA,[-mt,-ye]);function dA(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)<Ot?(e.point(t,n=(n+a)/2>0?ye:-ye),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)<Ot&&(t-=r*Ot),St(s-o)<Ot&&(s-=o*Ot),n=pA(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 pA(e,t,n,r){var i,s,a=Et(e-n);return St(a)>Ot?ym((Et(t)*(s=$t(r))*Et(n)-Et(r)*(i=$t(t))*Et(e))/(i*s*a)):(t+r)/2}function fA(e,t,n,r){var i;if(e==null)i=n*ye,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])>Ot){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 mA(e){var t=$t(e),n=2*Ht,r=t>0,i=St(t)>Ot;function s(u,d,h,p){lA(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),(!_||Fa(d,_)||Fa(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 O;!(b&h)&&(O=l(x,d,!0))&&(g=0,r?(u.lineStart(),u.point(O[0][0],O[0][1]),u.point(O[1][0],O[1][1]),u.lineEnd()):(u.point(O[1][0],O[1][1]),u.lineEnd(),u.lineStart(),u.point(O[0][0],O[0][1],3)))}E&&(!d||!Fa(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=si(u),f=si(d),g=[1,0,0],m=Va(p,f),v=Ha(m,m),x=m[0],_=v-x*x;if(!_)return!h&&u;var E=t*v/_,b=-t*x/_,O=Va(g,m),M=Ga(g,E),k=Ga(m,b);Lc(M,k);var A=O,R=Ha(M,A),C=Ha(A,A),H=R*R-C*(Ha(M,M)-1);if(!(H<0)){var P=Ze(H),U=Ga(A,(-R-P)/C);if(Lc(U,M),U=Ac(U),!h)return U;var T=u[0],$=d[0],L=u[1],D=d[1],B;$<T&&(B=T,T=$,$=B);var Q=$-T,W=St(Q-mt)<Ot,j=W||Q<Ot;if(!W&&D<L&&(B=L,L=D,D=B),j?W?L+D>0^U[1]<(St(U[0]-T)<Ot?L:D):L<=U[1]&&U[1]<=D:Q>mt^(T<=U[0]&&U[0]<=$)){var Z=Ga(A,(-R+P)/C);return Lc(Z,M),[U,Ac(Z)]}}}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 Am(a,o,s,r?[0,-e]:[-mt,e-mt])}function gA(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 cs=1e9,ja=-cs;function vA(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)<Ot?u>0?0:3:St(c[0]-n)<Ot?u>0?2:1:St(c[1]-t)<Ot?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=$m(),h,p,f,g,m,v,x,_,E,b,O,M={point:k,lineStart:H,lineEnd:P,polygonStart:R,polygonEnd:C};function k(T,$){i(T,$)&&u.point(T,$)}function A(){for(var T=0,$=0,L=p.length;$<L;++$)for(var D=p[$],B=1,Q=D.length,W=D[0],j,Z,ut=W[0],tt=W[1];B<Q;++B)j=ut,Z=tt,W=D[B],ut=W[0],tt=W[1],Z<=r?tt>r&&(ut-j)*(r-Z)>(tt-Z)*(e-j)&&++T:tt<=r&&(ut-j)*(r-Z)<(tt-Z)*(e-j)&&--T;return T}function R(){u=d,h=[],p=[],O=!0}function C(){var T=A(),$=O&&T,L=(h=im(h)).length;($||L)&&(c.polygonStart(),$&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),L&&Mm(h,o,T,s,c),c.polygonEnd()),u=c,h=p=f=null}function H(){M.point=U,p&&p.push(f=[]),b=!0,E=!1,x=_=NaN}function P(){h&&(U(g,m),v&&E&&d.rejoin(),h.push(d.result())),M.point=k,E&&u.lineEnd()}function U(T,$){var L=i(T,$);if(p&&f.push([T,$]),b)g=T,m=$,v=L,b=!1,L&&(u.lineStart(),u.point(T,$));else if(L&&E)u.point(T,$);else{var D=[x=Math.max(ja,Math.min(cs,x)),_=Math.max(ja,Math.min(cs,_))],B=[T=Math.max(ja,Math.min(cs,T)),$=Math.max(ja,Math.min(cs,$))];gA(D,B,e,t,n,r)?(E||(u.lineStart(),u.point(D[0],D[1])),u.point(B[0],B[1]),L||u.lineEnd(),O=!1):L&&(u.lineStart(),u.point(T,$),O=!1)}x=T,_=$,E=L}return M}}const Nc=e=>e;var Pc=new gr,Bc=new gr,km,Dm,Uc,Hc,kn={point:Pe,lineStart:Pe,lineEnd:Pe,polygonStart:function(){kn.lineStart=yA,kn.lineEnd=xA},polygonEnd:function(){kn.lineStart=kn.lineEnd=kn.point=Pe,Pc.add(St(Bc)),Bc=new gr},result:function(){var e=Pc/2;return Pc=new gr,e}};function yA(){kn.point=bA}function bA(e,t){kn.point=Rm,km=Uc=e,Dm=Hc=t}function Rm(e,t){Bc.add(Hc*e-Uc*t),Uc=e,Hc=t}function xA(){Rm(km,Dm)}var ai=1/0,Wa=ai,us=-ai,qa=us,Ya={point:_A,lineStart:Pe,lineEnd:Pe,polygonStart:Pe,polygonEnd:Pe,result:function(){var e=[[ai,Wa],[us,qa]];return us=qa=-(Wa=ai=1/0),e}};function _A(e,t){e<ai&&(ai=e),e>us&&(us=e),t<Wa&&(Wa=t),t>qa&&(qa=t)}var Vc=0,Gc=0,hs=0,Xa=0,Za=0,oi=0,Fc=0,zc=0,ds=0,Im,Nm,on,ln,Be={point:br,lineStart:Pm,lineEnd:Bm,polygonStart:function(){Be.lineStart=OA,Be.lineEnd=SA},polygonEnd:function(){Be.point=br,Be.lineStart=Pm,Be.lineEnd=Bm},result:function(){var e=ds?[Fc/ds,zc/ds]:oi?[Xa/oi,Za/oi]:hs?[Vc/hs,Gc/hs]:[NaN,NaN];return Vc=Gc=hs=Xa=Za=oi=Fc=zc=ds=0,e}};function br(e,t){Vc+=e,Gc+=t,++hs}function Pm(){Be.point=EA}function EA(e,t){Be.point=TA,br(on=e,ln=t)}function TA(e,t){var n=e-on,r=t-ln,i=Ze(n*n+r*r);Xa+=i*(on+e)/2,Za+=i*(ln+t)/2,oi+=i,br(on=e,ln=t)}function Bm(){Be.point=br}function OA(){Be.point=wA}function SA(){Um(Im,Nm)}function wA(e,t){Be.point=Um,br(Im=on=e,Nm=ln=t)}function Um(e,t){var n=e-on,r=t-ln,i=Ze(n*n+r*r);Xa+=i*(on+e)/2,Za+=i*(ln+t)/2,oi+=i,i=ln*e-on*t,Fc+=i*(on+e),zc+=i*(ln+t),ds+=i*3,br(on=e,ln=t)}function Hm(e){this._context=e}Hm.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,$e);break}}},result:Pe};var jc=new gr,Wc,Vm,Gm,ps,fs,ms={point:Pe,lineStart:function(){ms.point=$A},lineEnd:function(){Wc&&Fm(Vm,Gm),ms.point=Pe},polygonStart:function(){Wc=!0},polygonEnd:function(){Wc=null},result:function(){var e=+jc;return jc=new gr,e}};function $A(e,t){ms.point=Fm,Vm=ps=e,Gm=fs=t}function Fm(e,t){ps-=e,fs-=t,jc.add(Ze(ps*ps+fs*fs)),ps=e,fs=t}let zm,Ka,jm,Wm;class qm{constructor(t){this._append=t==null?Ym:MA(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!==jm||this._append!==Ka){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`,jm=r,Ka=this._append,Wm=this._,this._=i}this._+=Wm;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Ym(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function MA(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Ym;if(t!==zm){const n=10**t;zm=t,Ka=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 Ka}function CA(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),ii(o,i(s))),s.result()}return a.area=function(o){return ii(o,i(kn)),kn.result()},a.measure=function(o){return ii(o,i(ms)),ms.result()},a.bounds=function(o){return ii(o,i(Ya)),Ya.result()},a.centroid=function(o){return ii(o,i(Be)),Be.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Nc):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new qm(n)):new Hm(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 qm(n)),a},a.projection(e).digits(n).context(t)}function qc(e){return function(t){var n=new Yc;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Yc(){}Yc.prototype={constructor:Yc,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 Xc(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),ii(n,e.stream(Ya)),t(Ya.result()),r!=null&&e.clipExtent(r),e}function Xm(e,t,n){return Xc(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 AA(e,t,n){return Xm(e,[[0,0],t],n)}function LA(e,t,n){return Xc(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 kA(e,t,n){return Xc(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 Zm=16,DA=$t(30*Ht);function Km(e,t){return+t?IA(e,t):RA(e)}function RA(e){return qc({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function IA(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,O=l+f,M=Ze(E*E+b*b+O*O),k=Ln(O/=M),A=St(St(O)-1)<Ot||St(s-d)<Ot?(s+d)/2:yr(b,E),R=e(A,k),C=R[0],H=R[1],P=C-r,U=H-i,T=x*P-v*U;(T*T/_>t||St((v*P+x*U)/_-.5)>.3||a*h+o*p+l*f<DA)&&(n(r,i,s,a,o,l,C,H,A,E/=M,b/=M,O,g,m),m.point(C,H),n(C,H,A,E,b,O,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(k,A){k=e(k,A),r.point(k[0],k[1])}function x(){d=NaN,m.point=_,r.lineStart()}function _(k,A){var R=si([k,A]),C=e(k,A);n(d,h,u,p,f,g,d=C[0],h=C[1],u=k,p=R[0],f=R[1],g=R[2],Zm,r),r.point(d,h)}function E(){m.point=v,r.lineEnd()}function b(){x(),m.point=O,m.lineEnd=M}function O(k,A){_(i=k,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,Zm,r),m.lineEnd=E,E()}return m}}var NA=qc({point:function(e,t){this.stream.point(e*Ht,t*Ht)}});function PA(e){return qc({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function BA(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 Qm(e,t,n,r,i,s){if(!s)return BA(e,t,n,r,i);var a=$t(s),o=Et(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 Qa(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=Lm,m=null,v,x,_,E=Nc,b=.5,O,M,k,A,R;function C(T){return k(T[0]*Ht,T[1]*Ht)}function H(T){return T=k.invert(T[0],T[1]),T&&[T[0]*ce,T[1]*ce]}C.stream=function(T){return A&&R===T?A:A=NA(PA(u)(g(O(E(R=T)))))},C.preclip=function(T){return arguments.length?(g=T,f=void 0,U()):g},C.postclip=function(T){return arguments.length?(E=T,m=v=x=_=null,U()):E},C.clipAngle=function(T){return arguments.length?(g=+T?mA(f=T*Ht):(f=null,Lm),U()):f*ce},C.clipExtent=function(T){return arguments.length?(E=T==null?(m=v=x=_=null,Nc):vA(m=+T[0][0],v=+T[0][1],x=+T[1][0],_=+T[1][1]),U()):m==null?null:[[m,v],[x,_]]},C.scale=function(T){return arguments.length?(n=+T,P()):n},C.translate=function(T){return arguments.length?(r=+T[0],i=+T[1],P()):[r,i]},C.center=function(T){return arguments.length?(s=T[0]%360*Ht,a=T[1]%360*Ht,P()):[s*ce,a*ce]},C.rotate=function(T){return arguments.length?(o=T[0]%360*Ht,l=T[1]%360*Ht,c=T.length>2?T[2]%360*Ht:0,P()):[o*ce,l*ce,c*ce]},C.angle=function(T){return arguments.length?(d=T%360*Ht,P()):d*ce},C.reflectX=function(T){return arguments.length?(h=T?-1:1,P()):h<0},C.reflectY=function(T){return arguments.length?(p=T?-1:1,P()):p<0},C.precision=function(T){return arguments.length?(O=Km(M,b=T*T),U()):Ze(b)},C.fitExtent=function(T,$){return Xm(C,T,$)},C.fitSize=function(T,$){return AA(C,T,$)},C.fitWidth=function(T,$){return LA(C,T,$)},C.fitHeight=function(T,$){return kA(C,T,$)};function P(){var T=Qm(n,0,0,h,p,d).apply(null,t(s,a)),$=Qm(n,r-T[0],i-T[1],h,p,d);return u=Em(o,l,c),M=Dc(t,$),k=Dc(u,M),O=Km(M,b),U()}function U(){return A=R=null,C}return function(){return t=e.apply(this,arguments),C.invert=t.invert&&H,P()}}function tg(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]*Ht,n=s[1]*Ht):[t*ce,n*ce]},i}function UA(e){var t=$t(e);function n(r,i){return[r*t,Et(i)/t]}return n.invert=function(r,i){return[r/t,Ln(i*t)]},n}function HA(e,t){var n=Et(e),r=(n+Et(t))/2;if(St(r)<Ot)return UA(e);var i=1+n*(2*r-n),s=Ze(i)/r;function a(o,l){var c=Ze(i-2*r*Et(l))/r;return[c*Et(o*=r),s-c*$t(o)]}return a.invert=function(o,l){var c=s-l,u=yr(o,St(c))*Fn(c);return c*r<0&&(u-=mt*Fn(o)*Fn(c)),[u/r,Ln((i-(o*o+c*c)*r*r)/(2*r))]},a}function eg(){return tg(HA).scale(155.424).center([0,33.6442])}function VA(){return eg().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Zc(e,t){return[e,iA(sA((ye+t)/2))]}Zc.invert=function(e,t){return[e,2*ym(rA(t))-ye]};function GA(){return FA(Zc).scale(961/$e)}function FA(e){var t=Qa(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(oA(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Zc?[[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 Ja(e,t){return[e,t]}Ja.invert=Ja;function zA(){return Qa(Ja).scale(152.63)}function jA(e,t){var n=$t(e),r=e===t?Et(e):(n-$t(t))/(t-e),i=n/r+e;if(St(r)<Ot)return Ja;function s(a,o){var l=i-o,c=r*a;return[l*Et(c),i-l*$t(c)]}return s.invert=function(a,o){var l=i-o,c=yr(a,St(l))*Fn(l);return l*r<0&&(c-=mt*Fn(a)*Fn(l)),[c/r,i-Fn(r)*Ze(a*a+l*l)]},s}function WA(){return tg(jA).scale(131.154).center([0,13.9389])}var gs=1.340264,vs=-.081106,ys=893e-6,bs=.003796,to=Ze(3)/2,qA=12;function ng(e,t){var n=Ln(to*Et(t)),r=n*n,i=r*r*r;return[e*$t(n)/(to*(gs+3*vs*r+i*(7*ys+9*bs*r))),n*(gs+vs*r+i*(ys+bs*r))]}ng.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<qA&&(o=n*(gs+vs*r+i*(ys+bs*r))-t,l=gs+3*vs*r+i*(7*ys+9*bs*r),n-=a=o/l,r=n*n,i=r*r*r,!(St(a)<gm));++s);return[to*e*(gs+3*vs*r+i*(7*ys+9*bs*r))/$t(n),Ln(Et(n)/to)]};function YA(){return Qa(ng).scale(177.158)}function rg(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)))]}rg.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)>Ot&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function XA(){return Qa(rg).scale(175.295)}function ZA(e,t){return e.parent===t.parent?1:2}function KA(e){return e.reduce(QA,0)/e.length}function QA(e,t){return e+t.x}function JA(e){return 1+e.reduce(tL,0)}function tL(e,t){return Math.max(e,t.y)}function eL(e){for(var t;t=e.children;)e=t[0];return e}function nL(e){for(var t;t=e.children;)e=t[t.length-1];return e}function rL(){var e=ZA,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var p=h.children;p?(h.x=KA(p),h.y=JA(p)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=eL(s),c=nL(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 iL(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 sL(){return this.eachAfter(iL)}function aL(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function oL(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 lL(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 cL(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function uL(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 hL(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function dL(e){for(var t=this,n=pL(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 pL(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 fL(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function mL(){return Array.from(this)}function gL(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function vL(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*yL(){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 xs(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=_L)):t===void 0&&(t=xL);for(var n=new _s(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 _s(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(TL)}function bL(){return xs(this).eachBefore(EL)}function xL(e){return e.children}function _L(e){return Array.isArray(e)?e[1]:null}function EL(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function TL(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function _s(e){this.data=e,this.depth=this.height=0,this.parent=null}_s.prototype=xs.prototype={constructor:_s,count:sL,each:aL,eachAfter:lL,eachBefore:oL,find:cL,sum:uL,sort:hL,path:dL,ancestors:fL,descendants:mL,leaves:gL,links:vL,copy:bL,[Symbol.iterator]:yL};function OL(e){return e==null?null:ig(e)}function ig(e){if(typeof e!="function")throw new Error;return e}function xr(){return 0}function li(e){return function(){return e}}const SL=1664525,wL=1013904223,sg=4294967296;function $L(){let e=1;return()=>(e=(SL*e+wL)%sg)/sg}function ML(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function CL(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 AL(e,t){for(var n=0,r=(e=CL(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&ag(a,s)?++n:(a=kL(i=LL(i,s)),n=0);return a}function LL(e,t){var n,r;if(Kc(t,e))return[t];for(n=0;n<e.length;++n)if(eo(t,e[n])&&Kc(Es(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(eo(Es(e[n],e[r]),t)&&eo(Es(e[n],t),e[r])&&eo(Es(e[r],t),e[n])&&Kc(og(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function eo(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 ag(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 Kc(e,t){for(var n=0;n<t.length;++n)if(!ag(e,t[n]))return!1;return!0}function kL(e){switch(e.length){case 1:return DL(e[0]);case 2:return Es(e[0],e[1]);case 3:return og(e[0],e[1],e[2])}}function DL(e){return{x:e.x,y:e.y,r:e.r}}function Es(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 og(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,O=(f*E-g*_)/(b*2)-r,M=(g*m-f*v)/b,k=(p*_-h*E)/(b*2)-i,A=(h*v-p*m)/b,R=M*M+A*A-1,C=2*(s+O*M+k*A),H=O*O+k*k-s*s,P=-(Math.abs(R)>1e-6?(C+Math.sqrt(C*C-4*R*H))/(2*R):H/C);return{x:r+O+M*P,y:i+k+A*P,r:P}}function lg(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 cg(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 ug(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 no(e){this._=e,this.next=null,this.previous=null}function RL(e,t){if(!(s=(e=ML(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;lg(r,n,i=e[2]),n=new no(n),r=new no(r),i=new no(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){lg(n._,r._,i=e[l]),i=new no(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(cg(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(cg(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=ug(n);(i=i.next)!==r;)(o=ug(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=AL(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function IL(e){return Math.sqrt(e.value)}function NL(){var e=null,t=1,n=1,r=xr;function i(s){const a=$L();return s.x=t/2,s.y=n/2,e?s.eachBefore(hg(e)).eachAfter(Qc(r,.5,a)).eachBefore(dg(1)):s.eachBefore(hg(IL)).eachAfter(Qc(xr,1,a)).eachAfter(Qc(r,s.r/Math.min(t,n),a)).eachBefore(dg(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=OL(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:li(+s),i):r},i}function hg(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Qc(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=RL(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function dg(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 PL(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 BL(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 UL(e,t){return e.parent===t.parent?1:2}function Jc(e){var t=e.children;return t?t[0]:e.t}function tu(e){var t=e.children;return t?t[t.length-1]:e.t}function HL(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 VL(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 GL(e,t,n){return e.a.parent===t.parent?e.a:n}function ro(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}ro.prototype=Object.create(_s.prototype);function FL(e){for(var t=new ro(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 ro(s[a],a)),i.parent=n;return(t.parent=new ro(null,0)).children=[t],t}function zL(){var e=UL,t=1,n=1,r=null;function i(c){var u=FL(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){VL(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=tu(f),h=Jc(h),f&&h;)g=Jc(g),p=tu(p),p.a=c,E=f.z+x-h.z-m+e(f._,h._),E>0&&(HL(GL(f,c,d),c,E),m+=E,v+=E),x+=f.m,m+=h.m,_+=g.m,v+=p.m;f&&!tu(p)&&(p.t=f,p.m+=x-v),h&&!Jc(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 jL(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 WL=(1+Math.sqrt(5))/2;function qL(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,O;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),O=m*m*b,E=Math.max(x/O,O/v);d<h;++d){if(m+=c=o[d].value,c<v&&(v=c),c>x&&(x=c),O=m*m*b,_=Math.max(x/O,O/v),_>E){m-=c;break}E=_}a.push(l={value:m,dice:p<f,children:o.slice(u,d)}),l.dice?BL(l,n,r,i,g?r+=f*m/g:s):jL(l,n,r,g?n+=p*m/g:i,s),g-=m,u=d}return a}const YL=function e(t){function n(r,i,s,a,o){qL(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(WL);function XL(){var e=YL,t=!1,n=1,r=1,i=[0],s=xr,a=xr,o=xr,l=xr,c=xr;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(PL),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=ig(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:li(+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:li(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:li(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:li(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:li(+h),u):c},u}function io(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 Mc(t)}function ZL(e){return e.innerRadius}function KL(e){return e.outerRadius}function QL(e){return e.startAngle}function JL(e){return e.endAngle}function tk(e){return e&&e.padAngle}function ek(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<se))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function so(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Jr(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,O=h*g-f*p,M=(_<0?-1:1)*Jr(BM(0,b*b*E-O*O)),k=(O*_-x*M)/E,A=(-O*x-_*M)/E,R=(O*_+x*M)/E,C=(-O*x+_*M)/E,H=k-m,P=A-v,U=R-m,T=C-v;return H*H+P*P>U*U+T*T&&(k=R,A=C),{cx:k,cy:A,x01:-u,y01:-d,x11:k*(i/b-1),y11:A*(i/b-1)}}function Ts(){var e=ZL,t=KL,n=ft(0),r=null,i=QL,s=JL,a=tk,o=null,l=io(c);function c(){var u,d,h=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-Ma,g=s.apply(this,arguments)-Ma,m=vf(g-f),v=g>f;if(o||(o=u=l()),p<h&&(d=p,p=h,h=d),!(p>se))o.moveTo(0,0);else if(m>Ca-se)o.moveTo(p*mr(f),p*an(f)),o.arc(0,0,p,f,g,!v),h>se&&(o.moveTo(h*mr(g),h*an(g)),o.arc(0,0,h,g,f,v));else{var x=f,_=g,E=f,b=g,O=m,M=m,k=a.apply(this,arguments)/2,A=k>se&&(r?+r.apply(this,arguments):Jr(h*h+p*p)),R=uc(vf(p-h)/2,+n.apply(this,arguments)),C=R,H=R,P,U;if(A>se){var T=yf(A/h*an(k)),$=yf(A/p*an(k));(O-=T*2)>se?(T*=v?1:-1,E+=T,b-=T):(O=0,E=b=(f+g)/2),(M-=$*2)>se?($*=v?1:-1,x+=$,_-=$):(M=0,x=_=(f+g)/2)}var L=p*mr(x),D=p*an(x),B=h*mr(b),Q=h*an(b);if(R>se){var W=p*mr(_),j=p*an(_),Z=h*mr(E),ut=h*an(E),tt;if(m<os)if(tt=ek(L,D,Z,ut,W,j,B,Q)){var X=L-tt[0],et=D-tt[1],at=W-tt[0],z=j-tt[1],q=1/an(UM((X*at+et*z)/(Jr(X*X+et*et)*Jr(at*at+z*z)))/2),K=Jr(tt[0]*tt[0]+tt[1]*tt[1]);C=uc(R,(h-K)/(q-1)),H=uc(R,(p-K)/(q+1))}else C=H=0}M>se?H>se?(P=so(Z,ut,L,D,p,H,v),U=so(W,j,B,Q,p,H,v),o.moveTo(P.cx+P.x01,P.cy+P.y01),H<R?o.arc(P.cx,P.cy,H,ie(P.y01,P.x01),ie(U.y01,U.x01),!v):(o.arc(P.cx,P.cy,H,ie(P.y01,P.x01),ie(P.y11,P.x11),!v),o.arc(0,0,p,ie(P.cy+P.y11,P.cx+P.x11),ie(U.cy+U.y11,U.cx+U.x11),!v),o.arc(U.cx,U.cy,H,ie(U.y11,U.x11),ie(U.y01,U.x01),!v))):(o.moveTo(L,D),o.arc(0,0,p,x,_,!v)):o.moveTo(L,D),!(h>se)||!(O>se)?o.lineTo(B,Q):C>se?(P=so(B,Q,W,j,h,-C,v),U=so(L,D,Z,ut,h,-C,v),o.lineTo(P.cx+P.x01,P.cy+P.y01),C<R?o.arc(P.cx,P.cy,C,ie(P.y01,P.x01),ie(U.y01,U.x01),!v):(o.arc(P.cx,P.cy,C,ie(P.y01,P.x01),ie(P.y11,P.x11),!v),o.arc(0,0,h,ie(P.cy+P.y11,P.cx+P.x11),ie(U.cy+U.y11,U.cx+U.x11),v),o.arc(U.cx,U.cy,C,ie(U.y11,U.x11),ie(U.y01,U.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-os/2;return[mr(d)*u,an(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ft(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ft(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ft(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ft(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ft(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ft(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ft(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}function eu(e){return e[0]}function nu(e){return e[1]}function Os(e,t){var n=ft(!0),r=null,i=Aa,s=null,a=io(o);e=typeof e=="function"?e:e===void 0?eu:ft(e),t=typeof t=="function"?t:t===void 0?nu:ft(t);function o(l){var c,u=(l=Ea(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:ft(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ft(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ft(!!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 ru(e,t,n){var r=null,i=ft(!0),s=null,a=Aa,o=null,l=io(c);e=typeof e=="function"?e:e===void 0?eu:ft(+e),t=typeof t=="function"?t:ft(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?nu:ft(+n);function c(d){var h,p,f,g=(d=Ea(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 Os().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:ft(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:ft(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:ft(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:ft(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:ft(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:ft(+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:ft(!!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 nk(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function rk(e){return e}function ik(){var e=rk,t=nk,n=null,r=ft(0),i=ft(Ca),s=ft(0);function a(o){var l,c=(o=Ea(o)).length,u,d,h=0,p=new Array(c),f=new Array(c),g=+r.apply(this,arguments),m=Math.min(Ca,Math.max(-Ca,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,O){return t(f[b],f[O])}):n!=null&&p.sort(function(b,O){return n(o[b],o[O])}),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:ft(+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:ft(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ft(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:ft(+o),a):s},a}var sk=fg(Aa);function pg(e){this._curve=e}pg.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 fg(e){function t(n){return new pg(e(n))}return t._curve=e,t}function ak(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(fg(n)):t()._curve},e}function ok(){return ak(Os().curve(sk))}class lk{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 ck(e){return new lk(e,!0)}function uk(e){return e.source}function hk(e){return e.target}function dk(e){let t=uk,n=hk,r=eu,i=nu,s=null,a=null,o=io(l);function l(){let c;const u=kw.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:ft(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:ft(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function pk(){return dk(ck)}let gt=class{constructor(t,n,r){if(this.type="",this.renderType=rt.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){const n=this.parent;if(this.parent=t,!(n&&n.node()===t.node())&&this.type){const r=y(this.model.getOptions(),"style","prefix");this.parent?.classed(`${ge}--${r}--${this.type}`,!0),n&&n.classed(`${ge}--${r}--${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===rt.SVG?"svg":"div"}${r}.${ge}--${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");if(a.size()!==0){const o=parseFloat(a.attr("height")),l=parseFloat(a.attr("width"));!isNaN(o)&&!isNaN(l)&&o>0&&l>0&&i.attr("clip-path",`url(#${s})`)}}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?ot({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};/*! @license DOMPurify 3.4.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.2/LICENSE */const{entries:mg,setPrototypeOf:gg,isFrozen:fk,getPrototypeOf:mk,getOwnPropertyDescriptor:gk}=Object;let{freeze:ue,seal:Ue,create:ci}=Object,{apply:iu,construct:su}=typeof Reflect<"u"&&Reflect;ue||(ue=function(e){return e}),Ue||(Ue=function(e){return e}),iu||(iu=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),su||(su=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const Ss=Yt(Array.prototype.forEach),vk=Yt(Array.prototype.lastIndexOf),vg=Yt(Array.prototype.pop),ws=Yt(Array.prototype.push),yk=Yt(Array.prototype.splice),he=Array.isArray,$s=Yt(String.prototype.toLowerCase),au=Yt(String.prototype.toString),yg=Yt(String.prototype.match),ui=Yt(String.prototype.replace),bg=Yt(String.prototype.indexOf),bk=Yt(String.prototype.trim),xk=Yt(Number.prototype.toString),_k=Yt(Boolean.prototype.toString),xg=typeof BigInt>"u"?null:Yt(BigInt.prototype.toString),_g=typeof Symbol>"u"?null:Yt(Symbol.prototype.toString),Vt=Yt(Object.prototype.hasOwnProperty),Ms=Yt(Object.prototype.toString),ee=Yt(RegExp.prototype.test),ao=Ek(TypeError);function Yt(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 iu(e,t,r)}}function Ek(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return su(e,n)}}function pt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$s;if(gg&&gg(e,null),!he(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(fk(t)||(t[r]=s),i=s)}e[i]=!0}return e}function Tk(e){for(let t=0;t<e.length;t++)Vt(e,t)||(e[t]=null);return e}function be(e){const t=ci(null);for(const[n,r]of mg(e))Vt(e,n)&&(he(r)?t[n]=Tk(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=be(r):t[n]=r);return t}function Ok(e){switch(typeof e){case"string":return e;case"number":return xk(e);case"boolean":return _k(e);case"bigint":return xg?xg(e):"0";case"symbol":return _g?_g(e):"Symbol()";case"undefined":return Ms(e);case"function":case"object":{if(e===null)return Ms(e);const t=e,n=hi(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Ms(r)}return Ms(e)}default:return Ms(e)}}function hi(e,t){for(;e!==null;){const r=gk(e,t);if(r){if(r.get)return Yt(r.get);if(typeof r.value=="function")return Yt(r.value)}e=mk(e)}function n(){return null}return n}function Sk(e){try{return ee(e,""),!0}catch{return!1}}const Eg=ue(["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","search","section","select","shadow","slot","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"]),ou=ue(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),lu=ue(["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"]),wk=ue(["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"]),cu=ue(["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"]),$k=ue(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Tg=ue(["#text"]),Og=ue(["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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),uu=ue(["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","mask-type","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"]),Sg=ue(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),oo=ue(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Mk=Ue(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ck=Ue(/<%[\w\W]*|[\w\W]*%>/gm),Ak=Ue(/\$\{[\w\W]*/gm),Lk=Ue(/^data-[\-\w.\u00B7-\uFFFF]+$/),kk=Ue(/^aria-[\-\w]+$/),wg=Ue(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Dk=Ue(/^(?:\w+script|data):/i),Rk=Ue(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$g=Ue(/^html$/i),Ik=Ue(/^[a-z][.\w]*(-[.\w]+)+$/i);var Mg=Object.freeze({__proto__:null,ARIA_ATTR:kk,ATTR_WHITESPACE:Rk,CUSTOM_ELEMENT:Ik,DATA_ATTR:Lk,DOCTYPE_NAME:$g,ERB_EXPR:Ck,IS_ALLOWED_URI:wg,IS_SCRIPT_OR_DATA:Dk,MUSTACHE_EXPR:Mk,TMPLIT_EXPR:Ak});const Cs={element:1,text:3,progressingInstruction:7,comment:8,document:9},Nk=function(){return typeof window>"u"?null:window},Pk=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}},Cg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ag(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nk();const t=w=>Ag(w);if(t.version="3.4.2",t.removed=[],!e||!e.document||e.document.nodeType!==Cs.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=hi(f,"cloneNode"),m=hi(f,"remove"),v=hi(f,"nextSibling"),x=hi(f,"childNodes"),_=hi(f,"parentNode");if(typeof a=="function"){const w=n.createElement("template");w.content&&w.content.ownerDocument&&(n=w.content.ownerDocument)}let E,b="";const{implementation:O,createNodeIterator:M,createDocumentFragment:k,getElementsByTagName:A}=n,{importNode:R}=r;let C=Cg();t.isSupported=typeof mg=="function"&&typeof _=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:P,TMPLIT_EXPR:U,DATA_ATTR:T,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:B}=Mg;let{IS_ALLOWED_URI:Q}=Mg,W=null;const j=pt({},[...Eg,...ou,...lu,...cu,...Tg]);let Z=null;const ut=pt({},[...Og,...uu,...Sg,...oo]);let tt=Object.seal(ci(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}})),X=null,et=null;const at=Object.seal(ci(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let z=!0,q=!0,K=!1,F=!0,ht=!1,lt=!0,Mt=!1,Gt=!1,it=!1,bt=!1,He=!1,pe=!1,ks=!0,gi=!1;const vi="user-content-";let Rn=!0,Ds=!1,yi={},hn=null;const Iu=pt({},["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 Xv=null;const Zv=pt({},["audio","video","img","source","image","track"]);let Nu=null;const Kv=pt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Eo="http://www.w3.org/1998/Math/MathML",To="http://www.w3.org/2000/svg",dn="http://www.w3.org/1999/xhtml";let bi=dn,Pu=!1,Bu=null;const mB=pt({},[Eo,To,dn],au);let Uu=pt({},["mi","mo","mn","ms","mtext"]),Hu=pt({},["annotation-xml"]);const gB=pt({},["title","style","font","a","script"]);let Rs=null;const vB=["application/xhtml+xml","text/html"],yB="text/html";let Zt=null,xi=null;const bB=n.createElement("form"),Qv=function(w){return w instanceof RegExp||w instanceof Function},Vu=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(xi&&xi===w)return;(!w||typeof w!="object")&&(w={}),w=be(w),Rs=vB.indexOf(w.PARSER_MEDIA_TYPE)===-1?yB:w.PARSER_MEDIA_TYPE,Zt=Rs==="application/xhtml+xml"?au:$s,W=Vt(w,"ALLOWED_TAGS")&&he(w.ALLOWED_TAGS)?pt({},w.ALLOWED_TAGS,Zt):j,Z=Vt(w,"ALLOWED_ATTR")&&he(w.ALLOWED_ATTR)?pt({},w.ALLOWED_ATTR,Zt):ut,Bu=Vt(w,"ALLOWED_NAMESPACES")&&he(w.ALLOWED_NAMESPACES)?pt({},w.ALLOWED_NAMESPACES,au):mB,Nu=Vt(w,"ADD_URI_SAFE_ATTR")&&he(w.ADD_URI_SAFE_ATTR)?pt(be(Kv),w.ADD_URI_SAFE_ATTR,Zt):Kv,Xv=Vt(w,"ADD_DATA_URI_TAGS")&&he(w.ADD_DATA_URI_TAGS)?pt(be(Zv),w.ADD_DATA_URI_TAGS,Zt):Zv,hn=Vt(w,"FORBID_CONTENTS")&&he(w.FORBID_CONTENTS)?pt({},w.FORBID_CONTENTS,Zt):Iu,X=Vt(w,"FORBID_TAGS")&&he(w.FORBID_TAGS)?pt({},w.FORBID_TAGS,Zt):be({}),et=Vt(w,"FORBID_ATTR")&&he(w.FORBID_ATTR)?pt({},w.FORBID_ATTR,Zt):be({}),yi=Vt(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?be(w.USE_PROFILES):w.USE_PROFILES:!1,z=w.ALLOW_ARIA_ATTR!==!1,q=w.ALLOW_DATA_ATTR!==!1,K=w.ALLOW_UNKNOWN_PROTOCOLS||!1,F=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ht=w.SAFE_FOR_TEMPLATES||!1,lt=w.SAFE_FOR_XML!==!1,Mt=w.WHOLE_DOCUMENT||!1,bt=w.RETURN_DOM||!1,He=w.RETURN_DOM_FRAGMENT||!1,pe=w.RETURN_TRUSTED_TYPE||!1,it=w.FORCE_BODY||!1,ks=w.SANITIZE_DOM!==!1,gi=w.SANITIZE_NAMED_PROPS||!1,Rn=w.KEEP_CONTENT!==!1,Ds=w.IN_PLACE||!1,Q=Sk(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:wg,bi=typeof w.NAMESPACE=="string"?w.NAMESPACE:dn,Uu=Vt(w,"MATHML_TEXT_INTEGRATION_POINTS")&&w.MATHML_TEXT_INTEGRATION_POINTS&&typeof w.MATHML_TEXT_INTEGRATION_POINTS=="object"?be(w.MATHML_TEXT_INTEGRATION_POINTS):pt({},["mi","mo","mn","ms","mtext"]),Hu=Vt(w,"HTML_INTEGRATION_POINTS")&&w.HTML_INTEGRATION_POINTS&&typeof w.HTML_INTEGRATION_POINTS=="object"?be(w.HTML_INTEGRATION_POINTS):pt({},["annotation-xml"]);const Y=Vt(w,"CUSTOM_ELEMENT_HANDLING")&&w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING=="object"?be(w.CUSTOM_ELEMENT_HANDLING):ci(null);if(tt=ci(null),Vt(Y,"tagNameCheck")&&Qv(Y.tagNameCheck)&&(tt.tagNameCheck=Y.tagNameCheck),Vt(Y,"attributeNameCheck")&&Qv(Y.attributeNameCheck)&&(tt.attributeNameCheck=Y.attributeNameCheck),Vt(Y,"allowCustomizedBuiltInElements")&&typeof Y.allowCustomizedBuiltInElements=="boolean"&&(tt.allowCustomizedBuiltInElements=Y.allowCustomizedBuiltInElements),ht&&(q=!1),He&&(bt=!0),yi&&(W=pt({},Tg),Z=ci(null),yi.html===!0&&(pt(W,Eg),pt(Z,Og)),yi.svg===!0&&(pt(W,ou),pt(Z,uu),pt(Z,oo)),yi.svgFilters===!0&&(pt(W,lu),pt(Z,uu),pt(Z,oo)),yi.mathMl===!0&&(pt(W,cu),pt(Z,Sg),pt(Z,oo))),at.tagCheck=null,at.attributeCheck=null,Vt(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?at.tagCheck=w.ADD_TAGS:he(w.ADD_TAGS)&&(W===j&&(W=be(W)),pt(W,w.ADD_TAGS,Zt))),Vt(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?at.attributeCheck=w.ADD_ATTR:he(w.ADD_ATTR)&&(Z===ut&&(Z=be(Z)),pt(Z,w.ADD_ATTR,Zt))),Vt(w,"ADD_URI_SAFE_ATTR")&&he(w.ADD_URI_SAFE_ATTR)&&pt(Nu,w.ADD_URI_SAFE_ATTR,Zt),Vt(w,"FORBID_CONTENTS")&&he(w.FORBID_CONTENTS)&&(hn===Iu&&(hn=be(hn)),pt(hn,w.FORBID_CONTENTS,Zt)),Vt(w,"ADD_FORBID_CONTENTS")&&he(w.ADD_FORBID_CONTENTS)&&(hn===Iu&&(hn=be(hn)),pt(hn,w.ADD_FORBID_CONTENTS,Zt)),Rn&&(W["#text"]=!0),Mt&&pt(W,["html","head","body"]),W.table&&(pt(W,["tbody"]),delete X.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw ao('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ao('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=w.TRUSTED_TYPES_POLICY,b=E.createHTML("")}else E===void 0&&(E=Pk(p,i)),E!==null&&typeof b=="string"&&(b=E.createHTML(""));ue&&ue(w),xi=w},Jv=pt({},[...ou,...lu,...wk]),t1=pt({},[...cu,...$k]),xB=function(w){let Y=_(w);(!Y||!Y.tagName)&&(Y={namespaceURI:bi,tagName:"template"});const J=$s(w.tagName),wt=$s(Y.tagName);return Bu[w.namespaceURI]?w.namespaceURI===To?Y.namespaceURI===dn?J==="svg":Y.namespaceURI===Eo?J==="svg"&&(wt==="annotation-xml"||Uu[wt]):!!Jv[J]:w.namespaceURI===Eo?Y.namespaceURI===dn?J==="math":Y.namespaceURI===To?J==="math"&&Hu[wt]:!!t1[J]:w.namespaceURI===dn?Y.namespaceURI===To&&!Hu[wt]||Y.namespaceURI===Eo&&!Uu[wt]?!1:!t1[J]&&(gB[J]||!Jv[J]):!!(Rs==="application/xhtml+xml"&&Bu[w.namespaceURI]):!1},Tr=function(w){ws(t.removed,{element:w});try{_(w).removeChild(w)}catch{m(w)}},Or=function(w,Y){try{ws(t.removed,{attribute:Y.getAttributeNode(w),from:Y})}catch{ws(t.removed,{attribute:null,from:Y})}if(Y.removeAttribute(w),w==="is")if(bt||He)try{Tr(Y)}catch{}else try{Y.setAttribute(w,"")}catch{}},e1=function(w){let Y=null,J=null;if(it)w="<remove></remove>"+w;else{const Pt=yg(w,/^[\r\n\t ]+/);J=Pt&&Pt[0]}Rs==="application/xhtml+xml"&&bi===dn&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");const wt=E?E.createHTML(w):w;if(bi===dn)try{Y=new h().parseFromString(wt,Rs)}catch{}if(!Y||!Y.documentElement){Y=O.createDocument(bi,"template",null);try{Y.documentElement.innerHTML=Pu?b:wt}catch{}}const ne=Y.body||Y.documentElement;return w&&J&&ne.insertBefore(n.createTextNode(J),ne.childNodes[0]||null),bi===dn?A.call(Y,Mt?"html":"body")[0]:Mt?Y.documentElement:ne},n1=function(w){return M.call(w.ownerDocument||w,w,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Gu=function(w){return w instanceof d&&(typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||!(w.attributes instanceof u)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function")},Fu=function(w){return typeof o=="function"&&w instanceof o};function In(w,Y,J){Ss(w,wt=>{wt.call(t,Y,J,xi)})}const r1=function(w){let Y=null;if(In(C.beforeSanitizeElements,w,null),Gu(w))return Tr(w),!0;const J=Zt(w.nodeName);if(In(C.uponSanitizeElement,w,{tagName:J,allowedTags:W}),lt&&w.hasChildNodes()&&!Fu(w.firstElementChild)&&ee(/<[/\w!]/g,w.innerHTML)&&ee(/<[/\w!]/g,w.textContent)||lt&&w.namespaceURI===dn&&J==="style"&&Fu(w.firstElementChild)||w.nodeType===Cs.progressingInstruction||lt&&w.nodeType===Cs.comment&&ee(/<[/\w]/g,w.data))return Tr(w),!0;if(X[J]||!(at.tagCheck instanceof Function&&at.tagCheck(J))&&!W[J]){if(!X[J]&&s1(J)&&(tt.tagNameCheck instanceof RegExp&&ee(tt.tagNameCheck,J)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(J)))return!1;if(Rn&&!hn[J]){const wt=_(w)||w.parentNode,ne=x(w)||w.childNodes;if(ne&&wt){const Pt=ne.length;for(let Nn=Pt-1;Nn>=0;--Nn){const pn=g(ne[Nn],!0);wt.insertBefore(pn,v(w))}}}return Tr(w),!0}return w instanceof l&&!xB(w)||(J==="noscript"||J==="noembed"||J==="noframes")&&ee(/<\/no(script|embed|frames)/i,w.innerHTML)?(Tr(w),!0):(ht&&w.nodeType===Cs.text&&(Y=w.textContent,Ss([H,P,U],wt=>{Y=ui(Y,wt," ")}),w.textContent!==Y&&(ws(t.removed,{element:w.cloneNode()}),w.textContent=Y)),In(C.afterSanitizeElements,w,null),!1)},i1=function(w,Y,J){if(et[Y]||ks&&(Y==="id"||Y==="name")&&(J in n||J in bB))return!1;const wt=Z[Y]||at.attributeCheck instanceof Function&&at.attributeCheck(Y,w);if(!(q&&!et[Y]&&ee(T,Y))&&!(z&&ee($,Y))){if(!wt||et[Y]){if(!(s1(w)&&(tt.tagNameCheck instanceof RegExp&&ee(tt.tagNameCheck,w)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(w))&&(tt.attributeNameCheck instanceof RegExp&&ee(tt.attributeNameCheck,Y)||tt.attributeNameCheck instanceof Function&&tt.attributeNameCheck(Y,w))||Y==="is"&&tt.allowCustomizedBuiltInElements&&(tt.tagNameCheck instanceof RegExp&&ee(tt.tagNameCheck,J)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(J))))return!1}else if(!Nu[Y]&&!ee(Q,ui(J,D,""))&&!((Y==="src"||Y==="xlink:href"||Y==="href")&&w!=="script"&&bg(J,"data:")===0&&Xv[w])&&!(K&&!ee(L,ui(J,D,"")))&&J)return!1}return!0},_B=pt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),s1=function(w){return!_B[$s(w)]&&ee(B,w)},a1=function(w){In(C.beforeSanitizeAttributes,w,null);const{attributes:Y}=w;if(!Y||Gu(w))return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let wt=Y.length;for(;wt--;){const ne=Y[wt],{name:Pt,namespaceURI:Nn,value:pn}=ne,fe=Zt(Pt),qn=pn;let Qt=Pt==="value"?qn:bk(qn);if(J.attrName=fe,J.attrValue=Qt,J.keepAttr=!0,J.forceKeepAttr=void 0,In(C.uponSanitizeAttribute,w,J),Qt=J.attrValue,gi&&(fe==="id"||fe==="name")&&bg(Qt,vi)!==0&&(Or(Pt,w),Qt=vi+Qt),lt&&ee(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Qt)){Or(Pt,w);continue}if(fe==="attributename"&&yg(Qt,"href")){Or(Pt,w);continue}if(J.forceKeepAttr)continue;if(!J.keepAttr){Or(Pt,w);continue}if(!F&&ee(/\/>/i,Qt)){Or(Pt,w);continue}ht&&Ss([H,P,U],EB=>{Qt=ui(Qt,EB," ")});const l1=Zt(w.nodeName);if(!i1(l1,fe,Qt)){Or(Pt,w);continue}if(E&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Nn)switch(p.getAttributeType(l1,fe)){case"TrustedHTML":{Qt=E.createHTML(Qt);break}case"TrustedScriptURL":{Qt=E.createScriptURL(Qt);break}}if(Qt!==qn)try{Nn?w.setAttributeNS(Nn,Pt,Qt):w.setAttribute(Pt,Qt),Gu(w)?Tr(w):vg(t.removed)}catch{Or(Pt,w)}}In(C.afterSanitizeAttributes,w,null)},o1=function(w){let Y=null;const J=n1(w);for(In(C.beforeSanitizeShadowDOM,w,null);Y=J.nextNode();)In(C.uponSanitizeShadowNode,Y,null),r1(Y),a1(Y),Y.content instanceof s&&o1(Y.content);In(C.afterSanitizeShadowDOM,w,null)};return t.sanitize=function(w){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=null,wt=null,ne=null,Pt=null;if(Pu=!w,Pu&&(w="<!-->"),typeof w!="string"&&!Fu(w)&&(w=Ok(w),typeof w!="string"))throw ao("dirty is not a string, aborting");if(!t.isSupported)return w;if(Gt||Vu(Y),t.removed=[],typeof w=="string"&&(Ds=!1),Ds){const fe=w.nodeName;if(typeof fe=="string"){const qn=Zt(fe);if(!W[qn]||X[qn])throw ao("root node is forbidden and cannot be sanitized in-place")}}else if(w instanceof o)J=e1("<!---->"),wt=J.ownerDocument.importNode(w,!0),wt.nodeType===Cs.element&&wt.nodeName==="BODY"||wt.nodeName==="HTML"?J=wt:J.appendChild(wt);else{if(!bt&&!ht&&!Mt&&w.indexOf("<")===-1)return E&&pe?E.createHTML(w):w;if(J=e1(w),!J)return bt?null:pe?b:""}J&&it&&Tr(J.firstChild);const Nn=n1(Ds?w:J);for(;ne=Nn.nextNode();)r1(ne),a1(ne),ne.content instanceof s&&o1(ne.content);if(Ds)return w;if(bt){if(ht){J.normalize();let fe=J.innerHTML;Ss([H,P,U],qn=>{fe=ui(fe,qn," ")}),J.innerHTML=fe}if(He)for(Pt=k.call(J.ownerDocument);J.firstChild;)Pt.appendChild(J.firstChild);else Pt=J;return(Z.shadowroot||Z.shadowrootmode)&&(Pt=R.call(r,Pt,!0)),Pt}let pn=Mt?J.outerHTML:J.innerHTML;return Mt&&W["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&ee($g,J.ownerDocument.doctype.name)&&(pn="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
4
- `+pn),ht&&Ss([H,P,U],fe=>{pn=ui(pn,fe," ")}),E&&pe?E.createHTML(pn):pn},t.setConfig=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vu(w),Gt=!0},t.clearConfig=function(){xi=null,Gt=!1},t.isValidAttribute=function(w,Y,J){xi||Vu({});const wt=Zt(w),ne=Zt(Y);return i1(wt,ne,J)},t.addHook=function(w,Y){typeof Y=="function"&&ws(C[w],Y)},t.removeHook=function(w,Y){if(Y!==void 0){const J=vk(C[w],Y);return J===-1?void 0:yk(C[w],J,1)[0]}return vg(C[w])},t.removeHooks=function(w){C[w]=[]},t.removeAllHooks=function(){C=Cg()},t}var hu=Ag();const lo=e=>hu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),Bk=e=>hu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),cn=e=>hu.sanitize(e,{ALLOWED_TAGS:[]}),Lg=class u1 extends gt{constructor(){super(...arguments),this.type="toolbar",this.renderType=rt.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(S.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(S.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=>`
1
+ (function(F,xt){typeof exports=="object"&&typeof module<"u"?xt(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],xt):(F=typeof globalThis<"u"?globalThis:F||self,xt(F.ChartsReact={},F.React))})(this,function(F,xt){"use strict";var wo=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(wo||{}),So=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(So||{}),$o=(e=>(e.UPDATE="model-update",e))($o||{}),ju=(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))(ju||{}),Mo=(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))(Mo||{}),Co=(e=>(e.CHANGE="zoom-domain-change",e))(Co||{}),Ao=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Ao||{}),Lo=(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))(Lo||{}),Do=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Do||{}),ko=(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))(ko||{}),Ro=(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))(Ro||{}),Io=(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))(Io||{}),No=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(No||{}),Po=(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))(Po||{}),Uo=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Uo||{}),Bo=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Bo||{}),Ho=(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))(Ho||{}),Vo=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Vo||{}),Go=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Go||{}),wr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(wr||{}),Fo=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Fo||{}),Wu=(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))(Wu||{}),qu=(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))(qu||{}),Yu=(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))(Yu||{}),Zu=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Zu||{}),Xu=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Xu||{}),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 d1=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Yu,Area:Do,Axis:Lo,Bar:No,Boxplot:Po,CanvasZoom:Ao,Chart:wo,Choropleth:Sr,CirclePack:qu,Gauge:Io,Heatmap:Xu,Legend:Wu,Line:Bo,Meter:Zu,Modal:So,Model:$o,Pie:Ro,Radar:Ho,Scatter:Uo,Threshold:Fo,Toolbar:ju,Tooltip:wr,Tree:Vo,Treemap:Go,WordCloud:ko,ZoomBar:Mo,ZoomDomain:Co},Symbol.toStringTag,{value:"Module"})),T=d1;var rt=(e=>(e.HTML="html",e.SVG="svg",e))(rt||{}),zo=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(zo||{}),st=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(st||{}),G=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(G||{}),Ve=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ve||{}),Ae=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Ae||{}),zt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(zt||{}),nt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(nt||{}),$r=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))($r||{}),jt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(jt||{}),Mr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Mr||{}),Is=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Is||{}),Ct=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Ct||{}),ct=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ct||{}),Yn=(e=>(e.CENTER="center",e))(Yn||{}),_i=(e=>(e.LEFT="left",e.RIGHT="right",e))(_i||{}),Wt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Wt||{}),Qe=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Qe||{}),Je=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Je||{}),Zn=(e=>(e.SEMI="semi",e.FULL="full",e))(Zn||{}),Ns=(e=>(e.UP="up",e.DOWN="down",e))(Ns||{}),Ei=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Ei||{}),Oi=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Oi||{}),Ee=(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))(Ee||{}),_t=(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))(_t||{}),Ps=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ps||{}),qt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(qt||{}),Ti=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Ti||{}),Cr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Cr||{}),wi=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(wi||{}),tn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(tn||{}),Ku=(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))(Ku||{});function jo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function Si(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=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 $i(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)?f1(o,h=>h.test(a)):p1(o,h=>h.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 p1(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function f1(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function m1(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 Qu=6048e5,g1=864e5,Ju=6e4,th=36e5,eh=Symbol.for("constructDateFrom");function Le(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&eh in e?e[eh](t):e instanceof Date?new e.constructor(t):new Date(t)}function Xn(e,...t){const n=Le.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}let v1={};function Us(){return v1}function Ut(e,t){return Le(t||e,e)}function Mi(e,t){const n=Us(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Ut(e,t?.in),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}const y1={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"}},b1=(e,t,n)=>{let r;const i=y1[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},x1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_1=(e,t,n,r)=>x1[e],E1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},O1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},T1={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"]},w1={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"]},S1={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"}},$1={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"}},M1=(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"},C1={ordinalNumber:M1,era:Si({values:E1,defaultWidth:"wide"}),quarter:Si({values:O1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Si({values:T1,defaultWidth:"wide"}),day:Si({values:w1,defaultWidth:"wide"}),dayPeriod:Si({values:S1,defaultWidth:"wide",formattingValues:$1,defaultFormattingWidth:"wide"})},A1=/^(\d+)(th|st|nd|rd)?/i,L1=/\d+/i,D1={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},k1={any:[/^b/i,/^(a|c)/i]},R1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},I1={any:[/1/i,/2/i,/3/i,/4/i]},N1={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},P1={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]},U1={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},B1={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]},H1={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},V1={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}},G1={ordinalNumber:m1({matchPattern:A1,parsePattern:L1,valueCallback:e=>parseInt(e,10)}),era:$i({matchPatterns:D1,defaultMatchWidth:"wide",parsePatterns:k1,defaultParseWidth:"any"}),quarter:$i({matchPatterns:R1,defaultMatchWidth:"wide",parsePatterns:I1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:$i({matchPatterns:N1,defaultMatchWidth:"wide",parsePatterns:P1,defaultParseWidth:"any"}),day:$i({matchPatterns:U1,defaultMatchWidth:"wide",parsePatterns:B1,defaultParseWidth:"any"}),dayPeriod:$i({matchPatterns:H1,defaultMatchWidth:"any",parsePatterns:V1,defaultParseWidth:"any"})},F1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},z1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},j1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},W1={date:jo({formats:F1,defaultWidth:"full"}),time:jo({formats:z1,defaultWidth:"full"}),dateTime:jo({formats:j1,defaultWidth:"full"})},nh={code:"en-US",formatDistance:b1,formatLong:W1,formatRelative:_1,localize:C1,match:G1,options:{weekStartsOn:0,firstWeekContainsDate:1}};var rh=typeof global=="object"&&global&&global.Object===Object&&global,q1=typeof self=="object"&&self&&self.Object===Object&&self,Ge=rh||q1||Function("return this")(),De=Ge.Symbol,ih=Object.prototype,Y1=ih.hasOwnProperty,Z1=ih.toString,Ci=De?De.toStringTag:void 0;function X1(e){var t=Y1.call(e,Ci),n=e[Ci];try{e[Ci]=void 0;var r=!0}catch{}var i=Z1.call(e);return r&&(t?e[Ci]=n:delete e[Ci]),i}var K1=Object.prototype,Q1=K1.toString;function J1(e){return Q1.call(e)}var t0="[object Null]",e0="[object Undefined]",sh=De?De.toStringTag:void 0;function Kn(e){return e==null?e===void 0?e0:t0:sh&&sh in Object(e)?X1(e):J1(e)}function en(e){return e!=null&&typeof e=="object"}var n0="[object Symbol]";function Bs(e){return typeof e=="symbol"||en(e)&&Kn(e)==n0}function Wo(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 Jt=Array.isArray,ah=De?De.prototype:void 0,oh=ah?ah.toString:void 0;function lh(e){if(typeof e=="string")return e;if(Jt(e))return Wo(e,lh)+"";if(Bs(e))return oh?oh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function ke(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function qo(e){return e}var r0="[object AsyncFunction]",i0="[object Function]",s0="[object GeneratorFunction]",a0="[object Proxy]";function Yo(e){if(!ke(e))return!1;var t=Kn(e);return t==i0||t==s0||t==r0||t==a0}var Zo=Ge["__core-js_shared__"],ch=function(){var e=/[^.]+$/.exec(Zo&&Zo.keys&&Zo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function o0(e){return!!ch&&ch in e}var l0=Function.prototype,c0=l0.toString;function Qn(e){if(e!=null){try{return c0.call(e)}catch{}try{return e+""}catch{}}return""}var u0=/[\\^$.*+?()[\]{}|]/g,h0=/^\[object .+?Constructor\]$/,d0=Function.prototype,p0=Object.prototype,f0=d0.toString,m0=p0.hasOwnProperty,g0=RegExp("^"+f0.call(m0).replace(u0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v0(e){if(!ke(e)||o0(e))return!1;var t=Yo(e)?g0:h0;return t.test(Qn(e))}function y0(e,t){return e?.[t]}function Jn(e,t){var n=y0(e,t);return v0(n)?n:void 0}var Xo=Jn(Ge,"WeakMap"),uh=Object.create,b0=function(){function e(){}return function(t){if(!ke(t))return{};if(uh)return uh(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function x0(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 _0(){}function hh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var E0=800,O0=16,T0=Date.now;function w0(e){var t=0,n=0;return function(){var r=T0(),i=O0-(r-n);if(n=r,i>0){if(++t>=E0)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function S0(e){return function(){return e}}var Hs=function(){try{var e=Jn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),$0=Hs?function(e,t){return Hs(e,"toString",{configurable:!0,enumerable:!1,value:S0(t),writable:!0})}:qo,dh=w0($0);function M0(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function C0(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 A0(e){return e!==e}function L0(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function D0(e,t,n){return t===t?L0(e,t,n):C0(e,A0,n)}function k0(e,t){var n=e==null?0:e.length;return!!n&&D0(e,t,0)>-1}var R0=9007199254740991,I0=/^(?:0|[1-9]\d*)$/;function Ko(e,t){var n=typeof e;return t=t??R0,!!t&&(n=="number"||n!="symbol"&&I0.test(e))&&e>-1&&e%1==0&&e<t}function Ai(e,t,n){t=="__proto__"&&Hs?Hs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Li(e,t){return e===t||e!==e&&t!==t}var N0=Object.prototype,P0=N0.hasOwnProperty;function ph(e,t,n){var r=e[t];(!(P0.call(e,t)&&Li(r,n))||n===void 0&&!(t in e))&&Ai(e,t,n)}function Ar(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?Ai(n,o,l):ph(n,o,l)}return n}var fh=Math.max;function mh(e,t,n){return t=fh(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=fh(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),x0(e,this,o)}}function Qo(e,t){return dh(mh(e,t,qo),e+"")}var U0=9007199254740991;function Jo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=U0}function tr(e){return e!=null&&Jo(e.length)&&!Yo(e)}function B0(e,t,n){if(!ke(n))return!1;var r=typeof t;return(r=="number"?tr(n)&&Ko(t,n.length):r=="string"&&t in n)?Li(n[t],e):!1}function H0(e){return Qo(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&&B0(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 V0=Object.prototype;function Vs(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||V0;return e===n}function G0(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var F0="[object Arguments]";function gh(e){return en(e)&&Kn(e)==F0}var vh=Object.prototype,z0=vh.hasOwnProperty,j0=vh.propertyIsEnumerable,Lr=gh(function(){return arguments}())?gh:function(e){return en(e)&&z0.call(e,"callee")&&!j0.call(e,"callee")};function W0(){return!1}var yh=typeof F=="object"&&F&&!F.nodeType&&F,bh=yh&&typeof module=="object"&&module&&!module.nodeType&&module,q0=bh&&bh.exports===yh,xh=q0?Ge.Buffer:void 0,Y0=xh?xh.isBuffer:void 0,Dr=Y0||W0,Z0="[object Arguments]",X0="[object Array]",K0="[object Boolean]",Q0="[object Date]",J0="[object Error]",ty="[object Function]",ey="[object Map]",ny="[object Number]",ry="[object Object]",iy="[object RegExp]",sy="[object Set]",ay="[object String]",oy="[object WeakMap]",ly="[object ArrayBuffer]",cy="[object DataView]",uy="[object Float32Array]",hy="[object Float64Array]",dy="[object Int8Array]",py="[object Int16Array]",fy="[object Int32Array]",my="[object Uint8Array]",gy="[object Uint8ClampedArray]",vy="[object Uint16Array]",yy="[object Uint32Array]",kt={};kt[uy]=kt[hy]=kt[dy]=kt[py]=kt[fy]=kt[my]=kt[gy]=kt[vy]=kt[yy]=!0,kt[Z0]=kt[X0]=kt[ly]=kt[K0]=kt[cy]=kt[Q0]=kt[J0]=kt[ty]=kt[ey]=kt[ny]=kt[ry]=kt[iy]=kt[sy]=kt[ay]=kt[oy]=!1;function by(e){return en(e)&&Jo(e.length)&&!!kt[Kn(e)]}function tl(e){return function(t){return e(t)}}var _h=typeof F=="object"&&F&&!F.nodeType&&F,Di=_h&&typeof module=="object"&&module&&!module.nodeType&&module,xy=Di&&Di.exports===_h,el=xy&&rh.process,kr=function(){try{var e=Di&&Di.require&&Di.require("util").types;return e||el&&el.binding&&el.binding("util")}catch{}}(),Eh=kr&&kr.isTypedArray,Gs=Eh?tl(Eh):by,_y=Object.prototype,Ey=_y.hasOwnProperty;function Oh(e,t){var n=Jt(e),r=!n&&Lr(e),i=!n&&!r&&Dr(e),s=!n&&!r&&!i&&Gs(e),a=n||r||i||s,o=a?G0(e.length,String):[],l=o.length;for(var c in e)(t||Ey.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ko(c,l)))&&o.push(c);return o}function Th(e,t){return function(n){return e(t(n))}}var Oy=Th(Object.keys,Object),Ty=Object.prototype,wy=Ty.hasOwnProperty;function wh(e){if(!Vs(e))return Oy(e);var t=[];for(var n in Object(e))wy.call(e,n)&&n!="constructor"&&t.push(n);return t}function ki(e){return tr(e)?Oh(e):wh(e)}function Sy(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var $y=Object.prototype,My=$y.hasOwnProperty;function Cy(e){if(!ke(e))return Sy(e);var t=Vs(e),n=[];for(var r in e)r=="constructor"&&(t||!My.call(e,r))||n.push(r);return n}function Ri(e){return tr(e)?Oh(e,!0):Cy(e)}var Ay=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ly=/^\w*$/;function nl(e,t){if(Jt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Bs(e)?!0:Ly.test(e)||!Ay.test(e)||t!=null&&e in Object(t)}var Ii=Jn(Object,"create");function Dy(){this.__data__=Ii?Ii(null):{},this.size=0}function ky(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ry="__lodash_hash_undefined__",Iy=Object.prototype,Ny=Iy.hasOwnProperty;function Py(e){var t=this.__data__;if(Ii){var n=t[e];return n===Ry?void 0:n}return Ny.call(t,e)?t[e]:void 0}var Uy=Object.prototype,By=Uy.hasOwnProperty;function Hy(e){var t=this.__data__;return Ii?t[e]!==void 0:By.call(t,e)}var Vy="__lodash_hash_undefined__";function Gy(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ii&&t===void 0?Vy:t,this}function er(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])}}er.prototype.clear=Dy,er.prototype.delete=ky,er.prototype.get=Py,er.prototype.has=Hy,er.prototype.set=Gy;function Fy(){this.__data__=[],this.size=0}function Fs(e,t){for(var n=e.length;n--;)if(Li(e[n][0],t))return n;return-1}var zy=Array.prototype,jy=zy.splice;function Wy(e){var t=this.__data__,n=Fs(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():jy.call(t,n,1),--this.size,!0}function qy(e){var t=this.__data__,n=Fs(t,e);return n<0?void 0:t[n][1]}function Yy(e){return Fs(this.__data__,e)>-1}function Zy(e,t){var n=this.__data__,r=Fs(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function fn(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])}}fn.prototype.clear=Fy,fn.prototype.delete=Wy,fn.prototype.get=qy,fn.prototype.has=Yy,fn.prototype.set=Zy;var Ni=Jn(Ge,"Map");function Xy(){this.size=0,this.__data__={hash:new er,map:new(Ni||fn),string:new er}}function Ky(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function zs(e,t){var n=e.__data__;return Ky(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Qy(e){var t=zs(this,e).delete(e);return this.size-=t?1:0,t}function Jy(e){return zs(this,e).get(e)}function tb(e){return zs(this,e).has(e)}function eb(e,t){var n=zs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function mn(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])}}mn.prototype.clear=Xy,mn.prototype.delete=Qy,mn.prototype.get=Jy,mn.prototype.has=tb,mn.prototype.set=eb;var nb="Expected a function";function rl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(nb);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(rl.Cache||mn),n}rl.Cache=mn;var rb=500;function ib(e){var t=rl(e,function(r){return n.size===rb&&n.clear(),r}),n=t.cache;return t}var sb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ab=/\\(\\)?/g,ob=ib(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(sb,function(n,r,i,s){t.push(i?s.replace(ab,"$1"):r||n)}),t});function Pi(e){return e==null?"":lh(e)}function js(e,t){return Jt(e)?e:nl(e,t)?[e]:ob(Pi(e))}function Rr(e){if(typeof e=="string"||Bs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function il(e,t){t=js(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Rr(t[n++])];return n&&n==r?e:void 0}function vt(e,t,n){var r=e==null?void 0:il(e,t);return r===void 0?n:r}function sl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Sh=De?De.isConcatSpreadable:void 0;function lb(e){return Jt(e)||Lr(e)||!!(Sh&&e&&e[Sh])}function Ws(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=lb),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Ws(o,t-1,n,r,i):sl(i,o):r||(i[i.length]=o)}return i}var al=Th(Object.getPrototypeOf,Object),cb="[object Object]",ub=Function.prototype,hb=Object.prototype,$h=ub.toString,db=hb.hasOwnProperty,pb=$h.call(Object);function Mh(e){if(!en(e)||Kn(e)!=cb)return!1;var t=al(e);if(t===null)return!0;var n=db.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&$h.call(n)==pb}function fb(){this.__data__=new fn,this.size=0}function mb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function gb(e){return this.__data__.get(e)}function vb(e){return this.__data__.has(e)}var yb=200;function bb(e,t){var n=this.__data__;if(n instanceof fn){var r=n.__data__;if(!Ni||r.length<yb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new mn(r)}return n.set(e,t),this.size=n.size,this}function Fe(e){var t=this.__data__=new fn(e);this.size=t.size}Fe.prototype.clear=fb,Fe.prototype.delete=mb,Fe.prototype.get=gb,Fe.prototype.has=vb,Fe.prototype.set=bb;function xb(e,t){return e&&Ar(t,ki(t),e)}function _b(e,t){return e&&Ar(t,Ri(t),e)}var Ch=typeof F=="object"&&F&&!F.nodeType&&F,Ah=Ch&&typeof module=="object"&&module&&!module.nodeType&&module,Eb=Ah&&Ah.exports===Ch,Lh=Eb?Ge.Buffer:void 0,Dh=Lh?Lh.allocUnsafe:void 0;function kh(e,t){if(t)return e.slice();var n=e.length,r=Dh?Dh(n):new e.constructor(n);return e.copy(r),r}function Ob(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 Rh(){return[]}var Tb=Object.prototype,wb=Tb.propertyIsEnumerable,Ih=Object.getOwnPropertySymbols,ol=Ih?function(e){return e==null?[]:(e=Object(e),Ob(Ih(e),function(t){return wb.call(e,t)}))}:Rh;function Sb(e,t){return Ar(e,ol(e),t)}var $b=Object.getOwnPropertySymbols,Nh=$b?function(e){for(var t=[];e;)sl(t,ol(e)),e=al(e);return t}:Rh;function Mb(e,t){return Ar(e,Nh(e),t)}function Ph(e,t,n){var r=t(e);return Jt(e)?r:sl(r,n(e))}function ll(e){return Ph(e,ki,ol)}function Uh(e){return Ph(e,Ri,Nh)}var cl=Jn(Ge,"DataView"),ul=Jn(Ge,"Promise"),Ir=Jn(Ge,"Set"),Bh="[object Map]",Cb="[object Object]",Hh="[object Promise]",Vh="[object Set]",Gh="[object WeakMap]",Fh="[object DataView]",Ab=Qn(cl),Lb=Qn(Ni),Db=Qn(ul),kb=Qn(Ir),Rb=Qn(Xo),Re=Kn;(cl&&Re(new cl(new ArrayBuffer(1)))!=Fh||Ni&&Re(new Ni)!=Bh||ul&&Re(ul.resolve())!=Hh||Ir&&Re(new Ir)!=Vh||Xo&&Re(new Xo)!=Gh)&&(Re=function(e){var t=Kn(e),n=t==Cb?e.constructor:void 0,r=n?Qn(n):"";if(r)switch(r){case Ab:return Fh;case Lb:return Bh;case Db:return Hh;case kb:return Vh;case Rb:return Gh}return t});var Ib=Object.prototype,Nb=Ib.hasOwnProperty;function Pb(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Nb.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var qs=Ge.Uint8Array;function hl(e){var t=new e.constructor(e.byteLength);return new qs(t).set(new qs(e)),t}function Ub(e,t){var n=t?hl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Bb=/\w*$/;function Hb(e){var t=new e.constructor(e.source,Bb.exec(e));return t.lastIndex=e.lastIndex,t}var zh=De?De.prototype:void 0,jh=zh?zh.valueOf:void 0;function Vb(e){return jh?Object(jh.call(e)):{}}function Wh(e,t){var n=t?hl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Gb="[object Boolean]",Fb="[object Date]",zb="[object Map]",jb="[object Number]",Wb="[object RegExp]",qb="[object Set]",Yb="[object String]",Zb="[object Symbol]",Xb="[object ArrayBuffer]",Kb="[object DataView]",Qb="[object Float32Array]",Jb="[object Float64Array]",tx="[object Int8Array]",ex="[object Int16Array]",nx="[object Int32Array]",rx="[object Uint8Array]",ix="[object Uint8ClampedArray]",sx="[object Uint16Array]",ax="[object Uint32Array]";function ox(e,t,n){var r=e.constructor;switch(t){case Xb:return hl(e);case Gb:case Fb:return new r(+e);case Kb:return Ub(e,n);case Qb:case Jb:case tx:case ex:case nx:case rx:case ix:case sx:case ax:return Wh(e,n);case zb:return new r;case jb:case Yb:return new r(e);case Wb:return Hb(e);case qb:return new r;case Zb:return Vb(e)}}function qh(e){return typeof e.constructor=="function"&&!Vs(e)?b0(al(e)):{}}var lx="[object Map]";function cx(e){return en(e)&&Re(e)==lx}var Yh=kr&&kr.isMap,ux=Yh?tl(Yh):cx,hx="[object Set]";function dx(e){return en(e)&&Re(e)==hx}var Zh=kr&&kr.isSet,px=Zh?tl(Zh):dx,fx=1,mx=2,gx=4,Xh="[object Arguments]",vx="[object Array]",yx="[object Boolean]",bx="[object Date]",xx="[object Error]",Kh="[object Function]",_x="[object GeneratorFunction]",Ex="[object Map]",Ox="[object Number]",Qh="[object Object]",Tx="[object RegExp]",wx="[object Set]",Sx="[object String]",$x="[object Symbol]",Mx="[object WeakMap]",Cx="[object ArrayBuffer]",Ax="[object DataView]",Lx="[object Float32Array]",Dx="[object Float64Array]",kx="[object Int8Array]",Rx="[object Int16Array]",Ix="[object Int32Array]",Nx="[object Uint8Array]",Px="[object Uint8ClampedArray]",Ux="[object Uint16Array]",Bx="[object Uint32Array]",Lt={};Lt[Xh]=Lt[vx]=Lt[Cx]=Lt[Ax]=Lt[yx]=Lt[bx]=Lt[Lx]=Lt[Dx]=Lt[kx]=Lt[Rx]=Lt[Ix]=Lt[Ex]=Lt[Ox]=Lt[Qh]=Lt[Tx]=Lt[wx]=Lt[Sx]=Lt[$x]=Lt[Nx]=Lt[Px]=Lt[Ux]=Lt[Bx]=!0,Lt[xx]=Lt[Kh]=Lt[Mx]=!1;function Ui(e,t,n,r,i,s){var a,o=t&fx,l=t&mx,c=t&gx;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!ke(e))return e;var u=Jt(e);if(u){if(a=Pb(e),!o)return hh(e,a)}else{var h=Re(e),d=h==Kh||h==_x;if(Dr(e))return kh(e,o);if(h==Qh||h==Xh||d&&!i){if(a=l||d?{}:qh(e),!o)return l?Mb(e,_b(a,e)):Sb(e,xb(a,e))}else{if(!Lt[h])return i?e:{};a=ox(e,h,o)}}s||(s=new Fe);var p=s.get(e);if(p)return p;s.set(e,a),px(e)?e.forEach(function(m){a.add(Ui(m,t,n,m,e,s))}):ux(e)&&e.forEach(function(m,v){a.set(v,Ui(m,t,n,v,e,s))});var f=c?l?Uh:ll:l?Ri:ki,g=u?void 0:f(e);return M0(g||e,function(m,v){g&&(v=m,m=e[v]),ph(a,v,Ui(m,t,n,v,e,s))}),a}var Hx=1,Vx=4;function gn(e){return Ui(e,Hx|Vx)}var Gx="__lodash_hash_undefined__";function Fx(e){return this.__data__.set(e,Gx),this}function zx(e){return this.__data__.has(e)}function Bi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new mn;++t<n;)this.add(e[t])}Bi.prototype.add=Bi.prototype.push=Fx,Bi.prototype.has=zx;function Jh(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 td(e,t){return e.has(t)}var jx=1,Wx=2;function ed(e,t,n,r,i,s){var a=n&jx,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 h=-1,d=!0,p=n&Wx?new Bi:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var f=e[h],g=t[h];if(r)var m=a?r(g,f,h,t,e,s):r(f,g,h,e,t,s);if(m!==void 0){if(m)continue;d=!1;break}if(p){if(!Jh(t,function(v,b){if(!td(p,b)&&(f===v||i(f,v,n,r,s)))return p.push(b)})){d=!1;break}}else if(!(f===g||i(f,g,n,r,s))){d=!1;break}}return s.delete(e),s.delete(t),d}function qx(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function dl(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Yx=1,Zx=2,Xx="[object Boolean]",Kx="[object Date]",Qx="[object Error]",Jx="[object Map]",t_="[object Number]",e_="[object RegExp]",n_="[object Set]",r_="[object String]",i_="[object Symbol]",s_="[object ArrayBuffer]",a_="[object DataView]",nd=De?De.prototype:void 0,pl=nd?nd.valueOf:void 0;function o_(e,t,n,r,i,s,a){switch(n){case a_:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case s_:return!(e.byteLength!=t.byteLength||!s(new qs(e),new qs(t)));case Xx:case Kx:case t_:return Li(+e,+t);case Qx:return e.name==t.name&&e.message==t.message;case e_:case r_:return e==t+"";case Jx:var o=qx;case n_:var l=r&Yx;if(o||(o=dl),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=Zx,a.set(e,t);var u=ed(o(e),o(t),r,i,s,a);return a.delete(e),u;case i_:if(pl)return pl.call(e)==pl.call(t)}return!1}var l_=1,c_=Object.prototype,u_=c_.hasOwnProperty;function h_(e,t,n,r,i,s){var a=n&l_,o=ll(e),l=o.length,c=ll(t),u=c.length;if(l!=u&&!a)return!1;for(var h=l;h--;){var d=o[h];if(!(a?d in t:u_.call(t,d)))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;++h<l;){d=o[h];var v=e[d],b=t[d];if(r)var _=a?r(b,v,d,t,e,s):r(v,b,d,e,t,s);if(!(_===void 0?v===b||i(v,b,n,r,s):_)){g=!1;break}m||(m=d=="constructor")}if(g&&!m){var E=e.constructor,x=t.constructor;E!=x&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof x=="function"&&x instanceof x)&&(g=!1)}return s.delete(e),s.delete(t),g}var d_=1,rd="[object Arguments]",id="[object Array]",Ys="[object Object]",p_=Object.prototype,sd=p_.hasOwnProperty;function f_(e,t,n,r,i,s){var a=Jt(e),o=Jt(t),l=a?id:Re(e),c=o?id:Re(t);l=l==rd?Ys:l,c=c==rd?Ys:c;var u=l==Ys,h=c==Ys,d=l==c;if(d&&Dr(e)){if(!Dr(t))return!1;a=!0,u=!1}if(d&&!u)return s||(s=new Fe),a||Gs(e)?ed(e,t,n,r,i,s):o_(e,t,l,n,r,i,s);if(!(n&d_)){var p=u&&sd.call(e,"__wrapped__"),f=h&&sd.call(t,"__wrapped__");if(p||f){var g=p?e.value():e,m=f?t.value():t;return s||(s=new Fe),i(g,m,n,r,s)}}return d?(s||(s=new Fe),h_(e,t,n,r,i,s)):!1}function Zs(e,t,n,r,i){return e===t?!0:e==null||t==null||!en(e)&&!en(t)?e!==e&&t!==t:f_(e,t,n,r,Zs,i)}var m_=1,g_=2;function v_(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 Fe,h;if(!(h===void 0?Zs(c,l,m_|g_,r,u):h))return!1}}return!0}function ad(e){return e===e&&!ke(e)}function y_(e){for(var t=ki(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ad(i)]}return t}function od(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function b_(e){var t=y_(e);return t.length==1&&t[0][2]?od(t[0][0],t[0][1]):function(n){return n===e||v_(n,e,t)}}function x_(e,t){return e!=null&&t in Object(e)}function __(e,t,n){t=js(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=Rr(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&&Jo(i)&&Ko(a,i)&&(Jt(e)||Lr(e)))}function E_(e,t){return e!=null&&__(e,t,x_)}var O_=1,T_=2;function w_(e,t){return nl(e)&&ad(t)?od(Rr(e),t):function(n){var r=vt(n,e);return r===void 0&&r===t?E_(n,e):Zs(t,r,O_|T_)}}function S_(e){return function(t){return t?.[e]}}function $_(e){return function(t){return il(t,e)}}function M_(e){return nl(e)?S_(Rr(e)):$_(e)}function Xs(e){return typeof e=="function"?e:e==null?qo:typeof e=="object"?Jt(e)?w_(e[0],e[1]):b_(e):M_(e)}function C_(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 ld=C_();function fl(e,t,n){(n!==void 0&&!Li(e[t],n)||n===void 0&&!(t in e))&&Ai(e,t,n)}function ml(e){return en(e)&&tr(e)}function gl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function A_(e){return Ar(e,Ri(e))}function L_(e,t,n,r,i,s,a){var o=gl(e,n),l=gl(t,n),c=a.get(l);if(c){fl(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,h=u===void 0;if(h){var d=Jt(l),p=!d&&Dr(l),f=!d&&!p&&Gs(l);u=l,d||p||f?Jt(o)?u=o:ml(o)?u=hh(o):p?(h=!1,u=kh(l,!0)):f?(h=!1,u=Wh(l,!0)):u=[]:Mh(l)||Lr(l)?(u=o,Lr(o)?u=A_(o):(!ke(o)||Yo(o))&&(u=qh(l))):h=!1}h&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),fl(e,n,u)}function cd(e,t,n,r,i){e!==t&&ld(t,function(s,a){if(i||(i=new Fe),ke(s))L_(e,t,a,n,cd,r,i);else{var o=r?r(gl(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),fl(e,a,o)}},Ri)}function ud(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var D_="[object Map]",k_="[object Set]",R_=Object.prototype,I_=R_.hasOwnProperty;function ze(e){if(e==null)return!0;if(tr(e)&&(Jt(e)||typeof e=="string"||typeof e.splice=="function"||Dr(e)||Gs(e)||Lr(e)))return!e.length;var t=Re(e);if(t==D_||t==k_)return!e.size;if(Vs(e))return!wh(e).length;for(var n in e)if(I_.call(e,n))return!1;return!0}var ot=H0(function(e,t,n){cd(e,t,n)}),N_=1/0,P_=Ir&&1/dl(new Ir([,-0]))[1]==N_?function(e){return new Ir(e)}:_0,U_=200;function hd(e,t,n){var r=-1,i=k0,s=e.length,a=!0,o=[],l=o;if(s>=U_){var c=t?null:P_(e);if(c)return dl(c);a=!1,i=td,l=new Bi}else l=t?[]:o;t:for(;++r<s;){var u=e[r],h=t?t(u):u;if(u=u!==0?u:0,a&&h===h){for(var d=l.length;d--;)if(l[d]===h)continue t;t&&l.push(h),o.push(u)}else i(l,h,n)||(l!==o&&l.push(h),o.push(u))}return o}var B_=Qo(function(e){var t=ud(e);return ml(t)&&(t=void 0),hd(Ws(e,1,ml,!0),Xs(t))});function Hi(e){return e&&e.length?hd(e):[]}function nr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function H_(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function vl(e){let t,n,r;e.length!==2?(t=nr,n=(o,l)=>nr(e(o),l),r=(o,l)=>e(o)-l):(t=e===nr||e===H_?e:V_,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 h=c+u>>>1;n(o[h],l)<0?c=h+1:u=h}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 h=c+u>>>1;n(o[h],l)<=0?c=h+1:u=h}while(c<u)}return c}function a(o,l,c=0,u=o.length){const h=i(o,l,c,u-1);return h>c&&r(o[h-1],l)>-r(o[h],l)?h-1:h}return{left:i,center:a,right:s}}function V_(){return 0}function G_(e){return e===null?NaN:+e}function*F_(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const z_=vl(nr),yl=z_.right;vl(G_).center;function je(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 dd=class extends Map{constructor(t,n=q_){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(pd(this,t))}has(t){return super.has(pd(this,t))}set(t,n){return super.set(j_(this,t),n)}delete(t){return super.delete(W_(this,t))}};function pd({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function j_({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function W_({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function q_(e){return e!==null&&typeof e=="object"?e.valueOf():e}const Y_=Math.sqrt(50),Z_=Math.sqrt(10),X_=Math.sqrt(2);function Ks(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>=Y_?10:s>=Z_?5:s>=X_?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?Ks(e,t,n*2):[o,l,c]}function Qs(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?Ks(t,e,n):Ks(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 Nr(e,t,n){return t=+t,e=+e,n=+n,Ks(e,t,n)[2]}function bl(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Nr(t,e,n):Nr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function rr(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 Pn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}var K_={value:()=>{}};function xl(){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 Js(n)}function Js(e){this._=e}function Q_(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}})}Js.prototype=xl.prototype={constructor:Js,on:function(e,t){var n=this._,r=Q_(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=J_(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]=fd(n[i],e.name,t);else if(t==null)for(i in n)n[i]=fd(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 Js(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 J_(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function fd(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=K_,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var _l="http://www.w3.org/1999/xhtml";const md={svg:"http://www.w3.org/2000/svg",xhtml:_l,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ta(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),md.hasOwnProperty(t)?{space:md[t],local:e}:e}function tE(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===_l&&t.documentElement.namespaceURI===_l?t.createElement(e):t.createElementNS(n,e)}}function eE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gd(e){var t=ta(e);return(t.local?eE:tE)(t)}function nE(){}function El(e){return e==null?nE:function(){return this.querySelector(e)}}function rE(e){typeof e!="function"&&(e=El(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 Oe(r,this._parents)}function iE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function sE(){return[]}function vd(e){return e==null?sE:function(){return this.querySelectorAll(e)}}function aE(e){return function(){return iE(e.apply(this,arguments))}}function oE(e){typeof e=="function"?e=aE(e):e=vd(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 Oe(r,i)}function yd(e){return function(){return this.matches(e)}}function bd(e){return function(t){return t.matches(e)}}var lE=Array.prototype.find;function cE(e){return function(){return lE.call(this.children,e)}}function uE(){return this.firstElementChild}function hE(e){return this.select(e==null?uE:cE(typeof e=="function"?e:bd(e)))}var dE=Array.prototype.filter;function pE(){return Array.from(this.children)}function fE(e){return function(){return dE.call(this.children,e)}}function mE(e){return this.selectAll(e==null?pE:fE(typeof e=="function"?e:bd(e)))}function gE(e){typeof e!="function"&&(e=yd(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 Oe(r,this._parents)}function xd(e){return new Array(e.length)}function vE(){return new Oe(this._enter||this._groups.map(xd),this._parents)}function ea(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ea.prototype={constructor:ea,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 yE(e){return function(){return e}}function bE(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 ea(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function xE(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,h=s.length,d=new Array(u),p;for(o=0;o<u;++o)(l=t[o])&&(d[o]=p=a.call(l,l.__data__,o,t)+"",c.has(p)?i[o]=l:c.set(p,l));for(o=0;o<h;++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 ea(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(d[o])===l&&(i[o]=l)}function _E(e){return e.__data__}function EE(e,t){if(!arguments.length)return Array.from(this,_E);var n=t?xE:bE,r=this._parents,i=this._groups;typeof e!="function"&&(e=yE(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],h=i[c],d=h.length,p=OE(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(d);n(u,h,g,m,v,p,t);for(var b=0,_=0,E,x;b<f;++b)if(E=g[b]){for(b>=_&&(_=b+1);!(x=m[_])&&++_<f;);E._next=x||null}}return a=new Oe(a,r),a._enter=o,a._exit=l,a}function OE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function TE(){return new Oe(this._exit||this._groups.map(xd),this._parents)}function wE(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 SE(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],h=c.length,d=o[l]=new Array(h),p,f=0;f<h;++f)(p=c[f]||u[f])&&(d[f]=p);for(;l<i;++l)o[l]=n[l];return new Oe(o,this._parents)}function $E(){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 ME(e){e||(e=CE);function t(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}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 Oe(i,this._parents).order()}function CE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function AE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function LE(){return Array.from(this)}function DE(){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 kE(){let e=0;for(const t of this)++e;return e}function RE(){return!this.node()}function IE(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 NE(e){return function(){this.removeAttribute(e)}}function PE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function UE(e,t){return function(){this.setAttribute(e,t)}}function BE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function HE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function VE(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 GE(e,t){var n=ta(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?PE:NE:typeof t=="function"?n.local?VE:HE:n.local?BE:UE)(n,t))}function _d(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function FE(e){return function(){this.style.removeProperty(e)}}function zE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function jE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function WE(e,t,n){return arguments.length>1?this.each((t==null?FE:typeof t=="function"?jE:zE)(e,t,n??"")):Pr(this.node(),e)}function Pr(e,t){return e.style.getPropertyValue(t)||_d(e).getComputedStyle(e,null).getPropertyValue(t)}function qE(e){return function(){delete this[e]}}function YE(e,t){return function(){this[e]=t}}function ZE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function XE(e,t){return arguments.length>1?this.each((t==null?qE:typeof t=="function"?ZE:YE)(e,t)):this.node()[e]}function Ed(e){return e.trim().split(/^|\s+/)}function Ol(e){return e.classList||new Od(e)}function Od(e){this._node=e,this._names=Ed(e.getAttribute("class")||"")}Od.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 Td(e,t){for(var n=Ol(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function wd(e,t){for(var n=Ol(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function KE(e){return function(){Td(this,e)}}function QE(e){return function(){wd(this,e)}}function JE(e,t){return function(){(t.apply(this,arguments)?Td:wd)(this,e)}}function tO(e,t){var n=Ed(e+"");if(arguments.length<2){for(var r=Ol(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?JE:t?KE:QE)(n,t))}function eO(){this.textContent=""}function nO(e){return function(){this.textContent=e}}function rO(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function iO(e){return arguments.length?this.each(e==null?eO:(typeof e=="function"?rO:nO)(e)):this.node().textContent}function sO(){this.innerHTML=""}function aO(e){return function(){this.innerHTML=e}}function oO(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function lO(e){return arguments.length?this.each(e==null?sO:(typeof e=="function"?oO:aO)(e)):this.node().innerHTML}function cO(){this.nextSibling&&this.parentNode.appendChild(this)}function uO(){return this.each(cO)}function hO(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function dO(){return this.each(hO)}function pO(e){var t=typeof e=="function"?e:gd(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function fO(){return null}function mO(e,t){var n=typeof e=="function"?e:gd(e),r=t==null?fO:typeof t=="function"?t:El(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function gO(){var e=this.parentNode;e&&e.removeChild(this)}function vO(){return this.each(gO)}function yO(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bO(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xO(e){return this.select(e?bO:yO)}function _O(e){return arguments.length?this.property("__data__",e):this.node().__data__}function EO(e){return function(t){e.call(this,t,this.__data__)}}function OO(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 TO(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 wO(e,t,n){return function(){var r=this.__on,i,s=EO(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 SO(e,t,n){var r=OO(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?wO:TO,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function Sd(e,t,n){var r=_d(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 $O(e,t){return function(){return Sd(this,e,t)}}function MO(e,t){return function(){return Sd(this,e,t.apply(this,arguments))}}function CO(e,t){return this.each((typeof t=="function"?MO:$O)(e,t))}function*AO(){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 Oe(e,t){this._groups=e,this._parents=t}function Vi(){return new Oe([[document.documentElement]],$d)}function LO(){return this}Oe.prototype=Vi.prototype={constructor:Oe,select:rE,selectAll:oE,selectChild:hE,selectChildren:mE,filter:gE,data:EE,enter:vE,exit:TE,join:wE,merge:SE,selection:LO,order:$E,sort:ME,call:AE,nodes:LE,node:DE,size:kE,empty:RE,each:IE,attr:GE,style:WE,property:XE,classed:tO,text:iO,html:lO,raise:uO,lower:dO,append:pO,insert:mO,remove:vO,clone:xO,datum:_O,on:SO,dispatch:CO,[Symbol.iterator]:AO};function DO(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ir(e,t){if(e=DO(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 Tl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Md(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Gi(){}var Fi=.7,na=1/Fi,Ur="\\s*([+-]?\\d+)\\s*",zi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",kO=/^#([0-9a-f]{3,8})$/,RO=new RegExp(`^rgb\\(${Ur},${Ur},${Ur}\\)$`),IO=new RegExp(`^rgb\\(${nn},${nn},${nn}\\)$`),NO=new RegExp(`^rgba\\(${Ur},${Ur},${Ur},${zi}\\)$`),PO=new RegExp(`^rgba\\(${nn},${nn},${nn},${zi}\\)$`),UO=new RegExp(`^hsl\\(${zi},${nn},${nn}\\)$`),BO=new RegExp(`^hsla\\(${zi},${nn},${nn},${zi}\\)$`),Cd={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};Tl(Gi,vn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ad,formatHex:Ad,formatHex8:HO,formatHsl:VO,formatRgb:Ld,toString:Ld});function Ad(){return this.rgb().formatHex()}function HO(){return this.rgb().formatHex8()}function VO(){return Nd(this).formatHsl()}function Ld(){return this.rgb().formatRgb()}function vn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=kO.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Dd(t):n===3?new me(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ra(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ra(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=RO.exec(e))?new me(t[1],t[2],t[3],1):(t=IO.exec(e))?new me(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=NO.exec(e))?ra(t[1],t[2],t[3],t[4]):(t=PO.exec(e))?ra(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=UO.exec(e))?Id(t[1],t[2]/100,t[3]/100,1):(t=BO.exec(e))?Id(t[1],t[2]/100,t[3]/100,t[4]):Cd.hasOwnProperty(e)?Dd(Cd[e]):e==="transparent"?new me(NaN,NaN,NaN,0):null}function Dd(e){return new me(e>>16&255,e>>8&255,e&255,1)}function ra(e,t,n,r){return r<=0&&(e=t=n=NaN),new me(e,t,n,r)}function GO(e){return e instanceof Gi||(e=vn(e)),e?(e=e.rgb(),new me(e.r,e.g,e.b,e.opacity)):new me}function wl(e,t,n,r){return arguments.length===1?GO(e):new me(e,t,n,r??1)}function me(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Tl(me,wl,Md(Gi,{brighter(e){return e=e==null?na:Math.pow(na,e),new me(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Fi:Math.pow(Fi,e),new me(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new me(sr(this.r),sr(this.g),sr(this.b),ia(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:kd,formatHex:kd,formatHex8:FO,formatRgb:Rd,toString:Rd}));function kd(){return`#${ar(this.r)}${ar(this.g)}${ar(this.b)}`}function FO(){return`#${ar(this.r)}${ar(this.g)}${ar(this.b)}${ar((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rd(){const e=ia(this.opacity);return`${e===1?"rgb(":"rgba("}${sr(this.r)}, ${sr(this.g)}, ${sr(this.b)}${e===1?")":`, ${e})`}`}function ia(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function sr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ar(e){return e=sr(e),(e<16?"0":"")+e.toString(16)}function Id(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new We(e,t,n,r)}function Nd(e){if(e instanceof We)return new We(e.h,e.s,e.l,e.opacity);if(e instanceof Gi||(e=vn(e)),!e)return new We;if(e instanceof We)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 We(a,o,l,e.opacity)}function Pd(e,t,n,r){return arguments.length===1?Nd(e):new We(e,t,n,r??1)}function We(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Tl(We,Pd,Md(Gi,{brighter(e){return e=e==null?na:Math.pow(na,e),new We(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Fi:Math.pow(Fi,e),new We(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 me(Sl(e>=240?e-240:e+120,i,r),Sl(e,i,r),Sl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new We(Ud(this.h),sa(this.s),sa(this.l),ia(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=ia(this.opacity);return`${e===1?"hsl(":"hsla("}${Ud(this.h)}, ${sa(this.s)*100}%, ${sa(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ud(e){return e=(e||0)%360,e<0?e+360:e}function sa(e){return Math.max(0,Math.min(1,e||0))}function Sl(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 $l=e=>()=>e;function zO(e,t){return function(n){return e+n*t}}function jO(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 WO(e){return(e=+e)==1?Bd:function(t,n){return n-t?jO(t,n,e):$l(isNaN(t)?n:t)}}function Bd(e,t){var n=t-e;return n?zO(e,n):$l(isNaN(e)?t:e)}const aa=function e(t){var n=WO(t);function r(i,s){var a=n((i=wl(i)).r,(s=wl(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Bd(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 qO(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 YO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ZO(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]=ji(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 XO(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Te(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function KO(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]=ji(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Ml=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cl=new RegExp(Ml.source,"g");function QO(e){return function(){return e}}function JO(e){return function(t){return e(t)+""}}function Hd(e,t){var n=Ml.lastIndex=Cl.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Ml.exec(e))&&(i=Cl.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:Te(r,i)})),n=Cl.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?JO(l[0].x):QO(t):(t=l.length,function(c){for(var u=0,h;u<t;++u)o[(h=l[u]).i]=h.x(c);return o.join("")})}function ji(e,t){var n=typeof t,r;return t==null||n==="boolean"?$l(t):(n==="number"?Te:n==="string"?(r=vn(t))?(t=r,aa):Hd:t instanceof vn?aa:t instanceof Date?XO:YO(t)?qO:Array.isArray(t)?ZO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?KO:Te)(e,t)}function Vd(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Gd=180/Math.PI,Fd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zd(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)*Gd,skewX:Math.atan(l)*Gd,scaleX:a,scaleY:o}}var oa;function tT(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Fd:zd(t.a,t.b,t.c,t.d,t.e,t.f)}function eT(e){return e==null||(oa||(oa=document.createElementNS("http://www.w3.org/2000/svg","g")),oa.setAttribute("transform",e),!(e=oa.transform.baseVal.consolidate()))?Fd:(e=e.matrix,zd(e.a,e.b,e.c,e.d,e.e,e.f))}function jd(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,h,d,p,f){if(c!==h||u!==d){var g=p.push("translate(",null,t,null,n);f.push({i:g-4,x:Te(c,h)},{i:g-2,x:Te(u,d)})}else(h||d)&&p.push("translate("+h+t+d+n)}function a(c,u,h,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:h.push(i(h)+"rotate(",null,r)-2,x:Te(c,u)})):u&&h.push(i(h)+"rotate("+u+r)}function o(c,u,h,d){c!==u?d.push({i:h.push(i(h)+"skewX(",null,r)-2,x:Te(c,u)}):u&&h.push(i(h)+"skewX("+u+r)}function l(c,u,h,d,p,f){if(c!==h||u!==d){var g=p.push(i(p)+"scale(",null,",",null,")");f.push({i:g-4,x:Te(c,h)},{i:g-2,x:Te(u,d)})}else(h!==1||d!==1)&&p.push(i(p)+"scale("+h+","+d+")")}return function(c,u){var h=[],d=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,h,d),a(c.rotate,u.rotate,h,d),o(c.skewX,u.skewX,h,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,d),c=u=null,function(p){for(var f=-1,g=d.length,m;++f<g;)h[(m=d[f]).i]=m.x(p);return h.join("")}}}var nT=jd(tT,"px, ","px)","deg)"),rT=jd(eT,", ",")",")"),Br=0,Wi=0,qi=0,Wd=1e3,la,Yi,ca=0,or=0,ua=0,Zi=typeof performance=="object"&&performance.now?performance:Date,qd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Al(){return or||(qd(iT),or=Zi.now()+ua)}function iT(){or=0}function ha(){this._call=this._time=this._next=null}ha.prototype=Yd.prototype={constructor:ha,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Al():+n)+(t==null?0:+t),!this._next&&Yi!==this&&(Yi?Yi._next=this:la=this,Yi=this),this._call=e,this._time=n,Ll()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ll())}};function Yd(e,t,n){var r=new ha;return r.restart(e,t,n),r}function sT(){Al(),++Br;for(var e=la,t;e;)(t=or-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Br}function Zd(){or=(ca=Zi.now())+ua,Br=Wi=0;try{sT()}finally{Br=0,oT(),or=0}}function aT(){var e=Zi.now(),t=e-ca;t>Wd&&(ua-=t,ca=e)}function oT(){for(var e,t=la,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:la=n);Yi=e,Ll(r)}function Ll(e){if(!Br){Wi&&(Wi=clearTimeout(Wi));var t=e-or;t>24?(e<1/0&&(Wi=setTimeout(Zd,e-Zi.now()-ua)),qi&&(qi=clearInterval(qi))):(qi||(ca=Zi.now(),qi=setInterval(aT,Wd)),Br=1,qd(Zd))}}function Xd(e,t,n){var r=new ha;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var lT=xl("start","end","cancel","interrupt"),cT=[],Kd=0,Qd=1,Dl=2,da=3,Jd=4,kl=5,pa=6;function fa(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;uT(e,n,{name:t,index:r,group:i,on:lT,tween:cT,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Kd})}function Rl(e,t){var n=qe(e,t);if(n.state>Kd)throw new Error("too late; already scheduled");return n}function rn(e,t){var n=qe(e,t);if(n.state>da)throw new Error("too late; already running");return n}function qe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function uT(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Yd(s,0,n.time);function s(c){n.state=Qd,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,h,d,p;if(n.state!==Qd)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===da)return Xd(a);p.state===Jd?(p.state=pa,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=pa,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(Xd(function(){n.state===da&&(n.state=Jd,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Dl,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Dl){for(n.state=da,i=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=p);i.length=h+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=kl,1),h=-1,d=i.length;++h<d;)i[h].call(e,u);n.state===kl&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=pa,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Il(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>Dl&&r.state<kl,r.state=pa,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function hT(e){return this.each(function(){Il(this,e)})}function dT(e,t){var n,r;return function(){var i=rn(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 pT(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=rn(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 fT(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=qe(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?dT:pT)(n,e,t))}function Nl(e,t,n){var r=e._id;return e.each(function(){var i=rn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return qe(i,r).value[t]}}function tp(e,t){var n;return(typeof t=="number"?Te:t instanceof vn?aa:(n=vn(t))?(t=n,aa):Hd)(e,t)}function mT(e){return function(){this.removeAttribute(e)}}function gT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function vT(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 yT(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 bT(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 xT(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 _T(e,t){var n=ta(e),r=n==="transform"?rT:tp;return this.attrTween(e,typeof t=="function"?(n.local?xT:bT)(n,r,Nl(this,"attr."+e,t)):t==null?(n.local?gT:mT)(n):(n.local?yT:vT)(n,r,t))}function ET(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function OT(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function TT(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&OT(e,s)),n}return i._value=t,i}function wT(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&ET(e,s)),n}return i._value=t,i}function ST(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=ta(e);return this.tween(n,(r.local?TT:wT)(r,t))}function $T(e,t){return function(){Rl(this,e).delay=+t.apply(this,arguments)}}function MT(e,t){return t=+t,function(){Rl(this,e).delay=t}}function CT(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$T:MT)(t,e)):qe(this.node(),t).delay}function AT(e,t){return function(){rn(this,e).duration=+t.apply(this,arguments)}}function LT(e,t){return t=+t,function(){rn(this,e).duration=t}}function DT(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?AT:LT)(t,e)):qe(this.node(),t).duration}function kT(e,t){if(typeof t!="function")throw new Error;return function(){rn(this,e).ease=t}}function RT(e){var t=this._id;return arguments.length?this.each(kT(t,e)):qe(this.node(),t).ease}function IT(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;rn(this,e).ease=n}}function NT(e){if(typeof e!="function")throw new Error;return this.each(IT(this._id,e))}function PT(e){typeof e!="function"&&(e=yd(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 yn(r,this._parents,this._name,this._id)}function UT(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,h=a[o]=new Array(u),d,p=0;p<u;++p)(d=l[p]||c[p])&&(h[p]=d);for(;o<r;++o)a[o]=t[o];return new yn(a,this._parents,this._name,this._id)}function BT(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 HT(e,t,n){var r,i,s=BT(t)?Rl:rn;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function VT(e,t){var n=this._id;return arguments.length<2?qe(this.node(),n).on.on(e):this.each(HT(n,e,t))}function GT(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function FT(){return this.on("end.remove",GT(this._id))}function zT(e){var t=this._name,n=this._id;typeof e!="function"&&(e=El(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,h,d=0;d<l;++d)(u=o[d])&&(h=e.call(u,u.__data__,d,o))&&("__data__"in u&&(h.__data__=u.__data__),c[d]=h,fa(c[d],t,n,d,c,qe(u,n)));return new yn(s,this._parents,t,n)}function jT(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vd(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,h=0;h<c;++h)if(u=l[h]){for(var d=e.call(u,u.__data__,h,l),p,f=qe(u,n),g=0,m=d.length;g<m;++g)(p=d[g])&&fa(p,t,n,g,d,f);s.push(d),a.push(u)}return new yn(s,a,t,n)}var WT=Vi.prototype.constructor;function qT(){return new WT(this._groups,this._parents)}function YT(e,t){var n,r,i;return function(){var s=Pr(this,e),a=(this.style.removeProperty(e),Pr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function ep(e){return function(){this.style.removeProperty(e)}}function ZT(e,t,n){var r,i=n+"",s;return function(){var a=Pr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function XT(e,t,n){var r,i,s;return function(){var a=Pr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Pr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function KT(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=rn(this,e),c=l.on,u=l.value[s]==null?o||(o=ep(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function QT(e,t,n){var r=(e+="")=="transform"?nT:tp;return t==null?this.styleTween(e,YT(e,r)).on("end.style."+e,ep(e)):typeof t=="function"?this.styleTween(e,XT(e,r,Nl(this,"style."+e,t))).each(KT(this._id,e)):this.styleTween(e,ZT(e,r,t),n).on("end.style."+e,null)}function JT(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function tw(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&JT(e,a,n)),r}return s._value=t,s}function ew(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,tw(e,t,n??""))}function nw(e){return function(){this.textContent=e}}function rw(e){return function(){var t=e(this);this.textContent=t??""}}function iw(e){return this.tween("text",typeof e=="function"?rw(Nl(this,"text",e)):nw(e==null?"":e+""))}function sw(e){return function(t){this.textContent=e.call(this,t)}}function aw(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&sw(i)),t}return r._value=e,r}function ow(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,aw(e))}function lw(){for(var e=this._name,t=this._id,n=np(),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=qe(l,t);fa(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new yn(r,this._parents,e,n)}function cw(){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=rn(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 uw=0;function yn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function np(){return++uw}var bn=Vi.prototype;yn.prototype={constructor:yn,select:zT,selectAll:jT,selectChild:bn.selectChild,selectChildren:bn.selectChildren,filter:PT,merge:UT,selection:qT,transition:lw,call:bn.call,nodes:bn.nodes,node:bn.node,size:bn.size,empty:bn.empty,each:bn.each,on:VT,attr:_T,attrTween:ST,style:QT,styleTween:ew,text:iw,textTween:ow,remove:FT,tween:fT,delay:CT,duration:DT,ease:RT,easeVarying:NT,end:cw,[Symbol.iterator]:bn[Symbol.iterator]};function rp(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var hw={time:null,delay:0,duration:250,ease:rp};function dw(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 pw(e){var t,n;e instanceof yn?(t=e._id,e=e._name):(t=np(),(n=hw).time=Al(),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])&&fa(l,e,t,c,a,n||dw(l,t));return new yn(r,this._parents,e,t)}Vi.prototype.interrupt=hT,Vi.prototype.transition=pw;function fw(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ma(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 Hr(e){return e=ma(Math.abs(e)),e?e[1]:NaN}function mw(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 gw(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var vw=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xi(e){if(!(t=vw.exec(e)))throw new Error("invalid format: "+e);var t;return new Pl({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]})}Xi.prototype=Pl.prototype;function Pl(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+""}Pl.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 yw(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 ip;function bw(e,t){var n=ma(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(ip=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")+ma(e,Math.max(0,t+s-1))[0]}function sp(e,t){var n=ma(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 ap={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:fw,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)=>sp(e*100,t),r:sp,s:bw,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function op(e){return e}var lp=Array.prototype.map,cp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function xw(e){var t=e.grouping===void 0||e.thousands===void 0?op:mw(lp.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?op:gw(lp.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(h){h=Xi(h);var d=h.fill,p=h.align,f=h.sign,g=h.symbol,m=h.zero,v=h.width,b=h.comma,_=h.precision,E=h.trim,x=h.type;x==="n"?(b=!0,x="g"):ap[x]||(_===void 0&&(_=12),E=!0,x="g"),(m||d==="0"&&p==="=")&&(m=!0,d="0",p="=");var O=g==="$"?n:g==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",A=g==="$"?r:/[%p]/.test(x)?a:"",D=ap[x],L=/[defgprs%]/.test(x);_=_===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function N(M){var V=O,k=A,H,S,U;if(x==="c")k=D(M)+k,M="";else{M=+M;var B=M<0||1/M<0;if(M=isNaN(M)?l:D(Math.abs(M),_),E&&(M=yw(M)),B&&+M==0&&f!=="+"&&(B=!1),V=(B?f==="("?f:o:f==="-"||f==="("?"":f)+V,k=(x==="s"?cp[8+ip/3]:"")+k+(B&&f==="("?")":""),L){for(H=-1,S=M.length;++H<S;)if(U=M.charCodeAt(H),48>U||U>57){k=(U===46?i+M.slice(H+1):M.slice(H))+k,M=M.slice(0,H);break}}}b&&!m&&(M=t(M,1/0));var w=V.length+M.length+k.length,C=w<v?new Array(v-w+1).join(d):"";switch(b&&m&&(M=t(C+M,C.length?v-k.length:1/0),C=""),p){case"<":M=V+M+k+C;break;case"=":M=V+C+M+k;break;case"^":M=C.slice(0,w=C.length>>1)+V+M+k+C.slice(w);break;default:M=C+V+M+k;break}return s(M)}return N.toString=function(){return h+""},N}function u(h,d){var p=c((h=Xi(h),h.type="f",h)),f=Math.max(-8,Math.min(8,Math.floor(Hr(d)/3)))*3,g=Math.pow(10,-f),m=cp[8+f/3];return function(v){return p(g*v)+m}}return{format:c,formatPrefix:u}}var ga,Ul,up;_w({thousands:",",grouping:[3],currency:["$",""]});function _w(e){return ga=xw(e),Ul=ga.format,up=ga.formatPrefix,ga}function Ew(e){return Math.max(0,-Hr(Math.abs(e)))}function Ow(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Hr(t)/3)))*3-Hr(Math.abs(e)))}function Tw(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Hr(t)-Hr(e))+1}function Vr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const hp=Symbol("implicit");function va(){var e=new dd,t=[],n=[],r=hp;function i(s){let a=e.get(s);if(a===void 0){if(r!==hp)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 dd;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 va(t,n).unknown(r)},Vr.apply(i,arguments),i}function ww(e){return function(){return e}}function Sw(e){return+e}var dp=[0,1];function Gr(e){return e}function Bl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:ww(isNaN(t)?NaN:.5)}function $w(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Mw(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Bl(i,r),s=n(a,s)):(r=Bl(r,i),s=n(s,a)),function(o){return s(r(o))}}function Cw(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]=Bl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=yl(e,o,1,r)-1;return s[l](i[l](o))}}function Hl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function pp(){var e=dp,t=dp,n=ji,r,i,s,a=Gr,o,l,c;function u(){var d=Math.min(e.length,t.length);return a!==Gr&&(a=$w(e[0],e[d-1])),o=d>2?Cw:Mw,l=c=null,h}function h(d){return d==null||isNaN(d=+d)?s:(l||(l=o(e.map(r),t,n)))(r(a(d)))}return h.invert=function(d){return a(i((c||(c=o(t,e.map(r),Te)))(d)))},h.domain=function(d){return arguments.length?(e=Array.from(d,Sw),u()):e.slice()},h.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},h.rangeRound=function(d){return t=Array.from(d),n=Vd,u()},h.clamp=function(d){return arguments.length?(a=d?!0:Gr,u()):a!==Gr},h.interpolate=function(d){return arguments.length?(n=d,u()):n},h.unknown=function(d){return arguments.length?(s=d,h):s},function(d,p){return r=d,i=p,u()}}function fp(){return pp()(Gr,Gr)}function Aw(e,t,n,r){var i=bl(e,t,n),s;switch(r=Xi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=Ow(i,a))&&(r.precision=s),up(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Tw(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Ew(i))&&(r.precision=s-(r.type==="%")*2);break}}return Ul(r)}function mp(e){var t=e.domain;return e.ticks=function(n){var r=t();return Qs(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Aw(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=Nr(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 Ye(){var e=fp();return e.copy=function(){return Hl(e,Ye())},Vr.apply(e,arguments),mp(e)}function Vl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[yl(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 Vl().domain([e,t]).range(i).unknown(s)},Vr.apply(mp(a),arguments)}function Ki(e,t,n){this.k=e,this.x=t,this.y=n}Ki.prototype={constructor:Ki,scale:function(e){return e===1?this:new Ki(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ki(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+")"}},Ki.prototype;const ge="cds",xn={opacity:{unselected:.05,selected:.4}},Un={ticks:{number:7,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Fr={duration:1e3,ease:rp,zoomLevel:3},zr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},gp={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ie={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},Lw={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}},_n={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},te={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Dt={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}},lr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},Ze={nodeWidth:4,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},vp={minCellDividerDimension:16},yp={default:{size:24}},bp={defaultOffset:4,horizontalOffset:10},xp={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}},we={height:{[Ve.GRAPH_VIEW]:32,[Ve.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},Dw=[{type:qt.RADIUS,name:"Radius"},{type:qt.AREA,name:"Poor area"},{type:qt.AREA,name:"Satisfactory area"},{type:qt.AREA,name:"Great area"},{type:qt.QUARTILE,name:"Quartiles"}],jr={type:Ae.END_LINE,threshold:16,numCharacter:14},_p=4,kw={code:typeof navigator<"u"&&navigator?.language||"en-US",number:(e,t=navigator?.language||"en-US")=>e?.toLocaleString?.(t),date:(e,t=navigator?.language||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=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"}}},Rw={enabled:!0,position:$r.BOTTOM,clickable:!0,truncation:jr,alignment:jt.LEFT,order:null,additionalItems:[]},Iw={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},Nw={enabled:!0},Ep={enabled:!0,showTotal:!0,truncation:jr,groupLabel:"Group"},Op={top:{visible:!0,includeZero:!0,truncation:jr},bottom:{visible:!0,includeZero:!0,truncation:jr},left:{visible:!0,includeZero:!0,truncation:jr},right:{visible:!0,includeZero:!0,truncation:jr}},ya={addSpaceOnEdges:1,showDayName:!1,localeObject:nh,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 Tp=!1;try{Tp=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const re={width:null,height:null,resizable:!0,theme:zo.WHITE,tooltip:Ep,legend:Rw,locale:kw,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:_t.SHOW_AS_DATATABLE},...Tp?[{type:_t.MAKE_FULLSCREEN}]:[],{type:_t.EXPORT_CSV},{type:_t.EXPORT_PNG},{type:_t.EXPORT_JPG}]}},wp=ot({},re,{thematic:{projection:tn.geoNaturalEarth1}}),Qi=ot({},re,{axes:Op,timeScale:ya,grid:Iw,ruler:Nw,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ve.GRAPH_VIEW}}}),cr=ot({},Qi,{bars:{maxWidth:16,spacingFactor:.25,preserveSpaceForMissingBars:!0},timeScale:ot(ya,{addSpaceOnEdges:1})}),Pw=ot({},cr,{}),Uw=ot({},cr,{}),Bw=ot({},cr,{bars:ot({},cr.bars,{dividerSize:1.5})}),Hw=ot({},cr,{}),Gl=ot({},Qi,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),Vw=Gl,Sp=ot({},Gl,{points:{radius:3,filled:!1,enabled:!0}}),$p=ot({},Sp,{timeScale:ot(ya,{addSpaceOnEdges:0})}),Gw=$p,Fw=ot({},Qi,{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:qt.RADIUS,name:"Radius"}]}}),zw=ot({},Qi,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:qt.AREA,name:"Poor area"},{type:qt.AREA,name:"Satisfactory area"},{type:qt.AREA,name:"Great area"},{type:qt.QUARTILE,name:"Quartiles"}]}}),jw=ot({},cr,{bars:{dividerSize:1.5},timeScale:ot(ya,{addSpaceOnEdges:0})}),Ww=ot({},re,{tooltip:ot({},Ep,{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"}}),Mp=ot({},re,{pie:{labels:{formatter:null,enabled:!0},alignment:jt.LEFT,sortFunction:null,valueMapsTo:"value"}}),qw=ot({},re,{legend:{enabled:!1},gauge:{type:Zn.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:jt.LEFT}}),Yw=ot({},Mp,{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:jt.LEFT}}),Cp=ot({},re,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),Zw=ot({},Cp,{legend:{enabled:!0}}),Xw=ot({},re,{radar:{axes:{angle:"key",value:"value"},alignment:jt.LEFT,maxValue:void 0},tooltip:{gridline:{enabled:!0}}}),Kw=ot({},cr,{comboChartTypes:[]}),Qw=ot({tree:{type:Is.TREE}},re,{}),Jw=ot({},re,{data:ot(re.data,{groupMapsTo:"name"})}),tS=ot({},re,zr,{data:ot(re.data,{groupMapsTo:"name"})}),eS=ot({},re,{alluvial:{data:ot(re.data,{groupMapsTo:"source"}),nodeAlignment:jt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),nS=ot({},re,{axes:Op,heatmap:{divider:{state:Cr.AUTO},colorLegend:{type:"linear"}}}),rS=ot({},wp,{choropleth:{colorLegend:{type:"linear"}}}),At={alluvialChart:eS,areaChart:$p,axisChart:Qi,boxplotChart:Hw,bubbleChart:Fw,bulletChart:zw,chart:re,circlePackChart:tS,choroplethChart:rS,comboChart:Kw,donutChart:Yw,gaugeChart:qw,groupedBarChart:Uw,heatmapChart:nS,histogramChart:jw,lineChart:Sp,lollipopChart:Vw,meterChart:Cp,pieChart:Mp,proportionalMeterChart:Zw,radarChart:Xw,scatterChart:Gl,simpleBarChart:Pw,stackedAreaChart:Gw,stackedBarChart:Bw,thematicChart:wp,treeChart:Qw,treemapChart:Jw,wordCloudChart:Ww};function iS(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=ir(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function It(e,t){const n=gn(e),r=Object.keys(t.axes||{});t?.toolbar?.controls&&delete n.toolbar.controls,r.length===0&&delete n.axes;for(const i in n.axes)if(r.includes(i)){const s=t.axes[i];if((s.primary||s.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),s.mapsTo==null){const o=s.scaleType;o==null?s.mapsTo="value":o===nt.TIME?s.mapsTo="date":o===nt.LABELS&&(s.mapsTo="key")}}else delete n.axes[i];return zl(n,t),ot(n,t)}function En(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 Ji(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 Fl(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 ts(e,t,n){if(n>e.length)return e;if(t===Ae.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Ae.FRONT_LINE)return"..."+e.substr(-n);if(t===Ae.END_LINE)return e.substr(0,n)+"..."}function zl(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=Dw.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=B_(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},Ap=(e,t)=>t===zt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,le=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=Ap(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function On(e,t,n){return n===zt.VERTICAL?[e,t]:[t,e]}function Lp(e){const t=Ut(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 Dp(e,t){const n=Ut(e,t?.in);return n.setHours(0,0,0,0),n}function kp(e,t,n){const[r,i]=Xn(n?.in,e,t),s=Dp(r),a=Dp(i),o=+s-Lp(s),l=+a-Lp(a);return Math.round((o-l)/g1)}function sS(e,t){const n=Ut(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function aS(e,t){const n=Ut(e,t?.in);return kp(n,sS(n))+1}function ba(e,t){return Mi(e,{...t,weekStartsOn:1})}function Rp(e,t){const n=Ut(e,t?.in),r=n.getFullYear(),i=Le(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=ba(i),a=Le(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=ba(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function oS(e,t){const n=Rp(e,t),r=Le(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ba(r)}function lS(e,t){const n=Ut(e,t?.in),r=+ba(n)-+oS(n);return Math.round(r/Qu)+1}function Ip(e,t){const n=Ut(e,t?.in),r=n.getFullYear(),i=Us(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=Le(t?.in||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const o=Mi(a,t),l=Le(t?.in||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=Mi(l,t);return+n>=+o?r+1:+n>=+c?r:r-1}function cS(e,t){const n=Us(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Ip(e,t),s=Le(t?.in||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),Mi(s,t)}function uS(e,t){const n=Ut(e,t?.in),r=+Mi(n,t)-+cS(n,t);return Math.round(r/Qu)+1}function Ot(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Bn={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)}},Wr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Np={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 Bn.y(e,t)},Y:function(e,t,n,r){const i=Ip(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=Rp(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 Bn.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=uS(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ot(i,t.length)},I:function(e,t,n){const r=lS(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"}):Bn.d(e,t)},D:function(e,t,n){const r=aS(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=Wr.noon:r===0?i=Wr.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=Wr.evening:r>=12?i=Wr.afternoon:r>=4?i=Wr.morning:i=Wr.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 Bn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Bn.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"}):Bn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Bn.s(e,t)},S:function(e,t){return Bn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Up(r);case"XXXX":case"XX":return ur(r);case"XXXXX":case"XXX":default:return ur(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Up(r);case"xxxx":case"xx":return ur(r);case"xxxxx":case"xxx":default:return ur(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Pp(r,":");case"OOOO":default:return"GMT"+ur(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Pp(r,":");case"zzzz":default:return"GMT"+ur(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 Pp(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 Up(e,t){return e%60===0?(e>0?"-":"+")+Ot(Math.abs(e)/60,2):ur(e,t)}function ur(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 Bp=(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"})}},Hp=(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"})}},hS=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Bp(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}}",Bp(r,t)).replace("{{time}}",Hp(i,t))},dS={p:Hp,P:hS},pS=/^D+$/,fS=/^Y+$/,mS=["D","DD","YY","YYYY"];function gS(e){return pS.test(e)}function vS(e){return fS.test(e)}function yS(e,t,n){const r=bS(e,t,n);if(console.warn(r),mS.includes(e))throw new RangeError(r)}function bS(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 xS(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _S(e){return!(!xS(e)&&typeof e!="number"||isNaN(+Ut(e)))}const ES=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,OS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,TS=/^'([^]*?)'?$/,wS=/''/g,SS=/[a-zA-Z]/;function jl(e,t,n){const r=Us(),i=n?.locale??r.locale??nh,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=Ut(e,n?.in);if(!_S(o))throw new RangeError("Invalid time value");let l=t.match(OS).map(u=>{const h=u[0];if(h==="p"||h==="P"){const d=dS[h];return d(u,i.formatLong)}return u}).join("").match(ES).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const h=u[0];if(h==="'")return{isToken:!1,value:$S(u)};if(Np[h])return{isToken:!0,value:u};if(h.match(SS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:u}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const c={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return l.map(u=>{if(!u.isToken)return u.value;const h=u.value;(!n?.useAdditionalWeekYearTokens&&vS(h)||!n?.useAdditionalDayOfYearTokens&&gS(h))&&yS(h,t,String(e));const d=Np[h[0]];return d(o,h,i.localize,c)}).join("")}function $S(e){const t=e.match(TS);return t?t[1].replace(wS,"'"):e}const Wl=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",1800*1e3],["hourly",3600*1e3],["daily",1440*60*1e3],["monthly",720*60*60*1e3],["quarterly",2160*60*60*1e3],["yearly",360*24*60*60*1e3]];function Vp(e,t,n,r,i){const s=t===0,a=Number(jl(new Date(e),"c"))===2,o=Number(jl(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||_a(e)||es(e,l)||Hn(e);case"minute":return s||_a(e)||es(e,l)||Hn(e);case"30minutes":return s||_a(e)||es(e,l)||Hn(e);case"hourly":return s||_a(e)||es(e,l)||Hn(e);case"daily":return i?s||a||Hn(e):s||es(e,l)||Hn(e);case"weekly":return s||a||Hn(e);case"monthly":return s||Hn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function ql(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"),h=y(c,"secondary"),d=Vp(e,t,n,r,a);let p=d?u:h;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,b=m[r][d?"primary":"secondary"][p];if(r==="quarterly"||!b){const _=jl(l,p,{locale:f}).split("").map(E=>{const x=Number(E);return E!==" "&&!Number.isNaN(x)?x?.toLocaleString?.(g):E});return s[v](l,g,{},_.join(""))}else return s[v](l,g,b)}function xa(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function MS(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function CS(e){const t=Wl.reduce((n,[,r],i)=>{const s=Wl[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return Wl[t][0]}function Yl(e,t){if(Ku[t])return t;if(e.length===1)return"15seconds";const n=MS(e),r=Pn(n);return CS(r)}function _a(e){const{s:t,m:n,H:r}=xa(e);return r===0&&n===0&&t===0}function es(e,t){const n=xa(e).M,r=xa(t).M;return n!==r}function Hn(e){const{M:t,d:n,s:r,m:i,H:s}=xa(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Gp(e){return e===void 0?"":e.toISOString()}function Fp(e,t){const n=je(e,i=>i.value),r=Ye().domain(n).nice().domain();return r[0]>0?r[0]=0:r[0]===0&&r[1]===0&&(r[0]=0,r[1]=1),r[0]<0&&r[1]>0&&(Math.abs(r[0])>r[1]?r[1]=Math.abs(r[0]):r[0]=-r[1]),t&&(typeof t.min=="number"&&(r[0]=t.min),typeof t.max=="number"&&(r[1]=t.max)),r}function zp(e,t,n){const r=y(t,"gradient","colors"),i=!ze(r);let s=y(t,"pairing","option");const a=Fp(e,n),o=a[0]<0&&a[1]>0?"diverge":"mono";(s<1&&s>4&&o==="mono"||s<1&&s>2&&o==="diverge")&&(s=1);const l=i?r:[];if(!i){const c=o==="diverge"?17:11;for(let u=1;u<c+1;u++)l.push(`fill-${o}-${s}-${u}`)}return Vl().domain(a).range(l)}var dt=(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))(dt||{});function AS(e,t){return e&&ld(e,t,ki)}function LS(e,t){return function(n,r){if(n==null)return n;if(!tr(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 Zl=LS(AS);function ft(e){return function(){return e}}var DS=Array.prototype.slice;function Ea(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function kS(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 RS(e,t,n,r){return Zl(e,function(i,s,a){t(r,i,n(i),a)}),r}function IS(e,t){return function(n,r){var i=Jt(n)?kS:RS,s={};return i(n,e,Xs(r),s)}}function NS(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];Ai(r,i[0],i[1])}return r}var PS=Object.prototype,US=PS.hasOwnProperty,BS=IS(function(e,t,n){US.call(e,n)?e[n].push(t):Ai(e,n,[t])});function HS(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function VS(e){return e}function GS(e=nr){if(e===nr)return jp;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 jp(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var FS=Array.prototype,zS=FS.slice;function Xl(e){return()=>e}function jS(e,t,n){let r;for(;;){const i=Nr(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 WS(e){return Math.max(1,Math.ceil(Math.log(HS(e))/Math.LN2)+1)}function qS(){var e=VS,t=je,n=WS;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),h=u[0],d=u[1],p=n(c,h,d);if(!Array.isArray(p)){const _=d,E=+p;if(t===je&&([h,d]=jS(h,d,E)),p=Qs(h,d,E),p[0]<=h&&(l=Nr(h,d,E)),p[p.length-1]>=d)if(_>=d&&t===je){const x=Nr(h,d,E);isFinite(x)&&(x>0?d=(Math.floor(d/x)+1)*x:x<0&&(d=(Math.ceil(d*-x)+1)/-x))}else p.pop()}for(var f=p.length,g=0,m=f;p[g]<=h;)++g;for(;p[m-1]>d;)--m;(g||m<f)&&(p=p.slice(g,m),f=m-g);var v=new Array(f+1),b;for(s=0;s<=f;++s)b=v[s]=[],b.x0=s>0?p[s-1]:h,b.x1=s<f?p[s]:d;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[Math.min(f,Math.floor((o-h)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&h<=o&&o<=d){const _=Math.floor((h-o)*l);v[Math.min(f,_+(p[_]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[yl(p,o,0,f)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Xl(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Xl([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Xl(Array.isArray(i)?zS.call(i):i),r):n},r}function Wp(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?jp:GS(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(t-c*h/l+d)),f=Math.min(r,Math.floor(t+(l-c)*h/l+d));Wp(e,t,p,f,i)}const s=e[t];let a=n,o=r;for(ns(e,n,t),i(e[r],s)>0&&ns(e,n,r);a<o;){for(ns(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?ns(e,n,o):(++o,ns(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function ns(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Kl(e,t,n){if(e=Float64Array.from(F_(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Pn(e);if(t>=1)return rr(e);var r,i=(r-1)*t,s=Math.floor(i),a=rr(Wp(e,s).subarray(0,s+1)),o=Pn(e.subarray(s+1));return a+(o-a)*(i-s)}}function qp(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 Yp(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function YS(e,t){return e[t]}function ZS(e){const t=[];return t.key=e,t}function Ql(){var e=ft([]),t=Yp,n=qp,r=YS;function i(s){var a=Array.from(e.apply(this,arguments),ZS),o,l=a.length,c=-1,u;for(const h of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(h,a[o].key,c,s)]).data=h;for(o=0,u=Ea(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:ft(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:ft(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Yp:typeof s=="function"?s:ft(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??qp,i):n},i}function XS(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 KS(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class sn{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?.getDomainAxisScaleType();let h;return u===nt.TIME&&(h=d=>s(d,i,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(d=>{h&&(d[1]=h(d[1]));for(const p in d){const f=d[p];typeof f=="number"&&(d[p]=a(f,i))}return d})]}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,h]=a[o].domain;r=r.filter(d=>!(l in d)||d[l]>=u&&d[l]<=h)}}),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(gn(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 BS(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=Lw.defaultBins}=s,l=Array.isArray(o),c=qS().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],h=Array.from(new Set(t.map(p=>p[a]))),d=[];return c.forEach(p=>{const f=`${p.x0}-${p.x1}`,g=this.aggregateBinDataByGroup(p);h.forEach(m=>{d.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 Ql().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=Hi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Gp(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),h=new Date(c);return u-h}):(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(":"),h={x0:c,x1:u},d=t.find(p=>p.x0.toString()===c.toString());return a.forEach(p=>{h[p]=d.filter(f=>f[i]===p).length}),h}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const h=s.find(p=>{const f=this.services.cartesianScales.getDomainIdentifier(p);return p[i]===u&&Object.prototype.hasOwnProperty.call(p,f)&&(p[f]instanceof Date?Gp(p[f])===l:p[f].toString()===l)}),d=this.services.cartesianScales.getRangeIdentifier(c);c[u]=h?h[d]: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=NS(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const h=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/h*100:c[u]=0})})}return(r?Ql().offset(XS):Ql()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const h=l[u];return h[s]=a[c],h}))}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();zl(n,t),this.set({options:ot(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 h=y(i,o);h?l=h: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==="&ndash;"?"–":a).split(/[,;'"`]/).map(o=>KS(o)).join("")}"`)).map(s=>s.join(",")).join(`
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=Hi(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=gp.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=va().range(o).domain(this.allDataGroups)}}class hr extends sn{constructor(t){super(t),this.axisFlavor=wi.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]:[]],h=t.map(d=>[d[r],d[i.identifier]===null?"&ndash;":d[i.identifier],d[s.identifier]===null||isNaN(d[s.identifier])?"&ndash;":l(d[s.identifier],c),...a?[d[a.identifier]===null?"&ndash;":d[a.identifier]]:[],...o?[d[o.identifier]===null||isNaN(d[o.identifier])?"&ndash;":d[o.identifier]]:[]]);return super.formatTable({headers:u,cells:h})}setData(t){let n;if(t&&(n=super.setData(t),y(this.getOptions(),"zoomBar",G.TOP,"enabled"))){const r=y(this.getOptions(),"zoomBar",G.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(gn(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=Hi(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(h=>{h[s].getTime()===l&&(c+=h[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(G).forEach(i=>{const s=G[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 QS=class extends hr{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?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}};class JS extends hr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Kl(t,.25),q_50:Kl(t,.5),q_75:Kl(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(nr),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,h=c.quartiles.q_75,d=(h-u)*1.5,p=u-d,f=h+d,g=[],m=[];for(const _ of l)_<p||_>f?g.push(_):m.push(_);c.outliers=g;const v=Pn(m),b=rr(m);c.whiskers={min:v||Pn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:b||rr([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=["&ndash;"]),[l[n],y(l,"whiskers","min")!==null?i(y(l,"whiskers","min"),s):"&ndash;",y(l,"quartiles","q_25")!==null?i(y(l,"quartiles","q_25"),s):"&ndash;",y(l,"quartiles","q_50")!==null?i(y(l,"quartiles","q_50"),s):"&ndash;",y(l,"quartiles","q_75")!==null?i(y(l,"quartiles","q_75"),s):"&ndash;",y(l,"whiskers","max")!==null?i(y(l,"whiskers","max"),s):"&ndash;",y(l,"quartiles","q_75")!==null&&y(l,"quartiles","q_25")!==null?(i(y(l,"quartiles","q_75")-y(l,"quartiles","q_25")),s):"&ndash;",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=gp.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=va().range(i).domain(this.allDataGroups)}}class t$ extends hr{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?"&ndash;":s(u.value,a),y(u,"marker")===null?"&ndash;":s(u.marker,a),y(u,"marker")===null?"&ndash;":`${s(Math.floor(u[i]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}}let e$=class extends sn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(ze(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!ze(n)&&!ze(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?"&ndash;":a.id,a.name,a.value===null?"&ndash;":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=zp(this.getDisplayData(),t)}},n$=class extends sn{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=ot({},t,this.getZoomOptions(t));zl(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ot(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:qt.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(["&ndash;",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 h=0;typeof l.value=="number"&&(h=l.value,i+=l.value),r.push([l.name,s,a(h,o)])}}),i}},r$=class extends sn{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?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}};class i$ extends sn{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?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}let s$=class extends hr{constructor(t){super(t),this.axisFlavor=wi.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.")}getColorDomainOptions(){const t=this.getOptions();return y(t,"heatmap","colorDomain")}getValueDomain(){const t=je(this.getDisplayData(),i=>i.value),n=Ye().domain(t).nice().domain();n[0]>0?n[0]=0:n[0]===0&&n[1]===0&&(n[0]=0,n[1]=1),n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]);const r=this.getColorDomainOptions();return r&&(typeof r.min=="number"&&(n[0]=r.min),typeof r.max=="number"&&(n[1]=r.max)),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(ze(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(ze(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(ze(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]=gn(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(gn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){ze(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?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":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=!ze(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 u=a==="diverge"?17:11;for(let h=1;h<u+1;h++)o.push(`fill-${a}-${i}-${h}`)}this._colorScale=Vl().domain(s).range(o);const l=y(this.getOptions(),"color"),c=this.getColorDomainOptions();this._colorScale=zp(this.getDisplayData(),l,c)}},a$=class extends hr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[vt(t,"bins.rangeLabel")||"Range",...s.map(l=>vt(l,`0.${n}`))],o=[...vt(s,0).map((l,c)=>[`${r(Number(vt(l,"data.x0")),i)} – ${r(Number(vt(l,"data.x1")),i)}`,...s.map(u=>r(vt(u[c],`data.${vt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}},o$=class extends sn{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())?.reduce((s,a)=>s+a.value,0)??0,r=y(t,"meter","proportional")?n:n>100?100:n,i=y(t,"meter","status","ranges");if(i){const s=i.filter(a=>a.range[0]<=r&&r<=a.range[1]);if(s.length>0)return s[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 h=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[h[r],h.value===null?"&ndash;":a(h.value,o),...i?[i]:[]]]}else u=y(s,"total")||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(d=>{let p;d.value!==null&&d.value!==void 0?p=Number(d.value):p=0;const f=Number((d.value/u*100).toFixed(2));return[d[r],d.value===null?"&ndash;":a(p,o),a(f,o)+" %"]})];return super.formatTable({headers:l,cells:c})}},l$=class extends hr{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((h,d)=>y(u,"data",d,i)!==null?s(y(u,"data",d,i),a):"&ndash;")])];return super.formatTable({headers:l,cells:c})}},c$=class extends sn{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,"&ndash;"])}),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 u$ extends sn{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?"&ndash;":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})}}class h$ extends sn{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 d$=/\s/;function p$(e){for(var t=e.length;t--&&d$.test(e.charAt(t)););return t}var f$=/^\s+/;function m$(e){return e&&e.slice(0,p$(e)+1).replace(f$,"")}var Zp=NaN,g$=/^[-+]0x[0-9a-f]+$/i,v$=/^0b[01]+$/i,y$=/^0o[0-7]+$/i,b$=parseInt;function qr(e){if(typeof e=="number")return e;if(Bs(e))return Zp;if(ke(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ke(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=m$(e);var n=v$.test(e);return n||y$.test(e)?b$(e.slice(2),n?2:8):g$.test(e)?Zp:+e}var Jl=function(){return Ge.Date.now()},x$="Expected a function",_$=Math.max,E$=Math.min;function Oa(e,t,n){var r,i,s,a,o,l,c=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(x$);t=qr(t)||0,ke(n)&&(u=!!n.leading,h="maxWait"in n,s=h?_$(qr(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function p(O){var A=r,D=i;return r=i=void 0,c=O,a=e.apply(D,A),a}function f(O){return c=O,o=setTimeout(v,t),u?p(O):a}function g(O){var A=O-l,D=O-c,L=t-A;return h?E$(L,s-D):L}function m(O){var A=O-l,D=O-c;return l===void 0||A>=t||A<0||h&&D>=s}function v(){var O=Jl();if(m(O))return b(O);o=setTimeout(v,g(O))}function b(O){return o=void 0,d&&r?p(O):(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:b(Jl())}function x(){var O=Jl(),A=m(O);if(r=arguments,i=this,l=O,A){if(o===void 0)return f(l);if(h)return clearTimeout(o),o=setTimeout(v,t),p(l)}return o===void 0&&(o=setTimeout(v,t)),a}return x.cancel=_,x.flush=E,x}function O$(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 R(e){return typeof e=="string"?new Oe([[document.querySelector(e)]],[document.documentElement]):new Oe([[e]],$d)}function Yr(){var e=va().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 h(){var d=t().length,p=i<r,f=p?i:r,g=p?r:i;s=(g-f)/Math.max(1,d-l+c*2),o&&(s=Math.floor(s)),f+=(g-f-s*(d-l))*u,a=s*(1-l),o&&(f=Math.round(f),a=Math.round(a));var m=O$(d).map(function(v){return f+s*v});return n(p?m.reverse():m)}return e.domain=function(d){return arguments.length?(t(d),h()):t()},e.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,o=!0,h()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(d){return arguments.length?(o=!!d,h()):o},e.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),h()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),h()):l},e.paddingOuter=function(d){return arguments.length?(c=+d,h()):c},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),h()):u},e.copy=function(){return Yr(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Vr.apply(h(),arguments)}function Xp(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 tc=new Date,ec=new Date;function Zt(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=>Zt(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)=>(tc.setTime(+s),ec.setTime(+a),e(tc),e(ec),Math.floor(n(tc,ec))),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 Ta=Zt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ta.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Zt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ta),Ta.range;const Tn=1e3,Ne=Tn*60,wn=Ne*60,Sn=wn*24,nc=Sn*7,Kp=Sn*30,rc=Sn*365,Zr=Zt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Tn)},(e,t)=>(t-e)/Tn,e=>e.getUTCSeconds());Zr.range;const ic=Zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Tn)},(e,t)=>{e.setTime(+e+t*Ne)},(e,t)=>(t-e)/Ne,e=>e.getMinutes());ic.range,Zt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ne)},(e,t)=>(t-e)/Ne,e=>e.getUTCMinutes()).range;const sc=Zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Tn-e.getMinutes()*Ne)},(e,t)=>{e.setTime(+e+t*wn)},(e,t)=>(t-e)/wn,e=>e.getHours());sc.range,Zt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*wn)},(e,t)=>(t-e)/wn,e=>e.getUTCHours()).range;const rs=Zt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ne)/Sn,e=>e.getDate()-1);rs.range;const ac=Zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Sn,e=>e.getUTCDate()-1);ac.range,Zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Sn,e=>Math.floor(e/Sn)).range;function dr(e){return Zt(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())*Ne)/nc)}const wa=dr(0),Sa=dr(1),T$=dr(2),w$=dr(3),Xr=dr(4),S$=dr(5),$$=dr(6);wa.range,Sa.range,T$.range,w$.range,Xr.range,S$.range,$$.range;function pr(e){return Zt(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)/nc)}const Qp=pr(0),$a=pr(1),M$=pr(2),C$=pr(3),Kr=pr(4),A$=pr(5),L$=pr(6);Qp.range,$a.range,M$.range,C$.range,Kr.range,A$.range,L$.range;const oc=Zt(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());oc.range,Zt(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 $n=Zt(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());$n.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zt(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)}),$n.range;const fr=Zt(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());fr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zt(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)}),fr.range;function D$(e,t,n,r,i,s){const a=[[Zr,1,Tn],[Zr,5,5*Tn],[Zr,15,15*Tn],[Zr,30,30*Tn],[s,1,Ne],[s,5,5*Ne],[s,15,15*Ne],[s,30,30*Ne],[i,1,wn],[i,3,3*wn],[i,6,6*wn],[i,12,12*wn],[r,1,Sn],[r,2,2*Sn],[n,1,nc],[t,1,Kp],[t,3,3*Kp],[e,1,rc]];function o(c,u,h){const d=u<c;d&&([c,u]=[u,c]);const p=h&&typeof h.range=="function"?h:l(c,u,h),f=p?p.range(c,+u+1):[];return d?f.reverse():f}function l(c,u,h){const d=Math.abs(u-c)/h,p=vl(([,,m])=>m).right(a,d);if(p===a.length)return e.every(bl(c/rc,u/rc,h));if(p===0)return Ta.every(Math.max(bl(c,u,h),1));const[f,g]=a[d/a[p-1][2]<a[p][2]/d?p-1:p];return f.every(g)}return[o,l]}const[k$,R$]=D$($n,oc,wa,rs,sc,ic);function lc(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 cc(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 is(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function I$(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=ss(i),u=as(i),h=ss(s),d=as(s),p=ss(a),f=as(a),g=ss(o),m=as(o),v=ss(l),b=as(l),_={a:B,A:w,b:C,B:P,c:null,d:sf,e:sf,f:iM,g:fM,G:gM,H:eM,I:nM,j:rM,L:af,m:sM,M:aM,p:W,q,Q:df,s:pf,S:oM,u:lM,U:cM,V:uM,w:hM,W:dM,x:null,X:null,y:pM,Y:mM,Z:vM,"%":hf},E={a:K,A:ut,b:tt,B:X,c:null,d:lf,e:lf,f:_M,g:LM,G:kM,H:yM,I:bM,j:xM,L:cf,m:EM,M:OM,p:et,q:at,Q:df,s:pf,S:TM,u:wM,U:SM,V:$M,w:MM,W:CM,x:null,X:null,y:AM,Y:DM,Z:RM,"%":hf},x={a:N,A:M,b:V,B:k,c:H,d:nf,e:nf,f:K$,g:ef,G:tf,H:rf,I:rf,j:q$,L:X$,m:W$,M:Y$,p:L,q:j$,Q:J$,s:tM,S:Z$,u:H$,U:V$,V:G$,w:B$,W:F$,x:S,X:U,y:ef,Y:tf,Z:z$,"%":Q$};_.x=O(n,_),_.X=O(r,_),_.c=O(t,_),E.x=O(n,E),E.X=O(r,E),E.c=O(t,E);function O(j,Y){return function(Q){var z=[],ht=-1,lt=0,Mt=j.length,Gt,it,bt;for(Q instanceof Date||(Q=new Date(+Q));++ht<Mt;)j.charCodeAt(ht)===37&&(z.push(j.slice(lt,ht)),(it=Jp[Gt=j.charAt(++ht)])!=null?Gt=j.charAt(++ht):it=Gt==="e"?" ":"0",(bt=Y[Gt])&&(Gt=bt(Q,it)),z.push(Gt),lt=ht+1);return z.push(j.slice(lt,ht)),z.join("")}}function A(j,Y){return function(Q){var z=is(1900,void 0,1),ht=D(z,j,Q+="",0),lt,Mt;if(ht!=Q.length)return null;if("Q"in z)return new Date(z.Q);if("s"in z)return new Date(z.s*1e3+("L"in z?z.L:0));if(Y&&!("Z"in z)&&(z.Z=0),"p"in z&&(z.H=z.H%12+z.p*12),z.m===void 0&&(z.m="q"in z?z.q:0),"V"in z){if(z.V<1||z.V>53)return null;"w"in z||(z.w=1),"Z"in z?(lt=cc(is(z.y,0,1)),Mt=lt.getUTCDay(),lt=Mt>4||Mt===0?$a.ceil(lt):$a(lt),lt=ac.offset(lt,(z.V-1)*7),z.y=lt.getUTCFullYear(),z.m=lt.getUTCMonth(),z.d=lt.getUTCDate()+(z.w+6)%7):(lt=lc(is(z.y,0,1)),Mt=lt.getDay(),lt=Mt>4||Mt===0?Sa.ceil(lt):Sa(lt),lt=rs.offset(lt,(z.V-1)*7),z.y=lt.getFullYear(),z.m=lt.getMonth(),z.d=lt.getDate()+(z.w+6)%7)}else("W"in z||"U"in z)&&("w"in z||(z.w="u"in z?z.u%7:"W"in z?1:0),Mt="Z"in z?cc(is(z.y,0,1)).getUTCDay():lc(is(z.y,0,1)).getDay(),z.m=0,z.d="W"in z?(z.w+6)%7+z.W*7-(Mt+5)%7:z.w+z.U*7-(Mt+6)%7);return"Z"in z?(z.H+=z.Z/100|0,z.M+=z.Z%100,cc(z)):lc(z)}}function D(j,Y,Q,z){for(var ht=0,lt=Y.length,Mt=Q.length,Gt,it;ht<lt;){if(z>=Mt)return-1;if(Gt=Y.charCodeAt(ht++),Gt===37){if(Gt=Y.charAt(ht++),it=x[Gt in Jp?Y.charAt(ht++):Gt],!it||(z=it(j,Q,z))<0)return-1}else if(Gt!=Q.charCodeAt(z++))return-1}return z}function L(j,Y,Q){var z=c.exec(Y.slice(Q));return z?(j.p=u.get(z[0].toLowerCase()),Q+z[0].length):-1}function N(j,Y,Q){var z=p.exec(Y.slice(Q));return z?(j.w=f.get(z[0].toLowerCase()),Q+z[0].length):-1}function M(j,Y,Q){var z=h.exec(Y.slice(Q));return z?(j.w=d.get(z[0].toLowerCase()),Q+z[0].length):-1}function V(j,Y,Q){var z=v.exec(Y.slice(Q));return z?(j.m=b.get(z[0].toLowerCase()),Q+z[0].length):-1}function k(j,Y,Q){var z=g.exec(Y.slice(Q));return z?(j.m=m.get(z[0].toLowerCase()),Q+z[0].length):-1}function H(j,Y,Q){return D(j,t,Y,Q)}function S(j,Y,Q){return D(j,n,Y,Q)}function U(j,Y,Q){return D(j,r,Y,Q)}function B(j){return a[j.getDay()]}function w(j){return s[j.getDay()]}function C(j){return l[j.getMonth()]}function P(j){return o[j.getMonth()]}function W(j){return i[+(j.getHours()>=12)]}function q(j){return 1+~~(j.getMonth()/3)}function K(j){return a[j.getUTCDay()]}function ut(j){return s[j.getUTCDay()]}function tt(j){return l[j.getUTCMonth()]}function X(j){return o[j.getUTCMonth()]}function et(j){return i[+(j.getUTCHours()>=12)]}function at(j){return 1+~~(j.getUTCMonth()/3)}return{format:function(j){var Y=O(j+="",_);return Y.toString=function(){return j},Y},parse:function(j){var Y=A(j+="",!1);return Y.toString=function(){return j},Y},utcFormat:function(j){var Y=O(j+="",E);return Y.toString=function(){return j},Y},utcParse:function(j){var Y=A(j+="",!0);return Y.toString=function(){return j},Y}}}var Jp={"-":"",_:" ",0:"0"},Kt=/^\s*\d+/,N$=/^%/,P$=/[\\^$*+?|[\]().{}]/g;function yt(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 U$(e){return e.replace(P$,"\\$&")}function ss(e){return new RegExp("^(?:"+e.map(U$).join("|")+")","i")}function as(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function B$(e,t,n){var r=Kt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function H$(e,t,n){var r=Kt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function V$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function G$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function F$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function tf(e,t,n){var r=Kt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ef(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function z$(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 j$(e,t,n){var r=Kt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function W$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function nf(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function q$(e,t,n){var r=Kt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function rf(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Y$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Z$(e,t,n){var r=Kt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function X$(e,t,n){var r=Kt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function K$(e,t,n){var r=Kt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Q$(e,t,n){var r=N$.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function J$(e,t,n){var r=Kt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function tM(e,t,n){var r=Kt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function sf(e,t){return yt(e.getDate(),t,2)}function eM(e,t){return yt(e.getHours(),t,2)}function nM(e,t){return yt(e.getHours()%12||12,t,2)}function rM(e,t){return yt(1+rs.count($n(e),e),t,3)}function af(e,t){return yt(e.getMilliseconds(),t,3)}function iM(e,t){return af(e,t)+"000"}function sM(e,t){return yt(e.getMonth()+1,t,2)}function aM(e,t){return yt(e.getMinutes(),t,2)}function oM(e,t){return yt(e.getSeconds(),t,2)}function lM(e){var t=e.getDay();return t===0?7:t}function cM(e,t){return yt(wa.count($n(e)-1,e),t,2)}function of(e){var t=e.getDay();return t>=4||t===0?Xr(e):Xr.ceil(e)}function uM(e,t){return e=of(e),yt(Xr.count($n(e),e)+($n(e).getDay()===4),t,2)}function hM(e){return e.getDay()}function dM(e,t){return yt(Sa.count($n(e)-1,e),t,2)}function pM(e,t){return yt(e.getFullYear()%100,t,2)}function fM(e,t){return e=of(e),yt(e.getFullYear()%100,t,2)}function mM(e,t){return yt(e.getFullYear()%1e4,t,4)}function gM(e,t){var n=e.getDay();return e=n>=4||n===0?Xr(e):Xr.ceil(e),yt(e.getFullYear()%1e4,t,4)}function vM(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+yt(t/60|0,"0",2)+yt(t%60,"0",2)}function lf(e,t){return yt(e.getUTCDate(),t,2)}function yM(e,t){return yt(e.getUTCHours(),t,2)}function bM(e,t){return yt(e.getUTCHours()%12||12,t,2)}function xM(e,t){return yt(1+ac.count(fr(e),e),t,3)}function cf(e,t){return yt(e.getUTCMilliseconds(),t,3)}function _M(e,t){return cf(e,t)+"000"}function EM(e,t){return yt(e.getUTCMonth()+1,t,2)}function OM(e,t){return yt(e.getUTCMinutes(),t,2)}function TM(e,t){return yt(e.getUTCSeconds(),t,2)}function wM(e){var t=e.getUTCDay();return t===0?7:t}function SM(e,t){return yt(Qp.count(fr(e)-1,e),t,2)}function uf(e){var t=e.getUTCDay();return t>=4||t===0?Kr(e):Kr.ceil(e)}function $M(e,t){return e=uf(e),yt(Kr.count(fr(e),e)+(fr(e).getUTCDay()===4),t,2)}function MM(e){return e.getUTCDay()}function CM(e,t){return yt($a.count(fr(e)-1,e),t,2)}function AM(e,t){return yt(e.getUTCFullYear()%100,t,2)}function LM(e,t){return e=uf(e),yt(e.getUTCFullYear()%100,t,2)}function DM(e,t){return yt(e.getUTCFullYear()%1e4,t,4)}function kM(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Kr(e):Kr.ceil(e),yt(e.getUTCFullYear()%1e4,t,4)}function RM(){return"+0000"}function hf(){return"%"}function df(e){return+e}function pf(e){return Math.floor(+e/1e3)}var Qr,ff;IM({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 IM(e){return Qr=I$(e),ff=Qr.format,Qr.parse,Qr.utcFormat,Qr.utcParse,Qr}function NM(e){return new Date(e)}function PM(e){return e instanceof Date?+e:+new Date(+e)}function mf(e,t,n,r,i,s,a,o,l,c){var u=fp(),h=u.invert,d=u.domain,p=c(".%L"),f=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),b=c("%b %d"),_=c("%B"),E=c("%Y");function x(O){return(l(O)<O?p:o(O)<O?f:a(O)<O?g:s(O)<O?m:r(O)<O?i(O)<O?v:b:n(O)<O?_:E)(O)}return u.invert=function(O){return new Date(h(O))},u.domain=function(O){return arguments.length?d(Array.from(O,PM)):d().map(NM)},u.ticks=function(O){var A=d();return e(A[0],A[A.length-1],O??10)},u.tickFormat=function(O,A){return A==null?x:c(A)},u.nice=function(O){var A=d();return(!O||typeof O.range!="function")&&(O=t(A[0],A[A.length-1],O??10)),O?d(Xp(A,O)):u},u.copy=function(){return Hl(u,mf(e,t,n,r,i,s,a,o,l,c))},u}function gf(){return Vr.apply(mf(k$,R$,$n,oc,wa,rs,sc,ic,Zr,ff).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}const vf=Math.abs,ie=Math.atan2,mr=Math.cos,UM=Math.max,uc=Math.min,an=Math.sin,Jr=Math.sqrt,se=1e-12,os=Math.PI,Ma=os/2,Ca=2*os;function BM(e){return e>1?0:e<-1?os:Math.acos(e)}function yf(e){return e>=1?Ma:e<=-1?-Ma:Math.asin(e)}function bf(e){this._context=e}bf.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 Aa(e){return new bf(e)}function Vn(){}function xf(e){this._context=e}xf.prototype={areaStart:Vn,areaEnd:Vn,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 _f(e){return new xf(e)}function HM(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 VM=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Mn(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function La(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function GM(e){const t=La(e,"border-left-width"),n=La(e,"border-right-width");return e.clientWidth+t+n}function FM(e){const t=La(e,"border-top-width"),n=La(e,"border-bottom-width");return e.clientHeight+t+n}function Ef(e,t={}){const n=t.width||GM(e),r=t.height||FM(e);return{width:n,height:r}}function zM(){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 Se=16384;function jM(e){(e.width>Se||e.height>Se)&&(e.width>Se&&e.height>Se?e.width>e.height?(e.height*=Se/e.width,e.width=Se):(e.width*=Se/e.height,e.height=Se):e.width>Se?(e.height*=Se/e.width,e.width=Se):(e.width*=Se/e.height,e.height=Se))}function Da(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 WM(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qM(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),WM(i)}const ve=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ve(n,t)};function YM(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function ZM(e){return Mn(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function XM(e,t,n){const r=`.${e}:${t}`,i=n.cssText?YM(n):ZM(n);return document.createTextNode(`${r}{${i}}`)}function Of(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=VM();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(XM(s,n,r)),t.appendChild(a)}function KM(e,t){Of(e,t,":before"),Of(e,t,":after")}const Tf="application/font-woff",wf="image/jpeg",QM={woff:Tf,woff2:Tf,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:wf,jpeg:wf,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function JM(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function hc(e){const t=JM(e).toLowerCase();return QM[t]||""}function t2(e){return e.split(/,/)[1]}function dc(e){return e.search(/^(data:)/)!==-1}function e2(e,t){return`data:${t};base64,${e}`}async function Sf(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 pc={};function n2(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 fc(e,t,n){const r=n2(e,t,n.includeQueryParams);if(pc[r]!=null)return pc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await Sf(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),t2(o)));i=e2(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 pc[r]=i,i}async function r2(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Da(t)}async function i2(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a?.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return Da(o)}const n=e.poster,r=hc(n),i=await fc(n,r,t);return Da(i)}async function s2(e){var t;try{if(!((t=e?.contentDocument)===null||t===void 0)&&t.body)return await ka(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function a2(e,t){return ve(e,HTMLCanvasElement)?r2(e):ve(e,HTMLVideoElement)?i2(e,t):ve(e,HTMLIFrameElement)?s2(e):e.cloneNode(!1)}const o2=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function l2(e,t,n){var r,i;let s=[];return o2(e)&&e.assignedNodes?s=Mn(e.assignedNodes()):ve(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=Mn(e.contentDocument.body.childNodes):s=Mn(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||ve(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>ka(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function c2(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Mn(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`),ve(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 u2(e,t){ve(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ve(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function h2(e,t){if(ve(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function d2(e,t){return ve(t,Element)&&(c2(e,t),KM(e,t),u2(e,t),h2(e,t)),t}async function p2(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 ka(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 ka(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>a2(r,t)).then(r=>l2(e,r,t)).then(r=>d2(e,r)).then(r=>p2(r,t))}const $f=/url\((['"]?)([^'"]+?)\1\)/g,f2=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,m2=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function g2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function v2(e){const t=[];return e.replace($f,(n,r,i)=>(t.push(i),n)),t.filter(n=>!dc(n))}async function y2(e,t,n,r,i){try{const s=n?HM(t,n):t,a=hc(t);let o;return i||(o=await fc(s,a,r)),e.replace(g2(t),`$1${o}$3`)}catch{}return e}function b2(e,{preferredFontFormat:t}){return t?e.replace(m2,n=>{for(;;){const[r,,i]=f2.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Mf(e){return e.search($f)!==-1}async function Cf(e,t,n){if(!Mf(e))return e;const r=b2(e,n);return v2(r).reduce((i,s)=>i.then(a=>y2(a,s,t,n)),Promise.resolve(r))}async function Ra(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Cf(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function x2(e,t){await Ra("background",e,t)||await Ra("background-image",e,t),await Ra("mask",e,t)||await Ra("mask-image",e,t)}async function _2(e,t){const n=ve(e,HTMLImageElement);if(!(n&&!dc(e.src))&&!(ve(e,SVGImageElement)&&!dc(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await fc(r,hc(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 E2(e,t){const n=Mn(e.childNodes).map(r=>Af(r,t));await Promise.all(n).then(()=>e)}async function Af(e,t){ve(e,Element)&&(await x2(e,t),await _2(e,t),await E2(e,t))}function O2(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 Lf={};async function Df(e){let t=Lf[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Lf[e]=t,t}async function kf(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),Sf(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function Rf(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 T2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Mn(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Df(l).then(u=>kf(u,t)).then(u=>Rf(u).forEach(h=>{try{i.insertRule(h,h.startsWith("@import")?o+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:h,error:d})}})).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(Df(i.href).then(o=>kf(o,t)).then(o=>Rf(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{Mn(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function w2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Mf(t.style.getPropertyValue("src")))}async function S2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Mn(e.ownerDocument.styleSheets),r=await T2(n,t);return w2(r)}async function $2(e,t){const n=await S2(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return Cf(r.cssText,i,t)}))).join(`
3
+ `)}async function M2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await $2(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 C2(e,t={}){const{width:n,height:r}=Ef(e,t),i=await ka(e,t,!0);return await M2(i,t),await Af(i,t),O2(i,t),await qM(i,n,r)}async function If(e,t={}){const{width:n,height:r}=Ef(e,t),i=await C2(e,t),s=await Da(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||zM(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||jM(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 A2(e,t={}){return(await If(e,t)).toDataURL()}async function L2(e,t={}){return(await If(e,t)).toDataURL("image/jpeg",t.quality||1)}let Cn=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 D2="DONT_STYLE_ME_css_styles_verifier";let I=class zu extends Cn{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=R(t));const r={width:0,height:0},i=d=>{d&&Object.keys(r).forEach(p=>{if(d[p]){const f=d[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(d){console.error(d)}try{typeof a?.getBoundingClientRect=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(d){console.error(d)}let h;if(a instanceof SVGSVGElement&&(h={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(h),r.width>0&&r.height>0))return h;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 d={width:y(t.node(),"width","baseVal","value"),height:y(t.node(),"height","baseVal","value")};i(d)}catch{i(h),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(){const t=this.model.getOptions().chartId;t?this.chartID=t:this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=y(t,"style","prefix"),r=R(this.getHolder()).append("div").classed(`${ge}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",D2),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),R(this.getHolder()).classed(`${ge}--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=R(r);i.classed("filled",!0),L2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("jpg"):typeof o=="string"&&(a=o),t.services.files?.downloadImage(s,`${a}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=R(r);i.classed("filled",!0),A2(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("png"):typeof o=="string"&&(a=o),t.services.files?.downloadImage(s,`${a}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return R(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();R(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=R(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=zu.getSVGElementSize(R(this.mainContainer),{useBBox:!0}),n=R(this.mainContainer).attr("class"),r=R(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(zu.getSVGElementSize(R(s),{useBBox:!0}).height)}),i<=t?R(this.mainContainer).attr("height",i):R(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&R(t).on("mouseover",()=>{this.services.events?.dispatchEvent(T.Chart.MOUSEOVER)}).on("mouseout",()=>{this.services.events?.dispatchEvent(T.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Oa(()=>{t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,this.services.events?.dispatchEvent(T.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}},mc=class c1 extends Cn{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:c1.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function Nf(e){const t=k2(Pf(e),360);return Gn(t,[0,10])||Gn(t,[350,0])?{textAnchor:Qe.START,dominantBaseline:Je.MIDDLE}:Gn(t,[10,80])?{textAnchor:Qe.START,dominantBaseline:Je.HANGING}:Gn(t,[80,100])?{textAnchor:Qe.MIDDLE,dominantBaseline:Je.HANGING}:Gn(t,[100,170])?{textAnchor:Qe.END,dominantBaseline:Je.HANGING}:Gn(t,[170,190])?{textAnchor:Qe.END,dominantBaseline:Je.MIDDLE}:Gn(t,[190,260])?{textAnchor:Qe.END,dominantBaseline:Je.BASELINE}:Gn(t,[260,280])?{textAnchor:Qe.MIDDLE,dominantBaseline:Je.BASELINE}:{textAnchor:Qe.START,dominantBaseline:Je.BASELINE}}function k2(e,t){return(e%t+t)%t}function Gn(e,[t,n]){return e>=t&&e<=n}function Pf(e){return e*(180/Math.PI)}function Bt(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 R2(e,t){return t*Math.sin(e-Math.PI/2)}function I2(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 N2(e){return function(t){return e?.[t]}}var P2={À:"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"},U2=N2(P2),B2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,H2="\\u0300-\\u036f",V2="\\ufe20-\\ufe2f",G2="\\u20d0-\\u20ff",F2=H2+V2+G2,z2="["+F2+"]",j2=RegExp(z2,"g");function W2(e){return e=Pi(e),e&&e.replace(B2,U2).replace(j2,"")}var q2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Y2(e){return e.match(q2)||[]}var Z2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function X2(e){return Z2.test(e)}var Uf="\\ud800-\\udfff",K2="\\u0300-\\u036f",Q2="\\ufe20-\\ufe2f",J2="\\u20d0-\\u20ff",tC=K2+Q2+J2,Bf="\\u2700-\\u27bf",Hf="a-z\\xdf-\\xf6\\xf8-\\xff",eC="\\xac\\xb1\\xd7\\xf7",nC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rC="\\u2000-\\u206f",iC=" \\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",Vf="A-Z\\xc0-\\xd6\\xd8-\\xde",sC="\\ufe0e\\ufe0f",Gf=eC+nC+rC+iC,Ff="['’]",zf="["+Gf+"]",aC="["+tC+"]",jf="\\d+",oC="["+Bf+"]",Wf="["+Hf+"]",qf="[^"+Uf+Gf+jf+Bf+Hf+Vf+"]",lC="\\ud83c[\\udffb-\\udfff]",cC="(?:"+aC+"|"+lC+")",uC="[^"+Uf+"]",Yf="(?:\\ud83c[\\udde6-\\uddff]){2}",Zf="[\\ud800-\\udbff][\\udc00-\\udfff]",ti="["+Vf+"]",hC="\\u200d",Xf="(?:"+Wf+"|"+qf+")",dC="(?:"+ti+"|"+qf+")",Kf="(?:"+Ff+"(?:d|ll|m|re|s|t|ve))?",Qf="(?:"+Ff+"(?:D|LL|M|RE|S|T|VE))?",Jf=cC+"?",tm="["+sC+"]?",pC="(?:"+hC+"(?:"+[uC,Yf,Zf].join("|")+")"+tm+Jf+")*",fC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gC=tm+Jf+pC,vC="(?:"+[oC,Yf,Zf].join("|")+")"+gC,yC=RegExp([ti+"?"+Wf+"+"+Kf+"(?="+[zf,ti,"$"].join("|")+")",dC+"+"+Qf+"(?="+[zf,ti+Xf,"$"].join("|")+")",ti+"?"+Xf+"+"+Kf,ti+"+"+Qf,mC,fC,jf,vC].join("|"),"g");function bC(e){return e.match(yC)||[]}function xC(e,t,n){return e=Pi(e),t=t,t===void 0?X2(e)?bC(e):Y2(e):e.match(t)||[]}var _C="['’]",EC=RegExp(_C,"g");function em(e){return function(t){return I2(xC(W2(t).replace(EC,"")),e,"")}}function OC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function nm(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=qr(n),n=n===n?n:0),t!==void 0&&(t=qr(t),t=t===t?t:0),OC(qr(e),t,n)}var TC="Expected a function";function wC(e,t,n){if(typeof e!="function")throw new TypeError(TC);return setTimeout(function(){e.apply(void 0,n)},t)}var SC=Qo(function(e,t,n){return wC(e,qr(t)||0,n)});function $C(e,t){var n=-1,r=tr(e)?Array(e.length):[];return Zl(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function MC(e,t){var n=Jt(e)?Wo:$C;return n(e,Xs(t))}var CC=1/0;function AC(e,t){return Ws(MC(e,t),CC)}function rm(e,t){return Zs(e,t)}var ei=em(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});function LC(e,t){var n;return Zl(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function DC(e,t,n){var r=Jt(e)?Jh:LC;return r(e,Xs(t))}class gr{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*kC(e){for(const t of e)yield*t}function im(e){return Array.from(kC(e))}function RC(e){return e}var Ia=1,Na=2,gc=3,ls=4,sm=1e-6;function IC(e){return"translate("+e+",0)"}function NC(e){return"translate(0,"+e+")"}function PC(e){return t=>+e(t)}function UC(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function BC(){return!this.__axis}function Pa(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===Ia||e===ls?-1:1,u=e===ls||e===Na?"x":"y",h=e===Ia||e===gc?IC:NC;function d(p){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):RC),m=Math.max(s,0)+o,v=t.range(),b=+v[0]+l,_=+v[v.length-1]+l,E=(t.bandwidth?UC:PC)(t.copy(),l),x=p.selection?p.selection():p,O=x.selectAll(".domain").data([null]),A=x.selectAll(".tick").data(f,t).order(),D=A.exit(),L=A.enter().append("g").attr("class","tick"),N=A.select("line"),M=A.select("text");O=O.merge(O.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(L),N=N.merge(L.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),M=M.merge(L.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ia?"0em":e===gc?"0.71em":"0.32em")),p!==x&&(O=O.transition(p),A=A.transition(p),N=N.transition(p),M=M.transition(p),D=D.transition(p).attr("opacity",sm).attr("transform",function(V){return isFinite(V=E(V))?h(V+l):this.getAttribute("transform")}),L.attr("opacity",sm).attr("transform",function(V){var k=this.parentNode.__axis;return h((k&&isFinite(k=k(V))?k:E(V))+l)})),D.remove(),O.attr("d",e===ls||e===Na?a?"M"+c*a+","+b+"H"+l+"V"+_+"H"+c*a:"M"+l+","+b+"V"+_:a?"M"+b+","+c*a+"V"+l+"H"+_+"V"+c*a:"M"+b+","+l+"H"+_),A.attr("opacity",1).attr("transform",function(V){return h(E(V)+l)}),N.attr(u+"2",c*s),M.attr(u,c*m).text(g),x.filter(BC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Na?"start":e===ls?"end":"middle"),x.each(function(){this.__axis=E})}return d.scale=function(p){return arguments.length?(t=p,d):t},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),d):n.slice()},d.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),d):r&&r.slice()},d.tickFormat=function(p){return arguments.length?(i=p,d):i},d.tickSize=function(p){return arguments.length?(s=a=+p,d):s},d.tickSizeInner=function(p){return arguments.length?(s=+p,d):s},d.tickSizeOuter=function(p){return arguments.length?(a=+p,d):a},d.tickPadding=function(p){return arguments.length?(o=+p,d):o},d.offset=function(p){return arguments.length?(l=+p,d):l},d}function HC(e){return Pa(Ia,e)}function VC(e){return Pa(Na,e)}function vc(e){return Pa(gc,e)}function am(e){return Pa(ls,e)}const yc={capture:!0,passive:!1};function bc(e){e.preventDefault(),e.stopImmediatePropagation()}function GC(e){var t=e.document.documentElement,n=R(e).on("dragstart.drag",bc,yc);"onselectstart"in t?n.on("selectstart.drag",bc,yc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function FC(e,t){var n=e.document.documentElement,r=R(e).on("dragstart.drag",null);t&&(r.on("click.drag",bc,yc),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 zC(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const jC=e=>+e,xc=e=>()=>e;function WC(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 qC(e){e.stopImmediatePropagation()}function _c(e){e.preventDefault(),e.stopImmediatePropagation()}var om={name:"drag"},Ec={name:"space"},ni={name:"handle"},ri={name:"center"};const{abs:lm,max:ae,min:oe}=Math;function cm(e){return[+e[0],+e[1]]}function um(e){return[cm(e[0]),cm(e[1])]}var Ua={name:"x",handles:["w","e"].map(Tc),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]]}},Oc={},An={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"},hm={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},dm={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},YC={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},ZC={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Tc(e){return{type:e}}function XC(e){return!e.ctrlKey&&!e.button}function KC(){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 QC(){return navigator.maxTouchPoints||"ontouchstart"in this}function wc(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function JC(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function pm(){return tA(Ua)}function tA(e){var t=KC,n=XC,r=QC,i=!0,s=xl("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([Tc("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",An.overlay).merge(v).each(function(){var _=wc(this).extent;R(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([Tc("selection")]).enter().append("rect").attr("class","selection").attr("cursor",An.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=m.selectAll(".handle").data(e.handles,function(_){return _.type});b.exit().remove(),b.enter().append("rect").attr("class",function(_){return"handle handle--"+_.type}).attr("cursor",function(_){return An[_.type]}),m.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).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,b){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,x=u(_,arguments),O=E.selection,A=e.input(typeof v=="function"?v.apply(this,arguments):v,E.extent),D=ji(O,A);function L(N){E.selection=N===1&&A===null?null:D(N),c.call(_),x.brush()}return O!==null&&A!==null?L:L(1)}):m.each(function(){var _=this,E=arguments,x=_.__brush,O=e.input(typeof v=="function"?v.apply(_,E):v,x.extent),A=u(_,E).beforestart();Il(_),x.selection=O===null?null:O,c.call(_),A.start(b).brush(b).end(b)})},l.clear=function(m,v){l.move(m,null,v)};function c(){var m=R(this),v=wc(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(b){return b.type[b.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(b){return b.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(b){return b.type==="e"||b.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,b){var _=m.__brush.emitter;return _&&(!b||!_.clean)?_:new h(m,v,b)}function h(m,v,b){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=b}h.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,b){var _=R(this.that).datum();s.call(m,this.that,new WC(m,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:b,dispatch:s}),_)}};function d(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,b=m.target.__data__.type,_=(i&&m.metaKey?b="overlay":b)==="selection"?om:i&&m.altKey?ri:ni,E=e===Oc?null:YC[b],x=e===Ua?null:ZC[b],O=wc(v),A=O.extent,D=O.selection,L=A[0][0],N,M,V=A[0][1],k,H,S=A[1][0],U,B,w=A[1][1],C,P,W=0,q=0,K,ut=E&&x&&i&&m.shiftKey,tt,X,et=Array.from(m.touches||[m],it=>{const bt=it.identifier;return it=ir(it,v),it.point0=it.slice(),it.identifier=bt,it});Il(v);var at=u(v,arguments,!0).beforestart();if(b==="overlay"){D&&(K=!0);const it=[et[0],et[1]||et[0]];O.selection=D=[[N=e===Oc?L:oe(it[0][0],it[1][0]),k=e===Ua?V:oe(it[0][1],it[1][1])],[U=e===Oc?S:ae(it[0][0],it[1][0]),C=e===Ua?w:ae(it[0][1],it[1][1])]],et.length>1&&ht(m)}else N=D[0][0],k=D[0][1],U=D[1][0],C=D[1][1];M=N,H=k,B=U,P=C;var j=R(v).attr("pointer-events","none"),Y=j.selectAll(".overlay").attr("cursor",An[b]);if(m.touches)at.moved=z,at.ended=lt;else{var Q=R(m.view).on("mousemove.brush",z,!0).on("mouseup.brush",lt,!0);i&&Q.on("keydown.brush",Mt,!0).on("keyup.brush",Gt,!0),GC(m.view)}c.call(v),at.start(m,_.name);function z(it){for(const bt of it.changedTouches||[it])for(const He of et)He.identifier===bt.identifier&&(He.cur=ir(bt,v));if(ut&&!tt&&!X&&et.length===1){const bt=et[0];lm(bt.cur[0]-bt[0])>lm(bt.cur[1]-bt[1])?X=!0:tt=!0}for(const bt of et)bt.cur&&(bt[0]=bt.cur[0],bt[1]=bt.cur[1]);K=!0,_c(it),ht(it)}function ht(it){const bt=et[0],He=bt.point0;var pe;switch(W=bt[0]-He[0],q=bt[1]-He[1],_){case Ec:case om:{E&&(W=ae(L-N,oe(S-U,W)),M=N+W,B=U+W),x&&(q=ae(V-k,oe(w-C,q)),H=k+q,P=C+q);break}case ni:{et[1]?(E&&(M=ae(L,oe(S,et[0][0])),B=ae(L,oe(S,et[1][0])),E=1),x&&(H=ae(V,oe(w,et[0][1])),P=ae(V,oe(w,et[1][1])),x=1)):(E<0?(W=ae(L-N,oe(S-N,W)),M=N+W,B=U):E>0&&(W=ae(L-U,oe(S-U,W)),M=N,B=U+W),x<0?(q=ae(V-k,oe(w-k,q)),H=k+q,P=C):x>0&&(q=ae(V-C,oe(w-C,q)),H=k,P=C+q));break}case ri:{E&&(M=ae(L,oe(S,N-W*E)),B=ae(L,oe(S,U+W*E))),x&&(H=ae(V,oe(w,k-q*x)),P=ae(V,oe(w,C+q*x)));break}}B<M&&(E*=-1,pe=N,N=U,U=pe,pe=M,M=B,B=pe,b in hm&&Y.attr("cursor",An[b=hm[b]])),P<H&&(x*=-1,pe=k,k=C,C=pe,pe=H,H=P,P=pe,b in dm&&Y.attr("cursor",An[b=dm[b]])),O.selection&&(D=O.selection),tt&&(M=D[0][0],B=D[1][0]),X&&(H=D[0][1],P=D[1][1]),(D[0][0]!==M||D[0][1]!==H||D[1][0]!==B||D[1][1]!==P)&&(O.selection=[[M,H],[B,P]],c.call(v),at.brush(it,_.name))}function lt(it){if(qC(it),it.touches){if(it.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else FC(it.view,K),Q.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);j.attr("pointer-events","all"),Y.attr("cursor",An.overlay),O.selection&&(D=O.selection),JC(D)&&(O.selection=null,c.call(v)),at.end(it,_.name)}function Mt(it){switch(it.keyCode){case 16:{ut=E&&x;break}case 18:{_===ni&&(E&&(U=B-W*E,N=M+W*E),x&&(C=P-q*x,k=H+q*x),_=ri,ht(it));break}case 32:{(_===ni||_===ri)&&(E<0?U=B-W:E>0&&(N=M-W),x<0?C=P-q:x>0&&(k=H-q),_=Ec,Y.attr("cursor",An.selection),ht(it));break}default:return}_c(it)}function Gt(it){switch(it.keyCode){case 16:{ut&&(tt=X=ut=!1,ht(it));break}case 18:{_===ri&&(E<0?U=B:E>0&&(N=M),x<0?C=P:x>0&&(k=H),_=ni,ht(it));break}case 32:{_===Ec&&(it.altKey?(E&&(U=B-W*E,N=M+W*E),x&&(C=P-q*x,k=H+q*x),_=ri):(E<0?U=B:E>0&&(N=M),x<0?C=P:x>0&&(k=H),_=ni),Y.attr("cursor",An[b]),ht(it));break}default:return}_c(it)}}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=um(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:xc(um(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:xc(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:xc(!!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 Sc=Math.PI,$c=2*Sc,vr=1e-6,eA=$c-vr;function fm(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function nA(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return fm;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 Mc=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?fm:nA(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,h=o-n,d=u*u+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>vr)if(!(Math.abs(h*l-c*u)>vr)||!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),b=Math.sqrt(d),_=s*Math.tan((Sc-Math.acos((g+d-m)/(2*v*b)))/2),E=_/b,x=_/v;Math.abs(E-1)>vr&&this._append`L${t+E*u},${n+E*h}`,this._append`A${s},${s},0,0,${+(h*p>u*f)},${this._x1=t+x*l},${this._y1=n+x*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,h=1^a,d=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>vr||Math.abs(this._y1-u)>vr)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%$c+$c),d>eA?this._append`A${r},${r},0,1,${h},${t-o},${n-l}A${r},${r},0,1,${h},${this._x1=c},${this._y1=u}`:d>vr&&this._append`A${r},${r},0,${+(d>=Sc)},${h},${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 mm(){return new Mc}mm.prototype=Mc.prototype;var Tt=1e-6,gm=1e-12,mt=Math.PI,ye=mt/2,vm=mt/4,$e=mt*2,ce=180/mt,Ht=mt/180,wt=Math.abs,ym=Math.atan,yr=Math.atan2,$t=Math.cos,rA=Math.exp,iA=Math.log,Et=Math.sin,Fn=Math.sign||function(e){return e>0?1:e<0?-1:0},Xe=Math.sqrt,sA=Math.tan;function aA(e){return e>1?0:e<-1?mt:Math.acos(e)}function Ln(e){return e>1?ye:e<-1?-ye:Math.asin(e)}function Pe(){}function Ba(e,t){e&&xm.hasOwnProperty(e.type)&&xm[e.type](e,t)}var bm={Feature:function(e,t){Ba(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Ba(n[r].geometry,t)}},xm={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){Cc(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Cc(n[r],t,0)},Polygon:function(e,t){_m(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)_m(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Ba(n[r],t)}};function Cc(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 _m(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Cc(e[n],t,1);t.polygonEnd()}function ii(e,t){e&&bm.hasOwnProperty(e.type)?bm[e.type](e,t):Ba(e,t)}function Ac(e){return[yr(e[1],e[0]),Ln(e[2])]}function si(e){var t=e[0],n=e[1],r=$t(n);return[r*$t(t),r*Et(t),Et(n)]}function Ha(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Va(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 Lc(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ga(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Dc(e){var t=Xe(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function kc(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 Rc(e,t){return wt(e)>mt&&(e-=Math.round(e/$e)*$e),[e,t]}Rc.invert=Rc;function Em(e,t,n){return(e%=$e)?t||n?kc(Tm(e),wm(t,n)):Tm(e):t||n?wm(t,n):Rc}function Om(e){return function(t,n){return t+=e,wt(t)>mt&&(t-=Math.round(t/$e)*$e),[t,n]}}function Tm(e){var t=Om(e);return t.invert=Om(-e),t}function wm(e,t){var n=$t(e),r=Et(e),i=$t(t),s=Et(t);function a(o,l){var c=$t(l),u=$t(o)*c,h=Et(o)*c,d=Et(l),p=d*n+u*r;return[yr(h*i-p*s,u*n-d*r),Ln(p*i+h*s)]}return a.invert=function(o,l){var c=$t(l),u=$t(o)*c,h=Et(o)*c,d=Et(l),p=d*i-h*s;return[yr(h*i+d*s,u*n+p*r),Ln(p*n-u*r)]},a}function oA(e){e=Em(e[0]*Ht,e[1]*Ht,e.length>2?e[2]*Ht:0);function t(n){return n=e(n[0]*Ht,n[1]*Ht),n[0]*=ce,n[1]*=ce,n}return t.invert=function(n){return n=e.invert(n[0]*Ht,n[1]*Ht),n[0]*=ce,n[1]*=ce,n},t}function lA(e,t,n,r,i,s){if(n){var a=$t(t),o=Et(t),l=r*n;i==null?(i=t+r*$e,s=t-l/2):(i=Sm(a,i),s=Sm(a,s),(r>0?i<s:i>s)&&(i+=r*$e));for(var c,u=i;r>0?u>s:u<s;u-=l)c=Ac([a,-o*$t(u),-o*Et(u)]),e.point(c[0],c[1])}}function Sm(e,t){t=si(t),t[0]-=e,Dc(t);var n=aA(-t[1]);return((-t[2]<0?-n:n)+$e-Tt)%$e}function $m(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Pe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Fa(e,t){return wt(e[0]-t[0])<Tt&&wt(e[1]-t[1])<Tt}function za(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 Mm(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],b;if(Fa(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*Tt}s.push(b=new za(m,f,null,!0)),a.push(b.o=new za(m,null,b,!1)),s.push(b=new za(v,f,null,!1)),a.push(b.o=new za(v,null,b,!0))}}),!!s.length){for(a.sort(t),Cm(s),Cm(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,h;;){for(var d=c,p=!0;d.v;)if((d=d.n)===c)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(o=0,l=u.length;o<l;++o)i.point((h=u[o])[0],h[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(p)for(u=d.p.z,o=u.length-1;o>=0;--o)i.point((h=u[o])[0],h[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Cm(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 Ic(e){return wt(e[0])<=mt?e[0]:Fn(e[0])*((wt(e[0])+mt)%$e-mt)}function cA(e,t){var n=Ic(t),r=t[1],i=Et(r),s=[Et(n),-$t(n),0],a=0,o=0,l=new gr;i===1?r=ye+Tt:i===-1&&(r=-ye-Tt);for(var c=0,u=e.length;c<u;++c)if(d=(h=e[c]).length)for(var h,d,p=h[d-1],f=Ic(p),g=p[1]/2+vm,m=Et(g),v=$t(g),b=0;b<d;++b,f=E,m=O,v=A,p=_){var _=h[b],E=Ic(_),x=_[1]/2+vm,O=Et(x),A=$t(x),D=E-f,L=D>=0?1:-1,N=L*D,M=N>mt,V=m*O;if(l.add(yr(V*L*Et(N),v*A+V*$t(N))),a+=M?D+L*$e:D,M^f>=n^E>=n){var k=Va(si(p),si(_));Dc(k);var H=Va(s,k);Dc(H);var S=(M^D>=0?-1:1)*Ln(H[2]);(r>S||r===S&&(k[0]||k[1]))&&(o+=M^D>=0?1:-1)}}return(a<-Tt||a<Tt&&l<-gm)^o&1}function Am(e,t,n,r){return function(i){var s=t(i),a=$m(),o=t(a),l=!1,c,u,h,d={point:p,lineStart:g,lineEnd:m,polygonStart:function(){d.point=v,d.lineStart=b,d.lineEnd=_,u=[],c=[]},polygonEnd:function(){d.point=p,d.lineStart=g,d.lineEnd=m,u=im(u);var E=cA(c,r);u.length?(l||(i.polygonStart(),l=!0),Mm(u,hA,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,x){e(E,x)&&i.point(E,x)}function f(E,x){s.point(E,x)}function g(){d.point=f,s.lineStart()}function m(){d.point=p,s.lineEnd()}function v(E,x){h.push([E,x]),o.point(E,x)}function b(){o.lineStart(),h=[]}function _(){v(h[0][0],h[0][1]),o.lineEnd();var E=o.clean(),x=a.result(),O,A=x.length,D,L,N;if(h.pop(),c.push(h),h=null,!!A){if(E&1){if(L=x[0],(D=L.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),O=0;O<D;++O)i.point((N=L[O])[0],N[1]);i.lineEnd()}return}A>1&&E&2&&x.push(x.pop().concat(x.shift())),u.push(x.filter(uA))}}return d}}function uA(e){return e.length>1}function hA(e,t){return((e=e.x)[0]<0?e[1]-ye-Tt:ye-e[1])-((t=t.x)[0]<0?t[1]-ye-Tt:ye-t[1])}const Lm=Am(function(){return!0},dA,fA,[-mt,-ye]);function dA(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=wt(s-t);wt(l-mt)<Tt?(e.point(t,n=(n+a)/2>0?ye:-ye),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=mt&&(wt(t-r)<Tt&&(t-=r*Tt),wt(s-o)<Tt&&(s-=o*Tt),n=pA(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 pA(e,t,n,r){var i,s,a=Et(e-n);return wt(a)>Tt?ym((Et(t)*(s=$t(r))*Et(n)-Et(r)*(i=$t(t))*Et(e))/(i*s*a)):(t+r)/2}function fA(e,t,n,r){var i;if(e==null)i=n*ye,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(wt(e[0]-t[0])>Tt){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 mA(e){var t=$t(e),n=2*Ht,r=t>0,i=wt(t)>Tt;function s(u,h,d,p){lA(p,e,n,d,u,h)}function a(u,h){return $t(u)*$t(h)>t}function o(u){var h,d,p,f,g;return{lineStart:function(){f=p=!1,g=1},point:function(m,v){var b=[m,v],_,E=a(m,v),x=r?E?0:c(m,v):E?c(m+(m<0?mt:-mt),v):0;if(!h&&(f=p=E)&&u.lineStart(),E!==p&&(_=l(h,b),(!_||Fa(h,_)||Fa(b,_))&&(b[2]=1)),E!==p)g=0,E?(u.lineStart(),_=l(b,h),u.point(_[0],_[1])):(_=l(h,b),u.point(_[0],_[1],2),u.lineEnd()),h=_;else if(i&&h&&r^E){var O;!(x&d)&&(O=l(b,h,!0))&&(g=0,r?(u.lineStart(),u.point(O[0][0],O[0][1]),u.point(O[1][0],O[1][1]),u.lineEnd()):(u.point(O[1][0],O[1][1]),u.lineEnd(),u.lineStart(),u.point(O[0][0],O[0][1],3)))}E&&(!h||!Fa(h,b))&&u.point(b[0],b[1]),h=b,p=E,d=x},lineEnd:function(){p&&u.lineEnd(),h=null},clean:function(){return g|(f&&p)<<1}}}function l(u,h,d){var p=si(u),f=si(h),g=[1,0,0],m=Va(p,f),v=Ha(m,m),b=m[0],_=v-b*b;if(!_)return!d&&u;var E=t*v/_,x=-t*b/_,O=Va(g,m),A=Ga(g,E),D=Ga(m,x);Lc(A,D);var L=O,N=Ha(A,L),M=Ha(L,L),V=N*N-M*(Ha(A,A)-1);if(!(V<0)){var k=Xe(V),H=Ga(L,(-N-k)/M);if(Lc(H,A),H=Ac(H),!d)return H;var S=u[0],U=h[0],B=u[1],w=h[1],C;U<S&&(C=S,S=U,U=C);var P=U-S,W=wt(P-mt)<Tt,q=W||P<Tt;if(!W&&w<B&&(C=B,B=w,w=C),q?W?B+w>0^H[1]<(wt(H[0]-S)<Tt?B:w):B<=H[1]&&H[1]<=w:P>mt^(S<=H[0]&&H[0]<=U)){var K=Ga(L,(-N+k)/M);return Lc(K,A),[H,Ac(K)]}}}function c(u,h){var d=r?e:mt-e,p=0;return u<-d?p|=1:u>d&&(p|=2),h<-d?p|=4:h>d&&(p|=8),p}return Am(a,o,s,r?[0,-e]:[-mt,e-mt])}function gA(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,h=1,d=l-a,p=c-o,f;if(f=n-a,!(!d&&f>0)){if(f/=d,d<0){if(f<u)return;f<h&&(h=f)}else if(d>0){if(f>h)return;f>u&&(u=f)}if(f=i-a,!(!d&&f<0)){if(f/=d,d<0){if(f>h)return;f>u&&(u=f)}else if(d>0){if(f<u)return;f<h&&(h=f)}if(f=r-o,!(!p&&f>0)){if(f/=p,p<0){if(f<u)return;f<h&&(h=f)}else if(p>0){if(f>h)return;f>u&&(u=f)}if(f=s-o,!(!p&&f<0)){if(f/=p,p<0){if(f>h)return;f>u&&(u=f)}else if(p>0){if(f<u)return;f<h&&(h=f)}return u>0&&(e[0]=a+u*d,e[1]=o+u*p),h<1&&(t[0]=a+h*d,t[1]=o+h*p),!0}}}}}var cs=1e9,ja=-cs;function vA(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,h,d){var p=0,f=0;if(c==null||(p=a(c,h))!==(f=a(u,h))||l(c,u)<0^h>0)do d.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+h+4)%4)!==f);else d.point(u[0],u[1])}function a(c,u){return wt(c[0]-e)<Tt?u>0?0:3:wt(c[0]-n)<Tt?u>0?2:1:wt(c[1]-t)<Tt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var h=a(c,1),d=a(u,1);return h!==d?h-d:h===0?u[1]-c[1]:h===1?c[0]-u[0]:h===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,h=$m(),d,p,f,g,m,v,b,_,E,x,O,A={point:D,lineStart:V,lineEnd:k,polygonStart:N,polygonEnd:M};function D(S,U){i(S,U)&&u.point(S,U)}function L(){for(var S=0,U=0,B=p.length;U<B;++U)for(var w=p[U],C=1,P=w.length,W=w[0],q,K,ut=W[0],tt=W[1];C<P;++C)q=ut,K=tt,W=w[C],ut=W[0],tt=W[1],K<=r?tt>r&&(ut-q)*(r-K)>(tt-K)*(e-q)&&++S:tt<=r&&(ut-q)*(r-K)<(tt-K)*(e-q)&&--S;return S}function N(){u=h,d=[],p=[],O=!0}function M(){var S=L(),U=O&&S,B=(d=im(d)).length;(U||B)&&(c.polygonStart(),U&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),B&&Mm(d,o,S,s,c),c.polygonEnd()),u=c,d=p=f=null}function V(){A.point=H,p&&p.push(f=[]),x=!0,E=!1,b=_=NaN}function k(){d&&(H(g,m),v&&E&&h.rejoin(),d.push(h.result())),A.point=D,E&&u.lineEnd()}function H(S,U){var B=i(S,U);if(p&&f.push([S,U]),x)g=S,m=U,v=B,x=!1,B&&(u.lineStart(),u.point(S,U));else if(B&&E)u.point(S,U);else{var w=[b=Math.max(ja,Math.min(cs,b)),_=Math.max(ja,Math.min(cs,_))],C=[S=Math.max(ja,Math.min(cs,S)),U=Math.max(ja,Math.min(cs,U))];gA(w,C,e,t,n,r)?(E||(u.lineStart(),u.point(w[0],w[1])),u.point(C[0],C[1]),B||u.lineEnd(),O=!1):B&&(u.lineStart(),u.point(S,U),O=!1)}b=S,_=U,E=B}return A}}const Nc=e=>e;var Pc=new gr,Uc=new gr,Dm,km,Bc,Hc,Dn={point:Pe,lineStart:Pe,lineEnd:Pe,polygonStart:function(){Dn.lineStart=yA,Dn.lineEnd=xA},polygonEnd:function(){Dn.lineStart=Dn.lineEnd=Dn.point=Pe,Pc.add(wt(Uc)),Uc=new gr},result:function(){var e=Pc/2;return Pc=new gr,e}};function yA(){Dn.point=bA}function bA(e,t){Dn.point=Rm,Dm=Bc=e,km=Hc=t}function Rm(e,t){Uc.add(Hc*e-Bc*t),Bc=e,Hc=t}function xA(){Rm(Dm,km)}var ai=1/0,Wa=ai,us=-ai,qa=us,Ya={point:_A,lineStart:Pe,lineEnd:Pe,polygonStart:Pe,polygonEnd:Pe,result:function(){var e=[[ai,Wa],[us,qa]];return us=qa=-(Wa=ai=1/0),e}};function _A(e,t){e<ai&&(ai=e),e>us&&(us=e),t<Wa&&(Wa=t),t>qa&&(qa=t)}var Vc=0,Gc=0,hs=0,Za=0,Xa=0,oi=0,Fc=0,zc=0,ds=0,Im,Nm,on,ln,Ue={point:br,lineStart:Pm,lineEnd:Um,polygonStart:function(){Ue.lineStart=TA,Ue.lineEnd=wA},polygonEnd:function(){Ue.point=br,Ue.lineStart=Pm,Ue.lineEnd=Um},result:function(){var e=ds?[Fc/ds,zc/ds]:oi?[Za/oi,Xa/oi]:hs?[Vc/hs,Gc/hs]:[NaN,NaN];return Vc=Gc=hs=Za=Xa=oi=Fc=zc=ds=0,e}};function br(e,t){Vc+=e,Gc+=t,++hs}function Pm(){Ue.point=EA}function EA(e,t){Ue.point=OA,br(on=e,ln=t)}function OA(e,t){var n=e-on,r=t-ln,i=Xe(n*n+r*r);Za+=i*(on+e)/2,Xa+=i*(ln+t)/2,oi+=i,br(on=e,ln=t)}function Um(){Ue.point=br}function TA(){Ue.point=SA}function wA(){Bm(Im,Nm)}function SA(e,t){Ue.point=Bm,br(Im=on=e,Nm=ln=t)}function Bm(e,t){var n=e-on,r=t-ln,i=Xe(n*n+r*r);Za+=i*(on+e)/2,Xa+=i*(ln+t)/2,oi+=i,i=ln*e-on*t,Fc+=i*(on+e),zc+=i*(ln+t),ds+=i*3,br(on=e,ln=t)}function Hm(e){this._context=e}Hm.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,$e);break}}},result:Pe};var jc=new gr,Wc,Vm,Gm,ps,fs,ms={point:Pe,lineStart:function(){ms.point=$A},lineEnd:function(){Wc&&Fm(Vm,Gm),ms.point=Pe},polygonStart:function(){Wc=!0},polygonEnd:function(){Wc=null},result:function(){var e=+jc;return jc=new gr,e}};function $A(e,t){ms.point=Fm,Vm=ps=e,Gm=fs=t}function Fm(e,t){ps-=e,fs-=t,jc.add(Xe(ps*ps+fs*fs)),ps=e,fs=t}let zm,Ka,jm,Wm;class qm{constructor(t){this._append=t==null?Ym:MA(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!==jm||this._append!==Ka){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`,jm=r,Ka=this._append,Wm=this._,this._=i}this._+=Wm;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Ym(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function MA(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Ym;if(t!==zm){const n=10**t;zm=t,Ka=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 Ka}function CA(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),ii(o,i(s))),s.result()}return a.area=function(o){return ii(o,i(Dn)),Dn.result()},a.measure=function(o){return ii(o,i(ms)),ms.result()},a.bounds=function(o){return ii(o,i(Ya)),Ya.result()},a.centroid=function(o){return ii(o,i(Ue)),Ue.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Nc):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new qm(n)):new Hm(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 qm(n)),a},a.projection(e).digits(n).context(t)}function qc(e){return function(t){var n=new Yc;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Yc(){}Yc.prototype={constructor:Yc,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 Zc(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),ii(n,e.stream(Ya)),t(Ya.result()),r!=null&&e.clipExtent(r),e}function Zm(e,t,n){return Zc(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 AA(e,t,n){return Zm(e,[[0,0],t],n)}function LA(e,t,n){return Zc(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 DA(e,t,n){return Zc(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 Xm=16,kA=$t(30*Ht);function Km(e,t){return+t?IA(e,t):RA(e)}function RA(e){return qc({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function IA(e,t){function n(r,i,s,a,o,l,c,u,h,d,p,f,g,m){var v=c-r,b=u-i,_=v*v+b*b;if(_>4*t&&g--){var E=a+d,x=o+p,O=l+f,A=Xe(E*E+x*x+O*O),D=Ln(O/=A),L=wt(wt(O)-1)<Tt||wt(s-h)<Tt?(s+h)/2:yr(x,E),N=e(L,D),M=N[0],V=N[1],k=M-r,H=V-i,S=b*k-v*H;(S*S/_>t||wt((v*k+b*H)/_-.5)>.3||a*d+o*p+l*f<kA)&&(n(r,i,s,a,o,l,M,V,L,E/=A,x/=A,O,g,m),m.point(M,V),n(M,V,L,E,x,O,c,u,h,d,p,f,g,m))}}return function(r){var i,s,a,o,l,c,u,h,d,p,f,g,m={point:v,lineStart:b,lineEnd:E,polygonStart:function(){r.polygonStart(),m.lineStart=x},polygonEnd:function(){r.polygonEnd(),m.lineStart=b}};function v(D,L){D=e(D,L),r.point(D[0],D[1])}function b(){h=NaN,m.point=_,r.lineStart()}function _(D,L){var N=si([D,L]),M=e(D,L);n(h,d,u,p,f,g,h=M[0],d=M[1],u=D,p=N[0],f=N[1],g=N[2],Xm,r),r.point(h,d)}function E(){m.point=v,r.lineEnd()}function x(){b(),m.point=O,m.lineEnd=A}function O(D,L){_(i=D,L),s=h,a=d,o=p,l=f,c=g,m.point=_}function A(){n(h,d,u,p,f,g,s,a,i,o,l,c,Xm,r),m.lineEnd=E,E()}return m}}var NA=qc({point:function(e,t){this.stream.point(e*Ht,t*Ht)}});function PA(e){return qc({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function UA(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 Qm(e,t,n,r,i,s){if(!s)return UA(e,t,n,r,i);var a=$t(s),o=Et(s),l=a*e,c=o*e,u=a/e,h=o/e,d=(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-h*m+d),i*(p-h*g-u*m)]},f}function Qa(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,h=0,d=1,p=1,f=null,g=Lm,m=null,v,b,_,E=Nc,x=.5,O,A,D,L,N;function M(S){return D(S[0]*Ht,S[1]*Ht)}function V(S){return S=D.invert(S[0],S[1]),S&&[S[0]*ce,S[1]*ce]}M.stream=function(S){return L&&N===S?L:L=NA(PA(u)(g(O(E(N=S)))))},M.preclip=function(S){return arguments.length?(g=S,f=void 0,H()):g},M.postclip=function(S){return arguments.length?(E=S,m=v=b=_=null,H()):E},M.clipAngle=function(S){return arguments.length?(g=+S?mA(f=S*Ht):(f=null,Lm),H()):f*ce},M.clipExtent=function(S){return arguments.length?(E=S==null?(m=v=b=_=null,Nc):vA(m=+S[0][0],v=+S[0][1],b=+S[1][0],_=+S[1][1]),H()):m==null?null:[[m,v],[b,_]]},M.scale=function(S){return arguments.length?(n=+S,k()):n},M.translate=function(S){return arguments.length?(r=+S[0],i=+S[1],k()):[r,i]},M.center=function(S){return arguments.length?(s=S[0]%360*Ht,a=S[1]%360*Ht,k()):[s*ce,a*ce]},M.rotate=function(S){return arguments.length?(o=S[0]%360*Ht,l=S[1]%360*Ht,c=S.length>2?S[2]%360*Ht:0,k()):[o*ce,l*ce,c*ce]},M.angle=function(S){return arguments.length?(h=S%360*Ht,k()):h*ce},M.reflectX=function(S){return arguments.length?(d=S?-1:1,k()):d<0},M.reflectY=function(S){return arguments.length?(p=S?-1:1,k()):p<0},M.precision=function(S){return arguments.length?(O=Km(A,x=S*S),H()):Xe(x)},M.fitExtent=function(S,U){return Zm(M,S,U)},M.fitSize=function(S,U){return AA(M,S,U)},M.fitWidth=function(S,U){return LA(M,S,U)},M.fitHeight=function(S,U){return DA(M,S,U)};function k(){var S=Qm(n,0,0,d,p,h).apply(null,t(s,a)),U=Qm(n,r-S[0],i-S[1],d,p,h);return u=Em(o,l,c),A=kc(t,U),D=kc(u,A),O=Km(A,x),H()}function H(){return L=N=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&V,k()}}function tg(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]*Ht,n=s[1]*Ht):[t*ce,n*ce]},i}function BA(e){var t=$t(e);function n(r,i){return[r*t,Et(i)/t]}return n.invert=function(r,i){return[r/t,Ln(i*t)]},n}function HA(e,t){var n=Et(e),r=(n+Et(t))/2;if(wt(r)<Tt)return BA(e);var i=1+n*(2*r-n),s=Xe(i)/r;function a(o,l){var c=Xe(i-2*r*Et(l))/r;return[c*Et(o*=r),s-c*$t(o)]}return a.invert=function(o,l){var c=s-l,u=yr(o,wt(c))*Fn(c);return c*r<0&&(u-=mt*Fn(o)*Fn(c)),[u/r,Ln((i-(o*o+c*c)*r*r)/(2*r))]},a}function eg(){return tg(HA).scale(155.424).center([0,33.6442])}function VA(){return eg().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Xc(e,t){return[e,iA(sA((ye+t)/2))]}Xc.invert=function(e,t){return[e,2*ym(rA(t))-ye]};function GA(){return FA(Xc).scale(961/$e)}function FA(e){var t=Qa(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(h){return arguments.length?(r(h),u()):r()},t.translate=function(h){return arguments.length?(i(h),u()):i()},t.center=function(h){return arguments.length?(n(h),u()):n()},t.clipExtent=function(h){return arguments.length?(h==null?a=o=l=c=null:(a=+h[0][0],o=+h[0][1],l=+h[1][0],c=+h[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var h=mt*r(),d=t(oA(t.rotate()).invert([0,0]));return s(a==null?[[d[0]-h,d[1]-h],[d[0]+h,d[1]+h]]:e===Xc?[[Math.max(d[0]-h,a),o],[Math.min(d[0]+h,l),c]]:[[a,Math.max(d[1]-h,o)],[l,Math.min(d[1]+h,c)]])}return u()}function Ja(e,t){return[e,t]}Ja.invert=Ja;function zA(){return Qa(Ja).scale(152.63)}function jA(e,t){var n=$t(e),r=e===t?Et(e):(n-$t(t))/(t-e),i=n/r+e;if(wt(r)<Tt)return Ja;function s(a,o){var l=i-o,c=r*a;return[l*Et(c),i-l*$t(c)]}return s.invert=function(a,o){var l=i-o,c=yr(a,wt(l))*Fn(l);return l*r<0&&(c-=mt*Fn(a)*Fn(l)),[c/r,i-Fn(r)*Xe(a*a+l*l)]},s}function WA(){return tg(jA).scale(131.154).center([0,13.9389])}var gs=1.340264,vs=-.081106,ys=893e-6,bs=.003796,to=Xe(3)/2,qA=12;function ng(e,t){var n=Ln(to*Et(t)),r=n*n,i=r*r*r;return[e*$t(n)/(to*(gs+3*vs*r+i*(7*ys+9*bs*r))),n*(gs+vs*r+i*(ys+bs*r))]}ng.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<qA&&(o=n*(gs+vs*r+i*(ys+bs*r))-t,l=gs+3*vs*r+i*(7*ys+9*bs*r),n-=a=o/l,r=n*n,i=r*r*r,!(wt(a)<gm));++s);return[to*e*(gs+3*vs*r+i*(7*ys+9*bs*r))/$t(n),Ln(Et(n)/to)]};function YA(){return Qa(ng).scale(177.158)}function rg(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)))]}rg.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(wt(i)>Tt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function ZA(){return Qa(rg).scale(175.295)}function XA(e,t){return e.parent===t.parent?1:2}function KA(e){return e.reduce(QA,0)/e.length}function QA(e,t){return e+t.x}function JA(e){return 1+e.reduce(tL,0)}function tL(e,t){return Math.max(e,t.y)}function eL(e){for(var t;t=e.children;)e=t[0];return e}function nL(e){for(var t;t=e.children;)e=t[t.length-1];return e}function rL(){var e=XA,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(d){var p=d.children;p?(d.x=KA(p),d.y=JA(p)):(d.x=a?o+=e(d,a):0,d.y=0,a=d)});var l=eL(s),c=nL(s),u=l.x-e(l,c)/2,h=c.x+e(c,l)/2;return s.eachAfter(r?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-u)/(h-u)*t,d.y=(1-(s.y?d.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 iL(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 sL(){return this.eachAfter(iL)}function aL(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function oL(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 lL(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 cL(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function uL(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 hL(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function dL(e){for(var t=this,n=pL(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 pL(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 fL(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function mL(){return Array.from(this)}function gL(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function vL(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*yL(){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 xs(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=_L)):t===void 0&&(t=xL);for(var n=new _s(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 _s(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(OL)}function bL(){return xs(this).eachBefore(EL)}function xL(e){return e.children}function _L(e){return Array.isArray(e)?e[1]:null}function EL(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function OL(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function _s(e){this.data=e,this.depth=this.height=0,this.parent=null}_s.prototype=xs.prototype={constructor:_s,count:sL,each:aL,eachAfter:lL,eachBefore:oL,find:cL,sum:uL,sort:hL,path:dL,ancestors:fL,descendants:mL,leaves:gL,links:vL,copy:bL,[Symbol.iterator]:yL};function TL(e){return e==null?null:ig(e)}function ig(e){if(typeof e!="function")throw new Error;return e}function xr(){return 0}function li(e){return function(){return e}}const wL=1664525,SL=1013904223,sg=4294967296;function $L(){let e=1;return()=>(e=(wL*e+SL)%sg)/sg}function ML(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function CL(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 AL(e,t){for(var n=0,r=(e=CL(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&ag(a,s)?++n:(a=DL(i=LL(i,s)),n=0);return a}function LL(e,t){var n,r;if(Kc(t,e))return[t];for(n=0;n<e.length;++n)if(eo(t,e[n])&&Kc(Es(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(eo(Es(e[n],e[r]),t)&&eo(Es(e[n],t),e[r])&&eo(Es(e[r],t),e[n])&&Kc(og(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function eo(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 ag(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 Kc(e,t){for(var n=0;n<t.length;++n)if(!ag(e,t[n]))return!1;return!0}function DL(e){switch(e.length){case 1:return kL(e[0]);case 2:return Es(e[0],e[1]);case 3:return og(e[0],e[1],e[2])}}function kL(e){return{x:e.x,y:e.y,r:e.r}}function Es(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,h=Math.sqrt(l*l+c*c);return{x:(n+s+l/h*u)/2,y:(r+a+c/h*u)/2,r:(h+i+o)/2}}function og(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,h=n.r,d=r-a,p=r-c,f=i-o,g=i-u,m=l-s,v=h-s,b=r*r+i*i-s*s,_=b-a*a-o*o+l*l,E=b-c*c-u*u+h*h,x=p*f-d*g,O=(f*E-g*_)/(x*2)-r,A=(g*m-f*v)/x,D=(p*_-d*E)/(x*2)-i,L=(d*v-p*m)/x,N=A*A+L*L-1,M=2*(s+O*A+D*L),V=O*O+D*D-s*s,k=-(Math.abs(N)>1e-6?(M+Math.sqrt(M*M-4*N*V))/(2*N):V/M);return{x:r+O+A*k,y:i+D+L*k,r:k}}function lg(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 cg(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 ug(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 no(e){this._=e,this.next=null,this.previous=null}function RL(e,t){if(!(s=(e=ML(e)).length))return 0;var n,r,i,s,a,o,l,c,u,h,d;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;lg(r,n,i=e[2]),n=new no(n),r=new no(r),i=new no(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){lg(n._,r._,i=e[l]),i=new no(i),c=r.next,u=n.previous,h=r._.r,d=n._.r;do if(h<=d){if(cg(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}h+=c._.r,c=c.next}else{if(cg(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}d+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=ug(n);(i=i.next)!==r;)(o=ug(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=AL(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function IL(e){return Math.sqrt(e.value)}function NL(){var e=null,t=1,n=1,r=xr;function i(s){const a=$L();return s.x=t/2,s.y=n/2,e?s.eachBefore(hg(e)).eachAfter(Qc(r,.5,a)).eachBefore(dg(1)):s.eachBefore(hg(IL)).eachAfter(Qc(xr,1,a)).eachAfter(Qc(r,s.r/Math.min(t,n),a)).eachBefore(dg(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=TL(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:li(+s),i):r},i}function hg(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Qc(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=RL(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function dg(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 PL(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 UL(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 BL(e,t){return e.parent===t.parent?1:2}function Jc(e){var t=e.children;return t?t[0]:e.t}function tu(e){var t=e.children;return t?t[t.length-1]:e.t}function HL(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 VL(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 GL(e,t,n){return e.a.parent===t.parent?e.a:n}function ro(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}ro.prototype=Object.create(_s.prototype);function FL(e){for(var t=new ro(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 ro(s[a],a)),i.parent=n;return(t.parent=new ro(null,0)).children=[t],t}function zL(){var e=BL,t=1,n=1,r=null;function i(c){var u=FL(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var h=c,d=c,p=c;c.eachBefore(function(b){b.x<h.x&&(h=b),b.x>d.x&&(d=b),b.depth>p.depth&&(p=b)});var f=h===d?1:e(h,d)/2,g=f-h.x,m=t/(d.x+f+g),v=n/(p.depth||1);c.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*v})}return c}function s(c){var u=c.children,h=c.parent.children,d=c.i?h[c.i-1]:null;if(u){VL(c);var p=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+e(c._,d._),c.m=c.z-p):c.z=p}else d&&(c.z=d.z+e(c._,d._));c.parent.A=o(c,d,c.parent.A||h[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,h){if(u){for(var d=c,p=c,f=u,g=d.parent.children[0],m=d.m,v=p.m,b=f.m,_=g.m,E;f=tu(f),d=Jc(d),f&&d;)g=Jc(g),p=tu(p),p.a=c,E=f.z+b-d.z-m+e(f._,d._),E>0&&(HL(GL(f,c,h),c,E),m+=E,v+=E),b+=f.m,m+=d.m,_+=g.m,v+=p.m;f&&!tu(p)&&(p.t=f,p.m+=b-v),d&&!Jc(g)&&(g.t=d,g.m+=m-_,h=c)}return h}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 jL(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 WL=(1+Math.sqrt(5))/2;function qL(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,h=0,d=o.length,p,f,g=t.value,m,v,b,_,E,x,O;u<d;){p=i-n,f=s-r;do m=o[h++].value;while(!m&&h<d);for(v=b=m,x=Math.max(f/p,p/f)/(g*e),O=m*m*x,E=Math.max(b/O,O/v);h<d;++h){if(m+=c=o[h].value,c<v&&(v=c),c>b&&(b=c),O=m*m*x,_=Math.max(b/O,O/v),_>E){m-=c;break}E=_}a.push(l={value:m,dice:p<f,children:o.slice(u,h)}),l.dice?UL(l,n,r,i,g?r+=f*m/g:s):jL(l,n,r,g?n+=p*m/g:i,s),g-=m,u=h}return a}const YL=function e(t){function n(r,i,s,a,o){qL(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(WL);function ZL(){var e=YL,t=!1,n=1,r=1,i=[0],s=xr,a=xr,o=xr,l=xr,c=xr;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(h),i=[0],t&&d.eachBefore(PL),d}function h(d){var p=i[d.depth],f=d.x0+p,g=d.y0+p,m=d.x1-p,v=d.y1-p;m<f&&(f=m=(f+m)/2),v<g&&(g=v=(g+v)/2),d.x0=f,d.y0=g,d.x1=m,d.y1=v,d.children&&(p=i[d.depth+1]=s(d)/2,f+=c(d)-p,g+=a(d)-p,m-=o(d)-p,v-=l(d)-p,m<f&&(f=m=(f+m)/2),v<g&&(g=v=(g+v)/2),e(d,f,g,m,v))}return u.round=function(d){return arguments.length?(t=!!d,u):t},u.size=function(d){return arguments.length?(n=+d[0],r=+d[1],u):[n,r]},u.tile=function(d){return arguments.length?(e=ig(d),u):e},u.padding=function(d){return arguments.length?u.paddingInner(d).paddingOuter(d):u.paddingInner()},u.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:li(+d),u):s},u.paddingOuter=function(d){return arguments.length?u.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):u.paddingTop()},u.paddingTop=function(d){return arguments.length?(a=typeof d=="function"?d:li(+d),u):a},u.paddingRight=function(d){return arguments.length?(o=typeof d=="function"?d:li(+d),u):o},u.paddingBottom=function(d){return arguments.length?(l=typeof d=="function"?d:li(+d),u):l},u.paddingLeft=function(d){return arguments.length?(c=typeof d=="function"?d:li(+d),u):c},u}function io(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 Mc(t)}function XL(e){return e.innerRadius}function KL(e){return e.outerRadius}function QL(e){return e.startAngle}function JL(e){return e.endAngle}function tD(e){return e&&e.padAngle}function eD(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,h=o-s,d=h*l-u*c;if(!(d*d<se))return d=(u*(t-s)-h*(e-i))/d,[e+d*l,t+d*c]}function so(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Jr(o*o+l*l),u=c*l,h=-c*o,d=e+u,p=t+h,f=n+u,g=r+h,m=(d+f)/2,v=(p+g)/2,b=f-d,_=g-p,E=b*b+_*_,x=i-s,O=d*g-f*p,A=(_<0?-1:1)*Jr(UM(0,x*x*E-O*O)),D=(O*_-b*A)/E,L=(-O*b-_*A)/E,N=(O*_+b*A)/E,M=(-O*b+_*A)/E,V=D-m,k=L-v,H=N-m,S=M-v;return V*V+k*k>H*H+S*S&&(D=N,L=M),{cx:D,cy:L,x01:-u,y01:-h,x11:D*(i/x-1),y11:L*(i/x-1)}}function Os(){var e=XL,t=KL,n=ft(0),r=null,i=QL,s=JL,a=tD,o=null,l=io(c);function c(){var u,h,d=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-Ma,g=s.apply(this,arguments)-Ma,m=vf(g-f),v=g>f;if(o||(o=u=l()),p<d&&(h=p,p=d,d=h),!(p>se))o.moveTo(0,0);else if(m>Ca-se)o.moveTo(p*mr(f),p*an(f)),o.arc(0,0,p,f,g,!v),d>se&&(o.moveTo(d*mr(g),d*an(g)),o.arc(0,0,d,g,f,v));else{var b=f,_=g,E=f,x=g,O=m,A=m,D=a.apply(this,arguments)/2,L=D>se&&(r?+r.apply(this,arguments):Jr(d*d+p*p)),N=uc(vf(p-d)/2,+n.apply(this,arguments)),M=N,V=N,k,H;if(L>se){var S=yf(L/d*an(D)),U=yf(L/p*an(D));(O-=S*2)>se?(S*=v?1:-1,E+=S,x-=S):(O=0,E=x=(f+g)/2),(A-=U*2)>se?(U*=v?1:-1,b+=U,_-=U):(A=0,b=_=(f+g)/2)}var B=p*mr(b),w=p*an(b),C=d*mr(x),P=d*an(x);if(N>se){var W=p*mr(_),q=p*an(_),K=d*mr(E),ut=d*an(E),tt;if(m<os)if(tt=eD(B,w,K,ut,W,q,C,P)){var X=B-tt[0],et=w-tt[1],at=W-tt[0],j=q-tt[1],Y=1/an(BM((X*at+et*j)/(Jr(X*X+et*et)*Jr(at*at+j*j)))/2),Q=Jr(tt[0]*tt[0]+tt[1]*tt[1]);M=uc(N,(d-Q)/(Y-1)),V=uc(N,(p-Q)/(Y+1))}else M=V=0}A>se?V>se?(k=so(K,ut,B,w,p,V,v),H=so(W,q,C,P,p,V,v),o.moveTo(k.cx+k.x01,k.cy+k.y01),V<N?o.arc(k.cx,k.cy,V,ie(k.y01,k.x01),ie(H.y01,H.x01),!v):(o.arc(k.cx,k.cy,V,ie(k.y01,k.x01),ie(k.y11,k.x11),!v),o.arc(0,0,p,ie(k.cy+k.y11,k.cx+k.x11),ie(H.cy+H.y11,H.cx+H.x11),!v),o.arc(H.cx,H.cy,V,ie(H.y11,H.x11),ie(H.y01,H.x01),!v))):(o.moveTo(B,w),o.arc(0,0,p,b,_,!v)):o.moveTo(B,w),!(d>se)||!(O>se)?o.lineTo(C,P):M>se?(k=so(C,P,W,q,d,-M,v),H=so(B,w,K,ut,d,-M,v),o.lineTo(k.cx+k.x01,k.cy+k.y01),M<N?o.arc(k.cx,k.cy,M,ie(k.y01,k.x01),ie(H.y01,H.x01),!v):(o.arc(k.cx,k.cy,M,ie(k.y01,k.x01),ie(k.y11,k.x11),!v),o.arc(0,0,d,ie(k.cy+k.y11,k.cx+k.x11),ie(H.cy+H.y11,H.cx+H.x11),v),o.arc(H.cx,H.cy,M,ie(H.y11,H.x11),ie(H.y01,H.x01),!v))):o.arc(0,0,d,x,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,h=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-os/2;return[mr(h)*u,an(h)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ft(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ft(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ft(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ft(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ft(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ft(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ft(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}function eu(e){return e[0]}function nu(e){return e[1]}function Ts(e,t){var n=ft(!0),r=null,i=Aa,s=null,a=io(o);e=typeof e=="function"?e:e===void 0?eu:ft(e),t=typeof t=="function"?t:t===void 0?nu:ft(t);function o(l){var c,u=(l=Ea(l)).length,h,d=!1,p;for(r==null&&(s=i(p=a())),c=0;c<=u;++c)!(c<u&&n(h=l[c],c,l))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(h,c,l),+t(h,c,l));if(p)return s=null,p+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:ft(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ft(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ft(!!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 ru(e,t,n){var r=null,i=ft(!0),s=null,a=Aa,o=null,l=io(c);e=typeof e=="function"?e:e===void 0?eu:ft(+e),t=typeof t=="function"?t:ft(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?nu:ft(+n);function c(h){var d,p,f,g=(h=Ea(h)).length,m,v=!1,b,_=new Array(g),E=new Array(g);for(s==null&&(o=a(b=l())),d=0;d<=g;++d){if(!(d<g&&i(m=h[d],d,h))===v)if(v=!v)p=d,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),f=d-1;f>=p;--f)o.point(_[f],E[f]);o.lineEnd(),o.areaEnd()}v&&(_[d]=+e(m,d,h),E[d]=+t(m,d,h),o.point(r?+r(m,d,h):_[d],n?+n(m,d,h):E[d]))}if(b)return o=null,b+""||null}function u(){return Ts().defined(i).curve(a).context(s)}return c.x=function(h){return arguments.length?(e=typeof h=="function"?h:ft(+h),r=null,c):e},c.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ft(+h),c):e},c.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:ft(+h),c):r},c.y=function(h){return arguments.length?(t=typeof h=="function"?h:ft(+h),n=null,c):t},c.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ft(+h),c):t},c.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ft(+h),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(h){return arguments.length?(i=typeof h=="function"?h:ft(!!h),c):i},c.curve=function(h){return arguments.length?(a=h,s!=null&&(o=a(s)),c):a},c.context=function(h){return arguments.length?(h==null?s=o=null:o=a(s=h),c):s},c}function nD(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function rD(e){return e}function iD(){var e=rD,t=nD,n=null,r=ft(0),i=ft(Ca),s=ft(0);function a(o){var l,c=(o=Ea(o)).length,u,h,d=0,p=new Array(c),f=new Array(c),g=+r.apply(this,arguments),m=Math.min(Ca,Math.max(-Ca,i.apply(this,arguments)-g)),v,b=Math.min(Math.abs(m)/c,s.apply(this,arguments)),_=b*(m<0?-1:1),E;for(l=0;l<c;++l)(E=f[p[l]=l]=+e(o[l],l,o))>0&&(d+=E);for(t!=null?p.sort(function(x,O){return t(f[x],f[O])}):n!=null&&p.sort(function(x,O){return n(o[x],o[O])}),l=0,h=d?(m-c*_)/d:0;l<c;++l,g=v)u=p[l],E=f[u],v=g+(E>0?E*h:0)+_,f[u]={data:o[u],index:l,value:E,startAngle:g,endAngle:v,padAngle:b};return f}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:ft(+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:ft(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ft(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:ft(+o),a):s},a}var sD=fg(Aa);function pg(e){this._curve=e}pg.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 fg(e){function t(n){return new pg(e(n))}return t._curve=e,t}function aD(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(fg(n)):t()._curve},e}function oD(){return aD(Ts().curve(sD))}class lD{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 cD(e){return new lD(e,!0)}function uD(e){return e.source}function hD(e){return e.target}function dD(e){let t=uD,n=hD,r=eu,i=nu,s=null,a=null,o=io(l);function l(){let c;const u=DS.call(arguments),h=t.apply(this,u),d=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=d,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:ft(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:ft(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function pD(){return dD(cD)}let gt=class{constructor(t,n,r){if(this.type="",this.renderType=rt.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(R(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){const n=this.parent;if(this.parent=t,!(n&&n.node()===t.node())&&this.type){const r=y(this.model.getOptions(),"style","prefix");this.parent?.classed(`${ge}--${r}--${this.type}`,!0),n&&n.classed(`${ge}--${r}--${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=I.appendOrSelect(this.parent,`${this.renderType===rt.SVG?"svg":"div"}${r}.${ge}--${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=R(`#${s}`).select("rect");if(a.size()!==0){const o=parseFloat(a.attr("height")),l=parseFloat(a.attr("width"));!isNaN(o)&&!isNaN(l)&&o>0&&l>0&&i.attr("clip-path",`url(#${s})`)}}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?ot({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};/*! @license DOMPurify 3.4.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.2/LICENSE */const{entries:mg,setPrototypeOf:gg,isFrozen:fD,getPrototypeOf:mD,getOwnPropertyDescriptor:gD}=Object;let{freeze:ue,seal:Be,create:ci}=Object,{apply:iu,construct:su}=typeof Reflect<"u"&&Reflect;ue||(ue=function(e){return e}),Be||(Be=function(e){return e}),iu||(iu=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),su||(su=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const ws=Yt(Array.prototype.forEach),vD=Yt(Array.prototype.lastIndexOf),vg=Yt(Array.prototype.pop),Ss=Yt(Array.prototype.push),yD=Yt(Array.prototype.splice),he=Array.isArray,$s=Yt(String.prototype.toLowerCase),au=Yt(String.prototype.toString),yg=Yt(String.prototype.match),ui=Yt(String.prototype.replace),bg=Yt(String.prototype.indexOf),bD=Yt(String.prototype.trim),xD=Yt(Number.prototype.toString),_D=Yt(Boolean.prototype.toString),xg=typeof BigInt>"u"?null:Yt(BigInt.prototype.toString),_g=typeof Symbol>"u"?null:Yt(Symbol.prototype.toString),Vt=Yt(Object.prototype.hasOwnProperty),Ms=Yt(Object.prototype.toString),ee=Yt(RegExp.prototype.test),ao=ED(TypeError);function Yt(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 iu(e,t,r)}}function ED(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return su(e,n)}}function pt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$s;if(gg&&gg(e,null),!he(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(fD(t)||(t[r]=s),i=s)}e[i]=!0}return e}function OD(e){for(let t=0;t<e.length;t++)Vt(e,t)||(e[t]=null);return e}function be(e){const t=ci(null);for(const[n,r]of mg(e))Vt(e,n)&&(he(r)?t[n]=OD(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=be(r):t[n]=r);return t}function TD(e){switch(typeof e){case"string":return e;case"number":return xD(e);case"boolean":return _D(e);case"bigint":return xg?xg(e):"0";case"symbol":return _g?_g(e):"Symbol()";case"undefined":return Ms(e);case"function":case"object":{if(e===null)return Ms(e);const t=e,n=hi(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Ms(r)}return Ms(e)}default:return Ms(e)}}function hi(e,t){for(;e!==null;){const r=gD(e,t);if(r){if(r.get)return Yt(r.get);if(typeof r.value=="function")return Yt(r.value)}e=mD(e)}function n(){return null}return n}function wD(e){try{return ee(e,""),!0}catch{return!1}}const Eg=ue(["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","search","section","select","shadow","slot","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"]),ou=ue(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),lu=ue(["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"]),SD=ue(["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"]),cu=ue(["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"]),$D=ue(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Og=ue(["#text"]),Tg=ue(["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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),uu=ue(["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","mask-type","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"]),wg=ue(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),oo=ue(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MD=Be(/\{\{[\w\W]*|[\w\W]*\}\}/gm),CD=Be(/<%[\w\W]*|[\w\W]*%>/gm),AD=Be(/\$\{[\w\W]*/gm),LD=Be(/^data-[\-\w.\u00B7-\uFFFF]+$/),DD=Be(/^aria-[\-\w]+$/),Sg=Be(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kD=Be(/^(?:\w+script|data):/i),RD=Be(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$g=Be(/^html$/i),ID=Be(/^[a-z][.\w]*(-[.\w]+)+$/i);var Mg=Object.freeze({__proto__:null,ARIA_ATTR:DD,ATTR_WHITESPACE:RD,CUSTOM_ELEMENT:ID,DATA_ATTR:LD,DOCTYPE_NAME:$g,ERB_EXPR:CD,IS_ALLOWED_URI:Sg,IS_SCRIPT_OR_DATA:kD,MUSTACHE_EXPR:MD,TMPLIT_EXPR:AD});const Cs={element:1,text:3,progressingInstruction:7,comment:8,document:9},ND=function(){return typeof window>"u"?null:window},PD=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}},Cg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ag(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ND();const t=$=>Ag($);if(t.version="3.4.2",t.removed=[],!e||!e.document||e.document.nodeType!==Cs.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:h,DOMParser:d,trustedTypes:p}=e,f=l.prototype,g=hi(f,"cloneNode"),m=hi(f,"remove"),v=hi(f,"nextSibling"),b=hi(f,"childNodes"),_=hi(f,"parentNode");if(typeof a=="function"){const $=n.createElement("template");$.content&&$.content.ownerDocument&&(n=$.content.ownerDocument)}let E,x="";const{implementation:O,createNodeIterator:A,createDocumentFragment:D,getElementsByTagName:L}=n,{importNode:N}=r;let M=Cg();t.isSupported=typeof mg=="function"&&typeof _=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:V,ERB_EXPR:k,TMPLIT_EXPR:H,DATA_ATTR:S,ARIA_ATTR:U,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:w,CUSTOM_ELEMENT:C}=Mg;let{IS_ALLOWED_URI:P}=Mg,W=null;const q=pt({},[...Eg,...ou,...lu,...cu,...Og]);let K=null;const ut=pt({},[...Tg,...uu,...wg,...oo]);let tt=Object.seal(ci(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}})),X=null,et=null;const at=Object.seal(ci(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let j=!0,Y=!0,Q=!1,z=!0,ht=!1,lt=!0,Mt=!1,Gt=!1,it=!1,bt=!1,He=!1,pe=!1,Ds=!0,gi=!1;const vi="user-content-";let Rn=!0,ks=!1,yi={},hn=null;const Iu=pt({},["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 Zv=null;const Xv=pt({},["audio","video","img","source","image","track"]);let Nu=null;const Kv=pt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Eo="http://www.w3.org/1998/Math/MathML",Oo="http://www.w3.org/2000/svg",dn="http://www.w3.org/1999/xhtml";let bi=dn,Pu=!1,Uu=null;const mU=pt({},[Eo,Oo,dn],au);let Bu=pt({},["mi","mo","mn","ms","mtext"]),Hu=pt({},["annotation-xml"]);const gU=pt({},["title","style","font","a","script"]);let Rs=null;const vU=["application/xhtml+xml","text/html"],yU="text/html";let Xt=null,xi=null;const bU=n.createElement("form"),Qv=function($){return $ instanceof RegExp||$ instanceof Function},Vu=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(xi&&xi===$)return;(!$||typeof $!="object")&&($={}),$=be($),Rs=vU.indexOf($.PARSER_MEDIA_TYPE)===-1?yU:$.PARSER_MEDIA_TYPE,Xt=Rs==="application/xhtml+xml"?au:$s,W=Vt($,"ALLOWED_TAGS")&&he($.ALLOWED_TAGS)?pt({},$.ALLOWED_TAGS,Xt):q,K=Vt($,"ALLOWED_ATTR")&&he($.ALLOWED_ATTR)?pt({},$.ALLOWED_ATTR,Xt):ut,Uu=Vt($,"ALLOWED_NAMESPACES")&&he($.ALLOWED_NAMESPACES)?pt({},$.ALLOWED_NAMESPACES,au):mU,Nu=Vt($,"ADD_URI_SAFE_ATTR")&&he($.ADD_URI_SAFE_ATTR)?pt(be(Kv),$.ADD_URI_SAFE_ATTR,Xt):Kv,Zv=Vt($,"ADD_DATA_URI_TAGS")&&he($.ADD_DATA_URI_TAGS)?pt(be(Xv),$.ADD_DATA_URI_TAGS,Xt):Xv,hn=Vt($,"FORBID_CONTENTS")&&he($.FORBID_CONTENTS)?pt({},$.FORBID_CONTENTS,Xt):Iu,X=Vt($,"FORBID_TAGS")&&he($.FORBID_TAGS)?pt({},$.FORBID_TAGS,Xt):be({}),et=Vt($,"FORBID_ATTR")&&he($.FORBID_ATTR)?pt({},$.FORBID_ATTR,Xt):be({}),yi=Vt($,"USE_PROFILES")?$.USE_PROFILES&&typeof $.USE_PROFILES=="object"?be($.USE_PROFILES):$.USE_PROFILES:!1,j=$.ALLOW_ARIA_ATTR!==!1,Y=$.ALLOW_DATA_ATTR!==!1,Q=$.ALLOW_UNKNOWN_PROTOCOLS||!1,z=$.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ht=$.SAFE_FOR_TEMPLATES||!1,lt=$.SAFE_FOR_XML!==!1,Mt=$.WHOLE_DOCUMENT||!1,bt=$.RETURN_DOM||!1,He=$.RETURN_DOM_FRAGMENT||!1,pe=$.RETURN_TRUSTED_TYPE||!1,it=$.FORCE_BODY||!1,Ds=$.SANITIZE_DOM!==!1,gi=$.SANITIZE_NAMED_PROPS||!1,Rn=$.KEEP_CONTENT!==!1,ks=$.IN_PLACE||!1,P=wD($.ALLOWED_URI_REGEXP)?$.ALLOWED_URI_REGEXP:Sg,bi=typeof $.NAMESPACE=="string"?$.NAMESPACE:dn,Bu=Vt($,"MATHML_TEXT_INTEGRATION_POINTS")&&$.MATHML_TEXT_INTEGRATION_POINTS&&typeof $.MATHML_TEXT_INTEGRATION_POINTS=="object"?be($.MATHML_TEXT_INTEGRATION_POINTS):pt({},["mi","mo","mn","ms","mtext"]),Hu=Vt($,"HTML_INTEGRATION_POINTS")&&$.HTML_INTEGRATION_POINTS&&typeof $.HTML_INTEGRATION_POINTS=="object"?be($.HTML_INTEGRATION_POINTS):pt({},["annotation-xml"]);const Z=Vt($,"CUSTOM_ELEMENT_HANDLING")&&$.CUSTOM_ELEMENT_HANDLING&&typeof $.CUSTOM_ELEMENT_HANDLING=="object"?be($.CUSTOM_ELEMENT_HANDLING):ci(null);if(tt=ci(null),Vt(Z,"tagNameCheck")&&Qv(Z.tagNameCheck)&&(tt.tagNameCheck=Z.tagNameCheck),Vt(Z,"attributeNameCheck")&&Qv(Z.attributeNameCheck)&&(tt.attributeNameCheck=Z.attributeNameCheck),Vt(Z,"allowCustomizedBuiltInElements")&&typeof Z.allowCustomizedBuiltInElements=="boolean"&&(tt.allowCustomizedBuiltInElements=Z.allowCustomizedBuiltInElements),ht&&(Y=!1),He&&(bt=!0),yi&&(W=pt({},Og),K=ci(null),yi.html===!0&&(pt(W,Eg),pt(K,Tg)),yi.svg===!0&&(pt(W,ou),pt(K,uu),pt(K,oo)),yi.svgFilters===!0&&(pt(W,lu),pt(K,uu),pt(K,oo)),yi.mathMl===!0&&(pt(W,cu),pt(K,wg),pt(K,oo))),at.tagCheck=null,at.attributeCheck=null,Vt($,"ADD_TAGS")&&(typeof $.ADD_TAGS=="function"?at.tagCheck=$.ADD_TAGS:he($.ADD_TAGS)&&(W===q&&(W=be(W)),pt(W,$.ADD_TAGS,Xt))),Vt($,"ADD_ATTR")&&(typeof $.ADD_ATTR=="function"?at.attributeCheck=$.ADD_ATTR:he($.ADD_ATTR)&&(K===ut&&(K=be(K)),pt(K,$.ADD_ATTR,Xt))),Vt($,"ADD_URI_SAFE_ATTR")&&he($.ADD_URI_SAFE_ATTR)&&pt(Nu,$.ADD_URI_SAFE_ATTR,Xt),Vt($,"FORBID_CONTENTS")&&he($.FORBID_CONTENTS)&&(hn===Iu&&(hn=be(hn)),pt(hn,$.FORBID_CONTENTS,Xt)),Vt($,"ADD_FORBID_CONTENTS")&&he($.ADD_FORBID_CONTENTS)&&(hn===Iu&&(hn=be(hn)),pt(hn,$.ADD_FORBID_CONTENTS,Xt)),Rn&&(W["#text"]=!0),Mt&&pt(W,["html","head","body"]),W.table&&(pt(W,["tbody"]),delete X.tbody),$.TRUSTED_TYPES_POLICY){if(typeof $.TRUSTED_TYPES_POLICY.createHTML!="function")throw ao('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof $.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ao('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=$.TRUSTED_TYPES_POLICY,x=E.createHTML("")}else E===void 0&&(E=PD(p,i)),E!==null&&typeof x=="string"&&(x=E.createHTML(""));ue&&ue($),xi=$},Jv=pt({},[...ou,...lu,...SD]),t1=pt({},[...cu,...$D]),xU=function($){let Z=_($);(!Z||!Z.tagName)&&(Z={namespaceURI:bi,tagName:"template"});const J=$s($.tagName),St=$s(Z.tagName);return Uu[$.namespaceURI]?$.namespaceURI===Oo?Z.namespaceURI===dn?J==="svg":Z.namespaceURI===Eo?J==="svg"&&(St==="annotation-xml"||Bu[St]):!!Jv[J]:$.namespaceURI===Eo?Z.namespaceURI===dn?J==="math":Z.namespaceURI===Oo?J==="math"&&Hu[St]:!!t1[J]:$.namespaceURI===dn?Z.namespaceURI===Oo&&!Hu[St]||Z.namespaceURI===Eo&&!Bu[St]?!1:!t1[J]&&(gU[J]||!Jv[J]):!!(Rs==="application/xhtml+xml"&&Uu[$.namespaceURI]):!1},Or=function($){Ss(t.removed,{element:$});try{_($).removeChild($)}catch{m($)}},Tr=function($,Z){try{Ss(t.removed,{attribute:Z.getAttributeNode($),from:Z})}catch{Ss(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute($),$==="is")if(bt||He)try{Or(Z)}catch{}else try{Z.setAttribute($,"")}catch{}},e1=function($){let Z=null,J=null;if(it)$="<remove></remove>"+$;else{const Pt=yg($,/^[\r\n\t ]+/);J=Pt&&Pt[0]}Rs==="application/xhtml+xml"&&bi===dn&&($='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+$+"</body></html>");const St=E?E.createHTML($):$;if(bi===dn)try{Z=new d().parseFromString(St,Rs)}catch{}if(!Z||!Z.documentElement){Z=O.createDocument(bi,"template",null);try{Z.documentElement.innerHTML=Pu?x:St}catch{}}const ne=Z.body||Z.documentElement;return $&&J&&ne.insertBefore(n.createTextNode(J),ne.childNodes[0]||null),bi===dn?L.call(Z,Mt?"html":"body")[0]:Mt?Z.documentElement:ne},n1=function($){return A.call($.ownerDocument||$,$,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Gu=function($){return $ instanceof h&&(typeof $.nodeName!="string"||typeof $.textContent!="string"||typeof $.removeChild!="function"||!($.attributes instanceof u)||typeof $.removeAttribute!="function"||typeof $.setAttribute!="function"||typeof $.namespaceURI!="string"||typeof $.insertBefore!="function"||typeof $.hasChildNodes!="function")},Fu=function($){return typeof o=="function"&&$ instanceof o};function In($,Z,J){ws($,St=>{St.call(t,Z,J,xi)})}const r1=function($){let Z=null;if(In(M.beforeSanitizeElements,$,null),Gu($))return Or($),!0;const J=Xt($.nodeName);if(In(M.uponSanitizeElement,$,{tagName:J,allowedTags:W}),lt&&$.hasChildNodes()&&!Fu($.firstElementChild)&&ee(/<[/\w!]/g,$.innerHTML)&&ee(/<[/\w!]/g,$.textContent)||lt&&$.namespaceURI===dn&&J==="style"&&Fu($.firstElementChild)||$.nodeType===Cs.progressingInstruction||lt&&$.nodeType===Cs.comment&&ee(/<[/\w]/g,$.data))return Or($),!0;if(X[J]||!(at.tagCheck instanceof Function&&at.tagCheck(J))&&!W[J]){if(!X[J]&&s1(J)&&(tt.tagNameCheck instanceof RegExp&&ee(tt.tagNameCheck,J)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(J)))return!1;if(Rn&&!hn[J]){const St=_($)||$.parentNode,ne=b($)||$.childNodes;if(ne&&St){const Pt=ne.length;for(let Nn=Pt-1;Nn>=0;--Nn){const pn=g(ne[Nn],!0);St.insertBefore(pn,v($))}}}return Or($),!0}return $ instanceof l&&!xU($)||(J==="noscript"||J==="noembed"||J==="noframes")&&ee(/<\/no(script|embed|frames)/i,$.innerHTML)?(Or($),!0):(ht&&$.nodeType===Cs.text&&(Z=$.textContent,ws([V,k,H],St=>{Z=ui(Z,St," ")}),$.textContent!==Z&&(Ss(t.removed,{element:$.cloneNode()}),$.textContent=Z)),In(M.afterSanitizeElements,$,null),!1)},i1=function($,Z,J){if(et[Z]||Ds&&(Z==="id"||Z==="name")&&(J in n||J in bU))return!1;const St=K[Z]||at.attributeCheck instanceof Function&&at.attributeCheck(Z,$);if(!(Y&&!et[Z]&&ee(S,Z))&&!(j&&ee(U,Z))){if(!St||et[Z]){if(!(s1($)&&(tt.tagNameCheck instanceof RegExp&&ee(tt.tagNameCheck,$)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck($))&&(tt.attributeNameCheck instanceof RegExp&&ee(tt.attributeNameCheck,Z)||tt.attributeNameCheck instanceof Function&&tt.attributeNameCheck(Z,$))||Z==="is"&&tt.allowCustomizedBuiltInElements&&(tt.tagNameCheck instanceof RegExp&&ee(tt.tagNameCheck,J)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(J))))return!1}else if(!Nu[Z]&&!ee(P,ui(J,w,""))&&!((Z==="src"||Z==="xlink:href"||Z==="href")&&$!=="script"&&bg(J,"data:")===0&&Zv[$])&&!(Q&&!ee(B,ui(J,w,"")))&&J)return!1}return!0},_U=pt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),s1=function($){return!_U[$s($)]&&ee(C,$)},a1=function($){In(M.beforeSanitizeAttributes,$,null);const{attributes:Z}=$;if(!Z||Gu($))return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:K,forceKeepAttr:void 0};let St=Z.length;for(;St--;){const ne=Z[St],{name:Pt,namespaceURI:Nn,value:pn}=ne,fe=Xt(Pt),qn=pn;let Qt=Pt==="value"?qn:bD(qn);if(J.attrName=fe,J.attrValue=Qt,J.keepAttr=!0,J.forceKeepAttr=void 0,In(M.uponSanitizeAttribute,$,J),Qt=J.attrValue,gi&&(fe==="id"||fe==="name")&&bg(Qt,vi)!==0&&(Tr(Pt,$),Qt=vi+Qt),lt&&ee(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Qt)){Tr(Pt,$);continue}if(fe==="attributename"&&yg(Qt,"href")){Tr(Pt,$);continue}if(J.forceKeepAttr)continue;if(!J.keepAttr){Tr(Pt,$);continue}if(!z&&ee(/\/>/i,Qt)){Tr(Pt,$);continue}ht&&ws([V,k,H],EU=>{Qt=ui(Qt,EU," ")});const l1=Xt($.nodeName);if(!i1(l1,fe,Qt)){Tr(Pt,$);continue}if(E&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Nn)switch(p.getAttributeType(l1,fe)){case"TrustedHTML":{Qt=E.createHTML(Qt);break}case"TrustedScriptURL":{Qt=E.createScriptURL(Qt);break}}if(Qt!==qn)try{Nn?$.setAttributeNS(Nn,Pt,Qt):$.setAttribute(Pt,Qt),Gu($)?Or($):vg(t.removed)}catch{Tr(Pt,$)}}In(M.afterSanitizeAttributes,$,null)},o1=function($){let Z=null;const J=n1($);for(In(M.beforeSanitizeShadowDOM,$,null);Z=J.nextNode();)In(M.uponSanitizeShadowNode,Z,null),r1(Z),a1(Z),Z.content instanceof s&&o1(Z.content);In(M.afterSanitizeShadowDOM,$,null)};return t.sanitize=function($){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=null,St=null,ne=null,Pt=null;if(Pu=!$,Pu&&($="<!-->"),typeof $!="string"&&!Fu($)&&($=TD($),typeof $!="string"))throw ao("dirty is not a string, aborting");if(!t.isSupported)return $;if(Gt||Vu(Z),t.removed=[],typeof $=="string"&&(ks=!1),ks){const fe=$.nodeName;if(typeof fe=="string"){const qn=Xt(fe);if(!W[qn]||X[qn])throw ao("root node is forbidden and cannot be sanitized in-place")}}else if($ instanceof o)J=e1("<!---->"),St=J.ownerDocument.importNode($,!0),St.nodeType===Cs.element&&St.nodeName==="BODY"||St.nodeName==="HTML"?J=St:J.appendChild(St);else{if(!bt&&!ht&&!Mt&&$.indexOf("<")===-1)return E&&pe?E.createHTML($):$;if(J=e1($),!J)return bt?null:pe?x:""}J&&it&&Or(J.firstChild);const Nn=n1(ks?$:J);for(;ne=Nn.nextNode();)r1(ne),a1(ne),ne.content instanceof s&&o1(ne.content);if(ks)return $;if(bt){if(ht){J.normalize();let fe=J.innerHTML;ws([V,k,H],qn=>{fe=ui(fe,qn," ")}),J.innerHTML=fe}if(He)for(Pt=D.call(J.ownerDocument);J.firstChild;)Pt.appendChild(J.firstChild);else Pt=J;return(K.shadowroot||K.shadowrootmode)&&(Pt=N.call(r,Pt,!0)),Pt}let pn=Mt?J.outerHTML:J.innerHTML;return Mt&&W["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&ee($g,J.ownerDocument.doctype.name)&&(pn="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
4
+ `+pn),ht&&ws([V,k,H],fe=>{pn=ui(pn,fe," ")}),E&&pe?E.createHTML(pn):pn},t.setConfig=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vu($),Gt=!0},t.clearConfig=function(){xi=null,Gt=!1},t.isValidAttribute=function($,Z,J){xi||Vu({});const St=Xt($),ne=Xt(Z);return i1(St,ne,J)},t.addHook=function($,Z){typeof Z=="function"&&Ss(M[$],Z)},t.removeHook=function($,Z){if(Z!==void 0){const J=vD(M[$],Z);return J===-1?void 0:yD(M[$],J,1)[0]}return vg(M[$])},t.removeHooks=function($){M[$]=[]},t.removeAllHooks=function(){M=Cg()},t}var hu=Ag();const lo=e=>hu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),UD=e=>hu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),cn=e=>hu.sanitize(e,{ALLOWED_TAGS:[]}),Lg=class u1 extends gt{constructor(){super(...arguments),this.type="toolbar",this.renderType=rt.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=>`
5
5
  <button
6
6
  type="button"
7
7
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
8
8
  aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${cn(l.id)}`)}" aria-label="${cn(l.title)}">
9
9
  <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">
10
- ${Bk(l.iconSVG.content)}
10
+ ${UD(l.iconSVG.content)}
11
11
  </svg>
12
- </button>`).each(function(l,c){I(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),I(this).select("button").on("mouseover focus",function(u){const d=I(this);d.classed("hovered",!0),o.services.events.dispatchEvent(S.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:d,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(S.Toolbar.HIDE_TOOLTIP)}).on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>y(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("type","button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),I(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(S.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(S.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=I(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=I(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(S.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===_t.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${u1.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===_t.MAKE_FULLSCREEN&&l?a.type=_t.EXIT_FULLSCREEN:a.type===_t.EXIT_FULLSCREEN&&!l&&(a.type=_t.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?y(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=y(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
12
+ </button>`).each(function(l,c){R(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),R(this).select("button").on("mouseover focus",function(u){const h=R(this);h.classed("hovered",!0),o.services.events.dispatchEvent(T.Toolbar.SHOW_TOOLTIP,{event:u,hoveredElement:h,content:l.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){o.services.events.dispatchEvent(T.Toolbar.HIDE_TOOLTIP)}).on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>y(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("type","button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),R(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(T.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(T.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=R(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=R(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=R(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=R(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=R(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(T.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===_t.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${u1.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===_t.MAKE_FULLSCREEN&&l?a.type=_t.EXIT_FULLSCREEN:a.type===_t.EXIT_FULLSCREEN&&!l&&(a.type=_t.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?y(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=y(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
13
13
  <circle cx="16" cy="16" r="2"></circle>
14
- <circle cx="16" cy="24" r="2"></circle>`},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:p}=y(i,"locale","translations","toolbar");let f;switch(t){case _t.ZOOM_IN:n&&(f={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case _t.ZOOM_OUT:n&&(f={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case _t.RESET_ZOOM:n&&(f={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case _t.MAKE_FULLSCREEN:f={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case _t.EXIT_FULLSCREEN:f={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case _t.SHOW_AS_DATATABLE:f={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:p,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(S.Modal.SHOW)};break;case _t.EXPORT_CSV:f={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case _t.EXPORT_PNG:f={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case _t.EXPORT_JPG:f={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return f}getControlIconByType(t){switch(t){case _t.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
14
+ <circle cx="16" cy="24" r="2"></circle>`},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:h,exitFullScreen:d,showAsTable:p}=y(i,"locale","translations","toolbar");let f;switch(t){case _t.ZOOM_IN:n&&(f={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case _t.ZOOM_OUT:n&&(f={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case _t.RESET_ZOOM:n&&(f={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case _t.MAKE_FULLSCREEN:f={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case _t.EXIT_FULLSCREEN:f={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case _t.SHOW_AS_DATATABLE:f={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:p,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(T.Modal.SHOW)};break;case _t.EXPORT_CSV:f={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case _t.EXPORT_PNG:f={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case _t.EXPORT_JPG:f={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return f}getControlIconByType(t){switch(t){case _t.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
15
15
  <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case _t.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
16
- <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case _t.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case _t.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case _t.EXIT_FULLSCREEN:return'<polygon points="4 18 4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18"/><polygon points="30 3.416 28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416"/>';case _t.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case _t.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case _t.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case _t.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};Lg.buttonID=0;let co=Lg;const kg=class h1 extends gt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=h1.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(r=>{const i=y(r,"growth");return i===ct.PREFERRED||i===ct.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>y(t,"growth")===ct.STRETCH).size()}render(t=!0){const n=this.model.getOptions(),r=this.parent,{width:i,height:s}=N.getHTMLElementSize(r.node()),a=this.configs.direction===Ct.ROW||this.configs.direction===Ct.ROW_REVERSE,o=y(this.model.getOptions(),"style","prefix"),l=r.classed(`${ge}--${o}--layout-row`,this.configs.direction===Ct.ROW).classed(`${ge}--${o}--layout-row-reverse`,this.configs.direction===Ct.ROW_REVERSE).classed(`${ge}--${o}--layout-column`,this.configs.direction===Ct.COLUMN).classed(`${ge}--${o}--layout-column-reverse`,this.configs.direction===Ct.COLUMN_REVERSE).classed(`${ge}--${o}--layout-alignitems-center`,this.configs.alignItems===Yn.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);l.enter().append("div").merge(r.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",u=>`layout-child layout-child-${this._instanceID} ${u.id}`).each(function(u){u.components.forEach(d=>{const h=I(this),p=y(u,"renderType")===rt.SVG;d.setParent(p?N.appendOrSelect(h,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):h),p&&!h.select("svg.layout-svg-wrapper").attr("aria-label")&&h.select("svg.layout-svg-wrapper").attr("aria-label",n?.accessibility?.svgAriaLabel||n?.title);const f=y(u,"growth");(f===ct.PREFERRED||f===ct.FIXED)&&d.render(t)})}),r.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const d=y(u,"growth"),h=y(u,"renderType")===rt.SVG?N.getSVGElementSize(I(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):N.getHTMLElementSize(this);if(d===ct.PREFERRED){const p=a?h.width:h.height,f=a?i:s;u.size=p/f*100}}),l.exit().remove(),this.children.filter(u=>y(u,"growth")===ct.STRETCH).forEach(u=>{u.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const c=r.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);a?c.style("width",u=>`${u.size/100*i}px`).style("height","100%"):c.style("height",u=>`${u.size/100*s}px`).style("width","100%"),c.each(function(u){u.components.forEach(d=>{y(u,"growth")===ct.STRETCH&&d.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(r=>r.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(r=>r.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};kg.instanceID=Math.floor(Math.random()*99999999999);let Me=kg;class Dn extends gt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer({isPresentational:!0}).style("width",`${this.configs.size||yp.default.size}px`).style("height",`${this.configs.size||yp.default.size}px`).attr("opacity",0)}}class uo extends gt{constructor(t,n,r){super(t,n,r),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const i=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${i}__modal-title`).attr("aria-describedby",`${i}__modal-description`).attr("tabindex",-1).style("opacity",1).style("visibility","visible"),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),this.modal.on("click",this.handleHideModal),this.modal.select(".cds--modal-container").on("click",s=>{s.stopPropagation()}),this.modal.select(".cds--modal-close").on("click",this.handleHideModal),typeof window<"u"&&window.addEventListener("keydown",this.handleEscapeKey)},this.handleEscapeKey=i=>{i.key==="Escape"&&this.handleHideModal()},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null).style("opacity",0).style("visibility","hidden"),this.modal.on("click",null),this.modal.select(".cds--modal-container").on("click",null),this.modal.select(".cds--modal-close").on("click",null),typeof window<"u"&&window.removeEventListener("keydown",this.handleEscapeKey)},this.init()}addEventListeners(){this.services.events.addEventListener(S.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(S.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),{title:r,downloadAsCSV:i}=y(n,"locale","translations","tabularRep"),s=y(n,"style","prefix"),a=this.model.getTabularDataArray();return`
16
+ <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case _t.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case _t.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case _t.EXIT_FULLSCREEN:return'<polygon points="4 18 4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18"/><polygon points="30 3.416 28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416"/>';case _t.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case _t.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case _t.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case _t.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};Lg.buttonID=0;let co=Lg;const Dg=class h1 extends gt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=h1.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(r=>{const i=y(r,"growth");return i===ct.PREFERRED||i===ct.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>y(t,"growth")===ct.STRETCH).size()}render(t=!0){const n=this.model.getOptions(),r=this.parent,{width:i,height:s}=I.getHTMLElementSize(r.node()),a=this.configs.direction===Ct.ROW||this.configs.direction===Ct.ROW_REVERSE,o=y(this.model.getOptions(),"style","prefix"),l=r.classed(`${ge}--${o}--layout-row`,this.configs.direction===Ct.ROW).classed(`${ge}--${o}--layout-row-reverse`,this.configs.direction===Ct.ROW_REVERSE).classed(`${ge}--${o}--layout-column`,this.configs.direction===Ct.COLUMN).classed(`${ge}--${o}--layout-column-reverse`,this.configs.direction===Ct.COLUMN_REVERSE).classed(`${ge}--${o}--layout-alignitems-center`,this.configs.alignItems===Yn.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);l.enter().append("div").merge(r.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",u=>`layout-child layout-child-${this._instanceID} ${u.id}`).each(function(u){u.components.forEach(h=>{const d=R(this),p=y(u,"renderType")===rt.SVG;h.setParent(p?I.appendOrSelect(d,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):d),p&&!d.select("svg.layout-svg-wrapper").attr("aria-label")&&d.select("svg.layout-svg-wrapper").attr("aria-label",n?.accessibility?.svgAriaLabel||n?.title);const f=y(u,"growth");(f===ct.PREFERRED||f===ct.FIXED)&&h.render(t)})}),r.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const h=y(u,"growth"),d=y(u,"renderType")===rt.SVG?I.getSVGElementSize(R(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):I.getHTMLElementSize(this);if(h===ct.PREFERRED){const p=a?d.width:d.height,f=a?i:s;u.size=p/f*100}}),l.exit().remove(),this.children.filter(u=>y(u,"growth")===ct.STRETCH).forEach(u=>{u.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const c=r.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);a?c.style("width",u=>`${u.size/100*i}px`).style("height","100%"):c.style("height",u=>`${u.size/100*s}px`).style("width","100%"),c.each(function(u){u.components.forEach(h=>{y(u,"growth")===ct.STRETCH&&h.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(r=>r.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(r=>r.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};Dg.instanceID=Math.floor(Math.random()*99999999999);let Me=Dg;class kn extends gt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer({isPresentational:!0}).style("width",`${this.configs.size||yp.default.size}px`).style("height",`${this.configs.size||yp.default.size}px`).attr("opacity",0)}}class uo extends gt{constructor(t,n,r){super(t,n,r),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const i=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${i}__modal-title`).attr("aria-describedby",`${i}__modal-description`).attr("tabindex",-1).style("opacity",1).style("visibility","visible"),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),this.modal.on("click",this.handleHideModal),this.modal.select(".cds--modal-container").on("click",s=>{s.stopPropagation()}),this.modal.select(".cds--modal-close").on("click",this.handleHideModal),typeof window<"u"&&window.addEventListener("keydown",this.handleEscapeKey)},this.handleEscapeKey=i=>{i.key==="Escape"&&this.handleHideModal()},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null).style("opacity",0).style("visibility","hidden"),this.modal.on("click",null),this.modal.select(".cds--modal-container").on("click",null),this.modal.select(".cds--modal-close").on("click",null),typeof window<"u"&&window.removeEventListener("keydown",this.handleEscapeKey)},this.init()}addEventListeners(){this.services.events.addEventListener(T.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(T.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),{title:r,downloadAsCSV:i}=y(n,"locale","translations","tabularRep"),s=y(n,"style","prefix"),a=this.model.getTabularDataArray();return`
17
17
  <div class="cds--modal-container">
18
18
  <div class="cds--modal-header">
19
19
 
@@ -50,7 +50,7 @@
50
50
  <div class="${ge}--${s}-modal-footer-spacer"></div>
51
51
  <button class="cds--btn cds--btn--primary" type="button" data-modal-primary-focus>${i}</button>
52
52
  </div>
53
- </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.${ge}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class As extends gt{constructor(){super(...arguments),this.type="title",this.renderType=rt.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=>cn(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(S.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(S.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(S.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(S.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 du extends gt{constructor(){super(...arguments),this.type="legend",this.renderType=rt.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===jt.CENTER).classed("right-aligned",i===jt.RIGHT).classed(s||"horizontal",!0).classed("has-deactivated-items",l).attr("role",dt.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",dt.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("role","img").attr("aria-labelledby",(M,k)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+k}-title`));E.selectAll("*").remove();let b,O=1;E.append("svg").classed("icon",!0).each(function(M){const k=I(this);!b||b!=M.type?(b=M.type,O=1):O++,x.addAdditionalItem(k,M,O)}),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===qt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===qt.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",dt.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===qt.LINE){const a=Nt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",dt.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===qt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",dt.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===qt.SIZE){const{iconData:a,fill:o,stroke:l}=Nt.size;t.attr("fill","none").attr("role",dt.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===qt.QUARTILE){const{iconData:a}=Nt.quartile;t.selectAll("rect").attr("role",dt.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===qt.ZOOM){const{iconData:a,color:o}=y(Nt,"zoom"),l=t.attr("role",dt.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!==Ae.NONE?a.html(function(o){const l=cn(o.name);return l.length>i&&l.length!==s?ts(l,r,s):l}):a.html(o=>cn(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(S.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!==Ae.NONE&&t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){I(this).datum().name.length>s.threshold&&s.type!==Ae.NONE&&t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(S.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!==Ae.NONE&&t.services.events.dispatchEvent(S.Tooltip.HIDE),t.services.events.dispatchEvent(S.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(S.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(S.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(S.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class Dg extends gt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=rt.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 Uk extends Dg{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 di,Ft;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Ft||(Ft={}));var Rg=(di={},di[Ft.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)}},di[Ft.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)}},di[Ft.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)}},di[Ft.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)}},di),Ig=typeof window<"u"?window:{innerHeight:0,innerWidth:0},ho=function(){function e(t){t===void 0&&(t={}),this.positions=Rg,this.positions=Object.assign({},Rg,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:Ig.innerHeight,width:Ig.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 ho;class pu extends gt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=rt.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new ho,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>${lo(i.detail.content)}</p></div>`:o=lo(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>${lo(i.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${lo(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(S.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==S.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(S.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(S.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(S.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(S.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(S.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(S.Tooltip.MOVE,null),this.services.events.removeEventListener(S.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(S.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(S.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(S.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(S.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!==Ae.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=ts(a.label,r,s)),a.value&&a.value.length>i&&(a.value=ts(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
+ </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=R(this.services.domUtils.getHolder()),i=y(n,"style","prefix");this.modal=I.appendOrSelect(r,`div.${ge}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class As extends gt{constructor(){super(...arguments),this.type="title",this.renderType=rt.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=>cn(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=I.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 I.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 du extends gt{constructor(){super(...arguments),this.type="legend",this.renderType=rt.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(b=>b.status===o),c=y(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===jt.CENTER).classed("right-aligned",i===jt.RIGHT).classed(s||"horizontal",!0).classed("has-deactivated-items",l).attr("role",dt.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const h=u.selectAll("div.legend-item").data(a,b=>b.name),d=h.enter().append("div").attr("class","legend-item");d.merge(u.selectAll("div.legend-item")).classed("active",function(b){return b.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=d.append("div").classed("checkbox",!0),m=g.merge(h.select("div.checkbox")).attr("role",dt.CHECKBOX).attr("tabindex",p?0:-1).attr("aria-labelledby",(b,_)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${_}-title`)).attr("aria-checked",({status:b})=>b===Nt.items.status.ACTIVE).attr("width",f*2).attr("height",f*2).attr("class",b=>this.model.getColorClassName({classNameTypes:[st.BACKGROUND],dataGroupName:b.name,originalClassName:"checkbox"})).style("background",b=>b.status===Nt.items.status.ACTIVE?this.model.getFillColor(b.name)||this.model.getStrokeColor(b.name):null).classed("active",function(b){return b.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"),d.append("p").merge(h.select("p"));const v=y(n,"legend","additionalItems");if(v&&a.length){const b=this,_=u.selectAll("div.additional-item").data(v);_.exit().remove();const E=_.enter().append("div").merge(_).classed("legend-item",!0).classed("additional",!0).attr("role","img").attr("aria-labelledby",(A,D)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+D}-title`));E.selectAll("*").remove();let x,O=1;E.append("svg").classed("icon",!0).each(function(A){const D=R(this);!x||x!=A.type?(x=A.type,O=1):O++,b.addAdditionalItem(D,A,O)}),E.append("p").merge(E.select("p")),this.truncateLegendText()}h.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),p&&d.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===qt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===qt.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",dt.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===qt.LINE){const a=Nt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",dt.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===qt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",dt.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===qt.SIZE){const{iconData:a,fill:o,stroke:l}=Nt.size;t.attr("fill","none").attr("role",dt.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===qt.QUARTILE){const{iconData:a}=Nt.quartile;t.selectAll("rect").attr("role",dt.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===qt.ZOOM){const{iconData:a,color:o}=y(Nt,"zoom"),l=t.attr("role",dt.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!==Ae.NONE?a.html(function(o){const l=cn(o.name);return l.length>i&&l.length!==s?ts(l,r,s):l}):a.html(o=>cn(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:R(this)});const o=R(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==Ae.NONE&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){R(this).datum().name.length>s.threshold&&s.type!==Ae.NONE&&t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(T.Legend.ITEM_CLICK,{clickedElement:R(this)});const a=R(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=R(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Ae.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:R(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:R(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=R(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class kg extends gt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=rt.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=I.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=I.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 BD extends kg{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}=I.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=I.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=I.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 di,Ft;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Ft||(Ft={}));var Rg=(di={},di[Ft.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)}},di[Ft.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)}},di[Ft.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)}},di[Ft.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)}},di),Ig=typeof window<"u"?window:{innerHeight:0,innerWidth:0},ho=function(){function e(t){t===void 0&&(t={}),this.positions=Rg,this.positions=Object.assign({},Rg,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),h=0,d=0,p=i();u.top<p.top?h=p.top-u.top:u.bottom>p.height&&(h=u.bottom-p.height),u.left<p.left?d=p.left-u.left:u.right>p.width&&(d=u.right-p.width),h&&!d?d=1:d&&!h&&(h=1);var f=n.offsetHeight*n.offsetWidth,g=h*d,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:Ig.innerHeight,width:Ig.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 ho;class pu extends gt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=rt.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new ho,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items,a=R(i.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(i));i.detail.content?o=`<div class="title-tooltip"><p>${lo(i.detail.content)}</p></div>`:o=lo(this.getTooltipHTML(l));const c=I.appendOrSelect(this.tooltip,"div.content-box");if(y(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const u=`<div class="title-tooltip"><p>${lo(i.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${lo(this.model.getOptions().tooltip.customHTML(s,o,a))}</p></div>`);else c.html(o);c.selectAll(".datapoint-tooltip").each(function(u,h){const d=l[h];l[h]&&l[h].color&&R(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",d.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!==Ae.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=ts(a.label,r,s)),a.value&&a.value.length>i&&(a.value=ts(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>
54
54
  <div class="datapoint-tooltip${n.bold?" bold":""}">
55
55
  ${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
56
56
  <div class="label">
@@ -59,21 +59,21 @@
59
59
  </div>
60
60
  ${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
61
61
  </div>
62
- </li>`).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,n){const r=this.getOptions(),i=y(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=y(r,"locale");if(i)return i(t,n);if(this.isDate(t))return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),r=y(n,"tooltip","enabled");if(r){const i=I(this.services.domUtils.getHolder()),s=y(n,"style","prefix");this.tooltip=N.appendOrSelect(i,`div.${ge}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,n,r){const i=Object.assign({},t);return n==Ft.LEFT?i.left-=r:n==Ft.RIGHT?i.left+=r:n==Ft.TOP?i.top-=r:n==Ft.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=y(a,"zoomBar","top","enabled"),l=!!y(t,"detail","noWrap"),c=Array.isArray(y(t,"detail","placements")),u=c?y(t,"detail","placements"):[Ft.RIGHT,Ft.LEFT,Ft.TOP,Ft.BOTTOM];let d,{horizontalOffset:h}=bp;const{defaultOffset:p}=bp;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=y(t,"detail","event","target"),v=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(v,s,u,()=>({top:0,left:0,width:r,height:i}));let x=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));x=this.addOffsetByPlacement(x,d,p),this.positionService.setElement(s,x);return}let f=y(t,"detail","mousePosition");if(!f)f=ir(y(t,"detail","event"),n);else{const m=y(a,"zoomBar","top","type"),v=Se.height[m];o&&(f[1]+=v+Se.spacerHeight)}f[0]/r>.9?d=Ft.LEFT:f[0]/r<.1?d=Ft.RIGHT:d=this.positionService.findBestPlacementAt({left:f[0],top:f[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Ft.LEFT&&(h*=-1);const g=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},s,d);this.positionService.setElement(s,g)}}const Ng=class Oo extends gt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=rt.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=N.appendOrSelect(n,"svg.chart-grid-backdrop"),s=N.appendOrSelect(i,`g.${this.type}`),a=N.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=N.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const p=N.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===nt.TIME){let f=this.model.get("zoomDomain");f===void 0&&(f=this.services.zoom.getDefaultZoomBarDomain(),f&&this.model.set({zoomDomain:f},{animate:!1}));const g=b=>{const O=b[1]-b[0];let M="0,"+O.toString();const k=Math.floor(l/Oo.DASH_LENGTH),A=k*Oo.DASH_LENGTH;for(let R=0;R<k;R++)M+=","+Oo.DASH_LENGTH;M+=","+(l-A),k%2===1&&(M+=",0"),M+=","+O.toString(),M+=","+l.toString(),p.attr("stroke-dasharray",M)},m=b=>{const O=b.selection;O===null||O[0]===O[1]||(p.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(O))},v=(b,O)=>{const M=gf().range([0,o]).domain(f);let k=[M.invert(b),M.invert(O)],A="manual";k[0].valueOf()===k[1].valueOf()?(k=this.services.zoom.getDefaultZoomBarDomain(),A="reset"):A="manual",(f[0].valueOf()!==k[0].valueOf()||f[1].valueOf()!==k[1].valueOf())&&this.services.zoom.handleDomainChange(k,{dispatchEvent:!0,type:A})};let x;const _=b=>{const O=b.selection;O!==null&&(v(O[0],O[1]),s.call(x.move,null),p.style("display","none"))};l!=0&&o!=0&&(x=pm().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",_),s.call(x));const E=this.services.zoom.getZoomRatio();i.on("click",function(b){if(b.shiftKey){const O=this.services.domUtils.getHolder(),M=ir(s.node(),O)[0];let k=M-o*E/2;k<0&&(k=0);let A=M+o*E/2;A>o&&(A=o),v(k,A)}})}}};Ng.DASH_LENGTH=4;let Hk=Ng;class Vk extends gt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=rt.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=pm(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(S.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",V.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(V.TOP),i=this.services.zoom.isZoomBarLocked(V.TOP),s=y(this.getOptions(),"zoomBar",V.TOP,"type"),a=y(this.getOptions(),"axes",V.BOTTOM,"highlights"),o=Se.height[s],{width:l}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=N.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1).attr("role","presentation");if(N.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Se.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ve.GRAPH_VIEW?N.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ve.SLIDER_VIEW&&N.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,p=h.getMainXScale(),f=h.getMainYScale(),g=h.getMainXScaleType();if(p&&g===nt.TIME){let m=this.services.zoom.getZoomBarData();if(ze(m)||m.length===1)return;this.xScale=p.copy(),this.yScale=f.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const x=this.model.get("initialZoomDomain"),_=y(this.getOptions(),"zoomBar",V.TOP,"initialZoomDomain");_&&_[0]&&_[1]&&(_[0]=new Date(_[0]),_[1]=new Date(_[1])),_&&!(x&&x[0].valueOf()===_[0].valueOf()&&x[1].valueOf()===_[1].valueOf())?this.model.set({initialZoomDomain:ot([],_),zoomDomain:_?ot([],_):v},{skipUpdate:!0}):_===null&&x!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ot([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(je(m,O=>O.value));const E=this.model.get("zoomDomain");if(s===Ve.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const O=a.highlightStartMapsTo,M=a.highlightEndMapsTo,k=a.color,A=a.labelMapsTo;a.data.forEach((R,C)=>{N.appendOrSelect(d,`rect.highlight-${C}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(R[O])).attr("width",this.xScale(R[M])-this.xScale(R[O])).style("fill",k&&k.scale[R[A]]?k.scale[R[A]]:null).style("fill-opacity",.1).style("stroke",k&&k.scale[R[A]]?k.scale[R[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(E,c,l);const b=N.appendOrSelect(n,this.brushSelector).call(this.brush);if(E!==void 0)if(E[0].valueOf()===E[1].valueOf())b.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const O=E.map(M=>this.xScale(M));O[1]-O[0]<this.MIN_SELECTION_DIFF||(b.call(this.brush.move,O),this.updateBrushHandle(this.getComponentContainer(),O))}i&&(this.brush.filter(()=>!1),b.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",V.TOP,"type"),a=Se.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){let a="manual";if(n&&n[0]&&n[1]){const l=this.services.zoom.getDefaultZoomBarDomain();s[0].valueOf()===l[0].valueOf()&&s[1].valueOf()===l[1].valueOf()?a="reset":a="manual"}(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1,type:a});let o;t.type==="start"?o=S.ZoomBar.SELECTION_START:t.type==="brush"?o=S.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(o=S.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(S.ZoomDomain.CHANGE,{newDomain:s,type:a})),this.services.events.dispatchEvent(o,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=Se.handleWidth,s=y(this.getOptions(),"zoomBar",V.TOP,"type"),a=Se.height[s],o=-i/2,l=Se.handleBarWidth,c=s===Ve.GRAPH_VIEW?Se.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(p){if(p.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(p.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(p){return"handle-bar handle-bar--"+p.type}),h.attr("x",function(p){if(p.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(p.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ve.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",V.TOP,"type"),r=Se.height[n],i=this.getComponentContainer().select("svg.zoom-container");N.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,x,_)=>E=>s.getValueFromScale(v,x,_,E),d=u(this.xScale,l,a),h=u(this.yScale,c,o),p=y(this.getOptions(),"zoomBar",V.TOP,"type"),f=Se.height[p],g=ru().x(v=>d(v)).y0(f).y1(v=>f-h(v)),m=N.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=N.appendOrSelect(t,"clipPath").attr("id",n);N.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=gn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",V.TOP,"type"),a=Se.height[s],o=Os()([[n,a],[r,a]]);N.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),N.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",V.TOP,"type")===Ve.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(S.ZoomBar.UPDATE,this.render.bind(this))}}class Gk extends gt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=rt.SVG,this.positionService=new ho}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(V).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u?.correspondingDatasets,mapsTo:u?.mapsTo})}});const i=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),d=l.services.cartesianScales.getScaleTypeByPosition(c);let h=null,p=null;c===V.LEFT||c===V.RIGHT?(p=u,h=l.services.cartesianScales.getMainXScale()):(h=u,p=l.services.cartesianScales.getMainYScale());const f=d===nt.LABELS,[g,m]=h.range(),[v,x]=p.range(),{cartesianScales:_}=l.services,E=_.getOrientation(),b=R=>_.getDomainValue(R),O=R=>_.getRangeValue(R),[M,k]=Tn(b,O,E),A=I(this);c===V.TOP||c===V.BOTTOM?(A.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",v).attr("x1",({datum:R})=>M(R)+(f?u.step()/2:0)).attr("x2",({datum:R})=>M(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),A.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:R})=>-M(R)).attr("width",Math.abs(v-x)).classed("rotate",!0)):(A.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("x1",g).attr("x2",m).attr("y1",({datum:R})=>k(R)+(f?u.step()/2:0)).attr("y2",({datum:R})=>k(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),A.selectAll("rect.threshold-hoverable-area").attr("x",g).attr("y",({datum:R})=>k(R)).attr("width",Math.abs(m-g)).classed("rotate",!1))}),this.services.events.addEventListener(S.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(S.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===nt.TIME){const l=[V.LEFT,V.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),p=Yl(d.ticks(),y(h,"timeInterval"));return ql(n,0,d.ticks(),p,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=N.appendOrSelect(t,`div.${ge}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=ir(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(cn(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[Ft.RIGHT,Ft.LEFT,Ft.TOP,Ft.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(S.Threshold.SHOW,{event:n,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(n){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(S.Threshold.HIDE,{event:n,hoveredElement:I(this),datum:I(this).datum()})})}}class Fk extends gt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=rt.SVG,this.positionService=new ho,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(V).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),d=l.services.cartesianScales.getMainYScale(),[h,p]=u.range(),[f,g]=d.range(),{cartesianScales:m}=l.services,v=m.getOrientation(),x=M=>m.getDomainValue(M),_=M=>m.getRangeValue(M),[E,b]=Tn(x,_,v),O=I(this);c===V.TOP||c===V.BOTTOM?O.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("y",Math.max(g+l.highlightStrokeWidth,0)).attr("height",Math.max(f-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:M,...k})=>E(k[M])).attr("width",({highlightStartMapsTo:M,highlightEndMapsTo:k,...A})=>Math.max(E(A[k])-E(A[M]),0)).style("stroke",({color:M,labelMapsTo:k,...A})=>M&&M.scale[A[k]]?M.scale[A[k]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:k,...A})=>M&&M.scale[A[k]]?M.scale[A[k]]:null):O.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(p-h,0)).attr("y",({highlightEndMapsTo:M,...k})=>b(k[M])).attr("height",({highlightStartMapsTo:M,highlightEndMapsTo:k,...A})=>Math.max(b(A[M])-b(A[k]),0)).style("stroke",({color:M,labelMapsTo:k,...A})=>M&&M.scale[A[k]]?M.scale[A[k]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:k,...A})=>M&&M.scale[A[k]]?M.scale[A[k]]:null)})}}class Pg extends pu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],p=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const f=h[p];d=[{label:l,value:u},...Array.isArray(f)&&f.length===2?[{label:"Start",value:f[0]},{label:"End",value:f[1]}]:[{label:c,value:h[p]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:vt(r,"locale.translations.group")||vt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const p=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(p)&&p.length===2?`${p[0]} - ${p[1]}`:p,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:h[o]})}}).sort((h,p)=>p.value-h.value)),!a&&y(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier(),p=y(r,"tooltip","customTotalCalculation");let f;p?f=p(n):f=n.reduce((g,m)=>g+m[h],0),d.push({label:vt(r,"tooltip.totalLabel")||vt(r,"locale.translations.total")||"Total",value:f,bold:!0})}return d}}function Bg(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 zk(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 fu(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function jk(e){return e.depth}function Wk(e,t){return t-1-e.height}function Ug(e,t){return e.sourceLinks.length?e.depth:t-1}function po(e){return function(){return e}}function Hg(e,t){return fo(e.source,t.source)||e.index-t.index}function Vg(e,t){return fo(e.target,t.target)||e.index-t.index}function fo(e,t){return e.y0-t.y0}function mu(e){return e.value}function qk(e){return e.index}function Yk(e){return e.nodes}function Xk(e){return e.links}function Gg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Fg({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function Zk(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=qk,l=Ug,c,u,d=Yk,h=Xk,p=6;function f(){const T={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(T),m(T),v(T),x(T),b(T),Fg(T),T}f.update=function(T){return Fg(T),T},f.nodeId=function(T){return arguments.length?(o=typeof T=="function"?T:po(T),f):o},f.nodeAlign=function(T){return arguments.length?(l=typeof T=="function"?T:po(T),f):l},f.nodeSort=function(T){return arguments.length?(c=T,f):c},f.nodeWidth=function(T){return arguments.length?(i=+T,f):i},f.nodePadding=function(T){return arguments.length?(s=a=+T,f):s},f.nodes=function(T){return arguments.length?(d=typeof T=="function"?T:po(T),f):d},f.links=function(T){return arguments.length?(h=typeof T=="function"?T:po(T),f):h},f.linkSort=function(T){return arguments.length?(u=T,f):u},f.size=function(T){return arguments.length?(e=t=0,n=+T[0],r=+T[1],f):[n-e,r-t]},f.extent=function(T){return arguments.length?(e=+T[0][0],n=+T[1][0],t=+T[0][1],r=+T[1][1],f):[[e,t],[n,r]]},f.iterations=function(T){return arguments.length?(p=+T,f):p};function g({nodes:T,links:$}){for(const[D,B]of T.entries())B.index=D,B.sourceLinks=[],B.targetLinks=[];const L=new Map(T.map((D,B)=>[o(D,B,T),D]));for(const[D,B]of $.entries()){B.index=D;let{source:Q,target:W}=B;typeof Q!="object"&&(Q=B.source=Gg(L,Q)),typeof W!="object"&&(W=B.target=Gg(L,W)),Q.sourceLinks.push(B),W.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:D,targetLinks:B}of T)D.sort(u),B.sort(u)}function m({nodes:T}){for(const $ of T)$.value=$.fixedValue===void 0?Math.max(fu($.sourceLinks,mu),fu($.targetLinks,mu)):$.fixedValue}function v({nodes:T}){const $=T.length;let L=new Set(T),D=new Set,B=0;for(;L.size;){for(const Q of L){Q.depth=B;for(const{target:W}of Q.sourceLinks)D.add(W)}if(++B>$)throw new Error("circular link");L=D,D=new Set}}function x({nodes:T}){const $=T.length;let L=new Set(T),D=new Set,B=0;for(;L.size;){for(const Q of L){Q.height=B;for(const{source:W}of Q.targetLinks)D.add(W)}if(++B>$)throw new Error("circular link");L=D,D=new Set}}function _({nodes:T}){const $=Bg(T,B=>B.depth)+1,L=(n-e-i)/($-1),D=new Array($);for(const B of T){const Q=Math.max(0,Math.min($-1,Math.floor(l.call(null,B,$))));B.layer=Q,B.x0=e+Q*L,B.x1=B.x0+i,D[Q]?D[Q].push(B):D[Q]=[B]}if(c)for(const B of D)B.sort(c);return D}function E(T){const $=zk(T,L=>(r-t-(L.length-1)*a)/fu(L,mu));for(const L of T){let D=t;for(const B of L){B.y0=D,B.y1=D+B.value*$,D=B.y1+a;for(const Q of B.sourceLinks)Q.width=Q.value*$}D=(r-D+a)/(L.length+1);for(let B=0;B<L.length;++B){const Q=L[B];Q.y0+=D*(B+1),Q.y1+=D*(B+1)}H(L)}}function b(T){const $=_(T);a=Math.min(s,(r-t)/(Bg($,L=>L.length)-1)),E($);for(let L=0;L<p;++L){const D=Math.pow(.99,L),B=Math.max(1-D,(L+1)/p);M($,D,B),O($,D,B)}}function O(T,$,L){for(let D=1,B=T.length;D<B;++D){const Q=T[D];for(const W of Q){let j=0,Z=0;for(const{source:tt,value:X}of W.targetLinks){let et=X*(W.layer-tt.layer);j+=P(tt,W)*et,Z+=et}if(!(Z>0))continue;let ut=(j/Z-W.y0)*$;W.y0+=ut,W.y1+=ut,C(W)}c===void 0&&Q.sort(fo),k(Q,L)}}function M(T,$,L){for(let D=T.length,B=D-2;B>=0;--B){const Q=T[B];for(const W of Q){let j=0,Z=0;for(const{target:tt,value:X}of W.sourceLinks){let et=X*(tt.layer-W.layer);j+=U(W,tt)*et,Z+=et}if(!(Z>0))continue;let ut=(j/Z-W.y0)*$;W.y0+=ut,W.y1+=ut,C(W)}c===void 0&&Q.sort(fo),k(Q,L)}}function k(T,$){const L=T.length>>1,D=T[L];R(T,D.y0-a,L-1,$),A(T,D.y1+a,L+1,$),R(T,r,T.length-1,$),A(T,t,0,$)}function A(T,$,L,D){for(;L<T.length;++L){const B=T[L],Q=($-B.y0)*D;Q>1e-6&&(B.y0+=Q,B.y1+=Q),$=B.y1+a}}function R(T,$,L,D){for(;L>=0;--L){const B=T[L],Q=(B.y1-$)*D;Q>1e-6&&(B.y0-=Q,B.y1-=Q),$=B.y0-a}}function C({sourceLinks:T,targetLinks:$}){if(u===void 0){for(const{source:{sourceLinks:L}}of $)L.sort(Vg);for(const{target:{targetLinks:L}}of T)L.sort(Hg)}}function H(T){if(u===void 0)for(const{sourceLinks:$,targetLinks:L}of T)$.sort(Vg),L.sort(Hg)}function P(T,$){let L=T.y0-(T.sourceLinks.length-1)*a/2;for(const{target:D,width:B}of T.sourceLinks){if(D===$)break;L+=B+a}for(const{source:D,width:B}of $.targetLinks){if(D===T)break;L-=B}return L}function U(T,$){let L=$.y0-($.targetLinks.length-1)*a/2;for(const{source:D,width:B}of $.targetLinks){if(D===T)break;L+=B+a}for(const{target:D,width:B}of T.sourceLinks){if(D===$)break;L-=B}return L}return f}var gu=Math.PI,vu=2*gu,_r=1e-6,Kk=vu-_r;function yu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function zg(){return new yu}yu.prototype=zg.prototype={constructor:yu,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>_r)if(!(Math.abs(u*o-l*c)>_r)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,p=r-a,f=o*o+l*l,g=h*h+p*p,m=Math.sqrt(f),v=Math.sqrt(d),x=i*Math.tan((gu-Math.acos((f+d-g)/(2*m*v)))/2),_=x/v,E=x/m;Math.abs(_-1)>_r&&(this._+="L"+(e+_*c)+","+(t+_*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*p)+","+(this._x1=e+E*o)+","+(this._y1=t+E*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,d=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>_r||Math.abs(this._y1-c)>_r)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%vu+vu),d>Kk?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>_r&&(this._+="A"+n+","+n+",0,"+ +(d>=gu)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function jg(e){return function(){return e}}function Qk(e){return e[0]}function Jk(e){return e[1]}var tD=Array.prototype.slice;function eD(e){return e.source}function nD(e){return e.target}function rD(e){var t=eD,n=nD,r=Qk,i=Jk,s=null;function a(){var o,l=tD.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=zg()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:jg(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:jg(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function iD(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function sD(){return rD(iD)}function aD(e){return[e.source.x1,e.y0]}function oD(e){return[e.target.x0,e.y1]}function lD(){return sD().source(aD).target(oD)}class cD extends gt{constructor(){super(...arguments),this.type="alluvial",this.renderType=rt.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"alluvial graphs",withinChartClip:!0});n.html("");const{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(this.getOptions(),"color","gradient","enabled");let l=Xe.minNodePadding;s.alluvial.nodePadding>Xe.minNodePadding&&(l=s.alluvial.nodePadding);const c=y(s,"alluvial","nodeAlignment");let u=Ug;c===jt.LEFT?u=jk:c===jt.RIGHT&&(u=Wk);const d=Zk().nodeId(x=>x.name).nodeWidth(Xe.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(x=>Object.assign({},x)),links:a.map(x=>Object.assign({},x))}),this.graph.nodes=this.graph.nodes.filter(x=>x.value!==0);const h={};this.graph.nodes.forEach(x=>{const _=x.x0;x.category&&(h[_]=x?.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",x=>`translate(${x}, 0)`).append("text").attr("id",(x,_)=>this.services.domUtils.generateElementIDString(`alluvial-category-${_}`)).style("font-size","14px").text(x=>h[x]?h[x]:"").attr("y",20).attr("x",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-category-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0});let O=0;return x+O>=b&&(O=-b+4),O});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const x=y(this.getOptions(),"color","scale");x&&p.enter().append("linearGradient").attr("id",_=>`${this.gradient_id}-link-${_.index}`).attr("gradientUnits","userSpaceOnUse").call(_=>_.append("stop").attr("offset","0%").attr("stop-color",E=>x[E.source.name])).call(_=>_.append("stop").attr("offset","100%").attr("stop-color",E=>x[E.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",lD()).attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-line-${x.index}`)).attr("class",x=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:x.source.index,originalClassName:"link"})).style("stroke",x=>o?`url(#${this.gradient_id}-link-${x.index})`:this.model.getFillColor(x.source.name,null,{...x,source:x.source.name,target:x.target.name})).attr("stroke-width",x=>Math.max(1,x.width)).style("stroke-opacity",Xe.opacity.default).attr("aria-label",x=>`${x.source.name} → ${x.target.name} (${x.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const f=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-${x.index}`)).classed("node-group",!0).attr("transform",x=>`translate(${x.x0}, ${x.y0})`);f.append("rect").classed("node",!0).attr("height",x=>x.y1-x.y0).attr("width",x=>x.x1-x.x0).attr("fill","black");const g=f.append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${x.index}`)),{code:m,number:v}=y(s,"locale");g.append("text").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${x.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(x=>`${x.name} (${v(x.value,m)})`).attr("aria-label",x=>`${x.name} (${x.value})`),g.append("rect").classed("node-text-bg",!0).attr("width",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0});return b+8}).attr("height",18).attr("stroke-width",2).lower(),g.attr("transform",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0}),O=(x.y1-x.y0)/2-9;let M=x.x1-x.x0;return x.x1>=b?M=M-(b+16):M+=4,`translate(${M}, ${O})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=y(this.getOptions(),"locale"),s=Ta((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(I(a).lower(),l.style("stroke-opacity",Xe.opacity.default)):l.style("stroke-opacity",function(){return a===this?(I(this).raise(),Xe.opacity.selected):Xe.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=I(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(S.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(r(o.value,i)?`${r(o.value,i)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(S.Alluvial.LINE_MOUSEMOVE,{event:a,element:I(this),datum:o}),n.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(S.Alluvial.LINE_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(S.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(S.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=Ta((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",Xe.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return r.some(a=>a===s.index)?(I(this).classed("link-hovered",!0).raise(),Xe.opacity.selected):Xe.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=I(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=Ji(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),d=Ji(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(S.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(S.Alluvial.NODE_MOUSEMOVE,{event:r,element:I(this),datum:i}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(S.Alluvial.NODE_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=Ji(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Xe.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=Ji(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(S.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}getRightArrowIcon(){return`
62
+ </li>`).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,n){const r=this.getOptions(),i=y(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=y(r,"locale");if(i)return i(t,n);if(this.isDate(t))return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),r=y(n,"tooltip","enabled");if(r){const i=R(this.services.domUtils.getHolder()),s=y(n,"style","prefix");this.tooltip=I.appendOrSelect(i,`div.${ge}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,n,r){const i=Object.assign({},t);return n==Ft.LEFT?i.left-=r:n==Ft.RIGHT?i.left+=r:n==Ft.TOP?i.top-=r:n==Ft.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=y(a,"zoomBar","top","enabled"),l=!!y(t,"detail","noWrap"),c=Array.isArray(y(t,"detail","placements")),u=c?y(t,"detail","placements"):[Ft.RIGHT,Ft.LEFT,Ft.TOP,Ft.BOTTOM];let h,{horizontalOffset:d}=bp;const{defaultOffset:p}=bp;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=y(t,"detail","event","target"),v=this.services.domUtils.getElementOffset(m,!0);h=this.positionService.findBestPlacementAt(v,s,u,()=>({top:0,left:0,width:r,height:i}));let b=this.positionService.findPosition(m,s,h,()=>this.services.domUtils.getElementOffset(m));b=this.addOffsetByPlacement(b,h,p),this.positionService.setElement(s,b);return}let f=y(t,"detail","mousePosition");if(!f)f=ir(y(t,"detail","event"),n);else{const m=y(a,"zoomBar","top","type"),v=we.height[m];o&&(f[1]+=v+we.spacerHeight)}f[0]/r>.9?h=Ft.LEFT:f[0]/r<.1?h=Ft.RIGHT:h=this.positionService.findBestPlacementAt({left:f[0],top:f[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),h===Ft.LEFT&&(d*=-1);const g=this.positionService.findPositionAt({left:f[0]+d,top:f[1]},s,h);this.positionService.setElement(s,g)}}const Ng=class To extends gt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=rt.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=I.appendOrSelect(n,"svg.chart-grid-backdrop"),s=I.appendOrSelect(i,`g.${this.type}`),a=I.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=I.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),h=c.getMainXScale(),[d]=h.range();r.attr("transform",`translate(${d},0)`);const p=I.appendOrSelect(r,this.frontSelectionSelector);if(h&&u===nt.TIME){let f=this.model.get("zoomDomain");f===void 0&&(f=this.services.zoom.getDefaultZoomBarDomain(),f&&this.model.set({zoomDomain:f},{animate:!1}));const g=x=>{const O=x[1]-x[0];let A="0,"+O.toString();const D=Math.floor(l/To.DASH_LENGTH),L=D*To.DASH_LENGTH;for(let N=0;N<D;N++)A+=","+To.DASH_LENGTH;A+=","+(l-L),D%2===1&&(A+=",0"),A+=","+O.toString(),A+=","+l.toString(),p.attr("stroke-dasharray",A)},m=x=>{const O=x.selection;O===null||O[0]===O[1]||(p.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(O))},v=(x,O)=>{const A=gf().range([0,o]).domain(f);let D=[A.invert(x),A.invert(O)],L="manual";D[0].valueOf()===D[1].valueOf()?(D=this.services.zoom.getDefaultZoomBarDomain(),L="reset"):L="manual",(f[0].valueOf()!==D[0].valueOf()||f[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D,{dispatchEvent:!0,type:L})};let b;const _=x=>{const O=x.selection;O!==null&&(v(O[0],O[1]),s.call(b.move,null),p.style("display","none"))};l!=0&&o!=0&&(b=pm().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",_),s.call(b));const E=this.services.zoom.getZoomRatio();i.on("click",function(x){if(x.shiftKey){const O=this.services.domUtils.getHolder(),A=ir(s.node(),O)[0];let D=A-o*E/2;D<0&&(D=0);let L=A+o*E/2;L>o&&(L=o),v(D,L)}})}}};Ng.DASH_LENGTH=4;let HD=Ng;class VD extends gt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=rt.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=pm(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",G.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(G.TOP),i=this.services.zoom.isZoomBarLocked(G.TOP),s=y(this.getOptions(),"zoomBar",G.TOP,"type"),a=y(this.getOptions(),"axes",G.BOTTOM,"highlights"),o=we.height[s],{width:l}=I.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const h=I.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1).attr("role","presentation");if(I.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",we.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ve.GRAPH_VIEW?I.appendOrSelect(h,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ve.SLIDER_VIEW&&I.appendOrSelect(h,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(h,c,l);return}const{cartesianScales:d}=this.services,p=d.getMainXScale(),f=d.getMainYScale(),g=d.getMainXScaleType();if(p&&g===nt.TIME){let m=this.services.zoom.getZoomBarData();if(ze(m)||m.length===1)return;this.xScale=p.copy(),this.yScale=f.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const b=this.model.get("initialZoomDomain"),_=y(this.getOptions(),"zoomBar",G.TOP,"initialZoomDomain");_&&_[0]&&_[1]&&(_[0]=new Date(_[0]),_[1]=new Date(_[1])),_&&!(b&&b[0].valueOf()===_[0].valueOf()&&b[1].valueOf()===_[1].valueOf())?this.model.set({initialZoomDomain:ot([],_),zoomDomain:_?ot([],_):v},{skipUpdate:!0}):_===null&&b!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ot([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(je(m,O=>O.value));const E=this.model.get("zoomDomain");if(s===Ve.GRAPH_VIEW&&(this.renderZoomBarArea(h,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(h,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(h,c,l),a)){const O=a.highlightStartMapsTo,A=a.highlightEndMapsTo,D=a.color,L=a.labelMapsTo;a.data.forEach((N,M)=>{I.appendOrSelect(h,`rect.highlight-${M}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(N[O])).attr("width",this.xScale(N[A])-this.xScale(N[O])).style("fill",D&&D.scale[N[L]]?D.scale[N[L]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[N[L]]?D.scale[N[L]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(E,c,l);const x=I.appendOrSelect(n,this.brushSelector).call(this.brush);if(E!==void 0)if(E[0].valueOf()===E[1].valueOf())x.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const O=E.map(A=>this.xScale(A));O[1]-O[0]<this.MIN_SELECTION_DIFF||(x.call(this.brush.move,O),this.updateBrushHandle(this.getComponentContainer(),O))}i&&(this.brush.filter(()=>!1),x.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",G.TOP,"type"),a=we.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){let a="manual";if(n&&n[0]&&n[1]){const l=this.services.zoom.getDefaultZoomBarDomain();s[0].valueOf()===l[0].valueOf()&&s[1].valueOf()===l[1].valueOf()?a="reset":a="manual"}(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1,type:a});let o;t.type==="start"?o=T.ZoomBar.SELECTION_START:t.type==="brush"?o=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(o=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s,type:a})),this.services.events.dispatchEvent(o,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=we.handleWidth,s=y(this.getOptions(),"zoomBar",G.TOP,"type"),a=we.height[s],o=-i/2,l=we.handleBarWidth,c=s===Ve.GRAPH_VIEW?we.handleBarHeight:6,u=-l/2,h=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(p){if(p.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(p.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const d=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);d.enter().append("rect").attr("class",function(p){return"handle-bar handle-bar--"+p.type}),d.attr("x",function(p){if(p.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(p.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",h).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ve.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",G.TOP,"type"),r=we.height[n],i=this.getComponentContainer().select("svg.zoom-container");I.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,b,_)=>E=>s.getValueFromScale(v,b,_,E),h=u(this.xScale,l,a),d=u(this.yScale,c,o),p=y(this.getOptions(),"zoomBar",G.TOP,"type"),f=we.height[p],g=ru().x(v=>h(v)).y0(f).y1(v=>f-d(v)),m=I.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=I.appendOrSelect(t,"clipPath").attr("id",n);I.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=gn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",G.TOP,"type"),a=we.height[s],o=Ts()([[n,a],[r,a]]);I.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),I.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",G.TOP,"type")===Ve.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class GD extends gt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=rt.SVG,this.positionService=new ho}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(G).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u?.correspondingDatasets,mapsTo:u?.mapsTo})}});const i=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),h=l.services.cartesianScales.getScaleTypeByPosition(c);let d=null,p=null;c===G.LEFT||c===G.RIGHT?(p=u,d=l.services.cartesianScales.getMainXScale()):(d=u,p=l.services.cartesianScales.getMainYScale());const f=h===nt.LABELS,[g,m]=d.range(),[v,b]=p.range(),{cartesianScales:_}=l.services,E=_.getOrientation(),x=N=>_.getDomainValue(N),O=N=>_.getRangeValue(N),[A,D]=On(x,O,E),L=R(this);c===G.TOP||c===G.BOTTOM?(L.selectAll("line.threshold-line").transition().call(N=>l.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("y1",b).attr("y2",v).attr("x1",({datum:N})=>A(N)+(f?u.step()/2:0)).attr("x2",({datum:N})=>A(N)+(f?u.step()/2:0)).style("stroke",({fillColor:N})=>N),L.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:N})=>-A(N)).attr("width",Math.abs(v-b)).classed("rotate",!0)):(L.selectAll("line.threshold-line").transition().call(N=>l.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("x1",g).attr("x2",m).attr("y1",({datum:N})=>D(N)+(f?u.step()/2:0)).attr("y2",({datum:N})=>D(N)+(f?u.step()/2:0)).style("stroke",({fillColor:N})=>N),L.selectAll("rect.threshold-hoverable-area").attr("x",g).attr("y",({datum:N})=>D(N)).attr("width",Math.abs(m-g)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===nt.TIME){const l=[G.LEFT,G.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),h=l?u:c,d=y(i,"timeScale"),p=Yl(h.ticks(),y(d,"timeInterval"));return ql(n,0,h.ticks(),p,d,i.locale)}return o(n,a)}appendThresholdLabel(){const t=R(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=I.appendOrSelect(t,`div.${ge}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=ir(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(cn(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[Ft.RIGHT,Ft.LEFT,Ft.TOP,Ft.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){R(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:n,hoveredElement:R(this),datum:R(this).datum()})}).on("mouseout",function(n){R(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:n,hoveredElement:R(this),datum:R(this).datum()})})}}class FD extends gt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=rt.SVG,this.positionService=new ho,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(G).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),h=l.services.cartesianScales.getMainYScale(),[d,p]=u.range(),[f,g]=h.range(),{cartesianScales:m}=l.services,v=m.getOrientation(),b=A=>m.getDomainValue(A),_=A=>m.getRangeValue(A),[E,x]=On(b,_,v),O=R(this);c===G.TOP||c===G.BOTTOM?O.selectAll("rect.highlight-bar").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"highlight-bar-update",animate:t})).attr("y",Math.max(g+l.highlightStrokeWidth,0)).attr("height",Math.max(f-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:A,...D})=>E(D[A])).attr("width",({highlightStartMapsTo:A,highlightEndMapsTo:D,...L})=>Math.max(E(L[D])-E(L[A]),0)).style("stroke",({color:A,labelMapsTo:D,...L})=>A&&A.scale[L[D]]?A.scale[L[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:A,labelMapsTo:D,...L})=>A&&A.scale[L[D]]?A.scale[L[D]]:null):O.selectAll("rect.highlight-bar").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"highlight-bar-update",animate:t})).attr("x",d).attr("width",Math.max(p-d,0)).attr("y",({highlightEndMapsTo:A,...D})=>x(D[A])).attr("height",({highlightStartMapsTo:A,highlightEndMapsTo:D,...L})=>Math.max(x(L[A])-x(L[D]),0)).style("stroke",({color:A,labelMapsTo:D,...L})=>A&&A.scale[L[D]]?A.scale[L[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:A,labelMapsTo:D,...L})=>A&&A.scale[L[D]]?A.scale[L[D]]:null)})}}class Pg extends pu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let h;if(n.length===1){const d=n[0],p=i.getRangeIdentifier(d);if(a){const g=i.getRangeAxisPosition({datum:d,groups:[d[o]]});c=i.getScaleLabel(g)}const f=d[p];h=[{label:l,value:u},...Array.isArray(f)&&f.length===2?[{label:"Start",value:f[0]},{label:"End",value:f[1]}]:[{label:c,value:d[p]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>h.push({label:g.label,value:g.value})),h.push({label:vt(r,"locale.translations.group")||vt(r,"tooltip.groupLabel"),value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(h=[{label:l,value:u}],h=h.concat(n.map(d=>{const p=d[i.getRangeIdentifier(d)];return{label:d[o],value:Array.isArray(p)&&p.length===2?`${p[0]} - ${p[1]}`:p,color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:d[o]})}}).sort((d,p)=>p.value-d.value)),!a&&y(r,"tooltip","showTotal")===!0)){const d=i.getRangeIdentifier(),p=y(r,"tooltip","customTotalCalculation");let f;p?f=p(n):f=n.reduce((g,m)=>g+m[d],0),h.push({label:vt(r,"tooltip.totalLabel")||vt(r,"locale.translations.total")||"Total",value:f,bold:!0})}return h}}function Ug(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 zD(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 fu(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function jD(e){return e.depth}function WD(e,t){return t-1-e.height}function Bg(e,t){return e.sourceLinks.length?e.depth:t-1}function po(e){return function(){return e}}function Hg(e,t){return fo(e.source,t.source)||e.index-t.index}function Vg(e,t){return fo(e.target,t.target)||e.index-t.index}function fo(e,t){return e.y0-t.y0}function mu(e){return e.value}function qD(e){return e.index}function YD(e){return e.nodes}function ZD(e){return e.links}function Gg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Fg({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function XD(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=qD,l=Bg,c,u,h=YD,d=ZD,p=6;function f(){const S={nodes:h.apply(null,arguments),links:d.apply(null,arguments)};return g(S),m(S),v(S),b(S),x(S),Fg(S),S}f.update=function(S){return Fg(S),S},f.nodeId=function(S){return arguments.length?(o=typeof S=="function"?S:po(S),f):o},f.nodeAlign=function(S){return arguments.length?(l=typeof S=="function"?S:po(S),f):l},f.nodeSort=function(S){return arguments.length?(c=S,f):c},f.nodeWidth=function(S){return arguments.length?(i=+S,f):i},f.nodePadding=function(S){return arguments.length?(s=a=+S,f):s},f.nodes=function(S){return arguments.length?(h=typeof S=="function"?S:po(S),f):h},f.links=function(S){return arguments.length?(d=typeof S=="function"?S:po(S),f):d},f.linkSort=function(S){return arguments.length?(u=S,f):u},f.size=function(S){return arguments.length?(e=t=0,n=+S[0],r=+S[1],f):[n-e,r-t]},f.extent=function(S){return arguments.length?(e=+S[0][0],n=+S[1][0],t=+S[0][1],r=+S[1][1],f):[[e,t],[n,r]]},f.iterations=function(S){return arguments.length?(p=+S,f):p};function g({nodes:S,links:U}){for(const[w,C]of S.entries())C.index=w,C.sourceLinks=[],C.targetLinks=[];const B=new Map(S.map((w,C)=>[o(w,C,S),w]));for(const[w,C]of U.entries()){C.index=w;let{source:P,target:W}=C;typeof P!="object"&&(P=C.source=Gg(B,P)),typeof W!="object"&&(W=C.target=Gg(B,W)),P.sourceLinks.push(C),W.targetLinks.push(C)}if(u!=null)for(const{sourceLinks:w,targetLinks:C}of S)w.sort(u),C.sort(u)}function m({nodes:S}){for(const U of S)U.value=U.fixedValue===void 0?Math.max(fu(U.sourceLinks,mu),fu(U.targetLinks,mu)):U.fixedValue}function v({nodes:S}){const U=S.length;let B=new Set(S),w=new Set,C=0;for(;B.size;){for(const P of B){P.depth=C;for(const{target:W}of P.sourceLinks)w.add(W)}if(++C>U)throw new Error("circular link");B=w,w=new Set}}function b({nodes:S}){const U=S.length;let B=new Set(S),w=new Set,C=0;for(;B.size;){for(const P of B){P.height=C;for(const{source:W}of P.targetLinks)w.add(W)}if(++C>U)throw new Error("circular link");B=w,w=new Set}}function _({nodes:S}){const U=Ug(S,C=>C.depth)+1,B=(n-e-i)/(U-1),w=new Array(U);for(const C of S){const P=Math.max(0,Math.min(U-1,Math.floor(l.call(null,C,U))));C.layer=P,C.x0=e+P*B,C.x1=C.x0+i,w[P]?w[P].push(C):w[P]=[C]}if(c)for(const C of w)C.sort(c);return w}function E(S){const U=zD(S,B=>(r-t-(B.length-1)*a)/fu(B,mu));for(const B of S){let w=t;for(const C of B){C.y0=w,C.y1=w+C.value*U,w=C.y1+a;for(const P of C.sourceLinks)P.width=P.value*U}w=(r-w+a)/(B.length+1);for(let C=0;C<B.length;++C){const P=B[C];P.y0+=w*(C+1),P.y1+=w*(C+1)}V(B)}}function x(S){const U=_(S);a=Math.min(s,(r-t)/(Ug(U,B=>B.length)-1)),E(U);for(let B=0;B<p;++B){const w=Math.pow(.99,B),C=Math.max(1-w,(B+1)/p);A(U,w,C),O(U,w,C)}}function O(S,U,B){for(let w=1,C=S.length;w<C;++w){const P=S[w];for(const W of P){let q=0,K=0;for(const{source:tt,value:X}of W.targetLinks){let et=X*(W.layer-tt.layer);q+=k(tt,W)*et,K+=et}if(!(K>0))continue;let ut=(q/K-W.y0)*U;W.y0+=ut,W.y1+=ut,M(W)}c===void 0&&P.sort(fo),D(P,B)}}function A(S,U,B){for(let w=S.length,C=w-2;C>=0;--C){const P=S[C];for(const W of P){let q=0,K=0;for(const{target:tt,value:X}of W.sourceLinks){let et=X*(tt.layer-W.layer);q+=H(W,tt)*et,K+=et}if(!(K>0))continue;let ut=(q/K-W.y0)*U;W.y0+=ut,W.y1+=ut,M(W)}c===void 0&&P.sort(fo),D(P,B)}}function D(S,U){const B=S.length>>1,w=S[B];N(S,w.y0-a,B-1,U),L(S,w.y1+a,B+1,U),N(S,r,S.length-1,U),L(S,t,0,U)}function L(S,U,B,w){for(;B<S.length;++B){const C=S[B],P=(U-C.y0)*w;P>1e-6&&(C.y0+=P,C.y1+=P),U=C.y1+a}}function N(S,U,B,w){for(;B>=0;--B){const C=S[B],P=(C.y1-U)*w;P>1e-6&&(C.y0-=P,C.y1-=P),U=C.y0-a}}function M({sourceLinks:S,targetLinks:U}){if(u===void 0){for(const{source:{sourceLinks:B}}of U)B.sort(Vg);for(const{target:{targetLinks:B}}of S)B.sort(Hg)}}function V(S){if(u===void 0)for(const{sourceLinks:U,targetLinks:B}of S)U.sort(Vg),B.sort(Hg)}function k(S,U){let B=S.y0-(S.sourceLinks.length-1)*a/2;for(const{target:w,width:C}of S.sourceLinks){if(w===U)break;B+=C+a}for(const{source:w,width:C}of U.targetLinks){if(w===S)break;B-=C}return B}function H(S,U){let B=U.y0-(U.targetLinks.length-1)*a/2;for(const{source:w,width:C}of U.targetLinks){if(w===S)break;B+=C+a}for(const{target:w,width:C}of S.sourceLinks){if(w===U)break;B-=C}return B}return f}var gu=Math.PI,vu=2*gu,_r=1e-6,KD=vu-_r;function yu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function zg(){return new yu}yu.prototype=zg.prototype={constructor:yu,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,h=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>_r)if(!(Math.abs(u*o-l*c)>_r)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var d=n-s,p=r-a,f=o*o+l*l,g=d*d+p*p,m=Math.sqrt(f),v=Math.sqrt(h),b=i*Math.tan((gu-Math.acos((f+h-g)/(2*m*v)))/2),_=b/v,E=b/m;Math.abs(_-1)>_r&&(this._+="L"+(e+_*c)+","+(t+_*u)),this._+="A"+i+","+i+",0,0,"+ +(u*d>c*p)+","+(this._x1=e+E*o)+","+(this._y1=t+E*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,h=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>_r||Math.abs(this._y1-c)>_r)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%vu+vu),h>KD?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>_r&&(this._+="A"+n+","+n+",0,"+ +(h>=gu)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function jg(e){return function(){return e}}function QD(e){return e[0]}function JD(e){return e[1]}var tk=Array.prototype.slice;function ek(e){return e.source}function nk(e){return e.target}function rk(e){var t=ek,n=nk,r=QD,i=JD,s=null;function a(){var o,l=tk.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=zg()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:jg(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:jg(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function ik(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function sk(){return rk(ik)}function ak(e){return[e.source.x1,e.y0]}function ok(e){return[e.target.x0,e.y1]}function lk(){return sk().source(ak).target(ok)}class ck extends gt{constructor(){super(...arguments),this.type="alluvial",this.renderType=rt.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"alluvial graphs",withinChartClip:!0});n.html("");const{width:r,height:i}=I.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(this.getOptions(),"color","gradient","enabled");let l=Ze.minNodePadding;s.alluvial.nodePadding>Ze.minNodePadding&&(l=s.alluvial.nodePadding);const c=y(s,"alluvial","nodeAlignment");let u=Bg;c===jt.LEFT?u=jD:c===jt.RIGHT&&(u=WD);const h=XD().nodeId(b=>b.name).nodeWidth(Ze.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=h({nodes:s.alluvial.nodes.map(b=>Object.assign({},b)),links:a.map(b=>Object.assign({},b))}),this.graph.nodes=this.graph.nodes.filter(b=>b.value!==0);const d={};this.graph.nodes.forEach(b=>{const _=b.x0;b.category&&(d[_]=b?.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(d)).join("g").attr("transform",b=>`translate(${b}, 0)`).append("text").attr("id",(b,_)=>this.services.domUtils.generateElementIDString(`alluvial-category-${_}`)).style("font-size","14px").text(b=>d[b]?d[b]:"").attr("y",20).attr("x",(b,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-category-${_}`),{width:x}=I.getSVGElementSize(R(`text#${E}`),{useBBox:!0});let O=0;return b+O>=x&&(O=-x+4),O});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const b=y(this.getOptions(),"color","scale");b&&p.enter().append("linearGradient").attr("id",_=>`${this.gradient_id}-link-${_.index}`).attr("gradientUnits","userSpaceOnUse").call(_=>_.append("stop").attr("offset","0%").attr("stop-color",E=>b[E.source.name])).call(_=>_.append("stop").attr("offset","100%").attr("stop-color",E=>b[E.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",lk()).attr("id",b=>this.services.domUtils.generateElementIDString(`alluvial-line-${b.index}`)).attr("class",b=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:b.source.index,originalClassName:"link"})).style("stroke",b=>o?`url(#${this.gradient_id}-link-${b.index})`:this.model.getFillColor(b.source.name,null,{...b,source:b.source.name,target:b.target.name})).attr("stroke-width",b=>Math.max(1,b.width)).style("stroke-opacity",Ze.opacity.default).attr("aria-label",b=>`${b.source.name} → ${b.target.name} (${b.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const f=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",b=>this.services.domUtils.generateElementIDString(`alluvial-node-${b.index}`)).classed("node-group",!0).attr("transform",b=>`translate(${b.x0}, ${b.y0})`);f.append("rect").classed("node",!0).attr("height",b=>b.y1-b.y0).attr("width",b=>b.x1-b.x0).attr("fill","black");const g=f.append("g").attr("id",b=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${b.index}`)),{code:m,number:v}=y(s,"locale");g.append("text").attr("id",b=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${b.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(b=>`${b.name} (${v(b.value,m)})`).attr("aria-label",b=>`${b.name} (${b.value})`),g.append("rect").classed("node-text-bg",!0).attr("width",(b,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:x}=I.getSVGElementSize(R(`text#${E}`),{useBBox:!0});return x+8}).attr("height",18).attr("stroke-width",2).lower(),g.attr("transform",(b,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:x}=I.getSVGElementSize(R(`text#${E}`),{useBBox:!0}),O=(b.y1-b.y0)/2-9;let A=b.x1-b.x0;return b.x1>=x?A=A-(x+16):A+=4,`translate(${A}, ${O})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=y(this.getOptions(),"locale"),s=Oa((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(R(a).lower(),l.style("stroke-opacity",Ze.opacity.default)):l.style("stroke-opacity",function(){return a===this?(R(this).raise(),Ze.opacity.selected):Ze.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=R(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(r(o.value,i)?`${r(o.value,i)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEMOVE,{event:a,element:R(this),datum:o}),n.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_CLICK,{event:a,element:R(this),datum:o})}).on("mouseout",function(a,o){const l=R(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=Oa((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",Ze.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return r.some(a=>a===s.index)?(R(this).classed("link-hovered",!0).raise(),Ze.opacity.selected):Ze.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=R(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=Ji(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),h=Ji(u.attr("transform"));u.attr("transform",`translate(${h.x+4},${h.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEMOVE,{event:r,element:R(this),datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_CLICK,{event:r,element:R(this),datum:i})}).on("mouseout",function(r,i){const s=R(this),a=Ji(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Ze.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=Ji(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}getRightArrowIcon(){return`
63
63
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
64
64
  <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"/>
65
65
  <rect width="32" height="32"/>
66
- </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Ce extends gt{constructor(){super(...arguments),this.type="grid",this.renderType=rt.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=vc(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=am(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(En(u).tx)-Number(En(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+En(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+En(o).tx;else if(o)l=+En(o).tx-+En(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=N.getSVGElementSize(u).width-+En(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=En(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 Wg extends gt{constructor(){super(...arguments),this.type="area",this.renderType=rt.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?xn.opacity.unselected:xn.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",xn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=ru().curve(this.services.curves.getD3Curve()).defined(b=>{const O=s.getRangeIdentifier();return b[O]!=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,O)=>{y(r,"axes",b,"includeZero")===!1&&O[0]>0&&O[1]>0&&(d=O[0])},p=b=>u?s.getBoundedScaledValues(b)[0]:s.getRangeValue(d),f=b=>u?s.getBoundedScaledValues(b)[1]:s.getRangeValue(b);a===zt.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 O;if(b)O=getComputedStyle(b,null).getPropertyValue("stroke");else{const M=y(this.model.getOptions(),"color","scale");if(M!==null){const k=Object.keys(M);O=M[k[0]]}}mc.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:mc.getStops(i,O)})}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:O}=b;return o(O)}):(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:xn.opacity.selected).attr("d",b=>{const{data:O}=b;return o(O)}),u&&E.attr("fill-opacity",xn.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class pi extends gt{constructor(){super(...arguments),this.type="line",this.renderType=rt.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?_n.opacity.unselected:_n.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",_n.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,r=this.model.get("zoomDomain")!==void 0,i=n&&r?this.getComponentContainer({ariaLabel:"lines",withinChartClip:!1}):this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:s,curves:a}=this.services,o=m=>s.getDomainValue(m),l=m=>s.getRangeValue(m),[c,u]=Tn(o,l,s.getOrientation()),d=this.getOptions(),h=Os().x(c).y(u).curve(a.getD3Curve()).defined(m=>{const v=s.getRangeIdentifier(m);return m[v]!=null});let p=[];if(this.configs.stacked){const m=Object.keys(d.axes).some(x=>d.axes[x].percentage),{groupMapsTo:v}=d.data;p=this.model.getStackedData({groups:this.configs.groups,percentage:m}).map(x=>{const _=this.services.cartesianScales.getDomainIdentifier(x),E=this.services.cartesianScales.getRangeIdentifier(x);return{name:y(x,0,v),data:x.map(b=>({[_]:b.data.sharedStackKey,[v]:b[v],[E]:b[1]})),hidden:!kC(x,b=>b[0]!==b[1])}})}else p=this.model.getGroupedData(this.configs.groups);const f=i.selectAll("path.line").data(p,m=>m.name);f.exit().attr("opacity",0).remove();const g=f.enter().append("path").classed("line",!0).attr("opacity",0).merge(f).data(p,m=>m.name).attr("class",m=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:m.name,originalClassName:"line"})).style("stroke",m=>this.model.getStrokeColor(m.name,null,m.data)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",m=>{const{data:v}=m;return v.map(x=>{const _=this.services.cartesianScales.getRangeIdentifier(x);return x[_]}).join(",")});if(n&&r){const m=s.getMainXScale(),v=s.getMainYScale();if(m&&v){const[x,_]=m.range(),[E,b]=v.range();i.style("overflow","hidden").style("clip",`rect(${b}px, ${_}px, ${E}px, ${x}px)`)}}g.transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"line-update-enter",animate:t})).attr("opacity",m=>m.hidden?0:1).attr("d",m=>{const{data:v}=m;return h(v)})}destroy(){const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const qg=5;function uD(e,t){return e>t-qg&&e<t+qg}class zn extends gt{constructor(){super(...arguments),this.type="ruler",this.renderType=rt.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"),r=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),i=n||r;this.drawBackdrop(),i&&!this.isEventListenerAdded?this.addBackdropEventListeners():!i&&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===zt.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=>uD(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(S.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&&!rm(this.elementsToHighlight,x)&&this.hideRuler(),x.dispatch("mouseover"),this.elementsToHighlight=x,this.services.events.dispatchEvent(S.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(S.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=ir(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=iw(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")}}class un extends gt{constructor(){super(...arguments),this.type="scatter",this.renderType=rt.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>this.services.transitions?.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=>this.services.transitions?.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=>this.services.transitions?.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=>this.services.transitions?.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(S.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(S.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.services.zoom?.isZoomBarEnabled()||!1,r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:n}),i=this.getOptions(),{groupMapsTo:s}=i.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=r.selectAll("circle.dot").data(this.getScatterData(),u=>`${u[s]}-${u[o]}`);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l);this.styleCircles(c,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]=Tn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Tn(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]=Tn(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=>this.services.transitions?.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",dt.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,r=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip");if(!this.parent)throw new Error("Parent not defined");const i=this.parent.selectAll("circle");r?i.style("pointer-events","none"):i.style("pointer-events",null),i.on("mouseover",function(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=>{const c=t.services.cartesianScales?.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),r||t.services.events?.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,data:[a],additionalItems:t.getTooltipAdditionalItems(a)}),t.services.events?.dispatchEvent(S.Scatter.SCATTER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=I(this);t.services.events?.dispatchEvent(S.Scatter.SCATTER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events?.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events?.dispatchEvent(S.Scatter.SCATTER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);if(o.classed("hovered",!1),!t.configs.filled){const{filled:l}=t.getOptions().points,c=t.services.cartesianScales?.getDomainIdentifier(a),u=t.model.getIsFilled(a[n],a[c],a,l);o.classed("unfilled",!u).style("fill",d=>u||l?t.model.getFillColor(d[n],d[c],d):null)}t.services.events?.dispatchEvent(S.Scatter.SCATTER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events?.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o})})}destroy(){this.parent?.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(S.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(S.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class Yg extends gt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=rt.SVG,this.truncation={[V.LEFT]:!1,[V.RIGHT]:!1,[V.TOP]:!1,[V.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===V.BOTTOM||n===V.TOP?(c=this.configs.axes[V.LEFT]?this.margins.left:0,u=this.configs.axes[V.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 V.LEFT:h=am;break;case V.BOTTOM:h=vc;break;case V.RIGHT:h=VC;break;case V.TOP:h=HC;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",`${dt.GRAPHICS_OBJECT} ${dt.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===V.LEFT||n===V.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"),O=y(m,"ticks","number"),M=y(m,"ticks","values"),k=y(m,"truncation","type"),A=y(m,"truncation","threshold"),R=y(m,"truncation","numCharacter"),C=O!==null,H=y(r,"timeScale"),P=N.appendOrSelect(g,"g.tick"),U=N.appendOrSelect(P,"text").text("0"),T=N.getSVGElementSize(U.node(),{useBBox:!0}).height;P.remove();const $=this.scaleType||m.scaleType||nt.LINEAR,L=h(d).tickSizeOuter(0);if(d.ticks){let X;if(C?X=O:(X=Bn.ticks.number,x&&(X=this.getNumberOfFittingTicks(o,T,Bn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(X=0),L.ticks(X),v)if(!d.ticks(X).length)L.tickValues([]);else{const et=y(r,"timeScale","addSpaceOnEdges"),at=y(r,"axes",n,"domain"),z=d.copy();et&&!at&&z.nice(X);const q=z.ticks(X);et&&q.length>2&&!at&&(q.splice(q.length-1,1),q.splice(0,1)),L.tickValues(q)}}let D;const B=y(m,"ticks","formatter"),{code:Q,number:W}=y(r,"locale");if(v){const X=Yl(L.tickValues(),y(r,"timeScale","timeInterval"));B===null?D=(et,at)=>ql(et,at,L.tickValues(),X,H,r.locale):D=(et,at)=>{const z=ql(et,at,L.tickValues(),X,H,r.locale);return B(et,at,z)}}else B===null?$===nt.LINEAR&&(D=X=>W(X,Q)):D=B;L.tickFormat(D);const[j,Z]=this.services.cartesianScales.getScaleByPosition(n).domain();let ut;if(M){if(v)M.forEach((X,et)=>{X.getTime===void 0&&(M[et]=new Date(X))}),ut=M.filter(X=>{const et=X.getTime();return et>=new Date(j).getTime()&&et<=new Date(Z).getTime()});else if(E===nt.LABELS){const X=this.services.cartesianScales.getScaleByPosition(n).domain();ut=M.filter(et=>X.includes(et))}else ut=M.filter(X=>X>=j&&X<=Z);L.tickValues(ut)}switch(n){case V.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case V.BOTTOM:f.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case V.RIGHT:f.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case V.TOP:f.attr("transform",`translate(0, ${this.margins.top})`);break}const tt=this.model.isDataEmpty();if(m.title){const X=N.appendOrSelect(l,"text.axis-title").html(tt||b?"":cn(m.title)),et=y(m,"titleOrientation");let at;switch(n){case V.LEFT:et===Ps.RIGHT?X.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):X.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case V.BOTTOM:const z=o-_p;X.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${z})`);break;case V.RIGHT:et===Ps.LEFT?X.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):X.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case V.TOP:at=N.getSVGElementSize(X,{useBBox:!0}).height,X.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${at/2})`).style("text-anchor","middle");break}}if(v){const X=Yl(L.tickValues(),y(r,"timeScale","timeInterval")),et=H.showDayName,at=f;t&&(f=f.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"axis-update",animate:t}))),f=f.call(L),at.selectAll(".tick").data(L.tickValues(),d).order().select("text").attr("class",(z,q)=>Vp(z,q,L.tickValues(),X,et)?"tick-label--primary":"tick-label")}else!t||!p?f=f.call(L):f=f.transition().call(X=>this.services.transitions.setupTransition({transition:X,name:"axis-update",animate:t})).call(L);if(g.call(L),n===V.BOTTOM||n===V.TOP){let X=!1;const et=y(m,"ticks","rotation");if(et===Ti.ALWAYS)X=!0;else if(et===Ti.NEVER)X=!1;else if(!et||et===Ti.AUTO)if(d.step)X=g.selectAll("g.tick text").nodes().some(at=>N.getSVGElementSize(at,{useBBox:!0}).width>=d.step());else{X=!1;const at=g.append("text").text("A"),z=N.getSVGElementSize(at.node(),{useBBox:!0}).width;let q;g.selectAll("g.tick").each(function(){const K=I(this),F=parseFloat(y(En(this),"tx"));F!==null&&q+K.text().length*z*.8>=F&&(X=!0),q=F}),at.remove()}X?(C||(L.ticks(this.getNumberOfFittingTicks(a,T,Bn.ticks.horizontalSpaceRatio)),g.call(L),f.call(L)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===V.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",X=>X),g.selectAll("g.tick").attr("aria-label",X=>X),k!==Ae.NONE&&E===nt.LABELS&&!M){const X=this.services.cartesianScales.getScaleDomain(n);if(X.length>0){const et=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(et);const at=this;l.selectAll("g.tick text").data(X).text(function(z){return z.length>A?(at.truncation[n]=!0,ts(z,k,R)):z}),this.getInvisibleAxisRef().selectAll("g.tick text").data(X).text(function(z){return z.length>A?ts(z,k,R):z}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(X)}}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(S.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===nt.LABELS&&u.length>o&&l.services.events.dispatchEvent(S.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===nt.LABELS&&u.length>o&&l.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===nt.LABELS&&l.services.events.dispatchEvent(S.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 nm(i,2,Bn.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 hD extends Yg{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("role","button").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 V.LEFT:p=-u+Number(c.attr("x")),f=-(d/2);break;case V.RIGHT:p=Math.abs(Number(c.attr("x"))),f=-(d/2);break;case V.TOP:p=-(u/2),f=-d+Number(c.attr("y"))/2,s.truncation[n]&&(p=0,h.attr("transform","rotate(-45)"));break;case V.BOTTOM:p=-(u/2),f=d/2-2,s.truncation[n]&&(p=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",p-Bn.hover.rectanglePadding).attr("y",f).attr("width",u+Bn.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(S.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===nt.LABELS&&d.length>o&&l.services.events.dispatchEvent(S.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(S.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(S.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(S.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===nt.LABELS&&l.services.events.dispatchEvent(S.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(S.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(S.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(S.Tooltip.HIDE),l.services.events.dispatchEvent(S.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===V.LEFT||n===V.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 xe extends gt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=rt.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(V),i=y(this.getOptions(),"axes");r.forEach(a=>{i[V[a]]&&(n[V[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=V[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===Si.DEFAULT?new Yg(this.model,this.services,l):new hD(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=0;if(!o.getTitleRef().empty()){const g=N.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height;l===V.LEFT||l===V.RIGHT?h=g+5:l===V.BOTTOM?h=g+_p:h=g}const p=u,f=d;switch(l){case V.TOP:s.top=f+h;break;case V.BOTTOM:s.bottom=f+h;break;case V.LEFT:s.left=p+h;break;case V.RIGHT:s.right=p+h;break}}),this.services.events.dispatchEvent(S.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(S.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class de 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===Wt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Wt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Wt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Wt.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===zt.VERTICAL&&this.drawYGrid(t),n===zt.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=Ye().domain([0,1]).range(t),this.yScale=Ye().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).attr("role","presentation"),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=Ts().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(kt.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+kt.xOffset;c===jt.CENTER?f=s/2:c===jt.RIGHT&&(f=s-t-kt.xOffset);const g=t+kt.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+kt.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
+ </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Ce extends gt{constructor(){super(...arguments),this.type="grid",this.renderType=rt.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&&(I.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(I.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=vc(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=am(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,h)=>Number(En(u).tx)-Number(En(h).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+En(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+En(o).tx;else if(o)l=+En(o).tx-+En(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=I.getSVGElementSize(u).width-+En(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=En(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=I.appendOrSelect(r,"svg.chart-grid-backdrop").attr("role","presentation");const u=I.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 Wg extends gt{constructor(){super(...arguments),this.type="area",this.renderType=rt.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?xn.opacity.unselected:xn.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",xn.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=ru().curve(this.services.curves.getD3Curve()).defined(x=>{const O=s.getRangeIdentifier();return x[O]!=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 h=0;const d=(x,O)=>{y(r,"axes",x,"includeZero")===!1&&O[0]>0&&O[1]>0&&(h=O[0])},p=x=>u?s.getBoundedScaledValues(x)[0]:s.getRangeValue(h),f=x=>u?s.getBoundedScaledValues(x)[1]:s.getRangeValue(x);a===zt.VERTICAL?(i=s.getMainYScale().domain(),d(s.getMainYAxisPosition(),i),o.x(x=>s.getDomainValue(x)).y0(x=>p(x)).y1(x=>f(x))):(i=s.getMainXScale().domain(),d(s.getMainXAxisPosition(),i),o.x0(x=>p(x)).x1(x=>f(x)).y(x=>s.getDomainValue(x)));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,x=>x.name),b=R(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const x=b.select(`path.${this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:l[0].name})}`).node();let O;if(x)O=getComputedStyle(x,null).getPropertyValue("stroke");else{const A=y(this.model.getOptions(),"color","scale");if(A!==null){const D=Object.keys(A);O=A[D[0]]}}mc.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:mc.getStops(i,O)})}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",x=>`url(#${this.services.domUtils.generateElementIDString(`${x.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:x.name,originalClassName:"area"})).attr("d",x=>{const{data:O}=x;return o(O)}):(E.attr("opacity",0).merge(v).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:x.name,originalClassName:"area"})).style("fill",x=>_.model.getFillColor(x.name,null,x.data)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"area-update-enter",animate:t})).attr("opacity",u?1:xn.opacity.selected).attr("d",x=>{const{data:O}=x;return o(O)}),u&&E.attr("fill-opacity",xn.opacity.selected).style("stroke",x=>_.model.getStrokeColor(x.name,null,x.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 pi extends gt{constructor(){super(...arguments),this.type="line",this.renderType=rt.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?_n.opacity.unselected:_n.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",_n.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=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,r=this.model.get("zoomDomain")!==void 0,i=n&&r?this.getComponentContainer({ariaLabel:"lines",withinChartClip:!1}):this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:s,curves:a}=this.services,o=m=>s.getDomainValue(m),l=m=>s.getRangeValue(m),[c,u]=On(o,l,s.getOrientation()),h=this.getOptions(),d=Ts().x(c).y(u).curve(a.getD3Curve()).defined(m=>{const v=s.getRangeIdentifier(m);return m[v]!=null});let p=[];if(this.configs.stacked){const m=Object.keys(h.axes).some(b=>h.axes[b].percentage),{groupMapsTo:v}=h.data;p=this.model.getStackedData({groups:this.configs.groups,percentage:m}).map(b=>{const _=this.services.cartesianScales.getDomainIdentifier(b),E=this.services.cartesianScales.getRangeIdentifier(b);return{name:y(b,0,v),data:b.map(x=>({[_]:x.data.sharedStackKey,[v]:x[v],[E]:x[1]})),hidden:!DC(b,x=>x[0]!==x[1])}})}else p=this.model.getGroupedData(this.configs.groups);const f=i.selectAll("path.line").data(p,m=>m.name);f.exit().attr("opacity",0).remove();const g=f.enter().append("path").classed("line",!0).attr("opacity",0).merge(f).data(p,m=>m.name).attr("class",m=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:m.name,originalClassName:"line"})).style("stroke",m=>this.model.getStrokeColor(m.name,null,m.data)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",m=>{const{data:v}=m;return v.map(b=>{const _=this.services.cartesianScales.getRangeIdentifier(b);return b[_]}).join(",")});if(n&&r){const m=s.getMainXScale(),v=s.getMainYScale();if(m&&v){const[b,_]=m.range(),[E,x]=v.range();i.style("overflow","hidden").style("clip",`rect(${x}px, ${_}px, ${E}px, ${b}px)`)}}g.transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"line-update-enter",animate:t})).attr("opacity",m=>m.hidden?0:1).attr("d",m=>{const{data:v}=m;return d(v)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const qg=5;function uk(e,t){return e>t-qg&&e<t+qg}class zn extends gt{constructor(){super(...arguments),this.type="ruler",this.renderType=rt.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"),r=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),i=n||r;this.drawBackdrop(),i&&!this.isEventListenerAdded?this.addBackdropEventListeners():!i&&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===zt.HORIZONTAL?r:n,h=I.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),d=I.appendOrSelect(h,"line.ruler-line"),p=i.selectAll("[role=graphics-symbol]"),f=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>uk(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 b=m[0].domainValue,_=Math.abs(u-v.domainValue),E=Math.abs(u-b);return _>E||(_<E?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(E=>E.originalData).filter(E=>{const x=this.services.cartesianScales.getRangeIdentifier(E);return E[x]!=null}),v=g.map(E=>E.domainValue),b=p.filter(E=>{const x=this.services.cartesianScales.getDomainValue(E);return v.includes(x)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!rm(this.elementsToHighlight,b)&&this.hideRuler(),b.dispatch("mouseover"),this.elementsToHighlight=b,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:d,data:this.formatTooltipData(m)}),h.attr("opacity",1);const _=g[0];s==="horizontal"?d.attr("x1",c).attr("x2",l).attr("y1",_.domainValue).attr("y2",_.domainValue):d.attr("y1",c).attr("y2",l).attr("x1",_.domainValue).attr("x2",_.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=I.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=ir(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=iS(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=I.appendOrSelect(t,"svg.chart-grid-backdrop")}}class un extends gt{constructor(){super(...arguments),this.type="scatter",this.renderType=rt.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>this.services.transitions?.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=>this.services.transitions?.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=>this.services.transitions?.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=>this.services.transitions?.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.services.zoom?.isZoomBarEnabled()||!1,r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:n}),i=this.getOptions(),{groupMapsTo:s}=i.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=r.selectAll("circle.dot").data(this.getScatterData(),u=>`${u[s]}-${u[o]}`);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l);this.styleCircles(c,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]=On(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=On(h=>r.getDomainValue(h),h=>r.getRangeValue(h),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,h]=On(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:d}=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=>this.services.transitions?.setupTransition({transition:p,name:"scatter-update-enter",animate:n})).attr("cx",u).attr("cy",h).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",d?0:1).attr("role",dt.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,r=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip");if(!this.parent)throw new Error("Parent not defined");const i=this.parent.selectAll("circle");r?i.style("pointer-events","none"):i.style("pointer-events",null),i.on("mouseover",function(s,a){const o=R(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{const c=t.services.cartesianScales?.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),r||t.services.events?.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,data:[a],additionalItems:t.getTooltipAdditionalItems(a)}),t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=R(this);t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events?.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events?.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:s,element:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(this);if(o.classed("hovered",!1),!t.configs.filled){const{filled:l}=t.getOptions().points,c=t.services.cartesianScales?.getDomainIdentifier(a),u=t.model.getIsFilled(a[n],a[c],a,l);o.classed("unfilled",!u).style("fill",h=>u||l?t.model.getFillColor(h[n],h[c],h):null)}t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events?.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}destroy(){this.parent?.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class Yg extends gt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=rt.SVG,this.truncation={[G.LEFT]:!1,[G.RIGHT]:!1,[G.TOP]:!1,[G.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}=I.getSVGElementSize(s,{useAttrs:!0}),l=I.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===G.BOTTOM||n===G.TOP?(c=this.configs.axes[G.LEFT]?this.margins.left:0,u=this.configs.axes[G.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 h=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===nt.LABELS||this.scaleType===nt.LABELS_RATIO?h.rangeRound([c,u]):h.range([c,u]);let d;switch(n){case G.LEFT:d=am;break;case G.BOTTOM:d=vc;break;case G.RIGHT:d=VC;break;case G.TOP:d=HC;break}l.attr("aria-label",`${n} axis`);const p=!l.select("g.ticks").empty();let f=I.appendOrSelect(l,"g.ticks");p||(f.attr("role",`${dt.GRAPHICS_OBJECT} ${dt.GROUP}`),f.attr("aria-label",`${n} ticks`));const g=I.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,b=n===G.LEFT||n===G.RIGHT,_=this.model.get("zoomDomain");if(_&&v&&!b&&h.domain(_),!i){f.attr("aria-hidden",!0);return}const E=y(m,"scaleType"),x=y(r,"data","loading"),O=y(m,"ticks","number"),A=y(m,"ticks","values"),D=y(m,"truncation","type"),L=y(m,"truncation","threshold"),N=y(m,"truncation","numCharacter"),M=O!==null,V=y(r,"timeScale"),k=I.appendOrSelect(g,"g.tick"),H=I.appendOrSelect(k,"text").text("0"),S=I.getSVGElementSize(H.node(),{useBBox:!0}).height;k.remove();const U=this.scaleType||m.scaleType||nt.LINEAR,B=d(h).tickSizeOuter(0);if(h.ticks){let X;if(M?X=O:(X=Un.ticks.number,b&&(X=this.getNumberOfFittingTicks(o,S,Un.ticks.verticalSpaceRatio))),h.ticks().length===1&&h.ticks()[0]===0&&(X=0),B.ticks(X),v)if(!h.ticks(X).length)B.tickValues([]);else{const et=y(r,"timeScale","addSpaceOnEdges"),at=y(r,"axes",n,"domain"),j=h.copy();et&&!at&&j.nice(X);const Y=j.ticks(X);et&&Y.length>2&&!at&&(Y.splice(Y.length-1,1),Y.splice(0,1)),B.tickValues(Y)}}let w;const C=y(m,"ticks","formatter"),{code:P,number:W}=y(r,"locale");if(v){const X=Yl(B.tickValues(),y(r,"timeScale","timeInterval"));C===null?w=(et,at)=>ql(et,at,B.tickValues(),X,V,r.locale):w=(et,at)=>{const j=ql(et,at,B.tickValues(),X,V,r.locale);return C(et,at,j)}}else C===null?U===nt.LINEAR&&(w=X=>W(X,P)):w=C;B.tickFormat(w);const[q,K]=this.services.cartesianScales.getScaleByPosition(n).domain();let ut;if(A){if(v)A.forEach((X,et)=>{X.getTime===void 0&&(A[et]=new Date(X))}),ut=A.filter(X=>{const et=X.getTime();return et>=new Date(q).getTime()&&et<=new Date(K).getTime()});else if(E===nt.LABELS){const X=this.services.cartesianScales.getScaleByPosition(n).domain();ut=A.filter(et=>X.includes(et))}else ut=A.filter(X=>X>=q&&X<=K);B.tickValues(ut)}switch(n){case G.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case G.BOTTOM:f.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case G.RIGHT:f.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case G.TOP:f.attr("transform",`translate(0, ${this.margins.top})`);break}const tt=this.model.isDataEmpty();if(m.title){const X=I.appendOrSelect(l,"text.axis-title").html(tt||x?"":cn(m.title)),et=y(m,"titleOrientation");let at;switch(n){case G.LEFT:et===Ps.RIGHT?X.attr("transform","rotate(90)").attr("y",0).attr("x",h.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):X.attr("transform","rotate(-90)").attr("y",0).attr("x",-(h.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case G.BOTTOM:const j=o-_p;X.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${j})`);break;case G.RIGHT:et===Ps.LEFT?X.attr("transform","rotate(-90)").attr("y",a).attr("x",-(h.range()[0]/2)).style("text-anchor","middle"):X.attr("transform","rotate(90)").attr("y",-a).attr("x",h.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case G.TOP:at=I.getSVGElementSize(X,{useBBox:!0}).height,X.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${at/2})`).style("text-anchor","middle");break}}if(v){const X=Yl(B.tickValues(),y(r,"timeScale","timeInterval")),et=V.showDayName,at=f;t&&(f=f.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t}))),f=f.call(B),at.selectAll(".tick").data(B.tickValues(),h).order().select("text").attr("class",(j,Y)=>Vp(j,Y,B.tickValues(),X,et)?"tick-label--primary":"tick-label")}else!t||!p?f=f.call(B):f=f.transition().call(X=>this.services.transitions.setupTransition({transition:X,name:"axis-update",animate:t})).call(B);if(g.call(B),n===G.BOTTOM||n===G.TOP){let X=!1;const et=y(m,"ticks","rotation");if(et===Oi.ALWAYS)X=!0;else if(et===Oi.NEVER)X=!1;else if(!et||et===Oi.AUTO)if(h.step)X=g.selectAll("g.tick text").nodes().some(at=>I.getSVGElementSize(at,{useBBox:!0}).width>=h.step());else{X=!1;const at=g.append("text").text("A"),j=I.getSVGElementSize(at.node(),{useBBox:!0}).width;let Y;g.selectAll("g.tick").each(function(){const Q=R(this),z=parseFloat(y(En(this),"tx"));z!==null&&Y+Q.text().length*j*.8>=z&&(X=!0),Y=z}),at.remove()}X?(M||(B.ticks(this.getNumberOfFittingTicks(a,S,Un.ticks.horizontalSpaceRatio)),g.call(B),f.call(B)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===G.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(x?l.attr("opacity",0):l.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",X=>X),g.selectAll("g.tick").attr("aria-label",X=>X),D!==Ae.NONE&&E===nt.LABELS&&!A){const X=this.services.cartesianScales.getScaleDomain(n);if(X.length>0){const et=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(et);const at=this;l.selectAll("g.tick text").data(X).text(function(j){return j.length>L?(at.truncation[n]=!0,ts(j,D,N)):j}),this.getInvisibleAxisRef().selectAll("g.tick text").data(X).text(function(j){return j.length>L?ts(j,D,N):j}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(X)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=I.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:R(this),datum:u}),a===nt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:R(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:R(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:R(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:R(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 nm(i,2,Un.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;I.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class hk extends Yg{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=I.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=R(this);l.classed("tick-hover",!0).attr("role","button").attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:h}=I.getSVGElementSize(c,{useBBox:!0}),d=I.appendOrSelect(l,"rect.axis-holder");let p=0,f=0;switch(n){case G.LEFT:p=-u+Number(c.attr("x")),f=-(h/2);break;case G.RIGHT:p=Math.abs(Number(c.attr("x"))),f=-(h/2);break;case G.TOP:p=-(u/2),f=-h+Number(c.attr("y"))/2,s.truncation[n]&&(p=0,d.attr("transform","rotate(-45)"));break;case G.BOTTOM:p=-(u/2),f=h/2-2,s.truncation[n]&&(p=-u,d.attr("transform","rotate(-45)"));break}d.attr("x",p-Un.hover.rectanglePadding).attr("y",f).attr("width",u+Un.hover.rectanglePadding*2).attr("height",h).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=I.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=R(this).select("text"),h=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:h}),a===nt.LABELS&&h.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:h})}).on("mousemove",function(c){const u=R(this).select("text"),h=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:h}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:R(this).select("text"),datum:R(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:R(this).select("text"),datum:R(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 h=c.target.getBoundingClientRect();u.clientX=h.x,u.clientY=h.y}l.services.events.dispatchEvent(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:R(this),datum:R(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:R(this),datum:R(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:R(this),datum:R(this).select("text").datum()})),n===G.LEFT||n===G.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;I.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 xe extends gt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=rt.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(G),i=y(this.getOptions(),"axes");r.forEach(a=>{i[G[a]]&&(n[G[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=G[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===wi.DEFAULT?new Yg(this.model,this.services,l):new hk(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:h}=I.getSVGElementSize(c,{useBBox:!0});let d=0;if(!o.getTitleRef().empty()){const g=I.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height;l===G.LEFT||l===G.RIGHT?d=g+5:l===G.BOTTOM?d=g+_p:d=g}const p=u,f=h;switch(l){case G.TOP:s.top=f+d;break;case G.BOTTOM:s.bottom=f+d;break;case G.LEFT:s.left=p+d;break;case G.RIGHT:s.right=p+d;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 de 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===Wt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Wt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Wt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Wt.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===zt.VERTICAL&&this.drawYGrid(t),n===zt.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=Ye().domain([0,1]).range(t),this.yScale=Ye().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=I.getSVGElementSize(n,{useAttrs:!0});this.backdrop=I.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",r).attr("height",i);const s=I.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=I.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=I.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}=I.getSVGElementSize(i,{useAttrs:!0}),o=I.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a).attr("role","presentation"),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");I.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Os().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),h=t+Math.abs(Dt.radiusOffset),d=t+(Math.min(s,a)-t*2)/2,p=I.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${h}, ${d})`).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+Dt.xOffset;c===jt.CENTER?f=s/2:c===jt.RIGHT&&(f=s-t-Dt.xOffset);const g=t+Dt.yOffset;p.attr("transform",`translate(${f}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=I.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Dt.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}=I.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=I.appendOrSelect(i,"defs").lower(),c=I.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=`
67
67
  <stop class="${n}" offset="${a}"></stop>
68
68
  <stop class="${r}" offset="${a+.2}"></stop>
69
69
  <stop class="${n}" offset="${a+2*.2}"></stop>
70
- `;c.html(u),d();function d(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(jC).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",d)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class dD extends gt{constructor(){super(...arguments),this.type="boxplot",this.renderType=rt.SVG}render(t){const n=this.getComponentContainer({ariaLabel:"box plots",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,d]=o.range(),h=c-l,p=u-d;if(h===0)return;const{cartesianScales:f}=this.services,g=f.getOrientation(),m=g===zt.VERTICAL,[v,x]=Tn(C=>this.services.cartesianScales.getDomainValue(C),C=>this.services.cartesianScales.getRangeValue(C),g),_=Math.floor((m?h:p)/s.length),E=Math.min(_/2,16),b=this.model.getBoxplotData(),O=n.selectAll(".box-group").data(b);O.exit().remove();const M=O.enter().append("g").attr("class","box-group"),k=O.merge(M);M.append("path").merge(O.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Ie.strokeWidth.default).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-verticalstartline",animate:t})).attr("d",C=>{const H=f.getDomainValue(C[i]),P=H,U=f.getRangeValue(C.whiskers.min),T=f.getRangeValue(C.quartiles.q_25);return le({x0:H,x1:P,y0:U,y1:T},g)}),M.append("path").merge(O.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Ie.strokeWidth.default).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-verticalendline",animate:t})).attr("d",C=>{const H=f.getDomainValue(C[i]),P=H,U=f.getRangeValue(C.whiskers.max),T=f.getRangeValue(C.quartiles.q_75);return le({x0:H,x1:P,y0:U,y1:T},g)}),M.append("path").merge(O.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"box"})).attr("fill-opacity",Ie.box.opacity.default).attr("stroke-width",Ie.strokeWidth.default).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",C=>C[i]).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-quartiles",animate:t})).attr("d",C=>{const H=f.getDomainValue(C[i])-E/2,P=H+E,U=f.getRangeValue(Math[m?"max":"min"](C.quartiles.q_75,C.quartiles.q_25)),T=U+Math.abs(f.getRangeValue(C.quartiles.q_75)-f.getRangeValue(C.quartiles.q_25));return le({x0:H,x1:P,y0:U,y1:T},g)}),M.append("path").merge(O.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",C=>{const H=f.getDomainValue(C[i])-E/2,P=H+E,U=f.getRangeValue(C.whiskers.min),T=f.getRangeValue(C.whiskers.max);return le({x0:H,x1:P,y0:U,y1:T},g)}),M.append("path").merge(O.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Ie.strokeWidth.thicker).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-startingwhisker",animate:t})).attr("d",C=>{const H=f.getDomainValue(C[i])-E/4,P=H+E/2,U=f.getRangeValue(C.whiskers.min),T=f.getRangeValue(C.whiskers.min);return le({x0:H,x1:P,y0:U,y1:T},g)}),M.append("path").merge(O.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-median",animate:t})).attr("d",C=>{const H=f.getDomainValue(C[i])-E/2,P=H+E,U=f.getRangeValue(C.quartiles.q_50);return le({x0:H,x1:P,y0:U,y1:U},g)}),M.append("path").merge(O.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Ie.strokeWidth.thicker).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-endingwhisker",animate:t})).attr("d",C=>{const H=f.getDomainValue(C[i])-E/4,P=H+E/2,U=f.getRangeValue(C.whiskers.max),T=f.getRangeValue(C.whiskers.max);return le({x0:H,x1:P,y0:U,y1:T},g)});const A=k.selectAll("circle.outlier").data(C=>C.outliers.map(H=>({min:C.whiskers.min,max:C.whiskers.max,[i]:C[i],value:H})));A.exit().remove();const R=A.enter().append("circle");A.merge(R).attr("r",Ie.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Ie.circle.opacity.default).attr("cx",v).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-circles",animate:t})).attr("cy",x),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(i,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Ie.box.opacity.hovered),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(S.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=I(this);t.services.events.dispatchEvent(S.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(S.Boxplot.BOX_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Ie.box.opacity.default),t.services.events.dispatchEvent(S.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=I(this);o.classed("hovered",!0).attr("fill-opacity",Ie.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=I(this);t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(S.Boxplot.OUTLIER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);o.classed("hovered",!1).attr("fill-opacity",Ie.circle.opacity.default),t.services.events.dispatchEvent(S.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o})})}}class fi extends gt{constructor(){super(...arguments),this.type="zero-line",this.renderType=rt.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,s]=r.domain(),a=i>0&&s<0||i<0&&s>0,o=this.getComponentContainer({isPresentational:!0});if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+r(0)+.5;u||(u=r.range()[0]);const d=Ap({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());N.appendOrSelect(o,"line.domain").transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"zero-line-update",animate:t})).attr("y1",d.y0).attr("y2",d.y1).attr("x1",d.x0).attr("x2",d.x1)}}class pD extends un{constructor(){super(...arguments),this.type="bubble",this.renderType=rt.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?je(s):[1,1];return Ye().domain(l).range(o?n.bubble.radiusRange(a,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=r.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=Tn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",h=>{const p=o.getRangeIdentifier(h);return h[p]}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",h=>s(h[i]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:h[a],originalClassName:"dot"})).style("fill",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[a],h[p],h)}).style("stroke",h=>{const p=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[a],h[p],h)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=y(this.getOptions(),"bubble");return[{label:y(n,"radiusLabel"),value:t[y(n,"radiusMapsTo")]}]}}class fD extends gt{constructor(){super(...arguments),this.type="bullet",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bullet graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),d=()=>{const g=[];s.forEach(v=>{v.ranges?v.ranges.forEach((x,_)=>{x!=null&&x<u&&g.push({datum:v,value:x,order:_+1})}):g.push({datum:v,order:1})});const m=N.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(g,v=>`${v[r]}-${v.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",v=>`range-box order-${v.order}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-range-box-update-enter",animate:t})).attr("d",v=>{let x,_,E,b;return v.order===1?(x=this.services.cartesianScales.getDomainValue(v.datum)-16/2,_=x+16,E=c-2,b=l+1):(x=this.services.cartesianScales.getDomainValue(v.datum)-16/2,_=x+16,E=this.services.cartesianScales.getRangeValue(v.value),b=c),le({x0:x,x1:_,y0:E,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const g=N.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("bar",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-bar-update-enter",animate:t})).attr("class",m=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>{const v=this.services.cartesianScales.getDomainIdentifier(m);return this.model.getFillColor(m[r],m[v],m)}).attr("d",m=>{const v=this.services.cartesianScales.getDomainValue(m)-4,x=v+8,_=this.services.cartesianScales.getRangeValue(0)+1,E=this.services.cartesianScales.getRangeValue(m);return le({x0:v,x1:x,y0:_,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},p=()=>{const g=N.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>y(m,"marker")!==null),m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const v=this.services.cartesianScales.getDomainValue(m)-12,x=v+24,_=this.services.cartesianScales.getRangeValue(m.marker);return le({x0:v,x1:x,y0:_,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},f=()=>{let g=[];s.filter(v=>y(v,"marker")!==null).forEach(v=>{const x=v.marker,_=v[o];g=g.concat([{datum:v,value:x*.25,barValue:_},{datum:v,value:x*.5,barValue:_},{datum:v,value:x*.75,barValue:_}])});const m=N.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(g,v=>v[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",v=>`quartile ${v.value<=v.barValue?"over-bar":""}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:v,value:x})=>{let _=4;v.ranges&&v.ranges.indexOf(x)!==-1&&(_=8);const E=this.services.cartesianScales.getDomainValue(v)-_/2,b=E+_,O=this.services.cartesianScales.getRangeValue(x);return le({x0:E,x1:b,y0:O,y1:O},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};d(),h(),p(),f(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{code:s,number:a}=y(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=I(this);c.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=y(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:l[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:l[r]})},{label:"Value",value:l[i]},{label:"Target",value:l.marker},{label:"Percentage",value:`${a(Math.floor(l[i]/l.marker*100),s)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:o,element:I(this),datum:l}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:o,element:I(this),datum:l})}).on("mouseout",function(o,l){const c=I(this);c.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:c})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function mD(e){return e}function gD(e){if(e==null)return mD;var t,n,r=e.scale[0],i=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,d=new Array(u);for(d[0]=(t+=o[0])*r+s,d[1]=(n+=o[1])*i+a;c<u;)d[c]=o[c],++c;return d}}function vD(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function yD(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Xg(e,n)})}:Xg(e,t)}function Xg(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=bu(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:s}:r==null?{type:"Feature",id:n,properties:i,geometry:s}:{type:"Feature",id:n,bbox:r,properties:i,geometry:s}}function bu(e,t){var n=gD(e.transform),r=e.arcs;function i(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],p=0,f=h.length;p<f;++p)d.push(n(h[p],p));u<0&&vD(d,f)}function s(u){return n(u)}function a(u){for(var d=[],h=0,p=u.length;h<p;++h)i(u[h],d);return d.length<2&&d.push(d[0]),d}function o(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(o)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=s(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(s);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}function bD(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var d=e.arcs[c<0?~c:c],h;d.length<3&&!d[1][0]&&!d[1][1]&&(h=t[++a],t[a]=c,t[u]=h)}),t.forEach(function(c){var u=o(c),d=u[0],h=u[1],p,f;if(p=i[d])if(delete i[p.end],p.push(c),p.end=h,f=r[h]){delete r[f.start];var g=f===p?p:p.concat(f);r[g.start=p.start]=i[g.end=f.end]=g}else r[p.start]=i[p.end]=p;else if(p=r[h])if(delete r[p.start],p.unshift(c),p.start=d,f=i[d]){delete i[f.end];var m=f===p?p:f.concat(p);r[m.start=f.start]=i[m.end=p.end]=m}else r[p.start]=i[p.end]=p;else p=[c],r[p.start=d]=i[p.end=h]=p});function o(c){var u=e.arcs[c<0?~c:c],d=u[0],h;return e.transform?(h=[0,0],u.forEach(function(p){h[0]+=p[0],h[1]+=p[1]})):h=u[u.length-1],c<0?[h,d]:[d,h]}function l(c,u){for(var d in c){var h=c[d];delete u[h.start],delete h.start,delete h.end,h.forEach(function(p){n[p<0?~p:p]=1}),s.push(h)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function xD(e){for(var t=-1,n=e.length,r,i=e[n-1],s=0;++t<n;)r=i,i=e[t],s+=r[0]*i[1]-r[1]*i[0];return Math.abs(s)}function _D(e){return bu(e,ED.apply(this,arguments))}function ED(e,t){var n={},r=[],i=[];t.forEach(s);function s(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(s);break;case"Polygon":a(l.arcs);break;case"MultiPolygon":l.arcs.forEach(a);break}}function a(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),r.push(l)}function o(l){return xD(bu(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,i.push(c);l=u.pop();)c.push(l),l.forEach(function(d){d.forEach(function(h){n[h<0?~h:h].forEach(function(p){p._||(p._=1,u.push(p))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var c=[],u;if(l.forEach(function(g){g.forEach(function(m){m.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=bD(e,c),(u=c.length)>1)for(var d=1,h=o(c[0]),p,f;d<u;++d)(p=o(c[d]))>h&&(f=c[0],c[0]=c[d],c[d]=f,h=p);return c}).filter(function(l){return l.length>0})}}class TD extends zn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=rt.SVG}showRuler(t,[n,r]){const i=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),d=a.getDomainScale(),h=d.invert(o===zt.VERTICAL?n:r),p=N.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),f=N.appendOrSelect(p,"line.ruler-line"),g=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(vt(m,"data.x0"))<=h&&parseFloat(vt(m,"data.x1"))>=h)return!0});if(g.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!rm(this.elementsToHighlight,g)&&this.hideRuler(),g.dispatch("mouseover"),this.elementsToHighlight=g;const m=I(g.nodes()[0]).datum(),v=parseFloat(vt(m,"data.x0")),x=parseFloat(vt(m,"data.x1")),_=this.model.getActiveDataGroupNames(),E=_.reverse().map(b=>({label:b,value:vt(m,`data.${b}`),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:b})})).filter(b=>b.value!==0);if(E.length>0){this.services.events.dispatchEvent(S.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:f,items:[{label:vt(s,"bins.rangeLabel")||"Range",value:`${v} – ${x}`},...E,...y(s,"tooltip","showTotal")===!0?[{label:vt(s,"tooltip.totalLabel")||vt(s,"locale.translations.total")||"Total",value:(()=>{const O=y(s,"tooltip","customTotalCalculation");if(O){const M=_.map(k=>({[k]:parseFloat(vt(m,`data.${k}`))}));return O(M)}else return _.reduce((M,k)=>M+parseFloat(vt(m,`data.${k}`)),0)})()}]:[]]}),p.attr("opacity",1);const b=d((v+x)/2);o==="horizontal"?f.attr("x1",u).attr("x2",c).attr("y1",b).attr("y2",b):f.attr("y1",u).attr("y2",c).attr("x1",b).attr("x2",b)}else this.hideRuler()}else this.hideRuler()}}class mo extends zn{formatTooltipData(t){return t.reverse()}}const OD=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=mm();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},SD={d:"M7 0v8L0 4z"},wD={d:"M0 0v8l7-4z"},$D={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z"},MD={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z"},CD={d:"M0 .44974747h8v8H0v-3.6830331z"},AD={d:"M0 0h1.5v8H0z"};class Zg extends du{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=rt.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=N.getSVGElementSize(i,{useAttrs:!0}),a=y(this.getOptions(),"data","loading");if(s>Nt.color.barWidth&&!a){const o=y(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=N.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),d=c[0]-u-9;d>1?i.select("g.legend-title").attr("transform",`translate(${d}, 0)`):(i.select("g.legend").attr("transform",`translate(${c[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${c[0]}, 0)`))}}else i.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=r.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(S.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer({ariaLabel:"legend"}),{width:i}=N.getSVGElementSize(r,{useAttrs:!0}),s=y(n,"color","gradient","colors"),a=y(n,this.chartType,"colorLegend","type");let o=y(n,"color","pairing","option");const l=y(n,"heatmap","colorLegend","title");if(y(this.getOptions(),"data","loading")){r.html("");return}const c=!ze(s),u=Fp(this.model.getDisplayData()),d=!(i<=Nt.color.barWidth),h=d?Nt.color.barWidth:i,p=N.appendOrSelect(r,"g.legend"),f=N.appendOrSelect(p,"g.legend-axis");if(l){const A=N.appendOrSelect(r,"g.legend-title");N.appendOrSelect(A,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const g=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&g==="mono"||o<1&&o>2&&g==="diverge")&&(o=1);let m=[];const v=g==="diverge"?17:11;if(c)m=s;else for(let A=1;A<v+1;A++)m.push(a===Oi.LINEAR?`stop-color-${g}-${o}-${A}`:`fill-${g}-${o}-${A}`);const x=Oe(u[0],u[1]),_=zC(x,3),E=Ye().domain(u).range([0,h]),b=vc(E).tickSize(0).tickValues(_),{code:O,number:M}=y(n,"locale");b.tickFormat(A=>M(A,O));let k;switch(a){case Oi.LINEAR:this.drawLinear(m,p,h);break;case Oi.QUANTIZE:k=this.drawQuantize(m,g,c,p,h),E.range([k,h]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${Nt.color.axisYTranslation})`).call(b),f.select(".domain").remove(),f.select("g.tick:last-of-type text").style("text-anchor",d?"middle":"end"),f.select("g.tick:first-of-type text").style("text-anchor",d&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,r){const i=100/(t.length-1);N.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*i}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),N.appendOrSelect(n,"rect").attr("width",r).attr("height",Nt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,s){!r&&n==="diverge"&&t.splice(t.length/2,1);const a=Yr().domain(t).range([0,s]);return N.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",o=>a(o)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Nt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(S.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class LD extends As{constructor(){super(...arguments),this.type="meter-title",this.renderType=rt.SVG}render(t=!1){const n=y(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer({ariaLabel:"meter title"}),{groupMapsTo:s}=r.data,a=r.locale.translations.meter.title;if(y(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=i.selectAll("text.meter-title").data(a?[a]:[n[s]]);c.enter().append("text").classed("meter-title",!0).merge(c).attr("x",0).attr("y","1em").text(u=>u),c.exit().remove(),this.appendPercentage()}this.displayStatus();const o=this.getMaxTitleWidth(),l=N.appendOrSelect(i,"text.meter-title");o>0&&l.node().getComputedTextLength()>o&&this.truncateTitle(l,o)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=y(n,"meter","proportional","total"),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,d=y(n,"meter","proportional","breakdownFormatter"),{code:h,number:p}=y(n,"locale");a=d!==null?d({datasetsTotal:r,total:i}):`${p(r,h)} ${s} used (${p(u,h)} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const l=this.getMaxTitleWidth(),c=N.appendOrSelect(t,"text.proportional-meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"meter","proportional","total"),i=r?y(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"",a=y(n,"meter","proportional","totalFormatter"),{code:o,number:l}=y(n,"locale"),c=a!==null?a(i):`${l(r,o)} ${s} total`,u=N.getHTMLElementSize(this.parent.node()).width,d=t.selectAll("text.proportional-meter-total").data([c]);d.enter().append("text").classed("proportional-meter-total",!0).merge(d).attr("x",this.model.getStatus()&&typeof u!="string"?u-te.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(h=>h),d.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=N.getHTMLElementSize(this.parent.node()).width||0,i=this.model.getStatus(),s=te.status.indicatorSize/2,a=N.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-s}, 0)`),o=i?[i]:[],l=a.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",s).attr("cx",0).attr("cy",8);const c=a.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${s}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=y(this.model.getDisplayData(),0,"value"),{code:n,number:r}=y(this.getOptions(),"locale"),i=this.getComponentContainer(),s=N.appendOrSelect(i,"text.meter-title"),a=y(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(a),l=te.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+l).attr("y",s.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=N.appendOrSelect(this.parent,"tspan"),i=te.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());N.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=y(this.getOptions(),"meter","proportional"),n=N.getHTMLElementSize(this.parent.node()).width;if(t!==null){const r=N.appendOrSelect(this.parent,"text.proportional-meter-total").node(),i=N.getSVGElementSize(r,{useBBox:!0}).width;return n-i-te.total.paddingLeft}else{const r=N.appendOrSelect(this.parent,"text.percent-value"),i=te.statusBar.paddingRight,s=r.node().getComputedTextLength(),a=N.appendOrSelect(this.parent,"g.status-indicator").node(),o=N.getSVGElementSize(a,{useBBox:!0}).width+te.status.paddingLeft;return n-s-i-o}}getStatusIconPathString(t){switch(t){case Ei.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case Ei.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Ei.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class xu extends gt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=N.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=y(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return t<i(r[0])||n>i(r[1])}return!1}}class kD extends gt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-circlepack"})).attr("opacity",r=>r.data.dataGroupName===n.datum().name?1:zr.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"circle packs",withinChartClip:!0}),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=y(l,"canvasZoom","enabled");a&&y(s,0,"children")&&(s=y(s,0,"children"));const u=xs({children:s}).sum(f=>f.value).sort((f,g)=>g.value-f.value),d=NL().size([r,i]).padding(f=>f.depth>=1?zr.padding.children+3:zr.padding.mainGroup+3)(u).descendants().splice(1).filter(f=>f.depth<=o),h=n.selectAll("circle.node").data(d);h.exit().attr("width",0).attr("height",0).remove();const p=h.enter().append("circle").classed("node",!0);p.merge(h).attr("class",f=>{const g=c&&o===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${g}`:`node node-leaf ${g}`})}).style("fill",f=>this.model.getFillColor(f.data.dataGroupName,null,f.data)).style("stroke",f=>this.model.getFillColor(f.data.dataGroupName,null,f.data)).attr("cx",f=>f.x).attr("cy",f=>f.y).transition("circlepack-leaf-update-enter").call(f=>this.services.transitions.setupTransition({transition:f,name:"circlepack-leaf-update-enter"})).attr("r",f=>f.r).attr("opacity",1).attr("fill-opacity",zr.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,Fr),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",r=>this.model.getFillColor(r.data.dataGroupName,null,r.data))}highlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",zr.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){I(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=I(this.services.domUtils.getMainContainer()),n=this,r=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(r,Fr)})}getZoomIcon(){return`
70
+ `;c.html(u),h();function h(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(jC).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",h)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class dk extends gt{constructor(){super(...arguments),this.type="boxplot",this.renderType=rt.SVG}render(t){const n=this.getComponentContainer({ariaLabel:"box plots",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,h]=o.range(),d=c-l,p=u-h;if(d===0)return;const{cartesianScales:f}=this.services,g=f.getOrientation(),m=g===zt.VERTICAL,[v,b]=On(M=>this.services.cartesianScales.getDomainValue(M),M=>this.services.cartesianScales.getRangeValue(M),g),_=Math.floor((m?d:p)/s.length),E=Math.min(_/2,16),x=this.model.getBoxplotData(),O=n.selectAll(".box-group").data(x);O.exit().remove();const A=O.enter().append("g").attr("class","box-group"),D=O.merge(A);A.append("path").merge(O.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Ie.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalstartline",animate:t})).attr("d",M=>{const V=f.getDomainValue(M[i]),k=V,H=f.getRangeValue(M.whiskers.min),S=f.getRangeValue(M.quartiles.q_25);return le({x0:V,x1:k,y0:H,y1:S},g)}),A.append("path").merge(O.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Ie.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalendline",animate:t})).attr("d",M=>{const V=f.getDomainValue(M[i]),k=V,H=f.getRangeValue(M.whiskers.max),S=f.getRangeValue(M.quartiles.q_75);return le({x0:V,x1:k,y0:H,y1:S},g)}),A.append("path").merge(O.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"box"})).attr("fill-opacity",Ie.box.opacity.default).attr("stroke-width",Ie.strokeWidth.default).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",M=>M[i]).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-quartiles",animate:t})).attr("d",M=>{const V=f.getDomainValue(M[i])-E/2,k=V+E,H=f.getRangeValue(Math[m?"max":"min"](M.quartiles.q_75,M.quartiles.q_25)),S=H+Math.abs(f.getRangeValue(M.quartiles.q_75)-f.getRangeValue(M.quartiles.q_25));return le({x0:V,x1:k,y0:H,y1:S},g)}),A.append("path").merge(O.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",M=>{const V=f.getDomainValue(M[i])-E/2,k=V+E,H=f.getRangeValue(M.whiskers.min),S=f.getRangeValue(M.whiskers.max);return le({x0:V,x1:k,y0:H,y1:S},g)}),A.append("path").merge(O.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Ie.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-startingwhisker",animate:t})).attr("d",M=>{const V=f.getDomainValue(M[i])-E/4,k=V+E/2,H=f.getRangeValue(M.whiskers.min),S=f.getRangeValue(M.whiskers.min);return le({x0:V,x1:k,y0:H,y1:S},g)}),A.append("path").merge(O.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-median",animate:t})).attr("d",M=>{const V=f.getDomainValue(M[i])-E/2,k=V+E,H=f.getRangeValue(M.quartiles.q_50);return le({x0:V,x1:k,y0:H,y1:H},g)}),A.append("path").merge(O.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Ie.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-endingwhisker",animate:t})).attr("d",M=>{const V=f.getDomainValue(M[i])-E/4,k=V+E/2,H=f.getRangeValue(M.whiskers.max),S=f.getRangeValue(M.whiskers.max);return le({x0:V,x1:k,y0:H,y1:S},g)});const L=D.selectAll("circle.outlier").data(M=>M.outliers.map(V=>({min:M.whiskers.min,max:M.whiskers.max,[i]:M[i],value:V})));L.exit().remove();const N=L.enter().append("circle");L.merge(N).attr("r",Ie.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Ie.circle.opacity.default).attr("cx",v).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-circles",animate:t})).attr("cy",b),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(i,s){const a=R(this);R(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Ie.box.opacity.hovered),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=R(this);t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(T.Boxplot.BOX_CLICK,{event:i,element:R(this),datum:s})}).on("mouseout",function(i,s){const a=R(this);R(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Ie.box.opacity.default),t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=R(this);o.classed("hovered",!0).attr("fill-opacity",Ie.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=R(this);t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(T.Boxplot.OUTLIER_CLICK,{event:s,element:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(this);o.classed("hovered",!1).attr("fill-opacity",Ie.circle.opacity.default),t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class fi extends gt{constructor(){super(...arguments),this.type="zero-line",this.renderType=rt.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,s]=r.domain(),a=i>0&&s<0||i<0&&s>0,o=this.getComponentContainer({isPresentational:!0});if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+r(0)+.5;u||(u=r.range()[0]);const h=Ap({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());I.appendOrSelect(o,"line.domain").transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"zero-line-update",animate:t})).attr("y1",h.y0).attr("y2",h.y1).attr("x1",h.x0).attr("x2",h.x1)}}class pk extends un{constructor(){super(...arguments),this.type="bubble",this.renderType=rt.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=I.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?je(s):[1,1];return Ye().domain(l).range(o?n.bubble.radiusRange(a,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=r.data,{cartesianScales:o}=this.services,l=d=>o.getDomainValue(d),c=d=>o.getRangeValue(d),[u,h]=On(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",d=>{const p=o.getRangeIdentifier(d);return d[p]}).transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",h).attr("r",d=>s(d[i]||1)).attr("class",d=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:d[a],originalClassName:"dot"})).style("fill",d=>{const p=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getFillColor(d[a],d[p],d)}).style("stroke",d=>{const p=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getStrokeColor(d[a],d[p],d)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=y(this.getOptions(),"bubble");return[{label:y(n,"radiusLabel"),value:t[y(n,"radiusMapsTo")]}]}}class fk extends gt{constructor(){super(...arguments),this.type="bullet",this.renderType=rt.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:"bullet graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),h=()=>{const g=[];s.forEach(v=>{v.ranges?v.ranges.forEach((b,_)=>{b!=null&&b<u&&g.push({datum:v,value:b,order:_+1})}):g.push({datum:v,order:1})});const m=I.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(g,v=>`${v[r]}-${v.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",v=>`range-box order-${v.order}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-range-box-update-enter",animate:t})).attr("d",v=>{let b,_,E,x;return v.order===1?(b=this.services.cartesianScales.getDomainValue(v.datum)-16/2,_=b+16,E=c-2,x=l+1):(b=this.services.cartesianScales.getDomainValue(v.datum)-16/2,_=b+16,E=this.services.cartesianScales.getRangeValue(v.value),x=c),le({x0:b,x1:_,y0:E,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},d=()=>{const g=I.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("bar",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-bar-update-enter",animate:t})).attr("class",m=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>{const v=this.services.cartesianScales.getDomainIdentifier(m);return this.model.getFillColor(m[r],m[v],m)}).attr("d",m=>{const v=this.services.cartesianScales.getDomainValue(m)-4,b=v+8,_=this.services.cartesianScales.getRangeValue(0)+1,E=this.services.cartesianScales.getRangeValue(m);return le({x0:v,x1:b,y0:_,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},p=()=>{const g=I.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>y(m,"marker")!==null),m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const v=this.services.cartesianScales.getDomainValue(m)-12,b=v+24,_=this.services.cartesianScales.getRangeValue(m.marker);return le({x0:v,x1:b,y0:_,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},f=()=>{let g=[];s.filter(v=>y(v,"marker")!==null).forEach(v=>{const b=v.marker,_=v[o];g=g.concat([{datum:v,value:b*.25,barValue:_},{datum:v,value:b*.5,barValue:_},{datum:v,value:b*.75,barValue:_}])});const m=I.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(g,v=>v[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",v=>`quartile ${v.value<=v.barValue?"over-bar":""}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:v,value:b})=>{let _=4;v.ranges&&v.ranges.indexOf(b)!==-1&&(_=8);const E=this.services.cartesianScales.getDomainValue(v)-_/2,x=E+_,O=this.services.cartesianScales.getRangeValue(b);return le({x0:E,x1:x,y0:O,y1:O},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};h(),d(),p(),f(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),{code:s,number:a}=y(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=R(this);c.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=y(n,"bullet","performanceAreaTitles"),h=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:l[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:l[r]})},{label:"Value",value:l[i]},{label:"Target",value:l.marker},{label:"Percentage",value:`${a(Math.floor(l[i]/l.marker*100),s)}%`},{label:"Performance",value:u[h]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:o,element:R(this),datum:l}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:o,element:R(this),datum:l})}).on("mouseout",function(o,l){const c=R(this);c.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:c})})}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)}}function mk(e){return e}function gk(e){if(e==null)return mk;var t,n,r=e.scale[0],i=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,h=new Array(u);for(h[0]=(t+=o[0])*r+s,h[1]=(n+=o[1])*i+a;c<u;)h[c]=o[c],++c;return h}}function vk(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function yk(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Zg(e,n)})}:Zg(e,t)}function Zg(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=bu(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:s}:r==null?{type:"Feature",id:n,properties:i,geometry:s}:{type:"Feature",id:n,bbox:r,properties:i,geometry:s}}function bu(e,t){var n=gk(e.transform),r=e.arcs;function i(u,h){h.length&&h.pop();for(var d=r[u<0?~u:u],p=0,f=d.length;p<f;++p)h.push(n(d[p],p));u<0&&vk(h,f)}function s(u){return n(u)}function a(u){for(var h=[],d=0,p=u.length;d<p;++d)i(u[d],h);return h.length<2&&h.push(h[0]),h}function o(u){for(var h=a(u);h.length<4;)h.push(h[0]);return h}function l(u){return u.map(o)}function c(u){var h=u.type,d;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(c)};case"Point":d=s(u.coordinates);break;case"MultiPoint":d=u.coordinates.map(s);break;case"LineString":d=a(u.arcs);break;case"MultiLineString":d=u.arcs.map(a);break;case"Polygon":d=l(u.arcs);break;case"MultiPolygon":d=u.arcs.map(l);break;default:return null}return{type:h,coordinates:d}}return c(t)}function bk(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var h=e.arcs[c<0?~c:c],d;h.length<3&&!h[1][0]&&!h[1][1]&&(d=t[++a],t[a]=c,t[u]=d)}),t.forEach(function(c){var u=o(c),h=u[0],d=u[1],p,f;if(p=i[h])if(delete i[p.end],p.push(c),p.end=d,f=r[d]){delete r[f.start];var g=f===p?p:p.concat(f);r[g.start=p.start]=i[g.end=f.end]=g}else r[p.start]=i[p.end]=p;else if(p=r[d])if(delete r[p.start],p.unshift(c),p.start=h,f=i[h]){delete i[f.end];var m=f===p?p:f.concat(p);r[m.start=f.start]=i[m.end=p.end]=m}else r[p.start]=i[p.end]=p;else p=[c],r[p.start=h]=i[p.end=d]=p});function o(c){var u=e.arcs[c<0?~c:c],h=u[0],d;return e.transform?(d=[0,0],u.forEach(function(p){d[0]+=p[0],d[1]+=p[1]})):d=u[u.length-1],c<0?[d,h]:[h,d]}function l(c,u){for(var h in c){var d=c[h];delete u[d.start],delete d.start,delete d.end,d.forEach(function(p){n[p<0?~p:p]=1}),s.push(d)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function xk(e){for(var t=-1,n=e.length,r,i=e[n-1],s=0;++t<n;)r=i,i=e[t],s+=r[0]*i[1]-r[1]*i[0];return Math.abs(s)}function _k(e){return bu(e,Ek.apply(this,arguments))}function Ek(e,t){var n={},r=[],i=[];t.forEach(s);function s(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(s);break;case"Polygon":a(l.arcs);break;case"MultiPolygon":l.arcs.forEach(a);break}}function a(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),r.push(l)}function o(l){return xk(bu(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,i.push(c);l=u.pop();)c.push(l),l.forEach(function(h){h.forEach(function(d){n[d<0?~d:d].forEach(function(p){p._||(p._=1,u.push(p))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var c=[],u;if(l.forEach(function(g){g.forEach(function(m){m.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=bk(e,c),(u=c.length)>1)for(var h=1,d=o(c[0]),p,f;h<u;++h)(p=o(c[h]))>d&&(f=c[0],c[0]=c[h],c[h]=f,d=p);return c}).filter(function(l){return l.length>0})}}class Ok extends zn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=rt.SVG}showRuler(t,[n,r]){const i=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),h=a.getDomainScale(),d=h.invert(o===zt.VERTICAL?n:r),p=I.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),f=I.appendOrSelect(p,"line.ruler-line"),g=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(vt(m,"data.x0"))<=d&&parseFloat(vt(m,"data.x1"))>=d)return!0});if(g.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!rm(this.elementsToHighlight,g)&&this.hideRuler(),g.dispatch("mouseover"),this.elementsToHighlight=g;const m=R(g.nodes()[0]).datum(),v=parseFloat(vt(m,"data.x0")),b=parseFloat(vt(m,"data.x1")),_=this.model.getActiveDataGroupNames(),E=_.reverse().map(x=>({label:x,value:vt(m,`data.${x}`),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:x})})).filter(x=>x.value!==0);if(E.length>0){this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:f,items:[{label:vt(s,"bins.rangeLabel")||"Range",value:`${v} – ${b}`},...E,...y(s,"tooltip","showTotal")===!0?[{label:vt(s,"tooltip.totalLabel")||vt(s,"locale.translations.total")||"Total",value:(()=>{const O=y(s,"tooltip","customTotalCalculation");if(O){const A=_.map(D=>({[D]:parseFloat(vt(m,`data.${D}`))}));return O(A)}else return _.reduce((A,D)=>A+parseFloat(vt(m,`data.${D}`)),0)})()}]:[]]}),p.attr("opacity",1);const x=h((v+b)/2);o==="horizontal"?f.attr("x1",u).attr("x2",c).attr("y1",x).attr("y2",x):f.attr("y1",u).attr("y2",c).attr("x1",x).attr("x2",x)}else this.hideRuler()}else this.hideRuler()}}class mo extends zn{formatTooltipData(t){return t.reverse()}}const Tk=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=mm();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},wk={d:"M7 0v8L0 4z"},Sk={d:"M0 0v8l7-4z"},$k={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z"},Mk={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z"},Ck={d:"M0 .44974747h8v8H0v-3.6830331z"},Ak={d:"M0 0h1.5v8H0z"};class Xg extends du{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=rt.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=I.getSVGElementSize(i,{useAttrs:!0}),a=y(this.getOptions(),"data","loading");if(s>Nt.color.barWidth&&!a){const o=y(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=I.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),h=c[0]-u-9;h>1?i.select("g.legend-title").attr("transform",`translate(${h}, 0)`):(i.select("g.legend").attr("transform",`translate(${c[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${c[0]}, 0)`))}}else i.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=r.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(T.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer({ariaLabel:"legend"}),{width:i}=I.getSVGElementSize(r,{useAttrs:!0}),s=y(n,"color","gradient","colors"),a=y(n,this.chartType,"colorLegend","type");let o=y(n,"color","pairing","option");const l=y(n,"heatmap","colorLegend","title");if(y(this.getOptions(),"data","loading")){r.html("");return}const c=!ze(s),u=y(n,this.chartType,"colorDomain"),h=Fp(this.model.getDisplayData(),u),d=!(i<=Nt.color.barWidth),p=d?Nt.color.barWidth:i,f=I.appendOrSelect(r,"g.legend"),g=I.appendOrSelect(f,"g.legend-axis");if(l){const N=I.appendOrSelect(r,"g.legend-title");I.appendOrSelect(N,"text").text(l).attr("dy","0.7em"),f.attr("transform","translate(0, 16)")}const m=h[0]<0&&h[1]>0?"diverge":"mono";(o<1&&o>4&&m==="mono"||o<1&&o>2&&m==="diverge")&&(o=1);let v=[];const b=m==="diverge"?17:11;if(c)v=s;else for(let N=1;N<b+1;N++)v.push(a===Ti.LINEAR?`stop-color-${m}-${o}-${N}`:`fill-${m}-${o}-${N}`);const _=Te(h[0],h[1]),E=zC(_,3),x=Ye().domain(h).range([0,p]),O=vc(x).tickSize(0).tickValues(E),{code:A,number:D}=y(n,"locale");O.tickFormat(N=>D(N,A));let L;switch(a){case Ti.LINEAR:this.drawLinear(v,f,p);break;case Ti.QUANTIZE:L=this.drawQuantize(v,m,c,f,p),x.range([L,p]);break;default:throw Error("Entered color legend type is not supported.")}g.attr("transform",`translate(0,${Nt.color.axisYTranslation})`).call(O),g.select(".domain").remove(),g.select("g.tick:last-of-type text").style("text-anchor",d?"middle":"end"),g.select("g.tick:first-of-type text").style("text-anchor",d&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,r){const i=100/(t.length-1);I.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*i}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),I.appendOrSelect(n,"rect").attr("width",r).attr("height",Nt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,s){!r&&n==="diverge"&&t.splice(t.length/2,1);const a=Yr().domain(t).range([0,s]);return I.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",o=>a(o)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Nt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(T.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class Lk extends As{constructor(){super(...arguments),this.type="meter-title",this.renderType=rt.SVG}render(t=!1){const n=y(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer({ariaLabel:"meter title"}),{groupMapsTo:s}=r.data,a=r.locale.translations.meter.title;if(y(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=i.selectAll("text.meter-title").data(a?[a]:[n[s]]);c.enter().append("text").classed("meter-title",!0).merge(c).attr("x",0).attr("y","1em").text(u=>u),c.exit().remove(),this.appendPercentage()}this.displayStatus();const o=this.getMaxTitleWidth(),l=I.appendOrSelect(i,"text.meter-title");o>0&&l.node().getComputedTextLength()>o&&this.truncateTitle(l,o)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=y(n,"meter","proportional","total"),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,h=y(n,"meter","proportional","breakdownFormatter"),{code:d,number:p}=y(n,"locale");a=h!==null?h({datasetsTotal:r,total:i}):`${p(r,d)} ${s} used (${p(u,d)} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const l=this.getMaxTitleWidth(),c=I.appendOrSelect(t,"text.proportional-meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"meter","proportional","total"),i=r?y(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"",a=y(n,"meter","proportional","totalFormatter"),{code:o,number:l}=y(n,"locale"),c=a!==null?a(i):`${l(r,o)} ${s} total`,u=I.getHTMLElementSize(this.parent.node()).width,h=t.selectAll("text.proportional-meter-total").data([c]);h.enter().append("text").classed("proportional-meter-total",!0).merge(h).attr("x",this.model.getStatus()&&typeof u!="string"?u-te.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(d=>d),h.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=I.getHTMLElementSize(this.parent.node()).width||0,i=this.model.getStatus(),s=te.status.indicatorSize/2,a=I.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-s}, 0)`),o=i?[i]:[],l=a.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",s).attr("cx",0).attr("cy",8);const c=a.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${s}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=y(this.model.getDisplayData(),0,"value"),{code:n,number:r}=y(this.getOptions(),"locale"),i=this.getComponentContainer(),s=I.appendOrSelect(i,"text.meter-title"),a=y(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(a),l=te.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+l).attr("y",s.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=I.appendOrSelect(this.parent,"tspan"),i=te.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());I.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=y(this.getOptions(),"meter","proportional"),n=I.getHTMLElementSize(this.parent.node()).width;if(t!==null){const r=I.appendOrSelect(this.parent,"text.proportional-meter-total").node(),i=I.getSVGElementSize(r,{useBBox:!0}).width;return n-i-te.total.paddingLeft}else{const r=I.appendOrSelect(this.parent,"text.percent-value"),i=te.statusBar.paddingRight,s=r.node().getComputedTextLength(),a=I.appendOrSelect(this.parent,"g.status-indicator").node(),o=I.getSVGElementSize(a,{useBBox:!0}).width+te.status.paddingLeft;return n-s-i-o}}getStatusIconPathString(t){switch(t){case Ei.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case Ei.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Ei.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class xu extends gt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=I.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=y(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return t<i(r[0])||n>i(r[1])}return!1}}class Dk extends gt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-circlepack"})).attr("opacity",r=>r.data.dataGroupName===n.datum().name?1:zr.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"circle packs",withinChartClip:!0}),{width:r,height:i}=I.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=y(l,"canvasZoom","enabled");a&&y(s,0,"children")&&(s=y(s,0,"children"));const u=xs({children:s}).sum(f=>f.value).sort((f,g)=>g.value-f.value),h=NL().size([r,i]).padding(f=>f.depth>=1?zr.padding.children+3:zr.padding.mainGroup+3)(u).descendants().splice(1).filter(f=>f.depth<=o),d=n.selectAll("circle.node").data(h);d.exit().attr("width",0).attr("height",0).remove();const p=d.enter().append("circle").classed("node",!0);p.merge(d).attr("class",f=>{const g=c&&o===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${g}`:`node node-leaf ${g}`})}).style("fill",f=>this.model.getFillColor(f.data.dataGroupName,null,f.data)).style("stroke",f=>this.model.getFillColor(f.data.dataGroupName,null,f.data)).attr("cx",f=>f.x).attr("cy",f=>f.y).transition("circlepack-leaf-update-enter").call(f=>this.services.transitions.setupTransition({transition:f,name:"circlepack-leaf-update-enter"})).attr("r",f=>f.r).attr("opacity",1).attr("fill-opacity",zr.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,Fr),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",r=>this.model.getFillColor(r.data.dataGroupName,null,r.data))}highlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",zr.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){R(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=R(this.services.domUtils.getMainContainer()),n=this,r=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(r,Fr)})}getZoomIcon(){return`
71
71
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
72
72
  <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"/>
73
73
  <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"/>
74
- </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:vt(p,"locale.translations.total")||vt(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(S.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(S.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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(S.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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,Fr)}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,Fr),n.stopPropagation()}t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function DD(e,t){const n=ji(this._current,e);return r=>(this._current=n(r),t(this._current))}class Kg extends gt{constructor(){super(...arguments),this.type="pie",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return kt.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=Ts().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ts().innerRadius(this.getInnerRadius()).outerRadius(l+kt.hoverArc.outerRadiusOffset);const c=ik().value(A=>A[a]).sort(y(i,"pie","sortFunction")).padAngle(kt.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",dt.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",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",A=>[A[a],Fl(A.data[a],o,a)+"%",A.data[s]].filter(Boolean).join(", ")).attrTween("d",function(A){return DD.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",dt.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:Fl(A.data[a],o,a,!0)}):h(Fl(A.data[a],o,a),d)+"%").datum(function(A){const R=l+7,C=(A.endAngle-A.startAngle)/2+A.startAngle,H=C/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(C),A.yPosition=(A.textOffsetY+R)*-Math.cos(C),A}).attr("transform",function(A,R){const C=f.length,H=(A.endAngle-A.startAngle)*(180/Math.PI);if(R>=C-2&&H<kt.callout.minSliceDegree){let P,U;return A.index===C-1?(P=A.xPosition+kt.callout.offsetX+kt.callout.textMargin+A.textOffsetX,U=A.yPosition-kt.callout.offsetY,A.direction=_i.RIGHT,v.push(A)):(P=A.xPosition-kt.callout.offsetX-A.textOffsetX-kt.callout.textMargin,U=A.yPosition-kt.callout.offsetY,A.direction=_i.LEFT,v.push(A)),`translate(${P}, ${U})`}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?kt.xOffset:0,O=p?kt.yOffset:0;let M=l+b;_===jt.CENTER?M=E/2:_===jt.RIGHT&&(M=E-l-kt.xOffset);let k=l+O;v.length>0&&(k+=kt.yOffsetCallout),r.attr("x",M+7).attr("y",k),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",dt.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",dt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===_i.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+kt.callout.offsetX,y:o-kt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-kt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-kt.callout.offsetX,y:o-kt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+kt.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(S.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(S.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(S.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Pie.SLICE_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);wC(()=>{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(S.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.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+kt.radiusOffset:i}}class RD extends Kg{constructor(){super(...arguments),this.type="donut",this.renderType=rt.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=Vd:s=Oe;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 Qg="4,10 8,6 12,10",Jg="12,6 8,10 4,6";class ID extends gt{constructor(){super(...arguments),this.type="gauge",this.renderType=rt.SVG}getValue(){return this.model.getData().find(t=>t.group==="value")?.value??null}getValueRatio(){return nm(this.getValue(),0,100)/100}getDelta(){return this.model.getData().find(t=>t.group==="delta")?.value??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===Xn.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 Ns.UP:return Qg;case Ns.DOWN:return Jg;default:return t>0?Qg:Jg}}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=Ts().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Ts().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",dt.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===jt.CENTER?m=g/2:f===jt.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===Xn.FULL&&!s?d=l(a):r===Xn.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?"%":"",O=N.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${E}px`).attr("x",_/2).text(b),{width:M,height:k}=N.getSVGElementSize(O,{useBBox:!0});O.attr("y",`-${k/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(S.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Gauge.ARC_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(S.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===Xn.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class tv extends xu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=Hi(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",dt.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(u)/2;return this.services.cartesianScales.getOrientation()===zt.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.services.cartesianScales.getDomainIdentifier(u),h=u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d],p=this.getGroupScaleForLabel(h)(u[i]),f=this.getBarWidth(),g=p,m=p+f,v=this.services.cartesianScales.getRangeAxisPosition({datum:u}),x=this.services.cartesianScales.getDomainLowerBound(v),_=this.services.cartesianScales.getValueThroughAxisPosition(v,x),E=this.services.cartesianScales.getRangeValue(u),b=this.services.cartesianScales.getDomainValue(u)-f/2,O=b+f;if(!this.isOutsideZoomedDomain(b,O))return le({x0:g,x1:m,y0:_,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this,n=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),r=this.parent.selectAll("path.bar");n?r.style("pointer-events","none"):r.style("pointer-events",null),r.on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s}),n||t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:i,hoveredElement:a,data:[s]})}).on("mousemove",function(i,s){const a=I(this);t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:a})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.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(t){const n=this.getOptions();if(y(n,"bars","preserveSpaceForMissingBars")===!1&&t){const s=this.getDataCorrespondingToLabel(t),a=this.getTotalGroupPadding(s.length);return this.getBarWidth()*s.length+a}const r=this.model.getGroupedData(this.configs.groups),i=this.getTotalGroupPadding();return this.getBarWidth()*r.length+i}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=>s.data?.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(t){const n=this.model.getGroupedData(this.configs.groups),r=t!==void 0?t:n.length;return r===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(r-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=Yr().domain(t).rangeRound([0,this.getGroupWidth()])}getGroupScaleForLabel(t){const n=this.getOptions();if(y(n,"bars","preserveSpaceForMissingBars")===!1){const r=this.getDataCorrespondingToLabel(t),{groupMapsTo:i}=n.data,s=r.map(a=>a[i]);return Yr().domain(s).rangeRound([0,this.getGroupWidth(t)])}return this.groupScale}}class ND extends gt{constructor(){super(...arguments),this.type="heatmap",this.renderType=rt.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)}, ${Pn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Pn(l.range())},${c(r)})`),this.services.events.dispatchEvent(S.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(S.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(S.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(S.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(S.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(S.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!==Cr.OFF&&(t===Cr.AUTO&&vp.minCellDividerDimension<=this.xBandwidth&&vp.minCellDividerDimension<=this.yBandwidth||t===Cr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=vt(r,"locale.translations.total")||vt(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=Ji(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(S.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(S.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(S.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(S.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(S.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(S.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(S.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class PD extends gt{constructor(){super(...arguments),this.type="histogram",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=>vt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",dt.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=vt(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()===zt.VERTICAL?m+=1:m-=1),le({x0:p,x1:f,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.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=y(t,"tooltip","alwaysShowRulerTooltip"),a=this.parent.selectAll("path.bar");s?a.style("pointer-events","none"):a.style("pointer-events",null);const o=this;a.on("mouseover",function(l,c){const u=I(this);u.classed("hovered",!0);const d=i(parseFloat(vt(c,"data.x0")),r),h=i(parseFloat(vt(c,"data.x1")),r),p=o.services.cartesianScales.getRangeAxisPosition(),f=o.services.cartesianScales.getScaleLabel(p);s||o.services.events.dispatchEvent(S.Tooltip.SHOW,{event:l,hoveredElement:u,items:[{label:vt(t,"bins.rangeLabel")||"Range",value:`${d} – ${h}`},{label:t.tooltip.groupLabel||"Group",value:c[n],class:o.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:c[n]})},{label:f,value:vt(c,`data.${c[n]}`)}]})}).on("mousemove",function(l){o.services.events.dispatchEvent(S.Tooltip.MOVE,{event:l})}).on("mouseout",function(){I(this).classed("hovered",!1),o.services.events.dispatchEvent(S.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class BD extends un{constructor(){super(...arguments),this.type="lollipop",this.renderType=rt.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]?_n.weight.unselected:_n.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",_n.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?_n.opacity.unselected:_n.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",_n.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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]=Tn(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===zt.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(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class UD extends gt{constructor(){super(...arguments),this.type="meter",this.renderType=rt.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)-te.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-te.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=Ye().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?te.height.proportional:te.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(s?te.height.proportional:te.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?te.height.proportional:te.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",dt.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?te.height.proportional:te.height.default)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"peak-line-update",animate:t})).attr("x1",_=>d(_)).attr("x2",_=>d(_)).attr("role",dt.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(S.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(S.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(S.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(S.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class HD extends gt{constructor(){super(...arguments),this.type="radar",this.renderType=rt.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=AC(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ot(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:ot(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?lr.opacity.unselected:lr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?lr.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",lr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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}=lr;this.uniqueKeys=Array.from(new Set(s.map(T=>T[u]))),this.uniqueGroups=Array.from(new Set(s.map(T=>T[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 _=Yr().domain(this.fullDataNormalized.map(T=>T[u])).range([0,2*Math.PI].map(T=>T-Math.PI/2)),E=Pn(this.fullDataNormalized.map(T=>T[d])),b=Ye().domain([E>=0?0:E,rr(this.fullDataNormalized.map(T=>T[d]))]).range([g,x]).nice(f),O=b.ticks(f),M=(T,$,L)=>this.model.getFillColor(T,$,L),k=ok().angle(T=>_(T[u])+Math.PI/2).radius(T=>b(T[d])).curve(_f),A=this.uniqueKeys.map(T=>{const $=this.getLabelDimensions(T).width,L=R2(_(T),x);return $+L}),R={x:rr(A)+h,y:i/2},C=N.appendOrSelect(n,"g.y-axes").attr("role",dt.GROUP).selectAll("path").data(O,T=>T),H=T=>this.uniqueKeys.map($=>({[u]:$,[d]:T}));C.join(T=>T.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call($=>$.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",L=>k(H(L)))),T=>T.call($=>$.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=>k(H(L)))),T=>T.call($=>$.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_axes_exit",animate:t})).attr("d",L=>k(H(L))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",dt.GROUP).selectAll("line").data(this.uniqueKeys,T=>T).join(T=>T.append("line").attr("opacity",0).attr("class",$=>`x-axis-${ei($)}`).attr("stroke-dasharray","0").attr("x1",$=>Ut(_($),0,R).x).attr("y1",$=>Ut(_($),0,R).y).attr("x2",$=>Ut(_($),0,R).x).attr("y2",$=>Ut(_($),0,R).y).call($=>$.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)),T=>T.call($=>$.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)),T=>T.call($=>$.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",dt.GROUP).selectAll("text").data(this.uniqueKeys).join(T=>T.append("text").text($=>$).attr("opacity",0).attr("x",$=>Ut(_($),b.range()[1]+h,R).x).attr("y",$=>Ut(_($),b.range()[1]+h,R).y).style("text-anchor",$=>Nf(_($)).textAnchor).style("dominant-baseline",$=>Nf(_($)).dominantBaseline).call($=>$.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),T=>T.call($=>$.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"),D=this.getAlignmentXOffset(L,n,this.getParent());n.attr("x",D)})),T=>T.call($=>$.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",dt.GROUP).selectAll("path").data(this.groupedDataNormalized,T=>T.name).join(T=>T.append("path").attr("class",$=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:$.name,originalClassName:"blob"})).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",$=>$.name).attr("opacity",0).attr("transform",t?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",$=>M($.name,null,$.data)).style("fill-opacity",lr.opacity.selected).style("stroke",$=>M($.name,null,$.data)).call($=>{const L=$.transition().call(D=>this.services.transitions.setupTransition({transition:D,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",D=>k(D.data))}),T=>(T.attr("class",$=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:$.name,originalClassName:"blob"})).style("fill",$=>M($.name,null,$.data)).style("stroke",$=>M($.name,null,$.data)),T.call($=>$.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=>k(L.data))),T),T=>T.call($=>{const L=$.transition().call(D=>this.services.transitions.setupTransition({transition:D,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",dt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(T=>y(T,d)!==null)).join(T=>T.append("circle").attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",$=>$[c]),T=>T,T=>T.remove()).attr("class",T=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:T[l],originalClassName:ei(T[u])})).attr("cx",T=>Ut(_(T[u]),b(T[d]),R).x).attr("cy",T=>Ut(_(T[u]),b(T[d]),R).y).attr("r",0).attr("opacity",0).style("fill",T=>M(T[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",dt.GROUP).selectAll("rect").data(this.uniqueKeys).join(T=>T.append("rect"),T=>T,T=>T.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",T=>`rotate(${Pf(_(T))}, ${R.x}, ${R.y})`);const{code:P,number:U}=y(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",dt.GROUP).selectAll("text").data(je(O)).join(T=>T.append("text").attr("opacity",0).text($=>U($,P)).attr("x",$=>Ut(-Math.PI/2,b($),R).x+p).attr("y",$=>Ut(-Math.PI/2,b($),R).y).style("text-anchor","start").style("dominant-baseline","middle").call($=>$.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),T=>T.call($=>$.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)),T=>T.call($=>$.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===jt.CENTER?a=Math.floor((s-i.width)/2):t===jt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.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(S.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${ei(i)}`),o=t.parent.selectAll(`.dots circle.${ei(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",lr.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(S.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(S.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(S.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-${ei(i)}`),o=t.parent.selectAll(`.dots circle.${ei(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(S.Tooltip.HIDE)})}}class ev extends xu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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===zt.VERTICAL||d<0&&a===zt.HORIZONTAL?g=f-2:g=f+2),!this.isOutsideZoomedDomain(h,p))return le({x0:h,x1:p,y0:f,y1:g},a)}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this,n=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),r=this.parent.selectAll("path.bar");n?r.style("pointer-events","none"):r.style("pointer-events",null),r.on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s}),n||t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:i,hoveredElement:a,data:[s]})}).on("mousemove",function(i,s){t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:i,element:I(this),datum:s}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:a})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class VD extends de{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 nv extends gt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=rt.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?xn.opacity.unselected:xn.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",xn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=ru().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",dt.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",xn.opacity.selected).attr("d",this.areaGenerator)}}class rv extends xu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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",dt.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()===zt.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===zt.VERTICAL?g+=1:g-=1)}return le({x0:h,x1:p,y0:f,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",dt.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=y(t,"tooltip","alwaysShowRulerTooltip"),i=this.parent.selectAll("path.bar");r?i.style("pointer-events","none"):i.style("pointer-events",null);const s=this;i.on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0),s.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:a,element:l,datum:o});let c=s.model.getDisplayData(s.configs.groups).find(u=>{const d=s.services.cartesianScales.getDomainIdentifier(u),h=s.services.cartesianScales.getRangeIdentifier(u);return u[h]===o.data[o[n]]&&u[d].toString()===o.data.sharedStackKey&&u[n]===o[n]});if(c===void 0){const u=s.services.cartesianScales.getDomainIdentifier(),d=s.services.cartesianScales.getRangeIdentifier();c={[u]:o.data.sharedStackKey,[d]:o.data[o[n]],[n]:o[n]}}r||s.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:l,data:[c]})}).on("mousemove",function(a,o){const l=I(this);s.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:a,element:l,datum:o}),s.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("click",function(a,o){s.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);l.classed("hovered",!1),s.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:a,element:l,datum:o}),s.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:l})})}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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class iv extends un{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=rt.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",dt.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 mi=6;class GD extends gt{constructor(){super(...arguments),this.type="tree",this.renderType=rt.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+mi:30-mi},h=xs({name:o,children:a}),p=10,f=r/6,g=O=>{const M=h.descendants().reverse(),k=h.links();let A=h,R=h;h.eachBefore(D=>{D.x<A.x&&(A=D),D.x>R.x&&(R=D)});const C=R.x-A.x,H=n.transition().call(D=>this.services.transitions.setupTransition({transition:D,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,A.x,r,C].join(" ")),P=b.selectAll("g").data(M,D=>D.id),U=this,T=P.enter().append("g").attr("transform",()=>`translate(${O.y0},${O.x0})`).attr("class",D=>D.depth!==0&&D.children&&D.children.length>0?"clickable":null).on("mouseover",function(D,B){U.services.events.dispatchEvent(S.Tree.NODE_MOUSEOVER,{event:D,element:I(this),datum:B})}).on("click",function(D,B){B.depth!==0&&(B.children=B.children?null:B._children,g(B)),U.services.events.dispatchEvent(S.Tree.NODE_CLICK,{event:D,element:I(this),datum:B})}).on("mouseout",function(D,B){U.services.events.dispatchEvent(S.Tree.NODE_MOUSEOUT,{event:D,element:I(this),datum:B})});T.append("circle").attr("r",2.5).attr("class",D=>D._children?"parent":"child").attr("stroke-width",10),T.append("text").attr("dy","0.31em").attr("x",D=>D._children?-mi:mi).attr("text-anchor",D=>D._children?"end":"start").text(D=>D.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(T).transition(H).attr("transform",D=>`translate(${D.y},${D.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(H).remove().attr("transform",()=>`translate(${O.y},${O.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const $=E.selectAll("path").data(k,D=>D.target.id),L=$.enter().append("path").attr("d",()=>{const D={x:O.x0,y:O.y0};return _({source:D,target:D})});$.merge(L).transition(H).attr("d",_),$.exit().transition(H).remove().attr("d",()=>{const D={x:O.x,y:O.y};return _({source:D,target:D})}),h.eachBefore(D=>{D.x0=D.x,D.y0=D.y})},m=h.descendants(),v=m[m.length-1].depth,x=y(s,"tree","type")===Is.DENDROGRAM?rL().size([i,r-u-v*mi-l]):zL().nodeSize([p,f]).size([i,r-u-v*mi-l]),_=pk().x(O=>O.y).y(O=>O.x);h.x0=f/2,h.y0=0,h.descendants().forEach((O,M)=>{O.id=M,O._children=O.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 FD="#000000",zD="#ffffff",jD="#fcf4d6",WD="#fddc69",qD="#f1c21b",YD="#d2a106",XD="#b28600",ZD="#8e6a00",KD="#684e00",QD="#483700",JD="#302400",tR="#1c1500",eR={10:jD,20:WD,30:qD,40:YD,50:XD,60:ZD,70:KD,80:QD,90:JD,100:tR},nR="#fff2e8",rR="#ffd9be",iR="#ffb784",sR="#ff832b",aR="#eb6200",oR="#ba4e00",lR="#8a3800",cR="#5e2900",uR="#3e1a00",hR="#231000",dR={10:nR,20:rR,30:iR,40:sR,50:aR,60:oR,70:lR,80:cR,90:uR,100:hR},pR="#fff1f1",fR="#ffd7d9",mR="#ffb3b8",gR="#ff8389",vR="#fa4d56",yR="#da1e28",bR="#a2191f",xR="#750e13",_R="#520408",ER="#2d0709",TR={10:pR,20:fR,30:mR,40:gR,50:vR,60:yR,70:bR,80:xR,90:_R,100:ER},OR="#fff0f7",SR="#ffd6e8",wR="#ffafd2",$R="#ff7eb6",MR="#ee5396",CR="#d02670",AR="#9f1853",LR="#740937",kR="#510224",DR="#2a0a18",RR={10:OR,20:SR,30:wR,40:$R,50:MR,60:CR,70:AR,80:LR,90:kR,100:DR},IR="#f6f2ff",NR="#e8daff",PR="#d4bbff",BR="#be95ff",UR="#a56eff",HR="#8a3ffc",VR="#6929c4",GR="#491d8b",FR="#31135e",zR="#1c0f30",jR={10:IR,20:NR,30:PR,40:BR,50:UR,60:HR,70:VR,80:GR,90:FR,100:zR},WR="#edf5ff",qR="#d0e2ff",YR="#a6c8ff",XR="#78a9ff",ZR="#4589ff",KR="#0f62fe",QR="#0043ce",JR="#002d9c",tI="#001d6c",eI="#001141",nI={10:WR,20:qR,30:YR,40:XR,50:ZR,60:KR,70:QR,80:JR,90:tI,100:eI},rI="#e5f6ff",iI="#bae6ff",sI="#82cfff",aI="#33b1ff",oI="#1192e8",lI="#0072c3",cI="#00539a",uI="#003a6d",hI="#012749",dI="#061727",pI={10:rI,20:iI,30:sI,40:aI,50:oI,60:lI,70:cI,80:uI,90:hI,100:dI},fI="#d9fbfb",mI="#9ef0f0",gI="#3ddbd9",vI="#08bdba",yI="#009d9a",bI="#007d79",xI="#005d5d",_I="#004144",EI="#022b30",TI="#081a1c",OI={10:fI,20:mI,30:gI,40:vI,50:yI,60:bI,70:xI,80:_I,90:EI,100:TI},SI="#defbe6",wI="#a7f0ba",$I="#6fdc8c",MI="#42be65",CI="#24a148",AI="#198038",LI="#0e6027",kI="#044317",DI="#022d0d",RI="#071908",II={10:SI,20:wI,30:$I,40:MI,50:CI,60:AI,70:LI,80:kI,90:DI,100:RI},NI="#f2f4f8",PI="#dde1e6",BI="#c1c7cd",UI="#a2a9b0",HI="#878d96",VI="#697077",GI="#4d5358",FI="#343a3f",zI="#21272a",jI="#121619",WI={10:NI,20:PI,30:BI,40:UI,50:HI,60:VI,70:GI,80:FI,90:zI,100:jI},qI="#f4f4f4",YI="#e0e0e0",XI="#c6c6c6",ZI="#a8a8a8",KI="#8d8d8d",QI="#6f6f6f",JI="#525252",tN="#393939",eN="#262626",nN="#161616",rN={10:qI,20:YI,30:XI,40:ZI,50:KI,60:QI,70:JI,80:tN,90:eN,100:nN},iN="#f7f3f2",sN="#e5e0df",aN="#cac5c4",oN="#ada8a8",lN="#8f8b8b",cN="#726e6e",uN="#565151",hN="#3c3838",dN="#272525",pN="#171414",fN={10:iN,20:sN,30:aN,40:oN,50:lN,60:cN,70:uN,80:hN,90:dN,100:pN},sv={black:{100:FD},blue:nI,coolGray:WI,cyan:pI,gray:rN,green:II,magenta:RR,orange:dR,purple:jR,red:TR,teal:OI,warmGray:fN,white:{0:zD},yellow:eR};const mN=e=>{if(!e)return null;for(const t of Object.keys(sv)){const n=sv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},av=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=vn(n);let i;if(r&&(i=mN(r?r.hex():null)),i==null){const s=Pd(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let gN=0;class vN extends gt{constructor(){super(...arguments),this.type="treemap",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=xs({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=XL().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",()=>gN++).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",av).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",av),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),vn(s).darker(.7).toString()}),t.services.events.dispatchEvent(S.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(S.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.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(S.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}}function yN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bN(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?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 xN={value:function(){}};function ov(){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 go(n)}function go(e){this._=e}function _N(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}})}go.prototype=ov.prototype={constructor:go,on:function(e,t){var n=this._,r=_N(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=EN(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]=lv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=lv(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 go(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 EN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function lv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=xN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const TN=Object.freeze(Object.defineProperty({__proto__:null,dispatch:ov},Symbol.toStringTag,{value:"Module"})),ON=bN(TN);var _u,cv;function SN(){if(cv)return _u;cv=1;const e=ON.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;_u=function(){var E=[256,256],b=s,O=a,M=l,k=o,A=o,R=c,C=u,H=g,P=[],U=1/0,T=e("word","end"),$=null,L=Math.random,D={},B=x;D.canvas=function(j){return arguments.length?(B=_(j),D):B},D.start=function(){var j=Q(B()),Z=v((E[0]>>5)*E[1]),ut=null,tt=P.length,X=-1,et=[],at=P.map(function(q,K){return q.text=b.call(this,q,K),q.font=O.call(this,q,K),q.style=k.call(this,q,K),q.weight=A.call(this,q,K),q.rotate=R.call(this,q,K),q.size=~~M.call(this,q,K),q.padding=C.call(this,q,K),q}).sort(function(q,K){return K.size-q.size});return $&&clearInterval($),$=setInterval(z,0),z(),D;function z(){for(var q=Date.now();Date.now()-q<U&&++X<tt&&$;){var K=at[X];K.x=E[0]*(L()+.5)>>1,K.y=E[1]*(L()+.5)>>1,d(j,K,at,X),K.hasText&&W(Z,K,ut)&&(et.push(K),T.call("word",D,K),ut?p(ut,K):ut=[{x:K.x+K.x0,y:K.y+K.y0},{x:K.x+K.x1,y:K.y+K.y1}],K.x-=E[0]>>1,K.y-=E[1]>>1)}X>=tt&&(D.stop(),T.call("end",D,et,ut))}},D.stop=function(){$&&(clearInterval($),$=null);for(const j of P)delete j.sprite;return D};function Q(j){const Z=j.getContext("2d",{willReadFrequently:!0});j.width=j.height=1;const ut=Math.sqrt(Z.getImageData(0,0,1,1).data.length>>2);return j.width=(r<<5)/ut,j.height=i/ut,Z.fillStyle=Z.strokeStyle="red",{context:Z,ratio:ut}}function W(j,Z,ut){E[0],E[1];for(var tt=Z.x,X=Z.y,et=Math.sqrt(E[0]*E[0]+E[1]*E[1]),at=H(E),z=L()<.5?1:-1,q=-z,K,F,ht;(K=at(q+=z))&&(F=~~K[0],ht=~~K[1],!(Math.min(Math.abs(F),Math.abs(ht))>=et));)if(Z.x=tt+F,Z.y=X+ht,!(Z.x+Z.x0<0||Z.y+Z.y0<0||Z.x+Z.x1>E[0]||Z.y+Z.y1>E[1])&&(!ut||f(Z,ut))&&!h(Z,j,E[0])){for(var lt=Z.sprite,Mt=Z.width>>5,Gt=E[0]>>5,it=Z.x-(Mt<<4),bt=it&127,He=32-bt,pe=Z.y1-Z.y0,ks=(Z.y+Z.y0)*Gt+(it>>5),gi,vi=0;vi<pe;vi++){gi=0;for(var Rn=0;Rn<=Mt;Rn++)j[ks+Rn]|=gi<<He|(Rn<Mt?(gi=lt[vi*Mt+Rn])>>>bt:0);ks+=Gt}return!0}return!1}return D.timeInterval=function(j){return arguments.length?(U=j??1/0,D):U},D.words=function(j){return arguments.length?(P=j,D):P},D.size=function(j){return arguments.length?(E=[+j[0],+j[1]],D):E},D.font=function(j){return arguments.length?(O=_(j),D):O},D.fontStyle=function(j){return arguments.length?(k=_(j),D):k},D.fontWeight=function(j){return arguments.length?(A=_(j),D):A},D.rotate=function(j){return arguments.length?(R=_(j),D):R},D.text=function(j){return arguments.length?(b=_(j),D):b},D.spiral=function(j){return arguments.length?(H=n[j]||j,D):H},D.fontSize=function(j){return arguments.length?(M=_(j),D):M},D.padding=function(j){return arguments.length?(C=_(j),D):C},D.random=function(j){return arguments.length?(L=j,D):L},D.on=function(){var j=T.on.apply(T,arguments);return j===T?D:j},D};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,O,M){if(!b.sprite){var k=E.context,A=E.ratio;k.clearRect(0,0,(r<<5)/A,i/A);var R=0,C=0,H=0,P=O.length;for(--M;++M<P;){b=O[M],k.save(),k.font=b.style+" "+b.weight+" "+~~((b.size+1)/A)+"px "+b.font;const K=k.measureText(b.text),F=-Math.floor(K.width/2);let ht=(K.width+1)*A,lt=b.size<<1;if(b.rotate){var U=Math.sin(b.rotate*t),T=Math.cos(b.rotate*t),$=ht*T,L=ht*U,D=lt*T,B=lt*U;ht=Math.max(Math.abs($+B),Math.abs($-B))+31>>5<<5,lt=~~Math.max(Math.abs(L+D),Math.abs(L-D))}else ht=ht+31>>5<<5;if(lt>H&&(H=lt),R+ht>=r<<5&&(R=0,C+=H,H=0),C+lt>=i)break;k.translate((R+(ht>>1))/A,(C+(lt>>1))/A),b.rotate&&k.rotate(b.rotate*t),k.fillText(b.text,F,0),b.padding&&(k.lineWidth=2*b.padding,k.strokeText(b.text,F,0)),k.restore(),b.width=ht,b.height=lt,b.xoff=R,b.yoff=C,b.x1=ht>>1,b.y1=lt>>1,b.x0=-b.x1,b.y0=-b.y1,b.hasText=!0,R+=ht}for(var Q=k.getImageData(0,0,(r<<5)/A,i/A).data,W=[];--M>=0;)if(b=O[M],!!b.hasText){for(var j=b.width,Z=j>>5,ut=b.y1-b.y0,tt=0;tt<ut*Z;tt++)W[tt]=0;if(R=b.xoff,R==null)return;C=b.yoff;for(var X=0,et=-1,at=0;at<ut;at++){for(var tt=0;tt<j;tt++){var z=Z*at+(tt>>5),q=Q[(C+at)*(r<<5)+(R+tt)<<2]?1<<31-tt%32:0;W[z]|=q,X|=q}X?et=at:(b.y0++,ut--,at--,C++)}b.y1=b.y0+et,b.sprite=W.slice(0,(b.y1-b.y0)*Z)}}}function h(E,b,O){O>>=5;for(var M=E.sprite,k=E.width>>5,A=E.x-(k<<4),R=A&127,C=32-R,H=E.y1-E.y0,P=(E.y+E.y0)*O+(A>>5),U,T=0;T<H;T++){U=0;for(var $=0;$<=k;$++)if((U<<C|($<k?(U=M[T*k+$])>>>R:0))&b[P+$])return!0;P+=O}return!1}function p(E,b){var O=E[0],M=E[1];b.x+b.x0<O.x&&(O.x=b.x+b.x0),b.y+b.y0<O.y&&(O.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(O){return[b*(O*=.1)*Math.cos(O),O*Math.sin(O)]}}function m(E){var b=4,O=b*E[0]/E[1],M=0,k=0;return function(A){var R=A<0?-1:1;switch(Math.sqrt(1+4*R*A)-R&3){case 0:M+=O;break;case 1:k+=b;break;case 2:M-=O;break;default:k-=b;break}return[M,k]}}function v(E){for(var b=[],O=-1;++O<E;)b[O]=0;return b}function x(){return document.createElement("canvas")}function _(E){return typeof E=="function"?E:function(){return E}}return _u}var wN=SN();const $N=yN(wN);class MN extends gt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=rt.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(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.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=$N().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?je(i):[1,1];return Ye().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Ta(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(S.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:vt(t,"locale.translations.group")||vt(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(S.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(S.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(S.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o})})}}class CN extends gt{constructor(){super(...arguments),this.type="geo",this.renderType=rt.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=_D(s,Object.values(l)),u=yD(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=CA().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",Os()([[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 tn.geoEqualEarth:t=YA();break;case tn.geoAlbers:t=VA();break;case tn.geoConicEqualArea:t=eg();break;case tn.geoConicEquidistant:t=WA();break;case tn.geoEquirectangular:t=zA();break;case tn.geoMercator:t=GA();break;case tn.geoNaturalEarth1:t=XA();break;default:throw new Error("Projection is not supported.")}return t}}class AN extends CN{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(wr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Sr.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(wr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Sr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(wr.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(wr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Sr.HIDE,{event:r,hoveredElement:s})})}}function Eu(e){var t=e==null?0:e.length;return t?Ws(e,1):[]}function LN(e){return dh(mh(e,void 0,Eu),e+"")}function uv(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 kN(e,t){return t.length<2?e:il(e,uv(t,0,-1))}var DN=Object.prototype,RN=DN.hasOwnProperty;function IN(e,t){t=js(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=Rr(t[n]);if(i==="__proto__"&&!RN.call(e,"__proto__")||(i==="constructor"||i==="prototype")&&n<r-1)return!1}var s=kN(e,t);return s==null||delete s[Rr(ud(t))]}function NN(e){return Mh(e)?void 0:e}var PN=1,BN=2,UN=4,HN=LN(function(e,t){var n={};if(e==null)return n;var r=!1;t=Wo(t,function(s){return s=js(s,e),r||(r=s.length>1),s}),Ar(e,Bh(e),n),r&&(n=Bi(n,PN|BN|UN,NN));for(var i=t.length;i--;)IN(n,t[i]);return n});function hv(e){return Math.log(e)}function dv(e){return Math.exp(e)}function VN(e){return-Math.log(-e)}function GN(e){return-Math.exp(-e)}function FN(e){return isFinite(e)?+("1e"+e):e<0?0:e}function zN(e){return e===10?FN:e===Math.E?Math.exp:t=>Math.pow(e,t)}function jN(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 pv(e){return(t,n)=>-e(-t,n)}function WN(e){const t=e(hv,dv),n=t.domain;let r=10,i,s;function a(){return i=jN(r),s=zN(r),n()[0]<0?(i=pv(i),s=pv(s),e(VN,GN)):e(hv,dv),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=Qs(c,u,m))}else v=Qs(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=Zi(l)).precision==null&&(l.trim=!0),l=Bl(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 fv(){const e=WN(pp()).domain([1,10]);return e.copy=()=>Hl(e,fv()).base(e.base()),Vr.apply(e,arguments),e}function vo(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 yo(e){this._context=e}yo.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:vo(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:vo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qN(e){return new yo(e)}function mv(e){this._context=e}mv.prototype={areaStart:Vn,areaEnd:Vn,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:vo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function YN(e){return new mv(e)}function gv(e){this._context=e}gv.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:vo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XN(e){return new gv(e)}function vv(e,t){this._basis=new yo(e),this._beta=t}vv.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 ZN=function e(t){function n(r){return t===1?new yo(r):new vv(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function bo(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 Tu(e,t){this._context=e,this._k=(1-t)/6}Tu.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:bo(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:bo(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 KN=function e(t){function n(r){return new Tu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ou(e,t){this._context=e,this._k=(1-t)/6}Ou.prototype={areaStart:Vn,areaEnd:Vn,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:bo(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 QN=function e(t){function n(r){return new Ou(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Su(e,t){this._context=e,this._k=(1-t)/6}Su.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:bo(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 JN=function e(t){function n(r){return new Su(r,t)}return n.tension=function(r){return e(+r)},n}(0);function wu(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>se){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>se){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 yv(e,t){this._context=e,this._alpha=t}yv.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:wu(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 tP=function e(t){function n(r){return t?new yv(r,t):new Tu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function bv(e,t){this._context=e,this._alpha=t}bv.prototype={areaStart:Vn,areaEnd:Vn,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:wu(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 eP=function e(t){function n(r){return t?new bv(r,t):new Ou(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function xv(e,t){this._context=e,this._alpha=t}xv.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:wu(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 nP=function e(t){function n(r){return t?new xv(r,t):new Su(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function _v(e){return e<0?-1:1}function Ev(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(_v(s)+_v(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Tv(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function $u(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 xo(e){this._context=e}xo.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:$u(this,this._t0,Tv(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,$u(this,Tv(this,n=Ev(this,e,t)),n);break;default:$u(this,this._t0,n=Ev(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Ov(e){this._context=new Sv(e)}(Ov.prototype=Object.create(xo.prototype)).point=function(e,t){xo.prototype.point.call(this,t,e)};function Sv(e){this._context=e}Sv.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 rP(e){return new xo(e)}function iP(e){return new Ov(e)}function wv(e){this._context=e}wv.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=$v(e),i=$v(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 $v(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 sP(e){return new wv(e)}function _o(e,t){this._context=e,this._t=t}_o.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 aP(e){return new _o(e,.5)}function oP(e){return new _o(e,0)}function lP(e){return new _o(e,1)}class cP extends Cn{zoomIn(t,n,r){let i,s,a;const o=r||Fr;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(S.CanvasZoom.CANVAS_ZOOM_IN,{element:I(t)})}zoomOut(t,n){const r=n||Fr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_OUT)}}class uP extends Cn{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 hP extends Cn{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 dP extends Cn{constructor(){super(...arguments),this.pendingTransitions={}}init(){this.services.events?.addEventListener(S.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(xp,n,"duration")||xp.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Ls(e,t){const n=+Bt(e)-+Bt(t);return n<0?-1:n>0?1:n}function pP(e,t,n){const[r,i]=Zn(n?.in,e,t);return r.getFullYear()-i.getFullYear()}function fP(e,t,n){const[r,i]=Zn(n?.in,e,t),s=Ls(r,i),a=Math.abs(pP(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Ls(r,i)===-s,l=s*(a-+o);return l===0?0:l}function Mu(e,t,n){const r=Bt(e,n?.in);if(isNaN(t))return Le(e,NaN);if(!t)return r;const i=r.getDate(),s=Le(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 Mv(e,t,n){return Mu(e,t*12,n)}function mP(e,t,n){return Mv(e,-t,n)}function gP(e,t,n){const[r,i]=Zn(n?.in,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function vP(e,t){const n=Bt(e,t?.in);return n.setHours(23,59,59,999),n}function yP(e,t){const n=Bt(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function bP(e,t){const n=Bt(e,t?.in);return+vP(n,t)==+yP(n,t)}function xP(e,t,n){const[r,i,s]=Zn(n?.in,e,e,t),a=Ls(i,s),o=Math.abs(gP(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Ls(i,s)===-a;bP(r)&&o===1&&Ls(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function _P(e,t,n){return Mu(e,-t,n)}function EP(e,t,n){const[r,i]=Zn(n?.in,e,t),s=Cv(r,i),a=Math.abs(Dp(r,i));r.setDate(r.getDate()-s*a);const o=+(Cv(r,i)===-s),l=s*(a-o);return l===0?0:l}function Cv(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 Av(e,t,n){const r=Bt(e,n?.in);return isNaN(t)?Le(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function TP(e,t,n){return Av(e,-t,n)}function Cu(e){return t=>{const n=(0,Math.trunc)(t);return n===0?0:n}}function OP(e,t,n){const[r,i]=Zn(n?.in,e,t),s=(+r-+i)/th;return Cu()(s)}function Lv(e,t,n){return Le(e,+Bt(e)+t)}function kv(e,t,n){return Lv(e,t*th)}function SP(e,t,n){return kv(e,-t)}function Dv(e,t){return+Bt(e)-+Bt(t)}function Rv(e,t,n){const r=Dv(e,t)/Ju;return Cu()(r)}function Au(e,t,n){const r=Bt(e,n?.in);return r.setTime(r.getTime()+t*Ju),r}function Iv(e,t,n){return Au(e,-t,n)}function Nv(e,t,n){const r=Dv(e,t)/1e3;return Cu()(r)}function Lu(e,t,n){return Lv(e,t*1e3)}function Pv(e,t,n){return Lu(e,-t)}class wP extends Cn{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?.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?.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===V.BOTTOM||t===V.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(V).map(t=>V[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===V.LEFT||this.rangeAxisPosition===V.RIGHT)&&(this.domainAxisPosition===V.BOTTOM||this.domainAxisPosition===V.TOP)?this.orientation=zt.VERTICAL:this.orientation=zt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){const t=this.model.getOptions(),n=y(t,"axes");(n[V.LEFT]?.correspondingDatasets&&n[V.RIGHT]||n[V.RIGHT]?.correspondingDatasets&&n[V.LEFT]||n[V.TOP]?.correspondingDatasets&&n[V.BOTTOM]||n[V.BOTTOM]?.correspondingDatasets&&n[V.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=[V.BOTTOM,V.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[V.LEFT,V.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 $P(n,s)}else return MP(n,Bn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,V.LEFT)===null&&y(n,V.RIGHT)!==null||y(n,V.RIGHT,"main")===!0||r&&y(n,V.LEFT,"correspondingDatasets")?{primary:V.RIGHT,secondary:V.LEFT}:{primary:V.LEFT,secondary:V.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,V.BOTTOM)===null&&y(n,V.TOP)!==null||y(n,V.TOP,"main")===!0||r&&y(n,V.BOTTOM,"correspondingDatasets")?{primary:V.TOP,secondary:V.BOTTOM}:{primary:V.BOTTOM,secondary:V.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,rr(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}=Bn.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 Hi(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{...O}=b;let M=0,k=0;Object.values(HN(O,"sharedStackKey")).forEach(A=>{isNaN(A)||(A<0?k+=A:M+=A)}),E.push([k,M])}),g=[...Eu(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=je(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=gf():i===nt.LOG?s=fv().base(r.base||10):i===nt.LABELS||i===nt.LABELS_RATIO?s=Yr():s=Ye(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===zt.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 $P(e,t){const n=new Date(e[0]),r=new Date(e[1]);return fP(r,n)>1?[mP(n,t),Mv(r,t)]:xP(r,n)>1?[_P(n,t),Mu(r,t)]:EP(r,n)>1?[TP(n,t),Av(r,t)]:OP(r,n)>1?[SP(n,t),kv(r,t)]:Rv(r,n)>30?[Iv(n,t*30),Au(r,t*30)]:Rv(r,n)>1?[Iv(n,t),Au(r,t)]:Nv(r,n)>15?[Pv(n,t*15),Lu(r,t*15)]:Nv(r,n)>1?[Pv(n,t),Lu(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 CP extends Cn{constructor(){super(...arguments),this.curveTypes={curveLinear:Aa,curveLinearClosed:_f,curveBasis:qN,curveBasisClosed:YN,curveBasisOpen:XN,curveBundle:ZN,curveCardinal:KN,curveCardinalClosed:QN,curveCardinalOpen:JN,curveCatmullRom:tP,curveCatmullRomClosed:eP,curveCatmullRomOpen:nP,curveMonotoneX:rP,curveMonotoneY:iP,curveNatural:sP,curveStep:aP,curveStepAfter:lP,curveStepBefore:oP}}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 AP extends Cn{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===V.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,je(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0,type:"manual"}){this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&this.services.events?.dispatchEvent(S.ZoomDomain.CHANGE,{newDomain:t,type:n.type})}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&r){const a=i.stacked?"sharedStackKey":this.services.cartesianScales?.getDomainIdentifier(),o=t.filter(l=>new Date(l[a])>=r[0]&&new Date(l[a])<=r[1]);if(o.length>0)return o}return t}zoomIn(t=this.getZoomRatio()){const n=this.model.get("zoomDomain"),r=Se.handleWidth,i=this.services.cartesianScales?.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const s=i(n[0]),a=i(n[1]);if(a-s<r+1)return;const o=i.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,d=a-c;u>=d&&(u=s+l/2-r/2,d=a-l/2+r/2);const h=[i.invert(u),i.invert(d)];(n[0].valueOf()!==h[0].valueOf()||n[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h,{dispatchEvent:!0,type:"in"})}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,{dispatchEvent:!0,type:"out"})}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,{dispatchEvent:!0,type:"reset"})}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 LP(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:uv(e,t,n)}var kP="\\ud800-\\udfff",DP="\\u0300-\\u036f",RP="\\ufe20-\\ufe2f",IP="\\u20d0-\\u20ff",NP=DP+RP+IP,PP="\\ufe0e\\ufe0f",BP="\\u200d",UP=RegExp("["+BP+kP+NP+PP+"]");function Bv(e){return UP.test(e)}function HP(e){return e.split("")}var Uv="\\ud800-\\udfff",VP="\\u0300-\\u036f",GP="\\ufe20-\\ufe2f",FP="\\u20d0-\\u20ff",zP=VP+GP+FP,jP="\\ufe0e\\ufe0f",WP="["+Uv+"]",ku="["+zP+"]",Du="\\ud83c[\\udffb-\\udfff]",qP="(?:"+ku+"|"+Du+")",Hv="[^"+Uv+"]",Vv="(?:\\ud83c[\\udde6-\\uddff]){2}",Gv="[\\ud800-\\udbff][\\udc00-\\udfff]",YP="\\u200d",Fv=qP+"?",zv="["+jP+"]?",XP="(?:"+YP+"(?:"+[Hv,Vv,Gv].join("|")+")"+zv+Fv+")*",ZP=zv+Fv+XP,KP="(?:"+[Hv+ku+"?",ku,Vv,Gv,WP].join("|")+")",QP=RegExp(Du+"(?="+Du+")|"+KP+ZP,"g");function JP(e){return e.match(QP)||[]}function t3(e){return Bv(e)?JP(e):HP(e)}function e3(e){return function(t){t=Pi(t);var n=Bv(t)?t3(t):void 0,r=n?n[0]:t.charAt(0),i=n?LP(n,1).join(""):t.slice(1);return r[e]()+i}}var n3=e3("toUpperCase");function r3(e){return n3(Pi(e).toLowerCase())}var i3=em(function(e,t,n){return t=t.toLowerCase(),e+(n?r3(t):t)});class Ke{constructor(t,n){this.components=[],this.services={canvasZoom:cP,domUtils:N,events:uP,files:hP,gradientUtils:mc,transitions:dP},this.model=new sn(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(S.Model.UPDATE,r=>{const i=!!y(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(S.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(S.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 du(this.model,this.services)],growth:ct.PREFERRED},a=y(r,"canvasZoom","enabled");a&&a===!0&&t.push(new Uk(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new As(this.model,this.services)],growth:ct.STRETCH},c={id:"toolbar",components:[new co(this.model,this.services)],growth:ct.PREFERRED},u={id:"header",components:[new Me(this.model,this.services,[l,...i?[c]:[]],{direction:Ct.ROW,alignItems:Yn.CENTER})],growth:ct.PREFERRED},d={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:y(n,"graphFrameRenderType")||rt.SVG},h=y(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=Ct.COLUMN;if(h){const v=y(r,"legend","position");v==="left"?(p=Ct.ROW,r.legend.orientation||(r.legend.orientation=Mr.VERTICAL)):v==="right"?(p=Ct.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Mr.VERTICAL)):v==="bottom"&&(p=Ct.COLUMN_REVERSE)}const f={id:"spacer",components:[new Dn(this.model,this.services)],growth:ct.PREFERRED},g={id:"full-frame",components:[new Me(this.model,this.services,[...h?[s]:[],...h?[f]:[],d],{direction:p})],growth:ct.STRETCH},m=[];if(o||i){m.push(u);const v={id:"spacer",components:[new Dn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};m.push(v)}return m.push(g),[new pu(this.model,this.services),new uo(this.model,this.services),new Me(this.model,this.services,m,{direction:Ct.COLUMN})]}}class _e extends Ke{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:wP,curves:CP,zoom:AP}),this.model=new hr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",V.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===V.BOTTOM&&o===nt.TIME,c=this.services.zoom.isZoomBarLocked(V.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new As(this.model,this.services)],growth:ct.STRETCH},h={id:"toolbar",components:[new co(this.model,this.services)],growth:ct.PREFERRED},p={id:"header",components:[new Me(this.model,this.services,[d,...s?[h]:[]],{direction:Ct.ROW,alignItems:Yn.CENTER})],growth:ct.PREFERRED},f={id:"legend",components:[new du(this.model,this.services)],growth:ct.PREFERRED};l&&!c&&t.push(new Dg(this.model,this.services),new Hk(this.model,this.services)),t.push(new Gk(this.model,this.services)),t.push(new Fk(this.model,this.services));const g={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:rt.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Ct.COLUMN;if(m){const O=y(this.model.getOptions(),"legend","position");O===$r.LEFT?(v=Ct.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Mr.VERTICAL)):O===$r.RIGHT?(v=Ct.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Mr.VERTICAL)):O===$r.BOTTOM&&(v=Ct.COLUMN_REVERSE)}const x={id:"spacer",components:[new Dn(this.model,this.services)],growth:ct.PREFERRED},_={id:"full-frame",components:[new Me(this.model,this.services,[...m?[f]:[],...m?[x]:[],g],{direction:v})],growth:ct.STRETCH},E={id:"zoom-bar",components:[new Vk(this.model,this.services)],growth:ct.PREFERRED,renderType:rt.SVG},b=[];if(u||s){b.push(p);const O={id:"spacer",components:[new Dn(this.model,this.services,s?{size:15}:void 0)],growth:ct.PREFERRED};b.push(O)}return l&&b.push(E),b.push(_),[new Pg(this.model,this.services),new uo(this.model,this.services),new Me(this.model,this.services,b,{direction:Ct.COLUMN})]}}class s3 extends Ke{constructor(t,n){super(t,n),this.model=new Qw(this.services),this.model.setOptions(It(At.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new cD(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class a3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(gn(At.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new zn(this.model,this.services),new pi(this.model,this.services),new Wg(this.model,this.services),new un(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class o3 extends _e{constructor(t,n){super(t,n),this.model=new Jw(this.services),this.model.setOptions(It(At.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new dD(this.model,this.services),new fi(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class l3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new zn(this.model,this.services),new pD(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class c3 extends _e{constructor(t,n){super(t,n),this.model=new t$(this.services),this.model.setOptions(It(At.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new fD(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class u3 extends Ke{constructor(t,n){super(t,n),this.model=new e$(this.services),this.model.setOptions(It(At.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 As(this.model,this.services)],growth:ct.STRETCH},o={id:"toolbar",components:[new co(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new Me(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:Yn.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new Zg(this.model,this.services,{chartType:"choropleth"})],growth:ct.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:rt.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,p={id:"spacer",components:[new Dn(this.model,this.services,{size:15})],growth:ct.PREFERRED},f={id:"full-frame",components:[new Me(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Dn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(f),[new pu(this.model,this.services),new uo(this.model,this.services),new Me(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new AN(this.model,this.services)];return this.getChartComponents(t)}}class h3 extends Ke{constructor(t,n){super(t,n),this.model=new n$(this.services),this.model.setOptions(It(At.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new kD(this.model,this.services)];return this.getChartComponents(t)}}const jv={[Ee.LINE]:[pi,un],[Ee.SCATTER]:[un],[Ee.AREA]:[Wg,pi,un],[Ee.STACKED_AREA]:[nv,pi,iv,mo],[Ee.SIMPLE_BAR]:[ev],[Ee.GROUPED_BAR]:[tv,fi],[Ee.STACKED_BAR]:[rv,mo]};class d3 extends _e{constructor(t,n){super(t,n);const r=It(At.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Ee.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(jv).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=`${i3(i.type)}Chart`;return a=ot({},At[l],this.model.getOptions(),i.options),i.type===Ee.STACKED_AREA&&(o=!0),jv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ot({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Eu(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Ee.STACKED_BAR||i.type===Ee.STACKED_AREA),r=[new xe(this.model,this.services),new Ce(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.GRID}),...n?[]:[new zn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class Wv extends Ke{constructor(t,n,r=!1){super(t,n),this.model=new r$(this.services),!r&&(this.model.setOptions(It(At.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Kg(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.PIE})];return this.getChartComponents(t)}}class p3 extends Wv{constructor(t,n){super(t,n,!0),this.model.setOptions(It(At.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new RD(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.DONUT})];return this.getChartComponents(t)}}class f3 extends Ke{constructor(t,n){super(t,n),this.model=new i$(this.services),this.model.setOptions(It(At.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new ID(this.model,this.services)];return this.getChartComponents(t)}}class m3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new tv(this.model,this.services),new fi(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class g3 extends _e{constructor(t,n){super(t,n),this.model=new s$(this.services),this.model.setOptions(It(At.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 As(this.model,this.services)],growth:ct.STRETCH},o={id:"toolbar",components:[new co(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new Me(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:Yn.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new Zg(this.model,this.services,{chartType:"heatmap"})],growth:ct.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:rt.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,p={id:"spacer",components:[new Dn(this.model,this.services,{size:15})],growth:ct.PREFERRED},f={id:"full-frame",components:[new Me(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Dn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(f),[new Pg(this.model,this.services),new uo(this.model,this.services),new Me(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new xe(this.model,this.services),new ND(this.model,this.services)];return this.getAxisChartComponents(t)}}class v3 extends _e{constructor(t,n){super(t,n),this.model=new a$(this.services),this.model.setOptions(It(At.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new TD(this.model,this.services),new PD(this.model,this.services)];return this.getAxisChartComponents(t)}}class y3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new zn(this.model,this.services),new pi(this.model,this.services),new un(this.model,this.services,{handleThresholds:!0}),new VD(this.model,this.services),new fi(this.model,this.services)];return this.getAxisChartComponents(t)}}class b3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new zn(this.model,this.services),new BD(this.model,this.services),new un(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class x3 extends Ke{constructor(t,n){super(t,n),this.model=new o$(this.services);const r=n.options.meter?.proportional?ot(gn(At.proportionalMeterChart),n.options):ot(gn(At.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const t=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new LD(this.model,this.services)],growth:ct.STRETCH,renderType:rt.SVG},{id:"spacer",components:[new Dn(this.model,this.services,{size:8})],growth:ct.STRETCH}]:[],{id:"meter-graph",components:[new UD(this.model,this.services)],growth:ct.STRETCH,renderType:rt.SVG}],n=[new Me(this.model,this.services,t,{direction:Ct.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:rt.HTML})}}class _3 extends Ke{constructor(t,n){super(t,n),this.model=new l$(this.services),this.model.setOptions(It(At.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new HD(this.model,this.services)];return this.getChartComponents(t)}}class E3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new zn(this.model,this.services),new un(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class T3 extends Ke{constructor(t,n){super(t,n),this.model=new c$(this.services),this.model.setOptions(It(At.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new GD(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class O3 extends Ke{constructor(t,n){super(t,n),this.model=new u$(this.services),this.model.setOptions(It(At.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new vN(this.model,this.services)];return this.getChartComponents(t)}}class S3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new ev(this.model,this.services),new fi(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class w3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new mo(this.model,this.services),new nv(this.model,this.services),new pi(this.model,this.services,{stacked:!0}),new iv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class $3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new mo(this.model,this.services),new rv(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.VERT_OR_HORIZ}),new fi(this.model,this.services)];return this.getAxisChartComponents(t)}}class M3 extends Ke{constructor(t,n){super(t,n),this.model=new h$(this.services),this.model.setOptions(It(At.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new MN(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.PIE})];return this.getChartComponents(t)}}class Rt extends xt.PureComponent{chart;chartRef=xt.createRef();createChart(t,n,r){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(t){this.props.data!==t.data&&this.chart?.model.setData(this.props.data),this.props.options!==t.options&&this.chart?.model.setOptions(this.props.options)}render(){return xt.createElement("div",{ref:this.chartRef,className:"chart-holder"})}}class C3 extends Rt{createChart(t,n,r){return new s3(t,{data:n,options:r})}}class A3 extends Rt{createChart(t,n,r){return new a3(t,{data:n,options:r})}}class L3 extends Rt{createChart(t,n,r){return new o3(t,{data:n,options:r})}}class k3 extends Rt{createChart(t,n,r){return new l3(t,{data:n,options:r})}}class D3 extends Rt{createChart(t,n,r){return new c3(t,{data:n,options:r})}}class qv extends Rt{createChart(t,n,r){return new u3(t,{data:n,options:r})}}class R3 extends Rt{createChart(t,n,r){return new h3(t,{data:n,options:r})}}class I3 extends Rt{createChart(t,n,r){return new d3(t,{data:n,options:r})}}class N3 extends Rt{createChart(t,n,r){return new p3(t,{data:n,options:r})}}class P3 extends Rt{createChart(t,n,r){return new f3(t,{data:n,options:r})}}class B3 extends Rt{createChart(t,n,r){return new m3(t,{data:n,options:r})}}class U3 extends Rt{createChart(t,n,r){return new g3(t,{data:n,options:r})}}class H3 extends Rt{createChart(t,n,r){return new v3(t,{data:n,options:r})}}class V3 extends Rt{createChart(t,n,r){return new y3(t,{data:n,options:r})}}class G3 extends Rt{createChart(t,n,r){return new b3(t,{data:n,options:r})}}class F3 extends Rt{createChart(t,n,r){return new x3(t,{data:n,options:r})}}class z3 extends Rt{createChart(t,n,r){return new Wv(t,{data:n,options:r})}}class j3 extends Rt{createChart(t,n,r){return new _3(t,{data:n,options:r})}}class W3 extends Rt{createChart(t,n,r){return new E3(t,{data:n,options:r})}}class q3 extends Rt{createChart(t,n,r){return new S3(t,{data:n,options:r})}}class Y3 extends Rt{createChart(t,n,r){return new w3(t,{data:n,options:r})}}class X3 extends Rt{createChart(t,n,r){return new $3(t,{data:n,options:r})}}class Z3 extends Rt{createChart(t,n,r){return new T3(t,{data:n,options:r})}}class K3 extends Rt{createChart(t,n,r){return new O3(t,{data:n,options:r})}}class Q3 extends Rt{createChart(t,n,r){return new M3(t,{data:n,options:r})}}function J3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ru={exports:{}};/*!
74
+ </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=R(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=[],h=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:vt(p,"locale.translations.total")||vt(p,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else h=r.value;const d=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:d,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:h},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=R(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=R(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=R(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");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Fr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Fr),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 kk(e,t){const n=ji(this._current,e);return r=>(this._current=n(r),t(this._current))}class Kg extends gt{constructor(){super(...arguments),this.type="pie",this.renderType=rt.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 Dt.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(L=>L[a]>0),l=this.computeRadius();this.arc=Os().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Os().innerRadius(this.getInnerRadius()).outerRadius(l+Dt.hoverArc.outerRadiusOffset);const c=iD().value(L=>L[a]).sort(y(i,"pie","sortFunction")).padAngle(Dt.padAngle)(o),u=I.appendOrSelect(r,"g.slices").attr("role",dt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,L=>L.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",L=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:L.data[s],originalClassName:"slice"})).style("fill",L=>n.model.getFillColor(L.data[s],null,L.data)).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>[L[a],Fl(L.data[a],o,a)+"%",L.data[s]].filter(Boolean).join(", ")).attrTween("d",function(L){return kk.bind(this)(L,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:h,number:d}=y(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(L=>L.data[a]>0):[],g=I.appendOrSelect(r,"g.labels").attr("role",dt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,L=>L.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(L=>i.pie.labels.formatter?i.pie.labels.formatter({...L,percentageValue:Fl(L.data[a],o,a,!0)}):d(Fl(L.data[a],o,a),h)+"%").datum(function(L){const N=l+7,M=(L.endAngle-L.startAngle)/2+L.startAngle,V=M/Math.PI*180,k=this.getComputedTextLength();return L.textOffsetX=k/2,L.textOffsetY=V>90&&V<270?10:0,L.xPosition=(L.textOffsetX+N)*Math.sin(M),L.yPosition=(L.textOffsetY+N)*-Math.cos(M),L}).attr("transform",function(L,N){const M=f.length,V=(L.endAngle-L.startAngle)*(180/Math.PI);if(N>=M-2&&V<Dt.callout.minSliceDegree){let k,H;return L.index===M-1?(k=L.xPosition+Dt.callout.offsetX+Dt.callout.textMargin+L.textOffsetX,H=L.yPosition-Dt.callout.offsetY,L.direction=_i.RIGHT,v.push(L)):(k=L.xPosition-Dt.callout.offsetX-L.textOffsetX-Dt.callout.textMargin,H=L.yPosition-Dt.callout.offsetY,L.direction=_i.LEFT,v.push(L)),`translate(${k}, ${H})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(v);const b=y(i,"donut")?"donut":"pie",_=y(i,b,"alignment"),{width:E}=I.getSVGElementSize(this.getParent(),{useAttrs:!0}),x=p?Dt.xOffset:0,O=p?Dt.yOffset:0;let A=l+x;_===jt.CENTER?A=E/2:_===jt.RIGHT&&(A=E-l-Dt.xOffset);let D=l+O;v.length>0&&(D+=Dt.yOffsetCallout),r.attr("x",A+7).attr("y",D),this.addEventListeners()}renderCallouts(t){const n=I.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",dt.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",dt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===_i.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Dt.callout.offsetX,y:o-Dt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Dt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Dt.callout.offsetX,y:o-Dt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Dt.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return R(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 R(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=R(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:R(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=R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);SC(()=>{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}=I.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Dt.radiusOffset:i}}class Rk extends Kg{constructor(){super(...arguments),this.type="donut",this.renderType=rt.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=I.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");I.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(R(this))}),a!==null&&a!==""&&I.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=Vd:s=Te;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 Qg="4,10 8,6 12,10",Jg="12,6 8,10 4,6";class Ik extends gt{constructor(){super(...arguments),this.type="gauge",this.renderType=rt.SVG}getValue(){return this.model.getData().find(t=>t.group==="value")?.value??null}getValueRatio(){return nm(this.getValue(),0,100)/100}getDelta(){return this.model.getData().find(t=>t.group==="delta")?.value??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===Zn.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 Ns.UP:return Qg;case Ns.DOWN:return Jg;default:return t>0?Qg:Jg}}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,h=this.computeRadius(),d=this.getInnerRadius();this.backgroundArc=Os().innerRadius(d).outerRadius(h).startAngle(c).endAngle(u),this.arc=Os().innerRadius(d).outerRadius(h).startAngle(o).endAngle(c),I.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",dt.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}=I.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=h;f===jt.CENTER?m=g/2:f===jt.RIGHT&&(m=g-h),n.attr("x",m).attr("y",h),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 h=0;r===Zn.FULL&&!s?h=l(a):r===Zn.SEMI&&s&&(h=-(l(a)+c));const d=I.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${h})`),p=o(a),f=I.appendOrSelect(d,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),b=f.selectAll("text.gauge-value-number").data([i]);b.enter().append("text").attr("class","gauge-value-number").merge(b).style("font-size",`${p}px`).attr("text-anchor","middle").text(L=>{let N;return L!=null?N=Number(L.toFixed(2))%1!==0?L.toFixed(2):L.toFixed():N=0,v?v(N):m(Number(N),g)});const{width:_}=I.getSVGElementSize(I.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),E=p/2,x=u?"%":"",O=I.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${E}px`).attr("x",_/2).text(x),{width:A,height:D}=I.getSVGElementSize(O,{useBBox:!0});O.attr("y",`-${D/2}px`),f.attr("transform",`translate(-${A/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"),h=y(r,"gauge","numberSpacing"),d=y(r,"gauge","showPercentageSymbol"),p=I.appendOrSelect(n,"g.gauge-numbers"),f=I.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+h})`),g=I.appendOrSelect(f,"text.gauge-delta-number"),m=d?"%":"";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 x;return E!=null?x=Number(E.toFixed(2))%1!==0?E.toFixed(2):E.toFixed():x=0,c?`${c(x)}${m}`:`${a(Number(x),s)}${m}`});const{width:v}=I.getSVGElementSize(I.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),b=y(r,"gauge","deltaArrow","enabled"),_=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&b?[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=R(this);I.appendOrSelect(E,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=y(r,"gauge","status");I.appendOrSelect(E,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").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:R(this),datum:r})}).on("mousemove",function(n,r){const i=R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(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}=I.getSVGElementSize(this.parent,{useAttrs:!0});return n===Zn.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class tv extends xu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=rt.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=Hi(n.map(u=>{const h=this.services.cartesianScales.getDomainIdentifier(u);return u[h]&&typeof u[h].toString=="function"?u[h].toString():u[h]})),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",dt.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 h=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth(u)/2;return this.services.cartesianScales.getOrientation()===zt.VERTICAL?`translate(${h}, 0)`:`translate(0, ${h})`});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 h=this.services.cartesianScales.getDomainIdentifier(u);return this.model.getFillColor(u[i],u[h],u)}).attr("d",u=>{const h=this.services.cartesianScales.getDomainIdentifier(u),d=u[h]&&typeof u[h].toString=="function"?u[h].toString():u[h],p=this.getGroupScaleForLabel(d)(u[i]),f=this.getBarWidth(),g=p,m=p+f,v=this.services.cartesianScales.getRangeAxisPosition({datum:u}),b=this.services.cartesianScales.getDomainLowerBound(v),_=this.services.cartesianScales.getValueThroughAxisPosition(v,b),E=this.services.cartesianScales.getRangeValue(u),x=this.services.cartesianScales.getDomainValue(u)-f/2,O=x+f;if(!this.isOutsideZoomedDomain(x,O))return le({x0:g,x1:m,y0:_,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this,n=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),r=this.parent.selectAll("path.bar");n?r.style("pointer-events","none"):r.style("pointer-events",null),r.on("mouseover",function(i,s){const a=R(this);a.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s}),n||t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[s]})}).on("mousemove",function(i,s){const a=R(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:R(this),datum:s})}).on("mouseout",function(i,s){const a=R(this);a.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}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(t){const n=this.getOptions();if(y(n,"bars","preserveSpaceForMissingBars")===!1&&t){const s=this.getDataCorrespondingToLabel(t),a=this.getTotalGroupPadding(s.length);return this.getBarWidth()*s.length+a}const r=this.model.getGroupedData(this.configs.groups),i=this.getTotalGroupPadding();return this.getBarWidth()*r.length+i}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=>s.data?.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(t){const n=this.model.getGroupedData(this.configs.groups),r=t!==void 0?t:n.length;return r===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(r-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=Yr().domain(t).rangeRound([0,this.getGroupWidth()])}getGroupScaleForLabel(t){const n=this.getOptions();if(y(n,"bars","preserveSpaceForMissingBars")===!1){const r=this.getDataCorrespondingToLabel(t),{groupMapsTo:i}=n.data,s=r.map(a=>a[i]);return Yr().domain(s).rangeRound([0,this.getGroupWidth(t)])}return this.groupScale}}class Nk extends gt{constructor(){super(...arguments),this.type="heatmap",this.renderType=rt.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="",h=null,d=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(h===null){h=g,d=g,p=g;return}h+=g,d=g<d?g:d,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(h===null){h=g,d=g,p=g;return}h+=g,d=g<d?g:d,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)}, ${Pn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Pn(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:R(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:d!==null?d:"-"},{label:"Max",value:p!==null?p:"-"},{label:"Average",value:h!==null?h/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(),h=i.range(),d=s.range();this.xBandwidth=Math.abs((h[1]-h[0])/l.length),this.yBandwidth=Math.abs((d[1]-d[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(d[1]-d[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(h[1]-h[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=I.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);I.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),I.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),I.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),I.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!==Cr.OFF&&(t===Cr.AUTO&&vp.minCellDividerDimension<=this.xBandwidth&&vp.minCellDividerDimension<=this.yBandwidth||t===Cr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=vt(r,"locale.translations.total")||vt(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 h=R(this),d=h.select("rect.heat");if(!d.classed("null-state")){const p=Ji(h.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:d,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:d.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:R(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:R(this),datum:u})}).on("mouseout",function(c,u){const h=R(this).select("rect.heat"),d=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),d||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{event:c,hoveredElement:h}))})}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 Pk extends gt{constructor(){super(...arguments),this.type="histogram",this.renderType=rt.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=>vt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",dt.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,h)=>h).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 h=vt(u,"data");if(!h)return;const d=o(h.x1)-o(h.x0)-1,p=this.services.cartesianScales.getDomainValue(h.x0),f=p+d,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()===zt.VERTICAL?m+=1:m-=1),le({x0:p,x1:f,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.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=y(t,"tooltip","alwaysShowRulerTooltip"),a=this.parent.selectAll("path.bar");s?a.style("pointer-events","none"):a.style("pointer-events",null);const o=this;a.on("mouseover",function(l,c){const u=R(this);u.classed("hovered",!0);const h=i(parseFloat(vt(c,"data.x0")),r),d=i(parseFloat(vt(c,"data.x1")),r),p=o.services.cartesianScales.getRangeAxisPosition(),f=o.services.cartesianScales.getScaleLabel(p);s||o.services.events.dispatchEvent(T.Tooltip.SHOW,{event:l,hoveredElement:u,items:[{label:vt(t,"bins.rangeLabel")||"Range",value:`${h} – ${d}`},{label:t.tooltip.groupLabel||"Group",value:c[n],class:o.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:c[n]})},{label:f,value:vt(c,`data.${c[n]}`)}]})}).on("mousemove",function(l){o.services.events.dispatchEvent(T.Tooltip.MOVE,{event:l})}).on("mouseout",function(){R(this).classed("hovered",!1),o.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 Uk extends un{constructor(){super(...arguments),this.type="lollipop",this.renderType=rt.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]?_n.weight.unselected:_n.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",_n.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?_n.opacity.unselected:_n.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",_n.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),h=s.getOrientation(),[d,p]=On(c,u,h),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);h===zt.HORIZONTAL?g.attr("y1",p).attr("y2",p).attr("x1",a.range()[0]).attr("x2",m=>d(m)-r.points.radius):g.attr("x1",d).attr("x2",d).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 Bk extends gt{constructor(){super(...arguments),this.type="meter",this.renderType=rt.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)-te.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-te.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}=I.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 h=Ye().domain([0,u]).range([0,l]),d=this.getStackedBounds(a,h),p=y(i,"meter","height");I.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(s?te.height.proportional:te.height.default)),I.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(s?te.height.proportional:te.height.default));const f=r.selectAll("rect.value").data(d),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?te.height.proportional:te.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?h(u):Math.max(_.width,2)).style("fill",_=>n.model.getFillColor(_[c],null,_)).attr("role",dt.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 b=r.selectAll("line.peak").data(v==null?[]:[v]);b.enter().append("line").classed("peak",!0).merge(b).attr("y1",0).attr("y2",()=>p||(s?te.height.proportional:te.height.default)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"peak-line-update",animate:t})).attr("x1",_=>h(_)).attr("x2",_=>h(_)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",_=>_),b.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=R(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=R(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:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(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 Hk extends gt{constructor(){super(...arguments),this.type="radar",this.renderType=rt.SVG,this.getLabelDimensions=t=>{const n=I.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=I.appendOrSelect(n,"text").text(t),{width:i,height:s}=I.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=AC(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ot(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:ot(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?lr.opacity.unselected:lr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?lr.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",lr.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}=I.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:h}=y(o,"radar","axes"),{xLabelPadding:d,yLabelPadding:p,yTicksNumber:f,minRange:g,xAxisRectHeight:m}=lr;this.uniqueKeys=Array.from(new Set(s.map(w=>w[u]))),this.uniqueGroups=Array.from(new Set(s.map(w=>w[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),b=(Math.min(r,i)-v)/2;if(b<=0)return;const _=Yr().domain(this.fullDataNormalized.map(w=>w[u])).range([0,2*Math.PI].map(w=>w-Math.PI/2)),E=Pn(this.fullDataNormalized.map(w=>w[h])),x=y(o,"radar","maxValue"),O=rr(this.fullDataNormalized.map(w=>w[h]));let A=O;x!==void 0&&(x>=O?A=x:console.warn(`Carbon Charts - Radar: Custom maxValue (${x}) is less than the maximum data value (${O}). Using data maximum to prevent clipping.`));const D=Ye().domain([E>=0?0:E,A]).range([g,b]).nice(f),L=D.ticks(f),N=(w,C,P)=>this.model.getFillColor(w,C,P),M=oD().angle(w=>_(w[u])+Math.PI/2).radius(w=>D(w[h])).curve(_f),V=this.uniqueKeys.map(w=>{const C=this.getLabelDimensions(w).width,P=R2(_(w),b);return C+P}),k={x:rr(V)+d,y:i/2},H=I.appendOrSelect(n,"g.y-axes").attr("role",dt.GROUP).selectAll("path").data(L,w=>w),S=w=>this.uniqueKeys.map(C=>({[u]:C,[h]:w}));H.join(w=>w.append("path").attr("opacity",0).attr("transform",`translate(${k.x}, ${k.y})`).attr("fill","none").call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",P=>M(S(P)))),w=>w.call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",P=>M(S(P)))),w=>w.call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_axes_exit",animate:t})).attr("d",P=>M(S(P))).attr("opacity",0).remove())),I.appendOrSelect(n,"g.x-axes").attr("role",dt.GROUP).selectAll("line").data(this.uniqueKeys,w=>w).join(w=>w.append("line").attr("opacity",0).attr("class",C=>`x-axis-${ei(C)}`).attr("stroke-dasharray","0").attr("x1",C=>Bt(_(C),0,k).x).attr("y1",C=>Bt(_(C),0,k).y).attr("x2",C=>Bt(_(C),0,k).x).attr("y2",C=>Bt(_(C),0,k).y).call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",P=>Bt(_(P),D.range()[0],k).x).attr("y1",P=>Bt(_(P),D.range()[0],k).y).attr("x2",P=>Bt(_(P),D.range()[1],k).x).attr("y2",P=>Bt(_(P),D.range()[1],k).y)),w=>w.call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",P=>Bt(_(P),D.range()[0],k).x).attr("y1",P=>Bt(_(P),D.range()[0],k).y).attr("x2",P=>Bt(_(P),D.range()[1],k).x).attr("y2",P=>Bt(_(P),D.range()[1],k).y)),w=>w.call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),I.appendOrSelect(n,"g.x-labels").attr("role",dt.GROUP).selectAll("text").data(this.uniqueKeys).join(w=>w.append("text").text(C=>C).attr("opacity",0).attr("x",C=>Bt(_(C),D.range()[1]+d,k).x).attr("y",C=>Bt(_(C),D.range()[1]+d,k).y).style("text-anchor",C=>Nf(_(C)).textAnchor).style("dominant-baseline",C=>Nf(_(C)).dominantBaseline).call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),w=>w.call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",P=>Bt(_(P),D.range()[1]+d,k).x).attr("y",P=>Bt(_(P),D.range()[1]+d,k).y).end().finally(()=>{const P=y(o,"radar","alignment"),W=this.getAlignmentXOffset(P,n,this.getParent());n.attr("x",W)})),w=>w.call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),I.appendOrSelect(n,"g.blobs").attr("role",dt.GROUP).selectAll("path").data(this.groupedDataNormalized,w=>w.name).join(w=>w.append("path").attr("class",C=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:C.name,originalClassName:"blob"})).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",C=>C.name).attr("opacity",0).attr("transform",t?()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`:`translate(${k.x}, ${k.y})`).style("fill",C=>N(C.name,null,C.data)).style("fill-opacity",lr.opacity.selected).style("stroke",C=>N(C.name,null,C.data)).call(C=>{const P=C.transition().call(W=>this.services.transitions.setupTransition({transition:W,name:"radar_blobs_enter",animate:t}));t&&P.delay(()=>Math.random()*30).attr("transform",`translate(${k.x}, ${k.y})`),P.attr("opacity",1).attr("d",W=>M(W.data))}),w=>(w.attr("class",C=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:C.name,originalClassName:"blob"})).style("fill",C=>N(C.name,null,C.data)).style("stroke",C=>N(C.name,null,C.data)),w.call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",P=>M(P.data))),w),w=>w.call(C=>{const P=C.transition().call(W=>this.services.transitions.setupTransition({transition:W,name:"radar_blobs_exit",animate:t}));t&&P.delay(()=>Math.random()*30).attr("transform",()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`),P.attr("opacity",0).remove()})),I.appendOrSelect(n,"g.dots").attr("role",dt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(w=>y(w,h)!==null)).join(w=>w.append("circle").attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",C=>C[c]),w=>w,w=>w.remove()).attr("class",w=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:w[l],originalClassName:ei(w[u])})).attr("cx",w=>Bt(_(w[u]),D(w[h]),k).x).attr("cy",w=>Bt(_(w[u]),D(w[h]),k).y).attr("r",0).attr("opacity",0).style("fill",w=>N(w[l])),I.appendOrSelect(n,"g.x-axes-rect").attr("role",dt.GROUP).selectAll("rect").data(this.uniqueKeys).join(w=>w.append("rect"),w=>w,w=>w.remove()).attr("x",k.x).attr("y",k.y-m/2).attr("width",D.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",w=>`rotate(${Pf(_(w))}, ${k.x}, ${k.y})`);const{code:U,number:B}=y(o,"locale");I.appendOrSelect(n,"g.y-labels").attr("role",dt.GROUP).selectAll("text").data(je(L)).join(w=>w.append("text").attr("opacity",0).text(C=>B(C,U)).attr("x",C=>Bt(-Math.PI/2,D(C),k).x+p).attr("y",C=>Bt(-Math.PI/2,D(C),k).y).style("text-anchor","start").style("dominant-baseline","middle").call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),w=>w.call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_labels_update",animate:t})).text(P=>P).attr("opacity",1).attr("x",P=>Bt(-Math.PI/2,D(P),k).x+p).attr("y",P=>Bt(-Math.PI/2,D(P),k).y)),w=>w.call(C=>C.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=I.getSVGElementSize(n,{useBBox:!0}),{width:s}=I.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===jt.CENTER?a=Math.floor((s-i.width)/2):t===jt.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=R(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-${ei(i)}`),o=t.parent.selectAll(`.dots circle.${ei(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,h=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",lr.dotsRadius);const d=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:d.filter(p=>typeof p[h]=="number").map(p=>({label:p[u],value:p[h],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=R(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:R(this),datum:i})}).on("mouseout",function(r,i){const s=R(this),a=t.parent.select(`.x-axes .x-axis-${ei(i)}`),o=t.parent.selectAll(`.dots circle.${ei(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 ev extends xu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=rt.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(),h=l[c],d=this.services.cartesianScales.getDomainValue(l)-u/2,p=d+u;let f,g;if(Array.isArray(h)&&h.length===2)f=this.services.cartesianScales.getRangeValue(h[0]),g=this.services.cartesianScales.getRangeValue(h[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&&(h>0&&a===zt.VERTICAL||h<0&&a===zt.HORIZONTAL?g=f-2:g=f+2),!this.isOutsideZoomedDomain(d,p))return le({x0:d,x1:p,y0:f,y1:g},a)}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this,n=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),r=this.parent.selectAll("path.bar");n?r.style("pointer-events","none"):r.style("pointer-events",null),r.on("mouseover",function(i,s){const a=R(this);a.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s}),n||t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[s]})}).on("mousemove",function(i,s){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:R(this),datum:s}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:R(this),datum:s})}).on("mouseout",function(i,s){const a=R(this);a.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}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 Vk extends de{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=I.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=I.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("role","presentation"),I.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class nv extends gt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=rt.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?xn.opacity.unselected:xn.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",xn.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}),h=this.services.cartesianScales.getScaleByPosition(u),d=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=ru().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>h(p[0])).y1(p=>h(p[1])).curve(this.services.curves.getD3Curve()),d.exit().attr("opacity",0).remove(),d.enter().append("path").attr("opacity",0).merge(d).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",dt.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",xn.opacity.selected).attr("d",this.areaGenerator)}}class rv extends xu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=rt.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",dt.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,h=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(u)-h/2,p=d+h,f=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(d,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()===zt.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===zt.VERTICAL?g+=1:g-=1)}return le({x0:d,x1:p,y0:f,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",dt.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=y(t,"tooltip","alwaysShowRulerTooltip"),i=this.parent.selectAll("path.bar");r?i.style("pointer-events","none"):i.style("pointer-events",null);const s=this;i.on("mouseover",function(a,o){const l=R(this);l.classed("hovered",!0),s.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:a,element:l,datum:o});let c=s.model.getDisplayData(s.configs.groups).find(u=>{const h=s.services.cartesianScales.getDomainIdentifier(u),d=s.services.cartesianScales.getRangeIdentifier(u);return u[d]===o.data[o[n]]&&u[h].toString()===o.data.sharedStackKey&&u[n]===o[n]});if(c===void 0){const u=s.services.cartesianScales.getDomainIdentifier(),h=s.services.cartesianScales.getRangeIdentifier();c={[u]:o.data.sharedStackKey,[h]:o.data[o[n]],[n]:o[n]}}r||s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,data:[c]})}).on("mousemove",function(a,o){const l=R(this);s.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:a,element:l,datum:o}),s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(a,o){s.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:a,element:R(this),datum:o})}).on("mouseout",function(a,o){const l=R(this);l.classed("hovered",!1),s.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:a,element:l,datum:o}),s.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:l})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=I.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 iv extends un{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=rt.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",dt.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 h=u[i],d=this.services.cartesianScales.getDomainIdentifier(u),p=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:h,[d]: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,h)=>{const d=u[i],p=u.data.sharedStackKey;let f=u.data[d];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][h].data[d]),f!==null&&o.push({[i]:d,[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(h=>h[i]==l[i]&&h[c]==l[c]&&h[u]==l[u])!==void 0})}}const mi=6;class Gk extends gt{constructor(){super(...arguments),this.type="tree",this.renderType=rt.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}=I.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}=I.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),h={left:l>0?l+mi:30-mi},d=xs({name:o,children:a}),p=10,f=r/6,g=O=>{const A=d.descendants().reverse(),D=d.links();let L=d,N=d;d.eachBefore(w=>{w.x<L.x&&(L=w),w.x>N.x&&(N=w)});const M=N.x-L.x,V=n.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-h.left,L.x,r,M].join(" ")),k=x.selectAll("g").data(A,w=>w.id),H=this,S=k.enter().append("g").attr("transform",()=>`translate(${O.y0},${O.x0})`).attr("class",w=>w.depth!==0&&w.children&&w.children.length>0?"clickable":null).on("mouseover",function(w,C){H.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:w,element:R(this),datum:C})}).on("click",function(w,C){C.depth!==0&&(C.children=C.children?null:C._children,g(C)),H.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:w,element:R(this),datum:C})}).on("mouseout",function(w,C){H.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:w,element:R(this),datum:C})});S.append("circle").attr("r",2.5).attr("class",w=>w._children?"parent":"child").attr("stroke-width",10),S.append("text").attr("dy","0.31em").attr("x",w=>w._children?-mi:mi).attr("text-anchor",w=>w._children?"end":"start").text(w=>w.data.name).clone(!0).attr("class","text-stroke").lower(),k.merge(S).transition(V).attr("transform",w=>`translate(${w.y},${w.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),k.exit().transition(V).remove().attr("transform",()=>`translate(${O.y},${O.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const U=E.selectAll("path").data(D,w=>w.target.id),B=U.enter().append("path").attr("d",()=>{const w={x:O.x0,y:O.y0};return _({source:w,target:w})});U.merge(B).transition(V).attr("d",_),U.exit().transition(V).remove().attr("d",()=>{const w={x:O.x,y:O.y};return _({source:w,target:w})}),d.eachBefore(w=>{w.x0=w.x,w.y0=w.y})},m=d.descendants(),v=m[m.length-1].depth,b=y(s,"tree","type")===Is.DENDROGRAM?rL().size([i,r-u-v*mi-l]):zL().nodeSize([p,f]).size([i,r-u-v*mi-l]),_=pD().x(O=>O.y).y(O=>O.x);d.x0=f/2,d.y0=0,d.descendants().forEach((O,A)=>{O.id=A,O._children=O.children}),b(d),n.attr("viewBox",[-h.left,-0,r,p]).style("user-select","none");const E=n.append("g").attr("class","links"),x=n.append("g").attr("class","nodes");g(d)}}var Fk="#000000",zk="#ffffff",jk="#fcf4d6",Wk="#fddc69",qk="#f1c21b",Yk="#d2a106",Zk="#b28600",Xk="#8e6a00",Kk="#684e00",Qk="#483700",Jk="#302400",tR="#1c1500",eR={10:jk,20:Wk,30:qk,40:Yk,50:Zk,60:Xk,70:Kk,80:Qk,90:Jk,100:tR},nR="#fff2e8",rR="#ffd9be",iR="#ffb784",sR="#ff832b",aR="#eb6200",oR="#ba4e00",lR="#8a3800",cR="#5e2900",uR="#3e1a00",hR="#231000",dR={10:nR,20:rR,30:iR,40:sR,50:aR,60:oR,70:lR,80:cR,90:uR,100:hR},pR="#fff1f1",fR="#ffd7d9",mR="#ffb3b8",gR="#ff8389",vR="#fa4d56",yR="#da1e28",bR="#a2191f",xR="#750e13",_R="#520408",ER="#2d0709",OR={10:pR,20:fR,30:mR,40:gR,50:vR,60:yR,70:bR,80:xR,90:_R,100:ER},TR="#fff0f7",wR="#ffd6e8",SR="#ffafd2",$R="#ff7eb6",MR="#ee5396",CR="#d02670",AR="#9f1853",LR="#740937",DR="#510224",kR="#2a0a18",RR={10:TR,20:wR,30:SR,40:$R,50:MR,60:CR,70:AR,80:LR,90:DR,100:kR},IR="#f6f2ff",NR="#e8daff",PR="#d4bbff",UR="#be95ff",BR="#a56eff",HR="#8a3ffc",VR="#6929c4",GR="#491d8b",FR="#31135e",zR="#1c0f30",jR={10:IR,20:NR,30:PR,40:UR,50:BR,60:HR,70:VR,80:GR,90:FR,100:zR},WR="#edf5ff",qR="#d0e2ff",YR="#a6c8ff",ZR="#78a9ff",XR="#4589ff",KR="#0f62fe",QR="#0043ce",JR="#002d9c",tI="#001d6c",eI="#001141",nI={10:WR,20:qR,30:YR,40:ZR,50:XR,60:KR,70:QR,80:JR,90:tI,100:eI},rI="#e5f6ff",iI="#bae6ff",sI="#82cfff",aI="#33b1ff",oI="#1192e8",lI="#0072c3",cI="#00539a",uI="#003a6d",hI="#012749",dI="#061727",pI={10:rI,20:iI,30:sI,40:aI,50:oI,60:lI,70:cI,80:uI,90:hI,100:dI},fI="#d9fbfb",mI="#9ef0f0",gI="#3ddbd9",vI="#08bdba",yI="#009d9a",bI="#007d79",xI="#005d5d",_I="#004144",EI="#022b30",OI="#081a1c",TI={10:fI,20:mI,30:gI,40:vI,50:yI,60:bI,70:xI,80:_I,90:EI,100:OI},wI="#defbe6",SI="#a7f0ba",$I="#6fdc8c",MI="#42be65",CI="#24a148",AI="#198038",LI="#0e6027",DI="#044317",kI="#022d0d",RI="#071908",II={10:wI,20:SI,30:$I,40:MI,50:CI,60:AI,70:LI,80:DI,90:kI,100:RI},NI="#f2f4f8",PI="#dde1e6",UI="#c1c7cd",BI="#a2a9b0",HI="#878d96",VI="#697077",GI="#4d5358",FI="#343a3f",zI="#21272a",jI="#121619",WI={10:NI,20:PI,30:UI,40:BI,50:HI,60:VI,70:GI,80:FI,90:zI,100:jI},qI="#f4f4f4",YI="#e0e0e0",ZI="#c6c6c6",XI="#a8a8a8",KI="#8d8d8d",QI="#6f6f6f",JI="#525252",tN="#393939",eN="#262626",nN="#161616",rN={10:qI,20:YI,30:ZI,40:XI,50:KI,60:QI,70:JI,80:tN,90:eN,100:nN},iN="#f7f3f2",sN="#e5e0df",aN="#cac5c4",oN="#ada8a8",lN="#8f8b8b",cN="#726e6e",uN="#565151",hN="#3c3838",dN="#272525",pN="#171414",fN={10:iN,20:sN,30:aN,40:oN,50:lN,60:cN,70:uN,80:hN,90:dN,100:pN},sv={black:{100:Fk},blue:nI,coolGray:WI,cyan:pI,gray:rN,green:II,magenta:RR,orange:dR,purple:jR,red:OR,teal:TI,warmGray:fN,white:{0:zk},yellow:eR};const mN=e=>{if(!e)return null;for(const t of Object.keys(sv)){const n=sv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},av=function(e){const t=R(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=vn(n);let i;if(r&&(i=mN(r?r.hex():null)),i==null){const s=Pd(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let gN=0;class vN extends gt{constructor(){super(...arguments),this.type="treemap",this.renderType=rt.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}=I.getSVGElementSize(n,{useAttrs:!0}),l=xs({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=ZL().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 h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>gN++).merge(u);h.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 d=h.selectAll("rect.leaf").data(p=>[p]);d.exit().attr("width",0).attr("height",0).remove(),d.enter().append("rect").classed("leaf",!0).merge(d).attr("width",0).attr("height",0).attr("id",function(){const p=R(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)}),h.selectAll("clipPath").data(p=>p.data.showLabel!==!0?[]:[1],p=>p).join(p=>p.append("clipPath").attr("id",function(){const f=R(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=R(this.parentNode.parentNode).attr("data-uid"),g=`${i.style.prefix}-leaf-${f}`;return new URL(`#${g}`,s)+""}),p=>null,p=>p.remove()),h.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",av).attr("x",7).attr("y",18);return s&&f.attr("clip-path",function(){const g=R(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",av),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=R(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),vn(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=R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(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 yN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bN(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?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 xN={value:function(){}};function ov(){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 go(n)}function go(e){this._=e}function _N(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}})}go.prototype=ov.prototype={constructor:go,on:function(e,t){var n=this._,r=_N(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=EN(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]=lv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=lv(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 go(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 EN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function lv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=xN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const ON=Object.freeze(Object.defineProperty({__proto__:null,dispatch:ov},Symbol.toStringTag,{value:"Module"})),TN=bN(ON);var _u,cv;function wN(){if(cv)return _u;cv=1;const e=TN.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;_u=function(){var E=[256,256],x=s,O=a,A=l,D=o,L=o,N=c,M=u,V=g,k=[],H=1/0,S=e("word","end"),U=null,B=Math.random,w={},C=b;w.canvas=function(q){return arguments.length?(C=_(q),w):C},w.start=function(){var q=P(C()),K=v((E[0]>>5)*E[1]),ut=null,tt=k.length,X=-1,et=[],at=k.map(function(Y,Q){return Y.text=x.call(this,Y,Q),Y.font=O.call(this,Y,Q),Y.style=D.call(this,Y,Q),Y.weight=L.call(this,Y,Q),Y.rotate=N.call(this,Y,Q),Y.size=~~A.call(this,Y,Q),Y.padding=M.call(this,Y,Q),Y}).sort(function(Y,Q){return Q.size-Y.size});return U&&clearInterval(U),U=setInterval(j,0),j(),w;function j(){for(var Y=Date.now();Date.now()-Y<H&&++X<tt&&U;){var Q=at[X];Q.x=E[0]*(B()+.5)>>1,Q.y=E[1]*(B()+.5)>>1,h(q,Q,at,X),Q.hasText&&W(K,Q,ut)&&(et.push(Q),S.call("word",w,Q),ut?p(ut,Q):ut=[{x:Q.x+Q.x0,y:Q.y+Q.y0},{x:Q.x+Q.x1,y:Q.y+Q.y1}],Q.x-=E[0]>>1,Q.y-=E[1]>>1)}X>=tt&&(w.stop(),S.call("end",w,et,ut))}},w.stop=function(){U&&(clearInterval(U),U=null);for(const q of k)delete q.sprite;return w};function P(q){const K=q.getContext("2d",{willReadFrequently:!0});q.width=q.height=1;const ut=Math.sqrt(K.getImageData(0,0,1,1).data.length>>2);return q.width=(r<<5)/ut,q.height=i/ut,K.fillStyle=K.strokeStyle="red",{context:K,ratio:ut}}function W(q,K,ut){E[0],E[1];for(var tt=K.x,X=K.y,et=Math.sqrt(E[0]*E[0]+E[1]*E[1]),at=V(E),j=B()<.5?1:-1,Y=-j,Q,z,ht;(Q=at(Y+=j))&&(z=~~Q[0],ht=~~Q[1],!(Math.min(Math.abs(z),Math.abs(ht))>=et));)if(K.x=tt+z,K.y=X+ht,!(K.x+K.x0<0||K.y+K.y0<0||K.x+K.x1>E[0]||K.y+K.y1>E[1])&&(!ut||f(K,ut))&&!d(K,q,E[0])){for(var lt=K.sprite,Mt=K.width>>5,Gt=E[0]>>5,it=K.x-(Mt<<4),bt=it&127,He=32-bt,pe=K.y1-K.y0,Ds=(K.y+K.y0)*Gt+(it>>5),gi,vi=0;vi<pe;vi++){gi=0;for(var Rn=0;Rn<=Mt;Rn++)q[Ds+Rn]|=gi<<He|(Rn<Mt?(gi=lt[vi*Mt+Rn])>>>bt:0);Ds+=Gt}return!0}return!1}return w.timeInterval=function(q){return arguments.length?(H=q??1/0,w):H},w.words=function(q){return arguments.length?(k=q,w):k},w.size=function(q){return arguments.length?(E=[+q[0],+q[1]],w):E},w.font=function(q){return arguments.length?(O=_(q),w):O},w.fontStyle=function(q){return arguments.length?(D=_(q),w):D},w.fontWeight=function(q){return arguments.length?(L=_(q),w):L},w.rotate=function(q){return arguments.length?(N=_(q),w):N},w.text=function(q){return arguments.length?(x=_(q),w):x},w.spiral=function(q){return arguments.length?(V=n[q]||q,w):V},w.fontSize=function(q){return arguments.length?(A=_(q),w):A},w.padding=function(q){return arguments.length?(M=_(q),w):M},w.random=function(q){return arguments.length?(B=q,w):B},w.on=function(){var q=S.on.apply(S,arguments);return q===S?w:q},w};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 h(E,x,O,A){if(!x.sprite){var D=E.context,L=E.ratio;D.clearRect(0,0,(r<<5)/L,i/L);var N=0,M=0,V=0,k=O.length;for(--A;++A<k;){x=O[A],D.save(),D.font=x.style+" "+x.weight+" "+~~((x.size+1)/L)+"px "+x.font;const Q=D.measureText(x.text),z=-Math.floor(Q.width/2);let ht=(Q.width+1)*L,lt=x.size<<1;if(x.rotate){var H=Math.sin(x.rotate*t),S=Math.cos(x.rotate*t),U=ht*S,B=ht*H,w=lt*S,C=lt*H;ht=Math.max(Math.abs(U+C),Math.abs(U-C))+31>>5<<5,lt=~~Math.max(Math.abs(B+w),Math.abs(B-w))}else ht=ht+31>>5<<5;if(lt>V&&(V=lt),N+ht>=r<<5&&(N=0,M+=V,V=0),M+lt>=i)break;D.translate((N+(ht>>1))/L,(M+(lt>>1))/L),x.rotate&&D.rotate(x.rotate*t),D.fillText(x.text,z,0),x.padding&&(D.lineWidth=2*x.padding,D.strokeText(x.text,z,0)),D.restore(),x.width=ht,x.height=lt,x.xoff=N,x.yoff=M,x.x1=ht>>1,x.y1=lt>>1,x.x0=-x.x1,x.y0=-x.y1,x.hasText=!0,N+=ht}for(var P=D.getImageData(0,0,(r<<5)/L,i/L).data,W=[];--A>=0;)if(x=O[A],!!x.hasText){for(var q=x.width,K=q>>5,ut=x.y1-x.y0,tt=0;tt<ut*K;tt++)W[tt]=0;if(N=x.xoff,N==null)return;M=x.yoff;for(var X=0,et=-1,at=0;at<ut;at++){for(var tt=0;tt<q;tt++){var j=K*at+(tt>>5),Y=P[(M+at)*(r<<5)+(N+tt)<<2]?1<<31-tt%32:0;W[j]|=Y,X|=Y}X?et=at:(x.y0++,ut--,at--,M++)}x.y1=x.y0+et,x.sprite=W.slice(0,(x.y1-x.y0)*K)}}}function d(E,x,O){O>>=5;for(var A=E.sprite,D=E.width>>5,L=E.x-(D<<4),N=L&127,M=32-N,V=E.y1-E.y0,k=(E.y+E.y0)*O+(L>>5),H,S=0;S<V;S++){H=0;for(var U=0;U<=D;U++)if((H<<M|(U<D?(H=A[S*D+U])>>>N:0))&x[k+U])return!0;k+=O}return!1}function p(E,x){var O=E[0],A=E[1];x.x+x.x0<O.x&&(O.x=x.x+x.x0),x.y+x.y0<O.y&&(O.y=x.y+x.y0),x.x+x.x1>A.x&&(A.x=x.x+x.x1),x.y+x.y1>A.y&&(A.y=x.y+x.y1)}function f(E,x){return E.x+E.x1>x[0].x&&E.x+E.x0<x[1].x&&E.y+E.y1>x[0].y&&E.y+E.y0<x[1].y}function g(E){var x=E[0]/E[1];return function(O){return[x*(O*=.1)*Math.cos(O),O*Math.sin(O)]}}function m(E){var x=4,O=x*E[0]/E[1],A=0,D=0;return function(L){var N=L<0?-1:1;switch(Math.sqrt(1+4*N*L)-N&3){case 0:A+=O;break;case 1:D+=x;break;case 2:A-=O;break;default:D-=x;break}return[A,D]}}function v(E){for(var x=[],O=-1;++O<E;)x[O]=0;return x}function b(){return document.createElement("canvas")}function _(E){return typeof E=="function"?E:function(){return E}}return _u}var SN=wN();const $N=yN(SN);class MN extends gt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=rt.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:h}=I.getSVGElementSize(r,{useAttrs:!0});if(u===0||h===0)return;const d=$N().size([u,h]).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);d.start();function p(f){const g=I.appendOrSelect(r,"g.words");g.attr("transform",`translate(${d.size()[0]/2}, ${d.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=I.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?je(i):[1,1];return Ye().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Oa(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:R(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:vt(t,"locale.translations.group")||vt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=R(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:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(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 CN extends gt{constructor(){super(...arguments),this.type="geo",this.renderType=rt.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=I.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=_k(s,Object.values(l)),u=yk(s,{type:"GeometryCollection",geometries:Object.values(o)}),h=i.fitSize([n,r],u),d=CA().projection(h);I.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",d);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=I.appendOrSelect(t,"defs");I.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",Ts()([[0,0],[0,10]]));const g=I.appendOrSelect(t,"g.missing-data");I.appendOrSelect(g,"path").datum(c).attr("d",d).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case tn.geoEqualEarth:t=YA();break;case tn.geoAlbers:t=VA();break;case tn.geoConicEqualArea:t=eg();break;case tn.geoConicEquidistant:t=WA();break;case tn.geoEquirectangular:t=zA();break;case tn.geoMercator:t=GA();break;case tn.geoNaturalEarth1:t=ZA();break;default:throw new Error("Projection is not supported.")}return t}}class AN extends CN{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=R(this);t.services.events.dispatchEvent(Sr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(wr.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:R(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(wr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Sr.CHOROPLETH_CLICK,{event:r,element:R(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=R(this);t.services.events.dispatchEvent(Sr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(wr.HIDE,{event:r,hoveredElement:s})})}}function Eu(e){var t=e==null?0:e.length;return t?Ws(e,1):[]}function LN(e){return dh(mh(e,void 0,Eu),e+"")}function uv(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 DN(e,t){return t.length<2?e:il(e,uv(t,0,-1))}var kN=Object.prototype,RN=kN.hasOwnProperty;function IN(e,t){t=js(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=Rr(t[n]);if(i==="__proto__"&&!RN.call(e,"__proto__")||(i==="constructor"||i==="prototype")&&n<r-1)return!1}var s=DN(e,t);return s==null||delete s[Rr(ud(t))]}function NN(e){return Mh(e)?void 0:e}var PN=1,UN=2,BN=4,HN=LN(function(e,t){var n={};if(e==null)return n;var r=!1;t=Wo(t,function(s){return s=js(s,e),r||(r=s.length>1),s}),Ar(e,Uh(e),n),r&&(n=Ui(n,PN|UN|BN,NN));for(var i=t.length;i--;)IN(n,t[i]);return n});function hv(e){return Math.log(e)}function dv(e){return Math.exp(e)}function VN(e){return-Math.log(-e)}function GN(e){return-Math.exp(-e)}function FN(e){return isFinite(e)?+("1e"+e):e<0?0:e}function zN(e){return e===10?FN:e===Math.E?Math.exp:t=>Math.pow(e,t)}function jN(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 pv(e){return(t,n)=>-e(-t,n)}function WN(e){const t=e(hv,dv),n=t.domain;let r=10,i,s;function a(){return i=jN(r),s=zN(r),n()[0]<0?(i=pv(i),s=pv(s),e(VN,GN)):e(hv,dv),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 h=u<c;h&&([c,u]=[u,c]);let d=i(c),p=i(u),f,g;const m=o==null?10:+o;let v=[];if(!(r%1)&&p-d<m){if(d=Math.floor(d),p=Math.ceil(p),c>0){for(;d<=p;++d)for(f=1;f<r;++f)if(g=d<0?f/s(-d):f*s(d),!(g<c)){if(g>u)break;v.push(g)}}else for(;d<=p;++d)for(f=r-1;f>=1;--f)if(g=d>0?f/s(-d):f*s(d),!(g<c)){if(g>u)break;v.push(g)}v.length*2<m&&(v=Qs(c,u,m))}else v=Qs(d,p,Math.min(p-d,m)).map(s);return h?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Xi(l)).precision==null&&(l.trim=!0),l=Ul(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let h=u/s(Math.round(i(u)));return h*r<r-.5&&(h*=r),h<=c?l(u):""}},t.nice=()=>n(Xp(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function fv(){const e=WN(pp()).domain([1,10]);return e.copy=()=>Hl(e,fv()).base(e.base()),Vr.apply(e,arguments),e}function vo(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 yo(e){this._context=e}yo.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:vo(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:vo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qN(e){return new yo(e)}function mv(e){this._context=e}mv.prototype={areaStart:Vn,areaEnd:Vn,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:vo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function YN(e){return new mv(e)}function gv(e){this._context=e}gv.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:vo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ZN(e){return new gv(e)}function vv(e,t){this._basis=new yo(e),this._beta=t}vv.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 XN=function e(t){function n(r){return t===1?new yo(r):new vv(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function bo(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 Ou(e,t){this._context=e,this._k=(1-t)/6}Ou.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:bo(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:bo(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 KN=function e(t){function n(r){return new Ou(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Tu(e,t){this._context=e,this._k=(1-t)/6}Tu.prototype={areaStart:Vn,areaEnd:Vn,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:bo(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 QN=function e(t){function n(r){return new Tu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function wu(e,t){this._context=e,this._k=(1-t)/6}wu.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:bo(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 JN=function e(t){function n(r){return new wu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Su(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>se){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>se){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 yv(e,t){this._context=e,this._alpha=t}yv.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:Su(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 tP=function e(t){function n(r){return t?new yv(r,t):new Ou(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function bv(e,t){this._context=e,this._alpha=t}bv.prototype={areaStart:Vn,areaEnd:Vn,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:Su(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 eP=function e(t){function n(r){return t?new bv(r,t):new Tu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function xv(e,t){this._context=e,this._alpha=t}xv.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:Su(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 nP=function e(t){function n(r){return t?new xv(r,t):new wu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function _v(e){return e<0?-1:1}function Ev(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(_v(s)+_v(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Ov(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function $u(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 xo(e){this._context=e}xo.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:$u(this,this._t0,Ov(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,$u(this,Ov(this,n=Ev(this,e,t)),n);break;default:$u(this,this._t0,n=Ev(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Tv(e){this._context=new wv(e)}(Tv.prototype=Object.create(xo.prototype)).point=function(e,t){xo.prototype.point.call(this,t,e)};function wv(e){this._context=e}wv.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 rP(e){return new xo(e)}function iP(e){return new Tv(e)}function Sv(e){this._context=e}Sv.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=$v(e),i=$v(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 $v(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 sP(e){return new Sv(e)}function _o(e,t){this._context=e,this._t=t}_o.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 aP(e){return new _o(e,.5)}function oP(e){return new _o(e,0)}function lP(e){return new _o(e,1)}class cP extends Cn{zoomIn(t,n,r){let i,s,a;const o=r||Fr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=I.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:R(t)})}zoomOut(t,n){const r=n||Fr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_OUT)}}class uP extends Cn{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 hP extends Cn{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 dP extends Cn{constructor(){super(...arguments),this.pendingTransitions={}}init(){this.services.events?.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(xp,n,"duration")||xp.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Ls(e,t){const n=+Ut(e)-+Ut(t);return n<0?-1:n>0?1:n}function pP(e,t,n){const[r,i]=Xn(n?.in,e,t);return r.getFullYear()-i.getFullYear()}function fP(e,t,n){const[r,i]=Xn(n?.in,e,t),s=Ls(r,i),a=Math.abs(pP(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Ls(r,i)===-s,l=s*(a-+o);return l===0?0:l}function Mu(e,t,n){const r=Ut(e,n?.in);if(isNaN(t))return Le(e,NaN);if(!t)return r;const i=r.getDate(),s=Le(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 Mv(e,t,n){return Mu(e,t*12,n)}function mP(e,t,n){return Mv(e,-t,n)}function gP(e,t,n){const[r,i]=Xn(n?.in,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function vP(e,t){const n=Ut(e,t?.in);return n.setHours(23,59,59,999),n}function yP(e,t){const n=Ut(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function bP(e,t){const n=Ut(e,t?.in);return+vP(n,t)==+yP(n,t)}function xP(e,t,n){const[r,i,s]=Xn(n?.in,e,e,t),a=Ls(i,s),o=Math.abs(gP(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Ls(i,s)===-a;bP(r)&&o===1&&Ls(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function _P(e,t,n){return Mu(e,-t,n)}function EP(e,t,n){const[r,i]=Xn(n?.in,e,t),s=Cv(r,i),a=Math.abs(kp(r,i));r.setDate(r.getDate()-s*a);const o=+(Cv(r,i)===-s),l=s*(a-o);return l===0?0:l}function Cv(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 Av(e,t,n){const r=Ut(e,n?.in);return isNaN(t)?Le(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function OP(e,t,n){return Av(e,-t,n)}function Cu(e){return t=>{const n=(0,Math.trunc)(t);return n===0?0:n}}function TP(e,t,n){const[r,i]=Xn(n?.in,e,t),s=(+r-+i)/th;return Cu()(s)}function Lv(e,t,n){return Le(e,+Ut(e)+t)}function Dv(e,t,n){return Lv(e,t*th)}function wP(e,t,n){return Dv(e,-t)}function kv(e,t){return+Ut(e)-+Ut(t)}function Rv(e,t,n){const r=kv(e,t)/Ju;return Cu()(r)}function Au(e,t,n){const r=Ut(e,n?.in);return r.setTime(r.getTime()+t*Ju),r}function Iv(e,t,n){return Au(e,-t,n)}function Nv(e,t,n){const r=kv(e,t)/1e3;return Cu()(r)}function Lu(e,t,n){return Lv(e,t*1e3)}function Pv(e,t,n){return Lu(e,-t)}class SP extends Cn{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?.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?.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===G.BOTTOM||t===G.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(G).map(t=>G[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===G.LEFT||this.rangeAxisPosition===G.RIGHT)&&(this.domainAxisPosition===G.BOTTOM||this.domainAxisPosition===G.TOP)?this.orientation=zt.VERTICAL:this.orientation=zt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){const t=this.model.getOptions(),n=y(t,"axes");(n[G.LEFT]?.correspondingDatasets&&n[G.RIGHT]||n[G.RIGHT]?.correspondingDatasets&&n[G.LEFT]||n[G.TOP]?.correspondingDatasets&&n[G.BOTTOM]||n[G.BOTTOM]?.correspondingDatasets&&n[G.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=[G.BOTTOM,G.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[G.LEFT,G.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 $P(n,s)}else return MP(n,Un.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,G.LEFT)===null&&y(n,G.RIGHT)!==null||y(n,G.RIGHT,"main")===!0||r&&y(n,G.LEFT,"correspondingDatasets")?{primary:G.RIGHT,secondary:G.LEFT}:{primary:G.LEFT,secondary:G.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,G.BOTTOM)===null&&y(n,G.TOP)!==null||y(n,G.TOP,"main")===!0||r&&y(n,G.BOTTOM,"correspondingDatasets")?{primary:G.TOP,secondary:G.BOTTOM}:{primary:G.BOTTOM,secondary:G.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,rr(v,b=>b.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),b=this.model.getStackKeys({bins:v});return[b[0].split(":")[0],b[b.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:h}=r,{reference:d,compareTo:p}=Un.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 Hi(o.map(v=>v[c]));let f,g;const m=this.model.getDataGroupNames();if(a===nt.LABELS_RATIO)return o.map(v=>`${v[d]}/${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,b=this.model.getDataValuesGroupedByKeys({groups:m}),_=o.filter(x=>!m.includes(x[v])),E=[];b.forEach(x=>{const{...O}=x;let A=0,D=0;Object.values(HN(O,"sharedStackKey")).forEach(L=>{isNaN(L)||(L<0?D+=L:A+=L)}),E.push([D,A])}),g=[...Eu(E),..._.map(x=>x[c])]}else g=[],o.forEach(v=>{const b=v[c];Array.isArray(b)&&b.length===2?(g.push(b[0]),g.push(b[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(b))});return a!==nt.TIME&&a!==nt.LOG&&s&&g.push(0),h&&h.length>0&&h.forEach(v=>{const b=y(v,"value");b!==null&&g.push(b)}),f=je(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=gf():i===nt.LOG?s=fv().base(r.base||10):i===nt.LABELS||i===nt.LABELS_RATIO?s=Yr():s=Ye(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===zt.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 $P(e,t){const n=new Date(e[0]),r=new Date(e[1]);return fP(r,n)>1?[mP(n,t),Mv(r,t)]:xP(r,n)>1?[_P(n,t),Mu(r,t)]:EP(r,n)>1?[OP(n,t),Av(r,t)]:TP(r,n)>1?[wP(n,t),Dv(r,t)]:Rv(r,n)>30?[Iv(n,t*30),Au(r,t*30)]:Rv(r,n)>1?[Iv(n,t),Au(r,t)]:Nv(r,n)>15?[Pv(n,t*15),Lu(r,t*15)]:Nv(r,n)>1?[Pv(n,t),Lu(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 CP extends Cn{constructor(){super(...arguments),this.curveTypes={curveLinear:Aa,curveLinearClosed:_f,curveBasis:qN,curveBasisClosed:YN,curveBasisOpen:ZN,curveBundle:XN,curveCardinal:KN,curveCardinalClosed:QN,curveCardinalOpen:JN,curveCatmullRom:tP,curveCatmullRomClosed:eP,curveCatmullRomOpen:nP,curveMonotoneX:rP,curveMonotoneY:iP,curveNatural:sP,curveStep:aP,curveStepAfter:lP,curveStepBefore:oP}}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 AP extends Cn{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===G.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,je(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0,type:"manual"}){this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&this.services.events?.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t,type:n.type})}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&r){const a=i.stacked?"sharedStackKey":this.services.cartesianScales?.getDomainIdentifier(),o=t.filter(l=>new Date(l[a])>=r[0]&&new Date(l[a])<=r[1]);if(o.length>0)return o}return t}zoomIn(t=this.getZoomRatio()){const n=this.model.get("zoomDomain"),r=we.handleWidth,i=this.services.cartesianScales?.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const s=i(n[0]),a=i(n[1]);if(a-s<r+1)return;const o=i.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,h=a-c;u>=h&&(u=s+l/2-r/2,h=a-l/2+r/2);const d=[i.invert(u),i.invert(h)];(n[0].valueOf()!==d[0].valueOf()||n[1].valueOf()!==d[1].valueOf())&&this.handleDomainChange(d,{dispatchEvent:!0,type:"in"})}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,{dispatchEvent:!0,type:"out"})}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,{dispatchEvent:!0,type:"reset"})}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 LP(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:uv(e,t,n)}var DP="\\ud800-\\udfff",kP="\\u0300-\\u036f",RP="\\ufe20-\\ufe2f",IP="\\u20d0-\\u20ff",NP=kP+RP+IP,PP="\\ufe0e\\ufe0f",UP="\\u200d",BP=RegExp("["+UP+DP+NP+PP+"]");function Uv(e){return BP.test(e)}function HP(e){return e.split("")}var Bv="\\ud800-\\udfff",VP="\\u0300-\\u036f",GP="\\ufe20-\\ufe2f",FP="\\u20d0-\\u20ff",zP=VP+GP+FP,jP="\\ufe0e\\ufe0f",WP="["+Bv+"]",Du="["+zP+"]",ku="\\ud83c[\\udffb-\\udfff]",qP="(?:"+Du+"|"+ku+")",Hv="[^"+Bv+"]",Vv="(?:\\ud83c[\\udde6-\\uddff]){2}",Gv="[\\ud800-\\udbff][\\udc00-\\udfff]",YP="\\u200d",Fv=qP+"?",zv="["+jP+"]?",ZP="(?:"+YP+"(?:"+[Hv,Vv,Gv].join("|")+")"+zv+Fv+")*",XP=zv+Fv+ZP,KP="(?:"+[Hv+Du+"?",Du,Vv,Gv,WP].join("|")+")",QP=RegExp(ku+"(?="+ku+")|"+KP+XP,"g");function JP(e){return e.match(QP)||[]}function t3(e){return Uv(e)?JP(e):HP(e)}function e3(e){return function(t){t=Pi(t);var n=Uv(t)?t3(t):void 0,r=n?n[0]:t.charAt(0),i=n?LP(n,1).join(""):t.slice(1);return r[e]()+i}}var n3=e3("toUpperCase");function r3(e){return n3(Pi(e).toLowerCase())}var i3=em(function(e,t,n){return t=t.toLowerCase(),e+(n?r3(t):t)});class Ke{constructor(t,n){this.components=[],this.services={canvasZoom:cP,domUtils:I,events:uP,files:hP,gradientUtils:mc,transitions:dP},this.model=new sn(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 du(this.model,this.services)],growth:ct.PREFERRED},a=y(r,"canvasZoom","enabled");a&&a===!0&&t.push(new BD(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new As(this.model,this.services)],growth:ct.STRETCH},c={id:"toolbar",components:[new co(this.model,this.services)],growth:ct.PREFERRED},u={id:"header",components:[new Me(this.model,this.services,[l,...i?[c]:[]],{direction:Ct.ROW,alignItems:Yn.CENTER})],growth:ct.PREFERRED},h={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:y(n,"graphFrameRenderType")||rt.SVG},d=y(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=Ct.COLUMN;if(d){const v=y(r,"legend","position");v==="left"?(p=Ct.ROW,r.legend.orientation||(r.legend.orientation=Mr.VERTICAL)):v==="right"?(p=Ct.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Mr.VERTICAL)):v==="bottom"&&(p=Ct.COLUMN_REVERSE)}const f={id:"spacer",components:[new kn(this.model,this.services)],growth:ct.PREFERRED},g={id:"full-frame",components:[new Me(this.model,this.services,[...d?[s]:[],...d?[f]:[],h],{direction:p})],growth:ct.STRETCH},m=[];if(o||i){m.push(u);const v={id:"spacer",components:[new kn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};m.push(v)}return m.push(g),[new pu(this.model,this.services),new uo(this.model,this.services),new Me(this.model,this.services,m,{direction:Ct.COLUMN})]}}class _e extends Ke{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:SP,curves:CP,zoom:AP}),this.model=new hr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",G.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===G.BOTTOM&&o===nt.TIME,c=this.services.zoom.isZoomBarLocked(G.TOP),u=!!this.model.getOptions().title,h={id:"title",components:[new As(this.model,this.services)],growth:ct.STRETCH},d={id:"toolbar",components:[new co(this.model,this.services)],growth:ct.PREFERRED},p={id:"header",components:[new Me(this.model,this.services,[h,...s?[d]:[]],{direction:Ct.ROW,alignItems:Yn.CENTER})],growth:ct.PREFERRED},f={id:"legend",components:[new du(this.model,this.services)],growth:ct.PREFERRED};l&&!c&&t.push(new kg(this.model,this.services),new HD(this.model,this.services)),t.push(new GD(this.model,this.services)),t.push(new FD(this.model,this.services));const g={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:rt.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Ct.COLUMN;if(m){const O=y(this.model.getOptions(),"legend","position");O===$r.LEFT?(v=Ct.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Mr.VERTICAL)):O===$r.RIGHT?(v=Ct.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Mr.VERTICAL)):O===$r.BOTTOM&&(v=Ct.COLUMN_REVERSE)}const b={id:"spacer",components:[new kn(this.model,this.services)],growth:ct.PREFERRED},_={id:"full-frame",components:[new Me(this.model,this.services,[...m?[f]:[],...m?[b]:[],g],{direction:v})],growth:ct.STRETCH},E={id:"zoom-bar",components:[new VD(this.model,this.services)],growth:ct.PREFERRED,renderType:rt.SVG},x=[];if(u||s){x.push(p);const O={id:"spacer",components:[new kn(this.model,this.services,s?{size:15}:void 0)],growth:ct.PREFERRED};x.push(O)}return l&&x.push(E),x.push(_),[new Pg(this.model,this.services),new uo(this.model,this.services),new Me(this.model,this.services,x,{direction:Ct.COLUMN})]}}class s3 extends Ke{constructor(t,n){super(t,n),this.model=new QS(this.services),this.model.setOptions(It(At.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new ck(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class a3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(gn(At.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new zn(this.model,this.services),new pi(this.model,this.services),new Wg(this.model,this.services),new un(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class o3 extends _e{constructor(t,n){super(t,n),this.model=new JS(this.services),this.model.setOptions(It(At.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new dk(this.model,this.services),new fi(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class l3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new zn(this.model,this.services),new pk(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class c3 extends _e{constructor(t,n){super(t,n),this.model=new t$(this.services),this.model.setOptions(It(At.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new fk(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class u3 extends Ke{constructor(t,n){super(t,n),this.model=new e$(this.services),this.model.setOptions(It(At.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 As(this.model,this.services)],growth:ct.STRETCH},o={id:"toolbar",components:[new co(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new Me(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:Yn.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new Xg(this.model,this.services,{chartType:"choropleth"})],growth:ct.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:rt.SVG},h=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,d=Ct.COLUMN_REVERSE,p={id:"spacer",components:[new kn(this.model,this.services,{size:15})],growth:ct.PREFERRED},f={id:"full-frame",components:[new Me(this.model,this.services,[...h?[c]:[],...h?[p]:[],u],{direction:d})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new kn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(f),[new pu(this.model,this.services),new uo(this.model,this.services),new Me(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new AN(this.model,this.services)];return this.getChartComponents(t)}}class h3 extends Ke{constructor(t,n){super(t,n),this.model=new n$(this.services),this.model.setOptions(It(At.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new Dk(this.model,this.services)];return this.getChartComponents(t)}}const jv={[Ee.LINE]:[pi,un],[Ee.SCATTER]:[un],[Ee.AREA]:[Wg,pi,un],[Ee.STACKED_AREA]:[nv,pi,iv,mo],[Ee.SIMPLE_BAR]:[ev],[Ee.GROUPED_BAR]:[tv,fi],[Ee.STACKED_BAR]:[rv,mo]};class d3 extends _e{constructor(t,n){super(t,n);const r=It(At.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Ee.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(jv).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=`${i3(i.type)}Chart`;return a=ot({},At[l],this.model.getOptions(),i.options),i.type===Ee.STACKED_AREA&&(o=!0),jv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ot({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Eu(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Ee.STACKED_BAR||i.type===Ee.STACKED_AREA),r=[new xe(this.model,this.services),new Ce(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.GRID}),...n?[]:[new zn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class Wv extends Ke{constructor(t,n,r=!1){super(t,n),this.model=new r$(this.services),!r&&(this.model.setOptions(It(At.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Kg(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.PIE})];return this.getChartComponents(t)}}class p3 extends Wv{constructor(t,n){super(t,n,!0),this.model.setOptions(It(At.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new Rk(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.DONUT})];return this.getChartComponents(t)}}class f3 extends Ke{constructor(t,n){super(t,n),this.model=new i$(this.services),this.model.setOptions(It(At.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new Ik(this.model,this.services)];return this.getChartComponents(t)}}class m3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new tv(this.model,this.services),new fi(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class g3 extends _e{constructor(t,n){super(t,n),this.model=new s$(this.services),this.model.setOptions(It(At.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 As(this.model,this.services)],growth:ct.STRETCH},o={id:"toolbar",components:[new co(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new Me(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:Yn.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new Xg(this.model,this.services,{chartType:"heatmap"})],growth:ct.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:rt.SVG},h=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,d=Ct.COLUMN_REVERSE,p={id:"spacer",components:[new kn(this.model,this.services,{size:15})],growth:ct.PREFERRED},f={id:"full-frame",components:[new Me(this.model,this.services,[...h?[c]:[],...h?[p]:[],u],{direction:d})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new kn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(f),[new Pg(this.model,this.services),new uo(this.model,this.services),new Me(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new xe(this.model,this.services),new Nk(this.model,this.services)];return this.getAxisChartComponents(t)}}class v3 extends _e{constructor(t,n){super(t,n),this.model=new a$(this.services),this.model.setOptions(It(At.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new Ok(this.model,this.services),new Pk(this.model,this.services)];return this.getAxisChartComponents(t)}}class y3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new zn(this.model,this.services),new pi(this.model,this.services),new un(this.model,this.services,{handleThresholds:!0}),new Vk(this.model,this.services),new fi(this.model,this.services)];return this.getAxisChartComponents(t)}}class b3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new zn(this.model,this.services),new Uk(this.model,this.services),new un(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class x3 extends Ke{constructor(t,n){super(t,n),this.model=new o$(this.services);const r=n.options.meter?.proportional?ot(gn(At.proportionalMeterChart),n.options):ot(gn(At.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const t=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new Lk(this.model,this.services)],growth:ct.STRETCH,renderType:rt.SVG},{id:"spacer",components:[new kn(this.model,this.services,{size:8})],growth:ct.STRETCH}]:[],{id:"meter-graph",components:[new Bk(this.model,this.services)],growth:ct.STRETCH,renderType:rt.SVG}],n=[new Me(this.model,this.services,t,{direction:Ct.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:rt.HTML})}}class _3 extends Ke{constructor(t,n){super(t,n),this.model=new l$(this.services),this.model.setOptions(It(At.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Hk(this.model,this.services)];return this.getChartComponents(t)}}class E3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new zn(this.model,this.services),new un(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class O3 extends Ke{constructor(t,n){super(t,n),this.model=new c$(this.services),this.model.setOptions(It(At.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new Gk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class T3 extends Ke{constructor(t,n){super(t,n),this.model=new u$(this.services),this.model.setOptions(It(At.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new vN(this.model,this.services)];return this.getChartComponents(t)}}class w3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new ev(this.model,this.services),new fi(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class S3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new mo(this.model,this.services),new nv(this.model,this.services),new pi(this.model,this.services,{stacked:!0}),new iv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new de(this.model,this.services,{skeleton:Wt.GRID})];return this.getAxisChartComponents(t)}}class $3 extends _e{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ce(this.model,this.services),new mo(this.model,this.services),new rv(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.VERT_OR_HORIZ}),new fi(this.model,this.services)];return this.getAxisChartComponents(t)}}class M3 extends Ke{constructor(t,n){super(t,n),this.model=new h$(this.services),this.model.setOptions(It(At.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new MN(this.model,this.services),new de(this.model,this.services,{skeleton:Wt.PIE})];return this.getChartComponents(t)}}class Rt extends xt.PureComponent{chart;chartRef=xt.createRef();createChart(t,n,r){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(t){this.props.data!==t.data&&this.chart?.model.setData(this.props.data),this.props.options!==t.options&&this.chart?.model.setOptions(this.props.options)}render(){return xt.createElement("div",{ref:this.chartRef,className:"chart-holder"})}}class C3 extends Rt{createChart(t,n,r){return new s3(t,{data:n,options:r})}}class A3 extends Rt{createChart(t,n,r){return new a3(t,{data:n,options:r})}}class L3 extends Rt{createChart(t,n,r){return new o3(t,{data:n,options:r})}}class D3 extends Rt{createChart(t,n,r){return new l3(t,{data:n,options:r})}}class k3 extends Rt{createChart(t,n,r){return new c3(t,{data:n,options:r})}}class qv extends Rt{createChart(t,n,r){return new u3(t,{data:n,options:r})}}class R3 extends Rt{createChart(t,n,r){return new h3(t,{data:n,options:r})}}class I3 extends Rt{createChart(t,n,r){return new d3(t,{data:n,options:r})}}class N3 extends Rt{createChart(t,n,r){return new p3(t,{data:n,options:r})}}class P3 extends Rt{createChart(t,n,r){return new f3(t,{data:n,options:r})}}class U3 extends Rt{createChart(t,n,r){return new m3(t,{data:n,options:r})}}class B3 extends Rt{createChart(t,n,r){return new g3(t,{data:n,options:r})}}class H3 extends Rt{createChart(t,n,r){return new v3(t,{data:n,options:r})}}class V3 extends Rt{createChart(t,n,r){return new y3(t,{data:n,options:r})}}class G3 extends Rt{createChart(t,n,r){return new b3(t,{data:n,options:r})}}class F3 extends Rt{createChart(t,n,r){return new x3(t,{data:n,options:r})}}class z3 extends Rt{createChart(t,n,r){return new Wv(t,{data:n,options:r})}}class j3 extends Rt{createChart(t,n,r){return new _3(t,{data:n,options:r})}}class W3 extends Rt{createChart(t,n,r){return new E3(t,{data:n,options:r})}}class q3 extends Rt{createChart(t,n,r){return new w3(t,{data:n,options:r})}}class Y3 extends Rt{createChart(t,n,r){return new S3(t,{data:n,options:r})}}class Z3 extends Rt{createChart(t,n,r){return new $3(t,{data:n,options:r})}}class X3 extends Rt{createChart(t,n,r){return new O3(t,{data:n,options:r})}}class K3 extends Rt{createChart(t,n,r){return new T3(t,{data:n,options:r})}}class Q3 extends Rt{createChart(t,n,r){return new M3(t,{data:n,options:r})}}function J3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ru={exports:{}};/*!
75
75
  Copyright (c) 2018 Jed Watson.
76
76
  Licensed under the MIT License (MIT), see
77
77
  http://jedwatson.github.io/classnames
78
- */var Yv;function tB(){return Yv||(Yv=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(s=i(s,r(o)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var o in s)t.call(s,o)&&s[o]&&(a=i(a,o));return a}function i(s,a){return a?s?s+" "+a:s+a:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(Ru)),Ru.exports}var eB=tB();const jn=J3(eB),Wn="cds",nB=({tag:e="div",className:t,children:n,color:r,href:i,position:s="static",stacked:a,...o})=>{const l=i?"a":o.onClick?"button":e,c=`${Wn}--cc--card-node`,u=jn(c,{[`${c}--stacked`]:a,[`${c}--${l}`]:l,[t]:t});return xt.createElement(l,{className:u,style:{borderColor:r,position:s},tabIndex:0,...o},n)},rB=({children:e,farsideColumn:t=!1,...n})=>{const r=`${Wn}--cc--card-node`,i=jn(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return xt.createElement("div",{className:i,...n},e)},iB=({children:e,...t})=>{const n=`${Wn}--cc--card-node`,r=jn(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return xt.createElement("label",{className:r,...t},e)},sB=({children:e,...t})=>{const n=`${Wn}--cc--card-node`,r=jn(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return xt.createElement("div",{className:r,...t},e)},aB=({children:e,...t})=>{const n=`${Wn}--cc--card-node`,r=jn(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return xt.createElement("div",{className:r,...t},e)},oB=({className:e,color:t,markerEnd:n,markerStart:r,path:i,source:s,target:a,variant:o=null,...l})=>{const c=`${Wn}--cc--edge`,u=jn(c,e,{[`${c}--${o}`]:o});let d=i;if(!d&&s&&a&&(d=OD(s,a)),!d)throw Error("Missing parameters for Edge component: path or source and target.");return xt.createElement("g",{className:u,...l},xt.createElement("path",{d,className:`${c}__container`}),xt.createElement("path",{d,className:`${c}__outer`}),xt.createElement("path",{d,className:`${c}__inner`,markerEnd:`url(#${n})`,markerStart:`url(#${r})`,style:{stroke:t}}))},Er=({color:e,d:t,id:n,orient:r="auto",height:i,width:s,position:a="end",className:o,refX:l,refY:c,...u})=>{const d=`${Wn}--cc--marker`,h=jn(d,o),p=a==="end"?(s||0)/2+.5:.5,f=(i||0)/2;return xt.createElement("marker",{className:h,markerHeight:i,markerWidth:s,orient:r,id:n,refX:l||p,refY:c||f,markerUnits:"userSpaceOnUse",...u},xt.createElement("path",{d:t,style:{fill:e}}))},lB=e=>xt.createElement(Er,{d:SD.d,...e}),cB=e=>xt.createElement(Er,{d:wD.d,...e}),uB=e=>xt.createElement(Er,{d:$D.d,...e}),hB=e=>xt.createElement(Er,{d:MD.d,...e}),dB=e=>xt.createElement(Er,{d:CD.d,...e}),pB=e=>xt.createElement(Er,{d:AD.d,...e}),fB=({shape:e="circle",tag:t="div",title:n="Title",className:r,subtitle:i,description:s,renderIcon:a,href:o,size:l=48,stacked:c,position:u="fixed",bodyPosition:d="absolute",...h})=>{const p=o?"a":h.onClick?"button":t,f=`${Wn}--cc--shape-node`,g=jn(f,{[`${f}--stacked`]:c,[`${f}--${e}`]:e,[`${f}--${p}`]:p,[r]:r}),m=n?xt.createElement("div",{className:`${f}__title`},n):null,v=i?xt.createElement("div",{className:`${f}__subtitle`},i):null,x=s?xt.createElement("div",{className:`${f}__description`},s):null;return xt.createElement(p,{className:g,style:{height:l,width:l,position:u},tabIndex:0,...h},xt.createElement("div",{className:`${f}__icon`},a),xt.createElement("div",{className:`${f}__body`,style:{position:d}},m,v,x))};G.Alignments=jt,G.AlluvialChart=C3,G.AreaChart=A3,G.AreaEvent=ko,G.ArrowDirections=Ns,G.ArrowLeftMarker=lB,G.ArrowRightMarker=cB,G.AxisEvent=Lo,G.AxisFlavor=Si,G.AxisPositions=V,G.AxisTitleOrientations=Ps,G.BarEvent=No,G.BoxplotChart=L3,G.BoxplotEvent=Po,G.BubbleChart=k3,G.BulletChart=D3,G.CalloutDirections=_i,G.CanvasZoomEvent=Ao,G.CardNode=nB,G.CardNodeColumn=rB,G.CardNodeLabel=iB,G.CardNodeSubtitle=sB,G.CardNodeTitle=aB,G.CartesianOrientations=zt,G.ChartEvent=So,G.ChartTheme=zo,G.ChartTypes=Ee,G.ChoroplethChart=qv,G.CircleMarker=uB,G.CirclePackChart=R3,G.ColorClassNameTypes=st,G.ColorLegendType=Oi,G.ComboChart=I3,G.DiamondMarker=hB,G.DividerStatus=Cr,G.DominantBaseline=Je,G.DonutChart=N3,G.Edge=oB,G.ExperimentalChoroplethChart=qv,G.GaugeChart=P3,G.GaugeEvent=Io,G.GaugeTypes=Xn,G.GroupedBarChart=B3,G.HeatmapChart=U3,G.HistogramChart=H3,G.LayoutAlignItems=Yn,G.LayoutDirection=Ct,G.LayoutGrowth=ct,G.LegendItemType=qt,G.LegendOrientations=Mr,G.LegendPositions=$r,G.LineChart=V3,G.LineEvent=Uo,G.LollipopChart=G3,G.Marker=Er,G.MeterChart=F3,G.ModalEvent=wo,G.ModelEvent=$o,G.PieChart=z3,G.PieEvent=Ro,G.Projection=tn,G.RadarChart=j3,G.RadarEvent=Ho,G.RenderTypes=rt,G.ScaleTypes=nt,G.ScatterChart=W3,G.ScatterEvent=Bo,G.ShapeNode=fB,G.SimpleBarChart=q3,G.Skeletons=Wt,G.SquareMarker=dB,G.StackedAreaChart=Y3,G.StackedBarChart=X3,G.Statuses=Ei,G.TeeMarker=pB,G.TextAnchor=Qe,G.ThresholdEvent=Fo,G.TickRotations=Ti,G.ToolbarControlTypes=_t,G.TooltipEvent=Sr,G.TreeChart=Z3,G.TreeEvent=Vo,G.TreeTypes=Is,G.TreemapChart=K3,G.TreemapEvent=Go,G.TruncationTypes=Ae,G.WordCloudChart=Q3,G.WordCloudEvent=Do,G.ZoomBarTypes=Ve,G.ZoomDomainEvent=Co,G.ZoombarEvent=Mo,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})});
78
+ */var Yv;function tU(){return Yv||(Yv=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(s=i(s,r(o)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var o in s)t.call(s,o)&&s[o]&&(a=i(a,o));return a}function i(s,a){return a?s?s+" "+a:s+a:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(Ru)),Ru.exports}var eU=tU();const jn=J3(eU),Wn="cds",nU=({tag:e="div",className:t,children:n,color:r,href:i,position:s="static",stacked:a,...o})=>{const l=i?"a":o.onClick?"button":e,c=`${Wn}--cc--card-node`,u=jn(c,{[`${c}--stacked`]:a,[`${c}--${l}`]:l,[t]:t});return xt.createElement(l,{className:u,style:{borderColor:r,position:s},tabIndex:0,...o},n)},rU=({children:e,farsideColumn:t=!1,...n})=>{const r=`${Wn}--cc--card-node`,i=jn(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return xt.createElement("div",{className:i,...n},e)},iU=({children:e,...t})=>{const n=`${Wn}--cc--card-node`,r=jn(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return xt.createElement("label",{className:r,...t},e)},sU=({children:e,...t})=>{const n=`${Wn}--cc--card-node`,r=jn(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return xt.createElement("div",{className:r,...t},e)},aU=({children:e,...t})=>{const n=`${Wn}--cc--card-node`,r=jn(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return xt.createElement("div",{className:r,...t},e)},oU=({className:e,color:t,markerEnd:n,markerStart:r,path:i,source:s,target:a,variant:o=null,...l})=>{const c=`${Wn}--cc--edge`,u=jn(c,e,{[`${c}--${o}`]:o});let h=i;if(!h&&s&&a&&(h=Tk(s,a)),!h)throw Error("Missing parameters for Edge component: path or source and target.");return xt.createElement("g",{className:u,...l},xt.createElement("path",{d:h,className:`${c}__container`}),xt.createElement("path",{d:h,className:`${c}__outer`}),xt.createElement("path",{d:h,className:`${c}__inner`,markerEnd:`url(#${n})`,markerStart:`url(#${r})`,style:{stroke:t}}))},Er=({color:e,d:t,id:n,orient:r="auto",height:i,width:s,position:a="end",className:o,refX:l,refY:c,...u})=>{const h=`${Wn}--cc--marker`,d=jn(h,o),p=a==="end"?(s||0)/2+.5:.5,f=(i||0)/2;return xt.createElement("marker",{className:d,markerHeight:i,markerWidth:s,orient:r,id:n,refX:l||p,refY:c||f,markerUnits:"userSpaceOnUse",...u},xt.createElement("path",{d:t,style:{fill:e}}))},lU=e=>xt.createElement(Er,{d:wk.d,...e}),cU=e=>xt.createElement(Er,{d:Sk.d,...e}),uU=e=>xt.createElement(Er,{d:$k.d,...e}),hU=e=>xt.createElement(Er,{d:Mk.d,...e}),dU=e=>xt.createElement(Er,{d:Ck.d,...e}),pU=e=>xt.createElement(Er,{d:Ak.d,...e}),fU=({shape:e="circle",tag:t="div",title:n="Title",className:r,subtitle:i,description:s,renderIcon:a,href:o,size:l=48,stacked:c,position:u="fixed",bodyPosition:h="absolute",...d})=>{const p=o?"a":d.onClick?"button":t,f=`${Wn}--cc--shape-node`,g=jn(f,{[`${f}--stacked`]:c,[`${f}--${e}`]:e,[`${f}--${p}`]:p,[r]:r}),m=n?xt.createElement("div",{className:`${f}__title`},n):null,v=i?xt.createElement("div",{className:`${f}__subtitle`},i):null,b=s?xt.createElement("div",{className:`${f}__description`},s):null;return xt.createElement(p,{className:g,style:{height:l,width:l,position:u},tabIndex:0,...d},xt.createElement("div",{className:`${f}__icon`},a),xt.createElement("div",{className:`${f}__body`,style:{position:h}},m,v,b))};F.Alignments=jt,F.AlluvialChart=C3,F.AreaChart=A3,F.AreaEvent=Do,F.ArrowDirections=Ns,F.ArrowLeftMarker=lU,F.ArrowRightMarker=cU,F.AxisEvent=Lo,F.AxisFlavor=wi,F.AxisPositions=G,F.AxisTitleOrientations=Ps,F.BarEvent=No,F.BoxplotChart=L3,F.BoxplotEvent=Po,F.BubbleChart=D3,F.BulletChart=k3,F.CalloutDirections=_i,F.CanvasZoomEvent=Ao,F.CardNode=nU,F.CardNodeColumn=rU,F.CardNodeLabel=iU,F.CardNodeSubtitle=sU,F.CardNodeTitle=aU,F.CartesianOrientations=zt,F.ChartEvent=wo,F.ChartTheme=zo,F.ChartTypes=Ee,F.ChoroplethChart=qv,F.CircleMarker=uU,F.CirclePackChart=R3,F.ColorClassNameTypes=st,F.ColorLegendType=Ti,F.ComboChart=I3,F.DiamondMarker=hU,F.DividerStatus=Cr,F.DominantBaseline=Je,F.DonutChart=N3,F.Edge=oU,F.ExperimentalChoroplethChart=qv,F.GaugeChart=P3,F.GaugeEvent=Io,F.GaugeTypes=Zn,F.GroupedBarChart=U3,F.HeatmapChart=B3,F.HistogramChart=H3,F.LayoutAlignItems=Yn,F.LayoutDirection=Ct,F.LayoutGrowth=ct,F.LegendItemType=qt,F.LegendOrientations=Mr,F.LegendPositions=$r,F.LineChart=V3,F.LineEvent=Bo,F.LollipopChart=G3,F.Marker=Er,F.MeterChart=F3,F.ModalEvent=So,F.ModelEvent=$o,F.PieChart=z3,F.PieEvent=Ro,F.Projection=tn,F.RadarChart=j3,F.RadarEvent=Ho,F.RenderTypes=rt,F.ScaleTypes=nt,F.ScatterChart=W3,F.ScatterEvent=Uo,F.ShapeNode=fU,F.SimpleBarChart=q3,F.Skeletons=Wt,F.SquareMarker=dU,F.StackedAreaChart=Y3,F.StackedBarChart=Z3,F.Statuses=Ei,F.TeeMarker=pU,F.TextAnchor=Qe,F.ThresholdEvent=Fo,F.TickRotations=Oi,F.ToolbarControlTypes=_t,F.TooltipEvent=wr,F.TreeChart=X3,F.TreeEvent=Vo,F.TreeTypes=Is,F.TreemapChart=K3,F.TreemapEvent=Go,F.TruncationTypes=Ae,F.WordCloudChart=Q3,F.WordCloudEvent=ko,F.ZoomBarTypes=Ve,F.ZoomDomainEvent=Co,F.ZoombarEvent=Mo,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
79
79
  //# sourceMappingURL=index.umd.cjs.map