@openmrs/esm-generic-patient-widgets-app 11.3.1-pre.9171 → 11.3.1-pre.9182
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/.turbo/turbo-build.log +11 -11
- package/dist/3204.js +2 -0
- package/dist/3204.js.map +1 -0
- package/dist/9351.js +1 -0
- package/dist/9351.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-generic-patient-widgets-app.js +1 -1
- package/dist/openmrs-esm-generic-patient-widgets-app.js.buildmanifest.json +82 -82
- package/dist/openmrs-esm-generic-patient-widgets-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/src/obs-graph/obs-graph.component.tsx +9 -7
- package/src/obs-switchable/obs-switchable.component.tsx +8 -3
- package/src/obs-switchable/obs-switchable.test.tsx +37 -21
- package/src/obs-table/obs-table.component.tsx +6 -4
- package/src/obs-table-horizontal/obs-table-horizontal.component.tsx +7 -4
- package/src/resources/useConcepts.ts +41 -0
- package/src/resources/useObs.ts +31 -4
- package/dist/5986.js +0 -1
- package/dist/5986.js.map +0 -1
- package/dist/6781.js +0 -2
- package/dist/6781.js.map +0 -1
- /package/dist/{6781.js.LICENSE.txt → 3204.js.LICENSE.txt} +0 -0
package/dist/3204.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 3204.js.LICENSE.txt */
|
|
2
|
+
(globalThis.webpackChunk_openmrs_esm_generic_patient_widgets_app=globalThis.webpackChunk_openmrs_esm_generic_patient_widgets_app||[]).push([[3204],{2326:(t,e,n)=>{"use strict";n.d(e,{XI:()=>a});var i,r=n(75641),o=n.n(r),s=n(9247);const a=o().forwardRef((function({children:t,size:e=16,...n},r){return o().createElement(s.A,{width:e,height:e,ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},i||(i=o().createElement("path",{d:"M29,5a2,2,0,0,0-2-2H5A2,2,0,0,0,3,5V27a2,2,0,0,0,2,2H27a2,2,0,0,0,2-2ZM27,5V9H5V5Zm0,22H5V23H27Zm0-6H5V17H27Zm0-6H5V11H27Z"})),t)}))},6131:(t,e,n)=>{var i=n(86403),r=n(41580),o=n(51187),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=i(t);var n=a.test(t);return n||l.test(t)?c(t.slice(2),n?2:8):s.test(t)?NaN:+t}},8870:(t,e,n)=>{var i=n(65650),r=Object.prototype,o=r.hasOwnProperty,s=r.toString,a=i?i.toStringTag:void 0;t.exports=function(t){var e=o.call(t,a),n=t[a];try{t[a]=void 0;var i=!0}catch(t){}var r=s.call(t);return i&&(e?t[a]=n:delete t[a]),r}},29005:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},36529:(t,e,n)=>{var i=n(93655),r=n(65387);t.exports=function(t){return null!=t&&r(t.length)&&!i(t)}},41580:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},43301:(t,e,n)=>{var i=n(6131),r=1/0;t.exports=function(t){return t?(t=i(t))===r||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},46285:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},51187:(t,e,n)=>{var i=n(87379),r=n(80547);t.exports=function(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==i(t)}},51890:(t,e,n)=>{"use strict";n.d(e,{Wh:()=>H,bl:()=>__});var i=n(75641),r=(t=>(t.RENDER_FINISHED="render-finished",t.RESIZE="chart-resize",t.MOUSEOVER="chart-mouseover",t.MOUSEOUT="chart-mouseout",t))(r||{}),o=(t=>(t.SHOW="show-modal",t.HIDE="hide-modal",t))(o||{}),s=(t=>(t.UPDATE="model-update",t))(s||{}),a=(t=>(t.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",t.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",t.BUTTON_CLICK="toolbar-button-click",t.SHOW_TOOLTIP="toolbar-show-tooltip",t.HIDE_TOOLTIP="toolbar-hide-tooltip",t))(a||{}),l=(t=>(t.UPDATE="zoom-bar-update",t.SELECTION_START="zoom-bar-selection-start",t.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",t.SELECTION_END="zoom-bar-selection-end",t))(l||{}),c=(t=>(t.CHANGE="zoom-domain-change",t))(c||{}),u=(t=>(t.CANVAS_ZOOM_IN="canvas-zoom-in",t.CANVAS_ZOOM_OUT="canvas-zoom-out",t))(u||{}),h=(t=>(t.LABEL_MOUSEOVER="axis-label-mouseover",t.LABEL_MOUSEMOVE="axis-label-mousemove",t.LABEL_CLICK="axis-label-click",t.LABEL_MOUSEOUT="axis-label-mouseout",t.LABEL_FOCUS="axis-label-focus",t.LABEL_BLUR="axis-label-blur",t.RENDER_COMPLETE="axis-render-complete",t))(h||{}),d=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(d||{}),f=(t=>(t.WORD_MOUSEOVER="wordcloud-word-mouseover",t.WORD_MOUSEMOVE="wordcloud-word-mousemove",t.WORD_CLICK="wordcloud-word-click",t.WORD_MOUSEOUT="wordcloud-word-mouseout",t))(f||{}),p=(t=>(t.SLICE_MOUSEOVER="pie-slice-mouseover",t.SLICE_MOUSEMOVE="pie-slice-mousemove",t.SLICE_CLICK="pie-slice-click",t.SLICE_MOUSEOUT="pie-slice-mouseout",t))(p||{}),g=(t=>(t.ARC_MOUSEOVER="gauge-arc-mouseover",t.ARC_MOUSEMOVE="gauge-arc-mousemove",t.ARC_CLICK="gauge-arc-click",t.ARC_MOUSEOUT="gauge-arc-mouseout",t))(g||{}),m=(t=>(t.BAR_MOUSEOVER="bar-mouseover",t.BAR_MOUSEMOVE="bar-mousemove",t.BAR_CLICK="bar-click",t.BAR_MOUSEOUT="bar-mouseout",t))(m||{}),y=(t=>(t.BOX_MOUSEOVER="box-mouseover",t.BOX_MOUSEMOVE="box-mousemove",t.BOX_CLICK="box-click",t.BOX_MOUSEOUT="box-mouseout",t.OUTLIER_MOUSEOVER="outlier-mouseover",t.OUTLIER_MOUSEMOVE="outlier-mousemove",t.OUTLIER_CLICK="outlier-click",t.OUTLIER_MOUSEOUT="outlier-mouseout",t))(y||{}),v=(t=>(t.SCATTER_MOUSEOVER="scatter-mouseover",t.SCATTER_MOUSEMOVE="scatter-mousemove",t.SCATTER_CLICK="scatter-click",t.SCATTER_MOUSEOUT="scatter-mouseout",t))(v||{}),_=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(_||{}),b=(t=>(t.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",t.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",t.X_AXIS_CLICK="radar-x-axis-click",t.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",t))(b||{}),x=(t=>(t.NODE_MOUSEOVER="tree-node-mouseover",t.NODE_CLICK="tree-node-click",t.NODE_MOUSEOUT="tree-node-mouseout",t))(x||{}),w=(t=>(t.LEAF_MOUSEOVER="leaf-mouseover",t.LEAF_MOUSEMOVE="leaf-mousemove",t.LEAF_CLICK="leaf-click",t.LEAF_MOUSEOUT="leaf-mouseout",t))(w||{}),E=(t=>(t.SHOW="show-tooltip",t.MOVE="move-tooltip",t.HIDE="hide-tooltip",t))(E||{}),T=(t=>(t.SHOW="show-threshold",t.HIDE="hide-threshold",t))(T||{}),S=(t=>(t.ITEM_HOVER="legend-item-onhover",t.ITEM_CLICK="legend-item-onclick",t.ITEM_MOUSEOUT="legend-item-onmouseout",t.ITEMS_UPDATE="legend-items-update",t))(S||{}),O=(t=>(t.CIRCLE_MOUSEOVER="circle-leaf-mouseover",t.CIRCLE_CLICK="circle-leaf-click",t.CIRCLE_MOUSEOUT="circle-leaf-mouseout",t.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",t))(O||{}),M=(t=>(t.NODE_MOUSEOVER="alluvial-node-mouseover",t.NODE_CLICK="alluvial-node-click",t.NODE_MOUSEOUT="alluvial-node-mouseout",t.NODE_MOUSEMOVE="alluvial-node-mousemove",t.LINE_MOUSEOVER="alluvial-line-mouseover",t.LINE_CLICK="alluvial-line-click",t.LINE_MOUSEOUT="alluvial-line-mouseout",t.LINE_MOUSEMOVE="alluvial-line-mousemove",t))(M||{}),A=(t=>(t.METER_MOUSEOVER="meter-mouseover",t.METER_CLICK="meter-click",t.METER_MOUSEOUT="meter-mouseout",t.METER_MOUSEMOVE="meter-mousemove",t))(A||{}),C=(t=>(t.HEATMAP_MOUSEOVER="heatmap-mouseover",t.HEATMAP_CLICK="heatmap-click",t.HEATMAP_MOUSEOUT="heatmap-mouseout",t.HEATMAP_MOUSEMOVE="hetmap-mousemove",t))(C||{}),k=(t=>(t.CHOROPLETH_MOUSEOVER="choropleth-mouseover",t.CHOROPLETH_CLICK="choropleth-click",t.CHOROPLETH_MOUSEOUT="choropleth-mouseout",t.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",t))(k||{});const D=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:M,Area:d,Axis:h,Bar:m,Boxplot:y,CanvasZoom:u,Chart:r,Choropleth:k,CirclePack:O,Gauge:g,Heatmap:C,Legend:S,Line:_,Meter:A,Modal:o,Model:s,Pie:p,Radar:b,Scatter:v,Threshold:T,Toolbar:a,Tooltip:E,Tree:x,Treemap:w,WordCloud:f,ZoomBar:l,ZoomDomain:c},Symbol.toStringTag,{value:"Module"}));var L=(t=>(t.HTML="html",t.SVG="svg",t))(L||{}),R=(t=>(t.WHITE="white",t.G100="g100",t.G90="g90",t.G10="g10",t))(R||{}),I=(t=>(t.BACKGROUND="background",t.FILL="fill",t.STROKE="stroke",t.TOOLTIP="tooltip",t))(I||{}),N=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom",t))(N||{}),P=(t=>(t.GRAPH_VIEW="graph_view",t.SLIDER_VIEW="slider_view",t))(P||{}),U=(t=>(t.END_LINE="end_line",t.MID_LINE="mid_line",t.FRONT_LINE="front_line",t.NONE="none",t))(U||{}),B=(t=>(t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t))(B||{}),H=(t=>(t.TIME="time",t.LINEAR="linear",t.LOG="log",t.LABELS="labels",t.LABELS_RATIO="labels-ratio",t))(H||{}),F=(t=>(t.RIGHT="right",t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t))(F||{}),z=(t=>(t.LEFT="left",t.CENTER="center",t.RIGHT="right",t))(z||{}),$=(t=>(t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))($||{}),j=(t=>(t.TREE="tree",t.DENDROGRAM="dendrogram",t))(j||{}),V=(t=>(t.ROW="row",t.COLUMN="column",t.ROW_REVERSE="row-reverse",t.COLUMN_REVERSE="column-reverse",t))(V||{}),G=(t=>(t.FIXED="fixed",t.PREFERRED="preferred",t.STRETCH="stretch",t))(G||{}),W=(t=>(t.CENTER="center",t))(W||{}),Y=(t=>(t.GRID="grid",t.VERT_OR_HORIZ="vertOrHoriz",t.PIE="pie",t.DONUT="donut",t))(Y||{}),Z=(t=>(t.SEMI="semi",t.FULL="full",t))(Z||{}),X=(t=>(t.ALWAYS="always",t.AUTO="auto",t.NEVER="never",t))(X||{}),q=(t=>(t.SCATTER="scatter",t.LINE="line",t.SIMPLE_BAR="simple-bar",t.STACKED_BAR="stacked-bar",t.GROUPED_BAR="grouped-bar",t.AREA="area",t.STACKED_AREA="stacked-area",t))(q||{}),K=(t=>(t.EXPORT_CSV="Export as CSV",t.EXPORT_PNG="Export as PNG",t.EXPORT_JPG="Export as JPG",t.ZOOM_IN="Zoom in",t.ZOOM_OUT="Zoom out",t.RESET_ZOOM="Reset zoom",t.MAKE_FULLSCREEN="Make fullscreen",t.EXIT_FULLSCREEN="Exit fullscreen",t.SHOW_AS_DATATABLE="Show as data-table",t.CUSTOM="Custom",t))(K||{}),Q=(t=>(t.LEFT="left",t.RIGHT="right",t))(Q||{}),J=(t=>(t.CHECKBOX="checkbox",t.RADIUS="radius",t.AREA="area",t.SIZE="size",t.LINE="line",t.QUARTILE="quartile",t.ZOOM="zoom",t))(J||{}),tt=(t=>(t.ON="on",t.AUTO="auto",t.OFF="off",t))(tt||{}),et=(t=>(t.DEFAULT="default",t.HOVERABLE="hoverable",t))(et||{}),nt=(t=>(t.geoEqualEarth="geoEqualEarth",t.geoAlbers="geoAlbers",t.geoConicEqualArea="geoConicEqualArea",t.geoConicEquidistant="geoConicEquidistant",t.geoEquirectangular="geoEquirectangular",t.geoMercator="geoMercator",t.geoNaturalEarth1="geoNaturalEarth1",t))(nt||{}),it=(t=>(t["15seconds"]="15seconds",t.minute="minute",t["30minutes"]="30minutes",t.hourly="hourly",t.daily="daily",t.weekly="weekly",t.monthly="monthly",t.quarterly="quarterly",t.yearly="yearly",t))(it||{});function rt(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function ot(t){return(e,n)=>{let i;if("formatting"===(n?.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,r=n?.width?String(n.width):e;i=t.formattingValues[r]||t.formattingValues[e]}else{const e=t.defaultWidth,r=n?.width?String(n.width):t.defaultWidth;i=t.values[r]||t.values[e]}return i[t.argumentCallback?t.argumentCallback(e):e]}}function st(t){return(e,n={})=>{const i=n.width,r=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],o=e.match(r);if(!o)return null;const s=o[0],a=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?function(t){for(let e=0;e<t.length;e++)if(t[e].test(s))return e}(a):function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&t[e].test(s))return e}(a);let c;return c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:e.slice(s.length)}}}const at=6048e5,lt=36e5,ct=Symbol.for("constructDateFrom");function ut(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&ct in t?t[ct](e):t instanceof Date?new t.constructor(e):new Date(e)}function ht(t,...e){const n=ut.bind(null,e.find((t=>"object"==typeof t)));return e.map(n)}let dt={};function ft(){return dt}function pt(t,e){return ut(e||t,t)}function gt(t,e){const n=ft(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=pt(t,e?.in),o=r.getDay(),s=(o<i?7:0)+o-i;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}const mt={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"}},yt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vt={ordinalNumber:(t,e)=>{const n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ot({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ot({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:ot({values:{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"]},defaultWidth:"wide"}),day:ot({values:{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"]},defaultWidth:"wide"}),dayPeriod:ot({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},_t={ordinalNumber:(xt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match(xt.matchPattern);if(!n)return null;const i=n[0],r=t.match(xt.parsePattern);if(!r)return null;let o=xt.valueCallback?xt.valueCallback(r[0]):r[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(i.length)}}),era:st({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:st({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:st({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:st({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:st({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},bt={code:"en-US",formatDistance:(t,e,n)=>{let i;const r=mt[t];return i="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:{date:rt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:rt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:rt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},formatRelative:(t,e,n,i)=>yt[t],localize:vt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};var xt,wt="object"==typeof global&&global&&global.Object===Object&&global,Et="object"==typeof self&&self&&self.Object===Object&&self,Tt=wt||Et||Function("return this")(),St=Tt.Symbol,Ot=Object.prototype,Mt=Ot.hasOwnProperty,At=Ot.toString,Ct=St?St.toStringTag:void 0,kt=Object.prototype.toString,Dt=St?St.toStringTag:void 0;function Lt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Dt&&Dt in Object(t)?function(t){var e=Mt.call(t,Ct),n=t[Ct];try{t[Ct]=void 0;var i=!0}catch{}var r=At.call(t);return i&&(e?t[Ct]=n:delete t[Ct]),r}(t):function(t){return kt.call(t)}(t)}function Rt(t){return null!=t&&"object"==typeof t}function It(t){return"symbol"==typeof t||Rt(t)&&"[object Symbol]"==Lt(t)}function Nt(t,e){for(var n=-1,i=null==t?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}var Pt=Array.isArray,Ut=St?St.prototype:void 0,Bt=Ut?Ut.toString:void 0;function Ht(t){if("string"==typeof t)return t;if(Pt(t))return Nt(t,Ht)+"";if(It(t))return Bt?Bt.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Ft(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function zt(t){return t}function $t(t){if(!Ft(t))return!1;var e=Lt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var jt=Tt["__core-js_shared__"],Vt=function(){var t=/[^.]+$/.exec(jt&&jt.keys&&jt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Gt=Function.prototype.toString;function Wt(t){if(null!=t){try{return Gt.call(t)}catch{}try{return t+""}catch{}}return""}var Yt=/^\[object .+?Constructor\]$/,Zt=Function.prototype,Xt=Object.prototype,qt=Zt.toString,Kt=Xt.hasOwnProperty,Qt=RegExp("^"+qt.call(Kt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Jt(t,e){var n=function(t,e){return t?.[e]}(t,e);return function(t){return!(!Ft(t)||function(t){return!!Vt&&Vt in t}(t))&&($t(t)?Qt:Yt).test(Wt(t))}(n)?n:void 0}var te=Jt(Tt,"WeakMap"),ee=Object.create,ne=function(){function t(){}return function(e){if(!Ft(e))return{};if(ee)return ee(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function ie(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}var re=Date.now;function oe(t){return function(){return t}}var se=function(){try{var t=Jt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ae=se?function(t,e){return se(t,"toString",{configurable:!0,enumerable:!1,value:oe(e),writable:!0})}:zt,le=function(t){var e=0,n=0;return function(){var i=re(),r=16-(i-n);if(n=i,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(ae);function ce(t){return t!=t}function ue(t,e){return!(null==t||!t.length)&&function(t,e){return e==e?function(t,e){for(var n=-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}(t,e):function(t,e){for(var n=t.length,i=-1;++i<n;)if(e(t[i],i,t))return i;return-1}(t,ce)}(t,e)>-1}var he=/^(?:0|[1-9]\d*)$/;function de(t,e){var n=typeof t;return!!(e=e??9007199254740991)&&("number"==n||"symbol"!=n&&he.test(t))&&t>-1&&t%1==0&&t<e}function fe(t,e,n){"__proto__"==e&&se?se(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function pe(t,e){return t===e||t!=t&&e!=e}var ge=Object.prototype.hasOwnProperty;function me(t,e,n){var i=t[e];(!ge.call(t,e)||!pe(i,n)||void 0===n&&!(e in t))&&fe(t,e,n)}function ye(t,e,n,i){var r=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var a=e[o],l=void 0;void 0===l&&(l=t[a]),r?fe(n,a,l):me(n,a,l)}return n}var ve=Math.max;function _e(t,e,n){return e=ve(void 0===e?t.length-1:e,0),function(){for(var i=arguments,r=-1,o=ve(i.length-e,0),s=Array(o);++r<o;)s[r]=i[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=i[r];return a[e]=n(s),function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}(t,this,a)}}function be(t,e){return le(_e(t,e,zt),t+"")}function xe(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function we(t){return null!=t&&xe(t.length)&&!$t(t)}var Ee=Object.prototype;function Te(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ee)}function Se(t){return Rt(t)&&"[object Arguments]"==Lt(t)}var Oe=Object.prototype,Me=Oe.hasOwnProperty,Ae=Oe.propertyIsEnumerable,Ce=Se(function(){return arguments}())?Se:function(t){return Rt(t)&&Me.call(t,"callee")&&!Ae.call(t,"callee")},ke="object"==typeof exports&&exports&&!exports.nodeType&&exports,De=ke&&"object"==typeof module&&module&&!module.nodeType&&module,Le=De&&De.exports===ke?Tt.Buffer:void 0,Re=(Le?Le.isBuffer:void 0)||function(){return!1},Ie={};function Ne(t){return function(e){return t(e)}}Ie["[object Float32Array]"]=Ie["[object Float64Array]"]=Ie["[object Int8Array]"]=Ie["[object Int16Array]"]=Ie["[object Int32Array]"]=Ie["[object Uint8Array]"]=Ie["[object Uint8ClampedArray]"]=Ie["[object Uint16Array]"]=Ie["[object Uint32Array]"]=!0,Ie["[object Arguments]"]=Ie["[object Array]"]=Ie["[object ArrayBuffer]"]=Ie["[object Boolean]"]=Ie["[object DataView]"]=Ie["[object Date]"]=Ie["[object Error]"]=Ie["[object Function]"]=Ie["[object Map]"]=Ie["[object Number]"]=Ie["[object Object]"]=Ie["[object RegExp]"]=Ie["[object Set]"]=Ie["[object String]"]=Ie["[object WeakMap]"]=!1;var Pe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ue=Pe&&"object"==typeof module&&module&&!module.nodeType&&module,Be=Ue&&Ue.exports===Pe&&wt.process,He=function(){try{return Ue&&Ue.require&&Ue.require("util").types||Be&&Be.binding&&Be.binding("util")}catch{}}(),Fe=He&&He.isTypedArray,ze=Fe?Ne(Fe):function(t){return Rt(t)&&xe(t.length)&&!!Ie[Lt(t)]},$e=Object.prototype.hasOwnProperty;function je(t,e){var n=Pt(t),i=!n&&Ce(t),r=!n&&!i&&Re(t),o=!n&&!i&&!r&&ze(t),s=n||i||r||o,a=s?function(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}(t.length,String):[],l=a.length;for(var c in t)(e||$e.call(t,c))&&(!s||!("length"==c||r&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||de(c,l)))&&a.push(c);return a}function Ve(t,e){return function(n){return t(e(n))}}var Ge=Ve(Object.keys,Object),We=Object.prototype.hasOwnProperty;function Ye(t){if(!Te(t))return Ge(t);var e=[];for(var n in Object(t))We.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Ze(t){return we(t)?je(t):Ye(t)}var Xe=Object.prototype.hasOwnProperty;function qe(t){return we(t)?je(t,!0):function(t){if(!Ft(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Te(t),n=[];for(var i in t)"constructor"==i&&(e||!Xe.call(t,i))||n.push(i);return n}(t)}var Ke=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qe=/^\w*$/;function Je(t,e){if(Pt(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!It(t))||Qe.test(t)||!Ke.test(t)||null!=e&&t in Object(e)}var tn=Jt(Object,"create"),en=Object.prototype.hasOwnProperty,nn=Object.prototype.hasOwnProperty;function rn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function on(t,e){for(var n=t.length;n--;)if(pe(t[n][0],e))return n;return-1}rn.prototype.clear=function(){this.__data__=tn?tn(null):{},this.size=0},rn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},rn.prototype.get=function(t){var e=this.__data__;if(tn){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return en.call(e,t)?e[t]:void 0},rn.prototype.has=function(t){var e=this.__data__;return tn?void 0!==e[t]:nn.call(e,t)},rn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=tn&&void 0===e?"__lodash_hash_undefined__":e,this};var sn=Array.prototype.splice;function an(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}an.prototype.clear=function(){this.__data__=[],this.size=0},an.prototype.delete=function(t){var e=this.__data__,n=on(e,t);return!(n<0||(n==e.length-1?e.pop():sn.call(e,n,1),--this.size,0))},an.prototype.get=function(t){var e=this.__data__,n=on(e,t);return n<0?void 0:e[n][1]},an.prototype.has=function(t){return on(this.__data__,t)>-1},an.prototype.set=function(t,e){var n=this.__data__,i=on(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this};var ln=Jt(Tt,"Map");function cn(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function un(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function hn(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var s=t.apply(this,i);return n.cache=o.set(r,s)||o,s};return n.cache=new(hn.Cache||un),n}un.prototype.clear=function(){this.size=0,this.__data__={hash:new rn,map:new(ln||an),string:new rn}},un.prototype.delete=function(t){var e=cn(this,t).delete(t);return this.size-=e?1:0,e},un.prototype.get=function(t){return cn(this,t).get(t)},un.prototype.has=function(t){return cn(this,t).has(t)},un.prototype.set=function(t,e){var n=cn(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},hn.Cache=un;var dn,fn,pn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gn=/\\(\\)?/g,mn=(dn=hn((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(pn,(function(t,n,i,r){e.push(i?r.replace(gn,"$1"):n||t)})),e}),(function(t){return 500===fn.size&&fn.clear(),t})),fn=dn.cache,dn);function yn(t){return null==t?"":Ht(t)}function vn(t,e){return Pt(t)?t:Je(t,e)?[t]:mn(yn(t))}function _n(t){if("string"==typeof t||It(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function bn(t,e){for(var n=0,i=(e=vn(e,t)).length;null!=t&&n<i;)t=t[_n(e[n++])];return n&&n==i?t:void 0}function xn(t,e,n){var i=null==t?void 0:bn(t,e);return void 0===i?n:i}function wn(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}var En=St?St.isConcatSpreadable:void 0;function Tn(t){return Pt(t)||Ce(t)||!!(En&&t&&t[En])}function Sn(t,e,n,i,r){var o=-1,s=t.length;for(n||(n=Tn),r||(r=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?Sn(a,e-1,n,i,r):wn(r,a):i||(r[r.length]=a)}return r}var On=Ve(Object.getPrototypeOf,Object),Mn=Function.prototype,An=Object.prototype,Cn=Mn.toString,kn=An.hasOwnProperty,Dn=Cn.call(Object);function Ln(t){if(!Rt(t)||"[object Object]"!=Lt(t))return!1;var e=On(t);if(null===e)return!0;var n=kn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Cn.call(n)==Dn}function Rn(t){var e=this.__data__=new an(t);this.size=e.size}Rn.prototype.clear=function(){this.__data__=new an,this.size=0},Rn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Rn.prototype.get=function(t){return this.__data__.get(t)},Rn.prototype.has=function(t){return this.__data__.has(t)},Rn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof an){var i=n.__data__;if(!ln||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new un(i)}return n.set(t,e),this.size=n.size,this};var In="object"==typeof exports&&exports&&!exports.nodeType&&exports,Nn=In&&"object"==typeof module&&module&&!module.nodeType&&module,Pn=Nn&&Nn.exports===In?Tt.Buffer:void 0,Un=Pn?Pn.allocUnsafe:void 0;function Bn(t,e){if(e)return t.slice();var n=t.length,i=Un?Un(n):new t.constructor(n);return t.copy(i),i}function Hn(){return[]}var Fn=Object.prototype.propertyIsEnumerable,zn=Object.getOwnPropertySymbols,$n=zn?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,i=null==t?0:t.length,r=0,o=[];++n<i;){var s=t[n];e(s)&&(o[r++]=s)}return o}(zn(t),(function(e){return Fn.call(t,e)})))}:Hn,jn=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)wn(e,$n(t)),t=On(t);return e}:Hn;function Vn(t,e,n){var i=e(t);return Pt(t)?i:wn(i,n(t))}function Gn(t){return Vn(t,Ze,$n)}function Wn(t){return Vn(t,qe,jn)}var Yn=Jt(Tt,"DataView"),Zn=Jt(Tt,"Promise"),Xn=Jt(Tt,"Set"),qn="[object Map]",Kn="[object Promise]",Qn="[object Set]",Jn="[object WeakMap]",ti="[object DataView]",ei=Wt(Yn),ni=Wt(ln),ii=Wt(Zn),ri=Wt(Xn),oi=Wt(te),si=Lt;(Yn&&si(new Yn(new ArrayBuffer(1)))!=ti||ln&&si(new ln)!=qn||Zn&&si(Zn.resolve())!=Kn||Xn&&si(new Xn)!=Qn||te&&si(new te)!=Jn)&&(si=function(t){var e=Lt(t),n="[object Object]"==e?t.constructor:void 0,i=n?Wt(n):"";if(i)switch(i){case ei:return ti;case ni:return qn;case ii:return Kn;case ri:return Qn;case oi:return Jn}return e});var ai=Object.prototype.hasOwnProperty,li=Tt.Uint8Array;function ci(t){var e=new t.constructor(t.byteLength);return new li(e).set(new li(t)),e}var ui=/\w*$/,hi=St?St.prototype:void 0,di=hi?hi.valueOf:void 0;function fi(t,e){var n=e?ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function pi(t){return"function"!=typeof t.constructor||Te(t)?{}:ne(On(t))}var gi=He&&He.isMap,mi=gi?Ne(gi):function(t){return Rt(t)&&"[object Map]"==si(t)},yi=He&&He.isSet,vi=yi?Ne(yi):function(t){return Rt(t)&&"[object Set]"==si(t)},_i="[object Arguments]",bi="[object Function]",xi="[object Object]",wi={};function Ei(t,e,n,i,r,o){var s,a=1&e,l=2&e,c=4&e;if(n&&(s=r?n(t,i,r,o):n(t)),void 0!==s)return s;if(!Ft(t))return t;var u=Pt(t);if(u){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ai.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!a)return ie(t,s)}else{var h=si(t),d=h==bi||"[object GeneratorFunction]"==h;if(Re(t))return Bn(t,a);if(h==xi||h==_i||d&&!r){if(s=l||d?{}:pi(t),!a)return l?function(t,e){return ye(t,jn(t),e)}(t,function(t,e){return t&&ye(e,qe(e),t)}(s,t)):function(t,e){return ye(t,$n(t),e)}(t,function(t,e){return t&&ye(e,Ze(e),t)}(s,t))}else{if(!wi[h])return r?t:{};s=function(t,e,n){var i=t.constructor;switch(e){case"[object ArrayBuffer]":return ci(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return function(t,e){var n=e?ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return fi(t,n);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,ui.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return function(t){return di?Object(di.call(t)):{}}(t)}}(t,h,a)}}o||(o=new Rn);var f=o.get(t);if(f)return f;o.set(t,s),vi(t)?t.forEach((function(i){s.add(Ei(i,e,n,i,t,o))})):mi(t)&&t.forEach((function(i,r){s.set(r,Ei(i,e,n,r,t,o))}));var p=u?void 0:(c?l?Wn:Gn:l?qe:Ze)(t);return function(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n););}(p||t,(function(i,r){p&&(i=t[r=i]),me(s,r,Ei(i,e,n,r,t,o))})),s}function Ti(t){return Ei(t,5)}function Si(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new un;++e<n;)this.add(t[e])}function Oi(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}function Mi(t,e){return t.has(e)}function Ai(t,e,n,i,r,o){var s=1&n,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var h=-1,d=!0,f=2&n?new Si:void 0;for(o.set(t,e),o.set(e,t);++h<a;){var p=t[h],g=e[h];if(i)var m=s?i(g,p,h,e,t,o):i(p,g,h,t,e,o);if(void 0!==m){if(m)continue;d=!1;break}if(f){if(!Oi(e,(function(t,e){if(!Mi(f,e)&&(p===t||r(p,t,n,i,o)))return f.push(e)}))){d=!1;break}}else if(p!==g&&!r(p,g,n,i,o)){d=!1;break}}return o.delete(t),o.delete(e),d}function Ci(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}function ki(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}wi[_i]=wi["[object Array]"]=wi["[object ArrayBuffer]"]=wi["[object DataView]"]=wi["[object Boolean]"]=wi["[object Date]"]=wi["[object Float32Array]"]=wi["[object Float64Array]"]=wi["[object Int8Array]"]=wi["[object Int16Array]"]=wi["[object Int32Array]"]=wi["[object Map]"]=wi["[object Number]"]=wi[xi]=wi["[object RegExp]"]=wi["[object Set]"]=wi["[object String]"]=wi["[object Symbol]"]=wi["[object Uint8Array]"]=wi["[object Uint8ClampedArray]"]=wi["[object Uint16Array]"]=wi["[object Uint32Array]"]=!0,wi["[object Error]"]=wi[bi]=wi["[object WeakMap]"]=!1,Si.prototype.add=Si.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Si.prototype.has=function(t){return this.__data__.has(t)};var Di=St?St.prototype:void 0,Li=Di?Di.valueOf:void 0,Ri=Object.prototype.hasOwnProperty,Ii="[object Arguments]",Ni="[object Array]",Pi="[object Object]",Ui=Object.prototype.hasOwnProperty;function Bi(t,e,n,i,r){return t===e||(null==t||null==e||!Rt(t)&&!Rt(e)?t!=t&&e!=e:function(t,e,n,i,r,o){var s=Pt(t),a=Pt(e),l=s?Ni:si(t),c=a?Ni:si(e),u=(l=l==Ii?Pi:l)==Pi,h=(c=c==Ii?Pi:c)==Pi,d=l==c;if(d&&Re(t)){if(!Re(e))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new Rn),s||ze(t)?Ai(t,e,n,i,r,o):function(t,e,n,i,r,o,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new li(t),new li(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return pe(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Ci;case"[object Set]":var l=1&i;if(a||(a=ki),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;i|=2,s.set(t,e);var u=Ai(a(t),a(e),i,r,o,s);return s.delete(t),u;case"[object Symbol]":if(Li)return Li.call(t)==Li.call(e)}return!1}(t,e,l,n,i,r,o);if(!(1&n)){var f=u&&Ui.call(t,"__wrapped__"),p=h&&Ui.call(e,"__wrapped__");if(f||p){var g=f?t.value():t,m=p?e.value():e;return o||(o=new Rn),r(g,m,n,i,o)}}return!!d&&(o||(o=new Rn),function(t,e,n,i,r,o){var s=1&n,a=Gn(t),l=a.length;if(l!=Gn(e).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in e:Ri.call(e,u)))return!1}var h=o.get(t),d=o.get(e);if(h&&d)return h==e&&d==t;var f=!0;o.set(t,e),o.set(e,t);for(var p=s;++c<l;){var g=t[u=a[c]],m=e[u];if(i)var y=s?i(m,g,u,e,t,o):i(g,m,u,t,e,o);if(!(void 0===y?g===m||r(g,m,n,i,o):y)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var v=t.constructor,_=e.constructor;v!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof v&&v instanceof v&&"function"==typeof _&&_ instanceof _)&&(f=!1)}return o.delete(t),o.delete(e),f}(t,e,n,i,r,o))}(t,e,n,i,Bi,r))}function Hi(t){return t==t&&!Ft(t)}function Fi(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}function zi(t,e){return null!=t&&e in Object(t)}function $i(t){return"function"==typeof t?t:null==t?zt:"object"==typeof t?Pt(t)?function(t,e){return Je(t)&&Hi(e)?Fi(_n(t),e):function(n){var i=xn(n,t);return void 0===i&&i===e?function(t,e){return null!=t&&function(t,e,n){for(var i=-1,r=(e=vn(e,t)).length,o=!1;++i<r;){var s=_n(e[i]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++i!=r?o:!!(r=null==t?0:t.length)&&xe(r)&&de(s,r)&&(Pt(t)||Ce(t))}(t,e,zi)}(n,t):Bi(e,i,3)}}(t[0],t[1]):function(t){var e=function(t){for(var e=Ze(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,Hi(r)]}return e}(t);return 1==e.length&&e[0][2]?Fi(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n){var i=n.length,r=i;if(null==t)return!r;for(t=Object(t);i--;){var o=n[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<r;){var s=(o=n[i])[0],a=t[s],l=o[1];if(o[2]){if(void 0===a&&!(s in t))return!1}else if(!Bi(l,a,3,void 0,new Rn))return!1}return!0}(n,0,e)}}(t):function(t){return Je(t)?function(t){return function(e){return e?.[t]}}(_n(t)):function(t){return function(e){return bn(e,t)}}(t)}(t)}var ji=function(t,e,n){for(var i=-1,r=Object(t),o=n(t),s=o.length;s--;){var a=o[++i];if(!1===e(r[a],a,r))break}return t};function Vi(t,e,n){(void 0!==n&&!pe(t[e],n)||void 0===n&&!(e in t))&&fe(t,e,n)}function Gi(t){return Rt(t)&&we(t)}function Wi(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Yi(t,e,n,i,r){t!==e&&ji(e,(function(o,s){if(r||(r=new Rn),Ft(o))!function(t,e,n,i,r,o,s){var a=Wi(t,n),l=Wi(e,n),c=s.get(l);if(c)Vi(t,n,c);else{var u=o?o(a,l,n+"",t,e,s):void 0,h=void 0===u;if(h){var d=Pt(l),f=!d&&Re(l),p=!d&&!f&&ze(l);u=l,d||f||p?Pt(a)?u=a:Gi(a)?u=ie(a):f?(h=!1,u=Bn(l,!0)):p?(h=!1,u=fi(l,!0)):u=[]:Ln(l)||Ce(l)?(u=a,Ce(a)?u=function(t){return ye(t,qe(t))}(a):(!Ft(a)||$t(a))&&(u=pi(l))):h=!1}h&&(s.set(l,u),r(u,l,i,o,s),s.delete(l)),Vi(t,n,u)}}(t,e,s,n,Yi,i,r);else{var a=i?i(Wi(t,s),o,s+"",t,e,r):void 0;void 0===a&&(a=o),Vi(t,s,a)}}),qe)}function Zi(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Xi=Object.prototype.hasOwnProperty;var qi=function(t){return be((function(e,n){var i=-1,r=n.length,o=r>1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(r--,o):void 0,s&&function(t,e,n){if(!Ft(n))return!1;var i=typeof e;return!!("number"==i?we(n)&&de(e,n.length):"string"==i&&e in n)&&pe(n[e],t)}(n[0],n[1],s)&&(o=r<3?void 0:o,r=1),e=Object(e);++i<r;){var a=n[i];a&&t(e,a,i)}return e}))}((function(t,e,n){Yi(t,e,n)})),Ki=Xn&&1/ki(new Xn([,-0]))[1]==1/0?function(t){return new Xn(t)}:function(){};function Qi(t,e,n){var i=-1,r=ue,o=t.length,s=!0,a=[],l=a;if(o>=200){var c=e?null:Ki(t);if(c)return ki(c);s=!1,r=Mi,l=new Si}else l=e?[]:a;t:for(;++i<o;){var u=t[i],h=e?e(u):u;if(u=0!==u?u:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue t;e&&l.push(h),a.push(u)}else r(l,h,n)||(l!==a&&l.push(h),a.push(u))}return a}var Ji=be((function(t){var e=Zi(t);return Gi(e)&&(e=void 0),Qi(Sn(t,1,Gi,!0),$i(e))}));function tr(t){return t&&t.length?Qi(t):[]}function er(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function nr(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ir(t){let e,n,i;function r(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<0?r=e+1:o=e}while(r<o)}return r}return 2!==t.length?(e=er,n=(e,n)=>er(t(e),n),i=(e,n)=>t(e)-n):(e=t===er||t===nr?t:rr,n=t,i=t),{left:r,center:function(t,e,n=0,o=t.length){const s=r(t,e,n,o-1);return s>n&&i(t[s-1],e)>-i(t[s],e)?s-1:s},right:function(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<=0?r=e+1:o=e}while(r<o)}return r}}}function rr(){return 0}const or=ir(er).right;function sr(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(void 0===n?o>=o&&(n=i=o):(n>o&&(n=o),i<o&&(i=o)))}return[n,i]}ir((function(t){return null===t?NaN:+t})).center;let ar=class extends Map{constructor(t,e=cr){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(lr(this,t))}has(t){return super.has(lr(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}(this,t))}};function lr({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function cr(t){return null!==t&&"object"==typeof t?t.valueOf():t}const ur=Math.sqrt(50),hr=Math.sqrt(10),dr=Math.sqrt(2);function fr(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=ur?10:o>=hr?5:o>=dr?2:1;let a,l,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(t*c),l=Math.round(e*c),a/c<t&&++a,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*s,a=Math.round(t/c),l=Math.round(e/c),a*c<t&&++a,l*c>e&&--l),l<a&&.5<=n&&n<2?fr(t,e,2*n):[a,l,c]}function pr(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const i=e<t,[r,o,s]=i?fr(e,t,n):fr(t,e,n);if(!(o>=r))return[];const a=o-r+1,l=new Array(a);if(i)if(s<0)for(let t=0;t<a;++t)l[t]=(o-t)/-s;else for(let t=0;t<a;++t)l[t]=(o-t)*s;else if(s<0)for(let t=0;t<a;++t)l[t]=(r+t)/-s;else for(let t=0;t<a;++t)l[t]=(r+t)*s;return l}function gr(t,e,n){return fr(t=+t,e=+e,n=+n)[2]}function mr(t,e,n){n=+n;const i=(e=+e)<(t=+t),r=i?gr(e,t,n):gr(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}function yr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}var vr={value:()=>{}};function _r(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new br(i)}function br(t){this._=t}function xr(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function wr(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=vr,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}br.prototype=_r.prototype={constructor:br,on:function(t,e){var n,i=this._,r=function(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",i),o=-1,s=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=r[o]).type)i[n]=wr(i[n],t.name,e);else if(null==e)for(n in i)i[n]=wr(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=r[o]).type)&&(n=xr(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new br(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};var Er="http://www.w3.org/1999/xhtml";const Tr={svg:"http://www.w3.org/2000/svg",xhtml:Er,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Sr(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Tr.hasOwnProperty(e)?{space:Tr[e],local:t}:t}function Or(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Er&&e.documentElement.namespaceURI===Er?e.createElement(t):e.createElementNS(n,t)}}function Mr(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ar(t){var e=Sr(t);return(e.local?Mr:Or)(e)}function Cr(){}function kr(t){return null==t?Cr:function(){return this.querySelector(t)}}function Dr(){return[]}function Lr(t){return null==t?Dr:function(){return this.querySelectorAll(t)}}function Rr(t){return function(){return this.matches(t)}}function Ir(t){return function(e){return e.matches(t)}}var Nr=Array.prototype.find;function Pr(){return this.firstElementChild}var Ur=Array.prototype.filter;function Br(){return Array.from(this.children)}function Hr(t){return new Array(t.length)}function Fr(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function zr(t,e,n,i,r,o){for(var s,a=0,l=e.length,c=o.length;a<c;++a)(s=e[a])?(s.__data__=o[a],i[a]=s):n[a]=new Fr(t,o[a]);for(;a<l;++a)(s=e[a])&&(r[a]=s)}function $r(t,e,n,i,r,o,s){var a,l,c,u=new Map,h=e.length,d=o.length,f=new Array(h);for(a=0;a<h;++a)(l=e[a])&&(f[a]=c=s.call(l,l.__data__,a,e)+"",u.has(c)?r[a]=l:u.set(c,l));for(a=0;a<d;++a)c=s.call(t,o[a],a,o)+"",(l=u.get(c))?(i[a]=l,l.__data__=o[a],u.delete(c)):n[a]=new Fr(t,o[a]);for(a=0;a<h;++a)(l=e[a])&&u.get(f[a])===l&&(r[a]=l)}function jr(t){return t.__data__}function Vr(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Gr(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Wr(t){return function(){this.removeAttribute(t)}}function Yr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zr(t,e){return function(){this.setAttribute(t,e)}}function Xr(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function qr(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Kr(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Qr(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Jr(t){return function(){this.style.removeProperty(t)}}function to(t,e,n){return function(){this.style.setProperty(t,e,n)}}function eo(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function no(t,e){return t.style.getPropertyValue(e)||Qr(t).getComputedStyle(t,null).getPropertyValue(e)}function io(t){return function(){delete this[t]}}function ro(t,e){return function(){this[t]=e}}function oo(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function so(t){return t.trim().split(/^|\s+/)}function ao(t){return t.classList||new lo(t)}function lo(t){this._node=t,this._names=so(t.getAttribute("class")||"")}function co(t,e){for(var n=ao(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function uo(t,e){for(var n=ao(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function ho(t){return function(){co(this,t)}}function fo(t){return function(){uo(this,t)}}function po(t,e){return function(){(e.apply(this,arguments)?co:uo)(this,t)}}function go(){this.textContent=""}function mo(t){return function(){this.textContent=t}}function yo(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function vo(){this.innerHTML=""}function _o(t){return function(){this.innerHTML=t}}function bo(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function xo(){this.nextSibling&&this.parentNode.appendChild(this)}function wo(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Eo(){return null}function To(){var t=this.parentNode;t&&t.removeChild(this)}function So(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Oo(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Mo(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,o=e.length;i<o;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function Ao(t,e,n){return function(){var i,r=this.__on,o=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),void(i.value=e);this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Co(t,e,n){var i=Qr(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function ko(t,e){return function(){return Co(this,t,e)}}function Do(t,e){return function(){return Co(this,t,e.apply(this,arguments))}}Fr.prototype={constructor:Fr,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},lo.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Lo=[null];function Ro(t,e){this._groups=t,this._parents=e}function Io(){return new Ro([[document.documentElement]],Lo)}function No(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}function Po(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Uo(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Bo(){}Ro.prototype=Io.prototype={constructor:Ro,select:function(t){"function"!=typeof t&&(t=kr(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s,a=e[r],l=a.length,c=i[r]=new Array(l),u=0;u<l;++u)(o=a[u])&&(s=t.call(o,o.__data__,u,a))&&("__data__"in o&&(s.__data__=o.__data__),c[u]=s);return new Ro(i,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}(t):Lr(t);for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var s,a=e[o],l=a.length,c=0;c<l;++c)(s=a[c])&&(i.push(t.call(s,s.__data__,c,a)),r.push(s));return new Ro(i,r)},selectChild:function(t){return this.select(null==t?Pr:function(t){return function(){return Nr.call(this.children,t)}}("function"==typeof t?t:Ir(t)))},selectChildren:function(t){return this.selectAll(null==t?Br:function(t){return function(){return Ur.call(this.children,t)}}("function"==typeof t?t:Ir(t)))},filter:function(t){"function"!=typeof t&&(t=Rr(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],c=0;c<a;++c)(o=s[c])&&t.call(o,o.__data__,c,s)&&l.push(o);return new Ro(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,jr);var n=e?$r:zr,i=this._parents,r=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var o=r.length,s=new Array(o),a=new Array(o),l=new Array(o),c=0;c<o;++c){var u=i[c],h=r[c],d=h.length,f=Vr(t.call(u,u&&u.__data__,c,i)),p=f.length,g=a[c]=new Array(p),m=s[c]=new Array(p);n(u,h,g,m,l[c]=new Array(d),f,e);for(var y,v,_=0,b=0;_<p;++_)if(y=g[_]){for(_>=b&&(b=_+1);!(v=m[b])&&++b<p;);y._next=v||null}}return(s=new Ro(s,i))._enter=a,s._exit=l,s},enter:function(){return new Ro(this._enter||this._groups.map(Hr),this._parents)},exit:function(){return new Ro(this._exit||this._groups.map(Hr),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,o=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?o.remove():n(o),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,o=i.length,s=Math.min(r,o),a=new Array(r),l=0;l<s;++l)for(var c,u=n[l],h=i[l],d=u.length,f=a[l]=new Array(d),p=0;p<d;++p)(c=u[p]||h[p])&&(f[p]=c);for(;l<r;++l)a[l]=n[l];return new Ro(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],o=r.length-1,s=r[o];--o>=0;)(i=r[o])&&(s&&4^i.compareDocumentPosition(s)&&s.parentNode.insertBefore(i,s),s=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Gr);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var s,a=n[o],l=a.length,c=r[o]=new Array(l),u=0;u<l;++u)(s=a[u])&&(c[u]=s);c.sort(e)}return new Ro(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var s=i[r];if(s)return s}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,o=e[n],s=0,a=o.length;s<a;++s)(r=o[s])&&t.call(r,r.__data__,s,o);return this},attr:function(t,e){var n=Sr(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?Yr:Wr:"function"==typeof e?n.local?Kr:qr:n.local?Xr:Zr)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Jr:"function"==typeof e?eo:to)(t,e,n??"")):no(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?io:"function"==typeof e?oo:ro)(t,e)):this.node()[t]},classed:function(t,e){var n=so(t+"");if(arguments.length<2){for(var i=ao(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?po:e?ho:fo)(n,e))},text:function(t){return arguments.length?this.each(null==t?go:("function"==typeof t?yo:mo)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?vo:("function"==typeof t?bo:_o)(t)):this.node().innerHTML},raise:function(){return this.each(xo)},lower:function(){return this.each(wo)},append:function(t){var e="function"==typeof t?t:Ar(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:Ar(t),i=null==e?Eo:"function"==typeof e?e:kr(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(To)},clone:function(t){return this.select(t?Oo:So)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,o=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),s=o.length;if(!(arguments.length<2)){for(a=e?Ao:Mo,i=0;i<s;++i)this.each(a(o[i],e,n));return this}var a=this.node().__on;if(a)for(var l,c=0,u=a.length;c<u;++c)for(i=0,l=a[c];i<s;++i)if((r=o[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?Do:ko)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],o=0,s=r.length;o<s;++o)(i=r[o])&&(yield i)}};var Ho=.7,Fo=1/Ho,zo="\\s*([+-]?\\d+)\\s*",$o="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Vo=/^#([0-9a-f]{3,8})$/,Go=new RegExp(`^rgb\\(${zo},${zo},${zo}\\)$`),Wo=new RegExp(`^rgb\\(${jo},${jo},${jo}\\)$`),Yo=new RegExp(`^rgba\\(${zo},${zo},${zo},${$o}\\)$`),Zo=new RegExp(`^rgba\\(${jo},${jo},${jo},${$o}\\)$`),Xo=new RegExp(`^hsl\\(${$o},${jo},${jo}\\)$`),qo=new RegExp(`^hsla\\(${$o},${jo},${jo},${$o}\\)$`),Ko={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};function Qo(){return this.rgb().formatHex()}function Jo(){return this.rgb().formatRgb()}function ts(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Vo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?es(e):3===n?new rs(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ns(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ns(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Go.exec(t))?new rs(e[1],e[2],e[3],1):(e=Wo.exec(t))?new rs(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Yo.exec(t))?ns(e[1],e[2],e[3],e[4]):(e=Zo.exec(t))?ns(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Xo.exec(t))?us(e[1],e[2]/100,e[3]/100,1):(e=qo.exec(t))?us(e[1],e[2]/100,e[3]/100,e[4]):Ko.hasOwnProperty(t)?es(Ko[t]):"transparent"===t?new rs(NaN,NaN,NaN,0):null}function es(t){return new rs(t>>16&255,t>>8&255,255&t,1)}function ns(t,e,n,i){return i<=0&&(t=e=n=NaN),new rs(t,e,n,i)}function is(t,e,n,i){return 1===arguments.length?function(t){return t instanceof Bo||(t=ts(t)),t?new rs((t=t.rgb()).r,t.g,t.b,t.opacity):new rs}(t):new rs(t,e,n,i??1)}function rs(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function os(){return`#${cs(this.r)}${cs(this.g)}${cs(this.b)}`}function ss(){const t=as(this.opacity);return`${1===t?"rgb(":"rgba("}${ls(this.r)}, ${ls(this.g)}, ${ls(this.b)}${1===t?")":`, ${t})`}`}function as(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ls(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function cs(t){return((t=ls(t))<16?"0":"")+t.toString(16)}function us(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ds(t,e,n,i)}function hs(t){if(t instanceof ds)return new ds(t.h,t.s,t.l,t.opacity);if(t instanceof Bo||(t=ts(t)),!t)return new ds;if(t instanceof ds)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=e===o?(n-i)/a+6*(n<i):n===o?(i-e)/a+2:(e-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new ds(s,a,l,t.opacity)}function ds(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function fs(t){return(t=(t||0)%360)<0?t+360:t}function ps(t){return Math.max(0,Math.min(1,t||0))}function gs(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Po(Bo,ts,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Qo,formatHex:Qo,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return hs(this).formatHsl()},formatRgb:Jo,toString:Jo}),Po(rs,is,Uo(Bo,{brighter(t){return t=null==t?Fo:Math.pow(Fo,t),new rs(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ho:Math.pow(Ho,t),new rs(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new rs(ls(this.r),ls(this.g),ls(this.b),as(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:os,formatHex:os,formatHex8:function(){return`#${cs(this.r)}${cs(this.g)}${cs(this.b)}${cs(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ss,toString:ss})),Po(ds,(function(t,e,n,i){return 1===arguments.length?hs(t):new ds(t,e,n,i??1)}),Uo(Bo,{brighter(t){return t=null==t?Fo:Math.pow(Fo,t),new ds(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ho:Math.pow(Ho,t),new ds(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new rs(gs(t>=240?t-240:t+120,r,i),gs(t,r,i),gs(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new ds(fs(this.h),ps(this.s),ps(this.l),as(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 t=as(this.opacity);return`${1===t?"hsl(":"hsla("}${fs(this.h)}, ${100*ps(this.s)}%, ${100*ps(this.l)}%${1===t?")":`, ${t})`}`}}));const ms=t=>()=>t;function ys(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):ms(isNaN(t)?e:t)}const vs=function t(e){var n=function(t){return 1==(t=+t)?ys:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):ms(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=is(t)).r,(e=is(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),s=ys(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function _s(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(o){for(n=0;n<i;++n)r[n]=t[n]*(1-o)+e[n]*o;return r}}function bs(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),s=new Array(i);for(n=0;n<r;++n)o[n]=Ms(t[n],e[n]);for(;n<i;++n)s[n]=e[n];return function(t){for(n=0;n<r;++n)s[n]=o[n](t);return s}}function xs(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function ws(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Es(t,e){var n,i={},r={};for(n in(null===t||"object"!=typeof t)&&(t={}),(null===e||"object"!=typeof e)&&(e={}),e)n in t?i[n]=Ms(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var Ts=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ss=new RegExp(Ts.source,"g");function Os(t,e){var n,i,r,o=Ts.lastIndex=Ss.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=Ts.exec(t))&&(i=Ss.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:ws(n,i)})),o=Ss.lastIndex;return o<e.length&&(r=e.slice(o),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)a[(n=l[i]).i]=n.x(t);return a.join("")})}function Ms(t,e){var n,i=typeof e;return null==e||"boolean"===i?ms(e):("number"===i?ws:"string"===i?(n=ts(e))?(e=n,vs):Os:e instanceof ts?vs:e instanceof Date?xs:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?_s:Array.isArray(e)?bs:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Es:ws)(t,e)}function As(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Cs,ks=180/Math.PI,Ds={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ls(t,e,n,i,r,o){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(e,t)*ks,skewX:Math.atan(l)*ks,scaleX:s,scaleY:a}}function Rs(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(o,s){var a=[],l=[];return o=t(o),s=t(s),function(t,i,r,o,s,a){if(t!==r||i!==o){var l=s.push("translate(",null,e,null,n);a.push({i:l-4,x:ws(t,r)},{i:l-2,x:ws(i,o)})}else(r||o)&&s.push("translate("+r+e+o+n)}(o.translateX,o.translateY,s.translateX,s.translateY,a,l),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:ws(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,s.rotate,a,l),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:ws(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,s.skewX,a,l),function(t,e,n,i,o,s){if(t!==n||e!==i){var a=o.push(r(o)+"scale(",null,",",null,")");s.push({i:a-4,x:ws(t,n)},{i:a-2,x:ws(e,i)})}else(1!==n||1!==i)&&o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,l),o=s=null,function(t){for(var e,n=-1,i=l.length;++n<i;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var Is,Ns,Ps=Rs((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ds:Ls(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Us=Rs((function(t){return null!=t&&(Cs||(Cs=document.createElementNS("http://www.w3.org/2000/svg","g")),Cs.setAttribute("transform",t),t=Cs.transform.baseVal.consolidate())?Ls((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Ds}),", ",")",")"),Bs=0,Hs=0,Fs=0,zs=0,$s=0,js=0,Vs="object"==typeof performance&&performance.now?performance:Date,Gs="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ws(){return $s||(Gs(Ys),$s=Vs.now()+js)}function Ys(){$s=0}function Zs(){this._call=this._time=this._next=null}function Xs(t,e,n){var i=new Zs;return i.restart(t,e,n),i}function qs(){$s=(zs=Vs.now())+js,Bs=Hs=0;try{!function(){Ws(),++Bs;for(var t,e=Is;e;)(t=$s-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Bs}()}finally{Bs=0,function(){for(var t,e,n=Is,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Is=e);Ns=t,Qs(i)}(),$s=0}}function Ks(){var t=Vs.now(),e=t-zs;e>1e3&&(js-=e,zs=t)}function Qs(t){Bs||(Hs&&(Hs=clearTimeout(Hs)),t-$s>24?(t<1/0&&(Hs=setTimeout(qs,t-Vs.now()-js)),Fs&&(Fs=clearInterval(Fs))):(Fs||(zs=Vs.now(),Fs=setInterval(Ks,1e3)),Bs=1,Gs(qs)))}function Js(t,e,n){var i=new Zs;return e=null==e?0:+e,i.restart((n=>{i.stop(),t(n+e)}),e,n),i}Zs.prototype=Xs.prototype={constructor:Zs,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Ws():+n)+(null==e?0:+e),!this._next&&Ns!==this&&(Ns?Ns._next=this:Is=this,Ns=this),this._call=t,this._time=n,Qs()},stop:function(){this._call&&(this._call=null,this._time=1/0,Qs())}};var ta=_r("start","end","cancel","interrupt"),ea=[];function na(t,e,n,i,r,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function o(l){var c,u,h,d;if(1!==n.state)return a();for(c in r)if((d=r[c]).name===n.name){if(3===d.state)return Js(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[c]):+c<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[c])}if(Js((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(l))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(h=n.tween.length),c=0,u=-1;c<h;++c)(d=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++u]=d);i.length=u+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(a),n.state=5,1),o=-1,s=i.length;++o<s;)i[o].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),a())}function a(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=Xs((function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}),0,n.time)}(t,n,{name:e,index:i,group:r,on:ta,tween:ea,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function ia(t,e){var n=oa(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function ra(t,e){var n=oa(t,e);if(n.state>3)throw new Error("too late; already running");return n}function oa(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function sa(t,e){var n,i,r,o=t.__transition,s=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[r]):s=!1;s&&delete t.__transition}}function aa(t,e){var n,i;return function(){var r=ra(this,t),o=r.tween;if(o!==n)for(var s=0,a=(i=n=o).length;s<a;++s)if(i[s].name===e){(i=i.slice()).splice(s,1);break}r.tween=i}}function la(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var o=ra(this,t),s=o.tween;if(s!==i){r=(i=s).slice();for(var a={name:e,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===e){r[l]=a;break}l===c&&r.push(a)}o.tween=r}}function ca(t,e,n){var i=t._id;return t.each((function(){var t=ra(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return oa(t,i).value[e]}}function ua(t,e){var n;return("number"==typeof e?ws:e instanceof ts?vs:(n=ts(e))?(e=n,vs):Os)(t,e)}function ha(t){return function(){this.removeAttribute(t)}}function da(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fa(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttribute(t);return s===o?null:s===i?r:r=e(i=s,n)}}function pa(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===i?r:r=e(i=s,n)}}function ga(t,e,n){var i,r,o;return function(){var s,a,l=n(this);return null==l?void this.removeAttribute(t):(s=this.getAttribute(t))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l))}}function ma(t,e,n){var i,r,o;return function(){var s,a,l=n(this);return null==l?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l))}}function ya(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,r)),n}return r._value=e,r}function va(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,r)),n}return r._value=e,r}function _a(t,e){return function(){ia(this,t).delay=+e.apply(this,arguments)}}function ba(t,e){return e=+e,function(){ia(this,t).delay=e}}function xa(t,e){return function(){ra(this,t).duration=+e.apply(this,arguments)}}function wa(t,e){return e=+e,function(){ra(this,t).duration=e}}var Ea=Io.prototype.constructor;function Ta(t){return function(){this.style.removeProperty(t)}}var Sa=0;function Oa(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Ma(){return++Sa}var Aa=Io.prototype;function Ca(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Oa.prototype={constructor:Oa,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=kr(t));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s<r;++s)for(var a,l,c=i[s],u=c.length,h=o[s]=new Array(u),d=0;d<u;++d)(a=c[d])&&(l=t.call(a,a.__data__,d,c))&&("__data__"in a&&(l.__data__=a.__data__),h[d]=l,na(h[d],e,n,d,h,oa(a,n)));return new Oa(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Lr(t));for(var i=this._groups,r=i.length,o=[],s=[],a=0;a<r;++a)for(var l,c=i[a],u=c.length,h=0;h<u;++h)if(l=c[h]){for(var d,f=t.call(l,l.__data__,h,c),p=oa(l,n),g=0,m=f.length;g<m;++g)(d=f[g])&&na(d,e,n,g,f,p);o.push(f),s.push(l)}return new Oa(o,s,e,n)},selectChild:Aa.selectChild,selectChildren:Aa.selectChildren,filter:function(t){"function"!=typeof t&&(t=Rr(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],c=0;c<a;++c)(o=s[c])&&t.call(o,o.__data__,c,s)&&l.push(o);return new Oa(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),s=new Array(i),a=0;a<o;++a)for(var l,c=e[a],u=n[a],h=c.length,d=s[a]=new Array(h),f=0;f<h;++f)(l=c[f]||u[f])&&(d[f]=l);for(;a<i;++a)s[a]=e[a];return new Oa(s,this._parents,this._name,this._id)},selection:function(){return new Ea(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Ma(),i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,c=0;c<l;++c)if(s=a[c]){var u=oa(s,e);na(s,t,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Oa(i,this._parents,t,n)},call:Aa.call,nodes:Aa.nodes,node:Aa.node,size:Aa.size,empty:Aa.empty,each:Aa.each,on:function(t,e){var n=this._id;return arguments.length<2?oa(this.node(),n).on.on(t):this.each(function(t,e,n){var i,r,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ia:ra;return function(){var s=o(this,t),a=s.on;a!==i&&(r=(i=a).copy()).on(e,n),s.on=r}}(n,t,e))},attr:function(t,e){var n=Sr(t),i="transform"===n?Us:ua;return this.attrTween(t,"function"==typeof e?(n.local?ma:ga)(n,i,ca(this,"attr."+t,e)):null==e?(n.local?da:ha)(n):(n.local?pa:fa)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=Sr(t);return this.tween(n,(i.local?ya:va)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?Ps:ua;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var o=no(this,t),s=(this.style.removeProperty(t),no(this,t));return o===s?null:o===n&&s===i?r:r=e(n=o,i=s)}}(t,i)).on("end.style."+t,Ta(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,o;return function(){var s=no(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=no(this,t)),s===l?null:s===i&&l===r?o:(r=l,o=e(i=s,a))}}(t,i,ca(this,"style."+t,e))).each(function(t,e){var n,i,r,o,s="style."+e,a="end."+s;return function(){var l=ra(this,t),c=l.on,u=null==l.value[s]?o||(o=Ta(e)):void 0;(c!==n||r!==u)&&(i=(n=c).copy()).on(a,r=u),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,o=n+"";return function(){var s=no(this,t);return s===o?null:s===i?r:r=e(i=s,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,r;function o(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,o,n)),i}return o._value=e,o}(t,e,n??""))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=e??""}}(ca(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=oa(this.node(),n).tween,o=0,s=r.length;o<s;++o)if((i=r[o]).name===t)return i.value;return null}return this.each((null==e?aa:la)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?_a:ba)(e,t)):oa(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?xa:wa)(e,t)):oa(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){ra(this,t).ease=e}}(e,t)):oa(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;ra(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise((function(o,s){var a={value:s},l={value:function(){0===--r&&o()}};n.each((function(){var n=ra(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e})),0===r&&o()}))},[Symbol.iterator]:Aa[Symbol.iterator]};var ka={time:null,delay:0,duration:250,ease:Ca};function Da(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function La(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Ra(t){return(t=La(Math.abs(t)))?t[1]:NaN}Io.prototype.interrupt=function(t){return this.each((function(){sa(this,t)}))},Io.prototype.transition=function(t){var e,n;t instanceof Oa?(e=t._id,t=t._name):(e=Ma(),(n=ka).time=Ws(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,c=0;c<l;++c)(s=a[c])&&na(s,t,e,c,a,n||Da(s,e));return new Oa(i,this._parents,t,e)};var Ia,Na=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Pa(t){if(!(e=Na.exec(t)))throw new Error("invalid format: "+t);var e;return new Ua({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Ua(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ba(t,e){var n=La(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}Pa.prototype=Ua.prototype,Ua.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Ha={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ba(100*t,e),r:Ba,s:function(t,e){var n=La(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(Ia=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+La(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Fa(t){return t}var za,$a,ja,Va=Array.prototype.map,Ga=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Wa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}za=function(t){var e=void 0===t.grouping||void 0===t.thousands?Fa:function(t,e){return function(n,i){for(var r=n.length,o=[],s=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(n.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}(Va.call(t.grouping,Number),t.thousands+""),n=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",r=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?Fa:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Va.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",a=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function c(t){var c=(t=Pa(t)).fill,u=t.align,h=t.sign,d=t.symbol,f=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):Ha[v]||(void 0===m&&(m=12),y=!0,v="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="=");var _="$"===d?n:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===d?i:/[%p]/.test(v)?s:"",x=Ha[v],w=/[defgprs%]/.test(v);function E(t){var n,i,s,d=_,E=b;if("c"===v)E=x(t)+E,t="";else{var T=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:x(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),T&&0==+t&&"+"!==h&&(T=!1),d=(T?"("===h?h:a:"-"===h||"("===h?"":h)+d,E=("s"===v?Ga[8+Ia/3]:"")+E+(T&&"("===h?")":""),w)for(n=-1,i=t.length;++n<i;)if(48>(s=t.charCodeAt(n))||s>57){E=(46===s?r+t.slice(n+1):t.slice(n))+E,t=t.slice(0,n);break}}g&&!f&&(t=e(t,1/0));var S=d.length+t.length+E.length,O=S<p?new Array(p-S+1).join(c):"";switch(g&&f&&(t=e(O+t,O.length?p-E.length:1/0),O=""),u){case"<":t=d+t+E+O;break;case"=":t=d+O+t+E;break;case"^":t=O.slice(0,S=O.length>>1)+d+t+E+O.slice(S);break;default:t=O+d+t+E}return o(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),E.toString=function(){return t+""},E}return{format:c,formatPrefix:function(t,e){var n=c(((t=Pa(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Ra(e)/3))),r=Math.pow(10,-i),o=Ga[8+i/3];return function(t){return n(r*t)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),$a=za.format,ja=za.formatPrefix;const Ya=Symbol("implicit");function Za(){var t=new ar,e=[],n=[],i=Ya;function r(r){let o=t.get(r);if(void 0===o){if(i!==Ya)return i;t.set(r,o=e.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new ar;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return Za(e,n).unknown(i)},Wa.apply(r,arguments),r}function Xa(t){return+t}var qa=[0,1];function Ka(t){return t}function Qa(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function Ja(t,e,n){var i=t[0],r=t[1],o=e[0],s=e[1];return r<i?(i=Qa(r,i),o=n(s,o)):(i=Qa(i,r),o=n(o,s)),function(t){return o(i(t))}}function tl(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)r[s]=Qa(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(e){var n=or(t,e,1,i)-1;return o[n](r[n](e))}}function el(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function nl(){var t,e,n,i,r,o,s=qa,a=qa,l=Ms,c=Ka;function u(){var t=Math.min(s.length,a.length);return c!==Ka&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(s[0],s[t-1])),i=t>2?tl:Ja,r=o=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(s.map(t),a,l)))(t(c(e)))}return h.invert=function(n){return c(e((o||(o=i(a,s.map(t),ws)))(n)))},h.domain=function(t){return arguments.length?(s=Array.from(t,Xa),u()):s.slice()},h.range=function(t){return arguments.length?(a=Array.from(t),u()):a.slice()},h.rangeRound=function(t){return a=Array.from(t),l=As,u()},h.clamp=function(t){return arguments.length?(c=!!t||Ka,u()):c!==Ka},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,u()}}function il(){return nl()(Ka,Ka)}function rl(t){var e=t.domain;return t.ticks=function(t){var n=e();return pr(n[0],n[n.length-1],t??10)},t.tickFormat=function(t,n){var i=e();return function(t,e,n,i){var r,o=mr(t,e,n);switch((i=Pa(i??",f")).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null==i.precision&&!isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ra(e)/3)))-Ra(Math.abs(t)))}(o,s))&&(i.precision=r),ja(i,s);case"":case"e":case"g":case"p":case"r":null==i.precision&&!isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ra(e)-Ra(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=r-("e"===i.type));break;case"f":case"%":null==i.precision&&!isNaN(r=function(t){return Math.max(0,-Ra(Math.abs(t)))}(o))&&(i.precision=r-2*("%"===i.type))}return $a(i)}(i[0],i[i.length-1],t??10,n)},t.nice=function(n){null==n&&(n=10);var i,r,o=e(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(r=l,l=c,c=r,r=s,s=a,a=r);u-- >0;){if((r=gr(l,c,n))===i)return o[s]=l,o[a]=c,e(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function ol(){var t=il();return t.copy=function(){return el(t,ol())},Wa.apply(t,arguments),rl(t)}function sl(t,e,n){this.k=t,this.x=e,this.y=n}sl.prototype={constructor:sl,scale:function(t){return 1===t?this:new sl(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new sl(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},sl.prototype;const al="cds",ll=7,cl=2.5,ul=3.5,hl={reference:"value",compareTo:"marker"},dl=4,fl={duration:1e3,ease:Ca,zoomLevel:3},pl={"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1},gl={defaultBins:10},ml={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}},yl=.3,vl=1,_l=24,bl={defaultOffset:4,horizontalOffset:10},xl={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}},wl={height:{[P.GRAPH_VIEW]:32,[P.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},El=[{type:J.RADIUS,name:"Radius"},{type:J.AREA,name:"Poor area"},{type:J.AREA,name:"Satisfactory area"},{type:J.AREA,name:"Great area"},{type:J.QUARTILE,name:"Quartiles"}],Tl={type:U.END_LINE,threshold:16,numCharacter:14},Sl={code:typeof navigator<"u"&&navigator?.language||"en-US",number:(t,e=navigator?.language||"en-US")=>t?.toLocaleString?.(e),date:(t,e=navigator?.language||"en-US",n={},i=null)=>i||t.toLocaleDateString(e,n),time:(t,e=navigator?.language||"en-US",n={},i=null)=>i||t.toLocaleTimeString(e,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"}}},Ol={enabled:!0,position:F.BOTTOM,clickable:!0,truncation:Tl,alignment:z.LEFT,order:null,additionalItems:[]},Ml={enabled:!0,showTotal:!0,truncation:Tl,groupLabel:"Group"},Al={top:{visible:!0,includeZero:!0,truncation:Tl},bottom:{visible:!0,includeZero:!0,truncation:Tl},left:{visible:!0,includeZero:!0,truncation:Tl},right:{visible:!0,includeZero:!0,truncation:Tl}},Cl={addSpaceOnEdges:1,showDayName:!1,localeObject:bt,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 kl=!1;try{kl=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(xt){console.warn("Fullscreen capabilities check failed: ",xt.message)}const Dl={width:null,height:null,resizable:!0,theme:R.WHITE,tooltip:Ml,legend:Ol,locale:Sl,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:K.SHOW_AS_DATATABLE},...kl?[{type:K.MAKE_FULLSCREEN}]:[],{type:K.EXPORT_CSV},{type:K.EXPORT_PNG},{type:K.EXPORT_JPG}]}},Ll=qi({},Dl,{thematic:{projection:nt.geoNaturalEarth1}}),Rl=qi({},Dl,{axes:Al,timeScale:Cl,grid:{x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},ruler:{enabled:!0},zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:P.GRAPH_VIEW}}}),Il=qi({},Rl,{bars:{maxWidth:16,spacingFactor:.25,preserveSpaceForMissingBars:!0},timeScale:qi(Cl,{addSpaceOnEdges:1})}),Nl=qi({},Il,{}),Pl=qi({},Il,{}),Ul=qi({},Il,{bars:qi({},Il.bars,{dividerSize:1.5})}),Bl=qi({},Il,{}),Hl=qi({},Rl,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),Fl=Hl,zl=qi({},Hl,{points:{radius:3,filled:!1,enabled:!0}}),$l=qi({},zl,{timeScale:qi(Cl,{addSpaceOnEdges:0})}),jl=$l,Vl=qi({},Rl,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:t=>{const e=Math.min(t.width,t.height);return[3*e/400,25*e/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:J.RADIUS,name:"Radius"}]}}),Gl=qi({},Rl,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:J.AREA,name:"Poor area"},{type:J.AREA,name:"Satisfactory area"},{type:J.AREA,name:"Great area"},{type:J.QUARTILE,name:"Quartiles"}]}}),Wl=qi({},Il,{bars:{dividerSize:1.5},timeScale:qi(Cl,{addSpaceOnEdges:0})}),Yl=qi({},Dl,{tooltip:qi({},Ml,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:t=>{const e=Math.min(t.width,t.height);return[20*e/400,75*e/400]},wordMapsTo:"word"}}),Zl=qi({},Dl,{pie:{labels:{formatter:null,enabled:!0},alignment:z.LEFT,sortFunction:null,valueMapsTo:"value"}}),Xl=qi({},Dl,{legend:{enabled:!1},gauge:{type:Z.SEMI,arcWidth:16,deltaArrow:{size:t=>t/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:t=>t/8,valueFontSize:t=>t/2.5,alignment:z.LEFT}}),ql=qi({},Zl,{donut:{center:{numberFontSize:t=>`${Math.min(t/100*24,24)}px`,titleFontSize:t=>`${Math.min(t/100*15,15)}px`,titleYPosition:t=>Math.min(t/80*20,20)},alignment:z.LEFT}}),Kl=qi({},Dl,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),Ql=qi({},Kl,{legend:{enabled:!0}}),Jl=qi({},Dl,{radar:{axes:{angle:"key",value:"value"},alignment:z.LEFT},tooltip:{gridline:{enabled:!0}}}),tc=qi({},Il,{comboChartTypes:[]}),ec=qi({tree:{type:j.TREE}},Dl,{}),nc=qi({},Dl,{data:qi(Dl.data,{groupMapsTo:"name"})}),ic=qi({},Dl,{circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},{data:qi(Dl.data,{groupMapsTo:"name"})}),rc=qi({},Dl,{alluvial:{data:qi(Dl.data,{groupMapsTo:"source"}),nodeAlignment:z.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),oc=qi({},Dl,{axes:Al,heatmap:{divider:{state:tt.AUTO},colorLegend:{type:"linear"}}}),sc={alluvialChart:rc,areaChart:$l,axisChart:Rl,boxplotChart:Bl,bubbleChart:Vl,bulletChart:Gl,chart:Dl,circlePackChart:ic,choroplethChart:qi({},Ll,{choropleth:{colorLegend:{type:"linear"}}}),comboChart:tc,donutChart:ql,gaugeChart:Xl,groupedBarChart:Pl,heatmapChart:oc,histogramChart:Wl,lineChart:zl,lollipopChart:Fl,meterChart:Kl,pieChart:Zl,proportionalMeterChart:Ql,radarChart:Jl,scatterChart:Hl,simpleBarChart:Nl,stackedAreaChart:jl,stackedBarChart:Ul,thematicChart:Ll,treeChart:ec,treemapChart:nc,wordCloudChart:Yl};function ac(t){if(!t)return;const e=t.getAttribute("transform").match(/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/);if(!e)return null;if(e[0]){const t=e[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:t[0],ty:t[1]}}return null}function lc(t,e,n){return n>t.length?t:e===U.MID_LINE?t.substr(0,n/2)+"..."+t.substr(-n/2):e===U.FRONT_LINE?"..."+t.substr(-n):e===U.END_LINE?t.substr(0,n)+"...":void 0}function cc(t,e){const n=uc(t,"legend","additionalItems"),i=uc(e,"legend","additionalItems");if(n&&i){const r=i.map((t=>t.type)),o=n.map((t=>t.type)),s=El.filter((t=>o.includes(t.type)&&!r.includes(t.type)));t.legend.additionalItems=s,e.legend.additionalItems=Ji(s,i,"name")}}const uc=(t,...e)=>{let n=t;if(n){for(const t of e){if(null===n[t]||void 0===n[t])return null;n=n[t]}return n}return null},hc=(t,e)=>e===B.HORIZONTAL?{y0:t.x0,y1:t.x1,x0:t.y0,x1:t.y1}:t;function dc(t,e,n){return n===B.VERTICAL?[t,e]:[e,t]}function fc(t){const e=pt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function pc(t,e){const n=pt(t,e?.in);return n.setHours(0,0,0,0),n}function gc(t,e,n){const[i,r]=ht(0,t,e),o=pc(i),s=pc(r),a=+o-fc(o),l=+s-fc(s);return Math.round((a-l)/864e5)}function mc(t,e){return gt(t,{...e,weekStartsOn:1})}function yc(t,e){const n=pt(t,e?.in),i=n.getFullYear(),r=ut(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const o=mc(r),s=ut(n,0);s.setFullYear(i,0,4),s.setHours(0,0,0,0);const a=mc(s);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function vc(t,e){const n=pt(t,e?.in),i=n.getFullYear(),r=ft(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=ut(e?.in||t,0);s.setFullYear(i+1,0,o),s.setHours(0,0,0,0);const a=gt(s,e),l=ut(e?.in||t,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=gt(l,e);return+n>=+a?i+1:+n>=+c?i:i-1}function _c(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const bc={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return _c("yy"===e?i%100:i,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):_c(n+1,2)},d:(t,e)=>_c(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>_c(t.getHours()%12||12,e.length),H:(t,e)=>_c(t.getHours(),e.length),m:(t,e)=>_c(t.getMinutes(),e.length),s:(t,e)=>_c(t.getSeconds(),e.length),S(t,e){const n=e.length,i=t.getMilliseconds();return _c(Math.trunc(i*Math.pow(10,n-3)),e.length)}},xc={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),i=e>0?e:1-e;return n.ordinalNumber(i,{unit:"year"})}return bc.y(t,e)},Y:function(t,e,n,i){const r=vc(t,i),o=r>0?r:1-r;return"YY"===e?_c(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):_c(o,e.length)},R:function(t,e){return _c(yc(t),e.length)},u:function(t,e){return _c(t.getFullYear(),e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return _c(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return _c(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return bc.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return _c(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){const r=function(t,e){const n=pt(t,e?.in),i=+gt(n,e)-+function(t,e){const n=ft(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=vc(t,e),o=ut(e?.in||t,0);return o.setFullYear(r,0,i),o.setHours(0,0,0,0),gt(o,e)}(n,e);return Math.round(i/at)+1}(t,i);return"wo"===e?n.ordinalNumber(r,{unit:"week"}):_c(r,e.length)},I:function(t,e,n){const i=function(t,e){const n=pt(t,e?.in),i=+mc(n)-+function(t){const e=yc(t,void 0),n=ut(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),mc(n)}(n);return Math.round(i/at)+1}(t);return"Io"===e?n.ordinalNumber(i,{unit:"week"}):_c(i,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):bc.d(t,e)},D:function(t,e,n){const i=function(t,e){const n=pt(t,e?.in);return gc(n,function(t){const e=pt(t,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}(n))+1}(t);return"Do"===e?n.ordinalNumber(i,{unit:"dayOfYear"}):_c(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){case"E":case"EE":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"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){const r=t.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return _c(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});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"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){const r=t.getDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return _c(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const i=t.getDay(),r=0===i?7:i;switch(e){case"i":return String(r);case"ii":return _c(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){const i=t.getHours();let r;switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const i=t.getHours();let r;switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return bc.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):bc.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return"Ko"===e?n.ordinalNumber(i,{unit:"hour"}):_c(i,e.length)},k:function(t,e,n){let i=t.getHours();return 0===i&&(i=24),"ko"===e?n.ordinalNumber(i,{unit:"hour"}):_c(i,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):bc.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):bc.s(t,e)},S:function(t,e){return bc.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return Ec(i);case"XXXX":case"XX":return Tc(i);default:return Tc(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return Ec(i);case"xxxx":case"xx":return Tc(i);default:return Tc(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+wc(i,":");default:return"GMT"+Tc(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+wc(i,":");default:return"GMT"+Tc(i,":")}},t:function(t,e,n){return _c(Math.trunc(+t/1e3),e.length)},T:function(t,e,n){return _c(+t,e.length)}};function wc(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),r=Math.trunc(i/60),o=i%60;return 0===o?n+String(r):n+String(r)+e+_c(o,2)}function Ec(t,e){return t%60==0?(t>0?"-":"+")+_c(Math.abs(t)/60,2):Tc(t,e)}function Tc(t,e=""){const n=t>0?"-":"+",i=Math.abs(t);return n+_c(Math.trunc(i/60),2)+e+_c(i%60,2)}const Sc=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Oc=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Mc={p:Oc,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Sc(t,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"})}return o.replace("{{date}}",Sc(i,e)).replace("{{time}}",Oc(r,e))}},Ac=/^D+$/,Cc=/^Y+$/,kc=["D","DD","YY","YYYY"];const Dc=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Lc=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Rc=/^'([^]*?)'?$/,Ic=/''/g,Nc=/[a-zA-Z]/;function Pc(t,e,n){const i=ft(),r=n?.locale??i.locale??bt,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=pt(t,n?.in);if(!function(t){return!(!function(t){return t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t||isNaN(+pt(t)))}(a))throw new RangeError("Invalid time value");let l=e.match(Lc).map((t=>{const e=t[0];return"p"===e||"P"===e?(0,Mc[e])(t,r.formatLong):t})).join("").match(Dc).map((t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:Uc(t)};if(xc[e])return{isToken:!0,value:t};if(e.match(Nc))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}}));r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:r};return l.map((i=>{if(!i.isToken)return i.value;const o=i.value;return(!n?.useAdditionalWeekYearTokens&&function(t){return Cc.test(t)}(o)||!n?.useAdditionalDayOfYearTokens&&function(t){return Ac.test(t)}(o))&&function(t,e,n){const i=function(t,e,n){const i="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,n);if(console.warn(i),kc.includes(t))throw new RangeError(i)}(o,e,String(t)),(0,xc[o[0]])(a,o,r.localize,c)})).join("")}function Uc(t){const e=t.match(Rc);return e?e[1].replace(Ic,"'"):t}const Bc=[["15seconds",15e3],["minute",6e4],["30minutes",18e5],["hourly",36e5],["daily",864e5],["monthly",2592e6],["quarterly",7776e6],["yearly",31104e6]];function Hc(t,e,n,i,r){const o=0===e,s=2===Number(Pc(new Date(t),"c")),a=1===Number(Pc(new Date(t),"q")),l=0!==e?n[e-1]:null;switch(i){case"15seconds":case"minute":case"30minutes":case"hourly":return o||function(t){const{s:e,m:n,H:i}=zc(t);return 0===i&&0===n&&0===e}(t)||jc(t,l)||Vc(t);case"daily":return r?o||s||Vc(t):o||jc(t,l)||Vc(t);case"weekly":return o||s||Vc(t);case"monthly":return o||Vc(t);case"quarterly":return o||a;case"yearly":return!1;default:throw new Error(`${i} is not a valid time interval.`)}}function Fc(t,e,n,i,r,o){const s=r.showDayName,a="daily"===i&&s?"weekly":i,l=new Date(t),c=uc(r,"timeIntervalFormats")[a],u=uc(c,"primary"),h=uc(c,"secondary"),d=Hc(t,e,n,i,s);let f=d?u:h;"15seconds"===i&&0!==l.getMilliseconds()&&(f=f.replace("pp","h:mm:ss.SSS a"));const p=r.localeObject,{code:g,optionsObject:m}=o,y=m[i].type,v=m[i][d?"primary":"secondary"][f];if("quarterly"!==i&&v)return o[y](l,g,v);{const t=Pc(l,f,{locale:p}).split("").map((t=>{const e=Number(t);return" "===t||Number.isNaN(e)?t:e?.toLocaleString?.(g)}));return o[y](l,g,{},t.join(""))}}function zc(t){const e=new Date(t);return{M:e.getMonth()+1,d:e.getDate(),H:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}function $c(t,e){if(it[e])return e;if(1===t.length)return"15seconds";const n=function(t){if(t)return t.slice(1).map(((e,n)=>e-t[n]))}(t);return function(t){const e=Bc.reduce(((e,[,n],i)=>{const r=Bc[e][1];return Math.abs(r-t)<Math.abs(n-t)?e:i}),0);return Bc[e][0]}(function(t){let e;for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);return e}(n))}function jc(t,e){return zc(t).M!==zc(e).M}function Vc(t){const{M:e,d:n,s:i,m:r,H:o}=zc(t);return 1===e&&1===n&&0===o&&0===r&&0===i}function Gc(t){return void 0===t?"":t.toISOString()}var Wc=(t=>(t.GRAPHICS_DOCUMENT="graphics-document",t.GRAPHICS_OBJECT="graphics-object",t.GRAPHICS_SYMBOL="graphics-symbol",t.GROUP="group",t.DOCUMENT="document",t.CHECKBOX="checkbox",t.BUTTON="button",t.MENU="menu",t.MENU_ITEM="menuitem",t.IMG="img",t))(Wc||{}),Yc=function(t,e){if(null==t)return t;if(!we(t))return function(t,e){return t&&ji(t,e,Ze)}(t,e);for(var n=t.length,i=-1,r=Object(t);++i<n&&!1!==e(r[i],i,r););return t};function Zc(t){return function(){return t}}function Xc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function qc(t,e,n,i){for(var r=-1,o=null==t?0:t.length;++r<o;){var s=t[r];e(i,s,n(s),t)}return i}function Kc(t,e,n,i){return Yc(t,(function(t,r,o){e(i,t,n(t),o)})),i}Array.prototype.slice;var Qc=Object.prototype.hasOwnProperty,Jc=function(t){return function(e,n){return(Pt(e)?qc:Kc)(e,t,$i(n),{})}}((function(t,e,n){Qc.call(t,n)?t[n].push(e):fe(t,n,[e])}));function tu(t){return t}var eu=Array.prototype.slice;function nu(t){return()=>t}function iu(t){return Math.max(1,Math.ceil(Math.log(function(t){let e=0;for(let n of t)null!=n&&(n=+n)>=n&&++e;return e}(t))/Math.LN2)+1)}function ru(t,e){if((r=t.length)>1)for(var n,i,r,o=1,s=t[e[0]],a=s.length;o<r;++o)for(i=s,s=t[e[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function ou(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function su(t,e){return t[e]}function au(t){const e=[];return e.key=t,e}function lu(){var t=Zc([]),e=ou,n=ru,i=su;function r(r){var o,s,a=Array.from(t.apply(this,arguments),au),l=a.length,c=-1;for(const t of r)for(o=0,++c;o<l;++o)(a[o][c]=[0,+i(t,a[o].key,c,r)]).data=t;for(o=0,s=Xc(e(a));o<l;++o)a[s[o]].index=o;return n(a,s),a}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:Zc(Array.from(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:Zc(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?ou:"function"==typeof t?t:Zc(Array.from(t)),r):e},r.offset=function(t){return arguments.length?(n=t??ru,r):n},r}function cu(t,e){if((a=t.length)>0)for(var n,i,r,o,s,a,l=0,c=t[e[0]].length;l<c;++l)for(o=s=0,n=0;n<a;++n)(r=(i=t[e[n]][l])[1]-i[0])>0?(i[0]=o,i[1]=o+=r):r<0?(i[1]=s,i[0]=s+=r):(i[0]=0,i[1]=r)}class uu{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:e}){const n=this.getOptions(),{code:i,date:r,number:o}=uc(n,"locale"),s=uc(n,"tabularRepModal","tableHeadingFormatter"),a=uc(n,"tabularRepModal","tableCellFormatter"),{cartesianScales:l}=this.services,c=l?.getDomainAxisScaleType();let u;return c===H.TIME&&(u=t=>r(t,i,{month:"short",day:"numeric",year:"numeric"})),["function"==typeof s?s(t):t,..."function"==typeof a?a(e):e.map((t=>{u&&(t[1]=u(t[1]));for(const e in t){const n=t[e];"number"==typeof n&&(t[e]=o(n,i))}return t}))]}getAllDataFromDomain(t){if(!this.getData())return null;const e=this.getOptions();let n=this.getData();const i=this.getDataGroups(),{groupMapsTo:r}=uc(e,"data"),o=uc(e,"axes");return t&&(n=n.filter((e=>t.includes(e[r])))),o&&Object.keys(o).forEach((t=>{const e=o[t].mapsTo,i=o[t].scaleType;if((i===H.LINEAR||i===H.LOG)&&(n=n.map((t=>({...t,[e]:null===t[e]?t[e]:Number(t[e])})))),e&&o[t].domain)if(i===H.LABELS)n=n.filter((n=>o[t].domain.includes(n[e])));else{const[i,r]=o[t].domain;n=n.filter((t=>!(e in t)||t[e]>=i&&t[e]<=r))}})),n.filter((t=>i.find((e=>e.name===t[r]))))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:e}=ml.items.status,n=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter((t=>n.find((n=>n.name===t[i]&&n.status===e))))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const e=this.sanitize(Ti(t)),n=this.generateDataGroups(e);return this.set({data:e,dataGroups:n}),e}getDataGroups(t){return uc(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter((e=>t.includes(e.name))):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:e}=ml.items.status;return this.getDataGroups(t).filter((t=>t.status===e))}getDataGroupNames(t){return this.getDataGroups(t).map((t=>t.name))}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map((t=>t.name))}aggregateBinDataByGroup(t){return Jc(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),e=this.getOptions(),n=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),r=e.axes[n],{groupMapsTo:o}=e.data,{bins:s=gl.defaultBins}=r,a=Array.isArray(s),l=function(){var t=tu,e=sr,n=iu;function i(i){Array.isArray(i)||(i=Array.from(i));var r,o,s,a=i.length,l=new Array(a);for(r=0;r<a;++r)l[r]=t(i[r],r,i);var c=e(l),u=c[0],h=c[1],d=n(l,u,h);if(!Array.isArray(d)){const t=h,n=+d;if(e===sr&&([u,h]=function(t,e,n){let i;for(;;){const r=gr(t,e,n);if(r===i||0===r||!isFinite(r))return[t,e];r>0?(t=Math.floor(t/r)*r,e=Math.ceil(e/r)*r):r<0&&(t=Math.ceil(t*r)/r,e=Math.floor(e*r)/r),i=r}}(u,h,n)),(d=pr(u,h,n))[0]<=u&&(s=gr(u,h,n)),d[d.length-1]>=h)if(t>=h&&e===sr){const t=gr(u,h,n);isFinite(t)&&(t>0?h=(Math.floor(h/t)+1)*t:t<0&&(h=(Math.ceil(h*-t)+1)/-t))}else d.pop()}for(var f=d.length,p=0,g=f;d[p]<=u;)++p;for(;d[g-1]>h;)--g;(p||g<f)&&(d=d.slice(p,g),f=g-p);var m,y=new Array(f+1);for(r=0;r<=f;++r)(m=y[r]=[]).x0=r>0?d[r-1]:u,m.x1=r<f?d[r]:h;if(isFinite(s)){if(s>0)for(r=0;r<a;++r)null!=(o=l[r])&&u<=o&&o<=h&&y[Math.min(f,Math.floor((o-u)/s))].push(i[r]);else if(s<0)for(r=0;r<a;++r)if(null!=(o=l[r])&&u<=o&&o<=h){const t=Math.floor((u-o)*s);y[Math.min(f,t+(d[t]<=o))].push(i[r])}}else for(r=0;r<a;++r)null!=(o=l[r])&&u<=o&&o<=h&&y[or(d,o,0,f)].push(i[r]);return y}return i.value=function(e){return arguments.length?(t="function"==typeof e?e:nu(e),i):t},i.domain=function(t){return arguments.length?(e="function"==typeof t?t:nu([t[0],t[1]]),i):e},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:nu(Array.isArray(t)?eu.call(t):t),i):n},i}().value((t=>t[i])).thresholds(s)(t);if(a)l[l.length-1].x1=s[s.length-1];else{const t=l[0].x1-l[0].x0;l[l.length-1].x1=+l[l.length-1].x0+t}const c=a?[s[0],s[s.length-1]]:[l[0].x0,l[l.length-1].x1],u=Array.from(new Set(t.map((t=>t[o])))),h=[];return l.forEach((t=>{const e=`${t.x0}-${t.x1}`,n=this.aggregateBinDataByGroup(t);u.forEach((i=>{h.push({group:i,key:e,value:n[i]||0,bin:t.x0})}))})),{bins:l,binsDomain:c}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:e}=t.data,n=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),r=this.getDataValuesGroupedByKeys({bins:i});return lu().keys(n)(r).map(((t,i)=>Object.keys(t).filter((t=>!isNaN(t))).map((r=>{const o=t[r];return o[e]=n[i],o}))))}getGroupedData(t){const e=this.getDisplayData(t),n={},{groupMapsTo:i}=this.getOptions().data;return e.map((t=>{const e=t[i];null!==n[e]&&void 0!==n[e]?n[e].push(t):n[e]=[t]})),Object.keys(n).map((t=>({name:t,data:n[t]})))}getStackKeys({bins:t=null,groups:e=null}={bins:null,groups:null}){const n=this.getOptions(),i=this.getDisplayData(e);let r;r=t?t.map((t=>`${t.x0}:${t.x1}`)):tr(i.map((t=>{const e=this.services.cartesianScales.getDomainIdentifier(t);return t[e]instanceof Date?Gc(t[e]):t[e]&&"function"==typeof t[e].toString?t[e].toString():t[e]})));const o=this.services.cartesianScales.domainAxisPosition,s=n.axes[o].scaleType;return s===H.TIME?r.sort(((t,e)=>new Date(t)-new Date(e))):(s===H.LOG||s===H.LINEAR)&&r.sort(((t,e)=>t-e)),r}getDataValuesGroupedByKeys({bins:t=null,groups:e=null}){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getDisplayData(e),o=this.getDataGroupNames(),s=this.getStackKeys({bins:t,groups:e});return t?s.map((e=>{const[n,r]=e.split(":"),s={x0:n,x1:r},a=t.find((t=>t.x0.toString()===n.toString()));return o.forEach((t=>{s[t]=a.filter((e=>e[i]===t)).length})),s})):s.map((t=>{const e={sharedStackKey:t};return o.forEach((n=>{const o=r.find((e=>{const r=this.services.cartesianScales.getDomainIdentifier(e);return e[i]===n&&Object.prototype.hasOwnProperty.call(e,r)&&(e[r]instanceof Date?Gc(e[r])===t:e[r].toString()===t)})),s=this.services.cartesianScales.getRangeIdentifier(e);e[n]=o?o[s]:null})),e}))}getStackedData({percentage:t=!1,groups:e=null,divergent:n=!1}){const i=this.getOptions(),{groupMapsTo:r}=i.data,o=this.getActiveDataGroupNames(e),s=this.getDataValuesGroupedByKeys({groups:e});if(t){const t=function(t){for(var e=-1,n=null==t?0:t.length,i={};++e<n;){var r=t[e];i[r[0]]=r[1]}return i}(s.map((t=>[t.sharedStackKey,0])));s.forEach((e=>{o.forEach((n=>{t[e.sharedStackKey]+=e[n]}))})),s.forEach((e=>{o.forEach((n=>{const i=t[e.sharedStackKey];t[e.sharedStackKey]?e[n]=e[n]/i*100:e[n]=0}))}))}return(n?lu().offset(cu):lu()).keys(o)(s).map(((t,e)=>Object.keys(t).filter((t=>!isNaN(t))).map((n=>{const i=t[n];return i[r]=o[e],i}))))}getOptions(){return this.state.options}set(t,e){this.state=Object.assign({},this.state,t);const n=Object.assign({skipUpdate:!1,animate:!0},e);n.skipUpdate||this.update(n.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const e=this.getOptions();cc(e,t),this.set({options:qi(e,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(D.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:e,DISABLED:n}=ml.items.status,i=this.getDataGroups(),r=i.some((t=>t.status===n)),o=i.filter((t=>t.status===e));if(r)if(1===o.length&&o[0].name===t)i.forEach(((t,n)=>{i[n].status=e}));else{const r=i.findIndex((e=>e.name===t));i[r].status=i[r].status===n?e:n}else i.forEach(((r,o)=>{i[o].status=r.name===t?e:n}));const s=i.filter((t=>t.status===e)),a=this.getOptions();i.some((t=>t.status===n))?a.data.selectedGroups=s.map((t=>t.name)):a.data.selectedGroups=[],this.services.events.dispatchEvent(D.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,e,n,i){const r=this.getOptions();return r.getIsFilled?r.getIsFilled(t,e,n,i):i}getFillColor(t,e,n){const i=this.getOptions(),r=uc(this.colorScale,t);return i.getFillColor?i.getFillColor(t,e,n,r):r}getStrokeColor(t,e,n){const i=this.getOptions(),r=uc(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,e,n,r):r}isUserProvidedColorScaleValid(){const t=uc(this.getOptions(),"color","scale"),e=this.getDataGroups();return null!=t&&0!=Object.keys(t).length&&e.some((e=>Object.keys(t).includes(e.name)))}getColorClassName(t){const e=this.colorClassNames(t.dataGroupName);let n=t.originalClassName;return t.classNameTypes.forEach((i=>n=t.originalClassName?`${n} ${i}-${e}`:`${i}-${e}`)),n||""}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 e=[],{datasets:n,labels:i}=t;return n.forEach((t=>{t.data.forEach(((n,r)=>{let o;const s=uc(t,"label");if(null===s){o=uc(i,r)||"Ungrouped"}else o=s;const a={group:o,key:i[r]};isNaN(n)?(a.value=n.value,a.date=n.date):a.value=n,e.push(a)}))})),e}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map((t=>t.map((t=>`"${("–"===t?"–":t).split(/[,;'"`]/).map((t=>function(t){const e=t.trim();return["=","+","-","@","\t","\r"].includes(e.charAt(0))?` ${e}`:/[,\"\n]/.test(e)?`"${e}"`:e}(t))).join("")}"`)))).map((t=>t.join(","))).join("\n"),e=this.getOptions();let n="myChart";const i=uc(e,"fileDownload","fileName");"function"==typeof i?n=i("csv"):"string"==typeof i&&(n=i),this.services.files.downloadCSV(t,`${n}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return this.getTabularData(t)}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach((t=>{-1===this.allDataGroups.indexOf(t)&&this.allDataGroups.push(t)})):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:e}=this.getOptions().data,{ACTIVE:n,DISABLED:i}=ml.items.status,r=this.getOptions(),o=tr(t.map((t=>t[e])));r.data.selectedGroups.length&&(r.data.selectedGroups.every((t=>o.includes(t)))||(r.data.selectedGroups=[]));const s=t=>!r.data.selectedGroups.length||r.data.selectedGroups.includes(t)?n:i;return o.map((t=>({name:t,status:s(t)})))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),e=uc(t,"color","scale");Object.keys(e).forEach((t=>{this.allDataGroups.includes(t)||console.warn(`"${t}" does not exist in data groups.`)})),this.allDataGroups.filter((t=>e[t])).forEach((t=>this.colorScale[t]=e[t]))}setColorClassNames(){const t=uc(this.getOptions(),"color","pairing");let e=uc(t,"numberOfVariants");(!e||e<this.allDataGroups.length)&&(e=this.allDataGroups.length);let n=uc(t,"option");const i=e>5?14:e;n=n<=pl[`${i}-color`]?n:1;const r=this.allDataGroups.map(((t,e)=>`${i}-${n}-${e%14+1}`));this.colorClassNames=Za().range(r).domain(this.allDataGroups)}}class hu extends uu{constructor(t){super(t),this.axisFlavor=et.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,e=this.getOptions(),n=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return n&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach((n=>{const r=i[n];t.scales[r]?i[n]={position:r,label:t.getScaleLabel(r),identifier:uc(e,"axes",r,"mapsTo")}:i[n]=null})),i}getTabularDataArray(){const t=this.getDisplayData(),e=this.getOptions(),{groupMapsTo:n}=e.data,{primaryDomain:i,primaryRange:r,secondaryDomain:o,secondaryRange:s}=this.assignRangeAndDomains(),{number:a,code:l}=uc(this.getOptions(),"locale"),c=["Group",i.label,r.label,...o?[o.label]:[],...s?[s.label]:[]],u=t.map((t=>[t[n],null===t[i.identifier]?"–":t[i.identifier],null===t[r.identifier]||isNaN(t[r.identifier])?"–":a(t[r.identifier],l),...o?[null===t[o.identifier]?"–":t[o.identifier]]:[],...s?[null===t[s.identifier]||isNaN(t[s.identifier])?"–":t[s.identifier]]:[]]));return super.formatTable({headers:c,cells:u})}setData(t){let e;if(t&&(e=super.setData(t),uc(this.getOptions(),"zoomBar",N.TOP,"enabled"))){const t=uc(this.getOptions(),"zoomBar",N.TOP,"data");this.setZoomBarData(t)}return e}setZoomBarData(t){const e=t?this.sanitize(Ti(t)):this.getDisplayData();let n=e;const{cartesianScales:i}=this.services;if(e&&i.domainAxisPosition&&i.rangeAxisPosition){const t=i.getDomainIdentifier(),r=i.getRangeIdentifier();let o=e.map((e=>e[t].getTime()));o=tr(o).sort(),n=o.map((n=>{let i=0;const o={};return e.forEach((e=>{e[t].getTime()===n&&(i+=e[r])})),o[t]=new Date(n),o[r]=i,o}))}this.set({zoomBarData:n})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const e=this.getOptions();if(!e.axes)return t;const n=[];return Object.keys(N).forEach((t=>{const i=N[t],r=e.axes[i];if(r&&r.scaleType===H.TIME){const t=r.mapsTo;(null!==t||void 0!==t)&&n.push(t)}})),n.length>0&&t.forEach((t=>{n.forEach((e=>{null===uc(t,e,"getTime")&&(t[e]=new Date(t[e]))}))})),t}sanitize(t){return t=super.sanitize(t),this.sanitizeDateValues(t)}}var du=/\s/,fu=/^\s+/;var pu=/^[-+]0x[0-9a-f]+$/i,gu=/^0b[01]+$/i,mu=/^0o[0-7]+$/i,yu=parseInt;function vu(t){if("number"==typeof t)return t;if(It(t))return NaN;if(Ft(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ft(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=function(t){return t&&t.slice(0,function(t){for(var e=t.length;e--&&du.test(t.charAt(e)););return e}(t)+1).replace(fu,"")}(t);var n=gu.test(t);return n||mu.test(t)?yu(t.slice(2),n?2:8):pu.test(t)?NaN:+t}var _u=function(){return Tt.Date.now()},bu=Math.max,xu=Math.min;function wu(t){return"string"==typeof t?new Ro([[document.querySelector(t)]],[document.documentElement]):new Ro([[t]],Lo)}function Eu(){var t,e,n=Za().unknown(void 0),i=n.domain,r=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=s<o,d=h?s:o,f=h?o:s;t=(f-d)/Math.max(1,n-l+2*c),a&&(t=Math.floor(t)),d+=(f-d-t*(n-l))*u,e=t*(1-l),a&&(d=Math.round(d),e=Math.round(e));var p=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o}(n).map((function(e){return d+t*e}));return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([o,s]=t,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(t){return[o,s]=t,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,h()):a},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return Eu(i(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},Wa.apply(h(),arguments)}function Tu(t,e){var n,i=0,r=(t=t.slice()).length-1,o=t[i],s=t[r];return s<o&&(n=i,i=r,r=n,n=o,o=s,s=n),t[i]=e.floor(o),t[r]=e.ceil(s),t}const Su=new Date,Ou=new Date;function Mu(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,o)=>{const s=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return s;let a;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<i);return s},r.filter=n=>Mu((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})),n&&(r.count=(e,i)=>(Su.setTime(+e),Ou.setTime(+i),t(Su),t(Ou),Math.floor(n(Su,Ou))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t===0:e=>r.count(0,e)%t===0):r:null)),r}const Au=Mu((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));Au.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?Mu((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):Au:null),Au.range;const Cu=1e3,ku=6e4,Du=60*ku,Lu=24*Du,Ru=7*Lu,Iu=30*Lu,Nu=365*Lu,Pu=Mu((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*Cu)}),((t,e)=>(e-t)/Cu),(t=>t.getUTCSeconds()));Pu.range;const Uu=Mu((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Cu)}),((t,e)=>{t.setTime(+t+e*ku)}),((t,e)=>(e-t)/ku),(t=>t.getMinutes()));Uu.range;const Bu=Mu((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*ku)}),((t,e)=>(e-t)/ku),(t=>t.getUTCMinutes()));Bu.range;const Hu=Mu((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Cu-t.getMinutes()*ku)}),((t,e)=>{t.setTime(+t+e*Du)}),((t,e)=>(e-t)/Du),(t=>t.getHours()));Hu.range;const Fu=Mu((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*Du)}),((t,e)=>(e-t)/Du),(t=>t.getUTCHours()));Fu.range;const zu=Mu((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ku)/Lu),(t=>t.getDate()-1));zu.range;const $u=Mu((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/Lu),(t=>t.getUTCDate()-1));$u.range;const ju=Mu((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/Lu),(t=>Math.floor(t/Lu)));function Vu(t){return Mu((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ku)/Ru))}ju.range;const Gu=Vu(0),Wu=Vu(1),Yu=Vu(2),Zu=Vu(3),Xu=Vu(4),qu=Vu(5),Ku=Vu(6);function Qu(t){return Mu((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/Ru))}Gu.range,Wu.range,Yu.range,Zu.range,Xu.range,qu.range,Ku.range;const Ju=Qu(0),th=Qu(1),eh=Qu(2),nh=Qu(3),ih=Qu(4),rh=Qu(5),oh=Qu(6);Ju.range,th.range,eh.range,nh.range,ih.range,rh.range,oh.range;const sh=Mu((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()));sh.range;const ah=Mu((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()));ah.range;const lh=Mu((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));lh.every=t=>isFinite(t=Math.floor(t))&&t>0?Mu((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null,lh.range;const ch=Mu((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));ch.every=t=>isFinite(t=Math.floor(t))&&t>0?Mu((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null,ch.range;const[uh,hh]=function(t,e,n,i,r,o){const s=[[Pu,1,Cu],[Pu,5,5e3],[Pu,15,15e3],[Pu,30,3e4],[o,1,ku],[o,5,5*ku],[o,15,15*ku],[o,30,30*ku],[r,1,Du],[r,3,3*Du],[r,6,6*Du],[r,12,12*Du],[i,1,Lu],[i,2,2*Lu],[n,1,Ru],[e,1,Iu],[e,3,3*Iu],[t,1,Nu]];function a(e,n,i){const r=Math.abs(n-e)/i,o=ir((([,,t])=>t)).right(s,r);if(o===s.length)return t.every(mr(e/Nu,n/Nu,i));if(0===o)return Au.every(Math.max(mr(e,n,i),1));const[a,l]=s[r/s[o-1][2]<s[o][2]/r?o-1:o];return a.every(l)}return[function(t,e,n){const i=e<t;i&&([t,e]=[e,t]);const r=n&&"function"==typeof n.range?n:a(t,e,n),o=r?r.range(t,+e+1):[];return i?o.reverse():o},a]}(lh,sh,Gu,zu,Hu,Uu);function dh(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function fh(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ph(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var gh,mh,yh={"-":"",_:" ",0:"0"},vh=/^\s*\d+/,_h=/^%/,bh=/[\\^$*+?|[\]().{}]/g;function xh(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function wh(t){return t.replace(bh,"\\$&")}function Eh(t){return new RegExp("^(?:"+t.map(wh).join("|")+")","i")}function Th(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function Sh(t,e,n){var i=vh.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Oh(t,e,n){var i=vh.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Mh(t,e,n){var i=vh.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function Ah(t,e,n){var i=vh.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function Ch(t,e,n){var i=vh.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function kh(t,e,n){var i=vh.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Dh(t,e,n){var i=vh.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Lh(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Rh(t,e,n){var i=vh.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function Ih(t,e,n){var i=vh.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Nh(t,e,n){var i=vh.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Ph(t,e,n){var i=vh.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function Uh(t,e,n){var i=vh.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function Bh(t,e,n){var i=vh.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function Hh(t,e,n){var i=vh.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Fh(t,e,n){var i=vh.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function zh(t,e,n){var i=vh.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function $h(t,e,n){var i=_h.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function jh(t,e,n){var i=vh.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Vh(t,e,n){var i=vh.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Gh(t,e){return xh(t.getDate(),e,2)}function Wh(t,e){return xh(t.getHours(),e,2)}function Yh(t,e){return xh(t.getHours()%12||12,e,2)}function Zh(t,e){return xh(1+zu.count(lh(t),t),e,3)}function Xh(t,e){return xh(t.getMilliseconds(),e,3)}function qh(t,e){return Xh(t,e)+"000"}function Kh(t,e){return xh(t.getMonth()+1,e,2)}function Qh(t,e){return xh(t.getMinutes(),e,2)}function Jh(t,e){return xh(t.getSeconds(),e,2)}function td(t){var e=t.getDay();return 0===e?7:e}function ed(t,e){return xh(Gu.count(lh(t)-1,t),e,2)}function nd(t){var e=t.getDay();return e>=4||0===e?Xu(t):Xu.ceil(t)}function id(t,e){return t=nd(t),xh(Xu.count(lh(t),t)+(4===lh(t).getDay()),e,2)}function rd(t){return t.getDay()}function od(t,e){return xh(Wu.count(lh(t)-1,t),e,2)}function sd(t,e){return xh(t.getFullYear()%100,e,2)}function ad(t,e){return xh((t=nd(t)).getFullYear()%100,e,2)}function ld(t,e){return xh(t.getFullYear()%1e4,e,4)}function cd(t,e){var n=t.getDay();return xh((t=n>=4||0===n?Xu(t):Xu.ceil(t)).getFullYear()%1e4,e,4)}function ud(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+xh(e/60|0,"0",2)+xh(e%60,"0",2)}function hd(t,e){return xh(t.getUTCDate(),e,2)}function dd(t,e){return xh(t.getUTCHours(),e,2)}function fd(t,e){return xh(t.getUTCHours()%12||12,e,2)}function pd(t,e){return xh(1+$u.count(ch(t),t),e,3)}function gd(t,e){return xh(t.getUTCMilliseconds(),e,3)}function md(t,e){return gd(t,e)+"000"}function yd(t,e){return xh(t.getUTCMonth()+1,e,2)}function vd(t,e){return xh(t.getUTCMinutes(),e,2)}function _d(t,e){return xh(t.getUTCSeconds(),e,2)}function bd(t){var e=t.getUTCDay();return 0===e?7:e}function xd(t,e){return xh(Ju.count(ch(t)-1,t),e,2)}function wd(t){var e=t.getUTCDay();return e>=4||0===e?ih(t):ih.ceil(t)}function Ed(t,e){return t=wd(t),xh(ih.count(ch(t),t)+(4===ch(t).getUTCDay()),e,2)}function Td(t){return t.getUTCDay()}function Sd(t,e){return xh(th.count(ch(t)-1,t),e,2)}function Od(t,e){return xh(t.getUTCFullYear()%100,e,2)}function Md(t,e){return xh((t=wd(t)).getUTCFullYear()%100,e,2)}function Ad(t,e){return xh(t.getUTCFullYear()%1e4,e,4)}function Cd(t,e){var n=t.getUTCDay();return xh((t=n>=4||0===n?ih(t):ih.ceil(t)).getUTCFullYear()%1e4,e,4)}function kd(){return"+0000"}function Dd(){return"%"}function Ld(t){return+t}function Rd(t){return Math.floor(+t/1e3)}function Id(t){return new Date(t)}function Nd(t){return t instanceof Date?+t:+new Date(+t)}function Pd(t,e,n,i,r,o,s,a,l,c){var u=il(),h=u.invert,d=u.domain,f=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),v=c("%b %d"),_=c("%B"),b=c("%Y");function x(t){return(l(t)<t?f:a(t)<t?p:s(t)<t?g:o(t)<t?m:i(t)<t?r(t)<t?y:v:n(t)<t?_:b)(t)}return u.invert=function(t){return new Date(h(t))},u.domain=function(t){return arguments.length?d(Array.from(t,Nd)):d().map(Id)},u.ticks=function(e){var n=d();return t(n[0],n[n.length-1],e??10)},u.tickFormat=function(t,e){return null==e?x:c(e)},u.nice=function(t){var n=d();return(!t||"function"!=typeof t.range)&&(t=e(n[0],n[n.length-1],t??10)),t?d(Tu(n,t)):u},u.copy=function(){return el(u,Pd(t,e,n,i,r,o,s,a,l,c))},u}function Ud(){return Wa.apply(Pd(uh,hh,lh,sh,Gu,zu,Hu,Uu,Pu,mh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}gh=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,c=Eh(r),u=Th(r),h=Eh(o),d=Th(o),f=Eh(s),p=Th(s),g=Eh(a),m=Th(a),y=Eh(l),v=Th(l),_={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:Gh,e:Gh,f:qh,g:ad,G:cd,H:Wh,I:Yh,j:Zh,L:Xh,m:Kh,M:Qh,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Ld,s:Rd,S:Jh,u:td,U:ed,V:id,w:rd,W:od,x:null,X:null,y:sd,Y:ld,Z:ud,"%":Dd},b={a:function(t){return s[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:hd,e:hd,f:md,g:Md,G:Cd,H:dd,I:fd,j:pd,L:gd,m:yd,M:vd,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Ld,s:Rd,S:_d,u:bd,U:xd,V:Ed,w:Td,W:Sd,x:null,X:null,y:Od,Y:Ad,Z:kd,"%":Dd},x={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=y.exec(e.slice(n));return i?(t.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return T(t,e,n,i)},d:Nh,e:Nh,f:zh,g:Dh,G:kh,H:Uh,I:Uh,j:Ph,L:Fh,m:Ih,M:Bh,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:Rh,Q:jh,s:Vh,S:Hh,u:Oh,U:Mh,V:Ah,w:Sh,W:Ch,x:function(t,e,i){return T(t,n,e,i)},X:function(t,e,n){return T(t,i,e,n)},y:Dh,Y:kh,Z:Lh,"%":$h};function w(t,e){return function(n){var i,r,o,s=[],a=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===t.charCodeAt(a)&&(s.push(t.slice(l,a)),null!=(r=yh[i=t.charAt(++a)])?i=t.charAt(++a):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),s.push(i),l=a+1);return s.push(t.slice(l,a)),s.join("")}}function E(t,e){return function(n){var i,r,o=ph(1900,void 0,1);if(T(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=fh(ph(o.y,0,1))).getUTCDay(),i=r>4||0===r?th.ceil(i):th(i),i=$u.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=dh(ph(o.y,0,1))).getDay(),i=r>4||0===r?Wu.ceil(i):Wu(i),i=zu.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?fh(ph(o.y,0,1)).getUTCDay():dh(ph(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,fh(o)):dh(o)}}function T(t,e,n,i){for(var r,o,s=0,a=e.length,l=n.length;s<a;){if(i>=l)return-1;if(37===(r=e.charCodeAt(s++))){if(r=e.charAt(s++),!(o=x[r in yh?e.charAt(s++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return _.x=w(n,_),_.X=w(i,_),_.c=w(e,_),b.x=w(n,b),b.X=w(i,b),b.c=w(e,b),{format:function(t){var e=w(t+="",_);return e.toString=function(){return t},e},parse:function(t){var e=E(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=E(t+="",!0);return e.toString=function(){return t},e}}}({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"]}),mh=gh.format,gh.parse,gh.utcFormat,gh.utcParse;const Bd=Math.abs,Hd=Math.atan2,Fd=Math.cos,zd=Math.max,$d=Math.min,jd=Math.sin,Vd=Math.sqrt,Gd=1e-12,Wd=Math.PI,Yd=Wd/2,Zd=2*Wd;function Xd(t){return t>=1?Yd:t<=-1?-Yd:Math.asin(t)}function qd(t){this._context=t}function Kd(t){return new qd(t)}function Qd(){}function Jd(t){this._context=t}function tf(t){return new Jd(t)}qd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}},Jd.prototype={areaStart:Qd,areaEnd:Qd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};const ef=(()=>{let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${t}`)})();function nf(t){const e=[];for(let n=0,i=t.length;n<i;n++)e.push(t[n]);return e}function rf(t,e){const n=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return n?parseFloat(n.replace("px","")):0}function of(t,e={}){const n=e.width||function(t){const e=rf(t,"border-left-width"),n=rf(t,"border-right-width");return t.clientWidth+e+n}(t),i=e.height||function(t){const e=rf(t,"border-top-width"),n=rf(t,"border-bottom-width");return t.clientHeight+e+n}(t);return{width:n,height:i}}const sf=16384;function af(t){return new Promise(((e,n)=>{const i=new Image;i.decode=()=>e(i),i.onload=()=>e(i),i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=t}))}const lf=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return null!==n&&(n.constructor.name===e.name||lf(n,e))};function cf(t,e,n){const i=window.getComputedStyle(t,n),r=i.getPropertyValue("content");if(""===r||"none"===r)return;const o=ef();try{e.className=`${e.className} ${o}`}catch{return}const s=document.createElement("style");s.appendChild(function(t,e,n){const i=`.${t}:${e}`,r=n.cssText?function(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}(n):function(t){return nf(t).map((e=>`${e}: ${t.getPropertyValue(e)}${t.getPropertyPriority(e)?" !important":""};`)).join(" ")}(n);return document.createTextNode(`${i}{${r}}`)}(o,n,i)),e.appendChild(s)}const uf="application/font-woff",hf="image/jpeg",df={woff:uf,woff2:uf,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:hf,jpeg:hf,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ff(t){const e=function(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}(t).toLowerCase();return df[e]||""}function pf(t){return-1!==t.search(/^(data:)/)}async function gf(t,e,n){const i=await fetch(t,e);if(404===i.status)throw new Error(`Resource "${i.url}" not found`);const r=await i.blob();return new Promise(((t,e)=>{const o=new FileReader;o.onerror=e,o.onloadend=()=>{try{t(n({res:i,result:o.result}))}catch(t){e(t)}},o.readAsDataURL(r)}))}const mf={};async function yf(t,e,n){const i=function(t,e,n){let i=t.replace(/\?.*/,"");return n&&(i=t),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),e?`[${e}]${i}`:i}(t,e,n.includeQueryParams);if(null!=mf[i])return mf[i];let r;n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime());try{const i=await gf(t,n.fetchRequestInit,(({res:t,result:n})=>(e||(e=t.headers.get("Content-Type")||""),function(t){return t.split(/,/)[1]}(n))));r=function(t,e){return`data:${e};base64,${t}`}(i,e)}catch(e){r=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${t}`;e&&(i="string"==typeof e?e:e.message),i&&console.warn(i)}return mf[i]=r,r}const vf=t=>null!=t.tagName&&"SLOT"===t.tagName.toUpperCase();async function _f(t,e,n){return n||!e.filter||e.filter(t)?Promise.resolve(t).then((t=>async function(t,e){return lf(t,HTMLCanvasElement)?async function(t){const e=t.toDataURL();return"data:,"===e?t.cloneNode(!1):af(e)}(t):lf(t,HTMLVideoElement)?async function(t,e){if(t.currentSrc){const e=document.createElement("canvas"),n=e.getContext("2d");return e.width=t.clientWidth,e.height=t.clientHeight,n?.drawImage(t,0,0,e.width,e.height),af(e.toDataURL())}const n=t.poster,i=ff(n);return af(await yf(n,i,e))}(t,e):lf(t,HTMLIFrameElement)?async function(t){var e;try{if(null!==(e=t?.contentDocument)&&void 0!==e&&e.body)return await _f(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}(t):t.cloneNode(!1)}(t,e))).then((n=>async function(t,e,n){var i,r;let o=[];return o=vf(t)&&t.assignedNodes?nf(t.assignedNodes()):lf(t,HTMLIFrameElement)&&null!==(i=t.contentDocument)&&void 0!==i&&i.body?nf(t.contentDocument.body.childNodes):nf((null!==(r=t.shadowRoot)&&void 0!==r?r:t).childNodes),0===o.length||lf(t,HTMLVideoElement)||await o.reduce(((t,i)=>t.then((()=>_f(i,n))).then((t=>{t&&e.appendChild(t)}))),Promise.resolve()),e}(t,n,e))).then((e=>function(t,e){return lf(e,Element)&&(function(t,e){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):nf(i).forEach((r=>{let o=i.getPropertyValue(r);"font-size"===r&&o.endsWith("px")&&(o=Math.floor(parseFloat(o.substring(0,o.length-2)))-.1+"px"),lf(t,HTMLIFrameElement)&&"display"===r&&"inline"===o&&(o="block"),"d"===r&&e.getAttribute("d")&&(o=`path(${e.getAttribute("d")})`),n.setProperty(r,o,i.getPropertyPriority(r))}))}(t,e),function(t,e){cf(t,e,":before"),cf(t,e,":after")}(t,e),function(t,e){lf(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),lf(t,HTMLInputElement)&&e.setAttribute("value",t.value)}(t,e),function(t,e){if(lf(t,HTMLSelectElement)){const n=e,i=Array.from(n.children).find((e=>t.value===e.getAttribute("value")));i&&i.setAttribute("selected","")}}(t,e)),e}(t,e))).then((t=>async function(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(0===n.length)return t;const i={};for(let r=0;r<n.length;r++){const o=n[r].getAttribute("xlink:href");if(o){const n=t.querySelector(o),r=document.querySelector(o);!n&&r&&!i[o]&&(i[o]=await _f(r,e,!0))}}const r=Object.values(i);if(r.length){const e="http://www.w3.org/1999/xhtml",n=document.createElementNS(e,"svg");n.setAttribute("xmlns",e),n.style.position="absolute",n.style.width="0",n.style.height="0",n.style.overflow="hidden",n.style.display="none";const i=document.createElementNS(e,"defs");n.appendChild(i);for(let t=0;t<r.length;t++)i.appendChild(r[t]);t.appendChild(n)}return t}(t,e))):null}const bf=/url\((['"]?)([^'"]+?)\1\)/g,xf=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,wf=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Ef(t){return-1!==t.search(bf)}async function Tf(t,e,n){if(!Ef(t))return t;const i=function(t,{preferredFontFormat:e}){return e?t.replace(wf,(t=>{for(;;){const[n,,i]=xf.exec(t)||[];if(!i)return"";if(i===e)return`src: ${n};`}})):t}(t,n);return function(t){const e=[];return t.replace(bf,((t,n,i)=>(e.push(i),t))),e.filter((t=>!pf(t)))}(i).reduce(((t,i)=>t.then((t=>async function(t,e,n,i,r){try{const o=n?function(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),i=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(r),e&&(i.href=e),r.href=t,r.href}(e,n):e,s=ff(e);let a;return r||(a=await yf(o,s,i)),t.replace(function(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}(e),`$1${a}$3`)}catch{}return t}(t,i,e,n)))),Promise.resolve(i))}async function Sf(t,e,n){var i;const r=null===(i=e.style)||void 0===i?void 0:i.getPropertyValue(t);if(r){const i=await Tf(r,null,n);return e.style.setProperty(t,i,e.style.getPropertyPriority(t)),!0}return!1}async function Of(t,e){lf(t,Element)&&(await async function(t,e){await Sf("background",t,e)||await Sf("background-image",t,e),await Sf("mask",t,e)||await Sf("mask-image",t,e)}(t,e),await async function(t,e){const n=lf(t,HTMLImageElement);if((!n||pf(t.src))&&(!lf(t,SVGImageElement)||pf(t.href.baseVal)))return;const i=n?t.src:t.href.baseVal,r=await yf(i,ff(i),e);await new Promise(((e,i)=>{t.onload=e,t.onerror=i;const o=t;o.decode&&(o.decode=e),"lazy"===o.loading&&(o.loading="eager"),n?(t.srcset="",t.src=r):t.href.baseVal=r}))}(t,e),await async function(t,e){const n=nf(t.childNodes).map((t=>Of(t,e)));await Promise.all(n).then((()=>t))}(t,e))}const Mf={};async function Af(t){let e=Mf[t];return null!=e||(e={url:t,cssText:await(await fetch(t)).text()},Mf[t]=e),e}async function Cf(t,e){let n=t.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,r=(n.match(/url\([^)]+\)/g)||[]).map((async r=>{let o=r.replace(i,"$1");return o.startsWith("https://")||(o=new URL(o,t.url).href),gf(o,e.fetchRequestInit,(({result:t})=>(n=n.replace(r,`url(${t})`),[r,t])))}));return Promise.all(r).then((()=>n))}function kf(t){if(null==t)return[];const e=[];let n=t.replace(/(\/\*[\s\S]*?\*\/)/gi,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const t=i.exec(n);if(null===t)break;e.push(t[0])}n=n.replace(i,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let t=r.exec(n);if(null===t){if(t=o.exec(n),null===t)break;r.lastIndex=o.lastIndex}else o.lastIndex=r.lastIndex;e.push(t[0])}return e}async function Df(t,e){const n=null!=e.fontEmbedCSS?e.fontEmbedCSS:e.skipFonts?null:await async function(t,e){const n=await async function(t,e){if(null==t.ownerDocument)throw new Error("Provided element is not within a Document");const n=nf(t.ownerDocument.styleSheets),i=await async function(t,e){const n=[],i=[];return t.forEach((n=>{if("cssRules"in n)try{nf(n.cssRules||[]).forEach(((t,r)=>{if(t.type===CSSRule.IMPORT_RULE){let o=r+1;const s=Af(t.href).then((t=>Cf(t,e))).then((t=>kf(t).forEach((t=>{try{n.insertRule(t,t.startsWith("@import")?o+=1:n.cssRules.length)}catch(e){console.error("Error inserting rule from remote css",{rule:t,error:e})}})))).catch((t=>{console.error("Error loading remote css",t.toString())}));i.push(s)}}))}catch(r){const o=t.find((t=>null==t.href))||document.styleSheets[0];null!=n.href&&i.push(Af(n.href).then((t=>Cf(t,e))).then((t=>kf(t).forEach((t=>{o.insertRule(t,n.cssRules.length)})))).catch((t=>{console.error("Error loading remote stylesheet",t)}))),console.error("Error inlining remote css file",r)}})),Promise.all(i).then((()=>(t.forEach((t=>{if("cssRules"in t)try{nf(t.cssRules||[]).forEach((t=>{n.push(t)}))}catch(e){console.error(`Error while reading CSS rules from ${t.href}`,e)}})),n)))}(n,e);return function(t){return t.filter((t=>t.type===CSSRule.FONT_FACE_RULE)).filter((t=>Ef(t.style.getPropertyValue("src"))))}(i)}(t,e);return(await Promise.all(n.map((t=>{const n=t.parentStyleSheet?t.parentStyleSheet.href:null;return Tf(t.cssText,n,e)})))).join("\n")}(t,e);if(n){const e=document.createElement("style"),i=document.createTextNode(n);e.appendChild(i),t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}}async function Lf(t,e={}){const{width:n,height:i}=of(t,e),r=await _f(t,e,!0);return await Df(r,e),await Of(r,e),function(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const i=e.style;null!=i&&Object.keys(i).forEach((t=>{n[t]=i[t]}))}(r,e),await async function(t,e,n){const i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg"),o=document.createElementNS(i,"foreignObject");return r.setAttribute("width",`${e}`),r.setAttribute("height",`${n}`),r.setAttribute("viewBox",`0 0 ${e} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),r.appendChild(o),o.appendChild(t),async function(t){return Promise.resolve().then((()=>(new XMLSerializer).serializeToString(t))).then(encodeURIComponent).then((t=>`data:image/svg+xml;charset=utf-8,${t}`))}(r)}(r,n,i)}async function Rf(t,e={}){const{width:n,height:i}=of(t,e),r=await Lf(t,e),o=await af(r),s=document.createElement("canvas"),a=s.getContext("2d"),l=e.pixelRatio||function(){let t,e;try{e=process}catch{}const n=e&&e.env?e.env.devicePixelRatio:null;return n&&(t=parseInt(n,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}(),c=e.canvasWidth||n,u=e.canvasHeight||i;return s.width=c*l,s.height=u*l,e.skipAutoScale||function(t){(t.width>sf||t.height>sf)&&(t.width>sf&&t.height>sf?t.width>t.height?(t.height*=sf/t.width,t.width=sf):(t.width*=sf/t.height,t.height=sf):t.width>sf?(t.height*=sf/t.width,t.width=sf):(t.width*=sf/t.height,t.height=sf))}(s),s.style.width=`${c}`,s.style.height=`${u}`,e.backgroundColor&&(a.fillStyle=e.backgroundColor,a.fillRect(0,0,s.width,s.height)),a.drawImage(o,0,0,s.width,s.height),s}let If=class{constructor(t,e){this.model=t,this.services=e,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}},Nf=class t extends If{constructor(t,e){super(t,e)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,e={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=wu(t));const n={width:0,height:0},i=t=>{t&&Object.keys(n).forEach((e=>{if(t[e]){const i=t[e],r=parseFloat(i);i&&r>n[e]&&-1===(""+i).indexOf("%")&&(n[e]=r)}}))},r={width:t.attr("width"),height:t.attr("height")},o=t.node();let s,a,l,c,u;try{"function"==typeof o.getBBox&&(s=o.getBBox(),a={width:s.width,height:s.height})}catch(t){console.error(t)}try{"function"==typeof o?.getBoundingClientRect&&(l=o.getBoundingClientRect(),c={width:l.width,height:l.height})}catch(t){console.error(t)}if(o instanceof SVGSVGElement&&(u={width:o.clientWidth,height:o.clientHeight}),e){if(e.useAttrs&&(i(r),n.width>0&&n.height>0))return n;if(e.useClientDimensions&&(i(u),n.width>0&&n.height>0))return u;if(e.useBBox&&(i(a),n.width>0&&n.height>0))return a;if(e.useBoundingRect&&(i(c),n.width>0&&n.height>0))return c}try{i({width:uc(t.node(),"width","baseVal","value"),height:uc(t.node(),"height","baseVal","value")})}catch{i(u),i(a),i(r)}return n}static appendOrSelect(t,e){const n=t.select(`${e}`);if(n.empty()){let n,i,r=e.split("#");return 2===r.length?(n=r[0],r=r[1].split("."),i=r[0]):(r=e.split("."),n=r[0]),t.append(n).attr("id",i).attr("class",r.slice(1).join(" "))}return n}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,e=!1){const n={left:0,top:0},i=t.getBoundingClientRect(),r=e?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{n.left=i.left-r.left,n.top=i.top-r.top}catch(t){console.error(t)}return n}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor(281474976710656*(1+Math.random())).toString(16)}addMainContainer(){const t=this.model.getOptions(),e=uc(t,"style","prefix"),n=wu(this.getHolder()).append("div").classed(`${al}--${e}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");n.append("g").attr("class","DONT_STYLE_ME_css_styles_verifier"),this.mainContainer=n.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:e,height:n,theme:i}=this.model.getOptions();e!==this.width&&(t.style.width=e,this.width=e),n!==this.height&&(t.style.height=n,this.height=n),wu(this.getHolder()).classed(`${al}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,e=this.model.getOptions(),n=wu(this.getHolder());n.classed("filled",!0),async function(t,e={}){return(await Rf(t,e)).toDataURL("image/jpeg",e.quality||1)}(this.getMainContainer(),{quality:1,filter:t=>!(t.classList&&t.classList.contains("cds--cc--toolbar"))}).then((function(i){let r="myChart";const o=uc(e,"fileDownload","fileName");"function"==typeof o?r=o("jpg"):"string"==typeof o&&(r=o),t.services.files?.downloadImage(i,`${r}.jpg`),n.classed("filled",!1)}))}exportToPNG(){const t=this,e=this.model.getOptions(),n=wu(this.getHolder());n.classed("filled",!0),async function(t,e={}){return(await Rf(t,e)).toDataURL()}(this.getMainContainer(),{quality:1,filter:t=>!(t.classList&&t.classList.contains("cds--cc--toolbar"))}).then((function(i){let r="myChart";const o=uc(e,"fileDownload","fileName");"function"==typeof o?r=o("png"):"string"==typeof o&&(r=o),t.services.files?.downloadImage(i,`${r}.png`),n.classed("filled",!1)})).catch((function(t){console.error("oops, something went wrong!",t)}))}isFullScreenMode(){return wu(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();wu(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=wu(this.getHolder()),e=t.classed("fullscreen");t.classed("fullscreen",!e)}))}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:e}=t.getSVGElementSize(wu(this.mainContainer),{useBBox:!0}),n=wu(this.mainContainer).attr("class"),i=wu(this.mainContainer).selectAll(`.${n} > svg`);let r=0;i.nodes().forEach((function(e){r+=Number(t.getSVGElementSize(wu(e),{useBBox:!0}).height)})),r<=e?wu(this.mainContainer).attr("height",r):wu(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&wu(t).on("mouseover",(()=>{this.services.events?.dispatchEvent(D.Chart.MOUSEOVER)})).on("mouseout",(()=>{this.services.events?.dispatchEvent(D.Chart.MOUSEOUT)}))}addResizeListener(){const t=this.getHolder();if(!t)return;let e=t.clientWidth,n=t.clientHeight;const i=function(t,e,n){var i,r,o,s,a,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var n=i,o=r;return i=r=void 0,c=e,s=t.apply(o,n)}function p(t){var n=t-l;return void 0===l||n>=e||n<0||h&&t-c>=o}function g(){var t=_u();if(p(t))return m(t);a=setTimeout(g,function(t){var n=e-(t-l);return h?xu(n,o-(t-c)):n}(t))}function m(t){return a=void 0,d&&i?f(t):(i=r=void 0,s)}function y(){var t=_u(),n=p(t);if(i=arguments,r=this,l=t,n){if(void 0===a)return function(t){return c=t,a=setTimeout(g,e),u?f(t):s}(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return void 0===a&&(a=setTimeout(g,e)),s}return e=vu(e)||0,Ft(n)&&(u=!!n.leading,o=(h="maxWait"in n)?bu(vu(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=r=a=void 0},y.flush=function(){return void 0===a?s:m(_u())},y}((()=>{t&&(Math.abs(e-t.clientWidth)>1||Math.abs(n-t.clientHeight)>1)&&(e=t.clientWidth,n=t.clientHeight,this.services.events?.dispatchEvent(D.Chart.RESIZE))}),12.5);new ResizeObserver(i).observe(t)}},Pf=class t extends If{static appendOrUpdateLinearGradient(t){let e=t.svg.select(`defs linearGradient#${t.id}`);e.empty()&&(e=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)),e.selectAll("stop").remove(),e.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",(t=>t.offset)).style("stop-color",(t=>t.color)).style("stop-opacity",(t=>t.opacity))}static getOffsetRatio(t){return(100*Math.abs(t[1])/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(e,n){let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return e[0]<0&&e[1]>0&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:t.getOffsetRatio(e),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};var Uf=function(t){return function(e){return t?.[e]}}({À:"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"}),Bf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hf=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),Ff=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$f="\\ud800-\\udfff",jf="\\u2700-\\u27bf",Vf="a-z\\xdf-\\xf6\\xf8-\\xff",Gf="A-Z\\xc0-\\xd6\\xd8-\\xde",Wf="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Yf="["+Wf+"]",Zf="\\d+",Xf="["+jf+"]",qf="["+Vf+"]",Kf="[^"+$f+Wf+Zf+jf+Vf+Gf+"]",Qf="(?:\\ud83c[\\udde6-\\uddff]){2}",Jf="[\\ud800-\\udbff][\\udc00-\\udfff]",tp="["+Gf+"]",ep="(?:"+qf+"|"+Kf+")",np="(?:"+tp+"|"+Kf+")",ip="(?:['’](?:d|ll|m|re|s|t|ve))?",rp="(?:['’](?:D|LL|M|RE|S|T|VE))?",op="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",sp="[\\ufe0e\\ufe0f]?",ap=sp+op+"(?:\\u200d(?:"+["[^"+$f+"]",Qf,Jf].join("|")+")"+sp+op+")*",lp="(?:"+[Xf,Qf,Jf].join("|")+")"+ap,cp=RegExp([tp+"?"+qf+"+"+ip+"(?="+[Yf,tp,"$"].join("|")+")",np+"+"+rp+"(?="+[Yf,tp+ep,"$"].join("|")+")",tp+"?"+ep+"+"+ip,tp+"+"+rp,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zf,lp].join("|"),"g");var up=RegExp("['’]","g");function hp(t){return function(e){return function(t,e,n){for(var i=-1,r=null==t?0:t.length;++i<r;)n=e(n,t[i],i,t);return n}(function(t,e){return t=yn(t),void 0===e?function(t){return zf.test(t)}(t)?function(t){return t.match(cp)||[]}(t):function(t){return t.match(Ff)||[]}(t):t.match(e)||[]}(function(t){return(t=yn(t))&&t.replace(Bf,Uf).replace(Hf,"")}(e).replace(up,"")),t,"")}}function dp(t,e){var n;return Yc(t,(function(t,i,r){return!(n=e(t,i,r))})),!!n}function fp(t,e,n){return(Pt(t)?Oi:dp)(t,$i(e))}be((function(t,e,n){return function(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}(t,vu(e)||0,n)})),hp((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}));class pp{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],o=t+r,s=Math.abs(t)<Math.abs(r)?t-(o-r):r-(o-t);s&&(e[n++]=s),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,o=0;if(r>0){for(o=t[--r];r>0&&(e=o,n=t[--r],o=e+n,i=n-(o-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=o+n,n==e-o&&(o=e))}return o}}function gp(t){return t}var mp=1e-6;function yp(t){return"translate("+t+",0)"}function vp(t){return"translate(0,"+t+")"}function _p(t){return e=>+t(e)}function bp(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function xp(){return!this.__axis}function wp(t,e){var n=[],i=null,r=null,o=6,s=6,a=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",h=1===t||3===t?yp:vp;function d(d){var f=i??(e.ticks?e.ticks.apply(e,n):e.domain()),p=r??(e.tickFormat?e.tickFormat.apply(e,n):gp),g=Math.max(o,0)+a,m=e.range(),y=+m[0]+l,v=+m[m.length-1]+l,_=(e.bandwidth?bp:_p)(e.copy(),l),b=d.selection?d.selection():d,x=b.selectAll(".domain").data([null]),w=b.selectAll(".tick").data(f,e).order(),E=w.exit(),T=w.enter().append("g").attr("class","tick"),S=w.select("line"),O=w.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(T),S=S.merge(T.append("line").attr("stroke","currentColor").attr(u+"2",c*o)),O=O.merge(T.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),d!==b&&(x=x.transition(d),w=w.transition(d),S=S.transition(d),O=O.transition(d),E=E.transition(d).attr("opacity",mp).attr("transform",(function(t){return isFinite(t=_(t))?h(t+l):this.getAttribute("transform")})),T.attr("opacity",mp).attr("transform",(function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:_(t))+l)}))),E.remove(),x.attr("d",4===t||2===t?s?"M"+c*s+","+y+"H"+l+"V"+v+"H"+c*s:"M"+l+","+y+"V"+v:s?"M"+y+","+c*s+"V"+l+"H"+v+"V"+c*s:"M"+y+","+l+"H"+v),w.attr("opacity",1).attr("transform",(function(t){return h(_(t)+l)})),S.attr(u+"2",c*o),O.attr(u,c*g).text(p),b.filter(xp).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),b.each((function(){this.__axis=_}))}return d.scale=function(t){return arguments.length?(e=t,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),d):n.slice()},d.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),d):i&&i.slice()},d.tickFormat=function(t){return arguments.length?(r=t,d):r},d.tickSize=function(t){return arguments.length?(o=s=+t,d):o},d.tickSizeInner=function(t){return arguments.length?(o=+t,d):o},d.tickSizeOuter=function(t){return arguments.length?(s=+t,d):s},d.tickPadding=function(t){return arguments.length?(a=+t,d):a},d.offset=function(t){return arguments.length?(l=+t,d):l},d}function Ep(t){return wp(1,t)}function Tp(t){return wp(2,t)}function Sp(t){return wp(3,t)}function Op(t){return wp(4,t)}const Mp={capture:!0,passive:!1};function Ap(t){t.preventDefault(),t.stopImmediatePropagation()}const Cp=t=>+t,kp=t=>()=>t;function Dp(t,{sourceEvent:e,target:n,selection:i,mode:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Lp(t){t.preventDefault(),t.stopImmediatePropagation()}var Rp={name:"drag"},Ip={name:"space"},Np={name:"handle"},Pp={name:"center"};const{abs:Up,max:Bp,min:Hp}=Math;function Fp(t){return[+t[0],+t[1]]}function zp(t){return[Fp(t[0]),Fp(t[1])]}var $p={name:"x",handles:["w","e"].map(Xp),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},jp={},Vp={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"},Gp={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Wp={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Yp={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Zp={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Xp(t){return{type:t}}function qp(t){return!t.ctrlKey&&!t.button}function Kp(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Qp(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jp(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function tg(){return function(t){var e,n=Kp,i=qp,r=Qp,o=!0,s=_r("start","brush","end"),a=6;function l(e){var n=e.property("__brush",g).selectAll(".overlay").data([Xp("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Vp.overlay).merge(n).each((function(){var t=Jp(this).extent;wu(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),e.selectAll(".selection").data([Xp("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Vp.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var i=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));i.exit().remove(),i.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Vp[t.type]})),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=wu(this),e=Jp(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-a/2:e[0][0]-a/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-a/2:e[0][1]-a/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+a:a})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+a:a}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(t,e,n){var i=t.__brush.emitter;return!i||n&&i.clean?new h(t,e,n):i}function h(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function d(n){if((!e||n.touches)&&i.apply(this,arguments)){var r,s,a,l,h,d,f,p,g,m,y,v=this,_=n.target.__data__.type,b="selection"===(o&&n.metaKey?_="overlay":_)?Rp:o&&n.altKey?Pp:Np,x=t===jp?null:Yp[_],w=t===$p?null:Zp[_],E=Jp(v),T=E.extent,S=E.selection,O=T[0][0],M=T[0][1],A=T[1][0],C=T[1][1],k=0,D=0,L=x&&w&&o&&n.shiftKey,R=Array.from(n.touches||[n],(t=>{const e=t.identifier;return(t=No(t,v)).point0=t.slice(),t.identifier=e,t}));sa(v);var I=u(v,arguments,!0).beforestart();if("overlay"===_){S&&(g=!0);const e=[R[0],R[1]||R[0]];E.selection=S=[[r=t===jp?O:Hp(e[0][0],e[1][0]),a=t===$p?M:Hp(e[0][1],e[1][1])],[h=t===jp?A:Bp(e[0][0],e[1][0]),f=t===$p?C:Bp(e[0][1],e[1][1])]],R.length>1&&H(n)}else r=S[0][0],a=S[0][1],h=S[1][0],f=S[1][1];s=r,l=a,d=h,p=f;var N=wu(v).attr("pointer-events","none"),P=N.selectAll(".overlay").attr("cursor",Vp[_]);if(n.touches)I.moved=B,I.ended=F;else{var U=wu(n.view).on("mousemove.brush",B,!0).on("mouseup.brush",F,!0);o&&U.on("keydown.brush",(function(t){switch(t.keyCode){case 16:L=x&&w;break;case 18:b===Np&&(x&&(h=d-k*x,r=s+k*x),w&&(f=p-D*w,a=l+D*w),b=Pp,H(t));break;case 32:(b===Np||b===Pp)&&(x<0?h=d-k:x>0&&(r=s-k),w<0?f=p-D:w>0&&(a=l-D),b=Ip,P.attr("cursor",Vp.selection),H(t));break;default:return}Lp(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:L&&(m=y=L=!1,H(t));break;case 18:b===Pp&&(x<0?h=d:x>0&&(r=s),w<0?f=p:w>0&&(a=l),b=Np,H(t));break;case 32:b===Ip&&(t.altKey?(x&&(h=d-k*x,r=s+k*x),w&&(f=p-D*w,a=l+D*w),b=Pp):(x<0?h=d:x>0&&(r=s),w<0?f=p:w>0&&(a=l),b=Np),P.attr("cursor",Vp[_]),H(t));break;default:return}Lp(t)}),!0),function(t){var e=t.document.documentElement,n=wu(t).on("dragstart.drag",Ap,Mp);"onselectstart"in e?n.on("selectstart.drag",Ap,Mp):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(n.view)}c.call(v),I.start(n,b.name)}function B(t){for(const e of t.changedTouches||[t])for(const t of R)t.identifier===e.identifier&&(t.cur=No(e,v));if(L&&!m&&!y&&1===R.length){const t=R[0];Up(t.cur[0]-t[0])>Up(t.cur[1]-t[1])?y=!0:m=!0}for(const t of R)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);g=!0,Lp(t),H(t)}function H(t){const e=R[0],n=e.point0;var i;switch(k=e[0]-n[0],D=e[1]-n[1],b){case Ip:case Rp:x&&(k=Bp(O-r,Hp(A-h,k)),s=r+k,d=h+k),w&&(D=Bp(M-a,Hp(C-f,D)),l=a+D,p=f+D);break;case Np:R[1]?(x&&(s=Bp(O,Hp(A,R[0][0])),d=Bp(O,Hp(A,R[1][0])),x=1),w&&(l=Bp(M,Hp(C,R[0][1])),p=Bp(M,Hp(C,R[1][1])),w=1)):(x<0?(k=Bp(O-r,Hp(A-r,k)),s=r+k,d=h):x>0&&(k=Bp(O-h,Hp(A-h,k)),s=r,d=h+k),w<0?(D=Bp(M-a,Hp(C-a,D)),l=a+D,p=f):w>0&&(D=Bp(M-f,Hp(C-f,D)),l=a,p=f+D));break;case Pp:x&&(s=Bp(O,Hp(A,r-k*x)),d=Bp(O,Hp(A,h+k*x))),w&&(l=Bp(M,Hp(C,a-D*w)),p=Bp(M,Hp(C,f+D*w)))}d<s&&(x*=-1,i=r,r=h,h=i,i=s,s=d,d=i,_ in Gp&&P.attr("cursor",Vp[_=Gp[_]])),p<l&&(w*=-1,i=a,a=f,f=i,i=l,l=p,p=i,_ in Wp&&P.attr("cursor",Vp[_=Wp[_]])),E.selection&&(S=E.selection),m&&(s=S[0][0],d=S[1][0]),y&&(l=S[0][1],p=S[1][1]),(S[0][0]!==s||S[0][1]!==l||S[1][0]!==d||S[1][1]!==p)&&(E.selection=[[s,l],[d,p]],c.call(v),I.brush(t,b.name))}function F(t){if(function(t){t.stopImmediatePropagation()}(t),t.touches){if(t.touches.length)return;e&&clearTimeout(e),e=setTimeout((function(){e=null}),500)}else(function(t,e){var n=t.document.documentElement,i=wu(t).on("dragstart.drag",null);e&&(i.on("click.drag",Ap,Mp),setTimeout((function(){i.on("click.drag",null)}),0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)})(t.view,g),U.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);N.attr("pointer-events","all"),P.attr("cursor",Vp.overlay),E.selection&&(S=E.selection),function(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}(S)&&(E.selection=null,c.call(v)),I.end(t,b.name)}}function f(t){u(this,arguments).moved(t)}function p(t){u(this,arguments).ended(t)}function g(){var e=this.__brush||{selection:null};return e.extent=zp(n.apply(this,arguments)),e.dim=t,e}return l.move=function(e,n,i){e.tween?e.on("start.brush",(function(t){u(this,arguments).beforestart().start(t)})).on("interrupt.brush end.brush",(function(t){u(this,arguments).end(t)})).tween("brush",(function(){var e=this,i=e.__brush,r=u(e,arguments),o=i.selection,s=t.input("function"==typeof n?n.apply(this,arguments):n,i.extent),a=Ms(o,s);function l(t){i.selection=1===t&&null===s?null:a(t),c.call(e),r.brush()}return null!==o&&null!==s?l:l(1)})):e.each((function(){var e=this,r=arguments,o=e.__brush,s=t.input("function"==typeof n?n.apply(e,r):n,o.extent),a=u(e,r).beforestart();sa(e),o.selection=null===s?null:s,c.call(e),a.start(i).brush(i).end(i)}))},l.clear=function(t,e){l.move(t,null,e)},h.prototype={beforestart:function(){return 1===++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(t,e){return this.starting?(this.starting=!1,this.emit("start",t,e)):this.emit("brush",t),this},brush:function(t,e){return this.emit("brush",t,e),this},end:function(t,e){return 0===--this.active&&(delete this.state.emitter,this.emit("end",t,e)),this},emit:function(e,n,i){var r=wu(this.that).datum();s.call(e,this.that,new Dp(e,{sourceEvent:n,target:l,selection:t.output(this.state.selection),mode:i,dispatch:s}),r)}},l.extent=function(t){return arguments.length?(n="function"==typeof t?t:kp(zp(t)),l):n},l.filter=function(t){return arguments.length?(i="function"==typeof t?t:kp(!!t),l):i},l.touchable=function(t){return arguments.length?(r="function"==typeof t?t:kp(!!t),l):r},l.handleSize=function(t){return arguments.length?(a=+t,l):a},l.keyModifiers=function(t){return arguments.length?(o=!!t,l):o},l.on=function(){var t=s.on.apply(s,arguments);return t===s?l:t},l}($p)}const eg=Math.PI,ng=2*eg,ig=1e-6,rg=ng-ig;function og(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}let sg=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?og:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return og;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,i){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,e,n,i,r,o){this._append`C${+t},${+e},${+n},${+i},${this._x1=+r},${this._y1=+o}`}arcTo(t,e,n,i,r){if(t=+t,e=+e,n=+n,i=+i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let o=this._x1,s=this._y1,a=n-t,l=i-e,c=o-t,u=s-e,h=c*c+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(h>ig)if(Math.abs(u*a-l*c)>ig&&r){let d=n-o,f=i-s,p=a*a+l*l,g=d*d+f*f,m=Math.sqrt(p),y=Math.sqrt(h),v=r*Math.tan((eg-Math.acos((p+h-g)/(2*m*y)))/2),_=v/y,b=v/m;Math.abs(_-1)>ig&&this._append`L${t+_*c},${e+_*u}`,this._append`A${r},${r},0,0,${+(u*d>c*f)},${this._x1=t+b*a},${this._y1=e+b*l}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,i,r,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),a=n*Math.sin(i),l=t+s,c=e+a,u=1^o,h=o?i-r:r-i;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>ig||Math.abs(this._y1-c)>ig)&&this._append`L${l},${c}`,n&&(h<0&&(h=h%ng+ng),h>rg?this._append`A${n},${n},0,1,${u},${t-s},${e-a}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>ig&&this._append`A${n},${n},0,${+(h>=eg)},${u},${this._x1=t+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};var ag=Math.PI,lg=2*ag,cg=ag/180,ug=Math.abs,hg=(Math.atan,Math.atan2,Math.cos),dg=(Math.exp,Math.log,Math.sin,Math.sign,Math.sqrt);Math.tan;function fg(t,e){return ug(t)>ag&&(t-=Math.round(t/lg)*lg),[t,e]}function pg(){}function gg(t,e){return[t,e]}fg.invert=fg,new pp,new pp,new pp,pg.prototype={constructor:pg,point:function(t,e){this.stream.point(t,e)},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()}},hg(30*cg),gg.invert=gg;dg(3);function mg(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function yg(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=_g)):void 0===e&&(e=vg);for(var n,i,r,o,s,a=new wg(t),l=[a];n=l.pop();)if((r=e(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new wg(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(xg)}function vg(t){return t.children}function _g(t){return Array.isArray(t)?t[1]:null}function bg(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function xg(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function wg(t){this.data=t,this.depth=this.height=0,this.parent=null}function Eg(t,e,n,i,r){for(var o,s=t.children,a=-1,l=s.length,c=t.value&&(i-e)/t.value;++a<l;)(o=s[a]).y0=n,o.y1=r,o.x0=e,o.x1=e+=o.value*c}function Tg(t,e,n,i,r){for(var o,s=t.children,a=-1,l=s.length,c=t.value&&(r-n)/t.value;++a<l;)(o=s[a]).x0=e,o.x1=i,o.y0=n,o.y1=n+=o.value*c}function Sg(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new sg(e)}function Og(t){return t.innerRadius}function Mg(t){return t.outerRadius}function Ag(t){return t.startAngle}function Cg(t){return t.endAngle}function kg(t){return t&&t.padAngle}function Dg(t,e,n,i,r,o,s){var a=t-n,l=e-i,c=(s?o:-o)/Vd(a*a+l*l),u=c*l,h=-c*a,d=t+u,f=e+h,p=n+u,g=i+h,m=(d+p)/2,y=(f+g)/2,v=p-d,_=g-f,b=v*v+_*_,x=r-o,w=d*g-p*f,E=(_<0?-1:1)*Vd(zd(0,x*x*b-w*w)),T=(w*_-v*E)/b,S=(-w*v-_*E)/b,O=(w*_+v*E)/b,M=(-w*v+_*E)/b,A=T-m,C=S-y,k=O-m,D=M-y;return A*A+C*C>k*k+D*D&&(T=O,S=M),{cx:T,cy:S,x01:-u,y01:-h,x11:T*(r/x-1),y11:S*(r/x-1)}}function Lg(t){return t[0]}function Rg(t){return t[1]}function Ig(t,e){var n=Zc(!0),i=null,r=Kd,o=null,s=Sg(a);function a(a){var l,c,u,h=(a=Xc(a)).length,d=!1;for(null==i&&(o=r(u=s())),l=0;l<=h;++l)!(l<h&&n(c=a[l],l,a))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(c,l,a),+e(c,l,a));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?Lg:Zc(t),e="function"==typeof e?e:void 0===e?Rg:Zc(e),a.x=function(e){return arguments.length?(t="function"==typeof e?e:Zc(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:Zc(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:Zc(!!t),a):n},a.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),a):r},a.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),a):i},a}function Ng(t,e,n){var i=null,r=Zc(!0),o=null,s=Kd,a=null,l=Sg(c);function c(c){var u,h,d,f,p,g=(c=Xc(c)).length,m=!1,y=new Array(g),v=new Array(g);for(null==o&&(a=s(p=l())),u=0;u<=g;++u){if(!(u<g&&r(f=c[u],u,c))===m)if(m=!m)h=u,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),d=u-1;d>=h;--d)a.point(y[d],v[d]);a.lineEnd(),a.areaEnd()}m&&(y[u]=+t(f,u,c),v[u]=+e(f,u,c),a.point(i?+i(f,u,c):y[u],n?+n(f,u,c):v[u]))}if(p)return a=null,p+""||null}function u(){return Ig().defined(r).curve(s).context(o)}return t="function"==typeof t?t:void 0===t?Lg:Zc(+t),e="function"==typeof e?e:Zc(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?Rg:Zc(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:Zc(+e),i=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:Zc(+e),c):t},c.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Zc(+t),c):i},c.y=function(t){return arguments.length?(e="function"==typeof t?t:Zc(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:Zc(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Zc(+t),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(i).y(e)},c.defined=function(t){return arguments.length?(r="function"==typeof t?t:Zc(!!t),c):r},c.curve=function(t){return arguments.length?(s=t,null!=o&&(a=s(o)),c):s},c.context=function(t){return arguments.length?(null==t?o=a=null:a=s(o=t),c):o},c}function Pg(t){this._curve=t}wg.prototype=yg.prototype={constructor:wg,count:function(){return this.eachAfter(mg)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)t.call(e,o,++l,this);return this},eachBefore:function(t,e){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(t.call(e,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return yg(this).eachBefore(bg)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n])}while(o.length)}},Object.create(wg.prototype),function t(e){function n(t,n,i,r,o){!function(t,e,n,i,r,o){for(var s,a,l,c,u,h,d,f,p,g,m,y=[],v=e.children,_=0,b=0,x=v.length,w=e.value;_<x;){l=r-n,c=o-i;do{u=v[b++].value}while(!u&&b<x);for(h=d=u,m=u*u*(g=Math.max(c/l,l/c)/(w*t)),p=Math.max(d/m,m/h);b<x;++b){if(u+=a=v[b].value,a<h&&(h=a),a>d&&(d=a),m=u*u*g,(f=Math.max(d/m,m/h))>p){u-=a;break}p=f}y.push(s={value:u,dice:l<c,children:v.slice(_,b)}),s.dice?Eg(s,n,i,r,w?i+=c*u/w:o):Tg(s,n,i,w?n+=l*u/w:r,o),w-=u,_=b}}(e,t,n,i,r,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}((1+Math.sqrt(5))/2),function(t){function e(e){return new Pg(t(e))}e._curve=t}(Kd),Pg.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};let Ug=class{constructor(t,e,n){if(this.type="",this.renderType=L.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=e,n&&(this.configs=n,this.configs.id)){const t=uc(this.model.getOptions(),"style","prefix");this.id=`${t}--${this.configs.id}`}this.parent||this.setParent(wu(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 e=this.parent;if(this.parent=t,(!e||e.node()!==t.node())&&this.type){const t=uc(this.model.getOptions(),"style","prefix");this.parent?.classed(`${al}--${t}--${this.type}`,!0),e&&e.classed(`${al}--${t}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const e=uc(this.model.getOptions(),"style","prefix"),n=this.id?`#${this.id}`:"",i=Nf.appendOrSelect(this.parent,`${this.renderType===L.SVG?"svg":"div"}${n}.${al}--${e}--${this.type}`);if(t.ariaLabel&&i.attr("aria-label",t.ariaLabel),t.isPresentational&&i.attr("role","presentation"),t.withinChartClip){const t=this.model.get("chartClipId");if(t){const e=wu(`#${t}`).select("rect");if(0!==e.size()){const n=parseFloat(e.attr("height")),r=parseFloat(e.attr("width"));!isNaN(n)&&!isNaN(r)&&n>0&&r>0&&i.attr("clip-path",`url(#${t})`)}}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?qi({},this.model.getOptions(),this.configs.options):this.model.getOptions()}};const{entries:Bg,setPrototypeOf:Hg,isFrozen:Fg,getPrototypeOf:zg,getOwnPropertyDescriptor:$g}=Object;let{freeze:jg,seal:Vg,create:Gg}=Object,{apply:Wg,construct:Yg}=typeof Reflect<"u"&&Reflect;jg||(jg=function(t){return t}),Vg||(Vg=function(t){return t}),Wg||(Wg=function(t,e,n){return t.apply(e,n)}),Yg||(Yg=function(t,e){return new t(...e)});const Zg=lm(Array.prototype.forEach),Xg=lm(Array.prototype.lastIndexOf),qg=lm(Array.prototype.pop),Kg=lm(Array.prototype.push),Qg=lm(Array.prototype.splice),Jg=lm(String.prototype.toLowerCase),tm=lm(String.prototype.toString),em=lm(String.prototype.match),nm=lm(String.prototype.replace),im=lm(String.prototype.indexOf),rm=lm(String.prototype.trim),om=lm(Object.prototype.hasOwnProperty),sm=lm(RegExp.prototype.test),am=function(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return Yg(t,n)}}(TypeError);function lm(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Wg(t,e,i)}}function cm(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Jg;Hg&&Hg(t,null);let i=e.length;for(;i--;){let r=e[i];if("string"==typeof r){const t=n(r);t!==r&&(Fg(e)||(e[i]=t),r=t)}t[r]=!0}return t}function um(t){for(let e=0;e<t.length;e++)om(t,e)||(t[e]=null);return t}function hm(t){const e=Gg(null);for(const[n,i]of Bg(t))om(t,n)&&(Array.isArray(i)?e[n]=um(i):i&&"object"==typeof i&&i.constructor===Object?e[n]=hm(i):e[n]=i);return e}function dm(t,e){for(;null!==t;){const n=$g(t,e);if(n){if(n.get)return lm(n.get);if("function"==typeof n.value)return lm(n.value)}t=zg(t)}return function(){return null}}const fm=jg(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),pm=jg(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),gm=jg(["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"]),mm=jg(["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"]),ym=jg(["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"]),vm=jg(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_m=jg(["#text"]),bm=jg(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),xm=jg(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),wm=jg(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Em=jg(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Tm=Vg(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Sm=Vg(/<%[\w\W]*|[\w\W]*%>/gm),Om=Vg(/\$\{[\w\W]*/gm),Mm=Vg(/^data-[\-\w.\u00B7-\uFFFF]+$/),Am=Vg(/^aria-[\-\w]+$/),Cm=Vg(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),km=Vg(/^(?:\w+script|data):/i),Dm=Vg(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Lm=Vg(/^html$/i),Rm=Vg(/^[a-z][.\w]*(-[.\w]+)+$/i);var Im=Object.freeze({__proto__:null,ARIA_ATTR:Am,ATTR_WHITESPACE:Dm,CUSTOM_ELEMENT:Rm,DATA_ATTR:Mm,DOCTYPE_NAME:Lm,ERB_EXPR:Sm,IS_ALLOWED_URI:Cm,IS_SCRIPT_OR_DATA:km,MUSTACHE_EXPR:Tm,TMPLIT_EXPR:Om});var Nm=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:typeof window>"u"?null:window;const n=e=>t(e);if(n.version="3.2.6",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let{document:i}=e;const r=i,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:u,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,g=c.prototype,m=dm(g,"cloneNode"),y=dm(g,"remove"),v=dm(g,"nextSibling"),_=dm(g,"childNodes"),b=dm(g,"parentNode");if("function"==typeof a){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let x,w="";const{implementation:E,createNodeIterator:T,createDocumentFragment:S,getElementsByTagName:O}=i,{importNode:M}=r;let A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Bg&&"function"==typeof b&&E&&void 0!==E.createHTMLDocument;const{MUSTACHE_EXPR:C,ERB_EXPR:k,TMPLIT_EXPR:D,DATA_ATTR:L,ARIA_ATTR:R,IS_SCRIPT_OR_DATA:I,ATTR_WHITESPACE:N,CUSTOM_ELEMENT:P}=Im;let{IS_ALLOWED_URI:U}=Im,B=null;const H=cm({},[...fm,...pm,...gm,...ym,..._m]);let F=null;const z=cm({},[...bm,...xm,...wm,...Em]);let $=Object.seal(Gg(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}})),j=null,V=null,G=!0,W=!0,Y=!1,Z=!0,X=!1,q=!0,K=!1,Q=!1,J=!1,tt=!1,et=!1,nt=!1,it=!0,rt=!1,ot=!0,st=!1,at={},lt=null;const ct=cm({},["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 ut=null;const ht=cm({},["audio","video","img","source","image","track"]);let dt=null;const ft=cm({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pt="http://www.w3.org/1998/Math/MathML",gt="http://www.w3.org/2000/svg",mt="http://www.w3.org/1999/xhtml";let yt=mt,vt=!1,_t=null;const bt=cm({},[pt,gt,mt],tm);let xt=cm({},["mi","mo","mn","ms","mtext"]),wt=cm({},["annotation-xml"]);const Et=cm({},["title","style","font","a","script"]);let Tt=null;const St=["application/xhtml+xml","text/html"];let Ot=null,Mt=null;const At=i.createElement("form"),Ct=function(t){return t instanceof RegExp||t instanceof Function},kt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Mt||Mt!==t){if((!t||"object"!=typeof t)&&(t={}),t=hm(t),Tt=-1===St.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Ot="application/xhtml+xml"===Tt?tm:Jg,B=om(t,"ALLOWED_TAGS")?cm({},t.ALLOWED_TAGS,Ot):H,F=om(t,"ALLOWED_ATTR")?cm({},t.ALLOWED_ATTR,Ot):z,_t=om(t,"ALLOWED_NAMESPACES")?cm({},t.ALLOWED_NAMESPACES,tm):bt,dt=om(t,"ADD_URI_SAFE_ATTR")?cm(hm(ft),t.ADD_URI_SAFE_ATTR,Ot):ft,ut=om(t,"ADD_DATA_URI_TAGS")?cm(hm(ht),t.ADD_DATA_URI_TAGS,Ot):ht,lt=om(t,"FORBID_CONTENTS")?cm({},t.FORBID_CONTENTS,Ot):ct,j=om(t,"FORBID_TAGS")?cm({},t.FORBID_TAGS,Ot):hm({}),V=om(t,"FORBID_ATTR")?cm({},t.FORBID_ATTR,Ot):hm({}),at=!!om(t,"USE_PROFILES")&&t.USE_PROFILES,G=!1!==t.ALLOW_ARIA_ATTR,W=!1!==t.ALLOW_DATA_ATTR,Y=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,X=t.SAFE_FOR_TEMPLATES||!1,q=!1!==t.SAFE_FOR_XML,K=t.WHOLE_DOCUMENT||!1,tt=t.RETURN_DOM||!1,et=t.RETURN_DOM_FRAGMENT||!1,nt=t.RETURN_TRUSTED_TYPE||!1,J=t.FORCE_BODY||!1,it=!1!==t.SANITIZE_DOM,rt=t.SANITIZE_NAMED_PROPS||!1,ot=!1!==t.KEEP_CONTENT,st=t.IN_PLACE||!1,U=t.ALLOWED_URI_REGEXP||Cm,yt=t.NAMESPACE||mt,xt=t.MATHML_TEXT_INTEGRATION_POINTS||xt,wt=t.HTML_INTEGRATION_POINTS||wt,$=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Ct(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Ct(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&($.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(W=!1),et&&(tt=!0),at&&(B=cm({},_m),F=[],!0===at.html&&(cm(B,fm),cm(F,bm)),!0===at.svg&&(cm(B,pm),cm(F,xm),cm(F,Em)),!0===at.svgFilters&&(cm(B,gm),cm(F,xm),cm(F,Em)),!0===at.mathMl&&(cm(B,ym),cm(F,wm),cm(F,Em))),t.ADD_TAGS&&(B===H&&(B=hm(B)),cm(B,t.ADD_TAGS,Ot)),t.ADD_ATTR&&(F===z&&(F=hm(F)),cm(F,t.ADD_ATTR,Ot)),t.ADD_URI_SAFE_ATTR&&cm(dt,t.ADD_URI_SAFE_ATTR,Ot),t.FORBID_CONTENTS&&(lt===ct&&(lt=hm(lt)),cm(lt,t.FORBID_CONTENTS,Ot)),ot&&(B["#text"]=!0),K&&cm(B,["html","head","body"]),B.table&&(cm(B,["tbody"]),delete j.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw am('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw am('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=t.TRUSTED_TYPES_POLICY,w=x.createHTML("")}else void 0===x&&(x=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(n=e.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(p,o)),null!==x&&"string"==typeof w&&(w=x.createHTML(""));jg&&jg(t),Mt=t}},Dt=cm({},[...pm,...gm,...mm]),Lt=cm({},[...ym,...vm]),Rt=function(t){Kg(n.removed,{element:t});try{b(t).removeChild(t)}catch{y(t)}},It=function(t,e){try{Kg(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch{Kg(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(tt||et)try{Rt(e)}catch{}else try{e.setAttribute(t,"")}catch{}},Nt=function(t){let e=null,n=null;if(J)t="<remove></remove>"+t;else{const e=em(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Tt&&yt===mt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=x?x.createHTML(t):t;if(yt===mt)try{e=(new f).parseFromString(r,Tt)}catch{}if(!e||!e.documentElement){e=E.createDocument(yt,"template",null);try{e.documentElement.innerHTML=vt?w:r}catch{}}const o=e.body||e.documentElement;return t&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),yt===mt?O.call(e,K?"html":"body")[0]:K?e.documentElement:o},Pt=function(t){return T.call(t.ownerDocument||t,t,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ut=function(t){return t instanceof d&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof h)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},Bt=function(t){return"function"==typeof l&&t instanceof l};function Ht(t,e,i){Zg(t,(t=>{t.call(n,e,i,Mt)}))}const Ft=function(t){let e=null;if(Ht(A.beforeSanitizeElements,t,null),Ut(t))return Rt(t),!0;const i=Ot(t.nodeName);if(Ht(A.uponSanitizeElement,t,{tagName:i,allowedTags:B}),q&&t.hasChildNodes()&&!Bt(t.firstElementChild)&&sm(/<[/\w!]/g,t.innerHTML)&&sm(/<[/\w!]/g,t.textContent)||7===t.nodeType||q&&8===t.nodeType&&sm(/<[/\w]/g,t.data))return Rt(t),!0;if(!B[i]||j[i]){if(!j[i]&&$t(i)&&($.tagNameCheck instanceof RegExp&&sm($.tagNameCheck,i)||$.tagNameCheck instanceof Function&&$.tagNameCheck(i)))return!1;if(ot&&!lt[i]){const e=b(t)||t.parentNode,n=_(t)||t.childNodes;if(n&&e)for(let i=n.length-1;i>=0;--i){const r=m(n[i],!0);r.__removalCount=(t.__removalCount||0)+1,e.insertBefore(r,v(t))}}return Rt(t),!0}return t instanceof c&&!function(t){let e=b(t);(!e||!e.tagName)&&(e={namespaceURI:yt,tagName:"template"});const n=Jg(t.tagName),i=Jg(e.tagName);return!!_t[t.namespaceURI]&&(t.namespaceURI===gt?e.namespaceURI===mt?"svg"===n:e.namespaceURI===pt?"svg"===n&&("annotation-xml"===i||xt[i]):!!Dt[n]:t.namespaceURI===pt?e.namespaceURI===mt?"math"===n:e.namespaceURI===gt?"math"===n&&wt[i]:!!Lt[n]:t.namespaceURI===mt?!(e.namespaceURI===gt&&!wt[i]||e.namespaceURI===pt&&!xt[i])&&!Lt[n]&&(Et[n]||!Dt[n]):!("application/xhtml+xml"!==Tt||!_t[t.namespaceURI]))}(t)||("noscript"===i||"noembed"===i||"noframes"===i)&&sm(/<\/no(script|embed|frames)/i,t.innerHTML)?(Rt(t),!0):(X&&3===t.nodeType&&(e=t.textContent,Zg([C,k,D],(t=>{e=nm(e,t," ")})),t.textContent!==e&&(Kg(n.removed,{element:t.cloneNode()}),t.textContent=e)),Ht(A.afterSanitizeElements,t,null),!1)},zt=function(t,e,n){if(it&&("id"===e||"name"===e)&&(n in i||n in At))return!1;if((!W||V[e]||!sm(L,e))&&(!G||!sm(R,e)))if(!F[e]||V[e]){if(!($t(t)&&($.tagNameCheck instanceof RegExp&&sm($.tagNameCheck,t)||$.tagNameCheck instanceof Function&&$.tagNameCheck(t))&&($.attributeNameCheck instanceof RegExp&&sm($.attributeNameCheck,e)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(e))||"is"===e&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&sm($.tagNameCheck,n)||$.tagNameCheck instanceof Function&&$.tagNameCheck(n))))return!1}else if(!dt[e]&&!sm(U,nm(n,N,""))&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==im(n,"data:")||!ut[t])&&(!Y||sm(I,nm(n,N,"")))&&n)return!1;return!0},$t=function(t){return"annotation-xml"!==t&&em(t,P)},jt=function(t){Ht(A.beforeSanitizeAttributes,t,null);const{attributes:e}=t;if(!e||Ut(t))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let r=e.length;for(;r--;){const o=e[r],{name:s,namespaceURI:a,value:l}=o,c=Ot(s),u=l;let h="value"===s?u:rm(u);if(i.attrName=c,i.attrValue=h,i.keepAttr=!0,i.forceKeepAttr=void 0,Ht(A.uponSanitizeAttribute,t,i),h=i.attrValue,rt&&("id"===c||"name"===c)&&(It(s,t),h="user-content-"+h),q&&sm(/((--!?|])>)|<\/(style|title)/i,h)){It(s,t);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){It(s,t);continue}if(!Z&&sm(/\/>/i,h)){It(s,t);continue}X&&Zg([C,k,D],(t=>{h=nm(h,t," ")}));const d=Ot(t.nodeName);if(zt(d,c,h)){if(x&&"object"==typeof p&&"function"==typeof p.getAttributeType&&!a)switch(p.getAttributeType(d,c)){case"TrustedHTML":h=x.createHTML(h);break;case"TrustedScriptURL":h=x.createScriptURL(h)}if(h!==u)try{a?t.setAttributeNS(a,s,h):t.setAttribute(s,h),Ut(t)?Rt(t):qg(n.removed)}catch{It(s,t)}}else It(s,t)}Ht(A.afterSanitizeAttributes,t,null)},Vt=function t(e){let n=null;const i=Pt(e);for(Ht(A.beforeSanitizeShadowDOM,e,null);n=i.nextNode();)Ht(A.uponSanitizeShadowNode,n,null),Ft(n),jt(n),n.content instanceof s&&t(n.content);Ht(A.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,a=null,c=null;if(vt=!t,vt&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Bt(t)){if("function"!=typeof t.toString)throw am("toString is not a function");if("string"!=typeof(t=t.toString()))throw am("dirty is not a string, aborting")}if(!n.isSupported)return t;if(Q||kt(e),n.removed=[],"string"==typeof t&&(st=!1),st){if(t.nodeName){const e=Ot(t.nodeName);if(!B[e]||j[e])throw am("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof l)i=Nt("\x3c!----\x3e"),o=i.ownerDocument.importNode(t,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o);else{if(!tt&&!X&&!K&&-1===t.indexOf("<"))return x&&nt?x.createHTML(t):t;if(i=Nt(t),!i)return tt?null:nt?w:""}i&&J&&Rt(i.firstChild);const u=Pt(st?t:i);for(;a=u.nextNode();)Ft(a),jt(a),a.content instanceof s&&Vt(a.content);if(st)return t;if(tt){if(et)for(c=S.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(F.shadowroot||F.shadowrootmode)&&(c=M.call(r,c,!0)),c}let h=K?i.outerHTML:i.innerHTML;return K&&B["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&sm(Lm,i.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+h),X&&Zg([C,k,D],(t=>{h=nm(h,t," ")})),x&&nt?x.createHTML(h):h},n.setConfig=function(){kt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Q=!0},n.clearConfig=function(){Mt=null,Q=!1},n.isValidAttribute=function(t,e,n){Mt||kt({});const i=Ot(t),r=Ot(e);return zt(i,r,n)},n.addHook=function(t,e){"function"==typeof e&&Kg(A[t],e)},n.removeHook=function(t,e){if(void 0!==e){const n=Xg(A[t],e);return-1===n?void 0:Qg(A[t],n,1)[0]}return qg(A[t])},n.removeHooks=function(t){A[t]=[]},n.removeAllHooks=function(){A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const Pm=t=>Nm.sanitize(t,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),Um=t=>Nm.sanitize(t,{ALLOWED_TAGS:[]}),Bm=class t extends Ug{constructor(){super(...arguments),this.type="toolbar",this.renderType=L.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(D.Toolbar.SHOW_OVERFLOW_MENU,(()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)})),this.services.events.addEventListener(D.Toolbar.HIDE_OVERFLOW_MENU,(()=>{document.body.removeEventListener("click",t)}))}render(t=!0){const e=this.getComponentContainer({ariaLabel:"toolbar"}).attr("role","group");if(uc(this.getOptions(),"data","loading"))e.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=e.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:t,overflowMenuItemList:n}=this.getControlConfigs();n&&t.push(this.getOverflowButtonConfig());const i=e.selectAll("div.toolbar-control").data(t,(t=>t.id));i.exit().remove();const r=i.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),o=this;r.merge(i).classed("disabled",(t=>t.shouldBeDisabled())).attr("role","button").attr("aria-disabled",(t=>t.shouldBeDisabled())).attr("aria-label",(t=>t.title)).html((t=>`\n\t\t\t<button\n\t \t\t\ttype="button"\n\t\t\t\tclass="cds--overflow-menu__trigger cds--overflow-menu__trigger"\n\t\t\t\taria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${Um(t.id)}`)}" aria-label="${Um(t.title)}">\n\t\t\t\t<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">\n\t\t\t\t\t${(t=>Nm.sanitize(t,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}))(t.iconSVG.content)}\n\t\t\t\t</svg>\n\t\t\t</button>`)).each((function(t,e){wu(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",void 0!==t.iconSVG.width?t.iconSVG.width:"20px").style("height",void 0!==t.iconSVG.height?t.iconSVG.height:"20px"),wu(this).select("button").on("mouseover focus",(function(e){const n=wu(this);n.classed("hovered",!0),o.services.events.dispatchEvent(D.Toolbar.SHOW_TOOLTIP,{event:e,hoveredElement:n,content:t.title,noWrap:!0,placements:["top","bottom"]})})).on("mouseout blur",(function(){o.services.events.dispatchEvent(D.Toolbar.HIDE_TOOLTIP)})).on("click",(e=>{t.shouldBeDisabled()||o.triggerFunctionAndEvent(t,e,this)})).on("keydown",(n=>{n.key&&"Enter"===n.key||" "===n.key?(n.preventDefault(),o.triggerFunctionAndEvent(t,n,this)):n.key&&"ArrowLeft"===n.key?o.focusOnPreviousEnabledToolbarItem(e):n.key&&"ArrowRight"===n.key&&o.focusOnNextEnabledToolbarItem(e)}))})),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),e=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,(t=>uc(t,"id")));e.exit().remove();const n=e.enter().append("li").attr("id",(t=>this.services.domUtils.generateElementIDString(`control-${t.id}`))).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);n.append("button").attr("type","button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),n.merge(e).classed("cds--overflow-menu-options__option--disabled",(t=>t.shouldBeDisabled())).classed("cds--overflow-menu-options__option--disabled",(t=>t.shouldBeDisabled())).attr("aria-disabled",(t=>t.shouldBeDisabled())).selectAll("button").text((t=>t.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),wu(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(D.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(D.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const e=this.getToolbarButtonItems();let n=e.length;for(let i=t-1;i>=0;i--)if(!e[i].shouldBeDisabled()){n=i;break}if(n<e.length){const t=wu(`button#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)}`).node();"focus"in t&&t.focus()}}focusOnNextEnabledToolbarItem(t){const e=this.getToolbarButtonItems();let n=-1;for(let i=t+1;i<e.length;i++)if(!e[i].shouldBeDisabled()){n=i;break}if(n>-1){const t=wu(`button#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)}`).node();"focus"in t&&t.focus()}}focusOnPreviousEnabledMenuItem(t){const e=this.getOverflowMenuItems();let n=e.length;for(let i=t-1;i>=0;i--)if(!e[i].shouldBeDisabled()){n=i;break}if(n<e.length){const t=wu(`#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)} button`).node();"focus"in t&&t.focus()}}focusOnNextEnabledMenuItem(t){const e=this.getOverflowMenuItems();let n=-1;for(let i=t+1;i<e.length;i++)if(!e[i].shouldBeDisabled()){n=i;break}if(n>-1){const t=wu(`#${this.services.domUtils.generateElementIDString(`control-${e[n].id}`)} button`).node();"focus"in t&&t.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const e=this;this.getOverflowMenuItems().forEach(((n,i)=>{const r=wu(`#${this.services.domUtils.generateElementIDString(`control-${n.id}`)}`);null!==r&&(r.on("click",(()=>{e.triggerFunctionAndEvent(n,t,r.node()),e.updateOverflowMenu(!1)})),r.on("keydown",(o=>{o&&"Enter"===o.key?e.triggerFunctionAndEvent(n,t,r.node()):o&&"ArrowUp"===o.key?e.focusOnPreviousEnabledMenuItem(i):o&&"ArrowDown"===o.key?e.focusOnNextEnabledMenuItem(i):o&&"Escape"===o.key&&e.updateOverflowMenu(!1),o.preventDefault()})))})),e.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,e,n){"function"==typeof t.shouldBeDisabled&&t.shouldBeDisabled()||("function"==typeof t.clickFunction&&t.clickFunction(e),this.services.events.dispatchEvent(D.Toolbar.BUTTON_CLICK,{control:t,event:e,element:n}))}getControlConfigs(){const e=uc(this.getOptions(),"toolbar","numberOfIcons")-1,n=uc(this.getOptions(),"toolbar","controls"),i=[],r=[],o=[];return n.forEach((n=>{let s=null;if(n.type===K.CUSTOM)null===uc(n,"id")&&(n.id="toolbar-button-"+t.buttonID++),null===uc(n,"shouldBeDisabled")&&(n.shouldBeDisabled=()=>!1),s=n;else{const t=this.services.domUtils.isFullScreenMode();n.type===K.MAKE_FULLSCREEN&&t?n.type=K.EXIT_FULLSCREEN:n.type===K.EXIT_FULLSCREEN&&!t&&(n.type=K.MAKE_FULLSCREEN),s=this.getControlConfigByType(n.type)}s&&(s.text=n.text?n.text:n.type,-1!==s.id.indexOf("toolbar-export")?i.push(s):r.length<e?null===uc(s,"iconSVG","content")?o.push(s):r.push(s):o.push(s))})),o.push(...i),o.length?{buttonList:r,overflowMenuItemList:o}:{buttonList:r}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:e}=this.getControlConfigs();return e&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=uc(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>\n\t\t\t\t<circle cx="16" cy="16" r="2"></circle>\n\t\t\t\t<circle cx="16" cy="24" r="2"></circle>'},clickFunction:t=>this.toggleOverflowMenu(t)}}getControlConfigByType(t){const e=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),n=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:r,exportAsJPG:o,exportAsPNG:s,zoomIn:a,zoomOut:l,resetZoom:c,makeFullScreen:u,exitFullScreen:h,showAsTable:d}=uc(i,"locale","translations","toolbar");let f;switch(t){case K.ZOOM_IN:e&&(f={id:"toolbar-zoomIn",title:a,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case K.ZOOM_OUT:e&&(f={id:"toolbar-zoomOut",title:l,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case K.RESET_ZOOM:e&&(f={id:"toolbar-resetZoom",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case K.MAKE_FULLSCREEN:f={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:u,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case K.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 K.SHOW_AS_DATATABLE:f={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:d,shouldBeDisabled:()=>0===n.length,clickFunction:()=>this.services.events.dispatchEvent(D.Modal.SHOW)};break;case K.EXPORT_CSV:f={id:"toolbar-export-CSV",title:r,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case K.EXPORT_PNG:f={id:"toolbar-export-PNG",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case K.EXPORT_JPG:f={id:"toolbar-export-JPG",title:o,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 K.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"/>\n\t\t\t\t\t\t<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 K.ZOOM_OUT:return'<rect x="9" y="13" width="10" height="2"/>\n\t\t\t\t\t\t<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 K.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 K.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 K.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 K.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 K.EXPORT_CSV:case K.EXPORT_JPG:case K.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)}}};Bm.buttonID=0;let Hm=Bm;const Fm=class t extends Ug{constructor(e,n,i,r){super(e,n,r),this.type="layout",this.configs=r,this.children=i,this._instanceID=t.instanceID++,this.init()}init(){this.children.forEach((t=>{t.components.forEach((t=>{t.init()}))}))}getPreferedAndFixedSizeSum(){const t=this.parent;let e=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter((t=>{const e=uc(t,"growth");return e===G.PREFERRED||e===G.FIXED})).each((function(t){e+=t.size})),e}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter((t=>uc(t,"growth")===G.STRETCH)).size()}render(t=!0){const e=this.model.getOptions(),n=this.parent,{width:i,height:r}=Nf.getHTMLElementSize(n.node()),o=this.configs.direction===V.ROW||this.configs.direction===V.ROW_REVERSE,s=uc(this.model.getOptions(),"style","prefix"),a=n.classed(`${al}--${s}--layout-row`,this.configs.direction===V.ROW).classed(`${al}--${s}--layout-row-reverse`,this.configs.direction===V.ROW_REVERSE).classed(`${al}--${s}--layout-column`,this.configs.direction===V.COLUMN).classed(`${al}--${s}--layout-column-reverse`,this.configs.direction===V.COLUMN_REVERSE).classed(`${al}--${s}--layout-alignitems-center`,this.configs.alignItems===W.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,(t=>t.id));a.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",(t=>`layout-child layout-child-${this._instanceID} ${t.id}`)).each((function(n){n.components.forEach((i=>{const r=wu(this),o=uc(n,"renderType")===L.SVG;i.setParent(o?Nf.appendOrSelect(r,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):r),o&&!r.select("svg.layout-svg-wrapper").attr("aria-label")&&r.select("svg.layout-svg-wrapper").attr("aria-label",e?.accessibility?.svgAriaLabel||e?.title);const s=uc(n,"growth");(s===G.PREFERRED||s===G.FIXED)&&i.render(t)}))})),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each((function(t){const e=uc(t,"growth"),n=uc(t,"renderType")===L.SVG?Nf.getSVGElementSize(wu(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):Nf.getHTMLElementSize(this);if(e===G.PREFERRED){const e=o?n.width:n.height,s=o?i:r;t.size=e/s*100}})),a.exit().remove(),this.children.filter((t=>uc(t,"growth")===G.STRETCH)).forEach((t=>{t.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()}));const l=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,(t=>t.id));o?l.style("width",(t=>t.size/100*i+"px")).style("height","100%"):l.style("height",(t=>t.size/100*r+"px")).style("width","100%"),l.each((function(e){e.components.forEach((n=>{uc(e,"growth")===G.STRETCH&&n.render(t)}))}))}setModel(t){super.setModel(t),this.children.forEach((e=>{e.components.forEach((e=>e.setModel(t)))}))}setServices(t){super.setServices(t),this.children.forEach((e=>{e.components.forEach((e=>e.setServices(t)))}))}destroy(){this.children.forEach((t=>{t.components.forEach((t=>t.destroy()))}))}};Fm.instanceID=Math.floor(99999999999*Math.random());let zm=Fm;class $m extends Ug{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer({isPresentational:!0}).style("width",`${this.configs.size||_l}px`).style("height",`${this.configs.size||_l}px`).attr("opacity",0)}}class jm extends Ug{constructor(t,e,n){super(t,e,n),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const t=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${t}__modal-title`).attr("aria-describedby",`${t}__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",(t=>{t.stopPropagation()})),this.modal.select(".cds--modal-close").on("click",this.handleHideModal),typeof window<"u"&&window.addEventListener("keydown",this.handleEscapeKey)},this.handleEscapeKey=t=>{"Escape"===t.key&&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(D.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(D.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),e=this.model.getOptions(),{title:n,downloadAsCSV:i}=uc(e,"locale","translations","tabularRep"),r=uc(e,"style","prefix"),o=this.model.getTabularDataArray();return`\n\t\t<div class="cds--modal-container">\n\t\t\t<div class="cds--modal-header">\n\n\t\t\t\t<p class="cds--modal-header__label cds--type-delta" id="modal-title">${n}</p>\n\n\t\t\t\t<p class="cds--modal-header__heading cds--type-beta" id="${t}__modal-description">${Um(e.title)}</p>\n\n\t\t\t\t<button class="cds--modal-close" type="button" data-modal-close aria-label="close modal" data-modal-primary-focus>\n\t\t\t\t\t<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-label="Close" width="20" height="20" viewBox="0 0 32 32" role="img" class="cds--modal-close__icon">\n\t\t\t\t\t\t<path d="M24 9.4L22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16 24 9.4z"></path>\n\t\t\t\t\t</svg>\n\t\t\t\t</button>\n\t\t\t</div>\n\n\t\t\t<div class="cds--modal-content">\n\t\t\t\t<table class="cds--data-table cds--data-table--no-border">\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t${xn(o,0).map((t=>`<th scope="col">\n\t\t\t\t\t\t\t\t<div class="cds--table-header-label">${Um(t)}</div>\n\t\t\t\t\t\t\t</th>`)).join("")}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\n\t\t\t\t\t<tbody>${o.slice(1).map((t=>`\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t${t.map((t=>`<td>${Um(t)}</td>`)).join("")}\n\t\t\t\t\t\t\t</tr>`)).join("")}\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\n\t\t\t<div class="cds--modal-footer">\n\t\t\t <div class="${al}--${r}-modal-footer-spacer"></div>\n\t\t\t <button class="cds--btn cds--btn--primary" type="button" data-modal-primary-focus>${i}</button>\n\t\t\t</div>\n\t\t</div>`}render(t=!1){const e=this.model.getOptions();if(!this.isEventListenerAdded){const t=wu(this.services.domUtils.getHolder()),n=uc(e,"style","prefix");this.modal=Nf.appendOrSelect(t,`div.${al}--${n}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Vm extends Ug{constructor(){super(...arguments),this.type="title",this.renderType=L.HTML}render(t=!1){const e=this.getComponentContainer(),n=uc(this.getOptions(),"title"),i=e.selectAll("p.title").data([n]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html((t=>Um(t))),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const t=this;i.on("mouseover",(function(e){t.services.events.dispatchEvent(D.Tooltip.SHOW,{event:e,hoveredElement:i,content:i.text()})})).on("mousemove",(function(e){t.services.events.dispatchEvent(D.Tooltip.MOVE,{event:e})})).on("mouseout",(function(){t.services.events.dispatchEvent(D.Tooltip.HIDE)}))}i.exit().remove()}truncateTitle(t,e){if(e<=0)return;const n=t.text();if(t.node().getComputedTextLength()>e){t.append("tspan").text("...");const i=Nf.appendOrSelect(t,"tspan").node().getComputedTextLength(),r=t.text(),o=this.getSubstringIndex(t.node(),0,r.length-1,e-i);t.html(r.substring(0,o-1)).append("tspan").text("...");const s=this;t.on("mouseover",(function(e){s.services.events.dispatchEvent(D.Tooltip.SHOW,{event:e,hoveredElement:t,content:n})})).on("mousemove",(function(t){s.services.events.dispatchEvent(D.Tooltip.MOVE,{event:t})})).on("mouseout",(function(){s.services.events.dispatchEvent(D.Tooltip.HIDE)}))}}getMaxTitleWidth(){return Nf.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,e,n,i){const r=Math.floor((n+e)/2);return t.getSubStringLength(0,r)>i?this.getSubstringIndex(t,e,r,i):t.getSubStringLength(0,r)<i?t.getSubStringLength(0,r+1)>i?r:this.getSubstringIndex(t,r,n,i):r}}class Gm extends Ug{constructor(){super(...arguments),this.type="legend",this.renderType=L.HTML}render(t=!1){const e=this.getOptions(),n=uc(e,"legend"),i=uc(n,"alignment"),r=uc(e,"legend","orientation");let o=this.model.getDataGroups();const{DISABLED:s}=ml.items.status,a=o.some((t=>t.status===s)),l=uc(n,"order"),c=this.getComponentContainer().classed("center-aligned",i===z.CENTER).classed("right-aligned",i===z.RIGHT).classed(r||"horizontal",!0).classed("has-deactivated-items",a).attr("role",Wc.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");l&&(o=this.sortDataGroups(o,l));const u=c.selectAll("div.legend-item").data(o,(t=>t.name)),h=u.enter().append("div").attr("class","legend-item");h.merge(c.selectAll("div.legend-item")).classed("active",(function(t){return t.status===ml.items.status.ACTIVE}));const d=uc(this.getOptions(),"legend","clickable");c.classed("clickable",d&&o.length>1);const f=ml.checkbox.radius,p=h.append("div").classed("checkbox",!0),g=p.merge(u.select("div.checkbox")).attr("role",Wc.CHECKBOX).attr("tabindex",d?0:-1).attr("aria-labelledby",((t,e)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${e}-title`))).attr("aria-checked",(({status:t})=>t===ml.items.status.ACTIVE)).attr("width",2*f).attr("height",2*f).attr("class",(t=>this.model.getColorClassName({classNameTypes:[I.BACKGROUND],dataGroupName:t.name,originalClassName:"checkbox"}))).style("background",(t=>t.status===ml.items.status.ACTIVE?this.model.getFillColor(t.name)||this.model.getStrokeColor(t.name):null)).classed("active",(function(t){return t.status===ml.items.status.ACTIVE}));p.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(u.select("p"));const m=uc(e,"legend","additionalItems");if(m&&o.length){const t=this,e=c.selectAll("div.additional-item").data(m);e.exit().remove();const n=e.enter().append("div").merge(e).classed("legend-item",!0).classed("additional",!0).attr("role","img").attr("aria-labelledby",((t,e)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${g.size()+e}-title`)));n.selectAll("*").remove();let i,r=1;n.append("svg").classed("icon",!0).each((function(e){const n=wu(this);i&&i==e.type?r++:(i=e.type,r=1),t.addAdditionalItem(n,e,r)})),n.append("p").merge(n.select("p")),this.truncateLegendText()}u.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),d&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,e){if(t.sort(((t,n)=>e.indexOf(t.name)-e.indexOf(n.name))),e.length<t.length){const n=t.length-e.length;return t.slice(n).concat(t.slice(0,n))}return t}addAdditionalItem(t,e,n){const{width:i,height:r}=ml.area;if(e.type===J.RADIUS?t.style("width",`${r}px`).style("height",`${r}px`):t.style("width",`${i}px`).style("height",`${r}px`),e.type===J.RADIUS){const{iconData:n,fill:i,stroke:r}=ml.radius;t.attr("fill","none").selectAll("circle").data(n).enter().append("circle").classed("radius",!0).attr("role",Wc.IMG).attr("aria-label","radius").attr("cx",(t=>t.cx)).attr("cy",(t=>t.cy)).attr("r",(t=>t.r)).style("fill",e.fill?e.fill:i).style("stroke",e.stroke?e.stroke:r)}else if(e.type===J.LINE){const r=ml.line;t.select("line.line").empty()&&t.append("line").classed(`line-${n}`,!0).attr("role",Wc.IMG).attr("aria-label","line").attr("x1",0).attr("y1",r.yPosition).attr("x2",i).attr("y2",r.yPosition).style("stroke",e.stroke?e.stroke:r.stroke).style("stroke-width",r.strokeWidth)}else if(e.type===J.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${n}`,!0).attr("role",Wc.IMG).attr("aria-label","area").attr("width",i).attr("height",r).style("fill",n>3&&!e.fill?ml.area.fill:e.fill).style("stroke",e.stroke);else if(e.type===J.SIZE){const{iconData:n,fill:i,stroke:r}=ml.size;t.attr("fill","none").attr("role",Wc.IMG).attr("aria-label","size").selectAll("rect").data(n).enter().append("rect").classed("size",!0).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("y",(()=>0)).style("fill",e.fill?e.fill:i).style("stroke",e.stroke?e.stroke:r).style("stroke-width",1)}else if(e.type===J.QUARTILE){const{iconData:e}=ml.quartile;t.selectAll("rect").attr("role",Wc.IMG).attr("aria-label","quartile").data(e).enter().append("rect").attr("class",((t,e)=>"quartile-"+(0===e?"wrapper":"line"))).attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height))}else if(e.type===J.ZOOM){const{iconData:n,color:i}=uc(ml,"zoom"),r=t.attr("role",Wc.IMG).attr("aria-label","zoom").selectAll("g.icon").data(n).enter();r.append("g").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.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",(()=>e.color?e.color:i)),r.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",(()=>e.color?e.color:i))}}truncateLegendText(){const t=this.getComponentContainer(),e=uc(this.getOptions(),"legend","truncation"),n=uc(e,"type"),i=uc(e,"threshold"),r=uc(e,"numCharacter"),o=t.selectAll("div.legend-item p");o.attr("id",(function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")})),n!==U.NONE?o.html((function(t){const e=Um(t.name);return e.length>i&&e.length!==r?lc(e,n,r):e})):o.html((t=>Um(t.name)))}addEventListeners(){const t=this,e=this.getComponentContainer(),n=this.getOptions(),i=uc(n,"legend"),r=uc(i,"truncation");e.selectAll("div.legend-item").on("mouseover",(function(e){t.services.events.dispatchEvent(D.Legend.ITEM_HOVER,{hoveredElement:wu(this)});const n=wu(this);n.select("div.checkbox").classed("hovered",!0);const i=n.datum();i.name.length>r.threshold&&r.numCharacter<i.name.length&&r.type!==U.NONE&&t.services.events.dispatchEvent(D.Tooltip.SHOW,{event:e,hoveredElement:n,content:i.name})})).on("mousemove",(function(e){wu(this).datum().name.length>r.threshold&&r.type!==U.NONE&&t.services.events.dispatchEvent(D.Tooltip.MOVE,{event:e})})).on("click",(function(){t.services.events.dispatchEvent(D.Legend.ITEM_CLICK,{clickedElement:wu(this)});const e=wu(this).datum();t.model.toggleDataLabel(e.name)})).on("mouseout",(function(){const e=wu(this);e.select("div.checkbox").classed("hovered",!1),e.datum().name.length>r.threshold&&r.type!==U.NONE&&t.services.events.dispatchEvent(D.Tooltip.HIDE),t.services.events.dispatchEvent(D.Legend.ITEM_MOUSEOUT,{hoveredElement:e})})),e.selectAll("div.legend-item div.checkbox").on("keyup",(function(e){e.key&&"Tab"===e.key&&t.services.events.dispatchEvent(D.Legend.ITEM_HOVER,{hoveredElement:wu(this)})})),e.selectAll("div.legend-item div.checkbox").on("keydown",(function(e,n){e.key&&" "===e.key?(e.preventDefault(),t.model.toggleDataLabel(n.name)):e.key&&"Tab"===e.key&&t.services.events.dispatchEvent(D.Legend.ITEM_MOUSEOUT,{hoveredElement:wu(this)})})),e.selectAll("g.additional-item").on("mouseover",(function(e){const n=wu(this),i=n.datum();i.name.length>r.threshold&&t.services.events.dispatchEvent(D.Tooltip.SHOW,{event:e,hoveredElement:n,content:i.name})}))}}class Wm extends Ug{constructor(t,e,n){super(t,e,n),this.type="chart-clip",this.renderType=L.SVG,this.chartClipId="chart-clip-id-"+Math.floor(99999999999*Math.random()),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:e}=this.services;if(!e)throw new Error("Service cartesianScales was undefined");const n=e.getMainXScale(),i=e.getMainYScale(),[r,o]=n.range(),[s,a]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=Nf.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const l=Nf.appendOrSelect(this.chartClipPath,`rect.${this.type}`);o-r>0&&l.attr("x",r).attr("y",a).attr("width",o-r).attr("height",s-a),this.chartClipPath.merge(l).lower()}}class Ym extends Wm{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(99999999999*Math.random())}createClipPath(){const t=this.parent,{width:e,height:n}=Nf.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=Nf.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=Nf.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",e).attr("height",n),this.chartClipPath.merge(i).lower()}}var Zm,Xm;!function(t){t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom"}(Xm||(Xm={}));var qm=((Zm={})[Xm.LEFT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left-e.offsetWidth)}},Zm[Xm.RIGHT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left+n.width)}},Zm[Xm.TOP]=function(t,e,n){return{top:Math.round(t.top-e.offsetHeight),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},Zm[Xm.BOTTOM]=function(t,e,n){return{top:Math.round(t.top+n.height),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},Zm),Km=typeof window<"u"?window:{innerHeight:0,innerWidth:0},Qm=function(){function t(t){void 0===t&&(t={}),this.positions=qm,this.positions=Object.assign({},qm,t)}return t.prototype.getRelativeOffset=function(t){for(var e={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&"static"===getComputedStyle(t.offsetParent).position;)e.left+=t.offsetLeft,e.top+=t.offsetTop,t=t.offsetParent;return e},t.prototype.getAbsoluteOffset=function(t){for(var e=t,n={top:0,left:0};e.offsetParent;){var i=getComputedStyle(e.offsetParent);"static"===i.position&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(n.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(n.left+=parseInt(i.marginLeft,10))),e=e.offsetParent}var r=t.getBoundingClientRect(),o=document.body.getBoundingClientRect();return{top:r.top-o.top+n.top,left:r.left-o.left+n.left}},t.prototype.findRelative=function(t,e,n){var i=this.getRelativeOffset(t),r=t.getBoundingClientRect();return this.calculatePosition(i,r,e,n)},t.prototype.findAbsolute=function(t,e,n){var i=this.getAbsoluteOffset(t),r=t.getBoundingClientRect();return this.calculatePosition(i,r,e,n)},t.prototype.findPosition=function(t,e,n,i){void 0===i&&(i=this.getAbsoluteOffset.bind(this));var r=i(t),o=t.getBoundingClientRect();return this.calculatePosition(r,o,e,n)},t.prototype.findPositionAt=function(t,e,n){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},e,n)},t.prototype.getPlacementBox=function(t,e){var n=t.offsetHeight+e.top,i=t.offsetWidth+e.left;return{top:e.top,bottom:n,left:e.left,right:i}},t.prototype.addOffset=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Object.assign({},t,{top:t.top+e,left:t.left+n})},t.prototype.setElement=function(t,e){t.style.top=e.top+"px",t.style.left=e.left+"px"},t.prototype.findBestPlacement=function(t,e,n,i,r){var o=this;void 0===i&&(i=this.defaultContainerFunction.bind(this)),void 0===r&&(r=this.findPosition.bind(this));var s=n.map((function(n){var s=r(t,e,n),a=o.getPlacementBox(e,s),l=0,c=0,u=i();a.top<u.top?l=u.top-a.top:a.bottom>u.height&&(l=a.bottom-u.height),a.left<u.left?c=u.left-a.left:a.right>u.width&&(c=a.right-u.width),l&&!c?c=1:c&&!l&&(l=1);var h=e.offsetHeight*e.offsetWidth;return{placement:n,weight:(h-l*c)/h}}));return s.sort((function(t,e){return e.weight-t.weight})),s[0].placement},t.prototype.findBestPlacementAt=function(t,e,n,i){var r=this;return void 0===i&&(i=this.defaultContainerFunction.bind(this)),this.findBestPlacement(null,e,n,i,(function(e,n,i){return r.findPositionAt(t,n,i)}))},t.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Km.innerHeight,width:Km.innerWidth}},t.prototype.calculatePosition=function(t,e,n,i){return this.positions[i]?this.positions[i](t,n,e):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},t}();new Qm;class Jm extends Ug{constructor(t,e,n){super(t,e,n),this.type="tooltip",this.renderType=L.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new Qm,this.handleShowTooltip=t=>{const e=t.detail.data||t.detail.items,n=wu(t.detail.event.target).datum();let i;const r=this.formatItems(this.getItems(t));i=t.detail.content?`<div class="title-tooltip"><p>${Pm(t.detail.content)}</p></div>`:Pm(this.getTooltipHTML(r));const o=Nf.appendOrSelect(this.tooltip,"div.content-box");if(uc(this.getOptions(),"tooltip","customHTML"))if(t.detail.content){const e=`<div class="title-tooltip"><p>${Pm(t.detail.content)}</p></div>`;o.html(e)}else o.html(`<div class="title-tooltip"><p>${Pm(this.model.getOptions().tooltip.customHTML(e,i,n))}</p></div>`);else o.html(i);o.selectAll(".datapoint-tooltip").each((function(t,e){const n=r[e];r[e]&&r[e].color&&wu(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",n.color)})),this.positionTooltip(t),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=t.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(D.Tooltip.MOVE,(t=>{this.lastTriggeredEventType!==D.Toolbar.SHOW_TOOLTIP&&!1===this.tooltip.classed("hidden")&&this.positionTooltip(t)})),this.services.events.addEventListener(D.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(D.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(D.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(D.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(D.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(D.Tooltip.MOVE,null),this.services.events.removeEventListener(D.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(D.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(D.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(D.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(D.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const e=this.getOptions(),n=uc(e,"tooltip","truncation","type"),i=uc(e,"tooltip","truncation","threshold"),r=uc(e,"tooltip","truncation","numCharacter");return n!==U.NONE?t.map((t=>{const e=t.labelIcon?12:0;return t.value=this.valueFormatter(t.value,t.label),t.label&&t.label.length+e>i&&(t.label=lc(t.label,n,r)),t.value&&t.value.length>i&&(t.value=lc(t.value,n,r)),t})):t.map((t=>(t.value=this.valueFormatter(t.value,t.label),t)))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map((t=>`<li>\n\t\t\t\t\t<div class="datapoint-tooltip${t.bold?" bold":""}">\n\t\t\t\t\t\t${t.class||t.color?`<div class="tooltip-color ${t.class}"></div>`:""}\n\t\t\t\t\t\t<div class="label">\n\t\t\t\t\t\t<p>${t.label||""}</p>\n\t\t\t\t\t\t${t.labelIcon?`<span class="label-icon"/>${t.labelIcon}</span>`:""}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t${void 0===t.value||null===t.value?"":`<p class="value"/>${t.value}</p>`}\n\t\t\t\t\t</div>\n\t\t\t\t</li>`)).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,e){const n=this.getOptions(),i=uc(n,"tooltip","valueFormatter"),{code:r,number:o,date:s}=uc(n,"locale");if(i)return i(t,e);if(this.isDate(t))return s(t,r,{month:"short",day:"numeric",year:"numeric"});try{if("string"==typeof t&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t))return s(new Date(t),r,{month:"short",day:"numeric",year:"numeric"})}catch{}return o(t,r)}render(t=!1){const e=this.getOptions(),n=uc(e,"tooltip","enabled");if(n){const t=wu(this.services.domUtils.getHolder()),n=uc(e,"style","prefix");this.tooltip=Nf.appendOrSelect(t,`div.${al}--${n}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!n&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,e,n){const i=Object.assign({},t);return e==Xm.LEFT?i.left-=n:e==Xm.RIGHT?i.left+=n:e==Xm.TOP?i.top-=n:e==Xm.BOTTOM&&(i.top+=n),i}positionTooltip(t){const e=this.services.domUtils.getHolder(),n=e.offsetWidth,i=e.offsetHeight,r=this.tooltip.node(),o=this.getOptions(),s=uc(o,"zoomBar","top","enabled"),a=!!uc(t,"detail","noWrap"),l=Array.isArray(uc(t,"detail","placements")),c=l?uc(t,"detail","placements"):[Xm.RIGHT,Xm.LEFT,Xm.TOP,Xm.BOTTOM];let u,{horizontalOffset:h}=bl;const{defaultOffset:d}=bl;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",a),l){const e=uc(t,"detail","event","target"),o=this.services.domUtils.getElementOffset(e,!0);u=this.positionService.findBestPlacementAt(o,r,c,(()=>({top:0,left:0,width:n,height:i})));let s=this.positionService.findPosition(e,r,u,(()=>this.services.domUtils.getElementOffset(e)));return s=this.addOffsetByPlacement(s,u,d),void this.positionService.setElement(r,s)}let f=uc(t,"detail","mousePosition");if(f){const t=uc(o,"zoomBar","top","type"),e=wl.height[t];s&&(f[1]+=e+wl.spacerHeight)}else f=No(uc(t,"detail","event"),e);u=f[0]/n>.9?Xm.LEFT:f[0]/n<.1?Xm.RIGHT:this.positionService.findBestPlacementAt({left:f[0],top:f[1]},r,c,(()=>({top:void 0,left:void 0,width:n,height:i}))),u===Xm.LEFT&&(h*=-1);const p=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},r,u);this.positionService.setElement(r,p)}}const ty=class t extends Ug{constructor(){super(...arguments),this.type="grid-brush",this.renderType=L.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(e=!0){const n=this.parent,i=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const r=Nf.appendOrSelect(n,"svg.chart-grid-backdrop"),o=Nf.appendOrSelect(r,`g.${this.type}`),s=Nf.appendOrSelect(o,this.selectionSelector),{width:a,height:l}=Nf.getSVGElementSize(r,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),h=c.getMainXScale(),[d]=h.range();i.attr("transform",`translate(${d},0)`);const f=Nf.appendOrSelect(i,this.frontSelectionSelector);if(h&&u===H.TIME){let e=this.model.get("zoomDomain");void 0===e&&(e=this.services.zoom.getDefaultZoomBarDomain(),e&&this.model.set({zoomDomain:e},{animate:!1}));const n=e=>{const n=e[1]-e[0];let i="0,"+n.toString();const r=Math.floor(l/t.DASH_LENGTH),o=r*t.DASH_LENGTH;for(let e=0;e<r;e++)i+=","+t.DASH_LENGTH;i+=","+(l-o),r%2==1&&(i+=",0"),i+=","+n.toString(),i+=","+l.toString(),f.attr("stroke-dasharray",i)},i=t=>{const e=t.selection;null===e||e[0]===e[1]||(f.attr("x",parseFloat(s.attr("x"))+parseFloat(r.attr("x"))).attr("y",s.attr("y")).attr("width",s.attr("width")).attr("height",s.attr("height")).style("cursor","pointer").style("display",null),n(e))},c=(t,n)=>{const i=Ud().range([0,a]).domain(e);let r=[i.invert(t),i.invert(n)],o="manual";r[0].valueOf()===r[1].valueOf()?(r=this.services.zoom.getDefaultZoomBarDomain(),o="reset"):o="manual",(e[0].valueOf()!==r[0].valueOf()||e[1].valueOf()!==r[1].valueOf())&&this.services.zoom.handleDomainChange(r,{dispatchEvent:!0,type:o})};let u;const h=t=>{const e=t.selection;null!==e&&(c(e[0],e[1]),o.call(u.move,null),f.style("display","none"))};0!=l&&0!=a&&(u=tg().extent([[0,0],[a-1,l]]).on("start brush end",i).on("end.brushed",h),o.call(u));const d=this.services.zoom.getZoomRatio();r.on("click",(function(t){if(t.shiftKey){const t=this.services.domUtils.getHolder(),e=No(o.node(),t)[0];let n=e-a*d/2;n<0&&(n=0);let i=e+a*d/2;i>a&&(i=a),c(n,i)}}))}}};ty.DASH_LENGTH=4;let ey=ty;class ny extends Ug{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=L.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(99999999999*Math.random()),this.brush=tg(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(D.ZoomBar.UPDATE,this.render.bind(this));const t=uc(this.getOptions(),"zoomBar",N.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const e=this.getComponentContainer({ariaLabel:"zoom bar"}),n=this.services.zoom.isZoomBarLoading(N.TOP),i=this.services.zoom.isZoomBarLocked(N.TOP),r=uc(this.getOptions(),"zoomBar",N.TOP,"type"),o=uc(this.getOptions(),"axes",N.BOTTOM,"highlights"),s=wl.height[r],{width:a}=Nf.getSVGElementSize(this.parent,{useAttrs:!0});if(0===a)return;let l=0;const c=this.model.get("axesMargins");c&&c.left&&(l=c.left);const u=Nf.appendOrSelect(e,"svg.zoom-container").attr("width","100%").attr("height",s).attr("opacity",1).attr("role","presentation");if(Nf.appendOrSelect(e,"rect.zoom-spacer").attr("x",0).attr("y",s).attr("width","100%").attr("height",wl.spacerHeight).attr("opacity",1).attr("fill","none"),r===P.GRAPH_VIEW?Nf.appendOrSelect(u,"rect.zoom-bg").attr("x",l).attr("y",0).attr("width",a-l).attr("height","100%").classed("zoom-bg-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):r===P.SLIDER_VIEW&&Nf.appendOrSelect(u,"rect.zoom-slider-bg").attr("x",l).attr("y",s/2-1).attr("width",a-l).attr("height",2).classed("zoom-slider-bg-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),n)return void this.renderSkeleton(u,l,a);const{cartesianScales:h}=this.services,d=h.getMainXScale(),f=h.getMainYScale(),p=h.getMainXScaleType();if(d&&p===H.TIME){let t=this.services.zoom.getZoomBarData();if(function(t){if(null==t)return!0;if(we(t)&&(Pt(t)||"string"==typeof t||"function"==typeof t.splice||Re(t)||ze(t)||Ce(t)))return!t.length;var e=si(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Te(t))return!Ye(t).length;for(var n in t)if(Xi.call(t,n))return!1;return!0}(t)||1===t.length)return;this.xScale=d.copy(),this.yScale=f.copy();const n=this.services.zoom.getDefaultZoomBarDomain(t);t=this.compensateDataForDefaultDomain(t,n);const c=this.model.get("initialZoomDomain"),h=uc(this.getOptions(),"zoomBar",N.TOP,"initialZoomDomain");h&&h[0]&&h[1]&&(h[0]=new Date(h[0]),h[1]=new Date(h[1])),!h||c&&c[0].valueOf()===h[0].valueOf()&&c[1].valueOf()===h[1].valueOf()?null===h&&null!==c&&this.model.set({initialZoomDomain:null,zoomDomain:qi([],n)},{skipUpdate:!0}):this.model.set({initialZoomDomain:qi([],h),zoomDomain:h?qi([],h):n},{skipUpdate:!0}),this.xScale.range([l,a]).domain(n),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,s-6]).domain(sr(t,(t=>t.value)));const p=this.model.get("zoomDomain");if(r===P.GRAPH_VIEW&&(this.renderZoomBarArea(u,"path.zoom-graph-area-unselected",t,null),this.updateClipPath(e,this.clipId,0,0,0,0),this.renderZoomBarArea(u,"path.zoom-graph-area",t,this.clipId),this.renderZoomBarBaseline(u,l,a),o)){const t=o.highlightStartMapsTo,e=o.highlightEndMapsTo,n=o.color,i=o.labelMapsTo;o.data.forEach(((r,o)=>{Nf.appendOrSelect(u,`rect.highlight-${o}`).attr("height",s-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(r[t])).attr("width",this.xScale(r[e])-this.xScale(r[t])).style("fill",n&&n.scale[r[i]]?n.scale[r[i]]:null).style("fill-opacity",.1).style("stroke",n&&n.scale[r[i]]?n.scale[r[i]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")}))}this.addBrushEventListener(p,l,a);const g=Nf.appendOrSelect(e,this.brushSelector).call(this.brush);if(void 0!==p)if(p[0].valueOf()===p[1].valueOf())g.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const t=p.map((t=>this.xScale(t)));t[1]-t[0]<this.MIN_SELECTION_DIFF||(g.call(this.brush.move,t),this.updateBrushHandle(this.getComponentContainer(),t))}i&&(this.brush.filter((()=>!1)),g.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,e,n){const i=uc(this.getOptions(),"zoomBar",N.TOP,"type"),r=wl.height[i];this.brush.extent([[e,0],[n,r]]).on("start brush end",null).on("start brush end",(e=>{const n=e.selection;null===n?this.handleBrushedEvent(e,t,this.xScale,this.xScale.range()):n[0]===n[1]||this.handleBrushedEvent(e,t,this.xScale,n)}))}handleBrushedEvent(t,e,n,i){const r=[n.invert(i[0]),n.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),null!=t.sourceEvent&&("mousemove"===t.sourceEvent.type||"mouseup"===t.sourceEvent.type||"mousedown"===t.sourceEvent.type||"touchstart"===t.sourceEvent.type||"touchmove"===t.sourceEvent.type||"touchend"===t.sourceEvent.type)){let n,o="manual";if(e&&e[0]&&e[1]){const t=this.services.zoom.getDefaultZoomBarDomain();o=r[0].valueOf()===t[0].valueOf()&&r[1].valueOf()===t[1].valueOf()?"reset":"manual"}(void 0===e||e[0]!==r[0]||e[1]!==r[1])&&this.services.zoom.handleDomainChange(r,{dispatchEvent:!1,type:o}),"start"===t.type?n=D.ZoomBar.SELECTION_START:"brush"===t.type?n=D.ZoomBar.SELECTION_IN_PROGRESS:"end"===t.type&&(n=D.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(D.ZoomDomain.CHANGE,{newDomain:r,type:o})),this.services.events.dispatchEvent(n,{selection:i,newDomain:r})}}updateBrushHandle(t,e){const n=this,i=wl.handleWidth,r=uc(this.getOptions(),"zoomBar",N.TOP,"type"),o=wl.height[r],s=-i/2,a=wl.handleBarWidth,l=r===P.GRAPH_VIEW?wl.handleBarHeight:6,c=-a/2,u=(o-l)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",(function(t){return"w"===t.type?Math.max(e[0]+s,n.maxSelectionRange[0]):"e"===t.type?Math.min(e[1]+s,n.maxSelectionRange[1]-i):void 0})).attr("y",0).attr("width",i).attr("height",o).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(t){return"handle-bar handle-bar--"+t.type})),h.attr("x",(function(t){return"w"===t.type?Math.max(e[0]+c,n.maxSelectionRange[0]-s+c):"e"===t.type?Math.min(e[1]+c,n.maxSelectionRange[1]+s+c):void 0})).attr("y",u).attr("width",a).attr("height",l).attr("cursor","ew-resize"),r===P.SLIDER_VIEW&&this.updateSliderSelectedArea(e),this.updateClipPath(t,this.clipId,e[0],0,e[1]-e[0],o)}updateSliderSelectedArea(t){const e=uc(this.getOptions(),"zoomBar",N.TOP,"type"),n=wl.height[e],i=this.getComponentContainer().select("svg.zoom-container");Nf.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",n/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,e,n,i){const{cartesianScales:r}=this.services,o=r.getMainXAxisPosition(),s=r.getMainYAxisPosition(),a=r.getMainXScaleType(),l=r.getMainYScaleType(),c=(t,e,n)=>i=>r.getValueFromScale(t,e,n,i),u=c(this.xScale,a,o),h=c(this.yScale,l,s),d=uc(this.getOptions(),"zoomBar",N.TOP,"type"),f=wl.height[d],p=Ng().x((t=>u(t))).y0(f).y1((t=>f-h(t))),g=Nf.appendOrSelect(t,e).datum(n).attr("d",p);i&&g.attr("clip-path",`url(#${i})`)}updateClipPath(t,e,n,i,r,o){const s=Nf.appendOrSelect(t,"clipPath").attr("id",e);Nf.appendOrSelect(s,"rect").attr("x",n).attr("y",i).attr("width",r).attr("height",o)}compensateDataForDefaultDomain(t,e){if(!t||t.length<2)return;const n=Ti(t),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier();if(Number(e[0])<Number(n[0][i])){const t={};t[i]=e[0],t[r]=0,n.unshift(t)}if(Number(e[1])>Number(n[n.length-1][i])){const t={};t[i]=e[1],t[r]=0,n.push(t)}return n}renderZoomBarBaseline(t,e,n,i=!1){const r=uc(this.model.getOptions(),"zoomBar",N.TOP,"type"),o=wl.height[r],s=Ig()([[e,o],[n,o]]);Nf.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",s).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,e,n){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),Nf.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),uc(this.getOptions(),"zoomBar",N.TOP,"type")===P.GRAPH_VIEW&&this.renderZoomBarBaseline(t,e,n,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(D.ZoomBar.UPDATE,this.render.bind(this))}}class iy extends Ug{constructor(t,e){super(t,e),this.type="threshold",this.renderType=L.SVG,this.positionService=new Qm}render(t=!1){const e=uc(this.getOptions(),"axes"),n=[];Object.keys(e).forEach((t=>{if(Object.values(N).includes(t)){const i=e[t];i.thresholds&&i.thresholds.length>0&&n.push({axisPosition:t,thresholds:i.thresholds,correspondingDatasets:i?.correspondingDatasets,mapsTo:i?.mapsTo})}}));const i=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(n,(t=>t.axisPosition));i.exit().attr("opacity",0).remove();const r=i.enter().append("g").merge(i);r.attr("class",(t=>`axis-thresholds ${t.axisPosition}`));const o=r.selectAll("g.threshold-group").data((t=>t.thresholds.map((e=>(e.axisPosition=t.axisPosition,e.datum=this.constructDatumObj(t,e),e)))));o.exit().attr("opacity",0).remove();const s=o.enter().append("g");s.append("line").attr("class","threshold-line"),s.append("rect").attr("class","threshold-hoverable-area"),s.merge(o).attr("class","threshold-group");const a=this;r.each((function({axisPosition:e}){const n=a.services.cartesianScales.getScaleByPosition(e),i=a.services.cartesianScales.getScaleTypeByPosition(e);let r=null,o=null;e===N.LEFT||e===N.RIGHT?(o=n,r=a.services.cartesianScales.getMainXScale()):(r=n,o=a.services.cartesianScales.getMainYScale());const s=i===H.LABELS,[l,c]=r.range(),[u,h]=o.range(),{cartesianScales:d}=a.services,f=d.getOrientation(),[p,g]=dc((t=>d.getDomainValue(t)),(t=>d.getRangeValue(t)),f),m=wu(this);e===N.TOP||e===N.BOTTOM?(m.selectAll("line.threshold-line").transition().call((e=>a.services.transitions.setupTransition({transition:e,name:"threshold-line-update",animate:t}))).attr("y1",h).attr("y2",u).attr("x1",(({datum:t})=>p(t)+(s?n.step()/2:0))).attr("x2",(({datum:t})=>p(t)+(s?n.step()/2:0))).style("stroke",(({fillColor:t})=>t)),m.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",(({datum:t})=>-p(t))).attr("width",Math.abs(u-h)).classed("rotate",!0)):(m.selectAll("line.threshold-line").transition().call((e=>a.services.transitions.setupTransition({transition:e,name:"threshold-line-update",animate:t}))).attr("x1",l).attr("x2",c).attr("y1",(({datum:t})=>g(t)+(s?n.step()/2:0))).attr("y2",(({datum:t})=>g(t)+(s?n.step()/2:0))).style("stroke",(({fillColor:t})=>t)),m.selectAll("rect.threshold-hoverable-area").attr("x",l).attr("y",(({datum:t})=>g(t))).attr("width",Math.abs(c-l)).classed("rotate",!1))})),this.services.events.addEventListener(D.Threshold.SHOW,(t=>{this.setThresholdLabelPosition(t.detail),this.label.classed("hidden",!1)})),this.services.events.addEventListener(D.Threshold.HIDE,(()=>{this.label.classed("hidden",!0)})),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:e,axisPosition:n}=t,i=this.getOptions(),r=this.services.cartesianScales.getScaleTypeByPosition(n),{code:o,number:s}=uc(i,"locale");if(r===H.TIME){const t=[N.LEFT,N.RIGHT].includes(n),r=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),s=t?o:r,a=uc(i,"timeScale"),l=$c(s.ticks(),uc(a,"timeInterval"));return Fc(e,0,s.ticks(),l,a,i.locale)}return s(e,o)}appendThresholdLabel(){const t=wu(this.services.domUtils.getHolder()),e=uc(this.getOptions(),"style","prefix");this.label=Nf.appendOrSelect(t,`div.${al}--${e}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:e}){const n=this.services.domUtils.getHolder(),i=No(t,n),r=e.valueFormatter?e.valueFormatter(e.value):this.getFormattedValue(e);this.label.html(Um(`${e.label||"Threshold"}: ${r}`)).style("background-color",e.fillColor);const o=this.label.node(),s=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},o,[Xm.RIGHT,Xm.LEFT,Xm.TOP,Xm.BOTTOM],(()=>({top:void 0,left:void 0,width:n.offsetWidth,height:n.offsetHeight}))),a=this.positionService.findPositionAt({left:i[0],top:i[1]},o,s);this.positionService.setElement(o,a)}constructDatumObj(t,e){const n={};return t.correspondingDatasets&&(n.group=uc(t,"correspondingDatasets",0)),n[t.mapsTo]=e.value,n}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",(function(e){wu(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(D.Threshold.SHOW,{event:e,hoveredElement:wu(this),datum:wu(this).datum()})})).on("mouseout",(function(e){wu(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(D.Threshold.HIDE,{event:e,hoveredElement:wu(this),datum:wu(this).datum()})}))}}class ry extends Ug{constructor(t,e){super(t,e),this.type="highlight",this.renderType=L.SVG,this.positionService=new Qm,this.highlightStrokeWidth=1}render(t=!1){const e=uc(this.getOptions(),"axes"),n=[];Object.keys(e).forEach((t=>{if(Object.values(N).includes(t)){const i=e[t];i.highlights&&i.highlights.data.length>0&&n.push({axisPosition:t,highlightStartMapsTo:i.highlights.highlightStartMapsTo,highlightEndMapsTo:i.highlights.highlightEndMapsTo,labelMapsTo:i.highlights.labelMapsTo,highlight:i.highlights.data,color:i.highlights.color})}}));const i=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(n,(t=>t.axisPosition));i.exit().attr("opacity",0).remove();const r=i.enter().append("g").merge(i);r.attr("class",(t=>`axis-highlight ${t.axisPosition}`));const o=r.selectAll("g.highlight-group").data((t=>t.highlight.map((e=>(e.axisPosition=t.axisPosition,e.highlightStartMapsTo=t.highlightStartMapsTo,e.labelMapsTo=t.labelMapsTo,e.color=t.color,e.highlightEndMapsTo=t.highlightEndMapsTo,e)))));o.exit().attr("opacity",0).remove();const s=o.enter().append("g");s.append("rect").attr("class","highlight-bar"),s.append("line").attr("class","highlight-line"),s.merge(o).attr("class","highlight-group");const a=this;r.each((function({axisPosition:e}){const n=a.services.cartesianScales.getMainXScale(),i=a.services.cartesianScales.getMainYScale(),[r,o]=n.range(),[s,l]=i.range(),{cartesianScales:c}=a.services,u=c.getOrientation(),[h,d]=dc((t=>c.getDomainValue(t)),(t=>c.getRangeValue(t)),u),f=wu(this);e===N.TOP||e===N.BOTTOM?f.selectAll("rect.highlight-bar").transition().call((e=>a.services.transitions.setupTransition({transition:e,name:"highlight-bar-update",animate:t}))).attr("y",Math.max(l+a.highlightStrokeWidth,0)).attr("height",Math.max(s-2*a.highlightStrokeWidth,0)).attr("x",(({highlightStartMapsTo:t,...e})=>h(e[t]))).attr("width",(({highlightStartMapsTo:t,highlightEndMapsTo:e,...n})=>Math.max(h(n[e])-h(n[t]),0))).style("stroke",(({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null)).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",(({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null)):f.selectAll("rect.highlight-bar").transition().call((e=>a.services.transitions.setupTransition({transition:e,name:"highlight-bar-update",animate:t}))).attr("x",r).attr("width",Math.max(o-r,0)).attr("y",(({highlightEndMapsTo:t,...e})=>d(e[t]))).attr("height",(({highlightStartMapsTo:t,highlightEndMapsTo:e,...n})=>Math.max(d(n[t])-d(n[e]),0))).style("stroke",(({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null)).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",(({color:t,labelMapsTo:e,...n})=>t&&t.scale[n[e]]?t.scale[n[e]]:null))}))}}class oy extends Jm{getItems(t){if(t.detail.items)return t.detail.items;const{data:e}=t.detail;if(!e||!e.length||!e[0])return[];const n=this.getOptions(),{cartesianScales:i}=this.services,r=i.getDomainIdentifier(),o=i.isDualAxes(),{groupMapsTo:s}=n.data,a=i.getDomainLabel();let l=i.getRangeLabel();const c=e[0][r];let u;if(1===e.length){const r=e[0],h=i.getRangeIdentifier(r);if(o){const t=i.getRangeAxisPosition({datum:r,groups:[r[s]]});l=i.getScaleLabel(t)}const d=r[h];u=[{label:a,value:c},...Array.isArray(d)&&2===d.length?[{label:"Start",value:d[0]},{label:"End",value:d[1]}]:[{label:l,value:r[h]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach((t=>u.push({label:t.label,value:t.value}))),u.push({label:xn(n,"locale.translations.group")||xn(n,"tooltip.groupLabel"),value:r[s],color:this.model.getFillColor(r[s]),class:this.model.getColorClassName({classNameTypes:[I.TOOLTIP],dataGroupName:r[s]})})}else if(e.length>1&&(u=[{label:a,value:c}],u=u.concat(e.map((t=>{const e=t[i.getRangeIdentifier(t)];return{label:t[s],value:Array.isArray(e)&&2===e.length?`${e[0]} - ${e[1]}`:e,color:this.model.getFillColor(t[s]),class:this.model.getColorClassName({classNameTypes:[I.TOOLTIP],dataGroupName:t[s]})}})).sort(((t,e)=>e.value-t.value))),!o&&!0===uc(n,"tooltip","showTotal"))){const t=i.getRangeIdentifier(),r=uc(n,"tooltip","customTotalCalculation");let o;o=r?r(e):e.reduce(((e,n)=>e+n[t]),0),u.push({label:xn(n,"tooltip.totalLabel")||xn(n,"locale.translations.total")||"Total",value:o,bold:!0})}return u}}var sy=Math.PI,ay=2*sy,ly=1e-6,cy=ay-ly;function uy(){this._x0=this._y0=this._x1=this._y1=null,this._=""}uy.prototype=function(){return new uy}.prototype={constructor:uy,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,s=this._y1,a=n-t,l=i-e,c=o-t,u=s-e,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>ly)if(Math.abs(u*a-l*c)>ly&&r){var d=n-o,f=i-s,p=a*a+l*l,g=d*d+f*f,m=Math.sqrt(p),y=Math.sqrt(h),v=r*Math.tan((sy-Math.acos((p+h-g)/(2*m*y)))/2),_=v/y,b=v/m;Math.abs(_-1)>ly&&(this._+="L"+(t+_*c)+","+(e+_*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=t+b*a)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,i,r,o){t=+t,e=+e,o=!!o;var s=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+s,c=e+a,u=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>ly||Math.abs(this._y1-c)>ly)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%ay+ay),h>cy?this._+="A"+n+","+n+",0,1,"+u+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>ly&&(this._+="A"+n+","+n+",0,"+ +(h>=sy)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}},Array.prototype.slice;class hy extends Ug{constructor(){super(...arguments),this.type="grid",this.renderType=L.SVG}render(t=!0){const e=uc(this.getOptions(),"grid","x","enabled"),n=uc(this.getOptions(),"grid","y","enabled");this.drawBackdrop(e,n),(e||n)&&(e&&(Nf.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),n&&(Nf.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const e=this.parent,n=this.backdrop.attr("height"),i=Sp(this.services.cartesianScales.getMainXScale()).tickSizeInner(-n).tickSizeOuter(0);if(uc(this.getOptions(),"grid","x","alignWithAxisTicks")){const t=this.services.cartesianScales.getDomainAxisPosition(),e=uc(this.getOptions(),"axes",t,"ticks","values");e&&i.tickValues(e)}else{const t=uc(this.getOptions(),"grid","x","numberOfTicks");i.ticks(t)}const r=e.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${n})`);t?r.transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"grid-update",animate:t}))).call(i):r.call(i),this.cleanGrid(r)}drawYGrid(t){const e=this.parent,n=this.backdrop.attr("width"),i=Op(this.services.cartesianScales.getMainYScale()).tickSizeInner(-n).tickSizeOuter(0);if(uc(this.getOptions(),"grid","y","alignWithAxisTicks")){const t=this.services.cartesianScales.getRangeAxisPosition(),e=uc(this.getOptions(),"axes",t,"ticks","values");e&&i.tickValues(e)}else{const t=uc(this.getOptions(),"grid","y","numberOfTicks");i.ticks(t)}const r=e.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?r.transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"grid-update",animate:t}))).call(i):r.call(i),this.cleanGrid(r)}getGridlineThreshold(t){const e=this.parent,n=e.selectAll(".x.grid .tick").nodes().sort(((t,e)=>Number(ac(t).tx)-Number(ac(e).tx)));let i=-1;if(!n.length)return;n.forEach((e=>{t[0]>=+ac(e).tx&&i++}));const r=i+1<n.length?i+1:n.length,o=n[i],s=n[r];let a;if(o)if(s)a=+ac(s).tx-+ac(o).tx;else{const t=e.select("rect.chart-grid-backdrop").node();a=Nf.getSVGElementSize(t).width-+ac(o).tx}else a=+ac(s).tx;const{threshold:l}=this.getOptions().tooltip.gridline;return a*l}getActiveGridline(t){const e=uc(this.getOptions,"tooltip","gridline","threshold")||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter((function(){const n=ac(this),i=Number(n.tx)-e,r=Number(n.tx)+e;return i<=t[0]&&t[0]<=r}))}drawBackdrop(t,e){const n=this.parent,i=this.services.cartesianScales.getMainXScale(),r=this.services.cartesianScales.getMainYScale(),[o,s]=i.range(),[a,l]=r.range();this.backdrop=Nf.appendOrSelect(n,"svg.chart-grid-backdrop").attr("role","presentation");const c=Nf.appendOrSelect(this.backdrop,t||e?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(c).attr("x",o).attr("y",l).attr("width",Math.abs(s-o)).attr("height",Math.abs(a-l)).lower(),c.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class dy extends Ug{constructor(){super(...arguments),this.type="line",this.renderType=L.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:e}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call((t=>this.services.transitions.setupTransition({transition:t,name:"legend-hover-line"}))).attr("opacity",(t=>t.name!==e.datum().name?yl:vl))},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",vl)}}init(){const{events:t}=this.services;t.addEventListener(D.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(D.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const e=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,n=void 0!==this.model.get("zoomDomain"),i=e&&n?this.getComponentContainer({ariaLabel:"lines",withinChartClip:!1}):this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:o}=this.services,[s,a]=dc((t=>r.getDomainValue(t)),(t=>r.getRangeValue(t)),r.getOrientation()),l=this.getOptions(),c=Ig().x(s).y(a).curve(o.getD3Curve()).defined((t=>null!=t[r.getRangeIdentifier(t)]));let u=[];if(this.configs.stacked){const t=Object.keys(l.axes).some((t=>l.axes[t].percentage)),{groupMapsTo:e}=l.data;u=this.model.getStackedData({groups:this.configs.groups,percentage:t}).map((t=>{const n=this.services.cartesianScales.getDomainIdentifier(t),i=this.services.cartesianScales.getRangeIdentifier(t);return{name:uc(t,0,e),data:t.map((t=>({[n]:t.data.sharedStackKey,[e]:t[e],[i]:t[1]}))),hidden:!fp(t,(t=>t[0]!==t[1]))}}))}else u=this.model.getGroupedData(this.configs.groups);const h=i.selectAll("path.line").data(u,(t=>t.name));h.exit().attr("opacity",0).remove();const d=h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(u,(t=>t.name)).attr("class",(t=>this.model.getColorClassName({classNameTypes:[I.STROKE],dataGroupName:t.name,originalClassName:"line"}))).style("stroke",(t=>this.model.getStrokeColor(t.name,null,t.data))).attr("role",Wc.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",(t=>{const{data:e}=t;return e.map((t=>t[this.services.cartesianScales.getRangeIdentifier(t)])).join(",")}));if(e&&n){const t=r.getMainXScale(),e=r.getMainYScale();if(t&&e){const[n,r]=t.range(),[o,s]=e.range();i.style("overflow","hidden").style("clip",`rect(${s}px, ${r}px, ${o}px, ${n}px)`)}}d.transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"line-update-enter",animate:t}))).attr("opacity",(t=>t.hidden?0:1)).attr("d",(t=>{const{data:e}=t;return c(e)}))}destroy(){const t=this.services.events;t.removeEventListener(D.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(D.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class fy extends Ug{constructor(){super(...arguments),this.type="ruler",this.renderType=L.SVG,this.isXGridEnabled=uc(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=uc(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const e=uc(this.getOptions(),"ruler","enabled"),n=uc(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),i=e||n;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,[e,n]){const i=this.parent,r=this.services.cartesianScales.getOrientation(),o=this.model.getDisplayData(),s=this.services.cartesianScales.getRangeScale(),[a,l]=s.range(),c=r===B.HORIZONTAL?n:e,u=Nf.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=Nf.appendOrSelect(u,"line.ruler-line"),d=i.selectAll("[role=graphics-symbol]"),f=o.map((t=>({domainValue:this.services.cartesianScales.getDomainValue(t),originalData:t}))).filter((t=>function(t,e){return t>e-5&&t<e+5}(t.domainValue,c)));if(this.pointsWithinLine&&f.length===this.pointsWithinLine.length&&f.map((t=>t.domainValue)).join()===this.pointsWithinLine.map((t=>t.domainValue)).join())return this.pointsWithinLine=f,this.services.events.dispatchEvent(D.Tooltip.MOVE,{mousePosition:[e,n]});this.pointsWithinLine=f;const p=this.pointsWithinLine.reduce(((t,e)=>{if(0===t.length)return t.push(e),t;const n=t[0].domainValue,i=Math.abs(c-e.domainValue),r=Math.abs(c-n);return i>r||(i<r?t=[e]:t.push(e)),t}),[]);if(p.length>0){const i=p.map((t=>t.originalData)).filter((t=>null!=t[this.services.cartesianScales.getRangeIdentifier(t)])),o=p.map((t=>t.domainValue)),s=d.filter((t=>{const e=this.services.cartesianScales.getDomainValue(t);return o.includes(e)}));this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!function(t,e){return Bi(t,e)}(this.elementsToHighlight,s)&&this.hideRuler(),s.dispatch("mouseover"),this.elementsToHighlight=s,this.services.events.dispatchEvent(D.Tooltip.SHOW,{event:t,mousePosition:[e,n],hoveredElement:h,data:this.formatTooltipData(i)}),u.attr("opacity",1);const c=p[0];"horizontal"===r?h.attr("x1",l).attr("x2",a).attr("y1",c.domainValue).attr("y2",c.domainValue):h.attr("y1",l).attr("y2",a).attr("x1",c.domainValue).attr("x2",c.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,e=Nf.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(D.Tooltip.HIDE),e.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,e=this.services.domUtils.getHolder(),n=this.model.getDisplayData();let i=function(e){const n=No(e,t.parent.node());t.showRuler(e,n)};n.length>100&&(i=function(t,e,n){let i=null;return function(...r){const o=this;o.mousePosition=No(r[0],n),clearTimeout(i),i=setTimeout((function(){t.apply(o,r)}),e)}}((function(e){const{mousePosition:n}=this;t.showRuler(e,n)}),n.length%50*12.5,e)),this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=Nf.appendOrSelect(t,"svg.chart-grid-backdrop")}}let py=class extends Ug{constructor(){super(...arguments),this.type="scatter",this.renderType=L.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:e}=t.detail,{groupMapsTo:n}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call((t=>this.services.transitions?.setupTransition({transition:t,name:"legend-hover-scatter"}))).attr("opacity",(t=>t[n]!==e.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(D.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(D.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:e}=this.configs;e&&(t.addEventListener(D.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(D.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:e}=this.services;if(!e)throw new Error("Services cartesianScales are undefined.");const n=e.getDomainIdentifier(t),i=this.model.get("zoomDomain");return void 0!==i?t.filter((t=>t[n].getTime()>=i[0].getTime()&&t[n].getTime()<=i[1].getTime())):t}getScatterData(){const t=this.getOptions(),{stacked:e}=this.configs;let n;if(e){const e=Object.keys(t.axes).some((e=>t.axes[e].percentage));n=this.model.getStackedData({groups:this.configs.groups,percentage:e})}else{const{cartesianScales:t}=this.services;if(!t)throw new Error("Services cartesianScales are undefined.");n=this.model.getDisplayData(this.configs.groups).filter((e=>{const n=t.getRangeIdentifier(e);return void 0!==e[n]&&null!==e[n]}))}return this.filterBasedOnZoomDomain(n)}render(t){if(!uc(this.getOptions(),"points","enabled")&&!uc(this.getOptions(),"bubble","enabled"))return;const e=this.services.zoom?.isZoomBarEnabled()||!1,n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:e}),i=this.getOptions(),{groupMapsTo:r}=i.data,{cartesianScales:o}=this.services;if(!o)throw new Error("Services cartesianScales are undefined.");const s=o.getDomainIdentifier(),a=n.selectAll("circle.dot").data(this.getScatterData(),(t=>`${t[r]}-${t[s]}`));a.exit().attr("opacity",0).remove();const l=a.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(a);this.styleCircles(l,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:e}=this.configs;if(!e)return!1;const{cartesianScales:n}=this.services;if(!n)throw new Error("Cartesian scales service is undefined");const i=n.getOrientation(),[r,o]=dc(n.getHighestDomainThreshold(),n.getHighestRangeThreshold(),i),[s,a]=dc((t=>n.getDomainValue(t)),(t=>n.getRangeValue(t)),i),l=s(t),c=a(t);return o&&r?c<=o.scaleValue&&l>=r.scaleValue:o?c<=o.scaleValue:!!r&&l>=r.scaleValue}styleCircles(t,e){const n=this.getOptions(),{filled:i,fillOpacity:r}=n.points,{cartesianScales:o}=this.services;if(!o)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:s}=n.data,[a,l]=dc((t=>o.getDomainValue(t)),(t=>o.getRangeValue(t)),o.getOrientation()),{fadeInOnChartHolderMouseover:c}=this.configs;t.raise().classed("dot",!0).attr("class",(t=>{const e=o.getDomainIdentifier(t),n=this.model.getIsFilled(t[s],t[e],t,i)?[I.FILL,I.STROKE]:[I.STROKE];return this.model.getColorClassName({classNameTypes:n,dataGroupName:t[s],originalClassName:"dot"})||""})).classed("threshold-anomaly",(t=>this.isDatapointThresholdAnomaly(t))).classed("filled",(t=>{const e=o.getDomainIdentifier(t);return this.model.getIsFilled(t[s],t[e],t,i)})).classed("unfilled",(t=>{const e=o.getDomainIdentifier(t);return!this.model.getIsFilled(t[s],t[e],t,i)})).transition().call((t=>this.services.transitions?.setupTransition({transition:t,name:"scatter-update-enter",animate:e}))).attr("cx",a).attr("cy",l).attr("r",n.points.radius).style("fill",(t=>{const e=o.getDomainIdentifier(t);if(this.model.getIsFilled(t[s],t[e],t,i))return this.model.getFillColor(t[s],t[e],t)})).style("stroke",(t=>{const e=o.getDomainIdentifier(t);return this.model.getStrokeColor(t[s],t[e],t)})).attr("fill-opacity",i?r:1).attr("opacity",c?0:1).attr("role",Wc.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",(t=>t[o.getRangeIdentifier(t)])),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:e}=t.getOptions().data,n=uc(this.getOptions(),"tooltip","alwaysShowRulerTooltip");if(!this.parent)throw new Error("Parent not defined");const i=this.parent.selectAll("circle");n?i.style("pointer-events","none"):i.style("pointer-events",null),i.on("mouseover",(function(i,r){const o=wu(this);o.classed("hovered",!0).attr("class",(n=>t.model.getColorClassName({classNameTypes:[I.FILL],dataGroupName:n[e],originalClassName:o.attr("class")}))).style("fill",(n=>{const i=t.services.cartesianScales?.getDomainIdentifier(n);return t.model.getFillColor(n[e],n[i],n)})).classed("unfilled",!1),n||t.services.events?.dispatchEvent(D.Tooltip.SHOW,{event:i,hoveredElement:o,data:[r],additionalItems:t.getTooltipAdditionalItems(r)}),t.services.events?.dispatchEvent(D.Scatter.SCATTER_MOUSEOVER,{event:i,element:o,datum:r})})).on("mousemove",(function(e,n){const i=wu(this);t.services.events?.dispatchEvent(D.Scatter.SCATTER_MOUSEMOVE,{event:e,element:i,datum:n}),t.services.events?.dispatchEvent(D.Tooltip.MOVE,{event:e})})).on("click",(function(e,n){t.services.events?.dispatchEvent(D.Scatter.SCATTER_CLICK,{event:e,element:wu(this),datum:n})})).on("mouseout",(function(n,i){const r=wu(this);if(r.classed("hovered",!1),!t.configs.filled){const{filled:n}=t.getOptions().points,o=t.services.cartesianScales?.getDomainIdentifier(i),s=t.model.getIsFilled(i[e],i[o],i,n);r.classed("unfilled",!s).style("fill",(i=>s||n?t.model.getFillColor(i[e],i[o],i):null))}t.services.events?.dispatchEvent(D.Scatter.SCATTER_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events?.dispatchEvent(D.Tooltip.HIDE,{hoveredElement:r})}))}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(D.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(D.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(D.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(D.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}};class gy extends Ug{constructor(t,e,n){super(t,e,n),this.type="axes",this.renderType=L.SVG,this.truncation={[N.LEFT]:!1,[N.RIGHT]:!1,[N.TOP]:!1,[N.BOTTOM]:!1},n&&(this.configs=n),this.margins=this.configs.margins}render(t=!0){const{position:e}=this.configs,n=this.getOptions(),i=uc(n,"axes",e,"visible"),r=this.getComponentContainer({ariaLabel:"axes"}),{width:o,height:s}=Nf.getSVGElementSize(r,{useAttrs:!0}),a=Nf.appendOrSelect(r,`g.axis.${e}`);let l,c;if(e===N.BOTTOM||e===N.TOP?(l=this.configs.axes[N.LEFT]?this.margins.left:0,c=this.configs.axes[N.RIGHT]?o-this.margins.right:o):(l=s-this.margins.bottom,c=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const u=this.services.cartesianScales.getScaleByPosition(e);let h;switch(this.scaleType===H.LABELS||this.scaleType===H.LABELS_RATIO?u.rangeRound([l,c]):u.range([l,c]),e){case N.LEFT:h=Op;break;case N.BOTTOM:h=Sp;break;case N.RIGHT:h=Tp;break;case N.TOP:h=Ep}a.attr("aria-label",`${e} axis`);const d=!a.select("g.ticks").empty();let f=Nf.appendOrSelect(a,"g.ticks");d||(f.attr("role",`${Wc.GRAPHICS_OBJECT} ${Wc.GROUP}`),f.attr("aria-label",`${e} ticks`));const p=Nf.appendOrSelect(a,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${e} ticks`),g=uc(n,"axes",e),m=this.scaleType===H.TIME||g.scaleType===H.TIME,y=e===N.LEFT||e===N.RIGHT,v=this.model.get("zoomDomain");if(v&&m&&!y&&u.domain(v),!i)return void f.attr("aria-hidden",!0);const _=uc(g,"scaleType"),b=uc(n,"data","loading"),x=uc(g,"ticks","number"),w=uc(g,"ticks","values"),E=uc(g,"truncation","type"),T=uc(g,"truncation","threshold"),S=uc(g,"truncation","numCharacter"),O=null!==x,M=uc(n,"timeScale"),A=Nf.appendOrSelect(p,"g.tick"),C=Nf.appendOrSelect(A,"text").text("0"),k=Nf.getSVGElementSize(C.node(),{useBBox:!0}).height;A.remove();const D=this.scaleType||g.scaleType||H.LINEAR,L=h(u).tickSizeOuter(0);if(u.ticks){let t;if(O?t=x:(t=ll,y&&(t=this.getNumberOfFittingTicks(s,k,cl))),1===u.ticks().length&&0===u.ticks()[0]&&(t=0),L.ticks(t),m)if(u.ticks(t).length){const i=uc(n,"timeScale","addSpaceOnEdges"),r=uc(n,"axes",e,"domain"),o=u.copy();i&&!r&&o.nice(t);const s=o.ticks(t);i&&s.length>2&&!r&&(s.splice(s.length-1,1),s.splice(0,1)),L.tickValues(s)}else L.tickValues([])}let R;const I=uc(g,"ticks","formatter"),{code:P,number:B}=uc(n,"locale");if(m){const t=$c(L.tickValues(),uc(n,"timeScale","timeInterval"));R=null===I?(e,i)=>Fc(e,i,L.tickValues(),t,M,n.locale):(e,i)=>{const r=Fc(e,i,L.tickValues(),t,M,n.locale);return I(e,i,r)}}else null===I?D===H.LINEAR&&(R=t=>B(t,P)):R=I;L.tickFormat(R);const[F,z]=this.services.cartesianScales.getScaleByPosition(e).domain();let $;if(w){if(m)w.forEach(((t,e)=>{void 0===t.getTime&&(w[e]=new Date(t))})),$=w.filter((t=>{const e=t.getTime();return e>=new Date(F).getTime()&&e<=new Date(z).getTime()}));else if(_===H.LABELS){const t=this.services.cartesianScales.getScaleByPosition(e).domain();$=w.filter((e=>t.includes(e)))}else $=w.filter((t=>t>=F&&t<=z));L.tickValues($)}switch(e){case N.LEFT:f.attr("transform",`translate(${this.margins.left}, 0)`);break;case N.BOTTOM:f.attr("transform",`translate(0, ${s-this.margins.bottom})`);break;case N.RIGHT:f.attr("transform",`translate(${o-this.margins.right}, 0)`);break;case N.TOP:f.attr("transform",`translate(0, ${this.margins.top})`)}const j=this.model.isDataEmpty();if(g.title){const t=Nf.appendOrSelect(a,"text.axis-title").html(j||b?"":Um(g.title)),n=uc(g,"titleOrientation");let i;switch(e){case N.LEFT:n===Q.RIGHT?t.attr("transform","rotate(90)").attr("y",0).attr("x",u.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):t.attr("transform","rotate(-90)").attr("y",0).attr("x",-u.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case N.BOTTOM:const e=s-4;t.attr("transform",`translate(${this.margins.left/2+u.range()[1]/2}, ${e})`);break;case N.RIGHT:n===Q.LEFT?t.attr("transform","rotate(-90)").attr("y",o).attr("x",-u.range()[0]/2).style("text-anchor","middle"):t.attr("transform","rotate(90)").attr("y",-o).attr("x",u.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case N.TOP:i=Nf.getSVGElementSize(t,{useBBox:!0}).height,t.attr("transform",`translate(${this.margins.left/2+u.range()[1]/2}, ${i/2})`).style("text-anchor","middle")}}if(m){const e=$c(L.tickValues(),uc(n,"timeScale","timeInterval")),i=M.showDayName,r=f;t&&(f=f.transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"axis-update",animate:t})))),f=f.call(L),r.selectAll(".tick").data(L.tickValues(),u).order().select("text").attr("class",((t,n)=>Hc(t,n,L.tickValues(),e,i)?"tick-label--primary":"tick-label"))}else f=t&&d?f.transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"axis-update",animate:t}))).call(L):f.call(L);if(p.call(L),e===N.BOTTOM||e===N.TOP){let t=!1;const n=uc(g,"ticks","rotation");if(n===X.ALWAYS)t=!0;else if(n===X.NEVER)t=!1;else if(!n||n===X.AUTO)if(u.step)t=p.selectAll("g.tick text").nodes().some((t=>Nf.getSVGElementSize(t,{useBBox:!0}).width>=u.step()));else{t=!1;const e=p.append("text").text("A"),n=Nf.getSVGElementSize(e.node(),{useBBox:!0}).width;let i;p.selectAll("g.tick").each((function(){const e=wu(this),r=parseFloat(uc(ac(this),"tx"));null!==r&&i+e.text().length*n*.8>=r&&(t=!0),i=r})),e.remove()}t?(O||(L.ticks(this.getNumberOfFittingTicks(o,k,ul)),p.call(L),f.call(L)),a.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",e===N.TOP?"start":"end")):a.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(b?a.attr("opacity",0):a.attr("opacity",1),f.selectAll("g.tick").attr("aria-label",(t=>t)),p.selectAll("g.tick").attr("aria-label",(t=>t)),E!==U.NONE&&_===H.LABELS&&!w){const t=this.services.cartesianScales.getScaleDomain(e);if(t.length>0){const n=r.select(`g.axis.${e} g.ticks g.tick`).html();a.selectAll("g.ticks g.tick").html(n);const i=this;a.selectAll("g.tick text").data(t).text((function(t){return t.length>T?(i.truncation[e]=!0,lc(t,E,S)):t})),this.getInvisibleAxisRef().selectAll("g.tick text").data(t).text((function(t){return t.length>T?lc(t,E,S):t})),a.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),a.selectAll("g.tick text").data(t)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:e}=this.configs,n=Nf.appendOrSelect(t,`g.axis.${e}`),i=this.getOptions(),r=uc(i,"axes",e),o=uc(r,"scaleType"),s=uc(r,"truncation","threshold"),a=this;n.selectAll("g.tick text").on("mouseover",(function(t,e){a.services.events.dispatchEvent(D.Axis.LABEL_MOUSEOVER,{event:t,element:wu(this),datum:e}),o===H.LABELS&&e.length>s&&a.services.events.dispatchEvent(D.Tooltip.SHOW,{event:t,hoveredElement:wu(this),content:e})})).on("mousemove",(function(t,e){a.services.events.dispatchEvent(D.Axis.LABEL_MOUSEMOVE,{event:t,element:wu(this),datum:e}),o===H.LABELS&&e.length>s&&a.services.events.dispatchEvent(D.Tooltip.MOVE,{event:t})})).on("click",(function(t,e){a.services.events.dispatchEvent(D.Axis.LABEL_CLICK,{event:t,element:wu(this),datum:e})})).on("mouseout",(function(t,e){a.services.events.dispatchEvent(D.Axis.LABEL_MOUSEOUT,{event:t,element:wu(this),datum:e}),o===H.LABELS&&a.services.events.dispatchEvent(D.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,e,n){return function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=vu(n))==n?n:0),void 0!==e&&(e=(e=vu(e))==e?e:0),function(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}(vu(t),e,n)}(Math.floor(t/(e*n)),2,ll)}destroy(){const t=this.getComponentContainer(),{position:e}=this.configs;Nf.appendOrSelect(t,`g.axis.${e}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class my extends gy{constructor(t,e,n){super(t,e,n)}render(t=!0){super.render(t),super.destroy();const e=this.configs.position,n=this.getComponentContainer({ariaLabel:"axes"}),i=Nf.appendOrSelect(n,`g.axis.${e}`),r=this;i.selectAll("g.tick").each((function(t,n){const i=wu(this);i.classed("tick-hover",!0).attr("tabindex",0===n?0:-1);const o=i.select("text"),{width:s,height:a}=Nf.getSVGElementSize(o,{useBBox:!0}),l=Nf.appendOrSelect(i,"rect.axis-holder");let c=0,u=0;switch(e){case N.LEFT:c=-s+Number(o.attr("x")),u=-a/2;break;case N.RIGHT:c=Math.abs(Number(o.attr("x"))),u=-a/2;break;case N.TOP:c=-s/2,u=-a+Number(o.attr("y"))/2,r.truncation[e]&&(c=0,l.attr("transform","rotate(-45)"));break;case N.BOTTOM:c=-s/2,u=a/2-2,r.truncation[e]&&(c=-s,l.attr("transform","rotate(-45)"))}l.attr("x",c-dl).attr("y",u).attr("width",s+2*dl).attr("height",a).lower()})),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:e}=this.configs,n=Nf.appendOrSelect(t,`g.axis.${e}`),i=this.getOptions(),r=uc(i,"axes",e),o=uc(r,"scaleType"),s=uc(r,"truncation","threshold"),a=this;n.selectAll("g.tick.tick-hover").on("mouseover",(function(t){const e=wu(this).select("text"),n=e.datum();a.services.events.dispatchEvent(D.Axis.LABEL_MOUSEOVER,{event:t,element:e,datum:n}),o===H.LABELS&&n.length>s&&a.services.events.dispatchEvent(D.Tooltip.SHOW,{event:t,element:e,datum:n})})).on("mousemove",(function(t){const e=wu(this).select("text"),n=e.datum();a.services.events.dispatchEvent(D.Axis.LABEL_MOUSEMOVE,{event:t,element:e,datum:n}),a.services.events.dispatchEvent(D.Tooltip.MOVE,{event:t})})).on("click",(function(t){a.services.events.dispatchEvent(D.Axis.LABEL_CLICK,{event:t,element:wu(this).select("text"),datum:wu(this).select("text").datum()})})).on("mouseout",(function(t){a.services.events.dispatchEvent(D.Axis.LABEL_MOUSEOUT,{event:t,element:wu(this).select("text"),datum:wu(this).select("text").datum()}),o===H.LABELS&&a.services.events.dispatchEvent(D.Tooltip.HIDE)})).on("focus",(function(t){const e={clientX:0,clientY:0};if(t.target){t.target.focus();const n=t.target.getBoundingClientRect();e.clientX=n.x,e.clientY=n.y}a.services.events.dispatchEvent(D.Axis.LABEL_FOCUS,{event:{...t,...e},element:wu(this),datum:wu(this).select("text").datum()})})).on("blur",(function(t){a.services.events.dispatchEvent(D.Axis.LABEL_BLUR,{event:t,element:wu(this),datum:wu(this).select("text").datum()})})).on("keydown",(function(t){t.key&&"Escape"===t.key&&(a.services.events.dispatchEvent(D.Tooltip.HIDE),a.services.events.dispatchEvent(D.Axis.LABEL_BLUR,{event:t,element:wu(this),datum:wu(this).select("text").datum()})),e===N.LEFT||e===N.RIGHT?t.key&&"ArrowUp"===t.key?a.goNext(this,t):t.key&&"ArrowDown"===t.key&&a.goPrevious(this,t):t.key&&"ArrowLeft"===t.key?a.goPrevious(this,t):t.key&&"ArrowRight"===t.key&&a.goNext(this,t)}))}goNext(t,e){t.nextElementSibling&&"path"!==t.nextElementSibling.tagName&&t.nextElementSibling.dispatchEvent(new Event("focus")),e.preventDefault()}goPrevious(t,e){t.previousElementSibling&&"path"!==t.previousElementSibling.tagName&&t.previousElementSibling.dispatchEvent(new Event("focus")),e.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:e}=this.configs;Nf.appendOrSelect(t,`g.axis.${e}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class yy extends Ug{constructor(){super(...arguments),this.type="2D-axes",this.renderType=L.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const e={},n=Object.keys(N),i=uc(this.getOptions(),"axes");n.forEach((t=>{i[N[t]]&&(e[N[t]]=!0)})),this.configs.axes=e,n.forEach((t=>{const e=N[t];if(this.configs.axes[e]&&!this.children[e]){const t={position:e,axes:this.configs.axes,margins:this.margins},n=this.model.axisFlavor===et.DEFAULT?new gy(this.model,this.services,t):new my(this.model,this.services,t);n.setModel(this.model),n.setServices(this.services),n.setParent(this.parent),this.children[e]=n}})),Object.keys(this.children).forEach((e=>{this.children[e].render(t)}));const r={};Object.keys(this.children).forEach((t=>{const e=this.children[t],n=e.configs.position,i=e.getInvisibleAxisRef(),{width:o,height:s}=Nf.getSVGElementSize(i,{useBBox:!0});let a=0;if(!e.getTitleRef().empty()){const t=Nf.getSVGElementSize(e.getTitleRef(),{useBBox:!0}).height;a=n===N.LEFT||n===N.RIGHT?t+5:n===N.BOTTOM?t+4:t}const l=o,c=s;switch(n){case N.TOP:r.top=c+a;break;case N.BOTTOM:r.bottom=c+a;break;case N.LEFT:r.left=l+a;break;case N.RIGHT:r.right=l+a}})),this.services.events.dispatchEvent(D.Axis.RENDER_COMPLETE),Object.keys(r).some((t=>this.margins[t]!==r[t]))&&(this.margins=Object.assign(this.margins,r),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(D.ZoomBar.UPDATE),Object.keys(this.children).forEach((t=>{this.children[t].margins=this.margins})),this.render(!0))}}class vy extends Ug{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const e=uc(this.getOptions(),"data","loading");e?this.renderSkeleton(e):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Y.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Y.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Y.PIE)this.renderPieSkeleton(t);else{if(this.configs.skeleton!==Y.DONUT)throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`);this.renderDonutSkeleton(t)}}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const e=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),e===B.VERTICAL&&this.drawYGrid(t),e===B.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const e=this.computeOuterRadius();this.drawRing(e,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const e=this.computeOuterRadius(),n=this.computeInnerRadius();this.drawRing(e,n,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),e=this.services.cartesianScales.getMainYScale().range();this.xScale=ol().domain([0,1]).range(t),this.yScale=ol().domain([0,1]).range(e)}drawBackdrop(t){const e=this.parent,{width:n,height:i}=Nf.getSVGElementSize(e,{useAttrs:!0});this.backdrop=Nf.appendOrSelect(e,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",n).attr("height",i);const r=Nf.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");r.attr("width","100%").attr("height","100%");const[o]=this.xScale.range(),[,s]=this.yScale.range();this.backdrop.merge(r).attr("x",o).attr("y",s),r.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const e=+this.backdrop.attr("width"),n=uc(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(n).map((t=>t*e)),r=Nf.appendOrSelect(this.backdrop,"g.x.skeleton"),o=r.selectAll("line").data(i);o.enter().append("line").merge(o).attr("x1",(t=>t)).attr("x2",(t=>t)).attr("y1",0).attr("y2","100%"),r.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 e=+this.backdrop.attr("height"),n=this.backdrop.attr("width"),i=uc(this.getOptions(),"grid","y","numberOfTicks"),r=this.xScale.ticks(i).map((t=>t*e)),o=Nf.appendOrSelect(this.backdrop,"g.y.skeleton"),s=o.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",(t=>t)).attr("y2",(t=>t)),o.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,e,n=!0){const i=this.parent,{width:r,height:o}=Nf.getSVGElementSize(i,{useAttrs:!0}),s=Nf.appendOrSelect(i,"svg.chart-skeleton").attr("width",r).attr("height",o).attr("role","presentation"),a=0===e?"pie":"donut",l=uc(this.getOptions(),a,"alignment");Nf.appendOrSelect(s,"rect.chart-skeleton-area-container").attr("width",r).attr("height",o).attr("fill","none");const c=function(){var t=Og,e=Mg,n=Zc(0),i=null,r=Ag,o=Cg,s=kg,a=null,l=Sg(c);function c(){var c,u,h=+t.apply(this,arguments),d=+e.apply(this,arguments),f=r.apply(this,arguments)-Yd,p=o.apply(this,arguments)-Yd,g=Bd(p-f),m=p>f;if(a||(a=c=l()),d<h&&(u=d,d=h,h=u),d>Gd)if(g>Zd-Gd)a.moveTo(d*Fd(f),d*jd(f)),a.arc(0,0,d,f,p,!m),h>Gd&&(a.moveTo(h*Fd(p),h*jd(p)),a.arc(0,0,h,p,f,m));else{var y,v,_=f,b=p,x=f,w=p,E=g,T=g,S=s.apply(this,arguments)/2,O=S>Gd&&(i?+i.apply(this,arguments):Vd(h*h+d*d)),M=$d(Bd(d-h)/2,+n.apply(this,arguments)),A=M,C=M;if(O>Gd){var k=Xd(O/h*jd(S)),D=Xd(O/d*jd(S));(E-=2*k)>Gd?(x+=k*=m?1:-1,w-=k):(E=0,x=w=(f+p)/2),(T-=2*D)>Gd?(_+=D*=m?1:-1,b-=D):(T=0,_=b=(f+p)/2)}var L=d*Fd(_),R=d*jd(_),I=h*Fd(w),N=h*jd(w);if(M>Gd){var P,U=d*Fd(b),B=d*jd(b),H=h*Fd(x),F=h*jd(x);if(g<Wd)if(P=function(t,e,n,i,r,o,s,a){var l=n-t,c=i-e,u=s-r,h=a-o,d=h*l-u*c;if(!(d*d<Gd))return[t+(d=(u*(e-o)-h*(t-r))/d)*l,e+d*c]}(L,R,H,F,U,B,I,N)){var z=L-P[0],$=R-P[1],j=U-P[0],V=B-P[1],G=1/jd(function(t){return t>1?0:t<-1?Wd:Math.acos(t)}((z*j+$*V)/(Vd(z*z+$*$)*Vd(j*j+V*V)))/2),W=Vd(P[0]*P[0]+P[1]*P[1]);A=$d(M,(h-W)/(G-1)),C=$d(M,(d-W)/(G+1))}else A=C=0}T>Gd?C>Gd?(y=Dg(H,F,L,R,d,C,m),v=Dg(U,B,I,N,d,C,m),a.moveTo(y.cx+y.x01,y.cy+y.y01),C<M?a.arc(y.cx,y.cy,C,Hd(y.y01,y.x01),Hd(v.y01,v.x01),!m):(a.arc(y.cx,y.cy,C,Hd(y.y01,y.x01),Hd(y.y11,y.x11),!m),a.arc(0,0,d,Hd(y.cy+y.y11,y.cx+y.x11),Hd(v.cy+v.y11,v.cx+v.x11),!m),a.arc(v.cx,v.cy,C,Hd(v.y11,v.x11),Hd(v.y01,v.x01),!m))):(a.moveTo(L,R),a.arc(0,0,d,_,b,!m)):a.moveTo(L,R),h>Gd&&E>Gd?A>Gd?(y=Dg(I,N,U,B,h,-A,m),v=Dg(L,R,H,F,h,-A,m),a.lineTo(y.cx+y.x01,y.cy+y.y01),A<M?a.arc(y.cx,y.cy,A,Hd(y.y01,y.x01),Hd(v.y01,v.x01),!m):(a.arc(y.cx,y.cy,A,Hd(y.y01,y.x01),Hd(y.y11,y.x11),!m),a.arc(0,0,h,Hd(y.cy+y.y11,y.cx+y.x11),Hd(v.cy+v.y11,v.cx+v.x11),m),a.arc(v.cx,v.cy,A,Hd(v.y11,v.x11),Hd(v.y01,v.x01),!m))):a.arc(0,0,h,w,x,m):a.lineTo(I,N)}else a.moveTo(0,0);if(a.closePath(),c)return a=null,c+""||null}return c.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-Wd/2;return[Fd(i)*n,jd(i)*n]},c.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Zc(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Zc(+t),c):e},c.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Zc(+t),c):n},c.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Zc(+t),c):i},c.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Zc(+t),c):r},c.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Zc(+t),c):o},c.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Zc(+t),c):s},c.context=function(t){return arguments.length?(a=t??null,c):a},c}().innerRadius(e).outerRadius(t).startAngle(0).endAngle(2*Math.PI),u=t+Math.abs(-15),h=t+(Math.min(r,o)-2*t)/2,d=Nf.appendOrSelect(s,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${u}, ${h})`).attr("d",c).classed("shimmer-effect-areas",n).classed("empty-state-areas",!n).style("fill",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let f=t+30;l===z.CENTER?f=r/2:l===z.RIGHT&&(f=r-t-30);const p=t+20;d.attr("transform",`translate(${f}, ${p})`)}computeOuterRadius(){const{width:t,height:e}=Nf.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,e)/2-15}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const e="stop-bg-shimmer",n=this.parent.select(".chart-skeleton"),{width:i}=Nf.getSVGElementSize(this.parent,{useAttrs:!0}),r=i,o=Nf.appendOrSelect(n,"defs").lower(),s=Nf.appendOrSelect(o,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",0-3*.2*i).attr("x2",r).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),a=`\n\t\t\t<stop class="${e}" offset="0"></stop>\n\t\t\t<stop class="stop-shimmer" offset="0.2"></stop>\n\t\t\t<stop class="${e}" offset="0.4"></stop>\n\t\t`;s.html(a),function t(){s.attr("gradientTransform",`translate(${0-3*.2*i}, 0)`).transition().duration(2e3).delay(1e3).ease(Cp).attr("gradientTransform",`translate(${r+3*.2*i}, 0)`).on("end",t)}()}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class _y extends Ug{constructor(){super(...arguments),this.type="zero-line",this.renderType=L.SVG}render(t){const e=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),n=this.services.cartesianScales.getScaleByPosition(e),[i,r]=n.domain(),o=i>0&&r<0||i<0&&r>0,s=this.getComponentContainer({isPresentational:!0});if(!o)return void s.selectAll("line.domain").remove();const[a,l]=this.services.cartesianScales.getDomainScale().range();let c=+n(0)+.5;c||(c=n.range()[0]);const u=hc({x0:a,x1:l,y0:c,y1:c},this.services.cartesianScales.getOrientation());Nf.appendOrSelect(s,"line.domain").transition().call((e=>this.services.transitions.setupTransition({transition:e,name:"zero-line-update",animate:t}))).attr("y1",u.y0).attr("y2",u.y1).attr("x1",u.x0).attr("x2",u.x1)}}class by extends vy{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const e=uc(this.getOptions(),"data","loading"),n=!(uc(this.getOptions(),"grid","x","enabled")||uc(this.getOptions(),"grid","y","enabled")||uc(this.getOptions(),"axes","bottom","visible")||uc(this.getOptions(),"axes","left","visible"));e&&!n?super.renderGridSkeleton(e):e&&n?this.renderSparklineSkeleton(e):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const e=this.backdrop.attr("width"),n=Nf.appendOrSelect(this.backdrop,"g.y.skeleton"),i=n.selectAll("line").data([100]);i.enter().append("line").merge(i).attr("x1",0).attr("x2",e).attr("y1",(t=>t)).attr("y2",(t=>t)),n.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=Nf.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("role","presentation"),Nf.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}function xy(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var n=function t(){var n=!1;try{n=this instanceof t}catch{}return n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})})),n}var wy={value:function(){}};function Ey(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new Ty(i)}function Ty(t){this._=t}function Sy(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function Oy(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=wy,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}Ty.prototype=Ey.prototype={constructor:Ty,on:function(t,e){var n,i=this._,r=function(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",i),o=-1,s=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=r[o]).type)i[n]=Oy(i[n],t.name,e);else if(null==e)for(n in i)i[n]=Oy(i[n],t.name,null);return this}for(;++o<s;)if((n=(t=r[o]).type)&&(n=Sy(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ty(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};const My=xy(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Ey},Symbol.toStringTag,{value:"Module"})));var Ay,Cy;function ky(t){return null!=t&&t.length?Sn(t,1):[]}function Dy(t,e,n){var i=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(r);++i<r;)o[i]=t[i+e];return o}function Ly(t,e){return null==(t=function(t,e){return e.length<2?t:bn(t,Dy(e,0,-1))}(t,e=vn(e,t)))||delete t[_n(Zi(e))]}function Ry(t){return Ln(t)?void 0:t}!function(){if(Cy)return Ay;Cy=1;const t=My.dispatch,e=Math.PI/180,n={archimedean:p,rectangular:function(t){var e=4*t[0]/t[1],n=0,i=0;return function(t){var r=t<0?-1:1;switch(Math.sqrt(1+4*r*t)-r&3){case 0:n+=e;break;case 1:i+=4;break;case 2:n-=e;break;default:i-=4}return[n,i]}}},i=2048;function r(t){return t.text}function o(){return"serif"}function s(){return"normal"}function a(t){return Math.sqrt(t.value)}function l(){return 30*(~~(6*random())-3)}function c(){return 1}function u(t,n,r,o){if(!n.sprite){var s=t.context,a=t.ratio;s.clearRect(0,0,2048/a,i/a);var l=0,c=0,u=0,h=r.length;for(--o;++o<h;){n=r[o],s.save(),s.font=n.style+" "+n.weight+" "+~~((n.size+1)/a)+"px "+n.font;const t=s.measureText(n.text),h=-Math.floor(t.width/2);let v=(t.width+1)*a,_=n.size<<1;if(n.rotate){var d=Math.sin(n.rotate*e),f=Math.cos(n.rotate*e),p=v*f,g=v*d,m=_*f,y=_*d;v=Math.max(Math.abs(p+y),Math.abs(p-y))+31>>5<<5,_=~~Math.max(Math.abs(g+m),Math.abs(g-m))}else v=v+31>>5<<5;if(_>u&&(u=_),l+v>=2048&&(l=0,c+=u,u=0),c+_>=i)break;s.translate((l+(v>>1))/a,(c+(_>>1))/a),n.rotate&&s.rotate(n.rotate*e),s.fillText(n.text,h,0),n.padding&&(s.lineWidth=2*n.padding,s.strokeText(n.text,h,0)),s.restore(),n.width=v,n.height=_,n.xoff=l,n.yoff=c,n.x1=v>>1,n.y1=_>>1,n.x0=-n.x1,n.y0=-n.y1,n.hasText=!0,l+=v}for(var v=s.getImageData(0,0,2048/a,i/a).data,_=[];--o>=0;)if((n=r[o]).hasText){for(var b=n.width,x=b>>5,w=n.y1-n.y0,E=0;E<w*x;E++)_[E]=0;if(null==(l=n.xoff))return;c=n.yoff;for(var T=0,S=-1,O=0;O<w;O++){for(E=0;E<b;E++){var M=x*O+(E>>5),A=v[2048*(c+O)+(l+E)<<2]?1<<31-E%32:0;_[M]|=A,T|=A}T?S=O:(n.y0++,w--,O--,c++)}n.y1=n.y0+S,n.sprite=_.slice(0,(n.y1-n.y0)*x)}}}function h(t,e,n){n>>=5;for(var i,r=t.sprite,o=t.width>>5,s=t.x-(o<<4),a=127&s,l=32-a,c=t.y1-t.y0,u=(t.y+t.y0)*n+(s>>5),h=0;h<c;h++){i=0;for(var d=0;d<=o;d++)if((i<<l|(d<o?(i=r[h*o+d])>>>a:0))&e[u+d])return!0;u+=n}return!1}function d(t,e){var n=t[0],i=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>i.x&&(i.x=e.x+e.x1),e.y+e.y1>i.y&&(i.y=e.y+e.y1)}function f(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function p(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function g(){return document.createElement("canvas")}function m(t){return"function"==typeof t?t:function(){return t}}Ay=function(){var e=[256,256],y=r,v=o,_=a,b=s,x=s,w=l,E=c,T=p,S=[],O=1/0,M=t("word","end"),A=null,C=Math.random,k={},D=g;function L(t,n,i){e[0],e[1];for(var r,o,s,a=n.x,l=n.y,c=Math.sqrt(e[0]*e[0]+e[1]*e[1]),u=T(e),d=C()<.5?1:-1,p=-d;(r=u(p+=d))&&(o=~~r[0],s=~~r[1],!(Math.min(Math.abs(o),Math.abs(s))>=c));)if(n.x=a+o,n.y=l+s,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>e[0]||n.y+n.y1>e[1])&&(!i||f(n,i))&&!h(n,t,e[0])){for(var g,m=n.sprite,y=n.width>>5,v=e[0]>>5,_=n.x-(y<<4),b=127&_,x=32-b,w=n.y1-n.y0,E=(n.y+n.y0)*v+(_>>5),S=0;S<w;S++){g=0;for(var O=0;O<=y;O++)t[E+O]|=g<<x|(O<y?(g=m[S*y+O])>>>b:0);E+=v}return!0}return!1}return k.canvas=function(t){return arguments.length?(D=m(t),k):D},k.start=function(){var t=function(t){const e=t.getContext("2d",{willReadFrequently:!0});t.width=t.height=1;const n=Math.sqrt(e.getImageData(0,0,1,1).data.length>>2);return t.width=2048/n,t.height=i/n,e.fillStyle=e.strokeStyle="red",{context:e,ratio:n}}(D()),n=function(t){for(var e=[],n=-1;++n<t;)e[n]=0;return e}((e[0]>>5)*e[1]),r=null,o=S.length,s=-1,a=[],l=S.map((function(t,e){return t.text=y.call(this,t,e),t.font=v.call(this,t,e),t.style=b.call(this,t,e),t.weight=x.call(this,t,e),t.rotate=w.call(this,t,e),t.size=~~_.call(this,t,e),t.padding=E.call(this,t,e),t})).sort((function(t,e){return e.size-t.size}));return A&&clearInterval(A),A=setInterval(c,0),c(),k;function c(){for(var i=Date.now();Date.now()-i<O&&++s<o&&A;){var c=l[s];c.x=e[0]*(C()+.5)>>1,c.y=e[1]*(C()+.5)>>1,u(t,c,l,s),c.hasText&&L(n,c,r)&&(a.push(c),M.call("word",k,c),r?d(r,c):r=[{x:c.x+c.x0,y:c.y+c.y0},{x:c.x+c.x1,y:c.y+c.y1}],c.x-=e[0]>>1,c.y-=e[1]>>1)}s>=o&&(k.stop(),M.call("end",k,a,r))}},k.stop=function(){A&&(clearInterval(A),A=null);for(const t of S)delete t.sprite;return k},k.timeInterval=function(t){return arguments.length?(O=t??1/0,k):O},k.words=function(t){return arguments.length?(S=t,k):S},k.size=function(t){return arguments.length?(e=[+t[0],+t[1]],k):e},k.font=function(t){return arguments.length?(v=m(t),k):v},k.fontStyle=function(t){return arguments.length?(b=m(t),k):b},k.fontWeight=function(t){return arguments.length?(x=m(t),k):x},k.rotate=function(t){return arguments.length?(w=m(t),k):w},k.text=function(t){return arguments.length?(y=m(t),k):y},k.spiral=function(t){return arguments.length?(T=n[t]||t,k):T},k.fontSize=function(t){return arguments.length?(_=m(t),k):_},k.padding=function(t){return arguments.length?(E=m(t),k):E},k.random=function(t){return arguments.length?(C=t,k):C},k.on=function(){var t=M.on.apply(M,arguments);return t===M?k:t},k}}();var Iy=function(t){return le(_e(t,void 0,ky),t+"")}((function(t,e){var n={};if(null==t)return n;var i=!1;e=Nt(e,(function(e){return e=vn(e,t),i||(i=e.length>1),e})),ye(t,Wn(t),n),i&&(n=Ei(n,7,Ry));for(var r=e.length;r--;)Ly(n,e[r]);return n}));function Ny(t){return Math.log(t)}function Py(t){return Math.exp(t)}function Uy(t){return-Math.log(-t)}function By(t){return-Math.exp(-t)}function Hy(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Fy(t){return(e,n)=>-t(-e,n)}function zy(){const t=function(t){const e=t(Ny,Py),n=e.domain;let i,r,o=10;function s(){return i=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),r=function(t){return 10===t?Hy:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(i=Fy(i),r=Fy(r),t(Uy,By)):t(Ny,Py),e}return e.base=function(t){return arguments.length?(o=+t,s()):o},e.domain=function(t){return arguments.length?(n(t),s()):n()},e.ticks=t=>{const e=n();let s=e[0],a=e[e.length-1];const l=a<s;l&&([s,a]=[a,s]);let c,u,h=i(s),d=i(a);const f=null==t?10:+t;let p=[];if(!(o%1)&&d-h<f){if(h=Math.floor(h),d=Math.ceil(d),s>0){for(;h<=d;++h)for(c=1;c<o;++c)if(u=h<0?c/r(-h):c*r(h),!(u<s)){if(u>a)break;p.push(u)}}else for(;h<=d;++h)for(c=o-1;c>=1;--c)if(u=h>0?c/r(-h):c*r(h),!(u<s)){if(u>a)break;p.push(u)}2*p.length<f&&(p=pr(s,a,f))}else p=pr(h,d,Math.min(d-h,f)).map(r);return l?p.reverse():p},e.tickFormat=(t,n)=>{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(!(o%1)&&null==(n=Pa(n)).precision&&(n.trim=!0),n=$a(n)),t===1/0)return n;const s=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/r(Math.round(i(t)));return e*o<o-.5&&(e*=o),e<=s?n(t):""}},e.nice=()=>n(Tu(n(),{floor:t=>r(Math.floor(i(t))),ceil:t=>r(Math.ceil(i(t)))})),e}(nl()).domain([1,10]);return t.copy=()=>el(t,zy()).base(t.base()),Wa.apply(t,arguments),t}function $y(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function jy(t){this._context=t}function Vy(t){return new jy(t)}function Gy(t){this._context=t}function Wy(t){return new Gy(t)}function Yy(t){this._context=t}function Zy(t){return new Yy(t)}function Xy(t,e){this._basis=new jy(t),this._beta=e}jy.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:$y(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:$y(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Gy.prototype={areaStart:Qd,areaEnd:Qd,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)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:$y(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Yy.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:$y(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Xy.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],o=e[0],s=t[n]-r,a=e[n]-o,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(r+i*s),this._beta*e[l]+(1-this._beta)*(o+i*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const qy=function t(e){function n(t){return 1===e?new jy(t):new Xy(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Ky(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Qy(t,e){this._context=t,this._k=(1-e)/6}Qy.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:Ky(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Ky(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Jy=function t(e){function n(t){return new Qy(t,e)}return n.tension=function(e){return t(+e)},n}(0);function tv(t,e){this._context=t,this._k=(1-e)/6}tv.prototype={areaStart:Qd,areaEnd:Qd,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)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ky(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const ev=function t(e){function n(t){return new tv(t,e)}return n.tension=function(e){return t(+e)},n}(0);function nv(t,e){this._context=t,this._k=(1-e)/6}nv.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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:Ky(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const iv=function t(e){function n(t){return new nv(t,e)}return n.tension=function(e){return t(+e)},n}(0);function rv(t,e,n){var i=t._x1,r=t._y1,o=t._x2,s=t._y2;if(t._l01_a>Gd){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Gd){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,s,t._x2,t._y2)}function ov(t,e){this._context=t,this._alpha=e}ov.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)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:rv(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const sv=function t(e){function n(t){return e?new ov(t,e):new Qy(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function av(t,e){this._context=t,this._alpha=e}av.prototype={areaStart:Qd,areaEnd:Qd,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)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:rv(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const lv=function t(e){function n(t){return e?new av(t,e):new tv(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function cv(t,e){this._context=t,this._alpha=e}cv.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:rv(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const uv=function t(e){function n(t){return e?new cv(t,e):new nv(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function hv(t){return t<0?-1:1}function dv(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),s=(n-t._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(hv(o)+hv(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function fv(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function pv(t,e,n){var i=t._x0,r=t._y0,o=t._x1,s=t._y1,a=(o-i)/3;t._context.bezierCurveTo(i+a,r+a*e,o-a,s-a*n,o,s)}function gv(t){this._context=t}function mv(t){this._context=new yv(t)}function yv(t){this._context=t}function vv(t){return new gv(t)}function _v(t){return new mv(t)}function bv(t){this._context=t}function xv(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),s=new Array(i);for(r[0]=0,o[0]=2,s[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,o[e]=4,s[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,o[i-1]=7,s[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/o[e-1],o[e]-=n,s[e]-=n*s[e-1];for(r[i-1]=s[i-1]/o[i-1],e=i-2;e>=0;--e)r[e]=(s[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)o[e]=2*t[e+1]-r[e+1];return[r,o]}function wv(t){return new bv(t)}function Ev(t,e){this._context=t,this._t=e}function Tv(t){return new Ev(t,.5)}function Sv(t){return new Ev(t,0)}function Ov(t){return new Ev(t,1)}gv.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:pv(this,this._t0,fv(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,pv(this,fv(this,n=dv(this,t,e)),n);break;default:pv(this,this._t0,n=dv(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(mv.prototype=Object.create(gv.prototype)).point=function(t,e){gv.prototype.point.call(this,e,t)},yv.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}},bv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=xv(t),r=xv(e),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],t[s],e[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},Ev.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&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};class Mv extends If{zoomIn(t,e,n){let i,r,o;const s=n||fl;t&&(i=t.x,r=t.y,o=2);const{width:a,height:l}=Nf.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});e.transition().duration(s.duration).ease(s.ease).attr("transform",`translate(${a/2}, ${l/2}) scale(${o}) translate(${-i},${-r})`),this.services.events.dispatchEvent(D.CanvasZoom.CANVAS_ZOOM_IN,{element:wu(t)})}zoomOut(t,e){const n=e||fl;t.transition().duration(n.duration).ease(n.ease).attr("transform",""),this.services.events.dispatchEvent(D.CanvasZoom.CANVAS_ZOOM_OUT)}}class Av extends If{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,e){this.documentFragment.addEventListener(t,e)}removeEventListener(t,e){this.documentFragment.removeEventListener(t,e)}dispatchEvent(t,e){let n;e?n=new CustomEvent(t,{detail:e}):(n=document.createEvent("Event"),n.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(n)}}class Cv extends If{constructor(t,e){super(t,e)}downloadCSV(t,e){const n=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),e);else if(URL&&"download"in n){const r=URL.createObjectURL(new Blob([t],{type:i}));n.href=r,n.setAttribute("download",e),document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,e){const n=document.createElement("a");n.download=e,n.href=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}}class kv extends If{constructor(){super(...arguments),this.pendingTransitions={}}init(){this.services.events?.addEventListener(D.Model.UPDATE,(()=>{this.pendingTransitions={}}))}setupTransition({transition:t,name:e,animate:n}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",(()=>{delete this.pendingTransitions[t._id]})),!1===this.model.getOptions().animations||!1===n?t.duration(0):t.duration(uc(xl,e,"duration")||xl.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Dv(t,e){const n=+pt(t)-+pt(e);return n<0?-1:n>0?1:n}function Lv(t,e,n){const i=pt(t,n?.in);if(isNaN(e))return ut(t,NaN);if(!e)return i;const r=i.getDate(),o=ut(t,i.getTime());return o.setMonth(i.getMonth()+e+1,0),r>=o.getDate()?o:(i.setFullYear(o.getFullYear(),o.getMonth(),r),i)}function Rv(t,e,n){return Lv(t,12*e,n)}function Iv(t,e,n){return Rv(t,-e,n)}function Nv(t,e,n){const[i,r,o]=ht(0,t,t,e),s=Dv(r,o),a=Math.abs(function(t,e){const[n,i]=ht(0,t,e);return 12*(n.getFullYear()-i.getFullYear())+(n.getMonth()-i.getMonth())}(r,o));if(a<1)return 0;1===r.getMonth()&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-s*a);let l=Dv(r,o)===-s;(function(t,e){const n=pt(t,e?.in);return+function(t,e){const n=pt(t,e?.in);return n.setHours(23,59,59,999),n}(n,e)==+function(t,e){const n=pt(t,e?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}(n,e)})(i)&&1===a&&1===Dv(i,o)&&(l=!1);const c=s*(a-+l);return 0===c?0:c}function Pv(t,e,n){return Lv(t,-e,n)}function Uv(t,e){const n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function Bv(t,e,n){const i=pt(t,n?.in);return isNaN(e)?ut(t,NaN):(e&&i.setDate(i.getDate()+e),i)}function Hv(t,e,n){return Bv(t,-e,n)}function Fv(t){return t=>{const e=(0,Math.trunc)(t);return 0===e?0:e}}function zv(t,e,n){return ut(t,+pt(t)+e)}function $v(t,e,n){return zv(t,e*lt)}function jv(t,e,n){return $v(t,-e)}function Vv(t,e){return+pt(t)-+pt(e)}function Gv(t,e,n){const i=Vv(t,e)/6e4;return Fv()(i)}function Wv(t,e,n){const i=pt(t,n?.in);return i.setTime(i.getTime()+6e4*e),i}function Yv(t,e,n){return Wv(t,-e,n)}function Zv(t,e,n){const i=Vv(t,e)/1e3;return Fv()(i)}function Xv(t,e,n){return zv(t,1e3*e)}function qv(t,e,n){return Xv(t,-e)}class Kv extends If{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 e=this.model.getOptions(),{groupMapsTo:n}=e.data,i=uc(e,"axes",this.secondaryDomainAxisPosition),r=t[n];if(i?.correspondingDatasets&&i.correspondingDatasets.includes(r))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:e=null}={}){if(this.dualAxes){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,r=uc(n,"axes",this.secondaryRangeAxisPosition);let o;if(null!==t?o=t[i]:e&&e.length>0&&(o=e[0]),r?.correspondingDatasets&&r.correspondingDatasets.includes(o))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return uc(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===N.BOTTOM||t===N.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(N).map((t=>N[t])).forEach((t=>{this.scales[t]=this.createScale(t)}))}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),e=this.findHorizontalAxesPositions(),n=this.findDomainAndRangeAxesPositions(t,e);this.domainAxisPosition=n.primaryDomainAxisPosition,this.rangeAxisPosition=n.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=n.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=n.secondaryRangeAxisPosition)}determineOrientation(){this.rangeAxisPosition!==N.LEFT&&this.rangeAxisPosition!==N.RIGHT||this.domainAxisPosition!==N.BOTTOM&&this.domainAxisPosition!==N.TOP?this.orientation=B.HORIZONTAL:this.orientation=B.VERTICAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){const t=this.model.getOptions(),e=uc(t,"axes");(e[N.LEFT]?.correspondingDatasets&&e[N.RIGHT]||e[N.RIGHT]?.correspondingDatasets&&e[N.LEFT]||e[N.TOP]?.correspondingDatasets&&e[N.BOTTOM]||e[N.BOTTOM]?.correspondingDatasets&&e[N.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const e=uc(this.model.getOptions(),"axes",t,"domain");if(e&&!Array.isArray(e))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(e)&&(this.scaleTypes[t]===H.LINEAR||this.scaleTypes[t]===H.TIME)&&2!==e.length)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return e}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=[N.BOTTOM,N.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find((e=>t.indexOf(e)>-1))}getMainYAxisPosition(){const t=[N.LEFT,N.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find((e=>t.indexOf(e)>-1))}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,e,n,i){const r=this.model.getOptions(),o=uc(r,"axes")[n],{mapsTo:s}=o,a=null!==uc(i,s)?i[s]:i;let l;switch(e){case H.LABELS:l=t(a)+t.step()/2;break;case H.TIME:l=t(new Date(a));break;default:l=t(a)}return l}getBoundedScaledValues(t){const{bounds:e}=this.model.getOptions(),n=this.getRangeAxisPosition({datum:t}),i=this.scales[n],r=this.model.getOptions(),o=uc(r,"axes")[n],{mapsTo:s}=o,a=void 0!==t[s]?t[s]:t;return[i(null!==uc(t,e.upperBoundMapsTo)?t[e.upperBoundMapsTo]:a),i(null!==uc(t,e.lowerBoundMapsTo)?t[e.lowerBoundMapsTo]:a)]}getValueThroughAxisPosition(t,e){const n=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,n,t,e)}getDomainValue(t){const e=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(e,t)}getRangeValue(t){const e=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(e,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const e=this.model.getOptions();return uc(e,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const e=this.model.getOptions();return uc(e,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,e){const n=this.model.getOptions(),i=uc(n,"axes",t);return i.scaleType===H.TIME?function(t,e){const n=new Date(t[0]),i=new Date(t[1]);return function(t,e){const[n,i]=ht(0,t,e),r=Dv(n,i),o=Math.abs(function(t,e){const[n,i]=ht(0,t,e);return n.getFullYear()-i.getFullYear()}(n,i));n.setFullYear(1584),i.setFullYear(1584);const s=r*(o-+(Dv(n,i)===-r));return 0===s?0:s}(i,n)>1?[Iv(n,e),Rv(i,e)]:Nv(i,n)>1?[Pv(n,e),Lv(i,e)]:function(t,e){const[n,i]=ht(0,t,e),r=Uv(n,i),o=Math.abs(gc(n,i));n.setDate(n.getDate()-r*o);const s=r*(o-+(Uv(n,i)===-r));return 0===s?0:s}(i,n)>1?[Hv(n,e),Bv(i,e)]:function(t,e){const[n,i]=ht(0,t,e),r=(+n-+i)/lt;return Fv()(r)}(i,n)>1?[jv(n,e),$v(i,e)]:Gv(i,n)>30?[Yv(n,30*e),Wv(i,30*e)]:Gv(i,n)>1?[Yv(n,e),Wv(i,e)]:Zv(i,n)>15?[qv(n,15*e),Xv(i,15*e)]:Zv(i,n)>1?[qv(n,e),Xv(i,e)]:[n,i]}(e,uc(n,"timeScale","addSpaceOnEdges")):function([t,e],n,i){const r=(e-t)*n,o=e<=0&&e+r>0?0:e+r;let s=t>=0&&t-r<0?0:t-r;if(i===H.LOG&&s<=0){if(t<=0)throw Error("Data must have values greater than 0 if log scale type is used.");s=t}return[s,o]}(e,.1,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),e=uc(t,"axes"),n=this.isDualAxes();return null===uc(e,N.LEFT)&&null!==uc(e,N.RIGHT)||!0===uc(e,N.RIGHT,"main")||n&&uc(e,N.LEFT,"correspondingDatasets")?{primary:N.RIGHT,secondary:N.LEFT}:{primary:N.LEFT,secondary:N.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),e=uc(t,"axes"),n=this.isDualAxes();return null===uc(e,N.BOTTOM)&&null!==uc(e,N.TOP)||!0===uc(e,N.TOP,"main")||n&&uc(e,N.BOTTOM,"correspondingDatasets")?{primary:N.TOP,secondary:N.BOTTOM}:{primary:N.BOTTOM,secondary:N.TOP}}findDomainAndRangeAxesPositions(t,e){const n=this.model.getOptions(),i=uc(n,"axes",t.primary),r=uc(n,"axes",e.primary),o=i.scaleType||H.LINEAR,s=r.scaleType||H.LINEAR,a={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return a.primaryDomainAxisPosition=e.primary,a.primaryRangeAxisPosition=t.primary,a.secondaryDomainAxisPosition=e.secondary,a.secondaryRangeAxisPosition=t.secondary,(!(s===H.LABELS||s===H.TIME)&&o===H.LABELS||o===H.TIME)&&(a.primaryDomainAxisPosition=t.primary,a.primaryRangeAxisPosition=e.primary,a.secondaryDomainAxisPosition=t.secondary,a.secondaryRangeAxisPosition=e.secondary),a}getScaleDomain(t){const e=this.model.getOptions(),n=uc(e,"axes",t),i=uc(e,"bounds"),{includeZero:r}=n,o=uc(n,"scaleType")||H.LINEAR;if(this.model.isDataEmpty())return[];if(n.binned){const{bins:t}=this.model.getBinConfigurations();return[0,yr(t,(t=>t.length))]}if(n.limitDomainToBins){const{bins:t}=this.model.getBinConfigurations(),e=this.model.getStackKeys({bins:t});return[e[0].split(":")[0],e[e.length-1].split(":")[1]]}const s=this.model.getDisplayData(),{extendLinearDomainBy:a,mapsTo:l,percentage:c,thresholds:u}=n,{reference:h,compareTo:d}=hl;if(n.domain)return o===H.LABELS?n.domain:(o===H.TIME&&(n.domain=n.domain.map((t=>void 0===t.getTime?new Date(t):t))),this.extendsDomain(t,n.domain));if(c)return[0,100];if(n&&o===H.LABELS)return tr(s.map((t=>t[l])));let f,p;const g=this.model.getDataGroupNames();if(o===H.LABELS_RATIO)return s.map((t=>`${t[h]}/${t[d]}`));if(o===H.TIME)p=s.map((t=>+new Date(t[l])));else if(i&&e.axes)p=[],s.forEach((t=>{p.push(t[l]),t[i.upperBoundMapsTo]&&p.push(t[i.upperBoundMapsTo]),t[i.lowerBoundMapsTo]&&p.push(t[i.lowerBoundMapsTo])}));else if(!0===n.stacked&&g&&t===this.getRangeAxisPosition()){const{groupMapsTo:t}=e.data,n=this.model.getDataValuesGroupedByKeys({groups:g}),i=s.filter((e=>!g.includes(e[t]))),r=[];n.forEach((t=>{const{...e}=t;let n=0,i=0;Object.values(Iy(e,"sharedStackKey")).forEach((t=>{isNaN(t)||(t<0?i+=t:n+=t)})),r.push([i,n])})),p=[...ky(r),...i.map((t=>t[l]))]}else p=[],s.forEach((t=>{const e=t[l];Array.isArray(e)&&2===e.length?(p.push(e[0]),p.push(e[1])):(a&&p.push(Math.max(t[l],t[a])),p.push(e))}));return o!==H.TIME&&o!==H.LOG&&r&&p.push(0),u&&u.length>0&&u.forEach((t=>{const e=uc(t,"value");null!==e&&p.push(e)})),f=sr(p),f=this.extendsDomain(t,f),f}createScale(t){const e=this.model.getOptions(),n=uc(e,"axes",t);if(!n)return null;const i=uc(n,"scaleType")||H.LINEAR;let r;return this.scaleTypes[t]=i,r=i===H.TIME?Ud():i===H.LOG?zy().base(n.base||10):i===H.LABELS||i===H.LABELS_RATIO?Eu():ol(),r.domain(this.getScaleDomain(t)),r}getDomainLowerBound(t){let e,n=0;return e=this.getOrientation()===B.VERTICAL?this.getMainYScale().domain():this.getMainXScale().domain(),!1===uc(this.model.getOptions(),"axes",t,"includeZero")&&e[0]>0&&e[1]>0&&(n=e[0]),n}getHighestDomainThreshold(){const t=uc(this.model.getOptions(),"axes"),e=this.getDomainAxisPosition(),{thresholds:n}=t[e];if(!Array.isArray(n)||Array.isArray(n)&&!n.length)return null;const i=this.getDomainScale(),r=n.sort(((t,e)=>e.value-t.value))[0];return this.getScaleTypeByPosition(e)===H.TIME&&("string"==typeof r.value||void 0===r.value.getTime)&&(r.value=new Date(r.value)),{threshold:r,scaleValue:i(r.value)}}getHighestRangeThreshold(){const t=uc(this.model.getOptions(),"axes"),e=this.getRangeAxisPosition(),{thresholds:n}=t[e];if(!Array.isArray(n)||Array.isArray(n)&&!n.length)return null;const i=this.getRangeScale(),r=n.sort(((t,e)=>e.value-t.value))[0];return{threshold:r,scaleValue:i(r.value)}}}class Qv extends If{constructor(){super(...arguments),this.curveTypes={curveLinear:Kd,curveLinearClosed:tf,curveBasis:Vy,curveBasisClosed:Wy,curveBasisOpen:Zy,curveBundle:qy,curveCardinal:Jy,curveCardinalClosed:ev,curveCardinalOpen:iv,curveCatmullRom:sv,curveCatmullRomClosed:lv,curveCatmullRomOpen:uv,curveMonotoneX:vv,curveMonotoneY:_v,curveNatural:wv,curveStep:Tv,curveStepAfter:Ov,curveStepBefore:Sv}}getD3Curve(){let t="curveLinear";const e=this.model.getOptions().curve;if(e&&(t="string"==typeof e?e:e.name),this.curveTypes[t]){let n=this.curveTypes[t];return e&&Object.keys(e).forEach((t=>{n[t]&&(n=n[t](e[t]))})),n}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Jv extends If{isZoomBarEnabled(){if(!this.services.cartesianScales||!uc(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),e=uc(this.model.getOptions(),"axes",t,"scaleType");return t===N.BOTTOM&&e===H.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 e=t||this.services.zoom.getZoomBarData(),{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales undefined");const i=n.getMainXAxisPosition(),r=n.getDomainIdentifier(),o=uc(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(o)&&2===o.length)return o;if(!i)throw new Error("Not defined: mainXAxisPosition");return n.extendsDomain(i,sr(e,(t=>t[r])))}handleDomainChange(t,e={dispatchEvent:!0,type:"manual"}){this.model.set({zoomDomain:t},{animate:!1}),e.dispatchEvent&&this.services.events?.dispatchEvent(D.ZoomDomain.CHANGE,{newDomain:t,type:e.type})}getZoomRatio(){return uc(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,e){const n=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},e),r=uc(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&r&&n){const e=i.stacked?"sharedStackKey":this.services.cartesianScales?.getDomainIdentifier(),r=t.filter((t=>new Date(t[e])>=n[0]&&new Date(t[e])<=n[1]));if(r.length>0)return r}return t}zoomIn(t=this.getZoomRatio()){const e=this.model.get("zoomDomain"),n=wl.handleWidth,i=this.services.cartesianScales?.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const r=i(e[0]),o=i(e[1]);if(o-r<n+1)return;const s=i.range(),a=o-r,l=Math.min((s[1]-s[0])/2*(t/2),a/2);let c=r+l,u=o-l;c>=u&&(c=r+a/2-n/2,u=o-a/2+n/2);const h=[i.invert(c),i.invert(u)];(e[0].valueOf()!==h[0].valueOf()||e[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h,{dispatchEvent:!0,type:"in"})}zoomOut(t=this.getZoomRatio()){const e=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const n=this.services.cartesianScales.getMainXScale().copy();n.domain(this.getDefaultZoomBarDomain());const i=n(e[0]),r=n(e[1]),o=n.range(),s=(o[1]-o[0])/2*(t/2),a=Math.max(i-s,o[0]),l=Math.min(r+s,o[1]),c=[n.invert(a),n.invert(l)];(e[0].valueOf()!==c[0].valueOf()||e[1].valueOf()!==c[1].valueOf())&&this.handleDomainChange(c,{dispatchEvent:!0,type:"out"})}resetZoomDomain(){const t=this.model.get("zoomDomain"),e=this.getDefaultZoomBarDomain();(t[0].valueOf()!==e[0].valueOf()||t[1].valueOf()!==e[1].valueOf())&&this.handleDomainChange(e,{dispatchEvent:!0,type:"reset"})}isMinZoomDomain(){const t=this.model.get("zoomDomain"),e=this.getDefaultZoomBarDomain();return!(!t||!e)&&(t[1].valueOf()-t[0].valueOf())/(e[1].valueOf()-e[0].valueOf())<uc(this.model.getOptions(),"zoomBar","minZoomRatio")}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),e=this.getDefaultZoomBarDomain();return!(!t||!e||t[0].valueOf()!==e[0].valueOf()||t[1].valueOf()!==e[1].valueOf())}isEmptyState(){return 0===this.getZoomBarData().length}isZoomBarLoading(t){return uc(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return uc(this.model.getOptions(),"zoomBar",t,"locked")}}var t_=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function e_(t){return t_.test(t)}var n_="\\ud800-\\udfff",i_="["+n_+"]",r_="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o_="\\ud83c[\\udffb-\\udfff]",s_="[^"+n_+"]",a_="(?:\\ud83c[\\udde6-\\uddff]){2}",l_="[\\ud800-\\udbff][\\udc00-\\udfff]",c_="(?:"+r_+"|"+o_+")?",u_="[\\ufe0e\\ufe0f]?",h_=u_+c_+"(?:\\u200d(?:"+[s_,a_,l_].join("|")+")"+u_+c_+")*",d_="(?:"+[s_+r_+"?",r_,a_,l_,i_].join("|")+")",f_=RegExp(o_+"(?="+o_+")|"+d_+h_,"g");var p_=function(t){var e=e_(t=yn(t))?function(t){return e_(t)?function(t){return t.match(f_)||[]}(t):function(t){return t.split("")}(t)}(t):void 0,n=e?e[0]:t.charAt(0),i=e?function(t,e,n){var i=t.length;return Dy(t,1,n=void 0===n?i:n)}(e).join(""):t.slice(1);return n.toUpperCase()+i};hp((function(t,e,n){return e=e.toLowerCase(),t+(n?function(t){return p_(yn(t).toLowerCase())}(e):e)}));class g_{constructor(t,e){this.components=[],this.services={canvasZoom:Mv,domUtils:Nf,events:Av,files:Cv,gradientUtils:Pf,transitions:kv},this.model=new uu(this.services)}init(t,e){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach((t=>{const e=this.services[t];this.services[t]=new e(this.model,this.services)})),this.services.events.addEventListener(D.Model.UPDATE,(t=>{const e=!!uc(t,"detail","animate");this.update(e)})),this.model.setData(e.data),this.services.events.addEventListener(D.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((t=>{this.services[t].update()})),this.components.forEach((e=>e.render(t)));const e=this.services.transitions.getPendingTransitions(),n=Object.keys(e).map((t=>e[t].end().catch((t=>t))));Promise.all(n).then((()=>this.services.events.dispatchEvent(D.Chart.RENDER_FINISHED)))}destroy(){this.components.forEach((t=>t.destroy())),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,e){const n=this.model.getOptions(),i=uc(n,"toolbar","enabled"),r={id:"legend",components:[new Gm(this.model,this.services)],growth:G.PREFERRED},o=uc(n,"canvasZoom","enabled");o&&!0===o&&t.push(new Ym(this.model,this.services));const s=!!this.model.getOptions().title,a={id:"title",components:[new Vm(this.model,this.services)],growth:G.STRETCH},l={id:"toolbar",components:[new Hm(this.model,this.services)],growth:G.PREFERRED},c={id:"header",components:[new zm(this.model,this.services,[a,...i?[l]:[]],{direction:V.ROW,alignItems:W.CENTER})],growth:G.PREFERRED},u={id:"graph-frame",components:t,growth:G.STRETCH,renderType:uc(e,"graphFrameRenderType")||L.SVG},h=!0!==uc(e,"excludeLegend")&&!1!==n.legend.enabled;let d=V.COLUMN;if(h){const t=uc(n,"legend","position");"left"===t?(d=V.ROW,n.legend.orientation||(n.legend.orientation=$.VERTICAL)):"right"===t?(d=V.ROW_REVERSE,n.legend.orientation||(n.legend.orientation=$.VERTICAL)):"bottom"===t&&(d=V.COLUMN_REVERSE)}const f={id:"spacer",components:[new $m(this.model,this.services)],growth:G.PREFERRED},p={id:"full-frame",components:[new zm(this.model,this.services,[...h?[r]:[],...h?[f]:[],u],{direction:d})],growth:G.STRETCH},g=[];if(s||i){g.push(c);const t={id:"spacer",components:[new $m(this.model,this.services,i?{size:15}:void 0)],growth:G.PREFERRED};g.push(t)}return g.push(p),[new Jm(this.model,this.services),new jm(this.model,this.services),new zm(this.model,this.services,g,{direction:V.COLUMN})]}}class m_ extends g_{constructor(t,e){super(t,e),this.services=Object.assign(this.services,{cartesianScales:Kv,curves:Qv,zoom:Jv}),this.model=new hu(this.services)}getAxisChartComponents(t,e){const n=this.model.getOptions(),i=uc(n,"zoomBar",N.TOP,"enabled"),r=uc(n,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const o=this.services.cartesianScales.getMainXAxisPosition(),s=uc(n,"axes",o,"scaleType"),a=i&&o===N.BOTTOM&&s===H.TIME,l=this.services.zoom.isZoomBarLocked(N.TOP),c=!!this.model.getOptions().title,u={id:"title",components:[new Vm(this.model,this.services)],growth:G.STRETCH},h={id:"toolbar",components:[new Hm(this.model,this.services)],growth:G.PREFERRED},d={id:"header",components:[new zm(this.model,this.services,[u,...r?[h]:[]],{direction:V.ROW,alignItems:W.CENTER})],growth:G.PREFERRED},f={id:"legend",components:[new Gm(this.model,this.services)],growth:G.PREFERRED};a&&!l&&t.push(new Wm(this.model,this.services),new ey(this.model,this.services)),t.push(new iy(this.model,this.services)),t.push(new ry(this.model,this.services));const p={id:"graph-frame",components:t,growth:G.STRETCH,renderType:L.SVG},g=!1!==uc(e,"legend","enabled")&&!1!==this.model.getOptions().legend.enabled;let m=V.COLUMN;if(g){const t=uc(this.model.getOptions(),"legend","position");t===F.LEFT?(m=V.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=$.VERTICAL)):t===F.RIGHT?(m=V.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=$.VERTICAL)):t===F.BOTTOM&&(m=V.COLUMN_REVERSE)}const y={id:"spacer",components:[new $m(this.model,this.services)],growth:G.PREFERRED},v={id:"full-frame",components:[new zm(this.model,this.services,[...g?[f]:[],...g?[y]:[],p],{direction:m})],growth:G.STRETCH},_={id:"zoom-bar",components:[new ny(this.model,this.services)],growth:G.PREFERRED,renderType:L.SVG},b=[];if(c||r){b.push(d);const t={id:"spacer",components:[new $m(this.model,this.services,r?{size:15}:void 0)],growth:G.PREFERRED};b.push(t)}return a&&b.push(_),b.push(v),[new oy(this.model,this.services),new jm(this.model,this.services),new zm(this.model,this.services,b,{direction:V.COLUMN})]}}q.LINE,q.SCATTER,q.AREA,q.STACKED_AREA,q.SIMPLE_BAR,q.GROUPED_BAR,q.STACKED_BAR;class y_ extends m_{constructor(t,e){super(t,e),this.model.setOptions(function(t,e){const n=Ti(t),i=Object.keys(e.axes||{});e?.toolbar?.controls&&delete n.toolbar.controls,0===i.length&&delete n.axes;for(const t in n.axes)if(i.includes(t)){const n=e.axes[t];if((n.primary||n.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/"),null==n.mapsTo){const t=n.scaleType;null==t?n.mapsTo="value":t===H.TIME?n.mapsTo="date":t===H.LABELS&&(n.mapsTo="key")}}else delete n.axes[t];return cc(n,e),qi(n,e)}(sc.lineChart,e.options)),this.init(t,e)}getComponents(){const t=[new yy(this.model,this.services),new hy(this.model,this.services),new fy(this.model,this.services),new dy(this.model,this.services),new py(this.model,this.services,{handleThresholds:!0}),new by(this.model,this.services),new _y(this.model,this.services)];return this.getAxisChartComponents(t)}}class v_ extends i.PureComponent{chart;chartRef=i.createRef();createChart(t,e,n){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 i.createElement("div",{ref:this.chartRef,className:"chart-holder"})}}class __ extends v_{createChart(t,e,n){return new y_(t,{data:e,options:n})}}var b_;b_||(b_=1,function(t){!function(){var e={}.hasOwnProperty;function n(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=r(t,i(n)))}return t}function i(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var i="";for(var o in t)e.call(t,o)&&t[o]&&(i=r(i,o));return i}function r(t,e){return e?t?t+" "+e:t+e:t}t.exports?(n.default=n,t.exports=n):window.classNames=n}()}({exports:{}}))},62945:t=>{var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},65387:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},65650:(t,e,n)=>{var i=n(78942).Symbol;t.exports=i},67642:(t,e,n)=>{var i=n(43301);t.exports=function(t){var e=i(t),n=e%1;return e==e?n?e-n:e:0}},69632:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var i=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==i||"symbol"!=i&&e.test(t))&&t>-1&&t%1==0&&t<n}},73501:t=>{t.exports=function(t,e,n){var i=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(r);++i<r;)o[i]=t[i+e];return o}},74535:(t,e,n)=>{var i=n(46285),r=n(36529),o=n(69632),s=n(41580);t.exports=function(t,e,n){if(!s(n))return!1;var a=typeof e;return!!("number"==a?r(n)&&o(e,n.length):"string"==a&&e in n)&&i(n[e],t)}},74967:(t,e,n)=>{var i="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=i},78942:(t,e,n)=>{var i=n(74967),r="object"==typeof self&&self&&self.Object===Object&&self,o=i||r||Function("return this")();t.exports=o},80547:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},86403:(t,e,n)=>{var i=n(62945),r=/^\s+/;t.exports=function(t){return t?t.slice(0,i(t)+1).replace(r,""):t}},87379:(t,e,n)=>{var i=n(65650),r=n(8870),o=n(29005),s=i?i.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?r(t):o(t)}},88126:(t,e,n)=>{var i=n(73501),r=n(74535),o=n(67642),s=Math.ceil,a=Math.max;t.exports=function(t,e,n){e=(n?r(t,e,n):void 0===e)?1:a(o(e),0);var l=null==t?0:t.length;if(!l||e<1)return[];for(var c=0,u=0,h=Array(s(l/e));c<l;)h[u++]=i(t,c,c+=e);return h}},93655:(t,e,n)=>{var i=n(87379),r=n(41580);t.exports=function(t){if(!r(t))return!1;var e=i(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}}]);
|